@fluidframework/aqueduct 0.54.0-47413 → 0.55.0-48551

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.
Files changed (44) hide show
  1. package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts +3 -3
  2. package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -1
  3. package/dist/container-runtime-factories/baseContainerRuntimeFactory.js +4 -8
  4. package/dist/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
  5. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +2 -2
  6. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
  7. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +3 -5
  8. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  9. package/dist/data-object-factories/dataObjectFactory.d.ts +1 -21
  10. package/dist/data-object-factories/dataObjectFactory.d.ts.map +1 -1
  11. package/dist/data-object-factories/dataObjectFactory.js +1 -17
  12. package/dist/data-object-factories/dataObjectFactory.js.map +1 -1
  13. package/dist/data-object-factories/pureDataObjectFactory.d.ts +1 -21
  14. package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
  15. package/dist/data-object-factories/pureDataObjectFactory.js +1 -17
  16. package/dist/data-object-factories/pureDataObjectFactory.js.map +1 -1
  17. package/dist/data-objects/dataObject.d.ts +1 -23
  18. package/dist/data-objects/dataObject.d.ts.map +1 -1
  19. package/dist/data-objects/dataObject.js +1 -20
  20. package/dist/data-objects/dataObject.js.map +1 -1
  21. package/dist/data-objects/index.d.ts +2 -2
  22. package/dist/data-objects/index.d.ts.map +1 -1
  23. package/dist/data-objects/index.js +1 -3
  24. package/dist/data-objects/index.js.map +1 -1
  25. package/dist/data-objects/pureDataObject.d.ts +1 -20
  26. package/dist/data-objects/pureDataObject.d.ts.map +1 -1
  27. package/dist/data-objects/pureDataObject.js +2 -18
  28. package/dist/data-objects/pureDataObject.js.map +1 -1
  29. package/dist/test/tsconfig.tsbuildinfo +20 -36
  30. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js +5 -9
  31. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
  32. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +3 -5
  33. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  34. package/lib/data-object-factories/dataObjectFactory.js +0 -15
  35. package/lib/data-object-factories/dataObjectFactory.js.map +1 -1
  36. package/lib/data-object-factories/pureDataObjectFactory.js +0 -15
  37. package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -1
  38. package/lib/data-objects/dataObject.js +0 -18
  39. package/lib/data-objects/dataObject.js.map +1 -1
  40. package/lib/data-objects/index.js +2 -2
  41. package/lib/data-objects/index.js.map +1 -1
  42. package/lib/data-objects/pureDataObject.js +1 -16
  43. package/lib/data-objects/pureDataObject.js.map +1 -1
  44. package/package.json +24 -23
@@ -8,7 +8,6 @@ import { IFluidDataStoreContext } from "@fluidframework/runtime-definitions";
8
8
  import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
9
9
  import { IDirectory } from "@fluidframework/map";
10
10
  import { EventForwarder } from "@fluidframework/common-utils";
11
- import { IEvent } from "@fluidframework/common-definitions";
12
11
  import { DataObjectTypes, DataObjectType, IDataObjectProps } from "./types";
13
12
  /**
14
13
  * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.
@@ -73,7 +72,7 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
73
72
  */
74
73
  initializeInternal(existing: boolean): Promise<void>;
75
74
  /**
76
- * Retreive Fluid object using the handle get or the older requestFluidObject_UNSAFE call to fetch by ID
75
+ * Retrieve Fluid object using the handle get or the older requestFluidObject_UNSAFE call to fetch by ID
77
76
  *
78
77
  * @param key - key that object (handle/id) is stored with in the directory
79
78
  * @param directory - directory containing the object
@@ -118,22 +117,4 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
118
117
  */
119
118
  dispose(): void;
120
119
  }
121
- /**
122
- * @deprecated - This type is meant to ease the transition from the old PureDataObject type to the new.
123
- * please migrate to PureDataObject.
124
- *
125
- * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.
126
- * You probably don't want to inherit from this data store directly unless
127
- * you are creating another base data store class
128
- *
129
- * @typeParam O - represents a type that will define optional providers that will be injected
130
- * @typeParam S - the initial state type that the produced data object may take during creation
131
- * @typeParam E - represents events that will be available in the EventForwarder
132
- */
133
- export declare abstract class LegacyPureDataObject<O extends IFluidObject = object, S = undefined, E extends IEvent = IEvent> extends PureDataObject<{
134
- OptionalProviders: O;
135
- InitialState: S;
136
- Events: E;
137
- }> {
138
- }
139
120
  //# sourceMappingURL=pureDataObject.d.ts.map
@@ -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;AAEtE,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE5E;;;;;;GAMG;AACH,8BAAsB,cAAc,CAAC,CAA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F;;;OAGG;cACa,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAEzD;;OAEG;cACa,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAE/C;;OAEG;IACI,OAAO,IAAI,IAAI;CAGzB"}
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.LegacyPureDataObject = exports.PureDataObject = void 0;
7
+ 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");
@@ -99,7 +99,7 @@ class PureDataObject extends common_utils_1.EventForwarder {
99
99
  await this.hasInitialized();
100
100
  }
