@fluidframework/driver-definitions 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-dev-rc.1.0.0.232845

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 (39) hide show
  1. package/api-report/driver-definitions.api.md +36 -30
  2. package/dist/driver-definitions-alpha.d.ts +77 -99
  3. package/dist/driver-definitions-beta.d.ts +11 -93
  4. package/dist/driver-definitions-public.d.ts +11 -93
  5. package/dist/driver-definitions-untrimmed.d.ts +77 -99
  6. package/dist/driverError.d.ts +9 -97
  7. package/dist/driverError.d.ts.map +1 -1
  8. package/dist/driverError.js +1 -95
  9. package/dist/driverError.js.map +1 -1
  10. package/dist/index.d.ts +2 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +1 -2
  13. package/dist/index.js.map +1 -1
  14. package/dist/storage.d.ts +65 -2
  15. package/dist/storage.d.ts.map +1 -1
  16. package/dist/storage.js.map +1 -1
  17. package/dist/tsdoc-metadata.json +1 -1
  18. package/lib/driver-definitions-alpha.d.mts +77 -99
  19. package/lib/driver-definitions-beta.d.mts +11 -93
  20. package/lib/driver-definitions-public.d.mts +11 -93
  21. package/lib/driver-definitions-untrimmed.d.mts +77 -99
  22. package/lib/driverError.d.mts +9 -97
  23. package/lib/driverError.d.mts.map +1 -1
  24. package/lib/driverError.mjs +0 -94
  25. package/lib/driverError.mjs.map +1 -1
  26. package/lib/index.d.mts +2 -2
  27. package/lib/index.d.mts.map +1 -1
  28. package/lib/index.mjs +1 -1
  29. package/lib/index.mjs.map +1 -1
  30. package/lib/storage.d.mts +65 -2
  31. package/lib/storage.d.mts.map +1 -1
  32. package/lib/storage.mjs.map +1 -1
  33. package/lib/test/types/validateDriverDefinitionsPrevious.generated.mjs +3 -3
  34. package/lib/test/types/validateDriverDefinitionsPrevious.generated.mjs.map +1 -1
  35. package/package.json +14 -6
  36. package/src/driverError.ts +21 -130
  37. package/src/index.ts +3 -1
  38. package/src/storage.ts +74 -1
  39. /package/{.eslintrc.js → .eslintrc.cjs} +0 -0
@@ -11,6 +11,7 @@ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
11
11
  import { IDisposable } from '@fluidframework/core-interfaces';
12
12
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
13
13
  import { IErrorEvent } from '@fluidframework/core-interfaces';
14
+ import { IEvent } from '@fluidframework/core-interfaces';
14
15
  import { IEventProvider } from '@fluidframework/core-interfaces';
15
16
  import { INack } from '@fluidframework/protocol-definitions';
16
17
  import { IRequest } from '@fluidframework/core-interfaces';
@@ -27,29 +28,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
27
28
  // @alpha (undocumented)
28
29
  export type DriverError = IThrottlingWarning | IGenericNetworkError | IAuthorizationError | ILocationRedirectionError | IDriverBasicError;
29
30
 
30
- // @public @deprecated
31
- export enum DriverErrorType {
32
- authorizationError = "authorizationError",
33
- deltaStreamConnectionForbidden = "deltaStreamConnectionForbidden",
34
- fetchFailure = "fetchFailure",
35
- fetchTokenError = "fetchTokenError",
36
- fileIsLocked = "fileIsLocked",
37
- fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
38
- fileOverwrittenInStorage = "fileOverwrittenInStorage",
39
- fluidInvalidSchema = "fluidInvalidSchema",
40
- genericError = "genericError",
41
- genericNetworkError = "genericNetworkError",
42
- incorrectServerResponse = "incorrectServerResponse",
43
- locationRedirection = "locationRedirection",
44
- offlineError = "offlineError",
45
- outOfStorageError = "outOfStorageError",
46
- throttlingError = "throttlingError",
47
- // (undocumented)
48
- unsupportedClientProtocolVersion = "unsupportedClientProtocolVersion",
49
- usageError = "usageError",
50
- writeError = "writeError"
51
- }
52
-
53
31
  // @public
