@fluidframework/aqueduct 0.52.0-44610 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-object-factories/dataObjectFactory.d.ts +21 -4
- package/dist/data-object-factories/dataObjectFactory.d.ts.map +1 -1
- package/dist/data-object-factories/dataObjectFactory.js +18 -4
- package/dist/data-object-factories/dataObjectFactory.js.map +1 -1
- package/dist/data-object-factories/pureDataObjectFactory.d.ts +30 -13
- package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
- package/dist/data-object-factories/pureDataObjectFactory.js +18 -4
- package/dist/data-object-factories/pureDataObjectFactory.js.map +1 -1
- package/dist/data-objects/dataObject.d.ts +25 -5
- package/dist/data-objects/dataObject.d.ts.map +1 -1
- package/dist/data-objects/dataObject.js +21 -5
- package/dist/data-objects/dataObject.js.map +1 -1
- package/dist/data-objects/index.d.ts +3 -2
- package/dist/data-objects/index.d.ts.map +1 -1
- package/dist/data-objects/index.js +3 -1
- package/dist/data-objects/index.js.map +1 -1
- package/dist/data-objects/pureDataObject.d.ts +26 -15
- package/dist/data-objects/pureDataObject.d.ts.map +1 -1
- package/dist/data-objects/pureDataObject.js +18 -5
- package/dist/data-objects/pureDataObject.js.map +1 -1
- package/dist/data-objects/types.d.ts +38 -0
- package/dist/data-objects/types.d.ts.map +1 -0
- package/dist/data-objects/types.js +7 -0
- package/dist/data-objects/types.js.map +1 -0
- package/dist/test/tsconfig.tsbuildinfo +53 -33
- package/lib/data-object-factories/dataObjectFactory.js +16 -3
- package/lib/data-object-factories/dataObjectFactory.js.map +1 -1
- package/lib/data-object-factories/pureDataObjectFactory.js +16 -3
- package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -1
- package/lib/data-objects/dataObject.js +19 -4
- package/lib/data-objects/dataObject.js.map +1 -1
- package/lib/data-objects/index.js +2 -2
- package/lib/data-objects/index.js.map +1 -1
- package/lib/data-objects/pureDataObject.js +16 -4
- package/lib/data-objects/pureDataObject.js.map +1 -1
- package/lib/data-objects/types.js +6 -0
- package/lib/data-objects/types.js.map +1 -0
- package/package.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pureDataObject.d.ts","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,WAAW,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAU,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"pureDataObject.d.ts","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,WAAW,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAU,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,g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,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.PureDataObject = void 0;
|
|
7
|
+
exports.LegacyPureDataObject = exports.PureDataObject = void 0;
|
|
8
8
|
const datastore_1 = require("@fluidframework/datastore");
|
|
9
9
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
10
10
|
const request_handler_1 = require("@fluidframework/request-handler");
|
|
@@ -15,11 +15,8 @@ const request_handlers_1 = require("../request-handlers");
|
|
|
15
15
|
* You probably don't want to inherit from this data store directly unless
|
|
16
16
|
* you are creating another base data store class
|
|
17
17
|
*
|
|
18
|
-
* @typeParam
|
|
19
|
-
* @typeParam S - the initial state type that the produced data object may take during creation
|
|
20
|
-
* @typeParam E - represents events that will be available in the EventForwarder
|
|
18
|
+
* @typeParam I - The optional input types used to strongly type the data object
|
|
21
19
|
*/
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
23
20
|
class PureDataObject extends common_utils_1.EventForwarder {
|
|
24
21
|
constructor(props) {
|
|
25
22
|
super();
|
|
@@ -169,4 +166,20 @@ class PureDataObject extends common_utils_1.EventForwarder {
|
|
|
169
166
|
}
|
|
170
167
|
}
|
|
171
168
|
exports.PureDataObject = PureDataObject;
|
|
169
|
+
/**
|
|
170
|
+
* @deprecated - This type is meant to ease the transition from the old PureDataObject type to the new.
|
|
171
|
+
* please migrate to PureDataObject.
|
|
172
|
+
*
|
|
173
|
+
* This is a bare-bones base class that does basic setup and enables for factory on an initialize call.
|
|
174
|
+
* You probably don't want to inherit from this data store directly unless
|
|
175
|
+
* you are creating another base data store class
|
|
176
|
+
*
|
|
177
|
+
* @typeParam O - represents a type that will define optional providers that will be injected
|
|
178
|
+
* @typeParam S - the initial state type that the produced data object may take during creation
|
|
179
|
+
* @typeParam E - represents events that will be available in the EventForwarder
|
|
180
|
+
*/
|
|
181
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
182
|
+
class LegacyPureDataObject extends PureDataObject {
|
|
183
|
+
}
|
|
184
|
+
exports.LegacyPureDataObject = LegacyPureDataObject;
|
|
172
185
|
//# sourceMappingURL=pureDataObject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,yDAA8D;AAE9D,+DAAsE;AAEtE,qEAAsE;AACtE,8DAA6D;AAC7D,0DAAuE;AAWvE;;;;;;;;GAQG;AACH,wDAAwD;AACxD,MAAsB,cAClB,SAAQ,6BAAiB;IAgDzB,YAAmB,KAA6B;QAC5C,KAAK,EAAE,CAAC;QA9CJ,cAAS,GAAG,KAAK,CAAC;QA+CtB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QAEjC,qBAAM,CAAE,IAAI,CAAC,OAAe,CAAC,WAAW,KAAK,SAAS,EAAE,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAC7G,IAAI,CAAC,OAAe,CAAC,WAAW,GAAG,IAAI,CAAC;QAEzC,8GAA8G;QAC9G,4GAA4G;QAC5G,yBAAyB;QACzB,IAAI,CAAC,WAAW,GAAG,IAAI,6BAAiB,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAEvF,2BAA2B;QAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;YAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;IAv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AC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC;IACjF,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,UAAU,CAAuC,EAAU;QACvE,OAAO,qCAAmB,CAAI,IAAI,yCAAoB,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC;IACzG,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,aAAa,KAAoB,CAAC;IAElD;;;;;OAKG;IACO,KAAK,CAAC,qBAAqB,CAAC,KAAS,IAAmB,CAAC;IAEnE;;;OAGG;IACO,KAAK,CAAC,wBAAwB,KAAoB,CAAC;IAE7D;;OAEG;IACO,KAAK,CAAC,cAAc,KAAoB,CAAC;IAEnD;;OAEG;IACI,OAAO;QACV,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ;AAvMD,wCAuMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IFluidObject,\n IFluidHandle,\n IFluidLoadable,\n IFluidRouter,\n IProvideFluidHandle,\n IRequest,\n IResponse,\n FluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport { AsyncFluidObjectProvider, FluidObjectKey } from \"@fluidframework/synthesize\";\nimport { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore\";\nimport { IDirectory } from \"@fluidframework/map\";\nimport { assert, EventForwarder } from \"@fluidframework/common-utils\";\nimport { IEvent } from \"@fluidframework/common-definitions\";\nimport { handleFromLegacyUri } from \"@fluidframework/request-handler\";\nimport { serviceRoutePathRoot } from \"../container-services\";\nimport { defaultFluidObjectRequestHandler } from \"../request-handlers\";\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport interface IDataObjectProps<O = object, S = undefined> {\n readonly runtime: IFluidDataStoreRuntime;\n readonly context: IFluidDataStoreContext;\n // eslint-disable-next-line @typescript-eslint/ban-types\n readonly providers: AsyncFluidObjectProvider<FluidObjectKey<O>, FluidObjectKey<object>>;\n readonly initProps?: S;\n}\n\n/**\n * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.\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 O - represents a type that will define optional providers that will be injected\n * @typeParam S - the initial state type that the produced data object may take during creation\n * @typeParam E - represents events that will be available in the EventForwarder\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport abstract class PureDataObject<O extends IFluidObject = object, S = undefined, E extends IEvent = IEvent>\n extends EventForwarder<E>\n implements IFluidLoadable, IFluidRouter, IProvideFluidHandle, IFluidObject {\n private readonly innerHandle: IFluidHandle<this>;\n private _disposed = false;\n\n /**\n * This is your FluidDataStoreRuntime object\n */\n protected readonly runtime: IFluidDataStoreRuntime;\n\n /**\n * This context is used to talk up to the ContainerRuntime\n */\n protected readonly context: IFluidDataStoreContext;\n\n /**\n * Providers are IFluidObject keyed objects that provide back\n * a promise to the corresponding IFluidObject or undefined.\n * Providers injected/provided by the Container and/or HostingApplication\n *\n * To define providers set IFluidObject interfaces in the generic O type for your data store\n */\n // eslint-disable-next-line @typescript-eslint/ban-types\n protected readonly providers: AsyncFluidObjectProvider<FluidObjectKey<O>, FluidObjectKey<object>>;\n\n protected initProps?: S;\n\n protected initializeP: Promise<void> | undefined;\n\n public get disposed() { return this._disposed; }\n\n public get id() { return this.runtime.id; }\n public get IFluidRouter() { return this; }\n public get IFluidLoadable() { return this; }\n public get IFluidHandle() { return this.innerHandle; }\n\n /**\n * Handle to a data store\n */\n public get handle(): IFluidHandle<this> { return this.innerHandle; }\n\n public static async getDataObject(runtime: IFluidDataStoreRuntime) {\n const obj = (runtime as any)._dataObject as PureDataObject;\n assert(obj !== undefined, 0x0bc /* \"Runtime has no DataObject!\" */);\n await obj.finishInitialization(true);\n return obj;\n }\n\n public constructor(props: IDataObjectProps<O, S>) {\n super();\n this.runtime = props.runtime;\n this.context = props.context;\n this.providers = props.providers;\n this.initProps = props.initProps;\n\n assert((this.runtime as any)._dataObject === undefined, 0x0bd /* \"Object runtime already has DataObject!\" */);\n (this.runtime as any)._dataObject = this;\n\n // Create a FluidObjectHandle with empty string as `path`. This is because reaching this PureDataObject is the\n // same as reaching its routeContext (FluidDataStoreRuntime) so there is so the relative path to it from the\n // routeContext is empty.\n this.innerHandle = new FluidObjectHandle(this, \"\", this.runtime.objectsRoutingContext);\n\n // Container event handlers\n this.runtime.once(\"dispose\", () => {\n this._disposed = true;\n this.dispose();\n });\n }\n\n // #region IFluidRouter\n\n /**\n * Return this object if someone requests it directly\n * We will return this object in two scenarios:\n * 1. the request url is a \"/\"\n * 2. the request url is empty\n */\n public async request(req: IRequest): Promise<IResponse> {\n return defaultFluidObjectRequestHandler(this, req);\n }\n\n // #endregion IFluidRouter\n\n // #region IFluidLoadable\n\n // #endregion IFluidLoadable\n\n /**\n * Call this API to ensure PureDataObject is fully initialized\n * initialization happens on demand, only on as-needed bases.\n * In most cases you should allow factory/object to decide when to finish initialization.\n * But if you are supplying your own implementation of DataStoreRuntime factory and overriding some methods\n * and need fully initialized object, then you can call this API to ensure object is fully initialized.\n */\n public async finishInitialization(existing: boolean): Promise<void> {\n if (this.initializeP !== undefined) {\n return this.initializeP;\n }\n this.initializeP = this.initializeInternal(existing);\n return this.initializeP;\n }\n\n /**\n * Internal initialize implementation. Overwriting this will change the flow of the PureDataObject and should\n * generally not be done.\n *\n * Calls initializingFirstTime, initializingFromExisting, and hasInitialized. Caller is\n * responsible for ensuring this is only invoked once.\n */\n public async initializeInternal(existing: boolean): Promise<void> {\n await this.preInitialize();\n if (existing) {\n assert(this.initProps === undefined,\n 0x0be /* \"Trying to initialize from existing while initProps is set!\" */);\n await this.initializingFromExisting();\n } else {\n await this.initializingFirstTime(this.context.createProps as S ?? this.initProps);\n }\n await this.hasInitialized();\n }\n\n /**\n * Retreive Fluid object using the handle get or the older requestFluidObject_UNSAFE call to fetch by ID\n *\n * @param key - key that object (handle/id) is stored with in the directory\n * @param directory - directory containing the object\n * @param getObjectFromDirectory - optional callback for fetching object from the directory, allows users to\n * define custom types/getters for object retrieval\n */\n public async getFluidObjectFromDirectory<T extends IFluidObject & FluidObject & IFluidLoadable>(\n key: string,\n directory: IDirectory,\n getObjectFromDirectory?: (id: string, directory: IDirectory) => string | IFluidHandle | undefined):\n Promise<T | undefined> {\n const handleOrId = getObjectFromDirectory ? getObjectFromDirectory(key, directory) : directory.get(key);\n if (typeof handleOrId === \"string\") {\n // For backwards compatibility with older stored IDs\n // We update the storage with the handle so that this code path is less and less trafficked\n const fluidObject = await this.requestFluidObject_UNSAFE<T>(handleOrId);\n if (fluidObject.IFluidLoadable && fluidObject.handle) {\n directory.set(key, fluidObject.handle);\n }\n return fluidObject;\n } else {\n const handle = handleOrId?.IFluidHandle;\n return await (handle ? handle.get() : this.requestFluidObject_UNSAFE(key)) as T;\n }\n }\n\n /**\n * @deprecated\n * Gets the data store of a given id. Will follow the pattern of the container for waiting.\n * @param id - data store id\n */\n protected async requestFluidObject_UNSAFE<T extends IFluidObject>(id: string): Promise<T> {\n return handleFromLegacyUri<T>(`/${id}`, this.context.containerRuntime).get();\n }\n\n /**\n * Gets the service at a given id.\n * @param id - service id\n */\n protected async getService<T extends IFluidObject & FluidObject>(id: string): Promise<T> {\n return handleFromLegacyUri<T>(`/${serviceRoutePathRoot}/${id}`, this.context.containerRuntime).get();\n }\n\n /**\n * Called every time the data store is initialized, before initializingFirstTime or\n * initializingFromExisting is called.\n */\n protected async preInitialize(): Promise<void> { }\n\n /**\n * Called the first time the data store is initialized (new creations with a new\n * data store runtime)\n *\n * @param props - Optional props to be passed in on create\n */\n protected async initializingFirstTime(props?: S): Promise<void> { }\n\n /**\n * Called every time but the first time the data store is initialized (creations\n * with an existing data store runtime)\n */\n protected async initializingFromExisting(): Promise<void> { }\n\n /**\n * Called every time the data store is initialized after create or existing.\n */\n protected async hasInitialized(): Promise<void> { }\n\n /**\n * Called when the host container closes and disposes itself\n */\n public dispose(): void {\n super.dispose();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,yDAA8D;AAE9D,+DAAsE;AACtE,qEAAsE;AAEtE,8DAA6D;AAC7D,0DAAuE;AAGvE;;;;;;GAMG;AACH,MAAsB,cAClB,SAAQ,6BAA2C;IAiDnD,YAAmB,KAA0B;QACzC,KAAK,EAAE,CAAC;QA/CJ,cAAS,GAAG,KAAK,CAAC;QAgDtB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QAEjC,qBAAM,CAAE,IAAI,CAAC,OAAe,CAAC,WAAW,KAAK,SAAS,EAAE,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAC7G,IAAI,CAAC,OAAe,CAAC,WAAW,GAAG,IAAI,CAAC;QAEzC,8GAA8G;QAC9G,4GAA4G;QAC5G,yBAAyB;QACzB,IAAI,CAAC,WAAW,GAAG,IAAI,6BAAiB,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAEvF,2BAA2B;QAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;YAC9B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,OAAO,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;IAvCD,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhD,IAAW,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G;IACO,KAAK,CAAC,UAAU,CAAuC,EAAU;QACvE,OAAO,qCAAmB,CAAI,IAAI,yCAAoB,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC;IACzG,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,aAAa,KAAoB,CAAC;IAElD;;;;;OAKG;IACO,KAAK,CAAC,qBAAqB,CAAC,KAAyC,IAAmB,CAAC;IAEnG;;;OAGG;IACO,KAAK,CAAC,wBAAwB,KAAoB,CAAC;IAE7D;;OAEG;IACO,KAAK,CAAC,cAAc,KAAoB,CAAC;IAEnD;;OAEG;IACI,OAAO;QACV,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ;AAzMD,wCAyMC;AAED;;;;;;;;;;;GAWG;AACH,wDAAwD;AACxD,MAAsB,oBACtB,SAAQ,cAAkE;CAEzE;AAHD,oDAGC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IFluidObject,\n IFluidHandle,\n IFluidLoadable,\n IFluidRouter,\n IProvideFluidHandle,\n IRequest,\n IResponse,\n FluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport { AsyncFluidObjectProvider, FluidObjectKey } from \"@fluidframework/synthesize\";\nimport { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore\";\nimport { IDirectory } from \"@fluidframework/map\";\nimport { assert, EventForwarder } from \"@fluidframework/common-utils\";\nimport { handleFromLegacyUri } from \"@fluidframework/request-handler\";\nimport { IEvent } from \"@fluidframework/common-definitions\";\nimport { serviceRoutePathRoot } from \"../container-services\";\nimport { defaultFluidObjectRequestHandler } from \"../request-handlers\";\nimport { DataObjectTypes, DataObjectType, IDataObjectProps } from \"./types\";\n\n/**\n * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.\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 */\nexport abstract class PureDataObject<I extends DataObjectTypes = DataObjectTypes>\n extends EventForwarder<DataObjectType<I, \"Events\">>\n implements IFluidLoadable, IFluidRouter, IProvideFluidHandle, IFluidObject {\n private readonly innerHandle: IFluidHandle<this>;\n private _disposed = false;\n\n /**\n * This is your FluidDataStoreRuntime object\n */\n protected readonly runtime: IFluidDataStoreRuntime;\n\n /**\n * This context is used to talk up to the ContainerRuntime\n */\n protected readonly context: IFluidDataStoreContext;\n\n /**\n * Providers are IFluidObject keyed objects that provide back\n * a promise to the corresponding IFluidObject or undefined.\n * Providers injected/provided by the Container and/or HostingApplication\n *\n * To define providers set IFluidObject interfaces in the generic O type for your data store\n */\n protected readonly providers:\n // eslint-disable-next-line @typescript-eslint/ban-types\n AsyncFluidObjectProvider<FluidObjectKey<DataObjectType<I, \"OptionalProviders\">>, FluidObjectKey<object>>;\n\n protected initProps?: DataObjectType<I, \"InitialState\">;\n\n protected initializeP: Promise<void> | undefined;\n\n public get disposed() { return this._disposed; }\n\n public get id() { return this.runtime.id; }\n public get IFluidRouter() { return this; }\n public get IFluidLoadable() { return this; }\n public get IFluidHandle() { return this.innerHandle; }\n\n /**\n * Handle to a data store\n */\n public get handle(): IFluidHandle<this> { return this.innerHandle; }\n\n public static async getDataObject(runtime: IFluidDataStoreRuntime) {\n const obj = (runtime as any)._dataObject as PureDataObject;\n assert(obj !== undefined, 0x0bc /* \"Runtime has no DataObject!\" */);\n await obj.finishInitialization(true);\n return obj;\n }\n\n public constructor(props: IDataObjectProps<I>) {\n super();\n this.runtime = props.runtime;\n this.context = props.context;\n this.providers = props.providers;\n this.initProps = props.initProps;\n\n assert((this.runtime as any)._dataObject === undefined, 0x0bd /* \"Object runtime already has DataObject!\" */);\n (this.runtime as any)._dataObject = this;\n\n // Create a FluidObjectHandle with empty string as `path`. This is because reaching this PureDataObject is the\n // same as reaching its routeContext (FluidDataStoreRuntime) so there is so the relative path to it from the\n // routeContext is empty.\n this.innerHandle = new FluidObjectHandle(this, \"\", this.runtime.objectsRoutingContext);\n\n // Container event handlers\n this.runtime.once(\"dispose\", () => {\n this._disposed = true;\n this.dispose();\n });\n }\n\n // #region IFluidRouter\n\n /**\n * Return this object if someone requests it directly\n * We will return this object in two scenarios:\n * 1. the request url is a \"/\"\n * 2. the request url is empty\n */\n public async request(req: IRequest): Promise<IResponse> {\n return defaultFluidObjectRequestHandler(this, req);\n }\n\n // #endregion IFluidRouter\n\n // #region IFluidLoadable\n\n // #endregion IFluidLoadable\n\n /**\n * Call this API to ensure PureDataObject is fully initialized\n * initialization happens on demand, only on as-needed bases.\n * In most cases you should allow factory/object to decide when to finish initialization.\n * But if you are supplying your own implementation of DataStoreRuntime factory and overriding some methods\n * and need fully initialized object, then you can call this API to ensure object is fully initialized.\n */\n public async finishInitialization(existing: boolean): Promise<void> {\n if (this.initializeP !== undefined) {\n return this.initializeP;\n }\n this.initializeP = this.initializeInternal(existing);\n return this.initializeP;\n }\n\n /**\n * Internal initialize implementation. Overwriting this will change the flow of the PureDataObject and should\n * generally not be done.\n *\n * Calls initializingFirstTime, initializingFromExisting, and hasInitialized. Caller is\n * responsible for ensuring this is only invoked once.\n */\n public async initializeInternal(existing: boolean): Promise<void> {\n await this.preInitialize();\n if (existing) {\n assert(this.initProps === undefined,\n 0x0be /* \"Trying to initialize from existing while initProps is set!\" */);\n await this.initializingFromExisting();\n } else {\n await this.initializingFirstTime(\n this.context.createProps as DataObjectType<I, \"InitialState\"> ?? this.initProps);\n }\n await this.hasInitialized();\n }\n\n /**\n * Retreive Fluid object using the handle get or the older requestFluidObject_UNSAFE call to fetch by ID\n *\n * @param key - key that object (handle/id) is stored with in the directory\n * @param directory - directory containing the object\n * @param getObjectFromDirectory - optional callback for fetching object from the directory, allows users to\n * define custom types/getters for object retrieval\n */\n public async getFluidObjectFromDirectory<T extends IFluidObject & FluidObject & IFluidLoadable>(\n key: string,\n directory: IDirectory,\n getObjectFromDirectory?: (id: string, directory: IDirectory) => string | IFluidHandle | undefined):\n Promise<T | undefined> {\n const handleOrId = getObjectFromDirectory ? getObjectFromDirectory(key, directory) : directory.get(key);\n if (typeof handleOrId === \"string\") {\n // For backwards compatibility with older stored IDs\n // We update the storage with the handle so that this code path is less and less trafficked\n const fluidObject = await this.requestFluidObject_UNSAFE<T>(handleOrId);\n if (fluidObject.IFluidLoadable && fluidObject.handle) {\n directory.set(key, fluidObject.handle);\n }\n return fluidObject;\n } else {\n const handle = handleOrId?.IFluidHandle;\n return await (handle ? handle.get() : this.requestFluidObject_UNSAFE(key)) as T;\n }\n }\n\n /**\n * @deprecated\n * Gets the data store of a given id. Will follow the pattern of the container for waiting.\n * @param id - data store id\n */\n protected async requestFluidObject_UNSAFE<T extends IFluidObject>(id: string): Promise<T> {\n return handleFromLegacyUri<T>(`/${id}`, this.context.containerRuntime).get();\n }\n\n /**\n * Gets the service at a given id.\n * @param id - service id\n */\n protected async getService<T extends IFluidObject & FluidObject>(id: string): Promise<T> {\n return handleFromLegacyUri<T>(`/${serviceRoutePathRoot}/${id}`, this.context.containerRuntime).get();\n }\n\n /**\n * Called every time the data store is initialized, before initializingFirstTime or\n * initializingFromExisting is called.\n */\n protected async preInitialize(): Promise<void> { }\n\n /**\n * Called the first time the data store is initialized (new creations with a new\n * data store runtime)\n *\n * @param props - Optional props to be passed in on create\n */\n protected async initializingFirstTime(props?: DataObjectType<I, \"InitialState\">): Promise<void> { }\n\n /**\n * Called every time but the first time the data store is initialized (creations\n * with an existing data store runtime)\n */\n protected async initializingFromExisting(): Promise<void> { }\n\n /**\n * Called every time the data store is initialized after create or existing.\n */\n protected async hasInitialized(): Promise<void> { }\n\n /**\n * Called when the host container closes and disposes itself\n */\n public dispose(): void {\n super.dispose();\n }\n}\n\n/**\n * @deprecated - This type is meant to ease the transition from the old PureDataObject type to the new.\n * please migrate to PureDataObject.\n *\n * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.\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 O - represents a type that will define optional providers that will be injected\n * @typeParam S - the initial state type that the produced data object may take during creation\n * @typeParam E - represents events that will be available in the EventForwarder\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport abstract class LegacyPureDataObject<O extends IFluidObject = object, S = undefined, E extends IEvent = IEvent>\nextends PureDataObject<{OptionalProviders: O, InitialState: S, Events: E}> {\n\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { FluidObject } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { AsyncFluidObjectProvider, FluidObjectKey } from "@fluidframework/synthesize";
|
|
7
|
+
import { IFluidDataStoreContext } from "@fluidframework/runtime-definitions";
|
|
8
|
+
import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
|
|
9
|
+
import { IEvent } from "@fluidframework/common-definitions";
|
|
10
|
+
/**
|
|
11
|
+
* This type is used as the base generic input to DataObject and PureDataObject.
|
|
12
|
+
*/
|
|
13
|
+
export interface DataObjectTypes {
|
|
14
|
+
/**
|
|
15
|
+
* represents a type that will define optional providers that will be injected
|
|
16
|
+
*/
|
|
17
|
+
OptionalProviders?: FluidObject;
|
|
18
|
+
/**
|
|
19
|
+
* the initial state type that the produced data object may take during creation
|
|
20
|
+
*/
|
|
21
|
+
InitialState?: any;
|
|
22
|
+
/**
|
|
23
|
+
* represents events that will be available in the EventForwarder
|
|
24
|
+
*/
|
|
25
|
+
Events?: IEvent;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @internal This utility type pulls a specific key's type off the T and returns that,
|
|
29
|
+
* or the default value if TKey is not specified by T
|
|
30
|
+
*/
|
|
31
|
+
export declare type DataObjectType<T extends DataObjectTypes, P extends keyof DataObjectTypes> = T[P] extends Required<DataObjectTypes>[P] ? T[P] : Required<DataObjectTypes>[P];
|
|
32
|
+
export interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {
|
|
33
|
+
readonly runtime: IFluidDataStoreRuntime;
|
|
34
|
+
readonly context: IFluidDataStoreContext;
|
|
35
|
+
readonly providers: AsyncFluidObjectProvider<FluidObjectKey<DataObjectType<I, "OptionalProviders">>, FluidObjectKey<object>>;
|
|
36
|
+
readonly initProps?: DataObjectType<I, "InitialState">;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data-objects/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,WAAW,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,oBAAY,cAAc,CAAC,CAAC,SAAS,eAAe,EAAE,CAAC,SAAS,MAAM,eAAe,IACjF,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpF,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IACzE,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,SAAS,EAEd,wBAAwB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7G,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;CAC1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/data-objects/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n FluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport { AsyncFluidObjectProvider, FluidObjectKey } from \"@fluidframework/synthesize\";\nimport { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { IEvent } from \"@fluidframework/common-definitions\";\n\n/**\n * This type is used as the base generic input to DataObject and PureDataObject.\n */\nexport interface DataObjectTypes {\n /**\n * represents a type that will define optional providers that will be injected\n */\n OptionalProviders?: FluidObject;\n /**\n * the initial state type that the produced data object may take during creation\n */\n InitialState?: any;\n /**\n * represents events that will be available in the EventForwarder\n */\n Events?: IEvent;\n}\n\n/**\n * @internal This utility type pulls a specific key's type off the T and returns that,\n * or the default value if TKey is not specified by T\n */\nexport type DataObjectType<T extends DataObjectTypes, P extends keyof DataObjectTypes> =\n T[P] extends Required<DataObjectTypes>[P] ? T[P] : Required<DataObjectTypes>[P];\n\nexport interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {\n readonly runtime: IFluidDataStoreRuntime;\n readonly context: IFluidDataStoreContext;\n readonly providers:\n // eslint-disable-next-line @typescript-eslint/ban-types\n AsyncFluidObjectProvider<FluidObjectKey<DataObjectType<I, \"OptionalProviders\">>, FluidObjectKey<object>>;\n readonly initProps?: DataObjectType<I, \"InitialState\">;\n}\n"]}
|
|
@@ -151,9 +151,14 @@
|
|
|
151
151
|
"signature": "766d8c595f94c9fe9dbb779b60d7a4d6d7a6526ef22090ccedbc658c2d8c77e0",
|
|
152
152
|
"affectsGlobalScope": false
|
|
153
153
|
},
|
|
154
|
+
"../../../../../node_modules/@fluidframework/core-interfaces/dist/provider.d.ts": {
|
|
155
|
+
"version": "bc7c554f306ede38ac8d2c79c8325320a596f8331c008032cc5fc87626d9c0b9",
|
|
156
|
+
"signature": "bc7c554f306ede38ac8d2c79c8325320a596f8331c008032cc5fc87626d9c0b9",
|
|
157
|
+
"affectsGlobalScope": false
|
|
158
|
+
},
|
|
154
159
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/handles.d.ts": {
|
|
155
|
-
"version": "
|
|
156
|
-
"signature": "
|
|
160
|
+
"version": "a2228831e5efcba6c26dfd52c63d279e88d626c72e58cbd9b0d08a34b267ebf2",
|
|
161
|
+
"signature": "a2228831e5efcba6c26dfd52c63d279e88d626c72e58cbd9b0d08a34b267ebf2",
|
|
157
162
|
"affectsGlobalScope": false
|
|
158
163
|
},
|
|
159
164
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts": {
|
|
@@ -176,11 +181,6 @@
|
|
|
176
181
|
"signature": "29af84fd868f666a8d2b0766b188faed869babeb3da5c556fc1151cc4e1e5153",
|
|
177
182
|
"affectsGlobalScope": false
|
|
178
183
|
},
|
|
179
|
-
"../../../../../node_modules/@fluidframework/core-interfaces/dist/provider.d.ts": {
|
|
180
|
-
"version": "bc7c554f306ede38ac8d2c79c8325320a596f8331c008032cc5fc87626d9c0b9",
|
|
181
|
-
"signature": "bc7c554f306ede38ac8d2c79c8325320a596f8331c008032cc5fc87626d9c0b9",
|
|
182
|
-
"affectsGlobalScope": false
|
|
183
|
-
},
|
|
184
184
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts": {
|
|
185
185
|
"version": "398cf7701e7ebd8094e625fff1ba84c2b97a23aefe2ea135f0b47df0a58cf465",
|
|
186
186
|
"signature": "398cf7701e7ebd8094e625fff1ba84c2b97a23aefe2ea135f0b47df0a58cf465",
|
|
@@ -512,8 +512,8 @@
|
|
|
512
512
|
"affectsGlobalScope": false
|
|
513
513
|
},
|
|
514
514
|
"../../../../../node_modules/@fluidframework/driver-definitions/dist/storage.d.ts": {
|
|
515
|
-
"version": "
|
|
516
|
-
"signature": "
|
|
515
|
+
"version": "1aa581496a5ac6df4808d36946ce5c5f63f7a5021d6eb329685e45c240b2f83b",
|
|
516
|
+
"signature": "1aa581496a5ac6df4808d36946ce5c5f63f7a5021d6eb329685e45c240b2f83b",
|
|
517
517
|
"affectsGlobalScope": false
|
|
518
518
|
},
|
|
519
519
|
"../../../../../node_modules/@fluidframework/driver-definitions/dist/index.d.ts": {
|
|
@@ -522,28 +522,28 @@
|
|
|
522
522
|
"affectsGlobalScope": false
|
|
523
523
|
},
|
|
524
524
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts": {
|
|
525
|
-
"version": "
|
|
526
|
-
"signature": "
|
|
525
|
+
"version": "c65f10bd0bcaf01a2f767b1abe286e915df770efcffca079ece5abc2bf806694",
|
|
526
|
+
"signature": "c65f10bd0bcaf01a2f767b1abe286e915df770efcffca079ece5abc2bf806694",
|
|
527
527
|
"affectsGlobalScope": false
|
|
528
528
|
},
|
|
529
529
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts": {
|
|
530
|
-
"version": "
|
|
531
|
-
"signature": "
|
|
530
|
+
"version": "e0cdfdeee27dbe35ece5e29a75ec4c96b2c4a748853e1acf6ae478683f48d515",
|
|
531
|
+
"signature": "e0cdfdeee27dbe35ece5e29a75ec4c96b2c4a748853e1acf6ae478683f48d515",
|
|
532
532
|
"affectsGlobalScope": false
|
|
533
533
|
},
|
|
534
534
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts": {
|
|
535
|
-
"version": "
|
|
536
|
-
"signature": "
|
|
535
|
+
"version": "fd64a9d2be496b6b5831ed862a5828906f4821f109a8bc7e5c20d340942a6c2a",
|
|
536
|
+
"signature": "fd64a9d2be496b6b5831ed862a5828906f4821f109a8bc7e5c20d340942a6c2a",
|
|
537
537
|
"affectsGlobalScope": false
|
|
538
538
|
},
|
|
539
539
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts": {
|
|
540
|
-
"version": "
|
|
541
|
-
"signature": "
|
|
540
|
+
"version": "f248f0c5f911121e948a5de556eba4d15bdcf2b1108a2606fa46df98972fc48b",
|
|
541
|
+
"signature": "f248f0c5f911121e948a5de556eba4d15bdcf2b1108a2606fa46df98972fc48b",
|
|
542
542
|
"affectsGlobalScope": false
|
|
543
543
|
},
|
|
544
544
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/runtime.d.ts": {
|
|
545
|
-
"version": "
|
|
546
|
-
"signature": "
|
|
545
|
+
"version": "aba46a553e4f5cbcdd1b8f9698522dac9478c8b94c6ce964cf0ad3bc74473d40",
|
|
546
|
+
"signature": "aba46a553e4f5cbcdd1b8f9698522dac9478c8b94c6ce964cf0ad3bc74473d40",
|
|
547
547
|
"affectsGlobalScope": false
|
|
548
548
|
},
|
|
549
549
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/chaincode.d.ts": {
|
|
@@ -551,14 +551,19 @@
|
|
|
551
551
|
"signature": "c2515bb517b70e8788066688ede46023ce10d4441aa38735f476b4a14eafbf72",
|
|
552
552
|
"affectsGlobalScope": false
|
|
553
553
|
},
|
|
554
|
+
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts": {
|
|
555
|
+
"version": "29af84fd868f666a8d2b0766b188faed869babeb3da5c556fc1151cc4e1e5153",
|
|
556
|
+
"signature": "29af84fd868f666a8d2b0766b188faed869babeb3da5c556fc1151cc4e1e5153",
|
|
557
|
+
"affectsGlobalScope": false
|
|
558
|
+
},
|
|
554
559
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/proxyLoader.d.ts": {
|
|
555
560
|
"version": "0ee40e5e446be73c62334a574d628dac014b292699bca2527d2abb99b8e31bf9",
|
|
556
561
|
"signature": "0ee40e5e446be73c62334a574d628dac014b292699bca2527d2abb99b8e31bf9",
|
|
557
562
|
"affectsGlobalScope": false
|
|
558
563
|
},
|
|
559
564
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/index.d.ts": {
|
|
560
|
-
"version": "
|
|
561
|
-
"signature": "
|
|
565
|
+
"version": "5364bdef891c277e6dc331de4b8e165051bea2f4281bdd70ee46bf58a7384ac8",
|
|
566
|
+
"signature": "5364bdef891c277e6dc331de4b8e165051bea2f4281bdd70ee46bf58a7384ac8",
|
|
562
567
|
"affectsGlobalScope": false
|
|
563
568
|
},
|
|
564
569
|
"../../../../runtime/runtime-definitions/dist/dataStoreRegistry.d.ts": {
|
|
@@ -577,8 +582,8 @@
|
|
|
577
582
|
"affectsGlobalScope": false
|
|
578
583
|
},
|
|
579
584
|
"../../../../runtime/runtime-definitions/dist/summary.d.ts": {
|
|
580
|
-
"version": "
|
|
581
|
-
"signature": "
|
|
585
|
+
"version": "858952f995ca3e0c7aac1018f41994eb6a82a05450ea880c7dd291fb6d46dfe2",
|
|
586
|
+
"signature": "858952f995ca3e0c7aac1018f41994eb6a82a05450ea880c7dd291fb6d46dfe2",
|
|
582
587
|
"affectsGlobalScope": false
|
|
583
588
|
},
|
|
584
589
|
"../../../../runtime/runtime-definitions/dist/dataStoreContext.d.ts": {
|
|
@@ -597,8 +602,8 @@
|
|
|
597
602
|
"affectsGlobalScope": false
|
|
598
603
|
},
|
|
599
604
|
"../../../../runtime/container-runtime-definitions/dist/containerRuntime.d.ts": {
|
|
600
|
-
"version": "
|
|
601
|
-
"signature": "
|
|
605
|
+
"version": "cdb9d3c0083999fe24831f5f26d59f3016599c32daed197f1b707bfc40abd8ab",
|
|
606
|
+
"signature": "cdb9d3c0083999fe24831f5f26d59f3016599c32daed197f1b707bfc40abd8ab",
|
|
602
607
|
"affectsGlobalScope": false
|
|
603
608
|
},
|
|
604
609
|
"../../../../runtime/container-runtime-definitions/dist/index.d.ts": {
|
|
@@ -612,8 +617,8 @@
|
|
|
612
617
|
"affectsGlobalScope": false
|
|
613
618
|
},
|
|
614
619
|
"../../../../runtime/runtime-utils/dist/dataStoreHelpers.d.ts": {
|
|
615
|
-
"version": "
|
|
616
|
-
"signature": "
|
|
620
|
+
"version": "27cb6598c6a871ea3fd18997ca98d1e22b449ee995645e7780aa490452100bb0",
|
|
621
|
+
"signature": "27cb6598c6a871ea3fd18997ca98d1e22b449ee995645e7780aa490452100bb0",
|
|
617
622
|
"affectsGlobalScope": false
|
|
618
623
|
},
|
|
619
624
|
"../../../../runtime/datastore-definitions/dist/storage.d.ts": {
|
|
@@ -622,8 +627,8 @@
|
|
|
622
627
|
"affectsGlobalScope": false
|
|
623
628
|
},
|
|
624
629
|
"../../../../runtime/datastore-definitions/dist/dataStoreRuntime.d.ts": {
|
|
625
|
-
"version": "
|
|
626
|
-
"signature": "
|
|
630
|
+
"version": "0c93aff251f89876dff554f17229ba2769cd1ca2791f89fe30259d3e0433c4f6",
|
|
631
|
+
"signature": "0c93aff251f89876dff554f17229ba2769cd1ca2791f89fe30259d3e0433c4f6",
|
|
627
632
|
"affectsGlobalScope": false
|
|
628
633
|
},
|
|
629
634
|
"../../../../runtime/datastore-definitions/dist/channel.d.ts": {
|
|
@@ -687,8 +692,8 @@
|
|
|
687
692
|
"affectsGlobalScope": false
|
|
688
693
|
},
|
|
689
694
|
"../../../../runtime/runtime-utils/dist/summarizerNode/summarizerNodeWithGc.d.ts": {
|
|
690
|
-
"version": "
|
|
691
|
-
"signature": "
|
|
695
|
+
"version": "66a44a7c28bcf3361f56cee242f0cb989a343bbf396f64d3065e71232042b110",
|
|
696
|
+
"signature": "66a44a7c28bcf3361f56cee242f0cb989a343bbf396f64d3065e71232042b110",
|
|
692
697
|
"affectsGlobalScope": false
|
|
693
698
|
},
|
|
694
699
|
"../../../../runtime/runtime-utils/dist/summarizerNode/index.d.ts": {
|
|
@@ -828,7 +833,11 @@
|
|
|
828
833
|
"../../../view-interfaces/dist/htmlView.d.ts",
|
|
829
834
|
"../../../view-interfaces/dist/mountableView.d.ts"
|
|
830
835
|
],
|
|
836
|
+
"../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts": [
|
|
837
|
+
"../../../../../node_modules/@fluidframework/common-definitions/dist/index.d.ts"
|
|
838
|
+
],
|
|
831
839
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts": [
|
|
840
|
+
"../../../../../node_modules/@fluidframework/container-definitions/dist/runtime.d.ts",
|
|
832
841
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
|
|
833
842
|
],
|
|
834
843
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/index.d.ts": [
|
|
@@ -837,6 +846,7 @@
|
|
|
837
846
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
|
|
838
847
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts",
|
|
839
848
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts",
|
|
849
|
+
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts",
|
|
840
850
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/chaincode.d.ts",
|
|
841
851
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts",
|
|
842
852
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/proxyLoader.d.ts",
|
|
@@ -856,6 +866,7 @@
|
|
|
856
866
|
],
|
|
857
867
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts": [
|
|
858
868
|
"../../../../../node_modules/@fluidframework/common-definitions/dist/index.d.ts",
|
|
869
|
+
"../../../../../node_modules/@fluidframework/container-definitions/dist/audience.d.ts",
|
|
859
870
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
|
|
860
871
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts",
|
|
861
872
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts",
|
|
@@ -897,7 +908,8 @@
|
|
|
897
908
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/handles.d.ts": [
|
|
898
909
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
|
|
899
910
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts",
|
|
900
|
-
"../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts"
|
|
911
|
+
"../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts",
|
|
912
|
+
"../../../../../node_modules/@fluidframework/core-interfaces/dist/provider.d.ts"
|
|
901
913
|
],
|
|
902
914
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts": [
|
|
903
915
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
|
|
@@ -1437,7 +1449,11 @@
|
|
|
1437
1449
|
"../../../view-interfaces/dist/htmlView.d.ts",
|
|
1438
1450
|
"../../../view-interfaces/dist/mountableView.d.ts"
|
|
1439
1451
|
],
|
|
1452
|
+
"../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts": [
|
|
1453
|
+
"../../../../../node_modules/@fluidframework/common-definitions/dist/index.d.ts"
|
|
1454
|
+
],
|
|
1440
1455
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts": [
|
|
1456
|
+
"../../../../../node_modules/@fluidframework/container-definitions/dist/runtime.d.ts",
|
|
1441
1457
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
|
|
1442
1458
|
],
|
|
1443
1459
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/index.d.ts": [
|
|
@@ -1446,6 +1462,7 @@
|
|
|
1446
1462
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
|
|
1447
1463
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts",
|
|
1448
1464
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts",
|
|
1465
|
+
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts",
|
|
1449
1466
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/chaincode.d.ts",
|
|
1450
1467
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts",
|
|
1451
1468
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/proxyLoader.d.ts",
|
|
@@ -1465,6 +1482,7 @@
|
|
|
1465
1482
|
],
|
|
1466
1483
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts": [
|
|
1467
1484
|
"../../../../../node_modules/@fluidframework/common-definitions/dist/index.d.ts",
|
|
1485
|
+
"../../../../../node_modules/@fluidframework/container-definitions/dist/audience.d.ts",
|
|
1468
1486
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
|
|
1469
1487
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts",
|
|
1470
1488
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts",
|
|
@@ -1506,7 +1524,8 @@
|
|
|
1506
1524
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/handles.d.ts": [
|
|
1507
1525
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
|
|
1508
1526
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts",
|
|
1509
|
-
"../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts"
|
|
1527
|
+
"../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidRouter.d.ts",
|
|
1528
|
+
"../../../../../node_modules/@fluidframework/core-interfaces/dist/provider.d.ts"
|
|
1510
1529
|
],
|
|
1511
1530
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts": [
|
|
1512
1531
|
"../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts",
|
|
@@ -2013,6 +2032,7 @@
|
|
|
2013
2032
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts",
|
|
2014
2033
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts",
|
|
2015
2034
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts",
|
|
2035
|
+
"../../../../../node_modules/@fluidframework/container-definitions/dist/fluidPackage.d.ts",
|
|
2016
2036
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/index.d.ts",
|
|
2017
2037
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/chaincode.d.ts",
|
|
2018
2038
|
"../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts",
|
|
@@ -11,9 +11,7 @@ import { PureDataObjectFactory } from "./pureDataObjectFactory";
|
|
|
11
11
|
* ensuring relevant shared objects etc are available to the factory.
|
|
12
12
|
*
|
|
13
13
|
* @typeParam TObj - DataObject (concrete type)
|
|
14
|
-
* @typeParam
|
|
15
|
-
* @typeParam S - the initial state type that the produced data object may take during creation
|
|
16
|
-
* @typeParam E - represents events that will be available in the EventForwarder
|
|
14
|
+
* @typeParam I - The input types for the DataObject
|
|
17
15
|
*/
|
|
18
16
|
export class DataObjectFactory extends PureDataObjectFactory {
|
|
19
17
|
constructor(type, ctor, sharedObjects = [], optionalProviders, registryEntries, runtimeFactory = FluidDataStoreRuntime) {
|
|
@@ -30,4 +28,19 @@ export class DataObjectFactory extends PureDataObjectFactory {
|
|
|
30
28
|
super(type, ctor, mergedObjects, optionalProviders, registryEntries, runtimeFactory);
|
|
31
29
|
}
|
|
32
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated - This type is meant to ease the transition from the old PureDataObjectFactory type to the new.
|
|
33
|
+
* please migrate to PureDataObjectFactory.
|
|
34
|
+
*
|
|
35
|
+
* DataObjectFactory is the IFluidDataStoreFactory for use with DataObjects.
|
|
36
|
+
* It facilitates DataObject's features (such as its shared directory) by
|
|
37
|
+
* ensuring relevant shared objects etc are available to the factory.
|
|
38
|
+
*
|
|
39
|
+
* @typeParam TObj - DataObject (concrete type)
|
|
40
|
+
* @typeParam O - represents a type that will define optional providers that will be injected
|
|
41
|
+
* @typeParam S - the initial state type that the produced data object may take during creation
|
|
42
|
+
* @typeParam E - represents events that will be available in the EventForwarder
|
|
43
|
+
*/
|
|
44
|
+
export class LegacyDataObjectFactory extends DataObjectFactory {
|
|
45
|
+
}
|
|
33
46
|
//# sourceMappingURL=dataObjectFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,SAAS,GACZ,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"dataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,SAAS,GACZ,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIlE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,OAAO,iBACT,SAAQ,qBAA8B;IAEtC,YACI,IAAY,EACZ,IAA8C,EAC9C,gBAA4C,EAAE,EAC9C,iBAAoF,EACpF,eAAoD,EACpD,iBAA+C,qBAAqB;QAEpE,MAAM,aAAa,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC;QAEzC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,gBAAgB,CAAC,IAAI,CAAC,EAAE;YAC1E,sCAAsC;YACtC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC,CAAC;SACpD;QAED,0GAA0G;QAC1G,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,EAAE;YACpE,gCAAgC;YAChC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;SAC9C;QAED,KAAK,CACD,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,cAAc,CACjB,CAAC;IACN,CAAC;CACJ;AAED;;;;;;;;;;;;GAYG;AACF,MAAM,OAAO,uBACb,SAAQ,iBAA2E;CAAG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n DirectoryFactory,\n MapFactory,\n SharedDirectory,\n SharedMap,\n} from \"@fluidframework/map\";\nimport {\n NamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\nimport { IChannelFactory } from \"@fluidframework/datastore-definitions\";\nimport { FluidObjectSymbolProvider } from \"@fluidframework/synthesize\";\nimport { FluidDataStoreRuntime } from \"@fluidframework/datastore\";\n\nimport { IEvent } from \"@fluidframework/common-definitions\";\nimport { DataObject, DataObjectTypes, DataObjectType, IDataObjectProps, LegacyDataObject } from \"../data-objects\";\nimport { PureDataObjectFactory } from \"./pureDataObjectFactory\";\n\n/**\n * DataObjectFactory is the IFluidDataStoreFactory for use with DataObjects.\n * It facilitates DataObject's features (such as its shared directory) by\n * ensuring relevant shared objects etc are available to the factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n */\nexport class DataObjectFactory<TObj extends DataObject<I>, I extends DataObjectTypes = DataObjectTypes>\n extends PureDataObjectFactory<TObj, I>\n{\n constructor(\n type: string,\n ctor: new (props: IDataObjectProps<I>) => TObj,\n sharedObjects: readonly IChannelFactory[] = [],\n optionalProviders: FluidObjectSymbolProvider<DataObjectType<I, \"OptionalProviders\">>,\n registryEntries?: NamedFluidDataStoreRegistryEntries,\n runtimeFactory: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n ) {\n const mergedObjects = [...sharedObjects];\n\n if (!sharedObjects.find((factory) => factory.type === DirectoryFactory.Type)) {\n // User did not register for directory\n mergedObjects.push(SharedDirectory.getFactory());\n }\n\n // TODO: Remove SharedMap factory when compatibility with SharedMap DataObject is no longer needed in 0.10\n if (!sharedObjects.find((factory) => factory.type === MapFactory.Type)) {\n // User did not register for map\n mergedObjects.push(SharedMap.getFactory());\n }\n\n super(\n type,\n ctor,\n mergedObjects,\n optionalProviders,\n registryEntries,\n runtimeFactory,\n );\n }\n}\n\n/**\n * @deprecated - This type is meant to ease the transition from the old PureDataObjectFactory type to the new.\n * please migrate to PureDataObjectFactory.\n *\n * DataObjectFactory is the IFluidDataStoreFactory for use with DataObjects.\n * It facilitates DataObject's features (such as its shared directory) by\n * ensuring relevant shared objects etc are available to the factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam O - represents a type that will define optional providers that will be injected\n * @typeParam S - the initial state type that the produced data object may take during creation\n * @typeParam E - represents events that will be available in the EventForwarder\n */\n export class LegacyDataObjectFactory<TObj extends LegacyDataObject<O, S, E>, O, S, E extends IEvent = IEvent>\n extends DataObjectFactory<TObj, {OptionalProviders: O, InitialState: S, Events: E}> {}\n"]}
|
|
@@ -47,9 +47,7 @@ async function createDataObject(ctor, context, sharedObjectRegistry, optionalPro
|
|
|
47
47
|
* another base data store factory.
|
|
48
48
|
*
|
|
49
49
|
* @typeParam TObj - DataObject (concrete type)
|
|
50
|
-
* @typeParam
|
|
51
|
-
* @typeParam S - the initial state type that the produced data object may take during creation
|
|
52
|
-
* @typeParam E - represents events that will be available in the EventForwarder
|
|
50
|
+
* @typeParam I - The input types for the DataObject
|
|
53
51
|
*/
|
|
54
52
|
export class PureDataObjectFactory {
|
|
55
53
|
constructor(type, ctor, sharedObjects, optionalProviders, registryEntries, runtimeClass = FluidDataStoreRuntime) {
|
|
@@ -152,4 +150,19 @@ export class PureDataObjectFactory {
|
|
|
152
150
|
return instance;
|
|
153
151
|
}
|
|
154
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* @deprecated - This type is meant to ease the transition from the old PureDataObjectFactory type to the new.
|
|
155
|
+
* please migrate to PureDataObjectFactory.
|
|
156
|
+
*
|
|
157
|
+
* PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.
|
|
158
|
+
* Consumers should typically use DataObjectFactory instead unless creating
|
|
159
|
+
* another base data store factory.
|
|
160
|
+
*
|
|
161
|
+
* @typeParam TObj - DataObject (concrete type)
|
|
162
|
+
* @typeParam O - represents a type that will define optional providers that will be injected
|
|
163
|
+
* @typeParam S - the initial state type that the produced data object may take during creation
|
|
164
|
+
* @typeParam E - represents events that will be available in the EventForwarder
|
|
165
|
+
*/
|
|
166
|
+
export class LegacyPureDataObjectFactory extends PureDataObjectFactory {
|
|
167
|
+
}
|
|
155
168
|
//# sourceMappingURL=pureDataObjectFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,qBAAqB,EAErB,mBAAmB,GACrB,MAAM,2BAA2B,CAAC;AAEpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAa3E,OAAO,EAEH,mBAAmB,GAEtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAEH,cAAc,GACjB,MAAM,iB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,OAAO,EACP,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,YAAY,EACjB,KAAK,EAAE,WAAW;QAClB,YAAY,CAAC,CAAC;QAElB,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IFluidRouter, FluidObject } from \"@fluidframework/core-interfaces\";\nimport {\n FluidDataStoreRuntime,\n ISharedObjectRegistry,\n mixinRequestHandler,\n } from \"@fluidframework/datastore\";\nimport { IEvent } from \"@fluidframework/common-definitions\";\nimport { FluidDataStoreRegistry } from \"@fluidframework/container-runtime\";\nimport {\n IFluidDataStoreContext,\n IContainerRuntimeBase,\n IFluidDataStoreFactory,\n IFluidDataStoreRegistry,\n IProvideFluidDataStoreRegistry,\n NamedFluidDataStoreRegistryEntries,\n NamedFluidDataStoreRegistryEntry,\n IFluidDataStoreContextDetached,\n} from \"@fluidframework/runtime-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IChannelFactory } from \"@fluidframework/datastore-definitions\";\nimport {\n FluidObjectSymbolProvider,\n DependencyContainer,\n IFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\n\nimport {\n IDataObjectProps,\n PureDataObject,\n} from \"../data-objects\";\n\n/*\n * Useful interface in places where it's useful to do type erasure for PureDataObject generic\n */\nexport interface IRootDataObjectFactory extends IFluidDataStoreFactory {\n createRootInstance(\n rootDataStoreId: string,\n runtime: IContainerRuntime): Promise<IFluidRouter>;\n}\n\n/**\n * Proxy over PureDataObject\n * Does delayed creation & initialization of PureDataObject\n*/\nasync function createDataObject<TObj extends PureDataObject<O, S, E>, O, S, E extends IEvent = IEvent>(\n ctor: new (props: IDataObjectProps<O, S>) => TObj,\n context: IFluidDataStoreContext,\n sharedObjectRegistry: ISharedObjectRegistry,\n optionalProviders: FluidObjectSymbolProvider<O>,\n runtimeClassArg: typeof FluidDataStoreRuntime,\n existing: boolean,\n initProps?: S)\n{\n // base\n let runtimeClass = runtimeClassArg;\n\n // request mixin in\n runtimeClass = mixinRequestHandler(\n async (request: IRequest, runtimeArg: FluidDataStoreRuntime) =>\n (await PureDataObject.getDataObject(runtimeArg)).request(request),\n runtimeClass);\n\n // Create a new runtime for our data store\n // The runtime is what Fluid uses to create DDS' and route to your data store\n const runtime = new runtimeClass(\n context,\n sharedObjectRegistry,\n existing,\n );\n\n // Create object right away.\n // This allows object to register various callbacks with runtime before runtime\n // becomes globally available. But it's not full initialization - constructor can't\n // access DDSs or other services of runtime as objects are not fully initialized.\n // In order to use object, we need to go through full initialization by calling finishInitialization().\n const scope: FluidObject<IFluidDependencySynthesizer> = context.scope;\n const dependencyContainer = new DependencyContainer(scope.IFluidDependencySynthesizer);\n const providers = dependencyContainer.synthesize<O>(optionalProviders, {});\n const instance = new ctor({ runtime, context, providers, initProps });\n\n // if it's a newly created object, we need to wait for it to finish initialization\n // as that results in creation of DDSs, before it gets attached, providing atomic\n // guarantee of creation.\n // WARNING: we can't do the same (yet) for already existing PureDataObject!\n // This will result in deadlock, as it tries to resolve internal handles, but any\n // handle resolution goes through root (container runtime), which can't route it back\n // to this data store, as it's still not initialized and not known to container runtime yet.\n // In the future, we should address it by using relative paths for handles and be able to resolve\n // local DDSs while data store is not fully initialized.\n if (!existing) {\n await instance.finishInitialization(existing);\n }\n\n return { instance, runtime };\n}\n\n/**\n * PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.\n * Consumers should typically use DataObjectFactory instead unless creating\n * another base data store factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam O - represents a type that will define optional providers that will be injected\n * @typeParam S - the initial state type that the produced data object may take during creation\n * @typeParam E - represents events that will be available in the EventForwarder\n */\nexport class PureDataObjectFactory<TObj extends PureDataObject<O, S, E>, O, S, E extends IEvent = IEvent>\n implements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry>, IRootDataObjectFactory\n{\n private readonly sharedObjectRegistry: ISharedObjectRegistry;\n private readonly registry: IFluidDataStoreRegistry | undefined;\n\n constructor(\n public readonly type: string,\n private readonly ctor: new (props: IDataObjectProps<O, S>) => TObj,\n sharedObjects: readonly IChannelFactory[],\n private readonly optionalProviders: FluidObjectSymbolProvider<O>,\n registryEntries?: NamedFluidDataStoreRegistryEntries,\n private readonly runtimeClass: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n ) {\n if (this.type === \"\") {\n throw new Error(\"undefined type member\");\n }\n if (registryEntries !== undefined) {\n this.registry = new FluidDataStoreRegistry(registryEntries);\n }\n this.sharedObjectRegistry = new Map(sharedObjects.map((ext) => [ext.type, ext]));\n }\n\n public get IFluidDataStoreFactory() { return this; }\n\n public get IFluidDataStoreRegistry() {\n return this.registry;\n }\n\n /**\n * Convenience helper to get the data store's/factory's data store registry entry.\n * The return type hides the factory's generics, easing grouping of registry\n * entries that differ only in this way into the same array.\n * @returns The NamedFluidDataStoreRegistryEntry\n */\n public get registryEntry(): NamedFluidDataStoreRegistryEntry {\n return [this.type, Promise.resolve(this)];\n }\n\n /**\n * This is where we do data store setup.\n *\n * @param context - data store context used to load a data store runtime\n */\n public async instantiateDataStore(context: IFluidDataStoreContext, existing: boolean) {\n const { runtime } = await createDataObject(\n this.ctor,\n context,\n this.sharedObjectRegistry,\n this.optionalProviders,\n this.runtimeClass,\n existing);\n\n return runtime;\n }\n\n /**\n * Creates a new instance of the object. Uses parent context's registry to build package path to this factory.\n * In other words, registry of context passed in has to contain this factory, with the name that matches\n * this factory's type.\n * It is intended to be used by data store objects that create sub-objects.\n * @param context - The context being used to create the runtime\n * (the created object will have its own new context created as well)\n * @param initialState - The initial state to provide to the created data store.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createChildInstance(\n parentContext: IFluidDataStoreContext,\n initialState?: S,\n ): Promise<TObj> {\n return this.createNonRootInstanceCore(\n parentContext.containerRuntime,\n [...parentContext.packagePath, this.type],\n initialState);\n }\n\n /**\n * Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory.\n * In other words, registry of context passed in has to have this factory.\n * Intended to be used by data store objects that need to create peers (similar) instances of existing objects.\n * @param context - The component context being used to create the object\n * (the created object will have its own new context created as well)\n * @param initialState - The initial state to provide to the created component.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createPeerInstance(\n peerContext: IFluidDataStoreContext,\n initialState?: S,\n ): Promise<TObj> {\n return this.createNonRootInstanceCore(\n peerContext.containerRuntime,\n peerContext.packagePath,\n initialState);\n }\n\n /**\n * Creates a new instance of the object. Uses container's registry to find this factory.\n * It's expected that only container owners would use this functionality, as only such developers\n * have knowledge of entries in container registry.\n * The name in this registry for such record should match type of this factory.\n * @param runtime - container runtime. It's registry is used to create an object.\n * @param initialState - The initial state to provide to the created component.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createInstance(\n runtime: IContainerRuntimeBase,\n initialState?: S,\n ): Promise<TObj> {\n return this.createNonRootInstanceCore(\n runtime,\n [this.type],\n initialState);\n }\n\n /**\n * Creates a new root instance of the object. Uses container's registry to find this factory.\n * It's expected that only container owners would use this functionality, as only such developers\n * have knowledge of entries in container registry.\n * The name in this registry for such record should match type of this factory.\n * @param runtime - container runtime. It's registry is used to create an object.\n * @param initialState - The initial state to provide to the created component.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createRootInstance(\n rootDataStoreId: string,\n runtime: IContainerRuntime,\n initialState?: S,\n ): Promise<TObj> {\n const context = runtime.createDetachedRootDataStore([this.type], rootDataStoreId);\n return this.createInstanceCore(context, initialState);\n }\n\n protected async createNonRootInstanceCore(\n containerRuntime: IContainerRuntimeBase,\n packagePath: Readonly<string[]>,\n initialState?: S,\n ): Promise<TObj> {\n const context = containerRuntime.createDetachedDataStore(packagePath);\n return this.createInstanceCore(context, initialState);\n }\n\n protected async createInstanceCore(\n context: IFluidDataStoreContextDetached,\n initialState?: S,\n ): Promise<TObj> {\n const { instance, runtime } = await createDataObject(\n this.ctor,\n context,\n this.sharedObjectRegistry,\n this.optionalProviders,\n this.runtimeClass,\n false, // existing\n initialState);\n\n await context.attachRuntime(this, runtime);\n\n return instance;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,qBAAqB,EAErB,mBAAmB,GACrB,MAAM,2BAA2B,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAa3E,OAAO,EAEH,mBAAmB,GAEtB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAEH,cAAc,GAIjB,MAAM,iBAAiB,CAAC;AAUzB;;;EAGE;AACF,KAAK,UAAU,gBAAgB,CAC3B,IAA8C,EAC9C,OAA+B,EAC/B,oBAA2C,EAC3C,iBAAoF,EACpF,eAA6C,EAC7C,QAAiB,EACjB,SAA6C;IAE7C,OAAO;IACP,IAAI,YAAY,GAAG,eAAe,CAAC;IAEnC,mBAAmB;IACnB,YAAY,GAAG,mBAAmB,CAC9B,KAAK,EAAE,OAAiB,EAAE,UAAiC,EAAE,EAAE,CAC3D,CAAC,MAAM,cAAc,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EACjE,YAAY,CAAC,CAAC;IAEtB,0CAA0C;IAC1C,6EAA6E;IAC7E,MAAM,OAAO,GAAG,IAAI,YAAY,CAC5B,OAAO,EACP,oBAAoB,EACpB,QAAQ,CACX,CAAC;IAEF,4BAA4B;IAC5B,+EAA+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EACX,YAAY,CAAC,CAAC;IACtB,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,kBAAkB,CAC3B,eAAuB,EACvB,OAA0B,EAC1B,YAAgD;QAEhD,MAAM,OAAO,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC,CAAC;QAClF,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC1D,CAAC;IAES,KAAK,CAAC,yBAAyB,CACrC,gBAAuC,EACvC,WAA+B,EAC/B,YAAgD;QAEhD,MAAM,OAAO,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;QACtE,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC1D,CAAC;IAES,KAAK,CAAC,kBAAkB,CAC9B,OAAuC,EACvC,YAAgD;QAEhD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,gBAAgB,CAChD,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,YAAY,EACjB,KAAK,EAAE,WAAW;QAClB,YAAY,CAAC,CAAC;QAElB,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ;AAED;;;;;;;;;;;;GAYG;AACF,MAAM,OAAO,2BACb,SAAQ,qBAA8E;CAAG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IFluidRouter, FluidObject } from \"@fluidframework/core-interfaces\";\nimport {\n FluidDataStoreRuntime,\n ISharedObjectRegistry,\n mixinRequestHandler,\n } from \"@fluidframework/datastore\";\nimport { FluidDataStoreRegistry } from \"@fluidframework/container-runtime\";\nimport {\n IFluidDataStoreContext,\n IContainerRuntimeBase,\n IFluidDataStoreFactory,\n IFluidDataStoreRegistry,\n IProvideFluidDataStoreRegistry,\n NamedFluidDataStoreRegistryEntries,\n NamedFluidDataStoreRegistryEntry,\n IFluidDataStoreContextDetached,\n} from \"@fluidframework/runtime-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IChannelFactory } from \"@fluidframework/datastore-definitions\";\nimport {\n FluidObjectSymbolProvider,\n DependencyContainer,\n IFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\n\nimport { IEvent } from \"@fluidframework/common-definitions\";\nimport {\n IDataObjectProps,\n PureDataObject,\n DataObjectType,\n DataObjectTypes,\n LegacyPureDataObject,\n} from \"../data-objects\";\n/*\n * Useful interface in places where it's useful to do type erasure for PureDataObject generic\n */\nexport interface IRootDataObjectFactory extends IFluidDataStoreFactory {\n createRootInstance(\n rootDataStoreId: string,\n runtime: IContainerRuntime): Promise<IFluidRouter>;\n}\n\n/**\n * Proxy over PureDataObject\n * Does delayed creation & initialization of PureDataObject\n*/\nasync function createDataObject<TObj extends PureDataObject,I extends DataObjectTypes = DataObjectTypes>(\n ctor: new (props: IDataObjectProps<I>) => TObj,\n context: IFluidDataStoreContext,\n sharedObjectRegistry: ISharedObjectRegistry,\n optionalProviders: FluidObjectSymbolProvider<DataObjectType<I, \"OptionalProviders\">>,\n runtimeClassArg: typeof FluidDataStoreRuntime,\n existing: boolean,\n initProps?: DataObjectType<I, \"InitialState\">)\n{\n // base\n let runtimeClass = runtimeClassArg;\n\n // request mixin in\n runtimeClass = mixinRequestHandler(\n async (request: IRequest, runtimeArg: FluidDataStoreRuntime) =>\n (await PureDataObject.getDataObject(runtimeArg)).request(request),\n runtimeClass);\n\n // Create a new runtime for our data store\n // The runtime is what Fluid uses to create DDS' and route to your data store\n const runtime = new runtimeClass(\n context,\n sharedObjectRegistry,\n existing,\n );\n\n // Create object right away.\n // This allows object to register various callbacks with runtime before runtime\n // becomes globally available. But it's not full initialization - constructor can't\n // access DDSs or other services of runtime as objects are not fully initialized.\n // In order to use object, we need to go through full initialization by calling finishInitialization().\n const scope: FluidObject<IFluidDependencySynthesizer> = context.scope;\n const dependencyContainer = new DependencyContainer(scope.IFluidDependencySynthesizer);\n const providers = dependencyContainer.synthesize<DataObjectType<I, \"OptionalProviders\">>(optionalProviders, {});\n const instance = new ctor({ runtime, context, providers, initProps });\n\n // if it's a newly created object, we need to wait for it to finish initialization\n // as that results in creation of DDSs, before it gets attached, providing atomic\n // guarantee of creation.\n // WARNING: we can't do the same (yet) for already existing PureDataObject!\n // This will result in deadlock, as it tries to resolve internal handles, but any\n // handle resolution goes through root (container runtime), which can't route it back\n // to this data store, as it's still not initialized and not known to container runtime yet.\n // In the future, we should address it by using relative paths for handles and be able to resolve\n // local DDSs while data store is not fully initialized.\n if (!existing) {\n await instance.finishInitialization(existing);\n }\n\n return { instance, runtime };\n}\n\n/**\n * PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.\n * Consumers should typically use DataObjectFactory instead unless creating\n * another base data store factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n */\nexport class PureDataObjectFactory<TObj extends PureDataObject<I>, I extends DataObjectTypes = DataObjectTypes>\n implements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry>, IRootDataObjectFactory\n{\n private readonly sharedObjectRegistry: ISharedObjectRegistry;\n private readonly registry: IFluidDataStoreRegistry | undefined;\n\n constructor(\n public readonly type: string,\n private readonly ctor: new (props: IDataObjectProps<I>) => TObj,\n sharedObjects: readonly IChannelFactory[],\n private readonly optionalProviders: FluidObjectSymbolProvider<DataObjectType<I, \"OptionalProviders\">>,\n registryEntries?: NamedFluidDataStoreRegistryEntries,\n private readonly runtimeClass: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n ) {\n if (this.type === \"\") {\n throw new Error(\"undefined type member\");\n }\n if (registryEntries !== undefined) {\n this.registry = new FluidDataStoreRegistry(registryEntries);\n }\n this.sharedObjectRegistry = new Map(sharedObjects.map((ext) => [ext.type, ext]));\n }\n\n public get IFluidDataStoreFactory() { return this; }\n\n public get IFluidDataStoreRegistry() {\n return this.registry;\n }\n\n /**\n * Convenience helper to get the data store's/factory's data store registry entry.\n * The return type hides the factory's generics, easing grouping of registry\n * entries that differ only in this way into the same array.\n * @returns The NamedFluidDataStoreRegistryEntry\n */\n public get registryEntry(): NamedFluidDataStoreRegistryEntry {\n return [this.type, Promise.resolve(this)];\n }\n\n /**\n * This is where we do data store setup.\n *\n * @param context - data store context used to load a data store runtime\n */\n public async instantiateDataStore(context: IFluidDataStoreContext, existing: boolean) {\n const { runtime } = await createDataObject(\n this.ctor,\n context,\n this.sharedObjectRegistry,\n this.optionalProviders,\n this.runtimeClass,\n existing);\n\n return runtime;\n }\n\n /**\n * Creates a new instance of the object. Uses parent context's registry to build package path to this factory.\n * In other words, registry of context passed in has to contain this factory, with the name that matches\n * this factory's type.\n * It is intended to be used by data store objects that create sub-objects.\n * @param context - The context being used to create the runtime\n * (the created object will have its own new context created as well)\n * @param initialState - The initial state to provide to the created data store.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createChildInstance(\n parentContext: IFluidDataStoreContext,\n initialState?: DataObjectType<I, \"InitialState\">,\n ): Promise<TObj> {\n return this.createNonRootInstanceCore(\n parentContext.containerRuntime,\n [...parentContext.packagePath, this.type],\n initialState);\n }\n\n /**\n * Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory.\n * In other words, registry of context passed in has to have this factory.\n * Intended to be used by data store objects that need to create peers (similar) instances of existing objects.\n * @param context - The component context being used to create the object\n * (the created object will have its own new context created as well)\n * @param initialState - The initial state to provide to the created component.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createPeerInstance(\n peerContext: IFluidDataStoreContext,\n initialState?: DataObjectType<I, \"InitialState\">,\n ): Promise<TObj> {\n return this.createNonRootInstanceCore(\n peerContext.containerRuntime,\n peerContext.packagePath,\n initialState);\n }\n\n /**\n * Creates a new instance of the object. Uses container's registry to find this factory.\n * It's expected that only container owners would use this functionality, as only such developers\n * have knowledge of entries in container registry.\n * The name in this registry for such record should match type of this factory.\n * @param runtime - container runtime. It's registry is used to create an object.\n * @param initialState - The initial state to provide to the created component.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createInstance(\n runtime: IContainerRuntimeBase,\n initialState?: DataObjectType<I, \"InitialState\">,\n ): Promise<TObj> {\n return this.createNonRootInstanceCore(\n runtime,\n [this.type],\n initialState);\n }\n\n /**\n * Creates a new root instance of the object. Uses container's registry to find this factory.\n * It's expected that only container owners would use this functionality, as only such developers\n * have knowledge of entries in container registry.\n * The name in this registry for such record should match type of this factory.\n * @param runtime - container runtime. It's registry is used to create an object.\n * @param initialState - The initial state to provide to the created component.\n * @returns an object created by this factory. Data store and objects created are not attached to container.\n * They get attached only when a handle to one of them is attached to already attached objects.\n */\n public async createRootInstance(\n rootDataStoreId: string,\n runtime: IContainerRuntime,\n initialState?: DataObjectType<I, \"InitialState\">,\n ): Promise<TObj> {\n const context = runtime.createDetachedRootDataStore([this.type], rootDataStoreId);\n return this.createInstanceCore(context, initialState);\n }\n\n protected async createNonRootInstanceCore(\n containerRuntime: IContainerRuntimeBase,\n packagePath: Readonly<string[]>,\n initialState?: DataObjectType<I, \"InitialState\">,\n ): Promise<TObj> {\n const context = containerRuntime.createDetachedDataStore(packagePath);\n return this.createInstanceCore(context, initialState);\n }\n\n protected async createInstanceCore(\n context: IFluidDataStoreContextDetached,\n initialState?: DataObjectType<I, \"InitialState\">,\n ): Promise<TObj> {\n const { instance, runtime } = await createDataObject(\n this.ctor,\n context,\n this.sharedObjectRegistry,\n this.optionalProviders,\n this.runtimeClass,\n false, // existing\n initialState);\n\n await context.attachRuntime(this, runtime);\n\n return instance;\n }\n}\n\n/**\n * @deprecated - This type is meant to ease the transition from the old PureDataObjectFactory type to the new.\n * please migrate to PureDataObjectFactory.\n *\n * PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.\n * Consumers should typically use DataObjectFactory instead unless creating\n * another base data store factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam O - represents a type that will define optional providers that will be injected\n * @typeParam S - the initial state type that the produced data object may take during creation\n * @typeParam E - represents events that will be available in the EventForwarder\n */\n export class LegacyPureDataObjectFactory<TObj extends LegacyPureDataObject<O, S, E>, O, S, E extends IEvent = IEvent>\n extends PureDataObjectFactory<TObj,{OptionalProviders: O, InitialState: S, Events: E}> {}\n"]}
|