101
101
  /**
102
- * Retreive Fluid object using the handle get or the older requestFluidObject_UNSAFE call to fetch by ID
102
+ * Retrieve Fluid object using the handle get or the older requestFluidObject_UNSAFE call to fetch by ID
103
103
  *
104
104
  * @param key - key that object (handle/id) is stored with in the directory
105
105
  * @param directory - directory containing the object
@@ -166,20 +166,4 @@ class PureDataObject extends common_utils_1.EventForwarder {
166
166
  }
167
167
  }
168
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;
185
169
  //# sourceMappingURL=pureDataObject.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/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E,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"]}
1
+ {"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,yDAA8D;AAE9D,+DAAsE;AACtE,qEAAsE;AACtE,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,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B,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,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","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 { 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 * Retrieve 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"]}
@@ -567,8 +567,8 @@
567
567
  "affectsGlobalScope": false
568
568
  },
569
569
  "../../../../runtime/runtime-definitions/dist/garbageCollection.d.ts": {
570
- "version": "15026bcdfb49545956b4efc8b92540f091494d0609eff1306a52ec060482a329",
571
- "signature": "15026bcdfb49545956b4efc8b92540f091494d0609eff1306a52ec060482a329",
570
+ "version": "3a46909d243fe341ce2d71ad0c33977910196461e2f37d1c6ecd8d74abb7c82d",
571
+ "signature": "3a46909d243fe341ce2d71ad0c33977910196461e2f37d1c6ecd8d74abb7c82d",
572
572
  "affectsGlobalScope": false
573
573
  },
574
574
  "../../../../runtime/runtime-definitions/dist/protocol.d.ts": {
@@ -577,13 +577,13 @@
577
577
  "affectsGlobalScope": false
578
578
  },
579
579
  "../../../../runtime/runtime-definitions/dist/summary.d.ts": {
580
- "version": "858952f995ca3e0c7aac1018f41994eb6a82a05450ea880c7dd291fb6d46dfe2",
581
- "signature": "858952f995ca3e0c7aac1018f41994eb6a82a05450ea880c7dd291fb6d46dfe2",
580
+ "version": "50d7cb39cb949662e0994cbdefe4415959dfb4be6c867aab7e73e1e11519fb89",
581
+ "signature": "50d7cb39cb949662e0994cbdefe4415959dfb4be6c867aab7e73e1e11519fb89",
582
582
  "affectsGlobalScope": false
583
583
  },
584
584
  "../../../../runtime/runtime-definitions/dist/dataStoreContext.d.ts": {
585
- "version": "28ef6068103b7201fbe94fe48651d2d8daea2d3cb3f6607a0639c3a26e4b5201",
586
- "signature": "28ef6068103b7201fbe94fe48651d2d8daea2d3cb3f6607a0639c3a26e4b5201",
585
+ "version": "9e9249178b023440d34edcee927f07be916f1a29c4c3c02ace4f8a060d10f3e8",
586
+ "signature": "9e9249178b023440d34edcee927f07be916f1a29c4c3c02ace4f8a060d10f3e8",
587
587
  "affectsGlobalScope": false
588
588
  },
589
589
  "../../../../runtime/runtime-definitions/dist/dataStoreFactory.d.ts": {
@@ -607,8 +607,8 @@
607
607
  "affectsGlobalScope": false
608
608
  },
609
609
  "../../../../runtime/runtime-utils/dist/dataStoreHandleContextUtils.d.ts": {
610
- "version": "a6f5b191369e92f5b8b8c1337ac82fd2bc1f20943153db397d87ebb774c717f6",
611
- "signature": "a6f5b191369e92f5b8b8c1337ac82fd2bc1f20943153db397d87ebb774c717f6",
610
+ "version": "364a664124450723d4003b59212e6291445df626c9935ed2c1b25ccc98e5eec1",
611
+ "signature": "364a664124450723d4003b59212e6291445df626c9935ed2c1b25ccc98e5eec1",
612
612
  "affectsGlobalScope": false
613
613
  },
614
614
  "../../../../runtime/runtime-utils/dist/dataStoreHelpers.d.ts": {
@@ -622,13 +622,13 @@
622
622
  "affectsGlobalScope": false
623
623
  },
624
624
  "../../../../runtime/datastore-definitions/dist/dataStoreRuntime.d.ts": {
625
- "version": "96cc8af99cbd2e4653d318e14efff1851029c0e014d3df2d2dc6b0e1e3cddc55",
626
- "signature": "96cc8af99cbd2e4653d318e14efff1851029c0e014d3df2d2dc6b0e1e3cddc55",
625
+ "version": "e870cc895f5a97810e1d7bf84d96533faf4fb67f00c5732d9026c3b959631479",
626
+ "signature": "e870cc895f5a97810e1d7bf84d96533faf4fb67f00c5732d9026c3b959631479",
627
627
  "affectsGlobalScope": false
628
628
  },
629
629
  "../../../../runtime/datastore-definitions/dist/channel.d.ts": {
630
- "version": "fb9f2f9c8aa023b5e7243763536b99bbc7f7305da1d6821cd03d09cc9a91ac64",
631
- "signature": "fb9f2f9c8aa023b5e7243763536b99bbc7f7305da1d6821cd03d09cc9a91ac64",
630
+ "version": "5decb4d4a862e272a49518ea747a268b4fbb753f931b5de7a6cdb0d3a323d8fd",
631
+ "signature": "5decb4d4a862e272a49518ea747a268b4fbb753f931b5de7a6cdb0d3a323d8fd",
632
632
  "affectsGlobalScope": false
633
633
  },
634
634
  "../../../../runtime/datastore-definitions/dist/jsonable.d.ts": {
@@ -666,14 +666,9 @@
666
666
  "signature": "870d70891a4eee5d29dd4dd408d41dd260335f2eaa84fb3b7f3a2979b3ec078a",
667
667
  "affectsGlobalScope": false
668
668
  },
669
- "../../../../runtime/runtime-utils/dist/serializer.d.ts": {
670
- "version": "3e9878dc5c591d77f4277e11f63591e3df8bf8cd2a79469ca0890d51d4d3fe02",
671
- "signature": "3e9878dc5c591d77f4277e11f63591e3df8bf8cd2a79469ca0890d51d4d3fe02",
672
- "affectsGlobalScope": false
673
- },
674
669
  "../../../../runtime/runtime-utils/dist/utils.d.ts": {
675
- "version": "83bdd6bece2c26f907e253bf33c57fdc573f25e88998444d9012438de6e7230d",
676
- "signature": "83bdd6bece2c26f907e253bf33c57fdc573f25e88998444d9012438de6e7230d",
670
+ "version": "1d7ed6fd0c261ed3928aa9e1c02844e3032829d41529d7c153440de945eb693a",
671
+ "signature": "1d7ed6fd0c261ed3928aa9e1c02844e3032829d41529d7c153440de945eb693a",
677
672
  "affectsGlobalScope": false
678
673
  },
679
674
  "../../../../runtime/runtime-utils/dist/summarizerNode/summarizerNodeUtils.d.ts": {
@@ -687,8 +682,8 @@
687
682
  "affectsGlobalScope": false
688
683
  },
689
684
  "../../../../runtime/runtime-utils/dist/summarizerNode/summarizerNodeWithGc.d.ts": {
690
- "version": "66a44a7c28bcf3361f56cee242f0cb989a343bbf396f64d3065e71232042b110",
691
- "signature": "66a44a7c28bcf3361f56cee242f0cb989a343bbf396f64d3065e71232042b110",
685
+ "version": "37eb92e83dc91cddf876531dacbd65f0bab7782c0e9136550d6f74a158d5c443",
686
+ "signature": "37eb92e83dc91cddf876531dacbd65f0bab7782c0e9136550d6f74a158d5c443",
692
687
  "affectsGlobalScope": false
693
688
  },
694
689
  "../../../../runtime/runtime-utils/dist/summarizerNode/index.d.ts": {
@@ -702,13 +697,13 @@
702
697
  "affectsGlobalScope": false
703
698
  },
704
699
  "../../../../runtime/runtime-utils/dist/index.d.ts": {
705
- "version": "eb64c1df47644a08447d2ee7a5f12b247835658b9ab4a30463fb3338fb47657b",
706
- "signature": "eb64c1df47644a08447d2ee7a5f12b247835658b9ab4a30463fb3338fb47657b",
700
+ "version": "4d72a2f2b131fcad932178746692cdc6102206fa6b95541569ce44a8330ee89f",
701
+ "signature": "4d72a2f2b131fcad932178746692cdc6102206fa6b95541569ce44a8330ee89f",
707
702
  "affectsGlobalScope": false
708
703
  },
709
704
  "../../../request-handler/dist/requestHandlers.d.ts": {
710
- "version": "17b10a6f751f49b5fcab44d3eb8b96f77e28d6fb26246856c7f35c993679a7ee",
711
- "signature": "17b10a6f751f49b5fcab44d3eb8b96f77e28d6fb26246856c7f35c993679a7ee",
705
+ "version": "15e067b2b6a633b71939bf97fc74be51a1af6f551b474d1e03c8bf5efd49d55d",
706
+ "signature": "15e067b2b6a633b71939bf97fc74be51a1af6f551b474d1e03c8bf5efd49d55d",
712
707
  "affectsGlobalScope": false
713
708
  },
714
709
  "../../../request-handler/dist/runtimeRequestHandlerBuilder.d.ts": {
@@ -1376,7 +1371,6 @@
1376
1371
  "../../../../runtime/runtime-utils/dist/objectstorageutils.d.ts",
1377
1372
  "../../../../runtime/runtime-utils/dist/requestParser.d.ts",
1378
1373
  "../../../../runtime/runtime-utils/dist/runtimeFactoryHelper.d.ts",
1379
- "../../../../runtime/runtime-utils/dist/serializer.d.ts",
1380
1374
  "../../../../runtime/runtime-utils/dist/summarizerNode/index.d.ts",
1381
1375
  "../../../../runtime/runtime-utils/dist/summaryUtils.d.ts",
1382
1376
  "../../../../runtime/runtime-utils/dist/utils.d.ts"
@@ -1394,9 +1388,6 @@
1394
1388
  "../../../../../node_modules/@fluidframework/container-definitions/dist/index.d.ts",
1395
1389
  "../../../../runtime/container-runtime-definitions/dist/index.d.ts"
1396
1390
  ],
1397
- "../../../../runtime/runtime-utils/dist/serializer.d.ts": [
1398
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
1399
- ],
1400
1391
  "../../../../runtime/runtime-utils/dist/summarizerNode/index.d.ts": [
1401
1392
  "../../../../runtime/runtime-utils/dist/summarizerNode/summarizerNode.d.ts",
1402
1393
  "../../../../runtime/runtime-utils/dist/summarizerNode/summarizerNodeUtils.d.ts",
@@ -1428,7 +1419,6 @@
1428
1419
  "../../../../runtime/runtime-definitions/dist/index.d.ts"
1429
1420
  ],
1430
1421
  "../../../../runtime/runtime-utils/dist/utils.d.ts": [
1431
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
1432
1422
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/index.d.ts"
1433
1423
  ]
1434
1424
  },
@@ -1991,7 +1981,6 @@
1991
1981
  "../../../../runtime/runtime-utils/dist/objectstorageutils.d.ts",
1992
1982
  "../../../../runtime/runtime-utils/dist/requestParser.d.ts",
1993
1983
  "../../../../runtime/runtime-utils/dist/runtimeFactoryHelper.d.ts",
1994
- "../../../../runtime/runtime-utils/dist/serializer.d.ts",
1995
1984
  "../../../../runtime/runtime-utils/dist/summarizerNode/index.d.ts",
1996
1985
  "../../../../runtime/runtime-utils/dist/summaryUtils.d.ts",
1997
1986
  "../../../../runtime/runtime-utils/dist/utils.d.ts"
@@ -2009,9 +1998,6 @@
2009
1998
  "../../../../../node_modules/@fluidframework/container-definitions/dist/index.d.ts",
2010
1999
  "../../../../runtime/container-runtime-definitions/dist/index.d.ts"
2011
2000
  ],
2012
- "../../../../runtime/runtime-utils/dist/serializer.d.ts": [
2013
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts"
2014
- ],
2015
2001
  "../../../../runtime/runtime-utils/dist/summarizerNode/index.d.ts": [
2016
2002
  "../../../../runtime/runtime-utils/dist/summarizerNode/summarizerNode.d.ts",
2017
2003
  "../../../../runtime/runtime-utils/dist/summarizerNode/summarizerNodeUtils.d.ts",
@@ -2043,7 +2029,6 @@
2043
2029
  "../../../../runtime/runtime-definitions/dist/index.d.ts"
2044
2030
  ],
2045
2031
  "../../../../runtime/runtime-utils/dist/utils.d.ts": [
2046
- "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts",
2047
2032
  "../../../../../node_modules/@fluidframework/protocol-definitions/dist/index.d.ts"
2048
2033
  ]
2049
2034
  },
@@ -2195,7 +2180,6 @@
2195
2180
  "../../../../runtime/runtime-utils/dist/objectstorageutils.d.ts",
2196
2181
  "../../../../runtime/runtime-utils/dist/requestParser.d.ts",
2197
2182
  "../../../../runtime/runtime-utils/dist/runtimeFactoryHelper.d.ts",
2198
- "../../../../runtime/runtime-utils/dist/serializer.d.ts",
2199
2183
  "../../../../runtime/runtime-utils/dist/summarizerNode/index.d.ts",
2200
2184
  "../../../../runtime/runtime-utils/dist/summarizerNode/summarizerNode.d.ts",
2201
2185
  "../../../../runtime/runtime-utils/dist/summarizerNode/summarizerNodeUtils.d.ts",
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { FluidDataStoreRegistry, ContainerRuntime, } from "@fluidframework/container-runtime";
6
6
  import { IContainerRuntime, } from "@fluidframework/container-runtime-definitions";
7
- import { buildRuntimeRequestHandler, innerRequestHandler, } from "@fluidframework/request-handler";
7
+ import { buildRuntimeRequestHandler, } from "@fluidframework/request-handler";
8
8
  import { DependencyContainer, } from "@fluidframework/synthesize";
9
9
  import { RuntimeFactoryHelper } from "@fluidframework/runtime-utils";
10
10
  /**
@@ -19,10 +19,10 @@ export class BaseContainerRuntimeFactory extends RuntimeFactoryHelper {
19
19
  * @param requestHandlers - Request handlers for containers produced
20
20
  * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it
21
21
  */
