@fluidframework/driver-definitions 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.4.1.0.148229

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/.eslintrc.js CHANGED
@@ -4,8 +4,5 @@
4
4
  */
5
5
 
6
6
  module.exports = {
7
- "extends": [
8
- require.resolve("@fluidframework/eslint-config-fluid"),
9
- "prettier"
10
- ]
11
- }
7
+ extends: [require.resolve("@fluidframework/eslint-config-fluid"), "prettier"],
8
+ };
@@ -1,4 +1,4 @@
1
1
  {
2
- "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "@fluidframework/build-common/api-extractor-common-strict.json"
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "@fluidframework/build-common/api-extractor-common-strict.json"
4
4
  }
@@ -46,6 +46,10 @@ export declare enum DriverErrorType {
46
46
  * CSP violation, etc.
47
47
  */
48
48
  fetchFailure = "fetchFailure",
49
+ /**
50
+ * This error occurs when token provider fails to fetch orderer token
51
+ */
52
+ fetchTokenError = "fetchTokenError",
49
53
  /**
50
54
  * Unexpected response from server. Either JSON is malformed, or some required properties are missing
51
55
  */
@@ -54,7 +58,7 @@ export declare enum DriverErrorType {
54
58
  * This error occurs when the file is modified externally (not through Fluid protocol) in storage.
55
59
  * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
56
60
  * and storage / driver / loader detects such mismatch.
57
- * When it's hit, client needs to forget all the knowlege about this file and start over.
61
+ * When it's hit, client needs to forget all the knowledge about this file and start over.
58
62
  */
59
63
  fileOverwrittenInStorage = "fileOverwrittenInStorage",
60
64
  /**
@@ -75,8 +79,12 @@ export declare enum DriverErrorType {
75
79
  /**
76
80
  * Error indicating an API is being used improperly resulting in an invalid operation.
77
81
  * ! Should match the value of ContainerErrorType.usageError
78
- */
79
- usageError = "usageError"
82
+ */
83
+ usageError = "usageError",
84
+ /**
85
+ * File is locked for read/write by storage, e.g. whole collection is locked and access denied.
86
+ */
87
+ fileIsLocked = "fileIsLocked"
80
88
  }
81
89
  /**
82
90
  * Interface describing errors and warnings raised by any driver code.
@@ -94,11 +102,17 @@ export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
94
102
  * Base interface for all errors and warnings
95
103
  */
96
104
  export interface IDriverErrorBase {
97
- /** Classification of what type of error this is, used programmatically by consumers to interpret the error */
105
+ /**
106
+ * Classification of what type of error this is, used programmatically by consumers to interpret the error
107
+ */
98
108
  readonly errorType: DriverErrorType;
99
- /** Free-form error message */
109
+ /**
110
+ * Free-form error message
111
+ */
100
112
  readonly message: string;
101
- /** True indicates the caller may retry the failed action. False indicates it's a fatal error */
113
+ /**
114
+ * True indicates the caller may retry the failed action. False indicates it's a fatal error
115
+ */
102
116
  canRetry: boolean;
103
117
  /**
104
118
  * Best guess as to network conditions (online/offline) when the error arose.
@@ -128,7 +142,7 @@ export interface ILocationRedirectionError extends IDriverErrorBase {
128
142
  * allows compiler to differentiate interfaces based on error type
129
143
  */
130
144
  export interface IDriverBasicError extends IDriverErrorBase {
131
- readonly errorType: DriverErrorType.genericError | DriverErrorType.fileNotFoundOrAccessDeniedError | DriverErrorType.offlineError | DriverErrorType.unsupportedClientProtocolVersion | DriverErrorType.writeError | DriverErrorType.fetchFailure | DriverErrorType.incorrectServerResponse | DriverErrorType.fileOverwrittenInStorage | DriverErrorType.fluidInvalidSchema | DriverErrorType.usageError;
145
+ readonly errorType: DriverErrorType.genericError | DriverErrorType.fileNotFoundOrAccessDeniedError | DriverErrorType.offlineError | DriverErrorType.unsupportedClientProtocolVersion | DriverErrorType.writeError | DriverErrorType.fetchFailure | DriverErrorType.fetchTokenError | DriverErrorType.incorrectServerResponse | DriverErrorType.fileOverwrittenInStorage | DriverErrorType.fluidInvalidSchema | DriverErrorType.usageError | DriverErrorType.fileIsLocked;
132
146
  readonly statusCode?: number;
133
147
  }
134
148
  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;IACzC;;;MAGE;IACF,UAAU,eAAe;CAC5B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC;IACxE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,8GAA8G;IAC9G,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,8BAA8B;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gGAAgG;IAChG,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IACxD,QAAQ,CAAC,SAAS,E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,eAAe,CAAC,mBAAmB,CAAC;IACxD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC5D,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC,kBAAkB,CAAC;IACvD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;IAClE,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC,mBAAmB,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IAC1D,QAAQ,CAAC,SAAS,EACf,eAAe,CAAC,YAAY,GAC5B,eAAe,CAAC,+BAA+B,GAC/C,eAAe,CAAC,YAAY,GAC5B,eAAe,CAAC,gCAAgC,GAChD,eAAe,CAAC,UAAU,GAC1B,eAAe,CAAC,YAAY,GAC5B,eAAe,CAAC,eAAe,GAC/B,eAAe,CAAC,uBAAuB,GACvC,eAAe,CAAC,wBAAwB,GACxC,eAAe,CAAC,kBAAkB,GAClC,eAAe,CAAC,UAAU,GAC1B,eAAe,CAAC,YAAY,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,oBAAY,WAAW,GACpB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,yBAAyB,GACzB,iBAAiB,CAAC"}
@@ -52,6 +52,10 @@ var DriverErrorType;
52
52
  * CSP violation, etc.
53
53
  */
54
54
  DriverErrorType["fetchFailure"] = "fetchFailure";
55
+ /**
56
+ * This error occurs when token provider fails to fetch orderer token
57
+ */
58
+ DriverErrorType["fetchTokenError"] = "fetchTokenError";
55
59
  /**
56
60
  * Unexpected response from server. Either JSON is malformed, or some required properties are missing
57
61
  */
@@ -60,7 +64,7 @@ var DriverErrorType;
60
64
  * This error occurs when the file is modified externally (not through Fluid protocol) in storage.
61
65
  * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
62
66
  * and storage / driver / loader detects such mismatch.
63
- * When it's hit, client needs to forget all the knowlege about this file and start over.
67
+ * When it's hit, client needs to forget all the knowledge about this file and start over.
64
68
  */
65
69
  DriverErrorType["fileOverwrittenInStorage"] = "fileOverwrittenInStorage";
66
70
  /**
@@ -81,7 +85,11 @@ var DriverErrorType;
81
85
  /**
82
86
  * Error indicating an API is being used improperly resulting in an invalid operation.
83
87
  * ! Should match the value of ContainerErrorType.usageError
84
- */
88
+ */
85
89
  DriverErrorType["usageError"] = "usageError";
90
+ /**
91
+ * File is locked for read/write by storage, e.g. whole collection is locked and access denied.
92
+ */
93
+ DriverErrorType["fileIsLocked"] = "fileIsLocked";
86
94
  })(DriverErrorType = exports.DriverErrorType || (exports.DriverErrorType = {}));
