@fluidframework/aqueduct 2.0.0-internal.3.2.2 → 2.0.0-internal.3.3.1

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 (35) hide show
  1. package/README.md +1 -1
  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 +17 -6
  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 -2
  9. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  10. package/dist/container-services/containerServices.d.ts +17 -0
  11. package/dist/container-services/containerServices.d.ts.map +1 -1
  12. package/dist/container-services/containerServices.js +14 -0
  13. package/dist/container-services/containerServices.js.map +1 -1
  14. package/dist/data-objects/pureDataObject.d.ts +1 -0
  15. package/dist/data-objects/pureDataObject.d.ts.map +1 -1
  16. package/dist/data-objects/pureDataObject.js +1 -0
  17. package/dist/data-objects/pureDataObject.js.map +1 -1
  18. package/dist/test/tsconfig.tsbuildinfo +1 -1
  19. package/dist/test/types/validateAqueductPrevious.generated.js +8 -8
  20. package/dist/test/types/validateAqueductPrevious.generated.js.map +1 -1
  21. package/dist/utils/attachUtils.d.ts +3 -0
  22. package/dist/utils/attachUtils.d.ts.map +1 -1
  23. package/dist/utils/attachUtils.js +3 -0
  24. package/dist/utils/attachUtils.js.map +1 -1
  25. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js +17 -6
  26. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
  27. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +2 -2
  28. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  29. package/lib/container-services/containerServices.js +14 -0
  30. package/lib/container-services/containerServices.js.map +1 -1
  31. package/lib/data-objects/pureDataObject.js +1 -0
  32. package/lib/data-objects/pureDataObject.js.map +1 -1
  33. package/lib/utils/attachUtils.js +3 -0
  34. package/lib/utils/attachUtils.js.map +1 -1
  35. package/package.json +19 -23
package/README.md CHANGED
@@ -166,7 +166,7 @@ developer to:
166
166
 
167
167
  - Define the registry of data objects that can be created
168
168
  - Declare the default data object
