@fluidframework/aqueduct 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.246488

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 (122) hide show
  1. package/dist/aqueduct-alpha.d.ts +36 -10
  2. package/dist/aqueduct-beta.d.ts +6 -0
  3. package/dist/aqueduct-public.d.ts +6 -0
  4. package/dist/aqueduct-untrimmed.d.ts +36 -10
  5. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +1 -1
  6. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
  7. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +2 -2
  8. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  9. package/dist/container-runtime-factories/index.d.ts +2 -2
  10. package/dist/container-runtime-factories/index.d.ts.map +1 -1
  11. package/dist/container-runtime-factories/index.js +4 -4
  12. package/dist/container-runtime-factories/index.js.map +1 -1
  13. package/dist/data-object-factories/dataObjectFactory.d.ts +3 -3
  14. package/dist/data-object-factories/dataObjectFactory.d.ts.map +1 -1
  15. package/dist/data-object-factories/dataObjectFactory.js +2 -2
  16. package/dist/data-object-factories/dataObjectFactory.js.map +1 -1
  17. package/dist/data-object-factories/index.d.ts +2 -2
  18. package/dist/data-object-factories/index.d.ts.map +1 -1
  19. package/dist/data-object-factories/index.js +4 -4
  20. package/dist/data-object-factories/index.js.map +1 -1
  21. package/dist/data-object-factories/pureDataObjectFactory.d.ts +35 -11
  22. package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
  23. package/dist/data-object-factories/pureDataObjectFactory.js +50 -14
  24. package/dist/data-object-factories/pureDataObjectFactory.js.map +1 -1
  25. package/dist/data-objects/dataObject.d.ts +2 -2
  26. package/dist/data-objects/dataObject.d.ts.map +1 -1
  27. package/dist/data-objects/dataObject.js +2 -2
  28. package/dist/data-objects/dataObject.js.map +1 -1
  29. package/dist/data-objects/index.d.ts +3 -3
  30. package/dist/data-objects/index.d.ts.map +1 -1
  31. package/dist/data-objects/index.js +4 -4
  32. package/dist/data-objects/index.js.map +1 -1
  33. package/dist/data-objects/pureDataObject.d.ts +1 -1
  34. package/dist/data-objects/pureDataObject.d.ts.map +1 -1
  35. package/dist/data-objects/pureDataObject.js.map +1 -1
  36. package/dist/index.d.ts +3 -3
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +9 -9
  39. package/dist/index.js.map +1 -1
  40. package/dist/package.json +3 -0
  41. package/dist/tsdoc-metadata.json +1 -1
  42. package/lib/{aqueduct-alpha.d.mts → aqueduct-alpha.d.ts} +51 -10
  43. package/lib/{aqueduct-beta.d.mts → aqueduct-beta.d.ts} +21 -0
  44. package/lib/{aqueduct-public.d.mts → aqueduct-public.d.ts} +21 -0
  45. package/lib/{aqueduct-untrimmed.d.mts → aqueduct-untrimmed.d.ts} +51 -10
  46. package/lib/container-runtime-factories/{baseContainerRuntimeFactory.d.mts → baseContainerRuntimeFactory.d.ts} +1 -1
  47. package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -0
  48. package/lib/container-runtime-factories/{baseContainerRuntimeFactory.mjs → baseContainerRuntimeFactory.js} +2 -1
  49. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -0
  50. package/lib/container-runtime-factories/{containerRuntimeFactoryWithDefaultDataStore.d.mts → containerRuntimeFactoryWithDefaultDataStore.d.ts} +2 -2
  51. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -0
  52. package/lib/container-runtime-factories/{containerRuntimeFactoryWithDefaultDataStore.mjs → containerRuntimeFactoryWithDefaultDataStore.js} +2 -2
  53. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -0
  54. package/lib/container-runtime-factories/{index.d.mts → index.d.ts} +3 -3
  55. package/lib/container-runtime-factories/index.d.ts.map +1 -0
  56. package/lib/container-runtime-factories/{index.mjs → index.js} +3 -3
  57. package/lib/container-runtime-factories/index.js.map +1 -0
  58. package/lib/data-object-factories/{dataObjectFactory.d.mts → dataObjectFactory.d.ts} +4 -4
  59. package/lib/data-object-factories/dataObjectFactory.d.ts.map +1 -0
  60. package/lib/data-object-factories/{dataObjectFactory.mjs → dataObjectFactory.js} +2 -2
  61. package/lib/data-object-factories/dataObjectFactory.js.map +1 -0
  62. package/lib/data-object-factories/index.d.ts +7 -0
  63. package/lib/data-object-factories/index.d.ts.map +1 -0
  64. package/lib/data-object-factories/index.js +7 -0
  65. package/lib/data-object-factories/index.js.map +1 -0
  66. package/lib/data-object-factories/{pureDataObjectFactory.d.mts → pureDataObjectFactory.d.ts} +36 -12
  67. package/lib/data-object-factories/pureDataObjectFactory.d.ts.map +1 -0
  68. package/lib/data-object-factories/{pureDataObjectFactory.mjs → pureDataObjectFactory.js} +51 -15
  69. package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -0
  70. package/lib/data-objects/{dataObject.d.mts → dataObject.d.ts} +3 -3
  71. package/lib/data-objects/dataObject.d.ts.map +1 -0
  72. package/lib/data-objects/{dataObject.mjs → dataObject.js} +2 -2
  73. package/lib/data-objects/dataObject.js.map +1 -0
  74. package/lib/data-objects/{index.d.mts → index.d.ts} +4 -4
  75. package/lib/data-objects/index.d.ts.map +1 -0
  76. package/lib/data-objects/index.js +7 -0
  77. package/lib/data-objects/index.js.map +1 -0
  78. package/lib/data-objects/{pureDataObject.d.mts → pureDataObject.d.ts} +2 -2
  79. package/lib/data-objects/pureDataObject.d.ts.map +1 -0
  80. package/lib/data-objects/{pureDataObject.mjs → pureDataObject.js} +1 -1
  81. package/lib/data-objects/pureDataObject.js.map +1 -0
  82. package/lib/data-objects/{types.d.mts → types.d.ts} +1 -1
  83. package/lib/data-objects/types.d.ts.map +1 -0
  84. package/lib/data-objects/{types.mjs → types.js} +1 -1
  85. package/lib/data-objects/types.js.map +1 -0
  86. package/lib/index.d.ts +22 -0
  87. package/lib/index.d.ts.map +1 -0
  88. package/lib/index.js +22 -0
  89. package/lib/index.js.map +1 -0
  90. package/lib/test/aqueduct.spec.js +8 -0
  91. package/lib/test/aqueduct.spec.js.map +1 -0
  92. package/lib/test/tsconfig.tsbuildinfo +1 -0
  93. package/lib/test/types/validateAqueductPrevious.generated.js +26 -0
  94. package/lib/test/types/validateAqueductPrevious.generated.js.map +1 -0
  95. package/package.json +55 -54
  96. package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.mts.map +0 -1
  97. package/lib/container-runtime-factories/baseContainerRuntimeFactory.mjs.map +0 -1
  98. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.mts.map +0 -1
  99. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.mjs.map +0 -1
  100. package/lib/container-runtime-factories/index.d.mts.map +0 -1
  101. package/lib/container-runtime-factories/index.mjs.map +0 -1
  102. package/lib/data-object-factories/dataObjectFactory.d.mts.map +0 -1
  103. package/lib/data-object-factories/dataObjectFactory.mjs.map +0 -1
  104. package/lib/data-object-factories/index.d.mts +0 -7
  105. package/lib/data-object-factories/index.d.mts.map +0 -1
  106. package/lib/data-object-factories/index.mjs +0 -7
  107. package/lib/data-object-factories/index.mjs.map +0 -1
  108. package/lib/data-object-factories/pureDataObjectFactory.d.mts.map +0 -1
  109. package/lib/data-object-factories/pureDataObjectFactory.mjs.map +0 -1
  110. package/lib/data-objects/dataObject.d.mts.map +0 -1
  111. package/lib/data-objects/dataObject.mjs.map +0 -1
  112. package/lib/data-objects/index.d.mts.map +0 -1
  113. package/lib/data-objects/index.mjs +0 -7
  114. package/lib/data-objects/index.mjs.map +0 -1
  115. package/lib/data-objects/pureDataObject.d.mts.map +0 -1
  116. package/lib/data-objects/pureDataObject.mjs.map +0 -1
  117. package/lib/data-objects/types.d.mts.map +0 -1
  118. package/lib/data-objects/types.mjs.map +0 -1
  119. package/lib/index.d.mts +0 -8
  120. package/lib/index.d.mts.map +0 -1
  121. package/lib/index.mjs +0 -8
  122. package/lib/index.mjs.map +0 -1
