@fluidframework/driver-definitions 2.0.0-dev.7.3.0.210328 → 2.0.0-dev.7.3.0.211848

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.
@@ -8,5 +8,8 @@
8
8
  "logLevel": "none"
9
9
  }
10
10
  }
11
+ },
12
+ "dtsRollup": {
13
+ "enabled": true
11
14
  }
12
15
  }
@@ -0,0 +1,638 @@
1
+ import { ConnectionMode } from '@fluidframework/protocol-definitions';
2
+ import { IClient } from '@fluidframework/protocol-definitions';
3
+ import { IClientConfiguration } from '@fluidframework/protocol-definitions';
4
+ import { ICreateBlobResponse } from '@fluidframework/protocol-definitions';
5
+ import { IDisposable } from '@fluidframework/core-interfaces';
6
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
7
+ import { IErrorEvent } from '@fluidframework/core-interfaces';
8
+ import { IEventProvider } from '@fluidframework/core-interfaces';
9
+ import { INack } from '@fluidframework/protocol-definitions';
10
+ import { IRequest } from '@fluidframework/core-interfaces';
11
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
12
+ import { ISignalClient } from '@fluidframework/protocol-definitions';
13
+ import { ISignalMessage } from '@fluidframework/protocol-definitions';
14
+ import { ISnapshotTree } from '@fluidframework/protocol-definitions';
15
+ import { ISummaryHandle } from '@fluidframework/protocol-definitions';
16
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
17
+ import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
18
+ import { ITokenClaims } from '@fluidframework/protocol-definitions';
19
+ import { IVersion } from '@fluidframework/protocol-definitions';
20
+
21
+ export declare type DriverError = IThrottlingWarning | IGenericNetworkError | IAuthorizationError | ILocationRedirectionError | IDriverBasicError;
22
+
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
+ */
29
+ export declare enum DriverErrorType {
30
+ /**
31
+ * A fatal error with no specific interpretation covered by other DriverErrorType values
32
+ */
33
+ genericError = "genericError",
34
+ /**
35
+ * Some non-categorized (below) networking error
36
+ * Include errors like fatal server error (usually 500).
37
+ */
38
+ genericNetworkError = "genericNetworkError",
39
+ /**
40
+ * Access denied - user does not have enough privileges to open a file, or continue to operate on a file
41
+ */
42
+ authorizationError = "authorizationError",
43
+ /**
44
+ * File not found, or file deleted during session
45
+ */
46
+ fileNotFoundOrAccessDeniedError = "fileNotFoundOrAccessDeniedError",
47
+ /**
48
+ * Throttling error from server. Server is busy and is asking not to reconnect for some time
49
+ */
50
+ throttlingError = "throttlingError",
51
+ /**
52
+ * We can not reach server due to computer being offline.
53
+ */
54
+ offlineError = "offlineError",
55
+ unsupportedClientProtocolVersion = "unsupportedClientProtocolVersion",
56
+ /**
57
+ * User does not have write permissions to a file, but is changing content of a file.
58
+ * That might be indication of some data store error - data stores should not generate ops in readonly mode.
59
+ */
60
+ writeError = "writeError",
61
+ /**
62
+ * A generic fetch failure that indicates we were not able to get a response from the server.
63
+ * This may be due to the client being offline (though, if we are able to detect offline state it will be
64
+ * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
65
+ * CSP violation, etc.
66
+ */
67
+ fetchFailure = "fetchFailure",
68
+ /**
69
+ * This error occurs when token provider fails to fetch orderer token
70
+ */
71
+ fetchTokenError = "fetchTokenError",
72
+ /**
73
+ * Unexpected response from server. Either JSON is malformed, or some required properties are missing
74
+ */
75
+ incorrectServerResponse = "incorrectServerResponse",
76
+ /**
77
+ * This error occurs when the file is modified externally (not through Fluid protocol) in storage.
78
+ * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
79
+ * and storage / driver / loader detects such mismatch.
80
+ * When it's hit, client needs to forget all the knowledge about this file and start over.
81
+ */
82
+ fileOverwrittenInStorage = "fileOverwrittenInStorage",
83
+ /**
84
+ * The document is read-only and delta stream connection is forbidden.
85
+ */
86
+ deltaStreamConnectionForbidden = "deltaStreamConnectionForbidden",
87
+ /**
88
+ * The location of file/container can change on server. So if the file location moves and we try to access the old
89
+ * location, then this error is thrown to let the client know about the new location info.
90
+ */
91
+ locationRedirection = "locationRedirection",
92
+ /**
93
+ * When a file is not a Fluid file, but has Fluid extension such as ".note",
94
+ * server won't be able to open it and will return this error. The innerMostErrorCode will be
95
+ * "fluidInvalidSchema"
96
+ */
97
+ fluidInvalidSchema = "fluidInvalidSchema",
98
+ /**
99
+ * Error indicating an API is being used improperly resulting in an invalid operation.
100
+ * ! Should match the value of ContainerErrorType.usageError
101
+ */
102
+ usageError = "usageError",
103
+ /**
104
+ * File is locked for read/write by storage, e.g. whole collection is locked and access denied.
105
+ */
106
+ fileIsLocked = "fileIsLocked",
107
+ /**
108
+ * Storage is out of space
109
+ */
110
+ outOfStorageError = "outOfStorageError"
111
+ }
112
+
113
+ /**
114
+ * Different error types the Driver may report out to the Host.
115
+ */
116
+ export declare const DriverErrorTypes: {
117
+ /**
118
+ * Some non-categorized (below) networking error
119
+ * Include errors like fatal server error (usually 500).
120
+ */
121
+ readonly genericNetworkError: "genericNetworkError";
122
+ /**
123
+ * Access denied - user does not have enough privileges to open a file, or continue to operate on a file
124
+ */
125
+ readonly authorizationError: "authorizationError";
126
+ /**
127
+ * File not found, or file deleted during session
128
+ */
129
+ readonly fileNotFoundOrAccessDeniedError: "fileNotFoundOrAccessDeniedError";
130
+ /**
131
+ * We can not reach server due to computer being offline.
132
+ */
133
+ readonly offlineError: "offlineError";
134
+ readonly unsupportedClientProtocolVersion: "unsupportedClientProtocolVersion";
135
+ /**
136
+ * User does not have write permissions to a file, but is changing content of a file.
137
+ * That might be indication of some data store error - data stores should not generate ops in readonly mode.
138
+ */
139
+ readonly writeError: "writeError";
140
+ /**
141
+ * A generic fetch failure that indicates we were not able to get a response from the server.
142
+ * This may be due to the client being offline (though, if we are able to detect offline state it will be
143
+ * logged as an offlineError instead). Other possibilities could be DNS errors, malformed fetch request,
144
+ * CSP violation, etc.
145
+ */
146
+ readonly fetchFailure: "fetchFailure";
147
+ /**
148
+ * This error occurs when token provider fails to fetch orderer token
149
+ */
150
+ readonly fetchTokenError: "fetchTokenError";
151
+ /**
152
+ * Unexpected response from server. Either JSON is malformed, or some required properties are missing
153
+ */
154
+ readonly incorrectServerResponse: "incorrectServerResponse";
155
+ /**
156
+ * This error occurs when the file is modified externally (not through Fluid protocol) in storage.
157
+ * It will occur in cases where client has some state or cache that is based on old content (identity) of a file,
158
+ * and storage / driver / loader detects such mismatch.
159
+ * When it's hit, client needs to forget all the knowledge about this file and start over.
160
+ */
161
+ readonly fileOverwrittenInStorage: "fileOverwrittenInStorage";
162
+ /**
163
+ * The document is read-only and delta stream connection is forbidden.
164
+ */
165
+ readonly deltaStreamConnectionForbidden: "deltaStreamConnectionForbidden";
166
+ /**
167
+ * The location of file/container can change on server. So if the file location moves and we try to access the old
168
+ * location, then this error is thrown to let the client know about the new location info.
169
+ */
170
+ readonly locationRedirection: "locationRedirection";
171
+ /**
172
+ * When a file is not a Fluid file, but has Fluid extension such as ".note",
173
+ * server won't be able to open it and will return this error. The innerMostErrorCode will be
174
+ * "fluidInvalidSchema"
175
+ */
176
+ readonly fluidInvalidSchema: "fluidInvalidSchema";
177
+ /**
178
+ * File is locked for read/write by storage, e.g. whole collection is locked and access denied.
179
+ */
180
+ readonly fileIsLocked: "fileIsLocked";
181
+ /**
182
+ * Storage is out of space
183
+ */
184
+ readonly outOfStorageError: "outOfStorageError";
185
+ readonly genericError: "genericError";
186
+ readonly throttlingError: "throttlingError";
187
+ readonly usageError: "usageError";
188
+ };
189
+
190
+ export declare type DriverErrorTypes = (typeof DriverErrorTypes)[keyof typeof DriverErrorTypes];
191
+
192
+ /**
193
+ * Additional key in the loader request header
194
+ */
195
+ export declare enum DriverHeader {
196
+ summarizingClient = "fluid-client-summarizer",
197
+ createNew = "createNew"
198
+ }
199
+
200
+ /**
201
+ * Information that can be returned by a lightweight, seperately exported driver function. Used to preanalyze a URL
202
+ * for driver compatibility and preload information.
203
+ */
204
+ export declare interface DriverPreCheckInfo {
205
+ /**
206
+ * A code details hint that can potentially be used to prefetch container code prior to having a snapshot.
207
+ */
208
+ codeDetailsHint?: string;
209
+ /**
210
+ * Domains that will be connected to on the critical boot path. Hosts can choose to preconnect to these for
211
+ * improved performance.
212
+ */
213
+ criticalBootDomains?: string[];
214
+ }
215
+
216
+ export declare enum FetchSource {
217
+ default = "default",
218
+ noCache = "noCache"
219
+ }
220
+
221
+ export declare type FiveDaysMs = 432000000;
222
+
223
+ /**
224
+ * Interface describing errors and warnings raised by any driver code.
225
+ * Not expected to be implemented by a class or an object literal, but rather used in place of
226
+ * any or unknown in various function signatures that pass errors around.
227
+ *
228
+ * "Any" in the interface name is a nod to the fact that errorType has lost its type constraint.
229
+ * It will be either DriverErrorType or the specific driver's specialized error type enum,
230
+ * but we can't reference a specific driver's error type enum in this code.
231
+ */
232
+ export declare interface IAnyDriverError extends Omit<IDriverErrorBase, "errorType"> {
233
+ readonly errorType: string;
234
+ }
235
+
236
+ export declare interface IAuthorizationError extends IDriverErrorBase {
237
+ readonly errorType: DriverErrorType.authorizationError;
238
+ readonly claims?: string;
239
+ readonly tenantId?: string;
240
+ }
241
+
242
+ /**
243
+ * Container package info handed off to resolver.
244
+ */
245
+ export declare interface IContainerPackageInfo {
246
+ /**
247
+ * Container package name.
248
+ */
249
+ name: string;
250
+ }
251
+
252
+ export declare interface IDeltasFetchResult {
253
+ /**
254
+ * Sequential set of messages starting from 'from' sequence number.
255
+ * May be partial result, i.e. not fulfill original request in full.
256
+ */
257
+ messages: ISequencedDocumentMessage[];
258
+ /**
259
+ * If true, storage only partially fulfilled request, but has more ops
260
+ * If false, the request was fulfilled. If less ops were returned then
261
+ * requested, then storage does not have more ops in this range.
262
+ */
263
+ partialResult: boolean;
264
+ }
265
+
266
+ /**
267
+ * Interface to provide access to stored deltas for a shared object
268
+ */
269
+ export declare interface IDeltaStorageService {
270
+ /**
271
+ * Retrieves all the delta operations within the inclusive sequence number range
272
+ * @param tenantId - Id of the tenant.
273
+ * @param id - document id.
274
+ * @param from - first op to retrieve (inclusive)
275
+ * @param to - first op not to retrieve (exclusive end)
276
+ * @param fetchReason - Reason for fetching the messages, for logging.
277
+ * Example, gap between seq number of Op on wire and known seq number.
278
+ * It can be logged by spo which could help in debugging sessions if any issue occurs.
279
+ */
280
+ get(tenantId: string, id: string, from: number, // inclusive
281
+ to: number, // exclusive
282
+ fetchReason?: string): Promise<IDeltasFetchResult>;
283
+ }
284
+
285
+ export declare interface IDocumentDeltaConnection extends IDisposable, IEventProvider<IDocumentDeltaConnectionEvents> {
286
+ /**
287
+ * ClientID for the connection
288
+ */
289
+ clientId: string;
290
+ /**
291
+ * Claims for the client
292
+ */
293
+ claims: ITokenClaims;
294
+ /**
295
+ * Mode of the client
296
+ */
297
+ mode: ConnectionMode;
298
+ /**
299
+ * Whether the connection was made to a new or existing document
300
+ */
301
+ existing: boolean;
302
+ /**
303
+ * Protocol version being used with the service
304
+ */
305
+ version: string;
306
+ /**
307
+ * Messages sent during the connection
308
+ */
309
+ initialMessages: ISequencedDocumentMessage[];
310
+ /**
311
+ * Signals sent during the connection
312
+ */
313
+ initialSignals: ISignalMessage[];
314
+ /**
315
+ * Prior clients already connected.
316
+ */
317
+ initialClients: ISignalClient[];
318
+ /**
319
+ * Configuration details provided by the service
320
+ */
321
+ serviceConfiguration: IClientConfiguration;
322
+ /**
323
+ * Last known sequence number to ordering service at the time of connection
324
+ * It may lap actual last sequence number (quite a bit, if container is very active).
325
+ * But it's best information for client to figure out how far it is behind, at least
326
+ * for "read" connections. "write" connections may use own "join" op to similar information,
327
+ * that is likely to be more up-to-date.
328
+ */
329
+ checkpointSequenceNumber?: number;
330
+ /**
331
+ * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo
332
+ * it could contain info like build version, environment, region etc. These properties can be logged by client
333
+ * to better understand server environment etc. and use it in case error occurs.
334
+ * Format: "prop1:val1;prop2:val2;prop3:val3"
335
+ */
336
+ relayServiceAgent?: string;
337
+ /**
338
+ * Submit a new message to the server
339
+ */
340
+ submit(messages: IDocumentMessage[]): void;
341
+ /**
342
+ * Submits a new signal to the server
343
+ */
344
+ submitSignal(content: any, targetClientId?: string): void;
345
+ }
346
+
347
+ export declare interface IDocumentDeltaConnectionEvents extends IErrorEvent {
348
+ (event: "nack", listener: (documentId: string, message: INack[]) => void): any;
349
+ (event: "disconnect", listener: (reason: IAnyDriverError) => void): any;
350
+ (event: "op", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void): any;
351
+ (event: "signal", listener: (message: ISignalMessage | ISignalMessage[]) => void): any;
352
+ (event: "pong", listener: (latency: number) => void): any;
353
+ (event: "error", listener: (error: any) => void): any;
354
+ }
355
+
356
+ /**
357
+ * Interface to provide access to stored deltas for a shared object
358
+ */
359
+ export declare interface IDocumentDeltaStorageService {
360
+ /**
361
+ * Retrieves all the delta operations within the exclusive sequence number range
362
+ * @param from - first op to retrieve (inclusive)
363
+ * @param to - first op not to retrieve (exclusive end)
364
+ * @param abortSignal - signal that aborts operation
365
+ * @param cachedOnly - return only cached ops, i.e. ops available locally on client.
366
+ * @param fetchReason - Reason for fetching the messages, for logging.
367
+ * Example, gap between seq number of Op on wire and known seq number.
368
+ * It can be logged by spo which could help in debugging sessions if any issue occurs.
369
+ */
370
+ fetchMessages(from: number, to: number | undefined, abortSignal?: AbortSignal, cachedOnly?: boolean, fetchReason?: string): IStream<ISequencedDocumentMessage[]>;
371
+ }
372
+
373
+ export declare interface IDocumentService {
374
+ resolvedUrl: IResolvedUrl;
375
+ /**
376
+ * Policies implemented/instructed by driver.
377
+ */
378
+ policies?: IDocumentServicePolicies;
379
+ /**
380
+ * Access to storage associated with the document
381
+ */
382
+ connectToStorage(): Promise<IDocumentStorageService>;
383
+ /**
384
+ * Access to delta storage associated with the document
385
+ */
386
+ connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
387
+ /**
388
+ * Subscribes to the document delta stream
389
+ */
390
+ connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
391
+ /**
392
+ * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).
393
+ * Useful for storage to commit any pending state if any (including any local caching).
394
+ * Please note that it does not remove the need for caller to close all active delta connections,
395
+ * as storage may not be tracking such objects.
396
+ * @param error - tells if container (and storage) are closed due to critical error.
397
+ * Error might be due to disconnect between client & server knowledge about file, like file being overwritten
398
+ * in storage, but client having stale local cache.
399
+ * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.
400
+ */
401
+ dispose(error?: any): void;
402
+ }
403
+
404
+ export declare interface IDocumentServiceFactory {
405
+ /**
406
+ * Creates the document service after extracting different endpoints URLs from a resolved URL.
407
+ *
408
+ * @param resolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.
409
+ * @param logger - Optional telemetry logger to which telemetry events will be forwarded.
410
+ * @param clientIsSummarizer - Whether or not the client is the
411
+ * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
412
+ * `undefined` =\> false
413
+ *
414
+ * @returns An instance of {@link IDocumentService}.
415
+ */
416
+ createDocumentService(resolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
417
+ /**
418
+ * Creates a new document with the provided options. Returns the document service.
419
+ *
420
+ * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary
421
+ * should be posted later, before connecting to ordering service.
422
+ * @param createNewResolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.
423
+ * @param logger - Optional telemetry logger to which telemetry events will be forwarded.
424
+ * @param clientIsSummarizer - Whether or not the client is the
425
+ * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
426
+ * `undefined` =\> false
427
+ */
428
+ createContainer(createNewSummary: ISummaryTree | undefined, createNewResolvedUrl: IResolvedUrl, logger?: ITelemetryBaseLogger, clientIsSummarizer?: boolean): Promise<IDocumentService>;
429
+ }
430
+
431
+ export declare interface IDocumentServicePolicies {
432
+ /**
433
+ * Do not connect to delta stream
434
+ */
435
+ readonly storageOnly?: boolean;
436
+ /**
437
+ * Summarizer uploads the protocol tree too when summarizing.
438
+ */
439
+ readonly summarizeProtocolTree?: boolean;
440
+ }
441
+
442
+ /**
443
+ * Interface to provide access to snapshots saved for a shared object
444
+ */
445
+ export declare interface IDocumentStorageService extends Partial<IDisposable> {
446
+ repositoryUrl: string;
447
+ /**
448
+ * Policies implemented/instructed by driver.
449
+ */
450
+ readonly policies?: IDocumentStorageServicePolicies;
451
+ /**
452
+ * Returns the snapshot tree.
453
+ * @param version - Version of the snapshot to be fetched.
454
+ * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help
455
+ * in debugging purposes to see why this call was made.
456
+ */
457
+ getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
458
+ /**
459
+ * Retrieves all versions of the document starting at the specified versionId - or null if from the head
460
+ * @param versionId - Version id of the requested version.
461
+ * @param count - Number of the versions to be fetched.
462
+ * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help
463
+ * in debugging purposes to see why this call was made.
464
+ * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache
465
+ * requests and serve data from cache. That will result in stale info returned. Callers can disable this
466
+ * functionality by passing fetchSource = noCache and ensuring that driver will return latest information
467
+ * from storage.
468
+ */
469
+ getVersions(versionId: string | null, count: number, scenarioName?: string, fetchSource?: FetchSource): Promise<IVersion[]>;
470
+ /**
471
+ * Creates a blob out of the given buffer
472
+ */
473
+ createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
474
+ /**
475
+ * Reads the object with the given ID, returns content in arrayBufferLike
476
+ */
477
+ readBlob(id: string): Promise<ArrayBufferLike>;
478
+ /**
479
+ * Uploads a summary tree to storage using the given context for reference of previous summary handle.
480
+ * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are
481
+ * referencing from the previously acked summary.
482
+ * Returns the uploaded summary handle.
483
+ */
484
+ uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
485
+ /**
486
+ * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the
487
+ * server has deleted it this call may result in a broken promise.
488
+ */
489
+ downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
490
+ }
491
+
492
+ /**
493
+ * Policies describing attributes or characteristics of the driver's storage service,
494
+ * to direct how other components interact with the driver
495
+ */
496
+ export declare interface IDocumentStorageServicePolicies {
497
+ /**
498
+ * Should the Loader implement any sort of pre-fetching or caching mechanism?
499
+ */
500
+ readonly caching?: LoaderCachingPolicy;
501
+ /**
502
+ * IMPORTANT: This policy MUST be set to 5 days and PROPERLY ENFORCED for drivers that are used
503
+ * in applications where Garbage Collection is enabled. Otherwise data loss may occur.
504
+ *
505
+ * This policy pertains to requests for the latest snapshot from the service.
506
+ * If set, it means that the driver guarantees not to use a cached value that was fetched more than 5 days ago.
507
+ * If undefined, the driver makes no guarantees about the age of snapshots used for loading.
508
+ */
509
+ readonly maximumCacheDurationMs?: FiveDaysMs;
510
+ }
511
+
512
+ /**
513
+ * Having this uber interface without types that have their own interfaces
514
+ * allows compiler to differentiate interfaces based on error type
515
+ */
516
+ export declare interface IDriverBasicError extends IDriverErrorBase {
517
+ 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;
518
+ readonly statusCode?: number;
519
+ }
520
+
521
+ /**
522
+ * Base interface for all errors and warnings
523
+ */
524
+ export declare interface IDriverErrorBase {
525
+ /**
526
+ * Classification of what type of error this is, used programmatically by consumers to interpret the error.
527
+ *
528
+ * @privateRemarks TODO: use {@link DriverErrorTypes} instead (breaking change).
529
+ */
530
+ readonly errorType: DriverErrorType;
531
+ /**
532
+ * Free-form error message
533
+ */
534
+ readonly message: string;
535
+ /**
536
+ * True indicates the caller may retry the failed action. False indicates it's a fatal error
537
+ */
538
+ canRetry: boolean;
539
+ /**
540
+ * Best guess as to network conditions (online/offline) when the error arose.
541
+ * See OnlineStatus enum in driver-utils package for expected values.
542
+ */
543
+ online?: string;
544
+ /**
545
+ * Whether service was reachable and we got some response from service.
546
+ */
547
+ endpointReached?: boolean;
548
+ }
549
+
550
+ export declare interface IDriverHeader {
551
+ [DriverHeader.summarizingClient]: boolean;
552
+ [DriverHeader.createNew]: any;
553
+ }
554
+
555
+ export declare interface IGenericNetworkError extends IDriverErrorBase {
556
+ readonly errorType: DriverErrorType.genericNetworkError;
557
+ readonly statusCode?: number;
558
+ }
559
+
560
+ export declare interface ILocationRedirectionError extends IDriverErrorBase {
561
+ readonly errorType: DriverErrorType.locationRedirection;
562
+ readonly redirectUrl: IResolvedUrl;
563
+ }
564
+
565
+ export declare interface IResolvedUrl {
566
+ type: "fluid";
567
+ /**
568
+ * The id of the container this resolved url is for.
569
+ */
570
+ id: string;
571
+ url: string;
572
+ tokens: {
573
+ [name: string]: string;
574
+ };
575
+ endpoints: {
576
+ [name: string]: string;
577
+ };
578
+ }
579
+
580
+ /**
581
+ * Read interface for the Queue
582
+ */
583
+ export declare interface IStream<T> {
584
+ read(): Promise<IStreamResult<T>>;
585
+ }
586
+
587
+ export declare type IStreamResult<T> = {
588
+ done: true;
589
+ } | {
590
+ done: false;
591
+ value: T;
592
+ };
593
+
594
+ /**
595
+ * Context for uploading a summary to storage.
596
+ * Indicates the previously acked summary.
597
+ */
598
+ export declare interface ISummaryContext {
599
+ /**
600
+ * Parent summary proposed handle (from summary op)
601
+ */
602
+ readonly proposalHandle: string | undefined;
603
+ /**
604
+ * Parent summary acked handle (from summary ack)
605
+ */
606
+ readonly ackHandle: string | undefined;
607
+ readonly referenceSequenceNumber: number;
608
+ }
609
+
610
+ export declare interface IThrottlingWarning extends IDriverErrorBase {
611
+ readonly errorType: DriverErrorType.throttlingError;
612
+ readonly retryAfterSeconds: number;
613
+ }
614
+
615
+ export declare interface IUrlResolver {
616
+ resolve(request: IRequest): Promise<IResolvedUrl | undefined>;
617
+ /**
618
+ * Creates a url for the created container with any data store path given in the relative url.
619
+ * @param resolvedUrl - resolved url for the container.
620
+ * @param relativeUrl - relative url containing data store path; '/' represents root path.
621
+ * @param packageInfoSource - optional, represents container package information to be included in url.
622
+ * @returns absolute url combining container url with dta store path and optional additional information.
623
+ */
624
+ getAbsoluteUrl(resolvedUrl: IResolvedUrl, relativeUrl: string, packageInfoSource?: IContainerPackageInfo): Promise<string>;
625
+ }
626
+
627
+ export declare enum LoaderCachingPolicy {
628
+ /**
629
+ * The loader should not implement any prefetching or caching policy.
630
+ */
631
+ NoCaching = 0,
632
+ /**
633
+ * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.
634
+ */
635
+ Prefetch = 1
636
+ }
637
+
638
+ export { }