@fluidframework/datastore-definitions 2.0.0-internal.4.0.5 → 2.0.0-internal.4.1.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 +5 -0
- package/README.md +38 -0
- package/dist/channel.d.ts +2 -2
- package/dist/channel.d.ts.map +1 -1
- package/dist/channel.js.map +1 -1
- package/package.json +6 -6
- package/src/channel.ts +2 -0
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
Interface `IFluidDataStoreRuntime` specifies the data store developer API.
|
|
4
4
|
|
|
5
|
+
<!-- AUTO-GENERATED-CONTENT:START (README_DEPENDENCY_GUIDELINES_SECTION:includeHeading=TRUE) -->
|
|
6
|
+
|
|
7
|
+
<!-- prettier-ignore-start -->
|
|
8
|
+
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
9
|
+
|
|
10
|
+
## Using Fluid Framework libraries
|
|
11
|
+
|
|
12
|
+
When taking a dependency on a Fluid Framework library, we recommend using a `^` (caret) version range, such as `^1.3.4`.
|
|
13
|
+
While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
|
|
14
|
+
library consumers should always prefer `^`.
|
|
15
|
+
|
|
16
|
+
Note that when depending on a library version of the form 2.0.0-internal.x.y.z, called the Fluid internal version
|
|
17
|
+
scheme, you must use a `>= <` dependency range. Standard `^` and `~` ranges will not work as expected. See the
|
|
18
|
+
[@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
|
|
19
|
+
package for more information including tools to convert between version schemes.
|
|
20
|
+
|
|
21
|
+
<!-- prettier-ignore-end -->
|
|
22
|
+
|
|
23
|
+
<!-- AUTO-GENERATED-CONTENT:END -->
|
|
24
|
+
|
|
5
25
|
## Capabilities exposed on `IFluidDataStoreRuntime`
|
|
6
26
|
|
|
7
27
|
_TODO: The full set of functionality is under review_
|
|
@@ -25,3 +45,21 @@ For this reason people usually stick the currentSeq on the signal, so other clie
|
|
|
25
45
|
|
|
26
46
|
You can send a signal via the container or data store runtime. The container will emit the signal event on all signals,
|
|
27
47
|
but a data store will emit the signal event only on signals emitted on that data store runtime.
|
|
48
|
+
|
|
49
|
+
<!-- AUTO-GENERATED-CONTENT:START (README_TRADEMARK_SECTION:includeHeading=TRUE) -->
|
|
50
|
+
|
|
51
|
+
<!-- prettier-ignore-start -->
|
|
52
|
+
<!-- NOTE: This section is automatically generated using @fluid-tools/markdown-magic. Do not update these generated contents directly. -->
|
|
53
|
+
|
|
54
|
+
## Trademark
|
|
55
|
+
|
|
56
|
+
This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
|
|
57
|
+
|
|
58
|
+
Use of these trademarks or logos must follow Microsoft's [Trademark & Brand
|
|
59
|
+
Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
|
|
60
|
+
|
|
61
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
62
|
+
|
|
63
|
+
<!-- prettier-ignore-end -->
|
|
64
|
+
|
|
65
|
+
<!-- AUTO-GENERATED-CONTENT:END -->
|
package/dist/channel.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IFluidHandle, IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
6
6
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
7
|
-
import { IGarbageCollectionData, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
7
|
+
import { IGarbageCollectionData, IExperimentalIncrementalSummaryContext, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
8
8
|
import { IChannelAttributes } from "./storage";
|
|
9
9
|
import { IFluidDataStoreRuntime } from "./dataStoreRuntime";
|
|
10
10
|
export interface IChannel extends IFluidLoadable {
|
|
@@ -73,7 +73,7 @@ export interface IChannel extends IFluidLoadable {
|
|
|
73
73
|
*
|
|
74
74
|
* @returns A summary capturing the current state of the channel.
|
|
75
75
|
*/
|
|
76
|
-
summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;
|
|
76
|
+
summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext, incrementalSummaryContext?: IExperimentalIncrementalSummaryContext): Promise<ISummaryTreeWithStats>;
|
|
77
77
|
/**
|
|
78
78
|
* Checks if the channel is attached to storage.
|
|
79
79
|
* @returns True iff the channel is attached.
|
package/dist/channel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACN,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,QAAS,SAAQ,cAAc;IAC/C;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,gBAAgB,CACf,QAAQ,CAAC,EAAE,OAAO,EAClB,UAAU,CAAC,EAAE,OAAO,EACpB,gBAAgB,CAAC,EAAE,iBAAiB,GAClC,qBAAqB,CAAC;IAEzB;;;;;;;;;;;;;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AAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,eAAe,EAAE,gBAAgB,CAAC;IAElC,aAAa,EAAE,sBAAsB,CAAC;CACtC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IAExC;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACH,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,iBAAiB,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAC7C,OAAO,CAAC,QAAQ,CAAC,CAAC;IAErB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC9D"}
|
package/dist/channel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle, IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { IChannelAttributes } from \"./storage\";\nimport { IFluidDataStoreRuntime } from \"./dataStoreRuntime\";\n\nexport interface IChannel extends IFluidLoadable {\n\t/**\n\t * A readonly identifier for the channel\n\t */\n\treadonly id: string;\n\n\treadonly owner?: string;\n\n\treadonly attributes: IChannelAttributes;\n\n\t/**\n\t * Generates summary of the channel synchronously. It is called when an `attach message`\n\t * for a local channel is generated. In other words, when the channel is being attached\n\t * to make it visible to other clients.\n\t *\n\t * @remarks\n\t *\n\t * Note: Since the Attach Summary is generated for local channels when making them visible to\n\t * remote clients, they don't have any previous summaries to compare against. For this reason,\n\t * the attach summary cannot contain summary handles (paths to sub-trees or blobs).\n\t * It can, however, contain {@link @fluidframework/protocol-definitions#ISummaryAttachment}\n\t * (handles to blobs uploaded async via the blob manager).\n\t *\n\t * @param fullTree - A flag indicating whether the attempt should generate a full\n\t * summary tree without any handles for unchanged subtrees.\n\t *\n\t * Default: `false`\n\t *\n\t * @param trackState - An optimization for tracking state of objects across summaries. If the state\n\t * of an object did not change since last successful summary, an\n\t * {@link @fluidframework/protocol-definitions#ISummaryHandle} can be used\n\t * instead of re-summarizing it. If this is `false`, the expectation is that you should never\n\t * send an `ISummaryHandle`, since you are not expected to track state.\n\t *\n\t * Note: The goal is to remove the trackState and automatically decided whether the\n\t * handles will be used or not: {@link https://github.com/microsoft/FluidFramework/issues/10455}\n\t *\n\t * Default: `false`\n\t *\n\t * @param telemetryContext - See {@link @fluidframework/runtime-definitions#ITelemetryContext}.\n\t *\n\t * @returns A summary capturing the current state of the channel.\n\t */\n\tgetAttachSummary(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats;\n\n\t/**\n\t * Generates summary of the channel asynchronously.\n\t * This should not be called where the channel can be modified while summarization is in progress.\n\t *\n\t * @param fullTree - flag indicating whether the attempt should generate a full\n\t * summary tree without any handles for unchanged subtrees. It should only be set to true when generating\n\t * a summary from the entire container.\n\t *\n\t * Default: `false`\n\t *\n\t * @param trackState - An optimization for tracking state of objects across summaries. If the state\n\t * of an object did not change since last successful summary, an\n\t * {@link @fluidframework/protocol-definitions#ISummaryHandle} can be used\n\t * instead of re-summarizing it. If this is `false`, the expectation is that you should never\n\t * send an `ISummaryHandle`, since you are not expected to track state.\n\t *\n\t * Default: `false`\n\t *\n\t * Note: The goal is to remove the trackState and automatically decided whether the\n\t * handles will be used or not: {@link https://github.com/microsoft/FluidFramework/issues/10455}\n\t *\n\t * @param telemetryContext - See {@link @fluidframework/runtime-definitions#ITelemetryContext}.\n\t *\n\t * @returns A summary capturing the current state of the channel.\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 * Checks if the channel is attached to storage.\n\t * @returns True iff the channel is attached.\n\t */\n\tisAttached(): boolean;\n\n\t/**\n\t * Enables the channel to send and receive ops.\n\t * @param services - The services to connect to.\n\t */\n\tconnect(services: IChannelServices): void;\n\n\t/**\n\t * Returns the GC data for this channel. It contains a list of GC nodes that contains references to\n\t * other GC nodes.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tgetGCData(fullGC?: boolean): IGarbageCollectionData;\n}\n\n/**\n * Handler provided by shared data structure to process requests from the runtime.\n */\nexport interface IDeltaHandler {\n\t/**\n\t * Processes the op.\n\t * @param message - The message to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tprocess: (message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => void;\n\n\t/**\n\t * State change events to indicate changes to the delta connection\n\t * @param connected - true if connected, false otherwise\n\t */\n\tsetConnectionState(connected: boolean): void;\n\n\t/**\n\t * Called when the runtime asks the client to resubmit an op. This may be because the Container reconnected and\n\t * this op was not acked.\n\t * The client can choose to resubmit the same message, submit different / multiple messages or not submit anything\n\t * at all.\n\t * @param message - The original message that was submitted.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\treSubmit(message: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Apply changes from an op. Used when rehydrating an attached container\n\t * with pending changes. This prepares the SharedObject for seeing an ACK\n\t * for the op or resubmitting the op upon reconnection.\n\t * @param message - Contents of a stashed op.\n\t * @returns localMetadata of the op, to be passed to process() or resubmit()\n\t * when the op is ACKed or resubmitted, respectively\n\t */\n\tapplyStashedOp(message: any): unknown;\n\n\t/**\n\t * Revert a local op.\n\t * @param message - The original message that was submitted.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\trollback?(message: any, localOpMetadata: unknown): void;\n}\n\n/**\n * Interface to represent a connection to a delta notification stream.\n */\nexport interface IDeltaConnection {\n\tconnected: boolean;\n\n\t/**\n\t * Send new messages to the server.\n\t * @param messageContent - The content of the message to be sent.\n\t * @param localOpMetadata - The local metadata associated with the message. This is kept locally by the runtime\n\t * and not sent to the server. It will be provided back when this message is acknowledged by the server. It will\n\t * also be provided back when asked to resubmit the message.\n\t */\n\tsubmit(messageContent: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Attaches a message handler to the delta connection\n\t */\n\tattach(handler: IDeltaHandler): void;\n\n\t/**\n\t * Indicates that the channel is dirty and needs to be part of the summary. It is called by a SharedSummaryBlock\n\t * that needs to be part of the summary but does not generate ops.\n\t */\n\tdirty(): 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 * @param srcHandle - The handle of the node that added the reference.\n\t * @param outboundHandle - The handle of the outbound node that is referenced.\n\t */\n\taddedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;\n}\n\n/**\n * Storage services to read the objects at a given path.\n */\nexport interface IChannelStorageService {\n\t/**\n\t * Reads the object contained at the given path. Returns a buffer representation for the object.\n\t */\n\treadBlob(path: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Determines if there is an object contained at the given path.\n\t */\n\tcontains(path: string): Promise<boolean>;\n\n\t/**\n\t * Lists the blobs that exist at a specific path.\n\t */\n\tlist(path: string): Promise<string[]>;\n}\n\n/**\n * Storage services to read the objects at a given path using the given delta connection.\n */\nexport interface IChannelServices {\n\tdeltaConnection: IDeltaConnection;\n\n\tobjectStorage: IChannelStorageService;\n}\n\n/**\n * Definitions of a channel factory.\n *\n * The runtime must be able to produce \"channels\" of the correct in-memory object type for the collaborative session.\n * Here \"channels\" are typically distributed data structures (DDSs).\n *\n * The runtime will consult with a registry of such factories during\n * {@link https://fluidframework.com/docs/build/containers/ | Container} load and when receiving \"attach\" operations\n * (ops), which indicate a new instance of a channel being introduced to the collaboration session, to produce the\n * appropriate in-memory object.\n *\n * @example If a collaboration includes a {@link https://fluidframework.com/docs/data-structures/map/ | SharedMap},\n * the collaborating clients will need to have access to a factory that can produce the `SharedMap` obect.\n *\n * @remarks Factories follow a common model but enable custom behavior.\n */\nexport interface IChannelFactory {\n\t/**\n\t * String representing the type of the factory.\n\t */\n\treadonly type: string;\n\n\t/**\n\t * Attributes of the channel.\n\t */\n\treadonly attributes: IChannelAttributes;\n\n\t/**\n\t * Loads the given channel. This call is only ever invoked internally as the only thing\n\t * that is ever directly loaded is the document itself. Load will then only be called on documents that\n\t * were created and added to a channel.\n\t * @param runtime - Data store runtime containing state/info/helper methods about the data store.\n\t * @param id - ID of the channel.\n\t * @param services - Services to read objects at a given path using the delta connection.\n\t * @param channelAttributes - The attributes for the the channel to be loaded.\n\t * @returns The loaded object\n\t *\n\t * @privateRemarks\n\t * Thought: should the storage object include the version information and limit access to just files\n\t * for the given object? The latter seems good in general. But both are probably good things. We then just\n\t * need a way to allow the document to provide later storage for the object.\n\t */\n\tload(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tchannelAttributes: Readonly<IChannelAttributes>,\n\t): Promise<IChannel>;\n\n\t/**\n\t * Creates a local version of the channel.\n\t * Calling attach on the object later will insert it into the object stream.\n\t * @param runtime - The runtime the new object will be associated with\n\t * @param id - The unique ID of the new object\n\t * @returns The newly created object.\n\t *\n\t * @privateRemarks\n\t * NOTE here - When we attach we need to submit all the pending ops prior to actually doing the attach\n\t * for consistency.\n\t */\n\tcreate(runtime: IFluidDataStoreRuntime, id: string): IChannel;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle, IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIGarbageCollectionData,\n\tIExperimentalIncrementalSummaryContext,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { IChannelAttributes } from \"./storage\";\nimport { IFluidDataStoreRuntime } from \"./dataStoreRuntime\";\n\nexport interface IChannel extends IFluidLoadable {\n\t/**\n\t * A readonly identifier for the channel\n\t */\n\treadonly id: string;\n\n\treadonly owner?: string;\n\n\treadonly attributes: IChannelAttributes;\n\n\t/**\n\t * Generates summary of the channel synchronously. It is called when an `attach message`\n\t * for a local channel is generated. In other words, when the channel is being attached\n\t * to make it visible to other clients.\n\t *\n\t * @remarks\n\t *\n\t * Note: Since the Attach Summary is generated for local channels when making them visible to\n\t * remote clients, they don't have any previous summaries to compare against. For this reason,\n\t * the attach summary cannot contain summary handles (paths to sub-trees or blobs).\n\t * It can, however, contain {@link @fluidframework/protocol-definitions#ISummaryAttachment}\n\t * (handles to blobs uploaded async via the blob manager).\n\t *\n\t * @param fullTree - A flag indicating whether the attempt should generate a full\n\t * summary tree without any handles for unchanged subtrees.\n\t *\n\t * Default: `false`\n\t *\n\t * @param trackState - An optimization for tracking state of objects across summaries. If the state\n\t * of an object did not change since last successful summary, an\n\t * {@link @fluidframework/protocol-definitions#ISummaryHandle} can be used\n\t * instead of re-summarizing it. If this is `false`, the expectation is that you should never\n\t * send an `ISummaryHandle`, since you are not expected to track state.\n\t *\n\t * Note: The goal is to remove the trackState and automatically decided whether the\n\t * handles will be used or not: {@link https://github.com/microsoft/FluidFramework/issues/10455}\n\t *\n\t * Default: `false`\n\t *\n\t * @param telemetryContext - See {@link @fluidframework/runtime-definitions#ITelemetryContext}.\n\t *\n\t * @returns A summary capturing the current state of the channel.\n\t */\n\tgetAttachSummary(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummaryTreeWithStats;\n\n\t/**\n\t * Generates summary of the channel asynchronously.\n\t * This should not be called where the channel can be modified while summarization is in progress.\n\t *\n\t * @param fullTree - flag indicating whether the attempt should generate a full\n\t * summary tree without any handles for unchanged subtrees. It should only be set to true when generating\n\t * a summary from the entire container.\n\t *\n\t * Default: `false`\n\t *\n\t * @param trackState - An optimization for tracking state of objects across summaries. If the state\n\t * of an object did not change since last successful summary, an\n\t * {@link @fluidframework/protocol-definitions#ISummaryHandle} can be used\n\t * instead of re-summarizing it. If this is `false`, the expectation is that you should never\n\t * send an `ISummaryHandle`, since you are not expected to track state.\n\t *\n\t * Default: `false`\n\t *\n\t * Note: The goal is to remove the trackState and automatically decided whether the\n\t * handles will be used or not: {@link https://github.com/microsoft/FluidFramework/issues/10455}\n\t *\n\t * @param telemetryContext - See {@link @fluidframework/runtime-definitions#ITelemetryContext}.\n\t *\n\t * @returns A summary capturing the current state of the channel.\n\t */\n\tsummarize(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t): Promise<ISummaryTreeWithStats>;\n\n\t/**\n\t * Checks if the channel is attached to storage.\n\t * @returns True iff the channel is attached.\n\t */\n\tisAttached(): boolean;\n\n\t/**\n\t * Enables the channel to send and receive ops.\n\t * @param services - The services to connect to.\n\t */\n\tconnect(services: IChannelServices): void;\n\n\t/**\n\t * Returns the GC data for this channel. It contains a list of GC nodes that contains references to\n\t * other GC nodes.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tgetGCData(fullGC?: boolean): IGarbageCollectionData;\n}\n\n/**\n * Handler provided by shared data structure to process requests from the runtime.\n */\nexport interface IDeltaHandler {\n\t/**\n\t * Processes the op.\n\t * @param message - The message to process\n\t * @param local - Whether the message originated from the local client\n\t * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n\t * For messages from a remote client, this will be undefined.\n\t */\n\tprocess: (message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => void;\n\n\t/**\n\t * State change events to indicate changes to the delta connection\n\t * @param connected - true if connected, false otherwise\n\t */\n\tsetConnectionState(connected: boolean): void;\n\n\t/**\n\t * Called when the runtime asks the client to resubmit an op. This may be because the Container reconnected and\n\t * this op was not acked.\n\t * The client can choose to resubmit the same message, submit different / multiple messages or not submit anything\n\t * at all.\n\t * @param message - The original message that was submitted.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\treSubmit(message: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Apply changes from an op. Used when rehydrating an attached container\n\t * with pending changes. This prepares the SharedObject for seeing an ACK\n\t * for the op or resubmitting the op upon reconnection.\n\t * @param message - Contents of a stashed op.\n\t * @returns localMetadata of the op, to be passed to process() or resubmit()\n\t * when the op is ACKed or resubmitted, respectively\n\t */\n\tapplyStashedOp(message: any): unknown;\n\n\t/**\n\t * Revert a local op.\n\t * @param message - The original message that was submitted.\n\t * @param localOpMetadata - The local metadata associated with the original message.\n\t */\n\trollback?(message: any, localOpMetadata: unknown): void;\n}\n\n/**\n * Interface to represent a connection to a delta notification stream.\n */\nexport interface IDeltaConnection {\n\tconnected: boolean;\n\n\t/**\n\t * Send new messages to the server.\n\t * @param messageContent - The content of the message to be sent.\n\t * @param localOpMetadata - The local metadata associated with the message. This is kept locally by the runtime\n\t * and not sent to the server. It will be provided back when this message is acknowledged by the server. It will\n\t * also be provided back when asked to resubmit the message.\n\t */\n\tsubmit(messageContent: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Attaches a message handler to the delta connection\n\t */\n\tattach(handler: IDeltaHandler): void;\n\n\t/**\n\t * Indicates that the channel is dirty and needs to be part of the summary. It is called by a SharedSummaryBlock\n\t * that needs to be part of the summary but does not generate ops.\n\t */\n\tdirty(): 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 * @param srcHandle - The handle of the node that added the reference.\n\t * @param outboundHandle - The handle of the outbound node that is referenced.\n\t */\n\taddedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;\n}\n\n/**\n * Storage services to read the objects at a given path.\n */\nexport interface IChannelStorageService {\n\t/**\n\t * Reads the object contained at the given path. Returns a buffer representation for the object.\n\t */\n\treadBlob(path: string): Promise<ArrayBufferLike>;\n\n\t/**\n\t * Determines if there is an object contained at the given path.\n\t */\n\tcontains(path: string): Promise<boolean>;\n\n\t/**\n\t * Lists the blobs that exist at a specific path.\n\t */\n\tlist(path: string): Promise<string[]>;\n}\n\n/**\n * Storage services to read the objects at a given path using the given delta connection.\n */\nexport interface IChannelServices {\n\tdeltaConnection: IDeltaConnection;\n\n\tobjectStorage: IChannelStorageService;\n}\n\n/**\n * Definitions of a channel factory.\n *\n * The runtime must be able to produce \"channels\" of the correct in-memory object type for the collaborative session.\n * Here \"channels\" are typically distributed data structures (DDSs).\n *\n * The runtime will consult with a registry of such factories during\n * {@link https://fluidframework.com/docs/build/containers/ | Container} load and when receiving \"attach\" operations\n * (ops), which indicate a new instance of a channel being introduced to the collaboration session, to produce the\n * appropriate in-memory object.\n *\n * @example If a collaboration includes a {@link https://fluidframework.com/docs/data-structures/map/ | SharedMap},\n * the collaborating clients will need to have access to a factory that can produce the `SharedMap` obect.\n *\n * @remarks Factories follow a common model but enable custom behavior.\n */\nexport interface IChannelFactory {\n\t/**\n\t * String representing the type of the factory.\n\t */\n\treadonly type: string;\n\n\t/**\n\t * Attributes of the channel.\n\t */\n\treadonly attributes: IChannelAttributes;\n\n\t/**\n\t * Loads the given channel. This call is only ever invoked internally as the only thing\n\t * that is ever directly loaded is the document itself. Load will then only be called on documents that\n\t * were created and added to a channel.\n\t * @param runtime - Data store runtime containing state/info/helper methods about the data store.\n\t * @param id - ID of the channel.\n\t * @param services - Services to read objects at a given path using the delta connection.\n\t * @param channelAttributes - The attributes for the the channel to be loaded.\n\t * @returns The loaded object\n\t *\n\t * @privateRemarks\n\t * Thought: should the storage object include the version information and limit access to just files\n\t * for the given object? The latter seems good in general. But both are probably good things. We then just\n\t * need a way to allow the document to provide later storage for the object.\n\t */\n\tload(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tchannelAttributes: Readonly<IChannelAttributes>,\n\t): Promise<IChannel>;\n\n\t/**\n\t * Creates a local version of the channel.\n\t * Calling attach on the object later will insert it into the object stream.\n\t * @param runtime - The runtime the new object will be associated with\n\t * @param id - The unique ID of the new object\n\t * @returns The newly created object.\n\t *\n\t * @privateRemarks\n\t * NOTE here - When we attach we need to submit all the pending ops prior to actually doing the attach\n\t * for consistency.\n\t */\n\tcreate(runtime: IFluidDataStoreRuntime, id: string): IChannel;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/datastore-definitions",
|
|
3
|
-
"version": "2.0.0-internal.4.0
|
|
3
|
+
"version": "2.0.0-internal.4.1.0",
|
|
4
4
|
"description": "Fluid data store definitions",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
18
18
|
"@fluidframework/common-utils": "^1.1.1",
|
|
19
|
-
"@fluidframework/container-definitions": ">=2.0.0-internal.4.0
|
|
20
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.4.0
|
|
19
|
+
"@fluidframework/container-definitions": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
20
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0",
|
|
21
21
|
"@fluidframework/protocol-definitions": "^1.1.0",
|
|
22
|
-
"@fluidframework/runtime-definitions": ">=2.0.0-internal.4.0
|
|
22
|
+
"@fluidframework/runtime-definitions": ">=2.0.0-internal.4.1.0 <2.0.0-internal.4.2.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@fluid-tools/build-cli": "^0.
|
|
25
|
+
"@fluid-tools/build-cli": "^0.15.0",
|
|
26
26
|
"@fluidframework/build-common": "^1.1.0",
|
|
27
|
-
"@fluidframework/build-tools": "^0.
|
|
27
|
+
"@fluidframework/build-tools": "^0.15.0",
|
|
28
28
|
"@fluidframework/datastore-definitions-previous": "npm:@fluidframework/datastore-definitions@2.0.0-internal.4.0.0",
|
|
29
29
|
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
30
30
|
"@microsoft/api-extractor": "^7.34.4",
|
package/src/channel.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { IFluidHandle, IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
|
7
7
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
8
|
import {
|
|
9
9
|
IGarbageCollectionData,
|
|
10
|
+
IExperimentalIncrementalSummaryContext,
|
|
10
11
|
ISummaryTreeWithStats,
|
|
11
12
|
ITelemetryContext,
|
|
12
13
|
} from "@fluidframework/runtime-definitions";
|
|
@@ -91,6 +92,7 @@ export interface IChannel extends IFluidLoadable {
|
|
|
91
92
|
fullTree?: boolean,
|
|
92
93
|
trackState?: boolean,
|
|
93
94
|
telemetryContext?: ITelemetryContext,
|
|
95
|
+
incrementalSummaryContext?: IExperimentalIncrementalSummaryContext,
|
|
94
96
|
): Promise<ISummaryTreeWithStats>;
|
|
95
97
|
|
|
96
98
|
/**
|