@fluidframework/aqueduct 0.54.2 → 0.56.0-49831

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 (48) 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 +3 -22
  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/data-objects/types.d.ts +2 -2
  30. package/dist/data-objects/types.d.ts.map +1 -1
  31. package/dist/data-objects/types.js.map +1 -1
  32. package/dist/test/tsconfig.tsbuildinfo +40 -56
  33. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js +5 -9
  34. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
  35. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +3 -5
  36. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  37. package/lib/data-object-factories/dataObjectFactory.js +0 -15
  38. package/lib/data-object-factories/dataObjectFactory.js.map +1 -1
  39. package/lib/data-object-factories/pureDataObjectFactory.js +0 -15
  40. package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -1
  41. package/lib/data-objects/dataObject.js +0 -18
  42. package/lib/data-objects/dataObject.js.map +1 -1
  43. package/lib/data-objects/index.js +2 -2
  44. package/lib/data-objects/index.js.map +1 -1
  45. package/lib/data-objects/pureDataObject.js +1 -16
  46. package/lib/data-objects/pureDataObject.js.map +1 -1
  47. package/lib/data-objects/types.js.map +1 -1
  48. package/package.json +25 -24
@@ -3,12 +3,11 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { IFluidObject, IFluidHandle, IFluidLoadable, IFluidRouter, IProvideFluidHandle, IRequest, IResponse, FluidObject } from "@fluidframework/core-interfaces";
6
- import { AsyncFluidObjectProvider, FluidObjectKey } from "@fluidframework/synthesize";
6
+ import { AsyncFluidObjectProvider } from "@fluidframework/synthesize";
7
7
  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.
@@ -35,7 +34,7 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
35
34
  *
36
35
  * To define providers set IFluidObject interfaces in the generic O type for your data store
37
36
  */
38
- protected readonly providers: AsyncFluidObjectProvider<FluidObjectKey<DataObjectType<I, "OptionalProviders">>, FluidObjectKey<object>>;
37
+ protected readonly providers: AsyncFluidObjectProvider<DataObjectType<I, "OptionalProviders">>;
39
38
  protected initProps?: DataObjectType<I, "InitialState">;
40
39
  protected initializeP: Promise<void> | undefined;
41
40
  get disposed(): boolean;
@@ -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 @@
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AG,cAAc,EAC1F,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,UAAU,EACrB,sBAAsB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,KAAK,MAAM,GAAG,YAAY,GAAG,SAAS,GACjG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAgB1B;;;;OAIG;cACa,yBAAyB,CAAC,CAAC,SAAS,YAAY,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAIzF;;;OAGG;cACa,UAAU,CAAC,CAAC,SAAS,YAAY,GAAG,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAIxF;;;OAGG;cACa,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9C;;;;;OAKG;cACa,qBAAqB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAE/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/pureDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,yDAA8D;AAE9D,+DAAsE;AACtE,qEAAsE;AAEtE,8DAA6D;AAC7D,0DAAuE;AAGvE;;;;;;GAMG;AACH,MAAsB,cAClB,SAAQ,6BAA2C;IAiDnD,YAAmB,KAA0B;QACzC,KAAK,EAAE,CAAC;QA/CJ,cAAS,GAAG,KAAK,CAAC;QAgDtB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QAEjC,qBAAM,CAAE,IAAI,CAAC,OAAe,CAAC,WAAW,KAAK,SAAS,EAAE,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAC7G,IAAI,CAAC,OAAe,CAAC,WAAW,G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;aAC1C;YACD,OAAO,WAAW,CAAC;SACtB;aAAM;YACH,MAAM,MAAM,GAAG,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,YAAY,CAAC;YACxC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAM,CAAC;SACnF;IACL,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,yBAAyB,CAAyB,EAAU;QACxE,OAAO,qCAAmB,CAAI,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC;IACjF,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,UAAU,CAAuC,EAAU;QACvE,OAAO,qCAAmB,CAAI,IAAI,yCAAoB,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,EAAE,CAAC;IACzG,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,aAAa,KAAoB,CAAC;IAElD;;;;;OAKG;IACO,KAAK,CAAC,qBAAqB,CAAC,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;IA+CnD,YAAmB,KAA0B;QACzC,KAAK,EAAE,CAAC;QA7CJ,cAAS,GAAG,KAAK,CAAC;QA8CtB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,KAAK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IT 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 } 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: AsyncFluidObjectProvider<DataObjectType<I, \"OptionalProviders\">>;\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"]}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { FluidObject } from "@fluidframework/core-interfaces";
6
- import { AsyncFluidObjectProvider, FluidObjectKey } from "@fluidframework/synthesize";
6
+ import { AsyncFluidObjectProvider } from "@fluidframework/synthesize";
7
7
  import { IFluidDataStoreContext } from "@fluidframework/runtime-definitions";
