@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/src/storage.ts CHANGED
@@ -3,357 +3,386 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IDisposable, IEventProvider, IErrorEvent, ITelemetryBaseLogger } from "@fluidframework/common-definitions";
7
6
  import {
8
- ConnectionMode,
9
- IClient,
10
- IClientConfiguration,
11
- ICreateBlobResponse,
12
- IDocumentMessage,
13
- INack,
14
- ISequencedDocumentMessage,
15
- ISignalClient,
16
- ISignalMessage,
17
- ISnapshotTree,
18
- ISummaryHandle,
19
- ISummaryTree,
20
- ITokenClaims,
21
- IVersion,
7
+ IDisposable,
8
+ IEventProvider,
9
+ IErrorEvent,
10
+ ITelemetryBaseLogger,
11
+ } from "@fluidframework/common-definitions";
12
+ import {
13
+ ConnectionMode,
14
+ IClient,
15
+ IClientConfiguration,
16
+ ICreateBlobResponse,
17
+ IDocumentMessage,
18
+ INack,
19
+ ISequencedDocumentMessage,
20
+ ISignalClient,
21
+ ISignalMessage,
22
+ ISnapshotTree,
23
+ ISummaryHandle,
24
+ ISummaryTree,
25
+ ITokenClaims,
26
+ IVersion,
22
27
  } from "@fluidframework/protocol-definitions";
23
28
  import { IAnyDriverError } from "./driverError";
24
29
  import { IResolvedUrl } from "./urlResolver";
25
30
 
26
31
  export interface IDeltasFetchResult {
27
- /**
28
- * Sequential set of messages starting from 'from' sequence number.
29
- * May be partial result, i.e. not fulfill original request in full.
30
- */
31
- messages: ISequencedDocumentMessage[];
32
-
33
- /**
34
- * If true, storage only partially fulfilled request, but has more ops
35
- * If false, the request was fulfilled. If less ops were returned then
36
- * requested, then storage does not have more ops in this range.
37
- */
38
- partialResult: boolean;
32
+ /**
33
+ * Sequential set of messages starting from 'from' sequence number.
34
+ * May be partial result, i.e. not fulfill original request in full.
35
+ */
36
+ messages: ISequencedDocumentMessage[];
37
+
38
+ /**
39
+ * If true, storage only partially fulfilled request, but has more ops
40
+ * If false, the request was fulfilled. If less ops were returned then
41
+ * requested, then storage does not have more ops in this range.
42
+ */
43
+ partialResult: boolean;
39
44
  }
40
45
 
41
46
  /**
42
47
  * Interface to provide access to stored deltas for a shared object
43
48
  */
44
49
  export interface IDeltaStorageService {
45
- /**
46
- * Retrieves all the delta operations within the inclusive sequence number range
47
- * @param tenantId - Id of the tenant.
48
- * @param id - document id.
49
- * @param from - first op to retrieve (inclusive)
50
- * @param to - first op not to retrieve (exclusive end)
51
- * @param fetchReason - Reason for fetching the messages. Example, gap between seq number
52
- * of Op on wire and known seq number. It should not contain any PII. It can be logged by
53
- * spo which could help in debugging sessions if any issue occurs.
54
- */
55
- get(
56
- tenantId: string,
57
- id: string,
58
- from: number, // inclusive
59
- to: number, // exclusive
60
- fetchReason?: string,
61
- ): Promise<IDeltasFetchResult>;
50
+ /**
51
+ * Retrieves all the delta operations within the inclusive sequence number range
52
+ * @param tenantId - Id of the tenant.
53
+ * @param id - document id.
54
+ * @param from - first op to retrieve (inclusive)
55
+ * @param to - first op not to retrieve (exclusive end)
56
+ * @param fetchReason - Reason for fetching the messages. Example, gap between seq number
57
+ * of Op on wire and known seq number. It should not contain any PII. It can be logged by
58
+ * spo which could help in debugging sessions if any issue occurs.
59
+ */
60
+ get(
61
+ tenantId: string,
62
+ id: string,
63
+ from: number, // inclusive
64
+ to: number, // exclusive
65
+ fetchReason?: string,
66
+ ): Promise<IDeltasFetchResult>;
62
67
  }
