@fluidframework/driver-definitions 2.0.0-internal.2.3.1 → 2.0.0-internal.2.4.1
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/dist/driverError.d.ts +6 -2
- package/dist/driverError.d.ts.map +1 -1
- package/dist/driverError.js +4 -0
- package/dist/driverError.js.map +1 -1
- package/lib/driverError.d.ts +6 -2
- package/lib/driverError.d.ts.map +1 -1
- package/lib/driverError.js +4 -0
- package/lib/driverError.js.map +1 -1
- package/package.json +8 -7
- package/src/driverError.ts +8 -1
package/dist/driverError.d.ts
CHANGED
|
@@ -76,7 +76,11 @@ export declare enum DriverErrorType {
|
|
|
76
76
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
77
77
|
* ! Should match the value of ContainerErrorType.usageError
|
|
78
78
|
*/
|
|
79
|
-
usageError = "usageError"
|
|
79
|
+
usageError = "usageError",
|
|
80
|
+
/**
|
|
81
|
+
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
82
|
+
*/
|
|
83
|
+
fileIsLocked = "fileIsLocked"
|
|
80
84
|
}
|
|
81
85
|
/**
|
|
82
86
|
* Interface describing errors and warnings raised by any driver code.
|
|
@@ -134,7 +138,7 @@ export interface ILocationRedirectionError extends IDriverErrorBase {
|
|
|
134
138
|
* allows compiler to differentiate interfaces based on error type
|
|
135
139
|
*/
|
|
136
140
|
export interface IDriverBasicError extends IDriverErrorBase {
|
|
137
|
-
readonly errorType: DriverErrorType.genericError | DriverErrorType.fileNotFoundOrAccessDeniedError | DriverErrorType.offlineError | DriverErrorType.unsupportedClientProtocolVersion | DriverErrorType.writeError | DriverErrorType.fetchFailure | DriverErrorType.incorrectServerResponse | DriverErrorType.fileOverwrittenInStorage | DriverErrorType.fluidInvalidSchema | DriverErrorType.usageError;
|
|
141
|
+
readonly errorType: DriverErrorType.genericError | DriverErrorType.fileNotFoundOrAccessDeniedError | DriverErrorType.offlineError | DriverErrorType.unsupportedClientProtocolVersion | DriverErrorType.writeError | DriverErrorType.fetchFailure | DriverErrorType.incorrectServerResponse | DriverErrorType.fileOverwrittenInStorage | DriverErrorType.fluidInvalidSchema | DriverErrorType.usageError | DriverErrorType.fileIsLocked;
|
|
138
142
|
readonly statusCode?: number;
|
|
139
143
|
}
|
|
140
144
|
export declare type DriverError = IThrottlingWarning | IGenericNetworkError | IAuthorizationError | ILocationRedirectionError | IDriverBasicError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driverError.d.ts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;GAGG;AACH,oBAAY,eAAe;IACvB;;OAEG;IACH,YAAY,iBAAiB;IAE7B;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,kBAAkB,uBAAuB;IAEzC;;OAEG;IACH,+BAA+B,oCAAoC;IAEnE;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,YAAY,iBAAiB;IAK7B,gCAAgC,qCAAqC;IAErE;;;OAGG;IACH,UAAU,eAAe;IAEzB;;;;;OAKG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,uBAAuB,4BAA4B;IAEnD;;;;;OAKG;IACH,wBAAwB,6BAA6B;IAErD;;OAEG;IACH,8BAA8B,mCAAmC;IAEjE;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;;;OAIG;IACH,kBAAkB,uBAAuB;
|
|
1
|
+
{"version":3,"file":"driverError.d.ts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;GAGG;AACH,oBAAY,eAAe;IACvB;;OAEG;IACH,YAAY,iBAAiB;IAE7B;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,kBAAkB,uBAAuB;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kBAAkB,CAAC;IACvD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;IAC/D,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC,mBAAmB,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACvD,QAAQ,CAAC,SAAS,EAClB,eAAe,CAAC,YAAY,GAC1B,eAAe,CAAC,+BAA+B,GAC/C,eAAe,CAAC,YAAY,GAC5B,eAAe,CAAC,gCAAgC,GAChD,eAAe,CAAC,UAAU,GAC1B,eAAe,CAAC,YAAY,GAC5B,eAAe,CAAC,uBAAuB,GACvC,eAAe,CAAC,wBAAwB,GACxC,eAAe,CAAC,kBAAkB,GAClC,eAAe,CAAC,UAAU,GAC1B,eAAe,CAAC,YAAY,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,oBAAY,WAAW,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,yBAAyB,GACzB,iBAAiB,CAAC"}
|
package/dist/driverError.js
CHANGED
|
@@ -83,5 +83,9 @@ var DriverErrorType;
|
|
|
83
83
|
* ! Should match the value of ContainerErrorType.usageError
|
|
84
84
|
*/
|
|
85
85
|
DriverErrorType["usageError"] = "usageError";
|
|
86
|
+
/**
|
|
87
|
+
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
88
|
+
*/
|
|
89
|
+
DriverErrorType["fileIsLocked"] = "fileIsLocked";
|
|
86
90
|
})(DriverErrorType = exports.DriverErrorType || (exports.DriverErrorType = {}));
|
|
87
91
|
//# sourceMappingURL=driverError.js.map
|
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,
|
|
1
|
+
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;GAGG;AACH,IAAY,eA4FX;AA5FD,WAAY,eAAe;IACvB;;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,sEAAmD,CAAA;IAEnD;;;;;OAKG;IACH,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;IAEjE;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;;;OAIG;IACH,4DAAyC,CAAA;IAEzC;;;MAGE;IACF,4CAAyB,CAAA;IAEzB;;OAEG;IACH,gDAA6B,CAAA;AACjC,CAAC,EA5FW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QA4F1B","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 /**\n * A fatal error with no specific interpretation covered by other DriverErrorType values\n */\n genericError = \"genericError\",\n\n /**\n * Some non-categorized (below) networking error\n * Include errors like fatal server error (usually 500).\n */\n genericNetworkError = \"genericNetworkError\",\n\n /**\n * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n */\n authorizationError = \"authorizationError\",\n\n /**\n * File not found, or file deleted during session\n */\n fileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n /**\n * Throttling error from server. Server is busy and is asking not to reconnect for some time\n */\n throttlingError = \"throttlingError\",\n\n /**\n * We can not reach server due to computer being offline.\n */\n offlineError = \"offlineError\",\n\n /*\n * Unsupported client protocol\n */\n unsupportedClientProtocolVersion = \"unsupportedClientProtocolVersion\",\n\n /**\n * User does not have write permissions to a file, but is changing content of a file.\n * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n */\n writeError = \"writeError\",\n\n /**\n * A generic fetch failure that indicates we were not able to get a response from the server.\n * This may be due to the client being offline (though, if we are able to detect offline state it will be\n * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n * CSP violation, etc.\n */\n fetchFailure = \"fetchFailure\",\n\n /**\n * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n */\n incorrectServerResponse = \"incorrectServerResponse\",\n\n /**\n * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n * and storage / driver / loader detects such mismatch.\n * When it's hit, client needs to forget all the knowlege about this file and start over.\n */\n fileOverwrittenInStorage = \"fileOverwrittenInStorage\",\n\n /**\n * The document is read-only and delta stream connection is forbidden.\n */\n deltaStreamConnectionForbidden = \"deltaStreamConnectionForbidden\",\n\n /**\n * The location of file/container can change on server. So if the file location moves and we try to access the old\n * location, then this error is thrown to let the client know about the new location info.\n */\n locationRedirection = \"locationRedirection\",\n\n /**\n * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n * server won't be able to open it and will return this error. The innerMostErrorCode will be\n * \"fluidInvalidSchema\"\n */\n fluidInvalidSchema = \"fluidInvalidSchema\",\n\n /**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n * ! Should match the value of ContainerErrorType.usageError\n */\n usageError = \"usageError\",\n\n /**\n * File is locked for read/write by storage, e.g. whole collection is locked and access denied.\n */\n fileIsLocked = \"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 readonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n /**\n * Classification of what type of error this is, used programmatically by consumers to interpret the error\n */\n readonly errorType: DriverErrorType;\n\n /**\n * Free-form error message\n */\n readonly message: string;\n\n /**\n * True indicates the caller may retry the failed action. False indicates it's a fatal error\n */\n canRetry: boolean;\n\n /**\n * Best guess as to network conditions (online/offline) when the error arose.\n * See OnlineStatus enum in driver-utils package for expected values.\n */\n online?: string;\n}\n\nexport interface IThrottlingWarning extends IDriverErrorBase {\n readonly errorType: DriverErrorType.throttlingError;\n readonly retryAfterSeconds: number;\n}\n\nexport interface IGenericNetworkError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.genericNetworkError;\n readonly statusCode?: number;\n}\n\nexport interface IAuthorizationError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.authorizationError;\n readonly claims?: string;\n readonly tenantId?: string;\n}\n\nexport interface ILocationRedirectionError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.locationRedirection;\n readonly 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 readonly errorType:\n DriverErrorType.genericError\n | DriverErrorType.fileNotFoundOrAccessDeniedError\n | DriverErrorType.offlineError\n | DriverErrorType.unsupportedClientProtocolVersion\n | DriverErrorType.writeError\n | DriverErrorType.fetchFailure\n | DriverErrorType.incorrectServerResponse\n | DriverErrorType.fileOverwrittenInStorage\n | DriverErrorType.fluidInvalidSchema\n | DriverErrorType.usageError\n | DriverErrorType.fileIsLocked;\n readonly statusCode?: number;\n}\n\nexport type DriverError =\n | IThrottlingWarning\n | IGenericNetworkError\n | IAuthorizationError\n | ILocationRedirectionError\n | IDriverBasicError;\n"]}
|
package/lib/driverError.d.ts
CHANGED
|
@@ -76,7 +76,11 @@ export declare enum DriverErrorType {
|
|
|
76
76
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
77
77
|
* ! Should match the value of ContainerErrorType.usageError
|
|
78
78
|
*/
|
|
79
|
-
usageError = "usageError"
|
|
79
|
+
usageError = "usageError",
|
|
80
|
+
/**
|
|
81
|
+
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
82
|
+
*/
|
|
83
|
+
fileIsLocked = "fileIsLocked"
|
|
80
84
|
}
|
|
81
85
|
/**
|
|
82
86
|
* Interface describing errors and warnings raised by any driver code.
|
|
@@ -134,7 +138,7 @@ export interface ILocationRedirectionError extends IDriverErrorBase {
|
|
|
134
138
|
* allows compiler to differentiate interfaces based on error type
|
|
135
139
|
*/
|
|
136
140
|
export interface IDriverBasicError extends IDriverErrorBase {
|
|
137
|
-
readonly errorType: DriverErrorType.genericError | DriverErrorType.fileNotFoundOrAccessDeniedError | DriverErrorType.offlineError | DriverErrorType.unsupportedClientProtocolVersion | DriverErrorType.writeError | DriverErrorType.fetchFailure | DriverErrorType.incorrectServerResponse | DriverErrorType.fileOverwrittenInStorage | DriverErrorType.fluidInvalidSchema | DriverErrorType.usageError;
|
|
141
|
+
readonly errorType: DriverErrorType.genericError | DriverErrorType.fileNotFoundOrAccessDeniedError | DriverErrorType.offlineError | DriverErrorType.unsupportedClientProtocolVersion | DriverErrorType.writeError | DriverErrorType.fetchFailure | DriverErrorType.incorrectServerResponse | DriverErrorType.fileOverwrittenInStorage | DriverErrorType.fluidInvalidSchema | DriverErrorType.usageError | DriverErrorType.fileIsLocked;
|
|
138
142
|
readonly statusCode?: number;
|
|
139
143
|
}
|
|
140
144
|
export declare type DriverError = IThrottlingWarning | IGenericNetworkError | IAuthorizationError | ILocationRedirectionError | IDriverBasicError;
|
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;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;GAGG;AACH,oBAAY,eAAe;IACvB;;OAEG;IACH,YAAY,iBAAiB;IAE7B;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,kBAAkB,uBAAuB;IAEzC;;OAEG;IACH,+BAA+B,oCAAoC;IAEnE;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,YAAY,iBAAiB;IAK7B,gCAAgC,qCAAqC;IAErE;;;OAGG;IACH,UAAU,eAAe;IAEzB;;;;;OAKG;IACH,YAAY,iBAAiB;IAE7B;;OAEG;IACH,uBAAuB,4BAA4B;IAEnD;;;;;OAKG;IACH,wBAAwB,6BAA6B;IAErD;;OAEG;IACH,8BAA8B,mCAAmC;IAEjE;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;;;OAIG;IACH,kBAAkB,uBAAuB;
|
|
1
|
+
{"version":3,"file":"driverError.d.ts","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C;;;GAGG;AACH,oBAAY,eAAe;IACvB;;OAEG;IACH,YAAY,iBAAiB;IAE7B;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,kBAAkB,uBAAuB;IAEzC;;OAEG;IACH,+BAA+B,oCAAoC;IAEnE;;OAEG;IACH,eAAe,oBAAoB;IAEnC;;OAEG;IACH,YAAY,iBAAiB;IAK7B,gCAAgC,qCAAqC;IAErE;;;OAGG;IACH,UAAU,eAAe;IAEzB;;;;;OAKG;IACH,YAAY,iBAAiB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eAAe,CAAC,mBAAmB,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACvD,QAAQ,CAAC,SAAS,EAClB,eAAe,CAAC,YAAY,GAC1B,eAAe,CAAC,+BAA+B,GAC/C,eAAe,CAAC,YAAY,GAC5B,eAAe,CAAC,gCAAgC,GAChD,eAAe,CAAC,UAAU,GAC1B,eAAe,CAAC,YAAY,GAC5B,eAAe,CAAC,uBAAuB,GACvC,eAAe,CAAC,wBAAwB,GACxC,eAAe,CAAC,kBAAkB,GAClC,eAAe,CAAC,UAAU,GAC1B,eAAe,CAAC,YAAY,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,oBAAY,WAAW,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,yBAAyB,GACzB,iBAAiB,CAAC"}
|
package/lib/driverError.js
CHANGED
|
@@ -80,5 +80,9 @@ export var DriverErrorType;
|
|
|
80
80
|
* ! Should match the value of ContainerErrorType.usageError
|
|
81
81
|
*/
|
|
82
82
|
DriverErrorType["usageError"] = "usageError";
|
|
83
|
+
/**
|
|
84
|
+
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
85
|
+
*/
|
|
86
|
+
DriverErrorType["fileIsLocked"] = "fileIsLocked";
|
|
83
87
|
})(DriverErrorType || (DriverErrorType = {}));
|
|
84
88
|
//# sourceMappingURL=driverError.js.map
|
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,
|
|
1
|
+
{"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,CAAN,IAAY,eA4FX;AA5FD,WAAY,eAAe;IACvB;;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,sEAAmD,CAAA;IAEnD;;;;;OAKG;IACH,wEAAqD,CAAA;IAErD;;OAEG;IACH,oFAAiE,CAAA;IAEjE;;;OAGG;IACH,8DAA2C,CAAA;IAE3C;;;;OAIG;IACH,4DAAyC,CAAA;IAEzC;;;MAGE;IACF,4CAAyB,CAAA;IAEzB;;OAEG;IACH,gDAA6B,CAAA;AACjC,CAAC,EA5FW,eAAe,KAAf,eAAe,QA4F1B","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 /**\n * A fatal error with no specific interpretation covered by other DriverErrorType values\n */\n genericError = \"genericError\",\n\n /**\n * Some non-categorized (below) networking error\n * Include errors like fatal server error (usually 500).\n */\n genericNetworkError = \"genericNetworkError\",\n\n /**\n * Access denied - user does not have enough privileges to open a file, or continue to operate on a file\n */\n authorizationError = \"authorizationError\",\n\n /**\n * File not found, or file deleted during session\n */\n fileNotFoundOrAccessDeniedError = \"fileNotFoundOrAccessDeniedError\",\n\n /**\n * Throttling error from server. Server is busy and is asking not to reconnect for some time\n */\n throttlingError = \"throttlingError\",\n\n /**\n * We can not reach server due to computer being offline.\n */\n offlineError = \"offlineError\",\n\n /*\n * Unsupported client protocol\n */\n unsupportedClientProtocolVersion = \"unsupportedClientProtocolVersion\",\n\n /**\n * User does not have write permissions to a file, but is changing content of a file.\n * That might be indication of some data store error - data stores should not generate ops in readonly mode.\n */\n writeError = \"writeError\",\n\n /**\n * A generic fetch failure that indicates we were not able to get a response from the server.\n * This may be due to the client being offline (though, if we are able to detect offline state it will be\n * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,\n * CSP violation, etc.\n */\n fetchFailure = \"fetchFailure\",\n\n /**\n * Unexpected response from server. Either JSON is malformed, or some required properties are missing\n */\n incorrectServerResponse = \"incorrectServerResponse\",\n\n /**\n * This error occurs when the file is modified externally (not through Fluid protocol) in storage.\n * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,\n * and storage / driver / loader detects such mismatch.\n * When it's hit, client needs to forget all the knowlege about this file and start over.\n */\n fileOverwrittenInStorage = \"fileOverwrittenInStorage\",\n\n /**\n * The document is read-only and delta stream connection is forbidden.\n */\n deltaStreamConnectionForbidden = \"deltaStreamConnectionForbidden\",\n\n /**\n * The location of file/container can change on server. So if the file location moves and we try to access the old\n * location, then this error is thrown to let the client know about the new location info.\n */\n locationRedirection = \"locationRedirection\",\n\n /**\n * When a file is not a Fluid file, but has Fluid extension such as \".note\",\n * server won't be able to open it and will return this error. The innerMostErrorCode will be\n * \"fluidInvalidSchema\"\n */\n fluidInvalidSchema = \"fluidInvalidSchema\",\n\n /**\n * Error indicating an API is being used improperly resulting in an invalid operation.\n * ! Should match the value of ContainerErrorType.usageError\n */\n usageError = \"usageError\",\n\n /**\n * File is locked for read/write by storage, e.g. whole collection is locked and access denied.\n */\n fileIsLocked = \"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 readonly errorType: string;\n}\n\n/**\n * Base interface for all errors and warnings\n */\nexport interface IDriverErrorBase {\n /**\n * Classification of what type of error this is, used programmatically by consumers to interpret the error\n */\n readonly errorType: DriverErrorType;\n\n /**\n * Free-form error message\n */\n readonly message: string;\n\n /**\n * True indicates the caller may retry the failed action. False indicates it's a fatal error\n */\n canRetry: boolean;\n\n /**\n * Best guess as to network conditions (online/offline) when the error arose.\n * See OnlineStatus enum in driver-utils package for expected values.\n */\n online?: string;\n}\n\nexport interface IThrottlingWarning extends IDriverErrorBase {\n readonly errorType: DriverErrorType.throttlingError;\n readonly retryAfterSeconds: number;\n}\n\nexport interface IGenericNetworkError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.genericNetworkError;\n readonly statusCode?: number;\n}\n\nexport interface IAuthorizationError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.authorizationError;\n readonly claims?: string;\n readonly tenantId?: string;\n}\n\nexport interface ILocationRedirectionError extends IDriverErrorBase {\n readonly errorType: DriverErrorType.locationRedirection;\n readonly 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 readonly errorType:\n DriverErrorType.genericError\n | DriverErrorType.fileNotFoundOrAccessDeniedError\n | DriverErrorType.offlineError\n | DriverErrorType.unsupportedClientProtocolVersion\n | DriverErrorType.writeError\n | DriverErrorType.fetchFailure\n | DriverErrorType.incorrectServerResponse\n | DriverErrorType.fileOverwrittenInStorage\n | DriverErrorType.fluidInvalidSchema\n | DriverErrorType.usageError\n | DriverErrorType.fileIsLocked;\n readonly statusCode?: number;\n}\n\nexport type DriverError =\n | IThrottlingWarning\n | IGenericNetworkError\n | IAuthorizationError\n | ILocationRedirectionError\n | IDriverBasicError;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/driver-definitions",
|
|
3
|
-
"version": "2.0.0-internal.2.
|
|
3
|
+
"version": "2.0.0-internal.2.4.1",
|
|
4
4
|
"description": "Fluid driver definitions",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
43
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.
|
|
43
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.4.1 <2.0.0-internal.3.0.0",
|
|
44
44
|
"@fluidframework/protocol-definitions": "^1.1.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@fluid-tools/build-cli": "^0.
|
|
47
|
+
"@fluid-tools/build-cli": "^0.8.0",
|
|
48
48
|
"@fluidframework/build-common": "^1.1.0",
|
|
49
|
-
"@fluidframework/build-tools": "^0.
|
|
50
|
-
"@fluidframework/driver-definitions-previous": "npm:@fluidframework/driver-definitions@2.0.0-internal.2.
|
|
49
|
+
"@fluidframework/build-tools": "^0.8.0",
|
|
50
|
+
"@fluidframework/driver-definitions-previous": "npm:@fluidframework/driver-definitions@2.0.0-internal.2.4.0",
|
|
51
51
|
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
52
52
|
"@microsoft/api-extractor": "^7.22.2",
|
|
53
53
|
"@rushstack/eslint-config": "^2.5.1",
|
|
@@ -59,8 +59,9 @@
|
|
|
59
59
|
"typescript": "~4.5.5"
|
|
60
60
|
},
|
|
61
61
|
"typeValidation": {
|
|
62
|
-
"version": "2.0.0-internal.2.
|
|
63
|
-
"
|
|
62
|
+
"version": "2.0.0-internal.2.4.0",
|
|
63
|
+
"previousVersionStyle": "previousPatch",
|
|
64
|
+
"baselineRange": "2.0.0-internal.2.4.0",
|
|
64
65
|
"broken": {}
|
|
65
66
|
}
|
|
66
67
|
}
|
package/src/driverError.ts
CHANGED
|
@@ -90,11 +90,17 @@ export enum DriverErrorType {
|
|
|
90
90
|
* "fluidInvalidSchema"
|
|
91
91
|
*/
|
|
92
92
|
fluidInvalidSchema = "fluidInvalidSchema",
|
|
93
|
+
|
|
93
94
|
/**
|
|
94
95
|
* Error indicating an API is being used improperly resulting in an invalid operation.
|
|
95
96
|
* ! Should match the value of ContainerErrorType.usageError
|
|
96
97
|
*/
|
|
97
98
|
usageError = "usageError",
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* File is locked for read/write by storage, e.g. whole collection is locked and access denied.
|
|
102
|
+
*/
|
|
103
|
+
fileIsLocked = "fileIsLocked",
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
/**
|
|
@@ -172,7 +178,8 @@ export interface IDriverBasicError extends IDriverErrorBase {
|
|
|
172
178
|
| DriverErrorType.incorrectServerResponse
|
|
173
179
|
| DriverErrorType.fileOverwrittenInStorage
|
|
174
180
|
| DriverErrorType.fluidInvalidSchema
|
|
175
|
-
| DriverErrorType.usageError
|
|
181
|
+
| DriverErrorType.usageError
|
|
182
|
+
| DriverErrorType.fileIsLocked;
|
|
176
183
|
readonly statusCode?: number;
|
|
177
184
|
}
|
|
178
185
|
|