Comparing version 2.0.8 to 2.0.9
@@ -226,3 +226,3 @@ 'use strict'; | ||
if (this._server) { | ||
return Promise.resolve; | ||
return Promise.resolve(); | ||
} | ||
@@ -266,5 +266,5 @@ var options = _extends({}, this._options.server, { | ||
return this.waitUserAction(); | ||
} else if (!this._code && this.getToken() && this.isRequestExpired()) { | ||
} else if (this.getToken() && this.isRequestExpired()) { | ||
return this.refreshToken(); | ||
} else if (!this._code) { | ||
} else if (!this._code && !this.getToken()) { | ||
return Promise.resolve(false); | ||
@@ -281,3 +281,3 @@ } | ||
_this6._isConnected = true; | ||
return true; | ||
return Promise.resolve(true); | ||
} | ||
@@ -284,0 +284,0 @@ |
{ | ||
"name": "amocrm-js", | ||
"version": "2.0.8", | ||
"version": "2.0.9", | ||
"description": "JS Library for AmoCRM", | ||
@@ -5,0 +5,0 @@ "main": "dist/AmoCRM.js", |
@@ -271,1 +271,7 @@ # AmoCRM | ||
``` | ||
## Доска почёта | ||
Спасибо @amorev, @maxism за вклад в разработку этого проекта | ||
Отдельная благодарность @dmitrytemlead за возможность протестировать библиотеку в стороннем проекте |
@@ -45,3 +45,3 @@ import AmoCRM from '../src/AmoCRM'; | ||
fit( 'should get new token', async done => { | ||
it( 'should get new token', async done => { | ||
const url = client.connection.getAuthUrl(); | ||
@@ -73,2 +73,11 @@ console.log({ | ||
}, 60 * 1000 ); | ||
it( 'should set old token', async done => { | ||
client.connection.setToken( config.token ); | ||
client.connection.connect(); | ||
if ( !client.connection.isRequestExpired()) { | ||
done(); | ||
} | ||
// done(); | ||
}, 60 * 1000 ); | ||
}); |
@@ -181,3 +181,3 @@ 'use strict'; | ||
if ( this._server ) { | ||
return Promise.resolve; | ||
return Promise.resolve(); | ||
} | ||
@@ -221,6 +221,5 @@ const options = { | ||
} | ||
else if ( !this._code && this.getToken() && this.isRequestExpired()) { | ||
else if ( this.getToken() && this.isRequestExpired()) { | ||
return this.refreshToken(); | ||
} | ||
else if ( !this._code ) { | ||
} else if ( !this._code && !this.getToken() ) { | ||
return Promise.resolve( false ); | ||
@@ -236,3 +235,3 @@ } | ||
this._isConnected = true; | ||
return true; | ||
return Promise.resolve( true ); | ||
} | ||
@@ -239,0 +238,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
201806
4145
277