@fluidframework/aqueduct 2.0.0-internal.7.2.2 → 2.0.0-internal.7.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/README.md +1 -2
  2. package/dist/aqueduct-alpha.d.ts +396 -0
  3. package/dist/aqueduct-beta.d.ts +146 -0
  4. package/dist/aqueduct-public.d.ts +146 -0
  5. package/dist/aqueduct-untrimmed.d.ts +459 -0
  6. package/dist/container-runtime-factories/{baseContainerRuntimeFactory.js → baseContainerRuntimeFactory.cjs} +2 -2
  7. package/dist/container-runtime-factories/{baseContainerRuntimeFactory.js.map → baseContainerRuntimeFactory.cjs.map} +1 -1
  8. package/dist/container-runtime-factories/baseContainerRuntimeFactory.d.ts +1 -1
  9. package/dist/container-runtime-factories/{containerRuntimeFactoryWithDefaultDataStore.js → containerRuntimeFactoryWithDefaultDataStore.cjs} +4 -4
  10. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.cjs.map +1 -0
  11. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +1 -1
  12. package/dist/container-runtime-factories/{index.js → index.cjs} +3 -3
  13. package/dist/container-runtime-factories/index.cjs.map +1 -0
  14. package/dist/data-object-factories/{dataObjectFactory.js → dataObjectFactory.cjs} +3 -3
  15. package/dist/data-object-factories/dataObjectFactory.cjs.map +1 -0
  16. package/dist/data-object-factories/dataObjectFactory.d.ts +1 -1
  17. package/dist/data-object-factories/{index.js → index.cjs} +3 -3
  18. package/dist/data-object-factories/index.cjs.map +1 -0
  19. package/dist/data-object-factories/{pureDataObjectFactory.js → pureDataObjectFactory.cjs} +2 -2
  20. package/dist/data-object-factories/pureDataObjectFactory.cjs.map +1 -0
  21. package/dist/data-object-factories/pureDataObjectFactory.d.ts +3 -2
  22. package/dist/data-object-factories/pureDataObjectFactory.d.ts.map +1 -1
  23. package/dist/data-objects/{dataObject.js → dataObject.cjs} +3 -3
  24. package/dist/data-objects/{dataObject.js.map → dataObject.cjs.map} +1 -1
  25. package/dist/data-objects/dataObject.d.ts +1 -1
  26. package/dist/data-objects/{index.js → index.cjs} +3 -3
  27. package/dist/data-objects/index.cjs.map +1 -0
  28. package/dist/data-objects/{pureDataObject.js → pureDataObject.cjs} +2 -2
  29. package/dist/data-objects/{pureDataObject.js.map → pureDataObject.cjs.map} +1 -1
  30. package/dist/data-objects/pureDataObject.d.ts +1 -1
  31. package/dist/data-objects/{types.js → types.cjs} +1 -1
  32. package/dist/data-objects/types.cjs.map +1 -0
  33. package/dist/data-objects/types.d.ts +2 -2
  34. package/dist/{index.js → index.cjs} +6 -6
  35. package/dist/index.cjs.map +1 -0
  36. package/dist/request-handlers/{index.js → index.cjs} +2 -2
  37. package/dist/request-handlers/index.cjs.map +1 -0
  38. package/dist/request-handlers/{requestHandlers.js → requestHandlers.cjs} +4 -4
  39. package/dist/request-handlers/requestHandlers.cjs.map +1 -0
  40. package/dist/request-handlers/requestHandlers.d.ts +3 -3
  41. package/dist/tsdoc-metadata.json +1 -1
  42. package/dist/utils/{containerInteractions.js → containerInteractions.cjs} +4 -4
  43. package/dist/utils/containerInteractions.cjs.map +1 -0
  44. package/dist/utils/containerInteractions.d.ts +3 -3
  45. package/dist/utils/{index.js → index.cjs} +2 -2
  46. package/dist/utils/index.cjs.map +1 -0
  47. package/lib/aqueduct-alpha.d.ts +396 -0
  48. package/lib/aqueduct-beta.d.ts +146 -0
  49. package/lib/aqueduct-public.d.ts +146 -0
  50. package/lib/aqueduct-untrimmed.d.ts +459 -0
  51. package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.ts +59 -0
  52. package/lib/container-runtime-factories/baseContainerRuntimeFactory.d.ts.map +1 -0
  53. package/lib/container-runtime-factories/{baseContainerRuntimeFactory.js → baseContainerRuntimeFactory.mjs} +2 -3
  54. package/lib/container-runtime-factories/baseContainerRuntimeFactory.mjs.map +1 -0
  55. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts +45 -0
  56. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -0
  57. package/lib/container-runtime-factories/{containerRuntimeFactoryWithDefaultDataStore.js → containerRuntimeFactoryWithDefaultDataStore.mjs} +4 -5
  58. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.mjs.map +1 -0
  59. package/lib/container-runtime-factories/index.d.ts +7 -0
  60. package/lib/container-runtime-factories/index.d.ts.map +1 -0
  61. package/lib/container-runtime-factories/{index.js → index.mjs} +3 -3
  62. package/lib/container-runtime-factories/index.mjs.map +1 -0
  63. package/lib/data-object-factories/dataObjectFactory.d.ts +23 -0
  64. package/lib/data-object-factories/dataObjectFactory.d.ts.map +1 -0
  65. package/lib/data-object-factories/{dataObjectFactory.js → dataObjectFactory.mjs} +3 -3
  66. package/lib/data-object-factories/dataObjectFactory.mjs.map +1 -0
  67. package/lib/data-object-factories/index.d.ts +7 -0
  68. package/lib/data-object-factories/index.d.ts.map +1 -0
  69. package/lib/data-object-factories/index.mjs +7 -0
  70. package/lib/data-object-factories/index.mjs.map +1 -0
  71. package/lib/data-object-factories/pureDataObjectFactory.d.ts +100 -0
  72. package/lib/data-object-factories/pureDataObjectFactory.d.ts.map +1 -0
  73. package/lib/data-object-factories/{pureDataObjectFactory.js → pureDataObjectFactory.mjs} +2 -2
  74. package/lib/data-object-factories/pureDataObjectFactory.mjs.map +1 -0
  75. package/lib/data-objects/dataObject.d.ts +38 -0
  76. package/lib/data-objects/dataObject.d.ts.map +1 -0
  77. package/lib/data-objects/{dataObject.js → dataObject.mjs} +3 -3
  78. package/lib/data-objects/dataObject.mjs.map +1 -0
  79. package/lib/data-objects/index.d.ts +8 -0
  80. package/lib/data-objects/index.d.ts.map +1 -0
  81. package/lib/data-objects/index.mjs +7 -0
  82. package/lib/data-objects/index.mjs.map +1 -0
  83. package/lib/data-objects/pureDataObject.d.ts +98 -0
  84. package/lib/data-objects/pureDataObject.d.ts.map +1 -0
  85. package/lib/data-objects/{pureDataObject.js → pureDataObject.mjs} +2 -2
  86. package/lib/data-objects/pureDataObject.mjs.map +1 -0
  87. package/lib/data-objects/types.d.ts +36 -0
  88. package/lib/data-objects/types.d.ts.map +1 -0
  89. package/lib/data-objects/{types.js → types.mjs} +1 -1
  90. package/lib/data-objects/types.mjs.map +1 -0
  91. package/lib/index.d.ts +10 -0
  92. package/lib/index.d.ts.map +1 -0
  93. package/lib/index.mjs +10 -0
  94. package/lib/index.mjs.map +1 -0
  95. package/lib/request-handlers/index.d.ts +6 -0
  96. package/lib/request-handlers/index.d.ts.map +1 -0
  97. package/lib/request-handlers/{index.js → index.mjs} +2 -2
  98. package/lib/request-handlers/index.mjs.map +1 -0
  99. package/lib/request-handlers/requestHandlers.d.ts +46 -0
  100. package/lib/request-handlers/requestHandlers.d.ts.map +1 -0
  101. package/lib/request-handlers/{requestHandlers.js → requestHandlers.mjs} +4 -5
  102. package/lib/request-handlers/requestHandlers.mjs.map +1 -0
  103. package/lib/utils/containerInteractions.d.ts +38 -0
  104. package/lib/utils/containerInteractions.d.ts.map +1 -0
  105. package/lib/utils/{containerInteractions.js → containerInteractions.mjs} +4 -4
  106. package/lib/utils/containerInteractions.mjs.map +1 -0
  107. package/lib/utils/index.d.ts +6 -0
  108. package/lib/utils/index.d.ts.map +1 -0
  109. package/lib/utils/{index.js → index.mjs} +2 -2
  110. package/lib/utils/index.mjs.map +1 -0
  111. package/package.json +55 -36
  112. package/dist/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +0 -1
  113. package/dist/container-runtime-factories/index.js.map +0 -1
  114. package/dist/data-object-factories/dataObjectFactory.js.map +0 -1
  115. package/dist/data-object-factories/index.js.map +0 -1
  116. package/dist/data-object-factories/pureDataObjectFactory.js.map +0 -1
  117. package/dist/data-objects/index.js.map +0 -1
  118. package/dist/data-objects/types.js.map +0 -1
  119. package/dist/index.js.map +0 -1
  120. package/dist/request-handlers/index.js.map +0 -1
  121. package/dist/request-handlers/requestHandlers.js.map +0 -1
  122. package/dist/utils/containerInteractions.js.map +0 -1
  123. package/dist/utils/index.js.map +0 -1
  124. package/lib/container-runtime-factories/baseContainerRuntimeFactory.js.map +0 -1
  125. package/lib/container-runtime-factories/containerRuntimeFactoryWithDefaultDataStore.js.map +0 -1
  126. package/lib/container-runtime-factories/index.js.map +0 -1
  127. package/lib/data-object-factories/dataObjectFactory.js.map +0 -1
  128. package/lib/data-object-factories/index.js +0 -7
  129. package/lib/data-object-factories/index.js.map +0 -1
  130. package/lib/data-object-factories/pureDataObjectFactory.js.map +0 -1
  131. package/lib/data-objects/dataObject.js.map +0 -1
  132. package/lib/data-objects/index.js +0 -7
  133. package/lib/data-objects/index.js.map +0 -1
  134. package/lib/data-objects/pureDataObject.js.map +0 -1
  135. package/lib/data-objects/types.js.map +0 -1
  136. package/lib/index.js +0 -24
  137. package/lib/index.js.map +0 -1
  138. package/lib/request-handlers/index.js.map +0 -1
  139. package/lib/request-handlers/requestHandlers.js.map +0 -1
  140. package/lib/utils/containerInteractions.js.map +0 -1
  141. package/lib/utils/index.js.map +0 -1
