@fluidframework/aqueduct 2.0.0-internal.6.4.0 → 2.0.0-internal.7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/aqueduct-alpha.d.ts +439 -0
  2. package/dist/aqueduct-beta.d.ts +439 -0
  3. package/dist/aqueduct-public.d.ts +439 -0
  4. package/dist/aqueduct.d.ts +438 -0
  5. package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts +13 -6
  6. package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -1
  7. package/dist/container-runtime-factories/baseContainerRuntimeFactory.js +14 -12
  8. package/dist/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
  9. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +11 -3
  10. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
  11. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +19 -4
  12. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  13. package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
  14. package/dist/data-object-factories/pureDataObjectFactory.js +5 -5
  15. package/dist/data-object-factories/pureDataObjectFactory.js.map +1 -1
  16. package/dist/data-objects/pureDataObject.d.ts +5 -29
  17. package/dist/data-objects/pureDataObject.d.ts.map +1 -1
  18. package/dist/data-objects/pureDataObject.js +19 -57
  19. package/dist/data-objects/pureDataObject.js.map +1 -1
  20. package/dist/request-handlers/requestHandlers.d.ts +3 -0
  21. package/dist/request-handlers/requestHandlers.d.ts.map +1 -1
  22. package/dist/request-handlers/requestHandlers.js +5 -0
  23. package/dist/request-handlers/requestHandlers.js.map +1 -1
  24. package/dist/tsdoc-metadata.json +1 -1
  25. package/dist/utils/containerInteractions.d.ts +3 -0
  26. package/dist/utils/containerInteractions.d.ts.map +1 -1
  27. package/dist/utils/containerInteractions.js +3 -0
  28. package/dist/utils/containerInteractions.js.map +1 -1
  29. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js +14 -12
  30. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
  31. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +19 -4
  32. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  33. package/lib/data-object-factories/pureDataObjectFactory.js +5 -5
  34. package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -1
  35. package/lib/data-objects/pureDataObject.js +20 -58
  36. package/lib/data-objects/pureDataObject.js.map +1 -1
  37. package/lib/request-handlers/requestHandlers.js +5 -0
  38. package/lib/request-handlers/requestHandlers.js.map +1 -1
  39. package/lib/utils/containerInteractions.js +3 -0
  40. package/lib/utils/containerInteractions.js.map +1 -1
  41. package/package.json +27 -27
@@ -5,9 +5,17 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ContainerRuntimeFactoryWithDefaultDataStore = void 0;
8
+ // eslint-disable-next-line import/no-deprecated
8
9
  const request_handlers_1 = require("../request-handlers");
9
10
  const baseContainerRuntimeFactory_1 = require("./baseContainerRuntimeFactory");
10
11
  const defaultDataStoreId = "default";
12
+ const getDefaultFluidObject = async (runtime) => {
13
+ const entryPoint = await runtime.getAliasedDataStoreEntryPoint("default");
14
+ if (entryPoint === undefined) {
15
+ throw new Error("default dataStore must exist");
16
+ }
17
+ return entryPoint.get();
18
+ };
11
19
  /**
12
20
  * A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from
13
21
  * the container with an empty URL.
@@ -22,11 +30,18 @@ class ContainerRuntimeFactoryWithDefaultDataStore extends baseContainerRuntimeFa
22
30
  * @param dependencyContainer - deprecated, will be removed in a future release
23
31
  * @param requestHandlers -
24
32
  * @param runtimeOptions -
25
- * @param initializeEntryPoint -
33
+ * @param provideEntryPoint -
26
34
  */
