@fluidframework/aqueduct 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.4.1.0.148229

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 (83) hide show
  1. package/README.md +29 -29
  2. package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts +9 -5
  3. package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -1
  4. package/dist/container-runtime-factories/baseContainerRuntimeFactory.js +20 -7
  5. package/dist/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
  6. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +2 -1
  7. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
  8. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +2 -5
  9. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  10. package/dist/data-object-factories/dataObjectFactory.d.ts.map +1 -1
  11. package/dist/data-object-factories/dataObjectFactory.js.map +1 -1
  12. package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
  13. package/dist/data-object-factories/pureDataObjectFactory.js +4 -2
  14. package/dist/data-object-factories/pureDataObjectFactory.js.map +1 -1
  15. package/dist/data-objects/dataObject.d.ts.map +1 -1
  16. package/dist/data-objects/dataObject.js +1 -1
  17. package/dist/data-objects/dataObject.js.map +1 -1
  18. package/dist/data-objects/pureDataObject.d.ts +1 -6
  19. package/dist/data-objects/pureDataObject.d.ts.map +1 -1
  20. package/dist/data-objects/pureDataObject.js +15 -14
  21. package/dist/data-objects/pureDataObject.js.map +1 -1
  22. package/dist/data-objects/types.d.ts.map +1 -1
  23. package/dist/data-objects/types.js.map +1 -1
  24. package/dist/index.d.ts +2 -3
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1 -6
  27. package/dist/index.js.map +1 -1
  28. package/dist/request-handlers/requestHandlers.d.ts +1 -1
  29. package/dist/request-handlers/requestHandlers.d.ts.map +1 -1
  30. package/dist/request-handlers/requestHandlers.js +4 -2
  31. package/dist/request-handlers/requestHandlers.js.map +1 -1
  32. package/dist/test/defaultRoute.spec.js +3 -1
  33. package/dist/test/defaultRoute.spec.js.map +1 -1
  34. package/dist/test/tsconfig.tsbuildinfo +1 -1
  35. package/dist/test/types/validateAqueductPrevious.generated.js +8 -18
  36. package/dist/test/types/validateAqueductPrevious.generated.js.map +1 -1
  37. package/dist/utils/containerInteractions.d.ts.map +1 -1
  38. package/dist/utils/containerInteractions.js.map +1 -1
  39. package/dist/utils/index.d.ts +0 -1
  40. package/dist/utils/index.d.ts.map +1 -1
  41. package/dist/utils/index.js +1 -3
  42. package/dist/utils/index.js.map +1 -1
  43. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js +22 -9
  44. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
  45. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +2 -5
  46. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  47. package/lib/data-object-factories/dataObjectFactory.js +1 -1
  48. package/lib/data-object-factories/dataObjectFactory.js.map +1 -1
  49. package/lib/data-object-factories/pureDataObjectFactory.js +4 -2
  50. package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -1
  51. package/lib/data-objects/dataObject.js +1 -1
  52. package/lib/data-objects/dataObject.js.map +1 -1
  53. package/lib/data-objects/pureDataObject.js +15 -14
  54. package/lib/data-objects/pureDataObject.js.map +1 -1
  55. package/lib/data-objects/types.js.map +1 -1
  56. package/lib/index.js +2 -3
  57. package/lib/index.js.map +1 -1
  58. package/lib/request-handlers/requestHandlers.js +4 -2
  59. package/lib/request-handlers/requestHandlers.js.map +1 -1
  60. package/lib/utils/containerInteractions.js.map +1 -1
  61. package/lib/utils/index.js +0 -1
  62. package/lib/utils/index.js.map +1 -1
  63. package/package.json +58 -58
  64. package/dist/container-services/containerServices.d.ts +0 -27
  65. package/dist/container-services/containerServices.d.ts.map +0 -1
  66. package/dist/container-services/containerServices.js +0 -84
  67. package/dist/container-services/containerServices.js.map +0 -1
  68. package/dist/container-services/index.d.ts +0 -6
  69. package/dist/container-services/index.d.ts.map +0 -1
  70. package/dist/container-services/index.js +0 -12
  71. package/dist/container-services/index.js.map +0 -1
  72. package/dist/test/containerServices.spec.js +0 -121
  73. package/dist/test/containerServices.spec.js.map +0 -1
  74. package/dist/utils/attachUtils.d.ts +0 -7
  75. package/dist/utils/attachUtils.d.ts.map +0 -1
  76. package/dist/utils/attachUtils.js +0 -20
  77. package/dist/utils/attachUtils.js.map +0 -1
  78. package/lib/container-services/containerServices.js +0 -79
  79. package/lib/container-services/containerServices.js.map +0 -1
  80. package/lib/container-services/index.js +0 -6
  81. package/lib/container-services/index.js.map +0 -1
  82. package/lib/utils/attachUtils.js +0 -16
  83. package/lib/utils/attachUtils.js.map +0 -1
package/README.md CHANGED
@@ -18,8 +18,8 @@ object defines the logic of your Fluid object, whereas the data object factory d
18
18
 