22
- constructor(registryEntries, providerEntries = [], requestHandlers = [], runtimeOptions) {
22
+ constructor(registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions) {
23
23
  super();
24
24
  this.registryEntries = registryEntries;
25
- this.providerEntries = providerEntries;
25
+ this.dependencyContainer = dependencyContainer;
26
26
  this.requestHandlers = requestHandlers;
27
27
  this.runtimeOptions = runtimeOptions;
28
28
  this.registry = new FluidDataStoreRegistry(registryEntries);
@@ -37,13 +37,9 @@ export class BaseContainerRuntimeFactory extends RuntimeFactoryHelper {
37
37
  }
38
38
  async preInitialize(context, existing) {
39
39
  const scope = context.scope;
40
- const parentDependencyContainer = scope.IFluidDependencySynthesizer;
41
- const dc = new DependencyContainer(parentDependencyContainer);
42
- for (const entry of Array.from(this.providerEntries)) {
43
- dc.register(entry.type, entry.provider);
44
- }
40
+ const dc = new DependencyContainer(this.dependencyContainer, scope.IFluidDependencySynthesizer);
45
41
  scope.IFluidDependencySynthesizer = dc;
46
- const runtime = await ContainerRuntime.load(context, this.registryEntries, buildRuntimeRequestHandler(...this.requestHandlers, innerRequestHandler), this.runtimeOptions, scope, existing);
42
+ const runtime = await ContainerRuntime.load(context, this.registryEntries, buildRuntimeRequestHandler(...this.requestHandlers), this.runtimeOptions, scope, existing);
47
43
  // we register the runtime so developers of providers can use it in the factory pattern.
48
44
  dc.register(IContainerRuntime, runtime);
49
45
  return runtime;
@@ -1 +1 @@
1
- {"version":3,"file":"baseContainerRuntimeFactory.js","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEH,sBAAsB,EACtB,gBAAgB,GACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACH,iBAAiB,GACpB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAEH,0BAA0B,EAC1B,mBAAmB,GACtB,MAAM,iCAAiC,CAAC;AAMzC,OAAO,EACH,mBAAmB,GAGtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE;;;;GAIG;AACH,MAAM,OAAO,2BACT,SAAQ,oBAAoB;IAK5B;;;;;OAKG;IACH,YACqB,eAAmD,EACnD,kBAA+C,EAAE,EACjD,kBAA2C,EAAE,EAC7C,cAAyC;QAE1D,KAAK,EAAE,CAAC;QALS,oBAAe,GAAf,eAAe,CAAoC;QACnD,oBAAe,GAAf,eAAe,CAAkC;QACjD,oBAAe,GAAf,eAAe,CAA8B;QAC7C,mBAAc,GAAd,cAAc,CAA2B;QAG1D,IAAI,CAAC,QAAQ,GAAG,IAAI,sBAAsB,CAAC,eAAe,CAAC,CAAC;IAChE,CAAC;IAjBD,IAAW,uBAAuB,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAmBvD,KAAK,CAAC,oBAAoB,CAAC,OAAyB;QACvD,MAAM,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAEM,KAAK,CAAC,uBAAuB,CAAC,OAAyB;QAC1D,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAEM,KAAK,CAAC,aAAa,CACtB,OAA0B,EAC1B,QAAiB;QAEjB,MAAM,KAAK,GAAoD,OAAO,CAAC,KAAK,CAAC;QAC7E,MAAM,yBAAyB,GAAG,KAAK,CAAC,2BAA2B,CAAC;QACpE,MAAM,EAAE,GAAG,IAAI,mBAAmB,CAAC,yBAAyB,CAAC,CAAC;QAC9D,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE;YAClD,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;SAC3C;QACD,KAAK,CAAC,2BAA2B,GAAG,EAAE,CAAC;QAEvC,MAAM,OAAO,GAAqB,MAAM,gBAAgB,CAAC,IAAI,CACzD,OAAO,EACP,IAAI,CAAC,eAAe,EACpB,0BAA0B,CACtB,GAAG,IAAI,CAAC,eAAe,EACvB,mBAAmB,CAAC,EACxB,IAAI,CAAC,cAAc,EACnB,KAAK,EACL,QAAQ,CACX,CAAC;QAEF,wFAAwF;QACxF,EAAE,CAAC,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;QAExC,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B,IAAI,CAAC;IAE9E;;;;OAIG;IACO,KAAK,CAAC,uBAAuB,CAAC,OAA0B,IAAI,CAAC;CAC1E","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainerContext } from \"@fluidframework/container-definitions\";\nimport {\n IContainerRuntimeOptions,\n FluidDataStoreRegistry,\n ContainerRuntime,\n} from \"@fluidframework/container-runtime\";\nimport {\n IContainerRuntime,\n} from \"@fluidframework/container-runtime-definitions\";\nimport {\n RuntimeRequestHandler,\n buildRuntimeRequestHandler,\n innerRequestHandler,\n} from \"@fluidframework/request-handler\";\nimport {\n IFluidDataStoreRegistry,\n IProvideFluidDataStoreRegistry,\n NamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n DependencyContainer,\n DependencyContainerRegistry,\n IProvideFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\nimport { RuntimeFactoryHelper } from \"@fluidframework/runtime-utils\";\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\n\n/**\n * BaseContainerRuntimeFactory produces container runtimes with a given data store and service registry, as well as\n * given request handlers. It can be subclassed to implement a first-time initialization procedure for the containers\n * it creates.\n */\nexport class BaseContainerRuntimeFactory\n extends RuntimeFactoryHelper\n implements IProvideFluidDataStoreRegistry {\n public get IFluidDataStoreRegistry() { return this.registry; }\n private readonly registry: IFluidDataStoreRegistry;\n\n /**\n * @param registryEntries - The data store registry for containers produced\n * @param serviceRegistry - The service registry for containers produced\n * @param requestHandlers - Request handlers for containers produced\n * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it\n */\n constructor(\n private readonly registryEntries: NamedFluidDataStoreRegistryEntries,\n private readonly providerEntries: DependencyContainerRegistry = [],\n private readonly requestHandlers: RuntimeRequestHandler[] = [],\n private readonly runtimeOptions?: IContainerRuntimeOptions,\n ) {\n super();\n this.registry = new FluidDataStoreRegistry(registryEntries);\n }\n\n public async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n await this.containerInitializingFirstTime(runtime);\n await this.containerHasInitialized(runtime);\n }\n\n public async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {\n await this.containerHasInitialized(runtime);\n }\n\n public async preInitialize(\n context: IContainerContext,\n existing: boolean,\n ): Promise<ContainerRuntime> {\n const scope: FluidObject<IProvideFluidDependencySynthesizer> = context.scope;\n const parentDependencyContainer = scope.IFluidDependencySynthesizer;\n const dc = new DependencyContainer(parentDependencyContainer);\n for (const entry of Array.from(this.providerEntries)) {\n dc.register(entry.type, entry.provider);\n }\n scope.IFluidDependencySynthesizer = dc;\n\n const runtime: ContainerRuntime = await ContainerRuntime.load(\n context,\n this.registryEntries,\n buildRuntimeRequestHandler(\n ...this.requestHandlers,\n innerRequestHandler),\n this.runtimeOptions,\n scope,\n existing,\n );\n\n // we register the runtime so developers of providers can use it in the factory pattern.\n dc.register(IContainerRuntime, runtime);\n\n return runtime;\n }\n\n /**\n * Subclasses may override containerInitializingFirstTime to perform any setup steps at the time the container\n * is created. This likely includes creating any initial data stores that are expected to be there at the outset.\n * @param runtime - The container runtime for the container being initialized\n */\n protected async containerInitializingFirstTime(runtime: IContainerRuntime) { }\n\n /**\n * Subclasses may override containerHasInitialized to perform any steps after the container has initialized.\n * This likely includes loading any data stores that are expected to be there at the outset.\n * @param runtime - The container runtime for the container being initialized\n */\n protected async containerHasInitialized(runtime: IContainerRuntime) { }\n}\n"]}
1
+ {"version":3,"file":"baseContainerRuntimeFactory.js","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEH,sBAAsB,EACtB,gBAAgB,GACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACH,iBAAiB,GACpB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAEH,0BAA0B,GAC7B,MAAM,iCAAiC,CAAC;AAMzC,OAAO,EACH,mBAAmB,GAGtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE;;;;GAIG;AACH,MAAM,OAAO,2BACT,SAAQ,oBAAoB;IAK5B;;;;;OAKG;IACH,YACqB,eAAmD,EACnD,mBA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B,CAAC,OAA0B,IAAI,CAAC;IAE9E;;;;OAIG;IACO,KAAK,CAAC,uBAAuB,CAAC,OAA0B,IAAI,CAAC;CAC1E","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainerContext } from \"@fluidframework/container-definitions\";\nimport {\n IContainerRuntimeOptions,\n FluidDataStoreRegistry,\n ContainerRuntime,\n} from \"@fluidframework/container-runtime\";\nimport {\n IContainerRuntime,\n} from \"@fluidframework/container-runtime-definitions\";\nimport {\n RuntimeRequestHandler,\n buildRuntimeRequestHandler,\n} from \"@fluidframework/request-handler\";\nimport {\n IFluidDataStoreRegistry,\n IProvideFluidDataStoreRegistry,\n NamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n DependencyContainer,\n IFluidDependencySynthesizer,\n IProvideFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\nimport { RuntimeFactoryHelper } from \"@fluidframework/runtime-utils\";\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\n\n/**\n * BaseContainerRuntimeFactory produces container runtimes with a given data store and service registry, as well as\n * given request handlers. It can be subclassed to implement a first-time initialization procedure for the containers\n * it creates.\n */\nexport class BaseContainerRuntimeFactory\n extends RuntimeFactoryHelper\n implements IProvideFluidDataStoreRegistry {\n public get IFluidDataStoreRegistry() { return this.registry; }\n private readonly registry: IFluidDataStoreRegistry;\n\n /**\n * @param registryEntries - The data store registry for containers produced\n * @param serviceRegistry - The service registry for containers produced\n * @param requestHandlers - Request handlers for containers produced\n * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it\n */\n constructor(\n private readonly registryEntries: NamedFluidDataStoreRegistryEntries,\n private readonly dependencyContainer?: IFluidDependencySynthesizer,\n private readonly requestHandlers: RuntimeRequestHandler[] = [],\n private readonly runtimeOptions?: IContainerRuntimeOptions,\n ) {\n super();\n this.registry = new FluidDataStoreRegistry(registryEntries);\n }\n\n public async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n await this.containerInitializingFirstTime(runtime);\n await this.containerHasInitialized(runtime);\n }\n\n public async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {\n await this.containerHasInitialized(runtime);\n }\n\n public async preInitialize(\n context: IContainerContext,\n existing: boolean,\n ): Promise<ContainerRuntime> {\n const scope: FluidObject<IProvideFluidDependencySynthesizer> = context.scope;\n const dc = new DependencyContainer(this.dependencyContainer, scope.IFluidDependencySynthesizer);\n scope.IFluidDependencySynthesizer = dc;\n\n const runtime: ContainerRuntime = await ContainerRuntime.load(\n context,\n this.registryEntries,\n buildRuntimeRequestHandler(\n ...this.requestHandlers),\n this.runtimeOptions,\n scope,\n existing,\n );\n\n // we register the runtime so developers of providers can use it in the factory pattern.\n dc.register(IContainerRuntime, runtime);\n\n return runtime;\n }\n\n /**\n * Subclasses may override containerInitializingFirstTime to perform any setup steps at the time the container\n * is created. This likely includes creating any initial data stores that are expected to be there at the outset.\n * @param runtime - The container runtime for the container being initialized\n */\n protected async containerInitializingFirstTime(runtime: IContainerRuntime) { }\n\n /**\n * Subclasses may override containerHasInitialized to perform any steps after the container has initialized.\n * This likely includes loading any data stores that are expected to be there at the outset.\n * @param runtime - The container runtime for the container being initialized\n */\n protected async containerHasInitialized(runtime: IContainerRuntime) { }\n}\n"]}
@@ -2,7 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { innerRequestHandler, } from "@fluidframework/request-handler";
6
5
  import { defaultRouteRequestHandler } from "../request-handlers";
7
6
  import { BaseContainerRuntimeFactory } from "./baseContainerRuntimeFactory";
8
7
  const defaultDataStoreId = "default";
@@ -13,11 +12,10 @@ const defaultDataStoreId = "default";
13
12
  * This factory should be exposed as fluidExport off the entry point to your module.
14
13
  */
15
14
  export class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {
16
- constructor(defaultFactory, registryEntries, providerEntries = [], requestHandlers = [], runtimeOptions) {
17
- super(registryEntries, providerEntries, [
18
- ...requestHandlers,
15
+ constructor(defaultFactory, registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions) {
16
+ super(registryEntries, dependencyContainer, [
19
17
  defaultRouteRequestHandler(defaultDataStoreId),
20
- innerRequestHandler,
18
+ ...requestHandlers,
21
19
  ], runtimeOptions);
22
20
  this.defaultFactory = defaultFactory;
23
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.js","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAEH,mBAAmB,GACtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC;;;;;GAKG;AACH,MAAM,OAAO,2CAA4C,SAAQ,2BAA2B;IAGxF,YACuB,cAAsC,EACzD,eAAmD,EACnD,kBAA+C,EAAE,EACjD,kBAA2C,EAAE,EAC7C,cAAyC;QAEzC,KAAK,CACD,eAAe,EACf,eAAe,EACf;YACI,GAAG,eAAe;YAClB,0BAA0B,CAAC,kBAAkB,CAAC;YAC9C,mBAAmB;SACtB,EACD,cAAc,CACjB,CAAC;QAfiB,mBAAc,GAAd,cAAc,CAAwB;IAgB7D,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B;QACrE,MAAM,OAAO,CAAC,mBAAmB,CAC7B,IAAI,CAAC,cAAc,CAAC,IAAI,EACxB,kBAAkB,CACrB,CAAC;IACN,CAAC;;AA7BsB,8DAAkB,GAAG,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainerRuntimeOptions } from \"@fluidframework/container-runtime\";\nimport { IFluidDataStoreFactory, NamedFluidDataStoreRegistryEntries } from \"@fluidframework/runtime-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { DependencyContainerRegistry } from \"@fluidframework/synthesize\";\nimport {\n RuntimeRequestHandler,\n innerRequestHandler,\n} from \"@fluidframework/request-handler\";\nimport { defaultRouteRequestHandler } from \"../request-handlers\";\nimport { BaseContainerRuntimeFactory } from \"./baseContainerRuntimeFactory\";\n\nconst defaultDataStoreId = \"default\";\n\n/**\n * A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from\n * the container with an empty URL.\n *\n * This factory should be exposed as fluidExport off the entry point to your module.\n */\nexport class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {\n public static readonly defaultDataStoreId = defaultDataStoreId;\n\n constructor(\n protected readonly defaultFactory: IFluidDataStoreFactory,\n registryEntries: NamedFluidDataStoreRegistryEntries,\n providerEntries: DependencyContainerRegistry = [],\n requestHandlers: RuntimeRequestHandler[] = [],\n runtimeOptions?: IContainerRuntimeOptions,\n ) {\n super(\n registryEntries,\n providerEntries,\n [\n ...requestHandlers,\n defaultRouteRequestHandler(defaultDataStoreId),\n innerRequestHandler,\n ],\n runtimeOptions,\n );\n }\n\n /**\n * {@inheritDoc BaseContainerRuntimeFactory.containerInitializingFirstTime}\n */\n protected async containerInitializingFirstTime(runtime: IContainerRuntime) {\n await runtime.createRootDataStore(\n this.defaultFactory.type,\n defaultDataStoreId,\n );\n }\n}\n"]}
1
+ {"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.js","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC;;;;;GAKG;AACH,MAAM,OAAO,2CAA4C,SAAQ,2BAA2B;IAGxF,YACuB,cAAsC,EACzD,eAAmD,EACnD,mBAAiD,EACjD,kBAA2C,EAAE,EAC7C,cAAyC;QAEzC,KAAK,CACD,eAAe,EACf,mBAAmB,EACnB;YACI,0BAA0B,CAAC,kBAAkB,CAAC;YAC9C,GAAG,eAAe;SACrB,EACD,cAAc,CACjB,CAAC;QAdiB,mBAAc,GAAd,cAAc,CAAwB;IAe7D,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B;QACrE,MAAM,OAAO,CAAC,mBAAmB,CAC7B,IAAI,CAAC,cAAc,CAAC,IAAI,EACxB,kBAAkB,CACrB,CAAC;IACN,CAAC;;AA5BsB,8DAAkB,GAAG,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainerRuntimeOptions } from \"@fluidframework/container-runtime\";\nimport { IFluidDataStoreFactory, NamedFluidDataStoreRegistryEntries } from \"@fluidframework/runtime-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IFluidDependencySynthesizer } from \"@fluidframework/synthesize\";\nimport { RuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport { defaultRouteRequestHandler } from \"../request-handlers\";\nimport { BaseContainerRuntimeFactory } from \"./baseContainerRuntimeFactory\";\n\nconst defaultDataStoreId = \"default\";\n\n/**\n * A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from\n * the container with an empty URL.\n *\n * This factory should be exposed as fluidExport off the entry point to your module.\n */\nexport class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {\n public static readonly defaultDataStoreId = defaultDataStoreId;\n\n constructor(\n protected readonly defaultFactory: IFluidDataStoreFactory,\n registryEntries: NamedFluidDataStoreRegistryEntries,\n dependencyContainer?: IFluidDependencySynthesizer,\n requestHandlers: RuntimeRequestHandler[] = [],\n runtimeOptions?: IContainerRuntimeOptions,\n ) {\n super(\n registryEntries,\n dependencyContainer,\n [\n defaultRouteRequestHandler(defaultDataStoreId),\n ...requestHandlers,\n ],\n runtimeOptions,\n );\n }\n\n /**\n * {@inheritDoc BaseContainerRuntimeFactory.containerInitializingFirstTime}\n */\n protected async containerInitializingFirstTime(runtime: IContainerRuntime) {\n await runtime.createRootDataStore(\n this.defaultFactory.type,\n defaultDataStoreId,\n );\n }\n}\n"]}
@@ -28,19 +28,4 @@ export class DataObjectFactory extends PureDataObjectFactory {
28
28
  super(type, ctor, mergedObjects, optionalProviders, registryEntries, runtimeFactory);
29
29
  }
30
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
- }
46
31
  //# 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;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"]}
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;AAGlE,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","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 { DataObject, DataObjectTypes, DataObjectType, IDataObjectProps } 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"]}
@@ -150,19 +150,4 @@ export class PureDataObjectFactory {
150
150
  return instance;
151
151
  }
152
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
- }
168
153
  //# 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;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+E;IAC/E,mFAAmF;IACnF,iFAAiF;IACjF,uGAAuG;IACvG,MAAM,KAAK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,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"]}
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;AAEpC,OAAO,EAEH,cAAc,GAGjB,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;IA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,IAAI,CAAC,IAAI,CAAC,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","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 {\n IDataObjectProps,\n PureDataObject,\n DataObjectType,\n DataObjectTypes,\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"]}
@@ -74,22 +74,4 @@ export class DataObject extends PureDataObject {
74
74
  return `${item} must be initialized before being accessed.`;
75
75
  }
76
76
  }
77
- /**
78
- * @deprecated - This type is meant to ease the transition from the old DataObject type to the new.
79
- * please migrate to DataObject.
80
- *
81
- * DataObject is a base data store that is primed with a root directory. It
82
- * ensures that it is created and ready before you can access it.
83
- *
84
- * Having a single root directory allows for easier development. Instead of creating
85
- * and registering channels with the runtime any new DDS that is set on the root
86
- * will automatically be registered.
87
- *
88
- * @typeParam O - represents a type that will define optional providers that will be injected
89
- * @typeParam S - the initial state type that the produced data object may take during creation
90
- * @typeParam E - represents events that will be available in the EventForwarder
91
- */
92
- // eslint-disable-next-line @typescript-eslint/ban-types
93
- export class LegacyDataObject extends DataObject {
94
- }
95
77
  //# sourceMappingURL=dataObject.js.map