@fluidframework/aqueduct 2.53.1 → 2.61.0-355054

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 (76) hide show
  1. package/.mocharc.cjs +1 -2
  2. package/CHANGELOG.md +4 -0
  3. package/api-report/{aqueduct.legacy.alpha.api.md → aqueduct.legacy.beta.api.md} +14 -14
  4. package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts +2 -2
  5. package/dist/container-runtime-factories/baseContainerRuntimeFactory.js +1 -1
  6. package/dist/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
  7. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +2 -2
  8. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +1 -1
  9. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  10. package/dist/data-object-factories/dataObjectFactory.d.ts +1 -1
  11. package/dist/data-object-factories/dataObjectFactory.js +1 -1
  12. package/dist/data-object-factories/dataObjectFactory.js.map +1 -1
  13. package/dist/data-object-factories/pureDataObjectFactory.d.ts +2 -4
  14. package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
  15. package/dist/data-object-factories/pureDataObjectFactory.js +1 -2
  16. package/dist/data-object-factories/pureDataObjectFactory.js.map +1 -1
  17. package/dist/data-object-factories/treeDataObjectFactory.d.ts +1 -1
  18. package/dist/data-object-factories/treeDataObjectFactory.js +1 -1
  19. package/dist/data-object-factories/treeDataObjectFactory.js.map +1 -1
  20. package/dist/data-objects/dataObject.d.ts +1 -1
  21. package/dist/data-objects/dataObject.js +1 -1
  22. package/dist/data-objects/dataObject.js.map +1 -1
  23. package/dist/data-objects/pureDataObject.d.ts +1 -2
  24. package/dist/data-objects/pureDataObject.d.ts.map +1 -1
  25. package/dist/data-objects/pureDataObject.js +1 -2
  26. package/dist/data-objects/pureDataObject.js.map +1 -1
  27. package/dist/data-objects/treeDataObject.d.ts +1 -1
  28. package/dist/data-objects/treeDataObject.js +1 -1
  29. package/dist/data-objects/treeDataObject.js.map +1 -1
  30. package/dist/data-objects/types.d.ts +2 -4
  31. package/dist/data-objects/types.d.ts.map +1 -1
  32. package/dist/data-objects/types.js.map +1 -1
  33. package/dist/legacy.d.ts +2 -1
  34. package/internal.d.ts +1 -1
  35. package/legacy.d.ts +1 -1
  36. package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.ts +2 -2
  37. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js +1 -1
  38. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
  39. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +2 -2
  40. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +1 -1
  41. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  42. package/lib/data-object-factories/dataObjectFactory.d.ts +1 -1
  43. package/lib/data-object-factories/dataObjectFactory.js +1 -1
  44. package/lib/data-object-factories/dataObjectFactory.js.map +1 -1
  45. package/lib/data-object-factories/pureDataObjectFactory.d.ts +2 -4
  46. package/lib/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
  47. package/lib/data-object-factories/pureDataObjectFactory.js +1 -2
  48. package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -1
  49. package/lib/data-object-factories/treeDataObjectFactory.d.ts +1 -1
  50. package/lib/data-object-factories/treeDataObjectFactory.js +1 -1
  51. package/lib/data-object-factories/treeDataObjectFactory.js.map +1 -1
  52. package/lib/data-objects/dataObject.d.ts +1 -1
  53. package/lib/data-objects/dataObject.js +1 -1
  54. package/lib/data-objects/dataObject.js.map +1 -1
  55. package/lib/data-objects/pureDataObject.d.ts +1 -2
  56. package/lib/data-objects/pureDataObject.d.ts.map +1 -1
  57. package/lib/data-objects/pureDataObject.js +1 -2
  58. package/lib/data-objects/pureDataObject.js.map +1 -1
  59. package/lib/data-objects/treeDataObject.d.ts +1 -1
  60. package/lib/data-objects/treeDataObject.js +1 -1
  61. package/lib/data-objects/treeDataObject.js.map +1 -1
  62. package/lib/data-objects/types.d.ts +2 -4
  63. package/lib/data-objects/types.d.ts.map +1 -1
  64. package/lib/data-objects/types.js.map +1 -1
  65. package/lib/legacy.d.ts +2 -1
  66. package/lib/tsdoc-metadata.json +1 -1
  67. package/package.json +28 -28
  68. package/src/container-runtime-factories/baseContainerRuntimeFactory.ts +2 -2
  69. package/src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts +2 -2
  70. package/src/data-object-factories/dataObjectFactory.ts +1 -1
  71. package/src/data-object-factories/pureDataObjectFactory.ts +2 -4
  72. package/src/data-object-factories/treeDataObjectFactory.ts +1 -1
  73. package/src/data-objects/dataObject.ts +1 -1
  74. package/src/data-objects/pureDataObject.ts +1 -2
  75. package/src/data-objects/treeDataObject.ts +1 -1
  76. package/src/data-objects/types.ts +2 -4
@@ -1 +1 @@
1
- {"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAYjE,kEAA6D;AAG7D,qEAA2E;AAK3E;;;;;;;;;;GAUG;AACH,MAAsB,cACrB,SAAQ,gCAAuC;IAkC/C,IAAW,EAAE;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QAChB,0GAA0G;QAC1G,yGAAyG;QACzG,wDAAwD;QACxD,IAAA,iBAAM,EAAC,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC,OAAO,C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IAAI,CAAC,wBAAwB,EAAE,CAAC;QACvC,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,CAAC,qBAAqB,CAC9B,IAAI,CAAC,OAAO,CAAC,WAAiC,IAAI,IAAI,CAAC,SAAS,CACjE,CAAC;QACH,CAAC;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;AAtJD,wCAsJC","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 type {\n\tIEvent,\n\tIFluidLoadable,\n\tIRequest,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\t// eslint-disable-next-line import/no-deprecated\n\tIProvideFluidHandle,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions/internal\";\nimport type { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions/internal\";\nimport { create404Response } from \"@fluidframework/runtime-utils/internal\";\nimport type { AsyncFluidObjectProvider } from \"@fluidframework/synthesize/internal\";\n\nimport type { DataObjectTypes, IDataObjectProps } from \"./types.js\";\n\n/**\n * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.\n *\n * @remarks\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 * @legacy\n * @alpha\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, 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 IContainerRuntime\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\t/**\n\t * Internal implementation detail.\n\t * Subclasses should not use this.\n\t * @privateRemarks\n\t * For unknown reasons this API was exposed as a protected member with no documented behavior nor any external usage or clear use-case.\n\t * Ideally a breaking change would be made to replace this with a better named private property like `#initializationPromise` when permitted.\n\t */\n\tprotected initializeP: Promise<void> | undefined;\n\n\tpublic get id(): string {\n\t\treturn this.runtime.id;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidLoadable.IFluidLoadable}\n\t */\n\tpublic get IFluidLoadable(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal<this> {\n\t\treturn this.handle;\n\t}\n\n\t/**\n\t * Handle to a data store\n\t */\n\tpublic get handle(): IFluidHandleInternal<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 IFluidHandleInternal<this>;\n\t}\n\n\tpublic static async getDataObject(runtime: IFluidDataStoreRuntime): Promise<PureDataObject> {\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\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 * Await 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 await this API to ensure object is fully initialized.\n\t */\n\tpublic async finishInitialization(existing: boolean): Promise<void> {\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"]}
1
+ {"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAYjE,kEAA6D;AAG7D,qEAA2E;AAK3E;;;;;;;;;GASG;AACH,MAAsB,cACrB,SAAQ,gCAAuC;IAkC/C,IAAW,EAAE;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;OAEG;IACH,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QAChB,0GAA0G;QAC1G,yGAAyG;QACzG,wDAAwD;QACxD,IAAA,iBAAM,EAAC,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC,OAAO,CAAC,UAAwC,CAAC;IAC9D,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,OAA+B;QAChE,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC3C,OAAO,GAAqB,CAAC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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;AAtJD,wCAsJC","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 type {\n\tIEvent,\n\tIFluidLoadable,\n\tIRequest,\n\tIResponse,\n} from \"@fluidframework/core-interfaces\";\nimport type {\n\tIFluidHandleInternal,\n\t// eslint-disable-next-line import/no-deprecated\n\tIProvideFluidHandle,\n} from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions/internal\";\nimport type { IFluidDataStoreContext } from \"@fluidframework/runtime-definitions/internal\";\nimport { create404Response } from \"@fluidframework/runtime-utils/internal\";\nimport type { AsyncFluidObjectProvider } from \"@fluidframework/synthesize/internal\";\n\nimport type { DataObjectTypes, IDataObjectProps } from \"./types.js\";\n\n/**\n * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.\n *\n * @remarks\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 * @legacy @beta\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, 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 IContainerRuntime\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\t/**\n\t * Internal implementation detail.\n\t * Subclasses should not use this.\n\t * @privateRemarks\n\t * For unknown reasons this API was exposed as a protected member with no documented behavior nor any external usage or clear use-case.\n\t * Ideally a breaking change would be made to replace this with a better named private property like `#initializationPromise` when permitted.\n\t */\n\tprotected initializeP: Promise<void> | undefined;\n\n\tpublic get id(): string {\n\t\treturn this.runtime.id;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidLoadable.IFluidLoadable}\n\t */\n\tpublic get IFluidLoadable(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}\n\t */\n\tpublic get IFluidHandle(): IFluidHandleInternal<this> {\n\t\treturn this.handle;\n\t}\n\n\t/**\n\t * Handle to a data store\n\t */\n\tpublic get handle(): IFluidHandleInternal<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 IFluidHandleInternal<this>;\n\t}\n\n\tpublic static async getDataObject(runtime: IFluidDataStoreRuntime): Promise<PureDataObject> {\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\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 * Await 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 await this API to ensure object is fully initialized.\n\t */\n\tpublic async finishInitialization(existing: boolean): Promise<void> {\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"]}
@@ -43,7 +43,7 @@ import type { DataObjectTypes } from "./types.js";
43
43
  * }
44
44
  * ```
45
45
  *
46
- * @legacy @alpha
46
+ * @legacy @beta
47
47
  */
48
48
  export declare abstract class TreeDataObject<TDataObjectTypes extends DataObjectTypes = DataObjectTypes> extends PureDataObject<TDataObjectTypes> {
49
49
  #private;
@@ -64,7 +64,7 @@ const uninitializedErrorString = "The tree has not yet been initialized. The dat
64
64
  * }
65
65
  * ```
66
66
  *
67
- * @legacy @alpha
67
+ * @legacy @beta
68
68
  */
