<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>API Docs</title>
  <link rel="SHORTCUT ICON" href="images/favicon.ico"/>
  <link href='css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
  <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
  <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
  <!--Custom: Take from application\frontend\nfv-client\dist\optimize\resources\nfv\css\style.css-->
  <link href='css/ncso-style.css' rel='stylesheet' type='text/css'/>
  <!--/Custom: Take from application\frontend\nfv-client\dist\optimize\resources\nfv\css\style.css-->

  <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
  <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
  <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
  <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
  <script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
  <script src='lib/underscore-min.js' type='text/javascript'></script>
  <script src='lib/backbone-min.js' type='text/javascript'></script>
  <script src='swagger-ui.js' type='text/javascript'></script>
  <script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
  <script src='lib/marked.js' type='text/javascript'></script>
  <script src='lib/swagger-oauth.js' type='text/javascript'></script>

  <!-- Some basic translations -->
  <!-- <script src='lang/translator.js' type='text/javascript'></script> -->
  <!-- <script src='lang/ru.js' type='text/javascript'></script> -->
  <!-- <script src='lang/en.js' type='text/javascript'></script> -->

  <script type="text/javascript">
    $(function () {
      var url = window.location.protocol + "//" + window.location.host;
      if (window.location.pathname.indexOf('/api-docs') > 0) {
        url += window.location.pathname.substring(0, window.location.pathname.indexOf('/api-docs'))
      }
      url += "/api-docs/api.json";
      log('API URL: ' + url);

      // Pre load translate...
      if(window.SwaggerTranslator) {
        window.SwaggerTranslator.translate();
      }
      window.swaggerUi = new SwaggerUi({
        url: url,
        dom_id: "swagger-ui-container",
        supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
        onComplete: function(swaggerApi, swaggerUi){
          if(typeof initOAuth == "function") {
            initOAuth({
              clientId: "your-client-id",
              clientSecret: "your-client-secret",
              realm: "your-realms",
              appName: "your-app-name", 
              scopeSeparator: ","
            });
          }

          if(window.SwaggerTranslator) {
            window.SwaggerTranslator.translate();
          }

          $('pre code').each(function(i, e) {
            hljs.highlightBlock(e)
          });

        },
        onFailure: function(data) {
          log("Unable to Load SwaggerUI");
        },
        docExpansion: "none",
        apisSorter: "alpha",
        showRequestHeaders: false
      });


      window.swaggerUi.load();

      function log() {
        if ('console' in window) {
          console.log.apply(console, arguments);
        }
      }
  });
  </script>

    <!-- Hide the swagger io  -->
    <style>
        .footer a, .footer img{
            display: none !important;
        }
    </style>
</head>

<body class="swagger-section">

<!--NCSO script-->
<script>

  //SET TITLE - START
  function pollData() {
    if(!(document.querySelector('#api_info .info_title') && document.querySelector('#api_info .info_title').innerText)) {
      setTimeout(pollData, 50);
    }
    else {
      setData();
    }
  }

  function setData() {
    document.querySelector('[data-uxf-point="main-title"]').innerText = document.querySelector('#api_info .info_title').innerText;
    document.querySelector('#api_info .info_title').innerText = '';
  }

  pollData();
  //SET TITLE - END

  var __LOGIN_REST_STATUS = {OPEN: 'OPEN', SEND: 'SEND'};
  var __loginPath = '/auth/tokens', __isLoginInProcess, __xAuthToken;

  function isAuthanticationRest(path) {
      return path.endsWith(__loginPath);
  }

  //Proxy requests - START

  //Proxy Open Method
  (function() {
      var proxiedOpen = window.XMLHttpRequest.prototype.open;
      window.XMLHttpRequest.prototype.open = function(method, path) {
          if(isAuthanticationRest(path)) {
              __isLoginInProcess = true;
          }
          else {
              __isLoginInProcess = false;
          }
          return proxiedOpen.apply(this, Array.prototype.slice.call(arguments));
      };
  })();

  //Proxy Send Method - X-AUTH-STUFF
  (function() {
      var proxiedSend = window.XMLHttpRequest.prototype.send;
      window.XMLHttpRequest.prototype.send = function() {
          if(__isLoginInProcess) {
              proxyAuthanticationCallback(this);
          }
          return proxiedSend.apply(this, Array.prototype.slice.call(arguments));
      };
  })();

  //Proxy Authantication Callback Method - X-AUTH-STUFF
  function proxyAuthanticationCallback(xhrObject) {
      var proxy = xhrObject.onreadystatechange;
      xhrObject.onreadystatechange = function() {
          if (xhrObject.readyState == 4) {
              if(xhrObject.status == 200 || xhrObject.status == 401) {
                  window.swaggerUi.api.clientAuthorizations.remove('X-AUTH-TOKEN');
                  if(xhrObject.status == 200) {
                      var key = xhrObject.getResponseHeader('x-auth-token');
                      if(key && key.trim() != "") {
                          var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("X-AUTH-TOKEN", key, "header");
                          window.swaggerUi.api.clientAuthorizations.add("X-AUTH-TOKEN", apiKeyAuth);
                          console.log("added x-auth-key ", key);
                      }
                  }
              }
          }
          return proxy.apply(xhrObject, Array.prototype.slice.call(arguments));
      }
  }

  //Proxy Send Method - CUSTOM HEADERS STUFF
  (function () {
      var proxiedSend = window.XMLHttpRequest.prototype.send;
      window.XMLHttpRequest.prototype.send = function () {
          var headerItems = document.querySelectorAll('.custom-headers .headers-list .header-item');
          if (headerItems) {
              Array.prototype.forEach.call(headerItems, function (header) {
                  var headerName = header.querySelector('.header-name').value;
                  var headerValue = header.querySelector('.header-value').value;
                  if (headerName && headerValue) {
                      this.setRequestHeader(headerName, headerValue);
                  }
              }, this);
          }
          return proxiedSend.apply(this, Array.prototype.slice.call(arguments));
      };
  })();

  //Proxy requests - END