8
8
  import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
9
9
  import { IEvent } from "@fluidframework/common-definitions";
@@ -32,7 +32,7 @@ export declare type DataObjectType<T extends DataObjectTypes, P extends keyof Da
32
32
  export interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {
33
33
  readonly runtime: IFluidDataStoreRuntime;
34
34
  readonly context: IFluidDataStoreContext;
35
- readonly providers: AsyncFluidObjectProvider<FluidObjectKey<DataObjectType<I, "OptionalProviders">>, FluidObjectKey<object>>;
35
+ readonly providers: AsyncFluidObjectProvider<DataObjectType<I, "OptionalProviders">>;
36
36
  readonly initProps?: DataObjectType<I, "InitialState">;
37
37
  }
38
38
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data-objects/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,WAAW,EACd,MAAM,iCAAiC,C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,4BAA4B,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,oBAAY,cAAc,CAAC,CAAC,SAAS,eAAe,EAAE,CAAC,SAAS,MAAM,eAAe,IACjF,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpF,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IACzE,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC,cAAc,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC;IACrF,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;CAC1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/data-objects/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n FluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport { AsyncFluidObjectProvider, FluidObjectKey } from \"@fluidframework/synthesize\";\nimport { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { IEvent } from \"@fluidframework/common-definitions\";\n\n/**\n * This type is used as the base generic input to DataObject and PureDataObject.\n */\nexport interface DataObjectTypes {\n /**\n * represents a type that will define optional providers that will be injected\n */\n OptionalProviders?: FluidObject;\n /**\n * the initial state type that the produced data object may take during creation\n */\n InitialState?: any;\n /**\n * represents events that will be available in the EventForwarder\n */\n Events?: IEvent;\n}\n\n/**\n * @internal This utility type pulls a specific key's type off the T and returns that,\n * or the default value if TKey is not specified by T\n */\nexport type DataObjectType<T extends DataObjectTypes, P extends keyof DataObjectTypes> =\n T[P] extends Required<DataObjectTypes>[P] ? T[P] : Required<DataObjectTypes>[P];\n\nexport interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {\n readonly runtime: IFluidDataStoreRuntime;\n readonly context: IFluidDataStoreContext;\n readonly providers:\n // eslint-disable-next-line @typescript-eslint/ban-types\n AsyncFluidObjectProvider<FluidObjectKey<DataObjectType<I, \"OptionalProviders\">>, FluidObjectKey<object>>;\n readonly initProps?: DataObjectType<I, \"InitialState\">;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/data-objects/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n FluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport { AsyncFluidObjectProvider } from \"@fluidframework/synthesize\";\nimport { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { IEvent } from \"@fluidframework/common-definitions\";\n\n/**\n * This type is used as the base generic input to DataObject and PureDataObject.\n */\nexport interface DataObjectTypes {\n /**\n * represents a type that will define optional providers that will be injected\n */\n OptionalProviders?: FluidObject;\n /**\n * the initial state type that the produced data object may take during creation\n */\n InitialState?: any;\n /**\n * represents events that will be available in the EventForwarder\n */\n Events?: IEvent;\n}\n\n/**\n * @internal This utility type pulls a specific key's type off the T and returns that,\n * or the default value if TKey is not specified by T\n */\nexport type DataObjectType<T extends DataObjectTypes, P extends keyof DataObjectTypes> =\n T[P] extends Required<DataObjectTypes>[P] ? T[P] : Required<DataObjectTypes>[P];\n\nexport interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {\n readonly runtime: IFluidDataStoreRuntime;\n readonly context: IFluidDataStoreContext;\n readonly providers: AsyncFluidObjectProvider<DataObjectType<I, \"OptionalProviders\">>;\n readonly initProps?: DataObjectType<I, \"InitialState\">;\n}\n"]}
@@ -162,13 +162,13 @@
162
162
  "affectsGlobalScope": false
163
163
  },
