@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.
@@ -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
- console.log(this._oauth);
450
- /*this._refreshOAuthToken = setInterval(() => {
451
- try
452
- {
453
- theOAuth.periodicRefresh();
454
- } catch(e) {
455
- console.log('periodic refresh', e);
456
- }
457
- }, 4 * 60 * 60 * 1000);*/
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.3.55",
3
+ "version": "3.3.57",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -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
- console.log(this._oauth);
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({