@fluidframework/driver-definitions 2.0.0-internal.8.0.0 → 2.0.0-rc.1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +0 -6
  3. package/api-extractor-esm.json +4 -0
  4. package/api-extractor-lint.json +1 -10
  5. package/api-extractor.json +1 -9
  6. package/api-report/driver-definitions.api.md +13 -13
  7. package/dist/driver-definitions-alpha.d.ts +151 -12
  8. package/dist/driver-definitions-beta.d.ts +215 -15
  9. package/dist/driver-definitions-public.d.ts +215 -15
  10. package/dist/driver-definitions-untrimmed.d.ts +13 -13
  11. package/dist/driverError.d.ts +11 -11
  12. package/dist/driverError.js +2 -2
  13. package/dist/driverError.js.map +1 -1
  14. package/dist/urlResolver.d.ts +2 -2
  15. package/dist/urlResolver.js +1 -1
  16. package/dist/urlResolver.js.map +1 -1
  17. package/lib/{driver-definitions-alpha.d.ts → driver-definitions-alpha.d.mts} +151 -12
  18. package/lib/driver-definitions-beta.d.mts +295 -0
  19. package/lib/driver-definitions-public.d.mts +295 -0
  20. package/lib/{driver-definitions-untrimmed.d.ts → driver-definitions-untrimmed.d.mts} +13 -13
  21. package/lib/{driverError.d.ts → driverError.d.mts} +13 -13
  22. package/lib/driverError.d.mts.map +1 -0
  23. package/lib/{driverError.js → driverError.mjs} +8 -11
  24. package/lib/driverError.mjs.map +1 -0
  25. package/lib/{index.d.ts → index.d.mts} +4 -4
  26. package/lib/index.d.mts.map +1 -0
  27. package/lib/index.mjs +8 -0
  28. package/lib/index.mjs.map +1 -0
  29. package/lib/{storage.d.ts → storage.d.mts} +3 -3
  30. package/lib/storage.d.mts.map +1 -0
  31. package/lib/{storage.js → storage.mjs} +5 -8
  32. package/lib/storage.mjs.map +1 -0
  33. package/lib/test/types/{maximumCacheDurationPolicy.spec.d.ts → maximumCacheDurationPolicy.spec.d.mts} +1 -1
  34. package/lib/test/types/maximumCacheDurationPolicy.spec.d.mts.map +1 -0
  35. package/lib/test/types/{maximumCacheDurationPolicy.spec.js → maximumCacheDurationPolicy.spec.mjs} +2 -3
  36. package/lib/test/types/maximumCacheDurationPolicy.spec.mjs.map +1 -0
  37. package/lib/test/types/{validateDriverDefinitionsPrevious.generated.d.ts → validateDriverDefinitionsPrevious.generated.d.mts} +1 -1
  38. package/lib/test/types/validateDriverDefinitionsPrevious.generated.d.mts.map +1 -0
  39. package/lib/test/types/{validateDriverDefinitionsPrevious.generated.js → validateDriverDefinitionsPrevious.generated.mjs} +2 -3
  40. package/lib/test/types/validateDriverDefinitionsPrevious.generated.mjs.map +1 -0
  41. package/lib/{urlResolver.d.ts → urlResolver.d.mts} +3 -7
  42. package/lib/urlResolver.d.mts.map +1 -0
  43. package/lib/{urlResolver.js → urlResolver.mjs} +4 -7
  44. package/lib/urlResolver.mjs.map +1 -0
  45. package/package.json +23 -10
  46. package/src/driverError.ts +11 -11
  47. package/src/urlResolver.ts +2 -2
  48. package/lib/driver-definitions-beta.d.ts +0 -95
  49. package/lib/driver-definitions-public.d.ts +0 -95
  50. package/lib/driverError.d.ts.map +0 -1
  51. package/lib/driverError.js.map +0 -1
  52. package/lib/index.d.ts.map +0 -1
  53. package/lib/index.js +0 -16
  54. package/lib/index.js.map +0 -1
  55. package/lib/storage.d.ts.map +0 -1
  56. package/lib/storage.js.map +0 -1
  57. package/lib/test/types/maximumCacheDurationPolicy.spec.d.ts.map +0 -1
  58. package/lib/test/types/maximumCacheDurationPolicy.spec.js.map +0 -1
  59. package/lib/test/types/validateDriverDefinitionsPrevious.generated.d.ts.map +0 -1
  60. package/lib/test/types/validateDriverDefinitionsPrevious.generated.js.map +0 -1
  61. package/lib/urlResolver.d.ts.map +0 -1
  62. package/lib/urlResolver.js.map +0 -1
  63. package/tsconfig.esnext.json +0 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @fluidframework/driver-definitions