54
32
  export const DriverErrorTypes: {
55
33
  readonly genericNetworkError: "genericNetworkError";
@@ -111,7 +89,7 @@ export interface IAuthorizationError extends IDriverErrorBase {
111
89
  // (undocumented)
112
90
  readonly claims?: string;
113
91
  // (undocumented)
114
- readonly errorType: DriverErrorType.authorizationError;
92
+ readonly errorType: typeof DriverErrorTypes.authorizationError;
115
93
  // (undocumented)
116
94
  readonly tenantId?: string;
117
95
  }
@@ -173,7 +151,7 @@ export interface IDocumentDeltaStorageService {
173
151
  }
174
152
 
175
153
  // @alpha (undocumented)
176
- export interface IDocumentService {
154
+ export interface IDocumentService extends IEventProvider<IDocumentServiceEvents> {
177
155
  connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
178
156
  connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
179
157
  connectToStorage(): Promise<IDocumentStorageService>;
@@ -183,6 +161,11 @@ export interface IDocumentService {
183
161
  resolvedUrl: IResolvedUrl;
184
162
  }
185
163
 
164
+ // @alpha
165
+ export interface IDocumentServiceEvents extends IEvent {
166
+ (event: "metadataUpdate", listener: (metadata: Record<string, string>) => void): any;
167
+ }
168
+
186
169
  // @alpha (undocumented)
187
170
  export interface IDocumentServiceFactory {
188
171
  createContainer(createNewSummary: ISummaryTree | undefined, createNewResolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
@@ -193,12 +176,14 @@ export interface IDocumentServiceFactory {
193
176
  export interface IDocumentServicePolicies {
194
177
  readonly storageOnly?: boolean;
195
178
  readonly summarizeProtocolTree?: boolean;
179
+ readonly supportGetSnapshotApi?: boolean;
196
180
  }
197
181
 
198
182
  // @alpha
199
183
  export interface IDocumentStorageService extends Partial<IDisposable> {
200
184
  createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
201
185
  downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
186
+ getSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
202
187
  getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
203
188
  getVersions(versionId: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<IVersion[]>;
204
189
  readonly policies?: IDocumentStorageServicePolicies;
@@ -217,7 +202,7 @@ export interface IDocumentStorageServicePolicies {
217
202
  // @alpha
218
203
  export interface IDriverBasicError extends IDriverErrorBase {
219
204
  // (undocumented)
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;
205
+ readonly errorType: typeof DriverErrorTypes.genericError | typeof DriverErrorTypes.fileNotFoundOrAccessDeniedError | typeof DriverErrorTypes.offlineError | typeof DriverErrorTypes.unsupportedClientProtocolVersion | typeof DriverErrorTypes.writeError | typeof DriverErrorTypes.fetchFailure | typeof DriverErrorTypes.fetchTokenError | typeof DriverErrorTypes.incorrectServerResponse | typeof DriverErrorTypes.fileOverwrittenInStorage | typeof DriverErrorTypes.fluidInvalidSchema | typeof DriverErrorTypes.usageError | typeof DriverErrorTypes.fileIsLocked | typeof DriverErrorTypes.outOfStorageError;
221
206
  // (undocumented)
222
207
  readonly statusCode?: number;
223
208
  }
@@ -226,7 +211,7 @@ export interface IDriverBasicError extends IDriverErrorBase {
226
211
  export interface IDriverErrorBase {
227
212
  canRetry: boolean;
228
213
  endpointReached?: boolean;
229
- readonly errorType: DriverErrorType;
214
+ readonly errorType: DriverErrorTypes;
230
215
  readonly message: string;
231
216
  online?: string;
232
217
  }
@@ -242,7 +227,7 @@ export interface IDriverHeader {
242
227
  // @alpha (undocumented)
243
228
  export interface IGenericNetworkError extends IDriverErrorBase {
244
229
  // (undocumented)
245
- readonly errorType: DriverErrorType.genericNetworkError;
230
+ readonly errorType: typeof DriverErrorTypes.genericNetworkError;
246
231
  // (undocumented)
247
232
  readonly statusCode?: number;
248
233
  }
@@ -250,7 +235,7 @@ export interface IGenericNetworkError extends IDriverErrorBase {
250
235
  // @alpha (undocumented)
251
236
  export interface ILocationRedirectionError extends IDriverErrorBase {
252
237
  // (undocumented)
253
- readonly errorType: DriverErrorType.locationRedirection;
238
+ readonly errorType: typeof DriverErrorTypes.locationRedirection;
254
239
  // (undocumented)
255
240
  readonly redirectUrl: IResolvedUrl;
256
241
  }
@@ -272,6 +257,27 @@ export interface IResolvedUrl {
272
257
  url: string;
273
258
  }
274
259
 
260
+ // @alpha (undocumented)
261
+ export interface ISnapshot {
262
+ // (undocumented)
263
+ blobContents: Map<string, ArrayBuffer>;
264
+ latestSequenceNumber: number | undefined;
265
+ // (undocumented)
266
+ ops: ISequencedDocumentMessage[];
267
+ sequenceNumber: number | undefined;
268
+ // (undocumented)
269
+ snapshotFormatV: 1;
270
+ // (undocumented)
271
+ snapshotTree: ISnapshotTree;
272
+ }
273
+
274
+ // @alpha
275
+ export interface ISnapshotFetchOptions {
276
+ cacheSnapshot?: boolean;
277
+ scenarioName?: string;
278
+ versionId?: string;
279
+ }
280
+
275
281
  // @alpha
276
282
  export interface IStream<T> {
277
283
  // (undocumented)
@@ -297,7 +303,7 @@ export interface ISummaryContext {
297
303
  // @alpha (undocumented)
298
304
  export interface IThrottlingWarning extends IDriverErrorBase {
299
305
  // (undocumented)
300
- readonly errorType: DriverErrorType.throttlingError;
306
+ readonly errorType: typeof DriverErrorTypes.throttlingError;
301
307
  // (undocumented)
302
308
  readonly retryAfterSeconds: number;
303
309
  }
@@ -5,6 +5,7 @@ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
5
  import { IDisposable } from '@fluidframework/core-interfaces';
6
6
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
7
7
  import { IErrorEvent } from '@fluidframework/core-interfaces';
8
+ import { IEvent } from '@fluidframework/core-interfaces';
8
9
  import { IEventProvider } from '@fluidframework/core-interfaces';
9
10
  import { INack } from '@fluidframework/protocol-definitions';
10
11
  import { IRequest } from '@fluidframework/core-interfaces';
@@ -23,97 +24,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
23
24
  */
24
25
  export declare type DriverError = IThrottlingWarning | IGenericNetworkError | IAuthorizationError | ILocationRedirectionError | IDriverBasicError;
25
26
 
26
- /**
27
- * Driver Error types
28
- * Lists types that are likely to be used by all drivers
29
- *
30
- * @deprecated Use {@link (DriverErrorTypes:type)} instead.
31
- * @public
32
- */
33
- export declare enum DriverErrorType {
34
- /**
35
- * A fatal error with no specific interpretation covered by other DriverErrorType values
36
- */
37
- genericError = "genericError",
38
- /**
39
- * Some non-categorized (below) networking error
40
- * Include errors like fatal server error (usually 500).
41
- */
42
- genericNetworkError = "genericNetworkError",
43
- /**
44
- * Access denied - user does not have enough privileges to open a file, or continue to operate on a file
45
- */
46
- authorizationError = "authorizationError",
47
- /**
48
- * File not found, or file deleted during session
49
- */
50
- fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
51
- /**
52
- * Throttling error from server. Server is busy and is asking not to reconnect for some time
53
- */
54
- throttlingError = "throttlingError",
55
- /**
56
- * We can not reach server due to computer being offline.
57
- */
58
- offlineError = "offlineError",
59
- unsupportedClientProtocolVersion = "unsupportedClientProtocolVersion",
60
- /**
61
- * User does not have write permissions to a file, but is changing content of a file.
62
- * That might be indication of some data store error - data stores should not generate ops in readonly mode.
63
- */
64
- writeError = "writeError",
65
- /**
66
- * A generic fetch failure that indicates we were not able to get a response from the server.
67
- * This may be due to the client being offline (though, if we are able to detect offline state it will be
68
- * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
69
- * CSP violation, etc.
70
- */
71
- fetchFailure = "fetchFailure",
72
- /**
73
- * This error occurs when token provider fails to fetch orderer token
74
- */
75
- fetchTokenError = "fetchTokenError",
76
- /**
77
- * Unexpected response from server. Either JSON is malformed, or some required properties are missing
78
- */
79
- incorrectServerResponse = "incorrectServerResponse",
80
- /**
81
- * This error occurs when the file is modified externally (not through Fluid protocol) in storage.
82
- * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
83
- * and storage / driver / loader detects such mismatch.
84
- * When it's hit, client needs to forget all the knowledge about this file and start over.
85
- */
86
- fileOverwrittenInStorage = "fileOverwrittenInStorage",
87
- /**
88
- * The document is read-only and delta stream connection is forbidden.
89
- */
90
- deltaStreamConnectionForbidden = "deltaStreamConnectionForbidden",
91
- /**
92
- * The location of file/container can change on server. So if the file location moves and we try to access the old
93
- * location, then this error is thrown to let the client know about the new location info.
94
- */
95
- locationRedirection = "locationRedirection",
96
- /**
97
- * When a file is not a Fluid file, but has Fluid extension such as ".note",
98
- * server won't be able to open it and will return this error. The innerMostErrorCode will be
99
- * "fluidInvalidSchema"
100
- */
101
- fluidInvalidSchema = "fluidInvalidSchema",
102
- /**
103
- * Error indicating an API is being used improperly resulting in an invalid operation.
104
- * ! Should match the value of ContainerErrorType.usageError
105
- */
106
- usageError = "usageError",
107
- /**
108
- * File is locked for read/write by storage, e.g. whole collection is locked and access denied.
109
- */
110
- fileIsLocked = "fileIsLocked",
111
- /**
112
- * Storage is out of space
113
- */
114
- outOfStorageError = "outOfStorageError"
115
- }
116
-
117
27
  /**
118
28
  * Different error types the Driver may report out to the Host.
119
29
  * @public
@@ -238,11 +148,13 @@ export declare type FiveDaysMs = 432000000;
238
148
 
239
149
  /**
240
150
  * Interface describing errors and warnings raised by any driver code.
151
+ *
152
+ * @remarks
241
153
  * Not expected to be implemented by a class or an object literal, but rather used in place of
242
154
  * any or unknown in various function signatures that pass errors around.
243
155
  *
244
156
  * "Any" in the interface name is a nod to the fact that errorType has lost its type constraint.
245
- * It will be either DriverErrorType or the specific driver's specialized error type enum,
157
+ * It will be either {@link @fluidframework/driver-definitions#(DriverErrorTypes:variable)} or the specific driver's specialized error type enum,
246
158
  * but we can't reference a specific driver's error type enum in this code.
247
159
  * @public
248
160
  */
@@ -254,7 +166,7 @@ export declare interface IAnyDriverError extends Omit<IDriverErrorBase, "errorTy
254
166
  * @alpha
255
167
  */
256
168
  export declare interface IAuthorizationError extends IDriverErrorBase {
257
- readonly errorType: DriverErrorType.authorizationError;
169
+ readonly errorType: typeof DriverErrorTypes.authorizationError;
258
170
  readonly claims?: string;
259
171
  readonly tenantId?: string;
260
172
  }
@@ -372,7 +284,7 @@ export declare interface IDocumentDeltaStorageService {
372
284
  /**
373
285
  * @alpha
374
286
  */
375
- export declare interface IDocumentService {
287
+ export declare interface IDocumentService extends IEventProvider<IDocumentServiceEvents> {
376
288
  resolvedUrl: IResolvedUrl;
377
289
  /**
378
290
  * Policies implemented/instructed by driver.
@@ -403,6 +315,18 @@ export declare interface IDocumentService {
403
315
  dispose(error?: any): void;
404
316
  }
405
317
 
318
+ /**
319
+ * Events emitted by {@link IDocumentService}.
320
+ * @alpha
321
+ */
322
+ export declare interface IDocumentServiceEvents extends IEvent {
323
+ /**
324
+ * This event is used to communicate any metadata related to the container. We might have received metadata from the service.
325
+ * Read more info on this event from here `IContainer.containerMetadata`.
326
+ */
327
+ (event: "metadataUpdate", listener: (metadata: Record<string, string>) => void): any;
328
+ }
329
+
406
330
  /**
407
331
  * @alpha
408
332
  */
@@ -445,6 +369,12 @@ export declare interface IDocumentServicePolicies {
445
369
  * Summarizer uploads the protocol tree too when summarizing.
446
370
  */
447
371
  readonly summarizeProtocolTree?: boolean;
372
+ /**
373
+ * Whether the driver supports the new getSnapshot api which returns snapshot which
374
+ * contains all contents along with the snapshot tree. Enable this by default when the
375
+ * driver can fully support the api.
376
+ */
377
+ readonly supportGetSnapshotApi?: boolean;
448
378
  }
449
379
 
450
380
  /**
@@ -464,6 +394,13 @@ export declare interface IDocumentStorageService extends Partial<IDisposable> {
464
394
  * in debugging purposes to see why this call was made.
465
395
  */
466
396
  getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
397
+ /**
398
+ * Returns the snapshot which can contain other artifacts too like blob contents, ops etc. It is different from
399
+ * `getSnapshotTree` api in that, that API only returns the snapshot tree from the snapshot.
400
+ * @param snapshotFetchOptions - Options specified by the caller to specify and want certain behavior from the
401
+ * driver when fetching the snapshot.
402
+ */
403
+ getSnapshot?(snapshotFetchOptions?: ISnapshotFetchOptions): Promise<ISnapshot>;
467
404
  /**
468
405
  * Retrieves all versions of the document starting at the specified versionId - or null if from the head
469
406
  * @param versionId - Version id of the requested version.
@@ -525,7 +462,7 @@ export declare interface IDocumentStorageServicePolicies {
525
462
  * @alpha
526
463
  */
527
464
  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;
465
+ readonly errorType: typeof DriverErrorTypes.genericError | typeof DriverErrorTypes.fileNotFoundOrAccessDeniedError | typeof DriverErrorTypes.offlineError | typeof DriverErrorTypes.unsupportedClientProtocolVersion | typeof DriverErrorTypes.writeError | typeof DriverErrorTypes.fetchFailure | typeof DriverErrorTypes.fetchTokenError | typeof DriverErrorTypes.incorrectServerResponse | typeof DriverErrorTypes.fileOverwrittenInStorage | typeof DriverErrorTypes.fluidInvalidSchema | typeof DriverErrorTypes.usageError | typeof DriverErrorTypes.fileIsLocked | typeof DriverErrorTypes.outOfStorageError;
529
466
  readonly statusCode?: number;
530
467
  }
531
468
 
@@ -539,7 +476,7 @@ export declare interface IDriverErrorBase {
539
476
  *
540
477
  * @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).
541
478
  */
542
- readonly errorType: DriverErrorType;
479
+ readonly errorType: DriverErrorTypes;
543
480
  /**
544
481
  * Free-form error message
545
482
  */
@@ -565,7 +502,7 @@ export declare interface IDriverErrorBase {
565
502
  * @alpha
566
503
  */
567
504
  export declare interface IGenericNetworkError extends IDriverErrorBase {
568
- readonly errorType: DriverErrorType.genericNetworkError;
505
+ readonly errorType: typeof DriverErrorTypes.genericNetworkError;
569
506
  readonly statusCode?: number;
570
507
  }
571
508
 
@@ -573,7 +510,7 @@ export declare interface IGenericNetworkError extends IDriverErrorBase {
573
510
  * @alpha
574
511
  */
575
512
  export declare interface ILocationRedirectionError extends IDriverErrorBase {
576
- readonly errorType: DriverErrorType.locationRedirection;
513
+ readonly errorType: typeof DriverErrorTypes.locationRedirection;
577
514
  readonly redirectUrl: IResolvedUrl;
578
515
  }
579
516
 
@@ -595,6 +532,47 @@ export declare interface IResolvedUrl {
595
532
  };
596
533
  }
597
534
 
535
+ /**
536
+ * @alpha
537
+ */
538
+ export declare interface ISnapshot {
539
+ snapshotTree: ISnapshotTree;
540
+ blobContents: Map<string, ArrayBuffer>;
541
+ ops: ISequencedDocumentMessage[];
542
+ /**
543
+ * Sequence number of the snapshot
544
+ */
545
+ sequenceNumber: number | undefined;
546
+ /**
547
+ * Sequence number for the latest op/snapshot for the file in ODSP
548
+ */
549
+ latestSequenceNumber: number | undefined;
550
+ snapshotFormatV: 1;
551
+ }
552
+
553
+ /**
554
+ * Snapshot fetch options which are used to communicate different things to the driver
555
+ * when fetching the snapshot.
556
+ * @alpha
557
+ */
558
+ export declare interface ISnapshotFetchOptions {
559
+ /**
560
+ * Indicates scenario in which the snapshot is fetched. It is a free form string mostly
561
+ * used for telemetry purposes.
562
+ */
563
+ scenarioName?: string;
564
+ /**
565
+ * Tell driver to cache the fetched snapshot. Driver is supposed to cache the fetched snapshot if this is
566
+ * set to true. If undefined, then it is upto the driver, to cache it or not.
567
+ */
568
+ cacheSnapshot?: boolean;
569
+ /**
570
+ * Version of the snapshot to be fetched. Certain storage services just keep 1 snapshot for the
571
+ * container, so specifying version is not necessary for storage services.
572
+ */
573
+ versionId?: string;
574
+ }
575
+
598
576
  /**
599
577
  * Read interface for the Queue
600
578
  * @alpha
@@ -634,7 +612,7 @@ export declare interface ISummaryContext {
634
612
  * @alpha
635
613
  */
636
614
  export declare interface IThrottlingWarning extends IDriverErrorBase {
637
- readonly errorType: DriverErrorType.throttlingError;
615
+ readonly errorType: typeof DriverErrorTypes.throttlingError;
638
616
  readonly retryAfterSeconds: number;
639
617
  }
640
618
 
@@ -5,6 +5,7 @@ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
5
  import { IDisposable } from '@fluidframework/core-interfaces';
6
6
  import { IDocumentMessage } from '@fluidframework/protocol-definitions';
7
7
  import { IErrorEvent } from '@fluidframework/core-interfaces';
8
+ import { IEvent } from '@fluidframework/core-interfaces';
8
9
  import { IEventProvider } from '@fluidframework/core-interfaces';
9
10
  import { INack } from '@fluidframework/protocol-definitions';
10
11
  import { IRequest } from '@fluidframework/core-interfaces';
@@ -20,97 +21,6 @@ import { IVersion } from '@fluidframework/protocol-definitions';
20
21
 
21
22
  /* Excluded from this release type: DriverError */
22
23
 
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
24
  /**
115
25
  * Different error types the Driver may report out to the Host.
116
26
  * @public
@@ -204,11 +114,13 @@ export declare type DriverErrorTypes = (typeof DriverErrorTypes)[keyof typeof Dr
204
114
 
205
115
  /**
206
116
  * Interface describing errors and warnings raised by any driver code.
117
+ *
118
+ * @remarks
207
119
  * Not expected to be implemented by a class or an object literal, but rather used in place of
208
120
  * any or unknown in various function signatures that pass errors around.
209
121
  *
210
122
  * "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,
123
+ * It will be either {@link @fluidframework/driver-definitions#(DriverErrorTypes:variable)} or the specific driver's specialized error type enum,
212
124
  * but we can't reference a specific driver's error type enum in this code.
213
125
  * @public
214
126
  */
@@ -232,6 +144,8 @@ export declare interface IAnyDriverError extends Omit<IDriverErrorBase, "errorTy
232
144
 
233
145
  /* Excluded from this release type: IDocumentService */
234
146
 
147
+ /* Excluded from this release type: IDocumentServiceEvents */
148
+
235
149
  /* Excluded from this release type: IDocumentServiceFactory */
236
150
 
237
151
  /* Excluded from this release type: IDocumentServicePolicies */
@@ -252,7 +166,7 @@ export declare interface IDriverErrorBase {
252
166
  *
253
167
  * @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).
254
168
  */
255
- readonly errorType: DriverErrorType;
169
+ readonly errorType: DriverErrorTypes;
256
170
  /**
257
171
  * Free-form error message
258
172
  */
@@ -280,6 +194,10 @@ export declare interface IDriverErrorBase {
280
194
 
281
195
  /* Excluded from this release type: IResolvedUrl */
282
196
 
197
+ /* Excluded from this release type: ISnapshot */
198
+
199
+ /* Excluded from this release type: ISnapshotFetchOptions */
200
+
283
201
  /* Excluded from this release type: IStream */
284
202
 
285
203
  /* Excluded from this release type: IStreamResult */