27
- constructor(defaultFactory, registryEntries, dependencyContainer, requestHandlers = [], runtimeOptions, initializeEntryPoint) {
28
- super(registryEntries, dependencyContainer, [(0, request_handlers_1.defaultRouteRequestHandler)(defaultDataStoreId), ...requestHandlers], runtimeOptions, initializeEntryPoint);
29
- this.defaultFactory = defaultFactory;
35
+ constructor(props) {
36
+ const requestHandlers = props.requestHandlers ?? [];
37
+ const provideEntryPoint = props.provideEntryPoint ?? getDefaultFluidObject;
38
+ super({
39
+ ...props,
40
+ // eslint-disable-next-line import/no-deprecated
41
+ requestHandlers: [(0, request_handlers_1.defaultRouteRequestHandler)(defaultDataStoreId), ...requestHandlers],
42
+ provideEntryPoint,
43
+ });
44
+ this.defaultFactory = props.defaultFactory;
30
45
  }
31
46
  /**
32
47
  * {@inheritDoc BaseContainerRuntimeFactory.containerInitializingFirstTime}
@@ -1 +1 @@
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;;;;;;;;OAQG;IACH,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;;AAnCF,kGAoCC;AAnCuB,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\t/**\n\t * Constructor\n\t * @param defaultFactory -\n\t * @param registryEntries -\n\t * @param dependencyContainer - deprecated, will be removed in a future release\n\t * @param requestHandlers -\n\t * @param runtimeOptions -\n\t * @param initializeEntryPoint -\n\t */\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
+ {"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.js","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,gDAAgD;AAChD,0DAAiE;AACjE,+EAA4E;AAE5E,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC,MAAM,qBAAqB,GAAG,KAAK,EAAE,OAA0B,EAAE,EAAE;IAClE,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC;IAC1E,IAAI,UAAU,KAAK,SAAS,EAAE;QAC7B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;KAChD;IACD,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC;AACzB,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAa,2CAA4C,SAAQ,yDAA2B;IAK3F;;;;;;;;OAQG;IACH,YAAY,KAQX;QACA,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC;QACpD,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,IAAI,qBAAqB,CAAC;QAE3E,KAAK,CAAC;YACL,GAAG,KAAK;YACR,gDAAgD;YAChD,eAAe,EAAE,CAAC,IAAA,6CAA0B,EAAC,kBAAkB,CAAC,EAAE,GAAG,eAAe,CAAC;YACrF,iBAAiB;SACjB,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;IAC5C,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;;AA1CF,kGA2CC;AA1CuB,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\";\n// eslint-disable-next-line import/no-deprecated\nimport { defaultRouteRequestHandler } from \"../request-handlers\";\nimport { BaseContainerRuntimeFactory } from \"./baseContainerRuntimeFactory\";\n\nconst defaultDataStoreId = \"default\";\n\nconst getDefaultFluidObject = async (runtime: IContainerRuntime) => {\n\tconst entryPoint = await runtime.getAliasedDataStoreEntryPoint(\"default\");\n\tif (entryPoint === undefined) {\n\t\tthrow new Error(\"default dataStore must exist\");\n\t}\n\treturn entryPoint.get();\n};\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\tprotected readonly defaultFactory: IFluidDataStoreFactory;\n\n\t/**\n\t * Constructor\n\t * @param defaultFactory -\n\t * @param registryEntries -\n\t * @param dependencyContainer - deprecated, will be removed in a future release\n\t * @param requestHandlers -\n\t * @param runtimeOptions -\n\t * @param provideEntryPoint -\n\t */\n\tconstructor(props: {\n\t\tdefaultFactory: IFluidDataStoreFactory;\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries;\n\t\tdependencyContainer?: IFluidDependencySynthesizer;\n\t\t/** @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md */\n\t\trequestHandlers?: RuntimeRequestHandler[];\n\t\truntimeOptions?: IContainerRuntimeOptions;\n\t\tprovideEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>;\n\t}) {\n\t\tconst requestHandlers = props.requestHandlers ?? [];\n\t\tconst provideEntryPoint = props.provideEntryPoint ?? getDefaultFluidObject;\n\n\t\tsuper({\n\t\t\t...props,\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\trequestHandlers: [defaultRouteRequestHandler(defaultDataStoreId), ...requestHandlers],\n\t\t\tprovideEntryPoint,\n\t\t});\n\n\t\tthis.defaultFactory = props.defaultFactory;\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":"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,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gC,CAE3D;IAED;;;;OAIG;IACU,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,OAAO;IAapF;;;;;;;;;;OAUG;IACU,mBAAmB,CAC/B,aAAa,EAAE,sBAAsB,EACrC,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,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"}
1
+ {"version":3,"file":"pureDataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAY,YAAY,EAAe,MAAM,iCAAiC,CAAC;AACtF,OAAO,EACN,qBAAqB,EAGrB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,sBAAsB,EACtB,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C;IAED,IAAW,uBAAuB,wCAEjC;IAED;;;;;OAKG;IACH,IAAW,aAAa,IAAI,gCAAgC,CAE3D;IAED;;;;OAIG;IACU,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,OAAO;IAapF;;;;;;;;;;OAUG;IACU,mBAAmB,CAC/B,aAAa,EAAE,sBAAsB,EACrC,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,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"}
@@ -17,10 +17,10 @@ async function createDataObject(ctor, context, sharedObjectRegistry, optionalPro
17
17
  let runtimeClass = runtimeClassArg;
18
18
  // request mixin in
19
19
  runtimeClass = (0, datastore_1.mixinRequestHandler)(async (request, runtimeArg) => {
20
- const maybeRouter = await runtimeArg.entryPoint?.get();
21
- (0, core_utils_1.assert)(maybeRouter !== undefined, 0x468 /* entryPoint should have been initialized by now */);
22
- (0, core_utils_1.assert)(maybeRouter?.IFluidRouter !== undefined, 0x469 /* Data store runtime entryPoint is not an IFluidRouter */);
23
- return maybeRouter?.IFluidRouter.request(request);
20
+ // The provideEntryPoint callback below always returns TObj, so this cast is safe
21
+ const dataObject = (await runtimeArg.entryPoint.get());
22
+ (0, core_utils_1.assert)(dataObject.request !== undefined, 0x795 /* Data store runtime entryPoint does not have request */);
23
+ return dataObject.request(request);
24
24
  }, runtimeClass);
25
25
  // Create a new runtime for our data store, as if via new FluidDataStoreRuntime,
26
26
  // but using the runtimeClass that's been augmented with mixins
@@ -33,7 +33,7 @@ async function createDataObject(ctor, context, sharedObjectRegistry, optionalPro
33
33
  // Without this I ran into issues with the load-existing flow not working correctly.
34
34
  await instance.finishInitialization(true);
35
35
  return instance;
36
- } /* initializeEntryPoint */);
36
+ } /* provideEntryPoint */);
37
37
  // Create object right away.
38
38
  // This allows object to register various callbacks with runtime before runtime
39
39
  // becomes globally available. But it's not full initialization - constructor can't
