@fluidframework/aqueduct 2.0.0-rc.1.0.6 → 2.0.0-rc.2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/aqueduct-alpha.d.ts +116 -48
  2. package/dist/aqueduct-beta.d.ts +10 -0
  3. package/dist/aqueduct-public.d.ts +10 -0
  4. package/dist/aqueduct-untrimmed.d.ts +116 -48
  5. package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts +39 -23
  6. package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -1
  7. package/dist/container-runtime-factories/baseContainerRuntimeFactory.js +3 -8
  8. package/dist/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -1
  9. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +37 -25
  10. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
  11. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js +4 -13
  12. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  13. package/dist/container-runtime-factories/index.d.ts +2 -2
  14. package/dist/container-runtime-factories/index.d.ts.map +1 -1
  15. package/dist/container-runtime-factories/index.js +4 -4
  16. package/dist/container-runtime-factories/index.js.map +1 -1
  17. package/dist/data-object-factories/dataObjectFactory.d.ts +6 -6
  18. package/dist/data-object-factories/dataObjectFactory.d.ts.map +1 -1
  19. package/dist/data-object-factories/dataObjectFactory.js +4 -4
  20. package/dist/data-object-factories/dataObjectFactory.js.map +1 -1
  21. package/dist/data-object-factories/index.d.ts +2 -2
  22. package/dist/data-object-factories/index.d.ts.map +1 -1
  23. package/dist/data-object-factories/index.js +4 -4
  24. package/dist/data-object-factories/index.js.map +1 -1
  25. package/dist/data-object-factories/pureDataObjectFactory.d.ts +44 -14
  26. package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
  27. package/dist/data-object-factories/pureDataObjectFactory.js +56 -14
  28. package/dist/data-object-factories/pureDataObjectFactory.js.map +1 -1
  29. package/dist/data-objects/dataObject.d.ts +3 -3
  30. package/dist/data-objects/dataObject.d.ts.map +1 -1
  31. package/dist/data-objects/dataObject.js +8 -8
  32. package/dist/data-objects/dataObject.js.map +1 -1
  33. package/dist/data-objects/index.d.ts +3 -3
  34. package/dist/data-objects/index.d.ts.map +1 -1
  35. package/dist/data-objects/index.js +4 -4
  36. package/dist/data-objects/index.js.map +1 -1
  37. package/dist/data-objects/pureDataObject.d.ts +12 -6
  38. package/dist/data-objects/pureDataObject.d.ts.map +1 -1
  39. package/dist/data-objects/pureDataObject.js +10 -0
  40. package/dist/data-objects/pureDataObject.js.map +1 -1
  41. package/dist/data-objects/types.d.ts +7 -7
  42. package/dist/data-objects/types.d.ts.map +1 -1
  43. package/dist/data-objects/types.js.map +1 -1
  44. package/dist/index.d.ts +3 -3
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +9 -9
  47. package/dist/index.js.map +1 -1
  48. package/dist/package.json +3 -0
  49. package/dist/tsdoc-metadata.json +1 -1
  50. package/lib/{aqueduct-alpha.d.mts → aqueduct-alpha.d.ts} +131 -48
  51. package/lib/{aqueduct-beta.d.mts → aqueduct-beta.d.ts} +25 -0
  52. package/lib/{aqueduct-public.d.mts → aqueduct-public.d.ts} +25 -0
  53. package/lib/{aqueduct-untrimmed.d.mts → aqueduct-untrimmed.d.ts} +131 -48
  54. package/lib/container-runtime-factories/{baseContainerRuntimeFactory.d.mts → baseContainerRuntimeFactory.d.ts} +40 -24
  55. package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -0
  56. package/lib/container-runtime-factories/{baseContainerRuntimeFactory.mjs → baseContainerRuntimeFactory.js} +6 -10
  57. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +1 -0
  58. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +57 -0
  59. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -0
  60. package/lib/container-runtime-factories/{containerRuntimeFactoryWithDefaultDataStore.mjs → containerRuntimeFactoryWithDefaultDataStore.js} +4 -13
  61. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +1 -0
  62. package/lib/container-runtime-factories/index.d.ts +7 -0
  63. package/lib/container-runtime-factories/index.d.ts.map +1 -0
  64. package/lib/container-runtime-factories/index.js +7 -0
  65. package/lib/container-runtime-factories/index.js.map +1 -0
  66. package/lib/data-object-factories/dataObjectFactory.d.ts +23 -0
  67. package/lib/data-object-factories/dataObjectFactory.d.ts.map +1 -0
  68. package/lib/data-object-factories/{dataObjectFactory.mjs → dataObjectFactory.js} +4 -4
  69. package/lib/data-object-factories/dataObjectFactory.js.map +1 -0
  70. package/lib/data-object-factories/index.d.ts +7 -0
  71. package/lib/data-object-factories/index.d.ts.map +1 -0
  72. package/lib/data-object-factories/index.js +7 -0
  73. package/lib/data-object-factories/index.js.map +1 -0
  74. package/lib/data-object-factories/{pureDataObjectFactory.d.mts → pureDataObjectFactory.d.ts} +45 -15
  75. package/lib/data-object-factories/pureDataObjectFactory.d.ts.map +1 -0
  76. package/lib/data-object-factories/{pureDataObjectFactory.mjs → pureDataObjectFactory.js} +57 -15
  77. package/lib/data-object-factories/pureDataObjectFactory.js.map +1 -0
  78. package/lib/data-objects/{dataObject.d.mts → dataObject.d.ts} +4 -4
  79. package/lib/data-objects/dataObject.d.ts.map +1 -0
  80. package/lib/data-objects/{dataObject.mjs → dataObject.js} +8 -8
  81. package/lib/data-objects/dataObject.js.map +1 -0
  82. package/lib/data-objects/index.d.ts +8 -0
  83. package/lib/data-objects/index.d.ts.map +1 -0
  84. package/lib/data-objects/index.js +7 -0
  85. package/lib/data-objects/index.js.map +1 -0
  86. package/lib/data-objects/{pureDataObject.d.mts → pureDataObject.d.ts} +13 -7
  87. package/lib/data-objects/pureDataObject.d.ts.map +1 -0
  88. package/lib/data-objects/{pureDataObject.mjs → pureDataObject.js} +11 -1
  89. package/lib/data-objects/pureDataObject.js.map +1 -0
  90. package/lib/data-objects/{types.d.mts → types.d.ts} +8 -8
  91. package/lib/data-objects/types.d.ts.map +1 -0
  92. package/lib/data-objects/{types.mjs → types.js} +1 -1
  93. package/lib/data-objects/types.js.map +1 -0
  94. package/lib/index.d.ts +22 -0
  95. package/lib/index.d.ts.map +1 -0
  96. package/lib/index.js +22 -0
  97. package/lib/index.js.map +1 -0
  98. package/lib/test/aqueduct.spec.js +8 -0
  99. package/lib/test/aqueduct.spec.js.map +1 -0
  100. package/lib/test/tsconfig.tsbuildinfo +1 -0
  101. package/lib/test/types/validateAqueductPrevious.generated.js +24 -0
  102. package/lib/test/types/validateAqueductPrevious.generated.js.map +1 -0
  103. package/package.json +54 -54
  104. package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.mts.map +0 -1
  105. package/lib/container-runtime-factories/baseContainerRuntimeFactory.mjs.map +0 -1
  106. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.mts +0 -45
  107. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.mts.map +0 -1
  108. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.mjs.map +0 -1
  109. package/lib/container-runtime-factories/index.d.mts +0 -7
  110. package/lib/container-runtime-factories/index.d.mts.map +0 -1
  111. package/lib/container-runtime-factories/index.mjs +0 -7
  112. package/lib/container-runtime-factories/index.mjs.map +0 -1
  113. package/lib/data-object-factories/dataObjectFactory.d.mts +0 -23
  114. package/lib/data-object-factories/dataObjectFactory.d.mts.map +0 -1
  115. package/lib/data-object-factories/dataObjectFactory.mjs.map +0 -1
  116. package/lib/data-object-factories/index.d.mts +0 -7
  117. package/lib/data-object-factories/index.d.mts.map +0 -1
  118. package/lib/data-object-factories/index.mjs +0 -7
  119. package/lib/data-object-factories/index.mjs.map +0 -1
  120. package/lib/data-object-factories/pureDataObjectFactory.d.mts.map +0 -1
  121. package/lib/data-object-factories/pureDataObjectFactory.mjs.map +0 -1
  122. package/lib/data-objects/dataObject.d.mts.map +0 -1
  123. package/lib/data-objects/dataObject.mjs.map +0 -1
  124. package/lib/data-objects/index.d.mts +0 -8
  125. package/lib/data-objects/index.d.mts.map +0 -1
  126. package/lib/data-objects/index.mjs +0 -7
  127. package/lib/data-objects/index.mjs.map +0 -1
  128. package/lib/data-objects/pureDataObject.d.mts.map +0 -1
  129. package/lib/data-objects/pureDataObject.mjs.map +0 -1
  130. package/lib/data-objects/types.d.mts.map +0 -1
  131. package/lib/data-objects/types.mjs.map +0 -1
  132. package/lib/index.d.mts +0 -8
  133. package/lib/index.d.mts.map +0 -1
  134. package/lib/index.mjs +0 -8
  135. package/lib/index.mjs.map +0 -1
