Socket
Socket
Sign inDemoInstall

@ringcentral/sdk

Package Overview
Dependencies
10
Maintainers
2
Versions
121
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1-comments.8795033128.260.0 to 0.0.1-comments.8845882619.266.0

4

package.json
{
"name": "@ringcentral/sdk",
"version": "0.0.1-comments.8795033128.260.0+3177576",
"version": "0.0.1-comments.8845882619.266.0+e16ec52",
"scripts": {

@@ -70,3 +70,3 @@ "postinstall": "npx playwright install",

},
"gitHead": "31775763e4bca460c2e874cb751a3aba6e18b04a"
"gitHead": "e16ec521caee41742219e836a1eda06080e92dbb"
}

@@ -128,5 +128,3 @@ import {EventEmitter} from 'events';

// Sanity checks
if (!init.url) {
throw new Error('Url is not defined');
}
if (!init.url) {throw new Error('Url is not defined');}
if (!init.method) {

@@ -218,9 +216,5 @@ init.method = 'GET';

boundary = this.getContentType(response).match(/boundary=([^;]+)/i)[1]; //eslint-disable-line
} catch (e) {
throw new Error('Cannot find boundary');
}
} catch (e) { throw new Error('Cannot find boundary');}
if (!boundary) {
throw new Error('Cannot find boundary');
}
if (!boundary) {throw new Error('Cannot find boundary');}

@@ -236,5 +230,3 @@ const parts = text.toString().split(Client._boundarySeparator + boundary);

if (parts.length < 1) {
throw new Error('No parts in body');
}
if (parts.length < 1) {throw new Error('No parts in body');}

@@ -280,5 +272,3 @@ // Step 2. Parse status info

public async error(response: Response, skipOKCheck = false): Promise<string> {
if (response.ok && !skipOKCheck) {
return null;
}
if (response.ok && !skipOKCheck) {return null;}

@@ -285,0 +275,0 @@ let msg = (response.status ? `${response.status} ` : '') + (response.statusText ? response.statusText : '');

@@ -222,5 +222,3 @@ import {createHash, randomBytes} from 'crypto';

// Append the URL prefix, if available
if (this._urlPrefix) {
builtUrl += this._urlPrefix;
}
if (this._urlPrefix) {builtUrl += this._urlPrefix;}

@@ -279,5 +277,3 @@ // Append the provided path

public async initDiscovery() {
if (!this._discovery) {
throw new Error('Discovery is not enabled!');
}
if (!this._discovery) {throw new Error('Discovery is not enabled!');}
try {

@@ -380,10 +376,6 @@ await this._discovery.init();

if (!response) {
throw new Error('Unable to parse response');
}
if (!response) {throw new Error('Unable to parse response');}
const queryString = new URLSearchParams(response);
if (!queryString) {
throw new Error('Unable to parse response');
}
if (!queryString) {throw new Error('Unable to parse response');}

@@ -417,9 +409,5 @@ const error = queryString.get('error_description') || queryString.get('error');

return new Promise((resolve, reject) => {
if (typeof window === 'undefined') {
throw new Error('This method can be used only in browser');
}
if (typeof window === 'undefined') {throw new Error('This method can be used only in browser');}
if (!url) {
throw new Error('Missing mandatory URL parameter');
}
if (!url) {throw new Error('Missing mandatory URL parameter');}

@@ -594,5 +582,3 @@ const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : 0;

}
if (endpoint_id) {
body.endpoint_id = endpoint_id;
}
if (endpoint_id) {body.endpoint_id = endpoint_id;}
response = await this._tokenRequest(tokenEndpoint, body);

@@ -663,9 +649,5 @@

// Perform sanity checks
if (!authData.refresh_token) {
throw new Error('Refresh token is missing');
}
if (!authData.refresh_token) {throw new Error('Refresh token is missing');}
const refreshTokenValid = await this._auth.refreshTokenValid();
if (!refreshTokenValid) {
throw new Error('Refresh token has expired');
}
if (!refreshTokenValid) {throw new Error('Refresh token has expired');}
const body: RefreshTokenBody = {

@@ -723,5 +705,3 @@ grant_type: 'refresh_token',

public async refresh(): Promise<Response> {
if (this._authProxy) {
throw new Error('Refresh is not supported in Auth Proxy mode');
}
if (this._authProxy) {throw new Error('Refresh is not supported in Auth Proxy mode');}
if (!this._refreshPromise) {

@@ -748,5 +728,3 @@ this._refreshPromise = (async () => {

public async logout(): Promise<Response> {
if (this._authProxy) {
throw new Error('Logout is not supported in Auth Proxy mode');
}
if (this._authProxy) {throw new Error('Logout is not supported in Auth Proxy mode');}
try {

@@ -836,5 +814,3 @@ this.emit(this.events.beforeLogout);

// Guard is for errors that come from polling
if (!e.response || retry) {
throw e;
}
if (!e.response || retry) {throw e;}

@@ -893,5 +869,3 @@ const {response} = e;

const discoveryData = await this._discovery.externalData();
if (!discoveryData) {
throw new Error('Discovery data is missing');
}
if (!discoveryData) {throw new Error('Discovery data is missing');}
this._server = discoveryData.coreApi.baseUri;

@@ -935,8 +909,4 @@ this._rcvServer = discoveryData.rcv.baseApiUri;

public async ensureLoggedIn(): Promise<Response | null> {
if (this._authProxy) {
return null;
}
if (await this._auth.accessTokenValid()) {
return null;
}
if (this._authProxy) {return null;}
if (await this._auth.accessTokenValid()) {return null;}
await this.refresh();

@@ -943,0 +913,0 @@ return null;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc