@fluidframework/odsp-driver-definitions 2.0.0-dev.5.3.2.178189 → 2.0.0-dev.6.4.0.191258
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 +24 -0
- package/README.md +4 -3
- package/dist/errors.d.ts +68 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +56 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/odspCache.d.ts +3 -3
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/odspCache.js +1 -1
- package/dist/odspCache.js.map +1 -1
- package/dist/resolvedUrl.d.ts +2 -2
- package/dist/resolvedUrl.d.ts.map +1 -1
- package/dist/resolvedUrl.js.map +1 -1
- package/lib/errors.d.ts +68 -0
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +55 -0
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/odspCache.d.ts +3 -3
- package/lib/odspCache.d.ts.map +1 -1
- package/lib/odspCache.js +1 -1
- package/lib/odspCache.js.map +1 -1
- package/lib/resolvedUrl.d.ts +2 -2
- package/lib/resolvedUrl.d.ts.map +1 -1
- package/lib/resolvedUrl.js.map +1 -1
- package/package.json +8 -9
- package/src/errors.ts +64 -1
- package/src/index.ts +7 -1
- package/src/odspCache.ts +3 -3
- package/src/resolvedUrl.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @fluidframework/odsp-driver-definitions
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.6.3.0
|
|
4
|
+
|
|
5
|
+
Dependency updates only.
|
|
6
|
+
|
|
7
|
+
## 2.0.0-internal.6.2.0
|
|
8
|
+
|
|
9
|
+
Dependency updates only.
|
|
10
|
+
|
|
11
|
+
## 2.0.0-internal.6.1.0
|
|
12
|
+
|
|
13
|
+
Dependency updates only.
|
|
14
|
+
|
|
15
|
+
## 2.0.0-internal.6.0.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
|
|
20
|
+
|
|
21
|
+
Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
|
|
22
|
+
|
|
23
|
+
## 2.0.0-internal.5.4.0
|
|
24
|
+
|
|
25
|
+
Dependency updates only.
|
|
26
|
+
|
|
3
27
|
## 2.0.0-internal.5.3.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -16,9 +16,10 @@ When taking a dependency on a Fluid Framework library, we recommend using a `^`
|
|
|
16
16
|
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
17
17
|
library consumers should always prefer `^`.
|
|
18
18
|
|
|
19
|
-
Note that when depending on a library version of the form 2.0.0-internal.x.y.z
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
|
|
20
|
+
you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
|
|
21
|
+
Standard `^` and `~` ranges will not work as expected.
|
|
22
|
+
See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
|
|
22
23
|
package for more information including tools to convert between version schemes.
|
|
23
24
|
|
|
24
25
|
<!-- prettier-ignore-end -->
|
package/dist/errors.d.ts
CHANGED
|
@@ -7,6 +7,71 @@ import { DriverError, IDriverErrorBase } from "@fluidframework/driver-definition
|
|
|
7
7
|
* ODSP Error types.
|
|
8
8
|
* Different error types that may be thrown by the ODSP driver.
|
|
9
9
|
*/
|
|
10
|
+
export declare const OdspErrorTypes: {
|
|
11
|
+
/**
|
|
12
|
+
* Storage is out of space
|
|
13
|
+
*/
|
|
14
|
+
readonly outOfStorageError: "outOfStorageError";
|
|
15
|
+
/**
|
|
16
|
+
* Invalid file name (at creation of the file)
|
|
17
|
+
*/
|
|
18
|
+
readonly invalidFileNameError: "invalidFileNameError";
|
|
19
|
+
/**
|
|
20
|
+
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
21
|
+
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
22
|
+
* such case.
|
|
23
|
+
*/
|
|
24
|
+
readonly snapshotTooBig: "snapshotTooBig";
|
|
25
|
+
/**
|
|
26
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
27
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
28
|
+
* such case.
|
|
29
|
+
*/
|
|
30
|
+
readonly fetchTimeout: "fetchTimeout";
|
|
31
|
+
/**
|
|
32
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
33
|
+
*/
|
|
34
|
+
readonly fluidNotEnabled: "fluidNotEnabled";
|
|
35
|
+
/**
|
|
36
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
37
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
38
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
39
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
40
|
+
* copying it over manually)
|
|
41
|
+
*/
|
|
42
|
+
readonly cannotCatchUp: "cannotCatchUp";
|
|
43
|
+
/**
|
|
44
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
45
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
46
|
+
*/
|
|
47
|
+
readonly serviceReadOnly: "serviceReadOnly";
|
|
48
|
+
readonly genericNetworkError: "genericNetworkError";
|
|
49
|
+
readonly authorizationError: "authorizationError";
|
|
50
|
+
readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
|
|
51
|
+
readonly offlineError: "offlineError";
|
|
52
|
+
readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
|
|
53
|
+
readonly writeError: "writeError";
|
|
54
|
+
readonly fetchFailure: "fetchFailure";
|
|
55
|
+
readonly fetchTokenError: "fetchTokenError";
|
|
56
|
+
readonly incorrectServerResponse: "incorrectServerResponse";
|
|
57
|
+
readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
|
|
58
|
+
readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
|
|
59
|
+
readonly locationRedirection: "locationRedirection"; /**
|
|
60
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
61
|
+
*/
|
|
62
|
+
readonly fluidInvalidSchema: "fluidInvalidSchema";
|
|
63
|
+
readonly fileIsLocked: "fileIsLocked";
|
|
64
|
+
readonly genericError: "genericError";
|
|
65
|
+
readonly throttlingError: "throttlingError";
|
|
66
|
+
readonly usageError: "usageError";
|
|
67
|
+
};
|
|
68
|
+
export declare type OdspErrorTypes = typeof OdspErrorTypes[keyof typeof OdspErrorTypes];
|
|
69
|
+
/**
|
|
70
|
+
* ODSP Error types.
|
|
71
|
+
* Different error types that may be thrown by the ODSP driver.
|
|
72
|
+
*
|
|
73
|
+
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
74
|
+
*/
|
|
10
75
|
export declare enum OdspErrorType {
|
|
11
76
|
/**
|
|
12
77
|
* Storage is out of space
|
|
@@ -32,6 +97,9 @@ export declare enum OdspErrorType {
|
|
|
32
97
|
* SPO admin toggle: fluid service is not enabled.
|
|
33
98
|
*/
|
|
34
99
|
fluidNotEnabled = "fluidNotEnabled",
|
|
100
|
+
/**
|
|
101
|
+
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
102
|
+
*/
|
|
35
103
|
fetchTokenError = "fetchTokenError",
|
|
36
104
|
/**
|
|
37
105
|
* This error will be raised when client is too behind with no way to catch up.
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,WAAW,EACX,gBAAgB,EAEhB,MAAM,oCAAoC,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,cAAc;IAI1B;;OAEG;;IAGH;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;;;;;;;;;;;;yDAoCH;;OAEG;;;;;;CApCM,CAAC;AACX,oBAAY,cAAc,GAAG,OAAO,cAAc,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEhF;;;;;GAKG;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;CACnC;AAED,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;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,EAAE,uBAAuB;IAC/F,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;CAClC;AAED,oBAAY,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
|
package/dist/errors.js
CHANGED
|
@@ -1,10 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OdspErrorType = void 0;
|
|
3
|
+
exports.OdspErrorType = exports.OdspErrorTypes = void 0;
|
|
4
|
+
/*!
|
|
5
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
6
|
+
* Licensed under the MIT License.
|
|
7
|
+
*/
|
|
8
|
+
const driver_definitions_1 = require("@fluidframework/driver-definitions");
|
|
4
9
|
/**
|
|
5
10
|
* ODSP Error types.
|
|
6
11
|
* Different error types that may be thrown by the ODSP driver.
|
|
7
12
|
*/
|
|
13
|
+
exports.OdspErrorTypes = {
|
|
14
|
+
// Inherit base driver error types
|
|
15
|
+
...driver_definitions_1.DriverErrorTypes,
|
|
16
|
+
/**
|
|
17
|
+
* Storage is out of space
|
|
18
|
+
*/
|
|
19
|
+
outOfStorageError: "outOfStorageError",
|
|
20
|
+
/**
|
|
21
|
+
* Invalid file name (at creation of the file)
|
|
22
|
+
*/
|
|
23
|
+
invalidFileNameError: "invalidFileNameError",
|
|
24
|
+
/**
|
|
25
|
+
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
26
|
+
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
27
|
+
* such case.
|
|
28
|
+
*/
|
|
29
|
+
snapshotTooBig: "snapshotTooBig",
|
|
30
|
+
/**
|
|
31
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
32
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
33
|
+
* such case.
|
|
34
|
+
*/
|
|
35
|
+
fetchTimeout: "fetchTimeout",
|
|
36
|
+
/**
|
|
37
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
38
|
+
*/
|
|
39
|
+
fluidNotEnabled: "fluidNotEnabled",
|
|
40
|
+
/**
|
|
41
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
42
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
43
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
44
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
45
|
+
* copying it over manually)
|
|
46
|
+
*/
|
|
47
|
+
cannotCatchUp: "cannotCatchUp",
|
|
48
|
+
/**
|
|
49
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
50
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
51
|
+
*/
|
|
52
|
+
serviceReadOnly: "serviceReadOnly",
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* ODSP Error types.
|
|
56
|
+
* Different error types that may be thrown by the ODSP driver.
|
|
57
|
+
*
|
|
58
|
+
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
59
|
+
*/
|
|
8
60
|
var OdspErrorType;
|
|
9
61
|
(function (OdspErrorType) {
|
|
10
62
|
/**
|
|
@@ -31,6 +83,9 @@ var OdspErrorType;
|
|
|
31
83
|
* SPO admin toggle: fluid service is not enabled.
|
|
32
84
|
*/
|
|
33
85
|
OdspErrorType["fluidNotEnabled"] = "fluidNotEnabled";
|
|
86
|
+
/**
|
|
87
|
+
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
88
|
+
*/
|
|
34
89
|
OdspErrorType["fetchTokenError"] = "fetchTokenError";
|
|
35
90
|
/**
|
|
36
91
|
* This error will be raised when client is too behind with no way to catch up.
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,2EAI4C;AAE5C;;;GAGG;AACU,QAAA,cAAc,GAAG;IAC7B,kCAAkC;IAClC,GAAG,qCAAgB;IAEnB;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;IAEtC;;OAEG;IACH,oBAAoB,EAAE,sBAAsB;IAE5C;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;OAIG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;;;;;OAMG;IACH,aAAa,EAAE,eAAe;IAE9B;;;OAGG;IACH,eAAe,EAAE,iBAAiB;CACzB,CAAC;AAGX;;;;;GAKG;AACH,IAAY,aAiDX;AAjDD,WAAY,aAAa;IACxB;;OAEG;IACH,wDAAuC,CAAA;IAEvC;;OAEG;IACH,8DAA6C,CAAA;IAE7C;;;;OAIG;IACH,kDAAiC,CAAA;IAEjC;;;;OAIG;IACH,8CAA6B,CAAA;IAE7B;;OAEG;IACH,oDAAmC,CAAA;IAEnC;;OAEG;IACH,oDAAmC,CAAA;IAEnC;;;;;;OAMG;IACH,gDAA+B,CAAA;IAE/B;;;OAGG;IACH,oDAAmC,CAAA;AACpC,CAAC,EAjDW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAiDxB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tDriverError,\n\tIDriverErrorBase,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions\";\n\n/**\n * ODSP Error types.\n * Different error types that may be thrown by the ODSP driver.\n */\nexport const OdspErrorTypes = {\n\t// Inherit base driver error types\n\t...DriverErrorTypes,\n\n\t/**\n\t * Storage is out of space\n\t */\n\toutOfStorageError: \"outOfStorageError\",\n\n\t/**\n\t * Invalid file name (at creation of the file)\n\t */\n\tinvalidFileNameError: \"invalidFileNameError\",\n\n\t/**\n\t * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger\n\t * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tsnapshotTooBig: \"snapshotTooBig\",\n\n\t/**\n\t * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when\n\t * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tfetchTimeout: \"fetchTimeout\",\n\n\t/**\n\t * SPO admin toggle: fluid service is not enabled.\n\t */\n\tfluidNotEnabled: \"fluidNotEnabled\",\n\n\t/**\n\t * This error will be raised when client is too behind with no way to catch up.\n\t * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted\n\t * by storage, and thus removing an ability for client to catch up.\n\t * This condition will result in any local changes being lost (i.e. only way to save state is by user\n\t * copying it over manually)\n\t */\n\tcannotCatchUp: \"cannotCatchUp\",\n\n\t/**\n\t * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.\n\t * So to preserve integrity of the data, the data becomes readonly.\n\t */\n\tserviceReadOnly: \"serviceReadOnly\",\n} as const;\nexport type OdspErrorTypes = typeof OdspErrorTypes[keyof typeof OdspErrorTypes];\n\n/**\n * ODSP Error types.\n * Different error types that may be thrown by the ODSP driver.\n *\n * @deprecated Use {@link (OdspErrorTypes:variable)} instead.\n */\nexport enum OdspErrorType {\n\t/**\n\t * Storage is out of space\n\t */\n\toutOfStorageError = \"outOfStorageError\",\n\n\t/**\n\t * Invalid file name (at creation of the file)\n\t */\n\tinvalidFileNameError = \"invalidFileNameError\",\n\n\t/**\n\t * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger\n\t * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tsnapshotTooBig = \"snapshotTooBig\",\n\n\t/**\n\t * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when\n\t * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tfetchTimeout = \"fetchTimeout\",\n\n\t/**\n\t * SPO admin toggle: fluid service is not enabled.\n\t */\n\tfluidNotEnabled = \"fluidNotEnabled\",\n\n\t/**\n\t * {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}\n\t */\n\tfetchTokenError = \"fetchTokenError\",\n\n\t/**\n\t * This error will be raised when client is too behind with no way to catch up.\n\t * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted\n\t * by storage, and thus removing an ability for client to catch up.\n\t * This condition will result in any local changes being lost (i.e. only way to save state is by user\n\t * copying it over manually)\n\t */\n\tcannotCatchUp = \"cannotCatchUp\",\n\n\t/**\n\t * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.\n\t * So to preserve integrity of the data, the data becomes readonly.\n\t */\n\tserviceReadOnly = \"serviceReadOnly\",\n}\n\nexport interface IOdspErrorAugmentations {\n\t/**\n\t * Server epoch indicates when the file was last modified.\n\t * Used to detect modifications outside Fluid's services\n\t */\n\tserverEpoch?: string;\n\n\t/**\n\t * It is the redirection url at which the network call should have been made. It is due to change\n\t * in site domain of the file on server.\n\t */\n\tredirectLocation?: string;\n\n\t/**\n\t * It is array of error codes included in error response from server.\n\t */\n\tfacetCodes?: string[];\n}\n\n/**\n * Base interface for all errors and warnings\n * Superset of IDriverErrorBase, but with Odsp-specific errorType and properties\n */\nexport interface IOdspError extends Omit<IDriverErrorBase, \"errorType\">, IOdspErrorAugmentations {\n\treadonly errorType: OdspErrorType;\n}\n\nexport type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorType } from "./errors";
|
|
5
|
+
export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorType, OdspErrorTypes, } from "./errors";
|
|
6
6
|
export { HostStoragePolicy, ICollabSessionOptions, IOpsCachingPolicy, ISnapshotOptions, } from "./factory";
|
|
7
7
|
export { CacheContentType, getKeyForCacheEntry, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey, } from "./odspCache";
|
|
8
8
|
export { IOdspResolvedUrl, IOdspUrlParts, ISharingLink, ISharingLinkKind, ShareLinkInfoType, ShareLinkTypes, SharingLinkRole, SharingLinkScope, } from "./resolvedUrl";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,cAAc,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,YAAY,EACZ,+BAA+B,EAC/B,gBAAgB,EAChB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,iCAAiC,EACjC,+BAA+B,EAC/B,uBAAuB,GACvB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.tokenFromResponse = exports.isTokenFromCache = exports.SharingLinkScope = exports.SharingLinkRole = exports.ShareLinkTypes = exports.snapshotKey = exports.getKeyForCacheEntry = exports.OdspErrorType = void 0;
|
|
7
|
+
exports.tokenFromResponse = exports.isTokenFromCache = exports.SharingLinkScope = exports.SharingLinkRole = exports.ShareLinkTypes = exports.snapshotKey = exports.getKeyForCacheEntry = exports.OdspErrorTypes = exports.OdspErrorType = void 0;
|
|
8
8
|
var errors_1 = require("./errors");
|
|
9
9
|
Object.defineProperty(exports, "OdspErrorType", { enumerable: true, get: function () { return errors_1.OdspErrorType; } });
|
|
10
|
+
Object.defineProperty(exports, "OdspErrorTypes", { enumerable: true, get: function () { return errors_1.OdspErrorTypes; } });
|
|
10
11
|
var odspCache_1 = require("./odspCache");
|
|
11
12
|
Object.defineProperty(exports, "getKeyForCacheEntry", { enumerable: true, get: function () { return odspCache_1.getKeyForCacheEntry; } });
|
|
12
13
|
Object.defineProperty(exports, "snapshotKey", { enumerable: true, get: function () { return odspCache_1.snapshotKey; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mCAMkB;AAFjB,uGAAA,aAAa,OAAA;AACb,wGAAA,cAAc,OAAA;AAQf,yCAQqB;AANpB,gHAAA,mBAAmB,OAAA;AAKnB,wGAAA,WAAW,OAAA;AAEZ,6CASuB;AAHtB,6GAAA,cAAc,OAAA;AACd,8GAAA,eAAe,OAAA;AACf,+GAAA,gBAAgB,OAAA;AAEjB,2CASsB;AANrB,8GAAA,gBAAgB,OAAA;AAIhB,+GAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tIOdspError,\n\tIOdspErrorAugmentations,\n\tOdspError,\n\tOdspErrorType,\n\tOdspErrorTypes,\n} from \"./errors\";\nexport {\n\tHostStoragePolicy,\n\tICollabSessionOptions,\n\tIOpsCachingPolicy,\n\tISnapshotOptions,\n} from \"./factory\";\nexport {\n\tCacheContentType,\n\tgetKeyForCacheEntry,\n\tICacheEntry,\n\tIEntry,\n\tIFileEntry,\n\tIPersistedCache,\n\tsnapshotKey,\n} from \"./odspCache\";\nexport {\n\tIOdspResolvedUrl,\n\tIOdspUrlParts,\n\tISharingLink,\n\tISharingLinkKind,\n\tShareLinkInfoType,\n\tShareLinkTypes,\n\tSharingLinkRole,\n\tSharingLinkScope,\n} from \"./resolvedUrl\";\nexport {\n\tIdentityType,\n\tInstrumentedStorageTokenFetcher,\n\tisTokenFromCache,\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n\tTokenFetchOptions,\n\ttokenFromResponse,\n\tTokenResponse,\n} from \"./tokenFetch\";\nexport {\n\tIProvideSessionAwareDriverFactory,\n\tIRelaySessionAwareDriverFactory,\n\tISocketStorageDiscovery,\n} from \"./sessionProvider\";\n"]}
|
package/dist/odspCache.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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
8
|
*/
|
|
@@ -20,7 +20,7 @@ export interface IFileEntry {
|
|
|
20
20
|
* a file if user requests so.
|
|
21
21
|
* This is IOdspResolvedUrl in case of ODSP driver.
|
|
22
22
|
*/
|
|
23
|
-
resolvedUrl:
|
|
23
|
+
resolvedUrl: IResolvedUrl;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
|
|
@@ -81,7 +81,7 @@ export interface IPersistedCache {
|
|
|
81
81
|
/**
|
|
82
82
|
* Api to generate a cache key from cache entry.
|
|
83
83
|
* @param entry - cache entry from which a cache key is generated
|
|
84
|
-
* @returns
|
|
84
|
+
* @returns The key for cache.
|
|
85
85
|
*/
|
|
86
86
|
export declare function getKeyForCacheEntry(entry: ICacheEntry): string;
|
|
87
87
|
//# 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;;GAEG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC,oBAAY,gBAAgB,GAAG,UAAU,GAAG,KAAK,CAAC;AAOlD,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,EAAE,YAAY,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACtB;;;;OAIG;IACH,IAAI,EAAE,gBAAgB,CAAC;IAEvB;;;;;;;OAOG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,MAAM;IAC1C;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;GAMG;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;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE9D"}
|
package/dist/odspCache.js
CHANGED
|
@@ -12,7 +12,7 @@ exports.snapshotKey = "snapshot";
|
|
|
12
12
|
/**
|
|
13
13
|
* Api to generate a cache key from cache entry.
|
|
14
14
|
* @param entry - cache entry from which a cache key is generated
|
|
15
|
-
* @returns
|
|
15
|
+
* @returns The key for cache.
|
|
16
16
|
*/
|
|
17
17
|
function getKeyForCacheEntry(entry) {
|
|
18
18
|
return `${entry.file.docId}_${entry.type}_${entry.key}`;
|
package/dist/odspCache.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspCache.js","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACU,QAAA,WAAW,GAAG,UAAU,CAAC;AAqFtC;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,KAAkB;IACrD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;AACzD,CAAC;AAFD,kDAEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"odspCache.js","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACU,QAAA,WAAW,GAAG,UAAU,CAAC;AAqFtC;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,KAAkB;IACrD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;AACzD,CAAC;AAFD,kDAEC","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 */\nexport const snapshotKey = \"snapshot\";\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 */\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 */\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 */\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 */\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 */\nexport function getKeyForCacheEntry(entry: ICacheEntry): string {\n\treturn `${entry.file.docId}_${entry.type}_${entry.key}`;\n}\n"]}
|
package/dist/resolvedUrl.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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
|
export interface IOdspUrlParts {
|
|
7
7
|
siteUrl: string;
|
|
8
8
|
driveId: string;
|
|
@@ -82,7 +82,7 @@ export interface ShareLinkInfoType {
|
|
|
82
82
|
*/
|
|
83
83
|
sharingLinkToRedeem?: string;
|
|
84
84
|
}
|
|
85
|
-
export interface IOdspResolvedUrl extends
|
|
85
|
+
export interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
|
|
86
86
|
type: "fluid";
|
|
87
87
|
odspResolvedUrl: true;
|
|
88
88
|
url: string;
|
|
@@ -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,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,oBAAY,cAAc;IACzB,GAAG,QAAQ;CACX;AAED;;GAEG;AACH,oBAAY,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,OAAO,YAAY;CACnB;AAED;;GAEG;AACH,oBAAY,eAAe;IAC1B,IAAI,SAAS;IACb,IAAI,SAAS;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE,gBAAgB,CAAC;IAKxB,IAAI,CAAC,EAAE,eAAe,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACrD,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;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,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/dist/resolvedUrl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedUrl.js","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH;;;GAGG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,6BAAW,CAAA;AACZ,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB;AAED;;GAEG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;IACf,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;AACpB,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B;AAED;;GAEG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,gCAAa,CAAA;IACb,gCAAa,CAAA;AACd,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"resolvedUrl.js","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH;;;GAGG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,6BAAW,CAAA;AACZ,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB;AAED;;GAEG;AACH,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,iDAA6B,CAAA;IAC7B,mCAAe,CAAA;IACf,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;AACpB,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B;AAED;;GAEG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,gCAAa,CAAA;IACb,gCAAa,CAAA;AACd,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,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\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 */\nexport enum ShareLinkTypes {\n\tcsl = \"csl\",\n}\n\n/**\n * Sharing scope of the share links created for a file.\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 */\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 */\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 */\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 */\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}\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/errors.d.ts
CHANGED
|
@@ -7,6 +7,71 @@ import { DriverError, IDriverErrorBase } from "@fluidframework/driver-definition
|
|
|
7
7
|
* ODSP Error types.
|
|
8
8
|
* Different error types that may be thrown by the ODSP driver.
|
|
9
9
|
*/
|
|
10
|
+
export declare const OdspErrorTypes: {
|
|
11
|
+
/**
|
|
12
|
+
* Storage is out of space
|
|
13
|
+
*/
|
|
14
|
+
readonly outOfStorageError: "outOfStorageError";
|
|
15
|
+
/**
|
|
16
|
+
* Invalid file name (at creation of the file)
|
|
17
|
+
*/
|
|
18
|
+
readonly invalidFileNameError: "invalidFileNameError";
|
|
19
|
+
/**
|
|
20
|
+
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
21
|
+
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
22
|
+
* such case.
|
|
23
|
+
*/
|
|
24
|
+
readonly snapshotTooBig: "snapshotTooBig";
|
|
25
|
+
/**
|
|
26
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
27
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
28
|
+
* such case.
|
|
29
|
+
*/
|
|
30
|
+
readonly fetchTimeout: "fetchTimeout";
|
|
31
|
+
/**
|
|
32
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
33
|
+
*/
|
|
34
|
+
readonly fluidNotEnabled: "fluidNotEnabled";
|
|
35
|
+
/**
|
|
36
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
37
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
38
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
39
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
40
|
+
* copying it over manually)
|
|
41
|
+
*/
|
|
42
|
+
readonly cannotCatchUp: "cannotCatchUp";
|
|
43
|
+
/**
|
|
44
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
45
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
46
|
+
*/
|
|
47
|
+
readonly serviceReadOnly: "serviceReadOnly";
|
|
48
|
+
readonly genericNetworkError: "genericNetworkError";
|
|
49
|
+
readonly authorizationError: "authorizationError";
|
|
50
|
+
readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
|
|
51
|
+
readonly offlineError: "offlineError";
|
|
52
|
+
readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
|
|
53
|
+
readonly writeError: "writeError";
|
|
54
|
+
readonly fetchFailure: "fetchFailure";
|
|
55
|
+
readonly fetchTokenError: "fetchTokenError";
|
|
56
|
+
readonly incorrectServerResponse: "incorrectServerResponse";
|
|
57
|
+
readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
|
|
58
|
+
readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
|
|
59
|
+
readonly locationRedirection: "locationRedirection"; /**
|
|
60
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
61
|
+
*/
|
|
62
|
+
readonly fluidInvalidSchema: "fluidInvalidSchema";
|
|
63
|
+
readonly fileIsLocked: "fileIsLocked";
|
|
64
|
+
readonly genericError: "genericError";
|
|
65
|
+
readonly throttlingError: "throttlingError";
|
|
66
|
+
readonly usageError: "usageError";
|
|
67
|
+
};
|
|
68
|
+
export declare type OdspErrorTypes = typeof OdspErrorTypes[keyof typeof OdspErrorTypes];
|
|
69
|
+
/**
|
|
70
|
+
* ODSP Error types.
|
|
71
|
+
* Different error types that may be thrown by the ODSP driver.
|
|
72
|
+
*
|
|
73
|
+
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
74
|
+
*/
|
|
10
75
|
export declare enum OdspErrorType {
|
|
11
76
|
/**
|
|
12
77
|
* Storage is out of space
|
|
@@ -32,6 +97,9 @@ export declare enum OdspErrorType {
|
|
|
32
97
|
* SPO admin toggle: fluid service is not enabled.
|
|
33
98
|
*/
|
|
34
99
|
fluidNotEnabled = "fluidNotEnabled",
|
|
100
|
+
/**
|
|
101
|
+
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
102
|
+
*/
|
|
35
103
|
fetchTokenError = "fetchTokenError",
|
|
36
104
|
/**
|
|
37
105
|
* This error will be raised when client is too behind with no way to catch up.
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,WAAW,EACX,gBAAgB,EAEhB,MAAM,oCAAoC,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,cAAc;IAI1B;;OAEG;;IAGH;;OAEG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;;;;;;;;;;;;yDAoCH;;OAEG;;;;;;CApCM,CAAC;AACX,oBAAY,cAAc,GAAG,OAAO,cAAc,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEhF;;;;;GAKG;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;CACnC;AAED,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;;;GAGG;AACH,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,EAAE,uBAAuB;IAC/F,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;CAClC;AAED,oBAAY,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
|
package/lib/errors.js
CHANGED
|
@@ -1,7 +1,59 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { DriverErrorTypes, } from "@fluidframework/driver-definitions";
|
|
1
6
|
/**
|
|
2
7
|
* ODSP Error types.
|
|
3
8
|
* Different error types that may be thrown by the ODSP driver.
|
|
4
9
|
*/
|
|
10
|
+
export const OdspErrorTypes = {
|
|
11
|
+
// Inherit base driver error types
|
|
12
|
+
...DriverErrorTypes,
|
|
13
|
+
/**
|
|
14
|
+
* Storage is out of space
|
|
15
|
+
*/
|
|
16
|
+
outOfStorageError: "outOfStorageError",
|
|
17
|
+
/**
|
|
18
|
+
* Invalid file name (at creation of the file)
|
|
19
|
+
*/
|
|
20
|
+
invalidFileNameError: "invalidFileNameError",
|
|
21
|
+
/**
|
|
22
|
+
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
23
|
+
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
24
|
+
* such case.
|
|
25
|
+
*/
|
|
26
|
+
snapshotTooBig: "snapshotTooBig",
|
|
27
|
+
/**
|
|
28
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
29
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
30
|
+
* such case.
|
|
31
|
+
*/
|
|
32
|
+
fetchTimeout: "fetchTimeout",
|
|
33
|
+
/**
|
|
34
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
35
|
+
*/
|
|
36
|
+
fluidNotEnabled: "fluidNotEnabled",
|
|
37
|
+
/**
|
|
38
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
39
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
40
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
41
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
42
|
+
* copying it over manually)
|
|
43
|
+
*/
|
|
44
|
+
cannotCatchUp: "cannotCatchUp",
|
|
45
|
+
/**
|
|
46
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
47
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
48
|
+
*/
|
|
49
|
+
serviceReadOnly: "serviceReadOnly",
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* ODSP Error types.
|
|
53
|
+
* Different error types that may be thrown by the ODSP driver.
|
|
54
|
+
*
|
|
55
|
+
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
56
|
+
*/
|
|
5
57
|
export var OdspErrorType;
|
|
6
58
|
(function (OdspErrorType) {
|
|
7
59
|
/**
|
|
@@ -28,6 +80,9 @@ export var OdspErrorType;
|
|
|
28
80
|
* SPO admin toggle: fluid service is not enabled.
|
|
29
81
|
*/
|
|
30
82
|
OdspErrorType["fluidNotEnabled"] = "fluidNotEnabled";
|
|
83
|
+
/**
|
|
84
|
+
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
85
|
+
*/
|
|
31
86
|
OdspErrorType["fetchTokenError"] = "fetchTokenError";
|
|
32
87
|
/**
|
|
33
88
|
* This error will be raised when client is too behind with no way to catch up.
|
package/lib/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGN,gBAAgB,GAChB,MAAM,oCAAoC,CAAC;AAE5C;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,kCAAkC;IAClC,GAAG,gBAAgB;IAEnB;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;IAEtC;;OAEG;IACH,oBAAoB,EAAE,sBAAsB;IAE5C;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;OAIG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;;;;;OAMG;IACH,aAAa,EAAE,eAAe;IAE9B;;;OAGG;IACH,eAAe,EAAE,iBAAiB;CACzB,CAAC;AAGX;;;;;GAKG;AACH,MAAM,CAAN,IAAY,aAiDX;AAjDD,WAAY,aAAa;IACxB;;OAEG;IACH,wDAAuC,CAAA;IAEvC;;OAEG;IACH,8DAA6C,CAAA;IAE7C;;;;OAIG;IACH,kDAAiC,CAAA;IAEjC;;;;OAIG;IACH,8CAA6B,CAAA;IAE7B;;OAEG;IACH,oDAAmC,CAAA;IAEnC;;OAEG;IACH,oDAAmC,CAAA;IAEnC;;;;;;OAMG;IACH,gDAA+B,CAAA;IAE/B;;;OAGG;IACH,oDAAmC,CAAA;AACpC,CAAC,EAjDW,aAAa,KAAb,aAAa,QAiDxB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport {\n\tDriverError,\n\tIDriverErrorBase,\n\tDriverErrorTypes,\n} from \"@fluidframework/driver-definitions\";\n\n/**\n * ODSP Error types.\n * Different error types that may be thrown by the ODSP driver.\n */\nexport const OdspErrorTypes = {\n\t// Inherit base driver error types\n\t...DriverErrorTypes,\n\n\t/**\n\t * Storage is out of space\n\t */\n\toutOfStorageError: \"outOfStorageError\",\n\n\t/**\n\t * Invalid file name (at creation of the file)\n\t */\n\tinvalidFileNameError: \"invalidFileNameError\",\n\n\t/**\n\t * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger\n\t * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tsnapshotTooBig: \"snapshotTooBig\",\n\n\t/**\n\t * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when\n\t * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tfetchTimeout: \"fetchTimeout\",\n\n\t/**\n\t * SPO admin toggle: fluid service is not enabled.\n\t */\n\tfluidNotEnabled: \"fluidNotEnabled\",\n\n\t/**\n\t * This error will be raised when client is too behind with no way to catch up.\n\t * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted\n\t * by storage, and thus removing an ability for client to catch up.\n\t * This condition will result in any local changes being lost (i.e. only way to save state is by user\n\t * copying it over manually)\n\t */\n\tcannotCatchUp: \"cannotCatchUp\",\n\n\t/**\n\t * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.\n\t * So to preserve integrity of the data, the data becomes readonly.\n\t */\n\tserviceReadOnly: \"serviceReadOnly\",\n} as const;\nexport type OdspErrorTypes = typeof OdspErrorTypes[keyof typeof OdspErrorTypes];\n\n/**\n * ODSP Error types.\n * Different error types that may be thrown by the ODSP driver.\n *\n * @deprecated Use {@link (OdspErrorTypes:variable)} instead.\n */\nexport enum OdspErrorType {\n\t/**\n\t * Storage is out of space\n\t */\n\toutOfStorageError = \"outOfStorageError\",\n\n\t/**\n\t * Invalid file name (at creation of the file)\n\t */\n\tinvalidFileNameError = \"invalidFileNameError\",\n\n\t/**\n\t * Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger\n\t * that that limit, thus request failed. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tsnapshotTooBig = \"snapshotTooBig\",\n\n\t/**\n\t * Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when\n\t * that limit is reached, request fails. Hosting application is expected to have fall-back behavior for\n\t * such case.\n\t */\n\tfetchTimeout = \"fetchTimeout\",\n\n\t/**\n\t * SPO admin toggle: fluid service is not enabled.\n\t */\n\tfluidNotEnabled = \"fluidNotEnabled\",\n\n\t/**\n\t * {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}\n\t */\n\tfetchTokenError = \"fetchTokenError\",\n\n\t/**\n\t * This error will be raised when client is too behind with no way to catch up.\n\t * This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted\n\t * by storage, and thus removing an ability for client to catch up.\n\t * This condition will result in any local changes being lost (i.e. only way to save state is by user\n\t * copying it over manually)\n\t */\n\tcannotCatchUp = \"cannotCatchUp\",\n\n\t/**\n\t * SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.\n\t * So to preserve integrity of the data, the data becomes readonly.\n\t */\n\tserviceReadOnly = \"serviceReadOnly\",\n}\n\nexport interface IOdspErrorAugmentations {\n\t/**\n\t * Server epoch indicates when the file was last modified.\n\t * Used to detect modifications outside Fluid's services\n\t */\n\tserverEpoch?: string;\n\n\t/**\n\t * It is the redirection url at which the network call should have been made. It is due to change\n\t * in site domain of the file on server.\n\t */\n\tredirectLocation?: string;\n\n\t/**\n\t * It is array of error codes included in error response from server.\n\t */\n\tfacetCodes?: string[];\n}\n\n/**\n * Base interface for all errors and warnings\n * Superset of IDriverErrorBase, but with Odsp-specific errorType and properties\n */\nexport interface IOdspError extends Omit<IDriverErrorBase, \"errorType\">, IOdspErrorAugmentations {\n\treadonly errorType: OdspErrorType;\n}\n\nexport type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorType } from "./errors";
|
|
5
|
+
export { IOdspError, IOdspErrorAugmentations, OdspError, OdspErrorType, OdspErrorTypes, } from "./errors";
|
|
6
6
|
export { HostStoragePolicy, ICollabSessionOptions, IOpsCachingPolicy, ISnapshotOptions, } from "./factory";
|
|
7
7
|
export { CacheContentType, getKeyForCacheEntry, ICacheEntry, IEntry, IFileEntry, IPersistedCache, snapshotKey, } from "./odspCache";
|
|
8
8
|
export { IOdspResolvedUrl, IOdspUrlParts, ISharingLink, ISharingLinkKind, ShareLinkInfoType, ShareLinkTypes, SharingLinkRole, SharingLinkScope, } from "./resolvedUrl";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,cAAc,GACd,MAAM,UAAU,CAAC;AAClB,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,UAAU,EACV,eAAe,EACf,WAAW,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,gBAAgB,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,YAAY,EACZ,+BAA+B,EAC/B,gBAAgB,EAChB,6BAA6B,EAC7B,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,iCAAiC,EACjC,+BAA+B,EAC/B,uBAAuB,GACvB,MAAM,mBAAmB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { OdspErrorType } from "./errors";
|
|
5
|
+
export { OdspErrorType, OdspErrorTypes, } from "./errors";
|
|
6
6
|
export { getKeyForCacheEntry, snapshotKey, } from "./odspCache";
|
|
7
7
|
export { ShareLinkTypes, SharingLinkRole, SharingLinkScope, } from "./resolvedUrl";
|
|
8
8
|
export { isTokenFromCache, tokenFromResponse, } from "./tokenFetch";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIN,aAAa,EACb,cAAc,GACd,MAAM,UAAU,CAAC;AAOlB,OAAO,EAEN,mBAAmB,EAKnB,WAAW,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAMN,cAAc,EACd,eAAe,EACf,gBAAgB,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAGN,gBAAgB,EAIhB,iBAAiB,GAEjB,MAAM,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tIOdspError,\n\tIOdspErrorAugmentations,\n\tOdspError,\n\tOdspErrorType,\n\tOdspErrorTypes,\n} from \"./errors\";\nexport {\n\tHostStoragePolicy,\n\tICollabSessionOptions,\n\tIOpsCachingPolicy,\n\tISnapshotOptions,\n} from \"./factory\";\nexport {\n\tCacheContentType,\n\tgetKeyForCacheEntry,\n\tICacheEntry,\n\tIEntry,\n\tIFileEntry,\n\tIPersistedCache,\n\tsnapshotKey,\n} from \"./odspCache\";\nexport {\n\tIOdspResolvedUrl,\n\tIOdspUrlParts,\n\tISharingLink,\n\tISharingLinkKind,\n\tShareLinkInfoType,\n\tShareLinkTypes,\n\tSharingLinkRole,\n\tSharingLinkScope,\n} from \"./resolvedUrl\";\nexport {\n\tIdentityType,\n\tInstrumentedStorageTokenFetcher,\n\tisTokenFromCache,\n\tOdspResourceTokenFetchOptions,\n\tTokenFetcher,\n\tTokenFetchOptions,\n\ttokenFromResponse,\n\tTokenResponse,\n} from \"./tokenFetch\";\nexport {\n\tIProvideSessionAwareDriverFactory,\n\tIRelaySessionAwareDriverFactory,\n\tISocketStorageDiscovery,\n} from \"./sessionProvider\";\n"]}
|
package/lib/odspCache.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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
8
|
*/
|
|
@@ -20,7 +20,7 @@ export interface IFileEntry {
|
|
|
20
20
|
* a file if user requests so.
|
|
21
21
|
* This is IOdspResolvedUrl in case of ODSP driver.
|
|
22
22
|
*/
|
|
23
|
-
resolvedUrl:
|
|
23
|
+
resolvedUrl: IResolvedUrl;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Cache entry. Identifies file that this entry belongs to, and type of content stored in it.
|
|
@@ -81,7 +81,7 @@ export interface IPersistedCache {
|
|
|
81
81
|
/**
|
|
82
82
|
* Api to generate a cache key from cache entry.
|
|
83
83
|
* @param entry - cache entry from which a cache key is generated
|
|
84
|
-
* @returns
|
|
84
|
+
* @returns The key for cache.
|
|
85
85
|
*/
|
|
86
86
|
export declare function getKeyForCacheEntry(entry: ICacheEntry): string;
|
|
87
87
|
//# sourceMappingURL=odspCache.d.ts.map
|
package/lib/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;;GAEG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC,oBAAY,gBAAgB,GAAG,UAAU,GAAG,KAAK,CAAC;AAOlD,MAAM,WAAW,UAAU;IAC1B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,EAAE,YAAY,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACtB;;;;OAIG;IACH,IAAI,EAAE,gBAAgB,CAAC;IAEvB;;;;;;;OAOG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,MAAM;IAC1C;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CACjB;AAED;;;;;;GAMG;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;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAE9D"}
|
package/lib/odspCache.js
CHANGED
|
@@ -9,7 +9,7 @@ export const snapshotKey = "snapshot";
|
|
|
9
9
|
/**
|
|
10
10
|
* Api to generate a cache key from cache entry.
|
|
11
11
|
* @param entry - cache entry from which a cache key is generated
|
|
12
|
-
* @returns
|
|
12
|
+
* @returns The key for cache.
|
|
13
13
|
*/
|
|
14
14
|
export function getKeyForCacheEntry(entry) {
|
|
15
15
|
return `${entry.file.docId}_${entry.type}_${entry.key}`;
|
package/lib/odspCache.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odspCache.js","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AAqFtC;;;;GAIG;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 {
|
|
1
|
+
{"version":3,"file":"odspCache.js","sourceRoot":"","sources":["../src/odspCache.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AAqFtC;;;;GAIG;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 */\nexport const snapshotKey = \"snapshot\";\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 */\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 */\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 */\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 */\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 */\nexport function getKeyForCacheEntry(entry: ICacheEntry): string {\n\treturn `${entry.file.docId}_${entry.type}_${entry.key}`;\n}\n"]}
|
package/lib/resolvedUrl.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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
|
export interface IOdspUrlParts {
|
|
7
7
|
siteUrl: string;
|
|
8
8
|
driveId: string;
|
|
@@ -82,7 +82,7 @@ export interface ShareLinkInfoType {
|
|
|
82
82
|
*/
|
|
83
83
|
sharingLinkToRedeem?: string;
|
|
84
84
|
}
|
|
85
|
-
export interface IOdspResolvedUrl extends
|
|
85
|
+
export interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
|
|
86
86
|
type: "fluid";
|
|
87
87
|
odspResolvedUrl: true;
|
|
88
88
|
url: string;
|
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;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,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,oBAAY,cAAc;IACzB,GAAG,QAAQ;CACX;AAED;;GAEG;AACH,oBAAY,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,OAAO,YAAY;CACnB;AAED;;GAEG;AACH,oBAAY,eAAe;IAC1B,IAAI,SAAS;IACb,IAAI,SAAS;CACb;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE,gBAAgB,CAAC;IAKxB,IAAI,CAAC,EAAE,eAAe,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACrD,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;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,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.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvedUrl.js","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH;;;GAGG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,6BAAW,CAAA;AACZ,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;GAEG;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;;GAEG;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 {
|
|
1
|
+
{"version":3,"file":"resolvedUrl.js","sourceRoot":"","sources":["../src/resolvedUrl.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH;;;GAGG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACzB,6BAAW,CAAA;AACZ,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;GAEG;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;;GAEG;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\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 */\nexport enum ShareLinkTypes {\n\tcsl = \"csl\",\n}\n\n/**\n * Sharing scope of the share links created for a file.\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 */\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 */\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 */\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 */\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}\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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/odsp-driver-definitions",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.6.4.0.191258",
|
|
4
4
|
"description": "Socket storage implementation for SPO and ODC",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,17 +15,16 @@
|
|
|
15
15
|
"module": "lib/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@fluidframework/driver-definitions": "2.0.0-dev.
|
|
18
|
+
"@fluidframework/driver-definitions": "2.0.0-dev.6.4.0.191258"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@fluid-tools/build-cli": "^0.
|
|
22
|
-
"@fluidframework/build-common": "^
|
|
23
|
-
"@fluidframework/build-tools": "^0.
|
|
24
|
-
"@fluidframework/eslint-config-fluid": "^2.
|
|
25
|
-
"@fluidframework/odsp-driver-definitions-previous": "npm:@fluidframework/odsp-driver-definitions@2.0.0-internal.
|
|
21
|
+
"@fluid-tools/build-cli": "^0.22.0",
|
|
22
|
+
"@fluidframework/build-common": "^2.0.0",
|
|
23
|
+
"@fluidframework/build-tools": "^0.22.0",
|
|
24
|
+
"@fluidframework/eslint-config-fluid": "^2.1.0",
|
|
25
|
+
"@fluidframework/odsp-driver-definitions-previous": "npm:@fluidframework/odsp-driver-definitions@2.0.0-internal.6.3.0",
|
|
26
26
|
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
27
27
|
"@microsoft/api-extractor": "^7.34.4",
|
|
28
|
-
"concurrently": "^7.6.0",
|
|
29
28
|
"copyfiles": "^2.4.1",
|
|
30
29
|
"cross-env": "^7.0.3",
|
|
31
30
|
"eslint": "~8.6.0",
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"build:esnext": "tsc --project ./tsconfig.esnext.json",
|
|
45
44
|
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
46
45
|
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
|
|
47
|
-
"clean": "rimraf dist lib *.tsbuildinfo *.build.log",
|
|
46
|
+
"clean": "rimraf --glob 'dist' 'lib' '*.tsbuildinfo' '*.build.log' '_api-extractor-temp'",
|
|
48
47
|
"eslint": "eslint --format stylish src",
|
|
49
48
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
50
49
|
"format": "npm run prettier:fix",
|
package/src/errors.ts
CHANGED
|
@@ -2,12 +2,72 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
DriverError,
|
|
7
|
+
IDriverErrorBase,
|
|
8
|
+
DriverErrorTypes,
|
|
9
|
+
} from "@fluidframework/driver-definitions";
|
|
6
10
|
|
|
7
11
|
/**
|
|
8
12
|
* ODSP Error types.
|
|
9
13
|
* Different error types that may be thrown by the ODSP driver.
|
|
10
14
|
*/
|
|
15
|
+
export const OdspErrorTypes = {
|
|
16
|
+
// Inherit base driver error types
|
|
17
|
+
...DriverErrorTypes,
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Storage is out of space
|
|
21
|
+
*/
|
|
22
|
+
outOfStorageError: "outOfStorageError",
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Invalid file name (at creation of the file)
|
|
26
|
+
*/
|
|
27
|
+
invalidFileNameError: "invalidFileNameError",
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
31
|
+
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
32
|
+
* such case.
|
|
33
|
+
*/
|
|
34
|
+
snapshotTooBig: "snapshotTooBig",
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
38
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
39
|
+
* such case.
|
|
40
|
+
*/
|
|
41
|
+
fetchTimeout: "fetchTimeout",
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
45
|
+
*/
|
|
46
|
+
fluidNotEnabled: "fluidNotEnabled",
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
50
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
51
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
52
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
53
|
+
* copying it over manually)
|
|
54
|
+
*/
|
|
55
|
+
cannotCatchUp: "cannotCatchUp",
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
59
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
60
|
+
*/
|
|
61
|
+
serviceReadOnly: "serviceReadOnly",
|
|
62
|
+
} as const;
|
|
63
|
+
export type OdspErrorTypes = typeof OdspErrorTypes[keyof typeof OdspErrorTypes];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* ODSP Error types.
|
|
67
|
+
* Different error types that may be thrown by the ODSP driver.
|
|
68
|
+
*
|
|
69
|
+
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
70
|
+
*/
|
|
11
71
|
export enum OdspErrorType {
|
|
12
72
|
/**
|
|
13
73
|
* Storage is out of space
|
|
@@ -38,6 +98,9 @@ export enum OdspErrorType {
|
|
|
38
98
|
*/
|
|
39
99
|
fluidNotEnabled = "fluidNotEnabled",
|
|
40
100
|
|
|
101
|
+
/**
|
|
102
|
+
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
103
|
+
*/
|
|
41
104
|
fetchTokenError = "fetchTokenError",
|
|
42
105
|
|
|
43
106
|
/**
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export {
|
|
7
|
+
IOdspError,
|
|
8
|
+
IOdspErrorAugmentations,
|
|
9
|
+
OdspError,
|
|
10
|
+
OdspErrorType,
|
|
11
|
+
OdspErrorTypes,
|
|
12
|
+
} from "./errors";
|
|
7
13
|
export {
|
|
8
14
|
HostStoragePolicy,
|
|
9
15
|
ICollabSessionOptions,
|
package/src/odspCache.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Describes what kind of content is stored in cache entry.
|
|
@@ -28,7 +28,7 @@ export interface IFileEntry {
|
|
|
28
28
|
* a file if user requests so.
|
|
29
29
|
* This is IOdspResolvedUrl in case of ODSP driver.
|
|
30
30
|
*/
|
|
31
|
-
resolvedUrl:
|
|
31
|
+
resolvedUrl: IResolvedUrl;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -96,7 +96,7 @@ export interface IPersistedCache {
|
|
|
96
96
|
/**
|
|
97
97
|
* Api to generate a cache key from cache entry.
|
|
98
98
|
* @param entry - cache entry from which a cache key is generated
|
|
99
|
-
* @returns
|
|
99
|
+
* @returns The key for cache.
|
|
100
100
|
*/
|
|
101
101
|
export function getKeyForCacheEntry(entry: ICacheEntry): string {
|
|
102
102
|
return `${entry.file.docId}_${entry.type}_${entry.key}`;
|
package/src/resolvedUrl.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
7
7
|
|
|
8
8
|
export interface IOdspUrlParts {
|
|
9
9
|
siteUrl: string;
|
|
@@ -98,7 +98,7 @@ export interface ShareLinkInfoType {
|
|
|
98
98
|
*/
|
|
99
99
|
sharingLinkToRedeem?: string;
|
|
100
100
|
}
|
|
101
|
-
export interface IOdspResolvedUrl extends
|
|
101
|
+
export interface IOdspResolvedUrl extends IResolvedUrl, IOdspUrlParts {
|
|
102
102
|
type: "fluid";
|
|
103
103
|
odspResolvedUrl: true;
|
|
104
104
|
|