@fluidframework/test-utils 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.216897

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 (90) hide show
  1. package/api-extractor-lint.json +13 -0
  2. package/api-extractor.json +0 -4
  3. package/api-report/test-utils.api.md +79 -73
  4. package/dist/DriverWrappers.d.ts +3 -0
  5. package/dist/DriverWrappers.d.ts.map +1 -1
  6. package/dist/DriverWrappers.js +3 -0
  7. package/dist/DriverWrappers.js.map +1 -1
  8. package/dist/TestConfigs.d.ts +3 -0
  9. package/dist/TestConfigs.d.ts.map +1 -1
  10. package/dist/TestConfigs.js +3 -0
  11. package/dist/TestConfigs.js.map +1 -1
  12. package/dist/TestSummaryUtils.d.ts +3 -0
  13. package/dist/TestSummaryUtils.d.ts.map +1 -1
  14. package/dist/TestSummaryUtils.js +3 -0
  15. package/dist/TestSummaryUtils.js.map +1 -1
  16. package/dist/containerUtils.d.ts +11 -0
  17. package/dist/containerUtils.d.ts.map +1 -1
  18. package/dist/containerUtils.js +27 -2
  19. package/dist/containerUtils.js.map +1 -1
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +3 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/interfaces.d.ts +6 -0
  25. package/dist/interfaces.d.ts.map +1 -1
  26. package/dist/interfaces.js.map +1 -1
  27. package/dist/loaderContainerTracker.d.ts +3 -0
  28. package/dist/loaderContainerTracker.d.ts.map +1 -1
  29. package/dist/loaderContainerTracker.js +3 -0
  30. package/dist/loaderContainerTracker.js.map +1 -1
  31. package/dist/localCodeLoader.d.ts +7 -0
  32. package/dist/localCodeLoader.d.ts.map +1 -1
  33. package/dist/localCodeLoader.js +1 -0
  34. package/dist/localCodeLoader.js.map +1 -1
  35. package/dist/localLoader.d.ts +2 -0
  36. package/dist/localLoader.d.ts.map +1 -1
  37. package/dist/localLoader.js +2 -0
  38. package/dist/localLoader.js.map +1 -1
  39. package/dist/packageVersion.d.ts +1 -1
  40. package/dist/packageVersion.js +1 -1
  41. package/dist/packageVersion.js.map +1 -1
  42. package/dist/retry.d.ts +1 -0
  43. package/dist/retry.d.ts.map +1 -1
  44. package/dist/retry.js +1 -0
  45. package/dist/retry.js.map +1 -1
  46. package/dist/test-utils-alpha.d.ts +176 -678
  47. package/dist/test-utils-beta.d.ts +176 -678
  48. package/dist/test-utils-public.d.ts +176 -678
  49. package/dist/test-utils-untrimmed.d.ts +348 -37
  50. package/dist/testContainerRuntimeFactory.d.ts +2 -0
  51. package/dist/testContainerRuntimeFactory.d.ts.map +1 -1
  52. package/dist/testContainerRuntimeFactory.js +15 -7
  53. package/dist/testContainerRuntimeFactory.js.map +1 -1
  54. package/dist/testContainerRuntimeFactoryWithDefaultDataStore.d.ts +1 -0
  55. package/dist/testContainerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
  56. package/dist/testContainerRuntimeFactoryWithDefaultDataStore.js +1 -0
  57. package/dist/testContainerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
  58. package/dist/testFluidObject.d.ts +5 -0
  59. package/dist/testFluidObject.d.ts.map +1 -1
  60. package/dist/testFluidObject.js +2 -0
  61. package/dist/testFluidObject.js.map +1 -1
  62. package/dist/testObjectProvider.d.ts +287 -37
  63. package/dist/testObjectProvider.d.ts.map +1 -1
  64. package/dist/testObjectProvider.js +310 -25
  65. package/dist/testObjectProvider.js.map +1 -1
  66. package/dist/timeoutUtils.d.ts +11 -0
  67. package/dist/timeoutUtils.d.ts.map +1 -1
  68. package/dist/timeoutUtils.js +5 -0
  69. package/dist/timeoutUtils.js.map +1 -1
  70. package/lib/test-utils-alpha.d.ts +176 -678
  71. package/lib/test-utils-beta.d.ts +176 -678
  72. package/lib/test-utils-public.d.ts +176 -678
  73. package/lib/test-utils-untrimmed.d.ts +348 -37
  74. package/package.json +34 -24
  75. package/src/DriverWrappers.ts +3 -0
  76. package/src/TestConfigs.ts +3 -0
  77. package/src/TestSummaryUtils.ts +3 -0
  78. package/src/containerUtils.ts +27 -1
  79. package/src/index.ts +7 -1
  80. package/src/interfaces.ts +6 -0
  81. package/src/loaderContainerTracker.ts +3 -0
  82. package/src/localCodeLoader.ts +7 -0
  83. package/src/localLoader.ts +2 -0
  84. package/src/packageVersion.ts +1 -1
  85. package/src/retry.ts +1 -0
  86. package/src/testContainerRuntimeFactory.ts +24 -5
  87. package/src/testContainerRuntimeFactoryWithDefaultDataStore.ts +1 -0
  88. package/src/testFluidObject.ts +5 -0
  89. package/src/testObjectProvider.ts +524 -47
  90. package/src/timeoutUtils.ts +11 -0
