Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

require('fetch-everywhere');

var _fetch = require('../../helpers/fetch.js');

var API = {
  me: function me(token, options) {
    return fetch(options.url + '/me', {
      headers: {
        Accept: 'application/json',
        'Access-Token': token
      }
    }).catch(_fetch.errorHandler).then(_fetch.responseHandler);
  },
  loadTheme: function loadTheme(token, mandatorId, options) {
    return fetch(options.premiumUrl + '/themes/' + mandatorId, {
      method: 'GET',
      headers: {
        Accept: 'application/json',
        'Access-Token': token
      }
    }).catch(_fetch.errorHandler).then(_fetch.responseHandler);
  },
  loadBranding: function loadBranding(token, mandatorId, options) {
    return fetch(options.url + '/me/branding/' + mandatorId, {
      method: 'GET',
      headers: {
        Accept: 'application/json',
        'Access-Token': token
      }
    }).catch(_fetch.errorHandler).then(_fetch.responseHandler);
  },
  tokenFromCookie: function tokenFromCookie(cookie, options) {
    return fetch(options.url + '/access-token-from-cookie', {
      method: 'POST',
      headers: {
        Accept: 'application/json',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(cookie)
    }).catch(_fetch.errorHandler).then(_fetch.responseHandler);
  },
  resendActivation: function resendActivation(id, email, options) {
    return fetch(options.url + '/resend-activation', {
      method: 'POST',
      headers: {
        Accept: 'application/json',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ id: id, email: email })
    }).catch(_fetch.errorHandler).then(_fetch.responseHandler);
  }
};

exports.default = API;