@aloma.io/integration-sdk 3.3.55 → 3.3.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/internal/index.mjs +12 -10
- package/package.json +1 -1
- package/src/internal/index.mjs +12 -10
package/build/internal/index.mjs
CHANGED
@@ -113,7 +113,6 @@ class OAuthFetcher extends Fetcher {
|
|
113
113
|
super({ retry, baseUrl, onResponse });
|
114
114
|
this.oauth = oauth;
|
115
115
|
this._getToken = getToken;
|
116
|
-
// TODO if oauth.periodicTokenRefresh
|
117
116
|
}
|
118
117
|
async getToken(force) {
|
119
118
|
var local = this, oauth = local.oauth;
|
@@ -163,6 +162,7 @@ class OAuth {
|
|
163
162
|
this._data = data || {};
|
164
163
|
this.saveOAuthResult = saveOAuthResult;
|
165
164
|
this.obtainViaRefreshToken = getRefreshToken;
|
165
|
+
this.clients = {};
|
166
166
|
}
|
167
167
|
data() {
|
168
168
|
return this._data;
|
@@ -444,17 +444,19 @@ ${text}
|
|
444
444
|
const theOAuth = decrypted.oauthResult
|
445
445
|
? new OAuth(decrypted.oauthResult, saveOAuthResult, getRefreshToken)
|
446
446
|
: null;
|
447
|
+
console.log('restarting');
|
447
448
|
if (theOAuth) {
|
448
449
|
clearInterval(this._refreshOAuthToken);
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
450
|
+
if (!(this._oauth.noPeriodicTokenRefresh === false)) {
|
451
|
+
this._refreshOAuthToken = setInterval(async () => {
|
452
|
+
try {
|
453
|
+
await theOAuth.periodicRefresh();
|
454
|
+
}
|
455
|
+
catch (e) {
|
456
|
+
//console.log('periodic refresh', e);
|
457
|
+
}
|
458
|
+
}, /*4 * 60 * 60 **/ 1000);
|
459
|
+
}
|
458
460
|
}
|
459
461
|
start({
|
460
462
|
config: decrypted,
|
package/package.json
CHANGED
package/src/internal/index.mjs
CHANGED
@@ -145,7 +145,6 @@ class OAuthFetcher extends Fetcher {
|
|
145
145
|
|
146
146
|
this.oauth = oauth;
|
147
147
|
this._getToken = getToken;
|
148
|
-
// TODO if oauth.periodicTokenRefresh
|
149
148
|
}
|
150
149
|
|
151
150
|
async getToken(force) {
|
@@ -206,6 +205,7 @@ class OAuth {
|
|
206
205
|
this._data = data || {};
|
207
206
|
this.saveOAuthResult = saveOAuthResult;
|
208
207
|
this.obtainViaRefreshToken = getRefreshToken;
|
208
|
+
this.clients = {};
|
209
209
|
}
|
210
210
|
|
211
211
|
data() {
|
@@ -548,19 +548,21 @@ ${text}
|
|
548
548
|
? new OAuth(decrypted.oauthResult, saveOAuthResult, getRefreshToken)
|
549
549
|
: null;
|
550
550
|
|
551
|
+
console.log('restarting')
|
551
552
|
if (theOAuth) {
|
552
553
|
clearInterval(this._refreshOAuthToken);
|
553
554
|
|
554
|
-
|
555
|
+
if (!(this._oauth.noPeriodicTokenRefresh === false)) {
|
556
|
+
this._refreshOAuthToken = setInterval(async () => {
|
557
|
+
try
|
558
|
+
{
|
559
|
+
await theOAuth.periodicRefresh();
|
560
|
+
} catch(e) {
|
561
|
+
//console.log('periodic refresh', e);
|
562
|
+
}
|
563
|
+
}, /*4 * 60 * 60 **/ 1000);
|
564
|
+
}
|
555
565
|
|
556
|
-
/*this._refreshOAuthToken = setInterval(() => {
|
557
|
-
try
|
558
|
-
{
|
559
|
-
theOAuth.periodicRefresh();
|
560
|
-
} catch(e) {
|
561
|
-
console.log('periodic refresh', e);
|
562
|
-
}
|
563
|
-
}, 4 * 60 * 60 * 1000);*/
|
564
566
|
}
|
565
567
|
|
566
568
|
start({
|