164
164
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidLoadable.d.ts": {
165
- "version": "9600c430e3f4fe67dbd656f22eef1f2d94fecb1b21ee0c63ebc3cc31a316713c",
166
- "signature": "9600c430e3f4fe67dbd656f22eef1f2d94fecb1b21ee0c63ebc3cc31a316713c",
165
+ "version": "4e9d111924468ed4547451e4962457ec18ad69ef965311681d1272bfd352e9f9",
166
+ "signature": "4e9d111924468ed4547451e4962457ec18ad69ef965311681d1272bfd352e9f9",
167
167
  "affectsGlobalScope": false
168
168
  },
169
169
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/serializer.d.ts": {
170
- "version": "edefb49a9a514311243924409191f01ce6fbce072ba01e387b7eabfbab096ae8",
171
- "signature": "edefb49a9a514311243924409191f01ce6fbce072ba01e387b7eabfbab096ae8",
170
+ "version": "9d1f552cc6eb78389d10237e3c61d114b9681f5098c3fc594436e7d448afe55b",
171
+ "signature": "9d1f552cc6eb78389d10237e3c61d114b9681f5098c3fc594436e7d448afe55b",
172
172
  "affectsGlobalScope": false
173
173
  },
174
174
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidObject.d.ts": {
@@ -177,8 +177,8 @@
177
177
  "affectsGlobalScope": false
178
178
  },
179
179
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/fluidPackage.d.ts": {
180
- "version": "29af84fd868f666a8d2b0766b188faed869babeb3da5c556fc1151cc4e1e5153",
181
- "signature": "29af84fd868f666a8d2b0766b188faed869babeb3da5c556fc1151cc4e1e5153",
180
+ "version": "970e1154a10ec841ea6a3f2605044a65e2261bb953f3b72a1ca1faa480c697f8",
181
+ "signature": "970e1154a10ec841ea6a3f2605044a65e2261bb953f3b72a1ca1faa480c697f8",
182
182
  "affectsGlobalScope": false
183
183
  },
184
184
  "../../../../../node_modules/@fluidframework/core-interfaces/dist/index.d.ts": {
@@ -502,13 +502,13 @@
502
502
  "affectsGlobalScope": false
503
503
  },
504
504
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/urlResolver.d.ts": {
505
- "version": "952bce19b9b3ab6b639403ca9193e086cbbd8be766b1fc330a04b7d3e13492be",
506
- "signature": "952bce19b9b3ab6b639403ca9193e086cbbd8be766b1fc330a04b7d3e13492be",
505
+ "version": "9b85431cfd5e919ca33b7c04866efc4facbebed66af3efd0a59d7e30f89c5a33",
506
+ "signature": "9b85431cfd5e919ca33b7c04866efc4facbebed66af3efd0a59d7e30f89c5a33",
507
507
  "affectsGlobalScope": false
508
508
  },
509
509
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/storage.d.ts": {
510
- "version": "1aa581496a5ac6df4808d36946ce5c5f63f7a5021d6eb329685e45c240b2f83b",
511
- "signature": "1aa581496a5ac6df4808d36946ce5c5f63f7a5021d6eb329685e45c240b2f83b",
510
+ "version": "dc51da03872a900f82db416a294523a0d37f4be324e1fd9d69c20856f01604e8",
511
+ "signature": "dc51da03872a900f82db416a294523a0d37f4be324e1fd9d69c20856f01604e8",
512
512
  "affectsGlobalScope": false
513
513
  },
514
514
  "../../../../../node_modules/@fluidframework/driver-definitions/dist/index.d.ts": {
@@ -517,13 +517,13 @@
517
517
  "affectsGlobalScope": false
518
518
  },
519
519
  "../../../../../node_modules/@fluidframework/container-definitions/dist/deltas.d.ts": {
520
- "version": "effeaf4985959d97471a1f95db55640c93ee4600ad0b3df694b66f3e89ec646d",
521
- "signature": "effeaf4985959d97471a1f95db55640c93ee4600ad0b3df694b66f3e89ec646d",
520
+ "version": "fe0f2fb74cf4c19d3f2f3754eaad33e7037225a67191e645f2c6e9944c8a465a",
521
+ "signature": "fe0f2fb74cf4c19d3f2f3754eaad33e7037225a67191e645f2c6e9944c8a465a",
522
522
  "affectsGlobalScope": false
523
523
  },