63
68
 
64
- export type IStreamResult<T> = { done: true; } | { done: false; value: T; };
69
+ export type IStreamResult<T> = { done: true } | { done: false; value: T };
65
70
 
66
71
  /**
67
72
  * Read interface for the Queue
68
73
  */
69
74
  export interface IStream<T> {
70
- read(): Promise<IStreamResult<T>>;
75
+ read(): Promise<IStreamResult<T>>;
71
76
  }
72
77
 
73
78
  /**
74
79
  * Interface to provide access to stored deltas for a shared object
75
80
  */
76
81
  export interface IDocumentDeltaStorageService {
77
- /**
78
- * Retrieves all the delta operations within the exclusive sequence number range
79
- * @param from - first op to retrieve (inclusive)
80
- * @param to - first op not to retrieve (exclusive end)
81
- * @param abortSignal - signal that aborts operation
82
- * @param cachedOnly - return only cached ops, i.e. ops available locally on client.
83
- * @param fetchReason - Reason for fetching the messages. Example, gap between seq number
84
- * of Op on wire and known seq number. It should not contain any PII. It can be logged by
85
- * spo which could help in debugging sessions if any issue occurs.
86
- */
87
- fetchMessages(from: number,
88
- to: number | undefined,
89
- abortSignal?: AbortSignal,
90
- cachedOnly?: boolean,
91
- fetchReason?: string,
92
- ): IStream<ISequencedDocumentMessage[]>;
82
+ /**
83
+ * Retrieves all the delta operations within the exclusive sequence number range
84
+ * @param from - first op to retrieve (inclusive)
85
+ * @param to - first op not to retrieve (exclusive end)
86
+ * @param abortSignal - signal that aborts operation
87
+ * @param cachedOnly - return only cached ops, i.e. ops available locally on client.
88
+ * @param fetchReason - Reason for fetching the messages. Example, gap between seq number
89
+ * of Op on wire and known seq number. It should not contain any PII. It can be logged by
90
+ * spo which could help in debugging sessions if any issue occurs.
91
+ */
92
+ fetchMessages(
93
+ from: number,
94
+ to: number | undefined,
95
+ abortSignal?: AbortSignal,
96
+ cachedOnly?: boolean,
97
+ fetchReason?: string,
98
+ ): IStream<ISequencedDocumentMessage[]>;
93
99
  }
94
100
 
95
- // DO NOT INCREASE THIS TYPE'S VALUE - If a driver started using a larger value, GC would likely start closing sessions
96
- export type FiveDaysMs = 432000000; /* 5 days in milliseconds */
101
+ // DO NOT INCREASE THIS TYPE'S VALUE
102
+ // If a driver started using a larger value,
103
+ // internal assumptions of the Runtime's GC feature will be violated
104
+ // DO NOT INCREASE THIS TYPE'S VALUE
105
+ export type FiveDaysMs = 432_000_000; /* 5 days in milliseconds */
97
106
 
