@fluidframework/test-utils 2.20.0 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/TestSummaryUtils.d.ts.map +1 -1
- package/dist/TestSummaryUtils.js +4 -1
- package/dist/TestSummaryUtils.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -6
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/testFluidObject.d.ts +1 -1
- package/dist/testFluidObject.d.ts.map +1 -1
- package/dist/testFluidObject.js +2 -4
- package/dist/testFluidObject.js.map +1 -1
- package/dist/timeoutUtils.d.ts +0 -4
- package/dist/timeoutUtils.d.ts.map +1 -1
- package/dist/timeoutUtils.js +1 -6
- package/dist/timeoutUtils.js.map +1 -1
- package/lib/TestSummaryUtils.d.ts.map +1 -1
- package/lib/TestSummaryUtils.js +4 -1
- package/lib/TestSummaryUtils.js.map +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/testFluidObject.d.ts +1 -1
- package/lib/testFluidObject.d.ts.map +1 -1
- package/lib/testFluidObject.js +2 -4
- package/lib/testFluidObject.js.map +1 -1
- package/lib/timeoutUtils.d.ts +0 -4
- package/lib/timeoutUtils.d.ts.map +1 -1
- package/lib/timeoutUtils.js +0 -5
- package/lib/timeoutUtils.js.map +1 -1
- package/package.json +26 -33
- package/src/TestSummaryUtils.ts +3 -0
- package/src/index.ts +0 -6
- package/src/packageVersion.ts +1 -1
- package/src/testFluidObject.ts +3 -6
- package/src/timeoutUtils.ts +0 -6
- package/dist/DriverWrappers.d.ts +0 -35
- package/dist/DriverWrappers.d.ts.map +0 -1
- package/dist/DriverWrappers.js +0 -60
- package/dist/DriverWrappers.js.map +0 -1
- package/lib/DriverWrappers.d.ts +0 -35
- package/lib/DriverWrappers.d.ts.map +0 -1
- package/lib/DriverWrappers.js +0 -54
- package/lib/DriverWrappers.js.map +0 -1
- package/src/DriverWrappers.ts +0 -90
package/src/DriverWrappers.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
8
|
-
import {
|
|
9
|
-
IDocumentService,
|
|
10
|
-
IDocumentServiceFactory,
|
|
11
|
-
IDocumentStorageService,
|
|
12
|
-
IResolvedUrl,
|
|
13
|
-
ISummaryContext,
|
|
14
|
-
} from "@fluidframework/driver-definitions/internal";
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated - unused
|
|
18
|
-
* Wraps the given IDocumentStorageService to override the `uploadSummaryWithContext` method. It calls the
|
|
19
|
-
* `uploadSummaryCb` whenever a summary is uploaded by the client. The summary context can be updated in the
|
|
20
|
-
* callback before it is uploaded to the server.
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export function wrapDocumentStorageService(
|
|
24
|
-
innerDocStorageService: IDocumentStorageService,
|
|
25
|
-
uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
|
|
26
|
-
) {
|
|
27
|
-
const outerDocStorageService = Object.create(
|
|
28
|
-
innerDocStorageService,
|
|
29
|
-
) as IDocumentStorageService;
|
|
30
|
-
outerDocStorageService.uploadSummaryWithContext = async (
|
|
31
|
-
summary: ISummaryTree,
|
|
32
|
-
context: ISummaryContext,
|
|
33
|
-
): Promise<string> => {
|
|
34
|
-
const newContext = uploadSummaryCb(summary, context);
|
|
35
|
-
return innerDocStorageService.uploadSummaryWithContext(summary, newContext);
|
|
36
|
-
};
|
|
37
|
-
return outerDocStorageService;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated - unused
|
|
42
|
-
* Wraps the given IDocumentService to override the `connectToStorage` method. The intent is to plumb the
|
|
43
|
-
* `uploadSummaryCb` to the IDocumentStorageService so that it is called whenever a summary is uploaded by
|
|
44
|
-
* the client.
|
|
45
|
-
* The document storage service that is created in `connectToStorage` is wrapped by calling `wrapDocumentStorageService`
|
|
46
|
-
* to pass in the `uploadSummaryCb`.
|
|
47
|
-
* @internal
|
|
48
|
-
*/
|
|
49
|
-
export function wrapDocumentService(
|
|
50
|
-
innerDocService: IDocumentService,
|
|
51
|
-
uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
|
|
52
|
-
) {
|
|
53
|
-
const outerDocService = Object.create(innerDocService) as IDocumentService;
|
|
54
|
-
outerDocService.connectToStorage = async (): Promise<IDocumentStorageService> => {
|
|
55
|
-
const storageService = await innerDocService.connectToStorage();
|
|
56
|
-
return wrapDocumentStorageService(storageService, uploadSummaryCb);
|
|
57
|
-
};
|
|
58
|
-
return outerDocService;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @deprecated - unused
|
|
63
|
-
* Wraps the given IDocumentServiceFactory to override the `createDocumentService` method. The intent is to plumb
|
|
64
|
-
* the `uploadSummaryCb` all the way to the IDocumentStorageService so that it is called whenever a summary is
|
|
65
|
-
* uploaded by the client.
|
|
66
|
-
* The document service that is created in `createDocumentService` is wrapped by calling `wrapDocumentService` to
|
|
67
|
-
* pass in the `uploadSummaryCb`.
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
export function wrapDocumentServiceFactory(
|
|
71
|
-
innerDocServiceFactory: IDocumentServiceFactory,
|
|
72
|
-
uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext,
|
|
73
|
-
) {
|
|
74
|
-
const outerDocServiceFactory = Object.create(
|
|
75
|
-
innerDocServiceFactory,
|
|
76
|
-
) as IDocumentServiceFactory;
|
|
77
|
-
outerDocServiceFactory.createDocumentService = async (
|
|
78
|
-
resolvedUrl: IResolvedUrl,
|
|
79
|
-
logger?: ITelemetryBaseLogger,
|
|
80
|
-
clientIsSummarizer?: boolean,
|
|
81
|
-
): Promise<IDocumentService> => {
|
|
82
|
-
const documentService = await innerDocServiceFactory.createDocumentService(
|
|
83
|
-
resolvedUrl,
|
|
84
|
-
logger,
|
|
85
|
-
clientIsSummarizer,
|
|
86
|
-
);
|
|
87
|
-
return wrapDocumentService(documentService, uploadSummaryCb);
|
|
88
|
-
};
|
|
89
|
-
return outerDocServiceFactory;
|
|
90
|
-
}
|