package/README.md CHANGED
@@ -226,8 +226,7 @@ We use custom handlers to build the Container Services pattern.
226
226
 
227
227
  This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.
228
228
 
229
- Use of these trademarks or logos must follow Microsoft's [Trademark & Brand
230
- Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
229
+ Use of these trademarks or logos must follow Microsoft's [Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
231
230
 
232
231
  Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
233
232
 
@@ -0,0 +1,396 @@
1
+ /**
2
+ * The `aqueduct` package is a library for building Fluid objects and Fluid
3
+ * containers within the Fluid Framework. Its goal is to provide a thin base
4
+ * layer over the existing Fluid Framework interfaces that allows developers to
5
+ * get started quickly.
6
+ *
7
+ * @remarks
8
+ * About the library name: An "aqueduct" is a way to transport water from a source
9
+ * to another location. The library name was chosen because its purpose is to
10
+ * facilitate using lower level constructs and therefore handle 'fluid' items
11
+ * same as an aqueduct.
12
+ *
13
+ * @packageDocumentation
14
+ */
15
+
16
+ import { AsyncFluidObjectProvider } from '@fluidframework/synthesize';
17
+ import { ContainerRuntime } from '@fluidframework/container-runtime';
18
+ import { FluidDataStoreRuntime } from '@fluidframework/datastore';
19
+ import { FluidObject } from '@fluidframework/core-interfaces';
20
+ import { FluidObjectSymbolProvider } from '@fluidframework/synthesize';
21
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
22
+ import { IContainer } from '@fluidframework/container-definitions';
23
+ import { IContainerContext } from '@fluidframework/container-definitions';
24
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
25
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
26
+ import { IContainerRuntimeOptions } from '@fluidframework/container-runtime';
27
+ import { IEvent } from '@fluidframework/core-interfaces';
28
+ import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions';
29
+ import { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definitions';
30
+ import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
31
+ import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
32
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
33
+ import { IFluidDependencySynthesizer } from '@fluidframework/synthesize';
34
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
35
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
36
+ import type { IFluidMountableViewClass } from '@fluidframework/view-interfaces';
37
+ import { IFluidRouter } from '@fluidframework/core-interfaces';
38
+ import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
39
+ import { IProvideFluidHandle } from '@fluidframework/core-interfaces';
40
+ import { IRequest } from '@fluidframework/core-interfaces';
41
+ import { IResponse } from '@fluidframework/core-interfaces';
42
+ import { ISharedDirectory } from '@fluidframework/map';
43
+ import { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions';
44
+ import { NamedFluidDataStoreRegistryEntry } from '@fluidframework/runtime-definitions';
45
+ import { RequestParser } from '@fluidframework/runtime-utils';
46
+ import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils';
47
+ import { RuntimeRequestHandler } from '@fluidframework/request-handler';
48
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
49
+
50
+ /**
51
+ * BaseContainerRuntimeFactory produces container runtimes with the specified data store and service registries,
52
+ * request handlers, runtimeOptions, and entryPoint initialization function.
53
+ * It can be subclassed to implement a first-time initialization procedure for the containers it creates.
54
+ * @alpha
55
+ */
56
+ export declare class BaseContainerRuntimeFactory extends RuntimeFactoryHelper implements IProvideFluidDataStoreRegistry {
57
+ get IFluidDataStoreRegistry(): IFluidDataStoreRegistry;
58
+ private readonly registry;
59
+ private readonly registryEntries;
60
+ private readonly dependencyContainer?;
61
+ private readonly runtimeOptions?;
62
+ private readonly requestHandlers;
63
+ private readonly provideEntryPoint;
64
+ /**
65
+ * @param registryEntries - The data store registry for containers produced
66
+ * @param dependencyContainer - deprecated, will be removed in a future release
67
+ * @param requestHandlers - Request handlers for containers produced
68
+ * @param runtimeOptions - The runtime options passed to the ContainerRuntime when instantiating it
69
+ * @param provideEntryPoint - Function that will initialize the entryPoint of the ContainerRuntime instances
70
+ * created with this factory
71
+ */
72
+ constructor(props: {
73
+ registryEntries: NamedFluidDataStoreRegistryEntries;
74
+ dependencyContainer?: IFluidDependencySynthesizer;
75
+ /** @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md */
76
+ requestHandlers?: RuntimeRequestHandler[];
77
+ runtimeOptions?: IContainerRuntimeOptions;
78
+ provideEntryPoint: (runtime: IContainerRuntime) => Promise<FluidObject>;
79
+ });
80
+ instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
81
+ instantiateFromExisting(runtime: ContainerRuntime): Promise<void>;
82
+ preInitialize(context: IContainerContext, existing: boolean): Promise<ContainerRuntime>;
83
+ /**
84
+ * Subclasses may override containerInitializingFirstTime to perform any setup steps at the time the container
85
+ * is created. This likely includes creating any initial data stores that are expected to be there at the outset.
86
+ * @param runtime - The container runtime for the container being initialized
87
+ */
88
+ protected containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void>;
89
+ /**
90
+ * Subclasses may override containerHasInitialized to perform any steps after the container has initialized.
91
+ * This likely includes loading any data stores that are expected to be there at the outset.
92
+ * @param runtime - The container runtime for the container being initialized
93
+ */
94
+ protected containerHasInitialized(runtime: IContainerRuntime): Promise<void>;
95
+ }
96
+
97
+ /**
98
+ * A ContainerRuntimeFactory that initializes Containers with a single default data store, which can be requested from
99
+ * the container with an empty URL.
100
+ *
101
+ * This factory should be exposed as fluidExport off the entry point to your module.
102
+ * @alpha
103
+ */
104
+ export declare class ContainerRuntimeFactoryWithDefaultDataStore extends BaseContainerRuntimeFactory {
105
+ static readonly defaultDataStoreId = "default";
106
+ protected readonly defaultFactory: IFluidDataStoreFactory;
107
+ /**
108
+ * Constructor
109
+ * @param defaultFactory -
110
+ * @param registryEntries -
111
+ * @param dependencyContainer - deprecated, will be removed in a future release
112
+ * @param requestHandlers -
113
+ * @param runtimeOptions -
114
+ * @param provideEntryPoint -
115
+ */
116
+ constructor(props: {
117
+ defaultFactory: IFluidDataStoreFactory;
118
+ registryEntries: NamedFluidDataStoreRegistryEntries;
119
+ dependencyContainer?: IFluidDependencySynthesizer;
120
+ /** @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md */
121
+ requestHandlers?: RuntimeRequestHandler[];
122
+ runtimeOptions?: IContainerRuntimeOptions;
123
+ provideEntryPoint?: (runtime: IContainerRuntime) => Promise<FluidObject>;
124
+ });
125
+ /**
126
+ * {@inheritDoc BaseContainerRuntimeFactory.containerInitializingFirstTime}
127
+ */
128
+ protected containerInitializingFirstTime(runtime: IContainerRuntime): Promise<void>;
129
+ }
130
+
131
+ /**
132
+ * DataObject is a base data store that is primed with a root directory. It
133
+ * ensures that it is created and ready before you can access it.
134
+ *
135
+ * Having a single root directory allows for easier development. Instead of creating
136
+ * and registering channels with the runtime any new DDS that is set on the root
137
+ * will automatically be registered.
138
+ *
139
+ * @typeParam I - The optional input types used to strongly type the data object
140
+ * @alpha
141
+ */
142
+ export declare abstract class DataObject<I extends DataObjectTypes = DataObjectTypes> extends PureDataObject<I> {
143
+ private internalRoot;
144
+ private readonly rootDirectoryId;
145
+ /**
146
+ * The root directory will either be ready or will return an error. If an error is thrown
147
+ * the root has not been correctly created/set.
148
+ */
149
+ protected get root(): ISharedDirectory;
150
+ /**
151
+ * Initializes internal objects and calls initialization overrides.
152
+ * Caller is responsible for ensuring this is only invoked once.
153
+ */
154
+ initializeInternal(existing: boolean): Promise<void>;
155
+ /**
156
+ * Generates an error string indicating an item is uninitialized.
157
+ * @param item - The name of the item that was uninitialized.
158
+ */
159
+ protected getUninitializedErrorString(item: string): string;
160
+ }
161
+
162
+ /**
163
+ * DataObjectFactory is the IFluidDataStoreFactory for use with DataObjects.
164
+ * It facilitates DataObject's features (such as its shared directory) by
165
+ * ensuring relevant shared objects etc are available to the factory.
166
+ *
167
+ * @typeParam TObj - DataObject (concrete type)
168
+ * @typeParam I - The input types for the DataObject
169
+ * @alpha
170
+ */
171
+ export declare class DataObjectFactory<TObj extends DataObject<I>, I extends DataObjectTypes = DataObjectTypes> extends PureDataObjectFactory<TObj, I> {
172
+ constructor(type: string, ctor: new (props: IDataObjectProps<I>) => TObj, sharedObjects: readonly IChannelFactory[] | undefined, optionalProviders: FluidObjectSymbolProvider<I["OptionalProviders"]>, registryEntries?: NamedFluidDataStoreRegistryEntries, runtimeFactory?: typeof FluidDataStoreRuntime);
173
+ }
174
+
175
+ /**
176
+ * This type is used as the base generic input to DataObject and PureDataObject.
177
+ * @alpha
178
+ */
179
+ export declare interface DataObjectTypes {
180
+ /**
181
+ * represents a type that will define optional providers that will be injected
182
+ */
183
+ OptionalProviders?: FluidObject;
184
+ /**
185
+ * the initial state type that the produced data object may take during creation
186
+ */
187
+ InitialState?: any;
188
+ /**
189
+ * represents events that will be available in the EventForwarder
190
+ */
191
+ Events?: IEvent;
192
+ }
193
+
194
+ /* Excluded from this release type: defaultFluidObjectRequestHandler */
195
+
196
+ /* Excluded from this release type: defaultRouteRequestHandler */
197
+
198
+ /* Excluded from this release type: getDefaultObjectFromContainer */
199
+
200
+ /* Excluded from this release type: getObjectFromContainer */
201
+
202
+ /* Excluded from this release type: getObjectWithIdFromContainer */
203
+
204
+ /**
205
+ * @alpha
206
+ */
207
+ export declare interface IDataObjectProps<I extends DataObjectTypes = DataObjectTypes> {
208
+ readonly runtime: IFluidDataStoreRuntime;
209
+ readonly context: IFluidDataStoreContext;
210
+ readonly providers: AsyncFluidObjectProvider<I["OptionalProviders"]>;
211
+ readonly initProps?: I["InitialState"];
212
+ }
213
+
214
+ /* Excluded from this release type: IFluidMountableViewClass */
215
+
216
+ /**
217
+ * Useful interface in places where it's useful to do type erasure for PureDataObject generic
218
+ * @deprecated Will be removed in future major release. Please remove all usage of it.
219
+ * @alpha
220
+ */
221
+ export declare interface IRootDataObjectFactory extends IFluidDataStoreFactory {
222
+ createRootInstance(rootDataStoreId: string, runtime: IContainerRuntime): Promise<IFluidRouter>;
223
+ }
224
+
225
+ /* Excluded from this release type: mountableViewRequestHandler */
226
+
227
+ /**
228
+ * This is a bare-bones base class that does basic setup and enables for factory on an initialize call.
229
+ * You probably don't want to inherit from this data store directly unless
230
+ * you are creating another base data store class
231
+ *
232
+ * @typeParam I - The optional input types used to strongly type the data object
233
+ * @alpha
234
+ */
235
+ export declare abstract class PureDataObject<I extends DataObjectTypes = DataObjectTypes> extends TypedEventEmitter<I["Events"] & IEvent> implements IFluidLoadable, IFluidRouter, IProvideFluidHandle {
236
+ /**
237
+ * This is your FluidDataStoreRuntime object
238
+ */
239
+ protected readonly runtime: IFluidDataStoreRuntime;
240
+ /**
241
+ * This context is used to talk up to the ContainerRuntime
242
+ */
243
+ protected readonly context: IFluidDataStoreContext;
244
+ /**
245
+ * Providers are FluidObject keyed objects that provide back
246
+ * a promise to the corresponding FluidObject or undefined.
247
+ * Providers injected/provided by the Container and/or HostingApplication
248
+ *
249
+ * To define providers set FluidObject interfaces in the OptionalProviders generic type for your data store
250
+ */
251
+ protected readonly providers: AsyncFluidObjectProvider<I["OptionalProviders"]>;
252
+ protected initProps?: I["InitialState"];
253
+ protected initializeP: Promise<void> | undefined;
254
+ get id(): string;
255
+ /**
256
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
257
+ */
258
+ get IFluidRouter(): this;
259
+ get IFluidLoadable(): this;
260
+ get IFluidHandle(): IFluidHandle<this>;
261
+ /**
262
+ * Handle to a data store
263
+ */
264
+ get handle(): IFluidHandle<this>;
265
+ static getDataObject(runtime: IFluidDataStoreRuntime): Promise<PureDataObject<DataObjectTypes>>;
266
+ constructor(props: IDataObjectProps<I>);
267
+ /**
268
+ * Return this object if someone requests it directly
269
+ * We will return this object in two scenarios:
270
+ *
271
+ * 1. the request url is a "/"
272
+ *
273
+ * 2. the request url is empty
274
+ */
275
+ request(req: IRequest): Promise<IResponse>;
276
+ /**
277
+ * Call this API to ensure PureDataObject is fully initialized.
278
+ * Initialization happens on demand, only on as-needed bases.
279
+ * In most cases you should allow factory/object to decide when to finish initialization.
280
+ * But if you are supplying your own implementation of DataStoreRuntime factory and overriding some methods
281
+ * and need a fully initialized object, then you can call this API to ensure object is fully initialized.
282
+ */
283
+ finishInitialization(existing: boolean): Promise<void>;
284
+ /**
285
+ * Internal initialize implementation. Overwriting this will change the flow of the PureDataObject and should
286
+ * generally not be done.
287
+ *
288
+ * Calls initializingFirstTime, initializingFromExisting, and hasInitialized. Caller is
289
+ * responsible for ensuring this is only invoked once.
290
+ */
291
+ initializeInternal(existing: boolean): Promise<void>;
292
+ /**
293
+ * Called every time the data store is initialized, before initializingFirstTime or
294
+ * initializingFromExisting is called.
295
+ */
296
+ protected preInitialize(): Promise<void>;
297
+ /**
298
+ * Called the first time the data store is initialized (new creations with a new
299
+ * data store runtime)
300
+ *
301
+ * @param props - Optional props to be passed in on create
302
+ */
303
+ protected initializingFirstTime(props?: I["InitialState"]): Promise<void>;
304
+ /**
305
+ * Called every time but the first time the data store is initialized (creations
306
+ * with an existing data store runtime)
307
+ */
308
+ protected initializingFromExisting(): Promise<void>;
309
+ /**
310
+ * Called every time the data store is initialized after create or existing.
311
+ */
312
+ protected hasInitialized(): Promise<void>;
313
+ }
314
+
315
+ /**
316
+ * PureDataObjectFactory is a barebones IFluidDataStoreFactory for use with PureDataObject.
317
+ * Consumers should typically use DataObjectFactory instead unless creating
318
+ * another base data store factory.
319
+ *
320
+ * @typeParam TObj - DataObject (concrete type)
321
+ * @typeParam I - The input types for the DataObject
322
+ * @alpha
323
+ */
324
+ export declare class PureDataObjectFactory<TObj extends PureDataObject<I>, I extends DataObjectTypes = DataObjectTypes> implements IFluidDataStoreFactory, Partial<IProvideFluidDataStoreRegistry>, IRootDataObjectFactory {
325
+ readonly type: string;
326
+ private readonly ctor;
327
+ private readonly optionalProviders;
328
+ private readonly runtimeClass;
329
+ private readonly sharedObjectRegistry;
330
+ private readonly registry;
331
+ constructor(type: string, ctor: new (props: IDataObjectProps<I>) => TObj, sharedObjects: readonly IChannelFactory[], optionalProviders: FluidObjectSymbolProvider<I["OptionalProviders"]>, registryEntries?: NamedFluidDataStoreRegistryEntries, runtimeClass?: typeof FluidDataStoreRuntime);
332
+ get IFluidDataStoreFactory(): this;
333
+ get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined;
334
+ /**
335
+ * Convenience helper to get the data store's/factory's data store registry entry.
336
+ * The return type hides the factory's generics, easing grouping of registry
337
+ * entries that differ only in this way into the same array.
338
+ * @returns The NamedFluidDataStoreRegistryEntry
339
+ */
340
+ get registryEntry(): NamedFluidDataStoreRegistryEntry;
341
+ /**
342
+ * This is where we do data store setup.
343
+ *
344
+ * @param context - data store context used to load a data store runtime
345
+ */
346
+ instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<FluidDataStoreRuntime>;
347
+ /**
348
+ * Creates a new instance of the object. Uses parent context's registry to build package path to this factory.
349
+ * In other words, registry of context passed in has to contain this factory, with the name that matches
350
+ * this factory's type.
351
+ * It is intended to be used by data store objects that create sub-objects.
352
+ * @param context - The context being used to create the runtime
353
+ * (the created object will have its own new context created as well)
354
+ * @param initialState - The initial state to provide to the created data store.
355
+ * @returns an object created by this factory. Data store and objects created are not attached to container.
356
+ * They get attached only when a handle to one of them is attached to already attached objects.
357
+ */
358
+ createChildInstance(parentContext: IFluidDataStoreContext, initialState?: I["InitialState"]): Promise<TObj>;
359
+ /**
360
+ * Creates a new instance of the object. Uses peer context's registry and its package path to identify this factory.
361
+ * In other words, registry of context passed in has to have this factory.
362
+ * Intended to be used by data store objects that need to create peers (similar) instances of existing objects.
363
+ * @param context - The component context being used to create the object
364
+ * (the created object will have its own new context created as well)
365
+ * @param initialState - The initial state to provide to the created component.
366
+ * @returns an object created by this factory. Data store and objects created are not attached to container.
367
+ * They get attached only when a handle to one of them is attached to already attached objects.
368
+ */
369
+ createPeerInstance(peerContext: IFluidDataStoreContext, initialState?: I["InitialState"]): Promise<TObj>;
370
+ /**
371
+ * Creates a new instance of the object. Uses container's registry to find this factory.
372
+ * It's expected that only container owners would use this functionality, as only such developers
373
+ * have knowledge of entries in container registry.
374
+ * The name in this registry for such record should match type of this factory.
375
+ * @param runtime - container runtime. It's registry is used to create an object.
376
+ * @param initialState - The initial state to provide to the created component.
377
+ * @returns an object created by this factory. Data store and objects created are not attached to container.
378
+ * They get attached only when a handle to one of them is attached to already attached objects.
379
+ */
380
+ createInstance(runtime: IContainerRuntimeBase, initialState?: I["InitialState"]): Promise<TObj>;
381
+ /**
382
+ * Creates a new root instance of the object. Uses container's registry to find this factory.
383
+ * It's expected that only container owners would use this functionality, as only such developers
384
+ * have knowledge of entries in container registry.
385
+ * The name in this registry for such record should match type of this factory.
386
+ * @param runtime - container runtime. It's registry is used to create an object.
387
+ * @param initialState - The initial state to provide to the created component.
388
+ * @returns an object created by this factory. Data store and objects created are not attached to container.
389
+ * They get attached only when a handle to one of them is attached to already attached objects.
390
+ */
391
+ createRootInstance(rootDataStoreId: string, runtime: IContainerRuntime, initialState?: I["InitialState"]): Promise<TObj>;
392
+ protected createNonRootInstanceCore(containerRuntime: IContainerRuntimeBase, packagePath: Readonly<string[]>, initialState?: I["InitialState"]): Promise<TObj>;
393
+ protected createInstanceCore(context: IFluidDataStoreContextDetached, initialState?: I["InitialState"]): Promise<TObj>;
394
+ }
395
+
396
+ export { }
@@ -0,0 +1,146 @@
1
+ /**
2
+ * The `aqueduct` package is a library for building Fluid objects and Fluid
3
+ * containers within the Fluid Framework. Its goal is to provide a thin base
4
+ * layer over the existing Fluid Framework interfaces that allows developers to
5
+ * get started quickly.
6
+ *
7
+ * @remarks
8
+ * About the library name: An "aqueduct" is a way to transport water from a source
9
+ * to another location. The library name was chosen because its purpose is to
10
+ * facilitate using lower level constructs and therefore handle 'fluid' items
11
+ * same as an aqueduct.
12
+ *
13
+ * @packageDocumentation
14
+ */
15
+
16
+ import { AsyncFluidObjectProvider } from '@fluidframework/synthesize';
17
+ import { ContainerRuntime } from '@fluidframework/container-runtime';
18
+ import { FluidDataStoreRuntime } from '@fluidframework/datastore';
19
+ import { FluidObject } from '@fluidframework/core-interfaces';
20
+ import { FluidObjectSymbolProvider } from '@fluidframework/synthesize';
21
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
22
+ import { IContainer } from '@fluidframework/container-definitions';
23
+ import { IContainerContext } from '@fluidframework/container-definitions';
24
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
25
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
26
+ import { IContainerRuntimeOptions } from '@fluidframework/container-runtime';
27
+ import { IEvent } from '@fluidframework/core-interfaces';
28
+ import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions';
29
+ import { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definitions';
30
+ import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
31
+ import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
32
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
33
+ import { IFluidDependencySynthesizer } from '@fluidframework/synthesize';
34
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
35
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
36
+ import type { IFluidMountableViewClass } from '@fluidframework/view-interfaces';
37
+ import { IFluidRouter } from '@fluidframework/core-interfaces';
38
+ import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
39
+ import { IProvideFluidHandle } from '@fluidframework/core-interfaces';
40
+ import { IRequest } from '@fluidframework/core-interfaces';
41
+ import { IResponse } from '@fluidframework/core-interfaces';
42
+ import { ISharedDirectory } from '@fluidframework/map';
43
+ import { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions';
44
+ import { NamedFluidDataStoreRegistryEntry } from '@fluidframework/runtime-definitions';
45
+ import { RequestParser } from '@fluidframework/runtime-utils';
46
+ import { RuntimeFactoryHelper } from '@fluidframework/runtime-utils';
47
+ import { RuntimeRequestHandler } from '@fluidframework/request-handler';
48
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
49
+
50
+ /* Excluded from this release type: AsyncFluidObjectProvider */
51
+
52
+ /* Excluded from this release type: BaseContainerRuntimeFactory */
53
+
54
+ /* Excluded from this release type: ContainerRuntime */
55
+
56
+ /* Excluded from this release type: ContainerRuntimeFactoryWithDefaultDataStore */
57
+
58
+ /* Excluded from this release type: DataObject */
59
+
60
+ /* Excluded from this release type: DataObjectFactory */
61
+
62
+ /* Excluded from this release type: DataObjectTypes */
63
+
64
+ /* Excluded from this release type: defaultFluidObjectRequestHandler */
65
+
66
+ /* Excluded from this release type: defaultRouteRequestHandler */
67
+
68
+ /* Excluded from this release type: FluidDataStoreRuntime */
69
+
70
+ /* Excluded from this release type: FluidObject */
71
+
72
+ /* Excluded from this release type: FluidObjectSymbolProvider */
73
+
74
+ /* Excluded from this release type: getDefaultObjectFromContainer */
75
+
76
+ /* Excluded from this release type: getObjectFromContainer */
77
+
78
+ /* Excluded from this release type: getObjectWithIdFromContainer */
79
+
80
+ /* Excluded from this release type: IChannelFactory */
81
+
82
+ /* Excluded from this release type: IContainer */
83
+
84
+ /* Excluded from this release type: IContainerContext */
85
+
86
+ /* Excluded from this release type: IContainerRuntime */
87
+
88
+ /* Excluded from this release type: IContainerRuntimeBase */
89
+
90
+ /* Excluded from this release type: IContainerRuntimeOptions */
91
+
92
+ /* Excluded from this release type: IDataObjectProps */
93
+
94
+ /* Excluded from this release type: IEvent */
95
+
96
+ /* Excluded from this release type: IFluidDataStoreContext */
97
+
98
+ /* Excluded from this release type: IFluidDataStoreContextDetached */
99
+
100
+ /* Excluded from this release type: IFluidDataStoreFactory */
101
+
102
+ /* Excluded from this release type: IFluidDataStoreRegistry */
103
+
104
+ /* Excluded from this release type: IFluidDataStoreRuntime */
105
+
106
+ /* Excluded from this release type: IFluidDependencySynthesizer */
107
+
108
+ /* Excluded from this release type: IFluidHandle */
109
+
110
+ /* Excluded from this release type: IFluidLoadable */
111
+
112
+ /* Excluded from this release type: IFluidMountableViewClass */
113
+
114
+ /* Excluded from this release type: IFluidRouter */
115
+
116
+ /* Excluded from this release type: IProvideFluidDataStoreRegistry */
117
+
118
+ /* Excluded from this release type: IProvideFluidHandle */
119
+
120
+ /* Excluded from this release type: IRequest */
121
+
122
+ /* Excluded from this release type: IResponse */
123
+
124
+ /* Excluded from this release type: IRootDataObjectFactory */
125
+
126
+ /* Excluded from this release type: ISharedDirectory */
127
+
128
+ /* Excluded from this release type: mountableViewRequestHandler */
129
+
130
+ /* Excluded from this release type: NamedFluidDataStoreRegistryEntries */
131
+
132
+ /* Excluded from this release type: NamedFluidDataStoreRegistryEntry */
133
+
134
+ /* Excluded from this release type: PureDataObject */
135
+
136
+ /* Excluded from this release type: PureDataObjectFactory */
137
+
138
+ /* Excluded from this release type: RequestParser */
139
+
140
+ /* Excluded from this release type: RuntimeFactoryHelper */
141
+
142
+ /* Excluded from this release type: RuntimeRequestHandler */
143
+
144
+ /* Excluded from this release type: TypedEventEmitter */
145
+
146
+ export { }