@fluidframework/test-utils 2.13.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 +17 -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/package.json +2 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/testContainerRuntimeFactory.d.ts.map +1 -1
- package/dist/testContainerRuntimeFactory.js +1 -6
- package/dist/testContainerRuntimeFactory.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/testContainerRuntimeFactory.d.ts.map +1 -1
- package/lib/testContainerRuntimeFactory.js +2 -9
- package/lib/testContainerRuntimeFactory.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 +25 -25
- package/src/TestSummaryUtils.ts +3 -0
- package/src/index.ts +0 -6
- package/src/packageVersion.ts +1 -1
- package/src/testContainerRuntimeFactory.ts +0 -7
- 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
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
import { IContainerContext, IRuntime } from "@fluidframework/container-definitions/internal";
|
|
7
7
|
import {
|
|
8
|
-
// eslint-disable-next-line import/no-deprecated -- ContainerRuntime class to be moved to internal scope
|
|
9
8
|
ContainerRuntime,
|
|
10
9
|
DefaultSummaryConfiguration,
|
|
11
10
|
type IContainerRuntimeOptionsInternal,
|
|
@@ -58,9 +57,7 @@ interface backCompat_ContainerRuntime {
|
|
|
58
57
|
runtimeOptions?: IContainerRuntimeOptionsInternal,
|
|
59
58
|
containerScope?: FluidObject,
|
|
60
59
|
existing?: boolean,
|
|
61
|
-
// eslint-disable-next-line import/no-deprecated -- ContainerRuntime class to be moved to internal scope
|
|
62
60
|
containerRuntimeCtor?: typeof ContainerRuntime,
|
|
63
|
-
// eslint-disable-next-line import/no-deprecated -- ContainerRuntime class to be moved to internal scope
|
|
64
61
|
): Promise<ContainerRuntime>;
|
|
65
62
|
}
|
|
66
63
|
|
|
@@ -69,7 +66,6 @@ interface backCompat_ContainerRuntime {
|
|
|
69
66
|
* @internal
|
|
70
67
|
*/
|
|
71
68
|
export const createTestContainerRuntimeFactory = (
|
|
72
|
-
// eslint-disable-next-line import/no-deprecated -- ContainerRuntime class to be moved to internal scope
|
|
73
69
|
containerRuntimeCtor: typeof ContainerRuntime,
|
|
74
70
|
) => {
|
|
75
71
|
return class extends RuntimeFactoryHelper {
|
|
@@ -92,7 +88,6 @@ export const createTestContainerRuntimeFactory = (
|
|
|
92
88
|
super();
|
|
93
89
|
}
|
|
94
90
|
|
|
95
|
-
// eslint-disable-next-line import/no-deprecated -- ContainerRuntime class to be moved to internal scope
|
|
96
91
|
public async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {
|
|
97
92
|
// Back-compat - old code does not return IDataStore for rootContext.attachRuntime() call!
|
|
98
93
|
// Thus need to leverage old API createDetachedRootDataStore() that is gone in latest releases.
|
|
@@ -111,7 +106,6 @@ export const createTestContainerRuntimeFactory = (
|
|
|
111
106
|
assert(result === "Success" || result === undefined, "success");
|
|
112
107
|
}
|
|
113
108
|
|
|
114
|
-
// eslint-disable-next-line import/no-deprecated -- ContainerRuntime class to be moved to internal scope
|
|
115
109
|
public async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {
|
|
116
110
|
// Validate we can load root data stores.
|
|
117
111
|
// We should be able to load any data store that was created in initializeFirstTime!
|
|
@@ -190,5 +184,4 @@ export const createTestContainerRuntimeFactory = (
|
|
|
190
184
|
* A container runtime factory that allows you to set runtime options
|
|
191
185
|
* @internal
|
|
192
186
|
*/
|
|
193
|
-
// eslint-disable-next-line import/no-deprecated -- ContainerRuntime class to be moved to internal scope
|
|
194
187
|
export const TestContainerRuntimeFactory = createTestContainerRuntimeFactory(ContainerRuntime);
|
package/src/testFluidObject.ts
CHANGED
|
@@ -45,7 +45,7 @@ export class TestFluidObject implements ITestFluidObject {
|
|
|
45
45
|
|
|
46
46
|
public root!: ISharedMap;
|
|
47
47
|
private readonly innerHandle: IFluidHandle<this>;
|
|
48
|
-
private
|
|
48
|
+
private initializationPromise: Promise<void> | undefined;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Creates a new TestFluidObject.
|
|
@@ -104,11 +104,8 @@ export class TestFluidObject implements ITestFluidObject {
|
|
|
104
104
|
this.root = (await this.runtime.getChannel("root")) as ISharedMap;
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return this.initializeP;
|
|
107
|
+
this.initializationPromise ??= doInitialization();
|
|
108
|
+
return this.initializationPromise;
|
|
112
109
|
}
|
|
113
110
|
}
|
|
114
111
|
|
package/src/timeoutUtils.ts
CHANGED
|
@@ -6,12 +6,6 @@
|
|
|
6
6
|
import { assert, Deferred } from "@fluidframework/core-utils/internal";
|
|
7
7
|
import type * as Mocha from "mocha";
|
|
8
8
|
|
|
9
|
-
// @deprecated this value is no longer used
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export const defaultTimeoutDurationMs = 250;
|
|
14
|
-
|
|
15
9
|
const timeBuffer = 15; // leave 15 ms leeway for finish processing
|
|
16
10
|
|
|
17
11
|
// TestTimeout class that manages tracking of test timeout. It creates a timer when timeout is in effect,
|
package/dist/DriverWrappers.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
6
|
-
import { IDocumentService, IDocumentServiceFactory, IDocumentStorageService, ISummaryContext } from "@fluidframework/driver-definitions/internal";
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated - unused
|
|
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
|
-
export declare function wrapDocumentStorageService(innerDocStorageService: IDocumentStorageService, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentStorageService;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated - unused
|
|
17
|
-
* Wraps the given IDocumentService to override the `connectToStorage` method. The intent is to plumb the
|
|
18
|
-
* `uploadSummaryCb` to the IDocumentStorageService so that it is called whenever a summary is uploaded by
|
|
19
|
-
* the client.
|
|
20
|
-
* The document storage service that is created in `connectToStorage` is wrapped by calling `wrapDocumentStorageService`
|
|
21
|
-
* to pass in the `uploadSummaryCb`.
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
export declare function wrapDocumentService(innerDocService: IDocumentService, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentService;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated - unused
|
|
27
|
-
* Wraps the given IDocumentServiceFactory to override the `createDocumentService` method. The intent is to plumb
|
|
28
|
-
* the `uploadSummaryCb` all the way to the IDocumentStorageService so that it is called whenever a summary is
|
|
29
|
-
* uploaded by the client.
|
|
30
|
-
* The document service that is created in `createDocumentService` is wrapped by calling `wrapDocumentService` to
|
|
31
|
-
* pass in the `uploadSummaryCb`.
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
export declare function wrapDocumentServiceFactory(innerDocServiceFactory: IDocumentServiceFactory, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentServiceFactory;
|
|
35
|
-
//# sourceMappingURL=DriverWrappers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DriverWrappers.d.ts","sourceRoot":"","sources":["../src/DriverWrappers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EAEvB,eAAe,EACf,MAAM,6CAA6C,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACzC,sBAAsB,EAAE,uBAAuB,EAC/C,eAAe,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,KAAK,eAAe,2BAazF;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAClC,eAAe,EAAE,gBAAgB,EACjC,eAAe,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,KAAK,eAAe,oBAQzF;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACzC,sBAAsB,EAAE,uBAAuB,EAC/C,eAAe,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,KAAK,eAAe,2BAkBzF"}
|
package/dist/DriverWrappers.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
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
|
-
* @deprecated - unused
|
|
10
|
-
* Wraps the given IDocumentStorageService to override the `uploadSummaryWithContext` method. It calls the
|
|
11
|
-
* `uploadSummaryCb` whenever a summary is uploaded by the client. The summary context can be updated in the
|
|
12
|
-
* callback before it is uploaded to the server.
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
function wrapDocumentStorageService(innerDocStorageService, uploadSummaryCb) {
|
|
16
|
-
const outerDocStorageService = Object.create(innerDocStorageService);
|
|
17
|
-
outerDocStorageService.uploadSummaryWithContext = async (summary, context) => {
|
|
18
|
-
const newContext = uploadSummaryCb(summary, context);
|
|
19
|
-
return innerDocStorageService.uploadSummaryWithContext(summary, newContext);
|
|
20
|
-
};
|
|
21
|
-
return outerDocStorageService;
|
|
22
|
-
}
|
|
23
|
-
exports.wrapDocumentStorageService = wrapDocumentStorageService;
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated - unused
|
|
26
|
-
* Wraps the given IDocumentService to override the `connectToStorage` method. The intent is to plumb the
|
|
27
|
-
* `uploadSummaryCb` to the IDocumentStorageService so that it is called whenever a summary is uploaded by
|
|
28
|
-
* the client.
|
|
29
|
-
* The document storage service that is created in `connectToStorage` is wrapped by calling `wrapDocumentStorageService`
|
|
30
|
-
* to pass in the `uploadSummaryCb`.
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
function wrapDocumentService(innerDocService, uploadSummaryCb) {
|
|
34
|
-
const outerDocService = Object.create(innerDocService);
|
|
35
|
-
outerDocService.connectToStorage = async () => {
|
|
36
|
-
const storageService = await innerDocService.connectToStorage();
|
|
37
|
-
return wrapDocumentStorageService(storageService, uploadSummaryCb);
|
|
38
|
-
};
|
|
39
|
-
return outerDocService;
|
|
40
|
-
}
|
|
41
|
-
exports.wrapDocumentService = wrapDocumentService;
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated - unused
|
|
44
|
-
* Wraps the given IDocumentServiceFactory to override the `createDocumentService` method. The intent is to plumb
|
|
45
|
-
* the `uploadSummaryCb` all the way to the IDocumentStorageService so that it is called whenever a summary is
|
|
46
|
-
* uploaded by the client.
|
|
47
|
-
* The document service that is created in `createDocumentService` is wrapped by calling `wrapDocumentService` to
|
|
48
|
-
* pass in the `uploadSummaryCb`.
|
|
49
|
-
* @internal
|
|
50
|
-
*/
|
|
51
|
-
function wrapDocumentServiceFactory(innerDocServiceFactory, uploadSummaryCb) {
|
|
52
|
-
const outerDocServiceFactory = Object.create(innerDocServiceFactory);
|
|
53
|
-
outerDocServiceFactory.createDocumentService = async (resolvedUrl, logger, clientIsSummarizer) => {
|
|
54
|
-
const documentService = await innerDocServiceFactory.createDocumentService(resolvedUrl, logger, clientIsSummarizer);
|
|
55
|
-
return wrapDocumentService(documentService, uploadSummaryCb);
|
|
56
|
-
};
|
|
57
|
-
return outerDocServiceFactory;
|
|
58
|
-
}
|
|
59
|
-
exports.wrapDocumentServiceFactory = wrapDocumentServiceFactory;
|
|
60
|
-
//# sourceMappingURL=DriverWrappers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DriverWrappers.js","sourceRoot":"","sources":["../src/DriverWrappers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAYH;;;;;;GAMG;AACH,SAAgB,0BAA0B,CACzC,sBAA+C,EAC/C,eAAyF;IAEzF,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAC3C,sBAAsB,CACK,CAAC;IAC7B,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;AAfD,gEAeC;AAED;;;;;;;;GAQG;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;;;;;;;;GAQG;AACH,SAAgB,0BAA0B,CACzC,sBAA+C,EAC/C,eAAyF;IAEzF,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAC3C,sBAAsB,CACK,CAAC;IAC7B,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;AApBD,gEAoBC","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 { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n\tISummaryContext,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * @deprecated - unused\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(\n\t\tinnerDocStorageService,\n\t) 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 * @deprecated - unused\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 * @deprecated - unused\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(\n\t\tinnerDocServiceFactory,\n\t) 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"]}
|
package/lib/DriverWrappers.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { ISummaryTree } from "@fluidframework/driver-definitions";
|
|
6
|
-
import { IDocumentService, IDocumentServiceFactory, IDocumentStorageService, ISummaryContext } from "@fluidframework/driver-definitions/internal";
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated - unused
|
|
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
|
-
export declare function wrapDocumentStorageService(innerDocStorageService: IDocumentStorageService, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentStorageService;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated - unused
|
|
17
|
-
* Wraps the given IDocumentService to override the `connectToStorage` method. The intent is to plumb the
|
|
18
|
-
* `uploadSummaryCb` to the IDocumentStorageService so that it is called whenever a summary is uploaded by
|
|
19
|
-
* the client.
|
|
20
|
-
* The document storage service that is created in `connectToStorage` is wrapped by calling `wrapDocumentStorageService`
|
|
21
|
-
* to pass in the `uploadSummaryCb`.
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
export declare function wrapDocumentService(innerDocService: IDocumentService, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentService;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated - unused
|
|
27
|
-
* Wraps the given IDocumentServiceFactory to override the `createDocumentService` method. The intent is to plumb
|
|
28
|
-
* the `uploadSummaryCb` all the way to the IDocumentStorageService so that it is called whenever a summary is
|
|
29
|
-
* uploaded by the client.
|
|
30
|
-
* The document service that is created in `createDocumentService` is wrapped by calling `wrapDocumentService` to
|
|
31
|
-
* pass in the `uploadSummaryCb`.
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
export declare function wrapDocumentServiceFactory(innerDocServiceFactory: IDocumentServiceFactory, uploadSummaryCb: (summaryTree: ISummaryTree, context: ISummaryContext) => ISummaryContext): IDocumentServiceFactory;
|
|
35
|
-
//# sourceMappingURL=DriverWrappers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DriverWrappers.d.ts","sourceRoot":"","sources":["../src/DriverWrappers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EAEvB,eAAe,EACf,MAAM,6CAA6C,CAAC;AAErD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACzC,sBAAsB,EAAE,uBAAuB,EAC/C,eAAe,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,KAAK,eAAe,2BAazF;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAClC,eAAe,EAAE,gBAAgB,EACjC,eAAe,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,KAAK,eAAe,oBAQzF;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACzC,sBAAsB,EAAE,uBAAuB,EAC/C,eAAe,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,KAAK,eAAe,2BAkBzF"}
|
package/lib/DriverWrappers.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated - unused
|
|
7
|
-
* Wraps the given IDocumentStorageService to override the `uploadSummaryWithContext` method. It calls the
|
|
8
|
-
* `uploadSummaryCb` whenever a summary is uploaded by the client. The summary context can be updated in the
|
|
9
|
-
* callback before it is uploaded to the server.
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export function wrapDocumentStorageService(innerDocStorageService, uploadSummaryCb) {
|
|
13
|
-
const outerDocStorageService = Object.create(innerDocStorageService);
|
|
14
|
-
outerDocStorageService.uploadSummaryWithContext = async (summary, context) => {
|
|
15
|
-
const newContext = uploadSummaryCb(summary, context);
|
|
16
|
-
return innerDocStorageService.uploadSummaryWithContext(summary, newContext);
|
|
17
|
-
};
|
|
18
|
-
return outerDocStorageService;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated - unused
|
|
22
|
-
* Wraps the given IDocumentService to override the `connectToStorage` method. The intent is to plumb the
|
|
23
|
-
* `uploadSummaryCb` to the IDocumentStorageService so that it is called whenever a summary is uploaded by
|
|
24
|
-
* the client.
|
|
25
|
-
* The document storage service that is created in `connectToStorage` is wrapped by calling `wrapDocumentStorageService`
|
|
26
|
-
* to pass in the `uploadSummaryCb`.
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export function wrapDocumentService(innerDocService, uploadSummaryCb) {
|
|
30
|
-
const outerDocService = Object.create(innerDocService);
|
|
31
|
-
outerDocService.connectToStorage = async () => {
|
|
32
|
-
const storageService = await innerDocService.connectToStorage();
|
|
33
|
-
return wrapDocumentStorageService(storageService, uploadSummaryCb);
|
|
34
|
-
};
|
|
35
|
-
return outerDocService;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated - unused
|
|
39
|
-
* Wraps the given IDocumentServiceFactory to override the `createDocumentService` method. The intent is to plumb
|
|
40
|
-
* the `uploadSummaryCb` all the way to the IDocumentStorageService so that it is called whenever a summary is
|
|
41
|
-
* uploaded by the client.
|
|
42
|
-
* The document service that is created in `createDocumentService` is wrapped by calling `wrapDocumentService` to
|
|
43
|
-
* pass in the `uploadSummaryCb`.
|
|
44
|
-
* @internal
|
|
45
|
-
*/
|
|
46
|
-
export function wrapDocumentServiceFactory(innerDocServiceFactory, uploadSummaryCb) {
|
|
47
|
-
const outerDocServiceFactory = Object.create(innerDocServiceFactory);
|
|
48
|
-
outerDocServiceFactory.createDocumentService = async (resolvedUrl, logger, clientIsSummarizer) => {
|
|
49
|
-
const documentService = await innerDocServiceFactory.createDocumentService(resolvedUrl, logger, clientIsSummarizer);
|
|
50
|
-
return wrapDocumentService(documentService, uploadSummaryCb);
|
|
51
|
-
};
|
|
52
|
-
return outerDocServiceFactory;
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=DriverWrappers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DriverWrappers.js","sourceRoot":"","sources":["../src/DriverWrappers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CACzC,sBAA+C,EAC/C,eAAyF;IAEzF,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAC3C,sBAAsB,CACK,CAAC;IAC7B,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;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,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;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CACzC,sBAA+C,EAC/C,eAAyF;IAEzF,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAC3C,sBAAsB,CACK,CAAC;IAC7B,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","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 { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport {\n\tIDocumentService,\n\tIDocumentServiceFactory,\n\tIDocumentStorageService,\n\tIResolvedUrl,\n\tISummaryContext,\n} from \"@fluidframework/driver-definitions/internal\";\n\n/**\n * @deprecated - unused\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(\n\t\tinnerDocStorageService,\n\t) 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 * @deprecated - unused\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 * @deprecated - unused\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(\n\t\tinnerDocServiceFactory,\n\t) 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"]}
|
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
|
-
}
|