@fluidframework/test-utils 1.4.0-115997 → 2.0.0-dev-rc.1.0.0.224419
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.
- package/.eslintrc.js +8 -7
- package/.mocharc.js +12 -0
- package/CHANGELOG.md +177 -0
- package/README.md +44 -14
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/test-utils.api.md +395 -0
- package/dist/DriverWrappers.d.ts +32 -0
- package/dist/DriverWrappers.d.ts.map +1 -0
- package/dist/DriverWrappers.js +57 -0
- package/dist/DriverWrappers.js.map +1 -0
- package/dist/TestConfigs.d.ts +10 -0
- package/dist/TestConfigs.d.ts.map +1 -0
- package/dist/TestConfigs.js +17 -0
- package/dist/TestConfigs.js.map +1 -0
- package/dist/TestSummaryUtils.d.ts +61 -0
- package/dist/TestSummaryUtils.d.ts.map +1 -0
- package/dist/TestSummaryUtils.js +135 -0
- package/dist/TestSummaryUtils.js.map +1 -0
- package/dist/containerUtils.d.ts +46 -0
- package/dist/containerUtils.d.ts.map +1 -0
- package/dist/containerUtils.js +85 -0
- package/dist/containerUtils.js.map +1 -0
- package/dist/index.d.ts +14 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -19
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +6 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js.map +1 -1
- package/dist/loaderContainerTracker.d.ts +39 -15
- package/dist/loaderContainerTracker.d.ts.map +1 -1
- package/dist/loaderContainerTracker.js +214 -86
- package/dist/loaderContainerTracker.js.map +1 -1
- package/dist/localCodeLoader.d.ts +9 -2
- package/dist/localCodeLoader.d.ts.map +1 -1
- package/dist/localCodeLoader.js +18 -17
- package/dist/localCodeLoader.js.map +1 -1
- package/dist/localLoader.d.ts +3 -2
- package/dist/localLoader.d.ts.map +1 -1
- package/dist/localLoader.js +2 -0
- package/dist/localLoader.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/retry.d.ts +1 -0
- package/dist/retry.d.ts.map +1 -1
- package/dist/retry.js +3 -2
- package/dist/retry.js.map +1 -1
- package/dist/test-utils-alpha.d.ts +305 -0
- package/dist/test-utils-beta.d.ts +202 -0
- package/dist/test-utils-public.d.ts +202 -0
- package/dist/test-utils-untrimmed.d.ts +1001 -0
- package/dist/testContainerRuntimeFactory.d.ts +4 -2
- package/dist/testContainerRuntimeFactory.d.ts.map +1 -1
- package/dist/testContainerRuntimeFactory.js +67 -12
- package/dist/testContainerRuntimeFactory.js.map +1 -1
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.d.ts +23 -0
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -0
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.js +32 -0
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.js.map +1 -0
- package/dist/testFluidObject.d.ts +30 -12
- package/dist/testFluidObject.d.ts.map +1 -1
- package/dist/testFluidObject.js +74 -43
- package/dist/testFluidObject.js.map +1 -1
- package/dist/testObjectProvider.d.ts +298 -41
- package/dist/testObjectProvider.d.ts.map +1 -1
- package/dist/testObjectProvider.js +377 -61
- package/dist/testObjectProvider.js.map +1 -1
- package/dist/timeoutUtils.d.ts +42 -0
- package/dist/timeoutUtils.d.ts.map +1 -1
- package/dist/timeoutUtils.js +142 -9
- package/dist/timeoutUtils.js.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/test-utils-alpha.d.ts +305 -0
- package/lib/test-utils-beta.d.ts +202 -0
- package/lib/test-utils-public.d.ts +202 -0
- package/lib/test-utils-untrimmed.d.ts +1001 -0
- package/package.json +106 -72
- package/prettier.config.cjs +8 -0
- package/src/DriverWrappers.ts +83 -0
- package/src/TestConfigs.ts +17 -0
- package/src/TestSummaryUtils.ts +210 -0
- package/src/containerUtils.ts +90 -0
- package/src/index.ts +47 -9
- package/src/interfaces.ts +16 -7
- package/src/loaderContainerTracker.ts +754 -534
- package/src/localCodeLoader.ts +87 -86
- package/src/localLoader.ts +27 -26
- package/src/packageVersion.ts +1 -1
- package/src/retry.ts +33 -26
- package/src/testContainerRuntimeFactory.ts +152 -59
- package/src/testContainerRuntimeFactoryWithDefaultDataStore.ts +61 -0
- package/src/testFluidObject.ts +190 -147
- package/src/testObjectProvider.ts +931 -372
- package/src/timeoutUtils.ts +226 -37
- package/tsconfig.json +9 -12
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
## API Report File for "@fluidframework/test-utils"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { ConfigTypes } from '@fluidframework/core-interfaces';
|
|
8
|
+
import { ContainerRuntime } from '@fluidframework/container-runtime';
|
|
9
|
+
import { ContainerRuntimeFactoryWithDefaultDataStore } from '@fluidframework/aqueduct';
|
|
10
|
+
import { FluidDataStoreRuntime } from '@fluidframework/datastore';
|
|
11
|
+
import { FluidObject } from '@fluidframework/core-interfaces';
|
|
12
|
+
import { IChannelFactory } from '@fluidframework/datastore-definitions';
|
|
13
|
+
import { ICodeDetailsLoader } from '@fluidframework/container-definitions';
|
|
14
|
+
import { IConfigProviderBase } from '@fluidframework/core-interfaces';
|
|
15
|
+
import { IContainer } from '@fluidframework/container-definitions';
|
|
16
|
+
import { IContainerContext } from '@fluidframework/container-definitions';
|
|
17
|
+
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
18
|
+
import { IContainerRuntimeOptions } from '@fluidframework/container-runtime';
|
|
19
|
+
import { IDataStore } from '@fluidframework/runtime-definitions';
|
|
20
|
+
import { IDocumentService } from '@fluidframework/driver-definitions';
|
|
21
|
+
import { IDocumentServiceFactory } from '@fluidframework/driver-definitions';
|
|
22
|
+
import { IDocumentStorageService } from '@fluidframework/driver-definitions';
|
|
23
|
+
import { IFluidCodeDetails } from '@fluidframework/container-definitions';
|
|
24
|
+
import { IFluidDataStoreChannel } from '@fluidframework/runtime-definitions';
|
|
25
|
+
import { IFluidDataStoreContext } from '@fluidframework/runtime-definitions';
|
|
26
|
+
import { IFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
27
|
+
import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
|
|
28
|
+
import { IFluidHandle } from '@fluidframework/core-interfaces';
|
|
29
|
+
import { IFluidLoadable } from '@fluidframework/core-interfaces';
|
|
30
|
+
import { IFluidModule } from '@fluidframework/container-definitions';
|
|
31
|
+
import { IFluidModuleWithDetails } from '@fluidframework/container-definitions';
|
|
32
|
+
import { IHostLoader } from '@fluidframework/container-definitions';
|
|
33
|
+
import { ILoaderOptions } from '@fluidframework/container-definitions';
|
|
34
|
+
import { ILoaderProps } from '@fluidframework/container-loader';
|
|
35
|
+
import { IOnDemandSummarizeOptions } from '@fluidframework/container-runtime';
|
|
36
|
+
import { IProvideFluidCodeDetailsComparer } from '@fluidframework/container-definitions';
|
|
37
|
+
import { IProvideFluidDataStoreFactory } from '@fluidframework/runtime-definitions';
|
|
38
|
+
import { IProvideFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
|
|
39
|
+
import { IProvideRuntimeFactory } from '@fluidframework/container-definitions';
|
|
40
|
+
import { IRequest } from '@fluidframework/core-interfaces';
|
|
41
|
+
import { IRequestHeader } from '@fluidframework/core-interfaces';
|
|
42
|
+
import { IResolvedUrl } from '@fluidframework/driver-definitions';
|
|
43
|
+
import { IResponse } from '@fluidframework/core-interfaces';
|
|
44
|
+
import { IRuntime } from '@fluidframework/container-definitions';
|
|
45
|
+
import { ISharedMap } from '@fluidframework/map';
|
|
46
|
+
import { ISummarizer } from '@fluidframework/container-runtime';
|
|
47
|
+
import { ISummaryContext } from '@fluidframework/driver-definitions';
|
|
48
|
+
import { ISummaryTree } from '@fluidframework/protocol-definitions';
|
|
49
|
+
import { ITelemetryBaseEvent } from '@fluidframework/core-interfaces';
|
|
50
|
+
import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
|
|
51
|
+
import { ITelemetryGenericEvent } from '@fluidframework/core-interfaces';
|
|
52
|
+
import { ITestDriver } from '@fluidframework/test-driver-definitions';
|
|
53
|
+
import { IUrlResolver } from '@fluidframework/driver-definitions';
|
|
54
|
+
import { Loader } from '@fluidframework/container-loader';
|
|
55
|
+
import { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions';
|
|
56
|
+
import { RuntimeRequestHandler } from '@fluidframework/request-handler';
|
|
57
|
+
|
|
58
|
+
// @internal (undocumented)
|
|
59
|
+
export type ChannelFactoryRegistry = Iterable<[string | undefined, IChannelFactory]>;
|
|
60
|
+
|
|
61
|
+
// @alpha
|
|
62
|
+
export function createAndAttachContainer(source: IFluidCodeDetails, loader: IHostLoader, attachRequest: IRequest): Promise<IContainer>;
|
|
63
|
+
|
|
64
|
+
// @internal
|
|
65
|
+
export const createContainerRuntimeFactoryWithDefaultDataStore: (Base: typeof ContainerRuntimeFactoryWithDefaultDataStore | undefined, ctorArgs: {
|
|
66
|
+
defaultFactory: IFluidDataStoreFactory;
|
|
67
|
+
registryEntries: NamedFluidDataStoreRegistryEntries;
|
|
68
|
+
dependencyContainer?: any;
|
|
69
|
+
requestHandlers?: RuntimeRequestHandler[] | undefined;
|
|
70
|
+
runtimeOptions?: IContainerRuntimeOptions | undefined;
|
|
71
|
+
provideEntryPoint?: ((runtime: IContainerRuntime) => Promise<FluidObject>) | undefined;
|
|
72
|
+
}) => ContainerRuntimeFactoryWithDefaultDataStore;
|
|
73
|
+
|
|
74
|
+
// @internal (undocumented)
|
|
75
|
+
export const createDocumentId: () => string;
|
|
76
|
+
|
|
77
|
+
// @internal
|
|
78
|
+
export function createLoader(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, documentServiceFactory: IDocumentServiceFactory, urlResolver: IUrlResolver, logger?: ITelemetryBaseLogger, options?: ILoaderOptions): IHostLoader;
|
|
79
|
+
|
|
80
|
+
// @internal
|
|
81
|
+
export function createSummarizer(provider: ITestObjectProvider, container: IContainer, config?: ITestContainerConfig, summaryVersion?: string, logger?: ITelemetryBaseLogger): Promise<{
|
|
82
|
+
container: IContainer;
|
|
83
|
+
summarizer: ISummarizer;
|
|
84
|
+
}>;
|
|
85
|
+
|
|
86
|
+
// @internal
|
|
87
|
+
export function createSummarizerFromFactory(provider: ITestObjectProvider, container: IContainer, dataStoreFactory: IFluidDataStoreFactory, summaryVersion?: string, containerRuntimeFactoryType?: typeof ContainerRuntimeFactoryWithDefaultDataStore, registryEntries?: NamedFluidDataStoreRegistryEntries, logger?: ITelemetryBaseLogger, configProvider?: IConfigProviderBase): Promise<{
|
|
88
|
+
container: IContainer;
|
|
89
|
+
summarizer: ISummarizer;
|
|
90
|
+
}>;
|
|
91
|
+
|
|
92
|
+
// @internal
|
|
93
|
+
export const createTestContainerRuntimeFactory: (containerRuntimeCtor: typeof ContainerRuntime) => {
|
|
94
|
+
new (type: string, dataStoreFactory: IFluidDataStoreFactory, runtimeOptions?: IContainerRuntimeOptions, requestHandlers?: RuntimeRequestHandler[]): {
|
|
95
|
+
type: string;
|
|
96
|
+
dataStoreFactory: IFluidDataStoreFactory;
|
|
97
|
+
runtimeOptions: IContainerRuntimeOptions;
|
|
98
|
+
requestHandlers: RuntimeRequestHandler[];
|
|
99
|
+
instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
|
|
100
|
+
instantiateFromExisting(runtime: ContainerRuntime): Promise<void>;
|
|
101
|
+
preInitialize(context: IContainerContext, existing: boolean): Promise<IRuntime & IContainerRuntime>;
|
|
102
|
+
readonly IRuntimeFactory: any;
|
|
103
|
+
instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
|
|
104
|
+
hasInitialized(_runtime: IContainerRuntime): Promise<void>;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// @internal (undocumented)
|
|
109
|
+
export enum DataObjectFactoryType {
|
|
110
|
+
// (undocumented)
|
|
111
|
+
Primed = 0,
|
|
112
|
+
// (undocumented)
|
|
113
|
+
Test = 1
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// @internal (undocumented)
|
|
117
|
+
export const defaultTimeoutDurationMs = 250;
|
|
118
|
+
|
|
119
|
+
// @internal
|
|
120
|
+
export class EventAndErrorTrackingLogger implements ITelemetryBaseLogger {
|
|
121
|
+
constructor(baseLogger: ITelemetryBaseLogger);
|
|
122
|
+
// (undocumented)
|
|
123
|
+
registerExpectedEvent(...orderedExpectedEvents: ITelemetryGenericEvent[]): void;
|
|
124
|
+
// (undocumented)
|
|
125
|
+
reportAndClearTrackedEvents(): {
|
|
126
|
+
expectedNotFound: ({
|
|
127
|
+
index: number;
|
|
128
|
+
event: ITelemetryGenericEvent | undefined;
|
|
129
|
+
} | undefined)[];
|
|
130
|
+
unexpectedErrors: ITelemetryBaseEvent[];
|
|
131
|
+
};
|
|
132
|
+
// (undocumented)
|
|
133
|
+
send(event: ITelemetryBaseEvent): void;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// @internal (undocumented)
|
|
137
|
+
export type fluidEntryPoint = SupportedExportInterfaces | IFluidModule;
|
|
138
|
+
|
|
139
|
+
// @internal
|
|
140
|
+
export function getContainerEntryPointBackCompat<T>(container: IContainer): Promise<T>;
|
|
141
|
+
|
|
142
|
+
// @internal
|
|
143
|
+
export function getDataStoreEntryPointBackCompat<T>(dataStore: IDataStore): Promise<T>;
|
|
144
|
+
|
|
145
|
+
// @internal (undocumented)
|
|
146
|
+
export function getUnexpectedLogErrorException(logger: EventAndErrorTrackingLogger | undefined, prefix?: string): Error | undefined;
|
|
147
|
+
|
|
148
|
+
// @internal
|
|
149
|
+
export interface IDocumentIdStrategy {
|
|
150
|
+
get(): string;
|
|
151
|
+
reset(): void;
|
|
152
|
+
update(resolvedUrl?: IResolvedUrl): void;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// @alpha (undocumented)
|
|
156
|
+
export interface IOpProcessingController {
|
|
157
|
+
// (undocumented)
|
|
158
|
+
pauseProcessing(...containers: IContainer[]): Promise<void>;
|
|
159
|
+
// (undocumented)
|
|
160
|
+
processIncoming(...containers: IContainer[]): Promise<void>;
|
|
161
|
+
// (undocumented)
|
|
162
|
+
processOutgoing(...containers: IContainer[]): Promise<void>;
|
|
163
|
+
// (undocumented)
|
|
164
|
+
resumeProcessing(...containers: IContainer[]): void;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// @alpha (undocumented)
|
|
168
|
+
export interface IProvideTestFluidObject {
|
|
169
|
+
// (undocumented)
|
|
170
|
+
readonly ITestFluidObject: ITestFluidObject;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// @internal (undocumented)
|
|
174
|
+
export interface ITestContainerConfig {
|
|
175
|
+
enableAttribution?: boolean;
|
|
176
|
+
fluidDataObjectType?: DataObjectFactoryType;
|
|
177
|
+
loaderProps?: Partial<ILoaderProps>;
|
|
178
|
+
registry?: ChannelFactoryRegistry;
|
|
179
|
+
runtimeOptions?: IContainerRuntimeOptions;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// @alpha (undocumented)
|
|
183
|
+
export interface ITestFluidObject extends IProvideTestFluidObject, IFluidLoadable {
|
|
184
|
+
// (undocumented)
|
|
185
|
+
readonly channel: IFluidDataStoreChannel;
|
|
186
|
+
// (undocumented)
|
|
187
|
+
readonly context: IFluidDataStoreContext;
|
|
188
|
+
// (undocumented)
|
|
189
|
+
getSharedObject<T = any>(id: string): Promise<T>;
|
|
190
|
+
// (undocumented)
|
|
191
|
+
root: ISharedMap;
|
|
192
|
+
// (undocumented)
|
|
193
|
+
readonly runtime: IFluidDataStoreRuntime;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// @internal (undocumented)
|
|
197
|
+
export interface ITestObjectProvider {
|
|
198
|
+
createContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>): Promise<IContainer>;
|
|
199
|
+
createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint;
|
|
200
|
+
createLoader(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, loaderProps?: Partial<ILoaderProps>): IHostLoader;
|
|
201
|
+
defaultCodeDetails: IFluidCodeDetails;
|
|
202
|
+
documentId: string;
|
|
203
|
+
documentServiceFactory: IDocumentServiceFactory;
|
|
204
|
+
driver: ITestDriver;
|
|
205
|
+
ensureSynchronized(timeoutDuration?: number): Promise<void>;
|
|
206
|
+
loadContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>, requestHeader?: IRequestHeader): Promise<IContainer>;
|
|
207
|
+
loadTestContainer(testContainerConfig?: ITestContainerConfig, requestHeader?: IRequestHeader): Promise<IContainer>;
|
|
208
|
+
logger: EventAndErrorTrackingLogger | undefined;
|
|
209
|
+
makeTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer>;
|
|
210
|
+
makeTestLoader(testContainerConfig?: ITestContainerConfig): IHostLoader;
|
|
211
|
+
opProcessingController: IOpProcessingController;
|
|
212
|
+
reset(): void;
|
|
213
|
+
resetLoaderContainerTracker(syncSummarizerClients?: boolean): any;
|
|
214
|
+
type: "TestObjectProvider" | "TestObjectProviderWithVersionedLoad";
|
|
215
|
+
updateDocumentId(url: IResolvedUrl | undefined): void;
|
|
216
|
+
urlResolver: IUrlResolver;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// @alpha (undocumented)
|
|
220
|
+
export class LoaderContainerTracker implements IOpProcessingController {
|
|
221
|
+
constructor(syncSummarizerClients?: boolean);
|
|
222
|
+
add<LoaderType extends IHostLoader>(loader: LoaderType): void;
|
|
223
|
+
ensureSynchronized(...containers: IContainer[]): Promise<void>;
|
|
224
|
+
pauseProcessing(...containers: IContainer[]): Promise<void>;
|
|
225
|
+
processIncoming(...containers: IContainer[]): Promise<void>;
|
|
226
|
+
processOutgoing(...containers: IContainer[]): Promise<void>;
|
|
227
|
+
reset(): void;
|
|
228
|
+
resumeProcessing(...containers: IContainer[]): IContainer[];
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// @internal
|
|
232
|
+
export class LocalCodeLoader implements ICodeDetailsLoader {
|
|
233
|
+
constructor(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, runtimeOptions?: IContainerRuntimeOptions);
|
|
234
|
+
load(source: IFluidCodeDetails): Promise<IFluidModuleWithDetails>;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// @internal (undocumented)
|
|
238
|
+
export const mockConfigProvider: (settings?: Record<string, ConfigTypes>) => IConfigProviderBase;
|
|
239
|
+
|
|
240
|
+
// @internal
|
|
241
|
+
export const retryWithEventualValue: <T>(callback: () => Promise<T>, check: (value: T) => boolean, defaultValue: T, maxTries?: number, backOffMs?: number) => Promise<T>;
|
|
242
|
+
|
|
243
|
+
// @internal
|
|
244
|
+
export function summarizeNow(summarizer: ISummarizer, inputs?: string | IOnDemandSummarizeOptions): Promise<SummaryInfo>;
|
|
245
|
+
|
|
246
|
+
// @internal
|
|
247
|
+
export interface SummaryInfo {
|
|
248
|
+
summaryRefSeq: number;
|
|
249
|
+
summaryTree: ISummaryTree;
|
|
250
|
+
summaryVersion: string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// @internal (undocumented)
|
|
254
|
+
export type SupportedExportInterfaces = Partial<IProvideRuntimeFactory & IProvideFluidDataStoreFactory & IProvideFluidDataStoreRegistry & IProvideFluidCodeDetailsComparer>;
|
|
255
|
+
|
|
256
|
+
// @internal
|
|
257
|
+
export const TestContainerRuntimeFactory: {
|
|
258
|
+
new (type: string, dataStoreFactory: IFluidDataStoreFactory, runtimeOptions?: IContainerRuntimeOptions, requestHandlers?: RuntimeRequestHandler[]): {
|
|
259
|
+
type: string;
|
|
260
|
+
dataStoreFactory: IFluidDataStoreFactory;
|
|
261
|
+
runtimeOptions: IContainerRuntimeOptions;
|
|
262
|
+
requestHandlers: RuntimeRequestHandler[];
|
|
263
|
+
instantiateFirstTime(runtime: ContainerRuntime): Promise<void>;
|
|
264
|
+
instantiateFromExisting(runtime: ContainerRuntime): Promise<void>;
|
|
265
|
+
preInitialize(context: IContainerContext, existing: boolean): Promise<IRuntime & IContainerRuntime>;
|
|
266
|
+
readonly IRuntimeFactory: any;
|
|
267
|
+
instantiateRuntime(context: IContainerContext, existing: boolean): Promise<IRuntime>;
|
|
268
|
+
hasInitialized(_runtime: IContainerRuntime): Promise<void>;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
// @internal
|
|
273
|
+
export class TestFluidObject implements ITestFluidObject {
|
|
274
|
+
constructor(runtime: IFluidDataStoreRuntime, channel: IFluidDataStoreChannel, context: IFluidDataStoreContext, factoryEntriesMap: Map<string, IChannelFactory>);
|
|
275
|
+
// (undocumented)
|
|
276
|
+
readonly channel: IFluidDataStoreChannel;
|
|
277
|
+
// (undocumented)
|
|
278
|
+
readonly context: IFluidDataStoreContext;
|
|
279
|
+
getSharedObject<T = any>(id: string): Promise<T>;
|
|
280
|
+
// (undocumented)
|
|
281
|
+
get handle(): IFluidHandle<this>;
|
|
282
|
+
// (undocumented)
|
|
283
|
+
get IFluidLoadable(): this;
|
|
284
|
+
// (undocumented)
|
|
285
|
+
initialize(existing: boolean): Promise<void>;
|
|
286
|
+
// (undocumented)
|
|
287
|
+
get ITestFluidObject(): this;
|
|
288
|
+
// (undocumented)
|
|
289
|
+
request(request: IRequest): Promise<IResponse>;
|
|
290
|
+
// (undocumented)
|
|
291
|
+
root: ISharedMap;
|
|
292
|
+
// (undocumented)
|
|
293
|
+
readonly runtime: IFluidDataStoreRuntime;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// @internal
|
|
297
|
+
export class TestFluidObjectFactory implements IFluidDataStoreFactory {
|
|
298
|
+
constructor(factoryEntries: ChannelFactoryRegistry, type?: string);
|
|
299
|
+
// (undocumented)
|
|
300
|
+
get IFluidDataStoreFactory(): this;
|
|
301
|
+
// (undocumented)
|
|
302
|
+
instantiateDataStore(context: IFluidDataStoreContext, existing: boolean): Promise<FluidDataStoreRuntime>;
|
|
303
|
+
// (undocumented)
|
|
304
|
+
readonly type: string;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// @internal
|
|
308
|
+
export class TestObjectProvider implements ITestObjectProvider {
|
|
309
|
+
constructor(LoaderConstructor: typeof Loader,
|
|
310
|
+
driver: ITestDriver,
|
|
311
|
+
createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint);
|
|
312
|
+
createContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>): Promise<IContainer>;
|
|
313
|
+
readonly createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint;
|
|
314
|
+
createLoader(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, loaderProps?: Partial<ILoaderProps>): Loader;
|
|
315
|
+
get defaultCodeDetails(): IFluidCodeDetails;
|
|
316
|
+
get documentId(): string;
|
|
317
|
+
get documentServiceFactory(): IDocumentServiceFactory;
|
|
318
|
+
readonly driver: ITestDriver;
|
|
319
|
+
ensureSynchronized(): Promise<void>;
|
|
320
|
+
loadContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>, requestHeader?: IRequestHeader): Promise<IContainer>;
|
|
321
|
+
loadTestContainer(testContainerConfig?: ITestContainerConfig, requestHeader?: IRequestHeader): Promise<IContainer>;
|
|
322
|
+
get logger(): EventAndErrorTrackingLogger;
|
|
323
|
+
makeTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer>;
|
|
324
|
+
makeTestLoader(testContainerConfig?: ITestContainerConfig): Loader;
|
|
325
|
+
get opProcessingController(): IOpProcessingController;
|
|
326
|
+
reset(): void;
|
|
327
|
+
resetLoaderContainerTracker(syncSummarizerClients?: boolean): void;
|
|
328
|
+
readonly type = "TestObjectProvider";
|
|
329
|
+
updateDocumentId(resolvedUrl: IResolvedUrl | undefined): void;
|
|
330
|
+
get urlResolver(): IUrlResolver;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// @internal
|
|
334
|
+
export class TestObjectProviderWithVersionedLoad implements ITestObjectProvider {
|
|
335
|
+
constructor(LoaderConstructorForCreating: typeof Loader, LoaderConstructorForLoading: typeof Loader, driverForCreating: ITestDriver, driverForLoading: ITestDriver, createFluidEntryPointForCreating: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint, createFluidEntryPointForLoading: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint);
|
|
336
|
+
createContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>): Promise<IContainer>;
|
|
337
|
+
get createFluidEntryPoint(): (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint;
|
|
338
|
+
createLoader(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, loaderProps?: Partial<ILoaderProps>): Loader;
|
|
339
|
+
get defaultCodeDetails(): IFluidCodeDetails;
|
|
340
|
+
get documentId(): string;
|
|
341
|
+
get documentServiceFactory(): IDocumentServiceFactory;
|
|
342
|
+
get driver(): ITestDriver;
|
|
343
|
+
ensureSynchronized(): Promise<void>;
|
|
344
|
+
loadContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>, requestHeader?: IRequestHeader): Promise<IContainer>;
|
|
345
|
+
loadTestContainer(testContainerConfig?: ITestContainerConfig, requestHeader?: IRequestHeader): Promise<IContainer>;
|
|
346
|
+
get logger(): EventAndErrorTrackingLogger;
|
|
347
|
+
makeTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer>;
|
|
348
|
+
makeTestLoader(testContainerConfig?: ITestContainerConfig): Loader;
|
|
349
|
+
get opProcessingController(): IOpProcessingController;
|
|
350
|
+
reset(): void;
|
|
351
|
+
resetLoaderContainerTracker(syncSummarizerClients?: boolean): void;
|
|
352
|
+
readonly type = "TestObjectProviderWithVersionedLoad";
|
|
353
|
+
updateDocumentId(resolvedUrl: IResolvedUrl | undefined): void;
|
|
354
|
+
get urlResolver(): IUrlResolver;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// @internal
|
|
358
|
+
export function timeoutAwait<T = void>(promise: PromiseLike<T>, timeoutOptions?: TimeoutWithError | TimeoutWithValue<T>): Promise<T>;
|
|
359
|
+
|
|
360
|
+
// @internal
|
|
361
|
+
export function timeoutPromise<T = void>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void, timeoutOptions?: TimeoutWithError | TimeoutWithValue<T>): Promise<T>;
|
|
362
|
+
|
|
363
|
+
// @internal (undocumented)
|
|
364
|
+
export interface TimeoutWithError {
|
|
365
|
+
durationMs?: number;
|
|
366
|
+
// (undocumented)
|
|
367
|
+
errorMsg?: string;
|
|
368
|
+
// (undocumented)
|
|
369
|
+
reject?: true;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// @internal (undocumented)
|
|
373
|
+
export interface TimeoutWithValue<T = void> {
|
|
374
|
+
durationMs?: number;
|
|
375
|
+
// (undocumented)
|
|
376
|
+
reject: false;
|
|
377
|
+
// (undocumented)
|
|
378
|
+
value: T;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// @internal
|
|
382
|
+
export function waitForContainerConnection(container: IContainer, failOnContainerClose?: boolean, timeoutOptions?: TimeoutWithError): Promise<void>;
|
|
383
|
+
|
|
384
|
+
// @internal
|
|
385
|
+
export function wrapDocumentService(innerDocService: IDocumentService, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentService;
|
|
386
|
+
|
|
387
|
+
// @internal
|
|
388
|
+
export function wrapDocumentServiceFactory(innerDocServiceFactory: IDocumentServiceFactory, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentServiceFactory;
|
|
389
|
+
|
|
390
|
+
// @internal
|
|
391
|
+
export function wrapDocumentStorageService(innerDocStorageService: IDocumentStorageService, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentStorageService;
|
|
392
|
+
|
|
393
|
+
// (No @packageDocumentation comment for this package)
|
|
394
|
+
|
|
395
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { IDocumentService, IDocumentServiceFactory, IDocumentStorageService, ISummaryContext } from "@fluidframework/driver-definitions";
|
|
6
|
+
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
7
|
+
/**
|
|
8
|
+
* Wraps the given IDocumentStorageService to override the `uploadSummaryWithContext` method. It calls the
|
|
9
|
+
* `uploadSummaryCb` whenever a summary is uploaded by the client. The summary context can be updated in the
|
|
10
|
+
* callback before it is uploaded to the server.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function wrapDocumentStorageService(innerDocStorageService: IDocumentStorageService, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentStorageService;
|
|
14
|
+
/**
|
|
15
|
+
* Wraps the given IDocumentService to override the `connectToStorage` method. The intent is to plumb the
|
|
16
|
+
* `uploadSummaryCb` to the IDocumentStorageService so that it is called whenever a summary is uploaded by
|
|
17
|
+
* the client.
|
|
18
|
+
* The document storage service that is created in `connectToStorage` is wrapped by calling `wrapDocumentStorageService`
|
|
19
|
+
* to pass in the `uploadSummaryCb`.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function wrapDocumentService(innerDocService: IDocumentService, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentService;
|
|
23
|
+
/**
|
|
24
|
+
* Wraps the given IDocumentServiceFactory to override the `createDocumentService` method. The intent is to plumb
|
|
25
|
+
* the `uploadSummaryCb` all the way to the IDocumentStorageService so that it is called whenever a summary is
|
|
26
|
+
* uploaded by the client.
|
|
27
|
+
* The document service that is created in `createDocumentService` is wrapped by calling `wrapDocumentService` to
|
|
28
|
+
* pass in the `uploadSummaryCb`.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare function wrapDocumentServiceFactory(innerDocServiceFactory: IDocumentServiceFactory, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentServiceFactory;
|
|
32
|
+
//# sourceMappingURL=DriverWrappers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DriverWrappers.d.ts","sourceRoot":"","sources":["../src/DriverWrappers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EAEvB,eAAe,EACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACzC,sBAAsB,EAAE,uBAAuB,EAC/C,eAAe,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,KAAK,eAAe,2BAWzF;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAClC,eAAe,EAAE,gBAAgB,EACjC,eAAe,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,KAAK,eAAe,oBAQzF;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACzC,sBAAsB,EAAE,uBAAuB,EAC/C,eAAe,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,KAAK,eAAe,2BAgBzF"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.wrapDocumentServiceFactory = exports.wrapDocumentService = exports.wrapDocumentStorageService = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Wraps the given IDocumentStorageService to override the `uploadSummaryWithContext` method. It calls the
|
|
10
|
+
* `uploadSummaryCb` whenever a summary is uploaded by the client. The summary context can be updated in the
|
|
11
|
+
* callback before it is uploaded to the server.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
function wrapDocumentStorageService(innerDocStorageService, uploadSummaryCb) {
|
|
15
|
+
const outerDocStorageService = Object.create(innerDocStorageService);
|
|
16
|
+
outerDocStorageService.uploadSummaryWithContext = async (summary, context) => {
|
|
17
|
+
const newContext = uploadSummaryCb(summary, context);
|
|
18
|
+
return innerDocStorageService.uploadSummaryWithContext(summary, newContext);
|
|
19
|
+
};
|
|
20
|
+
return outerDocStorageService;
|
|
21
|
+
}
|
|
22
|
+
exports.wrapDocumentStorageService = wrapDocumentStorageService;
|
|
23
|
+
/**
|
|
24
|
+
* Wraps the given IDocumentService to override the `connectToStorage` method. The intent is to plumb the
|
|
25
|
+
* `uploadSummaryCb` to the IDocumentStorageService so that it is called whenever a summary is uploaded by
|
|
26
|
+
* the client.
|
|
27
|
+
* The document storage service that is created in `connectToStorage` is wrapped by calling `wrapDocumentStorageService`
|
|
28
|
+
* to pass in the `uploadSummaryCb`.
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
function wrapDocumentService(innerDocService, uploadSummaryCb) {
|
|
32
|
+
const outerDocService = Object.create(innerDocService);
|
|
33
|
+
outerDocService.connectToStorage = async () => {
|
|
34
|
+
const storageService = await innerDocService.connectToStorage();
|
|
35
|
+
return wrapDocumentStorageService(storageService, uploadSummaryCb);
|
|
36
|
+
};
|
|
37
|
+
return outerDocService;
|
|
38
|
+
}
|
|
39
|
+
exports.wrapDocumentService = wrapDocumentService;
|
|
40
|
+
/**
|
|
41
|
+
* Wraps the given IDocumentServiceFactory to override the `createDocumentService` method. The intent is to plumb
|
|
42
|
+
* the `uploadSummaryCb` all the way to the IDocumentStorageService so that it is called whenever a summary is
|
|
43
|
+
* uploaded by the client.
|
|
44
|
+
* The document service that is created in `createDocumentService` is wrapped by calling `wrapDocumentService` to
|
|
45
|
+
* pass in the `uploadSummaryCb`.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
function wrapDocumentServiceFactory(innerDocServiceFactory, uploadSummaryCb) {
|
|
49
|
+
const outerDocServiceFactory = Object.create(innerDocServiceFactory);
|
|
50
|
+
outerDocServiceFactory.createDocumentService = async (resolvedUrl, logger, clientIsSummarizer) => {
|
|
51
|
+
const documentService = await innerDocServiceFactory.createDocumentService(resolvedUrl, logger, clientIsSummarizer);
|
|
52
|
+
return wrapDocumentService(documentService, uploadSummaryCb);
|
|
53
|
+
};
|
|
54
|
+
return outerDocServiceFactory;
|
|
55
|
+
}
|
|
56
|
+
exports.wrapDocumentServiceFactory = wrapDocumentServiceFactory;
|
|
57
|
+
//# sourceMappingURL=DriverWrappers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DriverWrappers.js","sourceRoot":"","sources":["../src/DriverWrappers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAYH;;;;;GAKG;AACH,SAAgB,0BAA0B,CACzC,sBAA+C,EAC/C,eAAyF;IAEzF,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAA4B,CAAC;IAChG,sBAAsB,CAAC,wBAAwB,GAAG,KAAK,EACtD,OAAqB,EACrB,OAAwB,EACN,EAAE;QACpB,MAAM,UAAU,GAAG,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACrD,OAAO,sBAAsB,CAAC,wBAAwB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC7E,CAAC,CAAC;IACF,OAAO,sBAAsB,CAAC;AAC/B,CAAC;AAbD,gEAaC;AAED;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAClC,eAAiC,EACjC,eAAyF;IAEzF,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAqB,CAAC;IAC3E,eAAe,CAAC,gBAAgB,GAAG,KAAK,IAAsC,EAAE;QAC/E,MAAM,cAAc,GAAG,MAAM,eAAe,CAAC,gBAAgB,EAAE,CAAC;QAChE,OAAO,0BAA0B,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;IACpE,CAAC,CAAC;IACF,OAAO,eAAe,CAAC;AACxB,CAAC;AAVD,kDAUC;AAED;;;;;;;GAOG;AACH,SAAgB,0BAA0B,CACzC,sBAA+C,EAC/C,eAAyF;IAEzF,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAA4B,CAAC;IAChG,sBAAsB,CAAC,qBAAqB,GAAG,KAAK,EACnD,WAAyB,EACzB,MAA6B,EAC7B,kBAA4B,EACA,EAAE;QAC9B,MAAM,eAAe,GAAG,MAAM,sBAAsB,CAAC,qBAAqB,CACzE,WAAW,EACX,MAAM,EACN,kBAAkB,CAClB,CAAC;QACF,OAAO,mBAAmB,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;IAC9D,CAAC,CAAC;IACF,OAAO,sBAAsB,CAAC;AAC/B,CAAC;AAlBD,gEAkBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n\tISummaryContext,\n} from \"@fluidframework/driver-definitions\";\nimport { ISummaryTree } from \"@fluidframework/protocol-definitions\";\n\n/**\n * Wraps the given IDocumentStorageService to override the `uploadSummaryWithContext` method. It calls the\n * `uploadSummaryCb` whenever a summary is uploaded by the client. The summary context can be updated in the\n * callback before it is uploaded to the server.\n * @internal\n */\nexport function wrapDocumentStorageService(\n\tinnerDocStorageService: IDocumentStorageService,\n\tuploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,\n) {\n\tconst outerDocStorageService = Object.create(innerDocStorageService) as IDocumentStorageService;\n\touterDocStorageService.uploadSummaryWithContext = async (\n\t\tsummary: ISummaryTree,\n\t\tcontext: ISummaryContext,\n\t): Promise<string> => {\n\t\tconst newContext = uploadSummaryCb(summary, context);\n\t\treturn innerDocStorageService.uploadSummaryWithContext(summary, newContext);\n\t};\n\treturn outerDocStorageService;\n}\n\n/**\n * Wraps the given IDocumentService to override the `connectToStorage` method. The intent is to plumb the\n * `uploadSummaryCb` to the IDocumentStorageService so that it is called whenever a summary is uploaded by\n * the client.\n * The document storage service that is created in `connectToStorage` is wrapped by calling `wrapDocumentStorageService`\n * to pass in the `uploadSummaryCb`.\n * @internal\n */\nexport function wrapDocumentService(\n\tinnerDocService: IDocumentService,\n\tuploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,\n) {\n\tconst outerDocService = Object.create(innerDocService) as IDocumentService;\n\touterDocService.connectToStorage = async (): Promise<IDocumentStorageService> => {\n\t\tconst storageService = await innerDocService.connectToStorage();\n\t\treturn wrapDocumentStorageService(storageService, uploadSummaryCb);\n\t};\n\treturn outerDocService;\n}\n\n/**\n * Wraps the given IDocumentServiceFactory to override the `createDocumentService` method. The intent is to plumb\n * the `uploadSummaryCb` all the way to the IDocumentStorageService so that it is called whenever a summary is\n * uploaded by the client.\n * The document service that is created in `createDocumentService` is wrapped by calling `wrapDocumentService` to\n * pass in the `uploadSummaryCb`.\n * @internal\n */\nexport function wrapDocumentServiceFactory(\n\tinnerDocServiceFactory: IDocumentServiceFactory,\n\tuploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,\n) {\n\tconst outerDocServiceFactory = Object.create(innerDocServiceFactory) as IDocumentServiceFactory;\n\touterDocServiceFactory.createDocumentService = async (\n\t\tresolvedUrl: IResolvedUrl,\n\t\tlogger?: ITelemetryBaseLogger,\n\t\tclientIsSummarizer?: boolean,\n\t): Promise<IDocumentService> => {\n\t\tconst documentService = await innerDocServiceFactory.createDocumentService(\n\t\t\tresolvedUrl,\n\t\t\tlogger,\n\t\t\tclientIsSummarizer,\n\t\t);\n\t\treturn wrapDocumentService(documentService, uploadSummaryCb);\n\t};\n\treturn outerDocServiceFactory;\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { ConfigTypes, IConfigProviderBase } from "@fluidframework/core-interfaces";
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare const mockConfigProvider: (settings?: Record<string, ConfigTypes>) => IConfigProviderBase;
|
|
10
|
+
//# sourceMappingURL=TestConfigs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestConfigs.d.ts","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEnF;;GAEG;AACH,eAAO,MAAM,kBAAkB,cACpB,OAAO,MAAM,EAAE,WAAW,CAAC,KACnC,mBAIF,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.mockConfigProvider = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
const mockConfigProvider = (settings = {}) => {
|
|
12
|
+
return {
|
|
13
|
+
getRawConfig: (name) => settings[name],
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
exports.mockConfigProvider = mockConfigProvider;
|
|
17
|
+
//# sourceMappingURL=TestConfigs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestConfigs.js","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH;;GAEG;AACI,MAAM,kBAAkB,GAAG,CACjC,WAAwC,EAAE,EACpB,EAAE;IACxB,OAAO;QACN,YAAY,EAAE,CAAC,IAAY,EAAe,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;KAC3D,CAAC;AACH,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ConfigTypes, IConfigProviderBase } from \"@fluidframework/core-interfaces\";\n\n/**\n * @internal\n */\nexport const mockConfigProvider = (\n\tsettings: Record<string, ConfigTypes> = {},\n): IConfigProviderBase => {\n\treturn {\n\t\tgetRawConfig: (name: string): ConfigTypes => settings[name],\n\t};\n};\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { ContainerRuntimeFactoryWithDefaultDataStore } from "@fluidframework/aqueduct";
|
|
6
|
+
import { IContainer } from "@fluidframework/container-definitions";
|
|
7
|
+
import { IOnDemandSummarizeOptions, ISummarizer } from "@fluidframework/container-runtime";
|
|
8
|
+
import { ITelemetryBaseLogger, IConfigProviderBase } from "@fluidframework/core-interfaces";
|
|
9
|
+
import { IFluidDataStoreFactory, NamedFluidDataStoreRegistryEntries } from "@fluidframework/runtime-definitions";
|
|
10
|
+
import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
11
|
+
import { ITestContainerConfig, ITestObjectProvider } from "./testObjectProvider";
|
|
12
|
+
/**
|
|
13
|
+
* Creates a summarizer client from the given container and data store factory, and returns the summarizer client's
|
|
14
|
+
* IContainer and ISummarizer.
|
|
15
|
+
* The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare function createSummarizerFromFactory(provider: ITestObjectProvider, container: IContainer, dataStoreFactory: IFluidDataStoreFactory, summaryVersion?: string, containerRuntimeFactoryType?: typeof ContainerRuntimeFactoryWithDefaultDataStore, registryEntries?: NamedFluidDataStoreRegistryEntries, logger?: ITelemetryBaseLogger, configProvider?: IConfigProviderBase): Promise<{
|
|
19
|
+
container: IContainer;
|
|
20
|
+
summarizer: ISummarizer;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Creates a summarizer client from the given container and returns the summarizer client's IContainer and ISummarizer.
|
|
24
|
+
* The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
|
|
25
|
+
*
|
|
26
|
+
* Can pass in a test config provider to enable/disable features.
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare function createSummarizer(provider: ITestObjectProvider, container: IContainer, config?: ITestContainerConfig, summaryVersion?: string, logger?: ITelemetryBaseLogger): Promise<{
|
|
30
|
+
container: IContainer;
|
|
31
|
+
summarizer: ISummarizer;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Summarizes on demand and returns the summary tree, the version number and the reference sequence number of the
|
|
35
|
+
* submitted summary.
|
|
36
|
+
*
|
|
37
|
+
* @param summarizer - The ISummarizer to use to summarize on demand
|
|
38
|
+
* @param inputs - Either the reason string or the full IOnDemandSummarizeOptions.
|
|
39
|
+
* Defaults to the reason "end-to-end test".
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export declare function summarizeNow(summarizer: ISummarizer, inputs?: string | IOnDemandSummarizeOptions): Promise<SummaryInfo>;
|
|
43
|
+
/**
|
|
44
|
+
* Summary information containing the summary tree, summary version, and summary sequence number.
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
export interface SummaryInfo {
|
|
48
|
+
/**
|
|
49
|
+
* The summary tree generated
|
|
50
|
+
*/
|
|
51
|
+
summaryTree: ISummaryTree;
|
|
52
|
+
/**
|
|
53
|
+
* Handle of the completed summary
|
|
54
|
+
*/
|
|
55
|
+
summaryVersion: string;
|
|
56
|
+
/**
|
|
57
|
+
* Reference sequence number of the current summary generation
|
|
58
|
+
*/
|
|
59
|
+
summaryRefSeq: number;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=TestSummaryUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestSummaryUtils.d.ts","sourceRoot":"","sources":["../src/TestSummaryUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2CAA2C,EAAE,MAAM,0BAA0B,CAAC;AAEvF,OAAO,EAAE,UAAU,EAA6B,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EACN,yBAAyB,EACzB,WAAW,EAEX,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACN,oBAAoB,EAGpB,mBAAmB,EACnB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACN,sBAAsB,EACtB,kCAAkC,EAClC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAsDjF;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAChD,QAAQ,EAAE,mBAAmB,EAC7B,SAAS,EAAE,UAAU,EACrB,gBAAgB,EAAE,sBAAsB,EACxC,cAAc,CAAC,EAAE,MAAM,EACvB,2BAA2B,qDAA8C,EACzE,eAAe,CAAC,EAAE,kCAAkC,EACpD,MAAM,CAAC,EAAE,oBAAoB,EAC7B,cAAc,GAAE,mBAA0C,GACxD,OAAO,CAAC;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,WAAW,CAAA;CAAE,CAAC,CAiB7D;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACrC,QAAQ,EAAE,mBAAmB,EAC7B,SAAS,EAAE,UAAU,EACrB,MAAM,CAAC,EAAE,oBAAoB,EAC7B,cAAc,CAAC,EAAE,MAAM,EACvB,MAAM,CAAC,EAAE,oBAAoB,GAC3B,OAAO,CAAC;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,WAAW,CAAA;CAAE,CAAC,CAe7D;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CACjC,UAAU,EAAE,WAAW,EACvB,MAAM,GAAE,MAAM,GAAG,yBAA6C,GAC5D,OAAO,CAAC,WAAW,CAAC,CAmCtB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,WAAW,EAAE,YAAY,CAAC;IAC1B;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACtB"}
|