69
69
  class TreeDataObject extends pureDataObject_js_1.PureDataObject {
70
70
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"treeDataObject.js","sourceRoot":"","sources":["../../src/data-objects/treeDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAGH,uEAAsE;AACtE,4DAAuE;AAEvE,2DAAqD;AAGrD;;;GAGG;AACH,MAAM,aAAa,GAAG,WAAW,CAAC;AAElC,MAAM,wBAAwB,GAC7B,8FAA8F,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAsB,cAEpB,SAAQ,kCAAgC;IAF1C;;QAGC;;;WAGG;QACH,uCAAyB;IA2C1B,CAAC;IAzCA;;;OAGG;IACH,IAAc,IAAI;QACjB,IAAI,uBAAA,IAAI,4BAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,qBAAU,CAAC,wBAAwB,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,uBAAA,IAAI,4BAAM,CAAC;IACnB,CAAC;IAEe,KAAK,CAAC,kBAAkB,CAAC,QAAiB;QACzD,IAAI,QAAQ,EAAE,CAAC;YACd,+FAA+F;YAC/F,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YAE7D,0FAA0F;YAC1F,8FAA8F;YAC9F,IAAI,CAAC,qBAAU,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC7B,MAAM,IAAI,KAAK,CACd,mBAAmB,OAAO,CAAC,EAAE,gEAAgE,CAC7F,CAAC;YACH,CAAC;YACD,MAAM,UAAU,GAAU,OAAO,CAAC;YAElC,uBAAA,IAAI,wBAAS,UAAU,MAAA,CAAC;QACzB,CAAC;aAAM,CAAC;YACP,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAC5C,aAAa,EACb,qBAAU,CAAC,UAAU,EAAE,CAAC,IAAI,CACR,CAAC;YACrB,UAAuC,CAAC,aAAa,EAAE,CAAC;YAEzD,uBAAA,IAAI,wBAAS,UAAU,MAAA,CAAC;YAExB,oFAAoF;YACpF,2DAA2D;QAC5D,CAAC;QAED,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;CACD;AAlDD,wCAkDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ISharedObject } from \"@fluidframework/shared-object-base/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { SharedTree, type ITree } from \"@fluidframework/tree/internal\";\n\nimport { PureDataObject } from \"./pureDataObject.js\";\nimport type { DataObjectTypes } from \"./types.js\";\n\n/**\n * Channel ID of {@link TreeDataObject}'s root {@link @fluidframework/tree#SharedTree}.\n * @privateRemarks This key is persisted and should not be changed without a migration strategy.\n */\nconst treeChannelId = \"root-tree\";\n\nconst uninitializedErrorString =\n\t\"The tree has not yet been initialized. The data object must be initialized before accessing.\";\n\n/**\n * A {@link PureDataObject | data object} backed by a {@link @fluidframework/tree#ITree}.\n *\n * @remarks\n *\n * In order to view the tree's data, consumers of this type will need to apply the appropriate view schema to the {@link TreeDataObject.tree}.\n * This will generally be done via {@link PureDataObject.initializingFromExisting} and {@link PureDataObject.initializingFirstTime} methods.\n *\n * To initialize the tree's data for initial creation, implementers of this class will need to override {@link PureDataObject.initializingFirstTime} and set the data in the schema-aware view.\n *\n * @typeParam TDataObjectTypes - The optional input types used to strongly type the data object.\n *\n * @example Implementing `initializingFirstTime`\n *\n * ```typescript\n * protected override async initializingFirstTime(): Promise<void> {\n * \t// Generate the schema-aware view of the tree.\n * \tthis.treeView = this.tree.viewWith(treeViewConfiguration);\n *\n * \t// Initialize the tree with initial data.\n * \tthis.treeView.initialize(initialTree);\n * }\n * ```\n *\n * @example Implementing `initializingFromExisting`\n *\n * ```typescript\n * protected override async initializingFromExisting(): Promise<void> {\n * \t// Generate the schema-aware view of the tree.\n * \tthis.treeView = this.tree.viewWith(treeViewConfiguration);\n *\n * // Ensure the loaded tree is compatible with the view schema.\n * \tif (!this.treeView.compatibility.canView) {\n * \t\t// Handle out-of-schema data as appropriate.\n * \t}\n * }\n * ```\n *\n * @legacy @alpha\n */\nexport abstract class TreeDataObject<\n\tTDataObjectTypes extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObject<TDataObjectTypes> {\n\t/**\n\t * The underlying {@link @fluidframework/tree#ITree | tree}.\n\t * @remarks Created once during initialization.\n\t */\n\t#tree: ITree | undefined;\n\n\t/**\n\t * The underlying {@link @fluidframework/tree#ITree | tree}.\n\t * @remarks Created once during initialization.\n\t */\n\tprotected get tree(): ITree {\n\t\tif (this.#tree === undefined) {\n\t\t\tthrow new UsageError(uninitializedErrorString);\n\t\t}\n\t\treturn this.#tree;\n\t}\n\n\tpublic override async initializeInternal(existing: boolean): Promise<void> {\n\t\tif (existing) {\n\t\t\t// data store has a root tree so we just need to set it before calling initializingFromExisting\n\t\t\tconst channel = await this.runtime.getChannel(treeChannelId);\n\n\t\t\t// TODO: Support using a Directory to Tree migration shim and DataObject's root channel ID\n\t\t\t// to allow migrating from DataObject to TreeDataObject instead of just erroring in that case.\n\t\t\tif (!SharedTree.is(channel)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Content with id ${channel.id} is not a SharedTree and cannot be loaded with treeDataObject.`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst sharedTree: ITree = channel;\n\n\t\t\tthis.#tree = sharedTree;\n\t\t} else {\n\t\t\tconst sharedTree = this.runtime.createChannel(\n\t\t\t\ttreeChannelId,\n\t\t\t\tSharedTree.getFactory().type,\n\t\t\t) as unknown as ITree;\n\t\t\t(sharedTree as unknown as ISharedObject).bindToContext();\n\n\t\t\tthis.#tree = sharedTree;\n\n\t\t\t// Note, the implementer is responsible for initializing the tree with initial data.\n\t\t\t// Generally, this can be done via `initializingFirstTime`.\n\t\t}\n\n\t\tawait super.initializeInternal(existing);\n\t}\n}\n"]}
1
+ {"version":3,"file":"treeDataObject.js","sourceRoot":"","sources":["../../src/data-objects/treeDataObject.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;AAGH,uEAAsE;AACtE,4DAAuE;AAEvE,2DAAqD;AAGrD;;;GAGG;AACH,MAAM,aAAa,GAAG,WAAW,CAAC;AAElC,MAAM,wBAAwB,GAC7B,8FAA8F,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAsB,cAEpB,SAAQ,kCAAgC;IAF1C;;QAGC;;;WAGG;QACH,uCAAyB;IA2C1B,CAAC;IAzCA;;;OAGG;IACH,IAAc,IAAI;QACjB,IAAI,uBAAA,IAAI,4BAAM,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,qBAAU,CAAC,wBAAwB,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,uBAAA,IAAI,4BAAM,CAAC;IACnB,CAAC;IAEe,KAAK,CAAC,kBAAkB,CAAC,QAAiB;QACzD,IAAI,QAAQ,EAAE,CAAC;YACd,+FAA+F;YAC/F,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YAE7D,0FAA0F;YAC1F,8FAA8F;YAC9F,IAAI,CAAC,qBAAU,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC7B,MAAM,IAAI,KAAK,CACd,mBAAmB,OAAO,CAAC,EAAE,gEAAgE,CAC7F,CAAC;YACH,CAAC;YACD,MAAM,UAAU,GAAU,OAAO,CAAC;YAElC,uBAAA,IAAI,wBAAS,UAAU,MAAA,CAAC;QACzB,CAAC;aAAM,CAAC;YACP,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAC5C,aAAa,EACb,qBAAU,CAAC,UAAU,EAAE,CAAC,IAAI,CACR,CAAC;YACrB,UAAuC,CAAC,aAAa,EAAE,CAAC;YAEzD,uBAAA,IAAI,wBAAS,UAAU,MAAA,CAAC;YAExB,oFAAoF;YACpF,2DAA2D;QAC5D,CAAC;QAED,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;CACD;AAlDD,wCAkDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { ISharedObject } from \"@fluidframework/shared-object-base/internal\";\nimport { UsageError } from \"@fluidframework/telemetry-utils/internal\";\nimport { SharedTree, type ITree } from \"@fluidframework/tree/internal\";\n\nimport { PureDataObject } from \"./pureDataObject.js\";\nimport type { DataObjectTypes } from \"./types.js\";\n\n/**\n * Channel ID of {@link TreeDataObject}'s root {@link @fluidframework/tree#SharedTree}.\n * @privateRemarks This key is persisted and should not be changed without a migration strategy.\n */\nconst treeChannelId = \"root-tree\";\n\nconst uninitializedErrorString =\n\t\"The tree has not yet been initialized. The data object must be initialized before accessing.\";\n\n/**\n * A {@link PureDataObject | data object} backed by a {@link @fluidframework/tree#ITree}.\n *\n * @remarks\n *\n * In order to view the tree's data, consumers of this type will need to apply the appropriate view schema to the {@link TreeDataObject.tree}.\n * This will generally be done via {@link PureDataObject.initializingFromExisting} and {@link PureDataObject.initializingFirstTime} methods.\n *\n * To initialize the tree's data for initial creation, implementers of this class will need to override {@link PureDataObject.initializingFirstTime} and set the data in the schema-aware view.\n *\n * @typeParam TDataObjectTypes - The optional input types used to strongly type the data object.\n *\n * @example Implementing `initializingFirstTime`\n *\n * ```typescript\n * protected override async initializingFirstTime(): Promise<void> {\n * \t// Generate the schema-aware view of the tree.\n * \tthis.treeView = this.tree.viewWith(treeViewConfiguration);\n *\n * \t// Initialize the tree with initial data.\n * \tthis.treeView.initialize(initialTree);\n * }\n * ```\n *\n * @example Implementing `initializingFromExisting`\n *\n * ```typescript\n * protected override async initializingFromExisting(): Promise<void> {\n * \t// Generate the schema-aware view of the tree.\n * \tthis.treeView = this.tree.viewWith(treeViewConfiguration);\n *\n * // Ensure the loaded tree is compatible with the view schema.\n * \tif (!this.treeView.compatibility.canView) {\n * \t\t// Handle out-of-schema data as appropriate.\n * \t}\n * }\n * ```\n *\n * @legacy @beta\n */\nexport abstract class TreeDataObject<\n\tTDataObjectTypes extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObject<TDataObjectTypes> {\n\t/**\n\t * The underlying {@link @fluidframework/tree#ITree | tree}.\n\t * @remarks Created once during initialization.\n\t */\n\t#tree: ITree | undefined;\n\n\t/**\n\t * The underlying {@link @fluidframework/tree#ITree | tree}.\n\t * @remarks Created once during initialization.\n\t */\n\tprotected get tree(): ITree {\n\t\tif (this.#tree === undefined) {\n\t\t\tthrow new UsageError(uninitializedErrorString);\n\t\t}\n\t\treturn this.#tree;\n\t}\n\n\tpublic override async initializeInternal(existing: boolean): Promise<void> {\n\t\tif (existing) {\n\t\t\t// data store has a root tree so we just need to set it before calling initializingFromExisting\n\t\t\tconst channel = await this.runtime.getChannel(treeChannelId);\n\n\t\t\t// TODO: Support using a Directory to Tree migration shim and DataObject's root channel ID\n\t\t\t// to allow migrating from DataObject to TreeDataObject instead of just erroring in that case.\n\t\t\tif (!SharedTree.is(channel)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Content with id ${channel.id} is not a SharedTree and cannot be loaded with treeDataObject.`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst sharedTree: ITree = channel;\n\n\t\t\tthis.#tree = sharedTree;\n\t\t} else {\n\t\t\tconst sharedTree = this.runtime.createChannel(\n\t\t\t\ttreeChannelId,\n\t\t\t\tSharedTree.getFactory().type,\n\t\t\t) as unknown as ITree;\n\t\t\t(sharedTree as unknown as ISharedObject).bindToContext();\n\n\t\t\tthis.#tree = sharedTree;\n\n\t\t\t// Note, the implementer is responsible for initializing the tree with initial data.\n\t\t\t// Generally, this can be done via `initializingFirstTime`.\n\t\t}\n\n\t\tawait super.initializeInternal(existing);\n\t}\n}\n"]}
@@ -8,8 +8,7 @@ import type { IFluidDataStoreContext, IFluidDataStoreFactory } from "@fluidframe
8
8
  import type { AsyncFluidObjectProvider } from "@fluidframework/synthesize/internal";
9
9
  /**
10
10
  * This type is used as the base generic input to DataObject and PureDataObject.
11
- * @legacy
12
- * @alpha
11
+ * @legacy @beta
13
12
  */
