@fluidframework/datastore-definitions 0.52.1 → 0.54.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/dist/channel.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IFluidLoadable } from "@fluidframework/core-interfaces";
5
+ import { IFluidHandle, IFluidLoadable } from "@fluidframework/core-interfaces";
6
6
  import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
7
7
  import { IGarbageCollectionData, ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
8
8
  import { IChannelAttributes } from "./storage";
@@ -84,6 +84,13 @@ export interface IDeltaConnection {
84
84
  * that needs to be part of the summary but does not generate ops.
85
85
  */
86
86
  dirty(): void;
87
+ /**
88
+ * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
89
+ * all references added in the system.
90
+ * @param srcHandle - The handle of the node that added the reference.
91
+ * @param outboundHandle - The handle of the outbound node that is referenced.
92
+ */
93
+ addedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;
87
94
  }
88
95
  /**
89
96
  * Storage services to read the objects at a given path.
@@ -1 +1 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,WAAW,QAAS,SAAQ,cAAc;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,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E,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAEjD;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzC;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,eAAe,EAAE,gBAAgB,CAAC;IAElC,aAAa,EAAE,sBAAsB,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IAExC;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACA,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,iBAAiB,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAChD,OAAO,CAAC,QAAQ,CAAC,CAAC;IAErB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC;CACjE"}
@@ -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 { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { IGarbageCollectionData, ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { IChannelAttributes } from \"./storage\";\nimport { IFluidDataStoreRuntime } from \"./dataStoreRuntime\";\n\nexport interface IChannel extends IFluidLoadable {\n /**\n * A readonly identifier for the channel\n */\n readonly id: string;\n\n readonly owner?: string;\n\n readonly attributes: IChannelAttributes;\n\n /**\n * Generates summary of the channel.\n * @returns A tree representing the summary of the channel.\n */\n summarize(fullTree?: boolean, trackState?: boolean): ISummaryTreeWithStats;\n\n /**\n * True if the data structure is attached to storage.\n */\n isAttached(): boolean;\n\n /**\n * Enables the channel to send and receive ops\n */\n connect(services: IChannelServices): void;\n\n /**\n * Returns the GC data for this channel. It contains a list of GC nodes that contains references to\n * other GC nodes.\n * @param fullGC - true to bypass optimizations and force full generation of GC data.\n */\n getGCData(fullGC?: boolean): IGarbageCollectionData;\n}\n\n/**\n * Handler provided by shared data structure to process requests from the runtime.\n */\nexport interface IDeltaHandler {\n /**\n * Processes the op.\n * @param message - The message to process\n * @param local - Whether the message originated from the local client\n * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n * For messages from a remote client, this will be undefined.\n */\n process: (message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => void;\n\n /**\n * State change events to indicate changes to the delta connection\n * @param connected - true if connected, false otherwise\n */\n setConnectionState(connected: boolean): void;\n\n /**\n * Called when the runtime asks the client to resubmit an op. This may be because the Container reconnected and\n * this op was not acked.\n * The client can choose to resubmit the same message, submit different / multiple messages or not submit anything\n * at all.\n * @param message - The original message that was submitted.\n * @param localOpMetadata - The local metadata associated with the original message.\n */\n reSubmit(message: any, localOpMetadata: unknown): void;\n\n applyStashedOp(message: any): unknown;\n}\n\n/**\n * Interface to represent a connection to a delta notification stream.\n */\nexport interface IDeltaConnection {\n connected: boolean;\n\n /**\n * Send new messages to the server.\n * @param messageContent - The content of the message to be sent.\n * @param localOpMetadata - The local metadata associated with the message. This is kept locally by the runtime\n * and not sent to the server. It will be provided back when this message is acknowledged by the server. It will\n * also be provided back when asked to resubmit the message.\n */\n submit(messageContent: any, localOpMetadata: unknown): void;\n\n /**\n * Attaches a message handler to the delta connection\n */\n attach(handler: IDeltaHandler): void;\n\n /**\n * Indicates that the channel is dirty and needs to be part of the summary. It is called by a SharedSummaryBlock\n * that needs to be part of the summary but does not generate ops.\n */\n dirty(): void;\n}\n\n/**\n * Storage services to read the objects at a given path.\n */\nexport interface IChannelStorageService {\n /**\n * Reads the object contained at the given path. Returns a buffer representation for the object.\n */\n readBlob(path: string): Promise<ArrayBufferLike>;\n\n /**\n * Determines if there is an object contained at the given path.\n */\n contains(path: string): Promise<boolean>;\n\n /**\n * Lists the blobs that exist at a specific path.\n */\n list(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 deltaConnection: IDeltaConnection;\n\n objectStorage: IChannelStorageService;\n}\n\n/**\n * Definitions of a channel factory. Factories follow a common model but enable custom behavior.\n */\nexport interface IChannelFactory {\n /**\n * String representing the type of the factory.\n */\n readonly type: string;\n\n /**\n * Attributes of the channel.\n */\n readonly attributes: IChannelAttributes;\n\n /**\n * Loads the given channel. This call is only ever invoked internally as the only thing\n * that is ever directly loaded is the document itself. Load will then only be called on documents that\n * were created and added to a channel.\n * @param runtime - Data store runtime containing state/info/helper methods about the data store.\n * @param id - ID of the channel.\n * @param services - Services to read objects at a given path using the delta connection.\n * @param channelAttributes - The attributes for the the channel to be loaded.\n * @returns The loaded object\n *\n * @privateRemarks\n * Thought: should the storage object include the version information and limit access to just files\n * for the given object? The latter seems good in general. But both are probably good things. We then just\n * need a way to allow the document to provide later storage for the object.\n */\n load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n channelAttributes: Readonly<IChannelAttributes>,\n ): Promise<IChannel>;\n\n /**\n * Creates a local version of the channel.\n * Calling attach on the object later will insert it into the object stream.\n * @param runtime - The runtime the new object will be associated with\n * @param id - The unique ID of the new object\n * @returns The newly created object.\n *\n * @privateRemarks\n * NOTE here - When we attach we need to submit all the pending ops prior to actually doing the attach\n * for consistency.\n */\n create(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 { IGarbageCollectionData, ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { IChannelAttributes } from \"./storage\";\nimport { IFluidDataStoreRuntime } from \"./dataStoreRuntime\";\n\nexport interface IChannel extends IFluidLoadable {\n /**\n * A readonly identifier for the channel\n */\n readonly id: string;\n\n readonly owner?: string;\n\n readonly attributes: IChannelAttributes;\n\n /**\n * Generates summary of the channel.\n * @returns A tree representing the summary of the channel.\n */\n summarize(fullTree?: boolean, trackState?: boolean): ISummaryTreeWithStats;\n\n /**\n * True if the data structure is attached to storage.\n */\n isAttached(): boolean;\n\n /**\n * Enables the channel to send and receive ops\n */\n connect(services: IChannelServices): void;\n\n /**\n * Returns the GC data for this channel. It contains a list of GC nodes that contains references to\n * other GC nodes.\n * @param fullGC - true to bypass optimizations and force full generation of GC data.\n */\n getGCData(fullGC?: boolean): IGarbageCollectionData;\n}\n\n/**\n * Handler provided by shared data structure to process requests from the runtime.\n */\nexport interface IDeltaHandler {\n /**\n * Processes the op.\n * @param message - The message to process\n * @param local - Whether the message originated from the local client\n * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.\n * For messages from a remote client, this will be undefined.\n */\n process: (message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) => void;\n\n /**\n * State change events to indicate changes to the delta connection\n * @param connected - true if connected, false otherwise\n */\n setConnectionState(connected: boolean): void;\n\n /**\n * Called when the runtime asks the client to resubmit an op. This may be because the Container reconnected and\n * this op was not acked.\n * The client can choose to resubmit the same message, submit different / multiple messages or not submit anything\n * at all.\n * @param message - The original message that was submitted.\n * @param localOpMetadata - The local metadata associated with the original message.\n */\n reSubmit(message: any, localOpMetadata: unknown): void;\n\n applyStashedOp(message: any): unknown;\n}\n\n/**\n * Interface to represent a connection to a delta notification stream.\n */\nexport interface IDeltaConnection {\n connected: boolean;\n\n /**\n * Send new messages to the server.\n * @param messageContent - The content of the message to be sent.\n * @param localOpMetadata - The local metadata associated with the message. This is kept locally by the runtime\n * and not sent to the server. It will be provided back when this message is acknowledged by the server. It will\n * also be provided back when asked to resubmit the message.\n */\n submit(messageContent: any, localOpMetadata: unknown): void;\n\n /**\n * Attaches a message handler to the delta connection\n */\n attach(handler: IDeltaHandler): void;\n\n /**\n * Indicates that the channel is dirty and needs to be part of the summary. It is called by a SharedSummaryBlock\n * that needs to be part of the summary but does not generate ops.\n */\n dirty(): void;\n\n /**\n * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n * all references added in the system.\n * @param srcHandle - The handle of the node that added the reference.\n * @param outboundHandle - The handle of the outbound node that is referenced.\n */\n addedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;\n}\n\n/**\n * Storage services to read the objects at a given path.\n */\nexport interface IChannelStorageService {\n /**\n * Reads the object contained at the given path. Returns a buffer representation for the object.\n */\n readBlob(path: string): Promise<ArrayBufferLike>;\n\n /**\n * Determines if there is an object contained at the given path.\n */\n contains(path: string): Promise<boolean>;\n\n /**\n * Lists the blobs that exist at a specific path.\n */\n list(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 deltaConnection: IDeltaConnection;\n\n objectStorage: IChannelStorageService;\n}\n\n/**\n * Definitions of a channel factory. Factories follow a common model but enable custom behavior.\n */\nexport interface IChannelFactory {\n /**\n * String representing the type of the factory.\n */\n readonly type: string;\n\n /**\n * Attributes of the channel.\n */\n readonly attributes: IChannelAttributes;\n\n /**\n * Loads the given channel. This call is only ever invoked internally as the only thing\n * that is ever directly loaded is the document itself. Load will then only be called on documents that\n * were created and added to a channel.\n * @param runtime - Data store runtime containing state/info/helper methods about the data store.\n * @param id - ID of the channel.\n * @param services - Services to read objects at a given path using the delta connection.\n * @param channelAttributes - The attributes for the the channel to be loaded.\n * @returns The loaded object\n *\n * @privateRemarks\n * Thought: should the storage object include the version information and limit access to just files\n * for the given object? The latter seems good in general. But both are probably good things. We then just\n * need a way to allow the document to provide later storage for the object.\n */\n load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n channelAttributes: Readonly<IChannelAttributes>,\n ): Promise<IChannel>;\n\n /**\n * Creates a local version of the channel.\n * Calling attach on the object later will insert it into the object stream.\n * @param runtime - The runtime the new object will be associated with\n * @param id - The unique ID of the new object\n * @returns The newly created object.\n *\n * @privateRemarks\n * NOTE here - When we attach we need to submit all the pending ops prior to actually doing the attach\n * for consistency.\n */\n create(runtime: IFluidDataStoreRuntime, id: string): IChannel;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  import { IDisposable, IEvent, IEventProvider, ITelemetryLogger } from "@fluidframework/common-definitions";
6
6
  import { IFluidHandleContext, IFluidSerializer, IFluidRouter, IFluidHandle } from "@fluidframework/core-interfaces";
7
7
  import { IAudience, IDeltaManager, ContainerWarning, AttachState, ILoaderOptions } from "@fluidframework/container-definitions";
8
- import { IDocumentMessage, IQuorum, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
8
+ import { IDocumentMessage, IQuorumClients, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
9
9
  import { IInboundSignalMessage, IProvideFluidDataStoreRegistry } from "@fluidframework/runtime-definitions";
10
10
  import { IChannel } from ".";
11
11
  export interface IFluidDataStoreRuntimeEvents extends IEvent {
@@ -19,6 +19,9 @@ export interface IFluidDataStoreRuntimeEvents extends IEvent {
19
19
  */
20
20
  export interface IFluidDataStoreRuntime extends IFluidRouter, IEventProvider<IFluidDataStoreRuntimeEvents>, IDisposable, Partial<IProvideFluidDataStoreRegistry> {
21
21
  readonly id: string;
22
+ /**
23
+ * @deprecated - FluidSerializer is not required as DDSs are the only ones that serialize data.
24
+ */
22
25
  readonly IFluidSerializer: IFluidSerializer;
23
26
  readonly IFluidHandleContext: IFluidHandleContext;
24
27
  readonly rootRoutingContext: IFluidHandleContext;
@@ -62,7 +65,7 @@ export interface IFluidDataStoreRuntime extends IFluidRouter, IEventProvider<IFl
62
65
  /**
63
66
  * Returns the current quorum.
64
67
  */
65
- getQuorum(): IQuorum;
68
+ getQuorum(): IQuorumClients;
66
69
  /**
67
70
  * Returns the current audience.
68
71
  */
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3G,OAAO,EACH,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,cAAc,EACjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,gBAAgB,EAChB,OAAO,EACP,yBAAyB,EAC5B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AAE7B,MAAM,WAAW,4BAA6B,SAAQ,MAAM;IACxD,CAEI,KAAK,EAAE,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,EAC5D,QAAQ,EAAE,MAAM,IAAI,OACtB;IACF,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,IAAI,OAAE;IACtE,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,OAAE;IACtF,CAAC,K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CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IAE/C;;OAEG;IACH,SAAS,IAAI,cAAc,CAAC;IAE5B;;OAEG;IACH,WAAW,IAAI,SAAS,CAAC;IAEzB;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9B;;;OAGG;IACH,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRuntime.js","sourceRoot":"","sources":["../src/dataStoreRuntime.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 { IDisposable, IEvent, IEventProvider, ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport {\n IFluidHandleContext,\n IFluidSerializer,\n IFluidRouter,\n IFluidHandle,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IAudience,\n IDeltaManager,\n ContainerWarning,\n AttachState,\n ILoaderOptions,\n} from \"@fluidframework/container-definitions\";\nimport {\n IDocumentMessage,\n IQuorum,\n ISequencedDocumentMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport { IInboundSignalMessage, IProvideFluidDataStoreRegistry } from \"@fluidframework/runtime-definitions\";\nimport { IChannel } from \".\";\n\nexport interface IFluidDataStoreRuntimeEvents extends IEvent {\n (\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n event: \"disconnected\" | \"dispose\" | \"attaching\" | \"attached\",\n listener: () => void,\n );\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n (event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n (event: \"connected\", listener: (clientId: string) => void);\n}\n\n/**\n * Represents the runtime for the data store. Contains helper functions/state of the data store.\n */\nexport interface IFluidDataStoreRuntime extends\n IFluidRouter,\n IEventProvider<IFluidDataStoreRuntimeEvents>,\n IDisposable,\n Partial<IProvideFluidDataStoreRegistry> {\n\n readonly id: string;\n\n readonly IFluidSerializer: IFluidSerializer;\n\n readonly IFluidHandleContext: IFluidHandleContext;\n\n readonly rootRoutingContext: IFluidHandleContext;\n readonly channelsRoutingContext: IFluidHandleContext;\n readonly objectsRoutingContext: IFluidHandleContext;\n\n readonly options: ILoaderOptions;\n\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n readonly clientId: string | undefined;\n\n readonly connected: boolean;\n\n readonly logger: ITelemetryLogger;\n\n /**\n * Indicates the attachment state of the data store to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Returns the channel with the given id\n */\n getChannel(id: string): Promise<IChannel>;\n\n /**\n * Creates a new channel of the given type.\n * @param id - ID of the channel to be created. A unique ID will be generated if left undefined.\n * @param type - Type of the channel.\n */\n createChannel(id: string | undefined, type: string): IChannel;\n\n /**\n * Bind the channel with the data store runtime. If the runtime\n * is attached then we attach the channel to make it live.\n */\n bindChannel(channel: IChannel): void;\n\n // Blob related calls\n /**\n * Api to upload a blob of data.\n * @param blob - blob to be uploaded.\n */\n uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;\n\n /**\n * Submits the signal to be sent to other clients.\n * @param type - Type of the signal.\n * @param content - Content of the signal.\n */\n submitSignal(type: string, content: any): void;\n\n /**\n * Returns the current quorum.\n */\n getQuorum(): IQuorum;\n\n /**\n * Returns the current audience.\n */\n getAudience(): IAudience;\n\n /**\n * Resolves when a local data store is attached.\n */\n waitAttached(): Promise<void>;\n\n /**\n * Errors raised by distributed data structures\n * @deprecated Warnings are being deprecated\n */\n raiseContainerWarning(warning: ContainerWarning): void;\n}\n"]}
1
+ {"version":3,"file":"dataStoreRuntime.js","sourceRoot":"","sources":["../src/dataStoreRuntime.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 { IDisposable, IEvent, IEventProvider, ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport {\n IFluidHandleContext,\n IFluidSerializer,\n IFluidRouter,\n IFluidHandle,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IAudience,\n IDeltaManager,\n ContainerWarning,\n AttachState,\n ILoaderOptions,\n} from \"@fluidframework/container-definitions\";\nimport {\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport { IInboundSignalMessage, IProvideFluidDataStoreRegistry } from \"@fluidframework/runtime-definitions\";\nimport { IChannel } from \".\";\n\nexport interface IFluidDataStoreRuntimeEvents extends IEvent {\n (\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n event: \"disconnected\" | \"dispose\" | \"attaching\" | \"attached\",\n listener: () => void,\n );\n (event: \"op\", listener: (message: ISequencedDocumentMessage) => void);\n (event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n (event: \"connected\", listener: (clientId: string) => void);\n}\n\n/**\n * Represents the runtime for the data store. Contains helper functions/state of the data store.\n */\nexport interface IFluidDataStoreRuntime extends\n IFluidRouter,\n IEventProvider<IFluidDataStoreRuntimeEvents>,\n IDisposable,\n Partial<IProvideFluidDataStoreRegistry> {\n\n readonly id: string;\n\n /**\n * @deprecated - FluidSerializer is not required as DDSs are the only ones that serialize data.\n */\n readonly IFluidSerializer: IFluidSerializer;\n\n readonly IFluidHandleContext: IFluidHandleContext;\n\n readonly rootRoutingContext: IFluidHandleContext;\n readonly channelsRoutingContext: IFluidHandleContext;\n readonly objectsRoutingContext: IFluidHandleContext;\n\n readonly options: ILoaderOptions;\n\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\n readonly clientId: string | undefined;\n\n readonly connected: boolean;\n\n readonly logger: ITelemetryLogger;\n\n /**\n * Indicates the attachment state of the data store to a host service.\n */\n readonly attachState: AttachState;\n\n /**\n * Returns the channel with the given id\n */\n getChannel(id: string): Promise<IChannel>;\n\n /**\n * Creates a new channel of the given type.\n * @param id - ID of the channel to be created. A unique ID will be generated if left undefined.\n * @param type - Type of the channel.\n */\n createChannel(id: string | undefined, type: string): IChannel;\n\n /**\n * Bind the channel with the data store runtime. If the runtime\n * is attached then we attach the channel to make it live.\n */\n bindChannel(channel: IChannel): void;\n\n // Blob related calls\n /**\n * Api to upload a blob of data.\n * @param blob - blob to be uploaded.\n */\n uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;\n\n /**\n * Submits the signal to be sent to other clients.\n * @param type - Type of the signal.\n * @param content - Content of the signal.\n */\n submitSignal(type: string, content: any): void;\n\n /**\n * Returns the current quorum.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Returns the current audience.\n */\n getAudience(): IAudience;\n\n /**\n * Resolves when a local data store is attached.\n */\n waitAttached(): Promise<void>;\n\n /**\n * Errors raised by distributed data structures\n * @deprecated Warnings are being deprecated\n */\n raiseContainerWarning(warning: ContainerWarning): void;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/datastore-definitions",
3
- "version": "0.52.1",
3
+ "version": "0.54.0",
4
4
  "description": "Fluid data store definitions",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": "https://github.com/microsoft/FluidFramework",
@@ -26,7 +26,6 @@
26
26
  "eslint:fix": "eslint --format stylish src --fix",
27
27
  "lint": "npm run eslint",
28
28
  "lint:fix": "npm run eslint:fix",
29
- "test:types": "tsd",
30
29
  "tsc": "tsc",
31
30
  "tsfmt": "tsfmt --verify",
32
31
  "tsfmt:fix": "tsfmt --replace"
@@ -34,17 +33,18 @@
34
33
  "dependencies": {
35
34
  "@fluidframework/common-definitions": "^0.20.1",
36
35
  "@fluidframework/common-utils": "^0.32.1",
37
- "@fluidframework/container-definitions": "^0.42.0",
36
+ "@fluidframework/container-definitions": "^0.44.0",
38
37
  "@fluidframework/core-interfaces": "^0.41.0",
39
38
  "@fluidframework/protocol-definitions": "^0.1026.0",
40
- "@fluidframework/runtime-definitions": "^0.52.1",
41
- "@types/node": "^12.19.0"
39
+ "@fluidframework/runtime-definitions": "^0.54.0",
40
+ "@types/node": "^14.18.0"
42
41
  },
43
42
  "devDependencies": {
44
43
  "@fluidframework/build-common": "^0.23.0",
45
- "@fluidframework/build-tools": "^0.2.44827",
44
+ "@fluidframework/build-tools": "^0.2.46657",
46
45
  "@fluidframework/datastore-definitions-0.51.1": "npm:@fluidframework/datastore-definitions@0.51.1",
47
46
  "@fluidframework/datastore-definitions-0.52.0": "npm:@fluidframework/datastore-definitions@0.52.0",
47
+ "@fluidframework/datastore-definitions-0.53.0": "npm:@fluidframework/datastore-definitions@0.53.0",
48
48
  "@fluidframework/eslint-config-fluid": "^0.24.0",
49
49
  "@microsoft/api-extractor": "^7.16.1",
50
50
  "@typescript-eslint/eslint-plugin": "~4.14.0",
@@ -59,29 +59,36 @@
59
59
  "eslint-plugin-react": "~7.22.0",
60
60
  "eslint-plugin-unicorn": "~26.0.1",
61
61
  "rimraf": "^2.6.2",
62
- "tsd": "^0.11.0",
63
62
  "typescript": "~4.1.3",
64
63
  "typescript-formatter": "7.1.0"
65
64
  },
66
- "tsd": {
67
- "directory": "test-d",
68
- "compilerOptions": {
69
- "rootDir": "test-d",
70
- "include": [
71
- "test-d/*"
72
- ],
73
- "lib": [
74
- "es2015"
75
- ],
76
- "types": [],
77
- "exclude": [
78
- "dist",
79
- "node_modules"
80
- ]
81
- }
82
- },
83
65
  "typeValidation": {
84
- "version": "0.52.1",
85
- "broken": {}
66
+ "version": "0.54.0",
67
+ "broken": {
68
+ "0.51.1": {
69
+ "InterfaceDeclaration_IChannel": {
70
+ "backCompat": false,
71
+ "forwardCompat": false
72
+ },
73
+ "InterfaceDeclaration_IChannelFactory": {
74
+ "backCompat": false,
75
+ "forwardCompat": false
76
+ },
77
+ "InterfaceDeclaration_IFluidDataStoreRuntime": {
78
+ "backCompat": false,
79
+ "forwardCompat": false
80
+ }
81
+ },
82
+ "0.52.0": {
83
+ "InterfaceDeclaration_IFluidDataStoreRuntime": {
84
+ "backCompat": false
85
+ }
86
+ },
87
+ "0.53.0": {
88
+ "InterfaceDeclaration_IFluidDataStoreRuntime": {
89
+ "backCompat": false
90
+ }
91
+ }
92
+ }
86
93
  }
87
94
  }
package/src/channel.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IFluidLoadable } from "@fluidframework/core-interfaces";
6
+ import { IFluidHandle, IFluidLoadable } from "@fluidframework/core-interfaces";
7
7
  import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
8
8
  import { IGarbageCollectionData, ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
9
9
  import { IChannelAttributes } from "./storage";
@@ -100,6 +100,14 @@ export interface IDeltaConnection {
100
100
  * that needs to be part of the summary but does not generate ops.
101
101
  */
102
102
  dirty(): void;
103
+
104
+ /**
105
+ * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
106
+ * all references added in the system.
107
+ * @param srcHandle - The handle of the node that added the reference.
108
+ * @param outboundHandle - The handle of the outbound node that is referenced.
109
+ */
110
+ addedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;
103
111
  }
104
112
 
105
113
  /**
@@ -19,7 +19,7 @@ import {
19
19
  } from "@fluidframework/container-definitions";
20
20
  import {
21
21
  IDocumentMessage,
22
- IQuorum,
22
+ IQuorumClients,
23
23
  ISequencedDocumentMessage,
24
24
  } from "@fluidframework/protocol-definitions";
25
25
  import { IInboundSignalMessage, IProvideFluidDataStoreRegistry } from "@fluidframework/runtime-definitions";
@@ -47,6 +47,9 @@ export interface IFluidDataStoreRuntime extends
47
47
 
48
48
  readonly id: string;
49
49
 
50
+ /**
51
+ * @deprecated - FluidSerializer is not required as DDSs are the only ones that serialize data.
52
+ */
50
53
  readonly IFluidSerializer: IFluidSerializer;
51
54
 
52
55
  readonly IFluidHandleContext: IFluidHandleContext;
@@ -105,7 +108,7 @@ export interface IFluidDataStoreRuntime extends
105
108
  /**
106
109
  * Returns the current quorum.
107
110
  */
108
- getQuorum(): IQuorum;
111
+ getQuorum(): IQuorumClients;
109
112
 
110
113
  /**
111
114
  * Returns the current audience.
@@ -1,170 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- import {expectError} from 'tsd';
7
- import { Jsonable } from '../dist/jsonable';
8
-
9
- declare function foo<T>(a: Jsonable<T>): void;
10
-
11
- // --- ideally wouldn't work but do as we don't know how to just exclude classes
12
-
13
- // test simple class.
14
- class Z {
15
- public a = "a";
16
- }
17
-
18
- foo<Z>(new Z())
19
-
20
- //test class with getter
21
- class getter {
22
- public get baz(): number {
23
- return 0;
24
- }
25
- }
26
-
27
- foo(new getter());
28
-
29
- // --- should work
30
-
31
- // test plain types
32
- foo(1);
33
- foo("");
34
- foo(undefined);
35
- foo(null);
36
- foo(true);
37
- foo([]);
38
- foo([0]);
39
- foo([""]);
40
- foo({});
41
- foo({ a:"a" });
42
-
43
- // test simple interface
44
- interface IA {
45
- a: "a";
46
- }
47
- declare const a: IA;
48
- foo(a)
49
-
50
- // test simple indexed interface
51
- interface IA2 {
52
- ["a"]: "a";
53
- }
54
- declare const a2: IA2;
55
- foo(a2);
56
-
57
- // text complex indexed interface
58
- declare const a3: { [key: string]: Jsonable<string> };
59
- foo(a3);
60
-
61
- // test interface with multiple properties
62
- interface A5 {
63
- a: "a",
64
- b: "b",
65
- };
66
- declare const a5: A5;
67
- foo(a5);
68
-
69
- // test interface with optional property
70
- interface A6 {
71
- a?: "a",
72
- };
73
- declare const a6: A6;
74
- foo(a6);
75
-
76
- // test simple type
77
- type A7 = {
78
- a: "a",
79
- };
80
-
81
- declare const a7: A7;
82
- foo(a7);
83
-
84
-
85
- // test nested interface
86
- interface IBN {
87
- b2: string;
88
- }
89
-
90
- interface INested {
91
- a: string;
92
- b: IBN;
93
- }
94
-
95
- const nested: INested = {
96
- a: "a",
97
- b: {
98
- b2:"foo",
99
- },
100
- }
101
- foo(nested);
102
-
103
- // --- should not work
104
-
105
- // test interface with method, and member
106
- interface IA11 {
107
- ["a"]: "a";
108
- foo: () => void;
109
- }
110
- declare const a11: IA11;
111
- expectError(foo(a11));
112
-
113
-
114
- // test interface with optional method
115
- interface A12 {
116
- foo?: () => void,
117
- };
118
- declare const a12: A12;
119
- expectError(foo(a12));
120
-
121
- // test type with method
122
- type A13 = {
123
- foo: () => void,
124
- };
125
- declare const a13: A13;
126
- expectError(foo(a13));
127
-
128
- // test type with primative and object with classes union
129
- interface IA14 {
130
- a: number | Date;
131
- }
132
- declare const a14: IA14;
133
- expectError(foo(a14));
134
-
135
- //test class with function
136
- class bar {
137
- public baz() {
138
- }
139
- }
140
-
141
- expectError(foo(new bar()));
142
-
143
-
144
- // test class with complex property
145
- interface MapProp{
146
- m: Map<string,string>
147
- }
148
- const mt: MapProp = {
149
- m: new Map(),
150
- }
151
- expectError(foo(mt));
152
-
153
- //test nested interface with complex property
154
- interface NestedMapProp{
155
- n: MapProp;
156
- }
157
- const nmt: NestedMapProp = {
158
- n: mt,
159
- };
160
- expectError(foo(nmt));
161
-
162
- // test class with symbol indexer for property
163
- const sym = Symbol.for("test");
164
- interface ISymbol{
165
- [sym]:string,
166
- }
167
- const isym: ISymbol ={
168
- [sym]:"foo",
169
- }
170
- expectError(foo(isym));