@adobe/helix-onedrive-support 8.0.10 → 8.1.0
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 +21 -0
- package/package.json +7 -7
- package/src/OneDriveAuth.d.ts +24 -1
- package/src/OneDriveAuth.js +15 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
# [8.1.0](https://github.com/adobe/helix-onedrive-support/compare/v8.0.12...v8.1.0) (2022-07-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add initTenantFromMountPoint() ([#284](https://github.com/adobe/helix-onedrive-support/issues/284)) ([1f1861a](https://github.com/adobe/helix-onedrive-support/commit/1f1861ae28fe8edfbbb644b0190165f62e2e0b1e))
|
|
7
|
+
|
|
8
|
+
## [8.0.12](https://github.com/adobe/helix-onedrive-support/compare/v8.0.11...v8.0.12) (2022-07-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **deps:** update external fixes ([#283](https://github.com/adobe/helix-onedrive-support/issues/283)) ([3494470](https://github.com/adobe/helix-onedrive-support/commit/3494470054f45b0e8085a07b2047e97058d99045))
|
|
14
|
+
|
|
15
|
+
## [8.0.11](https://github.com/adobe/helix-onedrive-support/compare/v8.0.10...v8.0.11) (2022-06-29)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **deps:** update dependency @adobe/helix-fetch to v3.1.1 ([622df8a](https://github.com/adobe/helix-onedrive-support/commit/622df8ac01e819d4a45653ccb320677ef8053254))
|
|
21
|
+
|
|
1
22
|
## [8.0.10](https://github.com/adobe/helix-onedrive-support/compare/v8.0.9...v8.0.10) (2022-06-28)
|
|
2
23
|
|
|
3
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-onedrive-support",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "Helix OneDrive Support",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/adobe/helix-onedrive-support#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@adobe/helix-fetch": "3.1.
|
|
32
|
-
"@aws-sdk/client-s3": "3.
|
|
31
|
+
"@adobe/helix-fetch": "3.1.1",
|
|
32
|
+
"@aws-sdk/client-s3": "3.121.0",
|
|
33
33
|
"@azure/msal-node": "1.10.0",
|
|
34
|
-
"jose": "4.8.
|
|
34
|
+
"jose": "4.8.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@adobe/eslint-config-helix": "1.3.2",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"c8": "7.11.3",
|
|
42
42
|
"codecov": "3.8.3",
|
|
43
43
|
"dotenv": "16.0.1",
|
|
44
|
-
"eslint": "8.
|
|
44
|
+
"eslint": "8.19.0",
|
|
45
45
|
"eslint-plugin-header": "3.1.1",
|
|
46
46
|
"eslint-plugin-import": "2.26.0",
|
|
47
47
|
"husky": "8.0.1",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"lint-staged": "13.0.3",
|
|
53
53
|
"mocha": "10.0.0",
|
|
54
54
|
"mocha-multi-reporters": "1.5.1",
|
|
55
|
-
"nock": "13.2.
|
|
56
|
-
"npm": "8.13.
|
|
55
|
+
"nock": "13.2.8",
|
|
56
|
+
"npm": "8.13.2",
|
|
57
57
|
"semantic-release": "19.0.3"
|
|
58
58
|
},
|
|
59
59
|
"lint-staged": {
|
package/src/OneDriveAuth.d.ts
CHANGED
|
@@ -38,6 +38,14 @@ export declare interface OneDriveAuthOptions {
|
|
|
38
38
|
tenantCache?: Map<string, string>;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Helix config mount point
|
|
43
|
+
*/
|
|
44
|
+
declare interface MountPoint {
|
|
45
|
+
url: string;
|
|
46
|
+
tenantId?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
41
49
|
/**
|
|
42
50
|
* Helper class that facilitates authentication for one drive.
|
|
43
51
|
*/
|
|
@@ -92,7 +100,22 @@ export declare class OneDriveAuth {
|
|
|
92
100
|
*/
|
|
93
101
|
authenticate(silentOnly: boolean): Promise<AuthenticationResult>;
|
|
94
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Disposes allocated resources.
|
|
105
|
+
*/
|
|
95
106
|
dispose() : Promise<void>;
|
|
96
107
|
|
|
97
|
-
|
|
108
|
+
/**
|
|
109
|
+
* Initializes the tenant from the url by requesting the required information from microsoft.
|
|
110
|
+
* @param {string|URL} sharingUrl
|
|
111
|
+
* @returns {string} the tenant id
|
|
112
|
+
*/
|
|
113
|
+
initTenantFromUrl(sharingUrl: string|URL): Promise<string>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Initializes the tenant either with the `tenantId` of the mount point or via the share url.
|
|
117
|
+
* @param {MountPoint} mp
|
|
118
|
+
* @returns {string} the tenant id
|
|
119
|
+
*/
|
|
120
|
+
initTenantFromMountPoint(mp: MountPoint): Promise<string>;
|
|
98
121
|
}
|
package/src/OneDriveAuth.js
CHANGED
|
@@ -151,7 +151,7 @@ export class OneDriveAuth {
|
|
|
151
151
|
|
|
152
152
|
async initTenantFromUrl(sharingUrl) {
|
|
153
153
|
if (this.tenant) {
|
|
154
|
-
return;
|
|
154
|
+
return this.tenant;
|
|
155
155
|
}
|
|
156
156
|
const { log } = this;
|
|
157
157
|
const tenantHost = OneDriveAuth.getTenantHostFromUrl(sharingUrl);
|
|
@@ -166,6 +166,20 @@ export class OneDriveAuth {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
log.info(`using tenant ${this.tenant} for ${tenantHost} from ${sharingUrl}`);
|
|
169
|
+
return this.tenant;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
async initTenantFromMountPoint(mp) {
|
|
173
|
+
const { log } = this;
|
|
174
|
+
if (this.tenant) {
|
|
175
|
+
return this.tenant;
|
|
176
|
+
}
|
|
177
|
+
if (mp.tenantId) {
|
|
178
|
+
this.tenant = mp.tenantId;
|
|
179
|
+
log.info(`using tenant ${this.tenant} from fstab.`);
|
|
180
|
+
return this.tenant;
|
|
181
|
+
}
|
|
182
|
+
return this.initTenantFromUrl(mp.url);
|
|
169
183
|
}
|
|
170
184
|
|
|
171
185
|
/**
|