@fluidframework/odsp-driver-definitions 2.0.0-internal.6.3.2 → 2.0.0-internal.6.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/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 +1 -1
- package/dist/odspCache.js +1 -1
- package/dist/odspCache.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 +1 -1
- package/lib/odspCache.js +1 -1
- package/lib/odspCache.js.map +1 -1
- package/package.json +3 -3
- package/src/errors.ts +64 -1
- package/src/index.ts +7 -1
- package/src/odspCache.ts +1 -1
package/CHANGELOG.md
CHANGED
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
|
@@ -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.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 { 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
|
|
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/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
|
@@ -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.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 { 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
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/odsp-driver-definitions",
|
|
3
|
-
"version": "2.0.0-internal.6.
|
|
3
|
+
"version": "2.0.0-internal.6.4.0",
|
|
4
4
|
"description": "Socket storage implementation for SPO and ODC",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"module": "lib/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.6.
|
|
18
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@fluid-tools/build-cli": "^0.22.0",
|
|
22
22
|
"@fluidframework/build-common": "^2.0.0",
|
|
23
23
|
"@fluidframework/build-tools": "^0.22.0",
|
|
24
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.
|
|
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
28
|
"copyfiles": "^2.4.1",
|
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
|
@@ -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}`;
|