@fluidframework/runtime-definitions 2.10.0 → 2.11.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,67 @@
1
1
  # @fluidframework/runtime-definitions
2
2
 
3
+ ## 2.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Synchronous Child Datastore Creation ([#23143](https://github.com/microsoft/FluidFramework/pull/23143)) [3426b434df](https://github.com/microsoft/FluidFramework/commit/3426b434dfa06de3ee1a60a5f0d605cd312f2c58)
8
+
9
+ #### Overview
10
+
11
+ This feature introduces a new pattern for creating datastores synchronously within the Fluid Framework. It allows for the synchronous creation of a child datastore from an existing datastore, provided that the child datastore is available synchronously via the existing datastore's registry and that the child's factory supports synchronous creation. This method also ensures strong typing for the consumer.
12
+
13
+ In this context, "child" refers specifically to the organization of factories and registries, not to any hierarchical or hosting relationship between datastores. The parent datastore does not control the runtime behaviors of the child datastore beyond its creation.
14
+
15
+ The synchronous creation of child datastores enhances the flexibility of datastore management within the Fluid Framework. It ensures type safety and provides a different way to manage datastores within a container. However, it is important to consider the overhead associated with datastores, as they are stored, summarized, garbage collected, loaded, and referenced independently. This overhead should be justified by the scenario's requirements.
16
+
17
+ Datastores offer increased capabilities, such as the ability to reference them via handles, allowing multiple references to exist and enabling those references to be moved, swapped, or changed. Additionally, datastores are garbage collected after becoming unreferenced, which can simplify final cleanup across clients. This is in contrast to subdirectories in a shared directory, which do not have native capabilities for referencing or garbage collection but are very low overhead to create.
18
+
19
+ Synchronous creation relies on both the factory and the datastore to support it. This means that asynchronous operations, such as resolving handles, some browser API calls, consensus-based operations, or other asynchronous tasks, cannot be performed during the creation flow. Therefore, synchronous child datastore creation is best limited to scenarios where the existing asynchronous process cannot be used, such as when a new datastore must be created in direct response to synchronous user input.
20
+
21
+ #### Key Benefits
22
+
23
+ - **Synchronous Creation**: Allows for the immediate creation of child datastores without waiting for asynchronous operations.
24
+ - **Strong Typing**: Ensures type safety and better developer experience by leveraging TypeScript's type system.
25
+
26
+ #### Use Cases
27
+
28
+ ##### Example 1: Creating a Child Datastore
29
+
30
+ In this example, we demonstrate how to support creating a child datastore synchronously from a parent datastore.
31
+
32
+ ```typescript
33
+ /**
34
+ * This is the parent DataObject, which is also a datastore. It has a
35
+ * synchronous method to create child datastores, which could be called
36
+ * in response to synchronous user input, like a key press.
37
+ */
38
+ class ParentDataObject extends DataObject {
39
+ createChild(name: string): ChildDataStore {
40
+ assert(
41
+ this.context.createChildDataStore !== undefined,
42
+ "this.context.createChildDataStore",
43
+ );
44
+
45
+ const { entrypoint } = this.context.createChildDataStore(
46
+ ChildDataStoreFactory.instance,
47
+ );
48
+ const dir = this.root.createSubDirectory("children");
49
+ dir.set(name, entrypoint.handle);
50
+ entrypoint.setProperty("childValue", name);
51
+
52
+ return entrypoint;
53
+ }
54
+
55
+ getChild(name: string): IFluidHandle<ChildDataStore> | undefined {
56
+ const dir = this.root.getSubDirectory("children");
57
+ return dir?.get<IFluidHandle<ChildDataStore>>(name);
58
+ }
59
+ }
60
+ ```
61
+
62
+ For a complete example see the following test:
63
+ https://github.com/microsoft/FluidFramework/blob/main/packages/test/local-server-tests/src/test/synchronousDataStoreCreation.spec.ts
64
+
3
65
  ## 2.10.0
4
66
 
5
67
  ### Minor Changes
