@adobe/helix-onedrive-support 9.0.0 → 9.0.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [9.0.2](https://github.com/adobe/helix-onedrive-support/compare/v9.0.1...v9.0.2) (2022-11-20)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update external fixes ([#320](https://github.com/adobe/helix-onedrive-support/issues/320)) ([1691eab](https://github.com/adobe/helix-onedrive-support/commit/1691eab475ff7d6a4b0ae37f8fd7d3c16f410af4))
7
+
8
+ ## [9.0.1](https://github.com/adobe/helix-onedrive-support/compare/v9.0.0...v9.0.1) (2022-11-15)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * simulate more errors in workflow ([#319](https://github.com/adobe/helix-onedrive-support/issues/319)) ([bd8da60](https://github.com/adobe/helix-onedrive-support/commit/bd8da60d3d885f85127042cfc4dae7938c765bd8))
14
+
1
15
  # [9.0.0](https://github.com/adobe/helix-onedrive-support/compare/v8.4.3...v9.0.0) (2022-11-14)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-onedrive-support",
3
- "version": "9.0.0",
3
+ "version": "9.0.2",
4
4
  "description": "Helix OneDrive Support",
5
5
  "main": "src/index.js",
6
6
  "exports": {
@@ -29,7 +29,7 @@
29
29
  "homepage": "https://github.com/adobe/helix-onedrive-support#readme",
30
30
  "dependencies": {
31
31
  "@adobe/fetch": "3.3.0",
32
- "@aws-sdk/client-s3": "3.209.0",
32
+ "@aws-sdk/client-s3": "3.213.0",
33
33
  "@azure/msal-node": "1.14.3",
34
34
  "jose": "4.11.0"
35
35
  },
@@ -41,7 +41,7 @@
41
41
  "c8": "7.12.0",
42
42
  "codecov": "3.8.3",
43
43
  "dotenv": "16.0.3",
44
- "eslint": "8.27.0",
44
+ "eslint": "8.28.0",
45
45
  "eslint-plugin-header": "3.1.1",
46
46
  "eslint-plugin-import": "2.26.0",
47
47
  "husky": "8.0.2",
@@ -53,7 +53,7 @@
53
53
  "mocha": "10.1.0",
54
54
  "mocha-multi-reporters": "1.5.1",
55
55
  "nock": "13.2.9",
56
- "npm": "8.19.3",
56
+ "npm": "9.1.2",
57
57
  "semantic-release": "19.0.5"
58
58
  },
59
59
  "lint-staged": {
@@ -14,10 +14,10 @@ import {AuthenticationResult, ClientApplication, ICachePlugin} from "@azure/msal
14
14
  export declare interface OneDriveAuthOptions {
15
15
  clientId: string;
16
16
  clientSecret?: string;
17
- refreshToken?: string;
18
17
  log?: Console;
19
18
  tenant?: string;
20
19
  scopes?: string[];
20
+ onCode?: Function;
21
21
  localAuthCache?:boolean;
22
22
 
23
23
  /**
@@ -76,14 +76,6 @@ export declare class OneDriveAuth {
76
76
  */
77
77
  getAuthorityUrl(): string;
78
78
 
79
- /**
80
- * Performs a login using an interactive flow which prompts the user to open a browser window and
81
- * enter the authorization code.
82
- * @params {function} [onCode] - optional function that gets invoked after code was retrieved.
83
- * @returns {Promise<AuthenticationResult>}
84
- */
85
- acquireTokenByDeviceCode(onCode: Function): Promise<AuthenticationResult>;
86
-
87
79
  /**
88
80
  * Sets the access token to use for all requests. if the token is a valid JWT token,
89
81
  * its `tid` claim is used a tenant (if no tenant is already set).
@@ -15,7 +15,6 @@ import { keepAliveNoCache } from '@adobe/fetch';
15
15
  import { ConfidentialClientApplication, LogLevel, PublicClientApplication } from '@azure/msal-node';
16
16
  import { decodeJwt } from 'jose';
17
17
  import { MemCachePlugin } from './cache/MemCachePlugin.js';
18
- import { StatusCodeError } from './StatusCodeError.js';
19
18
 
20
19
  const AZ_AUTHORITY_HOST_URL = 'https://login.windows.net';
21
20
  const AZ_COMMON_TENANT = 'common';
@@ -104,7 +103,7 @@ export class OneDriveAuth {
104
103
  log[MSAL_LOG_LEVELS[loglevel]](message);
105
104
  },
106
105
  piiLoggingEnabled: false,
107
- logLevel: LogLevel.Warning,
106
+ logLevel: LogLevel.Info,
108
107
  },
109
108
  },
110
109
  };
@@ -263,11 +262,7 @@ export class OneDriveAuth {
263
262
  account: accounts[0],
264
263
  });
265
264
  } catch (e) {
266
- if (e.message !== 'Entry not found in cache.') {
267
- log.warn(`Unable to acquire token from cache: ${e}`);
268
- } else {
269
- log.debug(`Unable to acquire token from cache: ${e}`);
270
- }
265
+ log.warn('Error while reacquiring token from cache', e);
271
266
  }
272
267
  }
273
268
  if (silentOnly) {
@@ -283,18 +278,13 @@ export class OneDriveAuth {
283
278
  },
284
279
  scopes: this.scopes,
285
280
  });
286
- } else if (this.clientSecret) {
287
- log.debug('acquire token with client credentials.');
288
- return await app.acquireTokenByClientCredential({
289
- scopes: this.scopes,
290
- });
291
- } else {
292
- const err = new StatusCodeError('No valid authentication credentials supplied.');
293
- err.statusCode = 401;
294
- throw err;
295
281
  }
282
+ log.debug('acquire token with client credentials.');
283
+ return await app.acquireTokenByClientCredential({
284
+ scopes: this.scopes,
285
+ });
296
286
  } catch (e) {
297
- log.error(`Error while acquiring access token ${e}`);
287
+ log.error('Error while acquiring access token', e);
298
288
  throw e;
299
289
  }
300
290
  }