@aloma.io/integration-sdk 3.3.54 → 3.3.55

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,6 +113,7 @@ 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
116
117
  }
117
118
  async getToken(force) {
118
119
  var local = this, oauth = local.oauth;
@@ -443,6 +444,18 @@ ${text}
443
444
  const theOAuth = decrypted.oauthResult
444
445
  ? new OAuth(decrypted.oauthResult, saveOAuthResult, getRefreshToken)
445
446
  : null;
447
+ if (theOAuth) {
448
+ 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);*/
458
+ }
446
459
  start({
447
460
  config: decrypted,
448
461
  oauth: theOAuth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.3.54",
3
+ "version": "3.3.55",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -145,6 +145,7 @@ class OAuthFetcher extends Fetcher {
145
145
 
146
146
  this.oauth = oauth;
147
147
  this._getToken = getToken;
148
+ // TODO if oauth.periodicTokenRefresh
148
149
  }
149
150
 
150
151
  async getToken(force) {
@@ -546,6 +547,22 @@ ${text}
546
547
  const theOAuth = decrypted.oauthResult
547
548
  ? new OAuth(decrypted.oauthResult, saveOAuthResult, getRefreshToken)
548
549
  : null;
550
+
551
+ if (theOAuth) {
552
+ clearInterval(this._refreshOAuthToken);
553
+
554
+ console.log(this._oauth);
555
+
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
+ }
565
+
549
566
  start({
550
567
  config: decrypted,
551
568
  oauth: theOAuth,