@fluidframework/datastore 2.0.0-rc.3.0.3 → 2.0.0-rc.4.0.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 +21 -0
- package/api-report/datastore.api.md +16 -13
- package/dist/channelContext.d.ts +1 -1
- package/dist/channelContext.d.ts.map +1 -1
- package/dist/channelContext.js.map +1 -1
- package/dist/channelStorageService.d.ts +1 -1
- package/dist/channelStorageService.d.ts.map +1 -1
- package/dist/channelStorageService.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts +9 -15
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +9 -20
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/fluidHandle.d.ts +5 -7
- package/dist/fluidHandle.d.ts.map +1 -1
- package/dist/fluidHandle.js +2 -7
- package/dist/fluidHandle.js.map +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/localChannelContext.d.ts +1 -1
- package/dist/localChannelContext.d.ts.map +1 -1
- package/dist/localChannelContext.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/remoteChannelContext.d.ts.map +1 -1
- package/dist/remoteChannelContext.js.map +1 -1
- package/lib/channelContext.d.ts +1 -1
- package/lib/channelContext.d.ts.map +1 -1
- package/lib/channelContext.js +1 -1
- package/lib/channelContext.js.map +1 -1
- package/lib/channelStorageService.d.ts +1 -1
- package/lib/channelStorageService.d.ts.map +1 -1
- package/lib/channelStorageService.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts +9 -15
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +10 -21
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/fluidHandle.d.ts +5 -7
- package/lib/fluidHandle.d.ts.map +1 -1
- package/lib/fluidHandle.js +3 -8
- package/lib/fluidHandle.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/localChannelContext.d.ts +1 -1
- package/lib/localChannelContext.d.ts.map +1 -1
- package/lib/localChannelContext.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/remoteChannelContext.d.ts.map +1 -1
- package/lib/remoteChannelContext.js +1 -1
- package/lib/remoteChannelContext.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +26 -21
- package/src/channelContext.ts +5 -2
- package/src/channelStorageService.ts +1 -1
- package/src/dataStoreRuntime.ts +27 -27
- package/src/fluidHandle.ts +7 -12
- package/src/localChannelContext.ts +1 -2
- package/src/packageVersion.ts +1 -1
- package/src/remoteChannelContext.ts +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @fluidframework/datastore
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.4.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Type Erase IFluidDataStoreRuntime.deltaManager [96872186d0](https://github.com/microsoft/FluidFramework/commit/96872186d0d0f245c1fece7d19b3743e501679b6)
|
|
8
|
+
|
|
9
|
+
Make IFluidDataStoreRuntime.deltaManager have an opaque type.
|
|
10
|
+
Marks the following types which were reachable from it as alpha:
|
|
11
|
+
|
|
12
|
+
- IConnectionDetails
|
|
13
|
+
- IDeltaSender
|
|
14
|
+
- IDeltaManagerEvents
|
|
15
|
+
- IDeltaManager
|
|
16
|
+
- IDeltaQueueEvents
|
|
17
|
+
- IDeltaQueue
|
|
18
|
+
- ReadOnlyInfo
|
|
19
|
+
|
|
20
|
+
As a temporary workaround, users needing access to the full delta manager API can use the `@alpha` `toDeltaManagerInternal` API to retrieve its members, but should migrate away from requiring access to those APIs.
|
|
21
|
+
|
|
22
|
+
Implementing a custom `IFluidDataStoreRuntime` is not supported: this is now indicated by it being marked with `@sealed`.
|
|
23
|
+
|
|
3
24
|
## 2.0.0-rc.3.0.0
|
|
4
25
|
|
|
5
26
|
### Major Changes
|
|
@@ -5,29 +5,32 @@
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
7
|
import { AttachState } from '@fluidframework/container-definitions';
|
|
8
|
-
import {
|
|
8
|
+
import { FluidHandleBase } from '@fluidframework/runtime-utils/internal';
|
|
9
|
+
import { FluidObject } from '@fluidframework/core-interfaces/internal';
|
|
9
10
|
import { IAudience } from '@fluidframework/container-definitions';
|
|
10
11
|
import { IChannel } from '@fluidframework/datastore-definitions';
|
|
11
12
|
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
12
13
|
import { IClientDetails } from '@fluidframework/protocol-definitions';
|
|
13
|
-
import { IDeltaManager } from '@fluidframework/container-definitions';
|
|
14
|
+
import { IDeltaManager } from '@fluidframework/container-definitions/internal';
|
|
15
|
+
import { IDeltaManagerErased } from '@fluidframework/datastore-definitions';
|
|
14
16
|
import { IDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
15
17
|
import { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions/internal';
|
|
16
18
|
import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions/internal';
|
|
17
19
|
import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
18
20
|
import { IFluidDataStoreRuntimeEvents } from '@fluidframework/datastore-definitions';
|
|
19
|
-
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
20
|
-
import { IFluidHandleContext } from '@fluidframework/core-interfaces';
|
|
21
|
+
import { IFluidHandle } from '@fluidframework/core-interfaces/internal';
|
|
22
|
+
import { IFluidHandleContext } from '@fluidframework/core-interfaces/internal';
|
|
23
|
+
import type { IFluidHandleInternal } from '@fluidframework/core-interfaces/internal';
|
|
21
24
|
import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
|
|
22
25
|
import { IIdCompressor } from '@fluidframework/id-compressor';
|
|
23
26
|
import { IInboundSignalMessage } from '@fluidframework/runtime-definitions';
|
|
24
27
|
import { IQuorumClients } from '@fluidframework/protocol-definitions';
|
|
25
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
26
|
-
import { IResponse } from '@fluidframework/core-interfaces';
|
|
28
|
+
import { IRequest } from '@fluidframework/core-interfaces/internal';
|
|
29
|
+
import { IResponse } from '@fluidframework/core-interfaces/internal';
|
|
27
30
|
import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
|
|
28
31
|
import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
|
|
29
32
|
import { ITelemetryContext } from '@fluidframework/runtime-definitions';
|
|
30
|
-
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
33
|
+
import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils/internal';
|
|
31
34
|
import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
32
35
|
import { VisibilityState } from '@fluidframework/runtime-definitions/internal';
|
|
33
36
|
|
|
@@ -64,13 +67,14 @@ export class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRunt
|
|
|
64
67
|
// (undocumented)
|
|
65
68
|
createChannel(idArg: string | undefined, type: string): IChannel;
|
|
66
69
|
// (undocumented)
|
|
67
|
-
|
|
70
|
+
get deltaManager(): IDeltaManagerErased;
|
|
71
|
+
// (undocumented)
|
|
72
|
+
readonly deltaManagerInternal: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
68
73
|
// (undocumented)
|
|
69
74
|
dispose(): void;
|
|
70
75
|
// (undocumented)
|
|
71
76
|
get disposed(): boolean;
|
|
72
|
-
|
|
73
|
-
readonly entryPoint: IFluidHandle<FluidObject>;
|
|
77
|
+
readonly entryPoint: IFluidHandleInternal<FluidObject>;
|
|
74
78
|
getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData;
|
|
75
79
|
// (undocumented)
|
|
76
80
|
getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
@@ -128,13 +132,12 @@ export class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRunt
|
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
// @alpha
|
|
131
|
-
export class FluidObjectHandle<T extends FluidObject = FluidObject>
|
|
135
|
+
export class FluidObjectHandle<T extends FluidObject = FluidObject> extends FluidHandleBase<T> {
|
|
132
136
|
constructor(value: T | Promise<T>, path: string, routeContext: IFluidHandleContext);
|
|
133
137
|
readonly absolutePath: string;
|
|
134
138
|
attachGraph(): void;
|
|
135
|
-
bind(handle:
|
|
139
|
+
bind(handle: IFluidHandleInternal): void;
|
|
136
140
|
get(): Promise<any>;
|
|
137
|
-
get IFluidHandle(): IFluidHandle;
|
|
138
141
|
get isAttached(): boolean;
|
|
139
142
|
// (undocumented)
|
|
140
143
|
readonly path: string;
|
package/dist/channelContext.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { IDocumentStorageService } from "@fluidframework/driver-definitions/inte
|
|
|
8
8
|
import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
9
9
|
import { IExperimentalIncrementalSummaryContext, IGarbageCollectionData, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
10
10
|
import { IFluidDataStoreContext, ISummarizeResult } from "@fluidframework/runtime-definitions/internal";
|
|
11
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
11
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
12
12
|
import { ChannelDeltaConnection } from "./channelDeltaConnection.js";
|
|
13
13
|
import { ChannelStorageService } from "./channelStorageService.js";
|
|
14
14
|
import { ISharedObjectRegistry } from "./dataStoreRuntime.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelContext.d.ts","sourceRoot":"","sources":["../src/channelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,E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wB,EACxB,QAAiC,EACjC,MAA2B,EAC3B,SAAiB;IAEjB,2DAA2D;IAC3D,IACC,UAAU,CAAC,qBAAqB,KAAK,SAAS;QAC9C,UAAU,CAAC,qBAAqB,KAAK,OAAO,CAAC,UAAU,CAAC,qBAAqB,EAC5E;QACD,MAAM,CAAC,kBAAkB,CAAC;YACzB,SAAS,EAAE,kCAAkC;YAC7C,GAAG,IAAA,2BAAgB,EAAC;gBACnB,WAAW,EAAE,UAAU,CAAC,IAAI;gBAC5B,sBAAsB,EAAE,GAAG,UAAU,CAAC,qBAAqB,IAAI,UAAU,CAAC,cAAc,EAAE;gBAC1F,kBAAkB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,qBAAqB,IAAI,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE;aACtG,CAAC;SACF,CAAC,CAAC;KACH;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AACxE,CAAC;AAxBD,kCAwBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n\tIChannel,\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions/internal\";\nimport { readAndParse } from \"@fluidframework/driver-utils/internal\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIExperimentalIncrementalSummaryContext,\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tIFluidDataStoreContext,\n\tISummarizeResult,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { addBlobToSummary } from \"@fluidframework/runtime-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { DataCorruptionError, tagCodeArtifacts } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { ChannelDeltaConnection } from \"./channelDeltaConnection.js\";\nimport { ChannelStorageService } from \"./channelStorageService.js\";\nimport { ISharedObjectRegistry } from \"./dataStoreRuntime.js\";\n\nexport const attributesBlobKey = \".attributes\";\n\nexport interface IChannelContext {\n\tgetChannel(): Promise<IChannel>;\n\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\tprocessOp(message: ISequencedDocumentMessage, local: boolean, localOpMetadata?: unknown): void;\n\n\tsummarize(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult>;\n\n\treSubmit(content: any, localOpMetadata: unknown): void;\n\n\tapplyStashedOp(content: any): unknown;\n\n\trollback(message: any, localOpMetadata: unknown): void;\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 set 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 context of routes that are used in it. These are used for the following:\n\t * 1. To identify if this context is being referenced in the document or not.\n\t * 2. To identify if this context or any of its children's used routes changed since last summary.\n\t * 3. They are added to the summary generated by this context.\n\t */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n}\n\nexport interface ChannelServiceEndpoints {\n\tdeltaConnection: ChannelDeltaConnection;\n\tobjectStorage: ChannelStorageService;\n}\n\nexport function createChannelServiceEndpoints(\n\tconnected: boolean,\n\tsubmitFn: (content: any, localOpMetadata: unknown) => void,\n\tdirtyFn: () => void,\n\taddedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,\n\tisAttachedAndVisible: () => boolean,\n\tstorageService: IDocumentStorageService,\n\tlogger: ITelemetryLoggerExt,\n\ttree?: ISnapshotTree,\n\textraBlobs?: Map<string, ArrayBufferLike>,\n): ChannelServiceEndpoints {\n\tconst deltaConnection = new ChannelDeltaConnection(\n\t\tconnected,\n\t\t(message, localOpMetadata) => submitFn(message, localOpMetadata),\n\t\tdirtyFn,\n\t\taddedGCOutboundReferenceFn,\n\t\tisAttachedAndVisible,\n\t);\n\tconst objectStorage = new ChannelStorageService(tree, storageService, logger, extraBlobs);\n\n\treturn {\n\t\tdeltaConnection,\n\t\tobjectStorage,\n\t};\n}\n\n/** Used to get the channel's summary for the DDS or DataStore attach op */\nexport function summarizeChannel(\n\tchannel: IChannel,\n\tfullTree: boolean = false,\n\ttrackState: boolean = false,\n\ttelemetryContext?: ITelemetryContext,\n): ISummaryTreeWithStats {\n\tconst summarizeResult = channel.getAttachSummary(fullTree, trackState, telemetryContext);\n\n\t// Add the channel attributes to the returned result.\n\taddBlobToSummary(summarizeResult, attributesBlobKey, JSON.stringify(channel.attributes));\n\treturn summarizeResult;\n}\n\nexport async function summarizeChannelAsync(\n\tchannel: IChannel,\n\tfullTree: boolean = false,\n\ttrackState: boolean = false,\n\ttelemetryContext?: ITelemetryContext,\n\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n): Promise<ISummaryTreeWithStats> {\n\tconst summarizeResult = await channel.summarize(\n\t\tfullTree,\n\t\ttrackState,\n\t\ttelemetryContext,\n\t\tincrementalSummaryContext,\n\t);\n\n\t// Add the channel attributes to the returned result.\n\taddBlobToSummary(summarizeResult, attributesBlobKey, JSON.stringify(channel.attributes));\n\treturn summarizeResult;\n}\n\nexport async function loadChannelFactoryAndAttributes(\n\tdataStoreContext: IFluidDataStoreContext,\n\tservices: ChannelServiceEndpoints,\n\tchannelId: string,\n\tregistry: ISharedObjectRegistry,\n\tattachMessageType?: string,\n): Promise<{ factory: IChannelFactory; attributes: IChannelAttributes }> {\n\tlet attributes: IChannelAttributes | undefined;\n\tif (await services.objectStorage.contains(attributesBlobKey)) {\n\t\tattributes = await readAndParse<IChannelAttributes | undefined>(\n\t\t\tservices.objectStorage,\n\t\t\tattributesBlobKey,\n\t\t);\n\t}\n\n\t// This is a backward compatibility case where the attach message doesn't include attributes. They must\n\t// include attach message type.\n\t// Since old attach messages will not have attributes, we need to keep this as long as we support old attach\n\t// messages.\n\tconst channelFactoryType = attributes ? attributes.type : attachMessageType;\n\tif (channelFactoryType === undefined) {\n\t\tthrow new DataCorruptionError(\n\t\t\t\"channelTypeNotAvailable\",\n\t\t\ttagCodeArtifacts({\n\t\t\t\tchannelId,\n\t\t\t\tdataStoreId: dataStoreContext.id,\n\t\t\t\tdataStorePackagePath: dataStoreContext.packagePath.join(\"/\"),\n\t\t\t\tchannelFactoryType,\n\t\t\t}),\n\t\t);\n\t}\n\tconst factory = registry.get(channelFactoryType);\n\tif (factory === undefined) {\n\t\tthrow new DataCorruptionError(\n\t\t\t\"channelFactoryNotRegisteredForGivenType\",\n\t\t\ttagCodeArtifacts({\n\t\t\t\tchannelId,\n\t\t\t\tdataStoreId: dataStoreContext.id,\n\t\t\t\tdataStorePackagePath: dataStoreContext.packagePath.join(\"/\"),\n\t\t\t\tchannelFactoryType,\n\t\t\t}),\n\t\t);\n\t}\n\t// This is a backward compatibility case where the attach message doesn't include attributes. Get the attributes\n\t// from the factory.\n\tattributes = attributes ?? factory.attributes;\n\treturn { factory, attributes };\n}\n\nexport async function loadChannel(\n\tdataStoreRuntime: IFluidDataStoreRuntime,\n\tattributes: IChannelAttributes,\n\tfactory: IChannelFactory,\n\tservices: ChannelServiceEndpoints,\n\tlogger: ITelemetryLoggerExt,\n\tchannelId: string,\n): Promise<IChannel> {\n\t// Compare snapshot version to collaborative object version\n\tif (\n\t\tattributes.snapshotFormatVersion !== undefined &&\n\t\tattributes.snapshotFormatVersion !== factory.attributes.snapshotFormatVersion\n\t) {\n\t\tlogger.sendTelemetryEvent({\n\t\t\teventName: \"ChannelAttributesVersionMismatch\",\n\t\t\t...tagCodeArtifacts({\n\t\t\t\tchannelType: attributes.type,\n\t\t\t\tchannelSnapshotVersion: `${attributes.snapshotFormatVersion}@${attributes.packageVersion}`,\n\t\t\t\tchannelCodeVersion: `${factory.attributes.snapshotFormatVersion}@${factory.attributes.packageVersion}`,\n\t\t\t}),\n\t\t});\n\t}\n\n\treturn factory.load(dataStoreRuntime, channelId, services, attributes);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"channelContext.js","sourceRoot":"","sources":["../src/channelContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH,oEAAqE;AAYrE,qEAA0E;AAC1E,uEAIkD;AAElD,2EAAqE;AACrE,yEAAmE;AAGtD,QAAA,iBAAiB,GAAG,aAAa,CAAC;AA0C/C,SAAgB,6BAA6B,CAC5C,SAAkB,EAClB,QAA0D,EAC1D,OAAmB,EACnB,0BAA2F,EAC3F,oBAAmC,EACnC,cAAuC,EACvC,MAA2B,EAC3B,IAAoB,EACpB,UAAyC;IAEzC,MAAM,eAAe,GAAG,IAAI,kDAAsB,CACjD,SAAS,EACT,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC,EAChE,OAAO,EACP,0BAA0B,EAC1B,oBAAoB,CACpB,CAAC;IACF,MAAM,aAAa,GAAG,IAAI,gDAAqB,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAE1F,OAAO;QACN,eAAe;QACf,aAAa;KACb,CAAC;AACH,CAAC;AAxBD,sEAwBC;AAED,2EAA2E;AAC3E,SAAgB,gBAAgB,CAC/B,OAAiB,EACjB,WAAoB,KAAK,EACzB,aAAsB,KAAK,EAC3B,gBAAoC;IAEpC,MAAM,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAEzF,qDAAqD;IACrD,IAAA,2BAAgB,EAAC,eAAe,EAAE,yBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC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ed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n\tIChannel,\n\tIChannelAttributes,\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions/internal\";\nimport { readAndParse } from \"@fluidframework/driver-utils/internal\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIExperimentalIncrementalSummaryContext,\n\tIGarbageCollectionData,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tIFluidDataStoreContext,\n\tISummarizeResult,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { addBlobToSummary } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tITelemetryLoggerExt,\n\tDataCorruptionError,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { ChannelDeltaConnection } from \"./channelDeltaConnection.js\";\nimport { ChannelStorageService } from \"./channelStorageService.js\";\nimport { ISharedObjectRegistry } from \"./dataStoreRuntime.js\";\n\nexport const attributesBlobKey = \".attributes\";\n\nexport interface IChannelContext {\n\tgetChannel(): Promise<IChannel>;\n\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\tprocessOp(message: ISequencedDocumentMessage, local: boolean, localOpMetadata?: unknown): void;\n\n\tsummarize(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult>;\n\n\treSubmit(content: any, localOpMetadata: unknown): void;\n\n\tapplyStashedOp(content: any): unknown;\n\n\trollback(message: any, localOpMetadata: unknown): void;\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 set 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 context of routes that are used in it. These are used for the following:\n\t * 1. To identify if this context is being referenced in the document or not.\n\t * 2. To identify if this context or any of its children's used routes changed since last summary.\n\t * 3. They are added to the summary generated by this context.\n\t */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n}\n\nexport interface ChannelServiceEndpoints {\n\tdeltaConnection: ChannelDeltaConnection;\n\tobjectStorage: ChannelStorageService;\n}\n\nexport function createChannelServiceEndpoints(\n\tconnected: boolean,\n\tsubmitFn: (content: any, localOpMetadata: unknown) => void,\n\tdirtyFn: () => void,\n\taddedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,\n\tisAttachedAndVisible: () => boolean,\n\tstorageService: IDocumentStorageService,\n\tlogger: ITelemetryLoggerExt,\n\ttree?: ISnapshotTree,\n\textraBlobs?: Map<string, ArrayBufferLike>,\n): ChannelServiceEndpoints {\n\tconst deltaConnection = new ChannelDeltaConnection(\n\t\tconnected,\n\t\t(message, localOpMetadata) => submitFn(message, localOpMetadata),\n\t\tdirtyFn,\n\t\taddedGCOutboundReferenceFn,\n\t\tisAttachedAndVisible,\n\t);\n\tconst objectStorage = new ChannelStorageService(tree, storageService, logger, extraBlobs);\n\n\treturn {\n\t\tdeltaConnection,\n\t\tobjectStorage,\n\t};\n}\n\n/** Used to get the channel's summary for the DDS or DataStore attach op */\nexport function summarizeChannel(\n\tchannel: IChannel,\n\tfullTree: boolean = false,\n\ttrackState: boolean = false,\n\ttelemetryContext?: ITelemetryContext,\n): ISummaryTreeWithStats {\n\tconst summarizeResult = channel.getAttachSummary(fullTree, trackState, telemetryContext);\n\n\t// Add the channel attributes to the returned result.\n\taddBlobToSummary(summarizeResult, attributesBlobKey, JSON.stringify(channel.attributes));\n\treturn summarizeResult;\n}\n\nexport async function summarizeChannelAsync(\n\tchannel: IChannel,\n\tfullTree: boolean = false,\n\ttrackState: boolean = false,\n\ttelemetryContext?: ITelemetryContext,\n\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n): Promise<ISummaryTreeWithStats> {\n\tconst summarizeResult = await channel.summarize(\n\t\tfullTree,\n\t\ttrackState,\n\t\ttelemetryContext,\n\t\tincrementalSummaryContext,\n\t);\n\n\t// Add the channel attributes to the returned result.\n\taddBlobToSummary(summarizeResult, attributesBlobKey, JSON.stringify(channel.attributes));\n\treturn summarizeResult;\n}\n\nexport async function loadChannelFactoryAndAttributes(\n\tdataStoreContext: IFluidDataStoreContext,\n\tservices: ChannelServiceEndpoints,\n\tchannelId: string,\n\tregistry: ISharedObjectRegistry,\n\tattachMessageType?: string,\n): Promise<{ factory: IChannelFactory; attributes: IChannelAttributes }> {\n\tlet attributes: IChannelAttributes | undefined;\n\tif (await services.objectStorage.contains(attributesBlobKey)) {\n\t\tattributes = await readAndParse<IChannelAttributes | undefined>(\n\t\t\tservices.objectStorage,\n\t\t\tattributesBlobKey,\n\t\t);\n\t}\n\n\t// This is a backward compatibility case where the attach message doesn't include attributes. They must\n\t// include attach message type.\n\t// Since old attach messages will not have attributes, we need to keep this as long as we support old attach\n\t// messages.\n\tconst channelFactoryType = attributes ? attributes.type : attachMessageType;\n\tif (channelFactoryType === undefined) {\n\t\tthrow new DataCorruptionError(\n\t\t\t\"channelTypeNotAvailable\",\n\t\t\ttagCodeArtifacts({\n\t\t\t\tchannelId,\n\t\t\t\tdataStoreId: dataStoreContext.id,\n\t\t\t\tdataStorePackagePath: dataStoreContext.packagePath.join(\"/\"),\n\t\t\t\tchannelFactoryType,\n\t\t\t}),\n\t\t);\n\t}\n\tconst factory = registry.get(channelFactoryType);\n\tif (factory === undefined) {\n\t\tthrow new DataCorruptionError(\n\t\t\t\"channelFactoryNotRegisteredForGivenType\",\n\t\t\ttagCodeArtifacts({\n\t\t\t\tchannelId,\n\t\t\t\tdataStoreId: dataStoreContext.id,\n\t\t\t\tdataStorePackagePath: dataStoreContext.packagePath.join(\"/\"),\n\t\t\t\tchannelFactoryType,\n\t\t\t}),\n\t\t);\n\t}\n\t// This is a backward compatibility case where the attach message doesn't include attributes. Get the attributes\n\t// from the factory.\n\tattributes = attributes ?? factory.attributes;\n\treturn { factory, attributes };\n}\n\nexport async function loadChannel(\n\tdataStoreRuntime: IFluidDataStoreRuntime,\n\tattributes: IChannelAttributes,\n\tfactory: IChannelFactory,\n\tservices: ChannelServiceEndpoints,\n\tlogger: ITelemetryLoggerExt,\n\tchannelId: string,\n): Promise<IChannel> {\n\t// Compare snapshot version to collaborative object version\n\tif (\n\t\tattributes.snapshotFormatVersion !== undefined &&\n\t\tattributes.snapshotFormatVersion !== factory.attributes.snapshotFormatVersion\n\t) {\n\t\tlogger.sendTelemetryEvent({\n\t\t\teventName: \"ChannelAttributesVersionMismatch\",\n\t\t\t...tagCodeArtifacts({\n\t\t\t\tchannelType: attributes.type,\n\t\t\t\tchannelSnapshotVersion: `${attributes.snapshotFormatVersion}@${attributes.packageVersion}`,\n\t\t\t\tchannelCodeVersion: `${factory.attributes.snapshotFormatVersion}@${factory.attributes.packageVersion}`,\n\t\t\t}),\n\t\t});\n\t}\n\n\treturn factory.load(dataStoreRuntime, channelId, services, attributes);\n}\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { IChannelStorageService } from "@fluidframework/datastore-definitions";
|
|
6
6
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions/internal";
|
|
7
7
|
import { ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
8
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
9
9
|
export declare class ChannelStorageService implements IChannelStorageService {
|
|
10
10
|
private readonly tree;
|
|
11
11
|
private readonly storage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelStorageService.d.ts","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"channelStorageService.d.ts","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,qBAAa,qBAAsB,YAAW,sBAAsB;IAoBlE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IAtB7B,OAAO,CAAC,MAAM,CAAC,WAAW;IAgB1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA6B;gBAGzC,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,EAClD,MAAM,EAAE,mBAAmB,EAC3B,UAAU,CAAC,0CAA8B;IAS9C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAehD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAepC,YAAY;CAG1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelStorageService.js","sourceRoot":"","sources":["../src/channelStorageService.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U,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEjF,IAAI,IAAI,KAAK,SAAS,EAAE;YACvB,OAAO,IAAI,CAAC;SACZ;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CACrB,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,EAAE,KAAK,CAAC,CAC3E,CAAC;QAEF,OAAO,KAAK,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,IAAY;QAC7B,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,MAAM,SAAS,GAAG,IAAA,8CAAmC,EAAC,IAAI,CAAC,CAAC;QAC5D,OAAO,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YAClD,oEAAoE;YACpE,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAG,CAAC;YAChC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB;QACD,IAAI,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACjD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACvC;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IACvC,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,IAAY;QACtC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACD;AArED,sDAqEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IChannelStorageService } from \"@fluidframework/datastore-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions/internal\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { getNormalizedObjectStoragePathParts } from \"@fluidframework/runtime-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\n\nexport class ChannelStorageService implements IChannelStorageService {\n\tprivate static flattenTree(\n\t\tbase: string,\n\t\ttree: ISnapshotTree,\n\t\tresults: { [path: string]: string },\n\t) {\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const path in tree.trees) {\n\t\t\tChannelStorageService.flattenTree(`${base}${path}/`, tree.trees[path], results);\n\t\t}\n\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const blob in tree.blobs) {\n\t\t\tresults[`${base}${blob}`] = tree.blobs[blob];\n\t\t}\n\t}\n\n\tprivate readonly flattenedTree: { [path: string]: string };\n\n\tconstructor(\n\t\tprivate readonly tree: ISnapshotTree | undefined,\n\t\tprivate readonly storage: Pick<IDocumentStorageService, \"readBlob\">,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\tprivate readonly extraBlobs?: Map<string, ArrayBufferLike>,\n\t) {\n\t\tthis.flattenedTree = {};\n\t\t// Create a map from paths to blobs\n\t\tif (tree !== undefined) {\n\t\t\tChannelStorageService.flattenTree(\"\", tree, this.flattenedTree);\n\t\t}\n\t}\n\n\tpublic async contains(path: string): Promise<boolean> {\n\t\treturn this.flattenedTree[path] !== undefined;\n\t}\n\n\tpublic async readBlob(path: string): Promise<ArrayBufferLike> {\n\t\tconst id = await this.getIdForPath(path);\n\t\tconst blob = this.extraBlobs !== undefined ? this.extraBlobs.get(id) : undefined;\n\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\t\tconst blobP = this.storage.readBlob(id);\n\t\tblobP.catch((error) =>\n\t\t\tthis.logger.sendErrorEvent({ eventName: \"ChannelStorageBlobError\" }, error),\n\t\t);\n\n\t\treturn blobP;\n\t}\n\n\tpublic async list(path: string): Promise<string[]> {\n\t\tlet tree = this.tree;\n\t\tconst pathParts = getNormalizedObjectStoragePathParts(path);\n\t\twhile (tree !== undefined && pathParts.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst part = pathParts.shift()!;\n\t\t\ttree = tree.trees[part];\n\t\t}\n\t\tif (tree === undefined || pathParts.length !== 0) {\n\t\t\tthrow new Error(\"path does not exist\");\n\t\t}\n\n\t\treturn Object.keys(tree?.blobs ?? {});\n\t}\n\n\tprivate async getIdForPath(path: string): Promise<string> {\n\t\treturn this.flattenedTree[path];\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"channelStorageService.js","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,qEAA6F;AAG7F,MAAa,qBAAqB;IACzB,MAAM,CAAC,WAAW,CACzB,IAAY,EACZ,IAAmB,EACnB,OAAmC;QAEnC,8DAA8D;QAC9D,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YAC9B,qBAAqB,CAAC,WAAW,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;SAChF;QAED,8DAA8D;QAC9D,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YAC9B,OAAO,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC7C;IACF,CAAC;IAID,YACkB,IAA+B,EAC/B,OAAkD,EAClD,MAA2B,EAC3B,UAAyC;QAHzC,SAAI,GAAJ,IAAI,CAA2B;QAC/B,YAAO,GAAP,OAAO,CAA2C;QAClD,WAAM,GAAN,MAAM,CAAqB;QAC3B,eAAU,GAAV,UAAU,CAA+B;QAE1D,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,mCAAmC;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AK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACjD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACvC;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IACvC,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,IAAY;QACtC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACD;AArED,sDAqEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IChannelStorageService } from \"@fluidframework/datastore-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions/internal\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { getNormalizedObjectStoragePathParts } from \"@fluidframework/runtime-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nexport class ChannelStorageService implements IChannelStorageService {\n\tprivate static flattenTree(\n\t\tbase: string,\n\t\ttree: ISnapshotTree,\n\t\tresults: { [path: string]: string },\n\t) {\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const path in tree.trees) {\n\t\t\tChannelStorageService.flattenTree(`${base}${path}/`, tree.trees[path], results);\n\t\t}\n\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const blob in tree.blobs) {\n\t\t\tresults[`${base}${blob}`] = tree.blobs[blob];\n\t\t}\n\t}\n\n\tprivate readonly flattenedTree: { [path: string]: string };\n\n\tconstructor(\n\t\tprivate readonly tree: ISnapshotTree | undefined,\n\t\tprivate readonly storage: Pick<IDocumentStorageService, \"readBlob\">,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\tprivate readonly extraBlobs?: Map<string, ArrayBufferLike>,\n\t) {\n\t\tthis.flattenedTree = {};\n\t\t// Create a map from paths to blobs\n\t\tif (tree !== undefined) {\n\t\t\tChannelStorageService.flattenTree(\"\", tree, this.flattenedTree);\n\t\t}\n\t}\n\n\tpublic async contains(path: string): Promise<boolean> {\n\t\treturn this.flattenedTree[path] !== undefined;\n\t}\n\n\tpublic async readBlob(path: string): Promise<ArrayBufferLike> {\n\t\tconst id = await this.getIdForPath(path);\n\t\tconst blob = this.extraBlobs !== undefined ? this.extraBlobs.get(id) : undefined;\n\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\t\tconst blobP = this.storage.readBlob(id);\n\t\tblobP.catch((error) =>\n\t\t\tthis.logger.sendErrorEvent({ eventName: \"ChannelStorageBlobError\" }, error),\n\t\t);\n\n\t\treturn blobP;\n\t}\n\n\tpublic async list(path: string): Promise<string[]> {\n\t\tlet tree = this.tree;\n\t\tconst pathParts = getNormalizedObjectStoragePathParts(path);\n\t\twhile (tree !== undefined && pathParts.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst part = pathParts.shift()!;\n\t\t\ttree = tree.trees[part];\n\t\t}\n\t\tif (tree === undefined || pathParts.length !== 0) {\n\t\t\tthrow new Error(\"path does not exist\");\n\t\t}\n\n\t\treturn Object.keys(tree?.blobs ?? {});\n\t}\n\n\tprivate async getIdForPath(path: string): Promise<string> {\n\t\treturn this.flattenedTree[path];\n\t}\n}\n"]}
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
6
|
-
import { AttachState, IAudience
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { AttachState, IAudience } from "@fluidframework/container-definitions";
|
|
7
|
+
import { IDeltaManager } from "@fluidframework/container-definitions/internal";
|
|
8
|
+
import { FluidObject, IFluidHandle, IFluidHandleContext, IRequest, IResponse } from "@fluidframework/core-interfaces/internal";
|
|
9
|
+
import type { IFluidHandleInternal } from "@fluidframework/core-interfaces/internal";
|
|
10
|
+
import { IChannel, IChannelFactory, IFluidDataStoreRuntime, IFluidDataStoreRuntimeEvents, type IDeltaManagerErased } from "@fluidframework/datastore-definitions";
|
|
9
11
|
import { IIdCompressor } from "@fluidframework/id-compressor";
|
|
10
12
|
import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
11
13
|
import { IGarbageCollectionData, IInboundSignalMessage, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
12
14
|
import { IFluidDataStoreChannel, IFluidDataStoreContext, VisibilityState } from "@fluidframework/runtime-definitions/internal";
|
|
13
|
-
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
15
|
+
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils/internal";
|
|
14
16
|
/**
|
|
15
17
|
* @alpha
|
|
16
18
|
*/
|
|
@@ -34,7 +36,7 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
34
36
|
/**
|
|
35
37
|
* {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.entryPoint}
|
|
36
38
|
*/
|
|
37
|
-
readonly entryPoint:
|
|
39
|
+
readonly entryPoint: IFluidHandleInternal<FluidObject>;
|
|
38
40
|
get connected(): boolean;
|
|
39
41
|
get clientId(): string | undefined;
|
|
40
42
|
get clientDetails(): IClientDetails;
|
|
@@ -59,7 +61,7 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
59
61
|
private readonly pendingHandlesToMakeVisible;
|
|
60
62
|
readonly id: string;
|
|
61
63
|
readonly options: Record<string | number, any>;
|
|
62
|
-
readonly
|
|
64
|
+
readonly deltaManagerInternal: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
63
65
|
private readonly quorum;
|
|
64
66
|
private readonly audience;
|
|
65
67
|
private readonly mc;
|
|
@@ -70,15 +72,6 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
70
72
|
* controlled via feature flags.
|
|
71
73
|
*/
|
|
72
74
|
private localChangesTelemetryCount;
|
|
73
|
-
/**
|
|
74
|
-
* Invokes the given callback and expects that no ops are submitted
|
|
75
|
-
* until execution finishes. If an op is submitted, an error will be raised.
|
|
76
|
-
*
|
|
77
|
-
* Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
|
|
78
|
-
*
|
|
79
|
-
* @param callback - the callback to be invoked
|
|
80
|
-
*/
|
|
81
|
-
ensureNoDataModelChanges<T>(callback: () => T): T;
|
|
82
75
|
/**
|
|
83
76
|
* Create an instance of a DataStore runtime.
|
|
84
77
|
*
|
|
@@ -91,6 +84,7 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
91
84
|
* and the primary way of interacting with some Fluid objects, and should be used if possible.
|
|
92
85
|
*/
|
|
93
86
|
constructor(dataStoreContext: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean, provideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>);
|
|
87
|
+
get deltaManager(): IDeltaManagerErased;
|
|
94
88
|
dispose(): void;
|
|
95
89
|
resolveHandle(request: IRequest): Promise<IResponse>;
|
|
96
90
|
request(request: IRequest): Promise<IResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;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AE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAoBtE,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAuC3D,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,eAAe;IAMvB;;;;OAIG;IACH,OAAO,CAAC,+BAA+B;IAyBhC,cAAc,CAAC,WAAW,EAAE,WAAW,CAAC,SAAS,GAAG,WAAW,CAAC,QAAQ,GAAG,IAAI;CA4CtF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,6BACL,QAAQ,WAAW,qBAAqB,KAAK,QAAQ,SAAS,CAAC,SACnF,4BAA4B,iCAUD,CAAC;AAEnC;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,sBAErB,qBAAqB,KAC1B,QAAQ;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,SACvD,4BAA4B,iCAyCD,CAAC"}
|
package/dist/dataStoreRuntime.js
CHANGED
|
@@ -75,20 +75,6 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
75
75
|
get logger() {
|
|
76
76
|
return this.mc.logger;
|
|
77
77
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Invokes the given callback and expects that no ops are submitted
|
|
80
|
-
* until execution finishes. If an op is submitted, an error will be raised.
|
|
81
|
-
*
|
|
82
|
-
* Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
|
|
83
|
-
*
|
|
84
|
-
* @param callback - the callback to be invoked
|
|
85
|
-
*/
|
|
86
|
-
ensureNoDataModelChanges(callback) {
|
|
87
|
-
// back-compat ADO:2309
|
|
88
|
-
return this.dataStoreContext.ensureNoDataModelChanges === undefined
|
|
89
|
-
? callback()
|
|
90
|
-
: this.dataStoreContext.ensureNoDataModelChanges(callback);
|
|
91
|
-
}
|
|
92
78
|
/**
|
|
93
79
|
* Create an instance of a DataStore runtime.
|
|
94
80
|
*
|
|
@@ -123,7 +109,7 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
123
109
|
});
|
|
124
110
|
this.id = dataStoreContext.id;
|
|
125
111
|
this.options = dataStoreContext.options;
|
|
126
|
-
this.
|
|
112
|
+
this.deltaManagerInternal = dataStoreContext.deltaManager;
|
|
127
113
|
this.quorum = dataStoreContext.getQuorum();
|
|
128
114
|
this.audience = dataStoreContext.getAudience();
|
|
129
115
|
const tree = dataStoreContext.baseSnapshot;
|
|
@@ -189,6 +175,9 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
189
175
|
this.localChangesTelemetryCount =
|
|
190
176
|
this.mc.config.getNumber("Fluid.Telemetry.LocalChangesTelemetryCount") ?? 10;
|
|
191
177
|
}
|
|
178
|
+
get deltaManager() {
|
|
179
|
+
return (0, internal_4.toDeltaManagerErased)(this.deltaManagerInternal);
|
|
180
|
+
}
|
|
192
181
|
dispose() {
|
|
193
182
|
if (this._disposed) {
|
|
194
183
|
return;
|
|
@@ -332,7 +321,7 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
332
321
|
* If this channel is already waiting to be made visible, do nothing. This can happen during attachGraph() when
|
|
333
322
|
* a channel's graph is attached. It calls bindToContext on the shared object which will end up back here.
|
|
334
323
|
*/
|
|
335
|
-
if (this.pendingHandlesToMakeVisible.has(channel.handle)) {
|
|
324
|
+
if (this.pendingHandlesToMakeVisible.has((0, internal_4.toFluidHandleInternal)(channel.handle))) {
|
|
336
325
|
return;
|
|
337
326
|
}
|
|
338
327
|
this.bind(channel.handle);
|
|
@@ -372,10 +361,10 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
372
361
|
bind(handle) {
|
|
373
362
|
// If visible, attach the incoming handle's graph. Else, this will be done when we become visible.
|
|
374
363
|
if (this.visibilityState !== internal_3.VisibilityState.NotVisible) {
|
|
375
|
-
handle.attachGraph();
|
|
364
|
+
(0, internal_4.toFluidHandleInternal)(handle).attachGraph();
|
|
376
365
|
return;
|
|
377
366
|
}
|
|
378
|
-
this.pendingHandlesToMakeVisible.add(handle);
|
|
367
|
+
this.pendingHandlesToMakeVisible.add((0, internal_4.toFluidHandleInternal)(handle));
|
|
379
368
|
}
|
|
380
369
|
setConnectionState(connected, clientId) {
|
|
381
370
|
this.verifyNotClosed();
|
|
@@ -542,7 +531,7 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
542
531
|
// ContainerRuntime is newer, it will actually be a no-op since then the ContainerRuntime
|
|
543
532
|
// will be the one to call addedGCOutboundReference directly.
|
|
544
533
|
// But on the flip side, if the ContainerRuntime is older, then it's important we still call this.
|
|
545
|
-
this.dataStoreContext.addedGCOutboundReference?.(srcHandle, outboundHandle);
|
|
534
|
+
this.dataStoreContext.addedGCOutboundReference?.((0, internal_4.toFluidHandleInternal)(srcHandle), (0, internal_4.toFluidHandleInternal)(outboundHandle));
|
|
546
535
|
}
|
|
547
536
|
/**
|
|
548
537
|
* Returns a summary at the current sequence number.
|
|
@@ -664,7 +653,7 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
664
653
|
if (channel.handle.isAttached) {
|
|
665
654
|
return;
|
|
666
655
|
}
|
|
667
|
-
channel.handle.attachGraph();
|
|
656
|
+
(0, internal_4.toFluidHandleInternal)(channel.handle).attachGraph();
|
|
668
657
|
(0, internal_1.assert)(this.isAttached, 0x182 /* "Data store should be attached to attach the channel." */);
|
|
669
658
|
(0, internal_1.assert)(this.visibilityState === internal_3.VisibilityState.GloballyVisible, 0x2d0 /* "Data store should be globally visible to attach channels." */);
|
|
670
659
|
const summarizeResult = (0, channelContext_js_1.summarizeChannel)(channel, true /* fullTree */, false /* trackState */);
|