@adobe/helix-onedrive-support 8.3.3 → 8.3.5

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
+ ## [8.3.5](https://github.com/adobe/helix-onedrive-support/compare/v8.3.4...v8.3.5) (2022-09-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * properly scoped fetch context ([388bd99](https://github.com/adobe/helix-onedrive-support/commit/388bd9929e8fe47ebcdd51dbad9c354ab19c45f3))
7
+
8
+ ## [8.3.4](https://github.com/adobe/helix-onedrive-support/compare/v8.3.3...v8.3.4) (2022-09-25)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update external fixes ([#302](https://github.com/adobe/helix-onedrive-support/issues/302)) ([a6c2988](https://github.com/adobe/helix-onedrive-support/commit/a6c29880f2fc4aca8815e81dedaf4ae7f60c11fe))
14
+
1
15
  ## [8.3.3](https://github.com/adobe/helix-onedrive-support/compare/v8.3.2...v8.3.3) (2022-09-23)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-onedrive-support",
3
- "version": "8.3.3",
3
+ "version": "8.3.5",
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.1.4",
32
- "@aws-sdk/client-s3": "3.171.0",
32
+ "@aws-sdk/client-s3": "3.178.0",
33
33
  "@azure/msal-node": "1.14.0",
34
34
  "jose": "4.9.3"
35
35
  },
@@ -41,7 +41,7 @@
41
41
  "c8": "7.12.0",
42
42
  "codecov": "3.8.3",
43
43
  "dotenv": "16.0.2",
44
- "eslint": "8.23.1",
44
+ "eslint": "8.24.0",
45
45
  "eslint-plugin-header": "3.1.1",
46
46
  "eslint-plugin-import": "2.26.0",
47
47
  "husky": "8.0.1",
package/src/OneDrive.js CHANGED
@@ -17,7 +17,6 @@ import { StatusCodeError } from './StatusCodeError.js';
17
17
  import { editDistance, sanitizeName, splitByExtension } from './utils.js';
18
18
  import { SharePointSite } from './SharePointSite.js';
19
19
 
20
- const { fetch, reset } = keepAliveNoCache({ userAgent: 'adobe-fetch' });
21
20
  /**
22
21
  * the maximum subscription time in milliseconds
23
22
  * @see https://docs.microsoft.com/en-us/graph/api/resources/subscription?view=graph-rest-1.0#maximum-length-of-subscription-per-resource-type
@@ -87,6 +86,8 @@ export class OneDrive {
87
86
  * @param {OneDriveOptions} opts Options
88
87
  */
89
88
  constructor(opts) {
89
+ this.fetchContext = keepAliveNoCache({ userAgent: 'adobe-fetch' });
90
+
90
91
  if (!opts.auth) {
91
92
  throw new Error('Missing auth.');
92
93
  }
@@ -104,6 +105,7 @@ export class OneDrive {
104
105
  async dispose() {
105
106
  // TODO: clear other state?
106
107
  await this.auth.dispose();
108
+ const { reset } = this.fetchContext;
107
109
  return reset();
108
110
  }
109
111
 
@@ -124,6 +126,7 @@ export class OneDrive {
124
126
  opts.headers.authorization = `Bearer ${accessToken}`;
125
127
  const url = `https://graph.microsoft.com/v1.0${relUrl}`;
126
128
  try {
129
+ const { fetch } = this.fetchContext;
127
130
  const resp = await fetch(url, opts);
128
131
  if (!resp.ok) {
129
132
  const text = await resp.text();