107
+ /**
108
+ * Policies describing attributes or characteristics of the driver's storage service,
109
+ * to direct how other components interact with the driver
110
+ */
98
111
  export interface IDocumentStorageServicePolicies {
99
- readonly caching?: LoaderCachingPolicy;
100
-
101
- /**
102
- * If this policy is provided, it tells runtime on ideal size for blobs.
103
- * Blobs that are smaller than that size should be aggregated into bigger blobs.
104
- */
105
- readonly minBlobSize?: number;
106
-
107
- /**
108
- * If undefined, the driver makes no guarantees about the age of snapshots used for loading.
109
- * Otherwise, the driver will not use snapshots that were added to the cache more than 5 days ago (per client clock)
110
- * The value MUST be 5 days if defined. This fixed upper bound is necessary for the Garbage Collection feature
111
- * in the Runtime layer to reliably compute when an object will never be referenced again and can be deleted.
112
- */
113
- readonly maximumCacheDurationMs?: FiveDaysMs;
112
+ /**
113
+ * Should the Loader implement any sort of pre-fetching or caching mechanism?
114
+ */
115
+ readonly caching?: LoaderCachingPolicy;
116
+
117
+ /**
118
+ * If this policy is provided, it tells runtime on ideal size for blobs.
119
+ * Blobs that are smaller than that size should be aggregated into bigger blobs.
120
+ */
121
+ readonly minBlobSize?: number;
122
+
123
+ /**
124
+ * IMPORTANT: This policy MUST be set to 5 days and PROPERLY ENFORCED for drivers that are used
125
+ * in applications where Garbage Collection is enabled. Otherwise data loss may occur.
126
+ *
127
+ * This policy pertains to requests for the latest snapshot from the service.
128
+ * If set, it means that the driver guarantees not to use a cached value that was fetched more than 5 days ago.
129
+ * If undefined, the driver makes no guarantees about the age of snapshots used for loading.
130
+ */
131
+ readonly maximumCacheDurationMs?: FiveDaysMs;
114
132
  }
115
133
 
116
134
  /**
117
135
  * Interface to provide access to snapshots saved for a shared object
118
136
  */
119
137
  export interface IDocumentStorageService extends Partial<IDisposable> {
120
- repositoryUrl: string;
121
-
122
- /**
123
- * Policies implemented/instructed by driver.
124
- */
125
- readonly policies?: IDocumentStorageServicePolicies;
126
-
127
- /**
128
- * Returns the snapshot tree.
129
- * @param version - Version of the snapshot to be fetched.
130
- * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help
131
- * in debugging purposes to see why this call was made.
132
- */
133
- getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
134
-
135
- /**
136
- * Retrieves all versions of the document starting at the specified versionId - or null if from the head
137
- * @param versionId - Version id of the requested version.
138
- * @param count - Number of the versions to be fetched.
139
- * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help
140
- * in debugging purposes to see why this call was made.
141
- * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache
142
- * requests and serve data from cache. That will result in stale info returned. Callers can disable this
143
- * functionality by passing fetchSource = noCache and ensuring that driver will return latest information
144
- * from storage.
145
- */
146
- getVersions(
147
- versionId: string | null,
148
- count: number,
149
- scenarioName?: string,
150
- fetchSource?: FetchSource,
151
- ): Promise<IVersion[]>;
152
-
153
- /**
154
- * Creates a blob out of the given buffer
155
- */
156
- createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
157
-
158
- /**
159
- * Reads the object with the given ID, returns content in arrayBufferLike
160
- */
161
- readBlob(id: string): Promise<ArrayBufferLike>;
162
-
163
- /**
164
- * Uploads a summary tree to storage using the given context for reference of previous summary handle.
165
- * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are
166
- * referencing from the previously acked summary.
167
- * Returns the uploaded summary handle.
168
- */
169
- uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
170
-
171
- /**
172
- * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the
173
- * server has deleted it this call may result in a broken promise.
174
- */
175
- downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
138
+ repositoryUrl: string;
139
+
140
+ /**
141
+ * Policies implemented/instructed by driver.
142
+ */
143
+ readonly policies?: IDocumentStorageServicePolicies;
144
+
145
+ /**
146
+ * Returns the snapshot tree.
147
+ * @param version - Version of the snapshot to be fetched.
148
+ * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help
149
+ * in debugging purposes to see why this call was made.
150
+ */
151
+ // TODO: use `undefined` instead.
152
+ // eslint-disable-next-line @rushstack/no-new-null
153
+ getSnapshotTree(version?: IVersion, scenarioName?: string): Promise<ISnapshotTree | null>;
154
+
155
+ /**
156
+ * Retrieves all versions of the document starting at the specified versionId - or null if from the head
157
+ * @param versionId - Version id of the requested version.
158
+ * @param count - Number of the versions to be fetched.
159
+ * @param scenarioName - scenario in which this api is called. This will be recorded by server and would help
160
+ * in debugging purposes to see why this call was made.
161
+ * @param fetchSource - Callers can specify the source of the response. For ex. Driver may choose to cache
162
+ * requests and serve data from cache. That will result in stale info returned. Callers can disable this
163
+ * functionality by passing fetchSource = noCache and ensuring that driver will return latest information
164
+ * from storage.
165
+ */
166
+ getVersions(
167
+ // TODO: use `undefined` instead.
168
+ // eslint-disable-next-line @rushstack/no-new-null
169
+ versionId: string | null,
170
+ count: number,
171
+ scenarioName?: string,
172
+ fetchSource?: FetchSource,
173
+ ): Promise<IVersion[]>;
174
+
175
+ /**
176
+ * Creates a blob out of the given buffer
177
+ */
178
+ createBlob(file: ArrayBufferLike): Promise<ICreateBlobResponse>;
179
+
180
+ /**
181
+ * Reads the object with the given ID, returns content in arrayBufferLike
182
+ */
183
+ readBlob(id: string): Promise<ArrayBufferLike>;
184
+
185
+ /**
186
+ * Uploads a summary tree to storage using the given context for reference of previous summary handle.
187
+ * The ISummaryHandles in the uploaded tree should have paths to indicate which summary object they are
188
+ * referencing from the previously acked summary.
189
+ * Returns the uploaded summary handle.
190
+ */
191
+ uploadSummaryWithContext(summary: ISummaryTree, context: ISummaryContext): Promise<string>;
192
+
193
+ /**
194
+ * Retrieves the commit that matches the packfile handle. If the packfile has already been committed and the
195
+ * server has deleted it this call may result in a broken promise.
196
+ */
197
+ downloadSummary(handle: ISummaryHandle): Promise<ISummaryTree>;
176
198
  }