87
95
  //# sourceMappingURL=driverError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;GAGG;AACH,IAAY,eAsFX;AAtFD,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;IACzC;;;MAGE;IACF,4CAAyB,CAAA;AAC7B,CAAC,EAtFW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAsF1B","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 * 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/**\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 /** Classification of what type of error this is, used programmatically by consumers to interpret the error */\n readonly errorType: DriverErrorType;\n /** Free-form error message */\n readonly message: string;\n /** True indicates the caller may retry the failed action. False indicates it's a fatal error */\n canRetry: boolean;\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 readonly statusCode?: number;\n}\n\nexport type DriverError =\n | IThrottlingWarning\n | IGenericNetworkError\n | IAuthorizationError\n | ILocationRedirectionError\n | IDriverBasicError;\n"]}
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\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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,WAAW,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,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,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,YAAY,GACf,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,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,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,YAAY,GACZ,MAAM,eAAe,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6CAUuB;AARnB,8GAAA,eAAe,OAAA;AASnB,qCAiBmB;AAhBf,sGAAA,WAAW,OAAA;AAeX,8GAAA,mBAAmB,OAAA;AAEvB,6CAUuB;AARnB,2GAAA,YAAY,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n DriverError,\n DriverErrorType,\n IAnyDriverError,\n IAuthorizationError,\n IDriverErrorBase,\n IDriverBasicError,\n IGenericNetworkError,\n ILocationRedirectionError,\n IThrottlingWarning,\n} from \"./driverError\";\nexport {\n FetchSource,\n FiveDaysMs,\n IDeltasFetchResult,\n IDeltaStorageService,\n IDocumentDeltaConnection,\n IDocumentDeltaConnectionEvents,\n IDocumentDeltaStorageService,\n IDocumentService,\n IDocumentServiceFactory,\n IDocumentServicePolicies,\n IDocumentStorageService,\n IDocumentStorageServicePolicies,\n IStream,\n IStreamResult,\n ISummaryContext,\n LoaderCachingPolicy,\n} from \"./storage\";\nexport {\n DriverPreCheckInfo,\n DriverHeader,\n IContainerPackageInfo,\n IDriverHeader,\n IFluidResolvedUrl,\n IResolvedUrl,\n IResolvedUrlBase,\n IWebResolvedUrl,\n IUrlResolver,\n} from \"./urlResolver\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6CAUuB;AARtB,8GAAA,eAAe,OAAA;AAShB,qCAiBmB;AAhBlB,sGAAA,WAAW,OAAA;AAeX,8GAAA,mBAAmB,OAAA;AAEpB,6CAUuB;AARtB,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\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\tIFluidResolvedUrl,\n\tIResolvedUrl,\n\tIResolvedUrlBase,\n\tIWebResolvedUrl,\n\tIUrlResolver,\n} from \"./urlResolver\";\n"]}
package/dist/storage.d.ts CHANGED
@@ -66,7 +66,14 @@ export interface IDocumentDeltaStorageService {
66
66
  fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean, fetchReason?: string): IStream<ISequencedDocumentMessage[]>;
67
67
  }
68
68
  export declare type FiveDaysMs = 432000000;
69
+ /**
70
+ * Policies describing attributes or characteristics of the driver's storage service,
71
+ * to direct how other components interact with the driver
72
+ */
69
73
  export interface IDocumentStorageServicePolicies {
74
+ /**
75
+ * Should the Loader implement any sort of pre-fetching or caching mechanism?
76
+ */
70
77
  readonly caching?: LoaderCachingPolicy;
71
78
  /**
72
79
  * If this policy is provided, it tells runtime on ideal size for blobs.
@@ -74,10 +81,12 @@ export interface IDocumentStorageServicePolicies {
74
81
  */
75
82
  readonly minBlobSize?: number;
76
83
  /**
84
+ * IMPORTANT: This policy MUST be set to 5 days and PROPERLY ENFORCED for drivers that are used
85
+ * in applications where Garbage Collection is enabled. Otherwise data loss may occur.
86
+ *
87
+ * This policy pertains to requests for the latest snapshot from the service.
88
+ * If set, it means that the driver guarantees not to use a cached value that was fetched more than 5 days ago.
77
89
  * If undefined, the driver makes no guarantees about the age of snapshots used for loading.
78
- * Otherwise, the driver will not use snapshots that were added to the cache more than 5 days ago (per client clock)
79
- * The value MUST be 5 days if defined. This fixed upper bound is necessary for the Garbage Collection feature
80
- * in the Runtime layer to reliably compute when an object will never be referenced again and can be deleted.
81
90
  */
82
91
  readonly maximumCacheDurationMs?: FiveDaysMs;
83
92
  }
@@ -214,6 +223,10 @@ export interface IDocumentServicePolicies {
214
223
  * Do not connect to delta stream
215
224
  */
216
225
  readonly storageOnly?: boolean;
226
+ /**
227
+ * Summarizer uploads the protocol tree too when summarizing.
228
+ */
229
+ readonly summarizeProtocolTree?: boolean;
217
230
  }
