@fluidframework/odsp-driver-definitions 1.4.0-115997 → 2.0.0-dev-rc.1.0.0.224419
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/.eslintrc.js +6 -9
- package/CHANGELOG.md +141 -0
- package/README.md +39 -1
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/odsp-driver-definitions.api.md +320 -0
- package/dist/errors.cjs +110 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.ts +122 -6
- package/dist/errors.d.ts.map +1 -1
- package/dist/{factory.js → factory.cjs} +1 -1
- package/dist/factory.cjs.map +1 -0
- package/dist/factory.d.ts +36 -6
- package/dist/factory.d.ts.map +1 -1
- package/dist/index.cjs +21 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/odsp-driver-definitions-alpha.d.ts +626 -0
- package/dist/odsp-driver-definitions-beta.d.ts +88 -0
- package/dist/odsp-driver-definitions-public.d.ts +79 -0
- package/dist/odsp-driver-definitions-untrimmed.d.ts +652 -0
- package/dist/odspCache.cjs +23 -0
- package/dist/odspCache.cjs.map +1 -0
- package/dist/odspCache.d.ts +21 -4
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/resolvedUrl.cjs +37 -0
- package/dist/resolvedUrl.cjs.map +1 -0
- package/dist/resolvedUrl.d.ts +59 -16
- package/dist/resolvedUrl.d.ts.map +1 -1
- package/dist/{odspCache.js → sessionProvider.cjs} +1 -6
- package/dist/sessionProvider.cjs.map +1 -0
- package/dist/sessionProvider.d.ts +48 -0
- package/dist/sessionProvider.d.ts.map +1 -0
- package/dist/{tokenFetch.js → tokenFetch.cjs} +6 -2
- package/dist/tokenFetch.cjs.map +1 -0
- package/dist/tokenFetch.d.ts +15 -5
- package/dist/tokenFetch.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/errors.d.mts +153 -0
- package/lib/errors.d.mts.map +1 -0
- package/lib/errors.mjs +103 -0
- package/lib/errors.mjs.map +1 -0
- package/lib/{factory.d.ts → factory.d.mts} +36 -6
- package/lib/factory.d.mts.map +1 -0
- package/lib/{factory.js → factory.mjs} +1 -1
- package/lib/factory.mjs.map +1 -0
- package/lib/index.d.mts +11 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +9 -0
- package/lib/index.mjs.map +1 -0
- package/lib/odsp-driver-definitions-alpha.d.mts +626 -0
- package/lib/odsp-driver-definitions-beta.d.mts +88 -0
- package/lib/odsp-driver-definitions-public.d.mts +79 -0
- package/lib/odsp-driver-definitions-untrimmed.d.mts +652 -0
- package/lib/{odspCache.d.ts → odspCache.d.mts} +21 -4
- package/lib/odspCache.d.mts.map +1 -0
- package/lib/odspCache.mjs +19 -0
- package/lib/odspCache.mjs.map +1 -0
- package/lib/{resolvedUrl.d.ts → resolvedUrl.d.mts} +59 -16
- package/lib/resolvedUrl.d.mts.map +1 -0
- package/lib/resolvedUrl.mjs +34 -0
- package/lib/resolvedUrl.mjs.map +1 -0
- package/lib/sessionProvider.d.mts +48 -0
- package/lib/sessionProvider.d.mts.map +1 -0
- package/lib/sessionProvider.mjs +6 -0
- package/lib/sessionProvider.mjs.map +1 -0
- package/lib/{tokenFetch.d.ts → tokenFetch.d.mts} +15 -5
- package/lib/tokenFetch.d.mts.map +1 -0
- package/lib/{tokenFetch.js → tokenFetch.mjs} +6 -2
- package/lib/tokenFetch.mjs.map +1 -0
- package/package.json +71 -42
- package/prettier.config.cjs +8 -0
- package/src/errors.ts +153 -57
- package/src/factory.ts +146 -114
- package/src/index.ts +47 -5
- package/src/odspCache.ts +71 -51
- package/src/resolvedUrl.ts +125 -72
- package/src/sessionProvider.ts +61 -0
- package/src/tokenFetch.ts +56 -39
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +11 -13
- package/.editorconfig +0 -7
- package/dist/errors.js +0 -44
- package/dist/errors.js.map +0 -1
- package/dist/factory.js.map +0 -1
- package/dist/index.js +0 -22
- package/dist/index.js.map +0 -1
- package/dist/odspCache.js.map +0 -1
- package/dist/packageVersion.d.ts +0 -9
- package/dist/packageVersion.d.ts.map +0 -1
- package/dist/packageVersion.js +0 -12
- package/dist/packageVersion.js.map +0 -1
- package/dist/resolvedUrl.js +0 -18
- package/dist/resolvedUrl.js.map +0 -1
- package/dist/tokenFetch.js.map +0 -1
- package/lib/errors.d.ts +0 -41
- package/lib/errors.d.ts.map +0 -1
- package/lib/errors.js +0 -41
- package/lib/errors.js.map +0 -1
- package/lib/factory.d.ts.map +0 -1
- package/lib/factory.js.map +0 -1
- package/lib/index.d.ts +0 -10
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -10
- package/lib/index.js.map +0 -1
- package/lib/odspCache.d.ts.map +0 -1
- package/lib/odspCache.js +0 -9
- package/lib/odspCache.js.map +0 -1
- package/lib/packageVersion.d.ts +0 -9
- package/lib/packageVersion.d.ts.map +0 -1
- package/lib/packageVersion.js +0 -9
- package/lib/packageVersion.js.map +0 -1
- package/lib/resolvedUrl.d.ts.map +0 -1
- package/lib/resolvedUrl.js +0 -15
- package/lib/resolvedUrl.js.map +0 -1
- package/lib/tokenFetch.d.ts.map +0 -1
- package/lib/tokenFetch.js.map +0 -1
- package/src/packageVersion.ts +0 -9
- package/tsconfig.esnext.json +0 -7
package/dist/odspCache.d.ts
CHANGED
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
6
|
/**
|
|
7
7
|
* Describes what kind of content is stored in cache entry.
|
|
8
|
+
* @internal
|
|
8
9
|
*/
|
|
9
10
|
export declare const snapshotKey = "snapshot";
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @alpha
|
|
13
|
+
*/
|
|
14
|
+
export type CacheContentType = "snapshot" | "ops";
|
|
15
|
+
/**
|
|
16
|
+
* @alpha
|
|
17
|
+
*/
|
|
11
18
|
export interface IFileEntry {
|
|
12
19
|
/**
|
|
13
20
|
* Unique and stable ID of the document.
|
|
@@ -20,10 +27,11 @@ export interface IFileEntry {
|
|
|
20
27
|
* a file if user requests so.
|
|
21
28
|
* This is IOdspResolvedUrl in case of ODSP driver.
|
|
22
29
|
*/
|
|
23
|
-
resolvedUrl:
|
|
30
|
+
resolvedUrl: IResolvedUrl;
|
|
24
31
|
}
|
|
25
32
|
/**
|
|
26
33
|
* Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
|
|
34
|
+
* @alpha
|
|
27
35
|
*/
|
|
28
36
|
export interface IEntry {
|
|
29
37
|
/**
|
|
@@ -44,6 +52,7 @@ export interface IEntry {
|
|
|
44
52
|
}
|
|
45
53
|
/**
|
|
46
54
|
* Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
|
|
55
|
+
* @alpha
|
|
47
56
|
*/
|
|
48
57
|
export interface ICacheEntry extends IEntry {
|
|
49
58
|
/**
|
|
@@ -57,13 +66,14 @@ export interface ICacheEntry extends IEntry {
|
|
|
57
66
|
* cache implementation that does not survive across sessions. Snapshot entires stored in the
|
|
58
67
|
* IPersistedCache will be considered stale and removed after 2 days. Read the README for more
|
|
59
68
|
* information.
|
|
69
|
+
* @alpha
|
|
60
70
|
*/
|
|
61
71
|
export interface IPersistedCache {
|
|
62
72
|
/**
|
|
63
73
|
* Get the cache value of the key
|
|
64
74
|
* @param entry - cache entry, identifies file and particular key for this file.
|
|
65
75
|
* @returns Cached value. undefined if nothing is cached.
|
|
66
|
-
|
|
76
|
+
*/
|
|
67
77
|
get(entry: ICacheEntry): Promise<any>;
|
|
68
78
|
/**
|
|
69
79
|
* Put the value into cache.
|
|
@@ -78,4 +88,11 @@ export interface IPersistedCache {
|
|
|
78
88
|
*/
|
|
79
89
|
removeEntries(file: IFileEntry): Promise<void>;
|
|
80
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Api to generate a cache key from cache entry.
|
|
93
|
+
* @param entry - cache entry from which a cache key is generated
|
|
94
|
+
* @returns The key for cache.
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
export declare function getKeyForCacheEntry(entry: ICacheEntry): string;
|
|
81
98
|
//# sourceMappingURL=odspCache.d.ts.map
|
package/dist/odspCache.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspCache.d.ts","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"odspCache.d.ts","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,KAAK,CAAC;AAOlD;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,EAAE,YAAY,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACtB;;;;OAIG;IACH,IAAI,EAAE,gBAAgB,CAAC;IAEvB;;;;;;;OAOG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,MAAM;IAC1C;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE9D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.SharingLinkRole = exports.SharingLinkScope = exports.ShareLinkTypes = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use ISharingLinkKind type instead.
|
|
10
|
+
* Type of shareLink requested/created when creating the file for the first time.
|
|
11
|
+
* @alpha
|
|
12
|
+
*/
|
|
13
|
+
var ShareLinkTypes;
|
|
14
|
+
(function (ShareLinkTypes) {
|
|
15
|
+
ShareLinkTypes["csl"] = "csl";
|
|
16
|
+
})(ShareLinkTypes || (exports.ShareLinkTypes = ShareLinkTypes = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Sharing scope of the share links created for a file.
|
|
19
|
+
* @alpha
|
|
20
|
+
*/
|
|
21
|
+
var SharingLinkScope;
|
|
22
|
+
(function (SharingLinkScope) {
|
|
23
|
+
SharingLinkScope["organization"] = "organization";
|
|
24
|
+
SharingLinkScope["users"] = "users";
|
|
25
|
+
SharingLinkScope["anonymous"] = "anonymous";
|
|
26
|
+
SharingLinkScope["default"] = "default";
|
|
27
|
+
})(SharingLinkScope || (exports.SharingLinkScope = SharingLinkScope = {}));
|
|
28
|
+
/**
|
|
29
|
+
* View/edit permission role for a sharing link.
|
|
30
|
+
* @alpha
|
|
31
|
+
*/
|
|
32
|
+
var SharingLinkRole;
|
|
33
|
+
(function (SharingLinkRole) {
|
|
34
|
+
SharingLinkRole["view"] = "view";
|
|
35
|
+
SharingLinkRole["edit"] = "edit";
|
|
36
|
+
})(SharingLinkRole || (exports.SharingLinkRole = SharingLinkRole = {}));
|
|
37
|
+
//# sourceMappingURL=resolvedUrl.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvedUrl.cjs","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH;;;;GAIG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,6BAAW,CAAA;AACZ,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;;GAGG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;IACf,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;AACpB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAED;;;GAGG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,gCAAa,CAAA;IACb,gCAAa,CAAA;AACd,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\n\n/**\n * @alpha\n */\nexport interface IOdspUrlParts {\n\tsiteUrl: string;\n\tdriveId: string;\n\titemId: string;\n}\n\n/**\n * @deprecated Use ISharingLinkKind type instead.\n * Type of shareLink requested/created when creating the file for the first time.\n * @alpha\n */\nexport enum ShareLinkTypes {\n\tcsl = \"csl\",\n}\n\n/**\n * Sharing scope of the share links created for a file.\n * @alpha\n */\nexport enum SharingLinkScope {\n\torganization = \"organization\",\n\tusers = \"users\",\n\tanonymous = \"anonymous\",\n\tdefault = \"default\",\n}\n\n/**\n * View/edit permission role for a sharing link.\n * @alpha\n */\nexport enum SharingLinkRole {\n\tview = \"view\",\n\tedit = \"edit\",\n}\n\n/**\n * Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.\n * Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.\n * @alpha\n */\nexport interface ISharingLinkKind {\n\tscope: SharingLinkScope;\n\t/*\n\t * If this parameter is not provided, the API will default to \"edit\" links (provided\n\t * a valid createLinkScope setting is given).\n\t */\n\trole?: SharingLinkRole;\n}\n\n/**\n * Sharing link data received from the /snapshot api response.\n * @alpha\n */\nexport interface ISharingLink extends ISharingLinkKind {\n\twebUrl: string;\n}\n\n/**\n * Sharing link data created for the ODSP item.\n * Contains information about either sharing link created while creating a new file or\n * a redeemable share link created when loading an existing file\n * @alpha\n */\nexport interface ShareLinkInfoType {\n\t/**\n\t * We create a new file in ODSP with the /snapshot api call. Applications then need to make a separate apis call to\n\t * create a sharing link for that file. To reduce the number of network calls, ODSP now provides a feature\n\t * where we can create a share link along with creating a file by passing a query parameter called\n\t * createShareLink (deprecated) or createLinkScope and createLinkRole. createLink object below saves the information\n\t * from the /snapshot api response.\n\t */\n\tcreateLink?: {\n\t\t/**\n\t\t * @deprecated\n\t\t * Type of shareLink requested/created when creating the file for the first time. The 'type' property here\n\t\t * represents the type of sharing link requested.\n\t\t * Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.\n\t\t */\n\t\ttype?: ShareLinkTypes | ISharingLinkKind;\n\n\t\t/**\n\t\t * Share link created when the file is created for the first time with /snapshot api call.\n\t\t */\n\t\tlink?: string | ISharingLink;\n\n\t\t/**\n\t\t * Error message if creation of sharing link fails with /snapshot api call\n\t\t */\n\t\terror?: any;\n\n\t\tshareId?: string;\n\t};\n\n\t/**\n\t * This is used to save the network calls while doing trees/latest call as if the client does not have\n\t * permission then this link can be redeemed for the permissions in the same network call.\n\t */\n\tsharingLinkToRedeem?: string;\n}\n/**\n * @alpha\n */\nexport interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {\n\ttype: \"fluid\";\n\todspResolvedUrl: true;\n\n\t// URL to send to fluid, contains the documentId and the path\n\turl: string;\n\n\t// A hashed identifier that is unique to this document\n\thashedDocumentId: string;\n\n\tendpoints: {\n\t\tsnapshotStorageUrl: string;\n\t\tattachmentPOSTStorageUrl: string;\n\t\tattachmentGETStorageUrl: string;\n\t\tdeltaStorageUrl: string;\n\t};\n\n\t// Tokens are not obtained by the ODSP driver using the resolve flow, the app must provide them.\n\t// eslint-disable-next-line @typescript-eslint/ban-types\n\ttokens: {};\n\n\tfileName: string;\n\n\tsummarizer: boolean;\n\n\tcodeHint?: {\n\t\t// containerPackageName is used for adding the package name to the request headers.\n\t\t// This may be used for preloading the container package when loading Fluid content.\n\t\tcontainerPackageName?: string;\n\t};\n\n\tfileVersion: string | undefined;\n\n\tdataStorePath?: string;\n\n\t/**\n\t * Sharing link data created for the ODSP item.\n\t * Contains information about either sharing link created while creating a new file or\n\t * a redeemable share link created when loading an existing file\n\t */\n\tshareLinkInfo?: ShareLinkInfoType;\n\n\tisClpCompliantApp?: boolean;\n}\n"]}
|
package/dist/resolvedUrl.d.ts
CHANGED
|
@@ -2,49 +2,88 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
|
+
/**
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
6
9
|
export interface IOdspUrlParts {
|
|
7
10
|
siteUrl: string;
|
|
8
11
|
driveId: string;
|
|
9
12
|
itemId: string;
|
|
10
13
|
}
|
|
11
14
|
/**
|
|
15
|
+
* @deprecated Use ISharingLinkKind type instead.
|
|
12
16
|
* Type of shareLink requested/created when creating the file for the first time.
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
* In future, we can add more types here.
|
|
16
|
-
*/
|
|
17
|
+
* @alpha
|
|
18
|
+
*/
|
|
17
19
|
export declare enum ShareLinkTypes {
|
|
18
20
|
csl = "csl"
|
|
19
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Sharing scope of the share links created for a file.
|
|
24
|
+
* @alpha
|
|
25
|
+
*/
|
|
26
|
+
export declare enum SharingLinkScope {
|
|
27
|
+
organization = "organization",
|
|
28
|
+
users = "users",
|
|
29
|
+
anonymous = "anonymous",
|
|
30
|
+
default = "default"
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* View/edit permission role for a sharing link.
|
|
34
|
+
* @alpha
|
|
35
|
+
*/
|
|
36
|
+
export declare enum SharingLinkRole {
|
|
37
|
+
view = "view",
|
|
38
|
+
edit = "edit"
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.
|
|
42
|
+
* Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.
|
|
43
|
+
* @alpha
|
|
44
|
+
*/
|
|
45
|
+
export interface ISharingLinkKind {
|
|
46
|
+
scope: SharingLinkScope;
|
|
47
|
+
role?: SharingLinkRole;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Sharing link data received from the /snapshot api response.
|
|
51
|
+
* @alpha
|
|
52
|
+
*/
|
|
53
|
+
export interface ISharingLink extends ISharingLinkKind {
|
|
54
|
+
webUrl: string;
|
|
55
|
+
}
|
|
20
56
|
/**
|
|
21
57
|
* Sharing link data created for the ODSP item.
|
|
22
58
|
* Contains information about either sharing link created while creating a new file or
|
|
23
59
|
* a redeemable share link created when loading an existing file
|
|
60
|
+
* @alpha
|
|
24
61
|
*/
|
|
25
62
|
export interface ShareLinkInfoType {
|
|
26
63
|
/**
|
|
27
|
-
* We create a new file in ODSP with the /snapshot api call. Applications then
|
|
28
|
-
* create a sharing link for that file. To reduce the number of
|
|
64
|
+
* We create a new file in ODSP with the /snapshot api call. Applications then need to make a separate apis call to
|
|
65
|
+
* create a sharing link for that file. To reduce the number of network calls, ODSP now provides a feature
|
|
29
66
|
* where we can create a share link along with creating a file by passing a query parameter called
|
|
30
|
-
* createShareLink. createLink object below saves the
|
|
67
|
+
* createShareLink (deprecated) or createLinkScope and createLinkRole. createLink object below saves the information
|
|
68
|
+
* from the /snapshot api response.
|
|
31
69
|
*/
|
|
32
70
|
createLink?: {
|
|
33
71
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
72
|
+
* @deprecated
|
|
73
|
+
* Type of shareLink requested/created when creating the file for the first time. The 'type' property here
|
|
74
|
+
* represents the type of sharing link requested.
|
|
75
|
+
* Will be deprecated soon. Type of sharing link will be present in the link:ISharingLink property below.
|
|
76
|
+
*/
|
|
77
|
+
type?: ShareLinkTypes | ISharingLinkKind;
|
|
39
78
|
/**
|
|
40
79
|
* Share link created when the file is created for the first time with /snapshot api call.
|
|
41
|
-
* This link does not require redemption.
|
|
42
80
|
*/
|
|
43
|
-
link?: string;
|
|
81
|
+
link?: string | ISharingLink;
|
|
44
82
|
/**
|
|
45
83
|
* Error message if creation of sharing link fails with /snapshot api call
|
|
46
84
|
*/
|
|
47
85
|
error?: any;
|
|
86
|
+
shareId?: string;
|
|
48
87
|
};
|
|
49
88
|
/**
|
|
50
89
|
* This is used to save the network calls while doing trees/latest call as if the client does not have
|
|
@@ -52,7 +91,10 @@ export interface ShareLinkInfoType {
|
|
|
52
91
|
*/
|
|
53
92
|
sharingLinkToRedeem?: string;
|
|
54
93
|
}
|
|
55
|
-
|
|
94
|
+
/**
|
|
95
|
+
* @alpha
|
|
96
|
+
*/
|
|
97
|
+
export interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
|
|
56
98
|
type: "fluid";
|
|
57
99
|
odspResolvedUrl: true;
|
|
58
100
|
url: string;
|
|
@@ -70,6 +112,7 @@ export interface IOdspResolvedUrl extends IFluidResolvedUrl, IOdspUrlParts {
|
|
|
70
112
|
containerPackageName?: string;
|
|
71
113
|
};
|
|
72
114
|
fileVersion: string | undefined;
|
|
115
|
+
dataStorePath?: string;
|
|
73
116
|
/**
|
|
74
117
|
* Sharing link data created for the ODSP item.
|
|
75
118
|
* Contains information about either sharing link created while creating a new file or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedUrl.d.ts","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"resolvedUrl.d.ts","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,oBAAY,cAAc;IACzB,GAAG,QAAQ;CACX;AAED;;;GAGG;AACH,oBAAY,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,OAAO,YAAY;CACnB;AAED;;;GAGG;AACH,oBAAY,eAAe;IAC1B,IAAI,SAAS;IACb,IAAI,SAAS;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE,gBAAgB,CAAC;IAKxB,IAAI,CAAC,EAAE,eAAe,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACrD,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE;QACZ;;;;;WAKG;QACH,IAAI,CAAC,EAAE,cAAc,GAAG,gBAAgB,CAAC;QAEzC;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;QAE7B;;WAEG;QACH,KAAK,CAAC,EAAE,GAAG,CAAC;QAEZ,OAAO,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B;AACD;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,YAAY,EAAE,aAAa;IACpE,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,IAAI,CAAC;IAGtB,GAAG,EAAE,MAAM,CAAC;IAGZ,gBAAgB,EAAE,MAAM,CAAC;IAEzB,SAAS,EAAE;QACV,kBAAkB,EAAE,MAAM,CAAC;QAC3B,wBAAwB,EAAE,MAAM,CAAC;QACjC,uBAAuB,EAAE,MAAM,CAAC;QAChC,eAAe,EAAE,MAAM,CAAC;KACxB,CAAC;IAIF,MAAM,EAAE,EAAE,CAAC;IAEX,QAAQ,EAAE,MAAM,CAAC;IAEjB,UAAU,EAAE,OAAO,CAAC;IAEpB,QAAQ,CAAC,EAAE;QAGV,oBAAoB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;IAEF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAEhC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAElC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -4,9 +4,4 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Describes what kind of content is stored in cache entry.
|
|
10
|
-
*/
|
|
11
|
-
exports.snapshotKey = "snapshot";
|
|
12
|
-
//# sourceMappingURL=odspCache.js.map
|
|
7
|
+
//# sourceMappingURL=sessionProvider.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionProvider.cjs","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\n\n/**\n * Socket storage discovery api response\n * @alpha\n */\nexport interface ISocketStorageDiscovery {\n\t// The id of the web socket\n\tid: string;\n\n\t// SPO gives us runtimeTenantId, we remap it to tenantId\n\t// See getSocketStorageDiscovery\n\truntimeTenantId?: string;\n\ttenantId: string;\n\n\tsnapshotStorageUrl: string;\n\tdeltaStorageUrl: string;\n\n\t/**\n\t * PUSH URL\n\t */\n\tdeltaStreamSocketUrl: string;\n\n\t/**\n\t * The access token for PushChannel. Optionally returned, depending on implementation.\n\t * OneDrive for Consumer implementation returns it and OneDrive for Business implementation\n\t * does not return it and instead expects token to be returned via `getWebsocketToken` callback\n\t * passed as a parameter to `OdspDocumentService.create()` factory.\n\t */\n\tsocketToken?: string;\n\n\t/**\n\t * This is the time within which client has to refresh the session on (ODSP) relay service.\n\t */\n\trefreshSessionDurationSeconds?: number;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to interrogate itself\n * to find out if it is session aware.\n * @alpha\n */\nexport interface IProvideSessionAwareDriverFactory {\n\treadonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;\n}\n\n/**\n * An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`\n * function if it session aware.\n * @alpha\n */\nexport interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {\n\tgetRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined>;\n}\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
|
+
/**
|
|
7
|
+
* Socket storage discovery api response
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
10
|
+
export interface ISocketStorageDiscovery {
|
|
11
|
+
id: string;
|
|
12
|
+
runtimeTenantId?: string;
|
|
13
|
+
tenantId: string;
|
|
14
|
+
snapshotStorageUrl: string;
|
|
15
|
+
deltaStorageUrl: string;
|
|
16
|
+
/**
|
|
17
|
+
* PUSH URL
|
|
18
|
+
*/
|
|
19
|
+
deltaStreamSocketUrl: string;
|
|
20
|
+
/**
|
|
21
|
+
* The access token for PushChannel. Optionally returned, depending on implementation.
|
|
22
|
+
* OneDrive for Consumer implementation returns it and OneDrive for Business implementation
|
|
23
|
+
* does not return it and instead expects token to be returned via `getWebsocketToken` callback
|
|
24
|
+
* passed as a parameter to `OdspDocumentService.create()` factory.
|
|
25
|
+
*/
|
|
26
|
+
socketToken?: string;
|
|
27
|
+
/**
|
|
28
|
+
* This is the time within which client has to refresh the session on (ODSP) relay service.
|
|
29
|
+
*/
|
|
30
|
+
refreshSessionDurationSeconds?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* An interface that allows a concrete instance of a driver factory to interrogate itself
|
|
34
|
+
* to find out if it is session aware.
|
|
35
|
+
* @alpha
|
|
36
|
+
*/
|
|
37
|
+
export interface IProvideSessionAwareDriverFactory {
|
|
38
|
+
readonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`
|
|
42
|
+
* function if it session aware.
|
|
43
|
+
* @alpha
|
|
44
|
+
*/
|
|
45
|
+
export interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {
|
|
46
|
+
getRelayServiceSessionInfo(resolvedUrl: IResolvedUrl): Promise<ISocketStorageDiscovery | undefined>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=sessionProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionProvider.d.ts","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IAEvC,EAAE,EAAE,MAAM,CAAC;IAIX,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IAEjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,6BAA6B,CAAC,EAAE,MAAM,CAAC;CACvC;AAED;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IACjD,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;CAC1E;AAED;;;;GAIG;AACH,MAAM,WAAW,+BAAgC,SAAQ,iCAAiC;IACzF,0BAA0B,CACzB,WAAW,EAAE,YAAY,GACvB,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAAC;CAChD"}
|
|
@@ -9,19 +9,23 @@ exports.isTokenFromCache = exports.tokenFromResponse = void 0;
|
|
|
9
9
|
* Helper method which transforms return value for TokenFetcher method to token string
|
|
10
10
|
* @param tokenResponse - return value for TokenFetcher method
|
|
11
11
|
* @returns Token value
|
|
12
|
+
* @internal
|
|
12
13
|
*/
|
|
13
14
|
const tokenFromResponse = (tokenResponse) => tokenResponse === null || typeof tokenResponse === "string"
|
|
14
15
|
? tokenResponse
|
|
15
|
-
: tokenResponse === undefined
|
|
16
|
+
: tokenResponse === undefined
|
|
17
|
+
? null
|
|
18
|
+
: tokenResponse.token;
|
|
16
19
|
exports.tokenFromResponse = tokenFromResponse;
|
|
17
20
|
/**
|
|
18
21
|
* Helper method which returns flag indicating whether token response comes from local cache
|
|
19
22
|
* @param tokenResponse - return value for TokenFetcher method
|
|
20
23
|
* @returns Value indicating whether response came from cache.
|
|
21
24
|
* Undefined is returned when we could not determine the source of token.
|
|
25
|
+
* @internal
|
|
22
26
|
*/
|
|
23
27
|
const isTokenFromCache = (tokenResponse) => tokenResponse === null || typeof tokenResponse === "string"
|
|
24
28
|
? undefined
|
|
25
29
|
: tokenResponse.fromCache;
|
|
26
30
|
exports.isTokenFromCache = isTokenFromCache;
|
|
27
|
-
//# sourceMappingURL=tokenFetch.
|
|
31
|
+
//# sourceMappingURL=tokenFetch.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokenFetch.cjs","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgEH;;;;;GAKG;AACI,MAAM,iBAAiB,GAAG,CAChC,aAAwD,EACxC,EAAE,CAClB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,aAAa;IACf,CAAC,CAAC,aAAa,KAAK,SAAS;QAC7B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AAPX,QAAA,iBAAiB,qBAON;AAExB;;;;;;GAMG;AACI,MAAM,gBAAgB,GAAG,CAC/B,aAA4C,EACtB,EAAE,CACxB,aAAa,KAAK,IAAI,IAAI,OAAO,aAAa,KAAK,QAAQ;IAC1D,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC;AALf,QAAA,gBAAgB,oBAKD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Represents token response\n * @beta\n */\nexport interface TokenResponse {\n\t/** Token value */\n\ttoken: string;\n\n\t/** Flag indicating whether token was obtained from local cache */\n\tfromCache?: boolean;\n}\n\n/**\n * Represents access token fetch options\n * @alpha\n */\nexport interface TokenFetchOptions {\n\t/**\n\t * Value indicating whether fresh token has to be returned.\n\t * If false then it is okay to return cached unexpired token if available.\n\t */\n\trefresh: boolean;\n\n\t/**\n\t * Claims that have to be passed with token fetch request.\n\t * These can be used to specify additional information that must be passed to token authority.\n\t */\n\tclaims?: string;\n\n\t/**\n\t * Tenant id of authority that must be handling token fetch.\n\t * If it is not specified then it is up to token fetching logic to determine which tenant authority\n\t * to use to issue access token.\n\t */\n\ttenantId?: string;\n}\n\n/**\n * Represents access token fetch options for ODSP resource\n * @alpha\n */\nexport interface OdspResourceTokenFetchOptions extends TokenFetchOptions {\n\t/** Site url representing ODSP resource location */\n\tsiteUrl: string;\n\n\t/** ODSP drive id where resource resides. Optional, used only when fetching token to access ODSP file */\n\tdriveId?: string;\n\n\t/** ODSP item id representing resource. Optional, used only when fetching token to access ODSP file */\n\titemId?: string;\n}\n\n/**\n * Method signature for callback method used to fetch access token\n * @param options - token fetch options\n * @returns If successful, TokenResponse object representing token value along with flag indicating\n * whether token came from cache. Legacy implementation may return a string for token value;\n * in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.\n * @alpha\n */\nexport type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;\n\n/**\n * Helper method which transforms return value for TokenFetcher method to token string\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Token value\n * @internal\n */\nexport const tokenFromResponse = (\n\ttokenResponse: string | TokenResponse | null | undefined,\n): string | null =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? tokenResponse\n\t\t: tokenResponse === undefined\n\t\t? null\n\t\t: tokenResponse.token;\n\n/**\n * Helper method which returns flag indicating whether token response comes from local cache\n * @param tokenResponse - return value for TokenFetcher method\n * @returns Value indicating whether response came from cache.\n * Undefined is returned when we could not determine the source of token.\n * @internal\n */\nexport const isTokenFromCache = (\n\ttokenResponse: string | TokenResponse | null,\n): boolean | undefined =>\n\ttokenResponse === null || typeof tokenResponse === \"string\"\n\t\t? undefined\n\t\t: tokenResponse.fromCache;\n\n/**\n * Identity types supported by ODSP driver.\n * `Consumer` represents user authenticated with Microsoft Account (MSA).\n * `Enterprise` represents user authenticated with M365 tenant account.\n * @alpha\n */\nexport type IdentityType = \"Consumer\" | \"Enterprise\";\n\n/**\n * @internal\n */\nexport type InstrumentedStorageTokenFetcher = (\n\toptions: TokenFetchOptions,\n\tname: string,\n\talwaysRecordTokenFetchTelemetry?: boolean,\n) => Promise<string | null>;\n"]}
|
package/dist/tokenFetch.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Represents token response
|
|
7
|
+
* @beta
|
|
7
8
|
*/
|
|
8
9
|
export interface TokenResponse {
|
|
9
10
|
/** Token value */
|
|
@@ -13,6 +14,7 @@ export interface TokenResponse {
|
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Represents access token fetch options
|
|
17
|
+
* @alpha
|
|
16
18
|
*/
|
|
17
19
|
export interface TokenFetchOptions {
|
|
18
20
|
/**
|
|
@@ -34,6 +36,7 @@ export interface TokenFetchOptions {
|
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* Represents access token fetch options for ODSP resource
|
|
39
|
+
* @alpha
|
|
37
40
|
*/
|
|
38
41
|
export interface OdspResourceTokenFetchOptions extends TokenFetchOptions {
|
|
39
42
|
/** Site url representing ODSP resource location */
|
|
@@ -49,12 +52,14 @@ export interface OdspResourceTokenFetchOptions extends TokenFetchOptions {
|
|
|
49
52
|
* @returns If successful, TokenResponse object representing token value along with flag indicating
|
|
50
53
|
* whether token came from cache. Legacy implementation may return a string for token value;
|
|
51
54
|
* in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.
|
|
55
|
+
* @alpha
|
|
52
56
|
*/
|
|
53
|
-
export
|
|
57
|
+
export type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;
|
|
54
58
|
/**
|
|
55
59
|
* Helper method which transforms return value for TokenFetcher method to token string
|
|
56
60
|
* @param tokenResponse - return value for TokenFetcher method
|
|
57
61
|
* @returns Token value
|
|
62
|
+
* @internal
|
|
58
63
|
*/
|
|
59
64
|
export declare const tokenFromResponse: (tokenResponse: string | TokenResponse | null | undefined) => string | null;
|
|
60
65
|
/**
|
|
@@ -62,13 +67,18 @@ export declare const tokenFromResponse: (tokenResponse: string | TokenResponse |
|
|
|
62
67
|
* @param tokenResponse - return value for TokenFetcher method
|
|
63
68
|
* @returns Value indicating whether response came from cache.
|
|
64
69
|
* Undefined is returned when we could not determine the source of token.
|
|
70
|
+
* @internal
|
|
65
71
|
*/
|
|
66
72
|
export declare const isTokenFromCache: (tokenResponse: string | TokenResponse | null) => boolean | undefined;
|
|
67
73
|
/**
|
|
68
74
|
* Identity types supported by ODSP driver.
|
|
69
|
-
*
|
|
70
|
-
*
|
|
75
|
+
* `Consumer` represents user authenticated with Microsoft Account (MSA).
|
|
76
|
+
* `Enterprise` represents user authenticated with M365 tenant account.
|
|
77
|
+
* @alpha
|
|
71
78
|
*/
|
|
72
|
-
export
|
|
73
|
-
|
|
79
|
+
export type IdentityType = "Consumer" | "Enterprise";
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
|
|
74
84
|
//# sourceMappingURL=tokenFetch.d.ts.map
|
package/dist/tokenFetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenFetch.d.ts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"tokenFetch.d.ts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC7B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACvE,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAEhB,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sGAAsG;IACtG,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC,CAAC;AAErF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,kBACd,MAAM,GAAG,aAAa,GAAG,IAAI,GAAG,SAAS,KACtD,MAAM,GAAG,IAKW,CAAC;AAExB;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,kBACb,MAAM,GAAG,aAAa,GAAG,IAAI,KAC1C,OAAO,GAAG,SAGc,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,YAAY,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG,CAC7C,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,EACZ,+BAA+B,CAAC,EAAE,OAAO,KACrC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.38.3"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/lib/errors.d.mts
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { DriverError, IDriverErrorBase } from "@fluidframework/driver-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* ODSP Error types.
|
|
4
|
+
* Different error types that may be thrown by the ODSP driver.
|
|
5
|
+
* @alpha
|
|
6
|
+
*/
|
|
7
|
+
export declare const OdspErrorTypes: {
|
|
8
|
+
/**
|
|
9
|
+
* Invalid file name (at creation of the file)
|
|
10
|
+
*/
|
|
11
|
+
readonly invalidFileNameError: "invalidFileNameError";
|
|
12
|
+
/**
|
|
13
|
+
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
14
|
+
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
15
|
+
* such case.
|
|
16
|
+
*/
|
|
17
|
+
readonly snapshotTooBig: "snapshotTooBig";
|
|
18
|
+
/**
|
|
19
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
20
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
21
|
+
* such case.
|
|
22
|
+
*/
|
|
23
|
+
readonly fetchTimeout: "fetchTimeout";
|
|
24
|
+
/**
|
|
25
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
26
|
+
*/
|
|
27
|
+
readonly fluidNotEnabled: "fluidNotEnabled";
|
|
28
|
+
/**
|
|
29
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
30
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
31
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
32
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
33
|
+
* copying it over manually)
|
|
34
|
+
*/
|
|
35
|
+
readonly cannotCatchUp: "cannotCatchUp";
|
|
36
|
+
/**
|
|
37
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
38
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
39
|
+
*/
|
|
40
|
+
readonly serviceReadOnly: "serviceReadOnly";
|
|
41
|
+
/**
|
|
42
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
43
|
+
*/
|
|
44
|
+
readonly blockedIPAddress: "blockedIPAddress";
|
|
45
|
+
readonly genericNetworkError: "genericNetworkError";
|
|
46
|
+
readonly authorizationError: "authorizationError";
|
|
47
|
+
readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
|
|
48
|
+
readonly offlineError: "offlineError";
|
|
49
|
+
readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
|
|
50
|
+
readonly writeError: "writeError";
|
|
51
|
+
readonly fetchFailure: "fetchFailure";
|
|
52
|
+
readonly fetchTokenError: "fetchTokenError";
|
|
53
|
+
readonly incorrectServerResponse: "incorrectServerResponse";
|
|
54
|
+
readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
|
|
55
|
+
readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
|
|
56
|
+
readonly locationRedirection: "locationRedirection";
|
|
57
|
+
readonly fluidInvalidSchema: "fluidInvalidSchema";
|
|
58
|
+
readonly fileIsLocked: "fileIsLocked";
|
|
59
|
+
readonly outOfStorageError: "outOfStorageError";
|
|
60
|
+
readonly genericError: "genericError";
|
|
61
|
+
readonly throttlingError: "throttlingError";
|
|
62
|
+
readonly usageError: "usageError";
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* @alpha
|
|
66
|
+
*/
|
|
67
|
+
export type OdspErrorTypes = (typeof OdspErrorTypes)[keyof typeof OdspErrorTypes];
|
|
68
|
+
/**
|
|
69
|
+
* ODSP Error types.
|
|
70
|
+
* Different error types that may be thrown by the ODSP driver.
|
|
71
|
+
*
|
|
72
|
+
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
73
|
+
* @alpha
|
|
74
|
+
*/
|
|
75
|
+
export declare enum OdspErrorType {
|
|
76
|
+
/**
|
|
77
|
+
* Storage is out of space
|
|
78
|
+
*/
|
|
79
|
+
outOfStorageError = "outOfStorageError",
|
|
80
|
+
/**
|
|
81
|
+
* Invalid file name (at creation of the file)
|
|
82
|
+
*/
|
|
83
|
+
invalidFileNameError = "invalidFileNameError",
|
|
84
|
+
/**
|
|
85
|
+
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
86
|
+
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
87
|
+
* such case.
|
|
88
|
+
*/
|
|
89
|
+
snapshotTooBig = "snapshotTooBig",
|
|
90
|
+
/**
|
|
91
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
92
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
93
|
+
* such case.
|
|
94
|
+
*/
|
|
95
|
+
fetchTimeout = "fetchTimeout",
|
|
96
|
+
/**
|
|
97
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
98
|
+
*/
|
|
99
|
+
fluidNotEnabled = "fluidNotEnabled",
|
|
100
|
+
/**
|
|
101
|
+
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
102
|
+
*/
|
|
103
|
+
fetchTokenError = "fetchTokenError",
|
|
104
|
+
/**
|
|
105
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
106
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
107
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
108
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
109
|
+
* copying it over manually)
|
|
110
|
+
*/
|
|
111
|
+
cannotCatchUp = "cannotCatchUp",
|
|
112
|
+
/**
|
|
113
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
114
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
115
|
+
*/
|
|
116
|
+
serviceReadOnly = "serviceReadOnly",
|
|
117
|
+
/**
|
|
118
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
119
|
+
*/
|
|
120
|
+
blockedIPAddress = "blockedIPAddress"
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @alpha
|
|
124
|
+
*/
|
|
125
|
+
export interface IOdspErrorAugmentations {
|
|
126
|
+
/**
|
|
127
|
+
* Server epoch indicates when the file was last modified.
|
|
128
|
+
* Used to detect modifications outside Fluid's services
|
|
129
|
+
*/
|
|
130
|
+
serverEpoch?: string;
|
|
131
|
+
/**
|
|
132
|
+
* It is the redirection url at which the network call should have been made. It is due to change
|
|
133
|
+
* in site domain of the file on server.
|
|
134
|
+
*/
|
|
135
|
+
redirectLocation?: string;
|
|
136
|
+
/**
|
|
137
|
+
* It is array of error codes included in error response from server.
|
|
138
|
+
*/
|
|
139
|
+
facetCodes?: string[];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Base interface for all errors and warnings
|
|
143
|
+
* Superset of IDriverErrorBase, but with Odsp-specific errorType and properties
|
|
144
|
+
* @alpha
|
|
145
|
+
*/
|
|
146
|
+
export interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
|
|
147
|
+
readonly errorType: OdspErrorType;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* @alpha
|
|
151
|
+
*/
|
|
152
|
+
export type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
|
|
153
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"OAIO,EACN,WAAW,EACX,gBAAgB,EAEhB,MAAM,oCAAoC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,cAAc;IAI1B;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;CAEM,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAElF;;;;;;GAMG;AACH,oBAAY,aAAa;IACxB;;OAEG;IACH,iBAAiB,sBAAsB;IAEvC;;OAEG;IACH,oBAAoB,yBAAyB;IAE7C;;;;OAIG;IACH,cAAc,mBAAmB;IAEjC;;;;OAIG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;;;;;OAMG;IACH,aAAa,kBAAkB;IAE/B;;;OAGG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,gBAAgB,qBAAqB;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,EAAE,uBAAuB;IAC/F,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
|