@@ -23,7 +23,9 @@ import { IContainerContext } from '@fluidframework/container-definitions';
23
23
  import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
24
24
  import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
25
25
  import { IContainerRuntimeOptions } from '@fluidframework/container-runtime';
26
+ import { IDataStore } from '@fluidframework/runtime-definitions';
26
27
  import { IEvent } from '@fluidframework/core-interfaces';
28
+ import { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions';
27
29
  import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions';
28
30
  import { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definitions';
29
31
  import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
@@ -50,6 +52,9 @@ import { TypedEventEmitter } from '@fluid-internal/client-utils';
50
52
  * @alpha
51
53
  */
52
54
  export declare class BaseContainerRuntimeFactory extends RuntimeFactoryHelper implements IProvideFluidDataStoreRegistry {
55
+ /**
56
+ * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreRegistry.IFluidDataStoreRegistry}
57
+ */
53
58
  get IFluidDataStoreRegistry(): IFluidDataStoreRegistry;
54
59
  private readonly registry;
55
60
  private readonly registryEntries;
@@ -57,22 +62,7 @@ export declare class BaseContainerRuntimeFactory extends RuntimeFactoryHelper im
57
62
  private readonly runtimeOptions?;
58
63
  private readonly requestHandlers;
59
64
  private readonly provideEntryPoint;
60
- /**
61
- * @param registryEntries - The data store registry for containers produced
62
- * @param dependencyContainer - deprecated, will be removed in a future release
63
- * @param requestHandlers - Request handlers for containers produced
64
- * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it
65
- * @param provideEntryPoint - Function that will initialize the entryPoint of the ContainerRuntime instances
66
- * created with this factory
67
- */
68
- constructor(props: {
69
- registryEntries: NamedFluidDataStoreRegistryEntries;
70
- dependencyContainer?: IFluidDependencySynthesizer;
71
- /** @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 */
72
- requestHandlers?: RuntimeRequestHandler[];
73
- runtimeOptions?: IContainerRuntimeOptions;
74
- provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;
75
- });
65
+ constructor(props: BaseContainerRuntimeFactoryProps);
76
66
  instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
77
67
  instantiateFromExisting(runtime: ContainerRuntime): Promise<void>;
78
68
  preInitialize(context: IContainerContext, existing: boolean): Promise<ContainerRuntime>;
@@ -90,6 +80,35 @@ export declare class BaseContainerRuntimeFactory extends RuntimeFactoryHelper im
90
80
  protected containerHasInitialized(runtime: IContainerRuntime): Promise<void>;
91
81
  }
92
82
 
83
+ /**
84
+ * {@link BaseContainerRuntimeFactory} construction properties.
85
+ * @alpha
86
+ */
87
+ export declare interface BaseContainerRuntimeFactoryProps {
88
+ /**
89
+ * The data store registry for containers produced.
90
+ */
91
+ registryEntries: NamedFluidDataStoreRegistryEntries;
92
+ /**
93
+ * @deprecated Will be removed in a future release.
94
+ */
95
+ dependencyContainer?: IFluidDependencySynthesizer;
96
+ /**
97
+ * Request handlers for containers produced.
98
+ * @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
99
+ */
100
+ requestHandlers?: RuntimeRequestHandler[];
101
+ /**
102
+ * The runtime options passed to the ContainerRuntime when instantiating it
103
+ */
104
+ runtimeOptions?: IContainerRuntimeOptions;
105
+ /**
106
+ * Function that will initialize the entryPoint of the ContainerRuntime instances
107
+ * created with this factory
108
+ */
109
+ provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;
110
+ }
111
+
93
112
  /**
94
113
  * A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from
95
114
  * the container with an empty URL.
@@ -100,30 +119,43 @@ export declare class BaseContainerRuntimeFactory extends RuntimeFactoryHelper im
100
119
  export declare class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {
101
120
  static readonly defaultDataStoreId = "default";
102
121
  protected readonly defaultFactory: IFluidDataStoreFactory;
103
- /**
104
- * Constructor
105
- * @param defaultFactory -
106
- * @param registryEntries -
107
- * @param dependencyContainer - deprecated, will be removed in a future release
108
- * @param requestHandlers -
109
- * @param runtimeOptions -
110
- * @param provideEntryPoint -
111
- */
112
- constructor(props: {
113
- defaultFactory: IFluidDataStoreFactory;
114
- registryEntries: NamedFluidDataStoreRegistryEntries;
115
- dependencyContainer?: IFluidDependencySynthesizer;
116
- /** @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 */
117
- requestHandlers?: RuntimeRequestHandler[];
118
- runtimeOptions?: IContainerRuntimeOptions;
119
- provideEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>;
120
- });
122
+ constructor(props: ContainerRuntimeFactoryWithDefaultDataStoreProps);
121
123
  /**
122
124
  * {@inheritDoc BaseContainerRuntimeFactory.containerInitializingFirstTime}
123
125
  */
124
126
  protected containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void>;
125
127
  }
126
128
 
129
+ /**
130
+ * {@link ContainerRuntimeFactoryWithDefaultDataStore} construction properties.
131
+ * @alpha
132
+ */
133
+ export declare interface ContainerRuntimeFactoryWithDefaultDataStoreProps {
134
+ defaultFactory: IFluidDataStoreFactory;
135
+ /**
136
+ * The data store registry for containers produced.
137
+ */
138
+ registryEntries: NamedFluidDataStoreRegistryEntries;
139
+ /**
140
+ * @deprecated Will be removed in a future release.
141
+ */
142
+ dependencyContainer?: IFluidDependencySynthesizer;
143
+ /**
144
+ * Request handlers for containers produced.
145
+ * @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
146
+ */
147
+ requestHandlers?: RuntimeRequestHandler[];
148
+ /**
149
+ * The runtime options passed to the ContainerRuntime when instantiating it
150
+ */
151
+ runtimeOptions?: IContainerRuntimeOptions;
152
+ /**
153
+ * Function that will initialize the entryPoint of the ContainerRuntime instances
154
+ * created with this factory
155
+ */
156
+ provideEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>;
157
+ }
158
+
127
159
  /**
128
160
  * DataObject is a base data store that is primed with a root directory. It
129
161
  * ensures that it is created and ready before you can access it.
@@ -165,7 +197,7 @@ export declare abstract class DataObject<I extends DataObjectTypes = DataObjectT
165
197
  * @alpha
166
198
  */
167
199
  export declare class DataObjectFactory<TObj extends DataObject<I>, I extends DataObjectTypes = DataObjectTypes> extends PureDataObjectFactory<TObj, I> {
168
- constructor(type: string, ctor: new (props: IDataObjectProps<I>) => TObj, sharedObjects: readonly IChannelFactory[] | undefined, optionalProviders: FluidObjectSymbolProvider<I["OptionalProviders"]>, registryEntries?: NamedFluidDataStoreRegistryEntries, runtimeFactory?: typeof FluidDataStoreRuntime);
200
+ constructor(type: string, ctor: new (props: IDataObjectProps<I>) => TObj, sharedObjects: readonly IChannelFactory<IFluidLoadable>[] | undefined, optionalProviders: FluidObjectSymbolProvider<I["OptionalProviders"]>, registryEntries?: NamedFluidDataStoreRegistryEntries, runtimeFactory?: typeof FluidDataStoreRuntime);
169
201
  }
170
202
 
171
203
  /**
@@ -174,15 +206,15 @@ export declare class DataObjectFactory<TObj extends DataObject<I>, I extends Dat
174
206
  */
175
207
  export declare interface DataObjectTypes {
176
208
  /**
177
- * represents a type that will define optional providers that will be injected
209
+ * Represents a type that will define optional providers that will be injected.
178
210
  */
179
211
  OptionalProviders?: FluidObject;
180
212
  /**
181
- * the initial state type that the produced data object may take during creation
213
+ * The initial state type that the produced data object may take during creation.
182
214
  */
183
215
  InitialState?: any;
184
216
  /**
185
- * represents events that will be available in the EventForwarder
217
+ * Represents events that will be available in the EventForwarder.
186
218
  */
187
219
  Events?: IEvent;
188
220
  }
@@ -225,13 +257,19 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
225
257
  protected initProps?: I["InitialState"];
226
258
  protected initializeP: Promise<void> | undefined;
227
259
  get id(): string;
260
+ /**
261
+ * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidLoadable.IFluidLoadable}
262
+ */
228
263
  get IFluidLoadable(): this;
264
+ /**
265
+ * {@inheritDoc @fluidframework/core-interfaces#IProvideFluidHandle.IFluidHandle}
266
+ */
229
267
  get IFluidHandle(): IFluidHandle<this>;
230
268
  /**
231
269
  * Handle to a data store
232
270
  */
233
271
  get handle(): IFluidHandle<this>;
234
- static getDataObject(runtime: IFluidDataStoreRuntime): Promise<PureDataObject<DataObjectTypes>>;
272
+ static getDataObject(runtime: IFluidDataStoreRuntime): Promise<PureDataObject>;
235
273
  constructor(props: IDataObjectProps<I>);
236
274
  /**
237
275
  * Return this object if someone requests it directly
@@ -291,14 +329,27 @@ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObj
291
329
  * @alpha
292
330
  */
293
331
  export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I extends DataObjectTypes = DataObjectTypes> implements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry> {
332
+ /**
333
+ * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory."type"}
334
+ */
294
335
  readonly type: string;
295
336
  private readonly ctor;
296
337
  private readonly optionalProviders;
297
338
  private readonly runtimeClass;
298
339
  private readonly sharedObjectRegistry;
299
340
  private readonly registry;
300
- constructor(type: string, ctor: new (props: IDataObjectProps<I>) => TObj, sharedObjects: readonly IChannelFactory[], optionalProviders: FluidObjectSymbolProvider<I["OptionalProviders"]>, registryEntries?: NamedFluidDataStoreRegistryEntries, runtimeClass?: typeof FluidDataStoreRuntime);
341
+ constructor(
342
+ /**
343
+ * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory."type"}
344
+ */
345
+ type: string, ctor: new (props: IDataObjectProps<I>) => TObj, sharedObjects: readonly IChannelFactory[], optionalProviders: FluidObjectSymbolProvider<I["OptionalProviders"]>, registryEntries?: NamedFluidDataStoreRegistryEntries, runtimeClass?: typeof FluidDataStoreRuntime);
346
+ /**
347
+ * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreFactory.IFluidDataStoreFactory}
348
+ */
301
349
  get IFluidDataStoreFactory(): this;
350
+ /**
351
+ * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreRegistry.IFluidDataStoreRegistry}
352
+ */
302
353
  get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined;
303
354
  /**
304
355
  * Convenience helper to get the data store's/factory's data store registry entry.
@@ -308,11 +359,9 @@ export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I ext
308
359
  */
309
360
  get registryEntry(): NamedFluidDataStoreRegistryEntry;
310
361
  /**
311
- * This is where we do data store setup.
312
- *
313
- * @param context - data store context used to load a data store runtime
362
+ * {@inheritDoc @fluidframework/runtime-definitions#IFluidDataStoreFactory.instantiateDataStore}
314
363
  */
315
- instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<FluidDataStoreRuntime>;
364
+ instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<IFluidDataStoreChannel>;
316
365
  /**
317
366
  * Creates a new instance of the object. Uses parent context's registry to build package path to this factory.
318
367
  * In other words, registry of context passed in has to contain this factory, with the name that matches
@@ -321,10 +370,11 @@ export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I ext
321
370
  * @param context - The context being used to create the runtime
322
371
  * (the created object will have its own new context created as well)
323
372
  * @param initialState - The initial state to provide to the created data store.
373
+ * @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
324
374
  * @returns an object created by this factory. Data store and objects created are not attached to container.
325
375
  * They get attached only when a handle to one of them is attached to already attached objects.
326
376
  */
327
- createChildInstance(parentContext: IFluidDataStoreContext, initialState?: I["InitialState"]): Promise<TObj>;
377
+ createChildInstance(parentContext: IFluidDataStoreContext, initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;
328
378
  /**
329
379
  * Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory.
330
380
  * In other words, registry of context passed in has to have this factory.
@@ -332,10 +382,11 @@ export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I ext
332
382
  * @param context - The component context being used to create the object
333
383
  * (the created object will have its own new context created as well)
334
384
  * @param initialState - The initial state to provide to the created component.
385
+ * @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
335
386
  * @returns an object created by this factory. Data store and objects created are not attached to container.
336
387
  * They get attached only when a handle to one of them is attached to already attached objects.
337
388
  */
338
- createPeerInstance(peerContext: IFluidDataStoreContext, initialState?: I["InitialState"]): Promise<TObj>;
389
+ createPeerInstance(peerContext: IFluidDataStoreContext, initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;
339
390
  /**
340
391
  * Creates a new instance of the object. Uses container's registry to find this factory.
341
392
  * It's expected that only container owners would use this functionality, as only such developers
@@ -343,10 +394,24 @@ export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I ext
343
394
  * The name in this registry for such record should match type of this factory.
344
395
  * @param runtime - container runtime. It's registry is used to create an object.
345
396
  * @param initialState - The initial state to provide to the created component.
397
+ * @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
346
398
  * @returns an object created by this factory. Data store and objects created are not attached to container.
347
399
  * They get attached only when a handle to one of them is attached to already attached objects.
348
400
  */
349
- createInstance(runtime: IContainerRuntimeBase, initialState?: I["InitialState"]): Promise<TObj>;
401
+ createInstance(runtime: IContainerRuntimeBase, initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;
402
+ /**
403
+ * Creates a new instance of the object with a datastore which exposes the aliasing api.
404
+ * @param runtime - container runtime. It is the runtime that will be used to create the object. It will produce
405
+ * the underlying infrastructure to get the data object to operate.
406
+ * @param initialState - The initial state to provide to the created component.
407
+ * @param packagePath - The path to the data store factory to use to create the data object.
408
+ * @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
409
+ * @returns an array containing the object created by this factory and an IDataStore object that enables users to
410
+ * alias the data object.
411
+ * The data object is attached only when it is attached to the handle graph that connects to an aliased object or
412
+ * when the data object is aliased.
413
+ */
414
+ createInstanceWithDataStore(containerRuntime: IContainerRuntimeBase, initialState?: I["InitialState"], packagePath?: Readonly<string[]>, loadingGroupId?: string): Promise<[TObj, IDataStore]>;
350
415
  /**
351
416
  * Creates a new root instance of the object. Uses container's registry to find this factory.
352
417
  * It's expected that only container owners would use this functionality, as only such developers
@@ -356,9 +421,12 @@ export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I ext
356
421
  * @param initialState - The initial state to provide to the created component.
357
422
  * @returns an object created by this factory. Data store and objects created are not attached to container.
358
423
  * They get attached only when a handle to one of them is attached to already attached objects.
424
+ *
425
+ * @deprecated - the issue is that it does not allow the customer to decide the conflict resolution policy when an
426
+ * aliasing conflict occurs. Use {@link PureDataObjectFactory.createInstanceWithDataStore} instead.
359
427
  */
360
428
  createRootInstance(rootDataStoreId: string, runtime: IContainerRuntime, initialState?: I["InitialState"]): Promise<TObj>;
361
- protected createNonRootInstanceCore(containerRuntime: IContainerRuntimeBase, packagePath: Readonly<string[]>, initialState?: I["InitialState"]): Promise<TObj>;
429
+ protected createNonRootInstanceCore(containerRuntime: IContainerRuntimeBase, packagePath: Readonly<string[]>, initialState?: I["InitialState"], loadingGroupId?: string): Promise<TObj>;
362
430
  protected createInstanceCore(context: IFluidDataStoreContextDetached, initialState?: I["InitialState"]): Promise<TObj>;
363
431
  }
364
432
 
@@ -2,14 +2,42 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IContainerContext } from "@fluidframework/container-definitions";
6
- import { IContainerRuntimeOptions, ContainerRuntime } from "@fluidframework/container-runtime";
7
- import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
8
- import { RuntimeRequestHandler } from "@fluidframework/request-handler";
9
- import { IFluidDataStoreRegistry, IProvideFluidDataStoreRegistry, NamedFluidDataStoreRegistryEntries } from "@fluidframework/runtime-definitions";
10
- import { IFluidDependencySynthesizer } from "@fluidframework/synthesize";
5
+ import { type IContainerContext } from "@fluidframework/container-definitions";
6
+ import { type IContainerRuntimeOptions, ContainerRuntime } from "@fluidframework/container-runtime";
7
+ import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions";
8
+ import { type RuntimeRequestHandler } from "@fluidframework/request-handler";
9
+ import { type IFluidDataStoreRegistry, type IProvideFluidDataStoreRegistry, type NamedFluidDataStoreRegistryEntries } from "@fluidframework/runtime-definitions";
10
+ import { type IFluidDependencySynthesizer } from "@fluidframework/synthesize";
11
11
  import { RuntimeFactoryHelper } from "@fluidframework/runtime-utils";
12
- import { FluidObject } from "@fluidframework/core-interfaces";
12
+ import { type FluidObject } from "@fluidframework/core-interfaces";
13
+ /**
14
+ * {@link BaseContainerRuntimeFactory} construction properties.
15
+ * @alpha
16
+ */
17
+ export interface BaseContainerRuntimeFactoryProps {
18
+ /**
19
+ * The data store registry for containers produced.
20
+ */
21
+ registryEntries: NamedFluidDataStoreRegistryEntries;
22
+ /**
23
+ * @deprecated Will be removed in a future release.
24
+ */
25
+ dependencyContainer?: IFluidDependencySynthesizer;
26
+ /**
27
+ * Request handlers for containers produced.
28
+ * @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
29
+ */
30
+ requestHandlers?: RuntimeRequestHandler[];
31
+ /**
32
+ * The runtime options passed to the ContainerRuntime when instantiating it
33
+ */
34
+ runtimeOptions?: IContainerRuntimeOptions;
35
+ /**
36
+ * Function that will initialize the entryPoint of the ContainerRuntime instances
37
+ * created with this factory
38
+ */
39
+ provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;
40
+ }
13
41
  /**
14
42
  * BaseContainerRuntimeFactory produces container runtimes with the specified data store and service registries,
15
43
  * request handlers, runtimeOptions, and entryPoint initialization function.
@@ -17,6 +45,9 @@ import { FluidObject } from "@fluidframework/core-interfaces";
17
45
  * @alpha
18
46
  */
19
47
  export declare class BaseContainerRuntimeFactory extends RuntimeFactoryHelper implements IProvideFluidDataStoreRegistry {
48
+ /**
49
+ * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreRegistry.IFluidDataStoreRegistry}
50
+ */
20
51
  get IFluidDataStoreRegistry(): IFluidDataStoreRegistry;
21
52
  private readonly registry;
22
53
  private readonly registryEntries;
@@ -24,22 +55,7 @@ export declare class BaseContainerRuntimeFactory extends RuntimeFactoryHelper im
24
55
  private readonly runtimeOptions?;
25
56
  private readonly requestHandlers;
26
57
  private readonly provideEntryPoint;
27
- /**
28
- * @param registryEntries - The data store registry for containers produced
29
- * @param dependencyContainer - deprecated, will be removed in a future release
30
- * @param requestHandlers - Request handlers for containers produced
31
- * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it
32
- * @param provideEntryPoint - Function that will initialize the entryPoint of the ContainerRuntime instances
33
- * created with this factory
34
- */
35
- constructor(props: {
36
- registryEntries: NamedFluidDataStoreRegistryEntries;
37
- dependencyContainer?: IFluidDependencySynthesizer;
38
- /** @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 */
39
- requestHandlers?: RuntimeRequestHandler[];
40
- runtimeOptions?: IContainerRuntimeOptions;
41
- provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;
42
- });
58
+ constructor(props: BaseContainerRuntimeFactoryProps);
43
59
  instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
44
60
  instantiateFromExisting(runtime: ContainerRuntime): Promise<void>;
45
61
  preInitialize(context: IContainerContext, existing: boolean): Promise<ContainerRuntime>;
@@ -1 +1 @@
1
- {"version":3,"file":"baseContainerRuntimeFactory.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EACN,wBAAwB,EAExB,gBAAgB,EAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,qBAAqB,EAA8B,MAAM,iCAAiC,CAAC;AACpG,OAAO,EACN,uBAAuB,EACvB,8BAA8B,EAC9B,kCAAkC,EAClC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEN,2BAA2B,EAE3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC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KAAK,EAAE,gCAAgC;IAW7C,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9D,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE,aAAa,CACzB,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GACf,OAAO,CAAC,gBAAgB,CAAC;IAsB5B;;;;OAIG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAEzF;;;;OAIG;cACa,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAClF"}
@@ -17,17 +17,12 @@ const runtime_utils_1 = require("@fluidframework/runtime-utils");
17
17
  * @alpha
18
18
  */
19
19
  class BaseContainerRuntimeFactory extends runtime_utils_1.RuntimeFactoryHelper {
20
+ /**
21
+ * {@inheritDoc @fluidframework/runtime-definitions#IProvideFluidDataStoreRegistry.IFluidDataStoreRegistry}
22
+ */
20
23
  get IFluidDataStoreRegistry() {
21
24
  return this.registry;
22
25
  }
23
- /**
24
- * @param registryEntries - The data store registry for containers produced
25
- * @param dependencyContainer - deprecated, will be removed in a future release
26
- * @param requestHandlers - Request handlers for containers produced
27
- * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it
28
- * @param provideEntryPoint - Function that will initialize the entryPoint of the ContainerRuntime instances
29
- * created with this factory
30
- */
31
26
  constructor(props) {
32
27
  super();
33
28
  this.registryEntries = props.registryEntries;
@@ -1 +1 @@
1
- {"version":3,"file":"baseContainerRuntimeFactory.js","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAI2C;AAE3C,gDAAgD;AAChD,qEAAoG;AAMpG,2DAIoC;AACpC,iEAAqE;AAGrE;;;;;GAKG;AACH,MAAa,2BACZ,SAAQ,oCAAoB;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,EAAE,KAAK;YACrB,gDAAgD;YAChD,cAAc,EAAE,IAAA,4CAA0B,EAAC,GAAG,IAAI,CAAC,eAAe,CAAC;YACnE,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SACzC,CAAC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,8BAA8B,CAAC,OAA0B,IAAG,CAAC;IAE7E;;;;OAIG;IACO,KAAK,CAAC,uBAAuB,CAAC,OAA0B,IAAG,CAAC;CACtE;AAxFD,kEAwFC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainerContext } from \"@fluidframework/container-definitions\";\nimport {\n\tIContainerRuntimeOptions,\n\tFluidDataStoreRegistry,\n\tContainerRuntime,\n} from \"@fluidframework/container-runtime\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\n// eslint-disable-next-line import/no-deprecated\nimport { RuntimeRequestHandler, buildRuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport {\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tDependencyContainer,\n\tIFluidDependencySynthesizer,\n\tIProvideFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\nimport { RuntimeFactoryHelper } from \"@fluidframework/runtime-utils\";\nimport { FluidObject } from \"@fluidframework/core-interfaces\";\n\n/**\n * BaseContainerRuntimeFactory produces container runtimes with the specified data store and service registries,\n * request handlers, runtimeOptions, and entryPoint initialization function.\n * It can be subclassed to implement a first-time initialization procedure for the containers it creates.\n * @alpha\n */\nexport class BaseContainerRuntimeFactory\n\textends RuntimeFactoryHelper\n\timplements IProvideFluidDataStoreRegistry\n{\n\tpublic get IFluidDataStoreRegistry() {\n\t\treturn this.registry;\n\t}\n\tprivate readonly registry: IFluidDataStoreRegistry;\n\n\tprivate readonly registryEntries: NamedFluidDataStoreRegistryEntries;\n\tprivate readonly dependencyContainer?: IFluidDependencySynthesizer;\n\tprivate readonly runtimeOptions?: IContainerRuntimeOptions;\n\tprivate readonly requestHandlers: RuntimeRequestHandler[];\n\tprivate readonly provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n\n\t/**\n\t * @param registryEntries - The data store registry for containers produced\n\t * @param dependencyContainer - deprecated, will be removed in a future release\n\t * @param requestHandlers - Request handlers for containers produced\n\t * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it\n\t * @param provideEntryPoint - Function that will initialize the entryPoint of the ContainerRuntime instances\n\t * created with this factory\n\t */\n\tconstructor(props: {\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries;\n\t\tdependencyContainer?: IFluidDependencySynthesizer;\n\t\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\trequestHandlers?: RuntimeRequestHandler[];\n\t\truntimeOptions?: IContainerRuntimeOptions;\n\t\tprovideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\n\t}) {\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}\n\n\tpublic async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n\t\tawait this.containerInitializingFirstTime(runtime);\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\tpublic async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\tpublic async preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<ContainerRuntime> {\n\t\tconst scope: Partial<IProvideFluidDependencySynthesizer> = context.scope;\n\t\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 ContainerRuntime.loadRuntime({\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});\n\t}\n\n\t/**\n\t * Subclasses may override containerInitializingFirstTime to perform any setup steps at the time the container\n\t * is created. This likely includes creating any initial data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerInitializingFirstTime(runtime: IContainerRuntime) {}\n\n\t/**\n\t * Subclasses may override containerHasInitialized to perform any steps after the container has initialized.\n\t * This likely includes loading any data stores that are expected to be there at the outset.\n\t * @param runtime - The container runtime for the container being initialized\n\t */\n\tprotected async containerHasInitialized(runtime: IContainerRuntime) {}\n}\n"]}
1
+ {"version":3,"file":"baseContainerRuntimeFactory.js","sourceRoot":"","sources":["../../src/container-runtime-factories/baseContainerRuntimeFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAI2C;AAE3C,gDAAgD;AAChD,qEAGyC;AAMzC,2DAIoC;AACpC,iEAAqE;AAgCrE;;;;;GAKG;AACH,MAAa,2BACZ,SAAQ,oCAAoB;IAG5B;;OAEG;IACH,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;IASD,YAAmB,KAAuC;QACzD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAC7C,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AK,CAAC,8BAA8B,CAAC,OAA0B,IAAkB,CAAC;IAE5F;;;;OAIG;IACO,KAAK,CAAC,uBAAuB,CAAC,OAA0B,IAAkB,CAAC;CACrF;AA5ED,kEA4EC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type IContainerContext } from \"@fluidframework/container-definitions\";\nimport {\n\ttype IContainerRuntimeOptions,\n\tFluidDataStoreRegistry,\n\tContainerRuntime,\n} from \"@fluidframework/container-runtime\";\nimport { type IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\n// eslint-disable-next-line import/no-deprecated\nimport {\n\ttype RuntimeRequestHandler,\n\tbuildRuntimeRequestHandler,\n} from \"@fluidframework/request-handler\";\nimport {\n\ttype IFluidDataStoreRegistry,\n\ttype IProvideFluidDataStoreRegistry,\n\ttype NamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tDependencyContainer,\n\ttype IFluidDependencySynthesizer,\n\ttype IProvideFluidDependencySynthesizer,\n} from \"@fluidframework/synthesize\";\nimport { RuntimeFactoryHelper } from \"@fluidframework/runtime-utils\";\nimport { type FluidObject } from \"@fluidframework/core-interfaces\";\n\n/**\n * {@link BaseContainerRuntimeFactory} construction properties.\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\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}\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 * @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\tprivate readonly requestHandlers: RuntimeRequestHandler[];\n\tprivate readonly provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;\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}\n\n\tpublic async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n\t\tawait this.containerInitializingFirstTime(runtime);\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\tpublic async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {\n\t\tawait this.containerHasInitialized(runtime);\n\t}\n\n\tpublic async preInitialize(\n\t\tcontext: IContainerContext,\n\t\texisting: boolean,\n\t): Promise<ContainerRuntime> {\n\t\tconst scope: Partial<IProvideFluidDependencySynthesizer> = context.scope;\n\t\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 ContainerRuntime.loadRuntime({\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});\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"]}
@@ -2,13 +2,42 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IContainerRuntimeOptions } from "@fluidframework/container-runtime";
6
- import { IFluidDataStoreFactory, NamedFluidDataStoreRegistryEntries } from "@fluidframework/runtime-definitions";
7
- import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
8
- import { IFluidDependencySynthesizer } from "@fluidframework/synthesize";
9
- import { RuntimeRequestHandler } from "@fluidframework/request-handler";
10
- import { FluidObject } from "@fluidframework/core-interfaces";
11
- import { BaseContainerRuntimeFactory } from "./baseContainerRuntimeFactory";
5
+ import { type IContainerRuntimeOptions } from "@fluidframework/container-runtime";
6
+ import { type NamedFluidDataStoreRegistryEntries, type IFluidDataStoreFactory } from "@fluidframework/runtime-definitions";
7
+ import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions";
8
+ import { type FluidObject } from "@fluidframework/core-interfaces";
9
+ import { type IFluidDependencySynthesizer } from "@fluidframework/synthesize";
10
+ import { type RuntimeRequestHandler } from "@fluidframework/request-handler";
11
+ import { BaseContainerRuntimeFactory } from "./baseContainerRuntimeFactory.js";
12
+ /**
13
+ * {@link ContainerRuntimeFactoryWithDefaultDataStore} construction properties.
14
+ * @alpha
15
+ */
16
+ export interface ContainerRuntimeFactoryWithDefaultDataStoreProps {
17
+ defaultFactory: IFluidDataStoreFactory;
18
+ /**
19
+ * The data store registry for containers produced.
20
+ */
21
+ registryEntries: NamedFluidDataStoreRegistryEntries;
22
+ /**
23
+ * @deprecated Will be removed in a future release.
24
+ */
25
+ dependencyContainer?: IFluidDependencySynthesizer;
26
+ /**
27
+ * Request handlers for containers produced.
28
+ * @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
29
+ */
30
+ requestHandlers?: RuntimeRequestHandler[];
31
+ /**
32
+ * The runtime options passed to the ContainerRuntime when instantiating it
33
+ */
34
+ runtimeOptions?: IContainerRuntimeOptions;
35
+ /**
36
+ * Function that will initialize the entryPoint of the ContainerRuntime instances
37
+ * created with this factory
38
+ */
39
+ provideEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>;
40
+ }
12
41
  /**
13
42
  * A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from
14
43
  * the container with an empty URL.
@@ -19,24 +48,7 @@ import { BaseContainerRuntimeFactory } from "./baseContainerRuntimeFactory";
19
48
  export declare class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {
20
49
  static readonly defaultDataStoreId = "default";
21
50
  protected readonly defaultFactory: IFluidDataStoreFactory;
22
- /**
23
- * Constructor
24
- * @param defaultFactory -
25
- * @param registryEntries -
26
- * @param dependencyContainer - deprecated, will be removed in a future release
27
- * @param requestHandlers -
28
- * @param runtimeOptions -
29
- * @param provideEntryPoint -
30
- */
31
- constructor(props: {
32
- defaultFactory: IFluidDataStoreFactory;
33
- registryEntries: NamedFluidDataStoreRegistryEntries;
34
- dependencyContainer?: IFluidDependencySynthesizer;
35
- /** @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 */
36
- requestHandlers?: RuntimeRequestHandler[];
37
- runtimeOptions?: IContainerRuntimeOptions;
38
- provideEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>;
39
- });
51
+ constructor(props: ContainerRuntimeFactoryWithDefaultDataStoreProps);
40
52
  /**
41
53
  * {@inheritDoc BaseContainerRuntimeFactory.containerInitializingFirstTime}
42
54
  */
@@ -1 +1 @@
1
- {"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAoB,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC/F,OAAO,EACN,sBAAsB,EACtB,kCAAkC,EAClC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAY,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAY5E;;;;;;GAMG;AACH,qBAAa,2CAA4C,SAAQ,2BAA2B;IAC3F,gBAAuB,kBAAkB,aAAsB;IAE/D,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,sBAAsB,CAAC;IAE1D;;;;;;;;OAQG;gBACS,KAAK,EAAE;QAClB,cAAc,EAAE,sBAAsB,CAAC;QACvC,eAAe,EAAE,kCAAkC,CAAC;QACpD,mBAAmB,CAAC,EAAE,2BAA2B,CAAC;QAClD,sLAAsL;QACtL,eAAe,CAAC,EAAE,qBAAqB,EAAE,CAAC;QAC1C,cAAc,CAAC,EAAE,wBAAwB,CAAC;QAC1C,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;KACzE;IAyBD;;OAEG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB;CAIzE"}
1
+ {"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,wBAAwB,EAE7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACN,KAAK,kCAAkC,EACvC,KAAK,sBAAsB,EAC3B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAAE,KAAK,WAAW,EAAiC,MAAM,iCAAiC,CAAC;AAElG,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAY/E;;;GAGG;AACH,MAAM,WAAW,gDAAgD;IAChE,cAAc,EAAE,sBAAsB,CAAC;IACvC;;OAEG;IACH,eAAe,EAAE,kCAAkC,CAAC;IACpD;;OAEG;IACH,mBAAmB,CAAC,EAAE,2BAA2B,CAAC;IAClD;;;OAGG;IACH,eAAe,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC1C;;OAEG;IACH,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CACzE;AAED;;;;;;GAMG;AACH,qBAAa,2CAA4C,SAAQ,2BAA2B;IAC3F,gBAAuB,kBAAkB,aAAsB;IAE/D,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,sBAAsB,CAAC;gBAEvC,KAAK,EAAE,gDAAgD;IA6B1E;;OAEG;cACa,8BAA8B,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAIzF"}
@@ -6,15 +6,15 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ContainerRuntimeFactoryWithDefaultDataStore = void 0;
8
8
  const runtime_utils_1 = require("@fluidframework/runtime-utils");
9
- const baseContainerRuntimeFactory_1 = require("./baseContainerRuntimeFactory");
9
+ const baseContainerRuntimeFactory_js_1 = require("./baseContainerRuntimeFactory.js");
10
10
  const defaultDataStoreId = "default";
11
- const getDefaultFluidObject = async (runtime) => {
11
+ async function getDefaultFluidObject(runtime) {
12
12
  const entryPoint = await runtime.getAliasedDataStoreEntryPoint("default");
13
13
  if (entryPoint === undefined) {
14
14
  throw new Error("default dataStore must exist");
15
15
  }
16
16
  return entryPoint.get();
17
- };
17
+ }
18
18
  /**
19
19
  * A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from
20
20
  * the container with an empty URL.
@@ -22,16 +22,7 @@ const getDefaultFluidObject = async (runtime) => {
22
22
  * This factory should be exposed as fluidExport off the entry point to your module.
23
23
  * @alpha
24
24
  */
25
- class ContainerRuntimeFactoryWithDefaultDataStore extends baseContainerRuntimeFactory_1.BaseContainerRuntimeFactory {
26
- /**
27
- * Constructor
28
- * @param defaultFactory -
29
- * @param registryEntries -
30
- * @param dependencyContainer - deprecated, will be removed in a future release
31
- * @param requestHandlers -
32
- * @param runtimeOptions -
33
- * @param provideEntryPoint -
34
- */
25
+ class ContainerRuntimeFactoryWithDefaultDataStore extends baseContainerRuntimeFactory_js_1.BaseContainerRuntimeFactory {
35
26
  constructor(props) {
36
27
  const requestHandlers = props.requestHandlers ?? [];
37
28
  const provideEntryPoint = props.provideEntryPoint ?? getDefaultFluidObject;
@@ -1 +1 @@
1
- {"version":3,"file":"containerRuntimeFactoryWithDefaultDataStore.js","sourceRoot":"","sources":["../../src/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,iEAA8D;AAC9D,+EAA4E;AAE5E,MAAM,kBAAkB,GAAG,SAAS,CAAC;AAErC,MAAM,qBAAqB,GAAG,KAAK,EAAE,OAA0B,EAAE,EAAE;IAClE,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,6BAA6B,CAAC,SAAS,CAAC,CAAC;IAC1E,IAAI,UAAU,KAAK,SAAS,EAAE;QAC7B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;KAChD;IACD,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC;AACzB,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAa,2CAA4C,SAAQ,yDAA2B;IAK3F;;;;;;;;OAQG;IACH,YAAY,KAQX;QACA,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC;QACpD,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,IAAI,qBAAqB,CAAC;QAE3E,MAAM,gBAAgB,GAAG,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE;YAChF,MAAM,MAAM,GAAG,6BAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;gBAClC,gFAAgF;gBAChF,OAAQ,OAA4B,CAAC,aAAa,CAAC;oBAClD,GAAG,EAAE,IAAI,kBAAkB,GAAG,MAAM,CAAC,KAAK,EAAE;oBAC5C,OAAO,EAAE,OAAO,CAAC,OAAO;iBACxB,CAAC,CAAC;aACH;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;;AArDF,kGAsDC;AArDuB,8DAAkB,GAAG,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ContainerRuntime, IContainerRuntimeOptions } from \"@fluidframework/container-runtime\";\nimport {\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IFluidDependencySynthesizer } from \"@fluidframework/synthesize\";\nimport { RuntimeRequestHandler } from \"@fluidframework/request-handler\";\nimport { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport { RequestParser } from \"@fluidframework/runtime-utils\";\nimport { BaseContainerRuntimeFactory } from \"./baseContainerRuntimeFactory\";\n\nconst defaultDataStoreId = \"default\";\n\nconst getDefaultFluidObject = async (runtime: IContainerRuntime) => {\n\tconst entryPoint = await runtime.getAliasedDataStoreEntryPoint(\"default\");\n\tif (entryPoint === undefined) {\n\t\tthrow new Error(\"default dataStore must exist\");\n\t}\n\treturn entryPoint.get();\n};\n\n/**\n * A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from\n * the container with an empty URL.\n *\n * This factory should be exposed as fluidExport off the entry point to your module.\n * @alpha\n */\nexport class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {\n\tpublic static readonly defaultDataStoreId = defaultDataStoreId;\n\n\tprotected readonly defaultFactory: IFluidDataStoreFactory;\n\n\t/**\n\t * Constructor\n\t * @param defaultFactory -\n\t * @param registryEntries -\n\t * @param dependencyContainer - deprecated, will be removed in a future release\n\t * @param requestHandlers -\n\t * @param runtimeOptions -\n\t * @param provideEntryPoint -\n\t */\n\tconstructor(props: {\n\t\tdefaultFactory: IFluidDataStoreFactory;\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries;\n\t\tdependencyContainer?: IFluidDependencySynthesizer;\n\t\t/** @deprecated Will be removed 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\trequestHandlers?: RuntimeRequestHandler[];\n\t\truntimeOptions?: IContainerRuntimeOptions;\n\t\tprovideEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>;\n\t}) {\n\t\tconst requestHandlers = props.requestHandlers ?? [];\n\t\tconst provideEntryPoint = props.provideEntryPoint ?? getDefaultFluidObject;\n\n\t\tconst getDefaultObject = async (request: IRequest, runtime: IContainerRuntime) => {\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 ContainerRuntime.loadRuntime is called in the base class\n\t\t\t\treturn (runtime as ContainerRuntime).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) {\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;;;AAYH,iEAA8D;AAG9D,qFAA+E;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;QAC7B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;KAChD;IACD,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC;AACzB,CAAC;AAgCD;;;;;;GAMG;AACH,MAAa,2CAA4C,SAAQ,4DAA2B;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,6BAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC7C,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;gBAClC,gFAAgF;gBAChF,OAAQ,OAA4B,CAAC,aAAa,CAAC;oBAClD,GAAG,EAAE,IAAI,kBAAkB,GAAG,MAAM,CAAC,KAAK,EAAE;oBAC5C,OAAO,EAAE,OAAO,CAAC,OAAO;iBACxB,CAAC,CAAC;aACH;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;;AAxCF,kGAyCC;AAxCuB,8DAAkB,GAAG,kBAAkB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\ttype IContainerRuntimeOptions,\n\ttype ContainerRuntime,\n} from \"@fluidframework/container-runtime\";\nimport {\n\ttype NamedFluidDataStoreRegistryEntries,\n\ttype IFluidDataStoreFactory,\n} from \"@fluidframework/runtime-definitions\";\nimport { type IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { type FluidObject, type IRequest, type IResponse } from \"@fluidframework/core-interfaces\";\nimport { RequestParser } from \"@fluidframework/runtime-utils\";\nimport { type IFluidDependencySynthesizer } from \"@fluidframework/synthesize\";\nimport { type RuntimeRequestHandler } from \"@fluidframework/request-handler\";\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 * @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\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}\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 * @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 ContainerRuntime.loadRuntime is called in the base class\n\t\t\t\treturn (runtime as ContainerRuntime).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"]}
@@ -2,6 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { BaseContainerRuntimeFactory } from "./baseContainerRuntimeFactory";
6
- export { ContainerRuntimeFactoryWithDefaultDataStore } from "./containerRuntimeFactoryWithDefaultDataStore";
5
+ export { BaseContainerRuntimeFactory, type BaseContainerRuntimeFactoryProps, } from "./baseContainerRuntimeFactory.js";
6
+ export { ContainerRuntimeFactoryWithDefaultDataStore, type ContainerRuntimeFactoryWithDefaultDataStoreProps, } from "./containerRuntimeFactoryWithDefaultDataStore.js";
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,2CAA2C,EAAE,MAAM,+CAA+C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/container-runtime-factories/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,2BAA2B,EAC3B,KAAK,gCAAgC,GACrC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,2CAA2C,EAC3C,KAAK,gDAAgD,GACrD,MAAM,kDAAkD,CAAC"}