@@ -1,682 +1,180 @@
1
- import { ConfigTypes } from '@fluidframework/telemetry-utils';
2
- import { ContainerRuntime } from '@fluidframework/container-runtime';
3
- import { ContainerRuntimeFactoryWithDefaultDataStore } from '@fluidframework/aqueduct';
4
- import { FluidDataStoreRuntime } from '@fluidframework/datastore';
5
- import { FluidObject } from '@fluidframework/core-interfaces';
6
- import { IChannelFactory } from '@fluidframework/datastore-definitions';
7
- import { ICodeDetailsLoader } from '@fluidframework/container-definitions';
8
- import { IConfigProviderBase } from '@fluidframework/telemetry-utils';
9
- import { IContainer } from '@fluidframework/container-definitions';
10
- import { IContainerContext } from '@fluidframework/container-definitions';
11
- import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
12
- import { IContainerRuntimeOptions } from '@fluidframework/container-runtime';
13
- import { IDocumentService } from '@fluidframework/driver-definitions';
14
- import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
15
- import { IDocumentStorageService } from '@fluidframework/driver-definitions';
16
- import { IFluidCodeDetails } from '@fluidframework/container-definitions';
17
- import { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions';
18
- import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions';
19
- import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
20
- import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
21
- import { IFluidHandle } from '@fluidframework/core-interfaces';
22
- import { IFluidLoadable } from '@fluidframework/core-interfaces';
23
- import { IFluidModule } from '@fluidframework/container-definitions';
24
- import { IFluidModuleWithDetails } from '@fluidframework/container-definitions';
25
- import { IHostLoader } from '@fluidframework/container-definitions';
26
- import { ILoaderOptions } from '@fluidframework/container-definitions';
27
- import { ILoaderProps } from '@fluidframework/container-loader';
28
- import { IOnDemandSummarizeOptions } from '@fluidframework/container-runtime';
29
- import { IProvideFluidCodeDetailsComparer } from '@fluidframework/container-definitions';
30
- import { IProvideFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
31
- import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
32
- import { IProvideRuntimeFactory } from '@fluidframework/container-definitions';
33
- import { IRequest } from '@fluidframework/core-interfaces';
34
1
  import { IRequestHeader } from '@fluidframework/core-interfaces';
35
- import { IResolvedUrl } from '@fluidframework/driver-definitions';
36
- import { IResponse } from '@fluidframework/core-interfaces';
37
- import { IRuntime } from '@fluidframework/container-definitions';
38
- import { ISharedMap } from '@fluidframework/map';
39
- import { ISummarizer } from '@fluidframework/container-runtime';
40
- import { ISummaryContext } from '@fluidframework/driver-definitions';
41
2
  import { ISummaryTree } from '@fluidframework/protocol-definitions';
42
- import { ITelemetryBaseEvent } from '@fluidframework/core-interfaces';
43
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
44
- import { ITelemetryGenericEvent } from '@fluidframework/core-interfaces';
45
- import { ITestDriver } from '@fluidframework/test-driver-definitions';
46
- import { IUrlResolver } from '@fluidframework/driver-definitions';
47
- import { Loader } from '@fluidframework/container-loader';
48
- import { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions';
49
- import { RuntimeRequestHandler } from '@fluidframework/request-handler';
50
-
51
- export declare type ChannelFactoryRegistry = Iterable<[string | undefined, IChannelFactory]>;
52
-
53
- /**
54
- * Creates a detached Container and attaches it.
55
- * @param source - The code details used to create the Container.
56
- * @param loader - The loader to use to initialize the container.
57
- * @param attachRequest - The request to create new from.
58
- */
59
- export declare function createAndAttachContainer(source: IFluidCodeDetails, loader: IHostLoader, attachRequest: IRequest): Promise<IContainer>;
60
-
61
- /**
62
- * ! Note: This function is purely needed for back-compat as the constructor argument structure was changed
63
- */
64
- export declare const createContainerRuntimeFactoryWithDefaultDataStore: (Base: typeof ContainerRuntimeFactoryWithDefaultDataStore | undefined, ctorArgs: {
65
- defaultFactory: IFluidDataStoreFactory;
66
- registryEntries: NamedFluidDataStoreRegistryEntries;
67
- dependencyContainer?: any;
68
- requestHandlers?: RuntimeRequestHandler[] | undefined;
69
- runtimeOptions?: IContainerRuntimeOptions | undefined;
70
- provideEntryPoint?: ((runtime: IContainerRuntime) => Promise<FluidObject>) | undefined;
71
- }) => ContainerRuntimeFactoryWithDefaultDataStore;
72
-
73
- export declare const createDocumentId: () => string;
74
-
75
- /**
76
- * Creates a loader with the given package entries and driver.
77
- * @param packageEntries - A list of code details to Fluid entry points.
78
- * @param documentServiceFactory - the driver factory to use
79
- * @param urlResolver - the url resolver to use
80
- * @param options - loader options
81
- */
82
- export declare function createLoader(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, documentServiceFactory: IDocumentServiceFactory, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger, options?: ILoaderOptions): IHostLoader;
83
-
84
- /**
85
- * Creates a summarizer client from the given container and returns the summarizer client's IContainer and ISummarizer.
86
- * The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
87
- *
88
- * Can pass in a test config provider to enable/disable features.
89
- */
90
- export declare function createSummarizer(provider: ITestObjectProvider, container: IContainer, config?: ITestContainerConfig, summaryVersion?: string, logger?: ITelemetryBaseLogger): Promise<{
91
- container: IContainer;
92
- summarizer: ISummarizer;
93
- }>;
94
-
95
- /**
96
- * Creates a summarizer client from the given container and data store factory, and returns the summarizer client's
97
- * IContainer and ISummarizer.
98
- * The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
99
- */
100
- export declare function createSummarizerFromFactory(provider: ITestObjectProvider, container: IContainer, dataStoreFactory: IFluidDataStoreFactory, summaryVersion?: string, containerRuntimeFactoryType?: typeof ContainerRuntimeFactoryWithDefaultDataStore, registryEntries?: NamedFluidDataStoreRegistryEntries, logger?: ITelemetryBaseLogger, configProvider?: IConfigProviderBase): Promise<{
101
- container: IContainer;
102
- summarizer: ISummarizer;
103
- }>;
104
-
105
- /**
106
- * Create a container runtime factory class that allows you to set runtime options
107
- */
108
- export declare const createTestContainerRuntimeFactory: (containerRuntimeCtor: typeof ContainerRuntime) => {
109
- new (type: string, dataStoreFactory: IFluidDataStoreFactory, runtimeOptions?: IContainerRuntimeOptions, requestHandlers?: RuntimeRequestHandler[]): {
110
- type: string;
111
- dataStoreFactory: IFluidDataStoreFactory;
112
- runtimeOptions: IContainerRuntimeOptions;
113
- requestHandlers: RuntimeRequestHandler[];
114
- instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
115
- instantiateFromExisting(runtime: ContainerRuntime): Promise<void>;
116
- preInitialize(context: IContainerContext, existing: boolean): Promise<IRuntime & IContainerRuntime>;
117
- readonly IRuntimeFactory: any;
118
- instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
119
- hasInitialized(_runtime: IContainerRuntime): Promise<void>;
120
- };
121
- };
122
-
123
- export declare enum DataObjectFactoryType {
124
- Primed = 0,
125
- Test = 1
126
- }
127
-
128
- export declare const defaultTimeoutDurationMs = 250;
129
-
130
- /**
131
- * This class tracks events. It allows specifying expected events, which will be looked for in order.
132
- * It also tracks all unexpected errors.
133
- * At any point you call reportAndClearTrackedEvents which will provide all unexpected errors, and
134
- * any expected events that have not occurred.
135
- */
136
- export declare class EventAndErrorTrackingLogger implements ITelemetryBaseLogger {
137
- private readonly baseLogger;
138
- /**
139
- * Even if these error events are logged, tests should still be allowed to pass
140
- * Additionally, if downgrade is true, then log as generic (e.g. to avoid polluting the e2e test logs)
141
- */
142
- private readonly allowedErrors;
143
- constructor(baseLogger: ITelemetryBaseLogger);
144
- private readonly expectedEvents;
145
- private readonly unexpectedErrors;
146
- registerExpectedEvent(...orderedExpectedEvents: ITelemetryGenericEvent[]): void;
147
- send(event: ITelemetryBaseEvent): void;
148
- reportAndClearTrackedEvents(): {
149
- expectedNotFound: ({
150
- index: number;
151
- event: ITelemetryGenericEvent | undefined;
152
- } | undefined)[];
153
- unexpectedErrors: ITelemetryBaseEvent[];
154
- };
155
- }
156
-
157
- export declare type fluidEntryPoint = SupportedExportInterfaces | IFluidModule;
158
-
159
- /**
160
- * This function should ONLY be used for back compat purposes
161
- * LTS versions of the Loader/Container will not have the "getEntryPoint" method, so we need to fallback to "request"
162
- * This function can be removed once LTS version of Loader moves to 2.0.0-internal.7.0.0
163
- */
164
- export declare function getContainerEntryPointBackCompat<T>(container: IContainer): Promise<T>;
165
-
166
- export declare function getUnexpectedLogErrorException(logger: EventAndErrorTrackingLogger | undefined, prefix?: string): Error | undefined;
167
-
168
- export declare interface IOpProcessingController {
169
- processIncoming(...containers: IContainer[]): Promise<void>;
170
- processOutgoing(...containers: IContainer[]): Promise<void>;
171
- pauseProcessing(...containers: IContainer[]): Promise<void>;
172
- resumeProcessing(...containers: IContainer[]): void;
173
- }
174
-
175
- export declare interface IProvideTestFluidObject {
176
- readonly ITestFluidObject: ITestFluidObject;
177
- }
178
-
179
- export declare interface ITestContainerConfig {
180
- /** TestFluidDataObject instead of PrimedDataStore */
181
- fluidDataObjectType?: DataObjectFactoryType;
182
- /** An array of channel name and DDS factory pair to create on container creation time */
183
- registry?: ChannelFactoryRegistry;
184
- /** Container runtime options for the container instance */
185
- runtimeOptions?: IContainerRuntimeOptions;
186
- /** Whether this runtime should be instantiated using a mixed-in attributor class */
187
- enableAttribution?: boolean;
188
- /** Loader options for the loader used to create containers */
189
- loaderProps?: Partial<ILoaderProps>;
190
- }
191
-
192
- export declare interface ITestFluidObject extends IProvideTestFluidObject, IFluidLoadable {
193
- root: ISharedMap;
194
- readonly runtime: IFluidDataStoreRuntime;
195
- readonly channel: IFluidDataStoreChannel;
196
- readonly context: IFluidDataStoreContext;
197
- getSharedObject<T = any>(id: string): Promise<T>;
198
- }
199
-
200
- export declare interface ITestObjectProvider {
201
- createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint;
202
- createLoader(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, loaderProps?: Partial<ILoaderProps>): IHostLoader;
203
- createContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>): Promise<IContainer>;
204
- loadContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>, requestHeader?: IRequestHeader): Promise<IContainer>;
205
- /**
206
- * Used to create a test Container. The Loader/ContainerRuntime/DataRuntime might be different versioned.
207
- * In generateLocalCompatTest(), this Container and its runtime will be arbitrarily-versioned.
208
- */
209
- makeTestLoader(testContainerConfig?: ITestContainerConfig): IHostLoader;
210
- makeTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer>;
211
- loadTestContainer(testContainerConfig?: ITestContainerConfig, requestHeader?: IRequestHeader): Promise<IContainer>;
212
- /**
213
- *
214
- * @param url - Resolved container URL
215
- */
216
- updateDocumentId(url: IResolvedUrl | undefined): void;
217
- logger: ITelemetryBaseLogger;
218
- documentServiceFactory: IDocumentServiceFactory;
219
- urlResolver: IUrlResolver;
220
- defaultCodeDetails: IFluidCodeDetails;
221
- opProcessingController: IOpProcessingController;
222
- ensureSynchronized(timeoutDuration?: number): Promise<void>;
223
- reset(): void;
224
- documentId: string;
225
- driver: ITestDriver;
226
- }
227
-
228
- export declare class LoaderContainerTracker implements IOpProcessingController {
229
- private readonly syncSummarizerClients;
230
- private readonly containers;
231
- private lastProposalSeqNum;
232
- constructor(syncSummarizerClients?: boolean);
233
- /**
234
- * Add a loader to start to track any container created from them
235
- * @param loader - loader to start tracking any container created.
236
- */
237
- add<LoaderType extends IHostLoader>(loader: LoaderType): void;
238
- /**
239
- * Utility function to add container to be tracked.
240
- *
241
- * @param container - container to add
242
- */
243
- private addContainer;
244
- /**
245
- * Keep track of the trailing NoOp that was sent so we can discount them in the clientSequenceNumber tracking.
246
- * The server might coalesce them with other ops, or a single NoOp, or delay it if it don't think it is necessary.
247
- *
248
- * @param container - the container to track
249
- * @param record - the record to update the trailing op information
250
- */
251
- private trackTrailingNoOps;
252
- private trackLastProposal;
253
- /**
254
- * Reset the tracker, closing all containers and stop tracking them.
255
- */
256
- reset(): void;
257
- /**
258
- * Make sure all the tracked containers are synchronized.
259
- *
260
- * No isDirty (non-readonly) containers
261
- * No extra clientId in quorum of any container that is not tracked and still opened.
262
- * - i.e. no pending Join/Leave message.
263
- * No unresolved proposal (minSeqNum \>= lastProposalSeqNum)
264
- * lastSequenceNumber of all container is the same
265
- * clientSequenceNumberObserved is the same as clientSequenceNumber sent
266
- * - this overlaps with !isDirty, but include task scheduler ops.
267
- * - Trailing NoOp is tracked and don't count as pending ops.
268
- *
269
- * Containers that are already pause will resume process and paused again once
270
- * everything is synchronized. Containers that aren't paused will remain unpaused when this
271
- * function returns.
272
- */
273
- ensureSynchronized(...containers: IContainer[]): Promise<void>;
274
- /**
275
- * Utility to calculate the set of clientId per container in quorum that is NOT associated with
276
- * any container we tracked, indicating there is a pending join or leave op that we need to wait.
277
- *
278
- * @param containersToApply - the set of containers to check
279
- */
280
- private getPendingClients;
281
- /**
282
- * Utility to check synchronization based on sequence number
283
- * See ensureSynchronized for more detail
284
- *
285
- * @param containersToApply - the set of containers to check
286
- */
287
- private needSequenceNumberSynchronize;
288
- private containerIndexStrings;
289
- /**
290
- * Utility to wait for any clientId in quorum that is NOT associated with any container we
291
- * tracked, indicating there is a pending join or leave op that we need to wait.
292
- *
293
- * Note that this function doesn't account for container that got added after we started waiting
294
- *
295
- * @param containersToApply - the set of containers to wait for any inbound ops for
296
- */
297
- private waitForPendingClients;
298
- /**
299
- * Utility to wait for any inbound ops from a set of containers
300
- * @param containersToApply - the set of containers to wait for any inbound ops for
301
- */
302
- private waitForAnyInboundOps;
303
- /**
304
- * Resume all queue activities on all paused tracked containers and return them
305
- */
306
- resumeProcessing(...containers: IContainer[]): IContainer[];
307
- /**
308
- * Pause all queue activities on the containers given, or all tracked containers
309
- * Any containers given that is not tracked will be ignored.
310
- *
311
- * When a container is paused, it is assumed that we want fine grain control over op
312
- * sequencing. This function will prepare the container and force it into write mode to
313
- * avoid missing join messages or change the sequence of event when switching from read to
314
- * write mode.
315
- */
316
- pauseProcessing(...containers: IContainer[]): Promise<void>;
317
- /**
318
- * When a container is paused, it is assumed that we want fine grain control over op
319
- * sequencing. This function will prepare the container and force it into write mode to
320
- * avoid missing join messages or change the sequence of event when switching from read to
321
- * write mode.
322
- *
323
- * @param container - the container to pause
324
- * @param record - the record for the container
325
- */
326
- private pauseContainer;
327
- /**
328
- * Pause all queue activities on all tracked containers, and resume only
329
- * inbound to process ops until it is idle. All queues are left in the paused state
330
- * after the function.
331
- *
332
- * Pausing will switch the container to write mode. See `pauseProcessing`
333
- */
334
- processIncoming(...containers: IContainer[]): Promise<void>;
335
- /**
336
- * Pause all queue activities on all tracked containers, and resume only
337
- * outbound to process ops until it is idle. All queues are left in the paused state
338
- * after the function.
339
- *
340
- * Pausing will switch the container to write mode. See `pauseProcessing`
341
- */
342
- processOutgoing(...containers: IContainer[]): Promise<void>;
343
- /**
344
- * Implementation of processIncoming and processOutgoing
345
- */
346
- private processQueue;
347
- /**
348
- * Utility to set up listener to track the outbound ops until it round trip back
349
- * Returns a function to remove the handler after it is done.
350
- *
351
- * @param container - the container to setup
352
- * @param inflightTracker - a map to track the clientSequenceNumber per container it expect to get ops back
353
- */
354
- private setupInOutTracker;
355
- /**
356
- * Setup debug traces for connection and ops
357
- */
358
- private setupTrace;
359
- /**
360
- * Filter out the opened containers based on param.
361
- * @param containers - The container to filter to. If the array is empty, it means don't filter and return
362
- * all open containers.
363
- */
364
- private getContainers;
365
- }
366
-
367
- /**
368
- * A simple code loader that caches a mapping of package name to a Fluid entry point.
369
- * On load, it retrieves the entry point matching the package name in the given code details.
370
- */
371
- export declare class LocalCodeLoader implements ICodeDetailsLoader {
372
- private readonly fluidPackageCache;
373
- constructor(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, runtimeOptions?: IContainerRuntimeOptions);
374
- /**
375
- * It finds the entry point for the package name in the given source and return it
376
- * as a Fluid module.
377
- * @param source - Details of where to find chaincode
378
- */
379
- load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;
380
- }
381
-
382
- export declare const mockConfigProvider: (settings?: Record<string, ConfigTypes>) => IConfigProviderBase;
383
-
384
- /**
385
- * Simple retry mechanism with linear back off to call
386
- * a function which may eventually return an accepted value.
387
- *
388
- * @param callback - the function to execute
389
- * @param check - the function to check if the value is acceptable
390
- * @param defaultValue - the default value
391
- * @param maxTries - maximum number of attempts
392
- * @param backOffMs - back off between attempts in milliseconds
393
- * @returns the actual value from the callback when successful or the default value otherwise
394
- */
395
- export declare const retryWithEventualValue: <T>(callback: () => Promise<T>, check: (value: T) => boolean, defaultValue: T, maxTries?: number, backOffMs?: number) => Promise<T>;
396
-
397
- /**
398
- * Summarizes on demand and returns the summary tree, the version number and the reference sequence number of the
399
- * submitted summary.
400
- *
401
- * @param summarizer - The ISummarizer to use to summarize on demand
402
- * @param inputs - Either the reason string or the full IOnDemandSummarizeOptions.
403
- * Defaults to the reason "end-to-end test".
404
- */
405
- export declare function summarizeNow(summarizer: ISummarizer, inputs?: string | IOnDemandSummarizeOptions): Promise<{
406
- summaryTree: ISummaryTree;
407
- summaryVersion: string;
408
- summaryRefSeq: number;
409
- }>;
410
-
411
- export declare type SupportedExportInterfaces = Partial<IProvideRuntimeFactory & IProvideFluidDataStoreFactory & IProvideFluidDataStoreRegistry & IProvideFluidCodeDetailsComparer>;
412
-
413
- /**
414
- * A container runtime factory that allows you to set runtime options
415
- */
416
- export declare const TestContainerRuntimeFactory: {
417
- new (type: string, dataStoreFactory: IFluidDataStoreFactory, runtimeOptions?: IContainerRuntimeOptions, requestHandlers?: RuntimeRequestHandler[]): {
418
- type: string;
419
- dataStoreFactory: IFluidDataStoreFactory;
420
- runtimeOptions: IContainerRuntimeOptions;
421
- requestHandlers: RuntimeRequestHandler[];
422
- instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
423
- instantiateFromExisting(runtime: ContainerRuntime): Promise<void>;
424
- preInitialize(context: IContainerContext, existing: boolean): Promise<IRuntime & IContainerRuntime>;
425
- readonly IRuntimeFactory: any;
426
- instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
427
- hasInitialized(_runtime: IContainerRuntime): Promise<void>;
428
- };
429
- };
430
-
431
- /**
432
- * A test Fluid object that will create a shared object for each key-value pair in the factoryEntries passed to load.
433
- * The shared objects can be retrieved by passing the key of the entry to getSharedObject.
434
- * It exposes the IFluidDataStoreContext and IFluidDataStoreRuntime.
435
- */
436
- export declare class TestFluidObject implements ITestFluidObject {
437
- readonly runtime: IFluidDataStoreRuntime;
438
- readonly channel: IFluidDataStoreChannel;
439
- readonly context: IFluidDataStoreContext;
440
- private readonly factoryEntriesMap;
441
- get ITestFluidObject(): this;
442
- get IFluidLoadable(): this;
443
- /**
444
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
445
- */
446
- get IFluidRouter(): this;
447
- get handle(): IFluidHandle<this>;
448
- root: ISharedMap;
449
- private readonly innerHandle;
450
- private initializeP;
451
- /**
452
- * Creates a new TestFluidObject.
453
- * @param runtime - The data store runtime.
454
- * @param context - The data store context.
455
- * @param factoryEntries - A list of id to IChannelFactory mapping. For each item in the list,
456
- * a shared object is created which can be retrieved by calling getSharedObject() with the id;
457
- */
458
- constructor(runtime: IFluidDataStoreRuntime, channel: IFluidDataStoreChannel, context: IFluidDataStoreContext, factoryEntriesMap: Map<string, IChannelFactory>);
459
- /**
460
- * Retrieves a shared object with the given id.
461
- * @param id - The id of the shared object to retrieve.
462
- */
463
- getSharedObject<T = any>(id: string): Promise<T>;
464
- /**
465
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
466
- */
467
- request(request: IRequest): Promise<IResponse>;
468
- initialize(existing: boolean): Promise<void>;
469
- }
470
-
471
- /**
472
- * Creates a factory for a TestFluidObject with the given object factory entries. It creates a data store runtime
473
- * with the object factories in the entry list. All the entries with an id other than undefined are passed to the
474
- * Fluid object so that it can create a shared object for each.
475
- *
476
- * @example
477
- *
478
- * The following will create a Fluid object that creates and loads a SharedString and SharedDirectory.
479
- * It will add SparseMatrix to the data store's factory so that it can be created later.
480
- *
481
- * ```typescript
482
- * new TestFluidObjectFactory([
483
- * [ "sharedString", SharedString.getFactory() ],
484
- * [ "sharedDirectory", SharedDirectory.getFactory() ],
485
- * [ undefined, SparseMatrix.getFactory() ],
486
- * ]);
487
- * ```
488
- *
489
- * The SharedString and SharedDirectory can be retrieved via getSharedObject() on the TestFluidObject as follows:
490
- *
491
- * ```typescript
492
- * sharedString = testFluidObject.getSharedObject<SharedString>("sharedString");
493
- * sharedDir = testFluidObject.getSharedObject<SharedDirectory>("sharedDirectory");
494
- * ```
495
- *
496
- * @privateRemarks Beware that using this class generally forfeits some compatibility coverage
497
- * `describeCompat` aims to provide:
498
- * `SharedMap`s always reference the current version of SharedMap.
499
- * AB#4670 tracks improving this situation.
500
- */
501
- export declare class TestFluidObjectFactory implements IFluidDataStoreFactory {
502
- private readonly factoryEntries;
503
- readonly type: string;
504
- get IFluidDataStoreFactory(): this;
505
- /**
506
- * Creates a new TestFluidObjectFactory.
507
- * @param factoryEntries - A list of id to IChannelFactory mapping. It creates a data store runtime with each
508
- * IChannelFactory. Entries with string ids are passed to the Fluid object so that it can create a shared object
509
- * for it.
510
- */
511
- constructor(factoryEntries: ChannelFactoryRegistry, type?: string);
512
- instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<FluidDataStoreRuntime>;
513
- }
514
-
515
- /**
516
- * Shared base class for test object provider. Contain code for loader and container creation and loading
517
- */
518
- export declare class TestObjectProvider implements ITestObjectProvider {
519
- readonly LoaderConstructor: typeof Loader;
520
- readonly driver: ITestDriver;
521
- readonly createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint;
522
- private _loaderContainerTracker;
523
- private _documentServiceFactory;
524
- private _urlResolver;
525
- private _logger;
526
- private readonly _documentIdStrategy;
527
- private _documentCreated;
528
- /**
529
- * Manage objects for loading and creating container, including the driver, loader, and OpProcessingController
530
- * @param createFluidEntryPoint - callback to create a fluidEntryPoint, with an optional set of channel name
531
- * and factory for TestFluidObject
532
- */
533
- constructor(LoaderConstructor: typeof Loader, driver: ITestDriver, createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint);
534
- get logger(): EventAndErrorTrackingLogger;
535
- set logger(logger: EventAndErrorTrackingLogger);
536
- get documentServiceFactory(): IDocumentServiceFactory;
537
- get urlResolver(): IUrlResolver;
538
- get documentId(): string;
539
- get defaultCodeDetails(): IFluidCodeDetails;
540
- get opProcessingController(): IOpProcessingController;
541
- /**
542
- * Create a loader. Containers created/loaded through this loader will be added to the OpProcessingController.
543
- *
544
- * Only the version of the loader will vary based on compat config. The version of
545
- * containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.
546
- *
547
- * @param packageEntries - list of code details and fluidEntryPoint pairs.
548
- */
549
- createLoader(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, loaderProps?: Partial<ILoaderProps>): Loader;
550
- /**
551
- * Create a container using a default document id and code details.
552
- * Container created is automatically added to the OpProcessingController to manage op flow
553
- *
554
- * Only the version of the loader will vary based on compat config. The version of
555
- * containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.
556
- *
557
- * @param packageEntries - list of code details and fluidEntryPoint pairs.
558
- */
559
- createContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>): Promise<IContainer>;
560
- loadContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>, requestHeader?: IRequestHeader): Promise<IContainer>;
561
- private resolveContainer;
562
- /**
563
- * Make a test loader. Containers created/loaded through this loader will be added to the OpProcessingController.
564
- * The version of the loader/containerRuntime/dataRuntime may vary based on compat config of the current run
565
- * @param testContainerConfig - optional configuring the test Container
566
- */
567
- makeTestLoader(testContainerConfig?: ITestContainerConfig): Loader;
568
- /**
569
- * Make a container using a default document id and code details
570
- * Container loaded is automatically added to the OpProcessingController to manage op flow
571
- * @param testContainerConfig - optional configuring the test Container
572
- */
573
- makeTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer>;
574
- /**
575
- * Load a container using a default document id and code details.
576
- * IContainer loaded is automatically added to the OpProcessingController to manage op flow
577
- * @param testContainerConfig - optional configuring the test Container
578
- * @param requestHeader - optional headers to be supplied to the loader
579
- */
580
- loadTestContainer(testContainerConfig?: ITestContainerConfig, requestHeader?: IRequestHeader): Promise<IContainer>;
581
- reset(): void;
582
- ensureSynchronized(): Promise<void>;
583
- waitContainerToCatchUp(container: IContainer): Promise<boolean>;
584
- updateDocumentId(resolvedUrl: IResolvedUrl | undefined): void;
585
- resetLoaderContainerTracker(syncSummarizerClients?: boolean): void;
586
- }
587
-
588
- /**
589
- * Wraps the given promise around with promise that will complete after a specific timeout if the original promise does
590
- * not resolve by then. By default, it uses the mocha test timeout and complete the promise just before that so that
591
- * tests don't time out because of unpredictable awaits.
592
- * The timeout can be overridden via timeoutOptions but it's recommended to use the default value.
593
- * @param promise - The promise to be awaited.
594
- * @param timeoutOptions - Options that can be used to override the timeout and / or define the behavior
595
- * when the promise is not fulfilled. For example, instead of rejecting the promise, resolve with a
596
- * specific value.
597
- * @returns A new promise that will complete when the given promise resolves or the timeout expires.
598
- */
599
- export declare function timeoutAwait<T = void>(promise: PromiseLike<T>, timeoutOptions?: TimeoutWithError | TimeoutWithValue<T>): Promise<T>;
600
-
601
- /**
602
- * Creates a promise from the given executor that will complete after a specific timeout. By default, it uses the mocha
603
- * test timeout and complete the promise just before that so that tests don't time out because of unpredictable awaits.
604
- * The timeout can be overridden via timeoutOptions but it's recommended to use the default value.
605
- * @param executor - The executor for the promise.
606
- * @param timeoutOptions - Options that can be used to override the timeout and / or define the behavior when
607
- * the promise is not fulfilled. For example, instead of rejecting the promise, resolve with a specific value.
608
- * @returns A new promise that will complete when the given executor resolves or the timeout expires.
609
- */
610
- export declare function timeoutPromise<T = void>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void, timeoutOptions?: TimeoutWithError | TimeoutWithValue<T>): Promise<T>;
611
-
612
- export declare interface TimeoutWithError {
613
- /**
614
- * Timeout duration in milliseconds, if it is great than 0 and not Infinity
615
- * If it is undefined, then it will use test timeout if we are in side the test function
616
- * Otherwise, there is no timeout
617
- */
618
- durationMs?: number;
619
- reject?: true;
620
- errorMsg?: string;
621
- }
622
-
623
- export declare interface TimeoutWithValue<T = void> {
624
- /**
625
- * Timeout duration in milliseconds, if it is great than 0 and not Infinity
626
- * If it is undefined, then it will use test timeout if we are in side the test function
627
- * Otherwise, there is no timeout
628
- */
629
- durationMs?: number;
630
- reject: false;
631
- value: T;
632
- }
633
-
634
- /**
635
- * Utility function to wait for the specified Container to be in Connected state.
636
- * If the Container is already connected, the Promise returns immediately; otherwise it resolves when the Container emits
637
- * its 'connected' event.
638
- * If failOnContainerClose === true, the returned Promise will be rejected if the container emits a 'closed' event
639
- * before a 'connected' event.
640
- * @param container - The container to wait for.
641
- * @param failOnContainerClose - If true, the returned Promise will be rejected if the container emits a 'closed' event
642
- * before a 'connected' event.
643
- * Defaults to true.
644
- * @param timeoutOptions - Options related to the behavior of the timeout.
645
- * If provided, the returned Promise will reject if the container hasn't emitted relevant events in timeoutOptions.durationMs.
646
- * If not provided, the Promise will wait indefinitely for the Container to emit its 'connected' (or 'closed', if
647
- * failOnContainerClose === true) event.
648
- *
649
- * @returns A Promise that either:
650
- * - Resolves when the specified container emits a 'connected' event (or immediately if the Container is already connected).
651
- * - Rejects if failOnContainerClose === true and the container emits a 'closed' event before a 'connected' event.
652
- * - Rejects after timeoutOptions.durationMs if timeoutOptions !== undefined and the container does not emit relevant
653
- * events, within that timeframe.
654
- */
655
- export declare function waitForContainerConnection(container: IContainer, failOnContainerClose?: boolean, timeoutOptions?: TimeoutWithError): Promise<void>;
656
-
657
- /**
658
- * Wraps the given IDocumentService to override the `connectToStorage` method. The intent is to plumb the
659
- * `uploadSummaryCb` to the IDocumentStorageService so that it is called whenever a summary is uploaded by
660
- * the client.
661
- * The document storage service that is created in `connectToStorage` is wrapped by calling `wrapDocumentStorageService`
662
- * to pass in the `uploadSummaryCb`.
663
- */
664
- export declare function wrapDocumentService(innerDocService: IDocumentService, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentService;
665
-
666
- /**
667
- * Wraps the given IDocumentServiceFactory to override the `createDocumentService` method. The intent is to plumb
668
- * the `uploadSummaryCb` all the way to the IDocumentStorageService so that it is called whenever a summary is
669
- * uploaded by the client.
670
- * The document service that is created in `createDocumentService` is wrapped by calling `wrapDocumentService` to
671
- * pass in the `uploadSummaryCb`.
672
- */
673
- export declare function wrapDocumentServiceFactory(innerDocServiceFactory: IDocumentServiceFactory, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentServiceFactory;
674
-
675
- /**
676
- * Wraps the given IDocumentStorageService to override the `uploadSummaryWithContext` method. It calls the
677
- * `uploadSummaryCb` whenever a summary is uploaded by the client. The summary context can be updated in the
678
- * callback before it is uploaded to the server.
679
- */
680
- export declare function wrapDocumentStorageService(innerDocStorageService: IDocumentStorageService, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentStorageService;
3
+
4
+ /* Excluded from this release type: ChannelFactoryRegistry */
5
+
6
+ /* Excluded from this release type: ConfigTypes */
7
+
8
+ /* Excluded from this release type: ContainerRuntime */
9
+
10
+ /* Excluded from this release type: ContainerRuntimeFactoryWithDefaultDataStore */
11
+
12
+ /* Excluded from this release type: createAndAttachContainer */
13
+
14
+ /* Excluded from this release type: createContainerRuntimeFactoryWithDefaultDataStore */
15
+
16
+ /* Excluded from this release type: createDocumentId */
17
+
18
+ /* Excluded from this release type: createLoader */
19
+
20
+ /* Excluded from this release type: createSummarizer */
21
+
22
+ /* Excluded from this release type: createSummarizerFromFactory */
23
+
24
+ /* Excluded from this release type: createTestContainerRuntimeFactory */
25
+
26
+ /* Excluded from this release type: DataObjectFactoryType */
27
+
28
+ /* Excluded from this release type: defaultTimeoutDurationMs */
29
+
30
+ /* Excluded from this release type: EventAndErrorTrackingLogger */
31
+
32
+ /* Excluded from this release type: FluidDataStoreRuntime */
33
+
34
+ /* Excluded from this release type: fluidEntryPoint */
35
+
36
+ /* Excluded from this release type: FluidObject */
37
+
38
+ /* Excluded from this release type: getContainerEntryPointBackCompat */
39
+
40
+ /* Excluded from this release type: getDataStoreEntryPointBackCompat */
41
+
42
+ /* Excluded from this release type: getUnexpectedLogErrorException */
43
+
44
+ /* Excluded from this release type: IChannelFactory */
45
+
46
+ /* Excluded from this release type: ICodeDetailsLoader */
47
+
48
+ /* Excluded from this release type: IConfigProviderBase */
49
+
50
+ /* Excluded from this release type: IContainer */
51
+
52
+ /* Excluded from this release type: IContainerContext */
53
+
54
+ /* Excluded from this release type: IContainerRuntime */
55
+
56
+ /* Excluded from this release type: IContainerRuntimeOptions */
57
+
58
+ /* Excluded from this release type: IDataStore */
59
+
60
+ /* Excluded from this release type: IDocumentIdStrategy */
61
+
62
+ /* Excluded from this release type: IDocumentService */
63
+
64
+ /* Excluded from this release type: IDocumentServiceFactory */
65
+
66
+ /* Excluded from this release type: IDocumentStorageService */
67
+
68
+ /* Excluded from this release type: IFluidCodeDetails */
69
+
70
+ /* Excluded from this release type: IFluidDataStoreChannel */
71
+
72
+ /* Excluded from this release type: IFluidDataStoreContext */
73
+
74
+ /* Excluded from this release type: IFluidDataStoreFactory */
75
+
76
+ /* Excluded from this release type: IFluidDataStoreRuntime */
77
+
78
+ /* Excluded from this release type: IFluidHandle */
79
+
80
+ /* Excluded from this release type: IFluidLoadable */
81
+
82
+ /* Excluded from this release type: IFluidModule */
83
+
84
+ /* Excluded from this release type: IFluidModuleWithDetails */
85
+
86
+ /* Excluded from this release type: IHostLoader */
87
+
88
+ /* Excluded from this release type: ILoaderOptions */
89
+
90
+ /* Excluded from this release type: ILoaderProps */
91
+
92
+ /* Excluded from this release type: IOnDemandSummarizeOptions */
93
+
94
+ /* Excluded from this release type: IOpProcessingController */
95
+
96
+ /* Excluded from this release type: IProvideFluidCodeDetailsComparer */
97
+
98
+ /* Excluded from this release type: IProvideFluidDataStoreFactory */
99
+
100
+ /* Excluded from this release type: IProvideFluidDataStoreRegistry */
101
+
102
+ /* Excluded from this release type: IProvideRuntimeFactory */
103
+
104
+ /* Excluded from this release type: IProvideTestFluidObject */
105
+
106
+ /* Excluded from this release type: IRequest */
107
+
108
+ /* Excluded from this release type: IResolvedUrl */
109
+
110
+ /* Excluded from this release type: IResponse */
111
+
112
+ /* Excluded from this release type: IRuntime */
113
+
114
+ /* Excluded from this release type: ISharedMap */
115
+
116
+ /* Excluded from this release type: ISummarizer */
117
+
118
+ /* Excluded from this release type: ISummaryContext */
119
+
120
+ /* Excluded from this release type: ITelemetryBaseEvent */
121
+
122
+ /* Excluded from this release type: ITelemetryBaseLogger */
123
+
124
+ /* Excluded from this release type: ITelemetryGenericEvent */
125
+
126
+ /* Excluded from this release type: ITestContainerConfig */
127
+
128
+ /* Excluded from this release type: ITestDriver */
129
+
130
+ /* Excluded from this release type: ITestFluidObject */
131
+
132
+ /* Excluded from this release type: ITestObjectProvider */
133
+
134
+ /* Excluded from this release type: IUrlResolver */
135
+
136
+ /* Excluded from this release type: Loader */
137
+
138
+ /* Excluded from this release type: LoaderContainerTracker */
139
+
140
+ /* Excluded from this release type: LocalCodeLoader */
141
+
142
+ /* Excluded from this release type: mockConfigProvider */
143
+
144
+ /* Excluded from this release type: NamedFluidDataStoreRegistryEntries */
145
+
146
+ /* Excluded from this release type: retryWithEventualValue */
147
+
148
+ /* Excluded from this release type: RuntimeRequestHandler */
149
+
150
+ /* Excluded from this release type: summarizeNow */
151
+
152
+ /* Excluded from this release type: SupportedExportInterfaces */
153
+
154
+ /* Excluded from this release type: TestContainerRuntimeFactory */
155
+
156
+ /* Excluded from this release type: TestFluidObject */
157
+
158
+ /* Excluded from this release type: TestFluidObjectFactory */
159
+
160
+ /* Excluded from this release type: TestObjectProvider */
161
+
162
+ /* Excluded from this release type: TestObjectProviderWithVersionedLoad */
163
+
164
+ /* Excluded from this release type: timeoutAwait */
165
+
166
+ /* Excluded from this release type: timeoutPromise */
167
+
168
+ /* Excluded from this release type: TimeoutWithError */
169
+
170
+ /* Excluded from this release type: TimeoutWithValue */
171
+
172
+ /* Excluded from this release type: waitForContainerConnection */
173
+
174
+ /* Excluded from this release type: wrapDocumentService */
175
+
176
+ /* Excluded from this release type: wrapDocumentServiceFactory */
177
+
178
+ /* Excluded from this release type: wrapDocumentStorageService */
681
179
 
682
180
  export { }