@fluidframework/aqueduct 2.117.0 → 3.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 +75 -2
- package/README.md +53 -50
- package/{api-extractor.json → api-extractor/api-extractor-model.json} +1 -1
- package/api-report/aqueduct.legacy.beta.api.md +1 -7
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.js +8 -0
- package/dist/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +3 -23
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +2 -1
- package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
- package/dist/data-object-factories/pureDataObjectFactory.js +6 -0
- package/dist/data-object-factories/pureDataObjectFactory.js.map +1 -1
- package/dist/data-objects/createDataObjectKind.js +1 -2
- package/dist/data-objects/createDataObjectKind.js.map +1 -1
- package/dist/data-objects/dataObject.d.ts.map +1 -1
- package/dist/data-objects/dataObject.js +4 -5
- package/dist/data-objects/dataObject.js.map +1 -1
- package/dist/data-objects/pureDataObject.js +25 -0
- package/dist/data-objects/pureDataObject.js.map +1 -1
- package/dist/data-objects/treeDataObject.js +9 -25
- package/dist/data-objects/treeDataObject.js.map +1 -1
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.js +8 -0
- package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +3 -23
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +3 -2
- package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
- package/lib/data-object-factories/pureDataObjectFactory.js +6 -0
- package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -1
- package/lib/data-objects/dataObject.d.ts.map +1 -1
- package/lib/data-objects/dataObject.js +4 -5
- package/lib/data-objects/dataObject.js.map +1 -1
- package/lib/data-objects/pureDataObject.js +25 -0
- package/lib/data-objects/pureDataObject.js.map +1 -1
- package/lib/data-objects/treeDataObject.js +9 -25
- package/lib/data-objects/treeDataObject.js.map +1 -1
- package/lib/legacy.d.ts +1 -1
- package/lib/public.d.ts +1 -1
- package/package.json +52 -54
- package/src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts +7 -28
- package/src/data-objects/dataObject.ts +10 -6
- package/tsconfig.json +1 -1
- package/internal.d.ts +0 -11
- package/legacy.d.ts +0 -11
- /package/api-extractor/{api-extractor.current.json → api-extractor-report.current.json} +0 -0
- /package/api-extractor/{api-extractor.legacy.json → api-extractor-report.legacy.json} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataObject.js","sourceRoot":"","sources":["../../src/data-objects/dataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,UAAU,EACV,eAAe,GACf,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"dataObject.js","sourceRoot":"","sources":["../../src/data-objects/dataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEN,UAAU,EACV,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;;;;;;;;;;;GAWG;AACH,MAAM,OAAgB,UAEpB,SAAQ,cAAiB;IAClB,YAAY,CAA+B;IAClC,eAAe,GAAG,MAAM,CAAC;IAE1C;;;OAGG;IACH,IAAc,IAAI;QACjB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,CAAC;QAC3D,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACa,KAAK,CAAC,kBAAkB,CAAC,QAAiB;QACzD,IAAI,QAAQ,EAAE,CAAC;YACd,oGAAoG;YACpG,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CACjD,IAAI,CAAC,eAAe,CACpB,CAAqB,CAAC;YAEvB,oGAAoG;YACpG,gGAAgG;YAChG,qGAAqG;YACrG,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,EAAE,CAAC;gBAC3D,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CACvB;oBACC,QAAQ,EAAE,SAAS;oBACnB,SAAS,EAAE,eAAe;oBAC1B,OAAO,EACN,6EAA6E;iBAC9E,EACD,QAAQ,CAAC,SAAS,CAClB,CAAC;YACH,CAAC;QACF,CAAC;aAAM,CAAC;YACP,+EAA+E;YAC/E,IAAI,CAAC,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;YAC/E,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC;QACnC,CAAC;QAED,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACO,2BAA2B,CAAC,IAAY;QACjD,OAAO,GAAG,IAAI,6CAA6C,CAAC;IAC7D,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype ISharedDirectory,\n\tMapFactory,\n\tSharedDirectory,\n} from \"@fluidframework/map/internal\";\nimport { LogLevel } from \"@fluidframework/core-interfaces\";\n\nimport { PureDataObject } from \"./pureDataObject.js\";\nimport type { DataObjectTypes } from \"./types.js\";\n\n/**\n * DataObject is a base data store that is primed with a root directory. It\n * ensures that it is created and ready before you can access it.\n *\n * Having a single root directory allows for easier development. Instead of creating\n * and registering channels with the runtime any new DDS that is set on the root\n * will automatically be registered.\n *\n * @typeParam I - The optional input types used to strongly type the data object\n * @legacy\n * @beta\n */\nexport abstract class DataObject<\n\tI extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObject<I> {\n\tprivate internalRoot: ISharedDirectory | undefined;\n\tprivate readonly rootDirectoryId = \"root\";\n\n\t/**\n\t * The root directory will either be ready or will return an error. If an error is thrown\n\t * the root has not been correctly created/set.\n\t */\n\tprotected get root(): ISharedDirectory {\n\t\tif (!this.internalRoot) {\n\t\t\tthrow new Error(this.getUninitializedErrorString(`root`));\n\t\t}\n\n\t\treturn this.internalRoot;\n\t}\n\n\t/**\n\t * Initializes internal objects and calls initialization overrides.\n\t * Caller is responsible for ensuring this is only invoked once.\n\t */\n\tpublic override async initializeInternal(existing: boolean): Promise<void> {\n\t\tif (existing) {\n\t\t\t// data store has a root directory so we just need to set it before calling initializingFromExisting\n\t\t\tthis.internalRoot = (await this.runtime.getChannel(\n\t\t\t\tthis.rootDirectoryId,\n\t\t\t)) as ISharedDirectory;\n\n\t\t\t// This will actually be an ISharedMap if the channel was previously created by the older version of\n\t\t\t// DataObject which used a SharedMap. Since SharedMap and SharedDirectory are compatible unless\n\t\t\t// SharedDirectory-only commands are used on SharedMap, this will mostly just work for compatibility.\n\t\t\tif (this.internalRoot.attributes.type === MapFactory.Type) {\n\t\t\t\tthis.runtime.logger.send(\n\t\t\t\t\t{\n\t\t\t\t\t\tcategory: \"generic\",\n\t\t\t\t\t\teventName: \"MapDataObject\",\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"Legacy document, SharedMap is masquerading as SharedDirectory in DataObject\",\n\t\t\t\t\t},\n\t\t\t\t\tLogLevel.essential,\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\t// Create a root directory and register it before calling initializingFirstTime\n\t\t\tthis.internalRoot = SharedDirectory.create(this.runtime, this.rootDirectoryId);\n\t\t\tthis.internalRoot.bindToContext();\n\t\t}\n\n\t\tawait super.initializeInternal(existing);\n\t}\n\n\t/**\n\t * Generates an error string indicating an item is uninitialized.\n\t * @param item - The name of the item that was uninitialized.\n\t */\n\tprotected getUninitializedErrorString(item: string): string {\n\t\treturn `${item} must be initialized before being accessed.`;\n\t}\n}\n"]}
|
|
@@ -16,6 +16,31 @@ import { create404Response } from "@fluidframework/runtime-utils/internal";
|
|
|
16
16
|
* @legacy @beta
|
|
17
17
|
*/
|
|
18
18
|
export class PureDataObject extends TypedEventEmitter {
|
|
19
|
+
/**
|
|
20
|
+
* This is your FluidDataStoreRuntime object
|
|
21
|
+
*/
|
|
22
|
+
runtime;
|
|
23
|
+
/**
|
|
24
|
+
* This context is used to talk up to the IContainerRuntime
|
|
25
|
+
*/
|
|
26
|
+
context;
|
|
27
|
+
/**
|
|
28
|
+
* Providers are FluidObject keyed objects that provide back
|
|
29
|
+
* a promise to the corresponding FluidObject or undefined.
|
|
30
|
+
* Providers injected/provided by the Container and/or HostingApplication
|
|
31
|
+
*
|
|
32
|
+
* To define providers set FluidObject interfaces in the OptionalProviders generic type for your data store
|
|
33
|
+
*/
|
|
34
|
+
providers;
|
|
35
|
+
initProps;
|
|
36
|
+
/**
|
|
37
|
+
* Internal implementation detail.
|
|
38
|
+
* Subclasses should not use this.
|
|
39
|
+
* @privateRemarks
|
|
40
|
+
* For unknown reasons this API was exposed as a protected member with no documented behavior nor any external usage or clear use-case.
|
|
41
|
+
* Ideally a breaking change would be made to replace this with a better named private property like `#initializationPromise` when permitted.
|
|
42
|
+
*/
|
|
43
|
+
initializeP;
|
|
19
44
|
get id() {
|
|
20
45
|
return this.runtime.id;
|
|
21
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAYjE,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAG7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAK3E;;;;;;;;;GASG;AACH,MAAM,OAAgB,cACrB,SAAQ,iBAAuC;
|
|
1
|
+
{"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tIEvent,\n\tIFluidLoadable,\n\tIRequest,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\t// eslint-disable-next-line import-x/no-deprecated\n\tIProvideFluidHandle,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions/internal\";\nimport type { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions/internal\";\nimport { create404Response } from \"@fluidframework/runtime-utils/internal\";\nimport type { AsyncFluidObjectProvider } from \"@fluidframework/synthesize/internal\";\n\nimport type { DataObjectTypes, IDataObjectProps } from \"./types.js\";\n\n/**\n * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.\n *\n * @remarks\n * You probably don't want to inherit from this data store directly unless\n * you are creating another base data store class.\n *\n * @typeParam I - The optional input types used to strongly type the data object\n * @legacy @beta\n */\nexport abstract class PureDataObject<I extends DataObjectTypes = DataObjectTypes>\n\textends TypedEventEmitter<I[\"Events\"] & IEvent>\n\t// eslint-disable-next-line import-x/no-deprecated\n\timplements IFluidLoadable, IProvideFluidHandle\n{\n\t/**\n\t * This is your FluidDataStoreRuntime object\n\t */\n\tprotected readonly runtime: IFluidDataStoreRuntime;\n\n\t/**\n\t * This context is used to talk up to the IContainerRuntime\n\t */\n\tprotected readonly context: IFluidDataStoreContext;\n\n\t/**\n\t * Providers are FluidObject keyed objects that provide back\n\t * a promise to the corresponding FluidObject or undefined.\n\t * Providers injected/provided by the Container and/or HostingApplication\n\t *\n\t * To define providers set FluidObject interfaces in the OptionalProviders generic type for your data store\n\t */\n\tprotected readonly providers: AsyncFluidObjectProvider<I[\"OptionalProviders\"]>;\n\n\tprotected initProps?: I[\"InitialState\"];\n\n\t/**\n\t * Internal implementation detail.\n\t * Subclasses should not use this.\n\t * @privateRemarks\n\t * For unknown reasons this API was exposed as a protected member with no documented behavior nor any external usage or clear use-case.\n\t * Ideally a breaking change would be made to replace this with a better named private property like `#initializationPromise` when permitted.\n\t */\n\tprotected initializeP: Promise<void> | undefined;\n\n\tpublic get id(): string {\n\t\treturn this.runtime.id;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidLoadable.IFluidLoadable}\n\t */\n\tpublic get IFluidLoadable(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal<this> {\n\t\treturn this.handle;\n\t}\n\n\t/**\n\t * Handle to a data store\n\t */\n\tpublic get handle(): IFluidHandleInternal<this> {\n\t\t// PureDataObjectFactory already provides an entryPoint initialization function to the data store runtime,\n\t\t// so this object should always have access to a non-null entryPoint. Need to cast because PureDataObject\n\t\t// tried to be too smart with its typing for handles :).\n\t\tassert(this.runtime.entryPoint !== undefined, 0x46b /* EntryPoint was undefined */);\n\t\treturn this.runtime.entryPoint as IFluidHandleInternal<this>;\n\t}\n\n\tpublic static async getDataObject(runtime: IFluidDataStoreRuntime): Promise<PureDataObject> {\n\t\tconst obj = await runtime.entryPoint.get();\n\t\treturn obj as PureDataObject;\n\t}\n\n\tpublic constructor(props: IDataObjectProps<I>) {\n\t\tsuper();\n\t\tthis.runtime = props.runtime;\n\t\tthis.context = props.context;\n\t\tthis.providers = props.providers;\n\t\tthis.initProps = props.initProps;\n\t}\n\n\t/**\n\t * Return this object if someone requests it directly\n\t * We will return this object in two scenarios:\n\t *\n\t * 1. the request url is a \"/\"\n\t *\n\t * 2. the request url is empty\n\t */\n\tpublic async request(req: IRequest): Promise<IResponse> {\n\t\treturn req.url === \"\" || req.url === \"/\" || req.url.startsWith(\"/?\")\n\t\t\t? { mimeType: \"fluid/object\", status: 200, value: this }\n\t\t\t: create404Response(req);\n\t}\n\n\t/**\n\t * Await this API to ensure PureDataObject is fully initialized.\n\t * Initialization happens on demand, only on as-needed bases.\n\t * In most cases you should allow factory/object to decide when to finish initialization.\n\t * But if you are supplying your own implementation of DataStoreRuntime factory and overriding some methods\n\t * and need a fully initialized object, then you can await this API to ensure object is fully initialized.\n\t */\n\tpublic async finishInitialization(existing: boolean): Promise<void> {\n\t\tthis.initializeP ??= this.initializeInternal(existing);\n\t\treturn this.initializeP;\n\t}\n\n\t/**\n\t * Internal initialize implementation. Overwriting this will change the flow of the PureDataObject and should\n\t * generally not be done.\n\t *\n\t * Calls initializingFirstTime, initializingFromExisting, and hasInitialized. Caller is\n\t * responsible for ensuring this is only invoked once.\n\t */\n\tpublic async initializeInternal(existing: boolean): Promise<void> {\n\t\tawait this.preInitialize();\n\t\tif (existing) {\n\t\t\tassert(\n\t\t\t\tthis.initProps === undefined,\n\t\t\t\t0x0be /* \"Trying to initialize from existing while initProps is set!\" */,\n\t\t\t);\n\t\t\tawait this.initializingFromExisting();\n\t\t} else {\n\t\t\tawait this.initializingFirstTime(\n\t\t\t\t(this.context.createProps as I[\"InitialState\"]) ?? this.initProps,\n\t\t\t);\n\t\t}\n\t\tawait this.hasInitialized();\n\t}\n\n\t/**\n\t * Called every time the data store is initialized, before initializingFirstTime or\n\t * initializingFromExisting is called.\n\t */\n\tprotected async preInitialize(): Promise<void> {}\n\n\t/**\n\t * Called the first time the data store is initialized (new creations with a new\n\t * data store runtime)\n\t *\n\t * @param props - Optional props to be passed in on create\n\t */\n\tprotected async initializingFirstTime(props?: I[\"InitialState\"]): Promise<void> {}\n\n\t/**\n\t * Called every time but the first time the data store is initialized (creations\n\t * with an existing data store runtime)\n\t */\n\tprotected async initializingFromExisting(): Promise<void> {}\n\n\t/**\n\t * Called every time the data store is initialized after create or existing.\n\t */\n\tprotected async hasInitialized(): Promise<void> {}\n}\n"]}
|
|
@@ -2,18 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
6
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
8
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
9
|
-
};
|
|
10
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
14
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
15
|
-
};
|
|
16
|
-
var _TreeDataObject_tree;
|
|
17
5
|
import { UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
18
6
|
import { SharedTree } from "@fluidframework/tree/internal";
|
|
19
7
|
import { PureDataObject } from "./pureDataObject.js";
|
|
@@ -64,23 +52,20 @@ const uninitializedErrorString = "The tree has not yet been initialized. The dat
|
|
|
64
52
|
* @legacy @beta
|
|
65
53
|
*/
|
|
66
54
|
export class TreeDataObject extends PureDataObject {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
*/
|
|
73
|
-
_TreeDataObject_tree.set(this, void 0);
|
|
74
|
-
}
|
|
55
|
+
/**
|
|
56
|
+
* The underlying {@link @fluidframework/tree#ITree | tree}.
|
|
57
|
+
* @remarks Created once during initialization.
|
|
58
|
+
*/
|
|
59
|
+
#tree;
|
|
75
60
|
/**
|
|
76
61
|
* The underlying {@link @fluidframework/tree#ITree | tree}.
|
|
77
62
|
* @remarks Created once during initialization.
|
|
78
63
|
*/
|
|
79
64
|
get tree() {
|
|
80
|
-
if (
|
|
65
|
+
if (this.#tree === undefined) {
|
|
81
66
|
throw new UsageError(uninitializedErrorString);
|
|
82
67
|
}
|
|
83
|
-
return
|
|
68
|
+
return this.#tree;
|
|
84
69
|
}
|
|
85
70
|
async initializeInternal(existing) {
|
|
86
71
|
if (existing) {
|
|
@@ -92,17 +77,16 @@ export class TreeDataObject extends PureDataObject {
|
|
|
92
77
|
throw new Error(`Content with id ${channel.id} is not a SharedTree and cannot be loaded with treeDataObject.`);
|
|
93
78
|
}
|
|
94
79
|
const sharedTree = channel;
|
|
95
|
-
|
|
80
|
+
this.#tree = sharedTree;
|
|
96
81
|
}
|
|
97
82
|
else {
|
|
98
83
|
const sharedTree = this.runtime.createChannel(treeChannelId, SharedTree.getFactory().type);
|
|
99
84
|
sharedTree.bindToContext();
|
|
100
|
-
|
|
85
|
+
this.#tree = sharedTree;
|
|
101
86
|
// Note, the implementer is responsible for initializing the tree with initial data.
|
|
102
87
|
// Generally, this can be done via `initializingFirstTime`.
|
|
103
88
|
}
|
|
104
89
|
await super.initializeInternal(existing);
|
|
105
90
|
}
|
|
106
91
|
}
|
|
107
|
-
_TreeDataObject_tree = new WeakMap();
|
|
108
92
|
//# sourceMappingURL=treeDataObject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeDataObject.js","sourceRoot":"","sources":["../../src/data-objects/treeDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"treeDataObject.js","sourceRoot":"","sources":["../../src/data-objects/treeDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AACtE,OAAO,EAAE,UAAU,EAAc,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;;;GAGG;AACH,MAAM,aAAa,GAAG,WAAW,CAAC;AAElC,MAAM,wBAAwB,GAC7B,8FAA8F,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,OAAgB,cAEpB,SAAQ,cAAgC;IACzC;;;OAGG;IACH,KAAK,CAAoB;IAEzB;;;OAGG;IACH,IAAc,IAAI;QACjB,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,UAAU,CAAC,wBAAwB,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAEe,KAAK,CAAC,kBAAkB,CAAC,QAAiB;QACzD,IAAI,QAAQ,EAAE,CAAC;YACd,+FAA+F;YAC/F,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YAE7D,0FAA0F;YAC1F,8FAA8F;YAC9F,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC7B,MAAM,IAAI,KAAK,CACd,mBAAmB,OAAO,CAAC,EAAE,gEAAgE,CAC7F,CAAC;YACH,CAAC;YACD,MAAM,UAAU,GAAU,OAAO,CAAC;YAElC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC;QACzB,CAAC;aAAM,CAAC;YACP,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAC5C,aAAa,EACb,UAAU,CAAC,UAAU,EAAE,CAAC,IAAI,CACR,CAAC;YACrB,UAAuC,CAAC,aAAa,EAAE,CAAC;YAEzD,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC;YAExB,oFAAoF;YACpF,2DAA2D;QAC5D,CAAC;QAED,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ISharedObject } from \"@fluidframework/shared-object-base/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { SharedTree, type ITree } from \"@fluidframework/tree/internal\";\n\nimport { PureDataObject } from \"./pureDataObject.js\";\nimport type { DataObjectTypes } from \"./types.js\";\n\n/**\n * Channel ID of {@link TreeDataObject}'s root {@link @fluidframework/tree#SharedTree}.\n * @privateRemarks This key is persisted and should not be changed without a migration strategy.\n */\nconst treeChannelId = \"root-tree\";\n\nconst uninitializedErrorString =\n\t\"The tree has not yet been initialized. The data object must be initialized before accessing.\";\n\n/**\n * A {@link PureDataObject | data object} backed by a {@link @fluidframework/tree#ITree}.\n *\n * @remarks\n *\n * In order to view the tree's data, consumers of this type will need to apply the appropriate view schema to the {@link TreeDataObject.tree}.\n * This will generally be done via {@link PureDataObject.initializingFromExisting} and {@link PureDataObject.initializingFirstTime} methods.\n *\n * To initialize the tree's data for initial creation, implementers of this class will need to override {@link PureDataObject.initializingFirstTime} and set the data in the schema-aware view.\n *\n * @typeParam TDataObjectTypes - The optional input types used to strongly type the data object.\n *\n * @example Implementing `initializingFirstTime`\n *\n * ```typescript\n * protected override async initializingFirstTime(): Promise<void> {\n * \t// Generate the schema-aware view of the tree.\n * \tthis.treeView = this.tree.viewWith(treeViewConfiguration);\n *\n * \t// Initialize the tree with initial data.\n * \tthis.treeView.initialize(initialTree);\n * }\n * ```\n *\n * @example Implementing `initializingFromExisting`\n *\n * ```typescript\n * protected override async initializingFromExisting(): Promise<void> {\n * \t// Generate the schema-aware view of the tree.\n * \tthis.treeView = this.tree.viewWith(treeViewConfiguration);\n *\n * // Ensure the loaded tree is compatible with the view schema.\n * \tif (!this.treeView.compatibility.canView) {\n * \t\t// Handle out-of-schema data as appropriate.\n * \t}\n * }\n * ```\n *\n * @legacy @beta\n */\nexport abstract class TreeDataObject<\n\tTDataObjectTypes extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObject<TDataObjectTypes> {\n\t/**\n\t * The underlying {@link @fluidframework/tree#ITree | tree}.\n\t * @remarks Created once during initialization.\n\t */\n\t#tree: ITree | undefined;\n\n\t/**\n\t * The underlying {@link @fluidframework/tree#ITree | tree}.\n\t * @remarks Created once during initialization.\n\t */\n\tprotected get tree(): ITree {\n\t\tif (this.#tree === undefined) {\n\t\t\tthrow new UsageError(uninitializedErrorString);\n\t\t}\n\t\treturn this.#tree;\n\t}\n\n\tpublic override async initializeInternal(existing: boolean): Promise<void> {\n\t\tif (existing) {\n\t\t\t// data store has a root tree so we just need to set it before calling initializingFromExisting\n\t\t\tconst channel = await this.runtime.getChannel(treeChannelId);\n\n\t\t\t// TODO: Support using a Directory to Tree migration shim and DataObject's root channel ID\n\t\t\t// to allow migrating from DataObject to TreeDataObject instead of just erroring in that case.\n\t\t\tif (!SharedTree.is(channel)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Content with id ${channel.id} is not a SharedTree and cannot be loaded with treeDataObject.`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst sharedTree: ITree = channel;\n\n\t\t\tthis.#tree = sharedTree;\n\t\t} else {\n\t\t\tconst sharedTree = this.runtime.createChannel(\n\t\t\t\ttreeChannelId,\n\t\t\t\tSharedTree.getFactory().type,\n\t\t\t) as unknown as ITree;\n\t\t\t(sharedTree as unknown as ISharedObject).bindToContext();\n\n\t\t\tthis.#tree = sharedTree;\n\n\t\t\t// Note, the implementer is responsible for initializing the tree with initial data.\n\t\t\t// Generally, this can be done via `initializingFirstTime`.\n\t\t}\n\n\t\tawait super.initializeInternal(existing);\n\t}\n}\n"]}
|
package/lib/legacy.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib
|
|
8
|
+
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
package/lib/public.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib
|
|
8
|
+
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib" in @fluid-tools/build-cli.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/aqueduct",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "A set of implementations for Fluid Framework interfaces.",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -14,38 +14,24 @@
|
|
|
14
14
|
"type": "module",
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"require": {
|
|
22
|
-
"types": "./dist/public.d.ts",
|
|
23
|
-
"default": "./dist/index.js"
|
|
17
|
+
"types": "./lib/public.d.ts",
|
|
18
|
+
"default": "./lib/index.js",
|
|
19
|
+
"internal-entrypoint-generation": {
|
|
20
|
+
"types": "./dist/public.d.ts"
|
|
24
21
|
}
|
|
25
22
|
},
|
|
26
23
|
"./legacy": {
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"require": {
|
|
32
|
-
"types": "./dist/legacy.d.ts",
|
|
33
|
-
"default": "./dist/index.js"
|
|
24
|
+
"types": "./lib/legacy.d.ts",
|
|
25
|
+
"default": "./lib/index.js",
|
|
26
|
+
"internal-entrypoint-generation": {
|
|
27
|
+
"types": "./dist/legacy.d.ts"
|
|
34
28
|
}
|
|
35
29
|
},
|
|
36
30
|
"./internal": {
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
"default": "./lib/index.js"
|
|
40
|
-
},
|
|
41
|
-
"require": {
|
|
42
|
-
"types": "./dist/index.d.ts",
|
|
43
|
-
"default": "./dist/index.js"
|
|
44
|
-
}
|
|
31
|
+
"types": "./lib/index.d.ts",
|
|
32
|
+
"default": "./lib/index.js"
|
|
45
33
|
}
|
|
46
34
|
},
|
|
47
|
-
"main": "lib/index.js",
|
|
48
|
-
"types": "lib/public.d.ts",
|
|
49
35
|
"c8": {
|
|
50
36
|
"all": true,
|
|
51
37
|
"cache-dir": "nyc/.cache",
|
|
@@ -69,27 +55,27 @@
|
|
|
69
55
|
"temp-directory": "nyc/.nyc_output"
|
|
70
56
|
},
|
|
71
57
|
"dependencies": {
|
|
72
|
-
"@fluid-internal/client-utils": "~
|
|
73
|
-
"@fluidframework/container-definitions": "~
|
|
74
|
-
"@fluidframework/container-runtime": "~
|
|
75
|
-
"@fluidframework/container-runtime-definitions": "~
|
|
76
|
-
"@fluidframework/core-interfaces": "~
|
|
77
|
-
"@fluidframework/core-utils": "~
|
|
78
|
-
"@fluidframework/datastore": "~
|
|
79
|
-
"@fluidframework/datastore-definitions": "~
|
|
80
|
-
"@fluidframework/map": "~
|
|
81
|
-
"@fluidframework/request-handler": "~
|
|
82
|
-
"@fluidframework/runtime-definitions": "~
|
|
83
|
-
"@fluidframework/runtime-utils": "~
|
|
84
|
-
"@fluidframework/shared-object-base": "~
|
|
85
|
-
"@fluidframework/synthesize": "~
|
|
86
|
-
"@fluidframework/telemetry-utils": "~
|
|
87
|
-
"@fluidframework/tree": "~
|
|
58
|
+
"@fluid-internal/client-utils": "~3.0.0",
|
|
59
|
+
"@fluidframework/container-definitions": "~3.0.0",
|
|
60
|
+
"@fluidframework/container-runtime": "~3.0.0",
|
|
61
|
+
"@fluidframework/container-runtime-definitions": "~3.0.0",
|
|
62
|
+
"@fluidframework/core-interfaces": "~3.0.0",
|
|
63
|
+
"@fluidframework/core-utils": "~3.0.0",
|
|
64
|
+
"@fluidframework/datastore": "~3.0.0",
|
|
65
|
+
"@fluidframework/datastore-definitions": "~3.0.0",
|
|
66
|
+
"@fluidframework/map": "~3.0.0",
|
|
67
|
+
"@fluidframework/request-handler": "~3.0.0",
|
|
68
|
+
"@fluidframework/runtime-definitions": "~3.0.0",
|
|
69
|
+
"@fluidframework/runtime-utils": "~3.0.0",
|
|
70
|
+
"@fluidframework/shared-object-base": "~3.0.0",
|
|
71
|
+
"@fluidframework/synthesize": "~3.0.0",
|
|
72
|
+
"@fluidframework/telemetry-utils": "~3.0.0",
|
|
73
|
+
"@fluidframework/tree": "~3.0.0"
|
|
88
74
|
},
|
|
89
75
|
"devDependencies": {
|
|
90
76
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
91
77
|
"@biomejs/biome": "~2.4.5",
|
|
92
|
-
"@fluid-internal/mocha-test-setup": "~
|
|
78
|
+
"@fluid-internal/mocha-test-setup": "~3.0.0",
|
|
93
79
|
"@fluid-tools/build-cli": "^0.67.0",
|
|
94
80
|
"@fluidframework/aqueduct-previous": "npm:@fluidframework/aqueduct@2.116.0",
|
|
95
81
|
"@fluidframework/build-common": "^2.0.3",
|
|
@@ -107,28 +93,41 @@
|
|
|
107
93
|
"mocha": "^11.7.5",
|
|
108
94
|
"mocha-multi-reporters": "^1.5.1",
|
|
109
95
|
"rimraf": "^6.1.3",
|
|
110
|
-
"typescript": "~
|
|
96
|
+
"typescript": "~6.0.3"
|
|
111
97
|
},
|
|
112
98
|
"typeValidation": {
|
|
113
|
-
"broken": {
|
|
99
|
+
"broken": {
|
|
100
|
+
"Interface_DataObjectFactoryProps": {
|
|
101
|
+
"backCompat": false,
|
|
102
|
+
"forwardCompat": false
|
|
103
|
+
},
|
|
104
|
+
"Interface_IDataObjectProps": {
|
|
105
|
+
"backCompat": false,
|
|
106
|
+
"forwardCompat": false
|
|
107
|
+
},
|
|
108
|
+
"Interface_BaseContainerRuntimeFactoryProps": {
|
|
109
|
+
"forwardCompat": false
|
|
110
|
+
}
|
|
111
|
+
},
|
|
114
112
|
"entrypoint": "legacy"
|
|
115
113
|
},
|
|
116
114
|
"scripts": {
|
|
117
115
|
"build": "fluid-build . --task build",
|
|
118
116
|
"build:api-reports": "concurrently \"npm:build:api-reports:*\"",
|
|
119
|
-
"build:api-reports:current": "api-extractor run --local --config api-extractor/api-extractor.current.json",
|
|
120
|
-
"build:api-reports:legacy": "api-extractor run --local --config api-extractor/api-extractor.legacy.json",
|
|
117
|
+
"build:api-reports:current": "api-extractor run --local --config api-extractor/api-extractor-report.current.json",
|
|
118
|
+
"build:api-reports:legacy": "api-extractor run --local --config api-extractor/api-extractor-report.legacy.json",
|
|
119
|
+
"build:cjs": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
|
|
121
120
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
122
121
|
"build:compile": "fluid-build . --task compile",
|
|
123
|
-
"build:docs": "api-extractor run --local",
|
|
122
|
+
"build:docs": "api-extractor run --local --config api-extractor/api-extractor-model.json",
|
|
124
123
|
"build:entrypoints": "fluid-build . --task build:entrypoints",
|
|
125
124
|
"build:entrypoints:cjs": "flub generate entrypoints --resolutionConditions require --outFileLegacyBeta legacy --outDir ./dist",
|
|
126
|
-
"build:entrypoints:esm": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib
|
|
127
|
-
"build:
|
|
125
|
+
"build:entrypoints:esm": "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib",
|
|
126
|
+
"build:esm": "tsc --project ./tsconfig.json",
|
|
128
127
|
"build:test": "concurrently npm:build:test:esm npm:build:test:cjs",
|
|
129
128
|
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
130
129
|
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
131
|
-
"check:are-the-types-wrong": "attw --pack .",
|
|
130
|
+
"check:are-the-types-wrong": "attw --pack . --profile esm-only",
|
|
132
131
|
"check:biome": "biome check .",
|
|
133
132
|
"check:exports": "concurrently \"npm:check:exports:*\"",
|
|
134
133
|
"check:exports:bundle-release-tags": "api-extractor run --config api-extractor/api-extractor-lint-bundle.json",
|
|
@@ -138,9 +137,9 @@
|
|
|
138
137
|
"check:exports:esm:public": "api-extractor run --config api-extractor/api-extractor-lint-public.esm.json",
|
|
139
138
|
"check:format": "npm run check:biome",
|
|
140
139
|
"ci:build:api-reports": "concurrently \"npm:ci:build:api-reports:*\"",
|
|
141
|
-
"ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor.current.json",
|
|
142
|
-
"ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
|
|
143
|
-
"ci:build:docs": "api-extractor run",
|
|
140
|
+
"ci:build:api-reports:current": "api-extractor run --config api-extractor/api-extractor-report.current.json",
|
|
141
|
+
"ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor-report.legacy.json",
|
|
142
|
+
"ci:build:docs": "api-extractor run --config api-extractor/api-extractor-model.json",
|
|
144
143
|
"clean": "rimraf --glob dist lib {alpha,beta,internal,legacy}.d.ts \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
145
144
|
"eslint": "eslint --quiet --format stylish src",
|
|
146
145
|
"eslint:fix": "eslint --quiet --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
@@ -154,7 +153,6 @@
|
|
|
154
153
|
"test:mocha:cjs": "cross-env FLUID_TEST_MODULE_SYSTEM=CJS mocha",
|
|
155
154
|
"test:mocha:esm": "mocha",
|
|
156
155
|
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
157
|
-
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
|
|
158
156
|
"typetests:gen": "flub generate typetests --dir . -v"
|
|
159
157
|
}
|
|
160
158
|
}
|
|
@@ -3,23 +3,19 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { IContainerRuntimeOptions } from "@fluidframework/container-runtime/internal";
|
|
7
6
|
import type {
|
|
8
7
|
IContainerRuntime,
|
|
9
8
|
// eslint-disable-next-line import-x/no-deprecated
|
|
10
9
|
IContainerRuntimeWithResolveHandle_Deprecated,
|
|
11
10
|
} from "@fluidframework/container-runtime-definitions/internal";
|
|
12
11
|
import type { FluidObject, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
13
|
-
|
|
14
|
-
import type { RuntimeRequestHandler } from "@fluidframework/request-handler/internal";
|
|
15
|
-
import type {
|
|
16
|
-
IFluidDataStoreFactory,
|
|
17
|
-
NamedFluidDataStoreRegistryEntries,
|
|
18
|
-
} from "@fluidframework/runtime-definitions/internal";
|
|
12
|
+
import type { IFluidDataStoreFactory } from "@fluidframework/runtime-definitions/internal";
|
|
19
13
|
import { RequestParser } from "@fluidframework/runtime-utils/internal";
|
|
20
|
-
import type { IFluidDependencySynthesizer } from "@fluidframework/synthesize/internal";
|
|
21
14
|
|
|
22
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
BaseContainerRuntimeFactory,
|
|
17
|
+
type BaseContainerRuntimeFactoryProps,
|
|
18
|
+
} from "./baseContainerRuntimeFactory.js";
|
|
23
19
|
|
|
24
20
|
const defaultDataStoreId = "default";
|
|
25
21
|
|
|
@@ -36,26 +32,9 @@ async function getDefaultFluidObject(runtime: IContainerRuntime): Promise<FluidO
|
|
|
36
32
|
* @legacy
|
|
37
33
|
* @beta
|
|
38
34
|
*/
|
|
39
|
-
export interface ContainerRuntimeFactoryWithDefaultDataStoreProps
|
|
35
|
+
export interface ContainerRuntimeFactoryWithDefaultDataStoreProps
|
|
36
|
+
extends Omit<BaseContainerRuntimeFactoryProps, "provideEntryPoint"> {
|
|
40
37
|
defaultFactory: IFluidDataStoreFactory;
|
|
41
|
-
/**
|
|
42
|
-
* The data store registry for containers produced.
|
|
43
|
-
*/
|
|
44
|
-
registryEntries: NamedFluidDataStoreRegistryEntries;
|
|
45
|
-
/**
|
|
46
|
-
* @deprecated Will be removed in a future release.
|
|
47
|
-
*/
|
|
48
|
-
dependencyContainer?: IFluidDependencySynthesizer;
|
|
49
|
-
/**
|
|
50
|
-
* Request handlers for containers produced.
|
|
51
|
-
* @deprecated Will be removed once Loader LTS version is "2.0.0-internal.7.0.0". Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
|
|
52
|
-
*/
|
|
53
|
-
// eslint-disable-next-line import-x/no-deprecated
|
|
54
|
-
requestHandlers?: RuntimeRequestHandler[];
|
|
55
|
-
/**
|
|
56
|
-
* The runtime options passed to the IContainerRuntime when instantiating it
|
|
57
|
-
*/
|
|
58
|
-
runtimeOptions?: IContainerRuntimeOptions;
|
|
59
38
|
/**
|
|
60
39
|
* Function that will initialize the entryPoint of the IContainerRuntime instances
|
|
61
40
|
* created with this factory
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
MapFactory,
|
|
9
9
|
SharedDirectory,
|
|
10
10
|
} from "@fluidframework/map/internal";
|
|
11
|
+
import { LogLevel } from "@fluidframework/core-interfaces";
|
|
11
12
|
|
|
12
13
|
import { PureDataObject } from "./pureDataObject.js";
|
|
13
14
|
import type { DataObjectTypes } from "./types.js";
|
|
@@ -57,12 +58,15 @@ export abstract class DataObject<
|
|
|
57
58
|
// DataObject which used a SharedMap. Since SharedMap and SharedDirectory are compatible unless
|
|
58
59
|
// SharedDirectory-only commands are used on SharedMap, this will mostly just work for compatibility.
|
|
59
60
|
if (this.internalRoot.attributes.type === MapFactory.Type) {
|
|
60
|
-
this.runtime.logger.send(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
this.runtime.logger.send(
|
|
62
|
+
{
|
|
63
|
+
category: "generic",
|
|
64
|
+
eventName: "MapDataObject",
|
|
65
|
+
message:
|
|
66
|
+
"Legacy document, SharedMap is masquerading as SharedDirectory in DataObject",
|
|
67
|
+
},
|
|
68
|
+
LogLevel.essential,
|
|
69
|
+
);
|
|
66
70
|
}
|
|
67
71
|
} else {
|
|
68
72
|
// Create a root directory and register it before calling initializingFirstTime
|
package/tsconfig.json
CHANGED
package/internal.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export * from "./lib/index.js";
|
package/legacy.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
-
* Generated by "flub generate entrypoints --outFileLegacyBeta legacy --outDir ./lib --node10TypeCompat" in @fluid-tools/build-cli.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export * from "./lib/legacy.js";
|
|
File without changes
|
|
File without changes
|