@@ -150,6 +150,7 @@ export interface IFluidDataStoreChannel extends IDisposable {
150
150
  export interface IFluidDataStoreContext extends IFluidParentContext {
151
151
  // (undocumented)
152
152
  readonly baseSnapshot: ISnapshotTree | undefined;
153
+ createChildDataStore?<T extends IFluidDataStoreFactory>(childFactory: T): ReturnType<Exclude<T["createDataStore"], undefined>>;
153
154
  // @deprecated (undocumented)
154
155
  readonly createProps?: any;
155
156
  // @deprecated (undocumented)
@@ -170,6 +171,9 @@ export const IFluidDataStoreFactory: keyof IProvideFluidDataStoreFactory;
170
171
 
171
172
  // @alpha
172
173
  export interface IFluidDataStoreFactory extends IProvideFluidDataStoreFactory {
174
+ createDataStore?(context: IFluidDataStoreContext): {
175
+ readonly runtime: IFluidDataStoreChannel;
176
+ };
173
177
  instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<IFluidDataStoreChannel>;
174
178
  type: string;
175
179
  }
@@ -179,8 +183,8 @@ export const IFluidDataStoreRegistry: keyof IProvideFluidDataStoreRegistry;
179
183
 
180
184
  // @alpha
181
185
  export interface IFluidDataStoreRegistry extends IProvideFluidDataStoreRegistry {
182
- // (undocumented)
183
186
  get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
187
+ getSync?(name: string): FluidDataStoreRegistryEntry | undefined;
184
188
  }
185
189
 
186
190
  // @alpha
@@ -375,11 +379,17 @@ export interface LocalAttributionKey {
375
379
  }
376
380
 
377
381
  // @alpha
378
- export type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry>;
382
+ export type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry2>;
379
383
 
380
384
  // @alpha
381
385
  export type NamedFluidDataStoreRegistryEntry = [string, Promise<FluidDataStoreRegistryEntry>];
382
386
 
387
+ // @alpha
388
+ export type NamedFluidDataStoreRegistryEntry2 = [
389
+ string,
390
+ Promise<FluidDataStoreRegistryEntry> | FluidDataStoreRegistryEntry
391
+ ];
392
+
383
393
  // @alpha
384
394
  export interface OpAttributionKey {
385
395
  seq: number;
@@ -9,7 +9,7 @@ import type { IFluidHandleInternal, IProvideFluidHandleContext } from "@fluidfra
9
9
  import type { IClientDetails, IQuorumClients } from "@fluidframework/driver-definitions";
10
10
  import type { IDocumentStorageService, IDocumentMessage, ISnapshotTree, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
11
11
  import type { IIdCompressor } from "@fluidframework/id-compressor";
12
- import type { IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
12
+ import type { IFluidDataStoreFactory, IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
13
13
  import type { IProvideFluidDataStoreRegistry } from "./dataStoreRegistry.js";
14
14
  import type { IGarbageCollectionData, IGarbageCollectionDetailsBase } from "./garbageCollectionDefinitions.js";
15
15
  import type { IInboundSignalMessage, IRuntimeMessageCollection } from "./protocol.js";
@@ -477,6 +477,25 @@ export interface IFluidDataStoreContext extends IFluidParentContext {
477
477
  * and its children with the GC details from the previous summary.
478
478
  */
479
479
  getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
480
+ /**
481
+ * Synchronously creates a detached child data store.
482
+ *
483
+ * The `createChildDataStore` method allows for the synchronous creation of a detached child data store. This is particularly
484
+ * useful in scenarios where immediate availability of the child data store is required, such as during the initialization
485
+ * of a parent data store, or when creation is in response to synchronous user input.
486
+ *
487
+ * In order for this function to succeed:
488
+ * 1. The parent data store's factory must also be an `IFluidDataStoreRegistry`.
489
+ * 2. The parent data store's registry must include the same instance as the provided child factory.
490
+ * 3. The parent data store's registry must synchronously provide the child factory via the `getSync` method.
491
+ * 4. The child factory must implement the `createDataStore` method.
492
+ *
493
+ * These invariants ensure that the child data store can also be created by a remote client running the same code as this client.
494
+ *
495
+ * @param childFactory - The factory of the data store to be created.
496
+ * @returns The created data store channel.
497
+ */
498
+ createChildDataStore?<T extends IFluidDataStoreFactory>(childFactory: T): ReturnType<Exclude<T["createDataStore"], undefined>>;
480
499
  }
481
500
  /**
482
501
  * @legacy
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreContext.d.ts","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EACX,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,oBAAoB,EACpB,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AAE,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,aAAa,GAAG,SAAS,CAAC;IAEjD;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,GAAG,CAAC;IAE3B;;;;;OAKG;IACH,gBAAgB,IAAI,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAE3D;;;;;;;;;;;;;;;;;OAiBG;IACH,oBAAoB,CAAC,CAAC,CAAC,SAAS,sBAAsB,EACrD,YAAY,EAAE,CAAC,GACb,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;CACxD;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA+B,SAAQ,sBAAsB;IAC7E;;OAEG;IACH,aAAa,CACZ,OAAO,EAAE,6BAA6B,EACtC,gBAAgB,EAAE,sBAAsB,GACtC,OAAO,CAAC,UAAU,CAAC,CAAC;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA0CH;;;;GAIG;AACH,IAAY,SAcX;AAdD,WAAY,SAAS;IACpB;;;;;OAKG;IACH,mDAAS,CAAA;IAET;;;OAGG;IACH,mDAAS,CAAA;AACV,CAAC,EAdW,SAAS,yBAAT,SAAS,QAcpB;AAED;;GAEG;AACH,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAChC;;;;;;;;OAQG;IACH,mEAAS,CAAA;AACV,CAAC,EAXW,qBAAqB,qCAArB,qBAAqB,QAWhC;AAED;;;;;GAKG;AACU,QAAA,eAAe,GAAG;IAC9B;;OAEG;IACH,UAAU,EAAE,YAAY;IAExB;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;;;;;OAQG;IACH,eAAe,EAAE,iBAAiB;CAClC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { AttachState, IAudience } from \"@fluidframework/container-definitions\";\nimport type { IDeltaManager } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIDisposable,\n\tIEvent,\n\tIEventProvider,\n\tIFluidHandle,\n\tIRequest,\n\tIResponse,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIProvideFluidHandleContext,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentStorageService,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport type { IProvideFluidDataStoreFactory } from \"./dataStoreFactory.js\";\nimport type { IProvideFluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nimport type {\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n} from \"./garbageCollectionDefinitions.js\";\nimport type { IInboundSignalMessage, IRuntimeMessageCollection } from \"./protocol.js\";\nimport type {\n\tCreateChildSummarizerNodeParam,\n\tISummarizerNodeWithGC,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tSummarizeInternalFn,\n} from \"./summary.js\";\n\n/**\n * Runtime flush mode handling\n * @legacy\n * @alpha\n */\nexport enum FlushMode {\n\t/**\n\t * In Immediate flush mode the runtime will immediately send all operations to the driver layer.\n\t *\n\t * @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.\n\t * See https://github.com/microsoft/FluidFramework/tree/main/packages/runtime/container-runtime/src/opLifecycle#how-batching-works\n\t */\n\tImmediate,\n\n\t/**\n\t * When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single\n\t * batch at the end of the turn. The flush call on the runtime can be used to force send the current batch.\n\t */\n\tTurnBased,\n}\n\n/**\n * @internal\n */\nexport enum FlushModeExperimental {\n\t/**\n\t * When in Async flush mode, the runtime will accumulate all operations across JS turns and send them as a single\n\t * batch when all micro-tasks are complete.\n\t *\n\t * This feature requires a version of the loader which supports reference sequence numbers. If an older version of\n\t * the loader is used, the runtime will fall back on FlushMode.TurnBased.\n\t *\n\t * @experimental - Not ready for use\n\t */\n\tAsync = 2,\n}\n\n/**\n * This tells the visibility state of a Fluid object. It basically tracks whether the object is not visible, visible\n * locally within the container only or visible globally to all clients.\n * @legacy\n * @alpha\n */\nexport const VisibilityState = {\n\t/**\n\t * Indicates that the object is not visible. This is the state when an object is first created.\n\t */\n\tNotVisible: \"NotVisible\",\n\n\t/**\n\t * Indicates that the object is visible locally within the container. This is the state when an object is attached\n\t * to the container's graph but the container itself isn't globally visible. The object's state goes from not\n\t * visible to locally visible.\n\t */\n\tLocallyVisible: \"LocallyVisible\",\n\n\t/**\n\t * Indicates that the object is visible globally to all clients. This is the state of an object in 2 scenarios:\n\t *\n\t * 1. It is attached to the container's graph when the container is globally visible. The object's state goes from\n\t * not visible to globally visible.\n\t *\n\t * 2. When a container becomes globally visible, all locally visible objects go from locally visible to globally\n\t * visible.\n\t */\n\tGloballyVisible: \"GloballyVisible\",\n};\n/**\n * @legacy\n * @alpha\n */\nexport type VisibilityState = (typeof VisibilityState)[keyof typeof VisibilityState];\n\n/**\n * @legacy\n * @alpha\n * @sealed\n */\nexport interface IContainerRuntimeBaseEvents extends IEvent {\n\t/**\n\t * Indicates the beginning of an incoming batch of ops\n\t * @param op - The first op in the batch. Can be inspected to learn about the sequence numbers relevant for this batch.\n\t */\n\t(event: \"batchBegin\", listener: (op: Omit<ISequencedDocumentMessage, \"contents\">) => void);\n\t/**\n\t * Indicates the end of an incoming batch of ops\n\t * @param error - If an error occurred while processing the batch, it is provided here.\n\t * @param op - The last op in the batch. Can be inspected to learn about the sequence numbers relevant for this batch.\n\t */\n\t(\n\t\tevent: \"batchEnd\",\n\t\tlistener: (error: any, op: Omit<ISequencedDocumentMessage, \"contents\">) => void,\n\t);\n\t/**\n\t * Indicates that an incoming op has been processed.\n\t * @param runtimeMessage - tells if op is runtime op. If it is, it was unpacked, i.e. its type and content\n\t * represent internal container runtime type / content. i.e. A grouped batch of N ops will result in N \"op\" events\n\t */\n\t(event: \"op\", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void);\n\t(event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n\t(event: \"dispose\", listener: () => void);\n}\n\n/**\n * Encapsulates the return codes of the aliasing API.\n *\n * 'Success' - the datastore has been successfully aliased. It can now be used.\n * 'Conflict' - there is already a datastore bound to the provided alias. To acquire it's entry point, use\n * the `IContainerRuntime.getAliasedDataStoreEntryPoint` function. The current datastore should be discarded\n * and will be garbage collected. The current datastore cannot be aliased to a different value.\n * 'AlreadyAliased' - the datastore has already been previously bound to another alias name.\n * @legacy\n * @alpha\n */\nexport type AliasResult = \"Success\" | \"Conflict\" | \"AlreadyAliased\";\n\n/**\n * Exposes some functionality/features of a data store:\n * - Handle to the data store's entryPoint\n * - Fluid router for the data store\n * - Can be assigned an alias\n * @legacy\n * @alpha\n */\nexport interface IDataStore {\n\t/**\n\t * Attempt to assign an alias to the datastore.\n\t * If the operation succeeds, the datastore can be referenced\n\t * by the supplied alias and will not be garbage collected.\n\t *\n\t * @param alias - Given alias for this datastore.\n\t * @returns A promise with the {@link AliasResult}\n\t */\n\ttrySetAlias(alias: string): Promise<AliasResult>;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting\n\t * with it.\n\t */\n\treadonly entryPoint: IFluidHandleInternal<FluidObject>;\n}\n\n/**\n * A reduced set of functionality of IContainerRuntime that a data store context/data store runtime will need\n * TODO: this should be merged into IFluidDataStoreContext\n * @legacy\n * @alpha\n * @sealed\n */\nexport interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeBaseEvents> {\n\treadonly baseLogger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\treadonly disposed: boolean;\n\n\t/**\n\t * Invokes the given callback and guarantees that all operations generated within the callback will be ordered\n\t * sequentially.\n\t *\n\t * If the callback throws an error, the container will close and the error will be logged.\n\t */\n\torderSequentially(callback: () => void): void;\n\n\t/**\n\t * Submits a container runtime level signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal. Should be a JSON serializable object or primitive.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\tsubmitSignal: (type: string, content: unknown, targetClientId?: string) => void;\n\n\t/**\n\t * @deprecated 0.16 Issue #1537, #3631\n\t */\n\t_createDataStoreWithProps(\n\t\tpkg: Readonly<string | string[]>,\n\t\tprops?: any,\n\t\tid?: string,\n\t): Promise<IDataStore>;\n\n\t/**\n\t * Creates a data store and returns an object that exposes a handle to the data store's entryPoint, and also serves\n\t * as the data store's router. The data store is not bound to a container, and in such state is not persisted to\n\t * storage (file). Storing the entryPoint handle (or any other handle inside the data store, e.g. for DDS) into an\n\t * already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this\n\t * store being attached to storage.\n\t * @param pkg - Package name of the data store factory\n\t * @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.\n\t * When not specified the datastore will belong to a `default` group. Read more about it in this\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}\n\t */\n\tcreateDataStore(\n\t\tpkg: Readonly<string | string[]>,\n\t\tloadingGroupId?: string,\n\t): Promise<IDataStore>;\n\n\t/**\n\t * Creates detached data store context. Only after context.attachRuntime() is called,\n\t * data store initialization is considered complete.\n\t * @param pkg - Package name of the data store factory\n\t * @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.\n\t * When not specified the datastore will belong to a `default` group. Read more about it in this\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}.\n\t */\n\tcreateDetachedDataStore(\n\t\tpkg: Readonly<string[]>,\n\t\tloadingGroupId?: string,\n\t): IFluidDataStoreContextDetached;\n\n\t/**\n\t * Returns the aliased data store's entryPoint, given the alias.\n\t * @param alias - The alias for the data store.\n\t * @returns The data store's entry point ({@link @fluidframework/core-interfaces#IFluidHandle}) if it exists and is aliased.\n\t * Returns undefined if no data store has been assigned the given alias.\n\t */\n\tgetAliasedDataStoreEntryPoint(alias: string): Promise<IFluidHandle<FluidObject> | undefined>;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tuploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandle<ArrayBufferLike>>;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n\n\t/**\n\t * Generates a new ID that is guaranteed to be unique across all sessions for this container.\n\t * It could be in compact form (non-negative integer, oppotunistic), but it could also be UUID string.\n\t * UUIDs generated will have low entropy in groups and will compress well.\n\t * It can be leveraged anywhere in container where container unique IDs are required, i.e. any place\n\t * that uses uuid() and stores result in container is likely candidate to start leveraging this API.\n\t * If you always want to convert to string, instead of doing String(generateDocumentUniqueId()), consider\n\t * doing encodeCompactIdToString(generateDocumentUniqueId()).\n\t *\n\t * For more details, please see IIdCompressor.generateDocumentUniqueId()\n\t */\n\tgenerateDocumentUniqueId(): number | string;\n\n\t/**\n\t * Api to fetch the snapshot from the service for a loadingGroupIds.\n\t * @param loadingGroupIds - LoadingGroupId for which the snapshot is asked for.\n\t * @param pathParts - Parts of the path, which we want to extract from the snapshot tree.\n\t * @returns - snapshotTree and the sequence number of the snapshot.\n\t */\n\tgetSnapshotForLoadingGroupId(\n\t\tloadingGroupIds: string[],\n\t\tpathParts: string[],\n\t): Promise<{ snapshotTree: ISnapshotTree; sequenceNumber: number }>;\n}\n\n/**\n * Minimal interface a data store runtime needs to provide for IFluidDataStoreContext to bind to control.\n *\n * Functionality include attach, snapshot, op/signal processing, request routes, expose an entryPoint,\n * and connection state notifications\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreChannel extends IDisposable {\n\t/**\n\t * Makes the data store channel visible in the container. Also, runs through its graph and attaches all\n\t * bound handles that represent its dependencies in the container's graph.\n\t */\n\tmakeVisibleAndAttachGraph(): void;\n\n\t/**\n\t * Synchronously retrieves the summary used as part of the initial summary message\n\t */\n\tgetAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;\n\n\t/**\n\t * Synchronously retrieves GC Data (representing the outbound routes present) for the initial state of the DataStore\n\t */\n\tgetAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData;\n\n\t/**\n\t * Process messages for this channel. The messages here are contiguous messages in a batch.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tprocessMessages?(messageCollection: IRuntimeMessageCollection): void;\n\n\t/**\n\t * Processes the op.\n\t * @deprecated processMessages should be used instead to process messages for a channel.\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;\n\n\t/**\n\t * Processes the signal.\n\t */\n\tprocessSignal(message: IInboundSignalMessage, local: boolean): void;\n\n\t/**\n\t * Generates a summary for the channel.\n\t * Introduced with summarizerNode - will be required in a future release.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree.\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tsummarize(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats>;\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context\n\t * including any of its children. Each node has a list of outbound routes to other GC nodes in the document.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n\t/**\n\t * After GC has run, called to notify this channel of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in this channel.\n\t */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n\n\t/**\n\t * Notifies this object about changes in the connection state.\n\t * @param value - New connection state.\n\t * @param clientId - ID of the client. It's old ID when in disconnected state and\n\t * it's new client ID when we are connecting or connected.\n\t */\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\t/**\n\t * Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\treSubmit(type: string, content: any, localOpMetadata: unknown);\n\n\tapplyStashedOp(content: any): Promise<unknown>;\n\n\t/**\n\t * Revert a local message.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\trollback?(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting\n\t * with the component.\n\t */\n\treadonly entryPoint: IFluidHandleInternal<FluidObject>;\n\n\trequest(request: IRequest): Promise<IResponse>;\n\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport type CreateChildSummarizerNodeFn = (\n\tsummarizeInternal: SummarizeInternalFn,\n\tgetGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t/**\n\t * @deprecated The functionality to get base GC details has been moved to summarizer node.\n\t */\n\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n) => ISummarizerNodeWithGC;\n\n/**\n * The state maintained for messages that are received when a channel isn't yet loaded.\n * @internal\n */\nexport interface IPendingMessagesState {\n\tmessageCollections: IRuntimeMessageCollection[];\n\tpendingCount: number;\n}\n\n/**\n * Represents the context for the data store like objects. It is used by the data store runtime to\n * get information and call functionality to its parent.\n *\n * This layout is temporary, as {@link IFluidParentContext} and {@link IFluidDataStoreContext} will converge.\n *\n * @legacy\n * @alpha\n */\nexport interface IFluidParentContext\n\textends IProvideFluidHandleContext,\n\t\tPartial<IProvideFluidDataStoreRegistry> {\n\treadonly options: Record<string | number, any>;\n\treadonly clientId: string | undefined;\n\treadonly connected: boolean;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly storage: IDocumentStorageService;\n\treadonly baseLogger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\treadonly idCompressor?: IIdCompressor;\n\t/**\n\t * Represents the loading group to which the data store belongs to. Please refer to this readme for more context.\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}\n\t */\n\treadonly loadingGroupId?: string;\n\t/**\n\t * Indicates the attachment state of the data store to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\treadonly containerRuntime: IContainerRuntimeBase;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * @deprecated this functionality has been removed.\n\t */\n\treadonly gcThrowOnTombstoneUsage: boolean;\n\t/**\n\t * @deprecated this functionality has been removed.\n\t */\n\treadonly gcTombstoneEnforcementAllowed: boolean;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n\n\t/**\n\t * Submits the message to be sent to other clients.\n\t * @param type - Type of the message.\n\t * @param content - Content of the message.\n\t * @param localOpMetadata - The local metadata associated with the message. This is kept locally and not sent to\n\t * the server. This will be sent back when this message is received back from the server. This is also sent if\n\t * we are asked to resubmit the message.\n\t */\n\tsubmitMessage(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Submits the signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal. Should be a JSON serializable object or primitive.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\tsubmitSignal: (type: string, content: unknown, targetClientId?: string) => void;\n\n\t/**\n\t * Called to make the data store locally visible in the container. This happens automatically for root data stores\n\t * when they are marked as root. For non-root data stores, this happens when their handle is added to a visible DDS.\n\t */\n\tmakeLocallyVisible(): void;\n\n\t/**\n\t * Get an absolute url to the container based on the provided relativeUrl.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tgetCreateChildSummarizerNodeFn(\n\t\t/**\n\t\t * Initial id or path part of this node\n\t\t */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t * If it is local, it will throw unsupported errors on calls to summarize.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t): CreateChildSummarizerNodeFn;\n\n\tdeleteChildSummarizerNode(id: string): void;\n\n\tuploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandleInternal<ArrayBufferLike>>;\n\n\t/**\n\t * Called by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.\n\t * @param address - The address of the channel that is dirty.\n\t */\n\tsetChannelDirty(address: string): void;\n\n\t/**\n\t * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n\t * all references added in the system.\n\t *\n\t * @param fromPath - The absolute path of the node that added the reference.\n\t * @param toPath - The absolute path of the outbound node that is referenced.\n\t * @param messageTimestampMs - The timestamp of the message that added the reference.\n\t */\n\taddedGCOutboundRoute(fromPath: string, toPath: string, messageTimestampMs?: number): void;\n}\n\n/**\n * Represents the context for the data store. It is used by the data store runtime to\n * get information and call functionality to the container.\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreContext extends IFluidParentContext {\n\treadonly id: string;\n\t/**\n\t * A data store created by a client, is a local data store for that client. Also, when a detached container loads\n\t * from a snapshot, all the data stores are treated as local data stores because at that stage the container\n\t * still doesn't exists in storage and so the data store couldn't have been created by any other client.\n\t * Value of this never changes even after the data store is attached.\n\t * As implementer of data store runtime, you can use this property to check that this data store belongs to this\n\t * client and hence implement any scenario based on that.\n\t */\n\treadonly isLocalDataStore: boolean;\n\t/**\n\t * The package path of the data store as per the package factory.\n\t */\n\treadonly packagePath: readonly string[];\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\n\t/**\n\t * @deprecated 0.16 Issue #1635, #3631\n\t */\n\treadonly createProps?: any;\n\n\t/**\n\t * @deprecated The functionality to get base GC details has been moved to summarizer node.\n\t *\n\t * Returns the GC details in the initial summary of this data store. This is used to initialize the data store\n\t * and its children with the GC details from the previous summary.\n\t */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {\n\t/**\n\t * Binds a runtime to the context.\n\t */\n\tattachRuntime(\n\t\tfactory: IProvideFluidDataStoreFactory,\n\t\tdataStoreRuntime: IFluidDataStoreChannel,\n\t): Promise<IDataStore>;\n}\n"]}
1
+ {"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA6CH;;;;GAIG;AACH,IAAY,SAcX;AAdD,WAAY,SAAS;IACpB;;;;;OAKG;IACH,mDAAS,CAAA;IAET;;;OAGG;IACH,mDAAS,CAAA;AACV,CAAC,EAdW,SAAS,yBAAT,SAAS,QAcpB;AAED;;GAEG;AACH,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAChC;;;;;;;;OAQG;IACH,mEAAS,CAAA;AACV,CAAC,EAXW,qBAAqB,qCAArB,qBAAqB,QAWhC;AAED;;;;;GAKG;AACU,QAAA,eAAe,GAAG;IAC9B;;OAEG;IACH,UAAU,EAAE,YAAY;IAExB;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;;;;;OAQG;IACH,eAAe,EAAE,iBAAiB;CAClC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { AttachState, IAudience } from \"@fluidframework/container-definitions\";\nimport type { IDeltaManager } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIDisposable,\n\tIEvent,\n\tIEventProvider,\n\tIFluidHandle,\n\tIRequest,\n\tIResponse,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIProvideFluidHandleContext,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentStorageService,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport type {\n\tIFluidDataStoreFactory,\n\tIProvideFluidDataStoreFactory,\n} from \"./dataStoreFactory.js\";\nimport type { IProvideFluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nimport type {\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n} from \"./garbageCollectionDefinitions.js\";\nimport type { IInboundSignalMessage, IRuntimeMessageCollection } from \"./protocol.js\";\nimport type {\n\tCreateChildSummarizerNodeParam,\n\tISummarizerNodeWithGC,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tSummarizeInternalFn,\n} from \"./summary.js\";\n\n/**\n * Runtime flush mode handling\n * @legacy\n * @alpha\n */\nexport enum FlushMode {\n\t/**\n\t * In Immediate flush mode the runtime will immediately send all operations to the driver layer.\n\t *\n\t * @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.\n\t * See https://github.com/microsoft/FluidFramework/tree/main/packages/runtime/container-runtime/src/opLifecycle#how-batching-works\n\t */\n\tImmediate,\n\n\t/**\n\t * When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single\n\t * batch at the end of the turn. The flush call on the runtime can be used to force send the current batch.\n\t */\n\tTurnBased,\n}\n\n/**\n * @internal\n */\nexport enum FlushModeExperimental {\n\t/**\n\t * When in Async flush mode, the runtime will accumulate all operations across JS turns and send them as a single\n\t * batch when all micro-tasks are complete.\n\t *\n\t * This feature requires a version of the loader which supports reference sequence numbers. If an older version of\n\t * the loader is used, the runtime will fall back on FlushMode.TurnBased.\n\t *\n\t * @experimental - Not ready for use\n\t */\n\tAsync = 2,\n}\n\n/**\n * This tells the visibility state of a Fluid object. It basically tracks whether the object is not visible, visible\n * locally within the container only or visible globally to all clients.\n * @legacy\n * @alpha\n */\nexport const VisibilityState = {\n\t/**\n\t * Indicates that the object is not visible. This is the state when an object is first created.\n\t */\n\tNotVisible: \"NotVisible\",\n\n\t/**\n\t * Indicates that the object is visible locally within the container. This is the state when an object is attached\n\t * to the container's graph but the container itself isn't globally visible. The object's state goes from not\n\t * visible to locally visible.\n\t */\n\tLocallyVisible: \"LocallyVisible\",\n\n\t/**\n\t * Indicates that the object is visible globally to all clients. This is the state of an object in 2 scenarios:\n\t *\n\t * 1. It is attached to the container's graph when the container is globally visible. The object's state goes from\n\t * not visible to globally visible.\n\t *\n\t * 2. When a container becomes globally visible, all locally visible objects go from locally visible to globally\n\t * visible.\n\t */\n\tGloballyVisible: \"GloballyVisible\",\n};\n/**\n * @legacy\n * @alpha\n */\nexport type VisibilityState = (typeof VisibilityState)[keyof typeof VisibilityState];\n\n/**\n * @legacy\n * @alpha\n * @sealed\n */\nexport interface IContainerRuntimeBaseEvents extends IEvent {\n\t/**\n\t * Indicates the beginning of an incoming batch of ops\n\t * @param op - The first op in the batch. Can be inspected to learn about the sequence numbers relevant for this batch.\n\t */\n\t(event: \"batchBegin\", listener: (op: Omit<ISequencedDocumentMessage, \"contents\">) => void);\n\t/**\n\t * Indicates the end of an incoming batch of ops\n\t * @param error - If an error occurred while processing the batch, it is provided here.\n\t * @param op - The last op in the batch. Can be inspected to learn about the sequence numbers relevant for this batch.\n\t */\n\t(\n\t\tevent: \"batchEnd\",\n\t\tlistener: (error: any, op: Omit<ISequencedDocumentMessage, \"contents\">) => void,\n\t);\n\t/**\n\t * Indicates that an incoming op has been processed.\n\t * @param runtimeMessage - tells if op is runtime op. If it is, it was unpacked, i.e. its type and content\n\t * represent internal container runtime type / content. i.e. A grouped batch of N ops will result in N \"op\" events\n\t */\n\t(event: \"op\", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void);\n\t(event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n\t(event: \"dispose\", listener: () => void);\n}\n\n/**\n * Encapsulates the return codes of the aliasing API.\n *\n * 'Success' - the datastore has been successfully aliased. It can now be used.\n * 'Conflict' - there is already a datastore bound to the provided alias. To acquire it's entry point, use\n * the `IContainerRuntime.getAliasedDataStoreEntryPoint` function. The current datastore should be discarded\n * and will be garbage collected. The current datastore cannot be aliased to a different value.\n * 'AlreadyAliased' - the datastore has already been previously bound to another alias name.\n * @legacy\n * @alpha\n */\nexport type AliasResult = \"Success\" | \"Conflict\" | \"AlreadyAliased\";\n\n/**\n * Exposes some functionality/features of a data store:\n * - Handle to the data store's entryPoint\n * - Fluid router for the data store\n * - Can be assigned an alias\n * @legacy\n * @alpha\n */\nexport interface IDataStore {\n\t/**\n\t * Attempt to assign an alias to the datastore.\n\t * If the operation succeeds, the datastore can be referenced\n\t * by the supplied alias and will not be garbage collected.\n\t *\n\t * @param alias - Given alias for this datastore.\n\t * @returns A promise with the {@link AliasResult}\n\t */\n\ttrySetAlias(alias: string): Promise<AliasResult>;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting\n\t * with it.\n\t */\n\treadonly entryPoint: IFluidHandleInternal<FluidObject>;\n}\n\n/**\n * A reduced set of functionality of IContainerRuntime that a data store context/data store runtime will need\n * TODO: this should be merged into IFluidDataStoreContext\n * @legacy\n * @alpha\n * @sealed\n */\nexport interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeBaseEvents> {\n\treadonly baseLogger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\treadonly disposed: boolean;\n\n\t/**\n\t * Invokes the given callback and guarantees that all operations generated within the callback will be ordered\n\t * sequentially.\n\t *\n\t * If the callback throws an error, the container will close and the error will be logged.\n\t */\n\torderSequentially(callback: () => void): void;\n\n\t/**\n\t * Submits a container runtime level signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal. Should be a JSON serializable object or primitive.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\tsubmitSignal: (type: string, content: unknown, targetClientId?: string) => void;\n\n\t/**\n\t * @deprecated 0.16 Issue #1537, #3631\n\t */\n\t_createDataStoreWithProps(\n\t\tpkg: Readonly<string | string[]>,\n\t\tprops?: any,\n\t\tid?: string,\n\t): Promise<IDataStore>;\n\n\t/**\n\t * Creates a data store and returns an object that exposes a handle to the data store's entryPoint, and also serves\n\t * as the data store's router. The data store is not bound to a container, and in such state is not persisted to\n\t * storage (file). Storing the entryPoint handle (or any other handle inside the data store, e.g. for DDS) into an\n\t * already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this\n\t * store being attached to storage.\n\t * @param pkg - Package name of the data store factory\n\t * @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.\n\t * When not specified the datastore will belong to a `default` group. Read more about it in this\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}\n\t */\n\tcreateDataStore(\n\t\tpkg: Readonly<string | string[]>,\n\t\tloadingGroupId?: string,\n\t): Promise<IDataStore>;\n\n\t/**\n\t * Creates detached data store context. Only after context.attachRuntime() is called,\n\t * data store initialization is considered complete.\n\t * @param pkg - Package name of the data store factory\n\t * @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.\n\t * When not specified the datastore will belong to a `default` group. Read more about it in this\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}.\n\t */\n\tcreateDetachedDataStore(\n\t\tpkg: Readonly<string[]>,\n\t\tloadingGroupId?: string,\n\t): IFluidDataStoreContextDetached;\n\n\t/**\n\t * Returns the aliased data store's entryPoint, given the alias.\n\t * @param alias - The alias for the data store.\n\t * @returns The data store's entry point ({@link @fluidframework/core-interfaces#IFluidHandle}) if it exists and is aliased.\n\t * Returns undefined if no data store has been assigned the given alias.\n\t */\n\tgetAliasedDataStoreEntryPoint(alias: string): Promise<IFluidHandle<FluidObject> | undefined>;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tuploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandle<ArrayBufferLike>>;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n\n\t/**\n\t * Generates a new ID that is guaranteed to be unique across all sessions for this container.\n\t * It could be in compact form (non-negative integer, oppotunistic), but it could also be UUID string.\n\t * UUIDs generated will have low entropy in groups and will compress well.\n\t * It can be leveraged anywhere in container where container unique IDs are required, i.e. any place\n\t * that uses uuid() and stores result in container is likely candidate to start leveraging this API.\n\t * If you always want to convert to string, instead of doing String(generateDocumentUniqueId()), consider\n\t * doing encodeCompactIdToString(generateDocumentUniqueId()).\n\t *\n\t * For more details, please see IIdCompressor.generateDocumentUniqueId()\n\t */\n\tgenerateDocumentUniqueId(): number | string;\n\n\t/**\n\t * Api to fetch the snapshot from the service for a loadingGroupIds.\n\t * @param loadingGroupIds - LoadingGroupId for which the snapshot is asked for.\n\t * @param pathParts - Parts of the path, which we want to extract from the snapshot tree.\n\t * @returns - snapshotTree and the sequence number of the snapshot.\n\t */\n\tgetSnapshotForLoadingGroupId(\n\t\tloadingGroupIds: string[],\n\t\tpathParts: string[],\n\t): Promise<{ snapshotTree: ISnapshotTree; sequenceNumber: number }>;\n}\n\n/**\n * Minimal interface a data store runtime needs to provide for IFluidDataStoreContext to bind to control.\n *\n * Functionality include attach, snapshot, op/signal processing, request routes, expose an entryPoint,\n * and connection state notifications\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreChannel extends IDisposable {\n\t/**\n\t * Makes the data store channel visible in the container. Also, runs through its graph and attaches all\n\t * bound handles that represent its dependencies in the container's graph.\n\t */\n\tmakeVisibleAndAttachGraph(): void;\n\n\t/**\n\t * Synchronously retrieves the summary used as part of the initial summary message\n\t */\n\tgetAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;\n\n\t/**\n\t * Synchronously retrieves GC Data (representing the outbound routes present) for the initial state of the DataStore\n\t */\n\tgetAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData;\n\n\t/**\n\t * Process messages for this channel. The messages here are contiguous messages in a batch.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tprocessMessages?(messageCollection: IRuntimeMessageCollection): void;\n\n\t/**\n\t * Processes the op.\n\t * @deprecated processMessages should be used instead to process messages for a channel.\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;\n\n\t/**\n\t * Processes the signal.\n\t */\n\tprocessSignal(message: IInboundSignalMessage, local: boolean): void;\n\n\t/**\n\t * Generates a summary for the channel.\n\t * Introduced with summarizerNode - will be required in a future release.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree.\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tsummarize(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats>;\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context\n\t * including any of its children. Each node has a list of outbound routes to other GC nodes in the document.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n\t/**\n\t * After GC has run, called to notify this channel of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in this channel.\n\t */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n\n\t/**\n\t * Notifies this object about changes in the connection state.\n\t * @param value - New connection state.\n\t * @param clientId - ID of the client. It's old ID when in disconnected state and\n\t * it's new client ID when we are connecting or connected.\n\t */\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\t/**\n\t * Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\treSubmit(type: string, content: any, localOpMetadata: unknown);\n\n\tapplyStashedOp(content: any): Promise<unknown>;\n\n\t/**\n\t * Revert a local message.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\trollback?(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting\n\t * with the component.\n\t */\n\treadonly entryPoint: IFluidHandleInternal<FluidObject>;\n\n\trequest(request: IRequest): Promise<IResponse>;\n\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport type CreateChildSummarizerNodeFn = (\n\tsummarizeInternal: SummarizeInternalFn,\n\tgetGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t/**\n\t * @deprecated The functionality to get base GC details has been moved to summarizer node.\n\t */\n\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n) => ISummarizerNodeWithGC;\n\n/**\n * The state maintained for messages that are received when a channel isn't yet loaded.\n * @internal\n */\nexport interface IPendingMessagesState {\n\tmessageCollections: IRuntimeMessageCollection[];\n\tpendingCount: number;\n}\n\n/**\n * Represents the context for the data store like objects. It is used by the data store runtime to\n * get information and call functionality to its parent.\n *\n * This layout is temporary, as {@link IFluidParentContext} and {@link IFluidDataStoreContext} will converge.\n *\n * @legacy\n * @alpha\n */\nexport interface IFluidParentContext\n\textends IProvideFluidHandleContext,\n\t\tPartial<IProvideFluidDataStoreRegistry> {\n\treadonly options: Record<string | number, any>;\n\treadonly clientId: string | undefined;\n\treadonly connected: boolean;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly storage: IDocumentStorageService;\n\treadonly baseLogger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\treadonly idCompressor?: IIdCompressor;\n\t/**\n\t * Represents the loading group to which the data store belongs to. Please refer to this readme for more context.\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}\n\t */\n\treadonly loadingGroupId?: string;\n\t/**\n\t * Indicates the attachment state of the data store to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\treadonly containerRuntime: IContainerRuntimeBase;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * @deprecated this functionality has been removed.\n\t */\n\treadonly gcThrowOnTombstoneUsage: boolean;\n\t/**\n\t * @deprecated this functionality has been removed.\n\t */\n\treadonly gcTombstoneEnforcementAllowed: boolean;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n\n\t/**\n\t * Submits the message to be sent to other clients.\n\t * @param type - Type of the message.\n\t * @param content - Content of the message.\n\t * @param localOpMetadata - The local metadata associated with the message. This is kept locally and not sent to\n\t * the server. This will be sent back when this message is received back from the server. This is also sent if\n\t * we are asked to resubmit the message.\n\t */\n\tsubmitMessage(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Submits the signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal. Should be a JSON serializable object or primitive.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\tsubmitSignal: (type: string, content: unknown, targetClientId?: string) => void;\n\n\t/**\n\t * Called to make the data store locally visible in the container. This happens automatically for root data stores\n\t * when they are marked as root. For non-root data stores, this happens when their handle is added to a visible DDS.\n\t */\n\tmakeLocallyVisible(): void;\n\n\t/**\n\t * Get an absolute url to the container based on the provided relativeUrl.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tgetCreateChildSummarizerNodeFn(\n\t\t/**\n\t\t * Initial id or path part of this node\n\t\t */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t * If it is local, it will throw unsupported errors on calls to summarize.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t): CreateChildSummarizerNodeFn;\n\n\tdeleteChildSummarizerNode(id: string): void;\n\n\tuploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandleInternal<ArrayBufferLike>>;\n\n\t/**\n\t * Called by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.\n\t * @param address - The address of the channel that is dirty.\n\t */\n\tsetChannelDirty(address: string): void;\n\n\t/**\n\t * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n\t * all references added in the system.\n\t *\n\t * @param fromPath - The absolute path of the node that added the reference.\n\t * @param toPath - The absolute path of the outbound node that is referenced.\n\t * @param messageTimestampMs - The timestamp of the message that added the reference.\n\t */\n\taddedGCOutboundRoute(fromPath: string, toPath: string, messageTimestampMs?: number): void;\n}\n\n/**\n * Represents the context for the data store. It is used by the data store runtime to\n * get information and call functionality to the container.\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreContext extends IFluidParentContext {\n\treadonly id: string;\n\t/**\n\t * A data store created by a client, is a local data store for that client. Also, when a detached container loads\n\t * from a snapshot, all the data stores are treated as local data stores because at that stage the container\n\t * still doesn't exists in storage and so the data store couldn't have been created by any other client.\n\t * Value of this never changes even after the data store is attached.\n\t * As implementer of data store runtime, you can use this property to check that this data store belongs to this\n\t * client and hence implement any scenario based on that.\n\t */\n\treadonly isLocalDataStore: boolean;\n\t/**\n\t * The package path of the data store as per the package factory.\n\t */\n\treadonly packagePath: readonly string[];\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\n\t/**\n\t * @deprecated 0.16 Issue #1635, #3631\n\t */\n\treadonly createProps?: any;\n\n\t/**\n\t * @deprecated The functionality to get base GC details has been moved to summarizer node.\n\t *\n\t * Returns the GC details in the initial summary of this data store. This is used to initialize the data store\n\t * and its children with the GC details from the previous summary.\n\t */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\n\t/**\n\t * Synchronously creates a detached child data store.\n\t *\n\t * The `createChildDataStore` method allows for the synchronous creation of a detached child data store. This is particularly\n\t * useful in scenarios where immediate availability of the child data store is required, such as during the initialization\n\t * of a parent data store, or when creation is in response to synchronous user input.\n\t *\n\t * In order for this function to succeed:\n\t * 1. The parent data store's factory must also be an `IFluidDataStoreRegistry`.\n\t * 2. The parent data store's registry must include the same instance as the provided child factory.\n\t * 3. The parent data store's registry must synchronously provide the child factory via the `getSync` method.\n\t * 4. The child factory must implement the `createDataStore` method.\n\t *\n\t * These invariants ensure that the child data store can also be created by a remote client running the same code as this client.\n\t *\n\t * @param childFactory - The factory of the data store to be created.\n\t * @returns The created data store channel.\n\t */\n\tcreateChildDataStore?<T extends IFluidDataStoreFactory>(\n\t\tchildFactory: T,\n\t): ReturnType<Exclude<T[\"createDataStore\"], undefined>>;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {\n\t/**\n\t * Binds a runtime to the context.\n\t */\n\tattachRuntime(\n\t\tfactory: IProvideFluidDataStoreFactory,\n\t\tdataStoreRuntime: IFluidDataStoreChannel,\n\t): Promise<IDataStore>;\n}\n"]}
@@ -16,21 +16,61 @@ export interface IProvideFluidDataStoreFactory {
16
16
  readonly IFluidDataStoreFactory: IFluidDataStoreFactory;
17
17
  }
18
18
  /**
19
- * IFluidDataStoreFactory create data stores. It is associated with an identifier (its `type` member)
20
- * and usually provided to consumers using this mapping through a data store registry.
19
+ * The `IFluidDataStoreFactory` interface is responsible for creating data stores.
20
+ * A data store is a component that manages a specific set of data and its operations.
21
+ * It encapsulates the logic for data management, synchronization, and interaction
22
+ * with other components within a Fluid container.
23
+ *
24
+ * Data stores are fundamental building blocks in the Fluid Framework. They are used
25
+ * to store and manage state, handle operations, and provide APIs for interacting
26
+ * with the data. Each data store type is associated with a unique identifier (its `type` member)
27
+ * and is typically provided to consumers through a data store registry.
28
+ *
29
+ * The factory is responsible for creating new instances of data stores and loading existing ones.
30
+ * The factory ensures that the data store is correctly initialized.
31
+ *
21
32
  * @legacy
22
33
  * @alpha
23
34
  */
24
35
  export interface IFluidDataStoreFactory extends IProvideFluidDataStoreFactory {
25
36
  /**
26
- * String that uniquely identifies the type of data store created by this factory.
37
+ * Uniquely identifies the type of data store created by this factory.
27
38
  */
28
39
  type: string;
29
40
  /**
30
- * Generates runtime for the data store from the data store context. Once created should be bound to the context.
31
- * @param context - Context for the data store.
32
- * @param existing - If instantiating from an existing file.
41
+ * Asynchronously generates the runtime for the data store from the given context.
42
+ * @remarks
43
+ * Once created, the data store should be bound to the context.
44
+ *
45
+ * This method supports both creation and loading paths. It is important to differentiate
46
+ * between the two based on the `existing` parameter:
47
+ * - When `existing` is false, this method creates a new data store.
48
+ * - When `existing` is true, it loads a pre-existing data store.
49
+ *
50
+ * @param context - The context for the data store, providing necessary information and services.
51
+ * @param existing - A boolean indicating whether the data store is being instantiated from an existing file.
52
+ * @returns A promise that resolves to the created data store channel.
33
53
  */
34
54
  instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<IFluidDataStoreChannel>;
55
+ /**
56
+ * Synchronously creates a new runtime for a new data store from the provided context.
57
+ *
58
+ * @remarks
59
+ * This method enables a synchronous creation path. Specifically, if this factory is registered
60
+ * as a child factory in another data store's registry, and the registry synchronously provides
61
+ * this factory, it becomes eligible for synchronous creation via the parent data store's context.
62
+ * After creation, all subsequent loads of a data store created through this method will utilize
63
+ * the asynchronous `instantiateDataStore` method on this factory.
64
+ *
65
+ * Note: This method is optional. Not all data stores can or will support a synchronous creation path,
66
+ * as being synchronous imposes limitations on the capabilities that can be used. Generally, this
67
+ * creation path should only be implemented when synchronous creation is necessary.
68
+ *
69
+ * @param context - The context for the data store, providing the necessary information and services.
70
+ * @returns An object containing the runtime of the created data store channel.
71
+ */
72
+ createDataStore?(context: IFluidDataStoreContext): {
73
+ readonly runtime: IFluidDataStoreChannel;
74
+ };
35
75
  }
36
76
  //# sourceMappingURL=dataStoreFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreFactory.d.ts","sourceRoot":"","sources":["../src/dataStoreFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE5F;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,6BAClB,CAAC;AAE1B;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC7C,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;CACxD;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAuB,SAAQ,6BAA6B;IAC5E;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,oBAAoB,CACnB,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACnC"}
1
+ {"version":3,"file":"dataStoreFactory.d.ts","sourceRoot":"","sources":["../src/dataStoreFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE5F;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,6BAClB,CAAC;AAE1B;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC7C,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;CACxD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,sBAAuB,SAAQ,6BAA6B;IAC5E;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CACnB,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAEnC;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CAAC,CAAC,OAAO,EAAE,sBAAsB,GAAG;QAClD,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;KACzC,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreFactory.js","sourceRoot":"","sources":["../src/dataStoreFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;GAGG;AACU,QAAA,sBAAsB,GAClC,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidDataStoreChannel, IFluidDataStoreContext } from \"./dataStoreContext.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidDataStoreFactory: keyof IProvideFluidDataStoreFactory =\n\t\"IFluidDataStoreFactory\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidDataStoreFactory {\n\treadonly IFluidDataStoreFactory: IFluidDataStoreFactory;\n}\n\n/**\n * IFluidDataStoreFactory create data stores. It is associated with an identifier (its `type` member)\n * and usually provided to consumers using this mapping through a data store registry.\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreFactory extends IProvideFluidDataStoreFactory {\n\t/**\n\t * String that uniquely identifies the type of data store created by this factory.\n\t */\n\ttype: string;\n\n\t/**\n\t * Generates runtime for the data store from the data store context. Once created should be bound to the context.\n\t * @param context - Context for the data store.\n\t * @param existing - If instantiating from an existing file.\n\t */\n\tinstantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<IFluidDataStoreChannel>;\n}\n"]}
1
+ {"version":3,"file":"dataStoreFactory.js","sourceRoot":"","sources":["../src/dataStoreFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;;GAGG;AACU,QAAA,sBAAsB,GAClC,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidDataStoreChannel, IFluidDataStoreContext } from \"./dataStoreContext.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidDataStoreFactory: keyof IProvideFluidDataStoreFactory =\n\t\"IFluidDataStoreFactory\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidDataStoreFactory {\n\treadonly IFluidDataStoreFactory: IFluidDataStoreFactory;\n}\n\n/**\n * The `IFluidDataStoreFactory` interface is responsible for creating data stores.\n * A data store is a component that manages a specific set of data and its operations.\n * It encapsulates the logic for data management, synchronization, and interaction\n * with other components within a Fluid container.\n *\n * Data stores are fundamental building blocks in the Fluid Framework. They are used\n * to store and manage state, handle operations, and provide APIs for interacting\n * with the data. Each data store type is associated with a unique identifier (its `type` member)\n * and is typically provided to consumers through a data store registry.\n *\n * The factory is responsible for creating new instances of data stores and loading existing ones.\n * The factory ensures that the data store is correctly initialized.\n *\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreFactory extends IProvideFluidDataStoreFactory {\n\t/**\n\t * Uniquely identifies the type of data store created by this factory.\n\t */\n\ttype: string;\n\n\t/**\n\t * Asynchronously generates the runtime for the data store from the given context.\n\t * @remarks\n\t * Once created, the data store should be bound to the context.\n\t *\n\t * This method supports both creation and loading paths. It is important to differentiate\n\t * between the two based on the `existing` parameter:\n\t * - When `existing` is false, this method creates a new data store.\n\t * - When `existing` is true, it loads a pre-existing data store.\n\t *\n\t * @param context - The context for the data store, providing necessary information and services.\n\t * @param existing - A boolean indicating whether the data store is being instantiated from an existing file.\n\t * @returns A promise that resolves to the created data store channel.\n\t */\n\tinstantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<IFluidDataStoreChannel>;\n\n\t/**\n\t * Synchronously creates a new runtime for a new data store from the provided context.\n\t *\n\t * @remarks\n\t * This method enables a synchronous creation path. Specifically, if this factory is registered\n\t * as a child factory in another data store's registry, and the registry synchronously provides\n\t * this factory, it becomes eligible for synchronous creation via the parent data store's context.\n\t * After creation, all subsequent loads of a data store created through this method will utilize\n\t * the asynchronous `instantiateDataStore` method on this factory.\n\t *\n\t * Note: This method is optional. Not all data stores can or will support a synchronous creation path,\n\t * as being synchronous imposes limitations on the capabilities that can be used. Generally, this\n\t * creation path should only be implemented when synchronous creation is necessary.\n\t *\n\t * @param context - The context for the data store, providing the necessary information and services.\n\t * @returns An object containing the runtime of the created data store channel.\n\t */\n\tcreateDataStore?(context: IFluidDataStoreContext): {\n\t\treadonly runtime: IFluidDataStoreChannel;\n\t};\n}\n"]}
@@ -17,12 +17,22 @@ export type FluidDataStoreRegistryEntry = Readonly<Partial<IProvideFluidDataStor
17
17
  * @alpha
18
18
  */
19
19
  export type NamedFluidDataStoreRegistryEntry = [string, Promise<FluidDataStoreRegistryEntry>];
20
+ /**
21
+ * An associated pair of an identifier and registry entry. Registry entries
22
+ * may be dynamically loaded.
23
+ * @legacy
24
+ * @alpha
25
+ */
26
+ export type NamedFluidDataStoreRegistryEntry2 = [
27
+ string,
28
+ Promise<FluidDataStoreRegistryEntry> | FluidDataStoreRegistryEntry
29
+ ];
20
30
  /**
21
31
  * An iterable identifier/registry entry pair list
22
32
  * @legacy
23
33
  * @alpha
24
34
  */
25
- export type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry>;
35
+ export type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry2>;
26
36
  /**
27
37
  * @legacy
28
38
  * @alpha
@@ -42,6 +52,27 @@ export interface IProvideFluidDataStoreRegistry {
42
52
  * @alpha
43
53
  */
44
54
  export interface IFluidDataStoreRegistry extends IProvideFluidDataStoreRegistry {
55
+ /**
56
+ * Retrieves a data store registry entry by its identifier.
57
+ *
58
+ * @remarks
59
+ * The `get` function plays a crucial role in the lifecycle of a data store by providing access to the registry entry
60
+ * associated with a given identifier. This registry entry can then be used to create or load a data store.
61
+ *
62
+ * @param name - The unique identifier of the data store registry entry to retrieve.
63
+ * @returns A promise that resolves to the data store registry entry, or the entry itself, or undefined if not found.
64
+ */
45
65
  get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
66
+ /**
67
+ * Synchronously retrieves a data store registry entry by its identifier.
68
+ *
69
+ * @remarks
70
+ * The `get` function plays a crucial role in the lifecycle of a data store by providing access to the registry entry
71
+ * associated with a given identifier. This registry entry can then be used to create or load a data store.
72
+ *
73
+ * @param name - The unique identifier of the data store registry entry to retrieve.
74
+ * @returns The data store registry entry, or the entry itself, or undefined if not found.
75
+ */
76
+ getSync?(name: string): FluidDataStoreRegistryEntry | undefined;
46
77
  }
47
78
  //# sourceMappingURL=dataStoreRegistry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRegistry.d.ts","sourceRoot":"","sources":["../src/dataStoreRegistry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CACjD,O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A8B;IAC9C,QAAQ,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;CAC1D;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAwB,SAAQ,8BAA8B;IAC9E;;;;;;;;;OASG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAAC;IAEpE;;;;;;;;;OASG;IACH,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,2BAA2B,GAAG,SAAS,CAAC;CAChE"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRegistry.js","sourceRoot":"","sources":["../src/dataStoreRegistry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA2BH;;;GAGG;AACU,QAAA,uBAAuB,GACnC,yBAAyB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IProvideFluidDataStoreFactory } from \"./dataStoreFactory.js\";\n\n/**\n * A single registry entry that may be used to create data stores\n * It has to have either factory or registry, or both.\n * @legacy\n * @alpha\n */\nexport type FluidDataStoreRegistryEntry = Readonly<\n\tPartial<IProvideFluidDataStoreRegistry & IProvideFluidDataStoreFactory>\n>;\n/**\n * An associated pair of an identifier and registry entry. Registry entries\n * may be dynamically loaded.\n * @legacy\n * @alpha\n */\nexport type NamedFluidDataStoreRegistryEntry = [string, Promise<FluidDataStoreRegistryEntry>];\n/**\n * An iterable identifier/registry entry pair list\n * @legacy\n * @alpha\n */\nexport type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry>;\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidDataStoreRegistry: keyof IProvideFluidDataStoreRegistry =\n\t\"IFluidDataStoreRegistry\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidDataStoreRegistry {\n\treadonly IFluidDataStoreRegistry: IFluidDataStoreRegistry;\n}\n\n/**\n * An association of identifiers to data store registry entries, where the\n * entries can be used to create data stores.\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreRegistry extends IProvideFluidDataStoreRegistry {\n\tget(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;\n}\n"]}
1
+ {"version":3,"file":"dataStoreRegistry.js","sourceRoot":"","sources":["../src/dataStoreRegistry.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAsCH;;;GAGG;AACU,QAAA,uBAAuB,GACnC,yBAAyB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IProvideFluidDataStoreFactory } from \"./dataStoreFactory.js\";\n\n/**\n * A single registry entry that may be used to create data stores\n * It has to have either factory or registry, or both.\n * @legacy\n * @alpha\n */\nexport type FluidDataStoreRegistryEntry = Readonly<\n\tPartial<IProvideFluidDataStoreRegistry & IProvideFluidDataStoreFactory>\n>;\n/**\n * An associated pair of an identifier and registry entry. Registry entries\n * may be dynamically loaded.\n * @legacy\n * @alpha\n */\nexport type NamedFluidDataStoreRegistryEntry = [string, Promise<FluidDataStoreRegistryEntry>];\n\n/**\n * An associated pair of an identifier and registry entry. Registry entries\n * may be dynamically loaded.\n * @legacy\n * @alpha\n */\nexport type NamedFluidDataStoreRegistryEntry2 = [\n\tstring,\n\tPromise<FluidDataStoreRegistryEntry> | FluidDataStoreRegistryEntry,\n];\n/**\n * An iterable identifier/registry entry pair list\n * @legacy\n * @alpha\n */\nexport type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry2>;\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidDataStoreRegistry: keyof IProvideFluidDataStoreRegistry =\n\t\"IFluidDataStoreRegistry\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidDataStoreRegistry {\n\treadonly IFluidDataStoreRegistry: IFluidDataStoreRegistry;\n}\n\n/**\n * An association of identifiers to data store registry entries, where the\n * entries can be used to create data stores.\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreRegistry extends IProvideFluidDataStoreRegistry {\n\t/**\n\t * Retrieves a data store registry entry by its identifier.\n\t *\n\t * @remarks\n\t * The `get` function plays a crucial role in the lifecycle of a data store by providing access to the registry entry\n\t * associated with a given identifier. This registry entry can then be used to create or load a data store.\n\t *\n\t * @param name - The unique identifier of the data store registry entry to retrieve.\n\t * @returns A promise that resolves to the data store registry entry, or the entry itself, or undefined if not found.\n\t */\n\tget(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;\n\n\t/**\n\t * Synchronously retrieves a data store registry entry by its identifier.\n\t *\n\t * @remarks\n\t * The `get` function plays a crucial role in the lifecycle of a data store by providing access to the registry entry\n\t * associated with a given identifier. This registry entry can then be used to create or load a data store.\n\t *\n\t * @param name - The unique identifier of the data store registry entry to retrieve.\n\t * @returns The data store registry entry, or the entry itself, or undefined if not found.\n\t */\n\tgetSync?(name: string): FluidDataStoreRegistryEntry | undefined;\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export type { AliasResult, CreateChildSummarizerNodeFn, IContainerRuntimeBase, I
7
7
  export { FlushMode, FlushModeExperimental, VisibilityState } from "./dataStoreContext.js";
8
8
  export type { IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
9
9
  export { IFluidDataStoreFactory } from "./dataStoreFactory.js";
10
- export type { FluidDataStoreRegistryEntry, IProvideFluidDataStoreRegistry, NamedFluidDataStoreRegistryEntries, NamedFluidDataStoreRegistryEntry, } from "./dataStoreRegistry.js";
10
+ export type { FluidDataStoreRegistryEntry, IProvideFluidDataStoreRegistry, NamedFluidDataStoreRegistryEntries, NamedFluidDataStoreRegistryEntry, NamedFluidDataStoreRegistryEntry2, } from "./dataStoreRegistry.js";
11
11
  export { IFluidDataStoreRegistry } from "./dataStoreRegistry.js";
12
12
  export type { IGarbageCollectionData, IGarbageCollectionDetailsBase, } from "./garbageCollectionDefinitions.js";
13
13
  export { gcBlobPrefix, gcDataBlobKey, gcDeletedBlobKey, gcTombstoneBlobKey, gcTreeKey, } from "./garbageCollectionDefinitions.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACX,WAAW,EACX,2BAA2B,EAC3B,qBAAqB,EACrB,2BAA2B,EAC3B,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,8BAA8B,EAC9B,qBAAqB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC1F,YAAY,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,YAAY,EACX,2BAA2B,EAC3B,8BAA8B,EAC9B,kCAAkC,EAClC,gCAAgC,GAChC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,YAAY,EACX,sBAAsB,EACtB,6BAA6B,GAC7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACN,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,GACT,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACX,cAAc,EACd,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,GACzB,MAAM,eAAe,CAAC;AACvB,YAAY,EACX,8BAA8B,EAC9B,sCAAsC,EACtC,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,2BAA2B,EAC3B,qBAAqB,EACrB,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACj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,eAAe,EACf,qBAAqB,EACrB,2BAA2B,EAC3B,qBAAqB,EACrB,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,GACzB,MAAM,cAAc,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAqBH,6DAA0F;AAAjF,gHAAA,SAAS,OAAA;AAAE,4HAAA,qBAAqB,OAAA;AAAE,sHAAA,eAAe,OAAA;AAE1D,6DAA+D;AAAtD,6HAAA,sBAAsB,OAAA;AAO/B,+DAAiE;AAAxD,+HAAA,uBAAuB,OAAA;AAKhC,qFAM2C;AAL1C,+HAAA,YAAY,OAAA;AACZ,gIAAA,aAAa,OAAA;AACb,mIAAA,gBAAgB,OAAA;AAChB,qIAAA,kBAAkB,OAAA;AAClB,4HAAA,SAAS,OAAA;AA0BV,2CAKsB;AAJrB,mHAAA,qBAAqB,OAAA;AACrB,8GAAA,gBAAgB,OAAA;AAChB,wHAAA,0BAA0B,OAAA;AAC1B,uHAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tAttributionInfo,\n\tAttributionKey,\n\tDetachedAttributionKey,\n\tLocalAttributionKey,\n\tOpAttributionKey,\n} from \"./attribution.js\";\nexport type {\n\tAliasResult,\n\tCreateChildSummarizerNodeFn,\n\tIContainerRuntimeBase,\n\tIContainerRuntimeBaseEvents,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidParentContext,\n\tIFluidDataStoreContextDetached,\n\tIPendingMessagesState,\n} from \"./dataStoreContext.js\";\nexport { FlushMode, FlushModeExperimental, VisibilityState } from \"./dataStoreContext.js\";\nexport type { IProvideFluidDataStoreFactory } from \"./dataStoreFactory.js\";\nexport { IFluidDataStoreFactory } from \"./dataStoreFactory.js\";\nexport type {\n\tFluidDataStoreRegistryEntry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n} from \"./dataStoreRegistry.js\";\nexport { IFluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nexport type {\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n} from \"./garbageCollectionDefinitions.js\";\nexport {\n\tgcBlobPrefix,\n\tgcDataBlobKey,\n\tgcDeletedBlobKey,\n\tgcTombstoneBlobKey,\n\tgcTreeKey,\n} from \"./garbageCollectionDefinitions.js\";\nexport type {\n\tIAttachMessage,\n\tIEnvelope,\n\tIInboundSignalMessage,\n\tInboundAttachMessage,\n\tIRuntimeMessageCollection,\n\tIRuntimeMessagesContent,\n\tISequencedMessageEnvelope,\n} from \"./protocol.js\";\nexport type {\n\tCreateChildSummarizerNodeParam,\n\tIExperimentalIncrementalSummaryContext,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tISummaryStats,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tITelemetryContextExt,\n\tSummarizeInternalFn,\n} from \"./summary.js\";\nexport {\n\tblobCountPropertyName,\n\tchannelsTreeName,\n\tCreateSummarizerNodeSource,\n\ttotalBlobSizePropertyName,\n} from \"./summary.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAqBH,6DAA0F;AAAjF,gHAAA,SAAS,OAAA;AAAE,4HAAA,qBAAqB,OAAA;AAAE,sHAAA,eAAe,OAAA;AAE1D,6DAA+D;AAAtD,6HAAA,sBAAsB,OAAA;AAQ/B,+DAAiE;AAAxD,+HAAA,uBAAuB,OAAA;AAKhC,qFAM2C;AAL1C,+HAAA,YAAY,OAAA;AACZ,gIAAA,aAAa,OAAA;AACb,mIAAA,gBAAgB,OAAA;AAChB,qIAAA,kBAAkB,OAAA;AAClB,4HAAA,SAAS,OAAA;AA0BV,2CAKsB;AAJrB,mHAAA,qBAAqB,OAAA;AACrB,8GAAA,gBAAgB,OAAA;AAChB,wHAAA,0BAA0B,OAAA;AAC1B,uHAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tAttributionInfo,\n\tAttributionKey,\n\tDetachedAttributionKey,\n\tLocalAttributionKey,\n\tOpAttributionKey,\n} from \"./attribution.js\";\nexport type {\n\tAliasResult,\n\tCreateChildSummarizerNodeFn,\n\tIContainerRuntimeBase,\n\tIContainerRuntimeBaseEvents,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidParentContext,\n\tIFluidDataStoreContextDetached,\n\tIPendingMessagesState,\n} from \"./dataStoreContext.js\";\nexport { FlushMode, FlushModeExperimental, VisibilityState } from \"./dataStoreContext.js\";\nexport type { IProvideFluidDataStoreFactory } from \"./dataStoreFactory.js\";\nexport { IFluidDataStoreFactory } from \"./dataStoreFactory.js\";\nexport type {\n\tFluidDataStoreRegistryEntry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n\tNamedFluidDataStoreRegistryEntry2,\n} from \"./dataStoreRegistry.js\";\nexport { IFluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nexport type {\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n} from \"./garbageCollectionDefinitions.js\";\nexport {\n\tgcBlobPrefix,\n\tgcDataBlobKey,\n\tgcDeletedBlobKey,\n\tgcTombstoneBlobKey,\n\tgcTreeKey,\n} from \"./garbageCollectionDefinitions.js\";\nexport type {\n\tIAttachMessage,\n\tIEnvelope,\n\tIInboundSignalMessage,\n\tInboundAttachMessage,\n\tIRuntimeMessageCollection,\n\tIRuntimeMessagesContent,\n\tISequencedMessageEnvelope,\n} from \"./protocol.js\";\nexport type {\n\tCreateChildSummarizerNodeParam,\n\tIExperimentalIncrementalSummaryContext,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tISummaryStats,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tITelemetryContextExt,\n\tSummarizeInternalFn,\n} from \"./summary.js\";\nexport {\n\tblobCountPropertyName,\n\tchannelsTreeName,\n\tCreateSummarizerNodeSource,\n\ttotalBlobSizePropertyName,\n} from \"./summary.js\";\n"]}
package/dist/legacy.d.ts CHANGED
@@ -52,6 +52,7 @@ export {
52
52
  LocalAttributionKey,
53
53
  NamedFluidDataStoreRegistryEntries,
54
54
  NamedFluidDataStoreRegistryEntry,
55
+ NamedFluidDataStoreRegistryEntry2,
55
56
  OpAttributionKey,
56
57
  SummarizeInternalFn,
57
58
  VisibilityState
@@ -9,7 +9,7 @@ import type { IFluidHandleInternal, IProvideFluidHandleContext } from "@fluidfra
9
9
  import type { IClientDetails, IQuorumClients } from "@fluidframework/driver-definitions";
10
10
  import type { IDocumentStorageService, IDocumentMessage, ISnapshotTree, ISequencedDocumentMessage } from "@fluidframework/driver-definitions/internal";
11
11
  import type { IIdCompressor } from "@fluidframework/id-compressor";
12
- import type { IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
12
+ import type { IFluidDataStoreFactory, IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
13
13
  import type { IProvideFluidDataStoreRegistry } from "./dataStoreRegistry.js";
14
14
  import type { IGarbageCollectionData, IGarbageCollectionDetailsBase } from "./garbageCollectionDefinitions.js";
15
15
  import type { IInboundSignalMessage, IRuntimeMessageCollection } from "./protocol.js";
@@ -477,6 +477,25 @@ export interface IFluidDataStoreContext extends IFluidParentContext {
477
477
  * and its children with the GC details from the previous summary.
478
478
  */
479
479
  getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
480
+ /**
481
+ * Synchronously creates a detached child data store.
482
+ *
483
+ * The `createChildDataStore` method allows for the synchronous creation of a detached child data store. This is particularly
484
+ * useful in scenarios where immediate availability of the child data store is required, such as during the initialization
485
+ * of a parent data store, or when creation is in response to synchronous user input.
486
+ *
487
+ * In order for this function to succeed:
488
+ * 1. The parent data store's factory must also be an `IFluidDataStoreRegistry`.
489
+ * 2. The parent data store's registry must include the same instance as the provided child factory.
490
+ * 3. The parent data store's registry must synchronously provide the child factory via the `getSync` method.
491
+ * 4. The child factory must implement the `createDataStore` method.
492
+ *
493
+ * These invariants ensure that the child data store can also be created by a remote client running the same code as this client.
494
+ *
495
+ * @param childFactory - The factory of the data store to be created.
496
+ * @returns The created data store channel.
497
+ */
498
+ createChildDataStore?<T extends IFluidDataStoreFactory>(childFactory: T): ReturnType<Exclude<T["createDataStore"], undefined>>;
480
499
  }
481
500
  /**
482
501
  * @legacy
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreContext.d.ts","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,KAAK,EACX,WAAW,EACX,WAAW,EACX,MAAM,EACN,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACX,oBAAoB,EACpB,0BAA0B,EAC1B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,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GAAG,CAAC;IAE3B;;;;;OAKG;IACH,gBAAgB,IAAI,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAE3D;;;;;;;;;;;;;;;;;OAiBG;IACH,oBAAoB,CAAC,CAAC,CAAC,SAAS,sBAAsB,EACrD,YAAY,EAAE,CAAC,GACb,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;CACxD;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA+B,SAAQ,sBAAsB;IAC7E;;OAEG;IACH,aAAa,CACZ,OAAO,EAAE,6BAA6B,EACtC,gBAAgB,EAAE,sBAAsB,GACtC,OAAO,CAAC,UAAU,CAAC,CAAC;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0CH;;;;GAIG;AACH,MAAM,CAAN,IAAY,SAcX;AAdD,WAAY,SAAS;IACpB;;;;;OAKG;IACH,mDAAS,CAAA;IAET;;;OAGG;IACH,mDAAS,CAAA;AACV,CAAC,EAdW,SAAS,KAAT,SAAS,QAcpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAChC;;;;;;;;OAQG;IACH,mEAAS,CAAA;AACV,CAAC,EAXW,qBAAqB,KAArB,qBAAqB,QAWhC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B;;OAEG;IACH,UAAU,EAAE,YAAY;IAExB;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;;;;;OAQG;IACH,eAAe,EAAE,iBAAiB;CAClC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { AttachState, IAudience } from \"@fluidframework/container-definitions\";\nimport type { IDeltaManager } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIDisposable,\n\tIEvent,\n\tIEventProvider,\n\tIFluidHandle,\n\tIRequest,\n\tIResponse,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIProvideFluidHandleContext,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentStorageService,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport type { IProvideFluidDataStoreFactory } from \"./dataStoreFactory.js\";\nimport type { IProvideFluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nimport type {\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n} from \"./garbageCollectionDefinitions.js\";\nimport type { IInboundSignalMessage, IRuntimeMessageCollection } from \"./protocol.js\";\nimport type {\n\tCreateChildSummarizerNodeParam,\n\tISummarizerNodeWithGC,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tSummarizeInternalFn,\n} from \"./summary.js\";\n\n/**\n * Runtime flush mode handling\n * @legacy\n * @alpha\n */\nexport enum FlushMode {\n\t/**\n\t * In Immediate flush mode the runtime will immediately send all operations to the driver layer.\n\t *\n\t * @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.\n\t * See https://github.com/microsoft/FluidFramework/tree/main/packages/runtime/container-runtime/src/opLifecycle#how-batching-works\n\t */\n\tImmediate,\n\n\t/**\n\t * When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single\n\t * batch at the end of the turn. The flush call on the runtime can be used to force send the current batch.\n\t */\n\tTurnBased,\n}\n\n/**\n * @internal\n */\nexport enum FlushModeExperimental {\n\t/**\n\t * When in Async flush mode, the runtime will accumulate all operations across JS turns and send them as a single\n\t * batch when all micro-tasks are complete.\n\t *\n\t * This feature requires a version of the loader which supports reference sequence numbers. If an older version of\n\t * the loader is used, the runtime will fall back on FlushMode.TurnBased.\n\t *\n\t * @experimental - Not ready for use\n\t */\n\tAsync = 2,\n}\n\n/**\n * This tells the visibility state of a Fluid object. It basically tracks whether the object is not visible, visible\n * locally within the container only or visible globally to all clients.\n * @legacy\n * @alpha\n */\nexport const VisibilityState = {\n\t/**\n\t * Indicates that the object is not visible. This is the state when an object is first created.\n\t */\n\tNotVisible: \"NotVisible\",\n\n\t/**\n\t * Indicates that the object is visible locally within the container. This is the state when an object is attached\n\t * to the container's graph but the container itself isn't globally visible. The object's state goes from not\n\t * visible to locally visible.\n\t */\n\tLocallyVisible: \"LocallyVisible\",\n\n\t/**\n\t * Indicates that the object is visible globally to all clients. This is the state of an object in 2 scenarios:\n\t *\n\t * 1. It is attached to the container's graph when the container is globally visible. The object's state goes from\n\t * not visible to globally visible.\n\t *\n\t * 2. When a container becomes globally visible, all locally visible objects go from locally visible to globally\n\t * visible.\n\t */\n\tGloballyVisible: \"GloballyVisible\",\n};\n/**\n * @legacy\n * @alpha\n */\nexport type VisibilityState = (typeof VisibilityState)[keyof typeof VisibilityState];\n\n/**\n * @legacy\n * @alpha\n * @sealed\n */\nexport interface IContainerRuntimeBaseEvents extends IEvent {\n\t/**\n\t * Indicates the beginning of an incoming batch of ops\n\t * @param op - The first op in the batch. Can be inspected to learn about the sequence numbers relevant for this batch.\n\t */\n\t(event: \"batchBegin\", listener: (op: Omit<ISequencedDocumentMessage, \"contents\">) => void);\n\t/**\n\t * Indicates the end of an incoming batch of ops\n\t * @param error - If an error occurred while processing the batch, it is provided here.\n\t * @param op - The last op in the batch. Can be inspected to learn about the sequence numbers relevant for this batch.\n\t */\n\t(\n\t\tevent: \"batchEnd\",\n\t\tlistener: (error: any, op: Omit<ISequencedDocumentMessage, \"contents\">) => void,\n\t);\n\t/**\n\t * Indicates that an incoming op has been processed.\n\t * @param runtimeMessage - tells if op is runtime op. If it is, it was unpacked, i.e. its type and content\n\t * represent internal container runtime type / content. i.e. A grouped batch of N ops will result in N \"op\" events\n\t */\n\t(event: \"op\", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void);\n\t(event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n\t(event: \"dispose\", listener: () => void);\n}\n\n/**\n * Encapsulates the return codes of the aliasing API.\n *\n * 'Success' - the datastore has been successfully aliased. It can now be used.\n * 'Conflict' - there is already a datastore bound to the provided alias. To acquire it's entry point, use\n * the `IContainerRuntime.getAliasedDataStoreEntryPoint` function. The current datastore should be discarded\n * and will be garbage collected. The current datastore cannot be aliased to a different value.\n * 'AlreadyAliased' - the datastore has already been previously bound to another alias name.\n * @legacy\n * @alpha\n */\nexport type AliasResult = \"Success\" | \"Conflict\" | \"AlreadyAliased\";\n\n/**\n * Exposes some functionality/features of a data store:\n * - Handle to the data store's entryPoint\n * - Fluid router for the data store\n * - Can be assigned an alias\n * @legacy\n * @alpha\n */\nexport interface IDataStore {\n\t/**\n\t * Attempt to assign an alias to the datastore.\n\t * If the operation succeeds, the datastore can be referenced\n\t * by the supplied alias and will not be garbage collected.\n\t *\n\t * @param alias - Given alias for this datastore.\n\t * @returns A promise with the {@link AliasResult}\n\t */\n\ttrySetAlias(alias: string): Promise<AliasResult>;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting\n\t * with it.\n\t */\n\treadonly entryPoint: IFluidHandleInternal<FluidObject>;\n}\n\n/**\n * A reduced set of functionality of IContainerRuntime that a data store context/data store runtime will need\n * TODO: this should be merged into IFluidDataStoreContext\n * @legacy\n * @alpha\n * @sealed\n */\nexport interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeBaseEvents> {\n\treadonly baseLogger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\treadonly disposed: boolean;\n\n\t/**\n\t * Invokes the given callback and guarantees that all operations generated within the callback will be ordered\n\t * sequentially.\n\t *\n\t * If the callback throws an error, the container will close and the error will be logged.\n\t */\n\torderSequentially(callback: () => void): void;\n\n\t/**\n\t * Submits a container runtime level signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal. Should be a JSON serializable object or primitive.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\tsubmitSignal: (type: string, content: unknown, targetClientId?: string) => void;\n\n\t/**\n\t * @deprecated 0.16 Issue #1537, #3631\n\t */\n\t_createDataStoreWithProps(\n\t\tpkg: Readonly<string | string[]>,\n\t\tprops?: any,\n\t\tid?: string,\n\t): Promise<IDataStore>;\n\n\t/**\n\t * Creates a data store and returns an object that exposes a handle to the data store's entryPoint, and also serves\n\t * as the data store's router. The data store is not bound to a container, and in such state is not persisted to\n\t * storage (file). Storing the entryPoint handle (or any other handle inside the data store, e.g. for DDS) into an\n\t * already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this\n\t * store being attached to storage.\n\t * @param pkg - Package name of the data store factory\n\t * @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.\n\t * When not specified the datastore will belong to a `default` group. Read more about it in this\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}\n\t */\n\tcreateDataStore(\n\t\tpkg: Readonly<string | string[]>,\n\t\tloadingGroupId?: string,\n\t): Promise<IDataStore>;\n\n\t/**\n\t * Creates detached data store context. Only after context.attachRuntime() is called,\n\t * data store initialization is considered complete.\n\t * @param pkg - Package name of the data store factory\n\t * @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.\n\t * When not specified the datastore will belong to a `default` group. Read more about it in this\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}.\n\t */\n\tcreateDetachedDataStore(\n\t\tpkg: Readonly<string[]>,\n\t\tloadingGroupId?: string,\n\t): IFluidDataStoreContextDetached;\n\n\t/**\n\t * Returns the aliased data store's entryPoint, given the alias.\n\t * @param alias - The alias for the data store.\n\t * @returns The data store's entry point ({@link @fluidframework/core-interfaces#IFluidHandle}) if it exists and is aliased.\n\t * Returns undefined if no data store has been assigned the given alias.\n\t */\n\tgetAliasedDataStoreEntryPoint(alias: string): Promise<IFluidHandle<FluidObject> | undefined>;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tuploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandle<ArrayBufferLike>>;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n\n\t/**\n\t * Generates a new ID that is guaranteed to be unique across all sessions for this container.\n\t * It could be in compact form (non-negative integer, oppotunistic), but it could also be UUID string.\n\t * UUIDs generated will have low entropy in groups and will compress well.\n\t * It can be leveraged anywhere in container where container unique IDs are required, i.e. any place\n\t * that uses uuid() and stores result in container is likely candidate to start leveraging this API.\n\t * If you always want to convert to string, instead of doing String(generateDocumentUniqueId()), consider\n\t * doing encodeCompactIdToString(generateDocumentUniqueId()).\n\t *\n\t * For more details, please see IIdCompressor.generateDocumentUniqueId()\n\t */\n\tgenerateDocumentUniqueId(): number | string;\n\n\t/**\n\t * Api to fetch the snapshot from the service for a loadingGroupIds.\n\t * @param loadingGroupIds - LoadingGroupId for which the snapshot is asked for.\n\t * @param pathParts - Parts of the path, which we want to extract from the snapshot tree.\n\t * @returns - snapshotTree and the sequence number of the snapshot.\n\t */\n\tgetSnapshotForLoadingGroupId(\n\t\tloadingGroupIds: string[],\n\t\tpathParts: string[],\n\t): Promise<{ snapshotTree: ISnapshotTree; sequenceNumber: number }>;\n}\n\n/**\n * Minimal interface a data store runtime needs to provide for IFluidDataStoreContext to bind to control.\n *\n * Functionality include attach, snapshot, op/signal processing, request routes, expose an entryPoint,\n * and connection state notifications\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreChannel extends IDisposable {\n\t/**\n\t * Makes the data store channel visible in the container. Also, runs through its graph and attaches all\n\t * bound handles that represent its dependencies in the container's graph.\n\t */\n\tmakeVisibleAndAttachGraph(): void;\n\n\t/**\n\t * Synchronously retrieves the summary used as part of the initial summary message\n\t */\n\tgetAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;\n\n\t/**\n\t * Synchronously retrieves GC Data (representing the outbound routes present) for the initial state of the DataStore\n\t */\n\tgetAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData;\n\n\t/**\n\t * Process messages for this channel. The messages here are contiguous messages in a batch.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tprocessMessages?(messageCollection: IRuntimeMessageCollection): void;\n\n\t/**\n\t * Processes the op.\n\t * @deprecated processMessages should be used instead to process messages for a channel.\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;\n\n\t/**\n\t * Processes the signal.\n\t */\n\tprocessSignal(message: IInboundSignalMessage, local: boolean): void;\n\n\t/**\n\t * Generates a summary for the channel.\n\t * Introduced with summarizerNode - will be required in a future release.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree.\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tsummarize(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats>;\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context\n\t * including any of its children. Each node has a list of outbound routes to other GC nodes in the document.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n\t/**\n\t * After GC has run, called to notify this channel of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in this channel.\n\t */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n\n\t/**\n\t * Notifies this object about changes in the connection state.\n\t * @param value - New connection state.\n\t * @param clientId - ID of the client. It's old ID when in disconnected state and\n\t * it's new client ID when we are connecting or connected.\n\t */\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\t/**\n\t * Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\treSubmit(type: string, content: any, localOpMetadata: unknown);\n\n\tapplyStashedOp(content: any): Promise<unknown>;\n\n\t/**\n\t * Revert a local message.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\trollback?(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting\n\t * with the component.\n\t */\n\treadonly entryPoint: IFluidHandleInternal<FluidObject>;\n\n\trequest(request: IRequest): Promise<IResponse>;\n\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport type CreateChildSummarizerNodeFn = (\n\tsummarizeInternal: SummarizeInternalFn,\n\tgetGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t/**\n\t * @deprecated The functionality to get base GC details has been moved to summarizer node.\n\t */\n\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n) => ISummarizerNodeWithGC;\n\n/**\n * The state maintained for messages that are received when a channel isn't yet loaded.\n * @internal\n */\nexport interface IPendingMessagesState {\n\tmessageCollections: IRuntimeMessageCollection[];\n\tpendingCount: number;\n}\n\n/**\n * Represents the context for the data store like objects. It is used by the data store runtime to\n * get information and call functionality to its parent.\n *\n * This layout is temporary, as {@link IFluidParentContext} and {@link IFluidDataStoreContext} will converge.\n *\n * @legacy\n * @alpha\n */\nexport interface IFluidParentContext\n\textends IProvideFluidHandleContext,\n\t\tPartial<IProvideFluidDataStoreRegistry> {\n\treadonly options: Record<string | number, any>;\n\treadonly clientId: string | undefined;\n\treadonly connected: boolean;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly storage: IDocumentStorageService;\n\treadonly baseLogger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\treadonly idCompressor?: IIdCompressor;\n\t/**\n\t * Represents the loading group to which the data store belongs to. Please refer to this readme for more context.\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}\n\t */\n\treadonly loadingGroupId?: string;\n\t/**\n\t * Indicates the attachment state of the data store to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\treadonly containerRuntime: IContainerRuntimeBase;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * @deprecated this functionality has been removed.\n\t */\n\treadonly gcThrowOnTombstoneUsage: boolean;\n\t/**\n\t * @deprecated this functionality has been removed.\n\t */\n\treadonly gcTombstoneEnforcementAllowed: boolean;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n\n\t/**\n\t * Submits the message to be sent to other clients.\n\t * @param type - Type of the message.\n\t * @param content - Content of the message.\n\t * @param localOpMetadata - The local metadata associated with the message. This is kept locally and not sent to\n\t * the server. This will be sent back when this message is received back from the server. This is also sent if\n\t * we are asked to resubmit the message.\n\t */\n\tsubmitMessage(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Submits the signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal. Should be a JSON serializable object or primitive.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\tsubmitSignal: (type: string, content: unknown, targetClientId?: string) => void;\n\n\t/**\n\t * Called to make the data store locally visible in the container. This happens automatically for root data stores\n\t * when they are marked as root. For non-root data stores, this happens when their handle is added to a visible DDS.\n\t */\n\tmakeLocallyVisible(): void;\n\n\t/**\n\t * Get an absolute url to the container based on the provided relativeUrl.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tgetCreateChildSummarizerNodeFn(\n\t\t/**\n\t\t * Initial id or path part of this node\n\t\t */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t * If it is local, it will throw unsupported errors on calls to summarize.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t): CreateChildSummarizerNodeFn;\n\n\tdeleteChildSummarizerNode(id: string): void;\n\n\tuploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandleInternal<ArrayBufferLike>>;\n\n\t/**\n\t * Called by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.\n\t * @param address - The address of the channel that is dirty.\n\t */\n\tsetChannelDirty(address: string): void;\n\n\t/**\n\t * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n\t * all references added in the system.\n\t *\n\t * @param fromPath - The absolute path of the node that added the reference.\n\t * @param toPath - The absolute path of the outbound node that is referenced.\n\t * @param messageTimestampMs - The timestamp of the message that added the reference.\n\t */\n\taddedGCOutboundRoute(fromPath: string, toPath: string, messageTimestampMs?: number): void;\n}\n\n/**\n * Represents the context for the data store. It is used by the data store runtime to\n * get information and call functionality to the container.\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreContext extends IFluidParentContext {\n\treadonly id: string;\n\t/**\n\t * A data store created by a client, is a local data store for that client. Also, when a detached container loads\n\t * from a snapshot, all the data stores are treated as local data stores because at that stage the container\n\t * still doesn't exists in storage and so the data store couldn't have been created by any other client.\n\t * Value of this never changes even after the data store is attached.\n\t * As implementer of data store runtime, you can use this property to check that this data store belongs to this\n\t * client and hence implement any scenario based on that.\n\t */\n\treadonly isLocalDataStore: boolean;\n\t/**\n\t * The package path of the data store as per the package factory.\n\t */\n\treadonly packagePath: readonly string[];\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\n\t/**\n\t * @deprecated 0.16 Issue #1635, #3631\n\t */\n\treadonly createProps?: any;\n\n\t/**\n\t * @deprecated The functionality to get base GC details has been moved to summarizer node.\n\t *\n\t * Returns the GC details in the initial summary of this data store. This is used to initialize the data store\n\t * and its children with the GC details from the previous summary.\n\t */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {\n\t/**\n\t * Binds a runtime to the context.\n\t */\n\tattachRuntime(\n\t\tfactory: IProvideFluidDataStoreFactory,\n\t\tdataStoreRuntime: IFluidDataStoreChannel,\n\t): Promise<IDataStore>;\n}\n"]}
1
+ {"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6CH;;;;GAIG;AACH,MAAM,CAAN,IAAY,SAcX;AAdD,WAAY,SAAS;IACpB;;;;;OAKG;IACH,mDAAS,CAAA;IAET;;;OAGG;IACH,mDAAS,CAAA;AACV,CAAC,EAdW,SAAS,KAAT,SAAS,QAcpB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAChC;;;;;;;;OAQG;IACH,mEAAS,CAAA;AACV,CAAC,EAXW,qBAAqB,KAArB,qBAAqB,QAWhC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B;;OAEG;IACH,UAAU,EAAE,YAAY;IAExB;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;;;;;OAQG;IACH,eAAe,EAAE,iBAAiB;CAClC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { AttachState, IAudience } from \"@fluidframework/container-definitions\";\nimport type { IDeltaManager } from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tFluidObject,\n\tIDisposable,\n\tIEvent,\n\tIEventProvider,\n\tIFluidHandle,\n\tIRequest,\n\tIResponse,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\tIProvideFluidHandleContext,\n} from \"@fluidframework/core-interfaces/internal\";\nimport type { IClientDetails, IQuorumClients } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentStorageService,\n\tIDocumentMessage,\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport type {\n\tIFluidDataStoreFactory,\n\tIProvideFluidDataStoreFactory,\n} from \"./dataStoreFactory.js\";\nimport type { IProvideFluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nimport type {\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n} from \"./garbageCollectionDefinitions.js\";\nimport type { IInboundSignalMessage, IRuntimeMessageCollection } from \"./protocol.js\";\nimport type {\n\tCreateChildSummarizerNodeParam,\n\tISummarizerNodeWithGC,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tSummarizeInternalFn,\n} from \"./summary.js\";\n\n/**\n * Runtime flush mode handling\n * @legacy\n * @alpha\n */\nexport enum FlushMode {\n\t/**\n\t * In Immediate flush mode the runtime will immediately send all operations to the driver layer.\n\t *\n\t * @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.\n\t * See https://github.com/microsoft/FluidFramework/tree/main/packages/runtime/container-runtime/src/opLifecycle#how-batching-works\n\t */\n\tImmediate,\n\n\t/**\n\t * When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single\n\t * batch at the end of the turn. The flush call on the runtime can be used to force send the current batch.\n\t */\n\tTurnBased,\n}\n\n/**\n * @internal\n */\nexport enum FlushModeExperimental {\n\t/**\n\t * When in Async flush mode, the runtime will accumulate all operations across JS turns and send them as a single\n\t * batch when all micro-tasks are complete.\n\t *\n\t * This feature requires a version of the loader which supports reference sequence numbers. If an older version of\n\t * the loader is used, the runtime will fall back on FlushMode.TurnBased.\n\t *\n\t * @experimental - Not ready for use\n\t */\n\tAsync = 2,\n}\n\n/**\n * This tells the visibility state of a Fluid object. It basically tracks whether the object is not visible, visible\n * locally within the container only or visible globally to all clients.\n * @legacy\n * @alpha\n */\nexport const VisibilityState = {\n\t/**\n\t * Indicates that the object is not visible. This is the state when an object is first created.\n\t */\n\tNotVisible: \"NotVisible\",\n\n\t/**\n\t * Indicates that the object is visible locally within the container. This is the state when an object is attached\n\t * to the container's graph but the container itself isn't globally visible. The object's state goes from not\n\t * visible to locally visible.\n\t */\n\tLocallyVisible: \"LocallyVisible\",\n\n\t/**\n\t * Indicates that the object is visible globally to all clients. This is the state of an object in 2 scenarios:\n\t *\n\t * 1. It is attached to the container's graph when the container is globally visible. The object's state goes from\n\t * not visible to globally visible.\n\t *\n\t * 2. When a container becomes globally visible, all locally visible objects go from locally visible to globally\n\t * visible.\n\t */\n\tGloballyVisible: \"GloballyVisible\",\n};\n/**\n * @legacy\n * @alpha\n */\nexport type VisibilityState = (typeof VisibilityState)[keyof typeof VisibilityState];\n\n/**\n * @legacy\n * @alpha\n * @sealed\n */\nexport interface IContainerRuntimeBaseEvents extends IEvent {\n\t/**\n\t * Indicates the beginning of an incoming batch of ops\n\t * @param op - The first op in the batch. Can be inspected to learn about the sequence numbers relevant for this batch.\n\t */\n\t(event: \"batchBegin\", listener: (op: Omit<ISequencedDocumentMessage, \"contents\">) => void);\n\t/**\n\t * Indicates the end of an incoming batch of ops\n\t * @param error - If an error occurred while processing the batch, it is provided here.\n\t * @param op - The last op in the batch. Can be inspected to learn about the sequence numbers relevant for this batch.\n\t */\n\t(\n\t\tevent: \"batchEnd\",\n\t\tlistener: (error: any, op: Omit<ISequencedDocumentMessage, \"contents\">) => void,\n\t);\n\t/**\n\t * Indicates that an incoming op has been processed.\n\t * @param runtimeMessage - tells if op is runtime op. If it is, it was unpacked, i.e. its type and content\n\t * represent internal container runtime type / content. i.e. A grouped batch of N ops will result in N \"op\" events\n\t */\n\t(event: \"op\", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void);\n\t(event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n\t(event: \"dispose\", listener: () => void);\n}\n\n/**\n * Encapsulates the return codes of the aliasing API.\n *\n * 'Success' - the datastore has been successfully aliased. It can now be used.\n * 'Conflict' - there is already a datastore bound to the provided alias. To acquire it's entry point, use\n * the `IContainerRuntime.getAliasedDataStoreEntryPoint` function. The current datastore should be discarded\n * and will be garbage collected. The current datastore cannot be aliased to a different value.\n * 'AlreadyAliased' - the datastore has already been previously bound to another alias name.\n * @legacy\n * @alpha\n */\nexport type AliasResult = \"Success\" | \"Conflict\" | \"AlreadyAliased\";\n\n/**\n * Exposes some functionality/features of a data store:\n * - Handle to the data store's entryPoint\n * - Fluid router for the data store\n * - Can be assigned an alias\n * @legacy\n * @alpha\n */\nexport interface IDataStore {\n\t/**\n\t * Attempt to assign an alias to the datastore.\n\t * If the operation succeeds, the datastore can be referenced\n\t * by the supplied alias and will not be garbage collected.\n\t *\n\t * @param alias - Given alias for this datastore.\n\t * @returns A promise with the {@link AliasResult}\n\t */\n\ttrySetAlias(alias: string): Promise<AliasResult>;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting\n\t * with it.\n\t */\n\treadonly entryPoint: IFluidHandleInternal<FluidObject>;\n}\n\n/**\n * A reduced set of functionality of IContainerRuntime that a data store context/data store runtime will need\n * TODO: this should be merged into IFluidDataStoreContext\n * @legacy\n * @alpha\n * @sealed\n */\nexport interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeBaseEvents> {\n\treadonly baseLogger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\treadonly disposed: boolean;\n\n\t/**\n\t * Invokes the given callback and guarantees that all operations generated within the callback will be ordered\n\t * sequentially.\n\t *\n\t * If the callback throws an error, the container will close and the error will be logged.\n\t */\n\torderSequentially(callback: () => void): void;\n\n\t/**\n\t * Submits a container runtime level signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal. Should be a JSON serializable object or primitive.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\tsubmitSignal: (type: string, content: unknown, targetClientId?: string) => void;\n\n\t/**\n\t * @deprecated 0.16 Issue #1537, #3631\n\t */\n\t_createDataStoreWithProps(\n\t\tpkg: Readonly<string | string[]>,\n\t\tprops?: any,\n\t\tid?: string,\n\t): Promise<IDataStore>;\n\n\t/**\n\t * Creates a data store and returns an object that exposes a handle to the data store's entryPoint, and also serves\n\t * as the data store's router. The data store is not bound to a container, and in such state is not persisted to\n\t * storage (file). Storing the entryPoint handle (or any other handle inside the data store, e.g. for DDS) into an\n\t * already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this\n\t * store being attached to storage.\n\t * @param pkg - Package name of the data store factory\n\t * @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.\n\t * When not specified the datastore will belong to a `default` group. Read more about it in this\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}\n\t */\n\tcreateDataStore(\n\t\tpkg: Readonly<string | string[]>,\n\t\tloadingGroupId?: string,\n\t): Promise<IDataStore>;\n\n\t/**\n\t * Creates detached data store context. Only after context.attachRuntime() is called,\n\t * data store initialization is considered complete.\n\t * @param pkg - Package name of the data store factory\n\t * @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.\n\t * When not specified the datastore will belong to a `default` group. Read more about it in this\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}.\n\t */\n\tcreateDetachedDataStore(\n\t\tpkg: Readonly<string[]>,\n\t\tloadingGroupId?: string,\n\t): IFluidDataStoreContextDetached;\n\n\t/**\n\t * Returns the aliased data store's entryPoint, given the alias.\n\t * @param alias - The alias for the data store.\n\t * @returns The data store's entry point ({@link @fluidframework/core-interfaces#IFluidHandle}) if it exists and is aliased.\n\t * Returns undefined if no data store has been assigned the given alias.\n\t */\n\tgetAliasedDataStoreEntryPoint(alias: string): Promise<IFluidHandle<FluidObject> | undefined>;\n\n\t/**\n\t * Get an absolute url for a provided container-relative request.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tuploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandle<ArrayBufferLike>>;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n\n\t/**\n\t * Generates a new ID that is guaranteed to be unique across all sessions for this container.\n\t * It could be in compact form (non-negative integer, oppotunistic), but it could also be UUID string.\n\t * UUIDs generated will have low entropy in groups and will compress well.\n\t * It can be leveraged anywhere in container where container unique IDs are required, i.e. any place\n\t * that uses uuid() and stores result in container is likely candidate to start leveraging this API.\n\t * If you always want to convert to string, instead of doing String(generateDocumentUniqueId()), consider\n\t * doing encodeCompactIdToString(generateDocumentUniqueId()).\n\t *\n\t * For more details, please see IIdCompressor.generateDocumentUniqueId()\n\t */\n\tgenerateDocumentUniqueId(): number | string;\n\n\t/**\n\t * Api to fetch the snapshot from the service for a loadingGroupIds.\n\t * @param loadingGroupIds - LoadingGroupId for which the snapshot is asked for.\n\t * @param pathParts - Parts of the path, which we want to extract from the snapshot tree.\n\t * @returns - snapshotTree and the sequence number of the snapshot.\n\t */\n\tgetSnapshotForLoadingGroupId(\n\t\tloadingGroupIds: string[],\n\t\tpathParts: string[],\n\t): Promise<{ snapshotTree: ISnapshotTree; sequenceNumber: number }>;\n}\n\n/**\n * Minimal interface a data store runtime needs to provide for IFluidDataStoreContext to bind to control.\n *\n * Functionality include attach, snapshot, op/signal processing, request routes, expose an entryPoint,\n * and connection state notifications\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreChannel extends IDisposable {\n\t/**\n\t * Makes the data store channel visible in the container. Also, runs through its graph and attaches all\n\t * bound handles that represent its dependencies in the container's graph.\n\t */\n\tmakeVisibleAndAttachGraph(): void;\n\n\t/**\n\t * Synchronously retrieves the summary used as part of the initial summary message\n\t */\n\tgetAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;\n\n\t/**\n\t * Synchronously retrieves GC Data (representing the outbound routes present) for the initial state of the DataStore\n\t */\n\tgetAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData;\n\n\t/**\n\t * Process messages for this channel. The messages here are contiguous messages in a batch.\n\t * @param messageCollection - The collection of messages to process.\n\t */\n\tprocessMessages?(messageCollection: IRuntimeMessageCollection): void;\n\n\t/**\n\t * Processes the op.\n\t * @deprecated processMessages should be used instead to process messages for a channel.\n\t */\n\tprocess(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;\n\n\t/**\n\t * Processes the signal.\n\t */\n\tprocessSignal(message: IInboundSignalMessage, local: boolean): void;\n\n\t/**\n\t * Generates a summary for the channel.\n\t * Introduced with summarizerNode - will be required in a future release.\n\t * @param fullTree - true to bypass optimizations and force a full summary tree.\n\t * @param trackState - This tells whether we should track state from this summary.\n\t * @param telemetryContext - summary data passed through the layers for telemetry purposes\n\t */\n\tsummarize(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats>;\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context\n\t * including any of its children. Each node has a list of outbound routes to other GC nodes in the document.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n\t/**\n\t * After GC has run, called to notify this channel of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in this channel.\n\t */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n\n\t/**\n\t * Notifies this object about changes in the connection state.\n\t * @param value - New connection state.\n\t * @param clientId - ID of the client. It's old ID when in disconnected state and\n\t * it's new client ID when we are connecting or connected.\n\t */\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\t/**\n\t * Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\treSubmit(type: string, content: any, localOpMetadata: unknown);\n\n\tapplyStashedOp(content: any): Promise<unknown>;\n\n\t/**\n\t * Revert a local message.\n\t * @param type - The type of the original message.\n\t * @param content - The content of the original message.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\trollback?(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting\n\t * with the component.\n\t */\n\treadonly entryPoint: IFluidHandleInternal<FluidObject>;\n\n\trequest(request: IRequest): Promise<IResponse>;\n\n\tsetAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport type CreateChildSummarizerNodeFn = (\n\tsummarizeInternal: SummarizeInternalFn,\n\tgetGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t/**\n\t * @deprecated The functionality to get base GC details has been moved to summarizer node.\n\t */\n\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n) => ISummarizerNodeWithGC;\n\n/**\n * The state maintained for messages that are received when a channel isn't yet loaded.\n * @internal\n */\nexport interface IPendingMessagesState {\n\tmessageCollections: IRuntimeMessageCollection[];\n\tpendingCount: number;\n}\n\n/**\n * Represents the context for the data store like objects. It is used by the data store runtime to\n * get information and call functionality to its parent.\n *\n * This layout is temporary, as {@link IFluidParentContext} and {@link IFluidDataStoreContext} will converge.\n *\n * @legacy\n * @alpha\n */\nexport interface IFluidParentContext\n\textends IProvideFluidHandleContext,\n\t\tPartial<IProvideFluidDataStoreRegistry> {\n\treadonly options: Record<string | number, any>;\n\treadonly clientId: string | undefined;\n\treadonly connected: boolean;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\treadonly storage: IDocumentStorageService;\n\treadonly baseLogger: ITelemetryBaseLogger;\n\treadonly clientDetails: IClientDetails;\n\treadonly idCompressor?: IIdCompressor;\n\t/**\n\t * Represents the loading group to which the data store belongs to. Please refer to this readme for more context.\n\t * {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}\n\t */\n\treadonly loadingGroupId?: string;\n\t/**\n\t * Indicates the attachment state of the data store to a host service.\n\t */\n\treadonly attachState: AttachState;\n\n\treadonly containerRuntime: IContainerRuntimeBase;\n\n\t/**\n\t * Ambient services provided with the context\n\t */\n\treadonly scope: FluidObject;\n\n\t/**\n\t * @deprecated this functionality has been removed.\n\t */\n\treadonly gcThrowOnTombstoneUsage: boolean;\n\t/**\n\t * @deprecated this functionality has been removed.\n\t */\n\treadonly gcTombstoneEnforcementAllowed: boolean;\n\n\t/**\n\t * Returns the current quorum.\n\t */\n\tgetQuorum(): IQuorumClients;\n\n\t/**\n\t * Returns the current audience.\n\t */\n\tgetAudience(): IAudience;\n\n\t/**\n\t * Submits the message to be sent to other clients.\n\t * @param type - Type of the message.\n\t * @param content - Content of the message.\n\t * @param localOpMetadata - The local metadata associated with the message. This is kept locally and not sent to\n\t * the server. This will be sent back when this message is received back from the server. This is also sent if\n\t * we are asked to resubmit the message.\n\t */\n\tsubmitMessage(type: string, content: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Submits the signal to be sent to other clients.\n\t * @param type - Type of the signal.\n\t * @param content - Content of the signal. Should be a JSON serializable object or primitive.\n\t * @param targetClientId - When specified, the signal is only sent to the provided client id.\n\t */\n\tsubmitSignal: (type: string, content: unknown, targetClientId?: string) => void;\n\n\t/**\n\t * Called to make the data store locally visible in the container. This happens automatically for root data stores\n\t * when they are marked as root. For non-root data stores, this happens when their handle is added to a visible DDS.\n\t */\n\tmakeLocallyVisible(): void;\n\n\t/**\n\t * Get an absolute url to the container based on the provided relativeUrl.\n\t * Returns undefined if the container or data store isn't attached to storage.\n\t * @param relativeUrl - A relative request within the container\n\t */\n\tgetAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n\tgetCreateChildSummarizerNodeFn(\n\t\t/**\n\t\t * Initial id or path part of this node\n\t\t */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t * If it is local, it will throw unsupported errors on calls to summarize.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t): CreateChildSummarizerNodeFn;\n\n\tdeleteChildSummarizerNode(id: string): void;\n\n\tuploadBlob(\n\t\tblob: ArrayBufferLike,\n\t\tsignal?: AbortSignal,\n\t): Promise<IFluidHandleInternal<ArrayBufferLike>>;\n\n\t/**\n\t * Called by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.\n\t * @param address - The address of the channel that is dirty.\n\t */\n\tsetChannelDirty(address: string): void;\n\n\t/**\n\t * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n\t * all references added in the system.\n\t *\n\t * @param fromPath - The absolute path of the node that added the reference.\n\t * @param toPath - The absolute path of the outbound node that is referenced.\n\t * @param messageTimestampMs - The timestamp of the message that added the reference.\n\t */\n\taddedGCOutboundRoute(fromPath: string, toPath: string, messageTimestampMs?: number): void;\n}\n\n/**\n * Represents the context for the data store. It is used by the data store runtime to\n * get information and call functionality to the container.\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreContext extends IFluidParentContext {\n\treadonly id: string;\n\t/**\n\t * A data store created by a client, is a local data store for that client. Also, when a detached container loads\n\t * from a snapshot, all the data stores are treated as local data stores because at that stage the container\n\t * still doesn't exists in storage and so the data store couldn't have been created by any other client.\n\t * Value of this never changes even after the data store is attached.\n\t * As implementer of data store runtime, you can use this property to check that this data store belongs to this\n\t * client and hence implement any scenario based on that.\n\t */\n\treadonly isLocalDataStore: boolean;\n\t/**\n\t * The package path of the data store as per the package factory.\n\t */\n\treadonly packagePath: readonly string[];\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\n\t/**\n\t * @deprecated 0.16 Issue #1635, #3631\n\t */\n\treadonly createProps?: any;\n\n\t/**\n\t * @deprecated The functionality to get base GC details has been moved to summarizer node.\n\t *\n\t * Returns the GC details in the initial summary of this data store. This is used to initialize the data store\n\t * and its children with the GC details from the previous summary.\n\t */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\n\t/**\n\t * Synchronously creates a detached child data store.\n\t *\n\t * The `createChildDataStore` method allows for the synchronous creation of a detached child data store. This is particularly\n\t * useful in scenarios where immediate availability of the child data store is required, such as during the initialization\n\t * of a parent data store, or when creation is in response to synchronous user input.\n\t *\n\t * In order for this function to succeed:\n\t * 1. The parent data store's factory must also be an `IFluidDataStoreRegistry`.\n\t * 2. The parent data store's registry must include the same instance as the provided child factory.\n\t * 3. The parent data store's registry must synchronously provide the child factory via the `getSync` method.\n\t * 4. The child factory must implement the `createDataStore` method.\n\t *\n\t * These invariants ensure that the child data store can also be created by a remote client running the same code as this client.\n\t *\n\t * @param childFactory - The factory of the data store to be created.\n\t * @returns The created data store channel.\n\t */\n\tcreateChildDataStore?<T extends IFluidDataStoreFactory>(\n\t\tchildFactory: T,\n\t): ReturnType<Exclude<T[\"createDataStore\"], undefined>>;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {\n\t/**\n\t * Binds a runtime to the context.\n\t */\n\tattachRuntime(\n\t\tfactory: IProvideFluidDataStoreFactory,\n\t\tdataStoreRuntime: IFluidDataStoreChannel,\n\t): Promise<IDataStore>;\n}\n"]}
@@ -16,21 +16,61 @@ export interface IProvideFluidDataStoreFactory {
16
16
  readonly IFluidDataStoreFactory: IFluidDataStoreFactory;
17
17
  }
18
18
  /**
19
- * IFluidDataStoreFactory create data stores. It is associated with an identifier (its `type` member)
20
- * and usually provided to consumers using this mapping through a data store registry.
19
+ * The `IFluidDataStoreFactory` interface is responsible for creating data stores.
20
+ * A data store is a component that manages a specific set of data and its operations.
21
+ * It encapsulates the logic for data management, synchronization, and interaction
22
+ * with other components within a Fluid container.
23
+ *
24
+ * Data stores are fundamental building blocks in the Fluid Framework. They are used
25
+ * to store and manage state, handle operations, and provide APIs for interacting
26
+ * with the data. Each data store type is associated with a unique identifier (its `type` member)
27
+ * and is typically provided to consumers through a data store registry.
28
+ *
29
+ * The factory is responsible for creating new instances of data stores and loading existing ones.
30
+ * The factory ensures that the data store is correctly initialized.
31
+ *
21
32
  * @legacy
22
33
  * @alpha
23
34
  */
24
35
  export interface IFluidDataStoreFactory extends IProvideFluidDataStoreFactory {
25
36
  /**
26
- * String that uniquely identifies the type of data store created by this factory.
37
+ * Uniquely identifies the type of data store created by this factory.
27
38
  */
28
39
  type: string;
29
40
  /**
30
- * Generates runtime for the data store from the data store context. Once created should be bound to the context.
31
- * @param context - Context for the data store.
32
- * @param existing - If instantiating from an existing file.
41
+ * Asynchronously generates the runtime for the data store from the given context.
42
+ * @remarks
43
+ * Once created, the data store should be bound to the context.
44
+ *
45
+ * This method supports both creation and loading paths. It is important to differentiate
46
+ * between the two based on the `existing` parameter:
47
+ * - When `existing` is false, this method creates a new data store.
48
+ * - When `existing` is true, it loads a pre-existing data store.
49
+ *
50
+ * @param context - The context for the data store, providing necessary information and services.
51
+ * @param existing - A boolean indicating whether the data store is being instantiated from an existing file.
52
+ * @returns A promise that resolves to the created data store channel.
33
53
  */
34
54
  instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<IFluidDataStoreChannel>;
55
+ /**
56
+ * Synchronously creates a new runtime for a new data store from the provided context.
57
+ *
58
+ * @remarks
59
+ * This method enables a synchronous creation path. Specifically, if this factory is registered
60
+ * as a child factory in another data store's registry, and the registry synchronously provides
61
+ * this factory, it becomes eligible for synchronous creation via the parent data store's context.
62
+ * After creation, all subsequent loads of a data store created through this method will utilize
63
+ * the asynchronous `instantiateDataStore` method on this factory.
64
+ *
65
+ * Note: This method is optional. Not all data stores can or will support a synchronous creation path,
66
+ * as being synchronous imposes limitations on the capabilities that can be used. Generally, this
67
+ * creation path should only be implemented when synchronous creation is necessary.
68
+ *
69
+ * @param context - The context for the data store, providing the necessary information and services.
70
+ * @returns An object containing the runtime of the created data store channel.
71
+ */
72
+ createDataStore?(context: IFluidDataStoreContext): {
73
+ readonly runtime: IFluidDataStoreChannel;
74
+ };
35
75
  }
36
76
  //# sourceMappingURL=dataStoreFactory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreFactory.d.ts","sourceRoot":"","sources":["../src/dataStoreFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE5F;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,6BAClB,CAAC;AAE1B;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC7C,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;CACxD;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAuB,SAAQ,6BAA6B;IAC5E;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,oBAAoB,CACnB,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,sBAAsB,CAAC,CAAC;CACnC"}
1
+ {"version":3,"file":"dataStoreFactory.d.ts","sourceRoot":"","sources":["../src/dataStoreFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE5F;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,6BAClB,CAAC;AAE1B;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC7C,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;CACxD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,sBAAuB,SAAQ,6BAA6B;IAC5E;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CACnB,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAEnC;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CAAC,CAAC,OAAO,EAAE,sBAAsB,GAAG;QAClD,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;KACzC,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreFactory.js","sourceRoot":"","sources":["../src/dataStoreFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAClC,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidDataStoreChannel, IFluidDataStoreContext } from \"./dataStoreContext.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidDataStoreFactory: keyof IProvideFluidDataStoreFactory =\n\t\"IFluidDataStoreFactory\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidDataStoreFactory {\n\treadonly IFluidDataStoreFactory: IFluidDataStoreFactory;\n}\n\n/**\n * IFluidDataStoreFactory create data stores. It is associated with an identifier (its `type` member)\n * and usually provided to consumers using this mapping through a data store registry.\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreFactory extends IProvideFluidDataStoreFactory {\n\t/**\n\t * String that uniquely identifies the type of data store created by this factory.\n\t */\n\ttype: string;\n\n\t/**\n\t * Generates runtime for the data store from the data store context. Once created should be bound to the context.\n\t * @param context - Context for the data store.\n\t * @param existing - If instantiating from an existing file.\n\t */\n\tinstantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<IFluidDataStoreChannel>;\n}\n"]}
1
+ {"version":3,"file":"dataStoreFactory.js","sourceRoot":"","sources":["../src/dataStoreFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAClC,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IFluidDataStoreChannel, IFluidDataStoreContext } from \"./dataStoreContext.js\";\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidDataStoreFactory: keyof IProvideFluidDataStoreFactory =\n\t\"IFluidDataStoreFactory\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidDataStoreFactory {\n\treadonly IFluidDataStoreFactory: IFluidDataStoreFactory;\n}\n\n/**\n * The `IFluidDataStoreFactory` interface is responsible for creating data stores.\n * A data store is a component that manages a specific set of data and its operations.\n * It encapsulates the logic for data management, synchronization, and interaction\n * with other components within a Fluid container.\n *\n * Data stores are fundamental building blocks in the Fluid Framework. They are used\n * to store and manage state, handle operations, and provide APIs for interacting\n * with the data. Each data store type is associated with a unique identifier (its `type` member)\n * and is typically provided to consumers through a data store registry.\n *\n * The factory is responsible for creating new instances of data stores and loading existing ones.\n * The factory ensures that the data store is correctly initialized.\n *\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreFactory extends IProvideFluidDataStoreFactory {\n\t/**\n\t * Uniquely identifies the type of data store created by this factory.\n\t */\n\ttype: string;\n\n\t/**\n\t * Asynchronously generates the runtime for the data store from the given context.\n\t * @remarks\n\t * Once created, the data store should be bound to the context.\n\t *\n\t * This method supports both creation and loading paths. It is important to differentiate\n\t * between the two based on the `existing` parameter:\n\t * - When `existing` is false, this method creates a new data store.\n\t * - When `existing` is true, it loads a pre-existing data store.\n\t *\n\t * @param context - The context for the data store, providing necessary information and services.\n\t * @param existing - A boolean indicating whether the data store is being instantiated from an existing file.\n\t * @returns A promise that resolves to the created data store channel.\n\t */\n\tinstantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<IFluidDataStoreChannel>;\n\n\t/**\n\t * Synchronously creates a new runtime for a new data store from the provided context.\n\t *\n\t * @remarks\n\t * This method enables a synchronous creation path. Specifically, if this factory is registered\n\t * as a child factory in another data store's registry, and the registry synchronously provides\n\t * this factory, it becomes eligible for synchronous creation via the parent data store's context.\n\t * After creation, all subsequent loads of a data store created through this method will utilize\n\t * the asynchronous `instantiateDataStore` method on this factory.\n\t *\n\t * Note: This method is optional. Not all data stores can or will support a synchronous creation path,\n\t * as being synchronous imposes limitations on the capabilities that can be used. Generally, this\n\t * creation path should only be implemented when synchronous creation is necessary.\n\t *\n\t * @param context - The context for the data store, providing the necessary information and services.\n\t * @returns An object containing the runtime of the created data store channel.\n\t */\n\tcreateDataStore?(context: IFluidDataStoreContext): {\n\t\treadonly runtime: IFluidDataStoreChannel;\n\t};\n}\n"]}
@@ -17,12 +17,22 @@ export type FluidDataStoreRegistryEntry = Readonly<Partial<IProvideFluidDataStor
17
17
  * @alpha
18
18
  */
19
19
  export type NamedFluidDataStoreRegistryEntry = [string, Promise<FluidDataStoreRegistryEntry>];
20
+ /**
21
+ * An associated pair of an identifier and registry entry. Registry entries
22
+ * may be dynamically loaded.
23
+ * @legacy
24
+ * @alpha
25
+ */
26
+ export type NamedFluidDataStoreRegistryEntry2 = [
27
+ string,
28
+ Promise<FluidDataStoreRegistryEntry> | FluidDataStoreRegistryEntry
29
+ ];
20
30
  /**
21
31
  * An iterable identifier/registry entry pair list
22
32
  * @legacy
23
33
  * @alpha
24
34
  */
25
- export type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry>;
35
+ export type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry2>;
26
36
  /**
27
37
  * @legacy
28
38
  * @alpha
@@ -42,6 +52,27 @@ export interface IProvideFluidDataStoreRegistry {
42
52
  * @alpha
43
53
  */
44
54
  export interface IFluidDataStoreRegistry extends IProvideFluidDataStoreRegistry {
55
+ /**
56
+ * Retrieves a data store registry entry by its identifier.
57
+ *
58
+ * @remarks
59
+ * The `get` function plays a crucial role in the lifecycle of a data store by providing access to the registry entry
60
+ * associated with a given identifier. This registry entry can then be used to create or load a data store.
61
+ *
62
+ * @param name - The unique identifier of the data store registry entry to retrieve.
63
+ * @returns A promise that resolves to the data store registry entry, or the entry itself, or undefined if not found.
64
+ */
45
65
  get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
66
+ /**
67
+ * Synchronously retrieves a data store registry entry by its identifier.
68
+ *
69
+ * @remarks
70
+ * The `get` function plays a crucial role in the lifecycle of a data store by providing access to the registry entry
71
+ * associated with a given identifier. This registry entry can then be used to create or load a data store.
72
+ *
73
+ * @param name - The unique identifier of the data store registry entry to retrieve.
74
+ * @returns The data store registry entry, or the entry itself, or undefined if not found.
75
+ */
76
+ getSync?(name: string): FluidDataStoreRegistryEntry | undefined;
46
77
  }
47
78
  //# sourceMappingURL=dataStoreRegistry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRegistry.d.ts","sourceRoot":"","sources":["../src/dataStoreRegistry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CACjD,OAAO,CAAC,8BAA8B,GAAG,6BAA6B,C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AAE,uBAAuB,CAAC;CAC1D;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAwB,SAAQ,8BAA8B;IAC9E;;;;;;;;;OASG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAAC;IAEpE;;;;;;;;;OASG;IACH,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,2BAA2B,GAAG,SAAS,CAAC;CAChE"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRegistry.js","sourceRoot":"","sources":["../src/dataStoreRegistry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GACnC,yBAAyB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IProvideFluidDataStoreFactory } from \"./dataStoreFactory.js\";\n\n/**\n * A single registry entry that may be used to create data stores\n * It has to have either factory or registry, or both.\n * @legacy\n * @alpha\n */\nexport type FluidDataStoreRegistryEntry = Readonly<\n\tPartial<IProvideFluidDataStoreRegistry & IProvideFluidDataStoreFactory>\n>;\n/**\n * An associated pair of an identifier and registry entry. Registry entries\n * may be dynamically loaded.\n * @legacy\n * @alpha\n */\nexport type NamedFluidDataStoreRegistryEntry = [string, Promise<FluidDataStoreRegistryEntry>];\n/**\n * An iterable identifier/registry entry pair list\n * @legacy\n * @alpha\n */\nexport type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry>;\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidDataStoreRegistry: keyof IProvideFluidDataStoreRegistry =\n\t\"IFluidDataStoreRegistry\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidDataStoreRegistry {\n\treadonly IFluidDataStoreRegistry: IFluidDataStoreRegistry;\n}\n\n/**\n * An association of identifiers to data store registry entries, where the\n * entries can be used to create data stores.\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreRegistry extends IProvideFluidDataStoreRegistry {\n\tget(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;\n}\n"]}
1
+ {"version":3,"file":"dataStoreRegistry.js","sourceRoot":"","sources":["../src/dataStoreRegistry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsCH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GACnC,yBAAyB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IProvideFluidDataStoreFactory } from \"./dataStoreFactory.js\";\n\n/**\n * A single registry entry that may be used to create data stores\n * It has to have either factory or registry, or both.\n * @legacy\n * @alpha\n */\nexport type FluidDataStoreRegistryEntry = Readonly<\n\tPartial<IProvideFluidDataStoreRegistry & IProvideFluidDataStoreFactory>\n>;\n/**\n * An associated pair of an identifier and registry entry. Registry entries\n * may be dynamically loaded.\n * @legacy\n * @alpha\n */\nexport type NamedFluidDataStoreRegistryEntry = [string, Promise<FluidDataStoreRegistryEntry>];\n\n/**\n * An associated pair of an identifier and registry entry. Registry entries\n * may be dynamically loaded.\n * @legacy\n * @alpha\n */\nexport type NamedFluidDataStoreRegistryEntry2 = [\n\tstring,\n\tPromise<FluidDataStoreRegistryEntry> | FluidDataStoreRegistryEntry,\n];\n/**\n * An iterable identifier/registry entry pair list\n * @legacy\n * @alpha\n */\nexport type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry2>;\n\n/**\n * @legacy\n * @alpha\n */\nexport const IFluidDataStoreRegistry: keyof IProvideFluidDataStoreRegistry =\n\t\"IFluidDataStoreRegistry\";\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IProvideFluidDataStoreRegistry {\n\treadonly IFluidDataStoreRegistry: IFluidDataStoreRegistry;\n}\n\n/**\n * An association of identifiers to data store registry entries, where the\n * entries can be used to create data stores.\n * @legacy\n * @alpha\n */\nexport interface IFluidDataStoreRegistry extends IProvideFluidDataStoreRegistry {\n\t/**\n\t * Retrieves a data store registry entry by its identifier.\n\t *\n\t * @remarks\n\t * The `get` function plays a crucial role in the lifecycle of a data store by providing access to the registry entry\n\t * associated with a given identifier. This registry entry can then be used to create or load a data store.\n\t *\n\t * @param name - The unique identifier of the data store registry entry to retrieve.\n\t * @returns A promise that resolves to the data store registry entry, or the entry itself, or undefined if not found.\n\t */\n\tget(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;\n\n\t/**\n\t * Synchronously retrieves a data store registry entry by its identifier.\n\t *\n\t * @remarks\n\t * The `get` function plays a crucial role in the lifecycle of a data store by providing access to the registry entry\n\t * associated with a given identifier. This registry entry can then be used to create or load a data store.\n\t *\n\t * @param name - The unique identifier of the data store registry entry to retrieve.\n\t * @returns The data store registry entry, or the entry itself, or undefined if not found.\n\t */\n\tgetSync?(name: string): FluidDataStoreRegistryEntry | undefined;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export type { AliasResult, CreateChildSummarizerNodeFn, IContainerRuntimeBase, I
7
7
  export { FlushMode, FlushModeExperimental, VisibilityState } from "./dataStoreContext.js";
8
8
  export type { IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
9
9
  export { IFluidDataStoreFactory } from "./dataStoreFactory.js";
10
- export type { FluidDataStoreRegistryEntry, IProvideFluidDataStoreRegistry, NamedFluidDataStoreRegistryEntries, NamedFluidDataStoreRegistryEntry, } from "./dataStoreRegistry.js";
10
+ export type { FluidDataStoreRegistryEntry, IProvideFluidDataStoreRegistry, NamedFluidDataStoreRegistryEntries, NamedFluidDataStoreRegistryEntry, NamedFluidDataStoreRegistryEntry2, } from "./dataStoreRegistry.js";
11
11
  export { IFluidDataStoreRegistry } from "./dataStoreRegistry.js";
12
12
  export type { IGarbageCollectionData, IGarbageCollectionDetailsBase, } from "./garbageCollectionDefinitions.js";
13
13
  export { gcBlobPrefix, gcDataBlobKey, gcDeletedBlobKey, gcTombstoneBlobKey, gcTreeKey, } from "./garbageCollectionDefinitions.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EACX,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACX,WAAW,EACX,2BAA2B,EAC3B,qBAAqB,EACrB,2BAA2B,EAC3B,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,8BAA8B,EAC9B,qBAAqB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC1F,YAAY,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,YAAY,EACX,2BAA2B,EAC3B,8BAA8B,EAC9B,kCAAkC,EAClC,gCAAgC,GAChC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,YAAY,EACX,sBAAsB,EACtB,6BAA6B,GAC7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACN,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,GACT,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACX,cAAc,EACd,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,GACzB,MAAM,eAAe,CAAC;AACvB,YAAY,EACX,8BAA8B,EAC9B,sCAAsC,EACtC,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,2BAA2B,EAC3B,qBAAqB,EACrB,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB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AqB,EACrB,2BAA2B,EAC3B,qBAAqB,EACrB,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,GACzB,MAAM,cAAc,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAO/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAKjE,OAAO,EACN,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,GACT,MAAM,mCAAmC,CAAC;AAyB3C,OAAO,EACN,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,GACzB,MAAM,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tAttributionInfo,\n\tAttributionKey,\n\tDetachedAttributionKey,\n\tLocalAttributionKey,\n\tOpAttributionKey,\n} from \"./attribution.js\";\nexport type {\n\tAliasResult,\n\tCreateChildSummarizerNodeFn,\n\tIContainerRuntimeBase,\n\tIContainerRuntimeBaseEvents,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidParentContext,\n\tIFluidDataStoreContextDetached,\n\tIPendingMessagesState,\n} from \"./dataStoreContext.js\";\nexport { FlushMode, FlushModeExperimental, VisibilityState } from \"./dataStoreContext.js\";\nexport type { IProvideFluidDataStoreFactory } from \"./dataStoreFactory.js\";\nexport { IFluidDataStoreFactory } from \"./dataStoreFactory.js\";\nexport type {\n\tFluidDataStoreRegistryEntry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n} from \"./dataStoreRegistry.js\";\nexport { IFluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nexport type {\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n} from \"./garbageCollectionDefinitions.js\";\nexport {\n\tgcBlobPrefix,\n\tgcDataBlobKey,\n\tgcDeletedBlobKey,\n\tgcTombstoneBlobKey,\n\tgcTreeKey,\n} from \"./garbageCollectionDefinitions.js\";\nexport type {\n\tIAttachMessage,\n\tIEnvelope,\n\tIInboundSignalMessage,\n\tInboundAttachMessage,\n\tIRuntimeMessageCollection,\n\tIRuntimeMessagesContent,\n\tISequencedMessageEnvelope,\n} from \"./protocol.js\";\nexport type {\n\tCreateChildSummarizerNodeParam,\n\tIExperimentalIncrementalSummaryContext,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tISummaryStats,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tITelemetryContextExt,\n\tSummarizeInternalFn,\n} from \"./summary.js\";\nexport {\n\tblobCountPropertyName,\n\tchannelsTreeName,\n\tCreateSummarizerNodeSource,\n\ttotalBlobSizePropertyName,\n} from \"./summary.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAQ/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAKjE,OAAO,EACN,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,GACT,MAAM,mCAAmC,CAAC;AAyB3C,OAAO,EACN,qBAAqB,EACrB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,GACzB,MAAM,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type {\n\tAttributionInfo,\n\tAttributionKey,\n\tDetachedAttributionKey,\n\tLocalAttributionKey,\n\tOpAttributionKey,\n} from \"./attribution.js\";\nexport type {\n\tAliasResult,\n\tCreateChildSummarizerNodeFn,\n\tIContainerRuntimeBase,\n\tIContainerRuntimeBaseEvents,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidParentContext,\n\tIFluidDataStoreContextDetached,\n\tIPendingMessagesState,\n} from \"./dataStoreContext.js\";\nexport { FlushMode, FlushModeExperimental, VisibilityState } from \"./dataStoreContext.js\";\nexport type { IProvideFluidDataStoreFactory } from \"./dataStoreFactory.js\";\nexport { IFluidDataStoreFactory } from \"./dataStoreFactory.js\";\nexport type {\n\tFluidDataStoreRegistryEntry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n\tNamedFluidDataStoreRegistryEntry2,\n} from \"./dataStoreRegistry.js\";\nexport { IFluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nexport type {\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n} from \"./garbageCollectionDefinitions.js\";\nexport {\n\tgcBlobPrefix,\n\tgcDataBlobKey,\n\tgcDeletedBlobKey,\n\tgcTombstoneBlobKey,\n\tgcTreeKey,\n} from \"./garbageCollectionDefinitions.js\";\nexport type {\n\tIAttachMessage,\n\tIEnvelope,\n\tIInboundSignalMessage,\n\tInboundAttachMessage,\n\tIRuntimeMessageCollection,\n\tIRuntimeMessagesContent,\n\tISequencedMessageEnvelope,\n} from \"./protocol.js\";\nexport type {\n\tCreateChildSummarizerNodeParam,\n\tIExperimentalIncrementalSummaryContext,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tISummaryStats,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tITelemetryContextExt,\n\tSummarizeInternalFn,\n} from \"./summary.js\";\nexport {\n\tblobCountPropertyName,\n\tchannelsTreeName,\n\tCreateSummarizerNodeSource,\n\ttotalBlobSizePropertyName,\n} from \"./summary.js\";\n"]}
package/lib/legacy.d.ts CHANGED
@@ -52,6 +52,7 @@ export {
52
52
  LocalAttributionKey,
53
53
  NamedFluidDataStoreRegistryEntries,
54
54
  NamedFluidDataStoreRegistryEntry,
55
+ NamedFluidDataStoreRegistryEntry2,
55
56
  OpAttributionKey,
56
57
  SummarizeInternalFn,
57
58
  VisibilityState
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/runtime-definitions",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "Fluid Runtime definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -47,11 +47,11 @@
47
47
  "main": "lib/index.js",
48
48
  "types": "lib/public.d.ts",
49
49
  "dependencies": {
50
- "@fluidframework/container-definitions": "~2.10.0",
51
- "@fluidframework/core-interfaces": "~2.10.0",
52
- "@fluidframework/driver-definitions": "~2.10.0",
53
- "@fluidframework/id-compressor": "~2.10.0",
54
- "@fluidframework/telemetry-utils": "~2.10.0"
50
+ "@fluidframework/container-definitions": "~2.11.0",
51
+ "@fluidframework/core-interfaces": "~2.11.0",
52
+ "@fluidframework/driver-definitions": "~2.11.0",
53
+ "@fluidframework/id-compressor": "~2.11.0",
54
+ "@fluidframework/telemetry-utils": "~2.11.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@arethetypeswrong/cli": "^0.16.4",
@@ -59,8 +59,8 @@
59
59
  "@fluid-tools/build-cli": "^0.51.0",
60
60
  "@fluidframework/build-common": "^2.0.3",
61
61
  "@fluidframework/build-tools": "^0.51.0",
62
- "@fluidframework/eslint-config-fluid": "^5.4.0",
63
- "@fluidframework/runtime-definitions-previous": "npm:@fluidframework/runtime-definitions@2.5.0",
62
+ "@fluidframework/eslint-config-fluid": "^5.6.0",
63
+ "@fluidframework/runtime-definitions-previous": "npm:@fluidframework/runtime-definitions@2.10.0",
64
64
  "@microsoft/api-extractor": "7.47.8",
65
65
  "concurrently": "^8.2.1",
66
66
  "copyfiles": "^2.4.1",
@@ -71,17 +71,7 @@
71
71
  "typescript": "~5.4.5"
72
72
  },
73
73
  "typeValidation": {
74
- "broken": {
75
- "Interface_IFluidDataStoreContext": {
76
- "backCompat": false
77
- },
78
- "Interface_IFluidDataStoreContextDetached": {
79
- "backCompat": false
80
- },
81
- "Interface_IFluidParentContext": {
82
- "backCompat": false
83
- }
84
- },
74
+ "broken": {},
85
75
  "entrypoint": "legacy"
86
76
  },
87
77
  "scripts": {
@@ -28,7 +28,10 @@ import type {
28
28
  } from "@fluidframework/driver-definitions/internal";
29
29
  import type { IIdCompressor } from "@fluidframework/id-compressor";
30
30
 
31
- import type { IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
31
+ import type {
32
+ IFluidDataStoreFactory,
33
+ IProvideFluidDataStoreFactory,
34
+ } from "./dataStoreFactory.js";
32
35
  import type { IProvideFluidDataStoreRegistry } from "./dataStoreRegistry.js";
33
36
  import type {
34
37
  IGarbageCollectionData,
@@ -593,6 +596,28 @@ export interface IFluidDataStoreContext extends IFluidParentContext {
593
596
  * and its children with the GC details from the previous summary.
594
597
  */
595
598
  getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
599
+
600
+ /**
601
+ * Synchronously creates a detached child data store.
602
+ *
603
+ * The `createChildDataStore` method allows for the synchronous creation of a detached child data store. This is particularly
604
+ * useful in scenarios where immediate availability of the child data store is required, such as during the initialization
605
+ * of a parent data store, or when creation is in response to synchronous user input.
606
+ *
607
+ * In order for this function to succeed:
608
+ * 1. The parent data store's factory must also be an `IFluidDataStoreRegistry`.
609
+ * 2. The parent data store's registry must include the same instance as the provided child factory.
610
+ * 3. The parent data store's registry must synchronously provide the child factory via the `getSync` method.
611
+ * 4. The child factory must implement the `createDataStore` method.
612
+ *
613
+ * These invariants ensure that the child data store can also be created by a remote client running the same code as this client.
614
+ *
615
+ * @param childFactory - The factory of the data store to be created.
616
+ * @returns The created data store channel.
617
+ */
618
+ createChildDataStore?<T extends IFluidDataStoreFactory>(
619
+ childFactory: T,
620
+ ): ReturnType<Exclude<T["createDataStore"], undefined>>;
596
621
  }
597
622
 
598
623
  /**
@@ -21,24 +21,65 @@ export interface IProvideFluidDataStoreFactory {
21
21
  }
22
22
 
23
23
  /**
24
- * IFluidDataStoreFactory create data stores. It is associated with an identifier (its `type` member)
25
- * and usually provided to consumers using this mapping through a data store registry.
24
+ * The `IFluidDataStoreFactory` interface is responsible for creating data stores.
25
+ * A data store is a component that manages a specific set of data and its operations.
26
+ * It encapsulates the logic for data management, synchronization, and interaction
27
+ * with other components within a Fluid container.
28
+ *
29
+ * Data stores are fundamental building blocks in the Fluid Framework. They are used
30
+ * to store and manage state, handle operations, and provide APIs for interacting
31
+ * with the data. Each data store type is associated with a unique identifier (its `type` member)
32
+ * and is typically provided to consumers through a data store registry.
33
+ *
34
+ * The factory is responsible for creating new instances of data stores and loading existing ones.
35
+ * The factory ensures that the data store is correctly initialized.
36
+ *
26
37
  * @legacy
27
38
  * @alpha
28
39
  */
29
40
  export interface IFluidDataStoreFactory extends IProvideFluidDataStoreFactory {
30
41
  /**
31
- * String that uniquely identifies the type of data store created by this factory.
42
+ * Uniquely identifies the type of data store created by this factory.
32
43
  */
33
44
  type: string;
34
45
 
35
46
  /**
36
- * Generates runtime for the data store from the data store context. Once created should be bound to the context.
37
- * @param context - Context for the data store.
38
- * @param existing - If instantiating from an existing file.
47
+ * Asynchronously generates the runtime for the data store from the given context.
48
+ * @remarks
49
+ * Once created, the data store should be bound to the context.
50
+ *
51
+ * This method supports both creation and loading paths. It is important to differentiate
52
+ * between the two based on the `existing` parameter:
53
+ * - When `existing` is false, this method creates a new data store.
54
+ * - When `existing` is true, it loads a pre-existing data store.
55
+ *
56
+ * @param context - The context for the data store, providing necessary information and services.
57
+ * @param existing - A boolean indicating whether the data store is being instantiated from an existing file.
58
+ * @returns A promise that resolves to the created data store channel.
39
59
  */
40
60
  instantiateDataStore(
41
61
  context: IFluidDataStoreContext,
42
62
  existing: boolean,
43
63
  ): Promise<IFluidDataStoreChannel>;
64
+
65
+ /**
66
+ * Synchronously creates a new runtime for a new data store from the provided context.
67
+ *
68
+ * @remarks
69
+ * This method enables a synchronous creation path. Specifically, if this factory is registered
70
+ * as a child factory in another data store's registry, and the registry synchronously provides
71
+ * this factory, it becomes eligible for synchronous creation via the parent data store's context.
72
+ * After creation, all subsequent loads of a data store created through this method will utilize
73
+ * the asynchronous `instantiateDataStore` method on this factory.
74
+ *
75
+ * Note: This method is optional. Not all data stores can or will support a synchronous creation path,
76
+ * as being synchronous imposes limitations on the capabilities that can be used. Generally, this
77
+ * creation path should only be implemented when synchronous creation is necessary.
78
+ *
79
+ * @param context - The context for the data store, providing the necessary information and services.
80
+ * @returns An object containing the runtime of the created data store channel.
81
+ */
82
+ createDataStore?(context: IFluidDataStoreContext): {
83
+ readonly runtime: IFluidDataStoreChannel;
84
+ };
44
85
  }
@@ -21,12 +21,23 @@ export type FluidDataStoreRegistryEntry = Readonly<
21
21
  * @alpha
22
22
  */
23
23
  export type NamedFluidDataStoreRegistryEntry = [string, Promise<FluidDataStoreRegistryEntry>];
24
+
25
+ /**
26
+ * An associated pair of an identifier and registry entry. Registry entries
27
+ * may be dynamically loaded.
28
+ * @legacy
29
+ * @alpha
30
+ */
31
+ export type NamedFluidDataStoreRegistryEntry2 = [
32
+ string,
33
+ Promise<FluidDataStoreRegistryEntry> | FluidDataStoreRegistryEntry,
34
+ ];
24
35
  /**
25
36
  * An iterable identifier/registry entry pair list
26
37
  * @legacy
27
38
  * @alpha
28
39
  */
29
- export type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry>;
40
+ export type NamedFluidDataStoreRegistryEntries = Iterable<NamedFluidDataStoreRegistryEntry2>;
30
41
 
31
42
  /**
32
43
  * @legacy
@@ -50,5 +61,27 @@ export interface IProvideFluidDataStoreRegistry {
50
61
  * @alpha
51
62
  */
52
63
  export interface IFluidDataStoreRegistry extends IProvideFluidDataStoreRegistry {
64
+ /**
65
+ * Retrieves a data store registry entry by its identifier.
66
+ *
67
+ * @remarks
68
+ * The `get` function plays a crucial role in the lifecycle of a data store by providing access to the registry entry
69
+ * associated with a given identifier. This registry entry can then be used to create or load a data store.
70
+ *
71
+ * @param name - The unique identifier of the data store registry entry to retrieve.
72
+ * @returns A promise that resolves to the data store registry entry, or the entry itself, or undefined if not found.
73
+ */
53
74
  get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
75
+
76
+ /**
77
+ * Synchronously retrieves a data store registry entry by its identifier.
78
+ *
79
+ * @remarks
80
+ * The `get` function plays a crucial role in the lifecycle of a data store by providing access to the registry entry
81
+ * associated with a given identifier. This registry entry can then be used to create or load a data store.
82
+ *
83
+ * @param name - The unique identifier of the data store registry entry to retrieve.
84
+ * @returns The data store registry entry, or the entry itself, or undefined if not found.
85
+ */
86
+ getSync?(name: string): FluidDataStoreRegistryEntry | undefined;
54
87
  }
package/src/index.ts CHANGED
@@ -30,6 +30,7 @@ export type {
30
30
  IProvideFluidDataStoreRegistry,
31
31
  NamedFluidDataStoreRegistryEntries,
32
32
  NamedFluidDataStoreRegistryEntry,
33
+ NamedFluidDataStoreRegistryEntry2,
33
34
  } from "./dataStoreRegistry.js";
34
35
  export { IFluidDataStoreRegistry } from "./dataStoreRegistry.js";
35
36
  export type {