@fluidframework/test-utils 2.0.0-dev.7.4.0.215930 → 2.0.0-dev.7.4.0.216897
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-extractor-lint.json +13 -0
- package/api-extractor.json +0 -4
- package/api-report/test-utils.api.md +79 -73
- package/dist/DriverWrappers.d.ts +3 -0
- package/dist/DriverWrappers.d.ts.map +1 -1
- package/dist/DriverWrappers.js +3 -0
- package/dist/DriverWrappers.js.map +1 -1
- package/dist/TestConfigs.d.ts +3 -0
- package/dist/TestConfigs.d.ts.map +1 -1
- package/dist/TestConfigs.js +3 -0
- package/dist/TestConfigs.js.map +1 -1
- package/dist/TestSummaryUtils.d.ts +3 -0
- package/dist/TestSummaryUtils.d.ts.map +1 -1
- package/dist/TestSummaryUtils.js +3 -0
- package/dist/TestSummaryUtils.js.map +1 -1
- package/dist/containerUtils.d.ts +11 -0
- package/dist/containerUtils.d.ts.map +1 -1
- package/dist/containerUtils.js +27 -2
- package/dist/containerUtils.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- 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 +3 -0
- package/dist/loaderContainerTracker.d.ts.map +1 -1
- package/dist/loaderContainerTracker.js +3 -0
- package/dist/loaderContainerTracker.js.map +1 -1
- package/dist/localCodeLoader.d.ts +7 -0
- package/dist/localCodeLoader.d.ts.map +1 -1
- package/dist/localCodeLoader.js +1 -0
- package/dist/localCodeLoader.js.map +1 -1
- package/dist/localLoader.d.ts +2 -0
- 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.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 +1 -0
- package/dist/retry.js.map +1 -1
- package/dist/test-utils-alpha.d.ts +176 -678
- package/dist/test-utils-beta.d.ts +176 -678
- package/dist/test-utils-public.d.ts +176 -678
- package/dist/test-utils-untrimmed.d.ts +348 -37
- package/dist/testContainerRuntimeFactory.d.ts +2 -0
- package/dist/testContainerRuntimeFactory.d.ts.map +1 -1
- package/dist/testContainerRuntimeFactory.js +15 -7
- package/dist/testContainerRuntimeFactory.js.map +1 -1
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.d.ts +1 -0
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -1
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.js +1 -0
- package/dist/testContainerRuntimeFactoryWithDefaultDataStore.js.map +1 -1
- package/dist/testFluidObject.d.ts +5 -0
- package/dist/testFluidObject.d.ts.map +1 -1
- package/dist/testFluidObject.js +2 -0
- package/dist/testFluidObject.js.map +1 -1
- package/dist/testObjectProvider.d.ts +287 -37
- package/dist/testObjectProvider.d.ts.map +1 -1
- package/dist/testObjectProvider.js +310 -25
- package/dist/testObjectProvider.js.map +1 -1
- package/dist/timeoutUtils.d.ts +11 -0
- package/dist/timeoutUtils.d.ts.map +1 -1
- package/dist/timeoutUtils.js +5 -0
- package/dist/timeoutUtils.js.map +1 -1
- package/lib/test-utils-alpha.d.ts +176 -678
- package/lib/test-utils-beta.d.ts +176 -678
- package/lib/test-utils-public.d.ts +176 -678
- package/lib/test-utils-untrimmed.d.ts +348 -37
- package/package.json +34 -24
- package/src/DriverWrappers.ts +3 -0
- package/src/TestConfigs.ts +3 -0
- package/src/TestSummaryUtils.ts +3 -0
- package/src/containerUtils.ts +27 -1
- package/src/index.ts +7 -1
- package/src/interfaces.ts +6 -0
- package/src/loaderContainerTracker.ts +3 -0
- package/src/localCodeLoader.ts +7 -0
- package/src/localLoader.ts +2 -0
- package/src/packageVersion.ts +1 -1
- package/src/retry.ts +1 -0
- package/src/testContainerRuntimeFactory.ts +24 -5
- package/src/testContainerRuntimeFactoryWithDefaultDataStore.ts +1 -0
- package/src/testFluidObject.ts +5 -0
- package/src/testObjectProvider.ts +524 -47
- package/src/timeoutUtils.ts +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/test-utils",
|
|
3
|
-
"version": "2.0.0-dev.7.4.0.
|
|
3
|
+
"version": "2.0.0-dev.7.4.0.216897",
|
|
4
4
|
"description": "Utilities for Fluid tests",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -34,27 +34,27 @@
|
|
|
34
34
|
"temp-directory": "nyc/.nyc_output"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@fluidframework/aqueduct": "2.0.0-dev.7.4.0.
|
|
38
|
-
"@fluidframework/container-definitions": "2.0.0-dev.7.4.0.
|
|
39
|
-
"@fluidframework/container-loader": "2.0.0-dev.7.4.0.
|
|
40
|
-
"@fluidframework/container-runtime": "2.0.0-dev.7.4.0.
|
|
41
|
-
"@fluidframework/container-runtime-definitions": "2.0.0-dev.7.4.0.
|
|
42
|
-
"@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.
|
|
43
|
-
"@fluidframework/core-utils": "2.0.0-dev.7.4.0.
|
|
44
|
-
"@fluidframework/datastore": "2.0.0-dev.7.4.0.
|
|
45
|
-
"@fluidframework/datastore-definitions": "2.0.0-dev.7.4.0.
|
|
46
|
-
"@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.
|
|
47
|
-
"@fluidframework/driver-utils": "2.0.0-dev.7.4.0.
|
|
48
|
-
"@fluidframework/local-driver": "2.0.0-dev.7.4.0.
|
|
49
|
-
"@fluidframework/map": "2.0.0-dev.7.4.0.
|
|
37
|
+
"@fluidframework/aqueduct": "2.0.0-dev.7.4.0.216897",
|
|
38
|
+
"@fluidframework/container-definitions": "2.0.0-dev.7.4.0.216897",
|
|
39
|
+
"@fluidframework/container-loader": "2.0.0-dev.7.4.0.216897",
|
|
40
|
+
"@fluidframework/container-runtime": "2.0.0-dev.7.4.0.216897",
|
|
41
|
+
"@fluidframework/container-runtime-definitions": "2.0.0-dev.7.4.0.216897",
|
|
42
|
+
"@fluidframework/core-interfaces": "2.0.0-dev.7.4.0.216897",
|
|
43
|
+
"@fluidframework/core-utils": "2.0.0-dev.7.4.0.216897",
|
|
44
|
+
"@fluidframework/datastore": "2.0.0-dev.7.4.0.216897",
|
|
45
|
+
"@fluidframework/datastore-definitions": "2.0.0-dev.7.4.0.216897",
|
|
46
|
+
"@fluidframework/driver-definitions": "2.0.0-dev.7.4.0.216897",
|
|
47
|
+
"@fluidframework/driver-utils": "2.0.0-dev.7.4.0.216897",
|
|
48
|
+
"@fluidframework/local-driver": "2.0.0-dev.7.4.0.216897",
|
|
49
|
+
"@fluidframework/map": "2.0.0-dev.7.4.0.216897",
|
|
50
50
|
"@fluidframework/protocol-definitions": "^3.0.0",
|
|
51
|
-
"@fluidframework/request-handler": "2.0.0-dev.7.4.0.
|
|
52
|
-
"@fluidframework/routerlicious-driver": "2.0.0-dev.7.4.0.
|
|
53
|
-
"@fluidframework/runtime-definitions": "2.0.0-dev.7.4.0.
|
|
54
|
-
"@fluidframework/runtime-utils": "2.0.0-dev.7.4.0.
|
|
55
|
-
"@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.
|
|
56
|
-
"@fluidframework/test-driver-definitions": "2.0.0-dev.7.4.0.
|
|
57
|
-
"@fluidframework/test-runtime-utils": "2.0.0-dev.7.4.0.
|
|
51
|
+
"@fluidframework/request-handler": "2.0.0-dev.7.4.0.216897",
|
|
52
|
+
"@fluidframework/routerlicious-driver": "2.0.0-dev.7.4.0.216897",
|
|
53
|
+
"@fluidframework/runtime-definitions": "2.0.0-dev.7.4.0.216897",
|
|
54
|
+
"@fluidframework/runtime-utils": "2.0.0-dev.7.4.0.216897",
|
|
55
|
+
"@fluidframework/telemetry-utils": "2.0.0-dev.7.4.0.216897",
|
|
56
|
+
"@fluidframework/test-driver-definitions": "2.0.0-dev.7.4.0.216897",
|
|
57
|
+
"@fluidframework/test-runtime-utils": "2.0.0-dev.7.4.0.216897",
|
|
58
58
|
"best-random": "^1.0.0",
|
|
59
59
|
"debug": "^4.3.4",
|
|
60
60
|
"uuid": "^9.0.0"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@fluidframework/build-common": "^2.0.3",
|
|
65
65
|
"@fluidframework/build-tools": "^0.28.0",
|
|
66
66
|
"@fluidframework/eslint-config-fluid": "^3.1.0",
|
|
67
|
-
"@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.
|
|
67
|
+
"@fluidframework/mocha-test-setup": "2.0.0-dev.7.4.0.216897",
|
|
68
68
|
"@fluidframework/test-utils-previous": "npm:@fluidframework/test-utils@2.0.0-internal.7.2.0",
|
|
69
69
|
"@microsoft/api-extractor": "^7.38.3",
|
|
70
70
|
"@types/debug": "^4.1.5",
|
|
@@ -98,7 +98,16 @@
|
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
"typeValidation": {
|
|
101
|
-
"broken": {
|
|
101
|
+
"broken": {
|
|
102
|
+
"InterfaceDeclaration_ITestObjectProvider": {
|
|
103
|
+
"backCompat": false,
|
|
104
|
+
"forwardCompat": false
|
|
105
|
+
},
|
|
106
|
+
"ClassDeclaration_TestObjectProvider": {
|
|
107
|
+
"backCompat": false,
|
|
108
|
+
"forwardCompat": false
|
|
109
|
+
}
|
|
110
|
+
}
|
|
102
111
|
},
|
|
103
112
|
"scripts": {
|
|
104
113
|
"api": "fluid-build . --task api",
|
|
@@ -110,12 +119,13 @@
|
|
|
110
119
|
"build:docs": "fluid-build . --task api",
|
|
111
120
|
"build:genver": "gen-version",
|
|
112
121
|
"build:test": "tsc --project ./src/test/tsconfig.json",
|
|
122
|
+
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
113
123
|
"ci:build:docs": "api-extractor run",
|
|
114
124
|
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
115
125
|
"eslint": "eslint --format stylish src",
|
|
116
126
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
117
127
|
"format": "npm run prettier:fix",
|
|
118
|
-
"lint": "npm run prettier && npm run eslint",
|
|
128
|
+
"lint": "npm run prettier && npm run check:release-tags && npm run eslint",
|
|
119
129
|
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
120
130
|
"prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
121
131
|
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
package/src/DriverWrappers.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { ISummaryTree } from "@fluidframework/protocol-definitions";
|
|
|
17
17
|
* Wraps the given IDocumentStorageService to override the `uploadSummaryWithContext` method. It calls the
|
|
18
18
|
* `uploadSummaryCb` whenever a summary is uploaded by the client. The summary context can be updated in the
|
|
19
19
|
* callback before it is uploaded to the server.
|
|
20
|
+
* @internal
|
|
20
21
|
*/
|
|
21
22
|
export function wrapDocumentStorageService(
|
|
22
23
|
innerDocStorageService: IDocumentStorageService,
|
|
@@ -39,6 +40,7 @@ export function wrapDocumentStorageService(
|
|
|
39
40
|
* the client.
|
|
40
41
|
* The document storage service that is created in `connectToStorage` is wrapped by calling `wrapDocumentStorageService`
|
|
41
42
|
* to pass in the `uploadSummaryCb`.
|
|
43
|
+
* @internal
|
|
42
44
|
*/
|
|
43
45
|
export function wrapDocumentService(
|
|
44
46
|
innerDocService: IDocumentService,
|
|
@@ -58,6 +60,7 @@ export function wrapDocumentService(
|
|
|
58
60
|
* uploaded by the client.
|
|
59
61
|
* The document service that is created in `createDocumentService` is wrapped by calling `wrapDocumentService` to
|
|
60
62
|
* pass in the `uploadSummaryCb`.
|
|
63
|
+
* @internal
|
|
61
64
|
*/
|
|
62
65
|
export function wrapDocumentServiceFactory(
|
|
63
66
|
innerDocServiceFactory: IDocumentServiceFactory,
|
package/src/TestConfigs.ts
CHANGED
package/src/TestSummaryUtils.ts
CHANGED
|
@@ -77,6 +77,7 @@ const defaultSummaryOptions: ISummaryRuntimeOptions = {
|
|
|
77
77
|
* Creates a summarizer client from the given container and data store factory, and returns the summarizer client's
|
|
78
78
|
* IContainer and ISummarizer.
|
|
79
79
|
* The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
|
|
80
|
+
* @internal
|
|
80
81
|
*/
|
|
81
82
|
export async function createSummarizerFromFactory(
|
|
82
83
|
provider: ITestObjectProvider,
|
|
@@ -114,6 +115,7 @@ export async function createSummarizerFromFactory(
|
|
|
114
115
|
* The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
|
|
115
116
|
*
|
|
116
117
|
* Can pass in a test config provider to enable/disable features.
|
|
118
|
+
* @internal
|
|
117
119
|
*/
|
|
118
120
|
export async function createSummarizer(
|
|
119
121
|
provider: ITestObjectProvider,
|
|
@@ -145,6 +147,7 @@ export async function createSummarizer(
|
|
|
145
147
|
* @param summarizer - The ISummarizer to use to summarize on demand
|
|
146
148
|
* @param inputs - Either the reason string or the full IOnDemandSummarizeOptions.
|
|
147
149
|
* Defaults to the reason "end-to-end test".
|
|
150
|
+
* @internal
|
|
148
151
|
*/
|
|
149
152
|
export async function summarizeNow(
|
|
150
153
|
summarizer: ISummarizer,
|
package/src/containerUtils.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { IContainer } from "@fluidframework/container-definitions";
|
|
|
7
7
|
import { ConnectionState } from "@fluidframework/container-loader";
|
|
8
8
|
import { IResponse } from "@fluidframework/core-interfaces";
|
|
9
9
|
import { assert } from "@fluidframework/core-utils";
|
|
10
|
+
import { IDataStore } from "@fluidframework/runtime-definitions";
|
|
10
11
|
import { PromiseExecutor, timeoutPromise, TimeoutWithError } from "./timeoutUtils";
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -29,6 +30,7 @@ import { PromiseExecutor, timeoutPromise, TimeoutWithError } from "./timeoutUtil
|
|
|
29
30
|
* - Rejects if failOnContainerClose === true and the container emits a 'closed' event before a 'connected' event.
|
|
30
31
|
* - Rejects after timeoutOptions.durationMs if timeoutOptions !== undefined and the container does not emit relevant
|
|
31
32
|
* events, within that timeframe.
|
|
33
|
+
* @internal
|
|
32
34
|
*/
|
|
33
35
|
export async function waitForContainerConnection(
|
|
34
36
|
container: IContainer,
|
|
@@ -53,12 +55,36 @@ export async function waitForContainerConnection(
|
|
|
53
55
|
* This function should ONLY be used for back compat purposes
|
|
54
56
|
* LTS versions of the Loader/Container will not have the "getEntryPoint" method, so we need to fallback to "request"
|
|
55
57
|
* This function can be removed once LTS version of Loader moves to 2.0.0-internal.7.0.0
|
|
58
|
+
* @internal
|
|
56
59
|
*/
|
|
57
60
|
export async function getContainerEntryPointBackCompat<T>(container: IContainer): Promise<T> {
|
|
58
61
|
if (container.getEntryPoint !== undefined) {
|
|
59
|
-
|
|
62
|
+
const entryPoint = await container.getEntryPoint();
|
|
63
|
+
// Note: We need to also check if the result of `getEntryPoint()` is defined. This is because when running
|
|
64
|
+
// cross version compat testing scenarios, if we create with 1.X container and load with 2.X then the
|
|
65
|
+
// function container.getEntryPoint will be defined for the 2.X container. However, it will not return undefined
|
|
66
|
+
// since the container's runtime will be on version 1.X, which does not have an entry point defined.
|
|
67
|
+
if (entryPoint !== undefined) {
|
|
68
|
+
return entryPoint as T;
|
|
69
|
+
}
|
|
60
70
|
}
|
|
61
71
|
const response: IResponse = await (container as any).request({ url: "/" });
|
|
62
72
|
assert(response.status === 200, "requesting '/' should return default data object");
|
|
63
73
|
return response.value as T;
|
|
64
74
|
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* This function should ONLY be used for back compat purposes
|
|
78
|
+
* Older supported versions of IDataStore do not have the "entryPoint" property, so we need to fallback to "request"
|
|
79
|
+
* This function can be removed once back-compat support for IDataStore moves to 2.0.0-internal.7.0.0
|
|
80
|
+
*
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
export async function getDataStoreEntryPointBackCompat<T>(dataStore: IDataStore): Promise<T> {
|
|
84
|
+
if (dataStore.entryPoint !== undefined) {
|
|
85
|
+
return dataStore.entryPoint.get() as Promise<T>;
|
|
86
|
+
}
|
|
87
|
+
const response: IResponse = await (dataStore as any).request({ url: "" });
|
|
88
|
+
assert(response.status === 200, "empty request should return data object");
|
|
89
|
+
return response.value as T;
|
|
90
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -24,10 +24,12 @@ export {
|
|
|
24
24
|
DataObjectFactoryType,
|
|
25
25
|
EventAndErrorTrackingLogger,
|
|
26
26
|
getUnexpectedLogErrorException,
|
|
27
|
+
IDocumentIdStrategy,
|
|
27
28
|
IOpProcessingController,
|
|
28
29
|
ITestContainerConfig,
|
|
29
30
|
ITestObjectProvider,
|
|
30
31
|
TestObjectProvider,
|
|
32
|
+
TestObjectProviderWithVersionedLoad,
|
|
31
33
|
} from "./testObjectProvider";
|
|
32
34
|
export { createSummarizer, createSummarizerFromFactory, summarizeNow } from "./TestSummaryUtils";
|
|
33
35
|
export {
|
|
@@ -37,5 +39,9 @@ export {
|
|
|
37
39
|
TimeoutWithError,
|
|
38
40
|
TimeoutWithValue,
|
|
39
41
|
} from "./timeoutUtils";
|
|
40
|
-
export {
|
|
42
|
+
export {
|
|
43
|
+
waitForContainerConnection,
|
|
44
|
+
getContainerEntryPointBackCompat,
|
|
45
|
+
getDataStoreEntryPointBackCompat,
|
|
46
|
+
} from "./containerUtils";
|
|
41
47
|
export { createContainerRuntimeFactoryWithDefaultDataStore } from "./testContainerRuntimeFactoryWithDefaultDataStore";
|
package/src/interfaces.ts
CHANGED
|
@@ -11,10 +11,16 @@ import {
|
|
|
11
11
|
} from "@fluidframework/runtime-definitions";
|
|
12
12
|
import { IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
14
17
|
export interface IProvideTestFluidObject {
|
|
15
18
|
readonly ITestFluidObject: ITestFluidObject;
|
|
16
19
|
}
|
|
17
20
|
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
18
24
|
export interface ITestFluidObject extends IProvideTestFluidObject, IFluidLoadable {
|
|
19
25
|
root: ISharedMap;
|
|
20
26
|
readonly runtime: IFluidDataStoreRuntime;
|
|
@@ -41,6 +41,9 @@ interface ContainerRecord {
|
|
|
41
41
|
lastProposal: number;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
44
47
|
export class LoaderContainerTracker implements IOpProcessingController {
|
|
45
48
|
private readonly containers = new Map<IContainer, ContainerRecord>();
|
|
46
49
|
private lastProposalSeqNum: number = 0;
|
package/src/localCodeLoader.ts
CHANGED
|
@@ -22,6 +22,9 @@ import {
|
|
|
22
22
|
import { createDataStoreFactory } from "@fluidframework/runtime-utils";
|
|
23
23
|
import { IContainerRuntimeOptions } from "@fluidframework/container-runtime";
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
25
28
|
export type SupportedExportInterfaces = Partial<
|
|
26
29
|
IProvideRuntimeFactory &
|
|
27
30
|
IProvideFluidDataStoreFactory &
|
|
@@ -30,11 +33,15 @@ export type SupportedExportInterfaces = Partial<
|
|
|
30
33
|
>;
|
|
31
34
|
|
|
32
35
|
// Represents the entry point for a Fluid container.
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
33
39
|
export type fluidEntryPoint = SupportedExportInterfaces | IFluidModule;
|
|
34
40
|
|
|
35
41
|
/**
|
|
36
42
|
* A simple code loader that caches a mapping of package name to a Fluid entry point.
|
|
37
43
|
* On load, it retrieves the entry point matching the package name in the given code details.
|
|
44
|
+
* @internal
|
|
38
45
|
*/
|
|
39
46
|
export class LocalCodeLoader implements ICodeDetailsLoader {
|
|
40
47
|
private readonly fluidPackageCache = new Map<string, IFluidModuleWithDetails>();
|
package/src/localLoader.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { fluidEntryPoint, LocalCodeLoader } from "./localCodeLoader";
|
|
|
21
21
|
* @param documentServiceFactory - the driver factory to use
|
|
22
22
|
* @param urlResolver - the url resolver to use
|
|
23
23
|
* @param options - loader options
|
|
24
|
+
* @internal
|
|
24
25
|
*/
|
|
25
26
|
export function createLoader(
|
|
26
27
|
packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,
|
|
@@ -45,6 +46,7 @@ export function createLoader(
|
|
|
45
46
|
* @param source - The code details used to create the Container.
|
|
46
47
|
* @param loader - The loader to use to initialize the container.
|
|
47
48
|
* @param attachRequest - The request to create new from.
|
|
49
|
+
* @internal
|
|
48
50
|
*/
|
|
49
51
|
|
|
50
52
|
export async function createAndAttachContainer(
|
package/src/packageVersion.ts
CHANGED
package/src/retry.ts
CHANGED
|
@@ -33,6 +33,7 @@ const retry = async <T>(
|
|
|
33
33
|
* @param maxTries - maximum number of attempts
|
|
34
34
|
* @param backOffMs - back off between attempts in milliseconds
|
|
35
35
|
* @returns the actual value from the callback when successful or the default value otherwise
|
|
36
|
+
* @internal
|
|
36
37
|
*/
|
|
37
38
|
export const retryWithEventualValue = async <T>(
|
|
38
39
|
callback: () => Promise<T>,
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
// eslint-disable-next-line import/no-deprecated
|
|
7
6
|
import { defaultRouteRequestHandler } from "@fluidframework/aqueduct";
|
|
8
7
|
import { IContainerContext, IRuntime } from "@fluidframework/container-definitions";
|
|
9
8
|
import {
|
|
@@ -12,13 +11,13 @@ import {
|
|
|
12
11
|
DefaultSummaryConfiguration,
|
|
13
12
|
} from "@fluidframework/container-runtime";
|
|
14
13
|
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
15
|
-
// eslint-disable-next-line import/no-deprecated
|
|
16
14
|
import { buildRuntimeRequestHandler, RuntimeRequestHandler } from "@fluidframework/request-handler";
|
|
17
15
|
import { IFluidDataStoreFactory } from "@fluidframework/runtime-definitions";
|
|
18
16
|
import { RuntimeFactoryHelper } from "@fluidframework/runtime-utils";
|
|
19
17
|
|
|
20
18
|
/**
|
|
21
19
|
* Create a container runtime factory class that allows you to set runtime options
|
|
20
|
+
* @internal
|
|
22
21
|
*/
|
|
23
22
|
export const createTestContainerRuntimeFactory = (
|
|
24
23
|
containerRuntimeCtor: typeof ContainerRuntime,
|
|
@@ -54,13 +53,34 @@ export const createTestContainerRuntimeFactory = (
|
|
|
54
53
|
public async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {
|
|
55
54
|
// Validate we can load root data stores.
|
|
56
55
|
// We should be able to load any data store that was created in initializeFirstTime!
|
|
57
|
-
|
|
56
|
+
// Note: We use the deprecated `getRootDataStore` from v1.X here to allow for cross-major version compat
|
|
57
|
+
// testing. Can be removed when we no longer support v1.X.
|
|
58
|
+
await (runtime.getAliasedDataStoreEntryPoint?.("default") ??
|
|
59
|
+
runtime.getRootDataStore("default"));
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
async preInitialize(
|
|
61
63
|
context: IContainerContext,
|
|
62
64
|
existing: boolean,
|
|
63
65
|
): Promise<IRuntime & IContainerRuntime> {
|
|
66
|
+
if (containerRuntimeCtor.loadRuntime === undefined) {
|
|
67
|
+
// Note: We use the deprecated `load` from v1.X here to allow for cross-major version compat testing.
|
|
68
|
+
// Can be removed when we no longer support v1.X.
|
|
69
|
+
return containerRuntimeCtor.load(
|
|
70
|
+
context,
|
|
71
|
+
[
|
|
72
|
+
["default", Promise.resolve(this.dataStoreFactory)],
|
|
73
|
+
[this.type, Promise.resolve(this.dataStoreFactory)],
|
|
74
|
+
],
|
|
75
|
+
buildRuntimeRequestHandler(
|
|
76
|
+
defaultRouteRequestHandler("default"),
|
|
77
|
+
...this.requestHandlers,
|
|
78
|
+
),
|
|
79
|
+
this.runtimeOptions,
|
|
80
|
+
context.scope,
|
|
81
|
+
existing,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
64
84
|
const provideEntryPoint = async (runtime: IContainerRuntime) => {
|
|
65
85
|
const entryPoint = await runtime.getAliasedDataStoreEntryPoint("default");
|
|
66
86
|
if (entryPoint === undefined) {
|
|
@@ -74,9 +94,7 @@ export const createTestContainerRuntimeFactory = (
|
|
|
74
94
|
["default", Promise.resolve(this.dataStoreFactory)],
|
|
75
95
|
[this.type, Promise.resolve(this.dataStoreFactory)],
|
|
76
96
|
],
|
|
77
|
-
// eslint-disable-next-line import/no-deprecated
|
|
78
97
|
requestHandler: buildRuntimeRequestHandler(
|
|
79
|
-
// eslint-disable-next-line import/no-deprecated
|
|
80
98
|
defaultRouteRequestHandler("default"),
|
|
81
99
|
...this.requestHandlers,
|
|
82
100
|
),
|
|
@@ -93,5 +111,6 @@ export const createTestContainerRuntimeFactory = (
|
|
|
93
111
|
|
|
94
112
|
/**
|
|
95
113
|
* A container runtime factory that allows you to set runtime options
|
|
114
|
+
* @internal
|
|
96
115
|
*/
|
|
97
116
|
export const TestContainerRuntimeFactory = createTestContainerRuntimeFactory(ContainerRuntime);
|
|
@@ -23,6 +23,7 @@ const getDefaultFluidObject = async (runtime: IContainerRuntime) => {
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* ! Note: This function is purely needed for back-compat as the constructor argument structure was changed
|
|
26
|
+
* @internal
|
|
26
27
|
*/
|
|
27
28
|
export const createContainerRuntimeFactoryWithDefaultDataStore = (
|
|
28
29
|
Base: typeof ContainerRuntimeFactoryWithDefaultDataStore = ContainerRuntimeFactoryWithDefaultDataStore,
|
package/src/testFluidObject.ts
CHANGED
|
@@ -25,6 +25,7 @@ import { ITestFluidObject } from "./interfaces";
|
|
|
25
25
|
* A test Fluid object that will create a shared object for each key-value pair in the factoryEntries passed to load.
|
|
26
26
|
* The shared objects can be retrieved by passing the key of the entry to getSharedObject.
|
|
27
27
|
* It exposes the IFluidDataStoreContext and IFluidDataStoreRuntime.
|
|
28
|
+
* @internal
|
|
28
29
|
*/
|
|
29
30
|
export class TestFluidObject implements ITestFluidObject {
|
|
30
31
|
public get ITestFluidObject() {
|
|
@@ -122,6 +123,9 @@ export class TestFluidObject implements ITestFluidObject {
|
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
|
|
126
|
+
/**
|
|
127
|
+
* @internal
|
|
128
|
+
*/
|
|
125
129
|
export type ChannelFactoryRegistry = Iterable<[string | undefined, IChannelFactory]>;
|
|
126
130
|
|
|
127
131
|
/**
|
|
@@ -153,6 +157,7 @@ export type ChannelFactoryRegistry = Iterable<[string | undefined, IChannelFacto
|
|
|
153
157
|
* `describeCompat` aims to provide:
|
|
154
158
|
* `SharedMap`s always reference the current version of SharedMap.
|
|
155
159
|
* AB#4670 tracks improving this situation.
|
|
160
|
+
* @internal
|
|
156
161
|
*/
|
|
157
162
|
export class TestFluidObjectFactory implements IFluidDataStoreFactory {
|
|
158
163
|
public get IFluidDataStoreFactory() {
|