2
2
 
3
+ ## 2.0.0-rc.1.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Updated server dependencies ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
8
+
9
+ The following Fluid server dependencies have been updated to the latest version, 3.0.0. [See the full changelog.](https://github.com/microsoft/FluidFramework/releases/tag/server_v3.0.0)
10
+
11
+ - @fluidframework/gitresources
12
+ - @fluidframework/server-kafka-orderer
13
+ - @fluidframework/server-lambdas
14
+ - @fluidframework/server-lambdas-driver
15
+ - @fluidframework/server-local-server
16
+ - @fluidframework/server-memory-orderer
17
+ - @fluidframework/protocol-base
18
+ - @fluidframework/server-routerlicious
19
+ - @fluidframework/server-routerlicious-base
20
+ - @fluidframework/server-services
21
+ - @fluidframework/server-services-client
22
+ - @fluidframework/server-services-core
23
+ - @fluidframework/server-services-ordering-kafkanode
24
+ - @fluidframework/server-services-ordering-rdkafka
25
+ - @fluidframework/server-services-ordering-zookeeper
26
+ - @fluidframework/server-services-shared
27
+ - @fluidframework/server-services-telemetry
28
+ - @fluidframework/server-services-utils
29
+ - @fluidframework/server-test-utils
30
+ - tinylicious
31
+
32
+ - Updated @fluidframework/protocol-definitions ([#19122](https://github.com/microsoft/FluidFramework/issues/19122)) [25366b4229](https://github.com/microsoft/FluidFramework/commits/25366b422918cb43685c5f328b50450749592902)
33
+
34
+ The @fluidframework/protocol-definitions dependency has been upgraded to v3.1.0. [See the full
35
+ changelog.](https://github.com/microsoft/FluidFramework/blob/main/common/lib/protocol-definitions/CHANGELOG.md#310)
36
+
3
37
  ## 2.0.0-internal.8.0.0
4
38
 
5
39
  Dependency updates only.
package/README.md CHANGED
@@ -13,12 +13,6 @@ When taking a dependency on a Fluid Framework library, we recommend using a `^`
13
13
  While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
14
14
  library consumers should always prefer `^`.
15
15
 
16
- Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
17
- you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
18
- Standard `^` and `~` ranges will not work as expected.
19
- See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
20
- package for more information including tools to convert between version schemes.
21
-
22
16
  <!-- prettier-ignore-end -->
23
17
 
24
18
  <!-- AUTO-GENERATED-CONTENT:END -->
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-base-esm.json"
4
+ }
@@ -1,13 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-lint.json",
4
- "messages": {
5
- "extractorMessageReporting": {
6
- // TODO: remove once base config has this enabled as an error
7
- "ae-incompatible-release-tags": {
8
- "logLevel": "error",
9
- "addToApiReportFile": false
10
- }
11
- }
12
- }
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.json"
13
4
  }
@@ -1,12 +1,4 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.json",
4
- "messages": {
5
- "extractorMessageReporting": {
6
- // TODO: Add missing documentation and remove this rule override
7
- "ae-undocumented": {
8
- "logLevel": "none"
9
- }
10
- }
11
- }
3
+ "extends": "../../../common/build/build-common/api-extractor-base.json"
12
4
  }
@@ -24,10 +24,10 @@ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
24
24
  import { ITokenClaims } from '@fluidframework/protocol-definitions';
25
25
  import { IVersion } from '@fluidframework/protocol-definitions';
26
26
 
27
- // @internal (undocumented)
27
+ // @alpha (undocumented)
28
28
  export type DriverError = IThrottlingWarning | IGenericNetworkError | IAuthorizationError | ILocationRedirectionError | IDriverBasicError;
29
29
 
30
- // @alpha @deprecated
30
+ // @public @deprecated
31
31
  export enum DriverErrorType {
32
32
  authorizationError = "authorizationError",
33
33
  deltaStreamConnectionForbidden = "deltaStreamConnectionForbidden",
@@ -50,7 +50,7 @@ export enum DriverErrorType {
50
50
  writeError = "writeError"
51
51
  }
52
52
 
53
- // @internal
53
+ // @public
54
54
  export const DriverErrorTypes: {
55
55
  readonly genericNetworkError: "genericNetworkError";
56
56
  readonly authorizationError: "authorizationError";
@@ -72,10 +72,10 @@ export const DriverErrorTypes: {
72
72
  readonly usageError: "usageError";
73
73
  };
74
74
 
75
- // @internal (undocumented)
75
+ // @public (undocumented)
76
76
  export type DriverErrorTypes = (typeof DriverErrorTypes)[keyof typeof DriverErrorTypes];
77
77
 
78
- // @internal
78
+ // @alpha
79
79
  export enum DriverHeader {
80
80
  // (undocumented)
81
81
  createNew = "createNew",
@@ -83,7 +83,7 @@ export enum DriverHeader {
83
83
  summarizingClient = "fluid-client-summarizer"
84
84
  }
85
85
 
86
- // @internal
86
+ // @alpha
87
87
  export interface DriverPreCheckInfo {
88
88
  codeDetailsHint?: string;
89
89
  criticalBootDomains?: string[];
@@ -100,13 +100,13 @@ export enum FetchSource {
100
100
  // @alpha (undocumented)
101
101
  export type FiveDaysMs = 432000000;
102
102
 
103
- // @alpha
103
+ // @public
104
104
  export interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
105
105
  // (undocumented)
106
106
  readonly errorType: string;
107
107
  }
108
108
 
109
- // @internal (undocumented)
109
+ // @alpha (undocumented)
110
110
  export interface IAuthorizationError extends IDriverErrorBase {
111
111
  // (undocumented)
112
112
  readonly claims?: string;
@@ -214,7 +214,7 @@ export interface IDocumentStorageServicePolicies {
214
214
  readonly maximumCacheDurationMs?: FiveDaysMs;
215
215
  }
216
216
 
217
- // @internal
217
+ // @alpha
218
218
  export interface IDriverBasicError extends IDriverErrorBase {
219
219
  // (undocumented)
220
220
  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 | DriverErrorType.outOfStorageError;
@@ -222,7 +222,7 @@ export interface IDriverBasicError extends IDriverErrorBase {
222
222
  readonly statusCode?: number;
223
223
  }
224
224
 
225
- // @alpha
225
+ // @public
226
226
  export interface IDriverErrorBase {
227
227
  canRetry: boolean;
228
228
  endpointReached?: boolean;
@@ -239,7 +239,7 @@ export interface IDriverHeader {
239
239
  [DriverHeader.createNew]: any;
240
240
  }
241
241
 
242
- // @internal (undocumented)
242
+ // @alpha (undocumented)
243
243
  export interface IGenericNetworkError extends IDriverErrorBase {
244
244
  // (undocumented)
245
245
  readonly errorType: DriverErrorType.genericNetworkError;
@@ -247,7 +247,7 @@ export interface IGenericNetworkError extends IDriverErrorBase {
247
247
  readonly statusCode?: number;
248
248
  }
249
249
 
250
- // @internal (undocumented)
250
+ // @alpha (undocumented)
251
251
  export interface ILocationRedirectionError extends IDriverErrorBase {
252
252
  // (undocumented)
253
253
  readonly errorType: DriverErrorType.locationRedirection;
@@ -294,7 +294,7 @@ export interface ISummaryContext {
294
294
  readonly referenceSequenceNumber: number;
295
295
  }
296
296
 
297
- // @internal (undocumented)
297
+ // @alpha (undocumented)
298
298
  export interface IThrottlingWarning extends IDriverErrorBase {
299
299
  // (undocumented)
300
300
  readonly errorType: DriverErrorType.throttlingError;
@@ -18,14 +18,17 @@ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
18
18
  import { ITokenClaims } from '@fluidframework/protocol-definitions';
19
19
  import { IVersion } from '@fluidframework/protocol-definitions';
20
20
 
21
- /* Excluded from this release type: DriverError */
21
+ /**
22
+ * @alpha
23
+ */
24
+ export declare type DriverError = IThrottlingWarning | IGenericNetworkError | IAuthorizationError | ILocationRedirectionError | IDriverBasicError;
22
25
 
23
26
  /**
24
27
  * Driver Error types
25
28
  * Lists types that are likely to be used by all drivers
26
29
  *
27
30
  * @deprecated Use {@link (DriverErrorTypes:type)} instead.
28
- * @alpha
31
+ * @public
29
32
  */
30
33
  export declare enum DriverErrorType {
31
34
  /**
@@ -111,11 +114,114 @@ export declare enum DriverErrorType {
111
114
  outOfStorageError = "outOfStorageError"
112
115
  }
113
116
 
114
- /* Excluded from this release type: DriverErrorTypes */
117
+ /**
118
+ * Different error types the Driver may report out to the Host.
119
+ * @public
120
+ */
121
+ export declare const DriverErrorTypes: {
122
+ /**
123
+ * Some non-categorized (below) networking error
124
+ * Include errors like fatal server error (usually 500).
125
+ */
126
+ readonly genericNetworkError: "genericNetworkError";
127
+ /**
128
+ * Access denied - user does not have enough privileges to open a file, or continue to operate on a file
129
+ */
130
+ readonly authorizationError: "authorizationError";
131
+ /**
132
+ * File not found, or file deleted during session
133
+ */
134
+ readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
135
+ /**
136
+ * We can not reach server due to computer being offline.
137
+ */
138
+ readonly offlineError: "offlineError";
139
+ readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
140
+ /**
141
+ * User does not have write permissions to a file, but is changing content of a file.
142
+ * That might be indication of some data store error - data stores should not generate ops in readonly mode.
143
+ */
144
+ readonly writeError: "writeError";
145
+ /**
146
+ * A generic fetch failure that indicates we were not able to get a response from the server.
147
+ * This may be due to the client being offline (though, if we are able to detect offline state it will be
148
+ * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
149
+ * CSP violation, etc.
150
+ */
151
+ readonly fetchFailure: "fetchFailure";
152
+ /**
153
+ * This error occurs when token provider fails to fetch orderer token
154
+ */
155
+ readonly fetchTokenError: "fetchTokenError";
156
+ /**
157
+ * Unexpected response from server. Either JSON is malformed, or some required properties are missing
158
+ */
159
+ readonly incorrectServerResponse: "incorrectServerResponse";
160
+ /**
161
+ * This error occurs when the file is modified externally (not through Fluid protocol) in storage.
162
+ * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
163
+ * and storage / driver / loader detects such mismatch.
164
+ * When it's hit, client needs to forget all the knowledge about this file and start over.
165
+ */
166
+ readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
167
+ /**
168
+ * The document is read-only and delta stream connection is forbidden.
169
+ */
170
+ readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
171
+ /**
172
+ * The location of file/container can change on server. So if the file location moves and we try to access the old
173
+ * location, then this error is thrown to let the client know about the new location info.
174
+ */
175
+ readonly locationRedirection: "locationRedirection";
176
+ /**
177
+ * When a file is not a Fluid file, but has Fluid extension such as ".note",
178
+ * server won't be able to open it and will return this error. The innerMostErrorCode will be
179
+ * "fluidInvalidSchema"
180
+ */
181
+ readonly fluidInvalidSchema: "fluidInvalidSchema";
182
+ /**
183
+ * File is locked for read/write by storage, e.g. whole collection is locked and access denied.
184
+ */
185
+ readonly fileIsLocked: "fileIsLocked";
186
+ /**
187
+ * Storage is out of space
188
+ */
189
+ readonly outOfStorageError: "outOfStorageError";
190
+ readonly genericError: "genericError";
191
+ readonly throttlingError: "throttlingError";
192
+ readonly usageError: "usageError";
193
+ };
194
+
195
+ /**
196
+ * @public
197
+ */
198
+ export declare type DriverErrorTypes = (typeof DriverErrorTypes)[keyof typeof DriverErrorTypes];
115
199
 
116
- /* Excluded from this release type: DriverHeader */
200
+ /**
201
+ * Additional key in the loader request header
202
+ * @alpha
203
+ */
204
+ export declare enum DriverHeader {
205
+ summarizingClient = "fluid-client-summarizer",
206
+ createNew = "createNew"
207
+ }
117
208
 
118
- /* Excluded from this release type: DriverPreCheckInfo */
209
+ /**
210
+ * Information that can be returned by a lightweight, seperately exported driver function. Used to preanalyze a URL
211
+ * for driver compatibility and preload information.
212
+ * @alpha
213
+ */
214
+ export declare interface DriverPreCheckInfo {
215
+ /**
216
+ * A code details hint that can potentially be used to prefetch container code prior to having a snapshot.
217
+ */
218
+ codeDetailsHint?: string;
219
+ /**
220
+ * Domains that will be connected to on the critical boot path. Hosts can choose to preconnect to these for
221
+ * improved performance.
222
+ */
223
+ criticalBootDomains?: string[];
224
+ }
119
225
 
120
226
  /**
121
227
  * @alpha
@@ -138,13 +244,20 @@ export declare type FiveDaysMs = 432000000;
138
244
  * "Any" in the interface name is a nod to the fact that errorType has lost its type constraint.
139
245
  * It will be either DriverErrorType or the specific driver's specialized error type enum,
140
246
  * but we can't reference a specific driver's error type enum in this code.
141
- * @alpha
247
+ * @public
142
248
  */
143
249
  export declare interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
144
250
  readonly errorType: string;
145
251
  }
146
252
 
147
- /* Excluded from this release type: IAuthorizationError */
253
+ /**
254
+ * @alpha
255
+ */
256
+ export declare interface IAuthorizationError extends IDriverErrorBase {
257
+ readonly errorType: DriverErrorType.authorizationError;
258
+ readonly claims?: string;
259
+ readonly tenantId?: string;
260
+ }
148
261
 
149
262
  /**
150
263
  * Container package info handed off to resolver.
@@ -406,11 +519,19 @@ export declare interface IDocumentStorageServicePolicies {
406
519
  readonly maximumCacheDurationMs?: FiveDaysMs;
407
520
  }
408
521
 
409
- /* Excluded from this release type: IDriverBasicError */
522
+ /**
523
+ * Having this uber interface without types that have their own interfaces
524
+ * allows compiler to differentiate interfaces based on error type
525
+ * @alpha
526
+ */
527
+ export declare interface IDriverBasicError extends IDriverErrorBase {
528
+ 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 | DriverErrorType.outOfStorageError;
529
+ readonly statusCode?: number;
530
+ }
410
531
 
411
532
  /**
412
533
  * Base interface for all errors and warnings
413
- * @alpha
534
+ * @public
414
535
  */
415
536
  export declare interface IDriverErrorBase {
416
537
  /**
@@ -440,9 +561,21 @@ export declare interface IDriverErrorBase {
440
561
 
441
562
  /* Excluded from this release type: IDriverHeader */
442
563
 
443
- /* Excluded from this release type: IGenericNetworkError */
564
+ /**
565
+ * @alpha
566
+ */
567
+ export declare interface IGenericNetworkError extends IDriverErrorBase {
568
+ readonly errorType: DriverErrorType.genericNetworkError;
569
+ readonly statusCode?: number;
570
+ }
444
571
 
445
- /* Excluded from this release type: ILocationRedirectionError */
572
+ /**
573
+ * @alpha
574
+ */
575
+ export declare interface ILocationRedirectionError extends IDriverErrorBase {
576
+ readonly errorType: DriverErrorType.locationRedirection;
577
+ readonly redirectUrl: IResolvedUrl;
578
+ }
446
579
 
447
580
  /**
448
581
  * @alpha
@@ -497,7 +630,13 @@ export declare interface ISummaryContext {
497
630
  readonly referenceSequenceNumber: number;
498
631
  }
499
632
 
500
- /* Excluded from this release type: IThrottlingWarning */
633
+ /**
634
+ * @alpha
635
+ */
636
+ export declare interface IThrottlingWarning extends IDriverErrorBase {
637
+ readonly errorType: DriverErrorType.throttlingError;
638
+ readonly retryAfterSeconds: number;
639
+ }
501
640
 
502
641
  /**
503
642
  * @alpha
@@ -20,9 +20,179 @@ import { IVersion } from '@fluidframework/protocol-definitions';
20
20
 
21
21
  /* Excluded from this release type: DriverError */
22
22
 
23
- /* Excluded from this release type: DriverErrorType */
24
-
25
- /* Excluded from this release type: DriverErrorTypes */
23
+ /**
24
+ * Driver Error types
25
+ * Lists types that are likely to be used by all drivers
26
+ *
27
+ * @deprecated Use {@link (DriverErrorTypes:type)} instead.
28
+ * @public
29
+ */
30
+ export declare enum DriverErrorType {
31
+ /**
32
+ * A fatal error with no specific interpretation covered by other DriverErrorType values
33
+ */
34
+ genericError = "genericError",
35
+ /**
36
+ * Some non-categorized (below) networking error
37
+ * Include errors like fatal server error (usually 500).
38
+ */
39
+ genericNetworkError = "genericNetworkError",
40
+ /**
41
+ * Access denied - user does not have enough privileges to open a file, or continue to operate on a file
42
+ */
43
+ authorizationError = "authorizationError",
44
+ /**
45
+ * File not found, or file deleted during session
46
+ */
47
+ fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
48
+ /**
49
+ * Throttling error from server. Server is busy and is asking not to reconnect for some time
50
+ */
51
+ throttlingError = "throttlingError",
52
+ /**
53
+ * We can not reach server due to computer being offline.
54
+ */
55
+ offlineError = "offlineError",
56
+ unsupportedClientProtocolVersion = "unsupportedClientProtocolVersion",
57
+ /**
58
+ * User does not have write permissions to a file, but is changing content of a file.
59
+ * That might be indication of some data store error - data stores should not generate ops in readonly mode.
60
+ */
61
+ writeError = "writeError",
62
+ /**
63
+ * A generic fetch failure that indicates we were not able to get a response from the server.
64
+ * This may be due to the client being offline (though, if we are able to detect offline state it will be
65
+ * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
66
+ * CSP violation, etc.
67
+ */
68
+ fetchFailure = "fetchFailure",
69
+ /**
70
+ * This error occurs when token provider fails to fetch orderer token
71
+ */
72
+ fetchTokenError = "fetchTokenError",
73
+ /**
74
+ * Unexpected response from server. Either JSON is malformed, or some required properties are missing
75
+ */
76
+ incorrectServerResponse = "incorrectServerResponse",
77
+ /**
78
+ * This error occurs when the file is modified externally (not through Fluid protocol) in storage.
79
+ * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
80
+ * and storage / driver / loader detects such mismatch.
81
+ * When it's hit, client needs to forget all the knowledge about this file and start over.
82
+ */
83
+ fileOverwrittenInStorage = "fileOverwrittenInStorage",
84
+ /**
85
+ * The document is read-only and delta stream connection is forbidden.
86
+ */
87
+ deltaStreamConnectionForbidden = "deltaStreamConnectionForbidden",
88
+ /**
89
+ * The location of file/container can change on server. So if the file location moves and we try to access the old
90
+ * location, then this error is thrown to let the client know about the new location info.
91
+ */
92
+ locationRedirection = "locationRedirection",
93
+ /**
94
+ * When a file is not a Fluid file, but has Fluid extension such as ".note",
95
+ * server won't be able to open it and will return this error. The innerMostErrorCode will be
96
+ * "fluidInvalidSchema"
97
+ */
98
+ fluidInvalidSchema = "fluidInvalidSchema",
99
+ /**
100
+ * Error indicating an API is being used improperly resulting in an invalid operation.
101
+ * ! Should match the value of ContainerErrorType.usageError
102
+ */
103
+ usageError = "usageError",
104
+ /**
105
+ * File is locked for read/write by storage, e.g. whole collection is locked and access denied.
106
+ */
107
+ fileIsLocked = "fileIsLocked",
108
+ /**
109
+ * Storage is out of space
110
+ */
111
+ outOfStorageError = "outOfStorageError"
112
+ }
113
+
114
+ /**
115
+ * Different error types the Driver may report out to the Host.
116
+ * @public
117
+ */
118
+ export declare const DriverErrorTypes: {
119
+ /**
120
+ * Some non-categorized (below) networking error
121
+ * Include errors like fatal server error (usually 500).
122
+ */
123
+ readonly genericNetworkError: "genericNetworkError";
124
+ /**
125
+ * Access denied - user does not have enough privileges to open a file, or continue to operate on a file
126
+ */
127
+ readonly authorizationError: "authorizationError";
128
+ /**
129
+ * File not found, or file deleted during session
130
+ */
131
+ readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
132
+ /**
133
+ * We can not reach server due to computer being offline.
134
+ */
135
+ readonly offlineError: "offlineError";
136
+ readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
137
+ /**
138
+ * User does not have write permissions to a file, but is changing content of a file.
139
+ * That might be indication of some data store error - data stores should not generate ops in readonly mode.
140
+ */
141
+ readonly writeError: "writeError";
142
+ /**
143
+ * A generic fetch failure that indicates we were not able to get a response from the server.
144
+ * This may be due to the client being offline (though, if we are able to detect offline state it will be
145
+ * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
146
+ * CSP violation, etc.
147
+ */
148
+ readonly fetchFailure: "fetchFailure";
149
+ /**
150
+ * This error occurs when token provider fails to fetch orderer token
151
+ */
152
+ readonly fetchTokenError: "fetchTokenError";
153
+ /**
154
+ * Unexpected response from server. Either JSON is malformed, or some required properties are missing
155
+ */
156
+ readonly incorrectServerResponse: "incorrectServerResponse";
157
+ /**
158
+ * This error occurs when the file is modified externally (not through Fluid protocol) in storage.
159
+ * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
160
+ * and storage / driver / loader detects such mismatch.
161
+ * When it's hit, client needs to forget all the knowledge about this file and start over.
162
+ */
163
+ readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
164
+ /**
165
+ * The document is read-only and delta stream connection is forbidden.
166
+ */
167
+ readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
168
+ /**
169
+ * The location of file/container can change on server. So if the file location moves and we try to access the old
170
+ * location, then this error is thrown to let the client know about the new location info.
171
+ */
172
+ readonly locationRedirection: "locationRedirection";
173
+ /**
174
+ * When a file is not a Fluid file, but has Fluid extension such as ".note",
175
+ * server won't be able to open it and will return this error. The innerMostErrorCode will be
176
+ * "fluidInvalidSchema"
177
+ */
178
+ readonly fluidInvalidSchema: "fluidInvalidSchema";
179
+ /**
180
+ * File is locked for read/write by storage, e.g. whole collection is locked and access denied.
181
+ */
182
+ readonly fileIsLocked: "fileIsLocked";
183
+ /**
184
+ * Storage is out of space
185
+ */
186
+ readonly outOfStorageError: "outOfStorageError";
187
+ readonly genericError: "genericError";
188
+ readonly throttlingError: "throttlingError";
189
+ readonly usageError: "usageError";
190
+ };
191
+
192
+ /**
193
+ * @public
194
+ */
195
+ export declare type DriverErrorTypes = (typeof DriverErrorTypes)[keyof typeof DriverErrorTypes];
26
196
 
27
197
  /* Excluded from this release type: DriverHeader */
28
198
 
@@ -32,7 +202,19 @@ import { IVersion } from '@fluidframework/protocol-definitions';
32
202
 
33
203
  /* Excluded from this release type: FiveDaysMs */
34
204
 
35
- /* Excluded from this release type: IAnyDriverError */
205
+ /**
206
+ * Interface describing errors and warnings raised by any driver code.
207
+ * Not expected to be implemented by a class or an object literal, but rather used in place of
208
+ * any or unknown in various function signatures that pass errors around.
209
+ *
210
+ * "Any" in the interface name is a nod to the fact that errorType has lost its type constraint.
211
+ * It will be either DriverErrorType or the specific driver's specialized error type enum,
212
+ * but we can't reference a specific driver's error type enum in this code.
213
+ * @public
214
+ */
215
+ export declare interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
216
+ readonly errorType: string;
217
+ }
36
218
 
37
219
  /* Excluded from this release type: IAuthorizationError */
38
220
 
@@ -42,8 +224,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
42
224
 
43
225
  /* Excluded from this release type: IDeltaStorageService */
44
226
 
45
- /* Excluded from this release type: IDisposable */
46
-
47
227
  /* Excluded from this release type: IDocumentDeltaConnection */
48
228
 
49
229
  /* Excluded from this release type: IDocumentDeltaConnectionEvents */
@@ -62,20 +242,42 @@ import { IVersion } from '@fluidframework/protocol-definitions';
62
242
 
63
243
  /* Excluded from this release type: IDriverBasicError */
64
244
 
65
- /* Excluded from this release type: IDriverErrorBase */
245
+ /**
246
+ * Base interface for all errors and warnings
247
+ * @public
248
+ */
249
+ export declare interface IDriverErrorBase {
250
+ /**
251
+ * Classification of what type of error this is, used programmatically by consumers to interpret the error.
252
+ *
253
+ * @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).
254
+ */
255
+ readonly errorType: DriverErrorType;
256
+ /**
257
+ * Free-form error message
258
+ */
259
+ readonly message: string;
260
+ /**
261
+ * True indicates the caller may retry the failed action. False indicates it's a fatal error
262
+ */
263
+ canRetry: boolean;
264
+ /**
265
+ * Best guess as to network conditions (online/offline) when the error arose.
266
+ * See OnlineStatus enum in driver-utils package for expected values.
267
+ */
268
+ online?: string;
269
+ /**
270
+ * Whether service was reachable and we got some response from service.
271
+ */
272
+ endpointReached?: boolean;
273
+ }
66
274
 
67
275
  /* Excluded from this release type: IDriverHeader */
68
276
 
69
- /* Excluded from this release type: IErrorEvent */
70
-
71
- /* Excluded from this release type: IEventProvider */
72
-
73
277
  /* Excluded from this release type: IGenericNetworkError */
74
278
 
75
279
  /* Excluded from this release type: ILocationRedirectionError */
76
280
 
77
- /* Excluded from this release type: IRequest */
78
-
79
281
  /* Excluded from this release type: IResolvedUrl */
80
282
 
81
283
  /* Excluded from this release type: IStream */
@@ -84,8 +286,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
84
286
 
85
287
  /* Excluded from this release type: ISummaryContext */
86
288
 
87
- /* Excluded from this release type: ITelemetryBaseLogger */
88
-
89
289
  /* Excluded from this release type: IThrottlingWarning */
90
290
 
91
291
  /* Excluded from this release type: IUrlResolver */