177
199
 
178
200
  export interface IDocumentDeltaConnectionEvents extends IErrorEvent {
179
- (event: "nack", listener: (documentId: string, message: INack[]) => void);
180
- (event: "disconnect", listener: (reason: IAnyDriverError) => void);
181
- (event: "op", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);
182
- (event: "signal", listener: (message: ISignalMessage) => void);
183
- (event: "pong", listener: (latency: number) => void);
184
- (event: "error", listener: (error: any) => void);
201
+ (event: "nack", listener: (documentId: string, message: INack[]) => void);
202
+ (event: "disconnect", listener: (reason: IAnyDriverError) => void);
203
+ (event: "op", listener: (documentId: string, messages: ISequencedDocumentMessage[]) => void);
204
+ (event: "signal", listener: (message: ISignalMessage) => void);
205
+ (event: "pong", listener: (latency: number) => void);
206
+ // TODO: Use something other than `any`.
207
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
208
+ (event: "error", listener: (error: any) => void);
185
209
  }
186
210
 
187
- export interface IDocumentDeltaConnection extends IDisposable, IEventProvider<IDocumentDeltaConnectionEvents> {
188
- /**
189
- * ClientID for the connection
190
- */
191
- clientId: string;
192
-
193
- /**
194
- * Claims for the client
195
- */
196
- claims: ITokenClaims;
197
-
198
- /**
199
- * Mode of the client
200
- */
201
- mode: ConnectionMode;
202
-
203
- /**
204
- * Whether the connection was made to a new or existing document
205
- */
206
- existing: boolean;
207
-
208
- /**
209
- * Protocol version being used with the service
210
- */
211
- version: string;
212
-
213
- /**
214
- * Messages sent during the connection
215
- */
216
- initialMessages: ISequencedDocumentMessage[];
217
-
218
- /**
219
- * Signals sent during the connection
220
- */
221
- initialSignals: ISignalMessage[];
222
-
223
- /**
224
- * Prior clients already connected.
225
- */
226
- initialClients: ISignalClient[];
227
-
228
- /**
229
- * Configuration details provided by the service
230
- */
231
- serviceConfiguration: IClientConfiguration;
232
-
233
- /**
234
- * Last known sequence number to ordering service at the time of connection
235
- * It may lap actual last sequence number (quite a bit, if container is very active).
236
- * But it's best information for client to figure out how far it is behind, at least
237
- * for "read" connections. "write" connections may use own "join" op to similar information,
238
- * that is likely to be more up-to-date.
239
- */
240
- checkpointSequenceNumber?: number;
241
-
242
- /**
243
- * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo
244
- * it could contain info like build version, environment, region etc. These properties can be logged by client
245
- * to better understand server environment etc. and use it in case error occurs.
246
- * Format: "prop1:val1;prop2:val2;prop3:val3"
247
- */
248
- relayServiceAgent?: string;
249
-
250
- /**
251
- * Submit a new message to the server
252
- */
253
- submit(messages: IDocumentMessage[]): void;
254
-
255
- /**
256
- * Submit a new signal to the server
257
- */
258
- submitSignal(message: any): void;
211
+ export interface IDocumentDeltaConnection
212
+ extends IDisposable,
213
+ IEventProvider<IDocumentDeltaConnectionEvents> {
214
+ /**
215
+ * ClientID for the connection
216
+ */
217
+ clientId: string;
218
+
219
+ /**
220
+ * Claims for the client
221
+ */
222
+ claims: ITokenClaims;
223
+
224
+ /**
225
+ * Mode of the client
226
+ */
227
+ mode: ConnectionMode;
228
+
229
+ /**
230
+ * Whether the connection was made to a new or existing document
231
+ */
232
+ existing: boolean;
233
+
234
+ /**
235
+ * Protocol version being used with the service
236
+ */
237
+ version: string;
238
+
239
+ /**
240
+ * Messages sent during the connection
241
+ */
242
+ initialMessages: ISequencedDocumentMessage[];
243
+
244
+ /**
245
+ * Signals sent during the connection
246
+ */
247
+ initialSignals: ISignalMessage[];
248
+
249
+ /**
250
+ * Prior clients already connected.
251
+ */
252
+ initialClients: ISignalClient[];
253
+
254
+ /**
255
+ * Configuration details provided by the service
256
+ */
257
+ serviceConfiguration: IClientConfiguration;
258
+
259
+ /**
260
+ * Last known sequence number to ordering service at the time of connection
261
+ * It may lap actual last sequence number (quite a bit, if container is very active).
262
+ * But it's best information for client to figure out how far it is behind, at least
263
+ * for "read" connections. "write" connections may use own "join" op to similar information,
264
+ * that is likely to be more up-to-date.
265
+ */
266
+ checkpointSequenceNumber?: number;
267
+
268
+ /**
269
+ * Properties that server can send to client to tell info about node that client is connected to. For ex, for spo
270
+ * it could contain info like build version, environment, region etc. These properties can be logged by client
271
+ * to better understand server environment etc. and use it in case error occurs.
272
+ * Format: "prop1:val1;prop2:val2;prop3:val3"
273
+ */
274
+ relayServiceAgent?: string;
275
+
276
+ /**
277
+ * Submit a new message to the server
278
+ */
279
+ submit(messages: IDocumentMessage[]): void;
280
+
281
+ /**
282
+ * Submit a new signal to the server
283
+ */
284
+ // TODO: Use something other than `any`.
285
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
286
+ submitSignal(message: any): void;
259
287
  }
260
288
 
261
289
  export enum LoaderCachingPolicy {
262
- /**
263
- * The loader should not implement any prefetching or caching policy.
264
- */
265
- NoCaching,
266
-
267
- /**
268
- * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.
269
- */
270
- Prefetch,
290
+ /**
291
+ * The loader should not implement any prefetching or caching policy.
292
+ */
293
+ NoCaching,
294
+
295
+ /**
296
+ * The loader should implement prefetching policy, i.e. it should prefetch resources from the latest snapshot.
297
+ */
298
+ Prefetch,
271
299
  }
272
300
 
273
301
  export interface IDocumentServicePolicies {
274
- /**
275
- * Do not connect to delta stream
276
- */
277
- readonly storageOnly?: boolean;
302
+ /**
303
+ * Do not connect to delta stream
304
+ */
305
+ readonly storageOnly?: boolean;
306
+
307
+ /**
308
+ * Summarizer uploads the protocol tree too when summarizing.
309
+ */
310
+ readonly summarizeProtocolTree?: boolean;
278
311
  }
279
312
 
280
313
  export interface IDocumentService {
281
-
282
- resolvedUrl: IResolvedUrl;
283
-
284
- /**
285
- * Policies implemented/instructed by driver.
286
- */
287
- policies?: IDocumentServicePolicies;
288
-
289
- /**
290
- * Access to storage associated with the document...
291
- */
292
- connectToStorage(): Promise<IDocumentStorageService>;
293
-
294
- /**
295
- * Access to delta storage associated with the document
296
- */
297
- connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
298
-
299
- /**
300
- * Subscribes to the document delta stream
301
- */
302
- connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
303
-
304
- /**
305
- * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).
306
- * Useful for storage to commit any pending state if any (including any local caching).
307
- * Please note that it does not remove the need for caller to close all active delta connections,
308
- * as storage may not be tracking such objects.
309
- * @param error - tells if container (and storage) are closed due to critical error.
310
- * Error might be due to disconnect between client & server knowlege about file, like file being overwritten
311
- * in storage, but client having stale local cache.
312
- * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.
313
- */
314
- dispose(error?: any): void;
314
+ resolvedUrl: IResolvedUrl;
315
+
316
+ /**
317
+ * Policies implemented/instructed by driver.
318
+ */
319
+ policies?: IDocumentServicePolicies;
320
+
321
+ /**
322
+ * Access to storage associated with the document
323
+ */
324
+ connectToStorage(): Promise<IDocumentStorageService>;
325
+
326
+ /**
327
+ * Access to delta storage associated with the document
328
+ */
329
+ connectToDeltaStorage(): Promise<IDocumentDeltaStorageService>;
330
+
331
+ /**
332
+ * Subscribes to the document delta stream
333
+ */
334
+ connectToDeltaStream(client: IClient): Promise<IDocumentDeltaConnection>;
335
+
336
+ /**
337
+ * Dispose storage. Called by storage consumer (Container) when it's done with storage (Container closed).
338
+ * Useful for storage to commit any pending state if any (including any local caching).
339
+ * Please note that it does not remove the need for caller to close all active delta connections,
340
+ * as storage may not be tracking such objects.
341
+ * @param error - tells if container (and storage) are closed due to critical error.
342
+ * Error might be due to disconnect between client & server knowledge about file, like file being overwritten
343
+ * in storage, but client having stale local cache.
344
+ * If driver implements any kind of local caching, such caches needs to be cleared on on critical errors.
345
+ */
346
+ // TODO: Use something other than `any`.
347
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
348
+ dispose(error?: any): void;
315
349
  }
316
350
 
317
351
  export interface IDocumentServiceFactory {
318
- /**
319
- * Name of the protocol used by factory
320
- */
321
- protocolName: string;
322
-
323
- /**
324
- * Creates the document service after extracting different endpoints URLs from a resolved URL.
325
- *
326
- * @param resolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.
327
- * @param logger - Optional telemetry logger to which telemetry events will be forwarded.
328
- * @param clientIsSummarizer - Whether or not the client is the
329
- * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
330
- * `undefined` =\> false
331
- *
332
- * @returns An instance of {@link IDocumentService}.
333
- */
334
- createDocumentService(
335
- resolvedUrl: IResolvedUrl,
336
- logger?: ITelemetryBaseLogger,
337
- clientIsSummarizer?: boolean,
338
- ): Promise<IDocumentService>;
339
-
340
- /**
341
- * Creates a new document with the provided options. Returns the document service.
342
- *
343
- * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary
344
- * should be posted later, before connecting to ordering service.
345
- * @param createNewResolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.
346
- * @param logger - Optional telemetry logger to which telemetry events will be forwarded.
347
- * @param clientIsSummarizer - Whether or not the client is the
348
- * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
349
- * `undefined` =\> false
350
- */
351
- createContainer(
352
- createNewSummary: ISummaryTree | undefined,
353
- createNewResolvedUrl: IResolvedUrl,
354
- logger?: ITelemetryBaseLogger,
355
- clientIsSummarizer?: boolean,
356
- ): Promise<IDocumentService>;
352
+ /**
353
+ * Creates the document service after extracting different endpoints URLs from a resolved URL.
354
+ *
355
+ * @param resolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.
356
+ * @param logger - Optional telemetry logger to which telemetry events will be forwarded.
357
+ * @param clientIsSummarizer - Whether or not the client is the
358
+ * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
359
+ * `undefined` =\> false
360
+ *
361
+ * @returns An instance of {@link IDocumentService}.
362
+ */
363
+ createDocumentService(
364
+ resolvedUrl: IResolvedUrl,
365
+ logger?: ITelemetryBaseLogger,
366
+ clientIsSummarizer?: boolean,
367
+ ): Promise<IDocumentService>;
368
+
369
+ /**
370
+ * Creates a new document with the provided options. Returns the document service.
371
+ *
372
+ * @param createNewSummary - Summary used to create file. If undefined, an empty file will be created and a summary
373
+ * should be posted later, before connecting to ordering service.
374
+ * @param createNewResolvedUrl - Endpoint URL data. See {@link IResolvedUrl}.
375
+ * @param logger - Optional telemetry logger to which telemetry events will be forwarded.
376
+ * @param clientIsSummarizer - Whether or not the client is the
377
+ * {@link https://fluidframework.com/docs/concepts/summarizer/ | summarizer}.
378
+ * `undefined` =\> false
379
+ */
380
+ createContainer(
381
+ createNewSummary: ISummaryTree | undefined,
382
+ createNewResolvedUrl: IResolvedUrl,
383
+ logger?: ITelemetryBaseLogger,
384
+ clientIsSummarizer?: boolean,
385
+ ): Promise<IDocumentService>;
357
386
  }
358
387
 
359
388
  /**
@@ -361,20 +390,20 @@ export interface IDocumentServiceFactory {
361
390
  * Indicates the previously acked summary.
362
391
  */
363
392
  export interface ISummaryContext {
364
- /**
365
- * Parent summary proposed handle (from summary op)
366
- */
367
- readonly proposalHandle: string | undefined;
393
+ /**
394
+ * Parent summary proposed handle (from summary op)
395
+ */
396
+ readonly proposalHandle: string | undefined;
368
397
 
369
- /**
370
- * Parent summary acked handle (from summary ack)
371
- */
372
- readonly ackHandle: string | undefined;
398
+ /**
399
+ * Parent summary acked handle (from summary ack)
400
+ */
401
+ readonly ackHandle: string | undefined;
373
402
 
374
- readonly referenceSequenceNumber: number;
403
+ readonly referenceSequenceNumber: number;
375
404
  }
376
405
 
377
406
  export enum FetchSource {
378
- default = "default",
379
- noCache = "noCache",
407
+ default = "default",
408
+ noCache = "noCache",
380
409
  }