@@ -3,11 +3,11 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { FluidDataStoreRuntime } from "@fluidframework/datastore";
6
- import { type IFluidDataStoreContext, type IContainerRuntimeBase, type IFluidDataStoreFactory, type IFluidDataStoreRegistry, type IProvideFluidDataStoreRegistry, type NamedFluidDataStoreRegistryEntries, type NamedFluidDataStoreRegistryEntry, type IFluidDataStoreContextDetached } from "@fluidframework/runtime-definitions";
6
+ import { type IContainerRuntimeBase, type IDataStore, type IFluidDataStoreChannel, type IFluidDataStoreContext, type IFluidDataStoreContextDetached, type IFluidDataStoreFactory, type IFluidDataStoreRegistry, type NamedFluidDataStoreRegistryEntries, type NamedFluidDataStoreRegistryEntry, type IProvideFluidDataStoreRegistry } from "@fluidframework/runtime-definitions";
7
7
  import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions";
8
8
  import { type IChannelFactory } from "@fluidframework/datastore-definitions";
9
9
  import { type FluidObjectSymbolProvider } from "@fluidframework/synthesize";
10
- import { type IDataObjectProps, type PureDataObject, type DataObjectTypes } from "../data-objects/index.mjs";
10
+ import { type IDataObjectProps, type PureDataObject, type DataObjectTypes } from "../data-objects/index.js";
11
11
  /**
12
12
  * PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.
13
13
  * Consumers should typically use DataObjectFactory instead unless creating
@@ -18,13 +18,20 @@ import { type IDataObjectProps, type PureDataObject, type DataObjectTypes } from
18
18
  * @alpha
19
19
  */
