@fluidframework/driver-definitions 2.0.0-internal.6.2.0 → 2.0.0-internal.6.3.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 +8 -0
- package/dist/driverError.d.ts +78 -1
- package/dist/driverError.d.ts.map +1 -1
- package/dist/driverError.js +80 -1
- package/dist/driverError.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/lib/driverError.d.ts +78 -1
- package/lib/driverError.d.ts.map +1 -1
- package/lib/driverError.js +79 -0
- package/lib/driverError.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/package.json +5 -6
- package/src/driverError.ts +101 -1
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @fluidframework/driver-definitions
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.6.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add new error type enumeration that extends common errors from core-interfaces ([#17078](https://github.com/microsoft/FluidFramework/issues/17078)) [5c4bf0d9c2](https://github.com/microsoft/FluidFramework/commits/5c4bf0d9c224af86d0c2205c67c6e64405fee51c)
|
|
8
|
+
|
|
9
|
+
Deprecates existing `DriverErrorType` enum in favor of the new `DriverErrorTypes` type.
|
|
10
|
+
|
|
3
11
|
## 2.0.0-internal.6.2.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/driverError.d.ts
CHANGED
|
@@ -3,9 +3,84 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IResolvedUrl } from "./urlResolver";
|
|
6
|
+
/**
|
|
7
|
+
* Different error types the Driver may report out to the Host.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DriverErrorTypes: {
|
|
10
|
+
/**
|
|
11
|
+
* Some non-categorized (below) networking error
|
|
12
|
+
* Include errors like fatal server error (usually 500).
|
|
13
|
+
*/
|
|
14
|
+
readonly genericNetworkError: "genericNetworkError";
|
|
15
|
+
/**
|
|
16
|
+
* Access denied - user does not have enough privileges to open a file, or continue to operate on a file
|
|
17
|
+
*/
|
|
18
|
+
readonly authorizationError: "authorizationError";
|
|
19
|
+
/**
|
|
20
|
+
* File not found, or file deleted during session
|
|
21
|
+
*/
|
|
22
|
+
readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
|
|
23
|
+
/**
|
|
24
|
+
* We can not reach server due to computer being offline.
|
|
25
|
+
*/
|
|
26
|
+
readonly offlineError: "offlineError";
|
|
27
|
+
readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
|
|
28
|
+
/**
|
|
29
|
+
* User does not have write permissions to a file, but is changing content of a file.
|
|
30
|
+
* That might be indication of some data store error - data stores should not generate ops in readonly mode.
|
|
31
|
+
*/
|
|
32
|
+
readonly writeError: "writeError";
|
|
33
|
+
/**
|
|
34
|
+
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
35
|
+
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
36
|
+
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
37
|
+
* CSP violation, etc.
|
|
38
|
+
*/
|
|
39
|
+
readonly fetchFailure: "fetchFailure";
|
|
40
|
+
/**
|
|
41
|
+
* This error occurs when token provider fails to fetch orderer token
|
|
42
|
+
*/
|
|
43
|
+
readonly fetchTokenError: "fetchTokenError";
|
|
44
|
+
/**
|
|
45
|
+
* Unexpected response from server. Either JSON is malformed, or some required properties are missing
|
|
46
|
+
*/
|
|
47
|
+
readonly incorrectServerResponse: "incorrectServerResponse";
|
|
48
|
+
/**
|
|
49
|
+
* This error occurs when the file is modified externally (not through Fluid protocol) in storage.
|
|
50
|
+
* It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
|
|
51
|
+
* and storage / driver / loader detects such mismatch.
|
|
52
|
+
* When it's hit, client needs to forget all the knowledge about this file and start over.
|
|
53
|
+
*/
|
|
54
|
+
readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
|
|
55
|
+
/**
|
|
56
|
+
* The document is read-only and delta stream connection is forbidden.
|
|
57
|
+
*/
|
|
58
|
+
readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
|
|
59
|
+
/**
|
|
60
|
+
* The location of file/container can change on server. So if the file location moves and we try to access the old
|
|
61
|
+
* location, then this error is thrown to let the client know about the new location info.
|
|
62
|
+
*/
|
|
63
|
+
readonly locationRedirection: "locationRedirection";
|
|
64
|
+
/**
|
|
65
|
+
* When a file is not a Fluid file, but has Fluid extension such as ".note",
|
|
66
|
+
* server won't be able to open it and will return this error. The innerMostErrorCode will be
|
|
67
|
+
* "fluidInvalidSchema"
|
|
68
|
+
*/
|
|
69
|
+
readonly fluidInvalidSchema: "fluidInvalidSchema";
|
|
70
|
+
/**
|
|
71
|
+
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
72
|
+
*/
|
|
73
|
+
readonly fileIsLocked: "fileIsLocked";
|
|
74
|
+
readonly genericError: "genericError";
|
|
75
|
+
readonly throttlingError: "throttlingError";
|
|
76
|
+
readonly usageError: "usageError";
|
|
77
|
+
};
|
|
78
|
+
export declare type DriverErrorTypes = typeof DriverErrorTypes[keyof typeof DriverErrorTypes];
|
|
6
79
|
/**
|
|
7
80
|
* Driver Error types
|
|
8
81
|
* Lists types that are likely to be used by all drivers
|
|
82
|
+
*
|
|
83
|
+
* @deprecated Use {@link (DriverErrorTypes:type)} instead.
|
|
9
84
|
*/
|
|
10
85
|
export declare enum DriverErrorType {
|
|
11
86
|
/**
|
|
@@ -103,7 +178,9 @@ export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
|
|
|
103
178
|
*/
|
|
104
179
|
export interface IDriverErrorBase {
|
|
105
180
|
/**
|
|
106
|
-
* Classification of what type of error this is, used programmatically by consumers to interpret the error
|
|
181
|
+
* Classification of what type of error this is, used programmatically by consumers to interpret the error.
|
|
182
|
+
*
|
|
183
|
+
* @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).
|
|
107
184
|
*/
|
|
108
185
|
readonly errorType: DriverErrorType;
|
|
109
186
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.d.ts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"driverError.d.ts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"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"}
|
package/dist/driverError.js
CHANGED
|
@@ -4,10 +4,89 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.DriverErrorType = void 0;
|
|
7
|
+
exports.DriverErrorType = exports.DriverErrorTypes = void 0;
|
|
8
|
+
const core_interfaces_1 = require("@fluidframework/core-interfaces");
|
|
9
|
+
// Omit `dataCorruptionError` and `dataProcessingError` from the list of values inherited from FluidErrorTypes
|
|
10
|
+
const { dataCorruptionError, dataProcessingError, ...FluidErrorTypesExceptDataTypes } = core_interfaces_1.FluidErrorTypes;
|
|
11
|
+
/**
|
|
12
|
+
* Different error types the Driver may report out to the Host.
|
|
13
|
+
*/
|
|
14
|
+
exports.DriverErrorTypes = {
|
|
15
|
+
// Inherit base error types
|
|
16
|
+
...FluidErrorTypesExceptDataTypes,
|
|
17
|
+
/**
|
|
18
|
+
* Some non-categorized (below) networking error
|
|
19
|
+
* Include errors like fatal server error (usually 500).
|
|
20
|
+
*/
|
|
21
|
+
genericNetworkError: "genericNetworkError",
|
|
22
|
+
/**
|
|
23
|
+
* Access denied - user does not have enough privileges to open a file, or continue to operate on a file
|
|
24
|
+
*/
|
|
25
|
+
authorizationError: "authorizationError",
|
|
26
|
+
/**
|
|
27
|
+
* File not found, or file deleted during session
|
|
28
|
+
*/
|
|
29
|
+
fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError",
|
|
30
|
+
/**
|
|
31
|
+
* We can not reach server due to computer being offline.
|
|
32
|
+
*/
|
|
33
|
+
offlineError: "offlineError",
|
|
34
|
+
/*
|
|
35
|
+
* Unsupported client protocol
|
|
36
|
+
*/
|
|
37
|
+
unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion",
|
|
38
|
+
/**
|
|
39
|
+
* User does not have write permissions to a file, but is changing content of a file.
|
|
40
|
+
* That might be indication of some data store error - data stores should not generate ops in readonly mode.
|
|
41
|
+
*/
|
|
42
|
+
writeError: "writeError",
|
|
43
|
+
/**
|
|
44
|
+
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
45
|
+
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
46
|
+
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
47
|
+
* CSP violation, etc.
|
|
48
|
+
*/
|
|
49
|
+
fetchFailure: "fetchFailure",
|
|
50
|
+
/**
|
|
51
|
+
* This error occurs when token provider fails to fetch orderer token
|
|
52
|
+
*/
|
|
53
|
+
fetchTokenError: "fetchTokenError",
|
|
54
|
+
/**
|
|
55
|
+
* Unexpected response from server. Either JSON is malformed, or some required properties are missing
|
|
56
|
+
*/
|
|
57
|
+
incorrectServerResponse: "incorrectServerResponse",
|
|
58
|
+
/**
|
|
59
|
+
* This error occurs when the file is modified externally (not through Fluid protocol) in storage.
|
|
60
|
+
* It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
|
|
61
|
+
* and storage / driver / loader detects such mismatch.
|
|
62
|
+
* When it's hit, client needs to forget all the knowledge about this file and start over.
|
|
63
|
+
*/
|
|
64
|
+
fileOverwrittenInStorage: "fileOverwrittenInStorage",
|
|
65
|
+
/**
|
|
66
|
+
* The document is read-only and delta stream connection is forbidden.
|
|
67
|
+
*/
|
|
68
|
+
deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden",
|
|
69
|
+
/**
|
|
70
|
+
* The location of file/container can change on server. So if the file location moves and we try to access the old
|
|
71
|
+
* location, then this error is thrown to let the client know about the new location info.
|
|
72
|
+
*/
|
|
73
|
+
locationRedirection: "locationRedirection",
|
|
74
|
+
/**
|
|
75
|
+
* When a file is not a Fluid file, but has Fluid extension such as ".note",
|
|
76
|
+
* server won't be able to open it and will return this error. The innerMostErrorCode will be
|
|
77
|
+
* "fluidInvalidSchema"
|
|
78
|
+
*/
|
|
79
|
+
fluidInvalidSchema: "fluidInvalidSchema",
|
|
80
|
+
/**
|
|
81
|
+
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
82
|
+
*/
|
|
83
|
+
fileIsLocked: "fileIsLocked",
|
|
84
|
+
};
|
|
8
85
|
/**
|
|
9
86
|
* Driver Error types
|
|
10
87
|
* Lists types that are likely to be used by all drivers
|
|
88
|
+
*
|
|
89
|
+
* @deprecated Use {@link (DriverErrorTypes:type)} instead.
|
|
11
90
|
*/
|
|
12
91
|
var DriverErrorType;
|
|
13
92
|
(function (DriverErrorType) {
|
package/dist/driverError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;GAGG;AACH,IAAY,eAiGX;AAjGD,WAAY,eAAe;IAC1B;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;OAEG;IACH,4DAAyC,CAAA;IAEzC;;OAEG;IACH,sFAAmE,CAAA;IAEnE;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,wFAAqE,CAAA;IAErE;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;;;;OAKG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,sEAAmD,CAAA;IAEnD;;;;;OAKG;IACH,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;IAEjE;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;;;OAIG;IACH,4DAAyC,CAAA;IAEzC;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;OAEG;IACH,gDAA6B,CAAA;AAC9B,CAAC,EAjGW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAiG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"./urlResolver\";\n\n/**\n * Driver Error types\n * Lists types that are likely to be used by all drivers\n */\nexport enum DriverErrorType {\n\t/**\n\t * A fatal error with no specific interpretation covered by other DriverErrorType values\n\t */\n\tgenericError = \"genericError\",\n\n\t/**\n\t * Some non-categorized (below) networking error\n\t * Include errors like fatal server error (usually 500).\n\t */\n\tgenericNetworkError = \"genericNetworkError\",\n\n\t/**\n\t * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n\t */\n\tauthorizationError = \"authorizationError\",\n\n\t/**\n\t * File not found, or file deleted during session\n\t */\n\tfileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n\t/**\n\t * Throttling error from server. Server is busy and is asking not to reconnect for some time\n\t */\n\tthrottlingError = \"throttlingError\",\n\n\t/**\n\t * We can not reach server due to computer being offline.\n\t */\n\tofflineError = \"offlineError\",\n\n\t/*\n\t * Unsupported client protocol\n\t */\n\tunsupportedClientProtocolVersion = \"unsupportedClientProtocolVersion\",\n\n\t/**\n\t * User does not have write permissions to a file, but is changing content of a file.\n\t * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n\t */\n\twriteError = \"writeError\",\n\n\t/**\n\t * A generic fetch failure that indicates we were not able to get a response from the server.\n\t * This may be due to the client being offline (though, if we are able to detect offline state it will be\n\t * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n\t * CSP violation, etc.\n\t */\n\tfetchFailure = \"fetchFailure\",\n\n\t/**\n\t * This error occurs when token provider fails to fetch orderer token\n\t */\n\tfetchTokenError = \"fetchTokenError\",\n\n\t/**\n\t * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n\t */\n\tincorrectServerResponse = \"incorrectServerResponse\",\n\n\t/**\n\t * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n\t * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n\t * and storage / driver / loader detects such mismatch.\n\t * When it's hit, client needs to forget all the knowledge about this file and start over.\n\t */\n\tfileOverwrittenInStorage = \"fileOverwrittenInStorage\",\n\n\t/**\n\t * The document is read-only and delta stream connection is forbidden.\n\t */\n\tdeltaStreamConnectionForbidden = \"deltaStreamConnectionForbidden\",\n\n\t/**\n\t * The location of file/container can change on server. So if the file location moves and we try to access the old\n\t * location, then this error is thrown to let the client know about the new location info.\n\t */\n\tlocationRedirection = \"locationRedirection\",\n\n\t/**\n\t * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n\t * server won't be able to open it and will return this error. The innerMostErrorCode will be\n\t * \"fluidInvalidSchema\"\n\t */\n\tfluidInvalidSchema = \"fluidInvalidSchema\",\n\n\t/**\n\t * Error indicating an API is being used improperly resulting in an invalid operation.\n\t * ! Should match the value of ContainerErrorType.usageError\n\t */\n\tusageError = \"usageError\",\n\n\t/**\n\t * File is locked for read/write by storage, e.g. whole collection is locked and access denied.\n\t */\n\tfileIsLocked = \"fileIsLocked\",\n}\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either DriverErrorType or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n */\nexport interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n\t/**\n\t * Classification of what type of error this is, used programmatically by consumers to interpret the error\n\t */\n\treadonly errorType: DriverErrorType;\n\n\t/**\n\t * Free-form error message\n\t */\n\treadonly message: string;\n\n\t/**\n\t * True indicates the caller may retry the failed action. False indicates it's a fatal error\n\t */\n\tcanRetry: boolean;\n\n\t/**\n\t * Best guess as to network conditions (online/offline) when the error arose.\n\t * See OnlineStatus enum in driver-utils package for expected values.\n\t */\n\tonline?: string;\n\n\t/**\n\t * Whether service was reachable and we got some response from service.\n\t */\n\tendpointReached?: boolean;\n}\n\nexport interface IThrottlingWarning extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.throttlingError;\n\treadonly retryAfterSeconds: number;\n}\n\nexport interface IGenericNetworkError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.genericNetworkError;\n\treadonly statusCode?: number;\n}\n\nexport interface IAuthorizationError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.authorizationError;\n\treadonly claims?: string;\n\treadonly tenantId?: string;\n}\n\nexport interface ILocationRedirectionError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.locationRedirection;\n\treadonly redirectUrl: IResolvedUrl;\n}\n\n/**\n * Having this uber interface without types that have their own interfaces\n * allows compiler to differentiate interfaces based on error type\n */\nexport interface IDriverBasicError extends IDriverErrorBase {\n\treadonly errorType:\n\t\t| DriverErrorType.genericError\n\t\t| DriverErrorType.fileNotFoundOrAccessDeniedError\n\t\t| DriverErrorType.offlineError\n\t\t| DriverErrorType.unsupportedClientProtocolVersion\n\t\t| DriverErrorType.writeError\n\t\t| DriverErrorType.fetchFailure\n\t\t| DriverErrorType.fetchTokenError\n\t\t| DriverErrorType.incorrectServerResponse\n\t\t| DriverErrorType.fileOverwrittenInStorage\n\t\t| DriverErrorType.fluidInvalidSchema\n\t\t| DriverErrorType.usageError\n\t\t| DriverErrorType.fileIsLocked;\n\treadonly statusCode?: number;\n}\n\nexport type DriverError =\n\t| IThrottlingWarning\n\t| IGenericNetworkError\n\t| IAuthorizationError\n\t| ILocationRedirectionError\n\t| IDriverBasicError;\n"]}
|
|
1
|
+
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,qEAAkE;AAIlE,8GAA8G;AAC9G,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,8BAA8B,EAAE,GACpF,iCAAe,CAAC;AAEjB;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC/B,2BAA2B;IAC3B,GAAG,8BAA8B;IAEjC;;;OAGG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,kBAAkB,EAAE,oBAAoB;IAExC;;OAEG;IACH,+BAA+B,EAAE,iCAAiC;IAElE;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,gCAAgC,EAAE,kCAAkC;IAEpE;;;OAGG;IACH,UAAU,EAAE,YAAY;IAExB;;;;;OAKG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,uBAAuB,EAAE,yBAAyB;IAElD;;;;;OAKG;IACH,wBAAwB,EAAE,0BAA0B;IAEpD;;OAEG;IACH,8BAA8B,EAAE,gCAAgC;IAEhE;;;OAGG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;;;OAIG;IACH,kBAAkB,EAAE,oBAAoB;IAExC;;OAEG;IACH,YAAY,EAAE,cAAc;CACnB,CAAC;AAGX;;;;;GAKG;AACH,IAAY,eAiGX;AAjGD,WAAY,eAAe;IAC1B;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;OAEG;IACH,4DAAyC,CAAA;IAEzC;;OAEG;IACH,sFAAmE,CAAA;IAEnE;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,wFAAqE,CAAA;IAErE;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;;;;OAKG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,sEAAmD,CAAA;IAEnD;;;;;OAKG;IACH,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;IAEjE;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;;;OAIG;IACH,4DAAyC,CAAA;IAEzC;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;OAEG;IACH,gDAA6B,CAAA;AAC9B,CAAC,EAjGW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAiG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidErrorTypes } from \"@fluidframework/core-interfaces\";\n\nimport { IResolvedUrl } from \"./urlResolver\";\n\n// Omit `dataCorruptionError` and `dataProcessingError` from the list of values inherited from FluidErrorTypes\nconst { dataCorruptionError, dataProcessingError, ...FluidErrorTypesExceptDataTypes } =\n\tFluidErrorTypes;\n\n/**\n * Different error types the Driver may report out to the Host.\n */\nexport const DriverErrorTypes = {\n\t// Inherit base error types\n\t...FluidErrorTypesExceptDataTypes,\n\n\t/**\n\t * Some non-categorized (below) networking error\n\t * Include errors like fatal server error (usually 500).\n\t */\n\tgenericNetworkError: \"genericNetworkError\",\n\n\t/**\n\t * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n\t */\n\tauthorizationError: \"authorizationError\",\n\n\t/**\n\t * File not found, or file deleted during session\n\t */\n\tfileNotFoundOrAccessDeniedError: \"fileNotFoundOrAccessDeniedError\",\n\n\t/**\n\t * We can not reach server due to computer being offline.\n\t */\n\tofflineError: \"offlineError\",\n\n\t/*\n\t * Unsupported client protocol\n\t */\n\tunsupportedClientProtocolVersion: \"unsupportedClientProtocolVersion\",\n\n\t/**\n\t * User does not have write permissions to a file, but is changing content of a file.\n\t * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n\t */\n\twriteError: \"writeError\",\n\n\t/**\n\t * A generic fetch failure that indicates we were not able to get a response from the server.\n\t * This may be due to the client being offline (though, if we are able to detect offline state it will be\n\t * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n\t * CSP violation, etc.\n\t */\n\tfetchFailure: \"fetchFailure\",\n\n\t/**\n\t * This error occurs when token provider fails to fetch orderer token\n\t */\n\tfetchTokenError: \"fetchTokenError\",\n\n\t/**\n\t * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n\t */\n\tincorrectServerResponse: \"incorrectServerResponse\",\n\n\t/**\n\t * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n\t * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n\t * and storage / driver / loader detects such mismatch.\n\t * When it's hit, client needs to forget all the knowledge about this file and start over.\n\t */\n\tfileOverwrittenInStorage: \"fileOverwrittenInStorage\",\n\n\t/**\n\t * The document is read-only and delta stream connection is forbidden.\n\t */\n\tdeltaStreamConnectionForbidden: \"deltaStreamConnectionForbidden\",\n\n\t/**\n\t * The location of file/container can change on server. So if the file location moves and we try to access the old\n\t * location, then this error is thrown to let the client know about the new location info.\n\t */\n\tlocationRedirection: \"locationRedirection\",\n\n\t/**\n\t * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n\t * server won't be able to open it and will return this error. The innerMostErrorCode will be\n\t * \"fluidInvalidSchema\"\n\t */\n\tfluidInvalidSchema: \"fluidInvalidSchema\",\n\n\t/**\n\t * File is locked for read/write by storage, e.g. whole collection is locked and access denied.\n\t */\n\tfileIsLocked: \"fileIsLocked\",\n} as const;\nexport type DriverErrorTypes = typeof DriverErrorTypes[keyof typeof DriverErrorTypes];\n\n/**\n * Driver Error types\n * Lists types that are likely to be used by all drivers\n *\n * @deprecated Use {@link (DriverErrorTypes:type)} instead.\n */\nexport enum DriverErrorType {\n\t/**\n\t * A fatal error with no specific interpretation covered by other DriverErrorType values\n\t */\n\tgenericError = \"genericError\",\n\n\t/**\n\t * Some non-categorized (below) networking error\n\t * Include errors like fatal server error (usually 500).\n\t */\n\tgenericNetworkError = \"genericNetworkError\",\n\n\t/**\n\t * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n\t */\n\tauthorizationError = \"authorizationError\",\n\n\t/**\n\t * File not found, or file deleted during session\n\t */\n\tfileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n\t/**\n\t * Throttling error from server. Server is busy and is asking not to reconnect for some time\n\t */\n\tthrottlingError = \"throttlingError\",\n\n\t/**\n\t * We can not reach server due to computer being offline.\n\t */\n\tofflineError = \"offlineError\",\n\n\t/*\n\t * Unsupported client protocol\n\t */\n\tunsupportedClientProtocolVersion = \"unsupportedClientProtocolVersion\",\n\n\t/**\n\t * User does not have write permissions to a file, but is changing content of a file.\n\t * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n\t */\n\twriteError = \"writeError\",\n\n\t/**\n\t * A generic fetch failure that indicates we were not able to get a response from the server.\n\t * This may be due to the client being offline (though, if we are able to detect offline state it will be\n\t * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n\t * CSP violation, etc.\n\t */\n\tfetchFailure = \"fetchFailure\",\n\n\t/**\n\t * This error occurs when token provider fails to fetch orderer token\n\t */\n\tfetchTokenError = \"fetchTokenError\",\n\n\t/**\n\t * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n\t */\n\tincorrectServerResponse = \"incorrectServerResponse\",\n\n\t/**\n\t * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n\t * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n\t * and storage / driver / loader detects such mismatch.\n\t * When it's hit, client needs to forget all the knowledge about this file and start over.\n\t */\n\tfileOverwrittenInStorage = \"fileOverwrittenInStorage\",\n\n\t/**\n\t * The document is read-only and delta stream connection is forbidden.\n\t */\n\tdeltaStreamConnectionForbidden = \"deltaStreamConnectionForbidden\",\n\n\t/**\n\t * The location of file/container can change on server. So if the file location moves and we try to access the old\n\t * location, then this error is thrown to let the client know about the new location info.\n\t */\n\tlocationRedirection = \"locationRedirection\",\n\n\t/**\n\t * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n\t * server won't be able to open it and will return this error. The innerMostErrorCode will be\n\t * \"fluidInvalidSchema\"\n\t */\n\tfluidInvalidSchema = \"fluidInvalidSchema\",\n\n\t/**\n\t * Error indicating an API is being used improperly resulting in an invalid operation.\n\t * ! Should match the value of ContainerErrorType.usageError\n\t */\n\tusageError = \"usageError\",\n\n\t/**\n\t * File is locked for read/write by storage, e.g. whole collection is locked and access denied.\n\t */\n\tfileIsLocked = \"fileIsLocked\",\n}\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either DriverErrorType or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n */\nexport interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n\t/**\n\t * Classification of what type of error this is, used programmatically by consumers to interpret the error.\n\t *\n\t * @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).\n\t */\n\treadonly errorType: DriverErrorType;\n\n\t/**\n\t * Free-form error message\n\t */\n\treadonly message: string;\n\n\t/**\n\t * True indicates the caller may retry the failed action. False indicates it's a fatal error\n\t */\n\tcanRetry: boolean;\n\n\t/**\n\t * Best guess as to network conditions (online/offline) when the error arose.\n\t * See OnlineStatus enum in driver-utils package for expected values.\n\t */\n\tonline?: string;\n\n\t/**\n\t * Whether service was reachable and we got some response from service.\n\t */\n\tendpointReached?: boolean;\n}\n\nexport interface IThrottlingWarning extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.throttlingError;\n\treadonly retryAfterSeconds: number;\n}\n\nexport interface IGenericNetworkError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.genericNetworkError;\n\treadonly statusCode?: number;\n}\n\nexport interface IAuthorizationError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.authorizationError;\n\treadonly claims?: string;\n\treadonly tenantId?: string;\n}\n\nexport interface ILocationRedirectionError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.locationRedirection;\n\treadonly redirectUrl: IResolvedUrl;\n}\n\n/**\n * Having this uber interface without types that have their own interfaces\n * allows compiler to differentiate interfaces based on error type\n */\nexport interface IDriverBasicError extends IDriverErrorBase {\n\treadonly errorType:\n\t\t| DriverErrorType.genericError\n\t\t| DriverErrorType.fileNotFoundOrAccessDeniedError\n\t\t| DriverErrorType.offlineError\n\t\t| DriverErrorType.unsupportedClientProtocolVersion\n\t\t| DriverErrorType.writeError\n\t\t| DriverErrorType.fetchFailure\n\t\t| DriverErrorType.fetchTokenError\n\t\t| DriverErrorType.incorrectServerResponse\n\t\t| DriverErrorType.fileOverwrittenInStorage\n\t\t| DriverErrorType.fluidInvalidSchema\n\t\t| DriverErrorType.usageError\n\t\t| DriverErrorType.fileIsLocked;\n\treadonly statusCode?: number;\n}\n\nexport type DriverError =\n\t| IThrottlingWarning\n\t| IGenericNetworkError\n\t| IAuthorizationError\n\t| ILocationRedirectionError\n\t| IDriverBasicError;\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 { DriverError, DriverErrorType, IAnyDriverError, IAuthorizationError, IDriverErrorBase, IDriverBasicError, IGenericNetworkError, ILocationRedirectionError, IThrottlingWarning, } from "./driverError";
|
|
5
|
+
export { DriverError, DriverErrorType, DriverErrorTypes, IAnyDriverError, IAuthorizationError, IDriverErrorBase, IDriverBasicError, IGenericNetworkError, ILocationRedirectionError, IThrottlingWarning, } from "./driverError";
|
|
6
6
|
export { FetchSource, FiveDaysMs, IDeltasFetchResult, IDeltaStorageService, IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IDocumentDeltaStorageService, IDocumentService, IDocumentServiceFactory, IDocumentServicePolicies, IDocumentStorageService, IDocumentStorageServicePolicies, IStream, IStreamResult, ISummaryContext, LoaderCachingPolicy, } from "./storage";
|
|
7
7
|
export { DriverPreCheckInfo, DriverHeader, IContainerPackageInfo, IDriverHeader, IResolvedUrl, IUrlResolver, } from "./urlResolver";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
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,EACN,WAAW,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,OAAO,EACP,aAAa,EACb,eAAe,EACf,mBAAmB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,YAAY,GACZ,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,OAAO,EACP,aAAa,EACb,eAAe,EACf,mBAAmB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,YAAY,GACZ,MAAM,eAAe,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.DriverHeader = exports.LoaderCachingPolicy = exports.FetchSource = exports.DriverErrorType = void 0;
|
|
7
|
+
exports.DriverHeader = exports.LoaderCachingPolicy = exports.FetchSource = exports.DriverErrorTypes = exports.DriverErrorType = void 0;
|
|
8
8
|
var driverError_1 = require("./driverError");
|
|
9
9
|
Object.defineProperty(exports, "DriverErrorType", { enumerable: true, get: function () { return driverError_1.DriverErrorType; } });
|
|
10
|
+
Object.defineProperty(exports, "DriverErrorTypes", { enumerable: true, get: function () { return driverError_1.DriverErrorTypes; } });
|
|
10
11
|
var storage_1 = require("./storage");
|
|
11
12
|
Object.defineProperty(exports, "FetchSource", { enumerable: true, get: function () { return storage_1.FetchSource; } });
|
|
12
13
|
Object.defineProperty(exports, "LoaderCachingPolicy", { enumerable: true, get: function () { return storage_1.LoaderCachingPolicy; } });
|
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,6CAWuB;AATtB,8GAAA,eAAe,OAAA;AACf,+GAAA,gBAAgB,OAAA;AASjB,qCAiBmB;AAhBlB,sGAAA,WAAW,OAAA;AAeX,8GAAA,mBAAmB,OAAA;AAEpB,6CAOuB;AALtB,2GAAA,YAAY,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tDriverError,\n\tDriverErrorType,\n\tDriverErrorTypes,\n\tIAnyDriverError,\n\tIAuthorizationError,\n\tIDriverErrorBase,\n\tIDriverBasicError,\n\tIGenericNetworkError,\n\tILocationRedirectionError,\n\tIThrottlingWarning,\n} from \"./driverError\";\nexport {\n\tFetchSource,\n\tFiveDaysMs,\n\tIDeltasFetchResult,\n\tIDeltaStorageService,\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tIStream,\n\tIStreamResult,\n\tISummaryContext,\n\tLoaderCachingPolicy,\n} from \"./storage\";\nexport {\n\tDriverPreCheckInfo,\n\tDriverHeader,\n\tIContainerPackageInfo,\n\tIDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"./urlResolver\";\n"]}
|
package/lib/driverError.d.ts
CHANGED
|
@@ -3,9 +3,84 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IResolvedUrl } from "./urlResolver";
|
|
6
|
+
/**
|
|
7
|
+
* Different error types the Driver may report out to the Host.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DriverErrorTypes: {
|
|
10
|
+
/**
|
|
11
|
+
* Some non-categorized (below) networking error
|
|
12
|
+
* Include errors like fatal server error (usually 500).
|
|
13
|
+
*/
|
|
14
|
+
readonly genericNetworkError: "genericNetworkError";
|
|
15
|
+
/**
|
|
16
|
+
* Access denied - user does not have enough privileges to open a file, or continue to operate on a file
|
|
17
|
+
*/
|
|
18
|
+
readonly authorizationError: "authorizationError";
|
|
19
|
+
/**
|
|
20
|
+
* File not found, or file deleted during session
|
|
21
|
+
*/
|
|
22
|
+
readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
|
|
23
|
+
/**
|
|
24
|
+
* We can not reach server due to computer being offline.
|
|
25
|
+
*/
|
|
26
|
+
readonly offlineError: "offlineError";
|
|
27
|
+
readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
|
|
28
|
+
/**
|
|
29
|
+
* User does not have write permissions to a file, but is changing content of a file.
|
|
30
|
+
* That might be indication of some data store error - data stores should not generate ops in readonly mode.
|
|
31
|
+
*/
|
|
32
|
+
readonly writeError: "writeError";
|
|
33
|
+
/**
|
|
34
|
+
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
35
|
+
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
36
|
+
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
37
|
+
* CSP violation, etc.
|
|
38
|
+
*/
|
|
39
|
+
readonly fetchFailure: "fetchFailure";
|
|
40
|
+
/**
|
|
41
|
+
* This error occurs when token provider fails to fetch orderer token
|
|
42
|
+
*/
|
|
43
|
+
readonly fetchTokenError: "fetchTokenError";
|
|
44
|
+
/**
|
|
45
|
+
* Unexpected response from server. Either JSON is malformed, or some required properties are missing
|
|
46
|
+
*/
|
|
47
|
+
readonly incorrectServerResponse: "incorrectServerResponse";
|
|
48
|
+
/**
|
|
49
|
+
* This error occurs when the file is modified externally (not through Fluid protocol) in storage.
|
|
50
|
+
* It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
|
|
51
|
+
* and storage / driver / loader detects such mismatch.
|
|
52
|
+
* When it's hit, client needs to forget all the knowledge about this file and start over.
|
|
53
|
+
*/
|
|
54
|
+
readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
|
|
55
|
+
/**
|
|
56
|
+
* The document is read-only and delta stream connection is forbidden.
|
|
57
|
+
*/
|
|
58
|
+
readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
|
|
59
|
+
/**
|
|
60
|
+
* The location of file/container can change on server. So if the file location moves and we try to access the old
|
|
61
|
+
* location, then this error is thrown to let the client know about the new location info.
|
|
62
|
+
*/
|
|
63
|
+
readonly locationRedirection: "locationRedirection";
|
|
64
|
+
/**
|
|
65
|
+
* When a file is not a Fluid file, but has Fluid extension such as ".note",
|
|
66
|
+
* server won't be able to open it and will return this error. The innerMostErrorCode will be
|
|
67
|
+
* "fluidInvalidSchema"
|
|
68
|
+
*/
|
|
69
|
+
readonly fluidInvalidSchema: "fluidInvalidSchema";
|
|
70
|
+
/**
|
|
71
|
+
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
72
|
+
*/
|
|
73
|
+
readonly fileIsLocked: "fileIsLocked";
|
|
74
|
+
readonly genericError: "genericError";
|
|
75
|
+
readonly throttlingError: "throttlingError";
|
|
76
|
+
readonly usageError: "usageError";
|
|
77
|
+
};
|
|
78
|
+
export declare type DriverErrorTypes = typeof DriverErrorTypes[keyof typeof DriverErrorTypes];
|
|
6
79
|
/**
|
|
7
80
|
* Driver Error types
|
|
8
81
|
* Lists types that are likely to be used by all drivers
|
|
82
|
+
*
|
|
83
|
+
* @deprecated Use {@link (DriverErrorTypes:type)} instead.
|
|
9
84
|
*/
|
|
10
85
|
export declare enum DriverErrorType {
|
|
11
86
|
/**
|
|
@@ -103,7 +178,9 @@ export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
|
|
|
103
178
|
*/
|
|
104
179
|
export interface IDriverErrorBase {
|
|
105
180
|
/**
|
|
106
|
-
* Classification of what type of error this is, used programmatically by consumers to interpret the error
|
|
181
|
+
* Classification of what type of error this is, used programmatically by consumers to interpret the error.
|
|
182
|
+
*
|
|
183
|
+
* @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).
|
|
107
184
|
*/
|
|
108
185
|
readonly errorType: DriverErrorType;
|
|
109
186
|
/**
|
package/lib/driverError.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.d.ts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"driverError.d.ts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"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"}
|
package/lib/driverError.js
CHANGED
|
@@ -2,9 +2,88 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { FluidErrorTypes } from "@fluidframework/core-interfaces";
|
|
6
|
+
// Omit `dataCorruptionError` and `dataProcessingError` from the list of values inherited from FluidErrorTypes
|
|
7
|
+
const { dataCorruptionError, dataProcessingError, ...FluidErrorTypesExceptDataTypes } = FluidErrorTypes;
|
|
8
|
+
/**
|
|
9
|
+
* Different error types the Driver may report out to the Host.
|
|
10
|
+
*/
|
|
11
|
+
export const DriverErrorTypes = {
|
|
12
|
+
// Inherit base error types
|
|
13
|
+
...FluidErrorTypesExceptDataTypes,
|
|
14
|
+
/**
|
|
15
|
+
* Some non-categorized (below) networking error
|
|
16
|
+
* Include errors like fatal server error (usually 500).
|
|
17
|
+
*/
|
|
18
|
+
genericNetworkError: "genericNetworkError",
|
|
19
|
+
/**
|
|
20
|
+
* Access denied - user does not have enough privileges to open a file, or continue to operate on a file
|
|
21
|
+
*/
|
|
22
|
+
authorizationError: "authorizationError",
|
|
23
|
+
/**
|
|
24
|
+
* File not found, or file deleted during session
|
|
25
|
+
*/
|
|
26
|
+
fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError",
|
|
27
|
+
/**
|
|
28
|
+
* We can not reach server due to computer being offline.
|
|
29
|
+
*/
|
|
30
|
+
offlineError: "offlineError",
|
|
31
|
+
/*
|
|
32
|
+
* Unsupported client protocol
|
|
33
|
+
*/
|
|
34
|
+
unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion",
|
|
35
|
+
/**
|
|
36
|
+
* User does not have write permissions to a file, but is changing content of a file.
|
|
37
|
+
* That might be indication of some data store error - data stores should not generate ops in readonly mode.
|
|
38
|
+
*/
|
|
39
|
+
writeError: "writeError",
|
|
40
|
+
/**
|
|
41
|
+
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
42
|
+
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
43
|
+
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
44
|
+
* CSP violation, etc.
|
|
45
|
+
*/
|
|
46
|
+
fetchFailure: "fetchFailure",
|
|
47
|
+
/**
|
|
48
|
+
* This error occurs when token provider fails to fetch orderer token
|
|
49
|
+
*/
|
|
50
|
+
fetchTokenError: "fetchTokenError",
|
|
51
|
+
/**
|
|
52
|
+
* Unexpected response from server. Either JSON is malformed, or some required properties are missing
|
|
53
|
+
*/
|
|
54
|
+
incorrectServerResponse: "incorrectServerResponse",
|
|
55
|
+
/**
|
|
56
|
+
* This error occurs when the file is modified externally (not through Fluid protocol) in storage.
|
|
57
|
+
* It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
|
|
58
|
+
* and storage / driver / loader detects such mismatch.
|
|
59
|
+
* When it's hit, client needs to forget all the knowledge about this file and start over.
|
|
60
|
+
*/
|
|
61
|
+
fileOverwrittenInStorage: "fileOverwrittenInStorage",
|
|
62
|
+
/**
|
|
63
|
+
* The document is read-only and delta stream connection is forbidden.
|
|
64
|
+
*/
|
|
65
|
+
deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden",
|
|
66
|
+
/**
|
|
67
|
+
* The location of file/container can change on server. So if the file location moves and we try to access the old
|
|
68
|
+
* location, then this error is thrown to let the client know about the new location info.
|
|
69
|
+
*/
|
|
70
|
+
locationRedirection: "locationRedirection",
|
|
71
|
+
/**
|
|
72
|
+
* When a file is not a Fluid file, but has Fluid extension such as ".note",
|
|
73
|
+
* server won't be able to open it and will return this error. The innerMostErrorCode will be
|
|
74
|
+
* "fluidInvalidSchema"
|
|
75
|
+
*/
|
|
76
|
+
fluidInvalidSchema: "fluidInvalidSchema",
|
|
77
|
+
/**
|
|
78
|
+
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
79
|
+
*/
|
|
80
|
+
fileIsLocked: "fileIsLocked",
|
|
81
|
+
};
|
|
5
82
|
/**
|
|
6
83
|
* Driver Error types
|
|
7
84
|
* Lists types that are likely to be used by all drivers
|
|
85
|
+
*
|
|
86
|
+
* @deprecated Use {@link (DriverErrorTypes:type)} instead.
|
|
8
87
|
*/
|
|
9
88
|
export var DriverErrorType;
|
|
10
89
|
(function (DriverErrorType) {
|
package/lib/driverError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,CAAN,IAAY,eAiGX;AAjGD,WAAY,eAAe;IAC1B;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;OAEG;IACH,4DAAyC,CAAA;IAEzC;;OAEG;IACH,sFAAmE,CAAA;IAEnE;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,wFAAqE,CAAA;IAErE;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;;;;OAKG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,sEAAmD,CAAA;IAEnD;;;;;OAKG;IACH,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;IAEjE;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;;;OAIG;IACH,4DAAyC,CAAA;IAEzC;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;OAEG;IACH,gDAA6B,CAAA;AAC9B,CAAC,EAjGW,eAAe,KAAf,eAAe,QAiG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResolvedUrl } from \"./urlResolver\";\n\n/**\n * Driver Error types\n * Lists types that are likely to be used by all drivers\n */\nexport enum DriverErrorType {\n\t/**\n\t * A fatal error with no specific interpretation covered by other DriverErrorType values\n\t */\n\tgenericError = \"genericError\",\n\n\t/**\n\t * Some non-categorized (below) networking error\n\t * Include errors like fatal server error (usually 500).\n\t */\n\tgenericNetworkError = \"genericNetworkError\",\n\n\t/**\n\t * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n\t */\n\tauthorizationError = \"authorizationError\",\n\n\t/**\n\t * File not found, or file deleted during session\n\t */\n\tfileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n\t/**\n\t * Throttling error from server. Server is busy and is asking not to reconnect for some time\n\t */\n\tthrottlingError = \"throttlingError\",\n\n\t/**\n\t * We can not reach server due to computer being offline.\n\t */\n\tofflineError = \"offlineError\",\n\n\t/*\n\t * Unsupported client protocol\n\t */\n\tunsupportedClientProtocolVersion = \"unsupportedClientProtocolVersion\",\n\n\t/**\n\t * User does not have write permissions to a file, but is changing content of a file.\n\t * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n\t */\n\twriteError = \"writeError\",\n\n\t/**\n\t * A generic fetch failure that indicates we were not able to get a response from the server.\n\t * This may be due to the client being offline (though, if we are able to detect offline state it will be\n\t * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n\t * CSP violation, etc.\n\t */\n\tfetchFailure = \"fetchFailure\",\n\n\t/**\n\t * This error occurs when token provider fails to fetch orderer token\n\t */\n\tfetchTokenError = \"fetchTokenError\",\n\n\t/**\n\t * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n\t */\n\tincorrectServerResponse = \"incorrectServerResponse\",\n\n\t/**\n\t * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n\t * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n\t * and storage / driver / loader detects such mismatch.\n\t * When it's hit, client needs to forget all the knowledge about this file and start over.\n\t */\n\tfileOverwrittenInStorage = \"fileOverwrittenInStorage\",\n\n\t/**\n\t * The document is read-only and delta stream connection is forbidden.\n\t */\n\tdeltaStreamConnectionForbidden = \"deltaStreamConnectionForbidden\",\n\n\t/**\n\t * The location of file/container can change on server. So if the file location moves and we try to access the old\n\t * location, then this error is thrown to let the client know about the new location info.\n\t */\n\tlocationRedirection = \"locationRedirection\",\n\n\t/**\n\t * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n\t * server won't be able to open it and will return this error. The innerMostErrorCode will be\n\t * \"fluidInvalidSchema\"\n\t */\n\tfluidInvalidSchema = \"fluidInvalidSchema\",\n\n\t/**\n\t * Error indicating an API is being used improperly resulting in an invalid operation.\n\t * ! Should match the value of ContainerErrorType.usageError\n\t */\n\tusageError = \"usageError\",\n\n\t/**\n\t * File is locked for read/write by storage, e.g. whole collection is locked and access denied.\n\t */\n\tfileIsLocked = \"fileIsLocked\",\n}\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either DriverErrorType or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n */\nexport interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n\t/**\n\t * Classification of what type of error this is, used programmatically by consumers to interpret the error\n\t */\n\treadonly errorType: DriverErrorType;\n\n\t/**\n\t * Free-form error message\n\t */\n\treadonly message: string;\n\n\t/**\n\t * True indicates the caller may retry the failed action. False indicates it's a fatal error\n\t */\n\tcanRetry: boolean;\n\n\t/**\n\t * Best guess as to network conditions (online/offline) when the error arose.\n\t * See OnlineStatus enum in driver-utils package for expected values.\n\t */\n\tonline?: string;\n\n\t/**\n\t * Whether service was reachable and we got some response from service.\n\t */\n\tendpointReached?: boolean;\n}\n\nexport interface IThrottlingWarning extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.throttlingError;\n\treadonly retryAfterSeconds: number;\n}\n\nexport interface IGenericNetworkError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.genericNetworkError;\n\treadonly statusCode?: number;\n}\n\nexport interface IAuthorizationError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.authorizationError;\n\treadonly claims?: string;\n\treadonly tenantId?: string;\n}\n\nexport interface ILocationRedirectionError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.locationRedirection;\n\treadonly redirectUrl: IResolvedUrl;\n}\n\n/**\n * Having this uber interface without types that have their own interfaces\n * allows compiler to differentiate interfaces based on error type\n */\nexport interface IDriverBasicError extends IDriverErrorBase {\n\treadonly errorType:\n\t\t| DriverErrorType.genericError\n\t\t| DriverErrorType.fileNotFoundOrAccessDeniedError\n\t\t| DriverErrorType.offlineError\n\t\t| DriverErrorType.unsupportedClientProtocolVersion\n\t\t| DriverErrorType.writeError\n\t\t| DriverErrorType.fetchFailure\n\t\t| DriverErrorType.fetchTokenError\n\t\t| DriverErrorType.incorrectServerResponse\n\t\t| DriverErrorType.fileOverwrittenInStorage\n\t\t| DriverErrorType.fluidInvalidSchema\n\t\t| DriverErrorType.usageError\n\t\t| DriverErrorType.fileIsLocked;\n\treadonly statusCode?: number;\n}\n\nexport type DriverError =\n\t| IThrottlingWarning\n\t| IGenericNetworkError\n\t| IAuthorizationError\n\t| ILocationRedirectionError\n\t| IDriverBasicError;\n"]}
|
|
1
|
+
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAIlE,8GAA8G;AAC9G,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,GAAG,8BAA8B,EAAE,GACpF,eAAe,CAAC;AAEjB;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,2BAA2B;IAC3B,GAAG,8BAA8B;IAEjC;;;OAGG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,kBAAkB,EAAE,oBAAoB;IAExC;;OAEG;IACH,+BAA+B,EAAE,iCAAiC;IAElE;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,gCAAgC,EAAE,kCAAkC;IAEpE;;;OAGG;IACH,UAAU,EAAE,YAAY;IAExB;;;;;OAKG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,eAAe,EAAE,iBAAiB;IAElC;;OAEG;IACH,uBAAuB,EAAE,yBAAyB;IAElD;;;;;OAKG;IACH,wBAAwB,EAAE,0BAA0B;IAEpD;;OAEG;IACH,8BAA8B,EAAE,gCAAgC;IAEhE;;;OAGG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;;;OAIG;IACH,kBAAkB,EAAE,oBAAoB;IAExC;;OAEG;IACH,YAAY,EAAE,cAAc;CACnB,CAAC;AAGX;;;;;GAKG;AACH,MAAM,CAAN,IAAY,eAiGX;AAjGD,WAAY,eAAe;IAC1B;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;OAEG;IACH,4DAAyC,CAAA;IAEzC;;OAEG;IACH,sFAAmE,CAAA;IAEnE;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,wFAAqE,CAAA;IAErE;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;;;;OAKG;IACH,gDAA6B,CAAA;IAE7B;;OAEG;IACH,sDAAmC,CAAA;IAEnC;;OAEG;IACH,sEAAmD,CAAA;IAEnD;;;;;OAKG;IACH,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;IAEjE;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;;;OAIG;IACH,4DAAyC,CAAA;IAEzC;;;OAGG;IACH,4CAAyB,CAAA;IAEzB;;OAEG;IACH,gDAA6B,CAAA;AAC9B,CAAC,EAjGW,eAAe,KAAf,eAAe,QAiG1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidErrorTypes } from \"@fluidframework/core-interfaces\";\n\nimport { IResolvedUrl } from \"./urlResolver\";\n\n// Omit `dataCorruptionError` and `dataProcessingError` from the list of values inherited from FluidErrorTypes\nconst { dataCorruptionError, dataProcessingError, ...FluidErrorTypesExceptDataTypes } =\n\tFluidErrorTypes;\n\n/**\n * Different error types the Driver may report out to the Host.\n */\nexport const DriverErrorTypes = {\n\t// Inherit base error types\n\t...FluidErrorTypesExceptDataTypes,\n\n\t/**\n\t * Some non-categorized (below) networking error\n\t * Include errors like fatal server error (usually 500).\n\t */\n\tgenericNetworkError: \"genericNetworkError\",\n\n\t/**\n\t * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n\t */\n\tauthorizationError: \"authorizationError\",\n\n\t/**\n\t * File not found, or file deleted during session\n\t */\n\tfileNotFoundOrAccessDeniedError: \"fileNotFoundOrAccessDeniedError\",\n\n\t/**\n\t * We can not reach server due to computer being offline.\n\t */\n\tofflineError: \"offlineError\",\n\n\t/*\n\t * Unsupported client protocol\n\t */\n\tunsupportedClientProtocolVersion: \"unsupportedClientProtocolVersion\",\n\n\t/**\n\t * User does not have write permissions to a file, but is changing content of a file.\n\t * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n\t */\n\twriteError: \"writeError\",\n\n\t/**\n\t * A generic fetch failure that indicates we were not able to get a response from the server.\n\t * This may be due to the client being offline (though, if we are able to detect offline state it will be\n\t * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n\t * CSP violation, etc.\n\t */\n\tfetchFailure: \"fetchFailure\",\n\n\t/**\n\t * This error occurs when token provider fails to fetch orderer token\n\t */\n\tfetchTokenError: \"fetchTokenError\",\n\n\t/**\n\t * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n\t */\n\tincorrectServerResponse: \"incorrectServerResponse\",\n\n\t/**\n\t * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n\t * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n\t * and storage / driver / loader detects such mismatch.\n\t * When it's hit, client needs to forget all the knowledge about this file and start over.\n\t */\n\tfileOverwrittenInStorage: \"fileOverwrittenInStorage\",\n\n\t/**\n\t * The document is read-only and delta stream connection is forbidden.\n\t */\n\tdeltaStreamConnectionForbidden: \"deltaStreamConnectionForbidden\",\n\n\t/**\n\t * The location of file/container can change on server. So if the file location moves and we try to access the old\n\t * location, then this error is thrown to let the client know about the new location info.\n\t */\n\tlocationRedirection: \"locationRedirection\",\n\n\t/**\n\t * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n\t * server won't be able to open it and will return this error. The innerMostErrorCode will be\n\t * \"fluidInvalidSchema\"\n\t */\n\tfluidInvalidSchema: \"fluidInvalidSchema\",\n\n\t/**\n\t * File is locked for read/write by storage, e.g. whole collection is locked and access denied.\n\t */\n\tfileIsLocked: \"fileIsLocked\",\n} as const;\nexport type DriverErrorTypes = typeof DriverErrorTypes[keyof typeof DriverErrorTypes];\n\n/**\n * Driver Error types\n * Lists types that are likely to be used by all drivers\n *\n * @deprecated Use {@link (DriverErrorTypes:type)} instead.\n */\nexport enum DriverErrorType {\n\t/**\n\t * A fatal error with no specific interpretation covered by other DriverErrorType values\n\t */\n\tgenericError = \"genericError\",\n\n\t/**\n\t * Some non-categorized (below) networking error\n\t * Include errors like fatal server error (usually 500).\n\t */\n\tgenericNetworkError = \"genericNetworkError\",\n\n\t/**\n\t * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n\t */\n\tauthorizationError = \"authorizationError\",\n\n\t/**\n\t * File not found, or file deleted during session\n\t */\n\tfileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n\t/**\n\t * Throttling error from server. Server is busy and is asking not to reconnect for some time\n\t */\n\tthrottlingError = \"throttlingError\",\n\n\t/**\n\t * We can not reach server due to computer being offline.\n\t */\n\tofflineError = \"offlineError\",\n\n\t/*\n\t * Unsupported client protocol\n\t */\n\tunsupportedClientProtocolVersion = \"unsupportedClientProtocolVersion\",\n\n\t/**\n\t * User does not have write permissions to a file, but is changing content of a file.\n\t * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n\t */\n\twriteError = \"writeError\",\n\n\t/**\n\t * A generic fetch failure that indicates we were not able to get a response from the server.\n\t * This may be due to the client being offline (though, if we are able to detect offline state it will be\n\t * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n\t * CSP violation, etc.\n\t */\n\tfetchFailure = \"fetchFailure\",\n\n\t/**\n\t * This error occurs when token provider fails to fetch orderer token\n\t */\n\tfetchTokenError = \"fetchTokenError\",\n\n\t/**\n\t * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n\t */\n\tincorrectServerResponse = \"incorrectServerResponse\",\n\n\t/**\n\t * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n\t * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n\t * and storage / driver / loader detects such mismatch.\n\t * When it's hit, client needs to forget all the knowledge about this file and start over.\n\t */\n\tfileOverwrittenInStorage = \"fileOverwrittenInStorage\",\n\n\t/**\n\t * The document is read-only and delta stream connection is forbidden.\n\t */\n\tdeltaStreamConnectionForbidden = \"deltaStreamConnectionForbidden\",\n\n\t/**\n\t * The location of file/container can change on server. So if the file location moves and we try to access the old\n\t * location, then this error is thrown to let the client know about the new location info.\n\t */\n\tlocationRedirection = \"locationRedirection\",\n\n\t/**\n\t * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n\t * server won't be able to open it and will return this error. The innerMostErrorCode will be\n\t * \"fluidInvalidSchema\"\n\t */\n\tfluidInvalidSchema = \"fluidInvalidSchema\",\n\n\t/**\n\t * Error indicating an API is being used improperly resulting in an invalid operation.\n\t * ! Should match the value of ContainerErrorType.usageError\n\t */\n\tusageError = \"usageError\",\n\n\t/**\n\t * File is locked for read/write by storage, e.g. whole collection is locked and access denied.\n\t */\n\tfileIsLocked = \"fileIsLocked\",\n}\n\n/**\n * Interface describing errors and warnings raised by any driver code.\n * Not expected to be implemented by a class or an object literal, but rather used in place of\n * any or unknown in various function signatures that pass errors around.\n *\n * \"Any\" in the interface name is a nod to the fact that errorType has lost its type constraint.\n * It will be either DriverErrorType or the specific driver's specialized error type enum,\n * but we can't reference a specific driver's error type enum in this code.\n */\nexport interface IAnyDriverError extends Omit<IDriverErrorBase, \"errorType\"> {\n\treadonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n\t/**\n\t * Classification of what type of error this is, used programmatically by consumers to interpret the error.\n\t *\n\t * @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).\n\t */\n\treadonly errorType: DriverErrorType;\n\n\t/**\n\t * Free-form error message\n\t */\n\treadonly message: string;\n\n\t/**\n\t * True indicates the caller may retry the failed action. False indicates it's a fatal error\n\t */\n\tcanRetry: boolean;\n\n\t/**\n\t * Best guess as to network conditions (online/offline) when the error arose.\n\t * See OnlineStatus enum in driver-utils package for expected values.\n\t */\n\tonline?: string;\n\n\t/**\n\t * Whether service was reachable and we got some response from service.\n\t */\n\tendpointReached?: boolean;\n}\n\nexport interface IThrottlingWarning extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.throttlingError;\n\treadonly retryAfterSeconds: number;\n}\n\nexport interface IGenericNetworkError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.genericNetworkError;\n\treadonly statusCode?: number;\n}\n\nexport interface IAuthorizationError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.authorizationError;\n\treadonly claims?: string;\n\treadonly tenantId?: string;\n}\n\nexport interface ILocationRedirectionError extends IDriverErrorBase {\n\treadonly errorType: DriverErrorType.locationRedirection;\n\treadonly redirectUrl: IResolvedUrl;\n}\n\n/**\n * Having this uber interface without types that have their own interfaces\n * allows compiler to differentiate interfaces based on error type\n */\nexport interface IDriverBasicError extends IDriverErrorBase {\n\treadonly errorType:\n\t\t| DriverErrorType.genericError\n\t\t| DriverErrorType.fileNotFoundOrAccessDeniedError\n\t\t| DriverErrorType.offlineError\n\t\t| DriverErrorType.unsupportedClientProtocolVersion\n\t\t| DriverErrorType.writeError\n\t\t| DriverErrorType.fetchFailure\n\t\t| DriverErrorType.fetchTokenError\n\t\t| DriverErrorType.incorrectServerResponse\n\t\t| DriverErrorType.fileOverwrittenInStorage\n\t\t| DriverErrorType.fluidInvalidSchema\n\t\t| DriverErrorType.usageError\n\t\t| DriverErrorType.fileIsLocked;\n\treadonly statusCode?: number;\n}\n\nexport type DriverError =\n\t| IThrottlingWarning\n\t| IGenericNetworkError\n\t| IAuthorizationError\n\t| ILocationRedirectionError\n\t| IDriverBasicError;\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 { DriverError, DriverErrorType, IAnyDriverError, IAuthorizationError, IDriverErrorBase, IDriverBasicError, IGenericNetworkError, ILocationRedirectionError, IThrottlingWarning, } from "./driverError";
|
|
5
|
+
export { DriverError, DriverErrorType, DriverErrorTypes, IAnyDriverError, IAuthorizationError, IDriverErrorBase, IDriverBasicError, IGenericNetworkError, ILocationRedirectionError, IThrottlingWarning, } from "./driverError";
|
|
6
6
|
export { FetchSource, FiveDaysMs, IDeltasFetchResult, IDeltaStorageService, IDocumentDeltaConnection, IDocumentDeltaConnectionEvents, IDocumentDeltaStorageService, IDocumentService, IDocumentServiceFactory, IDocumentServicePolicies, IDocumentStorageService, IDocumentStorageServicePolicies, IStream, IStreamResult, ISummaryContext, LoaderCachingPolicy, } from "./storage";
|
|
7
7
|
export { DriverPreCheckInfo, DriverHeader, IContainerPackageInfo, IDriverHeader, IResolvedUrl, IUrlResolver, } from "./urlResolver";
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
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,EACN,WAAW,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,OAAO,EACP,aAAa,EACb,eAAe,EACf,mBAAmB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,YAAY,GACZ,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,OAAO,EACP,aAAa,EACb,eAAe,EACf,mBAAmB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,YAAY,GACZ,MAAM,eAAe,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 { DriverErrorType, } from "./driverError";
|
|
5
|
+
export { DriverErrorType, DriverErrorTypes, } from "./driverError";
|
|
6
6
|
export { FetchSource, LoaderCachingPolicy, } from "./storage";
|
|
7
7
|
export { DriverHeader, } from "./urlResolver";
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
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,EAEN,eAAe,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,eAAe,EACf,gBAAgB,GAQhB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,WAAW,EAeX,mBAAmB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAEN,YAAY,GAKZ,MAAM,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tDriverError,\n\tDriverErrorType,\n\tDriverErrorTypes,\n\tIAnyDriverError,\n\tIAuthorizationError,\n\tIDriverErrorBase,\n\tIDriverBasicError,\n\tIGenericNetworkError,\n\tILocationRedirectionError,\n\tIThrottlingWarning,\n} from \"./driverError\";\nexport {\n\tFetchSource,\n\tFiveDaysMs,\n\tIDeltasFetchResult,\n\tIDeltaStorageService,\n\tIDocumentDeltaConnection,\n\tIDocumentDeltaConnectionEvents,\n\tIDocumentDeltaStorageService,\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIDocumentServicePolicies,\n\tIDocumentStorageService,\n\tIDocumentStorageServicePolicies,\n\tIStream,\n\tIStreamResult,\n\tISummaryContext,\n\tLoaderCachingPolicy,\n} from \"./storage\";\nexport {\n\tDriverPreCheckInfo,\n\tDriverHeader,\n\tIContainerPackageInfo,\n\tIDriverHeader,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"./urlResolver\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/driver-definitions",
|
|
3
|
-
"version": "2.0.0-internal.6.
|
|
3
|
+
"version": "2.0.0-internal.6.3.0",
|
|
4
4
|
"description": "Fluid driver definitions",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,17 +15,16 @@
|
|
|
15
15
|
"module": "lib/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.6.
|
|
18
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.6.3.0 <2.0.0-internal.6.4.0",
|
|
19
19
|
"@fluidframework/protocol-definitions": "^1.1.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@fluid-tools/build-cli": "^0.
|
|
22
|
+
"@fluid-tools/build-cli": "^0.22.0",
|
|
23
23
|
"@fluidframework/build-common": "^2.0.0",
|
|
24
|
-
"@fluidframework/build-tools": "^0.
|
|
24
|
+
"@fluidframework/build-tools": "^0.22.0",
|
|
25
25
|
"@fluidframework/driver-definitions-previous": "npm:@fluidframework/driver-definitions@2.0.0-internal.6.1.1",
|
|
26
26
|
"@fluidframework/eslint-config-fluid": "^2.1.0",
|
|
27
27
|
"@microsoft/api-extractor": "^7.34.4",
|
|
28
|
-
"concurrently": "^7.6.0",
|
|
29
28
|
"copyfiles": "^2.4.1",
|
|
30
29
|
"eslint": "~8.6.0",
|
|
31
30
|
"prettier": "~2.6.2",
|
|
@@ -52,7 +51,7 @@
|
|
|
52
51
|
"ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
|
|
53
52
|
"ci:test": "echo No test for this package",
|
|
54
53
|
"ci:test:coverage": "echo No test for this package",
|
|
55
|
-
"clean": "rimraf --glob
|
|
54
|
+
"clean": "rimraf --glob 'dist' 'lib' '*.tsbuildinfo' '*.build.log' '_api-extractor-temp'",
|
|
56
55
|
"eslint": "eslint --format stylish src",
|
|
57
56
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
58
57
|
"format": "npm run prettier:fix",
|
package/src/driverError.ts
CHANGED
|
@@ -3,11 +3,109 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { FluidErrorTypes } from "@fluidframework/core-interfaces";
|
|
7
|
+
|
|
6
8
|
import { IResolvedUrl } from "./urlResolver";
|
|
7
9
|
|
|
10
|
+
// Omit `dataCorruptionError` and `dataProcessingError` from the list of values inherited from FluidErrorTypes
|
|
11
|
+
const { dataCorruptionError, dataProcessingError, ...FluidErrorTypesExceptDataTypes } =
|
|
12
|
+
FluidErrorTypes;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Different error types the Driver may report out to the Host.
|
|
16
|
+
*/
|
|
17
|
+
export const DriverErrorTypes = {
|
|
18
|
+
// Inherit base error types
|
|
19
|
+
...FluidErrorTypesExceptDataTypes,
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Some non-categorized (below) networking error
|
|
23
|
+
* Include errors like fatal server error (usually 500).
|
|
24
|
+
*/
|
|
25
|
+
genericNetworkError: "genericNetworkError",
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Access denied - user does not have enough privileges to open a file, or continue to operate on a file
|
|
29
|
+
*/
|
|
30
|
+
authorizationError: "authorizationError",
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* File not found, or file deleted during session
|
|
34
|
+
*/
|
|
35
|
+
fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError",
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* We can not reach server due to computer being offline.
|
|
39
|
+
*/
|
|
40
|
+
offlineError: "offlineError",
|
|
41
|
+
|
|
42
|
+
/*
|
|
43
|
+
* Unsupported client protocol
|
|
44
|
+
*/
|
|
45
|
+
unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion",
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* User does not have write permissions to a file, but is changing content of a file.
|
|
49
|
+
* That might be indication of some data store error - data stores should not generate ops in readonly mode.
|
|
50
|
+
*/
|
|
51
|
+
writeError: "writeError",
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* A generic fetch failure that indicates we were not able to get a response from the server.
|
|
55
|
+
* This may be due to the client being offline (though, if we are able to detect offline state it will be
|
|
56
|
+
* logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
|
|
57
|
+
* CSP violation, etc.
|
|
58
|
+
*/
|
|
59
|
+
fetchFailure: "fetchFailure",
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* This error occurs when token provider fails to fetch orderer token
|
|
63
|
+
*/
|
|
64
|
+
fetchTokenError: "fetchTokenError",
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Unexpected response from server. Either JSON is malformed, or some required properties are missing
|
|
68
|
+
*/
|
|
69
|
+
incorrectServerResponse: "incorrectServerResponse",
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* This error occurs when the file is modified externally (not through Fluid protocol) in storage.
|
|
73
|
+
* It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
|
|
74
|
+
* and storage / driver / loader detects such mismatch.
|
|
75
|
+
* When it's hit, client needs to forget all the knowledge about this file and start over.
|
|
76
|
+
*/
|
|
77
|
+
fileOverwrittenInStorage: "fileOverwrittenInStorage",
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The document is read-only and delta stream connection is forbidden.
|
|
81
|
+
*/
|
|
82
|
+
deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden",
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The location of file/container can change on server. So if the file location moves and we try to access the old
|
|
86
|
+
* location, then this error is thrown to let the client know about the new location info.
|
|
87
|
+
*/
|
|
88
|
+
locationRedirection: "locationRedirection",
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* When a file is not a Fluid file, but has Fluid extension such as ".note",
|
|
92
|
+
* server won't be able to open it and will return this error. The innerMostErrorCode will be
|
|
93
|
+
* "fluidInvalidSchema"
|
|
94
|
+
*/
|
|
95
|
+
fluidInvalidSchema: "fluidInvalidSchema",
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
99
|
+
*/
|
|
100
|
+
fileIsLocked: "fileIsLocked",
|
|
101
|
+
} as const;
|
|
102
|
+
export type DriverErrorTypes = typeof DriverErrorTypes[keyof typeof DriverErrorTypes];
|
|
103
|
+
|
|
8
104
|
/**
|
|
9
105
|
* Driver Error types
|
|
10
106
|
* Lists types that are likely to be used by all drivers
|
|
107
|
+
*
|
|
108
|
+
* @deprecated Use {@link (DriverErrorTypes:type)} instead.
|
|
11
109
|
*/
|
|
12
110
|
export enum DriverErrorType {
|
|
13
111
|
/**
|
|
@@ -126,7 +224,9 @@ export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
|
|
|
126
224
|
*/
|
|
127
225
|
export interface IDriverErrorBase {
|
|
128
226
|
/**
|
|
129
|
-
* Classification of what type of error this is, used programmatically by consumers to interpret the error
|
|
227
|
+
* Classification of what type of error this is, used programmatically by consumers to interpret the error.
|
|
228
|
+
*
|
|
229
|
+
* @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).
|
|
130
230
|
*/
|
|
131
231
|
readonly errorType: DriverErrorType;
|
|
132
232
|
|