</script>

<div data-uxf-point="nfv-header" class="nfv-header">
  <div class="header-content-wrapper">
    <div data-uxf-point="nfv-logo" class="nfv-logo"><a href="../ncso/landingpage.html">VENDOR</a></div>
    <div data-uxf-point="header-title" class="header-title">
      <div data-uxf-point="main-title" class="main-title"></div>
      <div data-uxf-point="version-controller" class="version-select"></div>
      <div data-uxf-point="sub-title" class="sub-title"></div>
    </div>
  </div>
</div>

<div class="custom-headers">
    <style>
        .custom-headers {
            margin-left: 124px;
            width: 500px;
            border: 1px solid #419EF1;
        }

        .custom-headers .headers-title {
            background-color: #0F6AB4;
            height: 24px;
            color: white;
            text-align: center;
            font-size: 1.2em;
        }

        .custom-headers .headers-list .header-item {
            display: flex;
            justify-content: space-around;
            padding: 10px 5px 0 5px;
        }

        .custom-headers .headers-list .header-item.default-item .header-col.header-delete {
            visibility: hidden;
        }

        .custom-headers .headers-list .header-item.default-item .header-col.header-name {
            pointer-events: none;
        }

        .custom-headers .headers-list .header-item .header-col.header-delete {
            cursor: pointer;
            align-self: center;
        }

        .custom-headers .add-header {
            text-align: right;
            padding: 5px;
            border-top: 1px solid #0F6AB4;
            margin-top: 10px;
            background-color: #E7F6EC;
        }

        .custom-headers .add-header .add-header-button, .custom-headers .add-header .reset-header-button {

            text-decoration: none;
            color: white;
            display: inline-block;
            width: 50px;
            font-size: 0.9em;
            text-align: center;
            padding: 7px 0 4px;
            -moz-border-radius: 2px;
            -webkit-border-radius: 2px;
            -o-border-radius: 2px;
            -ms-border-radius: 2px;
            -khtml-border-radius: 2px;
            border-radius: 2px;
            background-color: #0f6ab4;
            cursor: pointer;
        }

        .custom-headers .add-header .reset-header-button {

        }
    </style>
    <div class="headers-title">Custom Headers</div>
    <div class="headers-list">
        <!--Dynamically add headers using addHeaderItem function-->
    </div>
    <div class="add-header">
        <span class="reset-header-button" onclick="resetHeaderItems();">Reset</span>
        <span class="add-header-button" onclick="addHeaderItem();">Add</span>
    </div>
    <script>
        function addHeaderItem(defaultName, defaultValue) {

            var headerItemName = document.createElement('input');
            headerItemName.type = 'text';
            headerItemName.value = defaultName || '';
            headerItemName.classList.add('header-col', 'header-name');

            var headerItemValue = document.createElement('input');
            headerItemValue.type = 'text';
            headerItemValue.value = defaultValue || '';
            headerItemValue.classList.add('header-col', 'header-value');

            var headerItemDelete = document.createElement('div');
            headerItemDelete.innerHTML = '&#10006;';
            headerItemDelete.classList.add('header-col', 'header-delete');

            var headerItem = document.createElement('div');
            headerItem.classList.add('header-item');
            headerItem.appendChild(headerItemName);
            headerItem.appendChild(headerItemValue);
            headerItem.appendChild(headerItemDelete);

            headerItemDelete.onclick = function () {
                headersList.removeChild(headerItem);
            };

            var headersList = document.querySelector('.custom-headers .headers-list');
            headersList.appendChild(headerItem);

            return headerItem;
        }
        function resetHeaderItems() {
            var headersList = document.querySelector('.custom-headers .headers-list');
            while (headersList.firstChild) {
                headersList.removeChild(headersList.firstChild);
            }
            var defaultHeaderItem = addHeaderItem('USER_ID');
            defaultHeaderItem.classList.add('default-item');
        }
        resetHeaderItems();
    </script>
</div>
<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
</body>
</html>