14
13
  export interface DataObjectTypes {
15
14
  /**
@@ -26,8 +25,7 @@ export interface DataObjectTypes {
26
25
  Events?: IEvent;
27
26
  }
28
27
  /**
29
- * @legacy
30
- * @alpha
28
+ * @legacy @beta
31
29
  */
32
30
  export interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {
33
31
  readonly runtime: IFluidDataStoreRuntime;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data-objects/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,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ACtB,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAEpF;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAChC;;OAEG;IAGH,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IAC5E,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;IACzC,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;IACrE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC;CACvC;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,OAAO,IAAI;IACzC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;CACzC,GAAG,CACD;IACA;;OAEG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;CACtC;AACH;;GAEG;GACD,CAAC,KACD,GAAG,IAAI,EAAE,KAAK,EAAE,KACX,CAAC,CAAC,CACT,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/data-objects/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FluidObject, IEvent } from \"@fluidframework/core-interfaces\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIFluidDataStoreContext,\n\tIFluidDataStoreFactory,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { AsyncFluidObjectProvider } from \"@fluidframework/synthesize/internal\";\n\n/**\n * This type is used as the base generic input to DataObject and PureDataObject.\n * @legacy\n * @alpha\n */\nexport interface DataObjectTypes {\n\t/**\n\t * Represents a type that will define optional providers that will be injected.\n\t */\n\tOptionalProviders?: FluidObject;\n\t/**\n\t * The initial state type that the produced data object may take during creation.\n\t */\n\t// TODO: Use a real type here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tInitialState?: any;\n\t/**\n\t * Represents events that will be available in the EventForwarder.\n\t */\n\tEvents?: IEvent;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {\n\treadonly runtime: IFluidDataStoreRuntime;\n\treadonly context: IFluidDataStoreContext;\n\treadonly providers: AsyncFluidObjectProvider<I[\"OptionalProviders\"]>;\n\treadonly initProps?: I[\"InitialState\"];\n}\n\n/**\n * An object that has a factory that can create a data object.\n * @typeParam T - The type of the data object.\n * @internal\n */\nexport type DataObjectKind<T = unknown> = {\n\treadonly factory: IFluidDataStoreFactory;\n} & (\n\t| {\n\t\t\t/**\n\t\t\t * Not actually used, but required for strong typing.\n\t\t\t */\n\t\t\treadonly makeCovariant?: T | undefined;\n\t }\n\t/**\n\t * Not actually used, but helps with strong typing.\n\t */\n\t| (new (\n\t\t\t...args: never[]\n\t ) => T)\n);\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/data-objects/types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FluidObject, IEvent } from \"@fluidframework/core-interfaces\";\nimport type { IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIFluidDataStoreContext,\n\tIFluidDataStoreFactory,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type { AsyncFluidObjectProvider } from \"@fluidframework/synthesize/internal\";\n\n/**\n * This type is used as the base generic input to DataObject and PureDataObject.\n * @legacy @beta\n */\nexport interface DataObjectTypes {\n\t/**\n\t * Represents a type that will define optional providers that will be injected.\n\t */\n\tOptionalProviders?: FluidObject;\n\t/**\n\t * The initial state type that the produced data object may take during creation.\n\t */\n\t// TODO: Use a real type here.\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tInitialState?: any;\n\t/**\n\t * Represents events that will be available in the EventForwarder.\n\t */\n\tEvents?: IEvent;\n}\n\n/**\n * @legacy @beta\n */\nexport interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {\n\treadonly runtime: IFluidDataStoreRuntime;\n\treadonly context: IFluidDataStoreContext;\n\treadonly providers: AsyncFluidObjectProvider<I[\"OptionalProviders\"]>;\n\treadonly initProps?: I[\"InitialState\"];\n}\n\n/**\n * An object that has a factory that can create a data object.\n * @typeParam T - The type of the data object.\n * @internal\n */\nexport type DataObjectKind<T = unknown> = {\n\treadonly factory: IFluidDataStoreFactory;\n} & (\n\t| {\n\t\t\t/**\n\t\t\t * Not actually used, but required for strong typing.\n\t\t\t */\n\t\t\treadonly makeCovariant?: T | undefined;\n\t }\n\t/**\n\t * Not actually used, but helps with strong typing.\n\t */\n\t| (new (\n\t\t\t...args: never[]\n\t ) => T)\n);\n"]}
package/dist/legacy.d.ts CHANGED
@@ -24,7 +24,7 @@
24
24
  */
25
25
 
