@fluidframework/datastore 2.0.0-internal.7.3.0 → 2.0.0-internal.8.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 +28 -0
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +9 -1
- package/api-report/datastore.api.md +7 -10
- package/dist/dataStoreRuntime.d.ts +14 -21
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +40 -28
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/datastore-alpha.d.ts +257 -0
- package/dist/datastore-beta.d.ts +87 -0
- package/dist/datastore-public.d.ts +87 -0
- package/dist/datastore-untrimmed.d.ts +324 -0
- package/dist/fluidHandle.d.ts +1 -2
- package/dist/fluidHandle.d.ts.map +1 -1
- package/dist/fluidHandle.js +1 -2
- package/dist/fluidHandle.js.map +1 -1
- package/dist/localChannelContext.d.ts +2 -2
- package/dist/localChannelContext.d.ts.map +1 -1
- package/dist/localChannelContext.js +13 -17
- package/dist/localChannelContext.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts +14 -21
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +40 -28
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/datastore-alpha.d.ts +257 -0
- package/lib/datastore-beta.d.ts +87 -0
- package/lib/datastore-public.d.ts +87 -0
- package/lib/datastore-untrimmed.d.ts +324 -0
- package/lib/fluidHandle.d.ts +1 -2
- package/lib/fluidHandle.d.ts.map +1 -1
- package/lib/fluidHandle.js +1 -2
- package/lib/fluidHandle.js.map +1 -1
- package/lib/localChannelContext.d.ts +2 -2
- package/lib/localChannelContext.d.ts.map +1 -1
- package/lib/localChannelContext.js +13 -17
- package/lib/localChannelContext.js.map +1 -1
- package/package.json +43 -19
- package/src/dataStoreRuntime.ts +53 -48
- package/src/fluidHandle.ts +1 -2
- package/src/localChannelContext.ts +14 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @fluidframework/datastore
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.8.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- datastore: Removed `FluidDataStoreRuntime.load(...)` [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
|
|
8
|
+
|
|
9
|
+
The static method `FluidDataStoreRuntime.load(...)` has been removed. Please migrate all usage of this method to
|
|
10
|
+
`FluidDataStoreRuntime` constructor.
|
|
11
|
+
|
|
12
|
+
- container-definitions: Fix ISnapshotTreeWithBlobContents and mark internal [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
|
|
13
|
+
|
|
14
|
+
`ISnapshotTreeWithBlobContents` is an internal type that should not be used externally. Additionally, the type didn't
|
|
15
|
+
match the usage, specifically in runtime-utils where an `any` cast was used to work around undefined blobContents. The
|
|
16
|
+
type has been updated to reflect that blobContents can be undefined.
|
|
17
|
+
|
|
18
|
+
- runtime-definitions: Removed IFluidRouter from IFluidDataStoreChannel and FluidDataStoreRuntime [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
|
|
19
|
+
|
|
20
|
+
The `IFluidRouter` property has been removed from `IFluidDataStoreChannel` and `FluidDataStoreRuntime`. Please migrate
|
|
21
|
+
all usage to the `IFluidDataStoreChannel.entryPoint` API.
|
|
22
|
+
|
|
23
|
+
See
|
|
24
|
+
[Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md)
|
|
25
|
+
for more details.
|
|
26
|
+
|
|
27
|
+
## 2.0.0-internal.7.4.0
|
|
28
|
+
|
|
29
|
+
Dependency updates only.
|
|
30
|
+
|
|
3
31
|
## 2.0.0-internal.7.3.0
|
|
4
32
|
|
|
5
33
|
Dependency updates only.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-lint.json",
|
|
4
|
+
"messages": {
|
|
5
|
+
"extractorMessageReporting": {
|
|
6
|
+
// TODO: remove once base config has this enabled as an error
|
|
7
|
+
"ae-incompatible-release-tags": {
|
|
8
|
+
"logLevel": "error",
|
|
9
|
+
"addToApiReportFile": false
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
-
"extends": "
|
|
3
|
+
"extends": "../../../common/build/build-common/api-extractor-base.json",
|
|
4
|
+
"messages": {
|
|
5
|
+
"extractorMessageReporting": {
|
|
6
|
+
// TODO: Add missing documentation and remove this rule override
|
|
7
|
+
"ae-undocumented": {
|
|
8
|
+
"logLevel": "none"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
4
12
|
}
|
|
@@ -32,7 +32,7 @@ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
|
|
|
32
32
|
import { TypedEventEmitter } from '@fluid-internal/client-utils';
|
|
33
33
|
import { VisibilityState } from '@fluidframework/runtime-definitions';
|
|
34
34
|
|
|
35
|
-
// @
|
|
35
|
+
// @alpha (undocumented)
|
|
36
36
|
export enum DataStoreMessageType {
|
|
37
37
|
// (undocumented)
|
|
38
38
|
Attach = "attach",
|
|
@@ -40,11 +40,12 @@ export enum DataStoreMessageType {
|
|
|
40
40
|
ChannelOp = "op"
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
// @
|
|
43
|
+
// @alpha
|
|
44
44
|
export class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRuntimeEvents> implements IFluidDataStoreChannel, IFluidDataStoreRuntime, IFluidHandleContext {
|
|
45
45
|
constructor(dataStoreContext: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean, provideEntryPoint: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>);
|
|
46
46
|
// (undocumented)
|
|
47
47
|
get absolutePath(): string;
|
|
48
|
+
addChannel(channel: IChannel): void;
|
|
48
49
|
// (undocumented)
|
|
49
50
|
applyStashedOp(content: any): Promise<unknown>;
|
|
50
51
|
attachGraph(): void;
|
|
@@ -87,12 +88,8 @@ export class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRunt
|
|
|
87
88
|
get idCompressor(): IIdCompressor | undefined;
|
|
88
89
|
// (undocumented)
|
|
89
90
|
get IFluidHandleContext(): this;
|
|
90
|
-
// @deprecated (undocumented)
|
|
91
|
-
get IFluidRouter(): this;
|
|
92
91
|
// (undocumented)
|
|
93
92
|
get isAttached(): boolean;
|
|
94
|
-
// @deprecated (undocumented)
|
|
95
|
-
static load(context: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean): FluidDataStoreRuntime;
|
|
96
93
|
// (undocumented)
|
|
97
94
|
get logger(): ITelemetryLoggerExt;
|
|
98
95
|
makeVisibleAndAttachGraph(): void;
|
|
@@ -128,7 +125,7 @@ export class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRunt
|
|
|
128
125
|
waitAttached(): Promise<void>;
|
|
129
126
|
}
|
|
130
127
|
|
|
131
|
-
// @
|
|
128
|
+
// @internal
|
|
132
129
|
export class FluidObjectHandle<T extends FluidObject = FluidObject> implements IFluidHandle {
|
|
133
130
|
constructor(value: T | Promise<T>, path: string, routeContext: IFluidHandleContext);
|
|
134
131
|
// (undocumented)
|
|
@@ -151,16 +148,16 @@ export class FluidObjectHandle<T extends FluidObject = FluidObject> implements I
|
|
|
151
148
|
protected readonly value: T | Promise<T>;
|
|
152
149
|
}
|
|
153
150
|
|
|
154
|
-
// @
|
|
151
|
+
// @alpha (undocumented)
|
|
155
152
|
export interface ISharedObjectRegistry {
|
|
156
153
|
// (undocumented)
|
|
157
154
|
get(name: string): IChannelFactory | undefined;
|
|
158
155
|
}
|
|
159
156
|
|
|
160
|
-
// @
|
|
157
|
+
// @internal
|
|
161
158
|
export const mixinRequestHandler: (requestHandler: (request: IRequest, runtime: FluidDataStoreRuntime) => Promise<IResponse>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime;
|
|
162
159
|
|
|
163
|
-
// @
|
|
160
|
+
// @internal
|
|
164
161
|
export const mixinSummaryHandler: (handler: (runtime: FluidDataStoreRuntime) => Promise<{
|
|
165
162
|
path: string[];
|
|
166
163
|
content: string;
|
|
@@ -10,43 +10,29 @@ import { IClientDetails, IDocumentMessage, ISequencedDocumentMessage, IQuorumCli
|
|
|
10
10
|
import { IFluidDataStoreContext, IFluidDataStoreChannel, IGarbageCollectionData, IInboundSignalMessage, ISummaryTreeWithStats, VisibilityState, ITelemetryContext, IIdCompressor } from "@fluidframework/runtime-definitions";
|
|
11
11
|
import { IChannel, IFluidDataStoreRuntime, IFluidDataStoreRuntimeEvents, IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
12
12
|
/**
|
|
13
|
-
* @
|
|
13
|
+
* @alpha
|
|
14
14
|
*/
|
|
15
15
|
export declare enum DataStoreMessageType {
|
|
16
16
|
Attach = "attach",
|
|
17
17
|
ChannelOp = "op"
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* @
|
|
20
|
+
* @alpha
|
|
21
21
|
*/
|
|
22
22
|
export interface ISharedObjectRegistry {
|
|
23
23
|
get(name: string): IChannelFactory | undefined;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Base data store class
|
|
27
|
-
*
|
|
28
|
-
* @public
|
|
27
|
+
* @alpha
|
|
29
28
|
*/
|
|
30
29
|
export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataStoreRuntimeEvents> implements IFluidDataStoreChannel, IFluidDataStoreRuntime, IFluidHandleContext {
|
|
31
30
|
private readonly dataStoreContext;
|
|
32
31
|
private readonly sharedObjectRegistry;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated Instantiate the class using its constructor instead.
|
|
35
|
-
*
|
|
36
|
-
* Loads the data store runtime
|
|
37
|
-
* @param context - The data store context
|
|
38
|
-
* @param sharedObjectRegistry - The registry of shared objects used by this data store
|
|
39
|
-
* @param existing - If loading from an existing file.
|
|
40
|
-
*/
|
|
41
|
-
static load(context: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean): FluidDataStoreRuntime;
|
|
42
32
|
/**
|
|
43
33
|
* {@inheritDoc @fluidframework/datastore-definitions#IFluidDataStoreRuntime.entryPoint}
|
|
44
34
|
*/
|
|
45
35
|
readonly entryPoint: IFluidHandle<FluidObject>;
|
|
46
|
-
/**
|
|
47
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
48
|
-
*/
|
|
49
|
-
get IFluidRouter(): this;
|
|
50
36
|
get connected(): boolean;
|
|
51
37
|
get clientId(): string | undefined;
|
|
52
38
|
get clientDetails(): IClientDetails;
|
|
@@ -107,7 +93,16 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
107
93
|
resolveHandle(request: IRequest): Promise<IResponse>;
|
|
108
94
|
request(request: IRequest): Promise<IResponse>;
|
|
109
95
|
getChannel(id: string): Promise<IChannel>;
|
|
96
|
+
/**
|
|
97
|
+
* Api which allows caller to create the channel first and then add it to the runtime.
|
|
98
|
+
* The channel type should be present in the registry, otherwise the runtime would reject
|
|
99
|
+
* the channel. Also the runtime used to create the channel object should be same to which
|
|
100
|
+
* it is added.
|
|
101
|
+
* @param channel - channel which needs to be added to the runtime.
|
|
102
|
+
*/
|
|
103
|
+
addChannel(channel: IChannel): void;
|
|
110
104
|
createChannel(id: string | undefined, type: string): IChannel;
|
|
105
|
+
private createChannelContext;
|
|
111
106
|
/**
|
|
112
107
|
* Binds a channel with the runtime. If the runtime is attached we will attach the channel right away.
|
|
113
108
|
* If the runtime is not attached we will defer the attach until the runtime attaches.
|
|
@@ -238,8 +233,7 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
238
233
|
* Request handler is only called when data store can't resolve request, i.e. for custom requests.
|
|
239
234
|
* @param Base - base class, inherits from FluidDataStoreRuntime
|
|
240
235
|
* @param requestHandler - request handler to mix in
|
|
241
|
-
*
|
|
242
|
-
* @public
|
|
236
|
+
* @internal
|
|
243
237
|
*/
|
|
244
238
|
export declare const mixinRequestHandler: (requestHandler: (request: IRequest, runtime: FluidDataStoreRuntime) => Promise<IResponse>, Base?: typeof FluidDataStoreRuntime) => typeof FluidDataStoreRuntime;
|
|
245
239
|
/**
|
|
@@ -247,8 +241,7 @@ export declare const mixinRequestHandler: (requestHandler: (request: IRequest, r
|
|
|
247
241
|
* @param handler - handler that returns info about blob to be added to summary.
|
|
248
242
|
* Or undefined not to add anything to summary.
|
|
249
243
|
* @param Base - base class, inherits from FluidDataStoreRuntime
|
|
250
|
-
*
|
|
251
|
-
* @public
|
|
244
|
+
* @internal
|
|
252
245
|
*/
|
|
253
246
|
export declare const mixinSummaryHandler: (handler: (runtime: FluidDataStoreRuntime) => Promise<{
|
|
254
247
|
path: string[];
|
|
@@ -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,EAEN,mBAAmB,EAQnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EAIzB,cAAc,EACd,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAKN,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,MAAM,qCAAqC,CAAC;AAa7C,OAAO,EACN,QAAQ,EACR,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EACf,MAAM,uCAAuC,CAAC;AAW/C;;GAEG;AACH,oBAAY,oBAAoB;IAE/B,MAAM,WAAW;IACjB,SAAS,OAAO;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAGrC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAAC;CAC/C;AAED
|
|
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,EAEN,mBAAmB,EAQnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EAIzB,cAAc,EACd,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAKN,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,MAAM,qCAAqC,CAAC;AAa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AAc,CAAC,EAAE,MAAM;IAKvE;;OAEG;IACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C;;OAEG;IACH,OAAO,CAAC,aAAa;IAmCrB,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,MAAM;IASd;;;;;;OAMG;IACI,QAAQ,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAwBlF;;;;OAIG;IACI,QAAQ,CAAC,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAoBtE,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAgC3D,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,cAAc;IA0CtB,OAAO,CAAC,eAAe;IAMvB;;;;OAIG;IACH,OAAO,CAAC,+BAA+B;CAwBvC;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
|
@@ -19,7 +19,7 @@ const localChannelContext_1 = require("./localChannelContext");
|
|
|
19
19
|
const remoteChannelContext_1 = require("./remoteChannelContext");
|
|
20
20
|
const fluidHandle_1 = require("./fluidHandle");
|
|
21
21
|
/**
|
|
22
|
-
* @
|
|
22
|
+
* @alpha
|
|
23
23
|
*/
|
|
24
24
|
var DataStoreMessageType;
|
|
25
25
|
(function (DataStoreMessageType) {
|
|
@@ -29,27 +29,9 @@ var DataStoreMessageType;
|
|
|
29
29
|
})(DataStoreMessageType || (exports.DataStoreMessageType = DataStoreMessageType = {}));
|
|
30
30
|
/**
|
|
31
31
|
* Base data store class
|
|
32
|
-
*
|
|
33
|
-
* @public
|
|
32
|
+
* @alpha
|
|
34
33
|
*/
|
|
35
34
|
class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated Instantiate the class using its constructor instead.
|
|
38
|
-
*
|
|
39
|
-
* Loads the data store runtime
|
|
40
|
-
* @param context - The data store context
|
|
41
|
-
* @param sharedObjectRegistry - The registry of shared objects used by this data store
|
|
42
|
-
* @param existing - If loading from an existing file.
|
|
43
|
-
*/
|
|
44
|
-
static load(context, sharedObjectRegistry, existing) {
|
|
45
|
-
return new FluidDataStoreRuntime(context, sharedObjectRegistry, existing, async (dataStoreRuntime) => dataStoreRuntime.entryPoint);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
49
|
-
*/
|
|
50
|
-
get IFluidRouter() {
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
35
|
get connected() {
|
|
54
36
|
return this.dataStoreContext.connected;
|
|
55
37
|
}
|
|
@@ -251,18 +233,50 @@ class FluidDataStoreRuntime extends client_utils_1.TypedEventEmitter {
|
|
|
251
233
|
}
|
|
252
234
|
return context.getChannel();
|
|
253
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Api which allows caller to create the channel first and then add it to the runtime.
|
|
238
|
+
* The channel type should be present in the registry, otherwise the runtime would reject
|
|
239
|
+
* the channel. Also the runtime used to create the channel object should be same to which
|
|
240
|
+
* it is added.
|
|
241
|
+
* @param channel - channel which needs to be added to the runtime.
|
|
242
|
+
*/
|
|
243
|
+
addChannel(channel) {
|
|
244
|
+
const id = channel.id;
|
|
245
|
+
if (id.includes("/")) {
|
|
246
|
+
throw new telemetry_utils_1.UsageError(`Id cannot contain slashes: ${id}`);
|
|
247
|
+
}
|
|
248
|
+
this.verifyNotClosed();
|
|
249
|
+
(0, core_utils_1.assert)(!this.contexts.has(id), 0x865 /* addChannel() with existing ID */);
|
|
250
|
+
const type = channel.attributes.type;
|
|
251
|
+
const factory = this.sharedObjectRegistry.get(channel.attributes.type);
|
|
252
|
+
if (factory === undefined) {
|
|
253
|
+
throw new Error(`Channel Factory ${type} not registered`);
|
|
254
|
+
}
|
|
255
|
+
this.createChannelContext(channel);
|
|
256
|
+
// Channels (DDS) should not be created in summarizer client.
|
|
257
|
+
this.identifyLocalChangeInSummarizer("DDSCreatedInSummarizer", id, type);
|
|
258
|
+
}
|
|
254
259
|
createChannel(id = (0, uuid_1.v4)(), type) {
|
|
255
260
|
if (id.includes("/")) {
|
|
256
261
|
throw new telemetry_utils_1.UsageError(`Id cannot contain slashes: ${id}`);
|
|
257
262
|
}
|
|
258
263
|
this.verifyNotClosed();
|
|
259
264
|
(0, core_utils_1.assert)(!this.contexts.has(id), 0x179 /* "createChannel() with existing ID" */);
|
|
260
|
-
|
|
261
|
-
const
|
|
262
|
-
|
|
265
|
+
(0, core_utils_1.assert)(type !== undefined, 0x209 /* "Factory Type should be defined" */);
|
|
266
|
+
const factory = this.sharedObjectRegistry.get(type);
|
|
267
|
+
if (factory === undefined) {
|
|
268
|
+
throw new Error(`Channel Factory ${type} not registered`);
|
|
269
|
+
}
|
|
270
|
+
const channel = factory.create(this, id);
|
|
271
|
+
this.createChannelContext(channel);
|
|
263
272
|
// Channels (DDS) should not be created in summarizer client.
|
|
264
273
|
this.identifyLocalChangeInSummarizer("DDSCreatedInSummarizer", id, type);
|
|
265
|
-
return
|
|
274
|
+
return channel;
|
|
275
|
+
}
|
|
276
|
+
createChannelContext(channel) {
|
|
277
|
+
this.notBoundedChannelContextSet.add(channel.id);
|
|
278
|
+
const context = new localChannelContext_1.LocalChannelContext(channel, this, this.dataStoreContext, this.dataStoreContext.storage, this.logger, (content, localOpMetadata) => this.submitChannelOp(channel.id, content, localOpMetadata), (address) => this.setChannelDirty(address), (srcHandle, outboundHandle) => this.addedGCOutboundReference(srcHandle, outboundHandle));
|
|
279
|
+
this.contexts.set(channel.id, context);
|
|
266
280
|
}
|
|
267
281
|
/**
|
|
268
282
|
* Binds a channel with the runtime. If the runtime is attached we will attach the channel right away.
|
|
@@ -756,8 +770,7 @@ exports.FluidDataStoreRuntime = FluidDataStoreRuntime;
|
|
|
756
770
|
* Request handler is only called when data store can't resolve request, i.e. for custom requests.
|
|
757
771
|
* @param Base - base class, inherits from FluidDataStoreRuntime
|
|
758
772
|
* @param requestHandler - request handler to mix in
|
|
759
|
-
*
|
|
760
|
-
* @public
|
|
773
|
+
* @internal
|
|
761
774
|
*/
|
|
762
775
|
const mixinRequestHandler = (requestHandler, Base = FluidDataStoreRuntime) => class RuntimeWithRequestHandler extends Base {
|
|
763
776
|
async request(request) {
|
|
@@ -774,8 +787,7 @@ exports.mixinRequestHandler = mixinRequestHandler;
|
|
|
774
787
|
* @param handler - handler that returns info about blob to be added to summary.
|
|
775
788
|
* Or undefined not to add anything to summary.
|
|
776
789
|
* @param Base - base class, inherits from FluidDataStoreRuntime
|
|
777
|
-
*
|
|
778
|
-
* @public
|
|
790
|
+
* @internal
|
|
779
791
|
*/
|
|
780
792
|
const mixinSummaryHandler = (handler, Base = FluidDataStoreRuntime) => class RuntimeWithSummarizerHandler extends Base {
|
|
781
793
|
addBlob(summary, path, content) {
|