Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

itslanguage

Package Overview
Dependencies
Maintainers
4
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

itslanguage - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

36

administrative-sdk/connection/connection-controller.js

@@ -357,4 +357,3 @@ 'use strict';

* @param {BasicAuth} basicAuth - Basic Auth to obtain credentials from.
* @param {string} organisationId - Id of the organisation to request a token for.
* @param {string} userId - Id of the user to request a token for.
* @param {string} [scopes] - The scopes which should be availible for the requested token.
* @returns {Promise} Promise containing a access_token, token_type and scope.

@@ -365,16 +364,16 @@ * @throws {Promise.<Error>} If the server returned an error.

Connection.prototype.getOauth2Token = function getOauth2Token(basicAuth, organisationId, userId) {
Connection.prototype.getOauth2Token = function getOauth2Token(basicAuth, scopes) {
var _this4 = this;
var url = this._settings.apiUrl + '/tokens';
var scopes = 'tenant/' + basicAuth.tenantId;
if (organisationId) {
scopes += '/organisation/' + organisationId;
}
if (organisationId && userId) {
scopes += '/user/' + userId;
}
var headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded; charset=utf8');
var formData = 'grant_type=password&scope=' + scopes + '&username=' + basicAuth.principal + '&password=' + basicAuth.credentials;
var formData = 'grant_type=password' + '&username=' + basicAuth.principal + '&password=' + basicAuth.credentials;
if (scopes) {
formData += '&scope=' + scopes;
}
var options = {

@@ -385,2 +384,3 @@ method: 'POST',

};
return fetch(url, options).then(function (response) {

@@ -400,2 +400,4 @@ return response.json().then(function (data) {

*
* This method also generates the appropriate scope for the given params.
*
* @param {BasicAuth} basicAuth - Basic Auth to obtain credentials from.

@@ -407,3 +409,11 @@ * @param {string} organisationId - Id of the organisation this user is part of.

Connection.prototype.getUserAuth = function getUserAuth(basicAuth, organisationId) {
return this.getOauth2Token(basicAuth, organisationId, basicAuth.principal);
var scopes = 'tenant/' + basicAuth.tenantId;
if (organisationId) {
scopes += '/organisation/' + organisationId;
if (basicAuth.principal) {
scopes += '/user/' + basicAuth.principal;
}
}
return this.getOauth2Token(basicAuth, scopes);
};

@@ -415,2 +425,2 @@

exports.default = Connection;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9hZG1pbmlzdHJhdGl2ZS1zZGsvY29ubmVjdGlvbi9jb25uZWN0aW9uLWNvbnRyb2xsZXIuanMiXSwibmFtZXMiOlsiQ29ubmVjdGlvbiIsIm9wdGlvbnMiLCJfc2V0dGluZ3MiLCJPYmplY3QiLCJhc3NpZ24iLCJhcGlVcmwiLCJvQXV0aDJUb2tlbiIsIndzVXJsIiwid3NUb2tlbiIsIl9zZGtDb21wYXRpYmlsaXR5IiwiX2FuYWx5c2lzSWQiLCJfcmVjb3JkaW5nSWQiLCJfcmVjb2duaXRpb25JZCIsIl9lbWl0dGVyIiwiX2Nvbm5lY3Rpb24iLCJhZGRFdmVudExpc3RlbmVyIiwibmFtZSIsImhhbmRsZXIiLCJvbiIsInJlbW92ZUV2ZW50TGlzdGVuZXIiLCJvZmYiLCJmaXJlRXZlbnQiLCJhcmdzIiwiZW1pdCIsIl9nZXRBdXRoSGVhZGVycyIsIlByb21pc2UiLCJyZWplY3QiLCJhdXRoSGVhZGVyIiwicmVzb2x2ZSIsIndlYlNvY2tldENvbm5lY3QiLCJzZWxmIiwib25PQXV0aDJDaGFsbGVuZ2UiLCJzZXNzaW9uIiwibWV0aG9kIiwiRXJyb3IiLCJhdXRoVXJsIiwiY29ubmVjdGlvbiIsInVybCIsInJlYWxtIiwiYXV0aG1ldGhvZHMiLCJhdXRoaWQiLCJkZXRhaWxzIiwidGlja2V0Iiwib25jaGFsbGVuZ2UiLCJlIiwiY29uc29sZSIsImxvZyIsIm9uZXJyb3IiLCJvbm9wZW4iLCJfc2Vzc2lvbiIsIm9uY2xvc2UiLCJvcGVuIiwiY2FsbCIsInJwYyIsImR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gICBoZWFkZXJzLFxuICAgICAgYm9keTogZm9ybURhdGFcbiAgICB9O1xuICAgIHJldHVybiBmZXRjaCh1cmwsIG9wdGlvbnMpXG4gICAgICAudGhlbihyZXNwb25zZSA9PlxuICAgICAgICByZXNwb25zZS5qc29uKClcbiAgICAgICAgICAudGhlbihkYXRhID0+IHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZS5vaykge1xuICAgICAgICAgICAgICB0aGlzLl9zZXR0aW5ncy5vQXV0aDJUb2tlbiA9IGRhdGEuYWNjZXNzX3Rva2VuO1xuICAgICAgICAgICAgICByZXR1cm4gZGF0YTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IGRhdGE7XG4gICAgICAgICAgfSlcbiAgICAgICk7XG4gIH1cblxuICAvKipcbiAgICogUmVxdWVzdCBhdXRoZW50aWNhdGlvbiBmb3IgYSB7QGxpbmsgVXNlcn0uIFRoZSBiYXNpY0F1dGggbm93IGNvbnRhaW5zIHRoZSB1c2VyJ3MgdXNlcm5hbWUgYW5kIHBhc3N3b3JkLlxuICAgKlxuICAgKiBAcGFyYW0ge0Jhc2ljQXV0aH0gYmFzaWNBdXRoIC0gQmFzaWMgQXV0aCB0byBvYnRhaW4gY3JlZGVudGlhbHMgZnJvbS5cbiAgICogQHBhcmFtIHtzdHJpbmd9IG9yZ2FuaXNhdGlvbklkIC0gSWQgb2YgdGhlIG9yZ2FuaXNhdGlvbiB0aGlzIHVzZXIgaXMgcGFydCBvZi5cbiAgICovXG4gIGdldFVzZXJBdXRoKGJhc2ljQXV0aCwgb3JnYW5pc2F0aW9uSWQpIHtcbiAgICByZXR1cm4gdGhpcy5nZXRPYXV0aDJUb2tlbihiYXNpY0F1dGgsIG9yZ2FuaXNhdGlvbklkLCBiYXNpY0F1dGgucHJpbmNpcGFsKTtcbiAgfVxufVxuIl19
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL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0dXJuZWQgYW4gZXJyb3IuXG4gICAqL1xuICBnZXRPYXV0aDJUb2tlbihiYXNpY0F1dGgsIHNjb3Blcykge1xuICAgIGNvbnN0IHVybCA9IHRoaXMuX3NldHRpbmdzLmFwaVVybCArICcvdG9rZW5zJztcblxuICAgIGNvbnN0IGhlYWRlcnMgPSBuZXcgSGVhZGVycygpO1xuICAgIGhlYWRlcnMuYXBwZW5kKCdDb250ZW50LVR5cGUnLCAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkOyBjaGFyc2V0PXV0ZjgnKTtcblxuICAgIGxldCBmb3JtRGF0YSA9ICdncmFudF90eXBlPXBhc3N3b3JkJyArXG4gICAgICAnJnVzZXJuYW1lPScgKyBiYXNpY0F1dGgucHJpbmNpcGFsICtcbiAgICAgICcmcGFzc3dvcmQ9JyArIGJhc2ljQXV0aC5jcmVkZW50aWFscztcblxuICAgIGlmIChzY29wZXMpIHtcbiAgICAgIGZvcm1EYXRhICs9ICcmc2NvcGU9JyArIHNjb3BlcztcbiAgICB9XG5cbiAgICBjb25zdCBvcHRpb25zID0ge1xuICAgICAgbWV0aG9kOiAnUE9TVCcsXG4gICAgICBoZWFkZXJzLFxuICAgICAgYm9keTogZm9ybURhdGFcbiAgICB9O1xuXG4gICAgcmV0dXJuIGZldGNoKHVybCwgb3B0aW9ucylcbiAgICAgIC50aGVuKHJlc3BvbnNlID0+XG4gICAgICAgIHJlc3BvbnNlLmpzb24oKVxuICAgICAgICAgIC50aGVuKGRhdGEgPT4ge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlLm9rKSB7XG4gICAgICAgICAgICAgIHRoaXMuX3NldHRpbmdzLm9BdXRoMlRva2VuID0gZGF0YS5hY2Nlc3NfdG9rZW47XG4gICAgICAgICAgICAgIHJldHVybiBkYXRhO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgZGF0YTtcbiAgICAgICAgICB9KVxuICAgICAgKTtcbiAgfVxuXG4gIC8qKlxuICAgKiBSZXF1ZXN0IGF1dGhlbnRpY2F0aW9uIGZvciBhIHtAbGluayBVc2VyfS4gVGhlIGJhc2ljQXV0aCBub3cgY29udGFpbnMgdGhlIHVzZXIncyB1c2VybmFtZSBhbmQgcGFzc3dvcmQuXG4gICAqXG4gICAqIFRoaXMgbWV0aG9kIGFsc28gZ2VuZXJhdGVzIHRoZSBhcHByb3ByaWF0ZSBzY29wZSBmb3IgdGhlIGdpdmVuIHBhcmFtcy5cbiAgICpcbiAgICogQHBhcmFtIHtCYXNpY0F1dGh9IGJhc2ljQXV0aCAtIEJhc2ljIEF1dGggdG8gb2J0YWluIGNyZWRlbnRpYWxzIGZyb20uXG4gICAqIEBwYXJhbSB7c3RyaW5nfSBvcmdhbmlzYXRpb25JZCAtIElkIG9mIHRoZSBvcmdhbmlzYXRpb24gdGhpcyB1c2VyIGlzIHBhcnQgb2YuXG4gICAqL1xuICBnZXRVc2VyQXV0aChiYXNpY0F1dGgsIG9yZ2FuaXNhdGlvbklkKSB7XG4gICAgbGV0IHNjb3BlcyA9ICd0ZW5hbnQvJyArIGJhc2ljQXV0aC50ZW5hbnRJZDtcbiAgICBpZiAob3JnYW5pc2F0aW9uSWQpIHtcbiAgICAgIHNjb3BlcyArPSAnL29yZ2FuaXNhdGlvbi8nICsgb3JnYW5pc2F0aW9uSWQ7XG4gICAgICBpZiAoYmFzaWNBdXRoLnByaW5jaXBhbCkge1xuICAgICAgICBzY29wZXMgKz0gJy91c2VyLycgKyBiYXNpY0F1dGgucHJpbmNpcGFsO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB0aGlzLmdldE9hdXRoMlRva2VuKGJhc2ljQXV0aCwgc2NvcGVzKTtcbiAgfVxufVxuIl19

@@ -57,2 +57,3 @@ 'use strict';

this.stream = inputStream;
this.willAnimate = true;
}

@@ -113,5 +114,3 @@

var analyserNode = this.analyserNode;
var willAnimate = this.willAnimate = {
anim: true
};
var volumeMeter = this;
var skippedCallbacks = 0;

@@ -137,3 +136,3 @@ var lastVolume = -1;

if (willAnimate.anim) {
if (volumeMeter.willAnimate) {
requestAnimationFrame(animloop);

@@ -177,5 +176,14 @@ } else {

VolumeMeter.prototype.stopAnalyser = function stopAnalyser() {
this.willAnimate.anim = false;
this.willAnimate = false;
};
/**
* Start calculating the volume.
*/
VolumeMeter.prototype.resumeAnalyser = function resumeAnalyser() {
this.willAnimate = true;
};
return VolumeMeter;

@@ -185,2 +193,2 @@ }();

exports.default = VolumeMeter;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hdWRpby9hdWRpby10b29scy5qcyJdLCJuYW1lcyI6WyJnZW5lcmF0ZVdhdmVTYW1wbGUiLCJkdXJhdGlvbiIsImVmZmVjdCIsInNhbXBsZVJhdGUiLCJsb29wcyIsImkiLCJNYXRoIiwicm91bmQiLCJjb3MiLCJzaW4iLCJ3YXZlIiwiY2hhbm5lbHMiLCJyYXRlIiwiZGVwdGgiLCJ0b1dhdiIsImVuY29kZSIsIlZvbHVtZU1ldGVyIiwiYXVkaW9Db250ZXh0IiwiaW5wdXRTdHJlYW0iLCJzdHJlYW0iLCJnZXRWb2x1bWVJbmRpY2F0aW9uIiwiY2FsbGJhY2siLCJhcmdzIiwiRXJyb3IiLCJBcnJheSIsInZvbHVtZUluZGljYXRpb25DYWxsYmFjayIsInZvbHVtZUluZGljYXRpb25DYWxsYmFja0FyZ3MiLCJhbmFseXNlck5vZGUiLCJjcmVhdGVBbmFseXNlciIsImZmdFNpemUiLCJjb25uZWN0IiwiX3VwZGF0ZUFuYWx5c2VycyIsIl9nZXRBdmVyYWdlVm9sdW1lIiwiYXJyYXkiLCJ2YWx1ZXMiLCJsZW5ndGgiLCJhdmVyYWdlIiwid2lsbEFuaW1hdGUiLCJhbmltIiwic2tpcHBlZENhbGxiYWNrcyIsImxhc3RWb2x1bWUiLCJhbmltbG9vcCIsInJlcXVlc3RBbmltYXRpb25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sbGluZyBiZWZvcmUgdXNlZnVsXG4gICAgICAgIC8vIHZhbHVlcyBiZWNvbWUgYXZhaWxhYmxlLiA1IHNlZW1zIHRvIGJlIHRoZSBtYWdpYyBudW1iZXIuXG4gICAgICAgIGlmIChza2lwcGVkQ2FsbGJhY2tzIDwgNSkge1xuICAgICAgICAgIHNraXBwZWRDYWxsYmFja3MgKz0gMTtcbiAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gY2IoYXJncyk7XG4gICAgICB9KTtcbiAgICB9XG4gIH1cblxuICAvKipcbiAgICogU3RvcCBjYWxjdWxhdGluZyB0aGUgdm9sdW1lLlxuICAgKi9cbiAgc3RvcEFuYWx5c2VyKCkge1xuICAgIHRoaXMud2lsbEFuaW1hdGUgPSBmYWxzZTtcbiAgfVxuXG4gIC8qKlxuICAgKiBTdGFydCBjYWxjdWxhdGluZyB0aGUgdm9sdW1lLlxuICAgKi9cbiAgcmVzdW1lQW5hbHlzZXIoKSB7XG4gICAgdGhpcy53aWxsQW5pbWF0ZSA9IHRydWU7XG4gIH1cbn1cbiJdfQ==
{
"name": "itslanguage",
"version": "2.2.0",
"version": "2.3.0",
"description": "The core JavaScript SDK for ITSLanguage.",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc