@fluidframework/odsp-driver-definitions 2.0.0-internal.7.3.0 → 2.0.0-internal.7.4.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 +4 -0
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +3 -3
- package/api-report/odsp-driver-definitions.api.md +36 -36
- package/dist/errors.cjs +2 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +12 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/factory.cjs.map +1 -1
- package/dist/factory.d.ts +12 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/odsp-driver-definitions-alpha.d.ts +475 -0
- package/dist/odsp-driver-definitions-beta.d.ts +81 -0
- package/dist/odsp-driver-definitions-public.d.ts +81 -0
- package/dist/odsp-driver-definitions-untrimmed.d.ts +652 -0
- package/dist/odspCache.cjs +2 -0
- package/dist/odspCache.cjs.map +1 -1
- package/dist/odspCache.d.ts +11 -0
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/resolvedUrl.cjs +3 -0
- package/dist/resolvedUrl.cjs.map +1 -1
- package/dist/resolvedUrl.d.ts +12 -0
- package/dist/resolvedUrl.d.ts.map +1 -1
- package/dist/sessionProvider.cjs.map +1 -1
- package/dist/sessionProvider.d.ts +3 -0
- package/dist/sessionProvider.d.ts.map +1 -1
- package/dist/tokenFetch.cjs +2 -0
- package/dist/tokenFetch.cjs.map +1 -1
- package/dist/tokenFetch.d.ts +10 -0
- package/dist/tokenFetch.d.ts.map +1 -1
- package/lib/errors.d.ts +12 -4
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.mjs +2 -0
- package/lib/errors.mjs.map +1 -1
- package/lib/factory.d.ts +12 -0
- package/lib/factory.d.ts.map +1 -1
- package/lib/factory.mjs.map +1 -1
- package/lib/index.d.ts +6 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/odsp-driver-definitions-alpha.d.ts +475 -0
- package/lib/odsp-driver-definitions-beta.d.ts +81 -0
- package/lib/odsp-driver-definitions-public.d.ts +81 -0
- package/lib/odsp-driver-definitions-untrimmed.d.ts +652 -0
- package/lib/odspCache.d.ts +11 -0
- package/lib/odspCache.d.ts.map +1 -1
- package/lib/odspCache.mjs +2 -0
- package/lib/odspCache.mjs.map +1 -1
- package/lib/resolvedUrl.d.ts +12 -0
- package/lib/resolvedUrl.d.ts.map +1 -1
- package/lib/resolvedUrl.mjs +3 -0
- package/lib/resolvedUrl.mjs.map +1 -1
- package/lib/sessionProvider.d.ts +3 -0
- package/lib/sessionProvider.d.ts.map +1 -1
- package/lib/sessionProvider.mjs.map +1 -1
- package/lib/tokenFetch.d.ts +10 -0
- package/lib/tokenFetch.d.ts.map +1 -1
- package/lib/tokenFetch.mjs +2 -0
- package/lib/tokenFetch.mjs.map +1 -1
- package/package.json +25 -6
- package/src/errors.ts +12 -0
- package/src/factory.ts +12 -0
- package/src/odspCache.ts +11 -0
- package/src/resolvedUrl.ts +12 -0
- package/src/sessionProvider.ts +3 -0
- package/src/tokenFetch.ts +10 -0
package/lib/odspCache.mjs
CHANGED
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Describes what kind of content is stored in cache entry.
|
|
7
|
+
* @internal
|
|
7
8
|
*/
|
|
8
9
|
export const snapshotKey = "snapshot";
|
|
9
10
|
/**
|
|
10
11
|
* Api to generate a cache key from cache entry.
|
|
11
12
|
* @param entry - cache entry from which a cache key is generated
|
|
12
13
|
* @returns The key for cache.
|
|
14
|
+
* @internal
|
|
13
15
|
*/
|
|
14
16
|
export function getKeyForCacheEntry(entry) {
|
|
15
17
|
return `${entry.file.docId}_${entry.type}_${entry.key}`;
|
package/lib/odspCache.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspCache.mjs","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH
|
|
1
|
+
{"version":3,"file":"odspCache.mjs","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AA8FtC;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAkB;IACrD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;AACzD,CAAC","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 * Describes what kind of content is stored in cache entry.\n * @internal\n */\nexport const snapshotKey = \"snapshot\";\n/**\n * @alpha\n */\nexport type CacheContentType = \"snapshot\" | \"ops\";\n\n/*\n * File / container identifier.\n * There is overlapping information here - host can use all of it or parts\n * to implement storage / identify files.\n */\n/**\n * @alpha\n */\nexport interface IFileEntry {\n\t/**\n\t * Unique and stable ID of the document.\n\t * Driver guarantees that docId is stable ID uniquely identifying document.\n\t */\n\tdocId: string;\n\t/**\n\t * Resolved URI is provided for additional versatility - host can use it to\n\t * identify file in storage, and (as example) delete all cached entries for\n\t * a file if user requests so.\n\t * This is IOdspResolvedUrl in case of ODSP driver.\n\t */\n\tresolvedUrl: IResolvedUrl;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @alpha\n */\nexport interface IEntry {\n\t/**\n\t * Identifies type of entry for a given file.\n\t * Each file can have multiple types of entries associated with it.\n\t * For example, it can be snapshot, blob, ops, etc.\n\t */\n\ttype: CacheContentType;\n\n\t/**\n\t * Identifies individual entry for a given file and type.\n\t * Each file can have multiple cache entries associated with it.\n\t * This property identifies a particular instance of entry.\n\t * For example, for blobs it will be unique ID of the blob in a file.\n\t * For batch of ops, it can be starting op sequence number.\n\t * For types that have only one entry (like snapshots), it will be empty string.\n\t */\n\tkey: string;\n}\n\n/**\n * Cache entry. Identifies file that this entry belongs to, and type of content stored in it.\n * @alpha\n */\nexport interface ICacheEntry extends IEntry {\n\t/**\n\t * Identifies file in storage this cached entry is for\n\t */\n\tfile: IFileEntry;\n}\n\n/**\n * Persistent cache. This interface can be implemented by the host to provide durable caching\n * across sessions. If not provided at driver factory construction, factory will use in-memory\n * cache implementation that does not survive across sessions. Snapshot entires stored in the\n * IPersistedCache will be considered stale and removed after 2 days. Read the README for more\n * information.\n * @alpha\n */\nexport interface IPersistedCache {\n\t/**\n\t * Get the cache value of the key\n\t * @param entry - cache entry, identifies file and particular key for this file.\n\t * @returns Cached value. undefined if nothing is cached.\n\t */\n\tget(entry: ICacheEntry): Promise<any>;\n\n\t/**\n\t * Put the value into cache.\n\t * Important - only serializable content is allowed since this cache may be persisted between sessions\n\t * @param entry - cache entry.\n\t * @param value - JSON-serializable content.\n\t */\n\tput(entry: ICacheEntry, value: any): Promise<void>;\n\n\t/**\n\t * Removes the entries from the cache for given parametres.\n\t * @param file - file entry to be deleted.\n\t */\n\tremoveEntries(file: IFileEntry): Promise<void>;\n}\n\n/**\n * Api to generate a cache key from cache entry.\n * @param entry - cache entry from which a cache key is generated\n * @returns The key for cache.\n * @internal\n */\nexport function getKeyForCacheEntry(entry: ICacheEntry): string {\n\treturn `${entry.file.docId}_${entry.type}_${entry.key}`;\n}\n"]}
|
package/lib/resolvedUrl.d.ts
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
|
+
/**
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
6
9
|
export interface IOdspUrlParts {
|
|
7
10
|
siteUrl: string;
|
|
8
11
|
driveId: string;
|
|
@@ -11,12 +14,14 @@ export interface IOdspUrlParts {
|
|
|
11
14
|
/**
|
|
12
15
|
* @deprecated Use ISharingLinkKind type instead.
|
|
13
16
|
* Type of shareLink requested/created when creating the file for the first time.
|
|
17
|
+
* @alpha
|
|
14
18
|
*/
|
|
15
19
|
export declare enum ShareLinkTypes {
|
|
16
20
|
csl = "csl"
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
19
23
|
* Sharing scope of the share links created for a file.
|
|
24
|
+
* @alpha
|
|
20
25
|
*/
|
|
21
26
|
export declare enum SharingLinkScope {
|
|
22
27
|
organization = "organization",
|
|
@@ -26,6 +31,7 @@ export declare enum SharingLinkScope {
|
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
28
33
|
* View/edit permission role for a sharing link.
|
|
34
|
+
* @alpha
|
|
29
35
|
*/
|
|
30
36
|
export declare enum SharingLinkRole {
|
|
31
37
|
view = "view",
|
|
@@ -34,6 +40,7 @@ export declare enum SharingLinkRole {
|
|
|
34
40
|
/**
|
|
35
41
|
* Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.
|
|
36
42
|
* Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.
|
|
43
|
+
* @alpha
|
|
37
44
|
*/
|
|
38
45
|
export interface ISharingLinkKind {
|
|
39
46
|
scope: SharingLinkScope;
|
|
@@ -41,6 +48,7 @@ export interface ISharingLinkKind {
|
|
|
41
48
|
}
|
|
42
49
|
/**
|
|
43
50
|
* Sharing link data received from the /snapshot api response.
|
|
51
|
+
* @alpha
|
|
44
52
|
*/
|
|
45
53
|
export interface ISharingLink extends ISharingLinkKind {
|
|
46
54
|
webUrl: string;
|
|
@@ -49,6 +57,7 @@ export interface ISharingLink extends ISharingLinkKind {
|
|
|
49
57
|
* Sharing link data created for the ODSP item.
|
|
50
58
|
* Contains information about either sharing link created while creating a new file or
|
|
51
59
|
* a redeemable share link created when loading an existing file
|
|
60
|
+
* @alpha
|
|
52
61
|
*/
|
|
53
62
|
export interface ShareLinkInfoType {
|
|
54
63
|
/**
|
|
@@ -82,6 +91,9 @@ export interface ShareLinkInfoType {
|
|
|
82
91
|
*/
|
|
83
92
|
sharingLinkToRedeem?: string;
|
|
84
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* @alpha
|
|
96
|
+
*/
|
|
85
97
|
export interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
|
|
86
98
|
type: "fluid";
|
|
87
99
|
odspResolvedUrl: true;
|
package/lib/resolvedUrl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedUrl.d.ts","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"resolvedUrl.d.ts","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,YAAY,EAAE,MAAM,oCAAoC;AAEjE;;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"}
|
package/lib/resolvedUrl.mjs
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated Use ISharingLinkKind type instead.
|
|
7
7
|
* Type of shareLink requested/created when creating the file for the first time.
|
|
8
|
+
* @alpha
|
|
8
9
|
*/
|
|
9
10
|
export var ShareLinkTypes;
|
|
10
11
|
(function (ShareLinkTypes) {
|
|
@@ -12,6 +13,7 @@ export var ShareLinkTypes;
|
|
|
12
13
|
})(ShareLinkTypes || (ShareLinkTypes = {}));
|
|
13
14
|
/**
|
|
14
15
|
* Sharing scope of the share links created for a file.
|
|
16
|
+
* @alpha
|
|
15
17
|
*/
|
|
16
18
|
export var SharingLinkScope;
|
|
17
19
|
(function (SharingLinkScope) {
|
|
@@ -22,6 +24,7 @@ export var SharingLinkScope;
|
|
|
22
24
|
})(SharingLinkScope || (SharingLinkScope = {}));
|
|
23
25
|
/**
|
|
24
26
|
* View/edit permission role for a sharing link.
|
|
27
|
+
* @alpha
|
|
25
28
|
*/
|
|
26
29
|
export var SharingLinkRole;
|
|
27
30
|
(function (SharingLinkRole) {
|
package/lib/resolvedUrl.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedUrl.mjs","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"resolvedUrl.mjs","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;;GAIG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,6BAAW,CAAA;AACZ,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;IACf,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;AACpB,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,gCAAa,CAAA;IACb,gCAAa,CAAA;AACd,CAAC,EAHW,eAAe,KAAf,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/lib/sessionProvider.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
6
6
|
/**
|
|
7
7
|
* Socket storage discovery api response
|
|
8
|
+
* @alpha
|
|
8
9
|
*/
|
|
9
10
|
export interface ISocketStorageDiscovery {
|
|
10
11
|
id: string;
|
|
@@ -31,6 +32,7 @@ export interface ISocketStorageDiscovery {
|
|
|
31
32
|
/**
|
|
32
33
|
* An interface that allows a concrete instance of a driver factory to interrogate itself
|
|
33
34
|
* to find out if it is session aware.
|
|
35
|
+
* @alpha
|
|
34
36
|
*/
|
|
35
37
|
export interface IProvideSessionAwareDriverFactory {
|
|
36
38
|
readonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;
|
|
@@ -38,6 +40,7 @@ export interface IProvideSessionAwareDriverFactory {
|
|
|
38
40
|
/**
|
|
39
41
|
* An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`
|
|
40
42
|
* function if it session aware.
|
|
43
|
+
* @alpha
|
|
41
44
|
*/
|
|
42
45
|
export interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {
|
|
43
46
|
getRelayServiceSessionInfo(resolvedUrl: IResolvedUrl): Promise<ISocketStorageDiscovery | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionProvider.d.ts","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"sessionProvider.d.ts","sourceRoot":"","sources":["../src/sessionProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,YAAY,EAAE,MAAM,oCAAoC;AAEjE;;;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionProvider.mjs","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 */\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 */\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 */\nexport interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {\n\tgetRelayServiceSessionInfo(\n\t\tresolvedUrl: IResolvedUrl,\n\t): Promise<ISocketStorageDiscovery | undefined>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sessionProvider.mjs","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"]}
|
package/lib/tokenFetch.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Represents token response
|
|
7
|
+
* @alpha
|
|
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
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
75
|
* `Consumer` represents user authenticated with Microsoft Account (MSA).
|
|
70
76
|
* `Enterprise` represents user authenticated with M365 tenant account.
|
|
77
|
+
* @internal
|
|
71
78
|
*/
|
|
72
79
|
export type IdentityType = "Consumer" | "Enterprise";
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
73
83
|
export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
|
|
74
84
|
//# sourceMappingURL=tokenFetch.d.ts.map
|
package/lib/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"}
|
package/lib/tokenFetch.mjs
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Helper method which transforms return value for TokenFetcher method to token string
|
|
7
7
|
* @param tokenResponse - return value for TokenFetcher method
|
|
8
8
|
* @returns Token value
|
|
9
|
+
* @internal
|
|
9
10
|
*/
|
|
10
11
|
export const tokenFromResponse = (tokenResponse) => tokenResponse === null || typeof tokenResponse === "string"
|
|
11
12
|
? tokenResponse
|
|
@@ -17,6 +18,7 @@ export const tokenFromResponse = (tokenResponse) => tokenResponse === null || ty
|
|
|
17
18
|
* @param tokenResponse - return value for TokenFetcher method
|
|
18
19
|
* @returns Value indicating whether response came from cache.
|
|
19
20
|
* Undefined is returned when we could not determine the source of token.
|
|
21
|
+
* @internal
|
|
20
22
|
*/
|
|
21
23
|
export const isTokenFromCache = (tokenResponse) => tokenResponse === null || typeof tokenResponse === "string"
|
|
22
24
|
? undefined
|
package/lib/tokenFetch.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenFetch.mjs","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"tokenFetch.mjs","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgEH;;;;;GAKG;AACH,MAAM,CAAC,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;AAExB;;;;;;GAMG;AACH,MAAM,CAAC,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","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 * @alpha\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 * @internal\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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/odsp-driver-definitions",
|
|
3
|
-
"version": "2.0.0-internal.7.
|
|
3
|
+
"version": "2.0.0-internal.7.4.0",
|
|
4
4
|
"description": "Socket storage implementation for SPO and ODC",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
"module": "lib/index.mjs",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.7.
|
|
18
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
+
"@arethetypeswrong/cli": "^0.13.3",
|
|
21
22
|
"@fluid-tools/build-cli": "^0.28.0",
|
|
22
23
|
"@fluidframework/build-common": "^2.0.3",
|
|
23
24
|
"@fluidframework/build-tools": "^0.28.0",
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
"@fluidframework/odsp-driver-definitions-previous": "npm:@fluidframework/odsp-driver-definitions@2.0.0-internal.7.2.0",
|
|
26
27
|
"@fluidframework/protocol-definitions": "^3.0.0",
|
|
27
28
|
"@microsoft/api-extractor": "^7.38.3",
|
|
29
|
+
"copyfiles": "^2.4.1",
|
|
28
30
|
"cross-env": "^7.0.3",
|
|
29
31
|
"eslint": "~8.50.0",
|
|
30
32
|
"prettier": "~3.0.3",
|
|
@@ -32,25 +34,42 @@
|
|
|
32
34
|
"tsc-multi": "^1.1.0",
|
|
33
35
|
"typescript": "~5.1.6"
|
|
34
36
|
},
|
|
37
|
+
"fluidBuild": {
|
|
38
|
+
"tasks": {
|
|
39
|
+
"build:docs": {
|
|
40
|
+
"dependsOn": [
|
|
41
|
+
"...",
|
|
42
|
+
"api-extractor:commonjs",
|
|
43
|
+
"api-extractor:esnext"
|
|
44
|
+
],
|
|
45
|
+
"script": false
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
35
49
|
"typeValidation": {
|
|
36
50
|
"broken": {}
|
|
37
51
|
},
|
|
38
52
|
"scripts": {
|
|
53
|
+
"api": "fluid-build . --task api",
|
|
54
|
+
"api-extractor:commonjs": "api-extractor run --local",
|
|
55
|
+
"api-extractor:esnext": "copyfiles -u 1 \"dist/**/*-@(alpha|beta|public|untrimmed).d.ts\" lib",
|
|
39
56
|
"build": "fluid-build . --task build",
|
|
40
57
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
41
58
|
"build:compile": "fluid-build . --task compile",
|
|
42
|
-
"build:docs": "
|
|
59
|
+
"build:docs": "fluid-build . --task api",
|
|
43
60
|
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
|
|
44
61
|
"build:test": "tsc-multi --config ./tsc-multi.test.json",
|
|
62
|
+
"check:are-the-types-wrong": "attw --pack",
|
|
63
|
+
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
45
64
|
"ci:build:docs": "api-extractor run",
|
|
46
65
|
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp",
|
|
47
66
|
"eslint": "eslint --format stylish src",
|
|
48
67
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
49
68
|
"format": "npm run prettier:fix",
|
|
50
|
-
"lint": "npm run prettier && npm run eslint",
|
|
69
|
+
"lint": "npm run prettier && npm run check:release-tags && npm run eslint",
|
|
51
70
|
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
52
|
-
"prettier": "prettier --check . --ignore-path ../../../.prettierignore",
|
|
53
|
-
"prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
|
|
71
|
+
"prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
72
|
+
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
54
73
|
"tsc": "tsc-multi --config ../../../common/build/build-common/tsc-multi.cjs.json",
|
|
55
74
|
"typetests:gen": "fluid-type-test-generator",
|
|
56
75
|
"typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
|
package/src/errors.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
/**
|
|
12
12
|
* ODSP Error types.
|
|
13
13
|
* Different error types that may be thrown by the ODSP driver.
|
|
14
|
+
* @internal
|
|
14
15
|
*/
|
|
15
16
|
export const OdspErrorTypes = {
|
|
16
17
|
// Inherit base driver error types
|
|
@@ -60,6 +61,9 @@ export const OdspErrorTypes = {
|
|
|
60
61
|
*/
|
|
61
62
|
blockedIPAddress: "blockedIPAddress",
|
|
62
63
|
} as const;
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
63
67
|
export type OdspErrorTypes = (typeof OdspErrorTypes)[keyof typeof OdspErrorTypes];
|
|
64
68
|
|
|
65
69
|
/**
|
|
@@ -67,6 +71,7 @@ export type OdspErrorTypes = (typeof OdspErrorTypes)[keyof typeof OdspErrorTypes
|
|
|
67
71
|
* Different error types that may be thrown by the ODSP driver.
|
|
68
72
|
*
|
|
69
73
|
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
74
|
+
* @internal
|
|
70
75
|
*/
|
|
71
76
|
export enum OdspErrorType {
|
|
72
77
|
/**
|
|
@@ -124,6 +129,9 @@ export enum OdspErrorType {
|
|
|
124
129
|
blockedIPAddress = "blockedIPAddress",
|
|
125
130
|
}
|
|
126
131
|
|
|
132
|
+
/**
|
|
133
|
+
* @internal
|
|
134
|
+
*/
|
|
127
135
|
export interface IOdspErrorAugmentations {
|
|
128
136
|
/**
|
|
129
137
|
* Server epoch indicates when the file was last modified.
|
|
@@ -146,9 +154,13 @@ export interface IOdspErrorAugmentations {
|
|
|
146
154
|
/**
|
|
147
155
|
* Base interface for all errors and warnings
|
|
148
156
|
* Superset of IDriverErrorBase, but with Odsp-specific errorType and properties
|
|
157
|
+
* @internal
|
|
149
158
|
*/
|
|
150
159
|
export interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
|
|
151
160
|
readonly errorType: OdspErrorType;
|
|
152
161
|
}
|
|
153
162
|
|
|
163
|
+
/**
|
|
164
|
+
* @internal
|
|
165
|
+
*/
|
|
154
166
|
export type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
|
package/src/factory.ts
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* @alpha
|
|
8
|
+
*/
|
|
6
9
|
export interface ISnapshotOptions {
|
|
7
10
|
blobs?: number;
|
|
8
11
|
deltas?: number;
|
|
@@ -22,6 +25,9 @@ export interface ISnapshotOptions {
|
|
|
22
25
|
timeout?: number;
|
|
23
26
|
}
|
|
24
27
|
|
|
28
|
+
/**
|
|
29
|
+
* @alpha
|
|
30
|
+
*/
|
|
25
31
|
export interface IOpsCachingPolicy {
|
|
26
32
|
/**
|
|
27
33
|
* Batch size. Controls how many ops are grouped together as single cache entry
|
|
@@ -50,6 +56,9 @@ export interface IOpsCachingPolicy {
|
|
|
50
56
|
totalOpsToCache?: number;
|
|
51
57
|
}
|
|
52
58
|
|
|
59
|
+
/**
|
|
60
|
+
* @alpha
|
|
61
|
+
*/
|
|
53
62
|
export interface ICollabSessionOptions {
|
|
54
63
|
/**
|
|
55
64
|
* Value indicating the display name for session that admits unauthenticated user.
|
|
@@ -69,6 +78,9 @@ export interface ICollabSessionOptions {
|
|
|
69
78
|
forceAccessTokenViaAuthorizationHeader?: boolean;
|
|
70
79
|
}
|
|
71
80
|
|
|
81
|
+
/**
|
|
82
|
+
* @alpha
|
|
83
|
+
*/
|
|
72
84
|
export interface HostStoragePolicy {
|
|
73
85
|
snapshotOptions?: ISnapshotOptions;
|
|
74
86
|
|
package/src/odspCache.ts
CHANGED
|
@@ -7,8 +7,12 @@ import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Describes what kind of content is stored in cache entry.
|
|
10
|
+
* @internal
|
|
10
11
|
*/
|
|
11
12
|
export const snapshotKey = "snapshot";
|
|
13
|
+
/**
|
|
14
|
+
* @alpha
|
|
15
|
+
*/
|
|
12
16
|
export type CacheContentType = "snapshot" | "ops";
|
|
13
17
|
|
|
14
18
|
/*
|
|
@@ -16,6 +20,9 @@ export type CacheContentType = "snapshot" | "ops";
|
|
|
16
20
|
* There is overlapping information here - host can use all of it or parts
|
|
17
21
|
* to implement storage / identify files.
|
|
18
22
|
*/
|
|
23
|
+
/**
|
|
24
|
+
* @alpha
|
|
25
|
+
*/
|
|
19
26
|
export interface IFileEntry {
|
|
20
27
|
/**
|
|
21
28
|
* Unique and stable ID of the document.
|
|
@@ -33,6 +40,7 @@ export interface IFileEntry {
|
|
|
33
40
|
|
|
34
41
|
/**
|
|
35
42
|
* Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
|
|
43
|
+
* @alpha
|
|
36
44
|
*/
|
|
37
45
|
export interface IEntry {
|
|
38
46
|
/**
|
|
@@ -55,6 +63,7 @@ export interface IEntry {
|
|
|
55
63
|
|
|
56
64
|
/**
|
|
57
65
|
* Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
|
|
66
|
+
* @alpha
|
|
58
67
|
*/
|
|
59
68
|
export interface ICacheEntry extends IEntry {
|
|
60
69
|
/**
|
|
@@ -69,6 +78,7 @@ export interface ICacheEntry extends IEntry {
|
|
|
69
78
|
* cache implementation that does not survive across sessions. Snapshot entires stored in the
|
|
70
79
|
* IPersistedCache will be considered stale and removed after 2 days. Read the README for more
|
|
71
80
|
* information.
|
|
81
|
+
* @alpha
|
|
72
82
|
*/
|
|
73
83
|
export interface IPersistedCache {
|
|
74
84
|
/**
|
|
@@ -97,6 +107,7 @@ export interface IPersistedCache {
|
|
|
97
107
|
* Api to generate a cache key from cache entry.
|
|
98
108
|
* @param entry - cache entry from which a cache key is generated
|
|
99
109
|
* @returns The key for cache.
|
|
110
|
+
* @internal
|
|
100
111
|
*/
|
|
101
112
|
export function getKeyForCacheEntry(entry: ICacheEntry): string {
|
|
102
113
|
return `${entry.file.docId}_${entry.type}_${entry.key}`;
|
package/src/resolvedUrl.ts
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @alpha
|
|
10
|
+
*/
|
|
8
11
|
export interface IOdspUrlParts {
|
|
9
12
|
siteUrl: string;
|
|
10
13
|
driveId: string;
|
|
@@ -14,6 +17,7 @@ export interface IOdspUrlParts {
|
|
|
14
17
|
/**
|
|
15
18
|
* @deprecated Use ISharingLinkKind type instead.
|
|
16
19
|
* Type of shareLink requested/created when creating the file for the first time.
|
|
20
|
+
* @alpha
|
|
17
21
|
*/
|
|
18
22
|
export enum ShareLinkTypes {
|
|
19
23
|
csl = "csl",
|
|
@@ -21,6 +25,7 @@ export enum ShareLinkTypes {
|
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
* Sharing scope of the share links created for a file.
|
|
28
|
+
* @alpha
|
|
24
29
|
*/
|
|
25
30
|
export enum SharingLinkScope {
|
|
26
31
|
organization = "organization",
|
|
@@ -31,6 +36,7 @@ export enum SharingLinkScope {
|
|
|
31
36
|
|
|
32
37
|
/**
|
|
33
38
|
* View/edit permission role for a sharing link.
|
|
39
|
+
* @alpha
|
|
34
40
|
*/
|
|
35
41
|
export enum SharingLinkRole {
|
|
36
42
|
view = "view",
|
|
@@ -40,6 +46,7 @@ export enum SharingLinkRole {
|
|
|
40
46
|
/**
|
|
41
47
|
* Defines the permissions scope for a share link requested to be created during the creation the file in ODSP.
|
|
42
48
|
* Providing these properties to the /snapshot api will also create and return the requested kind of sharing link.
|
|
49
|
+
* @alpha
|
|
43
50
|
*/
|
|
44
51
|
export interface ISharingLinkKind {
|
|
45
52
|
scope: SharingLinkScope;
|
|
@@ -52,6 +59,7 @@ export interface ISharingLinkKind {
|
|
|
52
59
|
|
|
53
60
|
/**
|
|
54
61
|
* Sharing link data received from the /snapshot api response.
|
|
62
|
+
* @alpha
|
|
55
63
|
*/
|
|
56
64
|
export interface ISharingLink extends ISharingLinkKind {
|
|
57
65
|
webUrl: string;
|
|
@@ -61,6 +69,7 @@ export interface ISharingLink extends ISharingLinkKind {
|
|
|
61
69
|
* Sharing link data created for the ODSP item.
|
|
62
70
|
* Contains information about either sharing link created while creating a new file or
|
|
63
71
|
* a redeemable share link created when loading an existing file
|
|
72
|
+
* @alpha
|
|
64
73
|
*/
|
|
65
74
|
export interface ShareLinkInfoType {
|
|
66
75
|
/**
|
|
@@ -98,6 +107,9 @@ export interface ShareLinkInfoType {
|
|
|
98
107
|
*/
|
|
99
108
|
sharingLinkToRedeem?: string;
|
|
100
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* @alpha
|
|
112
|
+
*/
|
|
101
113
|
export interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
|
|
102
114
|
type: "fluid";
|
|
103
115
|
odspResolvedUrl: true;
|
package/src/sessionProvider.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Socket storage discovery api response
|
|
10
|
+
* @alpha
|
|
10
11
|
*/
|
|
11
12
|
export interface ISocketStorageDiscovery {
|
|
12
13
|
// The id of the web socket
|
|
@@ -42,6 +43,7 @@ export interface ISocketStorageDiscovery {
|
|
|
42
43
|
/**
|
|
43
44
|
* An interface that allows a concrete instance of a driver factory to interrogate itself
|
|
44
45
|
* to find out if it is session aware.
|
|
46
|
+
* @alpha
|
|
45
47
|
*/
|
|
46
48
|
export interface IProvideSessionAwareDriverFactory {
|
|
47
49
|
readonly IRelaySessionAwareDriverFactory: IRelaySessionAwareDriverFactory;
|
|
@@ -50,6 +52,7 @@ export interface IProvideSessionAwareDriverFactory {
|
|
|
50
52
|
/**
|
|
51
53
|
* An interface that allows a concrete instance of a driver factory to call the `getRelayServiceSessionInfo`
|
|
52
54
|
* function if it session aware.
|
|
55
|
+
* @alpha
|
|
53
56
|
*/
|
|
54
57
|
export interface IRelaySessionAwareDriverFactory extends IProvideSessionAwareDriverFactory {
|
|
55
58
|
getRelayServiceSessionInfo(
|