@@ -1 +1 @@
1
- {"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yDAImC;AACnC,yEAA2E;AAmB3E,2DAAoD;AASpD;;;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,UAAU,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC;QACpC,IAAA,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,YAAgC;QAEhC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,gBAAgB,CACnD,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,YAAY,EACjB,KAAK,EAAE,WAAW;QAClB,YAAY,CACZ,CAAC;QAEF,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;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\tAsyncFluidObjectProvider,\n\tFluidObjectSymbolProvider,\n\tIFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\n\nimport { assert } from \"@fluidframework/core-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, as if via new FluidDataStoreRuntime,\n\t// but using the runtimeClass that's been augmented with mixins\n\t// The runtime is what Fluid uses to create DDS' and route to your data store\n\tconst runtime: FluidDataStoreRuntime = new runtimeClass( // calls new FluidDataStoreRuntime(...)\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} /* initializeEntryPoint */,\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 providers =\n\t\tscope.IFluidDependencySynthesizer?.synthesize<I[\"OptionalProviders\"]>(\n\t\t\toptionalProviders,\n\t\t\t{},\n\t\t) ??\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t({} as AsyncFluidObjectProvider<never>);\n\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
+ {"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,yDAImC;AACnC,yEAA2E;AAmB3E,2DAAoD;AAUpD;;;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,e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CAAC;QACtE,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACvD,CAAC;IAES,KAAK,CAAC,kBAAkB,CACjC,OAAuC,EACvC,YAAgC;QAEhC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,gBAAgB,CACnD,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,YAAY,EACjB,KAAK,EAAE,WAAW;QAClB,YAAY,CACZ,CAAC;QAEF,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AA3KD,sDA2KC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// eslint-disable-next-line import/no-deprecated\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\tAsyncFluidObjectProvider,\n\tFluidObjectSymbolProvider,\n\tIFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\n\nimport { assert } from \"@fluidframework/core-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\t// eslint-disable-next-line import/no-deprecated\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\t// The provideEntryPoint callback below always returns TObj, so this cast is safe\n\t\t\tconst dataObject = (await runtimeArg.entryPoint.get()) as TObj;\n\t\t\tassert(\n\t\t\t\tdataObject.request !== undefined,\n\t\t\t\t0x795 /* Data store runtime entryPoint does not have request */,\n\t\t\t);\n\t\t\treturn dataObject.request(request);\n\t\t},\n\t\truntimeClass,\n\t);\n\n\t// Create a new runtime for our data store, as if via new FluidDataStoreRuntime,\n\t// but using the runtimeClass that's been augmented with mixins\n\t// The runtime is what Fluid uses to create DDS' and route to your data store\n\tconst runtime: FluidDataStoreRuntime = new runtimeClass( // calls new FluidDataStoreRuntime(...)\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} /* provideEntryPoint */,\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 providers =\n\t\tscope.IFluidDependencySynthesizer?.synthesize<I[\"OptionalProviders\"]>(\n\t\t\toptionalProviders,\n\t\t\t{},\n\t\t) ??\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t({} as AsyncFluidObjectProvider<never>);\n\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\t\tTObj extends PureDataObject<I>,\n\t\tI extends DataObjectTypes = DataObjectTypes,\n\t>\n\timplements\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"]}
@@ -2,9 +2,8 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { EventEmitter } from "events";
6
- import { EventForwarder } from "@fluid-internal/client-utils";
7
- import { IEvent, IEventProvider, IFluidHandle, IFluidLoadable, IFluidRouter, IProvideFluidHandle, IRequest, IResponse } from "@fluidframework/core-interfaces";
5
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
6
+ import { IEvent, IFluidHandle, IFluidLoadable, IFluidRouter, IProvideFluidHandle, IRequest, IResponse } from "@fluidframework/core-interfaces";
8
7
  import { IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
9
8
  import { IFluidDataStoreContext } from "@fluidframework/runtime-definitions";
10
9
  import { AsyncFluidObjectProvider } from "@fluidframework/synthesize";
@@ -16,8 +15,7 @@ import { DataObjectTypes, IDataObjectProps } from "./types";
16
15
  *
17
16
  * @typeParam I - The optional input types used to strongly type the data object
18
17
  */
19
- export declare abstract class PureDataObject<I extends DataObjectTypes = DataObjectTypes> extends EventForwarder<I["Events"] & IEvent> implements IFluidLoadable, IFluidRouter, IProvideFluidHandle {
20
- private _disposed;
18
+ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObjectTypes> extends TypedEventEmitter<I["Events"] & IEvent> implements IFluidLoadable, IFluidRouter, IProvideFluidHandle {
21
19
  /**
22
20
  * This is your FluidDataStoreRuntime object
23
21
  */
@@ -36,12 +34,10 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
36
34
  protected readonly providers: AsyncFluidObjectProvider<I["OptionalProviders"]>;
37
35
  protected initProps?: I["InitialState"];
38
36
  protected initializeP: Promise<void> | undefined;
37
+ get id(): string;
39
38
  /**
40
- * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not provide a functioning built-in disposed flow.
41
- * This member will be removed in an upcoming release.
39
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
42
40
  */
43
- get disposed(): boolean;
44
- get id(): string;
45
41
  get IFluidRouter(): this;
46
42
  get IFluidLoadable(): this;
47
43
  get IFluidHandle(): IFluidHandle<this>;
@@ -97,25 +93,5 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
97
93
  * Called every time the data store is initialized after create or existing.
98
94
  */
99
95
  protected hasInitialized(): Promise<void>;
100
- /**
101
- * Called when the host container closes and disposes itself
102
- * @deprecated 2.0.0-internal.5.2.0 - Dispose does nothing and will be removed in an upcoming release.
103
- */
104
- dispose(): void;
105
- /**
106
- * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not actually set up to forward events, and will not be an EventForwarder
107
- * in a future release.
108
- */
109
- protected static isEmitterEvent(event: string): boolean;
110
- /**
111
- * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not actually set up to forward events, and will not be an EventForwarder
112
- * in a future release.
113
- */
114
- protected forwardEvent(source: EventEmitter | IEventProvider<I["Events"] & IEvent>, ...events: string[]): void;
115
- /**
116
- * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not actually set up to forward events, and will not be an EventForwarder
117
- * in a future release.
118
- */
119
- protected unforwardEvent(source: EventEmitter | IEventProvider<I["Events"] & IEvent>, ...events: string[]): void;
120
96
  }
121
97
  //# sourceMappingURL=pureDataObject.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pureDataObject.d.ts","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EACN,MAAM,EACN,cAAc,EACd,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;;;GAMG;AACH,8BAAsB,cAAc,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,CAC/E,SAAQ,c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I,OAAO,CAAC,IAAI,CAAC;CAC/C"}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.PureDataObject = void 0;
8
8
  const client_utils_1 = require("@fluid-internal/client-utils");
9
9
  const core_utils_1 = require("@fluidframework/core-utils");
10
- const request_handlers_1 = require("../request-handlers");
10
+ const runtime_utils_1 = require("@fluidframework/runtime-utils");
11
11
  /**
12
12
  * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.
13
13
  * You probably don't want to inherit from this data store directly unless
@@ -15,32 +15,14 @@ const request_handlers_1 = require("../request-handlers");
15
15
  *
16
16
  * @typeParam I - The optional input types used to strongly type the data object
17
17
  */
18
- class PureDataObject extends client_utils_1.EventForwarder {
19
- constructor(props) {
20
- super();
21
- this._disposed = false;
22
- this.runtime = props.runtime;
23
- this.context = props.context;
24
- this.providers = props.providers;
25
- this.initProps = props.initProps;
26
- (0, core_utils_1.assert)(this.runtime._dataObject === undefined, 0x0bd /* "Object runtime already has DataObject!" */);
27
- this.runtime._dataObject = this;
28
- // Container event handlers
29
- this.runtime.once("dispose", () => {
30
- this._disposed = true;
31
- this.dispose();
32
- });
33
- }
34
- /**
35
- * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not provide a functioning built-in disposed flow.
36
- * This member will be removed in an upcoming release.
37
- */
38
- get disposed() {
39
- return this._disposed;
40
- }
18
+ class PureDataObject extends client_utils_1.TypedEventEmitter {
41
19
  get id() {
42
20
  return this.runtime.id;
43
21
  }
22
+ /**
23
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
24
+ */
25
+ // eslint-disable-next-line import/no-deprecated
44
26
  get IFluidRouter() {
45
27
  return this;
46
28
  }
@@ -61,11 +43,18 @@ class PureDataObject extends client_utils_1.EventForwarder {
61
43
  return this.runtime.entryPoint;
62
44
  }
63
45
  static async getDataObject(runtime) {
64
- const obj = await runtime.entryPoint?.get();
65
- (0, core_utils_1.assert)(obj !== undefined, 0x0bc /* "The runtime's handle is not initialized yet!" */);
46
+ const obj = await runtime.entryPoint.get();
66
47
  return obj;
67
48
  }
68
- // #region IFluidRouter
49
+ constructor(props) {
50
+ super();
51
+ this.runtime = props.runtime;
52
+ this.context = props.context;
53
+ this.providers = props.providers;
54
+ this.initProps = props.initProps;
55
+ (0, core_utils_1.assert)(this.runtime._dataObject === undefined, 0x0bd /* "Object runtime already has DataObject!" */);
56
+ this.runtime._dataObject = this;
57
+ }
69
58
  /**
70
59
  * Return this object if someone requests it directly
71
60
  * We will return this object in two scenarios:
@@ -75,9 +64,10 @@ class PureDataObject extends client_utils_1.EventForwarder {
75
64
  * 2. the request url is empty
76
65
  */
77
66
  async request(req) {
78
- return (0, request_handlers_1.defaultFluidObjectRequestHandler)(this, req);
67
+ return req.url === "" || req.url === "/" || req.url.startsWith("/?")
68
+ ? { mimeType: "fluid/object", status: 200, value: this }
69
+ : (0, runtime_utils_1.create404Response)(req);
79
70
  }
80
- // #endregion IFluidRouter
81
71
  /**
82
72
  * Call this API to ensure PureDataObject is fully initialized.
83
73
  * Initialization happens on demand, only on as-needed bases.
@@ -131,34 +121,6 @@ class PureDataObject extends client_utils_1.EventForwarder {
131
121
  * Called every time the data store is initialized after create or existing.
132
122
  */
133
123
  async hasInitialized() { }
134
- /**
135
- * Called when the host container closes and disposes itself
136
- * @deprecated 2.0.0-internal.5.2.0 - Dispose does nothing and will be removed in an upcoming release.
137
- */
138
- dispose() {
139
- super.dispose();
140
- }
141
- /**
142
- * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not actually set up to forward events, and will not be an EventForwarder
143
- * in a future release.
144
- */
145
- static isEmitterEvent(event) {
146
- return super.isEmitterEvent(event);
147
- }
148
- /**
149
- * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not actually set up to forward events, and will not be an EventForwarder
150
- * in a future release.
151
- */
152
- forwardEvent(source, ...events) {
153
- super.forwardEvent(source, ...events);
154
- }
155
- /**
156
- * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not actually set up to forward events, and will not be an EventForwarder
157
- * in a future release.
158
- */
159
- unforwardEvent(source, ...events) {
160
- super.unforwardEvent(source, ...events);
161
- }
162
124
  }
163
125
  exports.PureDataObject = PureDataObject;
164
126
  //# sourceMappingURL=pureDataObject.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAA8D;AAC9D,2DAAoD;AAcpD,0DAAuE;AAGvE;;;;;;GAMG;AACH,MAAsB,cACrB,SAAQ,6BAAoC;IAkE5C,YAAmB,KAA0B;QAC5C,KAAK,EAAE,CAAC;QAhED,cAAS,GAAG,KAAK,CAAC;QAiEzB,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,mBAAM,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,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,OAAO,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACJ,CAAC;IAxDD;;;OAGG;IACH,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAED,IAAW,EAAE;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IACxB,CAAC;IACD,IAA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SAAS,KAAK,SAAS,EAC5B,KAAK,CAAC,kEAAkE,CACxE,CAAC;YACF,MAAM,IAAI,CAAC,wBAAwB,EAAE,CAAC;SACtC;aAAM;YACN,MAAM,IAAI,CAAC,qBAAqB,CAC9B,IAAI,CAAC,OAAO,CAAC,WAAiC,IAAI,IAAI,CAAC,SAAS,CACjE,CAAC;SACF;QACD,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAC7B,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;;;OAGG;IACI,OAAO;QACb,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAED;;;OAGG;IACO,MAAM,CAAC,cAAc,CAAC,KAAa;QAC5C,OAAO,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACO,YAAY,CACrB,MAA2D,EAC3D,GAAG,MAAgB;QAEnB,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACO,cAAc,CACvB,MAA2D,EAC3D,GAAG,MAAgB;QAEnB,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC;IACzC,CAAC;CACD;AA3MD,wCA2MC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { EventEmitter } from \"events\";\nimport { EventForwarder } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tIEvent,\n\tIEventProvider,\n\tIFluidHandle,\n\tIFluidLoadable,\n\tIFluidRouter,\n\tIProvideFluidHandle,\n\tIRequest,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { AsyncFluidObjectProvider } from \"@fluidframework/synthesize\";\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\t/**\n\t * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not provide a functioning built-in disposed flow.\n\t * This member will be removed in an upcoming release.\n\t */\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 * 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 * @deprecated 2.0.0-internal.5.2.0 - Dispose does nothing and will be removed in an upcoming release.\n\t */\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\t/**\n\t * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not actually set up to forward events, and will not be an EventForwarder\n\t * in a future release.\n\t */\n\tprotected static isEmitterEvent(event: string): boolean {\n\t\treturn super.isEmitterEvent(event);\n\t}\n\n\t/**\n\t * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not actually set up to forward events, and will not be an EventForwarder\n\t * in a future release.\n\t */\n\tprotected forwardEvent(\n\t\tsource: EventEmitter | IEventProvider<I[\"Events\"] & IEvent>,\n\t\t...events: string[]\n\t): void {\n\t\tsuper.forwardEvent(source, ...events);\n\t}\n\n\t/**\n\t * @deprecated 2.0.0-internal.5.2.0 - PureDataObject does not actually set up to forward events, and will not be an EventForwarder\n\t * in a future release.\n\t */\n\tprotected unforwardEvent(\n\t\tsource: EventEmitter | IEventProvider<I[\"Events\"] & IEvent>,\n\t\t...events: string[]\n\t): void {\n\t\tsuper.unforwardEvent(source, ...events);\n\t}\n}\n"]}
1
+ {"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AACjE,2DAAoD;AAcpD,iEAAkE;AAGlE;;;;;;GAMG;AACH,MAAsB,cACrB,SAAQ,gCAAuC;IA2B/C,IAAW,EAAE;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IACxB,CAAC;IACD;;OAEG;IACH,gDAAgD;IAChD,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QAChB,0GAA0G;QAC1G,yGAAyG;QACzG,wDAAwD;QACxD,IAAA,mBAAM,EAAC,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC,OAAO,CAAC,UAAgC,CAAC;IACtD,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,OAA+B;QAChE,MAA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,CAAC,aAAa,EAAE,CAAC;QAC3B,IAAI,QAAQ,EAAE;YACb,IAAA,mBAAM,EACL,IAAI,CAAC,SAAS,KAAK,SAAS,EAC5B,KAAK,CAAC,kEAAkE,CACxE,CAAC;YACF,MAAM,IAAI,CAAC,wBAAwB,EAAE,CAAC;SACtC;aAAM;YACN,MAAM,IAAI,CAAC,qBAAqB,CAC9B,IAAI,CAAC,OAAO,CAAC,WAAiC,IAAI,IAAI,CAAC,SAAS,CACjE,CAAC;SACF;QACD,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAC7B,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;CAClD;AAvJD,wCAuJC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tIEvent,\n\tIFluidHandle,\n\tIFluidLoadable,\n\t// eslint-disable-next-line import/no-deprecated\n\tIFluidRouter,\n\tIProvideFluidHandle,\n\tIRequest,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { AsyncFluidObjectProvider } from \"@fluidframework/synthesize\";\nimport { create404Response } from \"@fluidframework/runtime-utils\";\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 TypedEventEmitter<I[\"Events\"] & IEvent>\n\t// eslint-disable-next-line import/no-deprecated\n\timplements IFluidLoadable, IFluidRouter, IProvideFluidHandle\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 id() {\n\t\treturn this.runtime.id;\n\t}\n\t/**\n\t * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n\t */\n\t// eslint-disable-next-line import/no-deprecated\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\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\t}\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 req.url === \"\" || req.url === \"/\" || req.url.startsWith(\"/?\")\n\t\t\t? { mimeType: \"fluid/object\", status: 200, value: this }\n\t\t\t: create404Response(req);\n\t}\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 * 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"]}
@@ -17,12 +17,14 @@ import { RequestParser } from "@fluidframework/runtime-utils";
17
17
  * When a request is received with a mountableView: true header, this request handler will reissue the request
18
18
  * without the header, and respond with a mountable view of the given class using the response.
19
19
  * @param MountableViewClass - The type of mountable view to use when responding
20
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
20
21
  */
21
22
  export declare const mountableViewRequestHandler: (MountableViewClass: IFluidMountableViewClass, handlers: RuntimeRequestHandler[]) => (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse>;
22
23
  /**
23
24
  * Pipe through container request into internal request.
24
25
  * If request is empty and default url is provided, redirect request to such default url.
25
26
  * @param defaultRootId - optional default root data store ID to pass request in case request is empty.
27
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
26
28
  */
27
29
  export declare const defaultRouteRequestHandler: (defaultRootId: string) => (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
28
30
  /**
@@ -35,6 +37,7 @@ export declare const defaultRouteRequestHandler: (defaultRootId: string) => (req
35
37
  * 3. the request url starts with "/" and is followed by a query param, such as /?key=value
36
38
  *
37
39
  * Returns a 404 error for any other url.
40
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
38
41
  */
39
42
  export declare function defaultFluidObjectRequestHandler(fluidObject: FluidObject, request: IRequest): IResponse;
40
43
  //# sourceMappingURL=requestHandlers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../../src/request-handlers/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAkB,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAA8B,MAAM,iCAAiC,CAAC;AACpG,OAAO,EAAE,aAAa,EAAqB,MAAM,+BAA+B,CAAC;AAEjF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B,uBACnB,wBAAwB,YAClC,qBAAqB,EAAE,eAGV,aAAa,WAAW,iBAAiB,uBA4BhE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,kBAAmB,MAAM,eACxC,QAAQ,WAAW,iBAAiB,mCAU3D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC/C,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,QAAQ,GACf,SAAS,CAIX"}
1
+ {"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../../src/request-handlers/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAkB,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEhF,OAAO,EAAE,qBAAqB,EAA8B,MAAM,iCAAiC,CAAC;AACpG,OAAO,EAAE,aAAa,EAAqB,MAAM,+BAA+B,CAAC;AAEjF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,uBACnB,wBAAwB,YAClC,qBAAqB,EAAE,eAIV,aAAa,WAAW,iBAAiB,uBA4BhE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,kBAAmB,MAAM,eACxC,QAAQ,WAAW,iBAAiB,mCAU3D,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,gCAAgC,CAC/C,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,QAAQ,GACf,SAAS,CAIX"}
@@ -5,6 +5,7 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.defaultFluidObjectRequestHandler = exports.defaultRouteRequestHandler = exports.mountableViewRequestHandler = void 0;
8
+ // eslint-disable-next-line import/no-deprecated
8
9
  const request_handler_1 = require("@fluidframework/request-handler");
9
10
  const runtime_utils_1 = require("@fluidframework/runtime-utils");
10
11
  /**
@@ -17,8 +18,10 @@ const runtime_utils_1 = require("@fluidframework/runtime-utils");
17
18
  * When a request is received with a mountableView: true header, this request handler will reissue the request
18
19
  * without the header, and respond with a mountable view of the given class using the response.
19
20
  * @param MountableViewClass - The type of mountable view to use when responding
21
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
20
22
  */
21
23
  const mountableViewRequestHandler = (MountableViewClass, handlers) => {
24
+ // eslint-disable-next-line import/no-deprecated
22
25
  const nestedHandler = (0, request_handler_1.buildRuntimeRequestHandler)(...handlers);
23
26
  return async (request, runtime) => {
24
27
  const mountableView = request.headers?.mountableView === true;
@@ -51,6 +54,7 @@ exports.mountableViewRequestHandler = mountableViewRequestHandler;
51
54
  * Pipe through container request into internal request.
52
55
  * If request is empty and default url is provided, redirect request to such default url.
53
56
  * @param defaultRootId - optional default root data store ID to pass request in case request is empty.
57
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
54
58
  */
55
59
  const defaultRouteRequestHandler = (defaultRootId) => {
56
60
  return async (request, runtime) => {
@@ -75,6 +79,7 @@ exports.defaultRouteRequestHandler = defaultRouteRequestHandler;
75
79
  * 3. the request url starts with "/" and is followed by a query param, such as /?key=value
76
80
  *
77
81
  * Returns a 404 error for any other url.
82
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
78
83
  */
79
84
  function defaultFluidObjectRequestHandler(fluidObject, request) {
80
85
  return request.url === "" || request.url === "/" || request.url.startsWith("/?")
@@ -1 +1 @@
1
- {"version":3,"file":"requestHandlers.js","sourceRoot":"","sources":["../../src/request-handlers/requestHandlers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,qEAAoG;AACpG,iEAAiF;AAEjF;;;;;;;;;;GAUG;AACI,MAAM,2BAA2B,GAAG,CAC1C,kBAA4C,EAC5C,QAAiC,EAChC,EAAE;IACH,MAAM,aAAa,GAAG,IAAA,4CAA0B,EAAC,GAAG,QAAQ,CAAC,CAAC;IAC9D,OAAO,KAAK,EAAE,OAAsB,EAAE,OAA0B,EAAE,EAAE;QACnE,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;QAC9D,IAAI,UAAU,GAAa,OAAO,CAAC;QACnC,IAAI,aAAa,EAAE;YAClB,wDAAwD;YACxD,mDAAmD;YACnD,MAAM,OAAO,GAAmB,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YACvD,OAAQ,OAAe,CAAC,aAAa,CAAC;YACtC,UAAU,GAAG;gBACZ,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,OAAO;aACP,CAAC;SACF;QACD,MAAM,QAAQ,GAAG,MAAM,aAAa,CA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AC,IAAA,iCAAiB,EAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAPD,4EAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject, IRequest, IRequestHeader, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport type { IFluidMountableViewClass } from \"@fluidframework/view-interfaces\";\nimport { RuntimeRequestHandler, buildRuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils\";\n\n/**\n * A mountable view is only required if the view needs to be mounted across a bundle boundary. Mounting across\n * bundle boundaries breaks some frameworks, so the mountable view is used to ensure the mounting is done within\n * the same bundle as the view. For example, React hooks don't work if mounted across bundles since there will\n * be two React instances, breaking the Rules of Hooks. When cross-bundle mounting isn't required, the mountable\n * view isn't necessary.\n *\n * When a request is received with a mountableView: true header, this request handler will reissue the request\n * without the header, and respond with a mountable view of the given class using the response.\n * @param MountableViewClass - The type of mountable view to use when responding\n */\nexport const mountableViewRequestHandler = (\n\tMountableViewClass: IFluidMountableViewClass,\n\thandlers: RuntimeRequestHandler[],\n) => {\n\tconst nestedHandler = buildRuntimeRequestHandler(...handlers);\n\treturn async (request: RequestParser, runtime: IContainerRuntime) => {\n\t\tconst mountableView = request.headers?.mountableView === true;\n\t\tlet newRequest: IRequest = request;\n\t\tif (mountableView) {\n\t\t\t// Reissue the request without the mountableView header.\n\t\t\t// We'll repack whatever the response is if we can.\n\t\t\tconst headers: IRequestHeader = { ...request.headers };\n\t\t\tdelete (headers as any).mountableView;\n\t\t\tnewRequest = {\n\t\t\t\turl: request.url,\n\t\t\t\theaders,\n\t\t\t};\n\t\t}\n\t\tconst response = await nestedHandler(newRequest, runtime);\n\n\t\tif (\n\t\t\tmountableView &&\n\t\t\tresponse.status === 200 &&\n\t\t\tMountableViewClass.canMount(response.value)\n\t\t) {\n\t\t\treturn {\n\t\t\t\tstatus: 200,\n\t\t\t\tmimeType: \"fluid/object\",\n\t\t\t\tvalue: new MountableViewClass(response.value),\n\t\t\t};\n\t\t}\n\t\treturn response;\n\t};\n};\n\n/**\n * Pipe through container request into internal request.\n * If request is empty and default url is provided, redirect request to such default url.\n * @param defaultRootId - optional default root data store ID to pass request in case request is empty.\n */\nexport const defaultRouteRequestHandler = (defaultRootId: string) => {\n\treturn async (request: IRequest, runtime: IContainerRuntime) => {\n\t\tconst parser = RequestParser.create(request);\n\t\tif (parser.pathParts.length === 0) {\n\t\t\treturn runtime.IFluidHandleContext.resolveHandle({\n\t\t\t\turl: `/${defaultRootId}${parser.query}`,\n\t\t\t\theaders: request.headers,\n\t\t\t});\n\t\t}\n\t\treturn undefined; // continue search\n\t};\n};\n\n/**\n * Default request handler for a Fluid object that returns the object itself if:\n *\n * 1. the request url is empty\n *\n * 2. the request url is \"/\"\n *\n * 3. the request url starts with \"/\" and is followed by a query param, such as /?key=value\n *\n * Returns a 404 error for any other url.\n */\nexport function defaultFluidObjectRequestHandler(\n\tfluidObject: FluidObject,\n\trequest: IRequest,\n): IResponse {\n\treturn request.url === \"\" || request.url === \"/\" || request.url.startsWith(\"/?\")\n\t\t? { mimeType: \"fluid/object\", status: 200, value: fluidObject }\n\t\t: create404Response(request);\n}\n"]}
1
+ {"version":3,"file":"requestHandlers.js","sourceRoot":"","sources":["../../src/request-handlers/requestHandlers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,gDAAgD;AAChD,qEAAoG;AACpG,iEAAiF;AAEjF;;;;;;;;;;;GAWG;AACI,MAAM,2BAA2B,GAAG,CAC1C,kBAA4C,EAC5C,QAAiC,EAChC,EAAE;IACH,gDAAgD;IAChD,MAAM,aAAa,GAAG,IAAA,4CAA0B,EAAC,GAAG,QAAQ,CAAC,CAAC;IAC9D,OAAO,KAAK,EAAE,OAAsB,EAAE,OAA0B,EAAE,EAAE;QACnE,MAAM,aAAa,GAAG,OAAO,CAAC,O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CAAC;AAXW,QAAA,0BAA0B,8BAWrC;AAEF;;;;;;;;;;;GAWG;AACH,SAAgB,gCAAgC,CAC/C,WAAwB,EACxB,OAAiB;IAEjB,OAAO,OAAO,CAAC,GAAG,KAAK,EAAE,IAAI,OAAO,CAAC,GAAG,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;QAC/E,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE;QAC/D,CAAC,CAAC,IAAA,iCAAiB,EAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAPD,4EAOC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidObject, IRequest, IRequestHeader, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport type { IFluidMountableViewClass } from \"@fluidframework/view-interfaces\";\n// eslint-disable-next-line import/no-deprecated\nimport { RuntimeRequestHandler, buildRuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils\";\n\n/**\n * A mountable view is only required if the view needs to be mounted across a bundle boundary. Mounting across\n * bundle boundaries breaks some frameworks, so the mountable view is used to ensure the mounting is done within\n * the same bundle as the view. For example, React hooks don't work if mounted across bundles since there will\n * be two React instances, breaking the Rules of Hooks. When cross-bundle mounting isn't required, the mountable\n * view isn't necessary.\n *\n * When a request is received with a mountableView: true header, this request handler will reissue the request\n * without the header, and respond with a mountable view of the given class using the response.\n * @param MountableViewClass - The type of mountable view to use when responding\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n */\nexport const mountableViewRequestHandler = (\n\tMountableViewClass: IFluidMountableViewClass,\n\thandlers: RuntimeRequestHandler[],\n) => {\n\t// eslint-disable-next-line import/no-deprecated\n\tconst nestedHandler = buildRuntimeRequestHandler(...handlers);\n\treturn async (request: RequestParser, runtime: IContainerRuntime) => {\n\t\tconst mountableView = request.headers?.mountableView === true;\n\t\tlet newRequest: IRequest = request;\n\t\tif (mountableView) {\n\t\t\t// Reissue the request without the mountableView header.\n\t\t\t// We'll repack whatever the response is if we can.\n\t\t\tconst headers: IRequestHeader = { ...request.headers };\n\t\t\tdelete (headers as any).mountableView;\n\t\t\tnewRequest = {\n\t\t\t\turl: request.url,\n\t\t\t\theaders,\n\t\t\t};\n\t\t}\n\t\tconst response = await nestedHandler(newRequest, runtime);\n\n\t\tif (\n\t\t\tmountableView &&\n\t\t\tresponse.status === 200 &&\n\t\t\tMountableViewClass.canMount(response.value)\n\t\t) {\n\t\t\treturn {\n\t\t\t\tstatus: 200,\n\t\t\t\tmimeType: \"fluid/object\",\n\t\t\t\tvalue: new MountableViewClass(response.value),\n\t\t\t};\n\t\t}\n\t\treturn response;\n\t};\n};\n\n/**\n * Pipe through container request into internal request.\n * If request is empty and default url is provided, redirect request to such default url.\n * @param defaultRootId - optional default root data store ID to pass request in case request is empty.\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n */\nexport const defaultRouteRequestHandler = (defaultRootId: string) => {\n\treturn async (request: IRequest, runtime: IContainerRuntime) => {\n\t\tconst parser = RequestParser.create(request);\n\t\tif (parser.pathParts.length === 0) {\n\t\t\treturn runtime.IFluidHandleContext.resolveHandle({\n\t\t\t\turl: `/${defaultRootId}${parser.query}`,\n\t\t\t\theaders: request.headers,\n\t\t\t});\n\t\t}\n\t\treturn undefined; // continue search\n\t};\n};\n\n/**\n * Default request handler for a Fluid object that returns the object itself if:\n *\n * 1. the request url is empty\n *\n * 2. the request url is \"/\"\n *\n * 3. the request url starts with \"/\" and is followed by a query param, such as /?key=value\n *\n * Returns a 404 error for any other url.\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n */\nexport function defaultFluidObjectRequestHandler(\n\tfluidObject: FluidObject,\n\trequest: IRequest,\n): IResponse {\n\treturn request.url === \"\" || request.url === \"/\" || request.url.startsWith(\"/?\")\n\t\t? { mimeType: \"fluid/object\", status: 200, value: fluidObject }\n\t\t: create404Response(request);\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.34.9"
8
+ "packageVersion": "7.38.0"
9
9
  }
10
10
  ]
11
11
  }
@@ -5,6 +5,7 @@
5
5
  import { FluidObject } from "@fluidframework/core-interfaces";
6
6
  import { IContainer } from "@fluidframework/container-definitions";
7
7
  /**
8
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
8
9
  * Helper function for getting the default Fluid Object from a Container. This function only works for
9
10
  * Containers that support "/" request.
10
11
  *
@@ -14,6 +15,7 @@ import { IContainer } from "@fluidframework/container-definitions";
14
15
  */
15
16
  export declare function getDefaultObjectFromContainer<T = FluidObject>(container: IContainer): Promise<T>;
16
17
  /**
18
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
17
19
  * Helper function for getting as Fluid Object from a Container given a Unique Id. This function only works for
18
20
  * Containers that support getting FluidObjects via request.
19
21
  *
@@ -24,6 +26,7 @@ export declare function getDefaultObjectFromContainer<T = FluidObject>(container
24
26
  */
25
27
  export declare function getObjectWithIdFromContainer<T = FluidObject>(id: string, container: IContainer): Promise<T>;
26
28
  /**
29
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
27
30
  * Helper function for getting a Fluid Object from a Container given a path/url. This function only works for
28
31
  * Containers that support getting FluidObjects via request.
29
32
  *
@@ -1 +1 @@
1
- {"version":3,"file":"containerInteractions.d.ts","sourceRoot":"","sources":["../../src/utils/containerInteractions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAEnE;;;;;;;GAOG;AACH,wBAAsB,6BAA6B,CAAC,CAAC,GAAG,WAAW,EAClE,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED;;;;;;;;GAQG;AACH,wBAAsB,4BAA4B,CAAC,CAAC,GAAG,WAAW,EACjE,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,GAAG,WAAW,EAC3D,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAWZ"}
1
+ {"version":3,"file":"containerInteractions.d.ts","sourceRoot":"","sources":["../../src/utils/containerInteractions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAEnE;;;;;;;;GAQG;AACH,wBAAsB,6BAA6B,CAAC,CAAC,GAAG,WAAW,EAClE,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED;;;;;;;;;GASG;AACH,wBAAsB,4BAA4B,CAAC,CAAC,GAAG,WAAW,EACjE,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,GAAG,WAAW,EAC3D,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,UAAU,GACnB,OAAO,CAAC,CAAC,CAAC,CAWZ"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getObjectFromContainer = exports.getObjectWithIdFromContainer = exports.getDefaultObjectFromContainer = void 0;
4
4
  /**
5
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
5
6
  * Helper function for getting the default Fluid Object from a Container. This function only works for
6
7
  * Containers that support "/" request.
7
8
  *
@@ -24,6 +25,7 @@ async function getDefaultObjectFromContainer(container) {
24
25
  }
25
26
  exports.getDefaultObjectFromContainer = getDefaultObjectFromContainer;
26
27
  /**
28
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
27
29
  * Helper function for getting as Fluid Object from a Container given a Unique Id. This function only works for
28
30
  * Containers that support getting FluidObjects via request.
29
31
  *
@@ -47,6 +49,7 @@ async function getObjectWithIdFromContainer(id, container) {
47
49
  }
48
50
  exports.getObjectWithIdFromContainer = getObjectWithIdFromContainer;
49
51
  /**
52
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
50
53
  * Helper function for getting a Fluid Object from a Container given a path/url. This function only works for
51
54
  * Containers that support getting FluidObjects via request.
52
55
  *