524
524
  "../../../../../node_modules/@fluidframework/container-definitions/dist/error.d.ts": {
525
- "version": "e0cdfdeee27dbe35ece5e29a75ec4c96b2c4a748853e1acf6ae478683f48d515",
526
- "signature": "e0cdfdeee27dbe35ece5e29a75ec4c96b2c4a748853e1acf6ae478683f48d515",
525
+ "version": "fcb80d1e20711e08d39b2f1e63a1322ff26db44bf7fc8410415df957440b387b",
526
+ "signature": "fcb80d1e20711e08d39b2f1e63a1322ff26db44bf7fc8410415df957440b387b",
527
527
  "affectsGlobalScope": false
528
528
  },
529
529
  "../../../../../node_modules/@fluidframework/container-definitions/dist/fluidModule.d.ts": {
@@ -532,13 +532,13 @@
532
532
  "affectsGlobalScope": false
533
533
  },
534
534
  "../../../../../node_modules/@fluidframework/container-definitions/dist/loader.d.ts": {
535
- "version": "14e52ba703d9cfbce7aa1d8104a314eeaea2f4a418f21fb0bdbac41dacffc223",
536
- "signature": "14e52ba703d9cfbce7aa1d8104a314eeaea2f4a418f21fb0bdbac41dacffc223",
535
+ "version": "2cb7e613b8c2fd69b0f04b87b1092eaf84094382f9150d11cc6782d2e5e45b7b",
536
+ "signature": "2cb7e613b8c2fd69b0f04b87b1092eaf84094382f9150d11cc6782d2e5e45b7b",
537
537
  "affectsGlobalScope": false
538
538
  },
539
539
  "../../../../../node_modules/@fluidframework/container-definitions/dist/runtime.d.ts": {
540
- "version": "91a91bba1dfc2a00e507faddeeeb6d0779cfecd3ab5a3efd8e05abdf2d4a9c4c",
541
- "signature": "91a91bba1dfc2a00e507faddeeeb6d0779cfecd3ab5a3efd8e05abdf2d4a9c4c",
540
+ "version": "cbd17a44e4c8a0c79d020d321c57218399afdaffd922ab3073db1429697410d2",
541
+ "signature": "cbd17a44e4c8a0c79d020d321c57218399afdaffd922ab3073db1429697410d2",
542
542
  "affectsGlobalScope": false
543
543
  },
544
544
  "../../../../../node_modules/@fluidframework/container-definitions/dist/legacy/chaincode.d.ts": {
@@ -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": "8024f017b2b6f63d677f8745385686c279fc7a7ba16e134044cc80cab754c340",
586
+ "signature": "8024f017b2b6f63d677f8745385686c279fc7a7ba16e134044cc80cab754c340",
587
587
  "affectsGlobalScope": false
588
588
  },
589
589
  "../../../../runtime/runtime-definitions/dist/dataStoreFactory.d.ts": {
@@ -597,8 +597,8 @@
597
597
  "affectsGlobalScope": false
598
598
  },
599
599
  "../../../../runtime/container-runtime-definitions/dist/containerRuntime.d.ts": {
600
- "version": "0cf6539b516cf8c80357f1963f0540da8cc58eecd58ee9dca010bfa0d3af3238",
601
- "signature": "0cf6539b516cf8c80357f1963f0540da8cc58eecd58ee9dca010bfa0d3af3238",
600
+ "version": "25b17a9b2a85ef22c4d68e2854eb62965097519f3eb93554f73441bda318a763",
601
+ "signature": "25b17a9b2a85ef22c4d68e2854eb62965097519f3eb93554f73441bda318a763",
602
602
  "affectsGlobalScope": false
603
603
  },
604
604
  "../../../../runtime/container-runtime-definitions/dist/index.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": "e90ee5b5e82a17db7d3d39a6ea4c8bfaf519477808367920f0514a9323177787",
626
+ "signature": "e90ee5b5e82a17db7d3d39a6ea4c8bfaf519477808367920f0514a9323177787",
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":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,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,mBAAiD,EACjD,kBAA2C,EAAE,EAC7C,cAAyC;QAE1D,KAAK,EAAE,CAAC;QALS,oBAAe,GAAf,eAAe,CAAoC;QACnD,wBAAmB,GAAnB,mBAAmB,CAA8B;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,GAAG,OAAO,CAAC,KAAwD,CAAC;QAC/E,MAAM,EAAE,GAAG,IAAI,mBAAmB,CAC9B,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACjE,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,CAAC,EAC5B,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} 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 = context.scope as FluidObject<IProvideFluidDependencySynthesizer>;\n const dc = new DependencyContainer<FluidObject<IContainerRuntime>>(\n 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