26
26
  export {
27
- // @legacy APIs
27
+ // #region @legacyBeta APIs
28
28
  BaseContainerRuntimeFactory,
29
29
  BaseContainerRuntimeFactoryProps,
30
30
  ContainerRuntimeFactoryWithDefaultDataStore,
@@ -38,4 +38,5 @@ export {
38
38
  PureDataObjectFactory,
39
39
  TreeDataObject,
40
40
  TreeDataObjectFactory
41
+ // #endregion
41
42
  } from "./index.js";
package/internal.d.ts CHANGED
@@ -8,4 +8,4 @@
8
8
  * Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
9
9
  */
10
10
 
11
- export * from "./lib/index.js";
11
+ export * from "lib/index.js";
package/legacy.d.ts CHANGED
@@ -8,4 +8,4 @@
8
8
  * Generated by "flub generate entrypoints" in @fluid-tools/build-cli.
9
9
  */
10
10
 
11
- export * from "./lib/legacy.js";
11
+ export * from "lib/legacy.js";
@@ -13,7 +13,7 @@ import { type IFluidDependencySynthesizer } from "@fluidframework/synthesize/int
13
13
  /**
14
14
  * {@link BaseContainerRuntimeFactory} construction properties.
15
15
  * @legacy
16
- * @alpha
16
+ * @beta
17
17
  */
18
18
  export interface BaseContainerRuntimeFactoryProps {
19
19
  /**
@@ -49,7 +49,7 @@ export interface BaseContainerRuntimeFactoryProps {
49
49
  * request handlers, runtimeOptions, and entryPoint initialization function.
50
50
  * It can be subclassed to implement a first-time initialization procedure for the containers it creates.
51
51
  * @legacy
52
- * @alpha
52
+ * @beta
53
53
  */
54
54
  export declare class BaseContainerRuntimeFactory extends RuntimeFactoryHelper implements IProvideFluidDataStoreRegistry {
55
55
  /**
@@ -13,7 +13,7 @@ import { DependencyContainer, } from "@fluidframework/synthesize/internal";
13
13
  * request handlers, runtimeOptions, and entryPoint initialization function.
14
14
  * It can be subclassed to implement a first-time initialization procedure for the containers it creates.
15
15
  * @legacy
16
- * @alpha
16
+ * @beta
17
17
  */
18
18
  export class BaseContainerRuntimeFactory extends RuntimeFactoryHelper {
19
19
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"baseContainerRuntimeFactory.js","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,sBAAsB,EACtB,oBAAoB,GAGpB,MAAM,4CAA4C,CAAC;AAGpD,OAAO;AAGN,gDAAgD;AAChD,0BAA0B,GAC1B,MAAM,0CAA0C,CAAC;AAMlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EACN,mBAAmB,GAGnB,MAAM,qCAAqC,CAAC;AAsC7C;;;;;;GAMG;AACH,MA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AED,OAAO,oBAAoB,CAAC;YAC3B,OAAO;YACP,QAAQ;YACR,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,cAAc,EAAE,KAAK;YACrB,gDAAgD;YAChD,cAAc,EAAE,0BAA0B,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC;YACnE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;SAC7C,CAAC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B,IAAkB,CAAC;IAE5F;;;;OAIG;IACO,KAAK,CAAC,uBAAuB,CAAC,OAA0B,IAAkB,CAAC;CACrF","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIContainerContext,\n\tIRuntime,\n} from \"@fluidframework/container-definitions/internal\";\nimport {\n\tFluidDataStoreRegistry,\n\tloadContainerRuntime,\n\ttype IContainerRuntimeOptions,\n\ttype MinimumVersionForCollab,\n} from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { FluidObject } from \"@fluidframework/core-interfaces\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\ttype RuntimeRequestHandler,\n\t// eslint-disable-next-line import/no-deprecated\n\tbuildRuntimeRequestHandler,\n} from \"@fluidframework/request-handler/internal\";\nimport type {\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { RuntimeFactoryHelper } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tDependencyContainer,\n\ttype IFluidDependencySynthesizer,\n\ttype IProvideFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize/internal\";\n\n/**\n * {@link BaseContainerRuntimeFactory} construction properties.\n * @legacy\n * @alpha\n */\nexport interface BaseContainerRuntimeFactoryProps {\n\t/**\n\t * The data store registry for containers produced.\n\t */\n\tregistryEntries: NamedFluidDataStoreRegistryEntries;\n\t/**\n\t * @deprecated Will be removed in a future release.\n\t */\n\tdependencyContainer?: IFluidDependencySynthesizer;\n\t/**\n\t * Request handlers for containers produced.\n\t * @deprecated Will be removed once Loader LTS version is \"2.0.0-internal.7.0.0\". 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\trequestHandlers?: RuntimeRequestHandler[];\n\t/**\n\t * The runtime options passed to the ContainerRuntime when instantiating it\n\t */\n\truntimeOptions?: IContainerRuntimeOptions;\n\t/**\n\t * Function that will initialize the entryPoint of the ContainerRuntime instances\n\t * created with this factory\n\t */\n\tprovideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n\t/**\n\t * The minVersionForCollab passed to the ContainerRuntime when instantiating it.\n\t * See {@link @fluidframework/container-runtime#LoadContainerRuntimeParams} for more details on this property.\n\t */\n\tminVersionForCollab?: MinimumVersionForCollab | undefined;\n}\n\n/**\n * BaseContainerRuntimeFactory produces container runtimes with the specified data store and service registries,\n * request handlers, runtimeOptions, and entryPoint initialization function.\n * It can be subclassed to implement a first-time initialization procedure for the containers it creates.\n * @legacy\n * @alpha\n */\nexport class BaseContainerRuntimeFactory\n\textends RuntimeFactoryHelper\n\timplements IProvideFluidDataStoreRegistry\n{\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreRegistry.IFluidDataStoreRegistry}\n\t */\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry {\n\t\treturn this.registry;\n\t}\n\tprivate readonly registry: IFluidDataStoreRegistry;\n\n\tprivate readonly registryEntries: NamedFluidDataStoreRegistryEntries;\n\tprivate readonly dependencyContainer?: IFluidDependencySynthesizer;\n\tprivate readonly runtimeOptions?: IContainerRuntimeOptions;\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly requestHandlers: RuntimeRequestHandler[];\n\tprivate readonly provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n\tprivate readonly minVersionForCollab: MinimumVersionForCollab | undefined;\n\n\tpublic constructor(props: BaseContainerRuntimeFactoryProps) {\n\t\tsuper();\n\n\t\tthis.registryEntries = props.registryEntries;\n\t\tthis.dependencyContainer = props.dependencyContainer;\n\t\tthis.runtimeOptions = props.runtimeOptions;\n\t\tthis.provideEntryPoint = props.provideEntryPoint;\n\t\tthis.requestHandlers = props.requestHandlers ?? [];\n\t\tthis.registry = new FluidDataStoreRegistry(this.registryEntries);\n\t\tthis.minVersionForCollab = props.minVersionForCollab;\n\t}\n\n\t/**\n\t * Called the one time the container is created, and not on any subsequent load.\n\t * i.e. only when it's initialized on the client that first created it\n\t * @param runtime - The runtime for the container being initialized\n\t */\n\tpublic async instantiateFirstTime(runtime: IContainerRuntime): Promise<void> {\n\t\tawait this.containerInitializingFirstTime(runtime);\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\t/**\n\t * Called every time the container runtime is loaded for an existing container.\n\t * i.e. every time it's initialized _except_ for when it is first created\n\t * @param runtime - The runtime for the container being initialized\n\t */\n\tpublic async instantiateFromExisting(runtime: IContainerRuntime): Promise<void> {\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\t/**\n\t * Called at the start of initializing a container, to create the container runtime instance.\n\t * @param context - The context for the container being initialized\n\t * @param existing - Whether the container already exists and is being loaded (else it's being created new just now)\n\t */\n\tpublic async preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<IContainerRuntime & IRuntime> {\n\t\tconst scope: Partial<IProvideFluidDependencySynthesizer> = context.scope;\n\t\tif (this.dependencyContainer) {\n\t\t\tconst dc = new DependencyContainer<FluidObject>(\n\t\t\t\tthis.dependencyContainer,\n\t\t\t\tscope.IFluidDependencySynthesizer,\n\t\t\t);\n\t\t\tscope.IFluidDependencySynthesizer = dc;\n\t\t}\n\n\t\treturn loadContainerRuntime({\n\t\t\tcontext,\n\t\t\texisting,\n\t\t\truntimeOptions: this.runtimeOptions,\n\t\t\tregistryEntries: this.registryEntries,\n\t\t\tcontainerScope: scope,\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\trequestHandler: buildRuntimeRequestHandler(...this.requestHandlers),\n\t\t\tprovideEntryPoint: this.provideEntryPoint,\n\t\t\tminVersionForCollab: this.minVersionForCollab,\n\t\t});\n\t}\n\n\t/**\n\t * Subclasses may override containerInitializingFirstTime to perform any setup steps at the time the container\n\t * is created. This likely includes creating any initial data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void> {}\n\n\t/**\n\t * Subclasses may override containerHasInitialized to perform any steps after the container has initialized.\n\t * This likely includes loading any data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerHasInitialized(runtime: IContainerRuntime): Promise<void> {}\n}\n"]}
1
+ {"version":3,"file":"baseContainerRuntimeFactory.js","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EACN,sBAAsB,EACtB,oBAAoB,GAGpB,MAAM,4CAA4C,CAAC;AAGpD,OAAO;AAGN,gDAAgD;AAChD,0BAA0B,GAC1B,MAAM,0CAA0C,CAAC;AAMlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EACN,mBAAmB,GAGnB,MAAM,qCAAqC,CAAC;AAsC7C;;;;;;GAMG;AACH,MAAM,OAAO,2BACZ,SAAQ,oBAAoB;IAG5B;;OAEG;IACH,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IAWD,YAAmB,KAAuC;QACzD,KAAK,EAAE,CAAC;QAER,I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AAc,EAAE,0BAA0B,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC;YACnE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;SAC7C,CAAC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B,IAAkB,CAAC;IAE5F;;;;OAIG;IACO,KAAK,CAAC,uBAAuB,CAAC,OAA0B,IAAkB,CAAC;CACrF","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIContainerContext,\n\tIRuntime,\n} from \"@fluidframework/container-definitions/internal\";\nimport {\n\tFluidDataStoreRegistry,\n\tloadContainerRuntime,\n\ttype IContainerRuntimeOptions,\n\ttype MinimumVersionForCollab,\n} from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { FluidObject } from \"@fluidframework/core-interfaces\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\ttype RuntimeRequestHandler,\n\t// eslint-disable-next-line import/no-deprecated\n\tbuildRuntimeRequestHandler,\n} from \"@fluidframework/request-handler/internal\";\nimport type {\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { RuntimeFactoryHelper } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tDependencyContainer,\n\ttype IFluidDependencySynthesizer,\n\ttype IProvideFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize/internal\";\n\n/**\n * {@link BaseContainerRuntimeFactory} construction properties.\n * @legacy\n * @beta\n */\nexport interface BaseContainerRuntimeFactoryProps {\n\t/**\n\t * The data store registry for containers produced.\n\t */\n\tregistryEntries: NamedFluidDataStoreRegistryEntries;\n\t/**\n\t * @deprecated Will be removed in a future release.\n\t */\n\tdependencyContainer?: IFluidDependencySynthesizer;\n\t/**\n\t * Request handlers for containers produced.\n\t * @deprecated Will be removed once Loader LTS version is \"2.0.0-internal.7.0.0\". 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\trequestHandlers?: RuntimeRequestHandler[];\n\t/**\n\t * The runtime options passed to the ContainerRuntime when instantiating it\n\t */\n\truntimeOptions?: IContainerRuntimeOptions;\n\t/**\n\t * Function that will initialize the entryPoint of the ContainerRuntime instances\n\t * created with this factory\n\t */\n\tprovideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n\t/**\n\t * The minVersionForCollab passed to the ContainerRuntime when instantiating it.\n\t * See {@link @fluidframework/container-runtime#LoadContainerRuntimeParams} for more details on this property.\n\t */\n\tminVersionForCollab?: MinimumVersionForCollab | undefined;\n}\n\n/**\n * BaseContainerRuntimeFactory produces container runtimes with the specified data store and service registries,\n * request handlers, runtimeOptions, and entryPoint initialization function.\n * It can be subclassed to implement a first-time initialization procedure for the containers it creates.\n * @legacy\n * @beta\n */\nexport class BaseContainerRuntimeFactory\n\textends RuntimeFactoryHelper\n\timplements IProvideFluidDataStoreRegistry\n{\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreRegistry.IFluidDataStoreRegistry}\n\t */\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry {\n\t\treturn this.registry;\n\t}\n\tprivate readonly registry: IFluidDataStoreRegistry;\n\n\tprivate readonly registryEntries: NamedFluidDataStoreRegistryEntries;\n\tprivate readonly dependencyContainer?: IFluidDependencySynthesizer;\n\tprivate readonly runtimeOptions?: IContainerRuntimeOptions;\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly requestHandlers: RuntimeRequestHandler[];\n\tprivate readonly provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n\tprivate readonly minVersionForCollab: MinimumVersionForCollab | undefined;\n\n\tpublic constructor(props: BaseContainerRuntimeFactoryProps) {\n\t\tsuper();\n\n\t\tthis.registryEntries = props.registryEntries;\n\t\tthis.dependencyContainer = props.dependencyContainer;\n\t\tthis.runtimeOptions = props.runtimeOptions;\n\t\tthis.provideEntryPoint = props.provideEntryPoint;\n\t\tthis.requestHandlers = props.requestHandlers ?? [];\n\t\tthis.registry = new FluidDataStoreRegistry(this.registryEntries);\n\t\tthis.minVersionForCollab = props.minVersionForCollab;\n\t}\n\n\t/**\n\t * Called the one time the container is created, and not on any subsequent load.\n\t * i.e. only when it's initialized on the client that first created it\n\t * @param runtime - The runtime for the container being initialized\n\t */\n\tpublic async instantiateFirstTime(runtime: IContainerRuntime): Promise<void> {\n\t\tawait this.containerInitializingFirstTime(runtime);\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\t/**\n\t * Called every time the container runtime is loaded for an existing container.\n\t * i.e. every time it's initialized _except_ for when it is first created\n\t * @param runtime - The runtime for the container being initialized\n\t */\n\tpublic async instantiateFromExisting(runtime: IContainerRuntime): Promise<void> {\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\t/**\n\t * Called at the start of initializing a container, to create the container runtime instance.\n\t * @param context - The context for the container being initialized\n\t * @param existing - Whether the container already exists and is being loaded (else it's being created new just now)\n\t */\n\tpublic async preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<IContainerRuntime & IRuntime> {\n\t\tconst scope: Partial<IProvideFluidDependencySynthesizer> = context.scope;\n\t\tif (this.dependencyContainer) {\n\t\t\tconst dc = new DependencyContainer<FluidObject>(\n\t\t\t\tthis.dependencyContainer,\n\t\t\t\tscope.IFluidDependencySynthesizer,\n\t\t\t);\n\t\t\tscope.IFluidDependencySynthesizer = dc;\n\t\t}\n\n\t\treturn loadContainerRuntime({\n\t\t\tcontext,\n\t\t\texisting,\n\t\t\truntimeOptions: this.runtimeOptions,\n\t\t\tregistryEntries: this.registryEntries,\n\t\t\tcontainerScope: scope,\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\trequestHandler: buildRuntimeRequestHandler(...this.requestHandlers),\n\t\t\tprovideEntryPoint: this.provideEntryPoint,\n\t\t\tminVersionForCollab: this.minVersionForCollab,\n\t\t});\n\t}\n\n\t/**\n\t * Subclasses may override containerInitializingFirstTime to perform any setup steps at the time the container\n\t * is created. This likely includes creating any initial data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void> {}\n\n\t/**\n\t * Subclasses may override containerHasInitialized to perform any steps after the container has initialized.\n\t * This likely includes loading any data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerHasInitialized(runtime: IContainerRuntime): Promise<void> {}\n}\n"]}
@@ -12,7 +12,7 @@ import { BaseContainerRuntimeFactory } from "./baseContainerRuntimeFactory.js";
12
12
  /**
13
13
  * {@link ContainerRuntimeFactoryWithDefaultDataStore} construction properties.
14
14
  * @legacy
15
- * @alpha
15
+ * @beta
16
16
  */
17
17
  export interface ContainerRuntimeFactoryWithDefaultDataStoreProps {
18
18
  defaultFactory: IFluidDataStoreFactory;
@@ -45,7 +45,7 @@ export interface ContainerRuntimeFactoryWithDefaultDataStoreProps {
45
45
  *
46
46
  * This factory should be exposed as fluidExport off the entry point to your module.
47
47
  * @legacy
48
- * @alpha
48
+ * @beta
49
49
  */
50
50
  export declare class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {
51
51
  static readonly defaultDataStoreId = "default";
@@ -18,7 +18,7 @@ async function getDefaultFluidObject(runtime) {
18
18
  *
19
19
  * This factory should be exposed as fluidExport off the entry point to your module.
20
20
  * @legacy
21
- * @alpha
21
+ * @beta
22
22
  */
23
23
  export class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {
24
24
  constructor(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"containerRuntimeFactoryWithDefault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YACR,eAAe,EAAE,CAAC,gBAAgB,EAAE,GAAG,eAAe,CAAC;YACvD,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;;AAxCsB,8DAAkB,GAAG,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainerRuntimeOptions } from \"@fluidframework/container-runtime/internal\";\nimport type {\n\tIContainerRuntime,\n\t// eslint-disable-next-line import/no-deprecated\n\tIContainerRuntimeWithResolveHandle_Deprecated,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { FluidObject, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\n// eslint-disable-next-line import/no-deprecated\nimport type { RuntimeRequestHandler } from \"@fluidframework/request-handler/internal\";\nimport type {\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { RequestParser } from \"@fluidframework/runtime-utils/internal\";\nimport type { IFluidDependencySynthesizer } from \"@fluidframework/synthesize/internal\";\n\nimport { BaseContainerRuntimeFactory } from \"./baseContainerRuntimeFactory.js\";\n\nconst defaultDataStoreId = \"default\";\n\nasync function getDefaultFluidObject(runtime: IContainerRuntime): Promise<FluidObject> {\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 * {@link ContainerRuntimeFactoryWithDefaultDataStore} construction properties.\n * @legacy\n * @alpha\n */\nexport interface ContainerRuntimeFactoryWithDefaultDataStoreProps {\n\tdefaultFactory: IFluidDataStoreFactory;\n\t/**\n\t * The data store registry for containers produced.\n\t */\n\tregistryEntries: NamedFluidDataStoreRegistryEntries;\n\t/**\n\t * @deprecated Will be removed in a future release.\n\t */\n\tdependencyContainer?: IFluidDependencySynthesizer;\n\t/**\n\t * Request handlers for containers produced.\n\t * @deprecated Will be removed once Loader LTS version is \"2.0.0-internal.7.0.0\". 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\trequestHandlers?: RuntimeRequestHandler[];\n\t/**\n\t * The runtime options passed to the IContainerRuntime when instantiating it\n\t */\n\truntimeOptions?: IContainerRuntimeOptions;\n\t/**\n\t * Function that will initialize the entryPoint of the IContainerRuntime instances\n\t * created with this factory\n\t */\n\tprovideEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>;\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 * @legacy\n * @alpha\n */\nexport class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {\n\tpublic static readonly defaultDataStoreId = defaultDataStoreId;\n\n\tprotected readonly defaultFactory: IFluidDataStoreFactory;\n\n\tpublic constructor(props: ContainerRuntimeFactoryWithDefaultDataStoreProps) {\n\t\tconst requestHandlers = props.requestHandlers ?? [];\n\t\tconst provideEntryPoint = props.provideEntryPoint ?? getDefaultFluidObject;\n\n\t\tconst getDefaultObject = async (\n\t\t\trequest: IRequest,\n\t\t\truntime: IContainerRuntime,\n\t\t\t// eslint-disable-next-line unicorn/consistent-function-scoping\n\t\t): Promise<IResponse | undefined> => {\n\t\t\tconst parser = RequestParser.create(request);\n\t\t\tif (parser.pathParts.length === 0) {\n\t\t\t\t// This cast is safe as loadContainerRuntime is called in the base class\n\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\treturn (runtime as IContainerRuntimeWithResolveHandle_Deprecated).resolveHandle({\n\t\t\t\t\turl: `/${defaultDataStoreId}${parser.query}`,\n\t\t\t\t\theaders: request.headers,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn undefined; // continue search\n\t\t};\n\n\t\tsuper({\n\t\t\t...props,\n\t\t\trequestHandlers: [getDefaultObject, ...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): Promise<void> {\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;AAeH,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAGvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC,KAAK,UAAU,qBAAqB,CAAC,OAA0B;IAC9D,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC;IAC1E,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC;AACzB,CAAC;AAkCD;;;;;;;GAOG;AACH,MAAM,OAAO,2CAA4C,SAAQ,2BAA2B;IAK3F,YAAmB,KAAuD;QACzE,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC;QACpD,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,IAAI,qBAAqB,CAAC;QAE3E,MAAM,gBAAgB,GAAG,KAAK,EAC7B,OAAiB,EACjB,OAA0B,EAEO,EAAE;YACnC,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnC,wEAAwE;gBACxE,gDAAgD;gBAChD,OAAQ,OAAyD,CAAC,aAAa,CAAC;oBAC/E,GAAG,EAAE,IAAI,kBAAkB,GAAG,MAAM,CAAC,KAAK,EAAE;oBAC5C,OAAO,EAAE,OAAO,CAAC,OAAO;iBACxB,CAAC,CAAC;YACJ,CAAC;YACD,OAAO,SAAS,CAAC,CAAC,kBAAkB;QACrC,CAAC,CAAC;QAEF,KAAK,CAAC;YACL,GAAG,KAAK;YACR,eAAe,EAAE,CAAC,gBAAgB,EAAE,GAAG,eAAe,CAAC;YACvD,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;;AAxCsB,8DAAkB,GAAG,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { IContainerRuntimeOptions } from \"@fluidframework/container-runtime/internal\";\nimport type {\n\tIContainerRuntime,\n\t// eslint-disable-next-line import/no-deprecated\n\tIContainerRuntimeWithResolveHandle_Deprecated,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { FluidObject, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\n// eslint-disable-next-line import/no-deprecated\nimport type { RuntimeRequestHandler } from \"@fluidframework/request-handler/internal\";\nimport type {\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { RequestParser } from \"@fluidframework/runtime-utils/internal\";\nimport type { IFluidDependencySynthesizer } from \"@fluidframework/synthesize/internal\";\n\nimport { BaseContainerRuntimeFactory } from \"./baseContainerRuntimeFactory.js\";\n\nconst defaultDataStoreId = \"default\";\n\nasync function getDefaultFluidObject(runtime: IContainerRuntime): Promise<FluidObject> {\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 * {@link ContainerRuntimeFactoryWithDefaultDataStore} construction properties.\n * @legacy\n * @beta\n */\nexport interface ContainerRuntimeFactoryWithDefaultDataStoreProps {\n\tdefaultFactory: IFluidDataStoreFactory;\n\t/**\n\t * The data store registry for containers produced.\n\t */\n\tregistryEntries: NamedFluidDataStoreRegistryEntries;\n\t/**\n\t * @deprecated Will be removed in a future release.\n\t */\n\tdependencyContainer?: IFluidDependencySynthesizer;\n\t/**\n\t * Request handlers for containers produced.\n\t * @deprecated Will be removed once Loader LTS version is \"2.0.0-internal.7.0.0\". 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\trequestHandlers?: RuntimeRequestHandler[];\n\t/**\n\t * The runtime options passed to the IContainerRuntime when instantiating it\n\t */\n\truntimeOptions?: IContainerRuntimeOptions;\n\t/**\n\t * Function that will initialize the entryPoint of the IContainerRuntime instances\n\t * created with this factory\n\t */\n\tprovideEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>;\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 * @legacy\n * @beta\n */\nexport class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {\n\tpublic static readonly defaultDataStoreId = defaultDataStoreId;\n\n\tprotected readonly defaultFactory: IFluidDataStoreFactory;\n\n\tpublic constructor(props: ContainerRuntimeFactoryWithDefaultDataStoreProps) {\n\t\tconst requestHandlers = props.requestHandlers ?? [];\n\t\tconst provideEntryPoint = props.provideEntryPoint ?? getDefaultFluidObject;\n\n\t\tconst getDefaultObject = async (\n\t\t\trequest: IRequest,\n\t\t\truntime: IContainerRuntime,\n\t\t\t// eslint-disable-next-line unicorn/consistent-function-scoping\n\t\t): Promise<IResponse | undefined> => {\n\t\t\tconst parser = RequestParser.create(request);\n\t\t\tif (parser.pathParts.length === 0) {\n\t\t\t\t// This cast is safe as loadContainerRuntime is called in the base class\n\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\treturn (runtime as IContainerRuntimeWithResolveHandle_Deprecated).resolveHandle({\n\t\t\t\t\turl: `/${defaultDataStoreId}${parser.query}`,\n\t\t\t\t\theaders: request.headers,\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn undefined; // continue search\n\t\t};\n\n\t\tsuper({\n\t\t\t...props,\n\t\t\trequestHandlers: [getDefaultObject, ...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): Promise<void> {\n\t\tconst dataStore = await runtime.createDataStore(this.defaultFactory.type);\n\t\tawait dataStore.trySetAlias(defaultDataStoreId);\n\t}\n}\n"]}
@@ -16,7 +16,7 @@ import { PureDataObjectFactory, type DataObjectFactoryProps } from "./pureDataOb
16
16
  * @typeParam TObj - DataObject (concrete type)
17
17
  * @typeParam I - The input types for the DataObject
18
18
  * @legacy
19
- * @alpha
19
+ * @beta
20
20
  */
21
21
  export declare class DataObjectFactory<TObj extends DataObject<I>, I extends DataObjectTypes = DataObjectTypes> extends PureDataObjectFactory<TObj, I> {
22
22
  /**
@@ -12,7 +12,7 @@ import { PureDataObjectFactory, } from "./pureDataObjectFactory.js";
12
12
  * @typeParam TObj - DataObject (concrete type)
13
13
  * @typeParam I - The input types for the DataObject
14
14
  * @legacy
15
- * @alpha
15
+ * @beta
16
16
  */
17
17
  export class DataObjectFactory extends PureDataObjectFactory {
18
18
  constructor(propsOrType, maybeCtor, maybeSharedObjects, maybeOptionalProviders, maybeRegistryEntries, maybeRuntimeFactory) {
@@ -1 +1 @@
1
- {"version":3,"file":"dataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,eAAe,GACf,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EACN,qBAAqB,GAErB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,OAAO,iBAGX,SAAQ,qBAA8B;IAevC,YACC,WAAqD,EACrD,SAAsD,EACtD,kBAA+C,EAC/C,sBAA0E,EAC1E,oBAAyD,EACzD,mBAAkD;QAElD,MAAM,QAAQ,GACb,OAAO,WAAW,KAAK,QAAQ;YAC9B,CAAC,CAAC;gBACA,IAAI,EAAE,WAAW;gBACjB,6DAA6D;gBAC7D,oEAAoE;gBACpE,IAAI,EAAE,SAAU;gBAChB,aAAa,EAAE,kBAAkB;gBACjC,iBAAiB,EAAE,sBAAsB;gBACzC,eAAe,EAAE,oBAAoB;gBACrC,YAAY,EAAE,mBAAmB;aACjC;YACF,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC;QAEvB,MAAM,aAAa,GAAG,CAAC,QAAQ,CAAC,aAAa,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAErF,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9E,sCAAsC;YACtC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,0GAA0G;QAC1G,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACxE,gCAAgC;YAChC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;QAC5C,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FluidDataStoreRuntime } from \"@fluidframework/datastore/internal\";\nimport type { IChannelFactory } from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\tSharedMap,\n\tDirectoryFactory,\n\tMapFactory,\n\tSharedDirectory,\n} from \"@fluidframework/map/internal\";\nimport type { NamedFluidDataStoreRegistryEntries } from \"@fluidframework/runtime-definitions/internal\";\nimport type { FluidObjectSymbolProvider } from \"@fluidframework/synthesize/internal\";\n\nimport type { DataObject, DataObjectTypes, IDataObjectProps } from \"../data-objects/index.js\";\n\nimport {\n\tPureDataObjectFactory,\n\ttype DataObjectFactoryProps,\n} from \"./pureDataObjectFactory.js\";\n\n/**\n * DataObjectFactory is the IFluidDataStoreFactory for use with DataObjects.\n * It facilitates DataObject's features (such as its shared directory) by\n * ensuring relevant shared objects etc are available to the factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n * @legacy\n * @alpha\n */\nexport class DataObjectFactory<\n\tTObj extends DataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObjectFactory<TObj, I> {\n\t/**\n\t * @remarks Use the props object based constructor instead.\n\t * No new features will be added to this constructor,\n\t * and it will eventually be deprecated and removed.\n\t */\n\tpublic constructor(\n\t\ttype: string,\n\t\tctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects?: readonly IChannelFactory[],\n\t\toptionalProviders?: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\truntimeFactory?: typeof FluidDataStoreRuntime,\n\t);\n\tpublic constructor(props: DataObjectFactoryProps<TObj, I>);\n\tpublic constructor(\n\t\tpropsOrType: DataObjectFactoryProps<TObj, I> | string,\n\t\tmaybeCtor?: new (doProps: IDataObjectProps<I>) => TObj,\n\t\tmaybeSharedObjects?: readonly IChannelFactory[],\n\t\tmaybeOptionalProviders?: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tmaybeRegistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\tmaybeRuntimeFactory?: typeof FluidDataStoreRuntime,\n\t) {\n\t\tconst newProps =\n\t\t\ttypeof propsOrType === \"string\"\n\t\t\t\t? {\n\t\t\t\t\t\ttype: propsOrType,\n\t\t\t\t\t\t// both the arg and props base constructor require this param\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\tctor: maybeCtor!,\n\t\t\t\t\t\tsharedObjects: maybeSharedObjects,\n\t\t\t\t\t\toptionalProviders: maybeOptionalProviders,\n\t\t\t\t\t\tregistryEntries: maybeRegistryEntries,\n\t\t\t\t\t\truntimeClass: maybeRuntimeFactory,\n\t\t\t\t\t}\n\t\t\t\t: { ...propsOrType };\n\n\t\tconst sharedObjects = (newProps.sharedObjects = [...(newProps.sharedObjects ?? [])]);\n\n\t\tif (!sharedObjects.some((factory) => factory.type === DirectoryFactory.Type)) {\n\t\t\t// User did not register for directory\n\t\t\tsharedObjects.push(SharedDirectory.getFactory());\n\t\t}\n\n\t\t// TODO: Remove SharedMap factory when compatibility with SharedMap DataObject is no longer needed in 0.10\n\t\tif (!sharedObjects.some((factory) => factory.type === MapFactory.Type)) {\n\t\t\t// User did not register for map\n\t\t\tsharedObjects.push(SharedMap.getFactory());\n\t\t}\n\n\t\tsuper(newProps);\n\t}\n}\n"]}
1
+ {"version":3,"file":"dataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/dataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EACN,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,eAAe,GACf,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EACN,qBAAqB,GAErB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,OAAO,iBAGX,SAAQ,qBAA8B;IAevC,YACC,WAAqD,EACrD,SAAsD,EACtD,kBAA+C,EAC/C,sBAA0E,EAC1E,oBAAyD,EACzD,mBAAkD;QAElD,MAAM,QAAQ,GACb,OAAO,WAAW,KAAK,QAAQ;YAC9B,CAAC,CAAC;gBACA,IAAI,EAAE,WAAW;gBACjB,6DAA6D;gBAC7D,oEAAoE;gBACpE,IAAI,EAAE,SAAU;gBAChB,aAAa,EAAE,kBAAkB;gBACjC,iBAAiB,EAAE,sBAAsB;gBACzC,eAAe,EAAE,oBAAoB;gBACrC,YAAY,EAAE,mBAAmB;aACjC;YACF,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC;QAEvB,MAAM,aAAa,GAAG,CAAC,QAAQ,CAAC,aAAa,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAErF,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9E,sCAAsC;YACtC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,0GAA0G;QAC1G,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACxE,gCAAgC;YAChC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;QAC5C,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { FluidDataStoreRuntime } from \"@fluidframework/datastore/internal\";\nimport type { IChannelFactory } from \"@fluidframework/datastore-definitions/internal\";\nimport {\n\tSharedMap,\n\tDirectoryFactory,\n\tMapFactory,\n\tSharedDirectory,\n} from \"@fluidframework/map/internal\";\nimport type { NamedFluidDataStoreRegistryEntries } from \"@fluidframework/runtime-definitions/internal\";\nimport type { FluidObjectSymbolProvider } from \"@fluidframework/synthesize/internal\";\n\nimport type { DataObject, DataObjectTypes, IDataObjectProps } from \"../data-objects/index.js\";\n\nimport {\n\tPureDataObjectFactory,\n\ttype DataObjectFactoryProps,\n} from \"./pureDataObjectFactory.js\";\n\n/**\n * DataObjectFactory is the IFluidDataStoreFactory for use with DataObjects.\n * It facilitates DataObject's features (such as its shared directory) by\n * ensuring relevant shared objects etc are available to the factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n * @legacy\n * @beta\n */\nexport class DataObjectFactory<\n\tTObj extends DataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObjectFactory<TObj, I> {\n\t/**\n\t * @remarks Use the props object based constructor instead.\n\t * No new features will be added to this constructor,\n\t * and it will eventually be deprecated and removed.\n\t */\n\tpublic constructor(\n\t\ttype: string,\n\t\tctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects?: readonly IChannelFactory[],\n\t\toptionalProviders?: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\truntimeFactory?: typeof FluidDataStoreRuntime,\n\t);\n\tpublic constructor(props: DataObjectFactoryProps<TObj, I>);\n\tpublic constructor(\n\t\tpropsOrType: DataObjectFactoryProps<TObj, I> | string,\n\t\tmaybeCtor?: new (doProps: IDataObjectProps<I>) => TObj,\n\t\tmaybeSharedObjects?: readonly IChannelFactory[],\n\t\tmaybeOptionalProviders?: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tmaybeRegistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\tmaybeRuntimeFactory?: typeof FluidDataStoreRuntime,\n\t) {\n\t\tconst newProps =\n\t\t\ttypeof propsOrType === \"string\"\n\t\t\t\t? {\n\t\t\t\t\t\ttype: propsOrType,\n\t\t\t\t\t\t// both the arg and props base constructor require this param\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\tctor: maybeCtor!,\n\t\t\t\t\t\tsharedObjects: maybeSharedObjects,\n\t\t\t\t\t\toptionalProviders: maybeOptionalProviders,\n\t\t\t\t\t\tregistryEntries: maybeRegistryEntries,\n\t\t\t\t\t\truntimeClass: maybeRuntimeFactory,\n\t\t\t\t\t}\n\t\t\t\t: { ...propsOrType };\n\n\t\tconst sharedObjects = (newProps.sharedObjects = [...(newProps.sharedObjects ?? [])]);\n\n\t\tif (!sharedObjects.some((factory) => factory.type === DirectoryFactory.Type)) {\n\t\t\t// User did not register for directory\n\t\t\tsharedObjects.push(SharedDirectory.getFactory());\n\t\t}\n\n\t\t// TODO: Remove SharedMap factory when compatibility with SharedMap DataObject is no longer needed in 0.10\n\t\tif (!sharedObjects.some((factory) => factory.type === MapFactory.Type)) {\n\t\t\t// User did not register for map\n\t\t\tsharedObjects.push(SharedMap.getFactory());\n\t\t}\n\n\t\tsuper(newProps);\n\t}\n}\n"]}
@@ -14,8 +14,7 @@ import type { DataObjectTypes, IDataObjectProps, PureDataObject } from "../data-
14
14
  * registry entries, and the runtime class to use for the data object.
15
15
  * @typeParam TObj - DataObject (concrete type)
16
16
  * @typeParam I - The input types for the DataObject
17
- * @legacy
18
- * @alpha
17
+ * @legacy @beta
19
18
  */
20
19
  export interface DataObjectFactoryProps<TObj extends PureDataObject<I>, I extends DataObjectTypes = DataObjectTypes> {
21
20
  /**
@@ -55,8 +54,7 @@ export interface DataObjectFactoryProps<TObj extends PureDataObject<I>, I extend
55
54
  *
56
55
  * @typeParam TObj - DataObject (concrete type)
57
56
  * @typeParam I - The input types for the DataObject
58
- * @legacy
59
- * @alpha
57
+ * @legacy @beta
60
58
  */
61
59
  export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I extends DataObjectTypes = DataObjectTypes> implements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry> {
62
60
  private readonly registry;
@@ -1 +1 @@
1
- {"version":3,"file":"pureDataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAGhG,OAAO,EACN,qBAAqB,EAGrB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACX,eAAe,EAEf,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACX,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,kCAAkC,EAClC,gCAAgC,EAChC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAEX,yBAAyB,EAEzB,MAA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E,MAAM,GACrB,OAAO,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAgB9B;;;;;;;;;;;;OAYG;IACU,kBAAkB,CAC9B,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,iBAAiB,EAC1B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;cAkBA,yBAAyB,CACxC,gBAAgB,EAAE,qBAAqB,EACvC,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAC/B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,EAChC,cAAc,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC;cAKA,kBAAkB,CACjC,OAAO,EAAE,8BAA8B,EACvC,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;CAYhB"}
1
+ {"version":3,"file":"pureDataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAGhG,OAAO,EACN,qBAAqB,EAGrB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACX,eAAe,EAEf,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACX,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,8BAA8B,EAC9B,kCAAkC,EAClC,gCAAgC,EAChC,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAEX,yBAAyB,EAEzB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EACX,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,MAAM,0BAA0B,CAAC;AAoGlC;;;;;;;GAOG;AACH,MAAM,WAAW,sB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,EAAE,iBAAiB,EAC1B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;cAkBA,yBAAyB,CACxC,gBAAgB,EAAE,qBAAqB,EACvC,WAAW,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAC/B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,EAChC,cAAc,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC;cAKA,kBAAkB,CACjC,OAAO,EAAE,8BAA8B,EACvC,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;CAYhB"}
@@ -63,8 +63,7 @@ async function createDataObject({ ctor, context, sharedObjectRegistry, optionalP
63
63
  *
64
64
  * @typeParam TObj - DataObject (concrete type)
65
65
  * @typeParam I - The input types for the DataObject
66
- * @legacy
67
- * @alpha
66
+ * @legacy @beta
68
67
  */
69
68
  export class PureDataObjectFactory {
70
69
  constructor(propsOrType, maybeCtor, maybeSharedObjects, maybeOptionalProviders, maybeRegistryEntries, maybeRuntimeFactory) {
@@ -1 +1 @@
1
- {"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAGpF,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EACN,qBAAqB,EAErB,mBAAmB,GACnB,MAAM,oCAAoC,CAAC;AAwC5C;;;GAGG;AACH,KAAK,UAAU,gBAAgB,CAG7B,EACD,IAAI,EACJ,OAAO,EACP,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,QAAQ,GACwB;IAIhC,OAAO;IACP,IAAI,YAAY,GAAG,eAAe,CAAC;IAEnC,mBAAmB;IACnB,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M,GAAG,MAAM,OAAO,CAAC,6BAA6B,CAAC,eAAe,CAAC,CAAC;YAC5E,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;YAC/E,OAAO,CAAC,MAAM,MAAM,CAAC,GAAG,EAAE,CAAS,CAAC;QACrC,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;IAES,KAAK,CAAC,yBAAyB,CACxC,gBAAuC,EACvC,WAA+B,EAC/B,YAAgC,EAChC,cAAuB;QAEvB,MAAM,OAAO,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACtF,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,CAAC;YACpD,GAAG,IAAI,CAAC,WAAW;YACnB,OAAO;YACP,QAAQ,EAAE,KAAK;YACf,YAAY;SACZ,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidDataStoreRegistry } from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tFluidDataStoreRuntime,\n\ttype ISharedObjectRegistry,\n\tmixinRequestHandler,\n} from \"@fluidframework/datastore/internal\";\nimport type {\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIContainerRuntimeBase,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreFactory,\n\tIFluidDataStorePolicies,\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type {\n\tAsyncFluidObjectProvider,\n\tFluidObjectSymbolProvider,\n\tIFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize/internal\";\n\nimport type {\n\tDataObjectTypes,\n\tIDataObjectProps,\n\tPureDataObject,\n} from \"../data-objects/index.js\";\n\ninterface CreateDataObjectProps<TObj extends PureDataObject, I extends DataObjectTypes> {\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\tinitialState?: I[\"InitialState\"];\n\tpolicies?: Partial<IFluidDataStorePolicies>;\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,\n\tcontext,\n\tsharedObjectRegistry,\n\toptionalProviders,\n\truntimeClassArg,\n\texisting,\n\tinitialState: initProps,\n\tpolicies,\n}: CreateDataObjectProps<TObj, I>): Promise<{\n\tinstance: TObj;\n\truntime: FluidDataStoreRuntime;\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(\n\t\t// 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\tpolicies,\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 * Represents the properties required to create a DataObjectFactory.\n * This includes the type identifier, constructor, shared objects, optional providers,\n * registry entries, and the runtime class to use for the data object.\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n * @legacy\n * @alpha\n */\nexport interface DataObjectFactoryProps<\n\tTObj extends PureDataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> {\n\t/**\n\t * The type identifier for the data object factory.\n\t */\n\treadonly type: string;\n\n\t/**\n\t * The constructor for the data object.\n\t */\n\treadonly ctor: new (\n\t\tprops: IDataObjectProps<I>,\n\t) => TObj;\n\n\t/**\n\t * The shared objects (DDSes) to be registered with the data object.\n\t */\n\treadonly sharedObjects?: readonly IChannelFactory[];\n\n\t/**\n\t * Optional providers for dependency injection.\n\t */\n\treadonly optionalProviders?: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>;\n\n\t/**\n\t * Registry entries for named data stores.\n\t */\n\treadonly registryEntries?: NamedFluidDataStoreRegistryEntries;\n\n\t/**\n\t * The runtime class to use for the data object.\n\t */\n\treadonly runtimeClass?: typeof FluidDataStoreRuntime;\n\n\t/**\n\t * Optional policies that can be applied to the DataObject.\n\t * These policies define specific behaviors or constraints for the data object.\n\t */\n\treadonly policies?: Partial<IFluidDataStorePolicies>;\n}\n\n/**\n * PureDataObjectFactory is a bare-bones 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 * @legacy\n * @alpha\n */\nexport class PureDataObjectFactory<\n\tTObj extends PureDataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> implements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry>\n{\n\tprivate readonly registry: IFluidDataStoreRegistry | undefined;\n\tprivate readonly createProps: Omit<CreateDataObjectProps<TObj, I>, \"existing\" | \"context\">;\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.\"type\"}\n\t */\n\tpublic readonly type: string;\n\n\t/**\n\t * @remarks Use the props object based constructor instead.\n\t * No new features will be added to this constructor,\n\t * and it will eventually be deprecated and removed.\n\t */\n\tpublic constructor(\n\t\ttype: string,\n\t\tctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects?: readonly IChannelFactory[],\n\t\toptionalProviders?: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\truntimeClass?: typeof FluidDataStoreRuntime,\n\t);\n\tpublic constructor(props: DataObjectFactoryProps<TObj, I>);\n\tpublic constructor(\n\t\tpropsOrType: DataObjectFactoryProps<TObj, I> | string,\n\t\tmaybeCtor?: new (doProps: IDataObjectProps<I>) => TObj,\n\t\tmaybeSharedObjects?: readonly IChannelFactory[],\n\t\tmaybeOptionalProviders?: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tmaybeRegistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\tmaybeRuntimeFactory?: typeof FluidDataStoreRuntime,\n\t) {\n\t\tconst newProps =\n\t\t\ttypeof propsOrType === \"string\"\n\t\t\t\t? {\n\t\t\t\t\t\ttype: propsOrType,\n\t\t\t\t\t\t// both the arg and props base constructor require this param\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\tctor: maybeCtor!,\n\t\t\t\t\t\tsharedObjects: maybeSharedObjects,\n\t\t\t\t\t\toptionalProviders: maybeOptionalProviders,\n\t\t\t\t\t\tregistryEntries: maybeRegistryEntries,\n\t\t\t\t\t\truntimeClass: maybeRuntimeFactory,\n\t\t\t\t\t}\n\t\t\t\t: propsOrType;\n\n\t\tif (newProps.type === \"\") {\n\t\t\tthrow new Error(\"undefined type member\");\n\t\t}\n\t\tthis.type = newProps.type;\n\n\t\tthis.createProps = {\n\t\t\tctor: newProps.ctor,\n\t\t\toptionalProviders: newProps.optionalProviders ?? {},\n\t\t\tsharedObjectRegistry: new Map(newProps.sharedObjects?.map((ext) => [ext.type, ext])),\n\t\t\truntimeClassArg: newProps.runtimeClass ?? FluidDataStoreRuntime,\n\t\t\tpolicies: newProps.policies,\n\t\t};\n\n\t\tif (newProps.registryEntries !== undefined) {\n\t\t\tthis.registry = new FluidDataStoreRegistry(newProps.registryEntries);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreFactory.IFluidDataStoreFactory}\n\t */\n\tpublic get IFluidDataStoreFactory(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreRegistry.IFluidDataStoreRegistry}\n\t */\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined {\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 * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.instantiateDataStore}\n\t */\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<IFluidDataStoreChannel> {\n\t\tconst { runtime } = await createDataObject({ ...this.createProps, context, existing });\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 * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\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\tloadingGroupId?: string,\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\tloadingGroupId,\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 * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\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\tloadingGroupId?: string, // DO NOT USE, this is an experimental feature\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\tloadingGroupId,\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 * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\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\tloadingGroupId?: string,\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(runtime, [this.type], initialState, loadingGroupId);\n\t}\n\n\t/**\n\t * Creates a new instance of the object with a datastore which exposes the aliasing api.\n\t * @param runtime - container runtime. It is the runtime that will be used to create the object. It will produce\n\t * the underlying infrastructure to get the data object to operate.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @param packagePath - The path to the data store factory to use to create the data object.\n\t * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\n\t * @returns an array containing the object created by this factory and an IDataStore object that enables users to\n\t * alias the data object.\n\t * The data object is attached only when it is attached to the handle graph that connects to an aliased object or\n\t * when the data object is aliased.\n\t */\n\tpublic async createInstanceWithDataStore(\n\t\tcontainerRuntime: IContainerRuntimeBase,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tpackagePath?: Readonly<string[]>,\n\t\tloadingGroupId?: string,\n\t): Promise<[TObj, IDataStore]> {\n\t\tconst context = containerRuntime.createDetachedDataStore(\n\t\t\tpackagePath ?? [this.type],\n\t\t\tloadingGroupId,\n\t\t);\n\t\tconst { instance, runtime } = await createDataObject({\n\t\t\t...this.createProps,\n\t\t\tcontext,\n\t\t\texisting: false,\n\t\t\tinitialState,\n\t\t});\n\t\tconst dataStore = await context.attachRuntime(this, runtime);\n\n\t\treturn [instance, dataStore];\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\t * @deprecated - the issue is that it does not allow the customer to decide the conflict resolution policy when an\n\t * aliasing conflict occurs. Use {@link PureDataObjectFactory.createInstanceWithDataStore} instead.\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.createDetachedDataStore([this.type]);\n\t\tconst { instance, runtime: dataStoreRuntime } = await createDataObject({\n\t\t\t...this.createProps,\n\t\t\tcontext,\n\t\t\texisting: false,\n\t\t\tinitialState,\n\t\t});\n\t\tconst dataStore = await context.attachRuntime(this, dataStoreRuntime);\n\t\tconst result = await dataStore.trySetAlias(rootDataStoreId);\n\t\tif (result !== \"Success\") {\n\t\t\tconst handle = await runtime.getAliasedDataStoreEntryPoint(rootDataStoreId);\n\t\t\tassert(handle !== undefined, 0x8e1 /* Should have retrieved aliased handle */);\n\t\t\treturn (await handle.get()) as TObj;\n\t\t}\n\t\treturn instance;\n\t}\n\n\tprotected async createNonRootInstanceCore(\n\t\tcontainerRuntime: IContainerRuntimeBase,\n\t\tpackagePath: Readonly<string[]>,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tloadingGroupId?: string,\n\t): Promise<TObj> {\n\t\tconst context = containerRuntime.createDetachedDataStore(packagePath, loadingGroupId);\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\t...this.createProps,\n\t\t\tcontext,\n\t\t\texisting: false,\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;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAGpF,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EACN,qBAAqB,EAErB,mBAAmB,GACnB,MAAM,oCAAoC,CAAC;AAwC5C;;;GAGG;AACH,KAAK,UAAU,gBAAgB,CAG7B,EACD,IAAI,EACJ,OAAO,EACP,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,QAAQ,GACwB;IAIhC,OAAO;IACP,IAAI,YAAY,GAAG,eAAe,CAAC;IAEnC,mBAAmB;IACnB,YAAY,GAAG,mBAAmB,CACjC,KAAK,EAAE,OAAiB,EAAE,UAAiC,EAAE,EAAE;QAC9D,iFAAiF;QACjF,MAAM,UAAU,GAAG,CAAC,MAAM,UAAU,CAAC,UAAU,CAAC,GAAG,EAAE,CAAS,CAAC;QAC/D,MAAM,CACL,UAAU,CAAC,OAAO,KAAK,SAAS,EAChC,KAAK,CAAC,yDAAyD,CAC/D,CAAC;QACF,OAAO,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC,EACD,YAAY,CACZ,CAAC;IAEF,gFAAgF;IAChF,+DAA+D;IAC/D,6EAA6E;IAC7E,MAAM,OAAO,GAA0B,IAAI,YAAY;IACtD,uCAAuC;IACvC,OAAO,EACP,oBAAoB,E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,CAAC;IACvD,CAAC;IAES,KAAK,CAAC,kBAAkB,CACjC,OAAuC,EACvC,YAAgC;QAEhC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,gBAAgB,CAAC;YACpD,GAAG,IAAI,CAAC,WAAW;YACnB,OAAO;YACP,QAAQ,EAAE,KAAK;YACf,YAAY;SACZ,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { FluidDataStoreRegistry } from \"@fluidframework/container-runtime/internal\";\nimport type { IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport type { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tFluidDataStoreRuntime,\n\ttype ISharedObjectRegistry,\n\tmixinRequestHandler,\n} from \"@fluidframework/datastore/internal\";\nimport type {\n\tIChannelFactory,\n\tIFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIContainerRuntimeBase,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreFactory,\n\tIFluidDataStorePolicies,\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport type {\n\tAsyncFluidObjectProvider,\n\tFluidObjectSymbolProvider,\n\tIFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize/internal\";\n\nimport type {\n\tDataObjectTypes,\n\tIDataObjectProps,\n\tPureDataObject,\n} from \"../data-objects/index.js\";\n\ninterface CreateDataObjectProps<TObj extends PureDataObject, I extends DataObjectTypes> {\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\tinitialState?: I[\"InitialState\"];\n\tpolicies?: Partial<IFluidDataStorePolicies>;\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,\n\tcontext,\n\tsharedObjectRegistry,\n\toptionalProviders,\n\truntimeClassArg,\n\texisting,\n\tinitialState: initProps,\n\tpolicies,\n}: CreateDataObjectProps<TObj, I>): Promise<{\n\tinstance: TObj;\n\truntime: FluidDataStoreRuntime;\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(\n\t\t// 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\tpolicies,\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 * Represents the properties required to create a DataObjectFactory.\n * This includes the type identifier, constructor, shared objects, optional providers,\n * registry entries, and the runtime class to use for the data object.\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n * @legacy @beta\n */\nexport interface DataObjectFactoryProps<\n\tTObj extends PureDataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> {\n\t/**\n\t * The type identifier for the data object factory.\n\t */\n\treadonly type: string;\n\n\t/**\n\t * The constructor for the data object.\n\t */\n\treadonly ctor: new (\n\t\tprops: IDataObjectProps<I>,\n\t) => TObj;\n\n\t/**\n\t * The shared objects (DDSes) to be registered with the data object.\n\t */\n\treadonly sharedObjects?: readonly IChannelFactory[];\n\n\t/**\n\t * Optional providers for dependency injection.\n\t */\n\treadonly optionalProviders?: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>;\n\n\t/**\n\t * Registry entries for named data stores.\n\t */\n\treadonly registryEntries?: NamedFluidDataStoreRegistryEntries;\n\n\t/**\n\t * The runtime class to use for the data object.\n\t */\n\treadonly runtimeClass?: typeof FluidDataStoreRuntime;\n\n\t/**\n\t * Optional policies that can be applied to the DataObject.\n\t * These policies define specific behaviors or constraints for the data object.\n\t */\n\treadonly policies?: Partial<IFluidDataStorePolicies>;\n}\n\n/**\n * PureDataObjectFactory is a bare-bones 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 * @legacy @beta\n */\nexport class PureDataObjectFactory<\n\tTObj extends PureDataObject<I>,\n\tI extends DataObjectTypes = DataObjectTypes,\n> implements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry>\n{\n\tprivate readonly registry: IFluidDataStoreRegistry | undefined;\n\tprivate readonly createProps: Omit<CreateDataObjectProps<TObj, I>, \"existing\" | \"context\">;\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.\"type\"}\n\t */\n\tpublic readonly type: string;\n\n\t/**\n\t * @remarks Use the props object based constructor instead.\n\t * No new features will be added to this constructor,\n\t * and it will eventually be deprecated and removed.\n\t */\n\tpublic constructor(\n\t\ttype: string,\n\t\tctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects?: readonly IChannelFactory[],\n\t\toptionalProviders?: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\truntimeClass?: typeof FluidDataStoreRuntime,\n\t);\n\tpublic constructor(props: DataObjectFactoryProps<TObj, I>);\n\tpublic constructor(\n\t\tpropsOrType: DataObjectFactoryProps<TObj, I> | string,\n\t\tmaybeCtor?: new (doProps: IDataObjectProps<I>) => TObj,\n\t\tmaybeSharedObjects?: readonly IChannelFactory[],\n\t\tmaybeOptionalProviders?: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tmaybeRegistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\tmaybeRuntimeFactory?: typeof FluidDataStoreRuntime,\n\t) {\n\t\tconst newProps =\n\t\t\ttypeof propsOrType === \"string\"\n\t\t\t\t? {\n\t\t\t\t\t\ttype: propsOrType,\n\t\t\t\t\t\t// both the arg and props base constructor require this param\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\t\t\tctor: maybeCtor!,\n\t\t\t\t\t\tsharedObjects: maybeSharedObjects,\n\t\t\t\t\t\toptionalProviders: maybeOptionalProviders,\n\t\t\t\t\t\tregistryEntries: maybeRegistryEntries,\n\t\t\t\t\t\truntimeClass: maybeRuntimeFactory,\n\t\t\t\t\t}\n\t\t\t\t: propsOrType;\n\n\t\tif (newProps.type === \"\") {\n\t\t\tthrow new Error(\"undefined type member\");\n\t\t}\n\t\tthis.type = newProps.type;\n\n\t\tthis.createProps = {\n\t\t\tctor: newProps.ctor,\n\t\t\toptionalProviders: newProps.optionalProviders ?? {},\n\t\t\tsharedObjectRegistry: new Map(newProps.sharedObjects?.map((ext) => [ext.type, ext])),\n\t\t\truntimeClassArg: newProps.runtimeClass ?? FluidDataStoreRuntime,\n\t\t\tpolicies: newProps.policies,\n\t\t};\n\n\t\tif (newProps.registryEntries !== undefined) {\n\t\t\tthis.registry = new FluidDataStoreRegistry(newProps.registryEntries);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreFactory.IFluidDataStoreFactory}\n\t */\n\tpublic get IFluidDataStoreFactory(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreRegistry.IFluidDataStoreRegistry}\n\t */\n\tpublic get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined {\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 * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.instantiateDataStore}\n\t */\n\tpublic async instantiateDataStore(\n\t\tcontext: IFluidDataStoreContext,\n\t\texisting: boolean,\n\t): Promise<IFluidDataStoreChannel> {\n\t\tconst { runtime } = await createDataObject({ ...this.createProps, context, existing });\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 * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\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\tloadingGroupId?: string,\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\tloadingGroupId,\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 * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\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\tloadingGroupId?: string, // DO NOT USE, this is an experimental feature\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\tloadingGroupId,\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 * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\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\tloadingGroupId?: string,\n\t): Promise<TObj> {\n\t\treturn this.createNonRootInstanceCore(runtime, [this.type], initialState, loadingGroupId);\n\t}\n\n\t/**\n\t * Creates a new instance of the object with a datastore which exposes the aliasing api.\n\t * @param runtime - container runtime. It is the runtime that will be used to create the object. It will produce\n\t * the underlying infrastructure to get the data object to operate.\n\t * @param initialState - The initial state to provide to the created component.\n\t * @param packagePath - The path to the data store factory to use to create the data object.\n\t * @param loadingGroupId - NOT production ready, EXPERIMENTAL, please read {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}. The service needs to support this feature, does not work for most services\n\t * @returns an array containing the object created by this factory and an IDataStore object that enables users to\n\t * alias the data object.\n\t * The data object is attached only when it is attached to the handle graph that connects to an aliased object or\n\t * when the data object is aliased.\n\t */\n\tpublic async createInstanceWithDataStore(\n\t\tcontainerRuntime: IContainerRuntimeBase,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tpackagePath?: Readonly<string[]>,\n\t\tloadingGroupId?: string,\n\t): Promise<[TObj, IDataStore]> {\n\t\tconst context = containerRuntime.createDetachedDataStore(\n\t\t\tpackagePath ?? [this.type],\n\t\t\tloadingGroupId,\n\t\t);\n\t\tconst { instance, runtime } = await createDataObject({\n\t\t\t...this.createProps,\n\t\t\tcontext,\n\t\t\texisting: false,\n\t\t\tinitialState,\n\t\t});\n\t\tconst dataStore = await context.attachRuntime(this, runtime);\n\n\t\treturn [instance, dataStore];\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\t * @deprecated - the issue is that it does not allow the customer to decide the conflict resolution policy when an\n\t * aliasing conflict occurs. Use {@link PureDataObjectFactory.createInstanceWithDataStore} instead.\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.createDetachedDataStore([this.type]);\n\t\tconst { instance, runtime: dataStoreRuntime } = await createDataObject({\n\t\t\t...this.createProps,\n\t\t\tcontext,\n\t\t\texisting: false,\n\t\t\tinitialState,\n\t\t});\n\t\tconst dataStore = await context.attachRuntime(this, dataStoreRuntime);\n\t\tconst result = await dataStore.trySetAlias(rootDataStoreId);\n\t\tif (result !== \"Success\") {\n\t\t\tconst handle = await runtime.getAliasedDataStoreEntryPoint(rootDataStoreId);\n\t\t\tassert(handle !== undefined, 0x8e1 /* Should have retrieved aliased handle */);\n\t\t\treturn (await handle.get()) as TObj;\n\t\t}\n\t\treturn instance;\n\t}\n\n\tprotected async createNonRootInstanceCore(\n\t\tcontainerRuntime: IContainerRuntimeBase,\n\t\tpackagePath: Readonly<string[]>,\n\t\tinitialState?: I[\"InitialState\"],\n\t\tloadingGroupId?: string,\n\t): Promise<TObj> {\n\t\tconst context = containerRuntime.createDetachedDataStore(packagePath, loadingGroupId);\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\t...this.createProps,\n\t\t\tcontext,\n\t\t\texisting: false,\n\t\t\tinitialState,\n\t\t});\n\n\t\tawait context.attachRuntime(this, runtime);\n\n\t\treturn instance;\n\t}\n}\n"]}
@@ -10,7 +10,7 @@ import { PureDataObjectFactory, type DataObjectFactoryProps } from "./pureDataOb
10
10
  * @typeParam TDataObject - The concrete TreeDataObject implementation.
11
11
  * @typeParam TDataObjectTypes - The input types for the DataObject
12
12
  *
13
- * @legacy @alpha
13
+ * @legacy @beta
14
14
  */
15
15
  export declare class TreeDataObjectFactory<TDataObject extends TreeDataObject<TDataObjectTypes>, TDataObjectTypes extends DataObjectTypes = DataObjectTypes> extends PureDataObjectFactory<TDataObject, TDataObjectTypes> {
16
16
  constructor(props: DataObjectFactoryProps<TDataObject, TDataObjectTypes>);
@@ -10,7 +10,7 @@ import { PureDataObjectFactory, } from "./pureDataObjectFactory.js";
10
10
  * @typeParam TDataObject - The concrete TreeDataObject implementation.
11
11
  * @typeParam TDataObjectTypes - The input types for the DataObject
12
12
  *
13
- * @legacy @alpha
13
+ * @legacy @beta
14
14
  */
15
15
  export class TreeDataObjectFactory extends PureDataObjectFactory {
16
16
  constructor(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"treeDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/treeDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAI3D,OAAO,EACN,qBAAqB,GAErB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,OAAO,qBAGX,SAAQ,qBAAoD;IAC7D,YAAmB,KAA4D;QAC9E,MAAM,QAAQ,GAAG;YAChB,GAAG,KAAK;YACR,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE;SAClE,CAAC;QAEF,kFAAkF;QAClF,IACC,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAC3B,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,KAAK,UAAU,CAAC,UAAU,EAAE,CAAC,IAAI,CACpE,EACA,CAAC;YACF,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;QACtD,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SharedTree } from \"@fluidframework/tree/internal\";\n\nimport type { DataObjectTypes, TreeDataObject } from \"../data-objects/index.js\";\n\nimport {\n\tPureDataObjectFactory,\n\ttype DataObjectFactoryProps,\n} from \"./pureDataObjectFactory.js\";\n\n/**\n * {@link @fluidframework/runtime-definitions#IFluidDataStoreFactory} for use with {@link TreeDataObject}s.\n *\n * @typeParam TDataObject - The concrete TreeDataObject implementation.\n * @typeParam TDataObjectTypes - The input types for the DataObject\n *\n * @legacy @alpha\n */\nexport class TreeDataObjectFactory<\n\tTDataObject extends TreeDataObject<TDataObjectTypes>,\n\tTDataObjectTypes extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObjectFactory<TDataObject, TDataObjectTypes> {\n\tpublic constructor(props: DataObjectFactoryProps<TDataObject, TDataObjectTypes>) {\n\t\tconst newProps = {\n\t\t\t...props,\n\t\t\tsharedObjects: props.sharedObjects ? [...props.sharedObjects] : [],\n\t\t};\n\n\t\t// If the user did not specify a SharedTree factory, add it to the shared objects.\n\t\tif (\n\t\t\t!newProps.sharedObjects.some(\n\t\t\t\t(sharedObject) => sharedObject.type === SharedTree.getFactory().type,\n\t\t\t)\n\t\t) {\n\t\t\tnewProps.sharedObjects.push(SharedTree.getFactory());\n\t\t}\n\n\t\tsuper(newProps);\n\t}\n}\n"]}
1
+ {"version":3,"file":"treeDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/treeDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAI3D,OAAO,EACN,qBAAqB,GAErB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,OAAO,qBAGX,SAAQ,qBAAoD;IAC7D,YAAmB,KAA4D;QAC9E,MAAM,QAAQ,GAAG;YAChB,GAAG,KAAK;YACR,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE;SAClE,CAAC;QAEF,kFAAkF;QAClF,IACC,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAC3B,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,KAAK,UAAU,CAAC,UAAU,EAAE,CAAC,IAAI,CACpE,EACA,CAAC;YACF,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;QACtD,CAAC;QAED,KAAK,CAAC,QAAQ,CAAC,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SharedTree } from \"@fluidframework/tree/internal\";\n\nimport type { DataObjectTypes, TreeDataObject } from \"../data-objects/index.js\";\n\nimport {\n\tPureDataObjectFactory,\n\ttype DataObjectFactoryProps,\n} from \"./pureDataObjectFactory.js\";\n\n/**\n * {@link @fluidframework/runtime-definitions#IFluidDataStoreFactory} for use with {@link TreeDataObject}s.\n *\n * @typeParam TDataObject - The concrete TreeDataObject implementation.\n * @typeParam TDataObjectTypes - The input types for the DataObject\n *\n * @legacy @beta\n */\nexport class TreeDataObjectFactory<\n\tTDataObject extends TreeDataObject<TDataObjectTypes>,\n\tTDataObjectTypes extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObjectFactory<TDataObject, TDataObjectTypes> {\n\tpublic constructor(props: DataObjectFactoryProps<TDataObject, TDataObjectTypes>) {\n\t\tconst newProps = {\n\t\t\t...props,\n\t\t\tsharedObjects: props.sharedObjects ? [...props.sharedObjects] : [],\n\t\t};\n\n\t\t// If the user did not specify a SharedTree factory, add it to the shared objects.\n\t\tif (\n\t\t\t!newProps.sharedObjects.some(\n\t\t\t\t(sharedObject) => sharedObject.type === SharedTree.getFactory().type,\n\t\t\t)\n\t\t) {\n\t\t\tnewProps.sharedObjects.push(SharedTree.getFactory());\n\t\t}\n\n\t\tsuper(newProps);\n\t}\n}\n"]}
@@ -15,7 +15,7 @@ import type { DataObjectTypes } from "./types.js";
15
15
  *
16
16
  * @typeParam I - The optional input types used to strongly type the data object
17
17
  * @legacy
18
- * @alpha
18
+ * @beta
19
19
  */
20
20
  export declare abstract class DataObject<I extends DataObjectTypes = DataObjectTypes> extends PureDataObject<I> {
21
21
  private internalRoot;
@@ -14,7 +14,7 @@ import { PureDataObject } from "./pureDataObject.js";
14
14
  *
15
15
  * @typeParam I - The optional input types used to strongly type the data object
16
16
  * @legacy
17
- * @alpha
17
+ * @beta
18
18
  */
19
19
  export class DataObject extends PureDataObject {
20
20
  constructor() {