@fluidframework/test-utils 2.20.0 → 2.22.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/.eslintrc.cjs +0 -1
- package/CHANGELOG.md +8 -0
- package/README.md +1 -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/loaderContainerTracker.d.ts.map +1 -1
- package/dist/loaderContainerTracker.js +2 -1
- package/dist/loaderContainerTracker.js.map +1 -1
- package/dist/nonEmptyArrayType.d.ts +7 -0
- package/dist/nonEmptyArrayType.d.ts.map +1 -0
- package/dist/nonEmptyArrayType.js +12 -0
- package/dist/nonEmptyArrayType.js.map +1 -0
- 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/testObjectProvider.d.ts.map +1 -1
- package/dist/testObjectProvider.js +2 -1
- package/dist/testObjectProvider.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/loaderContainerTracker.d.ts.map +1 -1
- package/lib/loaderContainerTracker.js +2 -1
- package/lib/loaderContainerTracker.js.map +1 -1
- package/lib/nonEmptyArrayType.d.ts +7 -0
- package/lib/nonEmptyArrayType.d.ts.map +1 -0
- package/lib/nonEmptyArrayType.js +8 -0
- package/lib/nonEmptyArrayType.js.map +1 -0
- 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/testObjectProvider.d.ts.map +1 -1
- package/lib/testObjectProvider.js +2 -1
- package/lib/testObjectProvider.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 +28 -35
- package/src/TestSummaryUtils.ts +3 -0
- package/src/index.ts +0 -6
- package/src/loaderContainerTracker.ts +3 -2
- package/src/nonEmptyArrayType.ts +10 -0
- package/src/packageVersion.ts +1 -1
- package/src/testFluidObject.ts +3 -6
- package/src/testObjectProvider.ts +2 -1
- package/src/timeoutUtils.ts +0 -6
- package/tsconfig.json +0 -1
- 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/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/tsconfig.json
CHANGED
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
|
-
}
|