@aloma.io/integration-sdk 3.3.59 → 3.3.60

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.
@@ -304,14 +304,14 @@ ${text}
304
304
  this.startOAuth = async function (args) {
305
305
  if (!this._oauth)
306
306
  throw new Error("oauth not configured");
307
- const clientId = this._oauth.clientId ||
308
- process.env.OAUTH_CLIENT_ID ||
309
- decrypted.clientId;
307
+ const clientId = process.env.OAUTH_CLIENT_ID ||
308
+ decrypted.clientId ||
309
+ this._oauth.clientId;
310
310
  if (!clientId)
311
311
  throw new Error("clientId not configured");
312
- const scopes = this._oauth.scope ||
313
- process.env.OAUTH_SCOPE ||
312
+ const scopes = process.env.OAUTH_SCOPE ||
314
313
  decrypted.scope ||
314
+ this._oauth.scope ||
315
315
  "";
316
316
  const useCodeChallenge = !!that._oauth.useCodeChallenge;
317
317
  return {
@@ -331,14 +331,15 @@ ${text}
331
331
  const doFinish = async () => {
332
332
  if (!arg.code || !arg.redirectURI)
333
333
  throw new Error("need code and redirectUri");
334
- const clientId = that._oauth.clientId ||
335
- process.env.OAUTH_CLIENT_ID ||
336
- decrypted.clientId;
334
+ const clientId = process.env.OAUTH_CLIENT_ID ||
335
+ decrypted.clientId ||
336
+ that._oauth.clientId;
337
+ ;
337
338
  if (!clientId)
338
339
  throw new Error("clientId not configured");
339
- const clientSecret = that._oauth.clientSecret ||
340
- process.env.OAUTH_CLIENT_SECRET ||
341
- decrypted.clientSecret;
340
+ const clientSecret = process.env.OAUTH_CLIENT_SECRET ||
341
+ decrypted.clientSecret ||
342
+ that._oauth.clientSecret;
342
343
  if (!clientSecret)
343
344
  throw new Error("clientSecret not configured");
344
345
  const additionalTokenArgs = that._oauth.additionalTokenArgs || {};
@@ -416,14 +417,14 @@ ${text}
416
417
  };
417
418
  const that = this;
418
419
  const getRefreshToken = async (refreshToken) => {
419
- const clientId = that._oauth.clientId ||
420
- process.env.OAUTH_CLIENT_ID ||
421
- decrypted.clientId;
420
+ const clientId = process.env.OAUTH_CLIENT_ID ||
421
+ decrypted.clientId ||
422
+ that._oauth.clientId;
422
423
  if (!clientId)
423
424
  throw new Error("clientId not configured");
424
- const clientSecret = that._oauth.clientSecret ||
425
- process.env.OAUTH_CLIENT_SECRET ||
426
- decrypted.clientSecret;
425
+ const clientSecret = process.env.OAUTH_CLIENT_SECRET ||
426
+ decrypted.clientSecret ||
427
+ that._oauth.clientSecret;
427
428
  if (!clientSecret)
428
429
  throw new Error("clientSecret not configured");
429
430
  const useAuthHeader = !!that._oauth.useAuthHeader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloma.io/integration-sdk",
3
- "version": "3.3.59",
3
+ "version": "3.3.60",
4
4
  "description": "",
5
5
  "author": "aloma.io",
6
6
  "license": "Apache-2.0",
@@ -378,16 +378,16 @@ ${text}
378
378
  this.startOAuth = async function (args) {
379
379
  if (!this._oauth) throw new Error("oauth not configured");
380
380
 
381
- const clientId =
382
- this._oauth.clientId ||
383
- process.env.OAUTH_CLIENT_ID ||
384
- decrypted.clientId;
381
+ const clientId = process.env.OAUTH_CLIENT_ID ||
382
+ decrypted.clientId ||
383
+ this._oauth.clientId;
384
+
385
385
  if (!clientId) throw new Error("clientId not configured");
386
386
 
387
387
  const scopes =
388
- this._oauth.scope ||
389
388
  process.env.OAUTH_SCOPE ||
390
389
  decrypted.scope ||
390
+ this._oauth.scope ||
391
391
  "";
392
392
  const useCodeChallenge = !!that._oauth.useCodeChallenge;
393
393
 
@@ -412,16 +412,18 @@ ${text}
412
412
  if (!arg.code || !arg.redirectURI)
413
413
  throw new Error("need code and redirectUri");
414
414
 
415
- const clientId =
416
- that._oauth.clientId ||
417
- process.env.OAUTH_CLIENT_ID ||
418
- decrypted.clientId;
415
+ const clientId = process.env.OAUTH_CLIENT_ID ||
416
+ decrypted.clientId ||
417
+
418
+ that._oauth.clientId;
419
+
420
+ ;
419
421
  if (!clientId) throw new Error("clientId not configured");
420
422
 
421
423
  const clientSecret =
422
- that._oauth.clientSecret ||
423
424
  process.env.OAUTH_CLIENT_SECRET ||
424
- decrypted.clientSecret;
425
+ decrypted.clientSecret ||
426
+ that._oauth.clientSecret;
425
427
  if (!clientSecret) throw new Error("clientSecret not configured");
426
428
 
427
429
  const additionalTokenArgs = that._oauth.additionalTokenArgs || {};
@@ -515,15 +517,17 @@ ${text}
515
517
 
516
518
  const getRefreshToken = async (refreshToken) => {
517
519
  const clientId =
518
- that._oauth.clientId ||
520
+
519
521
  process.env.OAUTH_CLIENT_ID ||
520
- decrypted.clientId;
522
+ decrypted.clientId ||
523
+ that._oauth.clientId;
521
524
  if (!clientId) throw new Error("clientId not configured");
522
525
 
523
526
  const clientSecret =
524
- that._oauth.clientSecret ||
527
+
525
528
  process.env.OAUTH_CLIENT_SECRET ||
526
- decrypted.clientSecret;
529
+ decrypted.clientSecret ||
530
+ that._oauth.clientSecret;
527
531
  if (!clientSecret) throw new Error("clientSecret not configured");
528
532
 
529
533
  const useAuthHeader = !!that._oauth.useAuthHeader;