@fluidframework/test-utils 2.0.0-rc.3.0.1 → 2.0.0-rc.3.0.11
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/api-report/test-utils.api.md +1 -1
- package/dist/TestConfigs.d.ts +1 -1
- package/dist/TestConfigs.d.ts.map +1 -1
- package/dist/TestConfigs.js +2 -2
- package/dist/TestConfigs.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/testFluidObject.js.map +1 -1
- package/lib/TestConfigs.d.ts +1 -1
- package/lib/TestConfigs.d.ts.map +1 -1
- package/lib/TestConfigs.js +2 -2
- package/lib/TestConfigs.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/testFluidObject.js.map +1 -1
- package/package.json +24 -24
- package/src/TestConfigs.ts +4 -2
- package/src/packageVersion.ts +1 -1
- package/src/testFluidObject.ts +1 -1
- package/dist/public.d.ts +0 -12
- package/lib/public.d.ts +0 -12
|
@@ -97,7 +97,7 @@ export function createSummarizerFromFactory(provider: ITestObjectProvider, conta
|
|
|
97
97
|
}>;
|
|
98
98
|
|
|
99
99
|
// @internal
|
|
100
|
-
export const createTestConfigProvider: () => ITestConfigProvider;
|
|
100
|
+
export const createTestConfigProvider: (defaults?: Record<string, ConfigTypes>) => ITestConfigProvider;
|
|
101
101
|
|
|
102
102
|
// @internal
|
|
103
103
|
export const createTestContainerRuntimeFactory: (containerRuntimeCtor: typeof ContainerRuntime) => {
|
package/dist/TestConfigs.d.ts
CHANGED
|
@@ -19,5 +19,5 @@ export interface ITestConfigProvider extends IConfigProviderBase {
|
|
|
19
19
|
* Creates a test config provider with the ability to set configs values and clear all config values.
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
|
-
export declare const createTestConfigProvider: () => ITestConfigProvider;
|
|
22
|
+
export declare const createTestConfigProvider: (defaults?: Record<string, ConfigTypes>) => ITestConfigProvider;
|
|
23
23
|
//# sourceMappingURL=TestConfigs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestConfigs.d.ts","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC/D,yBAAyB;IACzB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,8BAA8B;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"TestConfigs.d.ts","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC/D,yBAAyB;IACzB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,8BAA8B;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,cAC1B,OAAO,MAAM,EAAE,WAAW,CAAC,KACnC,mBAcF,CAAC"}
|
package/dist/TestConfigs.js
CHANGED
|
@@ -9,8 +9,8 @@ exports.createTestConfigProvider = void 0;
|
|
|
9
9
|
* Creates a test config provider with the ability to set configs values and clear all config values.
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
|
-
const createTestConfigProvider = () => {
|
|
13
|
-
const settings = {};
|
|
12
|
+
const createTestConfigProvider = (defaults = {}) => {
|
|
13
|
+
const settings = { ...defaults };
|
|
14
14
|
return {
|
|
15
15
|
getRawConfig: (name) => settings[name],
|
|
16
16
|
set: (key, value) => {
|
package/dist/TestConfigs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestConfigs.js","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiBH;;;GAGG;AACI,MAAM,wBAAwB,GAAG,
|
|
1
|
+
{"version":3,"file":"TestConfigs.js","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAiBH;;;GAGG;AACI,MAAM,wBAAwB,GAAG,CACvC,WAAwC,EAAE,EACpB,EAAE;IACxB,MAAM,QAAQ,GAAgC,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC9D,OAAO;QACN,YAAY,EAAE,CAAC,IAAY,EAAe,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC3D,GAAG,EAAE,CAAC,GAAW,EAAE,KAAkB,EAAE,EAAE;YACxC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACvB,CAAC;QACD,KAAK,EAAE,GAAG,EAAE;YACX,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACrC,gEAAgE;gBAChE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC,CAAC;AAhBW,QAAA,wBAAwB,4BAgBnC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ConfigTypes, IConfigProviderBase } from \"@fluidframework/core-interfaces\";\n\n/**\n * Extension of IConfigProviderBase that supports setting a config value and clearing all\n * config values for testing.\n *\n * @internal\n */\nexport interface ITestConfigProvider extends IConfigProviderBase {\n\t/** Set a config value */\n\tset: (key: string, value: ConfigTypes) => void;\n\t/** Clear all config values */\n\tclear: () => void;\n}\n\n/**\n * Creates a test config provider with the ability to set configs values and clear all config values.\n * @internal\n */\nexport const createTestConfigProvider = (\n\tdefaults: Record<string, ConfigTypes> = {},\n): ITestConfigProvider => {\n\tconst settings: Record<string, ConfigTypes> = { ...defaults };\n\treturn {\n\t\tgetRawConfig: (name: string): ConfigTypes => settings[name],\n\t\tset: (key: string, value: ConfigTypes) => {\n\t\t\tsettings[key] = value;\n\t\t},\n\t\tclear: () => {\n\t\t\tObject.keys(settings).forEach((key) => {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\t\t\tdelete settings[key];\n\t\t\t});\n\t\t},\n\t};\n};\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/test-utils";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-rc.3.0.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-rc.3.0.11";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,+BAA+B,CAAC;AACpD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,+BAA+B,CAAC;AACpD,eAAO,MAAM,UAAU,oBAAoB,CAAC"}
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/test-utils";
|
|
11
|
-
exports.pkgVersion = "2.0.0-rc.3.0.
|
|
11
|
+
exports.pkgVersion = "2.0.0-rc.3.0.11";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/test-utils\";\nexport const pkgVersion = \"2.0.0-rc.3.0.11\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testFluidObject.js","sourceRoot":"","sources":["../src/testFluidObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAC7D,iEAI4C;AAE5C,2DAAqE;AAMrE,qEAA2E;AAI3E;;;;;GAKG;AACH,MAAa,eAAe;IAC3B,IAAW,gBAAgB;QAC1B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAMD;;;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C,CAAC;SACjC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;CACD;AAtED,wDAsEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tFluidDataStoreRuntime,\n\tFluidObjectHandle,\n\tmixinRequestHandler,\n} from \"@fluidframework/datastore/internal\";\nimport { IChannelFactory, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { ISharedMap, SharedMap } from \"@fluidframework/map/internal\";\nimport {\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreFactory,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { create404Response } from \"@fluidframework/runtime-utils/internal\";\n\nimport { ITestFluidObject } from \"./interfaces.js\";\n\n/**\n * A test Fluid object that will create a shared object for each key-value pair in the factoryEntries passed to load.\n * The shared objects can be retrieved by passing the key of the entry to getSharedObject.\n * It exposes the IFluidDataStoreContext and IFluidDataStoreRuntime.\n * @internal\n */\nexport class TestFluidObject implements ITestFluidObject {\n\tpublic get ITestFluidObject() {\n\t\treturn this;\n\t}\n\n\tpublic get IFluidLoadable() {\n\t\treturn this;\n\t}\n\n\tpublic get handle(): IFluidHandle<this> {\n\t\treturn this.innerHandle;\n\t}\n\n\tpublic root!: ISharedMap;\n\tprivate readonly innerHandle: IFluidHandle<this>;\n\tprivate initializeP: Promise<void> | undefined;\n\n\t/**\n\t * Creates a new TestFluidObject.\n\t * @param runtime - The data store runtime.\n\t * @param context - The data store context.\n\t * @param factoryEntries - A list of id to IChannelFactory mapping. For each item in the list,\n\t * a shared object is created which can be retrieved by calling getSharedObject() with the id;\n\t */\n\tconstructor(\n\t\tpublic readonly runtime: IFluidDataStoreRuntime,\n\t\tpublic readonly channel: IFluidDataStoreChannel,\n\t\tpublic readonly context: IFluidDataStoreContext,\n\t\tprivate readonly factoryEntriesMap: Map<string, IChannelFactory>,\n\t) {\n\t\tthis.innerHandle = new FluidObjectHandle(this, \"\", runtime.objectsRoutingContext);\n\t}\n\n\t/**\n\t * Retrieves a shared object with the given id.\n\t * @param id - The id of the shared object to retrieve.\n\t */\n\tpublic async getSharedObject<T = any>(id: string): Promise<T> {\n\t\tif (this.factoryEntriesMap === undefined) {\n\t\t\tthrow new Error(\"Shared objects were not provided during creation.\");\n\t\t}\n\n\t\tfor (const key of this.factoryEntriesMap.keys()) {\n\t\t\tif (key === id) {\n\t\t\t\tconst handle = this.root.get<IFluidHandle>(id);\n\t\t\t\treturn handle?.get() as unknown as T;\n\t\t\t}\n\t\t}\n\n\t\tthrow new Error(`Shared object with id ${id} not found.`);\n\t}\n\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\treturn request.url === \"\" || request.url === \"/\" || request.url.startsWith(\"/?\")\n\t\t\t? { mimeType: \"fluid/object\", status: 200, value: this }\n\t\t\t: create404Response(request);\n\t}\n\n\tpublic async initialize(existing: boolean) {\n\t\tconst doInitialization = async () => {\n\t\t\tif (!existing) {\n\t\t\t\tthis.root = SharedMap.create(this.runtime, \"root\");\n\n\t\t\t\tthis.factoryEntriesMap.forEach(\n\t\t\t\t\t(sharedObjectFactory: IChannelFactory, key: string) => {\n\t\t\t\t\t\tconst sharedObject = this.runtime.createChannel(\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tsharedObjectFactory.type,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.root.set(key, sharedObject.handle);\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tthis.root.bindToContext();\n\t\t\t}\n\n\t\t\tthis.root = (await this.runtime.getChannel(\"root\")) as ISharedMap;\n\t\t};\n\n\t\tif (this.initializeP === undefined) {\n\t\t\tthis.initializeP = doInitialization();\n\t\t}\n\n\t\treturn this.initializeP;\n\t}\n}\n\n/**\n * @internal\n */\nexport type ChannelFactoryRegistry = Iterable<[string | undefined, IChannelFactory]>;\n\n/**\n * Creates a factory for a TestFluidObject with the given object factory entries. It creates a data store runtime\n * with the object factories in the entry list. All the entries with an id other than undefined are passed to the\n * Fluid object so that it can create a shared object for each.\n *\n * @example\n *\n * The following will create a Fluid object that creates and loads a SharedString and SharedDirectory.\n * It will add SparseMatrix to the data store's factory so that it can be created later.\n *\n * ```typescript\n * new TestFluidObjectFactory([\n * [ \"sharedString\", SharedString.getFactory() ],\n * [ \"sharedDirectory\", SharedDirectory.getFactory() ],\n * [ undefined, SparseMatrix.getFactory() ],\n * ]);\n * ```\n *\n * The SharedString and SharedDirectory can be retrieved via getSharedObject() on the TestFluidObject as follows:\n *\n * ```typescript\n * sharedString = testFluidObject.getSharedObject<SharedString>(\"sharedString\");\n * sharedDir = testFluidObject.getSharedObject<SharedDirectory>(\"sharedDirectory\");\n * ```\n *\n * @privateRemarks Beware that using this class generally forfeits some compatibility coverage\n * `describeCompat` aims to provide:\n * `SharedMap`s always reference the current version of SharedMap.\n * AB#4670 tracks improving this situation.\n * @internal\n */\nexport class TestFluidObjectFactory implements IFluidDataStoreFactory {\n\tpublic get IFluidDataStoreFactory() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Creates a new TestFluidObjectFactory.\n\t * @param factoryEntries - A list of id to IChannelFactory mapping. It creates a data store runtime with each\n\t * IChannelFactory. Entries with string ids are passed to the Fluid object so that it can create a shared object\n\t * for it.\n\t */\n\tconstructor(\n\t\tprivate readonly factoryEntries: ChannelFactoryRegistry,\n\t\tpublic readonly type = \"TestFluidObjectFactory\",\n\t) {}\n\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<FluidDataStoreRuntime> {\n\t\tconst dataTypes = new Map<string, IChannelFactory>();\n\n\t\t// Add SharedMap's factory which will be used to create the root map.\n\t\tconst sharedMapFactory = SharedMap.getFactory();\n\t\tdataTypes.set(sharedMapFactory.type, sharedMapFactory);\n\n\t\t// Add the object factories to the list to be sent to data store runtime.\n\t\tfor (const [, factory] of this.factoryEntries) {\n\t\t\tdataTypes.set(factory.type, factory);\n\t\t}\n\n\t\t// Create a map from the factory entries with entries that don't have the id as undefined. This will be\n\t\t// passed to the Fluid object.\n\t\tconst factoryEntriesMapForObject = new Map<string, IChannelFactory>();\n\t\tfor (const [id, factory] of this.factoryEntries) {\n\t\t\tif (id !== undefined) {\n\t\t\t\tfactoryEntriesMapForObject.set(id, factory);\n\t\t\t}\n\t\t}\n\n\t\tconst runtimeClass = mixinRequestHandler(\n\t\t\tasync (request: IRequest, rt: FluidDataStoreRuntime) => {\n\t\t\t\t// The provideEntryPoint callback below always returns FluidDataStoreRuntime, so this cast is safe\n\t\t\t\tconst dataObject = (await rt.entryPoint.get()) as FluidDataStoreRuntime;\n\t\t\t\tassert(\n\t\t\t\t\tdataObject.request !== undefined,\n\t\t\t\t\t\"entryPoint should have been initialized by now\",\n\t\t\t\t);\n\t\t\t\treturn dataObject.request(request);\n\t\t\t},\n\t\t);\n\n\t\tconst runtime = new runtimeClass(context, dataTypes, existing, async () => {\n\t\t\tawait instance.initialize(true);\n\t\t\treturn instance;\n\t\t});\n\n\t\tconst instance: TestFluidObject = new TestFluidObject(\n\t\t\truntime, // runtime\n\t\t\truntime, // channel\n\t\t\tcontext,\n\t\t\tfactoryEntriesMapForObject,\n\t\t);\n\n\t\tif (!existing) {\n\t\t\tawait instance.initialize(false);\n\t\t}\n\n\t\treturn runtime;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"testFluidObject.js","sourceRoot":"","sources":["../src/testFluidObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA6D;AAC7D,iEAI4C;AAE5C,2DAAqE;AAMrE,qEAA2E;AAI3E;;;;;GAKG;AACH,MAAa,eAAe;IAC3B,IAAW,gBAAgB;QAC1B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,M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C,QAAQ,EAAE;YACd,MAAM,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;SACjC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;CACD;AAtED,wDAsEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tFluidDataStoreRuntime,\n\tFluidObjectHandle,\n\tmixinRequestHandler,\n} from \"@fluidframework/datastore/internal\";\nimport { IChannelFactory, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { ISharedMap, SharedMap } from \"@fluidframework/map/internal\";\nimport {\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreFactory,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { create404Response } from \"@fluidframework/runtime-utils/internal\";\n\nimport { ITestFluidObject } from \"./interfaces.js\";\n\n/**\n * A test Fluid object that will create a shared object for each key-value pair in the factoryEntries passed to load.\n * The shared objects can be retrieved by passing the key of the entry to getSharedObject.\n * It exposes the IFluidDataStoreContext and IFluidDataStoreRuntime.\n * @internal\n */\nexport class TestFluidObject implements ITestFluidObject {\n\tpublic get ITestFluidObject() {\n\t\treturn this;\n\t}\n\n\tpublic get IFluidLoadable() {\n\t\treturn this;\n\t}\n\n\tpublic get handle(): IFluidHandle<this> {\n\t\treturn this.innerHandle;\n\t}\n\n\tpublic root!: ISharedMap;\n\tprivate readonly innerHandle: IFluidHandle<this>;\n\tprivate initializeP: Promise<void> | undefined;\n\n\t/**\n\t * Creates a new TestFluidObject.\n\t * @param runtime - The data store runtime.\n\t * @param context - The data store context.\n\t * @param factoryEntries - A list of id to IChannelFactory mapping. For each item in the list,\n\t * a shared object is created which can be retrieved by calling getSharedObject() with the id;\n\t */\n\tconstructor(\n\t\tpublic readonly runtime: IFluidDataStoreRuntime,\n\t\tpublic readonly channel: IFluidDataStoreChannel,\n\t\tpublic readonly context: IFluidDataStoreContext,\n\t\tprivate readonly factoryEntriesMap: Map<string, IChannelFactory>,\n\t) {\n\t\tthis.innerHandle = new FluidObjectHandle(this, \"\", runtime.objectsRoutingContext);\n\t}\n\n\t/**\n\t * Retrieves a shared object with the given id.\n\t * @param id - The id of the shared object to retrieve.\n\t */\n\tpublic async getSharedObject<T = any>(id: string): Promise<T> {\n\t\tif (this.factoryEntriesMap === undefined) {\n\t\t\tthrow new Error(\"Shared objects were not provided during creation.\");\n\t\t}\n\n\t\tfor (const key of this.factoryEntriesMap.keys()) {\n\t\t\tif (key === id) {\n\t\t\t\tconst handle = this.root.get<IFluidHandle>(id);\n\t\t\t\treturn handle?.get() as Promise<T>;\n\t\t\t}\n\t\t}\n\n\t\tthrow new Error(`Shared object with id ${id} not found.`);\n\t}\n\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\treturn request.url === \"\" || request.url === \"/\" || request.url.startsWith(\"/?\")\n\t\t\t? { mimeType: \"fluid/object\", status: 200, value: this }\n\t\t\t: create404Response(request);\n\t}\n\n\tpublic async initialize(existing: boolean) {\n\t\tconst doInitialization = async () => {\n\t\t\tif (!existing) {\n\t\t\t\tthis.root = SharedMap.create(this.runtime, \"root\");\n\n\t\t\t\tthis.factoryEntriesMap.forEach(\n\t\t\t\t\t(sharedObjectFactory: IChannelFactory, key: string) => {\n\t\t\t\t\t\tconst sharedObject = this.runtime.createChannel(\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tsharedObjectFactory.type,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.root.set(key, sharedObject.handle);\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tthis.root.bindToContext();\n\t\t\t}\n\n\t\t\tthis.root = (await this.runtime.getChannel(\"root\")) as ISharedMap;\n\t\t};\n\n\t\tif (this.initializeP === undefined) {\n\t\t\tthis.initializeP = doInitialization();\n\t\t}\n\n\t\treturn this.initializeP;\n\t}\n}\n\n/**\n * @internal\n */\nexport type ChannelFactoryRegistry = Iterable<[string | undefined, IChannelFactory]>;\n\n/**\n * Creates a factory for a TestFluidObject with the given object factory entries. It creates a data store runtime\n * with the object factories in the entry list. All the entries with an id other than undefined are passed to the\n * Fluid object so that it can create a shared object for each.\n *\n * @example\n *\n * The following will create a Fluid object that creates and loads a SharedString and SharedDirectory.\n * It will add SparseMatrix to the data store's factory so that it can be created later.\n *\n * ```typescript\n * new TestFluidObjectFactory([\n * [ \"sharedString\", SharedString.getFactory() ],\n * [ \"sharedDirectory\", SharedDirectory.getFactory() ],\n * [ undefined, SparseMatrix.getFactory() ],\n * ]);\n * ```\n *\n * The SharedString and SharedDirectory can be retrieved via getSharedObject() on the TestFluidObject as follows:\n *\n * ```typescript\n * sharedString = testFluidObject.getSharedObject<SharedString>(\"sharedString\");\n * sharedDir = testFluidObject.getSharedObject<SharedDirectory>(\"sharedDirectory\");\n * ```\n *\n * @privateRemarks Beware that using this class generally forfeits some compatibility coverage\n * `describeCompat` aims to provide:\n * `SharedMap`s always reference the current version of SharedMap.\n * AB#4670 tracks improving this situation.\n * @internal\n */\nexport class TestFluidObjectFactory implements IFluidDataStoreFactory {\n\tpublic get IFluidDataStoreFactory() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Creates a new TestFluidObjectFactory.\n\t * @param factoryEntries - A list of id to IChannelFactory mapping. It creates a data store runtime with each\n\t * IChannelFactory. Entries with string ids are passed to the Fluid object so that it can create a shared object\n\t * for it.\n\t */\n\tconstructor(\n\t\tprivate readonly factoryEntries: ChannelFactoryRegistry,\n\t\tpublic readonly type = \"TestFluidObjectFactory\",\n\t) {}\n\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<FluidDataStoreRuntime> {\n\t\tconst dataTypes = new Map<string, IChannelFactory>();\n\n\t\t// Add SharedMap's factory which will be used to create the root map.\n\t\tconst sharedMapFactory = SharedMap.getFactory();\n\t\tdataTypes.set(sharedMapFactory.type, sharedMapFactory);\n\n\t\t// Add the object factories to the list to be sent to data store runtime.\n\t\tfor (const [, factory] of this.factoryEntries) {\n\t\t\tdataTypes.set(factory.type, factory);\n\t\t}\n\n\t\t// Create a map from the factory entries with entries that don't have the id as undefined. This will be\n\t\t// passed to the Fluid object.\n\t\tconst factoryEntriesMapForObject = new Map<string, IChannelFactory>();\n\t\tfor (const [id, factory] of this.factoryEntries) {\n\t\t\tif (id !== undefined) {\n\t\t\t\tfactoryEntriesMapForObject.set(id, factory);\n\t\t\t}\n\t\t}\n\n\t\tconst runtimeClass = mixinRequestHandler(\n\t\t\tasync (request: IRequest, rt: FluidDataStoreRuntime) => {\n\t\t\t\t// The provideEntryPoint callback below always returns FluidDataStoreRuntime, so this cast is safe\n\t\t\t\tconst dataObject = (await rt.entryPoint.get()) as FluidDataStoreRuntime;\n\t\t\t\tassert(\n\t\t\t\t\tdataObject.request !== undefined,\n\t\t\t\t\t\"entryPoint should have been initialized by now\",\n\t\t\t\t);\n\t\t\t\treturn dataObject.request(request);\n\t\t\t},\n\t\t);\n\n\t\tconst runtime = new runtimeClass(context, dataTypes, existing, async () => {\n\t\t\tawait instance.initialize(true);\n\t\t\treturn instance;\n\t\t});\n\n\t\tconst instance: TestFluidObject = new TestFluidObject(\n\t\t\truntime, // runtime\n\t\t\truntime, // channel\n\t\t\tcontext,\n\t\t\tfactoryEntriesMapForObject,\n\t\t);\n\n\t\tif (!existing) {\n\t\t\tawait instance.initialize(false);\n\t\t}\n\n\t\treturn runtime;\n\t}\n}\n"]}
|
package/lib/TestConfigs.d.ts
CHANGED
|
@@ -19,5 +19,5 @@ export interface ITestConfigProvider extends IConfigProviderBase {
|
|
|
19
19
|
* Creates a test config provider with the ability to set configs values and clear all config values.
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
|
-
export declare const createTestConfigProvider: () => ITestConfigProvider;
|
|
22
|
+
export declare const createTestConfigProvider: (defaults?: Record<string, ConfigTypes>) => ITestConfigProvider;
|
|
23
23
|
//# sourceMappingURL=TestConfigs.d.ts.map
|
package/lib/TestConfigs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestConfigs.d.ts","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC/D,yBAAyB;IACzB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,8BAA8B;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"TestConfigs.d.ts","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC/D,yBAAyB;IACzB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAC/C,8BAA8B;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,wBAAwB,cAC1B,OAAO,MAAM,EAAE,WAAW,CAAC,KACnC,mBAcF,CAAC"}
|
package/lib/TestConfigs.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* Creates a test config provider with the ability to set configs values and clear all config values.
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
export const createTestConfigProvider = () => {
|
|
10
|
-
const settings = {};
|
|
9
|
+
export const createTestConfigProvider = (defaults = {}) => {
|
|
10
|
+
const settings = { ...defaults };
|
|
11
11
|
return {
|
|
12
12
|
getRawConfig: (name) => settings[name],
|
|
13
13
|
set: (key, value) => {
|
package/lib/TestConfigs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestConfigs.js","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,
|
|
1
|
+
{"version":3,"file":"TestConfigs.js","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACvC,WAAwC,EAAE,EACpB,EAAE;IACxB,MAAM,QAAQ,GAAgC,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC9D,OAAO;QACN,YAAY,EAAE,CAAC,IAAY,EAAe,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC3D,GAAG,EAAE,CAAC,GAAW,EAAE,KAAkB,EAAE,EAAE;YACxC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACvB,CAAC;QACD,KAAK,EAAE,GAAG,EAAE;YACX,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACrC,gEAAgE;gBAChE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ConfigTypes, IConfigProviderBase } from \"@fluidframework/core-interfaces\";\n\n/**\n * Extension of IConfigProviderBase that supports setting a config value and clearing all\n * config values for testing.\n *\n * @internal\n */\nexport interface ITestConfigProvider extends IConfigProviderBase {\n\t/** Set a config value */\n\tset: (key: string, value: ConfigTypes) => void;\n\t/** Clear all config values */\n\tclear: () => void;\n}\n\n/**\n * Creates a test config provider with the ability to set configs values and clear all config values.\n * @internal\n */\nexport const createTestConfigProvider = (\n\tdefaults: Record<string, ConfigTypes> = {},\n): ITestConfigProvider => {\n\tconst settings: Record<string, ConfigTypes> = { ...defaults };\n\treturn {\n\t\tgetRawConfig: (name: string): ConfigTypes => settings[name],\n\t\tset: (key: string, value: ConfigTypes) => {\n\t\t\tsettings[key] = value;\n\t\t},\n\t\tclear: () => {\n\t\t\tObject.keys(settings).forEach((key) => {\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n\t\t\t\tdelete settings[key];\n\t\t\t});\n\t\t},\n\t};\n};\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/test-utils";
|
|
8
|
-
export declare const pkgVersion = "2.0.0-rc.3.0.
|
|
8
|
+
export declare const pkgVersion = "2.0.0-rc.3.0.11";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,+BAA+B,CAAC;AACpD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,+BAA+B,CAAC;AACpD,eAAO,MAAM,UAAU,oBAAoB,CAAC"}
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,4BAA4B,CAAC;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,4BAA4B,CAAC;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/test-utils\";\nexport const pkgVersion = \"2.0.0-rc.3.0.11\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testFluidObject.js","sourceRoot":"","sources":["../src/testFluidObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAEN,iBAAiB,EACjB,mBAAmB,GACnB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAc,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAMrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAI3E;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IAC3B,IAAW,gBAAgB;QAC1B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAMD;;;;;;OAMG;IACH,YACiB,OAA+B,EAC/B,OAA+B,EAC/B,OAA+B,EAC9B,iBAA+C;QAHhD,YAAO,GAAP,OAAO,CAAwB;QAC/B,YAAO,GAAP,OAAO,CAAwB;QAC/B,YAAO,GAAP,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AC,IAAI,EAAE,OAAO,CAAC,CAAC;SACrC;QAED,uGAAuG;QACvG,8BAA8B;QAC9B,MAAM,0BAA0B,GAAG,IAAI,GAAG,EAA2B,CAAC;QACtE,KAAK,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,cAAc,EAAE;YAChD,IAAI,EAAE,KAAK,SAAS,EAAE;gBACrB,0BAA0B,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;aAC5C;SACD;QAED,MAAM,YAAY,GAAG,mBAAmB,CACvC,KAAK,EAAE,OAAiB,EAAE,EAAyB,EAAE,EAAE;YACtD,kGAAkG;YAClG,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAA0B,CAAC;YACxE,MAAM,CACL,UAAU,CAAC,OAAO,KAAK,SAAS,EAChC,gDAAgD,CAChD,CAAC;YACF,OAAO,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC,CACD,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE;YACzE,MAAM,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAChC,OAAO,QAAQ,CAAC;QACjB,CAAC,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAoB,IAAI,eAAe,CACpD,OAAO,EAAE,UAAU;QACnB,OAAO,EAAE,UAAU;QACnB,OAAO,EACP,0BAA0B,CAC1B,CAAC;QAEF,IAAI,CAAC,QAAQ,EAAE;YACd,MAAM,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;SACjC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tFluidDataStoreRuntime,\n\tFluidObjectHandle,\n\tmixinRequestHandler,\n} from \"@fluidframework/datastore/internal\";\nimport { IChannelFactory, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { ISharedMap, SharedMap } from \"@fluidframework/map/internal\";\nimport {\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreFactory,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { create404Response } from \"@fluidframework/runtime-utils/internal\";\n\nimport { ITestFluidObject } from \"./interfaces.js\";\n\n/**\n * A test Fluid object that will create a shared object for each key-value pair in the factoryEntries passed to load.\n * The shared objects can be retrieved by passing the key of the entry to getSharedObject.\n * It exposes the IFluidDataStoreContext and IFluidDataStoreRuntime.\n * @internal\n */\nexport class TestFluidObject implements ITestFluidObject {\n\tpublic get ITestFluidObject() {\n\t\treturn this;\n\t}\n\n\tpublic get IFluidLoadable() {\n\t\treturn this;\n\t}\n\n\tpublic get handle(): IFluidHandle<this> {\n\t\treturn this.innerHandle;\n\t}\n\n\tpublic root!: ISharedMap;\n\tprivate readonly innerHandle: IFluidHandle<this>;\n\tprivate initializeP: Promise<void> | undefined;\n\n\t/**\n\t * Creates a new TestFluidObject.\n\t * @param runtime - The data store runtime.\n\t * @param context - The data store context.\n\t * @param factoryEntries - A list of id to IChannelFactory mapping. For each item in the list,\n\t * a shared object is created which can be retrieved by calling getSharedObject() with the id;\n\t */\n\tconstructor(\n\t\tpublic readonly runtime: IFluidDataStoreRuntime,\n\t\tpublic readonly channel: IFluidDataStoreChannel,\n\t\tpublic readonly context: IFluidDataStoreContext,\n\t\tprivate readonly factoryEntriesMap: Map<string, IChannelFactory>,\n\t) {\n\t\tthis.innerHandle = new FluidObjectHandle(this, \"\", runtime.objectsRoutingContext);\n\t}\n\n\t/**\n\t * Retrieves a shared object with the given id.\n\t * @param id - The id of the shared object to retrieve.\n\t */\n\tpublic async getSharedObject<T = any>(id: string): Promise<T> {\n\t\tif (this.factoryEntriesMap === undefined) {\n\t\t\tthrow new Error(\"Shared objects were not provided during creation.\");\n\t\t}\n\n\t\tfor (const key of this.factoryEntriesMap.keys()) {\n\t\t\tif (key === id) {\n\t\t\t\tconst handle = this.root.get<IFluidHandle>(id);\n\t\t\t\treturn handle?.get() as unknown as T;\n\t\t\t}\n\t\t}\n\n\t\tthrow new Error(`Shared object with id ${id} not found.`);\n\t}\n\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\treturn request.url === \"\" || request.url === \"/\" || request.url.startsWith(\"/?\")\n\t\t\t? { mimeType: \"fluid/object\", status: 200, value: this }\n\t\t\t: create404Response(request);\n\t}\n\n\tpublic async initialize(existing: boolean) {\n\t\tconst doInitialization = async () => {\n\t\t\tif (!existing) {\n\t\t\t\tthis.root = SharedMap.create(this.runtime, \"root\");\n\n\t\t\t\tthis.factoryEntriesMap.forEach(\n\t\t\t\t\t(sharedObjectFactory: IChannelFactory, key: string) => {\n\t\t\t\t\t\tconst sharedObject = this.runtime.createChannel(\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tsharedObjectFactory.type,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.root.set(key, sharedObject.handle);\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tthis.root.bindToContext();\n\t\t\t}\n\n\t\t\tthis.root = (await this.runtime.getChannel(\"root\")) as ISharedMap;\n\t\t};\n\n\t\tif (this.initializeP === undefined) {\n\t\t\tthis.initializeP = doInitialization();\n\t\t}\n\n\t\treturn this.initializeP;\n\t}\n}\n\n/**\n * @internal\n */\nexport type ChannelFactoryRegistry = Iterable<[string | undefined, IChannelFactory]>;\n\n/**\n * Creates a factory for a TestFluidObject with the given object factory entries. It creates a data store runtime\n * with the object factories in the entry list. All the entries with an id other than undefined are passed to the\n * Fluid object so that it can create a shared object for each.\n *\n * @example\n *\n * The following will create a Fluid object that creates and loads a SharedString and SharedDirectory.\n * It will add SparseMatrix to the data store's factory so that it can be created later.\n *\n * ```typescript\n * new TestFluidObjectFactory([\n * [ \"sharedString\", SharedString.getFactory() ],\n * [ \"sharedDirectory\", SharedDirectory.getFactory() ],\n * [ undefined, SparseMatrix.getFactory() ],\n * ]);\n * ```\n *\n * The SharedString and SharedDirectory can be retrieved via getSharedObject() on the TestFluidObject as follows:\n *\n * ```typescript\n * sharedString = testFluidObject.getSharedObject<SharedString>(\"sharedString\");\n * sharedDir = testFluidObject.getSharedObject<SharedDirectory>(\"sharedDirectory\");\n * ```\n *\n * @privateRemarks Beware that using this class generally forfeits some compatibility coverage\n * `describeCompat` aims to provide:\n * `SharedMap`s always reference the current version of SharedMap.\n * AB#4670 tracks improving this situation.\n * @internal\n */\nexport class TestFluidObjectFactory implements IFluidDataStoreFactory {\n\tpublic get IFluidDataStoreFactory() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Creates a new TestFluidObjectFactory.\n\t * @param factoryEntries - A list of id to IChannelFactory mapping. It creates a data store runtime with each\n\t * IChannelFactory. Entries with string ids are passed to the Fluid object so that it can create a shared object\n\t * for it.\n\t */\n\tconstructor(\n\t\tprivate readonly factoryEntries: ChannelFactoryRegistry,\n\t\tpublic readonly type = \"TestFluidObjectFactory\",\n\t) {}\n\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<FluidDataStoreRuntime> {\n\t\tconst dataTypes = new Map<string, IChannelFactory>();\n\n\t\t// Add SharedMap's factory which will be used to create the root map.\n\t\tconst sharedMapFactory = SharedMap.getFactory();\n\t\tdataTypes.set(sharedMapFactory.type, sharedMapFactory);\n\n\t\t// Add the object factories to the list to be sent to data store runtime.\n\t\tfor (const [, factory] of this.factoryEntries) {\n\t\t\tdataTypes.set(factory.type, factory);\n\t\t}\n\n\t\t// Create a map from the factory entries with entries that don't have the id as undefined. This will be\n\t\t// passed to the Fluid object.\n\t\tconst factoryEntriesMapForObject = new Map<string, IChannelFactory>();\n\t\tfor (const [id, factory] of this.factoryEntries) {\n\t\t\tif (id !== undefined) {\n\t\t\t\tfactoryEntriesMapForObject.set(id, factory);\n\t\t\t}\n\t\t}\n\n\t\tconst runtimeClass = mixinRequestHandler(\n\t\t\tasync (request: IRequest, rt: FluidDataStoreRuntime) => {\n\t\t\t\t// The provideEntryPoint callback below always returns FluidDataStoreRuntime, so this cast is safe\n\t\t\t\tconst dataObject = (await rt.entryPoint.get()) as FluidDataStoreRuntime;\n\t\t\t\tassert(\n\t\t\t\t\tdataObject.request !== undefined,\n\t\t\t\t\t\"entryPoint should have been initialized by now\",\n\t\t\t\t);\n\t\t\t\treturn dataObject.request(request);\n\t\t\t},\n\t\t);\n\n\t\tconst runtime = new runtimeClass(context, dataTypes, existing, async () => {\n\t\t\tawait instance.initialize(true);\n\t\t\treturn instance;\n\t\t});\n\n\t\tconst instance: TestFluidObject = new TestFluidObject(\n\t\t\truntime, // runtime\n\t\t\truntime, // channel\n\t\t\tcontext,\n\t\t\tfactoryEntriesMapForObject,\n\t\t);\n\n\t\tif (!existing) {\n\t\t\tawait instance.initialize(false);\n\t\t}\n\n\t\treturn runtime;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"testFluidObject.js","sourceRoot":"","sources":["../src/testFluidObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAEN,iBAAiB,EACjB,mBAAmB,GACnB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAc,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAMrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAI3E;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IAC3B,IAAW,gBAAgB;QAC1B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,WAAW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CAAC;SACjC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tFluidDataStoreRuntime,\n\tFluidObjectHandle,\n\tmixinRequestHandler,\n} from \"@fluidframework/datastore/internal\";\nimport { IChannelFactory, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { ISharedMap, SharedMap } from \"@fluidframework/map/internal\";\nimport {\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreFactory,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { create404Response } from \"@fluidframework/runtime-utils/internal\";\n\nimport { ITestFluidObject } from \"./interfaces.js\";\n\n/**\n * A test Fluid object that will create a shared object for each key-value pair in the factoryEntries passed to load.\n * The shared objects can be retrieved by passing the key of the entry to getSharedObject.\n * It exposes the IFluidDataStoreContext and IFluidDataStoreRuntime.\n * @internal\n */\nexport class TestFluidObject implements ITestFluidObject {\n\tpublic get ITestFluidObject() {\n\t\treturn this;\n\t}\n\n\tpublic get IFluidLoadable() {\n\t\treturn this;\n\t}\n\n\tpublic get handle(): IFluidHandle<this> {\n\t\treturn this.innerHandle;\n\t}\n\n\tpublic root!: ISharedMap;\n\tprivate readonly innerHandle: IFluidHandle<this>;\n\tprivate initializeP: Promise<void> | undefined;\n\n\t/**\n\t * Creates a new TestFluidObject.\n\t * @param runtime - The data store runtime.\n\t * @param context - The data store context.\n\t * @param factoryEntries - A list of id to IChannelFactory mapping. For each item in the list,\n\t * a shared object is created which can be retrieved by calling getSharedObject() with the id;\n\t */\n\tconstructor(\n\t\tpublic readonly runtime: IFluidDataStoreRuntime,\n\t\tpublic readonly channel: IFluidDataStoreChannel,\n\t\tpublic readonly context: IFluidDataStoreContext,\n\t\tprivate readonly factoryEntriesMap: Map<string, IChannelFactory>,\n\t) {\n\t\tthis.innerHandle = new FluidObjectHandle(this, \"\", runtime.objectsRoutingContext);\n\t}\n\n\t/**\n\t * Retrieves a shared object with the given id.\n\t * @param id - The id of the shared object to retrieve.\n\t */\n\tpublic async getSharedObject<T = any>(id: string): Promise<T> {\n\t\tif (this.factoryEntriesMap === undefined) {\n\t\t\tthrow new Error(\"Shared objects were not provided during creation.\");\n\t\t}\n\n\t\tfor (const key of this.factoryEntriesMap.keys()) {\n\t\t\tif (key === id) {\n\t\t\t\tconst handle = this.root.get<IFluidHandle>(id);\n\t\t\t\treturn handle?.get() as Promise<T>;\n\t\t\t}\n\t\t}\n\n\t\tthrow new Error(`Shared object with id ${id} not found.`);\n\t}\n\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\treturn request.url === \"\" || request.url === \"/\" || request.url.startsWith(\"/?\")\n\t\t\t? { mimeType: \"fluid/object\", status: 200, value: this }\n\t\t\t: create404Response(request);\n\t}\n\n\tpublic async initialize(existing: boolean) {\n\t\tconst doInitialization = async () => {\n\t\t\tif (!existing) {\n\t\t\t\tthis.root = SharedMap.create(this.runtime, \"root\");\n\n\t\t\t\tthis.factoryEntriesMap.forEach(\n\t\t\t\t\t(sharedObjectFactory: IChannelFactory, key: string) => {\n\t\t\t\t\t\tconst sharedObject = this.runtime.createChannel(\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\tsharedObjectFactory.type,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.root.set(key, sharedObject.handle);\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tthis.root.bindToContext();\n\t\t\t}\n\n\t\t\tthis.root = (await this.runtime.getChannel(\"root\")) as ISharedMap;\n\t\t};\n\n\t\tif (this.initializeP === undefined) {\n\t\t\tthis.initializeP = doInitialization();\n\t\t}\n\n\t\treturn this.initializeP;\n\t}\n}\n\n/**\n * @internal\n */\nexport type ChannelFactoryRegistry = Iterable<[string | undefined, IChannelFactory]>;\n\n/**\n * Creates a factory for a TestFluidObject with the given object factory entries. It creates a data store runtime\n * with the object factories in the entry list. All the entries with an id other than undefined are passed to the\n * Fluid object so that it can create a shared object for each.\n *\n * @example\n *\n * The following will create a Fluid object that creates and loads a SharedString and SharedDirectory.\n * It will add SparseMatrix to the data store's factory so that it can be created later.\n *\n * ```typescript\n * new TestFluidObjectFactory([\n * [ \"sharedString\", SharedString.getFactory() ],\n * [ \"sharedDirectory\", SharedDirectory.getFactory() ],\n * [ undefined, SparseMatrix.getFactory() ],\n * ]);\n * ```\n *\n * The SharedString and SharedDirectory can be retrieved via getSharedObject() on the TestFluidObject as follows:\n *\n * ```typescript\n * sharedString = testFluidObject.getSharedObject<SharedString>(\"sharedString\");\n * sharedDir = testFluidObject.getSharedObject<SharedDirectory>(\"sharedDirectory\");\n * ```\n *\n * @privateRemarks Beware that using this class generally forfeits some compatibility coverage\n * `describeCompat` aims to provide:\n * `SharedMap`s always reference the current version of SharedMap.\n * AB#4670 tracks improving this situation.\n * @internal\n */\nexport class TestFluidObjectFactory implements IFluidDataStoreFactory {\n\tpublic get IFluidDataStoreFactory() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Creates a new TestFluidObjectFactory.\n\t * @param factoryEntries - A list of id to IChannelFactory mapping. It creates a data store runtime with each\n\t * IChannelFactory. Entries with string ids are passed to the Fluid object so that it can create a shared object\n\t * for it.\n\t */\n\tconstructor(\n\t\tprivate readonly factoryEntries: ChannelFactoryRegistry,\n\t\tpublic readonly type = \"TestFluidObjectFactory\",\n\t) {}\n\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<FluidDataStoreRuntime> {\n\t\tconst dataTypes = new Map<string, IChannelFactory>();\n\n\t\t// Add SharedMap's factory which will be used to create the root map.\n\t\tconst sharedMapFactory = SharedMap.getFactory();\n\t\tdataTypes.set(sharedMapFactory.type, sharedMapFactory);\n\n\t\t// Add the object factories to the list to be sent to data store runtime.\n\t\tfor (const [, factory] of this.factoryEntries) {\n\t\t\tdataTypes.set(factory.type, factory);\n\t\t}\n\n\t\t// Create a map from the factory entries with entries that don't have the id as undefined. This will be\n\t\t// passed to the Fluid object.\n\t\tconst factoryEntriesMapForObject = new Map<string, IChannelFactory>();\n\t\tfor (const [id, factory] of this.factoryEntries) {\n\t\t\tif (id !== undefined) {\n\t\t\t\tfactoryEntriesMapForObject.set(id, factory);\n\t\t\t}\n\t\t}\n\n\t\tconst runtimeClass = mixinRequestHandler(\n\t\t\tasync (request: IRequest, rt: FluidDataStoreRuntime) => {\n\t\t\t\t// The provideEntryPoint callback below always returns FluidDataStoreRuntime, so this cast is safe\n\t\t\t\tconst dataObject = (await rt.entryPoint.get()) as FluidDataStoreRuntime;\n\t\t\t\tassert(\n\t\t\t\t\tdataObject.request !== undefined,\n\t\t\t\t\t\"entryPoint should have been initialized by now\",\n\t\t\t\t);\n\t\t\t\treturn dataObject.request(request);\n\t\t\t},\n\t\t);\n\n\t\tconst runtime = new runtimeClass(context, dataTypes, existing, async () => {\n\t\t\tawait instance.initialize(true);\n\t\t\treturn instance;\n\t\t});\n\n\t\tconst instance: TestFluidObject = new TestFluidObject(\n\t\t\truntime, // runtime\n\t\t\truntime, // channel\n\t\t\tcontext,\n\t\t\tfactoryEntriesMapForObject,\n\t\t);\n\n\t\tif (!existing) {\n\t\t\tawait instance.initialize(false);\n\t\t}\n\n\t\treturn runtime;\n\t}\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/test-utils",
|
|
3
|
-
"version": "2.0.0-rc.3.0.
|
|
3
|
+
"version": "2.0.0-rc.3.0.11",
|
|
4
4
|
"description": "Utilities for Fluid tests",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
17
|
"import": {
|
|
18
|
-
"types": "./lib/
|
|
18
|
+
"types": "./lib/index.d.ts",
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
21
|
"require": {
|
|
22
|
-
"types": "./dist/
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
23
|
"default": "./dist/index.js"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"main": "lib/index.js",
|
|
48
|
-
"types": "lib/
|
|
48
|
+
"types": "lib/index.d.ts",
|
|
49
49
|
"c8": {
|
|
50
50
|
"all": true,
|
|
51
51
|
"cache-dir": "nyc/.cache",
|
|
@@ -67,26 +67,26 @@
|
|
|
67
67
|
"temp-directory": "nyc/.nyc_output"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@fluid-internal/test-driver-definitions": ">=2.0.0-rc.3.0.
|
|
71
|
-
"@fluidframework/aqueduct": ">=2.0.0-rc.3.0.
|
|
72
|
-
"@fluidframework/container-definitions": ">=2.0.0-rc.3.0.
|
|
73
|
-
"@fluidframework/container-loader": ">=2.0.0-rc.3.0.
|
|
74
|
-
"@fluidframework/container-runtime": ">=2.0.0-rc.3.0.
|
|
75
|
-
"@fluidframework/container-runtime-definitions": ">=2.0.0-rc.3.0.
|
|
76
|
-
"@fluidframework/core-interfaces": ">=2.0.0-rc.3.0.
|
|
77
|
-
"@fluidframework/core-utils": ">=2.0.0-rc.3.0.
|
|
78
|
-
"@fluidframework/datastore": ">=2.0.0-rc.3.0.
|
|
79
|
-
"@fluidframework/datastore-definitions": ">=2.0.0-rc.3.0.
|
|
80
|
-
"@fluidframework/driver-definitions": ">=2.0.0-rc.3.0.
|
|
81
|
-
"@fluidframework/driver-utils": ">=2.0.0-rc.3.0.
|
|
82
|
-
"@fluidframework/local-driver": ">=2.0.0-rc.3.0.
|
|
83
|
-
"@fluidframework/map": ">=2.0.0-rc.3.0.
|
|
70
|
+
"@fluid-internal/test-driver-definitions": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
71
|
+
"@fluidframework/aqueduct": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
72
|
+
"@fluidframework/container-definitions": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
73
|
+
"@fluidframework/container-loader": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
74
|
+
"@fluidframework/container-runtime": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
75
|
+
"@fluidframework/container-runtime-definitions": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
76
|
+
"@fluidframework/core-interfaces": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
77
|
+
"@fluidframework/core-utils": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
78
|
+
"@fluidframework/datastore": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
79
|
+
"@fluidframework/datastore-definitions": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
80
|
+
"@fluidframework/driver-definitions": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
81
|
+
"@fluidframework/driver-utils": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
82
|
+
"@fluidframework/local-driver": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
83
|
+
"@fluidframework/map": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
84
84
|
"@fluidframework/protocol-definitions": "^3.2.0",
|
|
85
|
-
"@fluidframework/request-handler": ">=2.0.0-rc.3.0.
|
|
86
|
-
"@fluidframework/routerlicious-driver": ">=2.0.0-rc.3.0.
|
|
87
|
-
"@fluidframework/runtime-definitions": ">=2.0.0-rc.3.0.
|
|
88
|
-
"@fluidframework/runtime-utils": ">=2.0.0-rc.3.0.
|
|
89
|
-
"@fluidframework/telemetry-utils": ">=2.0.0-rc.3.0.
|
|
85
|
+
"@fluidframework/request-handler": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
86
|
+
"@fluidframework/routerlicious-driver": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
87
|
+
"@fluidframework/runtime-definitions": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
88
|
+
"@fluidframework/runtime-utils": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
89
|
+
"@fluidframework/telemetry-utils": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
90
90
|
"best-random": "^1.0.0",
|
|
91
91
|
"debug": "^4.3.4",
|
|
92
92
|
"mocha": "^10.2.0",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@arethetypeswrong/cli": "^0.15.2",
|
|
97
97
|
"@biomejs/biome": "^1.6.2",
|
|
98
|
-
"@fluid-internal/mocha-test-setup": ">=2.0.0-rc.3.0.
|
|
98
|
+
"@fluid-internal/mocha-test-setup": ">=2.0.0-rc.3.0.11 <2.0.0-rc.3.1.0",
|
|
99
99
|
"@fluid-tools/build-cli": "^0.37.0",
|
|
100
100
|
"@fluidframework/build-common": "^2.0.3",
|
|
101
101
|
"@fluidframework/build-tools": "^0.37.0",
|
package/src/TestConfigs.ts
CHANGED
|
@@ -22,8 +22,10 @@ export interface ITestConfigProvider extends IConfigProviderBase {
|
|
|
22
22
|
* Creates a test config provider with the ability to set configs values and clear all config values.
|
|
23
23
|
* @internal
|
|
24
24
|
*/
|
|
25
|
-
export const createTestConfigProvider = (
|
|
26
|
-
|
|
25
|
+
export const createTestConfigProvider = (
|
|
26
|
+
defaults: Record<string, ConfigTypes> = {},
|
|
27
|
+
): ITestConfigProvider => {
|
|
28
|
+
const settings: Record<string, ConfigTypes> = { ...defaults };
|
|
27
29
|
return {
|
|
28
30
|
getRawConfig: (name: string): ConfigTypes => settings[name],
|
|
29
31
|
set: (key: string, value: ConfigTypes) => {
|
package/src/packageVersion.ts
CHANGED
package/src/testFluidObject.ts
CHANGED
|
@@ -72,7 +72,7 @@ export class TestFluidObject implements ITestFluidObject {
|
|
|
72
72
|
for (const key of this.factoryEntriesMap.keys()) {
|
|
73
73
|
if (key === id) {
|
|
74
74
|
const handle = this.root.get<IFluidHandle>(id);
|
|
75
|
-
return handle?.get() as
|
|
75
|
+
return handle?.get() as Promise<T>;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
package/dist/public.d.ts
DELETED
|
@@ -1,12 +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" in @fluidframework/build-tools.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export {}
|
|
12
|
-
|
package/lib/public.d.ts
DELETED
|
@@ -1,12 +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" in @fluidframework/build-tools.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export {}
|
|
12
|
-
|