@aloma.io/integration-sdk 3.3.66 → 3.3.68

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.
@@ -206,8 +206,10 @@ class OAuth {
206
206
  }
207
207
  }
208
208
  async invalidate(err) {
209
+ if (this._data.access_token === 'invalid')
210
+ return;
209
211
  console.log('could not obtain access token, marking connector as disconnected', err);
210
- await this.upate(null, null);
212
+ await this.update('invalid', null);
211
213
  }
212
214
  getClient(arg = {}) {
213
215
  const client = new OAuthFetcher({ ...arg, oauth: this });
@@ -421,12 +423,8 @@ ${text}
421
423
  return { value: await jwe.encrypt(data, "none", config.id()) };
422
424
  };
423
425
  const saveOAuthResult = async (what) => {
424
- let value = null;
425
- if (what) {
426
- const jwe = await config.validateKeys("RSA-OAEP-256");
427
- value = await jwe.encrypt(what, "none", config.id());
428
- }
429
- ;
426
+ const jwe = await config.validateKeys("RSA-OAEP-256");
427
+ const value = await jwe.encrypt(what, "none", config.id());
430
428
  const packet = transport.newPacket({});
431
429
  packet.method("connector.config-update");
432
430
  packet.args({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.3.66",
3
+ "version": "3.3.68",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -267,9 +267,11 @@ class OAuth {
267
267
  }
268
268
 
269
269
  async invalidate(err) {
270
+ if (this._data.access_token === 'invalid') return;
271
+
270
272
  console.log('could not obtain access token, marking connector as disconnected', err);
271
273
 
272
- await this.upate(null, null);
274
+ await this.update('invalid', null);
273
275
  }
274
276
 
275
277
  getClient(arg = {}) {
@@ -525,12 +527,8 @@ ${text}
525
527
  };
526
528
 
527
529
  const saveOAuthResult = async (what) => {
528
- let value = null;
529
-
530
- if (what) {
531
- const jwe = await config.validateKeys("RSA-OAEP-256");
532
- value = await jwe.encrypt(what, "none", config.id())
533
- };
530
+ const jwe = await config.validateKeys("RSA-OAEP-256");
531
+ const value = await jwe.encrypt(what, "none", config.id())
534
532
 
535
533
  const packet = transport.newPacket({});
536
534