19
19
  The [DataObject][] class extends [PureDataObject](#puredataobject) and provides the following additional functionality:
20
20
 
21
- - A `root` SharedDirectory that makes creating and storing distributed data structures and objects easy.
22
- - Blob storage implementation that makes it easier to store and retrieve blobs.
21
+ - A `root` SharedDirectory that makes creating and storing distributed data structures and objects easy.
22
+ - Blob storage implementation that makes it easier to store and retrieve blobs.
23
23
 
24
24
  **Note:** Most developers will want to use the `DataObject` as their base class to extend.
25
25
 
@@ -27,14 +27,14 @@ The [DataObject][] class extends [PureDataObject](#puredataobject) and provides
27
27
 
28
28
  [PureDataObject][] provides the following functionality:
29
29
 
30
- - Basic set of interface implementations to be loadable in a Fluid container.
31
- - Functions for managing the Fluid object lifecycle.
32
- - `initializingFirstTime(props: S)` - called only the first time a Fluid object is initialized and only on the first
33
- client on which it loads.
34
- - `initializingFromExisting()` - called every time except the first time a Fluid object is initialized; that is, every
35
- time an instance is loaded from a previously created instance.
36
- - `hasInitialized()` - called every time after `initializingFirstTime` or `initializingFromExisting` executes
37
- - Helper functions for creating and getting other data objects in the same container.
30
+ - Basic set of interface implementations to be loadable in a Fluid container.
31
+ - Functions for managing the Fluid object lifecycle.
32
+ - `initializingFirstTime(props: S)` - called only the first time a Fluid object is initialized and only on the first
33
+ client on which it loads.
34
+ - `initializingFromExisting()` - called every time except the first time a Fluid object is initialized; that is, every
35
+ time an instance is loaded from a previously created instance.
36
+ - `hasInitialized()` - called every time after `initializingFirstTime` or `initializingFromExisting` executes
37
+ - Helper functions for creating and getting other data objects in the same container.
38
38
 
39
39
  **Note:** You probably don't want to inherit from this data object directly unless you are creating another base data
40
40
  object class. If you have a data object that doesn't use distributed data structures you should use Container Services
@@ -42,7 +42,7 @@ to manage your object.
42
42
 
43
43
  ### DataObject example
44
44
 
45
- In the below example we have a simple data object, *Clicker*, that will render a value alongside a button the the page.
45
+ In the below example we have a simple data object, _Clicker_, that will render a value alongside a button the the page.
46
46
  Every time the button is pressed the value will increment. Because this data object renders to the DOM it also extends
47
47
  `IFluidHTMLView`.
48
48
 
@@ -91,8 +91,8 @@ The Aqueduct offers a factory for each of the data objects provided.
91
91
 
92
92
  ### More details
93
93
 
94
- - [DataObjectFactory][]
95
- - [PureDataObjectFactory][]
94
+ - [DataObjectFactory][]
95
+ - [PureDataObjectFactory][]
96
96
 
97
97
  ### DataObjectFactory example
98
98
 
@@ -104,10 +104,10 @@ In the below example we build a `DataObjectFactory` for the [Clicker](#dataobjec
104
104
 
105
105
  ```typescript
106
106
  export const ClickerInstantiationFactory = new DataObjectFactory(
107
- Clicker.Name,
108
- Clicker,
109
- [SharedCounter.getFactory()], // distributed data structures
110
- {}, // Provider Symbols see below
107
+ Clicker.Name,
108
+ Clicker,
109
+ [SharedCounter.getFactory()], // distributed data structures
110
+ {}, // Provider Symbols see below
111
111
  );
112
112
  ```
113
113
 
@@ -129,7 +129,7 @@ In the below example we have an `IFluidUserInfo` interface that looks like this:
129
129
 
130
130
  ```typescript
131
131
  interface IFluidUserInfo {
132
- readonly userCount: number;
132
+ readonly userCount: number;
133
133
  }
134
134
  ```
135
135
 
@@ -164,10 +164,10 @@ objects cannot be consumed except for when they are within a Container.
164
164
  The Aqueduct library provides the [ContainerRuntimeFactoryWithDefaultDataStore][] that enables you as a container
165
165
  developer to:
166
166
 
167
- - Define the registry of data objects that can be created
168
- - Declare the default data object
169
- - Use [provider entries](#provider-entries-development)
170
- - Declare Container level [Request Handlers](#container-level-request-handlers)
167
+ - Define the registry of data objects that can be created
168
+ - Declare the default data object
169
+ - Use provider entries
170
+ - Declare Container level [Request Handlers](#container-level-request-handlers)
171
171
 
172
172
  ## Container object example
173
173
 
@@ -192,14 +192,14 @@ before the `DataObject` get function. Request handlers allow you to intercept re
192
192
  custom responses.
193
193
 
194
194
  Consider a scenario where you want to create a random color generator. I could create a RequestHandler that when someone
195
- makes a request to the Container for `{url:"color"}` will intercept and return a custom `IResponse` of `{ status:200,
196
- type:"text/plain", value:"blue"}`.
195
+ makes a request to the Container for `{url:"color"}` will intercept and return a custom `IResponse` of `{ status:200, type:"text/plain", value:"blue"}`.
197
196
 
198
197
  We use custom handlers to build the Container Services pattern.
199
198
 
200
199
  <!-- Links -->
201
- [ContainerRuntimeFactoryWithDefaultDataStore]: https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/containerRuntimeFactories/containerRuntimeFactoryWithDefaultDataStore.ts
202
- [DataObject]: https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/data-objects/dataObject.ts
203
- [DataObjectFactory]: https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/data-object-factories/dataObjectFactory.ts
204
- [PureDataObject]: https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/data-object-factories/pureDataObject.ts
205
- [PureDataObjectFactory]: https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts
200
+
201
+ [containerruntimefactorywithdefaultdatastore]: https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/containerRuntimeFactories/containerRuntimeFactoryWithDefaultDataStore.ts
202
+ [dataobject]: https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/data-objects/dataObject.ts
203
+ [dataobjectfactory]: https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/data-object-factories/dataObjectFactory.ts
204
+ [puredataobject]: https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/data-object-factories/pureDataObject.ts
205
+ [puredataobjectfactory]: https://github.com/microsoft/FluidFramework/blob/main/packages/framework/aqueduct/src/data-object-factories/pureDataObjectFactory.ts
@@ -9,25 +9,29 @@ import { RuntimeRequestHandler } from "@fluidframework/request-handler";
9
9
  import { IFluidDataStoreRegistry, IProvideFluidDataStoreRegistry, NamedFluidDataStoreRegistryEntries } from "@fluidframework/runtime-definitions";
10
10
  import { IFluidDependencySynthesizer } from "@fluidframework/synthesize";
11
11
  import { RuntimeFactoryHelper } from "@fluidframework/runtime-utils";
12
+ import { FluidObject } from "@fluidframework/core-interfaces";
12
13
  /**
13
- * BaseContainerRuntimeFactory produces container runtimes with a given data store and service registry, as well as
14
- * given request handlers. It can be subclassed to implement a first-time initialization procedure for the containers
15
- * it creates.
14
+ * BaseContainerRuntimeFactory produces container runtimes with the specified data store and service registries,
15
+ * request handlers, runtimeOptions, and entryPoint initialization function.
16
+ * It can be subclassed to implement a first-time initialization procedure for the containers it creates.
16
17
  */
17
18
  export declare class BaseContainerRuntimeFactory extends RuntimeFactoryHelper implements IProvideFluidDataStoreRegistry {
18
19
  private readonly registryEntries;
19
20
  private readonly dependencyContainer?;
20
21
  private readonly requestHandlers;
21
22
  private readonly runtimeOptions?;
23
+ private readonly initializeEntryPoint?;
22
24
  get IFluidDataStoreRegistry(): IFluidDataStoreRegistry;
23
25
  private readonly registry;
24
26
  /**
25
27
  * @param registryEntries - The data store registry for containers produced
26
- * @param serviceRegistry - The service registry for containers produced
28
+ * @param dependencyContainer -
27
29
  * @param requestHandlers - Request handlers for containers produced
28
30
  * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it
31
+ * @param initializeEntryPoint - Function that will initialize the entryPoint of the ContainerRuntime instances
32
+ * created with this factory
29
33
  */
30
- constructor(registryEntries: NamedFluidDataStoreRegistryEntries, dependencyContainer?: IFluidDependencySynthesizer | undefined, requestHandlers?: RuntimeRequestHandler[], runtimeOptions?: IContainerRuntimeOptions | undefined);
34
+ constructor(registryEntries: NamedFluidDataStoreRegistryEntries, dependencyContainer?: IFluidDependencySynthesizer | undefined, requestHandlers?: RuntimeRequestHandler[], runtimeOptions?: IContainerRuntimeOptions | undefined, initializeEntryPoint?: ((runtime: IContainerRuntime) => Promise<FluidObject>) | undefined);
31
35
  instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
32
36
  instantiateFromExisting(runtime: ContainerRuntime): Promise<void>;
33
37
  preInitialize(context: IContainerContext, existing: boolean): Promise<ContainerRuntime>;
@@ -1 +1 @@
1
- {"version":3,"file":"baseContainerRuntimeFactory.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EACH,wBAAwB,EAExB,gBAAgB,EACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACH,iBAAiB,EACpB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACH,qBAAqB,EAExB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,uBAAuB,EACvB,8BAA8B,EAC9B,kCAAkC,EACrC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEH,2BAA2B,EAE9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE;;;;GAIG;AACH,qBAAa,2BACT,SAAQ,oBACR,YAAW,8BAA8B;IAWrC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACrC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAbpC,IAAW,uBAAuB,4BAA4B;IAC9D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;IAEnD;;;;;OAKG;gBAEkB,eAAe,EAAE,kCAAkC,EACnD,mBAAmB,CAAC,yCAA6B,EACjD,eAAe,GAAE,qBAAqB,EAAO,EAC7C,cAAc,CAAC,sCAA0B;IAMjD,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9D,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE,aAAa,CACtB,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GAClB,OAAO,CAAC,gBAAgB,CAAC;IAsB5B;;;;OAIG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB;IAEzE;;;;OAIG;cACa,uBAAuB,CAAC,OAAO,EAAE,iBAAiB;CACrE"}
1
+ {"version":3,"file":"baseContainerRuntimeFactory.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EACN,wBAAwB,EAExB,gBAAgB,EAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAA8B,MAAM,iCAAiC,CAAC;AACpG,OAAO,EACN,uBAAuB,EACvB,8BAA8B,EAC9B,kCAAkC,EAClC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEN,2BAA2B,EAE3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D;;;;GAIG;AACH,qBAAa,2BACZ,SAAQ,oBACR,YAAW,8BAA8B;IAgBxC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACrC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IAlBvC,IAAW,uBAAuB,4BAEjC;IACD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;IAEnD;;;;;;;OAOG;gBAEe,eAAe,EAAE,kCAAkC,EACnD,mBAAmB,CAAC,yCAA6B,EACjD,eAAe,GAAE,qBAAqB,EAAO,EAC7C,cAAc,CAAC,sCAA0B,EACzC,oBAAoB,CAAC,aAC5B,iBAAiB,KACtB,QAAQ,WAAW,CAAC,aAAA;IAMb,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9D,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE,aAAa,CACzB,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,gBAAgB,CAAC;IAwB5B;;;;OAIG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB;IAEzE;;;;OAIG;cACa,uBAAuB,CAAC,OAAO,EAAE,iBAAiB;CAClE"}
@@ -11,26 +11,31 @@ const request_handler_1 = require("@fluidframework/request-handler");
11
11
  const synthesize_1 = require("@fluidframework/synthesize");
12
12
  const runtime_utils_1 = require("@fluidframework/runtime-utils");
13
13
  /**
14
- * BaseContainerRuntimeFactory produces container runtimes with a given data store and service registry, as well as
15
- * given request handlers. It can be subclassed to implement a first-time initialization procedure for the containers
16
- * it creates.
14
+ * BaseContainerRuntimeFactory produces container runtimes with the specified data store and service registries,
15
+ * request handlers, runtimeOptions, and entryPoint initialization function.
16
+ * It can be subclassed to implement a first-time initialization procedure for the containers it creates.
17
17
  */
18
18
  class BaseContainerRuntimeFactory extends runtime_utils_1.RuntimeFactoryHelper {
19
19
  /**
20
20
  * @param registryEntries - The data store registry for containers produced
21
- * @param serviceRegistry - The service registry for containers produced
21
+ * @param dependencyContainer -
22
22
  * @param requestHandlers - Request handlers for containers produced
23
23
  * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it
24
+ * @param initializeEntryPoint - Function that will initialize the entryPoint of the ContainerRuntime instances
25
+ * created with this factory
24
26
  */
25
- constructor(registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions) {
27
+ constructor(registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions, initializeEntryPoint) {
26
28
  super();
27
29
  this.registryEntries = registryEntries;
28
30
  this.dependencyContainer = dependencyContainer;
29
31
  this.requestHandlers = requestHandlers;
30
32
  this.runtimeOptions = runtimeOptions;
33
+ this.initializeEntryPoint = initializeEntryPoint;
31
34
  this.registry = new container_runtime_1.FluidDataStoreRegistry(registryEntries);
32
35
  }
33
- get IFluidDataStoreRegistry() { return this.registry; }
36
+ get IFluidDataStoreRegistry() {
37
+ return this.registry;
38
+ }
34
39
  async instantiateFirstTime(runtime) {
35
40
  await this.containerInitializingFirstTime(runtime);
36
41
  await this.containerHasInitialized(runtime);
@@ -42,7 +47,15 @@ class BaseContainerRuntimeFactory extends runtime_utils_1.RuntimeFactoryHelper {
42
47
  const scope = context.scope;
43
48
  const dc = new synthesize_1.DependencyContainer(this.dependencyContainer, scope.IFluidDependencySynthesizer);
44
49
  scope.IFluidDependencySynthesizer = dc;
45
- const runtime = await container_runtime_1.ContainerRuntime.load(context, this.registryEntries, (0, request_handler_1.buildRuntimeRequestHandler)(...this.requestHandlers), this.runtimeOptions, scope, existing);
50
+ const runtime = await container_runtime_1.ContainerRuntime.loadRuntime({
51
+ context,
52
+ requestHandler: (0, request_handler_1.buildRuntimeRequestHandler)(...this.requestHandlers),
53
+ existing,
54
+ runtimeOptions: this.runtimeOptions,
55
+ registryEntries: this.registryEntries,
56
+ containerScope: scope,
57
+ initializeEntryPoint: this.initializeEntryPoint,
58
+ });
46
59
  // we register the runtime so developers of providers can use it in the factory pattern.
47
60
  dc.register(container_runtime_definitions_1.IContainerRuntime, runtime);
48
61
  return runtime;
@@ -1 +1 @@
1
- {"version":3,"file":"baseContainerRuntimeFactory.js","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAI2C;AAC3C,iGAEuD;AACvD,qEAGyC;AAMzC,2DAIoC;AACpC,iEAAqE;AAGrE;;;;GAIG;AACH,MAAa,2BACT,SAAQ,oCAAoB;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,0CAAsB,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,GAAgD,OAAO,CAAC,KAAK,CAAC;QACzE,MAAM,EAAE,GAAG,IAAI,gCAAmB,CAC9B,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACjE,KAAK,CAAC,2BAA2B,GAAG,EAAE,CAAC;QAEvC,MAAM,OAAO,GAAqB,MAAM,oCAAgB,CAAC,IAAI,CACzD,OAAO,EACP,IAAI,CAAC,eAAe,EACpB,IAAA,4CAA0B,EACtB,GAAG,IAAI,CAAC,eAAe,CAAC,EAC5B,IAAI,CAAC,cAAc,EACnB,KAAK,EACL,QAAQ,CACX,CAAC;QAEF,wFAAwF;QACxF,EAAE,CAAC,QAAQ,CAAC,iDAAiB,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;AArED,kEAqEC","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: Partial<IProvideFluidDependencySynthesizer> = context.scope;\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"]}
1
+ {"version":3,"file":"baseContainerRuntimeFactory.js","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAI2C;AAC3C,iGAAkF;AAClF,qEAAoG;AAMpG,2DAIoC;AACpC,iEAAqE;AAGrE;;;;GAIG;AACH,MAAa,2BACZ,SAAQ,oCAAoB;IAQ5B;;;;;;;OAOG;IACH,YACkB,eAAmD,EACnD,mBAAiD,EACjD,kBAA2C,EAAE,EAC7C,cAAyC,EACzC,oBAEQ;QAEzB,KAAK,EAAE,CAAC;QARS,oBAAe,GAAf,eAAe,CAAoC;QACnD,wBAAmB,GAAnB,mBAAmB,CAA8B;QACjD,oBAAe,GAAf,eAAe,CAA8B;QAC7C,mBAAc,GAAd,cAAc,CAA2B;QACzC,yBAAoB,GAApB,oBAAoB,CAEZ;QAGzB,IAAI,CAAC,QAAQ,GAAG,IAAI,0CAAsB,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC;IAxBD,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAwBM,KAAK,CAAC,oBAAoB,CAAC,OAAyB;QAC1D,MAAM,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,uBAAuB,CAAC,OAAyB;QAC7D,MAAM,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,aAAa,CACzB,OAA0B,EAC1B,QAAiB;QAEjB,MAAM,KAAK,GAAgD,OAAO,CAAC,KAAK,CAAC;QACzE,MAAM,EAAE,GAAG,IAAI,gCAAmB,CACjC,IAAI,CAAC,mBAAmB,EACxB,KAAK,CAAC,2BAA2B,CACjC,CAAC;QACF,KAAK,CAAC,2BAA2B,GAAG,EAAE,CAAC;QAEvC,MAAM,OAAO,GAAqB,MAAM,oCAAgB,CAAC,WAAW,CAAC;YACpE,OAAO;YACP,cAAc,EAAE,IAAA,4CAA0B,EAAC,GAAG,IAAI,CAAC,eAAe,CAAC;YACnE,QAAQ;YACR,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,cAAc,EAAE,KAAK;YACrB,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;SAC/C,CAAC,CAAC;QAEH,wFAAwF;QACxF,EAAE,CAAC,QAAQ,CAAC,iDAAiB,EAAE,OAAO,CAAC,CAAC;QAExC,OAAO,OAAO,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B,IAAG,CAAC;IAE7E;;;;OAIG;IACO,KAAK,CAAC,uBAAuB,CAAC,OAA0B,IAAG,CAAC;CACtE;AA/ED,kEA+EC","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\tIContainerRuntimeOptions,\n\tFluidDataStoreRegistry,\n\tContainerRuntime,\n} from \"@fluidframework/container-runtime\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { RuntimeRequestHandler, buildRuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport {\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tDependencyContainer,\n\tIFluidDependencySynthesizer,\n\tIProvideFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\nimport { RuntimeFactoryHelper } from \"@fluidframework/runtime-utils\";\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\n\n/**\n * BaseContainerRuntimeFactory produces container runtimes with the specified data store and service registries,\n * request handlers, runtimeOptions, and entryPoint initialization function.\n * It can be subclassed to implement a first-time initialization procedure for the containers it creates.\n */\nexport class BaseContainerRuntimeFactory\n\textends RuntimeFactoryHelper\n\timplements IProvideFluidDataStoreRegistry\n{\n\tpublic get IFluidDataStoreRegistry() {\n\t\treturn this.registry;\n\t}\n\tprivate readonly registry: IFluidDataStoreRegistry;\n\n\t/**\n\t * @param registryEntries - The data store registry for containers produced\n\t * @param dependencyContainer -\n\t * @param requestHandlers - Request handlers for containers produced\n\t * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it\n\t * @param initializeEntryPoint - Function that will initialize the entryPoint of the ContainerRuntime instances\n\t * created with this factory\n\t */\n\tconstructor(\n\t\tprivate readonly registryEntries: NamedFluidDataStoreRegistryEntries,\n\t\tprivate readonly dependencyContainer?: IFluidDependencySynthesizer,\n\t\tprivate readonly requestHandlers: RuntimeRequestHandler[] = [],\n\t\tprivate readonly runtimeOptions?: IContainerRuntimeOptions,\n\t\tprivate readonly initializeEntryPoint?: (\n\t\t\truntime: IContainerRuntime,\n\t\t) => Promise<FluidObject>,\n\t) {\n\t\tsuper();\n\t\tthis.registry = new FluidDataStoreRegistry(registryEntries);\n\t}\n\n\tpublic async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n\t\tawait this.containerInitializingFirstTime(runtime);\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\tpublic async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\tpublic async preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<ContainerRuntime> {\n\t\tconst scope: Partial<IProvideFluidDependencySynthesizer> = context.scope;\n\t\tconst dc = new DependencyContainer<FluidObject<IContainerRuntime>>(\n\t\t\tthis.dependencyContainer,\n\t\t\tscope.IFluidDependencySynthesizer,\n\t\t);\n\t\tscope.IFluidDependencySynthesizer = dc;\n\n\t\tconst runtime: ContainerRuntime = await ContainerRuntime.loadRuntime({\n\t\t\tcontext,\n\t\t\trequestHandler: buildRuntimeRequestHandler(...this.requestHandlers),\n\t\t\texisting,\n\t\t\truntimeOptions: this.runtimeOptions,\n\t\t\tregistryEntries: this.registryEntries,\n\t\t\tcontainerScope: scope,\n\t\t\tinitializeEntryPoint: this.initializeEntryPoint,\n\t\t});\n\n\t\t// we register the runtime so developers of providers can use it in the factory pattern.\n\t\tdc.register(IContainerRuntime, runtime);\n\n\t\treturn runtime;\n\t}\n\n\t/**\n\t * Subclasses may override containerInitializingFirstTime to perform any setup steps at the time the container\n\t * is created. This likely includes creating any initial data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime) {}\n\n\t/**\n\t * Subclasses may override containerHasInitialized to perform any steps after the container has initialized.\n\t * This likely includes loading any data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerHasInitialized(runtime: IContainerRuntime) {}\n}\n"]}
@@ -7,6 +7,7 @@ import { IFluidDataStoreFactory, NamedFluidDataStoreRegistryEntries } from "@flu
7
7
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
8
8
  import { IFluidDependencySynthesizer } from "@fluidframework/synthesize";
9
9
  import { RuntimeRequestHandler } from "@fluidframework/request-handler";
10
+ import { FluidObject } from "@fluidframework/core-interfaces";
10
11
  import { BaseContainerRuntimeFactory } from "./baseContainerRuntimeFactory";
11
12
  /**
12
13
  * A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from
@@ -17,7 +18,7 @@ import { BaseContainerRuntimeFactory } from "./baseContainerRuntimeFactory";
17
18
  export declare class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {
18
19
  protected readonly defaultFactory: IFluidDataStoreFactory;
19
20
  static readonly defaultDataStoreId = "default";
20
- constructor(defaultFactory: IFluidDataStoreFactory, registryEntries: NamedFluidDataStoreRegistryEntries, dependencyContainer?: IFluidDependencySynthesizer, requestHandlers?: RuntimeRequestHandler[], runtimeOptions?: IContainerRuntimeOptions);
21
+ constructor(defaultFactory: IFluidDataStoreFactory, registryEntries: NamedFluidDataStoreRegistryEntries, dependencyContainer?: IFluidDependencySynthesizer, requestHandlers?: RuntimeRequestHandler[], runtimeOptions?: IContainerRuntimeOptions, initializeEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>);
21
22
  /**
22
23
  * {@inheritDoc BaseContainerRuntimeFactory.containerInitializingFirstTime}
23
24
  */
@@ -1 +1 @@
1
- {"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AACjH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAI5E;;;;;GAKG;AACH,qBAAa,2CAA4C,SAAQ,2BAA2B;IAIpF,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,sBAAsB;IAH7D,gBAAuB,kBAAkB,aAAsB;gBAGxC,cAAc,EAAE,sBAAsB,EACzD,eAAe,EAAE,kCAAkC,EACnD,mBAAmB,CAAC,EAAE,2BAA2B,EACjD,eAAe,GAAE,qBAAqB,EAAO,EAC7C,cAAc,CAAC,EAAE,wBAAwB;IAa7C;;OAEG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB;CAI5E"}
1
+ {"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EACN,sBAAsB,EACtB,kCAAkC,EAClC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAI5E;;;;;GAKG;AACH,qBAAa,2CAA4C,SAAQ,2BAA2B;IAI1F,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,sBAAsB;IAH1D,gBAAuB,kBAAkB,aAAsB;gBAG3C,cAAc,EAAE,sBAAsB,EACzD,eAAe,EAAE,kCAAkC,EACnD,mBAAmB,CAAC,EAAE,2BAA2B,EACjD,eAAe,GAAE,qBAAqB,EAAO,EAC7C,cAAc,CAAC,EAAE,wBAAwB,EACzC,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,WAAW,CAAC;IAW5E;;OAEG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB;CAIzE"}
@@ -15,11 +15,8 @@ const defaultDataStoreId = "default";
15
15
  * This factory should be exposed as fluidExport off the entry point to your module.
16
16
  */
17
17
  class ContainerRuntimeFactoryWithDefaultDataStore extends baseContainerRuntimeFactory_1.BaseContainerRuntimeFactory {
18
- constructor(defaultFactory, registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions) {
19
- super(registryEntries, dependencyContainer, [
20
- (0, request_handlers_1.defaultRouteRequestHandler)(defaultDataStoreId),
21
- ...requestHandlers,
22
- ], runtimeOptions);
18
+ constructor(defaultFactory, registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions, initializeEntryPoint) {
19
+ super(registryEntries, dependencyContainer, [(0, request_handlers_1.defaultRouteRequestHandler)(defaultDataStoreId), ...requestHandlers], runtimeOptions, initializeEntryPoint);
23
20
  this.defaultFactory = defaultFactory;
24
21
  }
25
22
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.js","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,0DAAiE;AACjE,+EAA4E;AAE5E,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC;;;;;GAKG;AACH,MAAa,2CAA4C,SAAQ,yDAA2B;IAGxF,YACuB,cAAsC,EACzD,eAAmD,EACnD,mBAAiD,EACjD,kBAA2C,EAAE,EAC7C,cAAyC;QAEzC,KAAK,CACD,eAAe,EACf,mBAAmB,EACnB;YACI,IAAA,6CAA0B,EAAC,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,SAAS,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1E,MAAM,SAAS,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACpD,CAAC;;AA3BL,kGA4BC;AA3B0B,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 const dataStore = await runtime.createDataStore(this.defaultFactory.type);\n await dataStore.trySetAlias(defaultDataStoreId);\n }\n}\n"]}
1
+ {"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.js","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,0DAAiE;AACjE,+EAA4E;AAE5E,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC;;;;;GAKG;AACH,MAAa,2CAA4C,SAAQ,yDAA2B;IAG3F,YACoB,cAAsC,EACzD,eAAmD,EACnD,mBAAiD,EACjD,kBAA2C,EAAE,EAC7C,cAAyC,EACzC,oBAA2E;QAE3E,KAAK,CACJ,eAAe,EACf,mBAAmB,EACnB,CAAC,IAAA,6CAA0B,EAAC,kBAAkB,CAAC,EAAE,GAAG,eAAe,CAAC,EACpE,cAAc,EACd,oBAAoB,CACpB,CAAC;QAbiB,mBAAc,GAAd,cAAc,CAAwB;IAc1D,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B;QACxE,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC1E,MAAM,SAAS,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACjD,CAAC;;AA1BF,kGA2BC;AA1BuB,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 {\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IFluidDependencySynthesizer } from \"@fluidframework/synthesize\";\nimport { RuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\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\tpublic static readonly defaultDataStoreId = defaultDataStoreId;\n\n\tconstructor(\n\t\tprotected readonly defaultFactory: IFluidDataStoreFactory,\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries,\n\t\tdependencyContainer?: IFluidDependencySynthesizer,\n\t\trequestHandlers: RuntimeRequestHandler[] = [],\n\t\truntimeOptions?: IContainerRuntimeOptions,\n\t\tinitializeEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>,\n\t) {\n\t\tsuper(\n\t\t\tregistryEntries,\n\t\t\tdependencyContainer,\n\t\t\t[defaultRouteRequestHandler(defaultDataStoreId), ...requestHandlers],\n\t\t\truntimeOptions,\n\t\t\tinitializeEntryPoint,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc BaseContainerRuntimeFactory.containerInitializingFirstTime}\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime) {\n\t\tconst dataStore = await runtime.createDataStore(this.defaultFactory.type);\n\t\tawait dataStore.trySetAlias(defaultDataStoreId);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EACH,kCAAkC,EACrC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;;;GAOG;AACH,qBAAa,iBAAiB,CAAC,IAAI,SAAS,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,eAAe,GAAG,eAAe,CAClG,SAAQ,qBAAqB,CAAC,IAAI,EAAE,CAAC,CAAC;gBAElC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,KAAK,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,EAC9C,aAAa,wCAAiC,EAC9C,iBAAiB,EAAE,yBAAyB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,EACpE,eAAe,CAAC,EAAE,kCAAkC,EACpD,cAAc,GAAE,OAAO,qBAA6C;CAwB3E"}
1
+ {"version":3,"file":"dataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;;;;;GAOG;AACH,qBAAa,iBAAiB,CAC7B,IAAI,SAAS,UAAU,CAAC,CAAC,CAAC,EAC1B,CAAC,SAAS,eAAe,GAAG,eAAe,CAC1C,SAAQ,qBAAqB,CAAC,IAAI,EAAE,CAAC,CAAC;gBAEtC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,KAAK,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,EAC9C,aAAa,wCAAiC,EAC9C,iBAAiB,EAAE,yBAAyB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,EACpE,eAAe,CAAC,EAAE,kCAAkC,EACpD,cAAc,GAAE,OAAO,qBAA6C;CAiBrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"dataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6CAK6B;AAM7B,yDAAkE;AAGlE,mEAAgE;AAEhE;;;;;;;GAOG;AACH,MAAa,iBACT,SAAQ,6CAA8B;IACtC,YACI,IAAY,EACZ,IAA8C,EAC9C,gBAA4C,EAAE,EAC9C,iBAAoE,EACpE,eAAoD,EACpD,iBAA+C,iCAAqB;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,sBAAgB,CAAC,IAAI,CAAC,EAAE;YAC1E,sCAAsC;YACtC,aAAa,CAAC,IAAI,CAAC,qBAAe,CAAC,UAAU,EAAE,CAAC,CAAC;SACpD;QAED,0GAA0G;QAC1G,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,gBAAU,CAAC,IAAI,CAAC,EAAE;YACpE,gCAAgC;YAChC,aAAa,CAAC,IAAI,CAAC,eAAS,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;AAhCD,8CAgCC","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, 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 constructor(\n type: string,\n ctor: new (props: IDataObjectProps<I>) => TObj,\n sharedObjects: readonly IChannelFactory[] = [],\n optionalProviders: FluidObjectSymbolProvider<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"]}
1
+ {"version":3,"file":"dataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6CAA+F;AAI/F,yDAAkE;AAGlE,mEAAgE;AAEhE;;;;;;;GAOG;AACH,MAAa,iBAGX,SAAQ,6CAA8B;IACvC,YACC,IAAY,EACZ,IAA8C,EAC9C,gBAA4C,EAAE,EAC9C,iBAAoE,EACpE,eAAoD,EACpD,iBAA+C,iCAAqB;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,sBAAgB,CAAC,IAAI,CAAC,EAAE;YAC7E,sCAAsC;YACtC,aAAa,CAAC,IAAI,CAAC,qBAAe,CAAC,UAAU,EAAE,CAAC,CAAC;SACjD;QAED,0GAA0G;QAC1G,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,gBAAU,CAAC,IAAI,CAAC,EAAE;YACvE,gCAAgC;YAChC,aAAa,CAAC,IAAI,CAAC,eAAS,CAAC,UAAU,EAAE,CAAC,CAAC;SAC3C;QAED,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;IACtF,CAAC;CACD;AA3BD,8CA2BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { DirectoryFactory, MapFactory, SharedDirectory, SharedMap } from \"@fluidframework/map\";\nimport { NamedFluidDataStoreRegistryEntries } from \"@fluidframework/runtime-definitions\";\nimport { IChannelFactory } from \"@fluidframework/datastore-definitions\";\nimport { FluidObjectSymbolProvider } from \"@fluidframework/synthesize\";\nimport { FluidDataStoreRuntime } from \"@fluidframework/datastore\";\n\nimport { DataObject, DataObjectTypes, 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<\n\tTObj extends DataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObjectFactory<TObj, I> {\n\tconstructor(\n\t\ttype: string,\n\t\tctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects: readonly IChannelFactory[] = [],\n\t\toptionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\truntimeFactory: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n\t) {\n\t\tconst mergedObjects = [...sharedObjects];\n\n\t\tif (!sharedObjects.find((factory) => factory.type === DirectoryFactory.Type)) {\n\t\t\t// User did not register for directory\n\t\t\tmergedObjects.push(SharedDirectory.getFactory());\n\t\t}\n\n\t\t// TODO: Remove SharedMap factory when compatibility with SharedMap DataObject is no longer needed in 0.10\n\t\tif (!sharedObjects.find((factory) => factory.type === MapFactory.Type)) {\n\t\t\t// User did not register for map\n\t\t\tmergedObjects.push(SharedMap.getFactory());\n\t\t}\n\n\t\tsuper(type, ctor, mergedObjects, optionalProviders, registryEntries, runtimeFactory);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"pureDataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,YAAY,EAAe,MAAM,iCAAiC,CAAC;AACtF,OAAO,EACH,qBAAqB,EAGvB,MAAM,2BAA2B,CAAC;AAEpC,OAAO,EACH,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,8BAA8B,EAC9B,kCAAkC,EAClC,gCAAgC,EAChC,8BAA8B,EACjC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,eAAe,EAA0B,MAAM,uCAAuC,CAAC;AAChG,OAAO,EACH,yBAAyB,EAG5B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,eAAe,EAClB,MAAM,iBAAiB,CA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E,sBAAsB,EACnC,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC;IAOhB;;;;;;;;;OASG;IACU,cAAc,CACvB,OAAO,EAAE,qBAAqB,EAC9B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC;IAOhB;;;;;;;;;OASG;IACU,kBAAkB,CAC3B,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,iBAAiB,EAC1B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC;cAKA,yBAAyB,CACrC,gBAAgB,EAAE,qBAAqB,EACvC,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAC/B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC;cAKA,kBAAkB,CAC9B,OAAO,EAAE,8BAA8B,EACvC,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC;CAcnB"}
1
+ {"version":3,"file":"pureDataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAY,YAAY,EAAe,MAAM,iCAAiC,CAAC;AACtF,OAAO,EACN,qBAAqB,EAGrB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,8BAA8B,EAC9B,kCAAkC,EAClC,gCAAgC,EAChC,8BAA8B,EAC9B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,eAAe,EAA0B,MAAM,uCAAuC,CAAC;AAChG,OAAO,EACN,yBAAyB,EAGzB,MAAM,4BAA4B,CAAC;AAGpC,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AC,IAAI,CAAC;IAQhB;;;;;;;;;OASG;IACU,kBAAkB,CAC9B,WAAW,EAAE,sBAAsB,EACnC,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;IAQhB;;;;;;;;;OASG;IACU,cAAc,CAC1B,OAAO,EAAE,qBAAqB,EAC9B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;IAIhB;;;;;;;;;OASG;IACU,kBAAkB,CAC9B,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,iBAAiB,EAC1B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;cAKA,yBAAyB,CACxC,gBAAgB,EAAE,qBAAqB,EACvC,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAC/B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;cAKA,kBAAkB,CACjC,OAAO,EAAE,8BAA8B,EACvC,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;CAehB"}
@@ -12,7 +12,7 @@ const common_utils_1 = require("@fluidframework/common-utils");
12
12
  /**
13
13
  * Proxy over PureDataObject
14
14
  * Does delayed creation & initialization of PureDataObject
15
- */
15
+ */
16
16
  async function createDataObject(ctor, context, sharedObjectRegistry, optionalProviders, runtimeClassArg, existing, initProps) {
17
17
  // base
18
18
  let runtimeClass = runtimeClassArg;
@@ -79,7 +79,9 @@ class PureDataObjectFactory {
79
79
  }
80
80
  this.sharedObjectRegistry = new Map(sharedObjects.map((ext) => [ext.type, ext]));
81
81
  }
82
- get IFluidDataStoreFactory() { return this; }
82
+ get IFluidDataStoreFactory() {
83
+ return this;
84
+ }
83
85
  get IFluidDataStoreRegistry() {
84
86
  return this.registry;
85
87
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yDAIoC;AACpC,yEAA2E;AAa3E,2DAIoC;AAEpC,+DAAsD;AAetD;;;EAGE;AACF,KAAK,UAAU,gBAAgB,CAC3B,IAA8C,EAC9C,OAA+B,EAC/B,oBAA2C,EAC3C,iBAAoE,EACpE,eAA6C,EAC7C,QAAiB,EACjB,SAA6B;IAC7B,OAAO;IACP,IAAI,YAAY,GAAG,eAAe,CAAC;IAEnC,mBAAmB;IACnB,YAAY,GAAG,IAAA,+BAAmB,EAC9B,KAAK,EAAE,OAAiB,EAAE,UAAiC,EAAE,EAAE;;QAC3D,MAAM,WAAW,GAA0C,MAAM,CAAA,MAAA,UAAU,CAAC,UAAU,0CAAE,GAAG,EAAE,CAAA,CAAC;QAC9F,IAAA,qBAAM,EAAC,WAAW,KAAK,SAAS,EAAE,KAAK,CAAC,oDAAoD,CAAC,CAAC;QAC9F,IAAA,qBAAM,EAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,MAAK,SAAS,EAC1C,KAAK,CAAC,0DAA0D,CAAC,CAAC;QACtE,OAAO,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC,EACD,YAAY,CAAC,CAAC;IAElB,0CAA0C;IAC1C,6EAA6E;IAC7E,MAAM,OAAO,GAA0B,IAAI,YAAY,CACnD,OAAO,EACP,oBAAoB,EACpB,QAAQ,EACR,KAAK,EAAE,EAA0B,EAAE,EAAE;QACjC,IAAA,qBAAM,EAAC,QAAQ,KAAK,SAAS,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACpE,sGAAsG;QACtG,yGAAyG;QACzG,oFAAoF;QACpF,MAAM,QAAQ,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC1C,OAAO,Q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C,yBAAyB,CACjC,OAAO,EACP,CAAC,IAAI,CAAC,IAAI,CAAC,EACX,YAAY,CAAC,CAAC;IACtB,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,kBAAkB,CAC3B,eAAuB,EACvB,OAA0B,EAC1B,YAAgC;QAEhC,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,YAAgC;QAEhC,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,YAAgC;QAEhC,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;AAjKD,sDAiKC","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, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport {\n FluidObjectSymbolProvider,\n DependencyContainer,\n IFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport {\n IDataObjectProps,\n PureDataObject,\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<I[\"OptionalProviders\"]>,\n runtimeClassArg: typeof FluidDataStoreRuntime,\n existing: boolean,\n initProps?: I[\"InitialState\"]) {\n // base\n let runtimeClass = runtimeClassArg;\n\n // request mixin in\n runtimeClass = mixinRequestHandler(\n async (request: IRequest, runtimeArg: FluidDataStoreRuntime) => {\n const maybeRouter: FluidObject<IFluidRouter> | undefined = await runtimeArg.entryPoint?.get();\n assert(maybeRouter !== undefined, 0x468 /* entryPoint should have been initialized by now */);\n assert(maybeRouter?.IFluidRouter !== undefined,\n 0x469 /* Data store runtime entryPoint is not an IFluidRouter */);\n return maybeRouter?.IFluidRouter.request(request);\n },\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: FluidDataStoreRuntime = new runtimeClass(\n context,\n sharedObjectRegistry,\n existing,\n async (rt: IFluidDataStoreRuntime) => {\n assert(instance !== undefined, 0x46a /* entryPoint is undefined */);\n // Calling finishInitialization here like PureDataObject.getDataObject did, to keep the same behavior,\n // since accessing the runtime's entryPoint is how we want the data object to be retrieved going forward.\n // Without this I ran into issues with the load-existing flow not working correctly.\n await instance.finishInitialization(true);\n return instance;\n },\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 DDSes 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<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 DDSes, 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 DDSes 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 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<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?: 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?: 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?: 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?: 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?: 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?: 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"]}
1
+ {"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yDAImC;AACnC,yEAA2E;AAa3E,2DAIoC;AAEpC,+DAAsD;AAStD;;;GAGG;AACH,KAAK,UAAU,gBAAgB,CAI9B,IAA8C,EAC9C,OAA+B,EAC/B,oBAA2C,EAC3C,iBAAoE,EACpE,eAA6C,EAC7C,QAAiB,EACjB,SAA6B;IAE7B,OAAO;IACP,IAAI,YAAY,GAAG,eAAe,CAAC;IAEnC,mBAAmB;IACnB,YAAY,GAAG,IAAA,+BAAmB,EACjC,KAAK,EAAE,OAAiB,EAAE,UAAiC,EAAE,EAAE;;QAC9D,MAAM,WAAW,GAChB,MAAM,CAAA,MAAA,UAAU,CAAC,UAAU,0CAAE,GAAG,EAAE,CAAA,CAAC;QACpC,IAAA,qBAAM,EACL,WAAW,KAAK,SAAS,EACzB,KAAK,CAAC,oDAAoD,CAC1D,CAAC;QACF,IAAA,qBAAM,EACL,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,MAAK,SAAS,EACvC,KAAK,CAAC,0DAA0D,CAChE,CAAC;QACF,OAAO,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC,EACD,YAAY,CACZ,CAAC;IAEF,0CAA0C;IAC1C,6EAA6E;I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;QAE3C,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AA1KD,sDA0KC","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\tFluidDataStoreRuntime,\n\tISharedObjectRegistry,\n\tmixinRequestHandler,\n} from \"@fluidframework/datastore\";\nimport { FluidDataStoreRegistry } from \"@fluidframework/container-runtime\";\nimport {\n\tIFluidDataStoreContext,\n\tIContainerRuntimeBase,\n\tIFluidDataStoreFactory,\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n\tIFluidDataStoreContextDetached,\n} from \"@fluidframework/runtime-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IChannelFactory, IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport {\n\tFluidObjectSymbolProvider,\n\tDependencyContainer,\n\tIFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { IDataObjectProps, PureDataObject, DataObjectTypes } 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\tcreateRootInstance(rootDataStoreId: string, runtime: IContainerRuntime): Promise<IFluidRouter>;\n}\n\n/**\n * Proxy over PureDataObject\n * Does delayed creation & initialization of PureDataObject\n */\nasync function createDataObject<\n\tTObj extends PureDataObject,\n\tI extends DataObjectTypes = DataObjectTypes,\n>(\n\tctor: new (props: IDataObjectProps<I>) => TObj,\n\tcontext: IFluidDataStoreContext,\n\tsharedObjectRegistry: ISharedObjectRegistry,\n\toptionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\truntimeClassArg: typeof FluidDataStoreRuntime,\n\texisting: boolean,\n\tinitProps?: I[\"InitialState\"],\n) {\n\t// base\n\tlet runtimeClass = runtimeClassArg;\n\n\t// request mixin in\n\truntimeClass = mixinRequestHandler(\n\t\tasync (request: IRequest, runtimeArg: FluidDataStoreRuntime) => {\n\t\t\tconst maybeRouter: FluidObject<IFluidRouter> | undefined =\n\t\t\t\tawait runtimeArg.entryPoint?.get();\n\t\t\tassert(\n\t\t\t\tmaybeRouter !== undefined,\n\t\t\t\t0x468 /* entryPoint should have been initialized by now */,\n\t\t\t);\n\t\t\tassert(\n\t\t\t\tmaybeRouter?.IFluidRouter !== undefined,\n\t\t\t\t0x469 /* Data store runtime entryPoint is not an IFluidRouter */,\n\t\t\t);\n\t\t\treturn maybeRouter?.IFluidRouter.request(request);\n\t\t},\n\t\truntimeClass,\n\t);\n\n\t// Create a new runtime for our data store\n\t// The runtime is what Fluid uses to create DDS' and route to your data store\n\tconst runtime: FluidDataStoreRuntime = new runtimeClass(\n\t\tcontext,\n\t\tsharedObjectRegistry,\n\t\texisting,\n\t\tasync (rt: IFluidDataStoreRuntime) => {\n\t\t\tassert(instance !== undefined, 0x46a /* entryPoint is undefined */);\n\t\t\t// Calling finishInitialization here like PureDataObject.getDataObject did, to keep the same behavior,\n\t\t\t// since accessing the runtime's entryPoint is how we want the data object to be retrieved going forward.\n\t\t\t// Without this I ran into issues with the load-existing flow not working correctly.\n\t\t\tawait instance.finishInitialization(true);\n\t\t\treturn instance;\n\t\t},\n\t);\n\n\t// Create object right away.\n\t// This allows object to register various callbacks with runtime before runtime\n\t// becomes globally available. But it's not full initialization - constructor can't\n\t// access DDSes or other services of runtime as objects are not fully initialized.\n\t// In order to use object, we need to go through full initialization by calling finishInitialization().\n\tconst scope: FluidObject<IFluidDependencySynthesizer> = context.scope;\n\tconst dependencyContainer = new DependencyContainer(scope.IFluidDependencySynthesizer);\n\tconst providers = dependencyContainer.synthesize<I[\"OptionalProviders\"]>(optionalProviders, {});\n\tconst instance = new ctor({ runtime, context, providers, initProps });\n\n\t// if it's a newly created object, we need to wait for it to finish initialization\n\t// as that results in creation of DDSes, before it gets attached, providing atomic\n\t// guarantee of creation.\n\t// WARNING: we can't do the same (yet) for already existing PureDataObject!\n\t// This will result in deadlock, as it tries to resolve internal handles, but any\n\t// handle resolution goes through root (container runtime), which can't route it back\n\t// to this data store, as it's still not initialized and not known to container runtime yet.\n\t// In the future, we should address it by using relative paths for handles and be able to resolve\n\t// local DDSes while data store is not fully initialized.\n\tif (!existing) {\n\t\tawait instance.finishInitialization(existing);\n\t}\n\n\treturn { 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<\n\tTObj extends PureDataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> implements\n\t\tIFluidDataStoreFactory,\n\t\tPartial<IProvideFluidDataStoreRegistry>,\n\t\tIRootDataObjectFactory\n{\n\tprivate readonly sharedObjectRegistry: ISharedObjectRegistry;\n\tprivate readonly registry: IFluidDataStoreRegistry | undefined;\n\n\tconstructor(\n\t\tpublic readonly type: string,\n\t\tprivate readonly ctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects: readonly IChannelFactory[],\n\t\tprivate readonly optionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\tprivate readonly runtimeClass: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n\t) {\n\t\tif (this.type === \"\") {\n\t\t\tthrow new Error(\"undefined type member\");\n\t\t}\n\t\tif (registryEntries !== undefined) {\n\t\t\tthis.registry = new FluidDataStoreRegistry(registryEntries);\n\t\t}\n\t\tthis.sharedObjectRegistry = new Map(sharedObjects.map((ext) => [ext.type, ext]));\n\t}\n\n\tpublic get IFluidDataStoreFactory() {\n\t\treturn this;\n\t}\n\n\tpublic get IFluidDataStoreRegistry() {\n\t\treturn this.registry;\n\t}\n\n\t/**\n\t * Convenience helper to get the data store's/factory's data store registry entry.\n\t * The return type hides the factory's generics, easing grouping of registry\n\t * entries that differ only in this way into the same array.\n\t * @returns The NamedFluidDataStoreRegistryEntry\n\t */\n\tpublic get registryEntry(): NamedFluidDataStoreRegistryEntry {\n\t\treturn [this.type, Promise.resolve(this)];\n\t}\n\n\t/**\n\t * This is where we do data store setup.\n\t *\n\t * @param context - data store context used to load a data store runtime\n\t */\n\tpublic async instantiateDataStore(context: IFluidDataStoreContext, existing: boolean) {\n\t\tconst { runtime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\texisting,\n\t\t);\n\n\t\treturn runtime;\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses parent context's registry to build package path to this factory.\n\t * In other words, registry of context passed in has to contain this factory, with the name that matches\n\t * this factory's type.\n\t * It is intended to be used by data store objects that create sub-objects.\n\t * @param context - The context being used to create the runtime\n\t * (the created object will have its own new context created as well)\n\t * @param initialState - The initial state to provide to the created data store.\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createChildInstance(\n\t\tparentContext: IFluidDataStoreContext,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(\n\t\t\tparentContext.containerRuntime,\n\t\t\t[...parentContext.packagePath, this.type],\n\t\t\tinitialState,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory.\n\t * In other words, registry of context passed in has to have this factory.\n\t * Intended to be used by data store objects that need to create peers (similar) instances of existing objects.\n\t * @param context - The component context being used to create the object\n\t * (the created object will have its own new context created as well)\n\t * @param initialState - The initial state to provide to the created component.\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createPeerInstance(\n\t\tpeerContext: IFluidDataStoreContext,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(\n\t\t\tpeerContext.containerRuntime,\n\t\t\tpeerContext.packagePath,\n\t\t\tinitialState,\n\t\t);\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses container's registry to find this factory.\n\t * It's expected that only container owners would use this functionality, as only such developers\n\t * have knowledge of entries in container registry.\n\t * The name in this registry for such record should match type of this factory.\n\t * @param runtime - container runtime. It's registry is used to create an object.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createInstance(\n\t\truntime: IContainerRuntimeBase,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(runtime, [this.type], initialState);\n\t}\n\n\t/**\n\t * Creates a new root instance of the object. Uses container's registry to find this factory.\n\t * It's expected that only container owners would use this functionality, as only such developers\n\t * have knowledge of entries in container registry.\n\t * The name in this registry for such record should match type of this factory.\n\t * @param runtime - container runtime. It's registry is used to create an object.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @returns an object created by this factory. Data store and objects created are not attached to container.\n\t * They get attached only when a handle to one of them is attached to already attached objects.\n\t */\n\tpublic async createRootInstance(\n\t\trootDataStoreId: string,\n\t\truntime: IContainerRuntime,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\tconst context = runtime.createDetachedRootDataStore([this.type], rootDataStoreId);\n\t\treturn this.createInstanceCore(context, initialState);\n\t}\n\n\tprotected async createNonRootInstanceCore(\n\t\tcontainerRuntime: IContainerRuntimeBase,\n\t\tpackagePath: Readonly<string[]>,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\tconst context = containerRuntime.createDetachedDataStore(packagePath);\n\t\treturn this.createInstanceCore(context, initialState);\n\t}\n\n\tprotected async createInstanceCore(\n\t\tcontext: IFluidDataStoreContextDetached,\n\t\tinitialState?: I[\"InitialState\"],\n\t): Promise<TObj> {\n\t\tconst { instance, runtime } = await createDataObject(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\tfalse, // existing\n\t\t\tinitialState,\n\t\t);\n\n\t\tawait context.attachRuntime(this, runtime);\n\n\t\treturn instance;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dataObject.d.ts","sourceRoot":"","sources":["../../src/data-objects/dataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,QAAQ,EACR,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAA+B,MAAM,qBAAqB,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;;;;GASG;AACH,8BAAsB,UAAU,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IACnG,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;IAE1C;;OAEG;IACU,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;IAc3D;;;OAGG;IACH,SAAS,KAAK,IAAI,IAAI,gBAAgB,CAMrC;IAED;;;OAGG;IACU,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBjE;;;OAGG;IACH,SAAS,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAG9D"}
1
+ {"version":3,"file":"dataObject.d.ts","sourceRoot":"","sources":["../../src/data-objects/dataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAA+B,MAAM,qBAAqB,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;;;;;;;;GASG;AACH,8BAAsB,UAAU,CAC/B,CAAC,SAAS,eAAe,GAAG,eAAe,CAC1C,SAAQ,cAAc,CAAC,CAAC,CAAC;IAC1B,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;IAE1C;;OAEG;IACU,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;IAc3D;;;OAGG;IACH,SAAS,KAAK,IAAI,IAAI,gBAAgB,CAMrC;IAED;;;OAGG;IACU,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BjE;;;OAGG;IACH,SAAS,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAG3D"}
@@ -62,7 +62,7 @@ class DataObject extends pureDataObject_1.PureDataObject {
62
62
  }
63
63
  else {
64
64
  // data store has a root directory so we just need to set it before calling initializingFromExisting
65
- this.internalRoot = await this.runtime.getChannel(this.rootDirectoryId);
65
+ this.internalRoot = (await this.runtime.getChannel(this.rootDirectoryId));
66
66
  // This will actually be an ISharedMap if the channel was previously created by the older version of
67
67
  // DataObject which used a SharedMap. Since SharedMap and SharedDirectory are compatible unless
68
68
  // SharedDirectory-only commands are used on SharedMap, this will mostly just work for compatibility.
@@ -1 +1 @@
1
- {"version":3,"file":"dataObject.js","sourceRoot":"","sources":["../../src/data-objects/dataObject.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,CAAC,aAAa,EAAE,CAAC;SACrC;aAAM;YACH,oGAAoG;YACpG,IAAI,CAAC,YAAY,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAqB,CAAC;YAE5F,oGAAoG;YACpG,gGAAgG;YAChG,qGAAqG;YACrG,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,KAAK,gBAAU,CAAC,IAAI,EAAE;gBACvD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;oBACrB,QAAQ,EAAE,SAAS;oBACnB,SAAS,EAAE,eAAe;oBAC1B,OAAO,EAAE,6EAA6E;iBACzF,CAAC,CAAC;aACN;SACJ;QAED,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACO,2BAA2B,CAAC,IAAY;QAC9C,OAAO,GAAG,IAAI,6CAA6C,CAAC;IAChE,CAAC;CACJ;AApED,gCAoEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n IRequest,\n IResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { ISharedDirectory, MapFactory, SharedDirectory } from \"@fluidframework/map\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils\";\nimport { PureDataObject } from \"./pureDataObject\";\nimport { DataObjectTypes } from \"./types\";\n\n/**\n * DataObject is a base data store that is primed with a root directory. It\n * ensures that it is created and ready before you can access it.\n *\n * Having a single root directory allows for easier development. Instead of creating\n * and registering channels with the runtime any new DDS that is set on the root\n * will automatically be registered.\n *\n * @typeParam I - The optional input types used to strongly type the data object\n */\nexport abstract class DataObject<I extends DataObjectTypes = DataObjectTypes> extends PureDataObject<I> {\n private internalRoot: ISharedDirectory | undefined;\n private readonly rootDirectoryId = \"root\";\n\n /**\n * {@inheritDoc PureDataObject.request}\n */\n public async request(request: IRequest): Promise<IResponse> {\n const requestParser = RequestParser.create(request);\n const itemId = requestParser.pathParts[0];\n if (itemId === \"bigBlobs\") {\n const value = this.root.get<string>(requestParser.pathParts.join(\"/\"));\n if (value === undefined) {\n return create404Response(requestParser);\n }\n return { mimeType: \"fluid/object\", status: 200, value };\n } else {\n return super.request(requestParser);\n }\n }\n\n /**\n * The root directory will either be ready or will return an error. If an error is thrown\n * the root has not been correctly created/set.\n */\n protected get root(): ISharedDirectory {\n if (!this.internalRoot) {\n throw new Error(this.getUninitializedErrorString(`root`));\n }\n\n return this.internalRoot;\n }\n\n /**\n * Initializes internal objects and calls initialization overrides.\n * Caller is responsible for ensuring this is only invoked once.\n */\n public async initializeInternal(existing: boolean): Promise<void> {\n if (!existing) {\n // Create a root directory and register it before calling initializingFirstTime\n this.internalRoot = SharedDirectory.create(this.runtime, this.rootDirectoryId);\n this.internalRoot.bindToContext();\n } else {\n // data store has a root directory so we just need to set it before calling initializingFromExisting\n this.internalRoot = await this.runtime.getChannel(this.rootDirectoryId) as ISharedDirectory;\n\n // This will actually be an ISharedMap if the channel was previously created by the older version of\n // DataObject which used a SharedMap. Since SharedMap and SharedDirectory are compatible unless\n // SharedDirectory-only commands are used on SharedMap, this will mostly just work for compatibility.\n if (this.internalRoot.attributes.type === MapFactory.Type) {\n this.runtime.logger.send({\n category: \"generic\",\n eventName: \"MapDataObject\",\n message: \"Legacy document, SharedMap is masquerading as SharedDirectory in DataObject\",\n });\n }\n }\n\n await super.initializeInternal(existing);\n }\n\n /**\n * Generates an error string indicating an item is uninitialized.\n * @param item - The name of the item that was uninitialized.\n */\n protected getUninitializedErrorString(item: string): string {\n return `${item} must be initialized before being accessed.`;\n }\n}\n"]}
1
+ {"version":3,"file":"dataObject.js","sourceRoot":"","sources":["../../src/data-objects/dataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,6CAAoF;AACpF,iEAAiF;AACjF,qDAAkD;AAGlD;;;;;;;;;GASG;AACH,MAAsB,UAEpB,SAAQ,+BAAiB;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CAAC,eAAe,CACpB,CAAqB,CAAC;YAEvB,oGAAoG;YACpG,gGAAgG;YAChG,qGAAqG;YACrG,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,KAAK,gBAAU,CAAC,IAAI,EAAE;gBAC1D,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;oBACxB,QAAQ,EAAE,SAAS;oBACnB,SAAS,EAAE,eAAe;oBAC1B,OAAO,EACN,6EAA6E;iBAC9E,CAAC,CAAC;aACH;SACD;QAED,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACO,2BAA2B,CAAC,IAAY;QACjD,OAAO,GAAG,IAAI,6CAA6C,CAAC;IAC7D,CAAC;CACD;AAzED,gCAyEC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { ISharedDirectory, MapFactory, SharedDirectory } from \"@fluidframework/map\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils\";\nimport { PureDataObject } from \"./pureDataObject\";\nimport { DataObjectTypes } from \"./types\";\n\n/**\n * DataObject is a base data store that is primed with a root directory. It\n * ensures that it is created and ready before you can access it.\n *\n * Having a single root directory allows for easier development. Instead of creating\n * and registering channels with the runtime any new DDS that is set on the root\n * will automatically be registered.\n *\n * @typeParam I - The optional input types used to strongly type the data object\n */\nexport abstract class DataObject<\n\tI extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObject<I> {\n\tprivate internalRoot: ISharedDirectory | undefined;\n\tprivate readonly rootDirectoryId = \"root\";\n\n\t/**\n\t * {@inheritDoc PureDataObject.request}\n\t */\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\tconst requestParser = RequestParser.create(request);\n\t\tconst itemId = requestParser.pathParts[0];\n\t\tif (itemId === \"bigBlobs\") {\n\t\t\tconst value = this.root.get<string>(requestParser.pathParts.join(\"/\"));\n\t\t\tif (value === undefined) {\n\t\t\t\treturn create404Response(requestParser);\n\t\t\t}\n\t\t\treturn { mimeType: \"fluid/object\", status: 200, value };\n\t\t} else {\n\t\t\treturn super.request(requestParser);\n\t\t}\n\t}\n\n\t/**\n\t * The root directory will either be ready or will return an error. If an error is thrown\n\t * the root has not been correctly created/set.\n\t */\n\tprotected get root(): ISharedDirectory {\n\t\tif (!this.internalRoot) {\n\t\t\tthrow new Error(this.getUninitializedErrorString(`root`));\n\t\t}\n\n\t\treturn this.internalRoot;\n\t}\n\n\t/**\n\t * Initializes internal objects and calls initialization overrides.\n\t * Caller is responsible for ensuring this is only invoked once.\n\t */\n\tpublic async initializeInternal(existing: boolean): Promise<void> {\n\t\tif (!existing) {\n\t\t\t// Create a root directory and register it before calling initializingFirstTime\n\t\t\tthis.internalRoot = SharedDirectory.create(this.runtime, this.rootDirectoryId);\n\t\t\tthis.internalRoot.bindToContext();\n\t\t} else {\n\t\t\t// data store has a root directory so we just need to set it before calling initializingFromExisting\n\t\t\tthis.internalRoot = (await this.runtime.getChannel(\n\t\t\t\tthis.rootDirectoryId,\n\t\t\t)) as ISharedDirectory;\n\n\t\t\t// This will actually be an ISharedMap if the channel was previously created by the older version of\n\t\t\t// DataObject which used a SharedMap. Since SharedMap and SharedDirectory are compatible unless\n\t\t\t// SharedDirectory-only commands are used on SharedMap, this will mostly just work for compatibility.\n\t\t\tif (this.internalRoot.attributes.type === MapFactory.Type) {\n\t\t\t\tthis.runtime.logger.send({\n\t\t\t\t\tcategory: \"generic\",\n\t\t\t\t\teventName: \"MapDataObject\",\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t\"Legacy document, SharedMap is masquerading as SharedDirectory in DataObject\",\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tawait super.initializeInternal(existing);\n\t}\n\n\t/**\n\t * Generates an error string indicating an item is uninitialized.\n\t * @param item - The name of the item that was uninitialized.\n\t */\n\tprotected getUninitializedErrorString(item: string): string {\n\t\treturn `${item} must be initialized before being accessed.`;\n\t}\n}\n"]}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { IEvent } from "@fluidframework/common-definitions";
6
6
  import { EventForwarder } from "@fluidframework/common-utils";
7
- import { IFluidHandle, IFluidLoadable, IFluidRouter, IProvideFluidHandle, IRequest, IResponse, FluidObject } from "@fluidframework/core-interfaces";
7
+ import { IFluidHandle, IFluidLoadable, IFluidRouter, IProvideFluidHandle, IRequest, IResponse } from "@fluidframework/core-interfaces";
8
8
  import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
9
9
  import { IDirectory } from "@fluidframework/map";
10
10
  import { IFluidDataStoreContext } from "@fluidframework/runtime-definitions";
@@ -82,11 +82,6 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
82
82
  * define custom types/getters for object retrieval
83
83
  */
84
84
  getFluidObjectFromDirectory<T extends IFluidLoadable>(key: string, directory: IDirectory, getObjectFromDirectory?: (id: string, directory: IDirectory) => IFluidHandle | undefined): Promise<T | undefined>;
85
- /**
86
- * Gets the service at a given id.
87
- * @param id - service id
88
- */
89
- protected getService<T extends FluidObject>(id: string): Promise<T>;
90
85
  /**
91
86
  * Called every time the data store is initialized, before initializingFirstTime or
92
87
  * initializingFromExisting is called.
@@ -1 +1 @@
1
- {"version":3,"file":"pureDataObject.d.ts","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAU,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EACH,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,WAAW,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,qB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