218
231
  export interface IDocumentService {
219
232
  resolvedUrl: IResolvedUrl;
@@ -222,7 +235,7 @@ export interface IDocumentService {
222
235
  */
223
236
  policies?: IDocumentServicePolicies;
224
237
  /**
225
- * Access to storage associated with the document...
238
+ * Access to storage associated with the document
226
239
  */
227
240
  connectToStorage(): Promise<IDocumentStorageService>;
228
241
  /**
@@ -239,17 +252,13 @@ export interface IDocumentService {
239
252
  * Please note that it does not remove the need for caller to close all active delta connections,
240
253
  * as storage may not be tracking such objects.
241
254
  * @param error - tells if container (and storage) are closed due to critical error.
242
- * Error might be due to disconnect between client & server knowlege about file, like file being overwritten
255
+ * Error might be due to disconnect between client & server knowledge about file, like file being overwritten
243
256
  * in storage, but client having stale local cache.
244
257
  * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.
245
258
  */
246
259
  dispose(error?: any): void;
247
260
  }
248
261
  export interface IDocumentServiceFactory {
249
- /**
250
- * Name of the protocol used by factory
251
- */
252
- protocolName: string;
253
262
  /**
254
263
  * Creates the document service after extracting different endpoints URLs from a resolved URL.
255
264
  *
@@ -1 +1 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AACpH,OAAO,EACH,cAAc,EACd,OAAO,EACP,oBAAoB,EACpB,mBAAmB,EACnB,gBAAg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GAC1B,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE7B;;;;;;;;;;OAUG;IACH,eAAe,CACd,gBAAgB,EAAE,YAAY,GAAG,SAAS,EAC1C,oBAAoB,EAAE,YAAY,EAClC,MAAM,CAAC,EAAE,oBAAoB,EAC7B,kBAAkB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAEvC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;CACzC;AAED,oBAAY,WAAW;IACtB,OAAO,YAAY;IACnB,OAAO,YAAY;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiQH,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC3B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACZ,CAAC,EAVW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAU9B;AA0GD,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACvB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDisposable, IEventProvider, IErrorEvent, ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport {\n ConnectionMode,\n IClient,\n IClientConfiguration,\n ICreateBlobResponse,\n IDocumentMessage,\n INack,\n ISequencedDocumentMessage,\n ISignalClient,\n ISignalMessage,\n ISnapshotTree,\n ISummaryHandle,\n ISummaryTree,\n ITokenClaims,\n IVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAnyDriverError } from \"./driverError\";\nimport { IResolvedUrl } from \"./urlResolver\";\n\nexport interface IDeltasFetchResult {\n /**\n * Sequential set of messages starting from 'from' sequence number.\n * May be partial result, i.e. not fulfill original request in full.\n */\n messages: ISequencedDocumentMessage[];\n\n /**\n * If true, storage only partially fulfilled request, but has more ops\n * If false, the request was fulfilled. If less ops were returned then\n * requested, then storage does not have more ops in this range.\n */\n partialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDeltaStorageService {\n /**\n * Retrieves all the delta operations within the inclusive sequence number range\n * @param tenantId - Id of the tenant.\n * @param id - document id.\n * @param from - first op to retrieve (inclusive)\n * @param to - first op not to retrieve (exclusive end)\n * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n * spo which could help in debugging sessions if any issue occurs.\n */\n get(\n tenantId: string,\n id: string,\n from: number, // inclusive\n to: number, // exclusive\n fetchReason?: string,\n ): Promise<IDeltasFetchResult>;\n}\n\nexport type IStreamResult<T> = { done: true; } | { done: false; value: T; };\n\n/**\n * Read interface for the Queue\n */\nexport interface IStream<T> {\n read(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDocumentDeltaStorageService {\n /**\n * Retrieves all the delta operations within the exclusive sequence number range\n * @param from - first op to retrieve (inclusive)\n * @param to - first op not to retrieve (exclusive end)\n * @param abortSignal - signal that aborts operation\n * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n * spo which could help in debugging sessions if any issue occurs.\n */\n fetchMessages(from: number,\n to: number | undefined,\n abortSignal?: AbortSignal,\n cachedOnly?: boolean,\n fetchReason?: string,\n ): IStream<ISequencedDocumentMessage[]>;\n}\n\n// DO NOT INCREASE THIS TYPE'S VALUE - If a driver started using a larger value, GC would likely start closing sessions\nexport type FiveDaysMs = 432000000; /* 5 days in milliseconds */\n\nexport interface IDocumentStorageServicePolicies {\n readonly caching?: LoaderCachingPolicy;\n\n /**\n * If this policy is provided, it tells runtime on ideal size for blobs.\n * Blobs that are smaller than that size should be aggregated into bigger blobs.\n */\n readonly minBlobSize?: number;\n\n /**\n * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n * Otherwise, the driver will not use snapshots that were added to the cache more than 5 days ago (per client clock)\n * The value MUST be 5 days if defined. This fixed upper bound is necessary for the Garbage Collection feature\n * in the Runtime layer to reliably compute when an object will never be referenced again and can be deleted.\n */\n readonly maximumCacheDurationMs?: FiveDaysMs;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n repositoryUrl: string;\n\n /**\n * Policies implemented/instructed by driver.\n */\n readonly policies?: IDocumentStorageServicePolicies;\n\n /**\n * Returns the snapshot tree.\n * @param version - Version of the snapshot to be fetched.\n * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n * in debugging purposes to see why this call was made.\n */\n getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n /**\n * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n * @param versionId - Version id of the requested version.\n * @param count - Number of the versions to be fetched.\n * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n * in debugging purposes to see why this call was made.\n * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n * from storage.\n */\n getVersions(\n versionId: string | null,\n count: number,\n scenarioName?: string,\n fetchSource?: FetchSource,\n ): Promise<IVersion[]>;\n\n /**\n * Creates a blob out of the given buffer\n */\n createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n /**\n * Reads the object with the given ID, returns content in arrayBufferLike\n */\n readBlob(id: string): Promise<ArrayBufferLike>;\n\n /**\n * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n * referencing from the previously acked summary.\n * Returns the uploaded summary handle.\n */\n uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n /**\n * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n * server has deleted it this call may result in a broken promise.\n */\n downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n (event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n (event: \"disconnect\", listener: (reason: IAnyDriverError) => void);\n (event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n (event: \"signal\", listener: (message: ISignalMessage) => void);\n (event: \"pong\", listener: (latency: number) => void);\n (event: \"error\", listener: (error: any) => void);\n}\n\nexport interface IDocumentDeltaConnection extends IDisposable, IEventProvider<IDocumentDeltaConnectionEvents> {\n /**\n * ClientID for the connection\n */\n clientId: string;\n\n /**\n * Claims for the client\n */\n claims: ITokenClaims;\n\n /**\n * Mode of the client\n */\n mode: ConnectionMode;\n\n /**\n * Whether the connection was made to a new or existing document\n */\n existing: boolean;\n\n /**\n * Protocol version being used with the service\n */\n version: string;\n\n /**\n * Messages sent during the connection\n */\n initialMessages: ISequencedDocumentMessage[];\n\n /**\n * Signals sent during the connection\n */\n initialSignals: ISignalMessage[];\n\n /**\n * Prior clients already connected.\n */\n initialClients: ISignalClient[];\n\n /**\n * Configuration details provided by the service\n */\n serviceConfiguration: IClientConfiguration;\n\n /**\n * Last known sequence number to ordering service at the time of connection\n * It may lap actual last sequence number (quite a bit, if container is very active).\n * But it's best information for client to figure out how far it is behind, at least\n * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n * that is likely to be more up-to-date.\n */\n checkpointSequenceNumber?: number;\n\n /**\n * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n * it could contain info like build version, environment, region etc. These properties can be logged by client\n * to better understand server environment etc. and use it in case error occurs.\n * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n */\n relayServiceAgent?: string;\n\n /**\n * Submit a new message to the server\n */\n submit(messages: IDocumentMessage[]): void;\n\n /**\n * Submit a new signal to the server\n */\n submitSignal(message: any): void;\n}\n\nexport enum LoaderCachingPolicy {\n /**\n * The loader should not implement any prefetching or caching policy.\n */\n NoCaching,\n\n /**\n * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n */\n Prefetch,\n}\n\nexport interface IDocumentServicePolicies {\n /**\n * Do not connect to delta stream\n */\n readonly storageOnly?: boolean;\n}\n\nexport interface IDocumentService {\n\n resolvedUrl: IResolvedUrl;\n\n /**\n * Policies implemented/instructed by driver.\n */\n policies?: IDocumentServicePolicies;\n\n /**\n * Access to storage associated with the document...\n */\n connectToStorage(): Promise<IDocumentStorageService>;\n\n /**\n * Access to delta storage associated with the document\n */\n connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n /**\n * Subscribes to the document delta stream\n */\n connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n /**\n * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n * Useful for storage to commit any pending state if any (including any local caching).\n * Please note that it does not remove the need for caller to close all active delta connections,\n * as storage may not be tracking such objects.\n * @param error - tells if container (and storage) are closed due to critical error.\n * Error might be due to disconnect between client & server knowlege about file, like file being overwritten\n * in storage, but client having stale local cache.\n * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n */\n dispose(error?: any): void;\n}\n\nexport interface IDocumentServiceFactory {\n /**\n * Name of the protocol used by factory\n */\n protocolName: string;\n\n /**\n * Creates the document service after extracting different endpoints URLs from a resolved URL.\n *\n * @param resolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n * @param clientIsSummarizer - Whether or not the client is the\n * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n * `undefined` =\\> false\n *\n * @returns An instance of {@link IDocumentService}.\n */\n createDocumentService(\n resolvedUrl: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService>;\n\n /**\n * Creates a new document with the provided options. Returns the document service.\n *\n * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n * should be posted later, before connecting to ordering service.\n * @param createNewResolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n * @param clientIsSummarizer - Whether or not the client is the\n * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n * `undefined` =\\> false\n */\n createContainer(\n createNewSummary: ISummaryTree | undefined,\n createNewResolvedUrl: IResolvedUrl,\n logger?: ITelemetryBaseLogger,\n clientIsSummarizer?: boolean,\n ): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n */\nexport interface ISummaryContext {\n /**\n * Parent summary proposed handle (from summary op)\n */\n readonly proposalHandle: string | undefined;\n\n /**\n * Parent summary acked handle (from summary ack)\n */\n readonly ackHandle: string | undefined;\n\n readonly referenceSequenceNumber: number;\n}\n\nexport enum FetchSource {\n default = \"default\",\n noCache = \"noCache\",\n}\n"]}
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../src/storage.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6RH,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC9B;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,qEAAQ,CAAA;AACT,CAAC,EAVW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAU9B;AA2GD,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACpB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIDisposable,\n\tIEventProvider,\n\tIErrorEvent,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/common-definitions\";\nimport {\n\tConnectionMode,\n\tIClient,\n\tIClientConfiguration,\n\tICreateBlobResponse,\n\tIDocumentMessage,\n\tINack,\n\tISequencedDocumentMessage,\n\tISignalClient,\n\tISignalMessage,\n\tISnapshotTree,\n\tISummaryHandle,\n\tISummaryTree,\n\tITokenClaims,\n\tIVersion,\n} from \"@fluidframework/protocol-definitions\";\nimport { IAnyDriverError } from \"./driverError\";\nimport { IResolvedUrl } from \"./urlResolver\";\n\nexport interface IDeltasFetchResult {\n\t/**\n\t * Sequential set of messages starting from 'from' sequence number.\n\t * May be partial result, i.e. not fulfill original request in full.\n\t */\n\tmessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * If true, storage only partially fulfilled request, but has more ops\n\t * If false, the request was fulfilled. If less ops were returned then\n\t * requested, then storage does not have more ops in this range.\n\t */\n\tpartialResult: boolean;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the inclusive sequence number range\n\t * @param tenantId - Id of the tenant.\n\t * @param id - document id.\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n\t * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n\t * spo which could help in debugging sessions if any issue occurs.\n\t */\n\tget(\n\t\ttenantId: string,\n\t\tid: string,\n\t\tfrom: number, // inclusive\n\t\tto: number, // exclusive\n\t\tfetchReason?: string,\n\t): Promise<IDeltasFetchResult>;\n}\n\nexport type IStreamResult<T> = { done: true } | { done: false; value: T };\n\n/**\n * Read interface for the Queue\n */\nexport interface IStream<T> {\n\tread(): Promise<IStreamResult<T>>;\n}\n\n/**\n * Interface to provide access to stored deltas for a shared object\n */\nexport interface IDocumentDeltaStorageService {\n\t/**\n\t * Retrieves all the delta operations within the exclusive sequence number range\n\t * @param from - first op to retrieve (inclusive)\n\t * @param to - first op not to retrieve (exclusive end)\n\t * @param abortSignal - signal that aborts operation\n\t * @param cachedOnly - return only cached ops, i.e. ops available locally on client.\n\t * @param fetchReason - Reason for fetching the messages. Example, gap between seq number\n\t * of Op on wire and known seq number. It should not contain any PII. It can be logged by\n\t * spo which could help in debugging sessions if any issue occurs.\n\t */\n\tfetchMessages(\n\t\tfrom: number,\n\t\tto: number | undefined,\n\t\tabortSignal?: AbortSignal,\n\t\tcachedOnly?: boolean,\n\t\tfetchReason?: string,\n\t): IStream<ISequencedDocumentMessage[]>;\n}\n\n// DO NOT INCREASE THIS TYPE'S VALUE\n// If a driver started using a larger value,\n// internal assumptions of the Runtime's GC feature will be violated\n// DO NOT INCREASE THIS TYPE'S VALUE\nexport type FiveDaysMs = 432_000_000; /* 5 days in milliseconds */\n\n/**\n * Policies describing attributes or characteristics of the driver's storage service,\n * to direct how other components interact with the driver\n */\nexport interface IDocumentStorageServicePolicies {\n\t/**\n\t * Should the Loader implement any sort of pre-fetching or caching mechanism?\n\t */\n\treadonly caching?: LoaderCachingPolicy;\n\n\t/**\n\t * If this policy is provided, it tells runtime on ideal size for blobs.\n\t * Blobs that are smaller than that size should be aggregated into bigger blobs.\n\t */\n\treadonly minBlobSize?: number;\n\n\t/**\n\t * IMPORTANT: This policy MUST be set to 5 days and PROPERLY ENFORCED for drivers that are used\n\t * in applications where Garbage Collection is enabled. Otherwise data loss may occur.\n\t *\n\t * This policy pertains to requests for the latest snapshot from the service.\n\t * If set, it means that the driver guarantees not to use a cached value that was fetched more than 5 days ago.\n\t * If undefined, the driver makes no guarantees about the age of snapshots used for loading.\n\t */\n\treadonly maximumCacheDurationMs?: FiveDaysMs;\n}\n\n/**\n * Interface to provide access to snapshots saved for a shared object\n */\nexport interface IDocumentStorageService extends Partial<IDisposable> {\n\trepositoryUrl: string;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\treadonly policies?: IDocumentStorageServicePolicies;\n\n\t/**\n\t * Returns the snapshot tree.\n\t * @param version - Version of the snapshot to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t */\n\t// TODO: use `undefined` instead.\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tgetSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;\n\n\t/**\n\t * Retrieves all versions of the document starting at the specified versionId - or null if from the head\n\t * @param versionId - Version id of the requested version.\n\t * @param count - Number of the versions to be fetched.\n\t * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help\n\t * in debugging purposes to see why this call was made.\n\t * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache\n\t * requests and serve data from cache. That will result in stale info returned. Callers can disable this\n\t * functionality by passing fetchSource = noCache and ensuring that driver will return latest information\n\t * from storage.\n\t */\n\tgetVersions(\n\t\t// TODO: use `undefined` instead.\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tversionId: string | null,\n\t\tcount: number,\n\t\tscenarioName?: string,\n\t\tfetchSource?: FetchSource,\n\t): Promise<IVersion[]>;\n\n\t/**\n\t * Creates a blob out of the given buffer\n\t */\n\tcreateBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;\n\n\t/**\n\t * Reads the object with the given ID, returns content in arrayBufferLike\n\t */\n\treadBlob(id: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Uploads a summary tree to storage using the given context for reference of previous summary handle.\n\t * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are\n\t * referencing from the previously acked summary.\n\t * Returns the uploaded summary handle.\n\t */\n\tuploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;\n\n\t/**\n\t * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the\n\t * server has deleted it this call may result in a broken promise.\n\t */\n\tdownloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;\n}\n\nexport interface IDocumentDeltaConnectionEvents extends IErrorEvent {\n\t(event: \"nack\", listener: (documentId: string, message: INack[]) => void);\n\t(event: \"disconnect\", listener: (reason: IAnyDriverError) => void);\n\t(event: \"op\", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);\n\t(event: \"signal\", listener: (message: ISignalMessage) => void);\n\t(event: \"pong\", listener: (latency: number) => void);\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t(event: \"error\", listener: (error: any) => void);\n}\n\nexport interface IDocumentDeltaConnection\n\textends IDisposable,\n\t\tIEventProvider<IDocumentDeltaConnectionEvents> {\n\t/**\n\t * ClientID for the connection\n\t */\n\tclientId: string;\n\n\t/**\n\t * Claims for the client\n\t */\n\tclaims: ITokenClaims;\n\n\t/**\n\t * Mode of the client\n\t */\n\tmode: ConnectionMode;\n\n\t/**\n\t * Whether the connection was made to a new or existing document\n\t */\n\texisting: boolean;\n\n\t/**\n\t * Protocol version being used with the service\n\t */\n\tversion: string;\n\n\t/**\n\t * Messages sent during the connection\n\t */\n\tinitialMessages: ISequencedDocumentMessage[];\n\n\t/**\n\t * Signals sent during the connection\n\t */\n\tinitialSignals: ISignalMessage[];\n\n\t/**\n\t * Prior clients already connected.\n\t */\n\tinitialClients: ISignalClient[];\n\n\t/**\n\t * Configuration details provided by the service\n\t */\n\tserviceConfiguration: IClientConfiguration;\n\n\t/**\n\t * Last known sequence number to ordering service at the time of connection\n\t * It may lap actual last sequence number (quite a bit, if container is very active).\n\t * But it's best information for client to figure out how far it is behind, at least\n\t * for \"read\" connections. \"write\" connections may use own \"join\" op to similar information,\n\t * that is likely to be more up-to-date.\n\t */\n\tcheckpointSequenceNumber?: number;\n\n\t/**\n\t * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo\n\t * it could contain info like build version, environment, region etc. These properties can be logged by client\n\t * to better understand server environment etc. and use it in case error occurs.\n\t * Format: \"prop1:val1;prop2:val2;prop3:val3\"\n\t */\n\trelayServiceAgent?: string;\n\n\t/**\n\t * Submit a new message to the server\n\t */\n\tsubmit(messages: IDocumentMessage[]): void;\n\n\t/**\n\t * Submit a new signal to the server\n\t */\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tsubmitSignal(message: any): void;\n}\n\nexport enum LoaderCachingPolicy {\n\t/**\n\t * The loader should not implement any prefetching or caching policy.\n\t */\n\tNoCaching,\n\n\t/**\n\t * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.\n\t */\n\tPrefetch,\n}\n\nexport interface IDocumentServicePolicies {\n\t/**\n\t * Do not connect to delta stream\n\t */\n\treadonly storageOnly?: boolean;\n\n\t/**\n\t * Summarizer uploads the protocol tree too when summarizing.\n\t */\n\treadonly summarizeProtocolTree?: boolean;\n}\n\nexport interface IDocumentService {\n\tresolvedUrl: IResolvedUrl;\n\n\t/**\n\t * Policies implemented/instructed by driver.\n\t */\n\tpolicies?: IDocumentServicePolicies;\n\n\t/**\n\t * Access to storage associated with the document\n\t */\n\tconnectToStorage(): Promise<IDocumentStorageService>;\n\n\t/**\n\t * Access to delta storage associated with the document\n\t */\n\tconnectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;\n\n\t/**\n\t * Subscribes to the document delta stream\n\t */\n\tconnectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;\n\n\t/**\n\t * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).\n\t * Useful for storage to commit any pending state if any (including any local caching).\n\t * Please note that it does not remove the need for caller to close all active delta connections,\n\t * as storage may not be tracking such objects.\n\t * @param error - tells if container (and storage) are closed due to critical error.\n\t * Error might be due to disconnect between client & server knowledge about file, like file being overwritten\n\t * in storage, but client having stale local cache.\n\t * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.\n\t */\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tdispose(error?: any): void;\n}\n\nexport interface IDocumentServiceFactory {\n\t/**\n\t * Creates the document service after extracting different endpoints URLs from a resolved URL.\n\t *\n\t * @param resolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t *\n\t * @returns An instance of {@link IDocumentService}.\n\t */\n\tcreateDocumentService(\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n\n\t/**\n\t * Creates a new document with the provided options. Returns the document service.\n\t *\n\t * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary\n\t * should be posted later, before connecting to ordering service.\n\t * @param createNewResolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.\n\t * @param logger - Optional telemetry logger to which telemetry events will be forwarded.\n\t * @param clientIsSummarizer - Whether or not the client is the\n\t * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.\n\t * `undefined` =\\> false\n\t */\n\tcreateContainer(\n\t\tcreateNewSummary: ISummaryTree | undefined,\n\t\tcreateNewResolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService>;\n}\n\n/**\n * Context for uploading a summary to storage.\n * Indicates the previously acked summary.\n */\nexport interface ISummaryContext {\n\t/**\n\t * Parent summary proposed handle (from summary op)\n\t */\n\treadonly proposalHandle: string | undefined;\n\n\t/**\n\t * Parent summary acked handle (from summary ack)\n\t */\n\treadonly ackHandle: string | undefined;\n\n\treadonly referenceSequenceNumber: number;\n}\n\nexport enum FetchSource {\n\tdefault = \"default\",\n\tnoCache = \"noCache\",\n}\n"]}
@@ -4,9 +4,15 @@
4
4
  */
5
5
  import { IRequest } from "@fluidframework/core-interfaces";
6
6
  export declare type IResolvedUrl = IWebResolvedUrl | IFluidResolvedUrl;
7
+ /**
8
+ * @deprecated This interface is unused and will be removed in the next major release.
9
+ */
7
10
  export interface IResolvedUrlBase {
8
11
  type: string;
9
12
  }
13
+ /**
14
+ * @deprecated This interface is unused and will be removed in the next major release.
15
+ */
10
16
  export interface IWebResolvedUrl extends IResolvedUrlBase {
11
17
  type: "web";
12
18
  data: string;
@@ -46,9 +52,9 @@ export interface IUrlResolver {
46
52
  getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
47
53
  }
48
54
  /**
49
- * Information that can be returned by a lightweight, seperately exported driver function. Used to preanalyze a URL
50
- * for driver compatibility and preload information.
51
- */
55
+ * Information that can be returned by a lightweight, seperately exported driver function. Used to preanalyze a URL
56
+ * for driver compatibility and preload information.
57
+ */
52
58
  export interface DriverPreCheckInfo {
53
59
  /**
54
60
  * A code details hint that can potentially be used to prefetch container code prior to having a snapshot.
@@ -1 +1 @@
1
- {"version":3,"file":"urlResolver.d.ts","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,oBAAY,YAAY,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAgB,SAAQ,gBAAgB;IACrD,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACvD,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;KAAE,CAAC;IAC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ot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":";;;AA4EA;;GAEG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACpB,qDAAqD;IACrD,6DAA6C,CAAA;IAC7C,iDAAiD;IACjD,uCAAuB,CAAA;AAC3B,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest } from \"@fluidframework/core-interfaces\";\n\nexport type IResolvedUrl = IWebResolvedUrl | IFluidResolvedUrl;\n\nexport interface IResolvedUrlBase {\n type: string;\n}\n\nexport interface IWebResolvedUrl extends IResolvedUrlBase {\n type: \"web\";\n data: string;\n}\n\nexport interface IFluidResolvedUrl extends IResolvedUrlBase {\n type: \"fluid\";\n /**\n * The id of the container this resolved url is for.\n */\n id: string;\n url: string;\n tokens: { [name: string]: string; };\n endpoints: { [name: string]: string; };\n}\n\n/**\n * Container package info handed off to resolver.\n */\nexport interface IContainerPackageInfo {\n /**\n * Container package name.\n */\n name: string;\n}\n\nexport interface IUrlResolver {\n\n // Like DNS should be able to cache resolution requests. Then possibly just have a token provider go and do stuff?\n // the expiration of it could be relative to the lifetime of the token? Requests after need to refresh?\n // or do we split the token access from this?\n resolve(request: IRequest): Promise<IResolvedUrl | undefined>;\n\n /**\n * Creates a url for the created container with any data store path given in the relative url.\n * @param resolvedUrl - resolved url for the container.\n * @param relativeUrl - relative url containing data store path; '/' represents root path.\n * @param packageInfoSource - optional, represents container package information to be included in url.\n * @returns absolute url combining container url with dta store path and optional additional information.\n */\n getAbsoluteUrl(\n resolvedUrl: IResolvedUrl,\n relativeUrl: string,\n packageInfoSource?: IContainerPackageInfo,\n ): Promise<string>;\n}\n\n/**\n* Information that can be returned by a lightweight, seperately exported driver function. Used to preanalyze a URL\n* for driver compatibility and preload information.\n*/\nexport interface DriverPreCheckInfo {\n /**\n * A code details hint that can potentially be used to prefetch container code prior to having a snapshot.\n */\n codeDetailsHint?: string;\n\n /**\n * Domains that will be connected to on the critical boot path. Hosts can choose to preconnect to these for\n * improved performance.\n */\n criticalBootDomains?: string[];\n }\n\n/**\n * Additional key in the loader request header\n */\nexport enum DriverHeader {\n // Key to indicate whether the request for summarizer\n summarizingClient = \"fluid-client-summarizer\",\n // createNew information, specific to each driver\n createNew = \"createNew\",\n}\n\nexport interface IDriverHeader {\n [DriverHeader.summarizingClient]: boolean;\n [DriverHeader.createNew]: any;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface IRequestHeader extends Partial<IDriverHeader> { }\n}\n"]}
1
+ {"version":3,"file":"urlResolver.js","sourceRoot":"","sources":["../src/urlResolver.ts"],"names":[],"mappings":";;;AAiFA;;GAEG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACvB,qDAAqD;IACrD,6DAA6C,CAAA;IAC7C,iDAAiD;IACjD,uCAAuB,CAAA;AACxB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { IRequest } from \"@fluidframework/core-interfaces\";\n\nexport type IResolvedUrl = IWebResolvedUrl | IFluidResolvedUrl;\n\n/**\n * @deprecated This interface is unused and will be removed in the next major release.\n */\nexport interface IResolvedUrlBase {\n\ttype: string;\n}\n\n/**\n * @deprecated This interface is unused and will be removed in the next major release.\n */\nexport interface IWebResolvedUrl extends IResolvedUrlBase {\n\ttype: \"web\";\n\tdata: string;\n}\n\nexport interface IFluidResolvedUrl extends IResolvedUrlBase {\n\ttype: \"fluid\";\n\t/**\n\t * The id of the container this resolved url is for.\n\t */\n\tid: string;\n\turl: string;\n\ttokens: { [name: string]: string };\n\tendpoints: { [name: string]: string };\n}\n\n/**\n * Container package info handed off to resolver.\n */\nexport interface IContainerPackageInfo {\n\t/**\n\t * Container package name.\n\t */\n\tname: string;\n}\n\nexport interface IUrlResolver {\n\t// Like DNS should be able to cache resolution requests. Then possibly just have a token provider go and do stuff?\n\t// the expiration of it could be relative to the lifetime of the token? Requests after need to refresh?\n\t// or do we split the token access from this?\n\tresolve(request: IRequest): Promise<IResolvedUrl | undefined>;\n\n\t/**\n\t * Creates a url for the created container with any data store path given in the relative url.\n\t * @param resolvedUrl - resolved url for the container.\n\t * @param relativeUrl - relative url containing data store path; '/' represents root path.\n\t * @param packageInfoSource - optional, represents container package information to be included in url.\n\t * @returns absolute url combining container url with dta store path and optional additional information.\n\t */\n\tgetAbsoluteUrl(\n\t\tresolvedUrl: IResolvedUrl,\n\t\trelativeUrl: string,\n\t\tpackageInfoSource?: IContainerPackageInfo,\n\t): Promise<string>;\n}\n\n/**\n * Information that can be returned by a lightweight, seperately exported driver function. Used to preanalyze a URL\n * for driver compatibility and preload information.\n */\nexport interface DriverPreCheckInfo {\n\t/**\n\t * A code details hint that can potentially be used to prefetch container code prior to having a snapshot.\n\t */\n\tcodeDetailsHint?: string;\n\n\t/**\n\t * Domains that will be connected to on the critical boot path. Hosts can choose to preconnect to these for\n\t * improved performance.\n\t */\n\tcriticalBootDomains?: string[];\n}\n\n/**\n * Additional key in the loader request header\n */\nexport enum DriverHeader {\n\t// Key to indicate whether the request for summarizer\n\tsummarizingClient = \"fluid-client-summarizer\",\n\t// createNew information, specific to each driver\n\tcreateNew = \"createNew\",\n}\n\nexport interface IDriverHeader {\n\t[DriverHeader.summarizingClient]: boolean;\n\t// TODO: Use something other than `any`.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[DriverHeader.createNew]: any;\n}\n\ndeclare module \"@fluidframework/core-interfaces\" {\n\t// eslint-disable-next-line @typescript-eslint/no-empty-interface\n\texport interface IRequestHeader extends Partial<IDriverHeader> {}\n}\n"]}
@@ -46,6 +46,10 @@ export declare enum DriverErrorType {
46
46
  * CSP violation, etc.
47
47
  */
48
48
  fetchFailure = "fetchFailure",
49
+ /**
50
+ * This error occurs when token provider fails to fetch orderer token
51
+ */
52
+ fetchTokenError = "fetchTokenError",
49
53
  /**
50
54
  * Unexpected response from server. Either JSON is malformed, or some required properties are missing
51
55
  */
@@ -54,7 +58,7 @@ export declare enum DriverErrorType {
54
58
  * This error occurs when the file is modified externally (not through Fluid protocol) in storage.
55
59
  * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
56
60
  * and storage / driver / loader detects such mismatch.
57
- * When it's hit, client needs to forget all the knowlege about this file and start over.
61
+ * When it's hit, client needs to forget all the knowledge about this file and start over.
58
62
  */
59
63
  fileOverwrittenInStorage = "fileOverwrittenInStorage",
60
64
  /**
@@ -75,8 +79,12 @@ export declare enum DriverErrorType {
75
79
  /**
76
80
  * Error indicating an API is being used improperly resulting in an invalid operation.
77
81
  * ! Should match the value of ContainerErrorType.usageError
78
- */
79
- usageError = "usageError"
82
+ */
83
+ usageError = "usageError",
84
+ /**
85
+ * File is locked for read/write by storage, e.g. whole collection is locked and access denied.
86
+ */
87
+ fileIsLocked = "fileIsLocked"
80
88
  }
81
89
  /**
82
90
  * Interface describing errors and warnings raised by any driver code.
@@ -94,11 +102,17 @@ export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
94
102
  * Base interface for all errors and warnings
95
103
  */
96
104
  export interface IDriverErrorBase {
97
- /** Classification of what type of error this is, used programmatically by consumers to interpret the error */
105
+ /**
106
+ * Classification of what type of error this is, used programmatically by consumers to interpret the error
107
+ */
98
108
  readonly errorType: DriverErrorType;
99
- /** Free-form error message */
109
+ /**
110
+ * Free-form error message
111
+ */
100
112
  readonly message: string;
101
- /** True indicates the caller may retry the failed action. False indicates it's a fatal error */
113
+ /**
114
+ * True indicates the caller may retry the failed action. False indicates it's a fatal error
115
+ */
102
116
  canRetry: boolean;
103
117
  /**
104
118
  * Best guess as to network conditions (online/offline) when the error arose.
@@ -128,7 +142,7 @@ export interface ILocationRedirectionError extends IDriverErrorBase {
128
142
  * allows compiler to differentiate interfaces based on error type
129
143
  */
130
144
  export interface IDriverBasicError extends IDriverErrorBase {
131
- readonly errorType: DriverErrorType.genericError | DriverErrorType.fileNotFoundOrAccessDeniedError | DriverErrorType.offlineError | DriverErrorType.unsupportedClientProtocolVersion | DriverErrorType.writeError | DriverErrorType.fetchFailure | DriverErrorType.incorrectServerResponse | DriverErrorType.fileOverwrittenInStorage | DriverErrorType.fluidInvalidSchema | DriverErrorType.usageError;
145
+ readonly errorType: DriverErrorType.genericError | DriverErrorType.fileNotFoundOrAccessDeniedError | DriverErrorType.offlineError | DriverErrorType.unsupportedClientProtocolVersion | DriverErrorType.writeError | DriverErrorType.fetchFailure | DriverErrorType.fetchTokenError | DriverErrorType.incorrectServerResponse | DriverErrorType.fileOverwrittenInStorage | DriverErrorType.fluidInvalidSchema | DriverErrorType.usageError | DriverErrorType.fileIsLocked;
132
146
  readonly statusCode?: number;
133
147
  }
134
148
  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;;;OAG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YAAY,GAC5B,eAAe,CAAC,eAAe,GAC/B,eAAe,CAAC,uBAAuB,GACvC,eAAe,CAAC,wBAAwB,GACxC,eAAe,CAAC,kBAAkB,GAClC,eAAe,CAAC,UAAU,GAC1B,eAAe,CAAC,YAAY,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,oBAAY,WAAW,GACpB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,yBAAyB,GACzB,iBAAiB,CAAC"}
@@ -49,6 +49,10 @@ export var DriverErrorType;
49
49
  * CSP violation, etc.
50
50
  */
51
51
  DriverErrorType["fetchFailure"] = "fetchFailure";
52
+ /**
53
+ * This error occurs when token provider fails to fetch orderer token
54
+ */
55
+ DriverErrorType["fetchTokenError"] = "fetchTokenError";
52
56
  /**
53
57
  * Unexpected response from server. Either JSON is malformed, or some required properties are missing
54
58
  */
@@ -57,7 +61,7 @@ export var DriverErrorType;
57
61
  * This error occurs when the file is modified externally (not through Fluid protocol) in storage.
58
62
  * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
59
63
  * and storage / driver / loader detects such mismatch.
60
- * When it's hit, client needs to forget all the knowlege about this file and start over.
64
+ * When it's hit, client needs to forget all the knowledge about this file and start over.
61
65
  */
62
66
  DriverErrorType["fileOverwrittenInStorage"] = "fileOverwrittenInStorage";
63
67
  /**
@@ -78,7 +82,11 @@ export var DriverErrorType;
78
82
  /**
79
83
  * Error indicating an API is being used improperly resulting in an invalid operation.
80
84
  * ! Should match the value of ContainerErrorType.usageError
81
- */
85
+ */
82
86
  DriverErrorType["usageError"] = "usageError";
87
+ /**
88
+ * File is locked for read/write by storage, e.g. whole collection is locked and access denied.
89
+ */
90
+ DriverErrorType["fileIsLocked"] = "fileIsLocked";
83
91
  })(DriverErrorType || (DriverErrorType = {}));
84
92
  //# sourceMappingURL=driverError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"driverError.js","sourceRoot":"","sources":["../src/driverError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,CAAN,IAAY,eAsFX;AAtFD,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;IACzC;;;MAGE;IACF,4CAAyB,CAAA;AAC7B,CAAC,EAtFW,eAAe,KAAf,eAAe,QAsF1B","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 * 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/**\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 /** Classification of what type of error this is, used programmatically by consumers to interpret the error */\n readonly errorType: DriverErrorType;\n /** Free-form error message */\n readonly message: string;\n /** True indicates the caller may retry the failed action. False indicates it's a fatal error */\n canRetry: boolean;\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 readonly statusCode?: number;\n}\n\nexport type DriverError =\n | IThrottlingWarning\n | IGenericNetworkError\n | IAuthorizationError\n | ILocationRedirectionError\n | IDriverBasicError;\n"]}
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\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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,WAAW,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,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,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,YAAY,GACf,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,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,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,YAAY,GACZ,MAAM,eAAe,CAAC"}
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,EAEH,eAAe,GAQlB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,WAAW,EAeX,mBAAmB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAEH,YAAY,GAQf,MAAM,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n DriverError,\n DriverErrorType,\n IAnyDriverError,\n IAuthorizationError,\n IDriverErrorBase,\n IDriverBasicError,\n IGenericNetworkError,\n ILocationRedirectionError,\n IThrottlingWarning,\n} from \"./driverError\";\nexport {\n FetchSource,\n FiveDaysMs,\n IDeltasFetchResult,\n IDeltaStorageService,\n IDocumentDeltaConnection,\n IDocumentDeltaConnectionEvents,\n IDocumentDeltaStorageService,\n IDocumentService,\n IDocumentServiceFactory,\n IDocumentServicePolicies,\n IDocumentStorageService,\n IDocumentStorageServicePolicies,\n IStream,\n IStreamResult,\n ISummaryContext,\n LoaderCachingPolicy,\n} from \"./storage\";\nexport {\n DriverPreCheckInfo,\n DriverHeader,\n IContainerPackageInfo,\n IDriverHeader,\n IFluidResolvedUrl,\n IResolvedUrl,\n IResolvedUrlBase,\n IWebResolvedUrl,\n IUrlResolver,\n} from \"./urlResolver\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,eAAe,GAQf,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,WAAW,EAeX,mBAAmB,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAEN,YAAY,GAQZ,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\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\tIFluidResolvedUrl,\n\tIResolvedUrl,\n\tIResolvedUrlBase,\n\tIWebResolvedUrl,\n\tIUrlResolver,\n} from \"./urlResolver\";\n"]}