@adobe/helix-onedrive-support 7.0.0 → 7.0.1

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,11 @@
1
+ ## [7.0.1](https://github.com/adobe/helix-onedrive-support/compare/v7.0.0...v7.0.1) (2022-03-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * detect *-my.sharepoint.com links ([#256](https://github.com/adobe/helix-onedrive-support/issues/256)) ([001f57d](https://github.com/adobe/helix-onedrive-support/commit/001f57d7d73fd760df86c5a18ac5f27bcf9f0cf5))
7
+ * trigger release ([c8826a3](https://github.com/adobe/helix-onedrive-support/commit/c8826a38c69279593338b34918b2c305912225b1))
8
+
1
9
  # [7.0.0](https://github.com/adobe/helix-onedrive-support/compare/v6.2.2...v7.0.0) (2022-03-23)
2
10
 
3
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-onedrive-support",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Helix OneDrive Support",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
package/src/OneDrive.d.ts CHANGED
@@ -194,6 +194,8 @@ export declare class OneDrive extends EventEmitter {
194
194
 
195
195
  me(): Promise<GraphResult>;
196
196
 
197
+ initTenantFromShareLink(sharingUrl: string|URL): Promise<void>;
198
+
197
199
  resolveShareLink(sharingUrl: string|URL): Promise<GraphResult>;
198
200
 
199
201
  /**
package/src/OneDrive.js CHANGED
@@ -155,7 +155,14 @@ class OneDrive extends EventEmitter {
155
155
  return;
156
156
  }
157
157
  const { log } = this;
158
- const [tenantHost] = new URL(sharingUrl).hostname.split('.');
158
+ const url = sharingUrl instanceof URL
159
+ ? sharingUrl
160
+ : new URL(sharingUrl);
161
+ let [tenantHost] = url.hostname.split('.');
162
+ // special case: `xxxx-my.sharepoint.com`
163
+ if (url.hostname.endsWith('-my.sharepoint.com')) {
164
+ tenantHost = tenantHost.substring(0, tenantHost.length - 3);
165
+ }
159
166
 
160
167
  if (this.tenantCache) {
161
168
  this.tenant = this.tenantCache.get(tenantHost);