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

amocrm-js

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amocrm-js - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11

21

dist/base/requests/domain/DomainRequest.js

@@ -115,2 +115,16 @@ 'use strict';

}, {
key: 'setCookies',
value: function setCookies(cookies) {
this._cookies = cookies;
var expires = cookies.find(function (cookie) {
return cookie.includes('expires=');
}).split('; ').find(function (cookie) {
return cookie.startsWith('expires=');
});
if (expires) {
this._expires = new Date(expires.replace('expires=', ''));
}
}
}, {
key: 'handleResponse',

@@ -124,3 +138,3 @@ value: function handleResponse(_ref) {

if (options.saveCookies) {
this._cookies = response.headers['set-cookie'];
this.setCookies(response.headers['set-cookie']);
}

@@ -149,2 +163,7 @@ var handler = new responseHandlerClass(rawData);

}
}, {
key: 'expires',
get: function get() {
return this._expires;
}
}]);

@@ -151,0 +170,0 @@

2

package.json
{
"name": "amocrm-js",
"version": "1.0.10",
"version": "1.0.11",
"description": "JS Library for AmoCRM",

@@ -5,0 +5,0 @@ "main": "dist/AmoCRM.js",

@@ -83,3 +83,3 @@ import AmoCRM from '../src/AmoCRM';

setTimeout(() => !checked && disconnected && done(), 2000);
setTimeout(() => !checked && disconnected && done(), 2000 );
});

@@ -249,2 +249,19 @@

});
it( 'many requests check', async done => {
const { domain, auth: { hash, login } } = config,
crm = new AmoCRM({
domain,
auth: {
hash, login
}
});
await crm.connect();
for (let i = 0; i < 10; i++) {
await crm.request.get( '/api/v2/account' );
}
done();
});
});

@@ -29,2 +29,6 @@ 'use strict';

get expires() {
return this._expires;
}
request( url, data = {}, method = 'GET', options = {}) {

@@ -67,6 +71,17 @@ const encodedData = this.encodeData( url, data, method, options ),

setCookies( cookies ) {
this._cookies = cookies;
const expires = cookies.find( cookie => cookie.includes( 'expires=' ))
.split( '; ' )
.find( cookie => cookie.startsWith( 'expires=' ));
if ( expires ) {
this._expires = new Date( expires.replace( 'expires=', '' ));
}
}
handleResponse({ rawData, response }, options = {}) {
const { responseHandlerClass } = this.constructor;
if ( options.saveCookies ) {
this._cookies = response.headers[ 'set-cookie' ];
this.setCookies( response.headers[ 'set-cookie' ])
}

@@ -73,0 +88,0 @@ const handler = new responseHandlerClass( rawData );

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