20
20
  export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I extends DataObjectTypes = DataObjectTypes> implements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry> {
21
+ /**
22
+ * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory."type"}
23
+ */
21
24
  readonly type: string;
22
25
  private readonly ctor;
23
26
  private readonly optionalProviders;
24
27
  private readonly runtimeClass;
25
28
  private readonly sharedObjectRegistry;
26
29
  private readonly registry;
27
- constructor(type: string, ctor: new (props: IDataObjectProps<I>) => TObj, sharedObjects: readonly IChannelFactory[], optionalProviders: FluidObjectSymbolProvider<I["OptionalProviders"]>, registryEntries?: NamedFluidDataStoreRegistryEntries, runtimeClass?: typeof FluidDataStoreRuntime);
30
+ constructor(
31
+ /**
32
+ * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory."type"}
33
+ */
34
+ type: string, ctor: new (props: IDataObjectProps<I>) => TObj, sharedObjects: readonly IChannelFactory[], optionalProviders: FluidObjectSymbolProvider<I["OptionalProviders"]>, registryEntries?: NamedFluidDataStoreRegistryEntries, runtimeClass?: typeof FluidDataStoreRuntime);
28
35
  /**
29
36
  * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreFactory.IFluidDataStoreFactory}
30
37
  */
@@ -41,11 +48,9 @@ export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I ext
41
48
  */
42
49
  get registryEntry(): NamedFluidDataStoreRegistryEntry;
43
50
  /**
44
- * This is where we do data store setup.
45
- *
46
- * @param context - data store context used to load a data store runtime
51
+ * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.instantiateDataStore}
47
52
  */
48
- instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<FluidDataStoreRuntime>;
53
+ instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<IFluidDataStoreChannel>;
49
54
  /**
50
55
  * Creates a new instance of the object. Uses parent context's registry to build package path to this factory.
51
56
  * In other words, registry of context passed in has to contain this factory, with the name that matches
@@ -54,10 +59,11 @@ export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I ext
54
59
  * @param context - The context being used to create the runtime
55
60
  * (the created object will have its own new context created as well)
56
61
  * @param initialState - The initial state to provide to the created data store.
62
+ * @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
57
63
  * @returns an object created by this factory. Data store and objects created are not attached to container.
58
64
  * They get attached only when a handle to one of them is attached to already attached objects.
59
65
  */
60
- createChildInstance(parentContext: IFluidDataStoreContext, initialState?: I["InitialState"]): Promise<TObj>;
66
+ createChildInstance(parentContext: IFluidDataStoreContext, initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;
61
67
  /**
62
68
  * Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory.
63
69
  * In other words, registry of context passed in has to have this factory.
@@ -65,10 +71,11 @@ export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I ext
65
71
  * @param context - The component context being used to create the object
66
72
  * (the created object will have its own new context created as well)
67
73
  * @param initialState - The initial state to provide to the created component.
74
+ * @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
68
75
  * @returns an object created by this factory. Data store and objects created are not attached to container.
69
76
  * They get attached only when a handle to one of them is attached to already attached objects.
70
77
  */
71
- createPeerInstance(peerContext: IFluidDataStoreContext, initialState?: I["InitialState"]): Promise<TObj>;
78
+ createPeerInstance(peerContext: IFluidDataStoreContext, initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;
72
79
  /**
73
80
  * Creates a new instance of the object. Uses container's registry to find this factory.
74
81
  * It's expected that only container owners would use this functionality, as only such developers
@@ -76,10 +83,24 @@ export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I ext
76
83
  * The name in this registry for such record should match type of this factory.
77
84
  * @param runtime - container runtime. It's registry is used to create an object.
78
85
  * @param initialState - The initial state to provide to the created component.
86
+ * @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
79
87
  * @returns an object created by this factory. Data store and objects created are not attached to container.
80
88
  * They get attached only when a handle to one of them is attached to already attached objects.
81
89
  */
82
- createInstance(runtime: IContainerRuntimeBase, initialState?: I["InitialState"]): Promise<TObj>;
90
+ createInstance(runtime: IContainerRuntimeBase, initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;
91
+ /**
92
+ * Creates a new instance of the object with a datastore which exposes the aliasing api.
93
+ * @param runtime - container runtime. It is the runtime that will be used to create the object. It will produce
94
+ * the underlying infrastructure to get the data object to operate.
95
+ * @param initialState - The initial state to provide to the created component.
96
+ * @param packagePath - The path to the data store factory to use to create the data object.
97
+ * @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
98
+ * @returns an array containing the object created by this factory and an IDataStore object that enables users to
99
+ * alias the data object.
100
+ * The data object is attached only when it is attached to the handle graph that connects to an aliased object or
101
+ * when the data object is aliased.
102
+ */
103
+ createInstanceWithDataStore(containerRuntime: IContainerRuntimeBase, initialState?: I["InitialState"], packagePath?: Readonly<string[]>, loadingGroupId?: string): Promise<[TObj, IDataStore]>;
83
104
  /**
84
105
  * Creates a new root instance of the object. Uses container's registry to find this factory.
85
106
  * It's expected that only container owners would use this functionality, as only such developers
@@ -89,9 +110,12 @@ export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I ext
89
110
  * @param initialState - The initial state to provide to the created component.
90
111
  * @returns an object created by this factory. Data store and objects created are not attached to container.
91
112
  * They get attached only when a handle to one of them is attached to already attached objects.
113
+ *
114
+ * @deprecated - the issue is that it does not allow the customer to decide the conflict resolution policy when an
115
+ * aliasing conflict occurs. Use {@link PureDataObjectFactory.createInstanceWithDataStore} instead.
92
116
  */
93
117
  createRootInstance(rootDataStoreId: string, runtime: IContainerRuntime, initialState?: I["InitialState"]): Promise<TObj>;
94
- protected createNonRootInstanceCore(containerRuntime: IContainerRuntimeBase, packagePath: Readonly<string[]>, initialState?: I["InitialState"]): Promise<TObj>;
118
+ protected createNonRootInstanceCore(containerRuntime: IContainerRuntimeBase, packagePath: Readonly<string[]>, initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;
95
119
  protected createInstanceCore(context: IFluidDataStoreContextDetached, initialState?: I["InitialState"]): Promise<TObj>;
96
120
  }
97
- //# sourceMappingURL=pureDataObjectFactory.d.mts.map
121
+ //# sourceMappingURL=pureDataObjectFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pureDataObjectFactory.d.ts","sourceRoot":"","sources":["../../src/data-object-factories/pureDataObjectFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,qBAAqB,EAGrB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,kCAAkC,EACvC,KAAK,gCAAgC,EACrC,KAAK,8BAA8B,EACnC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EACN,KAAK,eAAe,EAEpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAEN,KAAK,yBAAyB,EAE9B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,0BAA0B,CAAC;AAuFlC;;;;;;;;GAQG;AACH,qBAAa,qBAAqB,CAChC,IAAI,SAAS,cAAc,CAAC,CAAC,CAAC,EAC9B,CAAC,SAAS,eAAe,GAAG,eAAe,CAE5C,YAAW,sBAAsB,EAAE,OAAO,CAAC,8BAA8B,CAAC;IAMzE;;OAEG;aACa,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI;IAErB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAElC,OAAO,CAAC,Q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vC,gBAAgB,EAAE,qBAAqB,EACvC,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,EAChC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,EAChC,cAAc,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAmB9B;;;;;;;;;;;;OAYG;IACU,kBAAkB,CAC9B,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,iBAAiB,EAC1B,YAAY,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,OAAO,CAAC,IAAI,CAAC;cAqBA,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;CAehB"}
@@ -65,7 +65,11 @@ async function createDataObject(ctor, context, sharedObjectRegistry, optionalPro
65
65
  * @alpha
66
66
  */
67
67
  export class PureDataObjectFactory {
68
- constructor(type, ctor, sharedObjects, optionalProviders, registryEntries, runtimeClass = FluidDataStoreRuntime) {
68
+ constructor(
69
+ /**
70
+ * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory."type"}
71
+ */
72
+ type, ctor, sharedObjects, optionalProviders, registryEntries, runtimeClass = FluidDataStoreRuntime) {
69
73
  this.type = type;
70
74
  this.ctor = ctor;
71
75
  this.optionalProviders = optionalProviders;
@@ -100,9 +104,7 @@ export class PureDataObjectFactory {
100
104
  return [this.type, Promise.resolve(this)];
101
105
  }
102
106
  /**
103
- * This is where we do data store setup.
104
- *
105
- * @param context - data store context used to load a data store runtime
107
+ * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.instantiateDataStore}
106
108
  */
107
109
  async instantiateDataStore(context, existing) {
108
110
  const { runtime } = await createDataObject(this.ctor, context, this.sharedObjectRegistry, this.optionalProviders, this.runtimeClass, existing);
@@ -116,11 +118,12 @@ export class PureDataObjectFactory {
116
118
  * @param context - The context being used to create the runtime
117
119
  * (the created object will have its own new context created as well)
118
120
  * @param initialState - The initial state to provide to the created data store.
121
+ * @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
119
122
  * @returns an object created by this factory. Data store and objects created are not attached to container.
120
123
  * They get attached only when a handle to one of them is attached to already attached objects.
121
124
  */
122
- async createChildInstance(parentContext, initialState) {
123
- return this.createNonRootInstanceCore(parentContext.containerRuntime, [...parentContext.packagePath, this.type], initialState);
125
+ async createChildInstance(parentContext, initialState, loadingGroupId) {
126
+ return this.createNonRootInstanceCore(parentContext.containerRuntime, [...parentContext.packagePath, this.type], initialState, loadingGroupId);
124
127
  }
125
128
  /**
126
129
  * Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory.
@@ -129,11 +132,12 @@ export class PureDataObjectFactory {
129
132
  * @param context - The component context being used to create the object
130
133
  * (the created object will have its own new context created as well)
131
134
  * @param initialState - The initial state to provide to the created component.
135
+ * @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
132
136
  * @returns an object created by this factory. Data store and objects created are not attached to container.
133
137
  * They get attached only when a handle to one of them is attached to already attached objects.
134
138
  */
135
- async createPeerInstance(peerContext, initialState) {
136
- return this.createNonRootInstanceCore(peerContext.containerRuntime, peerContext.packagePath, initialState);
139
+ async createPeerInstance(peerContext, initialState, loadingGroupId) {
140
+ return this.createNonRootInstanceCore(peerContext.containerRuntime, peerContext.packagePath, initialState, loadingGroupId);
137
141
  }
138
142
  /**
139
143
  * Creates a new instance of the object. Uses container's registry to find this factory.
@@ -142,11 +146,31 @@ export class PureDataObjectFactory {
142
146
  * The name in this registry for such record should match type of this factory.
143
147
  * @param runtime - container runtime. It's registry is used to create an object.
144
148
  * @param initialState - The initial state to provide to the created component.
149
+ * @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
145
150
  * @returns an object created by this factory. Data store and objects created are not attached to container.
146
151
  * They get attached only when a handle to one of them is attached to already attached objects.
147
152
  */
148
- async createInstance(runtime, initialState) {
149
- return this.createNonRootInstanceCore(runtime, [this.type], initialState);
153
+ async createInstance(runtime, initialState, loadingGroupId) {
154
+ return this.createNonRootInstanceCore(runtime, [this.type], initialState, loadingGroupId);
155
+ }
156
+ /**
157
+ * Creates a new instance of the object with a datastore which exposes the aliasing api.
158
+ * @param runtime - container runtime. It is the runtime that will be used to create the object. It will produce
159
+ * the underlying infrastructure to get the data object to operate.
160
+ * @param initialState - The initial state to provide to the created component.
161
+ * @param packagePath - The path to the data store factory to use to create the data object.
162
+ * @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
163
+ * @returns an array containing the object created by this factory and an IDataStore object that enables users to
164
+ * alias the data object.
165
+ * The data object is attached only when it is attached to the handle graph that connects to an aliased object or
166
+ * when the data object is aliased.
167
+ */
168
+ async createInstanceWithDataStore(containerRuntime, initialState, packagePath, loadingGroupId) {
169
+ const context = containerRuntime.createDetachedDataStore(packagePath ?? [this.type], loadingGroupId);
170
+ const { instance, runtime } = await createDataObject(this.ctor, context, this.sharedObjectRegistry, this.optionalProviders, this.runtimeClass, false, // existing
171
+ initialState);
172
+ const dataStore = await context.attachRuntime(this, runtime);
173
+ return [instance, dataStore];
150
174
  }
151
175
  /**
152
176
  * Creates a new root instance of the object. Uses container's registry to find this factory.
@@ -157,13 +181,25 @@ export class PureDataObjectFactory {
157
181
  * @param initialState - The initial state to provide to the created component.
158
182
  * @returns an object created by this factory. Data store and objects created are not attached to container.
159
183
  * They get attached only when a handle to one of them is attached to already attached objects.
184
+ *
185
+ * @deprecated - the issue is that it does not allow the customer to decide the conflict resolution policy when an
186
+ * aliasing conflict occurs. Use {@link PureDataObjectFactory.createInstanceWithDataStore} instead.
160
187
  */
161
188
  async createRootInstance(rootDataStoreId, runtime, initialState) {
162
- const context = runtime.createDetachedRootDataStore([this.type], rootDataStoreId);
163
- return this.createInstanceCore(context, initialState);
189
+ const context = runtime.createDetachedDataStore([this.type]);
190
+ const { instance, runtime: dataStoreRuntime } = await createDataObject(this.ctor, context, this.sharedObjectRegistry, this.optionalProviders, this.runtimeClass, false, // existing
191
+ initialState);
192
+ const dataStore = await context.attachRuntime(this, dataStoreRuntime);
193
+ const result = await dataStore.trySetAlias(rootDataStoreId);
194
+ if (result !== "Success") {
195
+ const handle = await runtime.getAliasedDataStoreEntryPoint(rootDataStoreId);
196
+ assert(handle !== undefined, 0x8e1 /* Should have retrieved aliased handle */);
197
+ return (await handle.get());
198
+ }
199
+ return instance;
164
200
  }
165
- async createNonRootInstanceCore(containerRuntime, packagePath, initialState) {
166
- const context = containerRuntime.createDetachedDataStore(packagePath);
201
+ async createNonRootInstanceCore(containerRuntime, packagePath, initialState, loadingGroupId) {
202
+ const context = containerRuntime.createDetachedDataStore(packagePath, loadingGroupId);
167
203
  return this.createInstanceCore(context, initialState);
168
204
  }
169
205
  async createInstanceCore(context, initialState) {
@@ -173,4 +209,4 @@ export class PureDataObjectFactory {
173
209
  return instance;
174
210
  }
175
211
  }
176
- //# sourceMappingURL=pureDataObjectFactory.mjs.map
212
+ //# sourceMappingURL=pureDataObjectFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pureDataObjectFactory.js","sourceRoot":"","sources":["../../src/data-object-factories/pureDataOb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CAAC,eAAe,CAAC,CAAC;QAC5D,IAAI,MAAM,KAAK,SAAS,EAAE;YACzB,MAAM,MAAM,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;SACpC;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,CACnD,IAAI,CAAC,IAAI,EACT,OAAO,EACP,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,iBAAiB,EACtB,IAAI,CAAC,YAAY,EACjB,KAAK,EAAE,WAAW;QAClB,YAAY,CACZ,CAAC;QAEF,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3C,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type IRequest, type FluidObject } from \"@fluidframework/core-interfaces\";\nimport {\n\tFluidDataStoreRuntime,\n\ttype ISharedObjectRegistry,\n\tmixinRequestHandler,\n} from \"@fluidframework/datastore\";\nimport { FluidDataStoreRegistry } from \"@fluidframework/container-runtime\";\nimport {\n\ttype IContainerRuntimeBase,\n\ttype IDataStore,\n\ttype IFluidDataStoreChannel,\n\ttype IFluidDataStoreContext,\n\ttype IFluidDataStoreContextDetached,\n\ttype IFluidDataStoreFactory,\n\ttype IFluidDataStoreRegistry,\n\ttype NamedFluidDataStoreRegistryEntries,\n\ttype NamedFluidDataStoreRegistryEntry,\n\ttype IProvideFluidDataStoreRegistry,\n} from \"@fluidframework/runtime-definitions\";\nimport { type IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport {\n\ttype IChannelFactory,\n\ttype IFluidDataStoreRuntime,\n} from \"@fluidframework/datastore-definitions\";\nimport {\n\ttype AsyncFluidObjectProvider,\n\ttype FluidObjectSymbolProvider,\n\ttype IFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\ttype IDataObjectProps,\n\ttype PureDataObject,\n\ttype DataObjectTypes,\n} from \"../data-objects/index.js\";\n\n/**\n * Proxy over PureDataObject\n * Does delayed creation & initialization of PureDataObject\n */\nasync function createDataObject<\n\tTObj extends PureDataObject,\n\tI extends DataObjectTypes = DataObjectTypes,\n>(\n\tctor: new (props: IDataObjectProps<I>) => TObj,\n\tcontext: IFluidDataStoreContext,\n\tsharedObjectRegistry: ISharedObjectRegistry,\n\toptionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\truntimeClassArg: typeof FluidDataStoreRuntime,\n\texisting: boolean,\n\tinitProps?: I[\"InitialState\"],\n): 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( // calls new FluidDataStoreRuntime(...)\n\t\tcontext,\n\t\tsharedObjectRegistry,\n\t\texisting,\n\t\tasync (rt: IFluidDataStoreRuntime) => {\n\t\t\tassert(instance !== undefined, 0x46a /* entryPoint is undefined */);\n\t\t\t// Calling finishInitialization here like PureDataObject.getDataObject did, to keep the same behavior,\n\t\t\t// since accessing the runtime's entryPoint is how we want the data object to be retrieved going forward.\n\t\t\t// Without this I ran into issues with the load-existing flow not working correctly.\n\t\t\tawait instance.finishInitialization(true);\n\t\t\treturn instance;\n\t\t} /* provideEntryPoint */,\n\t);\n\n\t// Create object right away.\n\t// This allows object to register various callbacks with runtime before runtime\n\t// becomes globally available. But it's not full initialization - constructor can't\n\t// access DDSes or other services of runtime as objects are not fully initialized.\n\t// In order to use object, we need to go through full initialization by calling finishInitialization().\n\tconst scope: FluidObject<IFluidDependencySynthesizer> = context.scope;\n\tconst providers =\n\t\tscope.IFluidDependencySynthesizer?.synthesize<I[\"OptionalProviders\"]>(\n\t\t\toptionalProviders,\n\t\t\t{},\n\t\t) ??\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\t({} as AsyncFluidObjectProvider<never>);\n\n\tconst instance = new ctor({ runtime, context, providers, initProps });\n\n\t// if it's a newly created object, we need to wait for it to finish initialization\n\t// as that results in creation of DDSes, before it gets attached, providing atomic\n\t// guarantee of creation.\n\t// WARNING: we can't do the same (yet) for already existing PureDataObject!\n\t// This will result in deadlock, as it tries to resolve internal handles, but any\n\t// handle resolution goes through root (container runtime), which can't route it back\n\t// to this data store, as it's still not initialized and not known to container runtime yet.\n\t// In the future, we should address it by using relative paths for handles and be able to resolve\n\t// local DDSes while data store is not fully initialized.\n\tif (!existing) {\n\t\tawait instance.finishInitialization(existing);\n\t}\n\n\treturn { instance, runtime };\n}\n\n/**\n * PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.\n * Consumers should typically use DataObjectFactory instead unless creating\n * another base data store factory.\n *\n * @typeParam TObj - DataObject (concrete type)\n * @typeParam I - The input types for the DataObject\n * @alpha\n */\nexport class PureDataObjectFactory<\n\t\tTObj extends PureDataObject<I>,\n\t\tI extends DataObjectTypes = DataObjectTypes,\n\t>\n\timplements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry>\n{\n\tprivate readonly sharedObjectRegistry: ISharedObjectRegistry;\n\tprivate readonly registry: IFluidDataStoreRegistry | undefined;\n\n\tpublic constructor(\n\t\t/**\n\t\t * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.\"type\"}\n\t\t */\n\t\tpublic readonly type: string,\n\t\tprivate readonly ctor: new (props: IDataObjectProps<I>) => TObj,\n\t\tsharedObjects: readonly IChannelFactory[],\n\t\tprivate readonly optionalProviders: FluidObjectSymbolProvider<I[\"OptionalProviders\"]>,\n\t\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\t\tprivate readonly runtimeClass: typeof FluidDataStoreRuntime = FluidDataStoreRuntime,\n\t) {\n\t\tif (this.type === \"\") {\n\t\t\tthrow new Error(\"undefined type member\");\n\t\t}\n\t\tif (registryEntries !== undefined) {\n\t\t\tthis.registry = new FluidDataStoreRegistry(registryEntries);\n\t\t}\n\t\tthis.sharedObjectRegistry = new Map(sharedObjects.map((ext) => [ext.type, ext]));\n\t}\n\n\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(\n\t\t\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\texisting,\n\t\t);\n\n\t\treturn runtime;\n\t}\n\n\t/**\n\t * Creates a new instance of the object. Uses parent context's registry to build package path to this factory.\n\t * In other words, registry of context passed in has to contain this factory, with the name that matches\n\t * this factory's type.\n\t * It is intended to be used by data store objects that create sub-objects.\n\t * @param context - The context being used to create the runtime\n\t * (the created object will have its own new context created as well)\n\t * @param initialState - The initial state to provide to the created data store.\n\t * @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\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\tfalse, // existing\n\t\t\tinitialState,\n\t\t);\n\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\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\tfalse, // existing\n\t\t\tinitialState,\n\t\t);\n\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\tthis.ctor,\n\t\t\tcontext,\n\t\t\tthis.sharedObjectRegistry,\n\t\t\tthis.optionalProviders,\n\t\t\tthis.runtimeClass,\n\t\t\tfalse, // existing\n\t\t\tinitialState,\n\t\t);\n\n\t\tawait context.attachRuntime(this, runtime);\n\n\t\treturn instance;\n\t}\n}\n"]}
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { type ISharedDirectory } from "@fluidframework/map";
6
- import { PureDataObject } from "./pureDataObject.mjs";
7
- import { type DataObjectTypes } from "./types.mjs";
6
+ import { PureDataObject } from "./pureDataObject.js";
7
+ import { type DataObjectTypes } from "./types.js";
8
8
  /**
9
9
  * DataObject is a base data store that is primed with a root directory. It
10
10
  * ensures that it is created and ready before you can access it.
@@ -35,4 +35,4 @@ export declare abstract class DataObject<I extends DataObjectTypes = DataObjectT
35
35
  */
36
36
  protected getUninitializedErrorString(item: string): string;
37
37
  }
38
- //# sourceMappingURL=dataObject.d.mts.map
38
+ //# sourceMappingURL=dataObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataObject.d.ts","sourceRoot":"","sources":["../../src/data-objects/dataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,gBAAgB,EAA+B,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;GAUG;AACH,8BAAsB,UAAU,CAC/B,CAAC,SAAS,eAAe,GAAG,eAAe,CAC1C,SAAQ,cAAc,CAAC,CAAC,CAAC;IAC1B,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;IAE1C;;;OAGG;IACH,SAAS,KAAK,IAAI,IAAI,gBAAgB,CAMrC;IAED;;;OAGG;IACU,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BjE;;;OAGG;IACH,SAAS,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAG3D"}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { MapFactory, SharedDirectory } from "@fluidframework/map";
6
- import { PureDataObject } from "./pureDataObject.mjs";
6
+ import { PureDataObject } from "./pureDataObject.js";
7
7
  /**
8
8
  * DataObject is a base data store that is primed with a root directory. It
9
9
  * ensures that it is created and ready before you can access it.
@@ -64,4 +64,4 @@ export class DataObject extends PureDataObject {
64
64
  return `${item} must be initialized before being accessed.`;
65
65
  }
66
66
  }
67
- //# sourceMappingURL=dataObject.mjs.map
67
+ //# sourceMappingURL=dataObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataObject.js","sourceRoot":"","sources":["../../src/data-objects/dataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAyB,UAAU,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;;;;;;;;;;GAUG;AACH,MAAM,OAAgB,UAEpB,SAAQ,cAAiB;IAF3B;;QAIkB,oBAAe,GAAG,MAAM,CAAC;IAoD3C,CAAC;IAlDA;;;OAGG;IACH,IAAc,IAAI;QACjB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,CAAC;SAC1D;QAED,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,kBAAkB,CAAC,QAAiB;QAChD,IAAI,QAAQ,EAAE;YACb,oGAAoG;YACpG,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,CACjD,IAAI,CAAC,eAAe,CACpB,CAAqB,CAAC;YAEvB,oGAAoG;YACpG,gGAAgG;YAChG,qGAAqG;YACrG,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,IAAI,EAAE;gBAC1D,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;oBACxB,QAAQ,EAAE,SAAS;oBACnB,SAAS,EAAE,eAAe;oBAC1B,OAAO,EACN,6EAA6E;iBAC9E,CAAC,CAAC;aACH;SACD;aAAM;YACN,+EAA+E;YAC/E,IAAI,CAAC,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;YAC/E,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC;SAClC;QAED,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED;;;OAGG;IACO,2BAA2B,CAAC,IAAY;QACjD,OAAO,GAAG,IAAI,6CAA6C,CAAC;IAC7D,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type ISharedDirectory, MapFactory, SharedDirectory } from \"@fluidframework/map\";\nimport { PureDataObject } from \"./pureDataObject.js\";\nimport { type DataObjectTypes } from \"./types.js\";\n\n/**\n * DataObject is a base data store that is primed with a root directory. It\n * ensures that it is created and ready before you can access it.\n *\n * Having a single root directory allows for easier development. Instead of creating\n * and registering channels with the runtime any new DDS that is set on the root\n * will automatically be registered.\n *\n * @typeParam I - The optional input types used to strongly type the data object\n * @alpha\n */\nexport abstract class DataObject<\n\tI extends DataObjectTypes = DataObjectTypes,\n> extends PureDataObject<I> {\n\tprivate internalRoot: ISharedDirectory | undefined;\n\tprivate readonly rootDirectoryId = \"root\";\n\n\t/**\n\t * The root directory will either be ready or will return an error. If an error is thrown\n\t * the root has not been correctly created/set.\n\t */\n\tprotected get root(): ISharedDirectory {\n\t\tif (!this.internalRoot) {\n\t\t\tthrow new Error(this.getUninitializedErrorString(`root`));\n\t\t}\n\n\t\treturn this.internalRoot;\n\t}\n\n\t/**\n\t * Initializes internal objects and calls initialization overrides.\n\t * Caller is responsible for ensuring this is only invoked once.\n\t */\n\tpublic async initializeInternal(existing: boolean): Promise<void> {\n\t\tif (existing) {\n\t\t\t// data store has a root directory so we just need to set it before calling initializingFromExisting\n\t\t\tthis.internalRoot = (await this.runtime.getChannel(\n\t\t\t\tthis.rootDirectoryId,\n\t\t\t)) as ISharedDirectory;\n\n\t\t\t// This will actually be an ISharedMap if the channel was previously created by the older version of\n\t\t\t// DataObject which used a SharedMap. Since SharedMap and SharedDirectory are compatible unless\n\t\t\t// SharedDirectory-only commands are used on SharedMap, this will mostly just work for compatibility.\n\t\t\tif (this.internalRoot.attributes.type === MapFactory.Type) {\n\t\t\t\tthis.runtime.logger.send({\n\t\t\t\t\tcategory: \"generic\",\n\t\t\t\t\teventName: \"MapDataObject\",\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t\"Legacy document, SharedMap is masquerading as SharedDirectory in DataObject\",\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\t// Create a root directory and register it before calling initializingFirstTime\n\t\t\tthis.internalRoot = SharedDirectory.create(this.runtime, this.rootDirectoryId);\n\t\t\tthis.internalRoot.bindToContext();\n\t\t}\n\n\t\tawait super.initializeInternal(existing);\n\t}\n\n\t/**\n\t * Generates an error string indicating an item is uninitialized.\n\t * @param item - The name of the item that was uninitialized.\n\t */\n\tprotected getUninitializedErrorString(item: string): string {\n\t\treturn `${item} must be initialized before being accessed.`;\n\t}\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { DataObject } from "./dataObject.mjs";
6
- export { PureDataObject } from "./pureDataObject.mjs";
7
- export type { DataObjectTypes, IDataObjectProps } from "./types.mjs";
8
- //# sourceMappingURL=index.d.mts.map
5
+ export { DataObject } from "./dataObject.js";
6
+ export { PureDataObject } from "./pureDataObject.js";
7
+ export type { DataObjectTypes, IDataObjectProps } from "./types.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data-objects/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export { DataObject } from "./dataObject.js";
6
+ export { PureDataObject } from "./pureDataObject.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/data-objects/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { DataObject } from \"./dataObject.js\";\nexport { PureDataObject } from \"./pureDataObject.js\";\nexport type { DataObjectTypes, IDataObjectProps } from \"./types.js\";\n"]}
@@ -7,7 +7,7 @@ import { type IEvent, type IFluidHandle, type IFluidLoadable, type IProvideFluid
7
7
  import { type IFluidDataStoreRuntime } from "@fluidframework/datastore-definitions";
8
8
  import { type IFluidDataStoreContext } from "@fluidframework/runtime-definitions";
9
9
  import { type AsyncFluidObjectProvider } from "@fluidframework/synthesize";
10
- import { type DataObjectTypes, type IDataObjectProps } from "./types.mjs";
10
+ import { type DataObjectTypes, type IDataObjectProps } from "./types.js";
11
11
  /**
12
12
  * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.
13
13
  * You probably don't want to inherit from this data store directly unless
@@ -97,4 +97,4 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
97
97
  */
98
98
  protected hasInitialized(): Promise<void>;
99
99
  }
100
- //# sourceMappingURL=pureDataObject.d.mts.map
100
+ //# sourceMappingURL=pureDataObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"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AAI,YAAY,CAAC,IAAI,CAAC,CAE5C;IAED;;OAEG;IACH,IAAW,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAMtC;WAEmB,aAAa,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC;gBAKxE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAkB7C;;;;;;;OAOG;IACU,OAAO,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;IAMvD;;;;;;OAMG;IACU,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnE;;;;;;OAMG;IACU,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBjE;;;OAGG;cACa,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9C;;;;;OAKG;cACa,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAE/E;;;OAGG;cACa,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAEzD;;OAEG;cACa,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;CAC/C"}
@@ -123,4 +123,4 @@ export class PureDataObject extends TypedEventEmitter {
123
123
  */
124
124
  async hasInitialized() { }
125
125
  }
126
- //# sourceMappingURL=pureDataObject.mjs.map
126
+ //# sourceMappingURL=pureDataObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pureDataObject.js","sourceRoot":"","sources":["../../src/data-objects/pureDataObject.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAYpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE;;;;;;;GAOG;AACH,MAAM,OAAgB,cACrB,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,GAAG,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;YACnE,CAAC,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE;YACxD,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,oBAAoB,CAAC,QAAiB;QAClD,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE;YACnC,OAAO,IAAI,CAAC,WAAW,CAAC;SACxB;QACD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,kBAAkB,CAAC,QAAiB;QAChD,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;QAC3B,IAAI,QAAQ,EAAE;YACb,MAAM,CACL,IAAI,CAAC,SAAS,KAAK,SAAS,EAC5B,KAAK,CAAC,kEAAkE,CACxE,CAAC;YACF,MAAM,IAAI,CAAC,wBAAwB,EAAE,CAAC;SACtC;aAAM;YACN,MAAM,IAAI,CAAC,qBAAqB,CAC9B,IAAI,CAAC,OAAO,CAAC,WAAiC,IAAI,IAAI,CAAC,SAAS,CACjE,CAAC;SACF;QACD,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,aAAa,KAAmB,CAAC;IAEjD;;;;;OAKG;IACO,KAAK,CAAC,qBAAqB,CAAC,KAAyB,IAAkB,CAAC;IAElF;;;OAGG;IACO,KAAK,CAAC,wBAAwB,KAAmB,CAAC;IAE5D;;OAEG;IACO,KAAK,CAAC,cAAc,KAAmB,CAAC;CAClD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\ttype IEvent,\n\ttype IFluidHandle,\n\ttype IFluidLoadable,\n\ttype IProvideFluidHandle,\n\ttype IRequest,\n\ttype IResponse,\n} from \"@fluidframework/core-interfaces\";\nimport { type IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\nimport { type IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { type AsyncFluidObjectProvider } from \"@fluidframework/synthesize\";\nimport { create404Response } from \"@fluidframework/runtime-utils\";\nimport { type DataObjectTypes, type 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 * 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 * @alpha\n */\nexport abstract class PureDataObject<I extends DataObjectTypes = DataObjectTypes>\n\textends TypedEventEmitter<I[\"Events\"] & IEvent>\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 ContainerRuntime\n\t */\n\tprotected readonly context: IFluidDataStoreContext;\n\n\t/**\n\t * Providers are FluidObject keyed objects that provide back\n\t * a promise to the corresponding FluidObject or undefined.\n\t * Providers injected/provided by the Container and/or HostingApplication\n\t *\n\t * To define providers set FluidObject interfaces in the OptionalProviders generic type for your data store\n\t */\n\tprotected readonly providers: AsyncFluidObjectProvider<I[\"OptionalProviders\"]>;\n\n\tprotected initProps?: I[\"InitialState\"];\n\n\tprotected initializeP: Promise<void> | undefined;\n\n\tpublic get id(): 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(): IFluidHandle<this> {\n\t\treturn this.handle;\n\t}\n\n\t/**\n\t * Handle to a data store\n\t */\n\tpublic get handle(): IFluidHandle<this> {\n\t\t// PureDataObjectFactory already provides an entryPoint initialization function to the data store runtime,\n\t\t// so this object should always have access to a non-null entryPoint. Need to cast because PureDataObject\n\t\t// tried to be too smart with its typing for handles :).\n\t\tassert(this.runtime.entryPoint !== undefined, 0x46b /* EntryPoint was undefined */);\n\t\treturn this.runtime.entryPoint as IFluidHandle<this>;\n\t}\n\n\tpublic static async getDataObject(runtime: IFluidDataStoreRuntime): 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\n\t\t/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\t\t/* eslint-disable @typescript-eslint/no-explicit-any */\n\t\tassert(\n\t\t\t(this.runtime as any)._dataObject === undefined,\n\t\t\t0x0bd /* \"Object runtime already has DataObject!\" */,\n\t\t);\n\t\t(this.runtime as any)._dataObject = this;\n\t\t/* eslint-enable @typescript-eslint/no-explicit-any */\n\t\t/* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\t}\n\n\t/**\n\t * Return this object if someone requests it directly\n\t * We will return this object in two scenarios:\n\t *\n\t * 1. the request url is a \"/\"\n\t *\n\t * 2. the request url is empty\n\t */\n\tpublic async request(req: IRequest): Promise<IResponse> {\n\t\treturn req.url === \"\" || req.url === \"/\" || req.url.startsWith(\"/?\")\n\t\t\t? { mimeType: \"fluid/object\", status: 200, value: this }\n\t\t\t: create404Response(req);\n\t}\n\n\t/**\n\t * Call this API to ensure PureDataObject is fully initialized.\n\t * Initialization happens on demand, only on as-needed bases.\n\t * In most cases you should allow factory/object to decide when to finish initialization.\n\t * But if you are supplying your own implementation of DataStoreRuntime factory and overriding some methods\n\t * and need a fully initialized object, then you can call this API to ensure object is fully initialized.\n\t */\n\tpublic async finishInitialization(existing: boolean): Promise<void> {\n\t\tif (this.initializeP !== undefined) {\n\t\t\treturn this.initializeP;\n\t\t}\n\t\tthis.initializeP = this.initializeInternal(existing);\n\t\treturn this.initializeP;\n\t}\n\n\t/**\n\t * Internal initialize implementation. Overwriting this will change the flow of the PureDataObject and should\n\t * generally not be done.\n\t *\n\t * Calls initializingFirstTime, initializingFromExisting, and hasInitialized. Caller is\n\t * responsible for ensuring this is only invoked once.\n\t */\n\tpublic async initializeInternal(existing: boolean): Promise<void> {\n\t\tawait this.preInitialize();\n\t\tif (existing) {\n\t\t\tassert(\n\t\t\t\tthis.initProps === undefined,\n\t\t\t\t0x0be /* \"Trying to initialize from existing while initProps is set!\" */,\n\t\t\t);\n\t\t\tawait this.initializingFromExisting();\n\t\t} else {\n\t\t\tawait this.initializingFirstTime(\n\t\t\t\t(this.context.createProps as I[\"InitialState\"]) ?? this.initProps,\n\t\t\t);\n\t\t}\n\t\tawait this.hasInitialized();\n\t}\n\n\t/**\n\t * Called every time the data store is initialized, before initializingFirstTime or\n\t * initializingFromExisting is called.\n\t */\n\tprotected async preInitialize(): Promise<void> {}\n\n\t/**\n\t * Called the first time the data store is initialized (new creations with a new\n\t * data store runtime)\n\t *\n\t * @param props - Optional props to be passed in on create\n\t */\n\tprotected async initializingFirstTime(props?: I[\"InitialState\"]): Promise<void> {}\n\n\t/**\n\t * Called every time but the first time the data store is initialized (creations\n\t * with an existing data store runtime)\n\t */\n\tprotected async initializingFromExisting(): Promise<void> {}\n\n\t/**\n\t * Called every time the data store is initialized after create or existing.\n\t */\n\tprotected async hasInitialized(): Promise<void> {}\n}\n"]}
@@ -33,4 +33,4 @@ export interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {
33
33
  readonly providers: AsyncFluidObjectProvider<I["OptionalProviders"]>;
34
34
  readonly initProps?: I["InitialState"];
35
35
  }
36
- //# sourceMappingURL=types.d.mts.map
36
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/data-objects/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,uCAAuC,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"}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=types.mjs.map
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +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 IEvent, type FluidObject } from \"@fluidframework/core-interfaces\";\nimport { type AsyncFluidObjectProvider } from \"@fluidframework/synthesize\";\nimport { type IFluidDataStoreContext } from \"@fluidframework/runtime-definitions\";\nimport { type IFluidDataStoreRuntime } from \"@fluidframework/datastore-definitions\";\n\n/**\n * This type is used as the base generic input to DataObject and PureDataObject.\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 * @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"]}
package/lib/index.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * The `aqueduct` package is a library for building Fluid objects and Fluid
7
+ * containers within the Fluid Framework. Its goal is to provide a thin base
8
+ * layer over the existing Fluid Framework interfaces that allows developers to
9
+ * get started quickly.
10
+ *
11
+ * @remarks
12
+ * About the library name: An "aqueduct" is a way to transport water from a source
13
+ * to another location. The library name was chosen because its purpose is to
14
+ * facilitate using lower level constructs and therefore handle 'fluid' items
15
+ * same as an aqueduct.
16
+ *
17
+ * @packageDocumentation
18
+ */
19
+ export { DataObjectFactory, PureDataObjectFactory } from "./data-object-factories/index.js";
20
+ export { DataObject, type DataObjectTypes, type IDataObjectProps, PureDataObject, } from "./data-objects/index.js";
21
+ export { BaseContainerRuntimeFactory, type BaseContainerRuntimeFactoryProps, ContainerRuntimeFactoryWithDefaultDataStore, type ContainerRuntimeFactoryWithDefaultDataStoreProps, } from "./container-runtime-factories/index.js";
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EACN,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,cAAc,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,2BAA2B,EAC3B,KAAK,gCAAgC,EACrC,2CAA2C,EAC3C,KAAK,gDAAgD,GACrD,MAAM,wCAAwC,CAAC"}
package/lib/index.js ADDED
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * The `aqueduct` package is a library for building Fluid objects and Fluid
7
+ * containers within the Fluid Framework. Its goal is to provide a thin base
8
+ * layer over the existing Fluid Framework interfaces that allows developers to
9
+ * get started quickly.
10
+ *
11
+ * @remarks
12
+ * About the library name: An "aqueduct" is a way to transport water from a source
13
+ * to another location. The library name was chosen because its purpose is to
14
+ * facilitate using lower level constructs and therefore handle 'fluid' items
15
+ * same as an aqueduct.
16
+ *
17
+ * @packageDocumentation
18
+ */
19
+ export { DataObjectFactory, PureDataObjectFactory } from "./data-object-factories/index.js";
20
+ export { DataObject, PureDataObject, } from "./data-objects/index.js";
21
+ export { BaseContainerRuntimeFactory, ContainerRuntimeFactoryWithDefaultDataStore, } from "./container-runtime-factories/index.js";
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EACN,UAAU,EAGV,cAAc,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,2BAA2B,EAE3B,2CAA2C,GAE3C,MAAM,wCAAwC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The `aqueduct` package is a library for building Fluid objects and Fluid\n * containers within the Fluid Framework. Its goal is to provide a thin base\n * layer over the existing Fluid Framework interfaces that allows developers to\n * get started quickly.\n *\n * @remarks\n * About the library name: An \"aqueduct\" is a way to transport water from a source\n * to another location. The library name was chosen because its purpose is to\n * facilitate using lower level constructs and therefore handle 'fluid' items\n * same as an aqueduct.\n *\n * @packageDocumentation\n */\n\nexport { DataObjectFactory, PureDataObjectFactory } from \"./data-object-factories/index.js\";\nexport {\n\tDataObject,\n\ttype DataObjectTypes,\n\ttype IDataObjectProps,\n\tPureDataObject,\n} from \"./data-objects/index.js\";\nexport {\n\tBaseContainerRuntimeFactory,\n\ttype BaseContainerRuntimeFactoryProps,\n\tContainerRuntimeFactoryWithDefaultDataStore,\n\ttype ContainerRuntimeFactoryWithDefaultDataStoreProps,\n} from \"./container-runtime-factories/index.js\";\n"]}
@@ -0,0 +1,8 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ // Build pipeline breaks without this file ("No test files found")
6
+ describe("aqueduct-placeholder", () => { });
7
+ export {};
8
+ //# sourceMappingURL=aqueduct.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aqueduct.spec.js","sourceRoot":"","sources":["../../src/test/aqueduct.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kEAAkE;AAClE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Build pipeline breaks without this file (\"No test files found\")\ndescribe(\"aqueduct-placeholder\", () => {});\n"]}