@fluidframework/runtime-definitions 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-dev-rc.2.0.0.245554
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +1 -1
- package/CHANGELOG.md +75 -0
- package/api-extractor-cjs.json +8 -0
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/runtime-definitions.api.md +103 -116
- package/dist/dataStoreContext.d.ts +128 -69
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +3 -0
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreFactory.d.ts +1 -1
- package/dist/dataStoreFactory.d.ts.map +1 -1
- package/dist/dataStoreFactory.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +1 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/{garbageCollection.d.ts → garbageCollectionDefinitions.d.ts} +8 -2
- package/dist/garbageCollectionDefinitions.d.ts.map +1 -0
- package/dist/{garbageCollection.js → garbageCollectionDefinitions.js} +9 -3
- package/dist/garbageCollectionDefinitions.js.map +1 -0
- package/dist/index.d.ts +12 -52
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -26
- package/dist/index.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/protocol.d.ts +2 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/runtime-definitions-alpha.d.ts +188 -165
- package/dist/runtime-definitions-beta.d.ts +37 -59
- package/dist/runtime-definitions-public.d.ts +37 -59
- package/dist/runtime-definitions-untrimmed.d.ts +195 -166
- package/dist/summary.d.ts +15 -20
- package/dist/summary.d.ts.map +1 -1
- package/dist/summary.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/attribution.d.ts +71 -0
- package/lib/attribution.d.ts.map +1 -0
- package/lib/attribution.js +6 -0
- package/lib/attribution.js.map +1 -0
- package/lib/dataStoreContext.d.ts +464 -0
- package/lib/dataStoreContext.d.ts.map +1 -0
- package/lib/dataStoreContext.js +67 -0
- package/lib/dataStoreContext.js.map +1 -0
- package/lib/dataStoreFactory.d.ts +33 -0
- package/lib/dataStoreFactory.d.ts.map +1 -0
- package/lib/dataStoreFactory.js +9 -0
- package/lib/dataStoreFactory.js.map +1 -0
- package/lib/dataStoreRegistry.d.ts +41 -0
- package/lib/dataStoreRegistry.d.ts.map +1 -0
- package/lib/dataStoreRegistry.js +9 -0
- package/lib/dataStoreRegistry.js.map +1 -0
- package/lib/garbageCollectionDefinitions.d.ts +62 -0
- package/lib/garbageCollectionDefinitions.d.ts.map +1 -0
- package/lib/garbageCollectionDefinitions.js +35 -0
- package/lib/garbageCollectionDefinitions.js.map +1 -0
- package/lib/index.d.ts +17 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -0
- package/lib/protocol.d.ts +77 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +6 -0
- package/lib/protocol.js.map +1 -0
- package/lib/runtime-definitions-alpha.d.ts +1019 -0
- package/lib/runtime-definitions-beta.d.ts +242 -0
- package/lib/runtime-definitions-public.d.ts +242 -0
- package/lib/runtime-definitions-untrimmed.d.ts +1100 -0
- package/lib/summary.d.ts +322 -0
- package/lib/summary.d.ts.map +1 -0
- package/lib/summary.js +26 -0
- package/lib/summary.js.map +1 -0
- package/package.json +115 -33
- package/src/dataStoreContext.ts +151 -85
- package/src/dataStoreFactory.ts +1 -1
- package/src/dataStoreRegistry.ts +1 -1
- package/src/{garbageCollection.ts → garbageCollectionDefinitions.ts} +7 -1
- package/src/index.ts +26 -71
- package/src/protocol.ts +2 -1
- package/src/summary.ts +18 -20
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/dist/garbageCollection.d.ts.map +0 -1
- package/dist/garbageCollection.js.map +0 -1
package/src/dataStoreContext.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import type {
|
|
7
7
|
IEvent,
|
|
8
8
|
IEventProvider,
|
|
9
9
|
ITelemetryBaseLogger,
|
|
@@ -14,32 +14,30 @@ import {
|
|
|
14
14
|
IResponse,
|
|
15
15
|
FluidObject,
|
|
16
16
|
} from "@fluidframework/core-interfaces";
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
AttachState,
|
|
21
|
-
ILoaderOptions,
|
|
22
|
-
} from "@fluidframework/container-definitions";
|
|
23
|
-
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
24
|
-
import {
|
|
17
|
+
import type { IAudience, IDeltaManager, AttachState } from "@fluidframework/container-definitions";
|
|
18
|
+
import type { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
19
|
+
import type {
|
|
25
20
|
IClientDetails,
|
|
26
21
|
IDocumentMessage,
|
|
27
22
|
IQuorumClients,
|
|
28
23
|
ISequencedDocumentMessage,
|
|
29
24
|
ISnapshotTree,
|
|
30
25
|
} from "@fluidframework/protocol-definitions";
|
|
31
|
-
import { IIdCompressor } from "@fluidframework/id-compressor";
|
|
32
|
-
import { IProvideFluidDataStoreFactory } from "./dataStoreFactory";
|
|
33
|
-
import { IProvideFluidDataStoreRegistry } from "./dataStoreRegistry";
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
27
|
+
import type { IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
|
|
28
|
+
import type { IProvideFluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
29
|
+
import type {
|
|
30
|
+
IGarbageCollectionData,
|
|
31
|
+
IGarbageCollectionDetailsBase,
|
|
32
|
+
} from "./garbageCollectionDefinitions.js";
|
|
33
|
+
import type { IInboundSignalMessage } from "./protocol.js";
|
|
34
|
+
import type {
|
|
37
35
|
CreateChildSummarizerNodeParam,
|
|
38
36
|
ISummarizerNodeWithGC,
|
|
39
37
|
ISummaryTreeWithStats,
|
|
40
38
|
ITelemetryContext,
|
|
41
39
|
SummarizeInternalFn,
|
|
42
|
-
} from "./summary";
|
|
40
|
+
} from "./summary.js";
|
|
43
41
|
|
|
44
42
|
/**
|
|
45
43
|
* Runtime flush mode handling
|
|
@@ -48,6 +46,9 @@ import {
|
|
|
48
46
|
export enum FlushMode {
|
|
49
47
|
/**
|
|
50
48
|
* In Immediate flush mode the runtime will immediately send all operations to the driver layer.
|
|
49
|
+
*
|
|
50
|
+
* @deprecated This option will be removed in the next major version and should not be used. Use {@link FlushMode.TurnBased} instead, which is the default.
|
|
51
|
+
* See https://github.com/microsoft/FluidFramework/tree/main/packages/runtime/container-runtime/src/opLifecycle#how-batching-works
|
|
51
52
|
*/
|
|
52
53
|
Immediate,
|
|
53
54
|
|
|
@@ -120,6 +121,7 @@ export interface IContainerRuntimeBaseEvents extends IEvent {
|
|
|
120
121
|
(event: "op", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void);
|
|
121
122
|
(event: "batchEnd", listener: (error: any, op: ISequencedDocumentMessage) => void);
|
|
122
123
|
(event: "signal", listener: (message: IInboundSignalMessage, local: boolean) => void);
|
|
124
|
+
(event: "dispose", listener: () => void);
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
/**
|
|
@@ -167,10 +169,13 @@ export interface IDataStore {
|
|
|
167
169
|
export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeBaseEvents> {
|
|
168
170
|
readonly logger: ITelemetryBaseLogger;
|
|
169
171
|
readonly clientDetails: IClientDetails;
|
|
172
|
+
readonly disposed: boolean;
|
|
170
173
|
|
|
171
174
|
/**
|
|
172
175
|
* Invokes the given callback and guarantees that all operations generated within the callback will be ordered
|
|
173
|
-
* sequentially.
|
|
176
|
+
* sequentially.
|
|
177
|
+
*
|
|
178
|
+
* If the callback throws an error, the container will close and the error will be logged.
|
|
174
179
|
*/
|
|
175
180
|
orderSequentially(callback: () => void): void;
|
|
176
181
|
|
|
@@ -178,14 +183,15 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
178
183
|
* Submits a container runtime level signal to be sent to other clients.
|
|
179
184
|
* @param type - Type of the signal.
|
|
180
185
|
* @param content - Content of the signal.
|
|
186
|
+
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
181
187
|
*/
|
|
182
|
-
submitSignal(type: string, content: any): void;
|
|
188
|
+
submitSignal(type: string, content: any, targetClientId?: string): void;
|
|
183
189
|
|
|
184
190
|
/**
|
|
185
191
|
* @deprecated 0.16 Issue #1537, #3631
|
|
186
192
|
*/
|
|
187
193
|
_createDataStoreWithProps(
|
|
188
|
-
pkg: string | string[]
|
|
194
|
+
pkg: Readonly<string | string[]>,
|
|
189
195
|
props?: any,
|
|
190
196
|
id?: string,
|
|
191
197
|
): Promise<IDataStore>;
|
|
@@ -197,14 +203,24 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
197
203
|
* already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this
|
|
198
204
|
* store being attached to storage.
|
|
199
205
|
* @param pkg - Package name of the data store factory
|
|
206
|
+
* @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.
|
|
207
|
+
* When not specified the datastore will belong to a `default` group. Read more about it in this
|
|
208
|
+
* {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}
|
|
200
209
|
*/
|
|
201
|
-
createDataStore(pkg: string | string[]): Promise<IDataStore>;
|
|
210
|
+
createDataStore(pkg: Readonly<string | string[]>, loadingGroupId?: string): Promise<IDataStore>;
|
|
202
211
|
|
|
203
212
|
/**
|
|
204
213
|
* Creates detached data store context. Only after context.attachRuntime() is called,
|
|
205
214
|
* data store initialization is considered complete.
|
|
215
|
+
* @param pkg - Package name of the data store factory
|
|
216
|
+
* @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.
|
|
217
|
+
* When not specified the datastore will belong to a `default` group. Read more about it in this
|
|
218
|
+
* {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}.
|
|
206
219
|
*/
|
|
207
|
-
createDetachedDataStore(
|
|
220
|
+
createDetachedDataStore(
|
|
221
|
+
pkg: Readonly<string[]>,
|
|
222
|
+
loadingGroupId?: string,
|
|
223
|
+
): IFluidDataStoreContextDetached;
|
|
208
224
|
|
|
209
225
|
/**
|
|
210
226
|
* Get an absolute url for a provided container-relative request.
|
|
@@ -224,6 +240,30 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
224
240
|
* Returns the current audience.
|
|
225
241
|
*/
|
|
226
242
|
getAudience(): IAudience;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Generates a new ID that is guaranteed to be unique across all sessions for this container.
|
|
246
|
+
* It could be in compact form (non-negative integer, oppotunistic), but it could also be UUID string.
|
|
247
|
+
* UUIDs generated will have low entropy in groups and will compress well.
|
|
248
|
+
* It can be leveraged anywhere in container where container unique IDs are required, i.e. any place
|
|
249
|
+
* that uses uuid() and stores result in container is likely candidate to start leveraging this API.
|
|
250
|
+
* If you always want to convert to string, instead of doing String(generateDocumentUniqueId()), consider
|
|
251
|
+
* doing encodeCompactIdToString(generateDocumentUniqueId()).
|
|
252
|
+
*
|
|
253
|
+
* For more details, please see IIdCompressor.generateDocumentUniqueId()
|
|
254
|
+
*/
|
|
255
|
+
generateDocumentUniqueId(): number | string;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Api to fetch the snapshot from the service for a loadingGroupIds.
|
|
259
|
+
* @param loadingGroupIds - LoadingGroupId for which the snapshot is asked for.
|
|
260
|
+
* @param pathParts - Parts of the path, which we want to extract from the snapshot tree.
|
|
261
|
+
* @returns - snapshotTree and the sequence number of the snapshot.
|
|
262
|
+
*/
|
|
263
|
+
getSnapshotForLoadingGroupId(
|
|
264
|
+
loadingGroupIds: string[],
|
|
265
|
+
pathParts: string[],
|
|
266
|
+
): Promise<{ snapshotTree: ISnapshotTree; sequenceNumber: number }>;
|
|
227
267
|
}
|
|
228
268
|
|
|
229
269
|
/**
|
|
@@ -234,21 +274,6 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
234
274
|
* @alpha
|
|
235
275
|
*/
|
|
236
276
|
export interface IFluidDataStoreChannel extends IDisposable {
|
|
237
|
-
readonly id: string;
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Indicates the attachment state of the channel to a host service.
|
|
241
|
-
*/
|
|
242
|
-
readonly attachState: AttachState;
|
|
243
|
-
|
|
244
|
-
readonly visibilityState: VisibilityState;
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Runs through the graph and attaches the bound handles. Then binds this runtime to the container.
|
|
248
|
-
* @deprecated This will be removed in favor of {@link IFluidDataStoreChannel.makeVisibleAndAttachGraph}.
|
|
249
|
-
*/
|
|
250
|
-
attachGraph(): void;
|
|
251
|
-
|
|
252
277
|
/**
|
|
253
278
|
* Makes the data store channel visible in the container. Also, runs through its graph and attaches all
|
|
254
279
|
* bound handles that represent its dependencies in the container's graph.
|
|
@@ -256,19 +281,29 @@ export interface IFluidDataStoreChannel extends IDisposable {
|
|
|
256
281
|
makeVisibleAndAttachGraph(): void;
|
|
257
282
|
|
|
258
283
|
/**
|
|
259
|
-
*
|
|
284
|
+
* Synchronously retrieves the summary used as part of the initial summary message
|
|
260
285
|
*/
|
|
261
286
|
getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
262
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Synchronously retrieves GC Data (representing the outbound routes present) for the initial state of the DataStore
|
|
290
|
+
*/
|
|
291
|
+
getAttachGCData?(telemetryContext?: ITelemetryContext): IGarbageCollectionData;
|
|
292
|
+
|
|
263
293
|
/**
|
|
264
294
|
* Processes the op.
|
|
265
295
|
*/
|
|
266
|
-
process(
|
|
296
|
+
process(
|
|
297
|
+
message: ISequencedDocumentMessage,
|
|
298
|
+
local: boolean,
|
|
299
|
+
localOpMetadata: unknown,
|
|
300
|
+
addedOutboundReference?: (fromNodePath: string, toNodePath: string) => void,
|
|
301
|
+
): void;
|
|
267
302
|
|
|
268
303
|
/**
|
|
269
304
|
* Processes the signal.
|
|
270
305
|
*/
|
|
271
|
-
processSignal(message:
|
|
306
|
+
processSignal(message: IInboundSignalMessage, local: boolean): void;
|
|
272
307
|
|
|
273
308
|
/**
|
|
274
309
|
* Generates a summary for the channel.
|
|
@@ -329,6 +364,8 @@ export interface IFluidDataStoreChannel extends IDisposable {
|
|
|
329
364
|
readonly entryPoint: IFluidHandle<FluidObject>;
|
|
330
365
|
|
|
331
366
|
request(request: IRequest): Promise<IResponse>;
|
|
367
|
+
|
|
368
|
+
setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
|
|
332
369
|
}
|
|
333
370
|
|
|
334
371
|
/**
|
|
@@ -344,44 +381,29 @@ export type CreateChildSummarizerNodeFn = (
|
|
|
344
381
|
) => ISummarizerNodeWithGC;
|
|
345
382
|
|
|
346
383
|
/**
|
|
384
|
+
* Represents the context for the data store like objects. It is used by the data store runtime to
|
|
385
|
+
* get information and call functionality to its parent.
|
|
386
|
+
*
|
|
387
|
+
* This layout is temporary, as {@link IFluidParentContext} and {@link IFluidDataStoreContext} will converge.
|
|
388
|
+
*
|
|
347
389
|
* @alpha
|
|
348
390
|
*/
|
|
349
|
-
export interface
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Represents the context for the data store. It is used by the data store runtime to
|
|
355
|
-
* get information and call functionality to the container.
|
|
356
|
-
* @alpha
|
|
357
|
-
*/
|
|
358
|
-
export interface IFluidDataStoreContext
|
|
359
|
-
extends IEventProvider<IFluidDataStoreContextEvents>,
|
|
360
|
-
Partial<IProvideFluidDataStoreRegistry>,
|
|
361
|
-
IProvideFluidHandleContext {
|
|
362
|
-
readonly id: string;
|
|
363
|
-
/**
|
|
364
|
-
* A data store created by a client, is a local data store for that client. Also, when a detached container loads
|
|
365
|
-
* from a snapshot, all the data stores are treated as local data stores because at that stage the container
|
|
366
|
-
* still doesn't exists in storage and so the data store couldn't have been created by any other client.
|
|
367
|
-
* Value of this never changes even after the data store is attached.
|
|
368
|
-
* As implementer of data store runtime, you can use this property to check that this data store belongs to this
|
|
369
|
-
* client and hence implement any scenario based on that.
|
|
370
|
-
*/
|
|
371
|
-
readonly isLocalDataStore: boolean;
|
|
372
|
-
/**
|
|
373
|
-
* The package path of the data store as per the package factory.
|
|
374
|
-
*/
|
|
375
|
-
readonly packagePath: readonly string[];
|
|
376
|
-
readonly options: ILoaderOptions;
|
|
391
|
+
export interface IFluidParentContext
|
|
392
|
+
extends IProvideFluidHandleContext,
|
|
393
|
+
Partial<IProvideFluidDataStoreRegistry> {
|
|
394
|
+
readonly options: Record<string | number, any>;
|
|
377
395
|
readonly clientId: string | undefined;
|
|
378
396
|
readonly connected: boolean;
|
|
379
397
|
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
380
398
|
readonly storage: IDocumentStorageService;
|
|
381
|
-
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
382
399
|
readonly logger: ITelemetryBaseLogger;
|
|
383
400
|
readonly clientDetails: IClientDetails;
|
|
384
401
|
readonly idCompressor?: IIdCompressor;
|
|
402
|
+
/**
|
|
403
|
+
* Represents the loading group to which the data store belongs to. Please refer to this readme for more context.
|
|
404
|
+
* {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}
|
|
405
|
+
*/
|
|
406
|
+
readonly loadingGroupId?: string;
|
|
385
407
|
/**
|
|
386
408
|
* Indicates the attachment state of the data store to a host service.
|
|
387
409
|
*/
|
|
@@ -389,16 +411,14 @@ export interface IFluidDataStoreContext
|
|
|
389
411
|
|
|
390
412
|
readonly containerRuntime: IContainerRuntimeBase;
|
|
391
413
|
|
|
392
|
-
/**
|
|
393
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
394
|
-
*/
|
|
395
|
-
readonly createProps?: any;
|
|
396
|
-
|
|
397
414
|
/**
|
|
398
415
|
* Ambient services provided with the context
|
|
399
416
|
*/
|
|
400
417
|
readonly scope: FluidObject;
|
|
401
418
|
|
|
419
|
+
readonly gcThrowOnTombstoneUsage: boolean;
|
|
420
|
+
readonly gcTombstoneEnforcementAllowed: boolean;
|
|
421
|
+
|
|
402
422
|
/**
|
|
403
423
|
* Returns the current quorum.
|
|
404
424
|
*/
|
|
@@ -443,12 +463,6 @@ export interface IFluidDataStoreContext
|
|
|
443
463
|
*/
|
|
444
464
|
makeLocallyVisible(): void;
|
|
445
465
|
|
|
446
|
-
/**
|
|
447
|
-
* Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.
|
|
448
|
-
* @param address - The address of the channel that is dirty.
|
|
449
|
-
*/
|
|
450
|
-
setChannelDirty(address: string): void;
|
|
451
|
-
|
|
452
466
|
/**
|
|
453
467
|
* Get an absolute url to the container based on the provided relativeUrl.
|
|
454
468
|
* Returns undefined if the container or data store isn't attached to storage.
|
|
@@ -470,8 +484,60 @@ export interface IFluidDataStoreContext
|
|
|
470
484
|
createParam: CreateChildSummarizerNodeParam,
|
|
471
485
|
): CreateChildSummarizerNodeFn;
|
|
472
486
|
|
|
487
|
+
deleteChildSummarizerNode?(id: string): void;
|
|
488
|
+
|
|
473
489
|
uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
|
|
474
490
|
|
|
491
|
+
/**
|
|
492
|
+
* @deprecated There is no replacement for this, its functionality is no longer needed at this layer.
|
|
493
|
+
* It will be removed in a future release, sometime after 2.0.0-internal.8.0.0
|
|
494
|
+
*
|
|
495
|
+
* Similar capability is exposed with from/to string paths instead of handles via @see addedGCOutboundRoute
|
|
496
|
+
*
|
|
497
|
+
* Called when a new outbound reference is added to another node. This is used by garbage collection to identify
|
|
498
|
+
* all references added in the system.
|
|
499
|
+
* @param srcHandle - The handle of the node that added the reference.
|
|
500
|
+
* @param outboundHandle - The handle of the outbound node that is referenced.
|
|
501
|
+
*/
|
|
502
|
+
addedGCOutboundReference?(
|
|
503
|
+
srcHandle: { absolutePath: string },
|
|
504
|
+
outboundHandle: { absolutePath: string },
|
|
505
|
+
): void;
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Called by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.
|
|
509
|
+
* @param address - The address of the channel that is dirty.
|
|
510
|
+
*/
|
|
511
|
+
setChannelDirty(address: string): void;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Represents the context for the data store. It is used by the data store runtime to
|
|
516
|
+
* get information and call functionality to the container.
|
|
517
|
+
* @alpha
|
|
518
|
+
*/
|
|
519
|
+
export interface IFluidDataStoreContext extends IFluidParentContext {
|
|
520
|
+
readonly id: string;
|
|
521
|
+
/**
|
|
522
|
+
* A data store created by a client, is a local data store for that client. Also, when a detached container loads
|
|
523
|
+
* from a snapshot, all the data stores are treated as local data stores because at that stage the container
|
|
524
|
+
* still doesn't exists in storage and so the data store couldn't have been created by any other client.
|
|
525
|
+
* Value of this never changes even after the data store is attached.
|
|
526
|
+
* As implementer of data store runtime, you can use this property to check that this data store belongs to this
|
|
527
|
+
* client and hence implement any scenario based on that.
|
|
528
|
+
*/
|
|
529
|
+
readonly isLocalDataStore: boolean;
|
|
530
|
+
/**
|
|
531
|
+
* The package path of the data store as per the package factory.
|
|
532
|
+
*/
|
|
533
|
+
readonly packagePath: readonly string[];
|
|
534
|
+
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* @deprecated 0.16 Issue #1635, #3631
|
|
538
|
+
*/
|
|
539
|
+
readonly createProps?: any;
|
|
540
|
+
|
|
475
541
|
/**
|
|
476
542
|
* @deprecated The functionality to get base GC details has been moved to summarizer node.
|
|
477
543
|
*
|
|
@@ -481,15 +547,15 @@ export interface IFluidDataStoreContext
|
|
|
481
547
|
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
482
548
|
|
|
483
549
|
/**
|
|
484
|
-
*
|
|
485
|
-
* It will be removed in a future release, sometime after 2.0.0-internal.8.0.0
|
|
550
|
+
* (Same as @see addedGCOutboundReference, but with string paths instead of handles)
|
|
486
551
|
*
|
|
487
552
|
* Called when a new outbound reference is added to another node. This is used by garbage collection to identify
|
|
488
553
|
* all references added in the system.
|
|
489
|
-
*
|
|
490
|
-
* @param
|
|
554
|
+
*
|
|
555
|
+
* @param fromPath - The absolute path of the node that added the reference.
|
|
556
|
+
* @param toPath - The absolute path of the outbound node that is referenced.
|
|
491
557
|
*/
|
|
492
|
-
|
|
558
|
+
addedGCOutboundRoute?(fromPath: string, toPath: string): void;
|
|
493
559
|
}
|
|
494
560
|
|
|
495
561
|
/**
|
|
@@ -502,5 +568,5 @@ export interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {
|
|
|
502
568
|
attachRuntime(
|
|
503
569
|
factory: IProvideFluidDataStoreFactory,
|
|
504
570
|
dataStoreRuntime: IFluidDataStoreChannel,
|
|
505
|
-
): Promise<
|
|
571
|
+
): Promise<IDataStore>;
|
|
506
572
|
}
|
package/src/dataStoreFactory.ts
CHANGED
package/src/dataStoreRegistry.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export const gcTreeKey = "gc";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* The prefix for GC blobs in the GC tree in summary.
|
|
14
14
|
*
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
@@ -27,6 +27,12 @@ export const gcTombstoneBlobKey = "__tombstones";
|
|
|
27
27
|
* @internal
|
|
28
28
|
*/
|
|
29
29
|
export const gcDeletedBlobKey = "__deletedNodes";
|
|
30
|
+
/**
|
|
31
|
+
* The key for the GC Data blob in attach summaries.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export const gcDataBlobKey = ".gcdata";
|
|
30
36
|
|
|
31
37
|
/**
|
|
32
38
|
* Garbage collection data returned by nodes in a Container.
|
package/src/index.ts
CHANGED
|
@@ -3,55 +3,54 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export type {
|
|
7
7
|
AttributionInfo,
|
|
8
8
|
AttributionKey,
|
|
9
9
|
DetachedAttributionKey,
|
|
10
10
|
LocalAttributionKey,
|
|
11
11
|
OpAttributionKey,
|
|
12
|
-
} from "./attribution";
|
|
13
|
-
export {
|
|
12
|
+
} from "./attribution.js";
|
|
13
|
+
export type {
|
|
14
14
|
AliasResult,
|
|
15
15
|
CreateChildSummarizerNodeFn,
|
|
16
|
-
FlushMode,
|
|
17
|
-
FlushModeExperimental,
|
|
18
16
|
IContainerRuntimeBase,
|
|
19
17
|
IContainerRuntimeBaseEvents,
|
|
20
18
|
IDataStore,
|
|
21
19
|
IFluidDataStoreChannel,
|
|
22
20
|
IFluidDataStoreContext,
|
|
21
|
+
IFluidParentContext,
|
|
23
22
|
IFluidDataStoreContextDetached,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} from "./
|
|
27
|
-
export { IFluidDataStoreFactory
|
|
28
|
-
export {
|
|
23
|
+
} from "./dataStoreContext.js";
|
|
24
|
+
export { FlushMode, FlushModeExperimental, VisibilityState } from "./dataStoreContext.js";
|
|
25
|
+
export type { IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
|
|
26
|
+
export { IFluidDataStoreFactory } from "./dataStoreFactory.js";
|
|
27
|
+
export type {
|
|
29
28
|
FluidDataStoreRegistryEntry,
|
|
30
|
-
IFluidDataStoreRegistry,
|
|
31
29
|
IProvideFluidDataStoreRegistry,
|
|
32
30
|
NamedFluidDataStoreRegistryEntries,
|
|
33
31
|
NamedFluidDataStoreRegistryEntry,
|
|
34
|
-
} from "./dataStoreRegistry";
|
|
32
|
+
} from "./dataStoreRegistry.js";
|
|
33
|
+
export { IFluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
34
|
+
export type {
|
|
35
|
+
IGarbageCollectionData,
|
|
36
|
+
IGarbageCollectionDetailsBase,
|
|
37
|
+
} from "./garbageCollectionDefinitions.js";
|
|
35
38
|
export {
|
|
36
39
|
gcBlobPrefix,
|
|
40
|
+
gcDataBlobKey,
|
|
37
41
|
gcDeletedBlobKey,
|
|
38
42
|
gcTombstoneBlobKey,
|
|
39
43
|
gcTreeKey,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} from "./garbageCollection";
|
|
43
|
-
export {
|
|
44
|
+
} from "./garbageCollectionDefinitions.js";
|
|
45
|
+
export type {
|
|
44
46
|
IAttachMessage,
|
|
45
47
|
IEnvelope,
|
|
46
48
|
IInboundSignalMessage,
|
|
47
49
|
InboundAttachMessage,
|
|
48
50
|
ISignalEnvelope,
|
|
49
|
-
} from "./protocol";
|
|
50
|
-
export {
|
|
51
|
-
blobCountPropertyName,
|
|
52
|
-
channelsTreeName,
|
|
51
|
+
} from "./protocol.js";
|
|
52
|
+
export type {
|
|
53
53
|
CreateChildSummarizerNodeParam,
|
|
54
|
-
CreateSummarizerNodeSource,
|
|
55
54
|
IExperimentalIncrementalSummaryContext,
|
|
56
55
|
ISummarizeInternalResult,
|
|
57
56
|
ISummarizeResult,
|
|
@@ -63,54 +62,10 @@ export {
|
|
|
63
62
|
ISummaryTreeWithStats,
|
|
64
63
|
ITelemetryContext,
|
|
65
64
|
SummarizeInternalFn,
|
|
66
|
-
|
|
67
|
-
} from "./summary";
|
|
68
|
-
|
|
69
|
-
// Re-exports for backwards compatibility.
|
|
70
|
-
// Will be removed in the future.
|
|
65
|
+
} from "./summary.js";
|
|
71
66
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
78
|
-
*/
|
|
79
|
-
IIdCompressor,
|
|
80
|
-
/**
|
|
81
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
82
|
-
*/
|
|
83
|
-
IIdCompressorCore,
|
|
84
|
-
/**
|
|
85
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
86
|
-
*/
|
|
87
|
-
IdCreationRange,
|
|
88
|
-
/**
|
|
89
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
90
|
-
*/
|
|
91
|
-
OpSpaceCompressedId,
|
|
92
|
-
/**
|
|
93
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
94
|
-
*/
|
|
95
|
-
SerializedIdCompressor,
|
|
96
|
-
/**
|
|
97
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
98
|
-
*/
|
|
99
|
-
SerializedIdCompressorWithNoSession,
|
|
100
|
-
/**
|
|
101
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
102
|
-
*/
|
|
103
|
-
SerializedIdCompressorWithOngoingSession,
|
|
104
|
-
/**
|
|
105
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
106
|
-
*/
|
|
107
|
-
SessionId,
|
|
108
|
-
/**
|
|
109
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
110
|
-
*/
|
|
111
|
-
SessionSpaceCompressedId,
|
|
112
|
-
/**
|
|
113
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
114
|
-
*/
|
|
115
|
-
StableId,
|
|
116
|
-
} from "@fluidframework/id-compressor";
|
|
67
|
+
blobCountPropertyName,
|
|
68
|
+
channelsTreeName,
|
|
69
|
+
CreateSummarizerNodeSource,
|
|
70
|
+
totalBlobSizePropertyName,
|
|
71
|
+
} from "./summary.js";
|
package/src/protocol.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ISignalMessage, ITree } from "@fluidframework/protocol-definitions";
|
|
6
|
+
import type { ISignalMessage, ITree } from "@fluidframework/protocol-definitions";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* An envelope wraps the contents with the intended target
|
|
@@ -23,6 +23,7 @@ export interface IEnvelope {
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @internal
|
|
26
|
+
* @deprecated - This interface is now moved to `@fluidframework/container-definitions` package. Please import from that package.
|
|
26
27
|
*/
|
|
27
28
|
export interface ISignalEnvelope {
|
|
28
29
|
/**
|