169
- - Use [provider entries](#provider-entries-development)
169
+ - Use provider entries
170
170
  - Declare Container level [Request Handlers](#container-level-request-handlers)
171
171
 
172
172
  ## Container object example
@@ -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,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;AAGrE;;;;GAIG;AACH,qBAAa,2BACZ,SAAQ,oBACR,YAAW,8BAA8B;IAcxC,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;IAfjC,IAAW,uBAAuB,4BAEjC;IACD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;IAEnD;;;;;OAKG;gBAEe,eAAe,EAAE,kCAAkC,EACnD,mBAAmB,CAAC,yCAA6B,EACjD,eAAe,GAAE,qBAAqB,EAAO,EAC7C,cAAc,CAAC,sCAA0B;IAM9C,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;IAuB5B;;;;OAIG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB;IAEzE;;;;OAIG;cACa,uBAAuB,CAAC,OAAO,EAAE,iBAAiB;CAClE"}
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,23 +11,26 @@ 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
36
  get IFluidDataStoreRegistry() {
@@ -44,7 +47,15 @@ class BaseContainerRuntimeFactory extends runtime_utils_1.RuntimeFactoryHelper {
44
47
  const scope = context.scope;
45
48
  const dc = new synthesize_1.DependencyContainer(this.dependencyContainer, scope.IFluidDependencySynthesizer);
46
49
  scope.IFluidDependencySynthesizer = dc;
47
- 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
+ });
48
59
  // we register the runtime so developers of providers can use it in the factory pattern.
49
60
  dc.register(container_runtime_definitions_1.IContainerRuntime, runtime);
50
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,iGAAkF;AAClF,qEAAoG;AAMpG,2DAIoC;AACpC,iEAAqE;AAGrE;;;;GAIG;AACH,MAAa,2BACZ,SAAQ,oCAAoB;IAQ5B;;;;;OAKG;IACH,YACkB,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;IAC7D,CAAC;IAnBD,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAmBM,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,IAAI,CAC5D,OAAO,EACP,IAAI,CAAC,eAAe,EACpB,IAAA,4CAA0B,EAAC,GAAG,IAAI,CAAC,eAAe,CAAC,EACnD,IAAI,CAAC,cAAc,EACnB,KAAK,EACL,QAAQ,CACR,CAAC;QAEF,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;AAzED,kEAyEC","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 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\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 serviceRegistry - The service registry for containers produced\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 */\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) {\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.load(\n\t\t\tcontext,\n\t\t\tthis.registryEntries,\n\t\t\tbuildRuntimeRequestHandler(...this.requestHandlers),\n\t\t\tthis.runtimeOptions,\n\t\t\tscope,\n\t\t\texisting,\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"]}
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,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;AAExE,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;IAU1C;;OAEG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB;CAIzE"}
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,8 +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, [(0, request_handlers_1.defaultRouteRequestHandler)(defaultDataStoreId), ...requestHandlers], runtimeOptions);
18
+ constructor(defaultFactory, registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions, initializeEntryPoint) {
19
+ super(registryEntries, dependencyContainer, [(0, request_handlers_1.defaultRouteRequestHandler)(defaultDataStoreId), ...requestHandlers], runtimeOptions, initializeEntryPoint);
20
20
  this.defaultFactory = defaultFactory;
21
21
  }
22
22
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.js","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAUH,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;QAEzC,KAAK,CACJ,eAAe,EACf,mBAAmB,EACnB,CAAC,IAAA,6CAA0B,EAAC,kBAAkB,CAAC,EAAE,GAAG,eAAe,CAAC,EACpE,cAAc,CACd,CAAC;QAXiB,mBAAc,GAAd,cAAc,CAAwB;IAY1D,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;;AAxBF,kGAyBC;AAxBuB,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 { 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) {\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);\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
+ {"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"]}
@@ -5,23 +5,40 @@
5
5
  import { IResponse, IFluidRouter, IRequest, FluidObject } from "@fluidframework/core-interfaces";
6
6
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
7
7
  import { RuntimeRequestHandler } from "@fluidframework/request-handler";
8
+ /**
9
+ * @deprecated See {@link @fluidframework/synthesize#DependencyContainer}
10
+ */
8
11
  export declare const serviceRoutePathRoot = "_services";
12
+ /**
13
+ * @deprecated See {@link @fluidframework/synthesize#DependencyContainer}
14
+ */
9
15
  export declare type ContainerServiceRegistryEntries = Iterable<[
10
16
  string,
11
17
  (runtime: IContainerRuntime) => Promise<FluidObject>
12
18
  ]>;
13
19
  /**
14
20
  * This class is a simple starter class for building a Container Service. It simply provides routing
21
+ * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class
15
22
  */
16
23
  export declare abstract class BaseContainerService implements IFluidRouter {
17
24
  protected readonly runtime: IContainerRuntime;
25
+ /**
26
+ * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class
27
+ */
18
28
  get IFluidRouter(): this;
29
+ /**
30
+ * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class
31
+ */
19
32
  constructor(runtime: IContainerRuntime);
33
+ /**
34
+ * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class
35
+ */
20
36
  request(request: IRequest): Promise<IResponse>;
21
37
  }
22
38
  /**
23
39
  * Given a collection of IContainerServices will produce a RequestHandler for them all
24
40
  * @param serviceRegistry - Collection of Container Services
41
+ * @deprecated See {@link @fluidframework/synthesize#DependencyContainer}
25
42
  */
26
43
  export declare const generateContainerServicesRequestHandler: (serviceRegistry: ContainerServiceRegistryEntries) => RuntimeRequestHandler;
27
44
  //# sourceMappingURL=containerServices.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"containerServices.d.ts","sourceRoot":"","sources":["../../src/container-services/containerServices.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAQxE,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAEhD,oBAAY,+BAA+B,GAAG,QAAQ,CACrD;IAAC,MAAM;IAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,WAAW,CAAC;CAAC,CAC9D,CAAC;AAEF;;GAEG;AACH,8BAAsB,oBAAqB,YAAW,YAAY;IAKrD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,iBAAiB;IAJzD,IAAW,YAAY,SAEtB;gBAE8B,OAAO,EAAE,iBAAiB;IAE5C,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;CAO3D;AAoBD;;;GAGG;AACH,eAAO,MAAM,uCAAuC,wDAEjD,qBAkDF,CAAC"}
1
+ {"version":3,"file":"containerServices.d.ts","sourceRoot":"","sources":["../../src/container-services/containerServices.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAQxE;;GAEG;AACH,eAAO,MAAM,oBAAoB,cAAc,CAAC;AAEhD;;GAEG;AACH,oBAAY,+BAA+B,GAAG,QAAQ,CACrD;IAAC,MAAM;IAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,WAAW,CAAC;CAAC,CAC9D,CAAC;AAEF;;;GAGG;AACH,8BAAsB,oBAAqB,YAAW,YAAY;IAWrD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,iBAAiB;IAVzD;;OAEG;IACH,IAAW,YAAY,SAEtB;IAED;;OAEG;gBAC4B,OAAO,EAAE,iBAAiB;IAEzD;;OAEG;IACU,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;CAO3D;AAoBD;;;;GAIG;AACH,eAAO,MAAM,uCAAuC,wDAEjD,qBAkDF,CAAC"}
@@ -7,17 +7,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.generateContainerServicesRequestHandler = exports.BaseContainerService = exports.serviceRoutePathRoot = void 0;
8
8
  const runtime_utils_1 = require("@fluidframework/runtime-utils");
9
9
  // TODO: should this just be "s"?
10
+ /**
11
+ * @deprecated See {@link @fluidframework/synthesize#DependencyContainer}
12
+ */
10
13
  exports.serviceRoutePathRoot = "_services";
11
14
  /**
12
15
  * This class is a simple starter class for building a Container Service. It simply provides routing
16
+ * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class
13
17
  */
14
18
  class BaseContainerService {
19
+ /**
20
+ * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class
21
+ */
15
22
  constructor(runtime) {
16
23
  this.runtime = runtime;
17
24
  }
25
+ /**
26
+ * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class
27
+ */
18
28
  get IFluidRouter() {
19
29
  return this;
20
30
  }
31
+ /**
32
+ * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class
33
+ */
21
34
  async request(request) {
22
35
  return {
23
36
  status: 200,
@@ -44,6 +57,7 @@ class SingletonContainerServiceFactory {
44
57
  /**
45
58
  * Given a collection of IContainerServices will produce a RequestHandler for them all
46
59
  * @param serviceRegistry - Collection of Container Services
60
+ * @deprecated See {@link @fluidframework/synthesize#DependencyContainer}
47
61
  */
48
62
  const generateContainerServicesRequestHandler = (serviceRegistry) => {
49
63
  const factories = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"containerServices.js","sourceRoot":"","sources":["../../src/container-services/containerServices.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,iEAIuC;AAEvC,iCAAiC;AACpB,QAAA,oBAAoB,GAAG,WAAW,CAAC;AAMhD;;GAEG;AACH,MAAsB,oBAAoB;IAKzC,YAA+B,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAAG,CAAC;IAJ7D,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IA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;YACb,gDAAgD;YAChD,OAAO,IAAA,iCAAiB,EAAC,OAAO,CAAC,CAAC;SAClC;QAED,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAClD,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;QACpC,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;QAC/C,IAAI,MAAM,EAAE;YACX,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;SAClC;QAED,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;YACvB,qFAAqF;YACrF,OAAO,IAAA,mCAAmB,EACzB,GAAG,EACH,0DAA0D,EAC1D,OAAO,CACP,CAAC;SACF;QAED,4CAA4C;QAC5C,OAAO;YACN,MAAM,EAAE,GAAG;YACX,QAAQ,EAAE,cAAc;YACxB,KAAK,EAAE,OAAO;SACd,CAAC;IACH,CAAC,CAAC;AACH,CAAC,CAAC;AApDW,QAAA,uCAAuC,2CAoDlD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResponse, IFluidRouter, IRequest, FluidObject } from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { RuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport {\n\tRequestParser,\n\tcreate404Response,\n\tcreateResponseError,\n} from \"@fluidframework/runtime-utils\";\n\n// TODO: should this just be \"s\"?\nexport const serviceRoutePathRoot = \"_services\";\n\nexport type ContainerServiceRegistryEntries = Iterable<\n\t[string, (runtime: IContainerRuntime) => Promise<FluidObject>]\n>;\n\n/**\n * This class is a simple starter class for building a Container Service. It simply provides routing\n */\nexport abstract class BaseContainerService implements IFluidRouter {\n\tpublic get IFluidRouter() {\n\t\treturn this;\n\t}\n\n\tconstructor(protected readonly runtime: IContainerRuntime) {}\n\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\treturn {\n\t\t\tstatus: 200,\n\t\t\tmimeType: \"fluid/object\",\n\t\t\tvalue: this,\n\t\t};\n\t}\n}\n\n/**\n * ContainerService Factory that will only create one instance of the service for the Container.\n */\nclass SingletonContainerServiceFactory {\n\tprivate service: Promise<FluidObject> | undefined;\n\n\tpublic constructor(\n\t\tprivate readonly serviceFn: (runtime: IContainerRuntime) => Promise<FluidObject>,\n\t) {}\n\n\tpublic async getService(runtime: IContainerRuntime): Promise<FluidObject<IFluidRouter>> {\n\t\tif (!this.service) {\n\t\t\tthis.service = this.serviceFn(runtime);\n\t\t}\n\t\treturn this.service;\n\t}\n}\n\n/**\n * Given a collection of IContainerServices will produce a RequestHandler for them all\n * @param serviceRegistry - Collection of Container Services\n */\nexport const generateContainerServicesRequestHandler = (\n\tserviceRegistry: ContainerServiceRegistryEntries,\n): RuntimeRequestHandler => {\n\tconst factories: Map<string, SingletonContainerServiceFactory> = new Map();\n\tnew Map(serviceRegistry).forEach((fn, id) => {\n\t\tfactories.set(id, new SingletonContainerServiceFactory(fn));\n\t});\n\n\treturn async (request: RequestParser, runtime: IContainerRuntime) => {\n\t\tif (request.pathParts[0] !== serviceRoutePathRoot) {\n\t\t\t// If the request is not for a service we return undefined so the next handler can use it\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (request.pathParts.length < 2) {\n\t\t\t// If there is not service to route to then return a failure\n\t\t\treturn createResponseError(\n\t\t\t\t400,\n\t\t\t\t\"request did not specify a service to route to\",\n\t\t\t\trequest,\n\t\t\t);\n\t\t}\n\n\t\tconst factory = factories.get(request.pathParts[1]);\n\t\tif (!factory) {\n\t\t\t// If we can't find a registry entry then return\n\t\t\treturn create404Response(request);\n\t\t}\n\n\t\tconst service = await factory.getService(runtime);\n\t\tconst router = service.IFluidRouter;\n\t\tconst subRequest = request.createSubRequest(2);\n\t\tif (router) {\n\t\t\treturn router.request(subRequest);\n\t\t}\n\n\t\tif (!request.isLeaf(2)) {\n\t\t\t// If there is not terminating route but a sub-route was requested then we will fail.\n\t\t\treturn createResponseError(\n\t\t\t\t400,\n\t\t\t\t\"request sub-url for service that doesn't support routing\",\n\t\t\t\trequest,\n\t\t\t);\n\t\t}\n\n\t\t// Otherwise we will just return the service\n\t\treturn {\n\t\t\tstatus: 200,\n\t\t\tmimeType: \"fluid/object\",\n\t\t\tvalue: service,\n\t\t};\n\t};\n};\n"]}
1
+ {"version":3,"file":"containerServices.js","sourceRoot":"","sources":["../../src/container-services/containerServices.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,iEAIuC;AAEvC,iCAAiC;AACjC;;GAEG;AACU,QAAA,oBAAoB,GAAG,WAAW,CAAC;AAShD;;;GAGG;AACH,MAAsB,oBAAoB;IAQzC;;OAEG;IACH,YAA+B,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAAG,CAAC;IAV7D;;OAEG;IACH,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAOD;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,OAAiB;QACrC,OAAO;YACN,MAAM,EAAE,GAAG;YACX,QAAQ,EAAE,cAAc;YACxB,KAAK,EAAE,IAAI;SACX,CAAC;IACH,CAAC;CACD;AAvBD,oDAuBC;AAED;;GAEG;AACH,MAAM,gCAAgC;IAGrC,YACkB,SAA+D;QAA/D,cAAS,GAAT,SAAS,CAAsD;IAC9E,CAAC;IAEG,KAAK,CAAC,UAAU,CAAC,OAA0B;QACjD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;SACvC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;CACD;AAED;;;;GAIG;AACI,MAAM,uCAAuC,GAAG,CACtD,eAAgD,EACxB,EAAE;IAC1B,MAAM,SAAS,GAAkD,IAAI,GAAG,EAAE,CAAC;IAC3E,IAAI,G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;SACd,CAAC;IACH,CAAC,CAAC;AACH,CAAC,CAAC;AApDW,QAAA,uCAAuC,2CAoDlD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResponse, IFluidRouter, IRequest, FluidObject } from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { RuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport {\n\tRequestParser,\n\tcreate404Response,\n\tcreateResponseError,\n} from \"@fluidframework/runtime-utils\";\n\n// TODO: should this just be \"s\"?\n/**\n * @deprecated See {@link @fluidframework/synthesize#DependencyContainer}\n */\nexport const serviceRoutePathRoot = \"_services\";\n\n/**\n * @deprecated See {@link @fluidframework/synthesize#DependencyContainer}\n */\nexport type ContainerServiceRegistryEntries = Iterable<\n\t[string, (runtime: IContainerRuntime) => Promise<FluidObject>]\n>;\n\n/**\n * This class is a simple starter class for building a Container Service. It simply provides routing\n * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class\n */\nexport abstract class BaseContainerService implements IFluidRouter {\n\t/**\n\t * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class\n\t */\n\tpublic get IFluidRouter() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class\n\t */\n\tconstructor(protected readonly runtime: IContainerRuntime) {}\n\n\t/**\n\t * @deprecated Use {@link @fluidframework/synthesize#DependencyContainer} as a replacement for this class\n\t */\n\tpublic async request(request: IRequest): Promise<IResponse> {\n\t\treturn {\n\t\t\tstatus: 200,\n\t\t\tmimeType: \"fluid/object\",\n\t\t\tvalue: this,\n\t\t};\n\t}\n}\n\n/**\n * ContainerService Factory that will only create one instance of the service for the Container.\n */\nclass SingletonContainerServiceFactory {\n\tprivate service: Promise<FluidObject> | undefined;\n\n\tpublic constructor(\n\t\tprivate readonly serviceFn: (runtime: IContainerRuntime) => Promise<FluidObject>,\n\t) {}\n\n\tpublic async getService(runtime: IContainerRuntime): Promise<FluidObject<IFluidRouter>> {\n\t\tif (!this.service) {\n\t\t\tthis.service = this.serviceFn(runtime);\n\t\t}\n\t\treturn this.service;\n\t}\n}\n\n/**\n * Given a collection of IContainerServices will produce a RequestHandler for them all\n * @param serviceRegistry - Collection of Container Services\n * @deprecated See {@link @fluidframework/synthesize#DependencyContainer}\n */\nexport const generateContainerServicesRequestHandler = (\n\tserviceRegistry: ContainerServiceRegistryEntries,\n): RuntimeRequestHandler => {\n\tconst factories: Map<string, SingletonContainerServiceFactory> = new Map();\n\tnew Map(serviceRegistry).forEach((fn, id) => {\n\t\tfactories.set(id, new SingletonContainerServiceFactory(fn));\n\t});\n\n\treturn async (request: RequestParser, runtime: IContainerRuntime) => {\n\t\tif (request.pathParts[0] !== serviceRoutePathRoot) {\n\t\t\t// If the request is not for a service we return undefined so the next handler can use it\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif (request.pathParts.length < 2) {\n\t\t\t// If there is not service to route to then return a failure\n\t\t\treturn createResponseError(\n\t\t\t\t400,\n\t\t\t\t\"request did not specify a service to route to\",\n\t\t\t\trequest,\n\t\t\t);\n\t\t}\n\n\t\tconst factory = factories.get(request.pathParts[1]);\n\t\tif (!factory) {\n\t\t\t// If we can't find a registry entry then return\n\t\t\treturn create404Response(request);\n\t\t}\n\n\t\tconst service = await factory.getService(runtime);\n\t\tconst router = service.IFluidRouter;\n\t\tconst subRequest = request.createSubRequest(2);\n\t\tif (router) {\n\t\t\treturn router.request(subRequest);\n\t\t}\n\n\t\tif (!request.isLeaf(2)) {\n\t\t\t// If there is not terminating route but a sub-route was requested then we will fail.\n\t\t\treturn createResponseError(\n\t\t\t\t400,\n\t\t\t\t\"request sub-url for service that doesn't support routing\",\n\t\t\t\trequest,\n\t\t\t);\n\t\t}\n\n\t\t// Otherwise we will just return the service\n\t\treturn {\n\t\t\tstatus: 200,\n\t\t\tmimeType: \"fluid/object\",\n\t\t\tvalue: service,\n\t\t};\n\t};\n};\n"]}
@@ -85,6 +85,7 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
85
85
  /**
86
86
  * Gets the service at a given id.
87
87
  * @param id - service id
88
+ * @deprecated See https://github.com/microsoft/FluidFramework/pull/14430 for context
88
89
  */
89
90
  protected getService<T extends FluidObject>(id: string): Promise<T>;
90
91
  /**
@@ -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,EACN,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;;;GAMG;AACH,8BAAsB,cAAc,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,CAC/E,SAAQ,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,MAAM,CAC3C,YAAW,cAAc,EAAE,YAAY,EAAE,mBAAmB;IAE5D,OAAO,CAAC,SAAS,CAAS;IAE1B;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IAEnD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IAEnD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CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAE/E;;;OAGG;cACa,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAEzD;;OAEG;cACa,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAE/C;;OAEG;IACI,OAAO,IAAI,IAAI;CAGtB"}
@@ -130,6 +130,7 @@ class PureDataObject extends common_utils_1.EventForwarder {
130
130
  /**
131
131
  * Gets the service at a given id.
132
132
  * @param id - service id
133
+ * @deprecated See https://github.com/microsoft/FluidFramework/pull/14430 for context
133
134
  */
134
135
  async getService(id) {
135
136
  return (0, request_handler_1.handleFromLegacyUri)(`/${container_services_1.serviceRoutePathRoot}/${id}`, this.context.containerRuntime).get();
@@ -1 +1 @@
1
- {"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAsE;AAYtE,qEAAsE;AAGtE,8DAA6D;AAC7D,0DAAuE;AAGvE;;;;;;GAMG;AACH,MAAsB,cACrB,SAAQ,6BAAoC;IA8D5C,YAAmB,KAA0B;QAC5C,KAAK,EAAE,CAAC;QA5DD,cAAS,GAAG,KAAK,CAAC;QA6DzB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QAEjC,IAAA,qBAAM,EACJ,IAAI,CAAC,OAAe,CAAC,WAAW,KAAK,SAAS,EAC/C,KAAK,CAAC,8CAA8C,CACpD,CAAC;QACD,IAAI,CAAC,OAAe,CAAC,WAAW,GAAG,IAAI,CAAC;QAEzC,2BAA2B;QAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;YACjC,IAAI,CAAC,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CAAC,qBAAqB,CAAC,KAAyB,IAAkB,CAAC;IAElF;;;OAGG;IACO,KAAK,CAAC,wBAAwB,KAAmB,CAAC;IAE5D;;OAEG;IACO,KAAK,CAAC,cAAc,KAAmB,CAAC;IAElD;;OAEG;IACI,OAAO;QACb,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD;AA1MD,wCA0MC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent } from \"@fluidframework/common-definitions\";\nimport { assert, EventForwarder } from \"@fluidframework/common-utils\";\nimport {\n\tIFluidHandle,\n\tIFluidLoadable,\n\tIFluidRouter,\n\tIProvideFluidHandle,\n\tIRequest,\n\tIResponse,\n\tFluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { IDirectory } from \"@fluidframework/map\";\nimport { handleFromLegacyUri } from \"@fluidframework/request-handler\";\nimport { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { AsyncFluidObjectProvider } from \"@fluidframework/synthesize\";\nimport { serviceRoutePathRoot } from \"../container-services\";\nimport { defaultFluidObjectRequestHandler } from \"../request-handlers\";\nimport { DataObjectTypes, IDataObjectProps } from \"./types\";\n\n/**\n * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.\n * You probably don't want to inherit from this data store directly unless\n * you are creating another base data store class\n *\n * @typeParam I - The optional input types used to strongly type the data object\n */\nexport abstract class PureDataObject<I extends DataObjectTypes = DataObjectTypes>\n\textends EventForwarder<I[\"Events\"] & IEvent>\n\timplements IFluidLoadable, IFluidRouter, IProvideFluidHandle\n{\n\tprivate _disposed = false;\n\n\t/**\n\t * This is your FluidDataStoreRuntime object\n\t */\n\tprotected readonly runtime: IFluidDataStoreRuntime;\n\n\t/**\n\t * This context is used to talk up to the ContainerRuntime\n\t */\n\tprotected readonly context: IFluidDataStoreContext;\n\n\t/**\n\t * Providers are FluidObject keyed objects that provide back\n\t * a promise to the corresponding FluidObject or undefined.\n\t * Providers injected/provided by the Container and/or HostingApplication\n\t *\n\t * To define providers set FluidObject interfaces in the OptionalProviders generic type for your data store\n\t */\n\tprotected readonly providers: AsyncFluidObjectProvider<I[\"OptionalProviders\"]>;\n\n\tprotected initProps?: I[\"InitialState\"];\n\n\tprotected initializeP: Promise<void> | undefined;\n\n\tpublic get disposed() {\n\t\treturn this._disposed;\n\t}\n\n\tpublic get id() {\n\t\treturn this.runtime.id;\n\t}\n\tpublic get IFluidRouter() {\n\t\treturn this;\n\t}\n\tpublic get IFluidLoadable() {\n\t\treturn this;\n\t}\n\tpublic get IFluidHandle() {\n\t\treturn this.handle;\n\t}\n\n\t/**\n\t * Handle to a data store\n\t */\n\tpublic get handle(): IFluidHandle<this> {\n\t\t// PureDataObjectFactory already provides an entryPoint initialization function to the data store runtime,\n\t\t// so this object should always have access to a non-null entryPoint. Need to cast because PureDataObject\n\t\t// tried to be too smart with its typing for handles :).\n\t\tassert(this.runtime.entryPoint !== undefined, 0x46b /* EntryPoint was undefined */);\n\t\treturn this.runtime.entryPoint as IFluidHandle<this>;\n\t}\n\n\tpublic static async getDataObject(runtime: IFluidDataStoreRuntime) {\n\t\tconst obj = await runtime.entryPoint?.get();\n\t\tassert(obj !== undefined, 0x0bc /* \"The runtime's handle is not initialized yet!\" */);\n\t\treturn obj as PureDataObject;\n\t}\n\n\tpublic constructor(props: IDataObjectProps<I>) {\n\t\tsuper();\n\t\tthis.runtime = props.runtime;\n\t\tthis.context = props.context;\n\t\tthis.providers = props.providers;\n\t\tthis.initProps = props.initProps;\n\n\t\tassert(\n\t\t\t(this.runtime as any)._dataObject === undefined,\n\t\t\t0x0bd /* \"Object runtime already has DataObject!\" */,\n\t\t);\n\t\t(this.runtime as any)._dataObject = this;\n\n\t\t// Container event handlers\n\t\tthis.runtime.once(\"dispose\", () => {\n\t\t\tthis._disposed = true;\n\t\t\tthis.dispose();\n\t\t});\n\t}\n\n\t// #region IFluidRouter\n\n\t/**\n\t * Return this object if someone requests it directly\n\t * We will return this object in two scenarios:\n\t *\n\t * 1. the request url is a \"/\"\n\t *\n\t * 2. the request url is empty\n\t */\n\tpublic async request(req: IRequest): Promise<IResponse> {\n\t\treturn defaultFluidObjectRequestHandler(this, req);\n\t}\n\n\t// #endregion IFluidRouter\n\n\t/**\n\t * Call this API to ensure PureDataObject is fully initialized.\n\t * Initialization happens on demand, only on as-needed bases.\n\t * In most cases you should allow factory/object to decide when to finish initialization.\n\t * But if you are supplying your own implementation of DataStoreRuntime factory and overriding some methods\n\t * and need a fully initialized object, then you can call this API to ensure object is fully initialized.\n\t */\n\tpublic async finishInitialization(existing: boolean): Promise<void> {\n\t\tif (this.initializeP !== undefined) {\n\t\t\treturn this.initializeP;\n\t\t}\n\t\tthis.initializeP = this.initializeInternal(existing);\n\t\treturn this.initializeP;\n\t}\n\n\t/**\n\t * Internal initialize implementation. Overwriting this will change the flow of the PureDataObject and should\n\t * generally not be done.\n\t *\n\t * Calls initializingFirstTime, initializingFromExisting, and hasInitialized. Caller is\n\t * responsible for ensuring this is only invoked once.\n\t */\n\tpublic async initializeInternal(existing: boolean): Promise<void> {\n\t\tawait this.preInitialize();\n\t\tif (existing) {\n\t\t\tassert(\n\t\t\t\tthis.initProps === undefined,\n\t\t\t\t0x0be /* \"Trying to initialize from existing while initProps is set!\" */,\n\t\t\t);\n\t\t\tawait this.initializingFromExisting();\n\t\t} else {\n\t\t\tawait this.initializingFirstTime(\n\t\t\t\t(this.context.createProps as I[\"InitialState\"]) ?? this.initProps,\n\t\t\t);\n\t\t}\n\t\tawait this.hasInitialized();\n\t}\n\n\t/**\n\t * Retrieve Fluid object using the handle get\n\t *\n\t * @param key - key that object (handle/id) is stored with in the directory\n\t * @param directory - directory containing the object\n\t * @param getObjectFromDirectory - optional callback for fetching object from the directory, allows users to\n\t * define custom types/getters for object retrieval\n\t */\n\tpublic async getFluidObjectFromDirectory<T extends IFluidLoadable>(\n\t\tkey: string,\n\t\tdirectory: IDirectory,\n\t\tgetObjectFromDirectory?: (id: string, directory: IDirectory) => IFluidHandle | undefined,\n\t): Promise<T | undefined> {\n\t\tconst handleMaybe = getObjectFromDirectory\n\t\t\t? getObjectFromDirectory(key, directory)\n\t\t\t: directory.get(key);\n\t\tconst handle = handleMaybe?.IFluidHandle;\n\t\tif (handle) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\treturn handle.get();\n\t\t}\n\t}\n\n\t/**\n\t * Gets the service at a given id.\n\t * @param id - service id\n\t */\n\tprotected async getService<T extends FluidObject>(id: string): Promise<T> {\n\t\treturn handleFromLegacyUri<T>(\n\t\t\t`/${serviceRoutePathRoot}/${id}`,\n\t\t\tthis.context.containerRuntime,\n\t\t).get();\n\t}\n\n\t/**\n\t * Called every time the data store is initialized, before initializingFirstTime or\n\t * initializingFromExisting is called.\n\t */\n\tprotected async preInitialize(): Promise<void> {}\n\n\t/**\n\t * Called the first time the data store is initialized (new creations with a new\n\t * data store runtime)\n\t *\n\t * @param props - Optional props to be passed in on create\n\t */\n\tprotected async initializingFirstTime(props?: I[\"InitialState\"]): Promise<void> {}\n\n\t/**\n\t * Called every time but the first time the data store is initialized (creations\n\t * with an existing data store runtime)\n\t */\n\tprotected async initializingFromExisting(): Promise<void> {}\n\n\t/**\n\t * Called every time the data store is initialized after create or existing.\n\t */\n\tprotected async hasInitialized(): Promise<void> {}\n\n\t/**\n\t * Called when the host container closes and disposes itself\n\t */\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n}\n"]}
1
+ {"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAsE;AAYtE,qEAAsE;AAGtE,8DAA6D;AAC7D,0DAAuE;AAGvE;;;;;;GAMG;AACH,MAAsB,cACrB,SAAQ,6BAAoC;IA8D5C,YAAmB,KAA0B;QAC5C,KAAK,EAAE,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AE,SAAS,CAAC;YACxC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACtB,MAAM,MAAM,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,YAAY,CAAC;QACzC,IAAI,MAAM,EAAE;YACX,+DAA+D;YAC/D,OAAO,MAAM,CAAC,GAAG,EAAE,CAAC;SACpB;IACF,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,UAAU,CAAwB,EAAU;QAC3D,OAAO,IAAA,qCAAmB,EACzB,IAAI,yCAAoB,IAAI,EAAE,EAAE,EAChC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAC7B,CAAC,GAAG,EAAE,CAAC;IACT,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,aAAa,KAAmB,CAAC;IAEjD;;;;;OAKG;IACO,KAAK,CAAC,qBAAqB,CAAC,KAAyB,IAAkB,CAAC;IAElF;;;OAGG;IACO,KAAK,CAAC,wBAAwB,KAAmB,CAAC;IAE5D;;OAEG;IACO,KAAK,CAAC,cAAc,KAAmB,CAAC;IAElD;;OAEG;IACI,OAAO;QACb,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD;AA3MD,wCA2MC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent } from \"@fluidframework/common-definitions\";\nimport { assert, EventForwarder } from \"@fluidframework/common-utils\";\nimport {\n\tIFluidHandle,\n\tIFluidLoadable,\n\tIFluidRouter,\n\tIProvideFluidHandle,\n\tIRequest,\n\tIResponse,\n\tFluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { IDirectory } from \"@fluidframework/map\";\nimport { handleFromLegacyUri } from \"@fluidframework/request-handler\";\nimport { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { AsyncFluidObjectProvider } from \"@fluidframework/synthesize\";\nimport { serviceRoutePathRoot } from \"../container-services\";\nimport { defaultFluidObjectRequestHandler } from \"../request-handlers\";\nimport { DataObjectTypes, IDataObjectProps } from \"./types\";\n\n/**\n * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.\n * You probably don't want to inherit from this data store directly unless\n * you are creating another base data store class\n *\n * @typeParam I - The optional input types used to strongly type the data object\n */\nexport abstract class PureDataObject<I extends DataObjectTypes = DataObjectTypes>\n\textends EventForwarder<I[\"Events\"] & IEvent>\n\timplements IFluidLoadable, IFluidRouter, IProvideFluidHandle\n{\n\tprivate _disposed = false;\n\n\t/**\n\t * This is your FluidDataStoreRuntime object\n\t */\n\tprotected readonly runtime: IFluidDataStoreRuntime;\n\n\t/**\n\t * This context is used to talk up to the ContainerRuntime\n\t */\n\tprotected readonly context: IFluidDataStoreContext;\n\n\t/**\n\t * Providers are FluidObject keyed objects that provide back\n\t * a promise to the corresponding FluidObject or undefined.\n\t * Providers injected/provided by the Container and/or HostingApplication\n\t *\n\t * To define providers set FluidObject interfaces in the OptionalProviders generic type for your data store\n\t */\n\tprotected readonly providers: AsyncFluidObjectProvider<I[\"OptionalProviders\"]>;\n\n\tprotected initProps?: I[\"InitialState\"];\n\n\tprotected initializeP: Promise<void> | undefined;\n\n\tpublic get disposed() {\n\t\treturn this._disposed;\n\t}\n\n\tpublic get id() {\n\t\treturn this.runtime.id;\n\t}\n\tpublic get IFluidRouter() {\n\t\treturn this;\n\t}\n\tpublic get IFluidLoadable() {\n\t\treturn this;\n\t}\n\tpublic get IFluidHandle() {\n\t\treturn this.handle;\n\t}\n\n\t/**\n\t * Handle to a data store\n\t */\n\tpublic get handle(): IFluidHandle<this> {\n\t\t// PureDataObjectFactory already provides an entryPoint initialization function to the data store runtime,\n\t\t// so this object should always have access to a non-null entryPoint. Need to cast because PureDataObject\n\t\t// tried to be too smart with its typing for handles :).\n\t\tassert(this.runtime.entryPoint !== undefined, 0x46b /* EntryPoint was undefined */);\n\t\treturn this.runtime.entryPoint as IFluidHandle<this>;\n\t}\n\n\tpublic static async getDataObject(runtime: IFluidDataStoreRuntime) {\n\t\tconst obj = await runtime.entryPoint?.get();\n\t\tassert(obj !== undefined, 0x0bc /* \"The runtime's handle is not initialized yet!\" */);\n\t\treturn obj as PureDataObject;\n\t}\n\n\tpublic constructor(props: IDataObjectProps<I>) {\n\t\tsuper();\n\t\tthis.runtime = props.runtime;\n\t\tthis.context = props.context;\n\t\tthis.providers = props.providers;\n\t\tthis.initProps = props.initProps;\n\n\t\tassert(\n\t\t\t(this.runtime as any)._dataObject === undefined,\n\t\t\t0x0bd /* \"Object runtime already has DataObject!\" */,\n\t\t);\n\t\t(this.runtime as any)._dataObject = this;\n\n\t\t// Container event handlers\n\t\tthis.runtime.once(\"dispose\", () => {\n\t\t\tthis._disposed = true;\n\t\t\tthis.dispose();\n\t\t});\n\t}\n\n\t// #region IFluidRouter\n\n\t/**\n\t * Return this object if someone requests it directly\n\t * We will return this object in two scenarios:\n\t *\n\t * 1. the request url is a \"/\"\n\t *\n\t * 2. the request url is empty\n\t */\n\tpublic async request(req: IRequest): Promise<IResponse> {\n\t\treturn defaultFluidObjectRequestHandler(this, req);\n\t}\n\n\t// #endregion IFluidRouter\n\n\t/**\n\t * Call this API to ensure PureDataObject is fully initialized.\n\t * Initialization happens on demand, only on as-needed bases.\n\t * In most cases you should allow factory/object to decide when to finish initialization.\n\t * But if you are supplying your own implementation of DataStoreRuntime factory and overriding some methods\n\t * and need a fully initialized object, then you can call this API to ensure object is fully initialized.\n\t */\n\tpublic async finishInitialization(existing: boolean): Promise<void> {\n\t\tif (this.initializeP !== undefined) {\n\t\t\treturn this.initializeP;\n\t\t}\n\t\tthis.initializeP = this.initializeInternal(existing);\n\t\treturn this.initializeP;\n\t}\n\n\t/**\n\t * Internal initialize implementation. Overwriting this will change the flow of the PureDataObject and should\n\t * generally not be done.\n\t *\n\t * Calls initializingFirstTime, initializingFromExisting, and hasInitialized. Caller is\n\t * responsible for ensuring this is only invoked once.\n\t */\n\tpublic async initializeInternal(existing: boolean): Promise<void> {\n\t\tawait this.preInitialize();\n\t\tif (existing) {\n\t\t\tassert(\n\t\t\t\tthis.initProps === undefined,\n\t\t\t\t0x0be /* \"Trying to initialize from existing while initProps is set!\" */,\n\t\t\t);\n\t\t\tawait this.initializingFromExisting();\n\t\t} else {\n\t\t\tawait this.initializingFirstTime(\n\t\t\t\t(this.context.createProps as I[\"InitialState\"]) ?? this.initProps,\n\t\t\t);\n\t\t}\n\t\tawait this.hasInitialized();\n\t}\n\n\t/**\n\t * Retrieve Fluid object using the handle get\n\t *\n\t * @param key - key that object (handle/id) is stored with in the directory\n\t * @param directory - directory containing the object\n\t * @param getObjectFromDirectory - optional callback for fetching object from the directory, allows users to\n\t * define custom types/getters for object retrieval\n\t */\n\tpublic async getFluidObjectFromDirectory<T extends IFluidLoadable>(\n\t\tkey: string,\n\t\tdirectory: IDirectory,\n\t\tgetObjectFromDirectory?: (id: string, directory: IDirectory) => IFluidHandle | undefined,\n\t): Promise<T | undefined> {\n\t\tconst handleMaybe = getObjectFromDirectory\n\t\t\t? getObjectFromDirectory(key, directory)\n\t\t\t: directory.get(key);\n\t\tconst handle = handleMaybe?.IFluidHandle;\n\t\tif (handle) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\treturn handle.get();\n\t\t}\n\t}\n\n\t/**\n\t * Gets the service at a given id.\n\t * @param id - service id\n\t * @deprecated See https://github.com/microsoft/FluidFramework/pull/14430 for context\n\t */\n\tprotected async getService<T extends FluidObject>(id: string): Promise<T> {\n\t\treturn handleFromLegacyUri<T>(\n\t\t\t`/${serviceRoutePathRoot}/${id}`,\n\t\t\tthis.context.containerRuntime,\n\t\t).get();\n\t}\n\n\t/**\n\t * Called every time the data store is initialized, before initializingFirstTime or\n\t * initializingFromExisting is called.\n\t */\n\tprotected async preInitialize(): Promise<void> {}\n\n\t/**\n\t * Called the first time the data store is initialized (new creations with a new\n\t * data store runtime)\n\t *\n\t * @param props - Optional props to be passed in on create\n\t */\n\tprotected async initializingFirstTime(props?: I[\"InitialState\"]): Promise<void> {}\n\n\t/**\n\t * Called every time but the first time the data store is initialized (creations\n\t * with an existing data store runtime)\n\t */\n\tprotected async initializingFromExisting(): Promise<void> {}\n\n\t/**\n\t * Called every time the data store is initialized after create or existing.\n\t */\n\tprotected async hasInitialized(): Promise<void> {}\n\n\t/**\n\t * Called when the host container closes and disposes itself\n\t */\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n}\n"]}