@fluidframework/odsp-driver-definitions 2.0.0-internal.6.3.3 → 2.0.0-internal.7.0.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 +66 -0
- package/dist/errors.d.ts +73 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +61 -2
- 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 +2 -2
- package/dist/odspCache.d.ts.map +1 -1
- package/dist/odspCache.js +1 -1
- package/dist/odspCache.js.map +1 -1
- package/dist/resolvedUrl.js +3 -3
- package/dist/resolvedUrl.js.map +1 -1
- package/dist/tokenFetch.d.ts +3 -3
- package/dist/tokenFetch.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/errors.d.ts +73 -2
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +59 -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 +2 -2
- package/lib/odspCache.d.ts.map +1 -1
- package/lib/odspCache.js +1 -1
- package/lib/odspCache.js.map +1 -1
- package/lib/tokenFetch.d.ts +3 -3
- package/lib/tokenFetch.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/errors.ts +69 -1
- package/src/index.ts +7 -1
- package/src/odspCache.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
# @fluidframework/odsp-driver-definitions
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.7.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- odsp-driver: Load container in readonly mode when driver throws DriverErrorType.outOfStorage [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
8
|
+
|
|
9
|
+
Handle DriverErrorType.outOfStorage error from driver and load the container in readonly mode. Currently there is no
|
|
10
|
+
handling and when the join session throws this error, the container will get closed. With this we use NoDeltaStream
|
|
11
|
+
object as connection and load the container in read mode, so that it loads properly. We also notify the that the
|
|
12
|
+
container is "readonly" through the event on delta manager so that apps can listen to this and show any UX etc. The app
|
|
13
|
+
can listen to the event like this:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
container.deltaManager.on(
|
|
17
|
+
"readonly",
|
|
18
|
+
(readonly?: boolean, readonlyConnectionReason?: { text: string; error?: IErrorBase }) => {
|
|
19
|
+
// error?.errorType will be equal to DriverErrorType.outOfStorage in this case
|
|
20
|
+
// App logic
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
26
|
+
|
|
27
|
+
This included the following changes from the protocol-definitions release:
|
|
28
|
+
|
|
29
|
+
- Updating signal interfaces for some planned improvements. The intention is split the interface between signals
|
|
30
|
+
submitted by clients to the server and the resulting signals sent from the server to clients.
|
|
31
|
+
- A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
|
|
32
|
+
been added, which will be the typing for signals sent from the client to the server. Both extend a new
|
|
33
|
+
ISignalMessageBase interface that contains common members.
|
|
34
|
+
- The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
|
|
35
|
+
|
|
36
|
+
- Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
37
|
+
|
|
38
|
+
Dependencies on the following Fluid server package have been updated to version 2.0.1:
|
|
39
|
+
|
|
40
|
+
- @fluidframework/gitresources: 2.0.1
|
|
41
|
+
- @fluidframework/server-kafka-orderer: 2.0.1
|
|
42
|
+
- @fluidframework/server-lambdas: 2.0.1
|
|
43
|
+
- @fluidframework/server-lambdas-driver: 2.0.1
|
|
44
|
+
- @fluidframework/server-local-server: 2.0.1
|
|
45
|
+
- @fluidframework/server-memory-orderer: 2.0.1
|
|
46
|
+
- @fluidframework/protocol-base: 2.0.1
|
|
47
|
+
- @fluidframework/server-routerlicious: 2.0.1
|
|
48
|
+
- @fluidframework/server-routerlicious-base: 2.0.1
|
|
49
|
+
- @fluidframework/server-services: 2.0.1
|
|
50
|
+
- @fluidframework/server-services-client: 2.0.1
|
|
51
|
+
- @fluidframework/server-services-core: 2.0.1
|
|
52
|
+
- @fluidframework/server-services-ordering-kafkanode: 2.0.1
|
|
53
|
+
- @fluidframework/server-services-ordering-rdkafka: 2.0.1
|
|
54
|
+
- @fluidframework/server-services-ordering-zookeeper: 2.0.1
|
|
55
|
+
- @fluidframework/server-services-shared: 2.0.1
|
|
56
|
+
- @fluidframework/server-services-telemetry: 2.0.1
|
|
57
|
+
- @fluidframework/server-services-utils: 2.0.1
|
|
58
|
+
- @fluidframework/server-test-utils: 2.0.1
|
|
59
|
+
- tinylicious: 2.0.1
|
|
60
|
+
|
|
61
|
+
- Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
|
|
62
|
+
|
|
63
|
+
The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
|
|
64
|
+
|
|
65
|
+
## 2.0.0-internal.6.4.0
|
|
66
|
+
|
|
67
|
+
Dependency updates only.
|
|
68
|
+
|
|
3
69
|
## 2.0.0-internal.6.3.0
|
|
4
70
|
|
|
5
71
|
Dependency updates only.
|
package/dist/errors.d.ts
CHANGED
|
@@ -7,6 +7,70 @@ 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
|
+
* Invalid file name (at creation of the file)
|
|
13
|
+
*/
|
|
14
|
+
readonly invalidFileNameError: "invalidFileNameError";
|
|
15
|
+
/**
|
|
16
|
+
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
17
|
+
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
18
|
+
* such case.
|
|
19
|
+
*/
|
|
20
|
+
readonly snapshotTooBig: "snapshotTooBig";
|
|
21
|
+
/**
|
|
22
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
23
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
24
|
+
* such case.
|
|
25
|
+
*/
|
|
26
|
+
readonly fetchTimeout: "fetchTimeout";
|
|
27
|
+
/**
|
|
28
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
29
|
+
*/
|
|
30
|
+
readonly fluidNotEnabled: "fluidNotEnabled";
|
|
31
|
+
/**
|
|
32
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
33
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
34
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
35
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
36
|
+
* copying it over manually)
|
|
37
|
+
*/
|
|
38
|
+
readonly cannotCatchUp: "cannotCatchUp";
|
|
39
|
+
/**
|
|
40
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
41
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
42
|
+
*/
|
|
43
|
+
readonly serviceReadOnly: "serviceReadOnly";
|
|
44
|
+
/**
|
|
45
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
46
|
+
*/
|
|
47
|
+
readonly blockedIPAddress: "blockedIPAddress";
|
|
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
|
+
readonly fluidInvalidSchema: "fluidInvalidSchema";
|
|
61
|
+
readonly fileIsLocked: "fileIsLocked";
|
|
62
|
+
readonly outOfStorageError: "outOfStorageError";
|
|
63
|
+
readonly genericError: "genericError";
|
|
64
|
+
readonly throttlingError: "throttlingError";
|
|
65
|
+
readonly usageError: "usageError";
|
|
66
|
+
};
|
|
67
|
+
export type OdspErrorTypes = typeof OdspErrorTypes[keyof typeof OdspErrorTypes];
|
|
68
|
+
/**
|
|
69
|
+
* ODSP Error types.
|
|
70
|
+
* Different error types that may be thrown by the ODSP driver.
|
|
71
|
+
*
|
|
72
|
+
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
73
|
+
*/
|
|
10
74
|
export declare enum OdspErrorType {
|
|
11
75
|
/**
|
|
12
76
|
* Storage is out of space
|
|
@@ -32,6 +96,9 @@ export declare enum OdspErrorType {
|
|
|
32
96
|
* SPO admin toggle: fluid service is not enabled.
|
|
33
97
|
*/
|
|
34
98
|
fluidNotEnabled = "fluidNotEnabled",
|
|
99
|
+
/**
|
|
100
|
+
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
101
|
+
*/
|
|
35
102
|
fetchTokenError = "fetchTokenError",
|
|
36
103
|
/**
|
|
37
104
|
* This error will be raised when client is too behind with no way to catch up.
|
|
@@ -45,7 +112,11 @@ export declare enum OdspErrorType {
|
|
|
45
112
|
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
46
113
|
* So to preserve integrity of the data, the data becomes readonly.
|
|
47
114
|
*/
|
|
48
|
-
serviceReadOnly = "serviceReadOnly"
|
|
115
|
+
serviceReadOnly = "serviceReadOnly",
|
|
116
|
+
/**
|
|
117
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
118
|
+
*/
|
|
119
|
+
blockedIPAddress = "blockedIPAddress"
|
|
49
120
|
}
|
|
50
121
|
export interface IOdspErrorAugmentations {
|
|
51
122
|
/**
|
|
@@ -70,5 +141,5 @@ export interface IOdspErrorAugmentations {
|
|
|
70
141
|
export interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
|
|
71
142
|
readonly errorType: OdspErrorType;
|
|
72
143
|
}
|
|
73
|
-
export
|
|
144
|
+
export type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
|
|
74
145
|
//# sourceMappingURL=errors.d.ts.map
|
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;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;CAEM,CAAC;AACX,MAAM,MAAM,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;IAEnC;;OAEG;IACH,gBAAgB,qBAAqB;CACrC;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,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
|
package/dist/errors.js
CHANGED
|
@@ -1,9 +1,61 @@
|
|
|
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");
|
|
9
|
+
/**
|
|
10
|
+
* ODSP Error types.
|
|
11
|
+
* Different error types that may be thrown by the ODSP driver.
|
|
12
|
+
*/
|
|
13
|
+
exports.OdspErrorTypes = {
|
|
14
|
+
// Inherit base driver error types
|
|
15
|
+
...driver_definitions_1.DriverErrorTypes,
|
|
16
|
+
/**
|
|
17
|
+
* Invalid file name (at creation of the file)
|
|
18
|
+
*/
|
|
19
|
+
invalidFileNameError: "invalidFileNameError",
|
|
20
|
+
/**
|
|
21
|
+
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
22
|
+
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
23
|
+
* such case.
|
|
24
|
+
*/
|
|
25
|
+
snapshotTooBig: "snapshotTooBig",
|
|
26
|
+
/**
|
|
27
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
28
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
29
|
+
* such case.
|
|
30
|
+
*/
|
|
31
|
+
fetchTimeout: "fetchTimeout",
|
|
32
|
+
/**
|
|
33
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
34
|
+
*/
|
|
35
|
+
fluidNotEnabled: "fluidNotEnabled",
|
|
36
|
+
/**
|
|
37
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
38
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
39
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
40
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
41
|
+
* copying it over manually)
|
|
42
|
+
*/
|
|
43
|
+
cannotCatchUp: "cannotCatchUp",
|
|
44
|
+
/**
|
|
45
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
46
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
47
|
+
*/
|
|
48
|
+
serviceReadOnly: "serviceReadOnly",
|
|
49
|
+
/**
|
|
50
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
51
|
+
*/
|
|
52
|
+
blockedIPAddress: "blockedIPAddress",
|
|
53
|
+
};
|
|
4
54
|
/**
|
|
5
55
|
* ODSP Error types.
|
|
6
56
|
* Different error types that may be thrown by the ODSP driver.
|
|
57
|
+
*
|
|
58
|
+
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
7
59
|
*/
|
|
8
60
|
var OdspErrorType;
|
|
9
61
|
(function (OdspErrorType) {
|
|
@@ -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.
|
|
@@ -45,5 +100,9 @@ var OdspErrorType;
|
|
|
45
100
|
* So to preserve integrity of the data, the data becomes readonly.
|
|
46
101
|
*/
|
|
47
102
|
OdspErrorType["serviceReadOnly"] = "serviceReadOnly";
|
|
48
|
-
|
|
103
|
+
/**
|
|
104
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
105
|
+
*/
|
|
106
|
+
OdspErrorType["blockedIPAddress"] = "blockedIPAddress";
|
|
107
|
+
})(OdspErrorType || (exports.OdspErrorType = OdspErrorType = {}));
|
|
49
108
|
//# sourceMappingURL=errors.js.map
|
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,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;IAElC;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;CAC3B,CAAC;AAGX;;;;;GAKG;AACH,IAAY,aAsDX;AAtDD,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;IAEnC;;OAEG;IACH,sDAAqC,CAAA;AACtC,CAAC,EAtDW,aAAa,6BAAb,aAAa,QAsDxB","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 * 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\n\t/**\n\t * Due to organizational policies, you can't access server resources from the current network location.\n\t */\n\tblockedIPAddress: \"blockedIPAddress\",\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\t/**\n\t * Due to organizational policies, you can't access server resources from the current network location.\n\t */\n\tblockedIPAddress = \"blockedIPAddress\",\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
|
@@ -7,7 +7,7 @@ import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
|
7
7
|
* Describes what kind of content is stored in cache entry.
|
|
8
8
|
*/
|
|
9
9
|
export declare const snapshotKey = "snapshot";
|
|
10
|
-
export
|
|
10
|
+
export type CacheContentType = "snapshot" | "ops";
|
|
11
11
|
export interface IFileEntry {
|
|
12
12
|
/**
|
|
13
13
|
* Unique and stable ID of the document.
|
|
@@ -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,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC,
|
|
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,MAAM,MAAM,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 { 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/dist/resolvedUrl.js
CHANGED
|
@@ -12,7 +12,7 @@ exports.SharingLinkRole = exports.SharingLinkScope = exports.ShareLinkTypes = vo
|
|
|
12
12
|
var ShareLinkTypes;
|
|
13
13
|
(function (ShareLinkTypes) {
|
|
14
14
|
ShareLinkTypes["csl"] = "csl";
|
|
15
|
-
})(ShareLinkTypes
|
|
15
|
+
})(ShareLinkTypes || (exports.ShareLinkTypes = ShareLinkTypes = {}));
|
|
16
16
|
/**
|
|
17
17
|
* Sharing scope of the share links created for a file.
|
|
18
18
|
*/
|
|
@@ -22,7 +22,7 @@ var SharingLinkScope;
|
|
|
22
22
|
SharingLinkScope["users"] = "users";
|
|
23
23
|
SharingLinkScope["anonymous"] = "anonymous";
|
|
24
24
|
SharingLinkScope["default"] = "default";
|
|
25
|
-
})(SharingLinkScope
|
|
25
|
+
})(SharingLinkScope || (exports.SharingLinkScope = SharingLinkScope = {}));
|
|
26
26
|
/**
|
|
27
27
|
* View/edit permission role for a sharing link.
|
|
28
28
|
*/
|
|
@@ -30,5 +30,5 @@ var SharingLinkRole;
|
|
|
30
30
|
(function (SharingLinkRole) {
|
|
31
31
|
SharingLinkRole["view"] = "view";
|
|
32
32
|
SharingLinkRole["edit"] = "edit";
|
|
33
|
-
})(SharingLinkRole
|
|
33
|
+
})(SharingLinkRole || (exports.SharingLinkRole = SharingLinkRole = {}));
|
|
34
34
|
//# sourceMappingURL=resolvedUrl.js.map
|
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,
|
|
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,8BAAd,cAAc,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,gCAAhB,gBAAgB,QAK3B;AAED;;GAEG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IAC1B,gCAAa,CAAA;IACb,gCAAa,CAAA;AACd,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"@fluidframework/driver-definitions\";\n\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/dist/tokenFetch.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export interface OdspResourceTokenFetchOptions extends TokenFetchOptions {
|
|
|
50
50
|
* whether token came from cache. Legacy implementation may return a string for token value;
|
|
51
51
|
* in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
53
|
+
export type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;
|
|
54
54
|
/**
|
|
55
55
|
* Helper method which transforms return value for TokenFetcher method to token string
|
|
56
56
|
* @param tokenResponse - return value for TokenFetcher method
|
|
@@ -69,6 +69,6 @@ export declare const isTokenFromCache: (tokenResponse: string | TokenResponse |
|
|
|
69
69
|
* `Consumer` represents user authenticated with Microsoft Account (MSA).
|
|
70
70
|
* `Enterprise` represents user authenticated with M365 tenant account.
|
|
71
71
|
*/
|
|
72
|
-
export
|
|
73
|
-
export
|
|
72
|
+
export type IdentityType = "Consumer" | "Enterprise";
|
|
73
|
+
export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
|
|
74
74
|
//# sourceMappingURL=tokenFetch.d.ts.map
|
package/dist/tokenFetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenFetch.d.ts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACvE,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAEhB,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sGAAsG;IACtG,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"tokenFetch.d.ts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACvE,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAEhB,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sGAAsG;IACtG,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC,CAAC;AAErF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,kBACd,MAAM,GAAG,aAAa,GAAG,IAAI,GAAG,SAAS,KACtD,MAAM,GAAG,IAKW,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,kBACb,MAAM,GAAG,aAAa,GAAG,IAAI,KAC1C,OAAO,GAAG,SAGc,CAAC;AAE5B;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,YAAY,CAAC;AAErD,MAAM,MAAM,+BAA+B,GAAG,CAC7C,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,EACZ,+BAA+B,CAAC,EAAE,OAAO,KACrC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC"}
|
package/dist/tsdoc-metadata.json
CHANGED
package/lib/errors.d.ts
CHANGED
|
@@ -7,6 +7,70 @@ 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
|
+
* Invalid file name (at creation of the file)
|
|
13
|
+
*/
|
|
14
|
+
readonly invalidFileNameError: "invalidFileNameError";
|
|
15
|
+
/**
|
|
16
|
+
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
17
|
+
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
18
|
+
* such case.
|
|
19
|
+
*/
|
|
20
|
+
readonly snapshotTooBig: "snapshotTooBig";
|
|
21
|
+
/**
|
|
22
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
23
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
24
|
+
* such case.
|
|
25
|
+
*/
|
|
26
|
+
readonly fetchTimeout: "fetchTimeout";
|
|
27
|
+
/**
|
|
28
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
29
|
+
*/
|
|
30
|
+
readonly fluidNotEnabled: "fluidNotEnabled";
|
|
31
|
+
/**
|
|
32
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
33
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
34
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
35
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
36
|
+
* copying it over manually)
|
|
37
|
+
*/
|
|
38
|
+
readonly cannotCatchUp: "cannotCatchUp";
|
|
39
|
+
/**
|
|
40
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
41
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
42
|
+
*/
|
|
43
|
+
readonly serviceReadOnly: "serviceReadOnly";
|
|
44
|
+
/**
|
|
45
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
46
|
+
*/
|
|
47
|
+
readonly blockedIPAddress: "blockedIPAddress";
|
|
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
|
+
readonly fluidInvalidSchema: "fluidInvalidSchema";
|
|
61
|
+
readonly fileIsLocked: "fileIsLocked";
|
|
62
|
+
readonly outOfStorageError: "outOfStorageError";
|
|
63
|
+
readonly genericError: "genericError";
|
|
64
|
+
readonly throttlingError: "throttlingError";
|
|
65
|
+
readonly usageError: "usageError";
|
|
66
|
+
};
|
|
67
|
+
export type OdspErrorTypes = typeof OdspErrorTypes[keyof typeof OdspErrorTypes];
|
|
68
|
+
/**
|
|
69
|
+
* ODSP Error types.
|
|
70
|
+
* Different error types that may be thrown by the ODSP driver.
|
|
71
|
+
*
|
|
72
|
+
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
73
|
+
*/
|
|
10
74
|
export declare enum OdspErrorType {
|
|
11
75
|
/**
|
|
12
76
|
* Storage is out of space
|
|
@@ -32,6 +96,9 @@ export declare enum OdspErrorType {
|
|
|
32
96
|
* SPO admin toggle: fluid service is not enabled.
|
|
33
97
|
*/
|
|
34
98
|
fluidNotEnabled = "fluidNotEnabled",
|
|
99
|
+
/**
|
|
100
|
+
* {@inheritDoc @fluidframework/driver-definitions#FluidErrorType.fetchTokenError}
|
|
101
|
+
*/
|
|
35
102
|
fetchTokenError = "fetchTokenError",
|
|
36
103
|
/**
|
|
37
104
|
* This error will be raised when client is too behind with no way to catch up.
|
|
@@ -45,7 +112,11 @@ export declare enum OdspErrorType {
|
|
|
45
112
|
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
46
113
|
* So to preserve integrity of the data, the data becomes readonly.
|
|
47
114
|
*/
|
|
48
|
-
serviceReadOnly = "serviceReadOnly"
|
|
115
|
+
serviceReadOnly = "serviceReadOnly",
|
|
116
|
+
/**
|
|
117
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
118
|
+
*/
|
|
119
|
+
blockedIPAddress = "blockedIPAddress"
|
|
49
120
|
}
|
|
50
121
|
export interface IOdspErrorAugmentations {
|
|
51
122
|
/**
|
|
@@ -70,5 +141,5 @@ export interface IOdspErrorAugmentations {
|
|
|
70
141
|
export interface IOdspError extends Omit<IDriverErrorBase, "errorType">, IOdspErrorAugmentations {
|
|
71
142
|
readonly errorType: OdspErrorType;
|
|
72
143
|
}
|
|
73
|
-
export
|
|
144
|
+
export type OdspError = IOdspError | (DriverError & IOdspErrorAugmentations);
|
|
74
145
|
//# sourceMappingURL=errors.d.ts.map
|
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;;;;OAIG;;IAGH;;;;OAIG;;IAGH;;OAEG;;IAGH;;;;;;OAMG;;IAGH;;;OAGG;;IAGH;;OAEG;;;;;;;;;;;;;;;;;;;;CAEM,CAAC;AACX,MAAM,MAAM,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;IAEnC;;OAEG;IACH,gBAAgB,qBAAqB;CACrC;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,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,CAAC,WAAW,GAAG,uBAAuB,CAAC,CAAC"}
|
package/lib/errors.js
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
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";
|
|
6
|
+
/**
|
|
7
|
+
* ODSP Error types.
|
|
8
|
+
* Different error types that may be thrown by the ODSP driver.
|
|
9
|
+
*/
|
|
10
|
+
export const OdspErrorTypes = {
|
|
11
|
+
// Inherit base driver error types
|
|
12
|
+
...DriverErrorTypes,
|
|
13
|
+
/**
|
|
14
|
+
* Invalid file name (at creation of the file)
|
|
15
|
+
*/
|
|
16
|
+
invalidFileNameError: "invalidFileNameError",
|
|
17
|
+
/**
|
|
18
|
+
* Snapshot is too big. Host application specified limit for snapshot size, and snapshot was bigger
|
|
19
|
+
* that that limit, thus request failed. Hosting application is expected to have fall-back behavior for
|
|
20
|
+
* such case.
|
|
21
|
+
*/
|
|
22
|
+
snapshotTooBig: "snapshotTooBig",
|
|
23
|
+
/**
|
|
24
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
25
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
26
|
+
* such case.
|
|
27
|
+
*/
|
|
28
|
+
fetchTimeout: "fetchTimeout",
|
|
29
|
+
/**
|
|
30
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
31
|
+
*/
|
|
32
|
+
fluidNotEnabled: "fluidNotEnabled",
|
|
33
|
+
/**
|
|
34
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
35
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
36
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
37
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
38
|
+
* copying it over manually)
|
|
39
|
+
*/
|
|
40
|
+
cannotCatchUp: "cannotCatchUp",
|
|
41
|
+
/**
|
|
42
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
43
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
44
|
+
*/
|
|
45
|
+
serviceReadOnly: "serviceReadOnly",
|
|
46
|
+
/**
|
|
47
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
48
|
+
*/
|
|
49
|
+
blockedIPAddress: "blockedIPAddress",
|
|
50
|
+
};
|
|
1
51
|
/**
|
|
2
52
|
* ODSP Error types.
|
|
3
53
|
* Different error types that may be thrown by the ODSP driver.
|
|
54
|
+
*
|
|
55
|
+
* @deprecated Use {@link (OdspErrorTypes:variable)} instead.
|
|
4
56
|
*/
|
|
5
57
|
export var OdspErrorType;
|
|
6
58
|
(function (OdspErrorType) {
|
|
@@ -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.
|
|
@@ -42,5 +97,9 @@ export var OdspErrorType;
|
|
|
42
97
|
* So to preserve integrity of the data, the data becomes readonly.
|
|
43
98
|
*/
|
|
44
99
|
OdspErrorType["serviceReadOnly"] = "serviceReadOnly";
|
|
100
|
+
/**
|
|
101
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
102
|
+
*/
|
|
103
|
+
OdspErrorType["blockedIPAddress"] = "blockedIPAddress";
|
|
45
104
|
})(OdspErrorType || (OdspErrorType = {}));
|
|
46
105
|
//# sourceMappingURL=errors.js.map
|
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,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;IAElC;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;CAC3B,CAAC;AAGX;;;;;GAKG;AACH,MAAM,CAAN,IAAY,aAsDX;AAtDD,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;IAEnC;;OAEG;IACH,sDAAqC,CAAA;AACtC,CAAC,EAtDW,aAAa,KAAb,aAAa,QAsDxB","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 * 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\n\t/**\n\t * Due to organizational policies, you can't access server resources from the current network location.\n\t */\n\tblockedIPAddress: \"blockedIPAddress\",\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\t/**\n\t * Due to organizational policies, you can't access server resources from the current network location.\n\t */\n\tblockedIPAddress = \"blockedIPAddress\",\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
|
@@ -7,7 +7,7 @@ import { IResolvedUrl } from "@fluidframework/driver-definitions";
|
|
|
7
7
|
* Describes what kind of content is stored in cache entry.
|
|
8
8
|
*/
|
|
9
9
|
export declare const snapshotKey = "snapshot";
|
|
10
|
-
export
|
|
10
|
+
export type CacheContentType = "snapshot" | "ops";
|
|
11
11
|
export interface IFileEntry {
|
|
12
12
|
/**
|
|
13
13
|
* Unique and stable ID of the document.
|
|
@@ -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,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,WAAW,aAAa,CAAC;AACtC,
|
|
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,MAAM,MAAM,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 { 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/lib/tokenFetch.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export interface OdspResourceTokenFetchOptions extends TokenFetchOptions {
|
|
|
50
50
|
* whether token came from cache. Legacy implementation may return a string for token value;
|
|
51
51
|
* in this case it should be assumes that fromCache signal is undefined. Null is returned in case of failure.
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
53
|
+
export type TokenFetcher<T> = (options: T) => Promise<string | TokenResponse | null>;
|
|
54
54
|
/**
|
|
55
55
|
* Helper method which transforms return value for TokenFetcher method to token string
|
|
56
56
|
* @param tokenResponse - return value for TokenFetcher method
|
|
@@ -69,6 +69,6 @@ export declare const isTokenFromCache: (tokenResponse: string | TokenResponse |
|
|
|
69
69
|
* `Consumer` represents user authenticated with Microsoft Account (MSA).
|
|
70
70
|
* `Enterprise` represents user authenticated with M365 tenant account.
|
|
71
71
|
*/
|
|
72
|
-
export
|
|
73
|
-
export
|
|
72
|
+
export type IdentityType = "Consumer" | "Enterprise";
|
|
73
|
+
export type InstrumentedStorageTokenFetcher = (options: TokenFetchOptions, name: string, alwaysRecordTokenFetchTelemetry?: boolean) => Promise<string | null>;
|
|
74
74
|
//# sourceMappingURL=tokenFetch.d.ts.map
|
package/lib/tokenFetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenFetch.d.ts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACvE,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAEhB,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sGAAsG;IACtG,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"tokenFetch.d.ts","sourceRoot":"","sources":["../src/tokenFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IAEd,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACvE,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAEhB,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sGAAsG;IACtG,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,aAAa,GAAG,IAAI,CAAC,CAAC;AAErF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,kBACd,MAAM,GAAG,aAAa,GAAG,IAAI,GAAG,SAAS,KACtD,MAAM,GAAG,IAKW,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,kBACb,MAAM,GAAG,aAAa,GAAG,IAAI,KAC1C,OAAO,GAAG,SAGc,CAAC;AAE5B;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,YAAY,CAAC;AAErD,MAAM,MAAM,+BAA+B,GAAG,CAC7C,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,EACZ,+BAA+B,CAAC,EAAE,OAAO,KACrC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/odsp-driver-definitions",
|
|
3
|
-
"version": "2.0.0-internal.
|
|
3
|
+
"version": "2.0.0-internal.7.0.0",
|
|
4
4
|
"description": "Socket storage implementation for SPO and ODC",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
"module": "lib/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.
|
|
18
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.7.0.0 <2.0.0-internal.7.1.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@fluid-tools/build-cli": "^0.
|
|
21
|
+
"@fluid-tools/build-cli": "^0.24.0",
|
|
22
22
|
"@fluidframework/build-common": "^2.0.0",
|
|
23
|
-
"@fluidframework/build-tools": "^0.
|
|
23
|
+
"@fluidframework/build-tools": "^0.24.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.
|
|
26
|
-
"@fluidframework/protocol-definitions": "^
|
|
27
|
-
"@microsoft/api-extractor": "^7.
|
|
25
|
+
"@fluidframework/odsp-driver-definitions-previous": "npm:@fluidframework/odsp-driver-definitions@2.0.0-internal.6.3.0",
|
|
26
|
+
"@fluidframework/protocol-definitions": "^3.0.0",
|
|
27
|
+
"@microsoft/api-extractor": "^7.37.0",
|
|
28
28
|
"copyfiles": "^2.4.1",
|
|
29
29
|
"cross-env": "^7.0.3",
|
|
30
30
|
"eslint": "~8.6.0",
|
|
31
31
|
"prettier": "~2.6.2",
|
|
32
32
|
"rimraf": "^4.4.0",
|
|
33
|
-
"typescript": "~
|
|
33
|
+
"typescript": "~5.1.6"
|
|
34
34
|
},
|
|
35
35
|
"typeValidation": {
|
|
36
36
|
"broken": {}
|
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
|
+
* Invalid file name (at creation of the file)
|
|
21
|
+
*/
|
|
22
|
+
invalidFileNameError: "invalidFileNameError",
|
|
23
|
+
|
|
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
|
+
/**
|
|
32
|
+
* Maximum time limit to fetch reached. Host application specified limit for fetching of snapshot, when
|
|
33
|
+
* that limit is reached, request fails. Hosting application is expected to have fall-back behavior for
|
|
34
|
+
* such case.
|
|
35
|
+
*/
|
|
36
|
+
fetchTimeout: "fetchTimeout",
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* SPO admin toggle: fluid service is not enabled.
|
|
40
|
+
*/
|
|
41
|
+
fluidNotEnabled: "fluidNotEnabled",
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* This error will be raised when client is too behind with no way to catch up.
|
|
45
|
+
* This condition will happen when user was offline for too long, resulting in old ops / blobs being deleted
|
|
46
|
+
* by storage, and thus removing an ability for client to catch up.
|
|
47
|
+
* This condition will result in any local changes being lost (i.e. only way to save state is by user
|
|
48
|
+
* copying it over manually)
|
|
49
|
+
*/
|
|
50
|
+
cannotCatchUp: "cannotCatchUp",
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* SPO can occasionally return 403 for r/w operations on document when there is a fail over to another data center.
|
|
54
|
+
* So to preserve integrity of the data, the data becomes readonly.
|
|
55
|
+
*/
|
|
56
|
+
serviceReadOnly: "serviceReadOnly",
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
60
|
+
*/
|
|
61
|
+
blockedIPAddress: "blockedIPAddress",
|
|
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
|
/**
|
|
@@ -54,6 +117,11 @@ export enum OdspErrorType {
|
|
|
54
117
|
* So to preserve integrity of the data, the data becomes readonly.
|
|
55
118
|
*/
|
|
56
119
|
serviceReadOnly = "serviceReadOnly",
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Due to organizational policies, you can't access server resources from the current network location.
|
|
123
|
+
*/
|
|
124
|
+
blockedIPAddress = "blockedIPAddress",
|
|
57
125
|
}
|
|
58
126
|
|
|
59
127
|
export interface IOdspErrorAugmentations {
|
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}`;
|