@fluidframework/runtime-definitions 2.0.0-rc.1.0.6 → 2.0.0-rc.2.0.1
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 +98 -112
- package/dist/dataStoreContext.d.ts +110 -64
- 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} +1 -1
- package/dist/garbageCollectionDefinitions.d.ts.map +1 -0
- package/dist/{garbageCollection.js → garbageCollectionDefinitions.js} +1 -1
- 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 -27
- 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 +184 -175
- package/dist/runtime-definitions-beta.d.ts +35 -57
- package/dist/runtime-definitions-public.d.ts +35 -57
- package/dist/runtime-definitions-untrimmed.d.ts +185 -175
- 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 +469 -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 +1025 -0
- package/lib/runtime-definitions-beta.d.ts +244 -0
- package/lib/runtime-definitions-public.d.ts +244 -0
- package/lib/runtime-definitions-untrimmed.d.ts +1106 -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 +111 -34
- package/src/dataStoreContext.ts +133 -80
- package/src/dataStoreFactory.ts +1 -1
- package/src/dataStoreRegistry.ts +1 -1
- package/src/index.ts +25 -70
- 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/{garbageCollection.ts → garbageCollectionDefinitions.ts} +0 -0
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,6 +169,7 @@ 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
|
|
@@ -180,14 +183,15 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
180
183
|
* Submits a container runtime level signal to be sent to other clients.
|
|
181
184
|
* @param type - Type of the signal.
|
|
182
185
|
* @param content - Content of the signal.
|
|
186
|
+
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
183
187
|
*/
|
|
184
|
-
submitSignal(type: string, content: any): void;
|
|
188
|
+
submitSignal(type: string, content: any, targetClientId?: string): void;
|
|
185
189
|
|
|
186
190
|
/**
|
|
187
191
|
* @deprecated 0.16 Issue #1537, #3631
|
|
188
192
|
*/
|
|
189
193
|
_createDataStoreWithProps(
|
|
190
|
-
pkg: string | string[]
|
|
194
|
+
pkg: Readonly<string | string[]>,
|
|
191
195
|
props?: any,
|
|
192
196
|
id?: string,
|
|
193
197
|
): Promise<IDataStore>;
|
|
@@ -199,14 +203,24 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
199
203
|
* already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this
|
|
200
204
|
* store being attached to storage.
|
|
201
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}
|
|
202
209
|
*/
|
|
203
|
-
createDataStore(pkg: string | string[]): Promise<IDataStore>;
|
|
210
|
+
createDataStore(pkg: Readonly<string | string[]>, loadingGroupId?: string): Promise<IDataStore>;
|
|
204
211
|
|
|
205
212
|
/**
|
|
206
213
|
* Creates detached data store context. Only after context.attachRuntime() is called,
|
|
207
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}.
|
|
208
219
|
*/
|
|
209
|
-
createDetachedDataStore(
|
|
220
|
+
createDetachedDataStore(
|
|
221
|
+
pkg: Readonly<string[]>,
|
|
222
|
+
loadingGroupId?: string,
|
|
223
|
+
): IFluidDataStoreContextDetached;
|
|
210
224
|
|
|
211
225
|
/**
|
|
212
226
|
* Get an absolute url for a provided container-relative request.
|
|
@@ -226,6 +240,30 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
226
240
|
* Returns the current audience.
|
|
227
241
|
*/
|
|
228
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 }>;
|
|
229
267
|
}
|
|
230
268
|
|
|
231
269
|
/**
|
|
@@ -236,21 +274,6 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
236
274
|
* @alpha
|
|
237
275
|
*/
|
|
238
276
|
export interface IFluidDataStoreChannel extends IDisposable {
|
|
239
|
-
readonly id: string;
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Indicates the attachment state of the channel to a host service.
|
|
243
|
-
*/
|
|
244
|
-
readonly attachState: AttachState;
|
|
245
|
-
|
|
246
|
-
readonly visibilityState: VisibilityState;
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Runs through the graph and attaches the bound handles. Then binds this runtime to the container.
|
|
250
|
-
* @deprecated This will be removed in favor of {@link IFluidDataStoreChannel.makeVisibleAndAttachGraph}.
|
|
251
|
-
*/
|
|
252
|
-
attachGraph(): void;
|
|
253
|
-
|
|
254
277
|
/**
|
|
255
278
|
* Makes the data store channel visible in the container. Also, runs through its graph and attaches all
|
|
256
279
|
* bound handles that represent its dependencies in the container's graph.
|
|
@@ -270,12 +293,17 @@ export interface IFluidDataStoreChannel extends IDisposable {
|
|
|
270
293
|
/**
|
|
271
294
|
* Processes the op.
|
|
272
295
|
*/
|
|
273
|
-
process(
|
|
296
|
+
process(
|
|
297
|
+
message: ISequencedDocumentMessage,
|
|
298
|
+
local: boolean,
|
|
299
|
+
localOpMetadata: unknown,
|
|
300
|
+
addedOutboundReference?: (fromNodePath: string, toNodePath: string) => void,
|
|
301
|
+
): void;
|
|
274
302
|
|
|
275
303
|
/**
|
|
276
304
|
* Processes the signal.
|
|
277
305
|
*/
|
|
278
|
-
processSignal(message:
|
|
306
|
+
processSignal(message: IInboundSignalMessage, local: boolean): void;
|
|
279
307
|
|
|
280
308
|
/**
|
|
281
309
|
* Generates a summary for the channel.
|
|
@@ -358,37 +386,29 @@ export interface IFluidDataStoreContextEvents extends IEvent {
|
|
|
358
386
|
}
|
|
359
387
|
|
|
360
388
|
/**
|
|
361
|
-
* Represents the context for the data store. It is used by the data store runtime to
|
|
362
|
-
* get information and call functionality to
|
|
389
|
+
* Represents the context for the data store like objects. It is used by the data store runtime to
|
|
390
|
+
* get information and call functionality to its parent.
|
|
391
|
+
*
|
|
392
|
+
* This layout is temporary, as {@link IFluidParentContext} and {@link IFluidDataStoreContext} will converge.
|
|
393
|
+
*
|
|
363
394
|
* @alpha
|
|
364
395
|
*/
|
|
365
|
-
export interface
|
|
366
|
-
extends
|
|
367
|
-
Partial<IProvideFluidDataStoreRegistry
|
|
368
|
-
|
|
369
|
-
readonly id: string;
|
|
370
|
-
/**
|
|
371
|
-
* A data store created by a client, is a local data store for that client. Also, when a detached container loads
|
|
372
|
-
* from a snapshot, all the data stores are treated as local data stores because at that stage the container
|
|
373
|
-
* still doesn't exists in storage and so the data store couldn't have been created by any other client.
|
|
374
|
-
* Value of this never changes even after the data store is attached.
|
|
375
|
-
* As implementer of data store runtime, you can use this property to check that this data store belongs to this
|
|
376
|
-
* client and hence implement any scenario based on that.
|
|
377
|
-
*/
|
|
378
|
-
readonly isLocalDataStore: boolean;
|
|
379
|
-
/**
|
|
380
|
-
* The package path of the data store as per the package factory.
|
|
381
|
-
*/
|
|
382
|
-
readonly packagePath: readonly string[];
|
|
383
|
-
readonly options: ILoaderOptions;
|
|
396
|
+
export interface IFluidParentContext
|
|
397
|
+
extends IProvideFluidHandleContext,
|
|
398
|
+
Partial<IProvideFluidDataStoreRegistry> {
|
|
399
|
+
readonly options: Record<string | number, any>;
|
|
384
400
|
readonly clientId: string | undefined;
|
|
385
401
|
readonly connected: boolean;
|
|
386
402
|
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
387
403
|
readonly storage: IDocumentStorageService;
|
|
388
|
-
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
389
404
|
readonly logger: ITelemetryBaseLogger;
|
|
390
405
|
readonly clientDetails: IClientDetails;
|
|
391
406
|
readonly idCompressor?: IIdCompressor;
|
|
407
|
+
/**
|
|
408
|
+
* Represents the loading group to which the data store belongs to. Please refer to this readme for more context.
|
|
409
|
+
* {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}
|
|
410
|
+
*/
|
|
411
|
+
readonly loadingGroupId?: string;
|
|
392
412
|
/**
|
|
393
413
|
* Indicates the attachment state of the data store to a host service.
|
|
394
414
|
*/
|
|
@@ -396,16 +416,14 @@ export interface IFluidDataStoreContext
|
|
|
396
416
|
|
|
397
417
|
readonly containerRuntime: IContainerRuntimeBase;
|
|
398
418
|
|
|
399
|
-
/**
|
|
400
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
401
|
-
*/
|
|
402
|
-
readonly createProps?: any;
|
|
403
|
-
|
|
404
419
|
/**
|
|
405
420
|
* Ambient services provided with the context
|
|
406
421
|
*/
|
|
407
422
|
readonly scope: FluidObject;
|
|
408
423
|
|
|
424
|
+
readonly gcThrowOnTombstoneUsage: boolean;
|
|
425
|
+
readonly gcTombstoneEnforcementAllowed: boolean;
|
|
426
|
+
|
|
409
427
|
/**
|
|
410
428
|
* Returns the current quorum.
|
|
411
429
|
*/
|
|
@@ -450,12 +468,6 @@ export interface IFluidDataStoreContext
|
|
|
450
468
|
*/
|
|
451
469
|
makeLocallyVisible(): void;
|
|
452
470
|
|
|
453
|
-
/**
|
|
454
|
-
* Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.
|
|
455
|
-
* @param address - The address of the channel that is dirty.
|
|
456
|
-
*/
|
|
457
|
-
setChannelDirty(address: string): void;
|
|
458
|
-
|
|
459
471
|
/**
|
|
460
472
|
* Get an absolute url to the container based on the provided relativeUrl.
|
|
461
473
|
* Returns undefined if the container or data store isn't attached to storage.
|
|
@@ -477,15 +489,9 @@ export interface IFluidDataStoreContext
|
|
|
477
489
|
createParam: CreateChildSummarizerNodeParam,
|
|
478
490
|
): CreateChildSummarizerNodeFn;
|
|
479
491
|
|
|
480
|
-
|
|
492
|
+
deleteChildSummarizerNode?(id: string): void;
|
|
481
493
|
|
|
482
|
-
|
|
483
|
-
* @deprecated The functionality to get base GC details has been moved to summarizer node.
|
|
484
|
-
*
|
|
485
|
-
* Returns the GC details in the initial summary of this data store. This is used to initialize the data store
|
|
486
|
-
* and its children with the GC details from the previous summary.
|
|
487
|
-
*/
|
|
488
|
-
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
494
|
+
uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
|
|
489
495
|
|
|
490
496
|
/**
|
|
491
497
|
* @deprecated There is no replacement for this, its functionality is no longer needed at this layer.
|
|
@@ -498,7 +504,54 @@ export interface IFluidDataStoreContext
|
|
|
498
504
|
* @param srcHandle - The handle of the node that added the reference.
|
|
499
505
|
* @param outboundHandle - The handle of the outbound node that is referenced.
|
|
500
506
|
*/
|
|
501
|
-
addedGCOutboundReference?(
|
|
507
|
+
addedGCOutboundReference?(
|
|
508
|
+
srcHandle: { absolutePath: string },
|
|
509
|
+
outboundHandle: { absolutePath: string },
|
|
510
|
+
): void;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Represents the context for the data store. It is used by the data store runtime to
|
|
515
|
+
* get information and call functionality to the container.
|
|
516
|
+
* @alpha
|
|
517
|
+
*/
|
|
518
|
+
export interface IFluidDataStoreContext
|
|
519
|
+
extends IEventProvider<IFluidDataStoreContextEvents>,
|
|
520
|
+
IFluidParentContext {
|
|
521
|
+
readonly id: string;
|
|
522
|
+
/**
|
|
523
|
+
* A data store created by a client, is a local data store for that client. Also, when a detached container loads
|
|
524
|
+
* from a snapshot, all the data stores are treated as local data stores because at that stage the container
|
|
525
|
+
* still doesn't exists in storage and so the data store couldn't have been created by any other client.
|
|
526
|
+
* Value of this never changes even after the data store is attached.
|
|
527
|
+
* As implementer of data store runtime, you can use this property to check that this data store belongs to this
|
|
528
|
+
* client and hence implement any scenario based on that.
|
|
529
|
+
*/
|
|
530
|
+
readonly isLocalDataStore: boolean;
|
|
531
|
+
/**
|
|
532
|
+
* The package path of the data store as per the package factory.
|
|
533
|
+
*/
|
|
534
|
+
readonly packagePath: readonly string[];
|
|
535
|
+
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* @deprecated 0.16 Issue #1635, #3631
|
|
539
|
+
*/
|
|
540
|
+
readonly createProps?: any;
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.
|
|
544
|
+
* @param address - The address of the channel that is dirty.
|
|
545
|
+
*/
|
|
546
|
+
setChannelDirty(address: string): void;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* @deprecated The functionality to get base GC details has been moved to summarizer node.
|
|
550
|
+
*
|
|
551
|
+
* Returns the GC details in the initial summary of this data store. This is used to initialize the data store
|
|
552
|
+
* and its children with the GC details from the previous summary.
|
|
553
|
+
*/
|
|
554
|
+
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
502
555
|
|
|
503
556
|
/**
|
|
504
557
|
* (Same as @see addedGCOutboundReference, but with string paths instead of handles)
|
|
@@ -522,5 +575,5 @@ export interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {
|
|
|
522
575
|
attachRuntime(
|
|
523
576
|
factory: IProvideFluidDataStoreFactory,
|
|
524
577
|
dataStoreRuntime: IFluidDataStoreChannel,
|
|
525
|
-
): Promise<
|
|
578
|
+
): Promise<IDataStore>;
|
|
526
579
|
}
|
package/src/dataStoreFactory.ts
CHANGED
package/src/dataStoreRegistry.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -3,56 +3,55 @@
|
|
|
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
23
|
IFluidDataStoreContextEvents,
|
|
25
|
-
|
|
26
|
-
} from "./dataStoreContext";
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
24
|
+
} from "./dataStoreContext.js";
|
|
25
|
+
export { FlushMode, FlushModeExperimental, VisibilityState } from "./dataStoreContext.js";
|
|
26
|
+
export type { IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
|
|
27
|
+
export { IFluidDataStoreFactory } from "./dataStoreFactory.js";
|
|
28
|
+
export type {
|
|
29
29
|
FluidDataStoreRegistryEntry,
|
|
30
|
-
IFluidDataStoreRegistry,
|
|
31
30
|
IProvideFluidDataStoreRegistry,
|
|
32
31
|
NamedFluidDataStoreRegistryEntries,
|
|
33
32
|
NamedFluidDataStoreRegistryEntry,
|
|
34
|
-
} from "./dataStoreRegistry";
|
|
33
|
+
} from "./dataStoreRegistry.js";
|
|
34
|
+
export { IFluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
35
|
+
export type {
|
|
36
|
+
IGarbageCollectionData,
|
|
37
|
+
IGarbageCollectionDetailsBase,
|
|
38
|
+
} from "./garbageCollectionDefinitions.js";
|
|
35
39
|
export {
|
|
36
40
|
gcBlobPrefix,
|
|
37
41
|
gcDataBlobKey,
|
|
38
42
|
gcDeletedBlobKey,
|
|
39
43
|
gcTombstoneBlobKey,
|
|
40
44
|
gcTreeKey,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} from "./garbageCollection";
|
|
44
|
-
export {
|
|
45
|
+
} from "./garbageCollectionDefinitions.js";
|
|
46
|
+
export type {
|
|
45
47
|
IAttachMessage,
|
|
46
48
|
IEnvelope,
|
|
47
49
|
IInboundSignalMessage,
|
|
48
50
|
InboundAttachMessage,
|
|
49
51
|
ISignalEnvelope,
|
|
50
|
-
} from "./protocol";
|
|
51
|
-
export {
|
|
52
|
-
blobCountPropertyName,
|
|
53
|
-
channelsTreeName,
|
|
52
|
+
} from "./protocol.js";
|
|
53
|
+
export type {
|
|
54
54
|
CreateChildSummarizerNodeParam,
|
|
55
|
-
CreateSummarizerNodeSource,
|
|
56
55
|
IExperimentalIncrementalSummaryContext,
|
|
57
56
|
ISummarizeInternalResult,
|
|
58
57
|
ISummarizeResult,
|
|
@@ -64,54 +63,10 @@ export {
|
|
|
64
63
|
ISummaryTreeWithStats,
|
|
65
64
|
ITelemetryContext,
|
|
66
65
|
SummarizeInternalFn,
|
|
67
|
-
|
|
68
|
-
} from "./summary";
|
|
69
|
-
|
|
70
|
-
// Re-exports for backwards compatibility.
|
|
71
|
-
// Will be removed in the future.
|
|
66
|
+
} from "./summary.js";
|
|
72
67
|
export {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
79
|
-
*/
|
|
80
|
-
IIdCompressor,
|
|
81
|
-
/**
|
|
82
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
83
|
-
*/
|
|
84
|
-
IIdCompressorCore,
|
|
85
|
-
/**
|
|
86
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
87
|
-
*/
|
|
88
|
-
IdCreationRange,
|
|
89
|
-
/**
|
|
90
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
91
|
-
*/
|
|
92
|
-
OpSpaceCompressedId,
|
|
93
|
-
/**
|
|
94
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
95
|
-
*/
|
|
96
|
-
SerializedIdCompressor,
|
|
97
|
-
/**
|
|
98
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
99
|
-
*/
|
|
100
|
-
SerializedIdCompressorWithNoSession,
|
|
101
|
-
/**
|
|
102
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
103
|
-
*/
|
|
104
|
-
SerializedIdCompressorWithOngoingSession,
|
|
105
|
-
/**
|
|
106
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
107
|
-
*/
|
|
108
|
-
SessionId,
|
|
109
|
-
/**
|
|
110
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
111
|
-
*/
|
|
112
|
-
SessionSpaceCompressedId,
|
|
113
|
-
/**
|
|
114
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
115
|
-
*/
|
|
116
|
-
StableId,
|
|
117
|
-
} from "@fluidframework/id-compressor";
|
|
68
|
+
blobCountPropertyName,
|
|
69
|
+
channelsTreeName,
|
|
70
|
+
CreateSummarizerNodeSource,
|
|
71
|
+
totalBlobSizePropertyName,
|
|
72
|
+
} 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
|
/**
|
package/src/summary.ts
CHANGED
|
@@ -3,15 +3,18 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import type { TelemetryBaseEventPropertyType } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type {
|
|
8
8
|
SummaryTree,
|
|
9
9
|
ISummaryTree,
|
|
10
10
|
ISequencedDocumentMessage,
|
|
11
11
|
ISnapshotTree,
|
|
12
12
|
ITree,
|
|
13
13
|
} from "@fluidframework/protocol-definitions";
|
|
14
|
-
import {
|
|
14
|
+
import type {
|
|
15
|
+
IGarbageCollectionData,
|
|
16
|
+
IGarbageCollectionDetailsBase,
|
|
17
|
+
} from "./garbageCollectionDefinitions.js";
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
* Contains the aggregation data from a Tree/Subtree.
|
|
@@ -125,16 +128,6 @@ export interface ISummarizerNodeConfig {
|
|
|
125
128
|
* Defaults to true.
|
|
126
129
|
*/
|
|
127
130
|
readonly canReuseHandle?: boolean;
|
|
128
|
-
/**
|
|
129
|
-
* True to always stop execution on error during summarize, or false to
|
|
130
|
-
* attempt creating a summary that is a pointer ot the last acked summary
|
|
131
|
-
* plus outstanding ops in case of internal summarize failure.
|
|
132
|
-
* Defaults to false.
|
|
133
|
-
*
|
|
134
|
-
* BUG BUG: Default to true while we investigate problem
|
|
135
|
-
* with differential summaries
|
|
136
|
-
*/
|
|
137
|
-
readonly throwOnFailure?: true;
|
|
138
131
|
}
|
|
139
132
|
|
|
140
133
|
/**
|
|
@@ -187,9 +180,6 @@ export interface ISummarizerNode {
|
|
|
187
180
|
invalidate(sequenceNumber: number): void;
|
|
188
181
|
/**
|
|
189
182
|
* Calls the internal summarize function and handles internal state tracking.
|
|
190
|
-
* If unchanged and fullTree is false, it will reuse previous summary subtree.
|
|
191
|
-
* If an error is encountered and throwOnFailure is false, it will try to make
|
|
192
|
-
* a summary with a pointer to the previous summary + a blob of outstanding ops.
|
|
193
183
|
* @param fullTree - true to skip optimizations and always generate the full tree
|
|
194
184
|
* @param trackState - indicates whether the summarizer node should track the state of the summary or not
|
|
195
185
|
* @param telemetryContext - summary data passed through the layers for telemetry purposes
|
|
@@ -238,7 +228,9 @@ export interface ISummarizerNode {
|
|
|
238
228
|
|
|
239
229
|
getChild(id: string): ISummarizerNode | undefined;
|
|
240
230
|
|
|
241
|
-
/**
|
|
231
|
+
/**
|
|
232
|
+
* True if a summary is currently in progress
|
|
233
|
+
*/
|
|
242
234
|
isSummaryInProgress?(): boolean;
|
|
243
235
|
}
|
|
244
236
|
|
|
@@ -339,7 +331,7 @@ export interface ITelemetryContext {
|
|
|
339
331
|
* @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
|
|
340
332
|
* @param value - value to attribute to this summary telemetry data
|
|
341
333
|
*/
|
|
342
|
-
set(prefix: string, property: string, value:
|
|
334
|
+
set(prefix: string, property: string, value: TelemetryBaseEventPropertyType): void;
|
|
343
335
|
|
|
344
336
|
/**
|
|
345
337
|
* Sets multiple values for telemetry data being tracked.
|
|
@@ -350,20 +342,26 @@ export interface ITelemetryContext {
|
|
|
350
342
|
setMultiple(
|
|
351
343
|
prefix: string,
|
|
352
344
|
property: string,
|
|
353
|
-
values: Record<string,
|
|
345
|
+
values: Record<string, TelemetryBaseEventPropertyType>,
|
|
354
346
|
): void;
|
|
355
347
|
|
|
356
348
|
/**
|
|
357
349
|
* Get the telemetry data being tracked
|
|
350
|
+
*
|
|
351
|
+
* @deprecated This interface should only be used for instrumenting, not for attempting to read already-set telemetry data.
|
|
352
|
+
*
|
|
358
353
|
* @param prefix - unique prefix for this data (ex: "fluid:map:")
|
|
359
354
|
* @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
|
|
360
355
|
* @returns undefined if item not found
|
|
361
356
|
*/
|
|
362
|
-
get(prefix: string, property: string):
|
|
357
|
+
get(prefix: string, property: string): TelemetryBaseEventPropertyType;
|
|
363
358
|
|
|
364
359
|
/**
|
|
365
360
|
* Returns a serialized version of all the telemetry data.
|
|
366
361
|
* Should be used when logging in telemetry events.
|
|
362
|
+
*
|
|
363
|
+
* @deprecated This interface should only be used for instrumenting. A concrete implementation will likely have a serialize function
|
|
364
|
+
* but this functionality should not be used by other code being given an ITelemetryContext.
|
|
367
365
|
*/
|
|
368
366
|
serialize(): string;
|
|
369
367
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends":
|
|
3
|
-
"../../../common/build/build-common/tsconfig.base.json",
|
|
4
|
-
"../../../common/build/build-common/tsconfig.esm-only.json",
|
|
5
|
-
],
|
|
2
|
+
"extends": "../../../common/build/build-common/tsconfig.node16.json",
|
|
6
3
|
"include": ["src/**/*"],
|
|
7
4
|
"exclude": ["src/test/**/*"],
|
|
8
5
|
"compilerOptions": {
|
|
9
6
|
"rootDir": "./src",
|
|
10
|
-
"outDir": "./
|
|
7
|
+
"outDir": "./lib",
|
|
11
8
|
},
|
|
12
9
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollection.d.ts","sourceRoot":"","sources":["../src/garbageCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,eAAO,MAAM,SAAS,OAAO,CAAC;AAC9B;;;;GAIG;AACH,eAAO,MAAM,YAAY,SAAS,CAAC;AACnC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AACjD;;;;GAIG;AACH,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,OAAO,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,sBAAsB,CAAC;CAChC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollection.js","sourceRoot":"","sources":["../src/garbageCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AACU,QAAA,SAAS,GAAG,IAAI,CAAC;AAC9B;;;;GAIG;AACU,QAAA,YAAY,GAAG,MAAM,CAAC;AACnC;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,cAAc,CAAC;AACjD;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,gBAAgB,CAAC;AACjD;;;;GAIG;AACU,QAAA,aAAa,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The key for the GC tree in summary.\n *\n * @internal\n */\nexport const gcTreeKey = \"gc\";\n/**\n * The prefix for GC blobs in the GC tree in summary.\n *\n * @internal\n */\nexport const gcBlobPrefix = \"__gc\";\n/**\n * The key for tombstone blob in the GC tree in summary.\n *\n * @internal\n */\nexport const gcTombstoneBlobKey = \"__tombstones\";\n/**\n * The key for deleted nodes blob in the GC tree in summary.\n *\n * @internal\n */\nexport const gcDeletedBlobKey = \"__deletedNodes\";\n/**\n * The key for the GC Data blob in attach summaries.\n *\n * @internal\n */\nexport const gcDataBlobKey = \".gcdata\";\n\n/**\n * Garbage collection data returned by nodes in a Container.\n * Used for running GC in the Container.\n * @public\n */\nexport interface IGarbageCollectionData {\n\t/**\n\t * The GC nodes of a Fluid object in the Container. Each node has an id and a set of routes to other GC nodes.\n\t */\n\tgcNodes: { [id: string]: string[] };\n}\n\n/**\n * GC details provided to each node during creation.\n * @alpha\n */\nexport interface IGarbageCollectionDetailsBase {\n\t/**\n\t * A list of routes to Fluid objects that are used in this node.\n\t */\n\tusedRoutes?: string[];\n\t/**\n\t * The GC data of this node.\n\t */\n\tgcData?: IGarbageCollectionData;\n}\n"]}
|
|
File without changes
|