<!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 += "/activity-spec-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>
