@fluidframework/test-utils 2.101.1 → 2.103.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 +8 -0
- package/dist/containerUtils.d.ts +13 -0
- package/dist/containerUtils.d.ts.map +1 -1
- package/dist/containerUtils.js +18 -1
- package/dist/containerUtils.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/containerUtils.d.ts +13 -0
- package/lib/containerUtils.d.ts.map +1 -1
- package/lib/containerUtils.js +16 -0
- package/lib/containerUtils.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- 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/package.json +24 -31
- package/src/containerUtils.ts +20 -0
- package/src/index.ts +1 -0
- package/src/packageVersion.ts +1 -1
package/CHANGELOG.md
CHANGED
package/dist/containerUtils.d.ts
CHANGED
|
@@ -45,6 +45,19 @@ export declare function getContainerEntryPointBackCompat<T>(container: IContaine
|
|
|
45
45
|
* @internal
|
|
46
46
|
*/
|
|
47
47
|
export declare function getDataStoreEntryPointBackCompat<T>(dataStore: IDataStore): Promise<T>;
|
|
48
|
+
/**
|
|
49
|
+
* Calls `container.getPendingLocalState()` and asserts the method is implemented.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* `getPendingLocalState` is currently optional on `IContainer` for forward-compat with external
|
|
53
|
+
* implementers; the first-party `Container` always implements it. This helper centralises the
|
|
54
|
+
* existence check so test code does not duplicate `assert(... !== undefined, ...)` at every
|
|
55
|
+
* callsite. Once `getPendingLocalState` becomes required on `IContainer` this helper can be
|
|
56
|
+
* removed in favour of a direct call.
|
|
57
|
+
*
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
export declare function getRequiredPendingLocalState(container: IContainer): Promise<string>;
|
|
48
61
|
/**
|
|
49
62
|
* Casts a delta manager to its full interface type with inbound/outbound queues.
|
|
50
63
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerUtils.d.ts","sourceRoot":"","sources":["../src/containerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,aAAa,EACb,KAAK,iBAAiB,EACtB,MAAM,gDAAgD,CAAC;AAIxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,KAAK,EACX,gBAAgB,EAChB,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAmB,gBAAgB,EAAkB,MAAM,mBAAmB,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,0BAA0B,CAC/C,SAAS,EAAE,UAAU,EACrB,oBAAoB,GAAE,OAAc,EACpC,cAAc,CAAC,EAAE,gBAAgB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;;;GAKG;AACH,wBAAsB,gCAAgC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAc3F;AAED;;;;;;GAMG;AACH,wBAAsB,gCAAgC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAO3F;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,YAAY,EACT,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,GAC1D,mBAAmB,GACpB,iBAAiB,CAQnB"}
|
|
1
|
+
{"version":3,"file":"containerUtils.d.ts","sourceRoot":"","sources":["../src/containerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,aAAa,EACb,KAAK,iBAAiB,EACtB,MAAM,gDAAgD,CAAC;AAIxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,KAAK,EACX,gBAAgB,EAChB,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAmB,gBAAgB,EAAkB,MAAM,mBAAmB,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,0BAA0B,CAC/C,SAAS,EAAE,UAAU,EACrB,oBAAoB,GAAE,OAAc,EACpC,cAAc,CAAC,EAAE,gBAAgB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;;;GAKG;AACH,wBAAsB,gCAAgC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAc3F;AAED;;;;;;GAMG;AACH,wBAAsB,gCAAgC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAO3F;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,4BAA4B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAMzF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,YAAY,EACT,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,GAC1D,mBAAmB,GACpB,iBAAiB,CAQnB"}
|
package/dist/containerUtils.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.toIDeltaManagerFull = exports.getDataStoreEntryPointBackCompat = exports.getContainerEntryPointBackCompat = exports.waitForContainerConnection = void 0;
|
|
7
|
+
exports.toIDeltaManagerFull = exports.getRequiredPendingLocalState = exports.getDataStoreEntryPointBackCompat = exports.getContainerEntryPointBackCompat = exports.waitForContainerConnection = void 0;
|
|
8
8
|
const container_loader_1 = require("@fluidframework/container-loader");
|
|
9
9
|
const internal_1 = require("@fluidframework/core-utils/internal");
|
|
10
10
|
const timeoutUtils_js_1 = require("./timeoutUtils.js");
|
|
@@ -82,6 +82,23 @@ async function getDataStoreEntryPointBackCompat(dataStore) {
|
|
|
82
82
|
return response.value;
|
|
83
83
|
}
|
|
84
84
|
exports.getDataStoreEntryPointBackCompat = getDataStoreEntryPointBackCompat;
|
|
85
|
+
/**
|
|
86
|
+
* Calls `container.getPendingLocalState()` and asserts the method is implemented.
|
|
87
|
+
*
|
|
88
|
+
* @remarks
|
|
89
|
+
* `getPendingLocalState` is currently optional on `IContainer` for forward-compat with external
|
|
90
|
+
* implementers; the first-party `Container` always implements it. This helper centralises the
|
|
91
|
+
* existence check so test code does not duplicate `assert(... !== undefined, ...)` at every
|
|
92
|
+
* callsite. Once `getPendingLocalState` becomes required on `IContainer` this helper can be
|
|
93
|
+
* removed in favour of a direct call.
|
|
94
|
+
*
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
async function getRequiredPendingLocalState(container) {
|
|
98
|
+
(0, internal_1.assert)(container.getPendingLocalState !== undefined, "IContainer.getPendingLocalState is not implemented by this container");
|
|
99
|
+
return container.getPendingLocalState();
|
|
100
|
+
}
|
|
101
|
+
exports.getRequiredPendingLocalState = getRequiredPendingLocalState;
|
|
85
102
|
/**
|
|
86
103
|
* Casts a delta manager to its full interface type with inbound/outbound queues.
|
|
87
104
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerUtils.js","sourceRoot":"","sources":["../src/containerUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,uEAAmE;AAEnE,kEAA6D;AAQ7D,uDAAsF;AAEtF;;;;;;;;;;;;;;;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AAED;;;;;;GAMG;AACI,KAAK,UAAU,gCAAgC,CAAI,SAAqB;IAC9E,IAAI,SAAS,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC,UAAU,CAAC,GAAG,EAAgB,CAAC;IACjD,CAAC;IACD,MAAM,QAAQ,GAAc,MAAO,SAAiB,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1E,IAAA,iBAAM,EAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,yCAAyC,CAAC,CAAC;IAC3E,OAAO,QAAQ,CAAC,KAAU,CAAC;AAC5B,CAAC;AAPD,4EAOC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAClC,YAEsB;IAEtB,IAAA,iBAAM,EACL,SAAS,IAAI,YAAY,IAAI,UAAU,IAAI,YAAY,EACvD,sDAAsD,CACtD,CAAC;IACF,OAAO,YAE2E,CAAC;AACpF,CAAC;AAZD,kDAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIContainer,\n\tIDeltaManager,\n\ttype IDeltaManagerFull,\n} from \"@fluidframework/container-definitions/internal\";\nimport { ConnectionState } from \"@fluidframework/container-loader\";\nimport { IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IDeltaManagerErased } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { IDataStore } from \"@fluidframework/runtime-definitions/internal\";\n\nimport { PromiseExecutor, TimeoutWithError, timeoutPromise } from \"./timeoutUtils.js\";\n\n/**\n * Utility function to wait for the specified Container to be in Connected state.\n * If the Container is already connected, the Promise returns immediately; otherwise it resolves when the Container emits\n * its 'connected' event.\n * If failOnContainerClose === true, the returned Promise will be rejected if the container emits a 'closed' event\n * before a 'connected' event.\n * @param container - The container to wait for.\n * @param failOnContainerClose - If true, the returned Promise will be rejected if the container emits a 'closed' event\n * before a 'connected' event.\n * Defaults to true.\n * @param timeoutOptions - Options related to the behavior of the timeout.\n * If provided, the returned Promise will reject if the container hasn't emitted relevant events in timeoutOptions.durationMs.\n * If not provided, the Promise will wait indefinitely for the Container to emit its 'connected' (or 'closed', if\n * failOnContainerClose === true) event.\n *\n * @returns A Promise that either:\n * - Resolves when the specified container emits a 'connected' event (or immediately if the Container is already connected).\n * - Rejects if failOnContainerClose === true and the container emits a 'closed' event before a 'connected' event.\n * - Rejects after timeoutOptions.durationMs if timeoutOptions !== undefined and the container does not emit relevant\n * events, within that timeframe.\n * @internal\n */\nexport async function waitForContainerConnection(\n\tcontainer: IContainer,\n\tfailOnContainerClose: boolean = true,\n\ttimeoutOptions?: TimeoutWithError,\n): Promise<void> {\n\tif (container.connectionState !== ConnectionState.Connected) {\n\t\tconst executor: PromiseExecutor = (resolve, reject) => {\n\t\t\tcontainer.once(\"connected\", () => resolve());\n\t\t\tif (failOnContainerClose) {\n\t\t\t\tcontainer.once(\"closed\", (error) => reject(error));\n\t\t\t}\n\t\t};\n\n\t\treturn timeoutOptions === undefined\n\t\t\t? new Promise(executor)\n\t\t\t: timeoutPromise(executor, timeoutOptions);\n\t}\n}\n\n/**\n * This function should ONLY be used for back compat purposes\n * LTS versions of the Loader/Container will not have the \"getEntryPoint\" method, so we need to fallback to \"request\"\n * This function can be removed once LTS version of Loader moves to 2.0.0-internal.7.0.0\n * @internal\n */\nexport async function getContainerEntryPointBackCompat<T>(container: IContainer): Promise<T> {\n\tif (container.getEntryPoint !== undefined) {\n\t\tconst entryPoint = await container.getEntryPoint();\n\t\t// Note: We need to also check if the result of `getEntryPoint()` is defined. This is because when running\n\t\t// cross-client compat testing scenarios, if we create with 1.X container and load with 2.X then the\n\t\t// function container.getEntryPoint will be defined for the 2.X container. However, it will not return undefined\n\t\t// since the container's runtime will be on version 1.X, which does not have an entry point defined.\n\t\tif (entryPoint !== undefined) {\n\t\t\treturn entryPoint as T;\n\t\t}\n\t}\n\tconst response: IResponse = await (container as any).request({ url: \"/\" });\n\tassert(response.status === 200, \"requesting '/' should return default data object\");\n\treturn response.value as T;\n}\n\n/**\n * This function should ONLY be used for back compat purposes\n * Older supported versions of IDataStore do not have the \"entryPoint\" property, so we need to fallback to \"request\"\n * This function can be removed once back-compat support for IDataStore moves to 2.0.0-internal.7.0.0\n *\n * @internal\n */\nexport async function getDataStoreEntryPointBackCompat<T>(dataStore: IDataStore): Promise<T> {\n\tif (dataStore.entryPoint !== undefined) {\n\t\treturn dataStore.entryPoint.get() as Promise<T>;\n\t}\n\tconst response: IResponse = await (dataStore as any).request({ url: \"\" });\n\tassert(response.status === 200, \"empty request should return data object\");\n\treturn response.value as T;\n}\n\n/**\n * Casts a delta manager to its full interface type with inbound/outbound queues.\n *\n * @internal\n */\nexport function toIDeltaManagerFull(\n\tdeltaManager:\n\t\t| IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n\t\t| IDeltaManagerErased,\n): IDeltaManagerFull {\n\tassert(\n\t\t\"inbound\" in deltaManager && \"outbound\" in deltaManager,\n\t\t\"Delta manager does not have inbound/outbound queues.\",\n\t);\n\treturn deltaManager as unknown as\n\t\t| IDeltaManagerErased\n\t\t| IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> as IDeltaManagerFull;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"containerUtils.js","sourceRoot":"","sources":["../src/containerUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,uEAAmE;AAEnE,kEAA6D;AAQ7D,uDAAsF;AAEtF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACI,KAAK,UAAU,0BAA0B,CAC/C,SAAqB,EACrB,uBAAgC,IAAI,EACpC,cAAiC;IAEjC,IAAI,SAAS,CAAC,eAAe,KAAK,kCAAe,CAAC,SAAS,EAAE,CAAC;QAC7D,MAAM,QAAQ,GAAoB,CAAC,OAAO,E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AAc,MAAO,SAAiB,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1E,IAAA,iBAAM,EAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,yCAAyC,CAAC,CAAC;IAC3E,OAAO,QAAQ,CAAC,KAAU,CAAC;AAC5B,CAAC;AAPD,4EAOC;AAED;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,4BAA4B,CAAC,SAAqB;IACvE,IAAA,iBAAM,EACL,SAAS,CAAC,oBAAoB,KAAK,SAAS,EAC5C,sEAAsE,CACtE,CAAC;IACF,OAAO,SAAS,CAAC,oBAAoB,EAAE,CAAC;AACzC,CAAC;AAND,oEAMC;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAClC,YAEsB;IAEtB,IAAA,iBAAM,EACL,SAAS,IAAI,YAAY,IAAI,UAAU,IAAI,YAAY,EACvD,sDAAsD,CACtD,CAAC;IACF,OAAO,YAE2E,CAAC;AACpF,CAAC;AAZD,kDAYC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIContainer,\n\tIDeltaManager,\n\ttype IDeltaManagerFull,\n} from \"@fluidframework/container-definitions/internal\";\nimport { ConnectionState } from \"@fluidframework/container-loader\";\nimport { IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IDeltaManagerErased } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { IDataStore } from \"@fluidframework/runtime-definitions/internal\";\n\nimport { PromiseExecutor, TimeoutWithError, timeoutPromise } from \"./timeoutUtils.js\";\n\n/**\n * Utility function to wait for the specified Container to be in Connected state.\n * If the Container is already connected, the Promise returns immediately; otherwise it resolves when the Container emits\n * its 'connected' event.\n * If failOnContainerClose === true, the returned Promise will be rejected if the container emits a 'closed' event\n * before a 'connected' event.\n * @param container - The container to wait for.\n * @param failOnContainerClose - If true, the returned Promise will be rejected if the container emits a 'closed' event\n * before a 'connected' event.\n * Defaults to true.\n * @param timeoutOptions - Options related to the behavior of the timeout.\n * If provided, the returned Promise will reject if the container hasn't emitted relevant events in timeoutOptions.durationMs.\n * If not provided, the Promise will wait indefinitely for the Container to emit its 'connected' (or 'closed', if\n * failOnContainerClose === true) event.\n *\n * @returns A Promise that either:\n * - Resolves when the specified container emits a 'connected' event (or immediately if the Container is already connected).\n * - Rejects if failOnContainerClose === true and the container emits a 'closed' event before a 'connected' event.\n * - Rejects after timeoutOptions.durationMs if timeoutOptions !== undefined and the container does not emit relevant\n * events, within that timeframe.\n * @internal\n */\nexport async function waitForContainerConnection(\n\tcontainer: IContainer,\n\tfailOnContainerClose: boolean = true,\n\ttimeoutOptions?: TimeoutWithError,\n): Promise<void> {\n\tif (container.connectionState !== ConnectionState.Connected) {\n\t\tconst executor: PromiseExecutor = (resolve, reject) => {\n\t\t\tcontainer.once(\"connected\", () => resolve());\n\t\t\tif (failOnContainerClose) {\n\t\t\t\tcontainer.once(\"closed\", (error) => reject(error));\n\t\t\t}\n\t\t};\n\n\t\treturn timeoutOptions === undefined\n\t\t\t? new Promise(executor)\n\t\t\t: timeoutPromise(executor, timeoutOptions);\n\t}\n}\n\n/**\n * This function should ONLY be used for back compat purposes\n * LTS versions of the Loader/Container will not have the \"getEntryPoint\" method, so we need to fallback to \"request\"\n * This function can be removed once LTS version of Loader moves to 2.0.0-internal.7.0.0\n * @internal\n */\nexport async function getContainerEntryPointBackCompat<T>(container: IContainer): Promise<T> {\n\tif (container.getEntryPoint !== undefined) {\n\t\tconst entryPoint = await container.getEntryPoint();\n\t\t// Note: We need to also check if the result of `getEntryPoint()` is defined. This is because when running\n\t\t// cross-client compat testing scenarios, if we create with 1.X container and load with 2.X then the\n\t\t// function container.getEntryPoint will be defined for the 2.X container. However, it will not return undefined\n\t\t// since the container's runtime will be on version 1.X, which does not have an entry point defined.\n\t\tif (entryPoint !== undefined) {\n\t\t\treturn entryPoint as T;\n\t\t}\n\t}\n\tconst response: IResponse = await (container as any).request({ url: \"/\" });\n\tassert(response.status === 200, \"requesting '/' should return default data object\");\n\treturn response.value as T;\n}\n\n/**\n * This function should ONLY be used for back compat purposes\n * Older supported versions of IDataStore do not have the \"entryPoint\" property, so we need to fallback to \"request\"\n * This function can be removed once back-compat support for IDataStore moves to 2.0.0-internal.7.0.0\n *\n * @internal\n */\nexport async function getDataStoreEntryPointBackCompat<T>(dataStore: IDataStore): Promise<T> {\n\tif (dataStore.entryPoint !== undefined) {\n\t\treturn dataStore.entryPoint.get() as Promise<T>;\n\t}\n\tconst response: IResponse = await (dataStore as any).request({ url: \"\" });\n\tassert(response.status === 200, \"empty request should return data object\");\n\treturn response.value as T;\n}\n\n/**\n * Calls `container.getPendingLocalState()` and asserts the method is implemented.\n *\n * @remarks\n * `getPendingLocalState` is currently optional on `IContainer` for forward-compat with external\n * implementers; the first-party `Container` always implements it. This helper centralises the\n * existence check so test code does not duplicate `assert(... !== undefined, ...)` at every\n * callsite. Once `getPendingLocalState` becomes required on `IContainer` this helper can be\n * removed in favour of a direct call.\n *\n * @internal\n */\nexport async function getRequiredPendingLocalState(container: IContainer): Promise<string> {\n\tassert(\n\t\tcontainer.getPendingLocalState !== undefined,\n\t\t\"IContainer.getPendingLocalState is not implemented by this container\",\n\t);\n\treturn container.getPendingLocalState();\n}\n\n/**\n * Casts a delta manager to its full interface type with inbound/outbound queues.\n *\n * @internal\n */\nexport function toIDeltaManagerFull(\n\tdeltaManager:\n\t\t| IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n\t\t| IDeltaManagerErased,\n): IDeltaManagerFull {\n\tassert(\n\t\t\"inbound\" in deltaManager && \"outbound\" in deltaManager,\n\t\t\"Delta manager does not have inbound/outbound queues.\",\n\t);\n\treturn deltaManager as unknown as\n\t\t| IDeltaManagerErased\n\t\t| IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> as IDeltaManagerFull;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export { createDocumentId, DataObjectFactoryType, TestObjectProvider, TestObject
|
|
|
17
17
|
export type { SummaryInfo } from "./TestSummaryUtils.js";
|
|
18
18
|
export { createSummarizer, createSummarizerCore, createSummarizerFromFactory, summarizeNow, } from "./TestSummaryUtils.js";
|
|
19
19
|
export { timeoutAwait, timeoutPromise, type TimeoutDurationOption, type TimeoutWithError, type TimeoutWithValue, } from "./timeoutUtils.js";
|
|
20
|
-
export { toIDeltaManagerFull, waitForContainerConnection, getContainerEntryPointBackCompat, getDataStoreEntryPointBackCompat, } from "./containerUtils.js";
|
|
20
|
+
export { toIDeltaManagerFull, waitForContainerConnection, getContainerEntryPointBackCompat, getDataStoreEntryPointBackCompat, getRequiredPendingLocalState, } from "./containerUtils.js";
|
|
21
21
|
export { type ContainerRuntimeFactoryWithDefaultDataStoreConstructor, type ContainerRuntimeFactoryWithDefaultDataStoreProps, createContainerRuntimeFactoryWithDefaultDataStore, } from "./testContainerRuntimeFactoryWithDefaultDataStore.js";
|
|
22
22
|
export { TestFluidObjectInternal } from "./testFluidObjectInternal.js";
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EACN,2BAA2B,EAC3B,8BAA8B,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EACN,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,OAAO,EACP,sBAAsB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,wBAAwB,EAC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index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.TestFluidObjectInternal = exports.createContainerRuntimeFactoryWithDefaultDataStore = exports.getDataStoreEntryPointBackCompat = exports.getContainerEntryPointBackCompat = exports.waitForContainerConnection = exports.toIDeltaManagerFull = exports.timeoutPromise = exports.timeoutAwait = exports.summarizeNow = exports.createSummarizerFromFactory = exports.createSummarizerCore = exports.createSummarizer = exports.TestObjectProviderWithVersionedLoad = exports.TestObjectProvider = exports.DataObjectFactoryType = exports.createDocumentId = exports.LoaderContainerTracker = exports.TestFluidObjectFactory = exports.TestFluidObject = exports.TestContainerRuntimeFactory = exports.createTestContainerRuntimeFactory = exports.createTestConfigProvider = exports.retryWithEventualValue = exports.createAndAttachContainerUsingProps = exports.createLoaderProps = exports.createLoader = exports.createAndAttachContainer = exports.createDataStoreFactory = exports.LocalCodeLoader = exports.getUnexpectedLogErrorException = exports.EventAndErrorTrackingLogger = void 0;
|
|
7
|
+
exports.TestFluidObjectInternal = exports.createContainerRuntimeFactoryWithDefaultDataStore = exports.getRequiredPendingLocalState = exports.getDataStoreEntryPointBackCompat = exports.getContainerEntryPointBackCompat = exports.waitForContainerConnection = exports.toIDeltaManagerFull = exports.timeoutPromise = exports.timeoutAwait = exports.summarizeNow = exports.createSummarizerFromFactory = exports.createSummarizerCore = exports.createSummarizer = exports.TestObjectProviderWithVersionedLoad = exports.TestObjectProvider = exports.DataObjectFactoryType = exports.createDocumentId = exports.LoaderContainerTracker = exports.TestFluidObjectFactory = exports.TestFluidObject = exports.TestContainerRuntimeFactory = exports.createTestContainerRuntimeFactory = exports.createTestConfigProvider = exports.retryWithEventualValue = exports.createAndAttachContainerUsingProps = exports.createLoaderProps = exports.createLoader = exports.createAndAttachContainer = exports.createDataStoreFactory = exports.LocalCodeLoader = exports.getUnexpectedLogErrorException = exports.EventAndErrorTrackingLogger = void 0;
|
|
8
8
|
var eventAndErrorLogger_js_1 = require("./eventAndErrorLogger.js");
|
|
9
9
|
Object.defineProperty(exports, "EventAndErrorTrackingLogger", { enumerable: true, get: function () { return eventAndErrorLogger_js_1.EventAndErrorTrackingLogger; } });
|
|
10
10
|
Object.defineProperty(exports, "getUnexpectedLogErrorException", { enumerable: true, get: function () { return eventAndErrorLogger_js_1.getUnexpectedLogErrorException; } });
|
|
@@ -53,6 +53,7 @@ Object.defineProperty(exports, "toIDeltaManagerFull", { enumerable: true, get: f
|
|
|
53
53
|
Object.defineProperty(exports, "waitForContainerConnection", { enumerable: true, get: function () { return containerUtils_js_1.waitForContainerConnection; } });
|
|
54
54
|
Object.defineProperty(exports, "getContainerEntryPointBackCompat", { enumerable: true, get: function () { return containerUtils_js_1.getContainerEntryPointBackCompat; } });
|
|
55
55
|
Object.defineProperty(exports, "getDataStoreEntryPointBackCompat", { enumerable: true, get: function () { return containerUtils_js_1.getDataStoreEntryPointBackCompat; } });
|
|
56
|
+
Object.defineProperty(exports, "getRequiredPendingLocalState", { enumerable: true, get: function () { return containerUtils_js_1.getRequiredPendingLocalState; } });
|
|
56
57
|
// #endregion
|
|
57
58
|
var testContainerRuntimeFactoryWithDefaultDataStore_js_1 = require("./testContainerRuntimeFactoryWithDefaultDataStore.js");
|
|
58
59
|
Object.defineProperty(exports, "createContainerRuntimeFactoryWithDefaultDataStore", { enumerable: true, get: function () { return testContainerRuntimeFactoryWithDefaultDataStore_js_1.createContainerRuntimeFactoryWithDefaultDataStore; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,mEAGkC;AAFjC,qIAAA,2BAA2B,OAAA;AAC3B,wIAAA,8BAA8B,OAAA;AAG/B,2DAM8B;AAJ7B,qHAAA,eAAe,OAAA;AAGf,4HAAA,sBAAsB,OAAA;AA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,mDAAiF;AAAxE,0HAAA,wBAAwB,OAAA;AACjC,mFAG0C;AAFzC,mJAAA,iCAAiC,OAAA;AACjC,6IAAA,2BAA2B,OAAA;AAE5B,2DAK8B;AAH7B,qHAAA,eAAe,OAAA;AACf,4HAAA,sBAAsB,OAAA;AAIvB,wCAAwC;AACxC,yEAAyE;AACzE,iFAAiF;AACjF,+DAA+D;AAC/D,wEAAwE;AACxE,4EAA4E;AAC5E,oDAAoD;AACpD,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAO/B,iEAKiC;AAJhC,yHAAA,gBAAgB,OAAA;AAChB,8HAAA,qBAAqB,OAAA;AACrB,2HAAA,kBAAkB,OAAA;AAClB,4IAAA,mCAAmC,OAAA;AAGpC,6DAK+B;AAJ9B,uHAAA,gBAAgB,OAAA;AAChB,2HAAA,oBAAoB,OAAA;AACpB,kIAAA,2BAA2B,OAAA;AAC3B,mHAAA,YAAY,OAAA;AAEb,qDAM2B;AAL1B,+GAAA,YAAY,OAAA;AACZ,iHAAA,cAAc,OAAA;AAKf,yDAM6B;AAL5B,wHAAA,mBAAmB,OAAA;AACnB,+HAAA,0BAA0B,OAAA;AAC1B,qIAAA,gCAAgC,OAAA;AAChC,qIAAA,gCAAgC,OAAA;AAChC,iIAAA,4BAA4B,OAAA;AAE7B,aAAa;AAEb,2HAI8D;AAD7D,uLAAA,iDAAiD,OAAA;AAGlD,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IEventAndErrorTrackingLogger } from \"./eventAndErrorLogger.js\";\nexport {\n\tEventAndErrorTrackingLogger,\n\tgetUnexpectedLogErrorException,\n} from \"./eventAndErrorLogger.js\";\nexport { IProvideTestFluidObject, ITestFluidObject } from \"./interfaces.js\";\nexport {\n\tfluidEntryPoint,\n\tLocalCodeLoader,\n\tSupportedExportInterfaces,\n\tFactory,\n\tcreateDataStoreFactory,\n} from \"./localCodeLoader.js\";\nexport {\n\tcreateAndAttachContainer,\n\tcreateLoader,\n\tcreateLoaderProps,\n\tcreateAndAttachContainerUsingProps,\n} from \"./localLoader.js\";\nexport { retryWithEventualValue } from \"./retry.js\";\nexport { createTestConfigProvider, ITestConfigProvider } from \"./TestConfigs.js\";\nexport {\n\tcreateTestContainerRuntimeFactory,\n\tTestContainerRuntimeFactory,\n} from \"./testContainerRuntimeFactory.js\";\nexport {\n\tChannelFactoryRegistry,\n\tTestFluidObject,\n\tTestFluidObjectFactory,\n\tTestDataObjectKind,\n} from \"./testFluidObject.js\";\n\n// #region Exports with load side-effect\n// The below runtime (not \"type\") exports transitively or directly import\n// timeoutUtils.ts, which always executes on import and may patch Mocha's timeout\n// handling. That patching only takes effect when consumers use\n// @fluid-internal/mocha-test-setup that sets globalThis.getMochaModule.\n// @fluid-internal/mocha-test-setup is pervasive in our tests and thus patch\n// is usually in effect (when this package is used).\nexport { LoaderContainerTracker } from \"./loaderContainerTracker.js\";\nexport type {\n\tIDocumentIdStrategy,\n\tIOpProcessingController,\n\tITestContainerConfig,\n\tITestObjectProvider,\n} from \"./testObjectProvider.js\";\nexport {\n\tcreateDocumentId,\n\tDataObjectFactoryType,\n\tTestObjectProvider,\n\tTestObjectProviderWithVersionedLoad,\n} from \"./testObjectProvider.js\";\nexport type { SummaryInfo } from \"./TestSummaryUtils.js\";\nexport {\n\tcreateSummarizer,\n\tcreateSummarizerCore,\n\tcreateSummarizerFromFactory,\n\tsummarizeNow,\n} from \"./TestSummaryUtils.js\";\nexport {\n\ttimeoutAwait,\n\ttimeoutPromise,\n\ttype TimeoutDurationOption,\n\ttype TimeoutWithError,\n\ttype TimeoutWithValue,\n} from \"./timeoutUtils.js\";\nexport {\n\ttoIDeltaManagerFull,\n\twaitForContainerConnection,\n\tgetContainerEntryPointBackCompat,\n\tgetDataStoreEntryPointBackCompat,\n\tgetRequiredPendingLocalState,\n} from \"./containerUtils.js\";\n// #endregion\n\nexport {\n\ttype ContainerRuntimeFactoryWithDefaultDataStoreConstructor,\n\ttype ContainerRuntimeFactoryWithDefaultDataStoreProps,\n\tcreateContainerRuntimeFactoryWithDefaultDataStore,\n} from \"./testContainerRuntimeFactoryWithDefaultDataStore.js\";\n\nexport { TestFluidObjectInternal } from \"./testFluidObjectInternal.js\";\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/test-utils";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.103.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/test-utils";
|
|
11
|
-
exports.pkgVersion = "2.
|
|
11
|
+
exports.pkgVersion = "2.103.0";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/test-utils\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/test-utils\";\nexport const pkgVersion = \"2.103.0\";\n"]}
|
package/lib/containerUtils.d.ts
CHANGED
|
@@ -45,6 +45,19 @@ export declare function getContainerEntryPointBackCompat<T>(container: IContaine
|
|
|
45
45
|
* @internal
|
|
46
46
|
*/
|
|
47
47
|
export declare function getDataStoreEntryPointBackCompat<T>(dataStore: IDataStore): Promise<T>;
|
|
48
|
+
/**
|
|
49
|
+
* Calls `container.getPendingLocalState()` and asserts the method is implemented.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* `getPendingLocalState` is currently optional on `IContainer` for forward-compat with external
|
|
53
|
+
* implementers; the first-party `Container` always implements it. This helper centralises the
|
|
54
|
+
* existence check so test code does not duplicate `assert(... !== undefined, ...)` at every
|
|
55
|
+
* callsite. Once `getPendingLocalState` becomes required on `IContainer` this helper can be
|
|
56
|
+
* removed in favour of a direct call.
|
|
57
|
+
*
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
export declare function getRequiredPendingLocalState(container: IContainer): Promise<string>;
|
|
48
61
|
/**
|
|
49
62
|
* Casts a delta manager to its full interface type with inbound/outbound queues.
|
|
50
63
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerUtils.d.ts","sourceRoot":"","sources":["../src/containerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,UAAU,EACV,aAAa,EACb,KAAK,iBAAiB,EACtB,MAAM,gDAAgD,CAAC;AAIxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,KAAK,EACX,gBAAg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C,EAAE,gBAAgB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;;;GAKG;AACH,wBAAsB,gCAAgC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAc3F;AAED;;;;;;GAMG;AACH,wBAAsB,gCAAgC,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAO3F;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,4BAA4B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAMzF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,YAAY,EACT,aAAa,CAAC,yBAAyB,EAAE,gBAAgB,CAAC,GAC1D,mBAAmB,GACpB,iBAAiB,CAQnB"}
|
package/lib/containerUtils.js
CHANGED
|
@@ -76,6 +76,22 @@ export async function getDataStoreEntryPointBackCompat(dataStore) {
|
|
|
76
76
|
assert(response.status === 200, "empty request should return data object");
|
|
77
77
|
return response.value;
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Calls `container.getPendingLocalState()` and asserts the method is implemented.
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* `getPendingLocalState` is currently optional on `IContainer` for forward-compat with external
|
|
84
|
+
* implementers; the first-party `Container` always implements it. This helper centralises the
|
|
85
|
+
* existence check so test code does not duplicate `assert(... !== undefined, ...)` at every
|
|
86
|
+
* callsite. Once `getPendingLocalState` becomes required on `IContainer` this helper can be
|
|
87
|
+
* removed in favour of a direct call.
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
export async function getRequiredPendingLocalState(container) {
|
|
92
|
+
assert(container.getPendingLocalState !== undefined, "IContainer.getPendingLocalState is not implemented by this container");
|
|
93
|
+
return container.getPendingLocalState();
|
|
94
|
+
}
|
|
79
95
|
/**
|
|
80
96
|
* Casts a delta manager to its full interface type with inbound/outb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AK,SAAS,EAAE,CAAC;YAC9B,OAAO,UAAe,CAAC;QACxB,CAAC;IACF,CAAC;IACD,MAAM,QAAQ,GAAc,MAAO,SAAiB,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3E,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,kDAAkD,CAAC,CAAC;IACpF,OAAO,QAAQ,CAAC,KAAU,CAAC;AAC5B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAAI,SAAqB;IAC9E,IAAI,SAAS,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC,UAAU,CAAC,GAAG,EAAgB,CAAC;IACjD,CAAC;IACD,MAAM,QAAQ,GAAc,MAAO,SAAiB,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,yCAAyC,CAAC,CAAC;IAC3E,OAAO,QAAQ,CAAC,KAAU,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAClC,YAEsB;IAEtB,MAAM,CACL,SAAS,IAAI,YAAY,IAAI,UAAU,IAAI,YAAY,EACvD,sDAAsD,CACtD,CAAC;IACF,OAAO,YAE2E,CAAC;AACpF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIContainer,\n\tIDeltaManager,\n\ttype IDeltaManagerFull,\n} from \"@fluidframework/container-definitions/internal\";\nimport { ConnectionState } from \"@fluidframework/container-loader\";\nimport { IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IDeltaManagerErased } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { IDataStore } from \"@fluidframework/runtime-definitions/internal\";\n\nimport { PromiseExecutor, TimeoutWithError, timeoutPromise } from \"./timeoutUtils.js\";\n\n/**\n * Utility function to wait for the specified Container to be in Connected state.\n * If the Container is already connected, the Promise returns immediately; otherwise it resolves when the Container emits\n * its 'connected' event.\n * If failOnContainerClose === true, the returned Promise will be rejected if the container emits a 'closed' event\n * before a 'connected' event.\n * @param container - The container to wait for.\n * @param failOnContainerClose - If true, the returned Promise will be rejected if the container emits a 'closed' event\n * before a 'connected' event.\n * Defaults to true.\n * @param timeoutOptions - Options related to the behavior of the timeout.\n * If provided, the returned Promise will reject if the container hasn't emitted relevant events in timeoutOptions.durationMs.\n * If not provided, the Promise will wait indefinitely for the Container to emit its 'connected' (or 'closed', if\n * failOnContainerClose === true) event.\n *\n * @returns A Promise that either:\n * - Resolves when the specified container emits a 'connected' event (or immediately if the Container is already connected).\n * - Rejects if failOnContainerClose === true and the container emits a 'closed' event before a 'connected' event.\n * - Rejects after timeoutOptions.durationMs if timeoutOptions !== undefined and the container does not emit relevant\n * events, within that timeframe.\n * @internal\n */\nexport async function waitForContainerConnection(\n\tcontainer: IContainer,\n\tfailOnContainerClose: boolean = true,\n\ttimeoutOptions?: TimeoutWithError,\n): Promise<void> {\n\tif (container.connectionState !== ConnectionState.Connected) {\n\t\tconst executor: PromiseExecutor = (resolve, reject) => {\n\t\t\tcontainer.once(\"connected\", () => resolve());\n\t\t\tif (failOnContainerClose) {\n\t\t\t\tcontainer.once(\"closed\", (error) => reject(error));\n\t\t\t}\n\t\t};\n\n\t\treturn timeoutOptions === undefined\n\t\t\t? new Promise(executor)\n\t\t\t: timeoutPromise(executor, timeoutOptions);\n\t}\n}\n\n/**\n * This function should ONLY be used for back compat purposes\n * LTS versions of the Loader/Container will not have the \"getEntryPoint\" method, so we need to fallback to \"request\"\n * This function can be removed once LTS version of Loader moves to 2.0.0-internal.7.0.0\n * @internal\n */\nexport async function getContainerEntryPointBackCompat<T>(container: IContainer): Promise<T> {\n\tif (container.getEntryPoint !== undefined) {\n\t\tconst entryPoint = await container.getEntryPoint();\n\t\t// Note: We need to also check if the result of `getEntryPoint()` is defined. This is because when running\n\t\t// cross-client compat testing scenarios, if we create with 1.X container and load with 2.X then the\n\t\t// function container.getEntryPoint will be defined for the 2.X container. However, it will not return undefined\n\t\t// since the container's runtime will be on version 1.X, which does not have an entry point defined.\n\t\tif (entryPoint !== undefined) {\n\t\t\treturn entryPoint as T;\n\t\t}\n\t}\n\tconst response: IResponse = await (container as any).request({ url: \"/\" });\n\tassert(response.status === 200, \"requesting '/' should return default data object\");\n\treturn response.value as T;\n}\n\n/**\n * This function should ONLY be used for back compat purposes\n * Older supported versions of IDataStore do not have the \"entryPoint\" property, so we need to fallback to \"request\"\n * This function can be removed once back-compat support for IDataStore moves to 2.0.0-internal.7.0.0\n *\n * @internal\n */\nexport async function getDataStoreEntryPointBackCompat<T>(dataStore: IDataStore): Promise<T> {\n\tif (dataStore.entryPoint !== undefined) {\n\t\treturn dataStore.entryPoint.get() as Promise<T>;\n\t}\n\tconst response: IResponse = await (dataStore as any).request({ url: \"\" });\n\tassert(response.status === 200, \"empty request should return data object\");\n\treturn response.value as T;\n}\n\n/**\n * Casts a delta manager to its full interface type with inbound/outbound queues.\n *\n * @internal\n */\nexport function toIDeltaManagerFull(\n\tdeltaManager:\n\t\t| IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n\t\t| IDeltaManagerErased,\n): IDeltaManagerFull {\n\tassert(\n\t\t\"inbound\" in deltaManager && \"outbound\" in deltaManager,\n\t\t\"Delta manager does not have inbound/outbound queues.\",\n\t);\n\treturn deltaManager as unknown as\n\t\t| IDeltaManagerErased\n\t\t| IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> as IDeltaManagerFull;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"containerUtils.js","sourceRoot":"","sources":["../src/containerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;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G,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3E,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,kDAAkD,CAAC,CAAC;IACpF,OAAO,QAAQ,CAAC,KAAU,CAAC;AAC5B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAAI,SAAqB;IAC9E,IAAI,SAAS,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC,UAAU,CAAC,GAAG,EAAgB,CAAC;IACjD,CAAC;IACD,MAAM,QAAQ,GAAc,MAAO,SAAiB,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,yCAAyC,CAAC,CAAC;IAC3E,OAAO,QAAQ,CAAC,KAAU,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,SAAqB;IACvE,MAAM,CACL,SAAS,CAAC,oBAAoB,KAAK,SAAS,EAC5C,sEAAsE,CACtE,CAAC;IACF,OAAO,SAAS,CAAC,oBAAoB,EAAE,CAAC;AACzC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAClC,YAEsB;IAEtB,MAAM,CACL,SAAS,IAAI,YAAY,IAAI,UAAU,IAAI,YAAY,EACvD,sDAAsD,CACtD,CAAC;IACF,OAAO,YAE2E,CAAC;AACpF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIContainer,\n\tIDeltaManager,\n\ttype IDeltaManagerFull,\n} from \"@fluidframework/container-definitions/internal\";\nimport { ConnectionState } from \"@fluidframework/container-loader\";\nimport { IResponse } from \"@fluidframework/core-interfaces\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport type { IDeltaManagerErased } from \"@fluidframework/datastore-definitions/internal\";\nimport type {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport { IDataStore } from \"@fluidframework/runtime-definitions/internal\";\n\nimport { PromiseExecutor, TimeoutWithError, timeoutPromise } from \"./timeoutUtils.js\";\n\n/**\n * Utility function to wait for the specified Container to be in Connected state.\n * If the Container is already connected, the Promise returns immediately; otherwise it resolves when the Container emits\n * its 'connected' event.\n * If failOnContainerClose === true, the returned Promise will be rejected if the container emits a 'closed' event\n * before a 'connected' event.\n * @param container - The container to wait for.\n * @param failOnContainerClose - If true, the returned Promise will be rejected if the container emits a 'closed' event\n * before a 'connected' event.\n * Defaults to true.\n * @param timeoutOptions - Options related to the behavior of the timeout.\n * If provided, the returned Promise will reject if the container hasn't emitted relevant events in timeoutOptions.durationMs.\n * If not provided, the Promise will wait indefinitely for the Container to emit its 'connected' (or 'closed', if\n * failOnContainerClose === true) event.\n *\n * @returns A Promise that either:\n * - Resolves when the specified container emits a 'connected' event (or immediately if the Container is already connected).\n * - Rejects if failOnContainerClose === true and the container emits a 'closed' event before a 'connected' event.\n * - Rejects after timeoutOptions.durationMs if timeoutOptions !== undefined and the container does not emit relevant\n * events, within that timeframe.\n * @internal\n */\nexport async function waitForContainerConnection(\n\tcontainer: IContainer,\n\tfailOnContainerClose: boolean = true,\n\ttimeoutOptions?: TimeoutWithError,\n): Promise<void> {\n\tif (container.connectionState !== ConnectionState.Connected) {\n\t\tconst executor: PromiseExecutor = (resolve, reject) => {\n\t\t\tcontainer.once(\"connected\", () => resolve());\n\t\t\tif (failOnContainerClose) {\n\t\t\t\tcontainer.once(\"closed\", (error) => reject(error));\n\t\t\t}\n\t\t};\n\n\t\treturn timeoutOptions === undefined\n\t\t\t? new Promise(executor)\n\t\t\t: timeoutPromise(executor, timeoutOptions);\n\t}\n}\n\n/**\n * This function should ONLY be used for back compat purposes\n * LTS versions of the Loader/Container will not have the \"getEntryPoint\" method, so we need to fallback to \"request\"\n * This function can be removed once LTS version of Loader moves to 2.0.0-internal.7.0.0\n * @internal\n */\nexport async function getContainerEntryPointBackCompat<T>(container: IContainer): Promise<T> {\n\tif (container.getEntryPoint !== undefined) {\n\t\tconst entryPoint = await container.getEntryPoint();\n\t\t// Note: We need to also check if the result of `getEntryPoint()` is defined. This is because when running\n\t\t// cross-client compat testing scenarios, if we create with 1.X container and load with 2.X then the\n\t\t// function container.getEntryPoint will be defined for the 2.X container. However, it will not return undefined\n\t\t// since the container's runtime will be on version 1.X, which does not have an entry point defined.\n\t\tif (entryPoint !== undefined) {\n\t\t\treturn entryPoint as T;\n\t\t}\n\t}\n\tconst response: IResponse = await (container as any).request({ url: \"/\" });\n\tassert(response.status === 200, \"requesting '/' should return default data object\");\n\treturn response.value as T;\n}\n\n/**\n * This function should ONLY be used for back compat purposes\n * Older supported versions of IDataStore do not have the \"entryPoint\" property, so we need to fallback to \"request\"\n * This function can be removed once back-compat support for IDataStore moves to 2.0.0-internal.7.0.0\n *\n * @internal\n */\nexport async function getDataStoreEntryPointBackCompat<T>(dataStore: IDataStore): Promise<T> {\n\tif (dataStore.entryPoint !== undefined) {\n\t\treturn dataStore.entryPoint.get() as Promise<T>;\n\t}\n\tconst response: IResponse = await (dataStore as any).request({ url: \"\" });\n\tassert(response.status === 200, \"empty request should return data object\");\n\treturn response.value as T;\n}\n\n/**\n * Calls `container.getPendingLocalState()` and asserts the method is implemented.\n *\n * @remarks\n * `getPendingLocalState` is currently optional on `IContainer` for forward-compat with external\n * implementers; the first-party `Container` always implements it. This helper centralises the\n * existence check so test code does not duplicate `assert(... !== undefined, ...)` at every\n * callsite. Once `getPendingLocalState` becomes required on `IContainer` this helper can be\n * removed in favour of a direct call.\n *\n * @internal\n */\nexport async function getRequiredPendingLocalState(container: IContainer): Promise<string> {\n\tassert(\n\t\tcontainer.getPendingLocalState !== undefined,\n\t\t\"IContainer.getPendingLocalState is not implemented by this container\",\n\t);\n\treturn container.getPendingLocalState();\n}\n\n/**\n * Casts a delta manager to its full interface type with inbound/outbound queues.\n *\n * @internal\n */\nexport function toIDeltaManagerFull(\n\tdeltaManager:\n\t\t| IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n\t\t| IDeltaManagerErased,\n): IDeltaManagerFull {\n\tassert(\n\t\t\"inbound\" in deltaManager && \"outbound\" in deltaManager,\n\t\t\"Delta manager does not have inbound/outbound queues.\",\n\t);\n\treturn deltaManager as unknown as\n\t\t| IDeltaManagerErased\n\t\t| IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> as IDeltaManagerFull;\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export { createDocumentId, DataObjectFactoryType, TestObjectProvider, TestObject
|
|
|
17
17
|
export type { SummaryInfo } from "./TestSummaryUtils.js";
|
|
18
18
|
export { createSummarizer, createSummarizerCore, createSummarizerFromFactory, summarizeNow, } from "./TestSummaryUtils.js";
|
|
19
19
|
export { timeoutAwait, timeoutPromise, type TimeoutDurationOption, type TimeoutWithError, type TimeoutWithValue, } from "./timeoutUtils.js";
|
|
20
|
-
export { toIDeltaManagerFull, waitForContainerConnection, getContainerEntryPointBackCompat, getDataStoreEntryPointBackCompat, } from "./containerUtils.js";
|
|
20
|
+
export { toIDeltaManagerFull, waitForContainerConnection, getContainerEntryPointBackCompat, getDataStoreEntryPointBackCompat, getRequiredPendingLocalState, } from "./containerUtils.js";
|
|
21
21
|
export { type ContainerRuntimeFactoryWithDefaultDataStoreConstructor, type ContainerRuntimeFactoryWithDefaultDataStoreProps, createContainerRuntimeFactoryWithDefaultDataStore, } from "./testContainerRuntimeFactoryWithDefaultDataStore.js";
|
|
22
22
|
export { TestFluidObjectInternal } from "./testFluidObjectInternal.js";
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;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AAgB,EACrB,KAAK,gBAAgB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,gCAAgC,EAChC,gCAAgC,EAChC,4BAA4B,GAC5B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACN,KAAK,sDAAsD,EAC3D,KAAK,gDAAgD,EACrD,iDAAiD,GACjD,MAAM,sDAAsD,CAAC;AAE9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -20,7 +20,7 @@ export { LoaderContainerTracker } from "./loaderContainerTracker.js";
|
|
|
20
20
|
export { createDocumentId, DataObjectFactoryType, TestObjectProvider, TestObjectProviderWithVersionedLoad, } from "./testObjectProvider.js";
|
|
21
21
|
export { createSummarizer, createSummarizerCore, createSummarizerFromFactory, summarizeNow, } from "./TestSummaryUtils.js";
|
|
22
22
|
export { timeoutAwait, timeoutPromise, } from "./timeoutUtils.js";
|
|
23
|
-
export { toIDeltaManagerFull, waitForContainerConnection, getContainerEntryPointBackCompat, getDataStoreEntryPointBackCompat, } from "./containerUtils.js";
|
|
23
|
+
export { toIDeltaManagerFull, waitForContainerConnection, getContainerEntryPointBackCompat, getDataStoreEntryPointBackCompat, getRequiredPendingLocalState, } from "./containerUtils.js";
|
|
24
24
|
// #endregion
|
|
25
25
|
export { createContainerRuntimeFactoryWithDefaultDataStore, } from "./testContainerRuntimeFactoryWithDefaultDataStore.js";
|
|
26
26
|
export { TestFluidObjectInternal } from "./testFluidObjectInternal.js";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,2BAA2B,EAC3B,8BAA8B,GAC9B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEN,eAAe,EAGf,sBAAsB,GACtB,MAAM,sBAAsB,CAAC;AAC9B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OAAO,EACN,iCAAiC,EACjC,2BAA2B,GAC3B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEN,eAAe,EACf,sBAAsB,GAEtB,MAAM,sBAAsB,CAAC;AAE9B,wCAAwC;AACxC,yEAAyE;AACzE,iFAAiF;AACjF,+DAA+D;AAC/D,wEAAwE;AACxE,4EAA4E;AAC5E,oDAAoD;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAOrE,OAAO,EACN,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,mCAAmC,GACnC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACN,gBAAgB,EAChB,oBAAoB,EACpB,2BAA2B,EAC3B,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,YAAY,EACZ,cAAc,GAId,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,gCAAgC,EAChC,gCAAgC,EAChC,4BAA4B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,aAAa;AAEb,OAAO,EAGN,iDAAiD,GACjD,MAAM,sDAAsD,CAAC;AAE9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { IEventAndErrorTrackingLogger } from \"./eventAndErrorLogger.js\";\nexport {\n\tEventAndErrorTrackingLogger,\n\tgetUnexpectedLogErrorException,\n} from \"./eventAndErrorLogger.js\";\nexport { IProvideTestFluidObject, ITestFluidObject } from \"./interfaces.js\";\nexport {\n\tfluidEntryPoint,\n\tLocalCodeLoader,\n\tSupportedExportInterfaces,\n\tFactory,\n\tcreateDataStoreFactory,\n} from \"./localCodeLoader.js\";\nexport {\n\tcreateAndAttachContainer,\n\tcreateLoader,\n\tcreateLoaderProps,\n\tcreateAndAttachContainerUsingProps,\n} from \"./localLoader.js\";\nexport { retryWithEventualValue } from \"./retry.js\";\nexport { createTestConfigProvider, ITestConfigProvider } from \"./TestConfigs.js\";\nexport {\n\tcreateTestContainerRuntimeFactory,\n\tTestContainerRuntimeFactory,\n} from \"./testContainerRuntimeFactory.js\";\nexport {\n\tChannelFactoryRegistry,\n\tTestFluidObject,\n\tTestFluidObjectFactory,\n\tTestDataObjectKind,\n} from \"./testFluidObject.js\";\n\n// #region Exports with load side-effect\n// The below runtime (not \"type\") exports transitively or directly import\n// timeoutUtils.ts, which always executes on import and may patch Mocha's timeout\n// handling. That patching only takes effect when consumers use\n// @fluid-internal/mocha-test-setup that sets globalThis.getMochaModule.\n// @fluid-internal/mocha-test-setup is pervasive in our tests and thus patch\n// is usually in effect (when this package is used).\nexport { LoaderContainerTracker } from \"./loaderContainerTracker.js\";\nexport type {\n\tIDocumentIdStrategy,\n\tIOpProcessingController,\n\tITestContainerConfig,\n\tITestObjectProvider,\n} from \"./testObjectProvider.js\";\nexport {\n\tcreateDocumentId,\n\tDataObjectFactoryType,\n\tTestObjectProvider,\n\tTestObjectProviderWithVersionedLoad,\n} from \"./testObjectProvider.js\";\nexport type { SummaryInfo } from \"./TestSummaryUtils.js\";\nexport {\n\tcreateSummarizer,\n\tcreateSummarizerCore,\n\tcreateSummarizerFromFactory,\n\tsummarizeNow,\n} from \"./TestSummaryUtils.js\";\nexport {\n\ttimeoutAwait,\n\ttimeoutPromise,\n\ttype TimeoutDurationOption,\n\ttype TimeoutWithError,\n\ttype TimeoutWithValue,\n} from \"./timeoutUtils.js\";\nexport {\n\ttoIDeltaManagerFull,\n\twaitForContainerConnection,\n\tgetContainerEntryPointBackCompat,\n\tgetDataStoreEntryPointBackCompat,\n\tgetRequiredPendingLocalState,\n} from \"./containerUtils.js\";\n// #endregion\n\nexport {\n\ttype ContainerRuntimeFactoryWithDefaultDataStoreConstructor,\n\ttype ContainerRuntimeFactoryWithDefaultDataStoreProps,\n\tcreateContainerRuntimeFactoryWithDefaultDataStore,\n} from \"./testContainerRuntimeFactoryWithDefaultDataStore.js\";\n\nexport { TestFluidObjectInternal } from \"./testFluidObjectInternal.js\";\n"]}
|
package/lib/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/test-utils";
|
|
8
|
-
export declare const pkgVersion = "2.
|
|
8
|
+
export declare const pkgVersion = "2.103.0";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
package/lib/packageVersion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,4BAA4B,CAAC;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/test-utils\";\nexport const pkgVersion = \"2.
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,4BAA4B,CAAC;AACpD,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/test-utils\";\nexport const pkgVersion = \"2.103.0\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/test-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.103.0",
|
|
4
4
|
"description": "Utilities for Fluid tests",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -67,26 +67,26 @@
|
|
|
67
67
|
"temp-directory": "nyc/.nyc_output"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@fluid-internal/test-driver-definitions": "~2.
|
|
71
|
-
"@fluidframework/container-definitions": "~2.
|
|
72
|
-
"@fluidframework/container-loader": "~2.
|
|
73
|
-
"@fluidframework/container-runtime": "~2.
|
|
74
|
-
"@fluidframework/container-runtime-definitions": "~2.
|
|
75
|
-
"@fluidframework/core-interfaces": "~2.
|
|
76
|
-
"@fluidframework/core-utils": "~2.
|
|
77
|
-
"@fluidframework/datastore": "~2.
|
|
78
|
-
"@fluidframework/datastore-definitions": "~2.
|
|
79
|
-
"@fluidframework/driver-definitions": "~2.
|
|
80
|
-
"@fluidframework/driver-utils": "~2.
|
|
81
|
-
"@fluidframework/local-driver": "~2.
|
|
82
|
-
"@fluidframework/map": "~2.
|
|
83
|
-
"@fluidframework/odsp-driver": "~2.
|
|
84
|
-
"@fluidframework/request-handler": "~2.
|
|
85
|
-
"@fluidframework/routerlicious-driver": "~2.
|
|
86
|
-
"@fluidframework/runtime-definitions": "~2.
|
|
87
|
-
"@fluidframework/runtime-utils": "~2.
|
|
88
|
-
"@fluidframework/shared-object-base": "~2.
|
|
89
|
-
"@fluidframework/telemetry-utils": "~2.
|
|
70
|
+
"@fluid-internal/test-driver-definitions": "~2.103.0",
|
|
71
|
+
"@fluidframework/container-definitions": "~2.103.0",
|
|
72
|
+
"@fluidframework/container-loader": "~2.103.0",
|
|
73
|
+
"@fluidframework/container-runtime": "~2.103.0",
|
|
74
|
+
"@fluidframework/container-runtime-definitions": "~2.103.0",
|
|
75
|
+
"@fluidframework/core-interfaces": "~2.103.0",
|
|
76
|
+
"@fluidframework/core-utils": "~2.103.0",
|
|
77
|
+
"@fluidframework/datastore": "~2.103.0",
|
|
78
|
+
"@fluidframework/datastore-definitions": "~2.103.0",
|
|
79
|
+
"@fluidframework/driver-definitions": "~2.103.0",
|
|
80
|
+
"@fluidframework/driver-utils": "~2.103.0",
|
|
81
|
+
"@fluidframework/local-driver": "~2.103.0",
|
|
82
|
+
"@fluidframework/map": "~2.103.0",
|
|
83
|
+
"@fluidframework/odsp-driver": "~2.103.0",
|
|
84
|
+
"@fluidframework/request-handler": "~2.103.0",
|
|
85
|
+
"@fluidframework/routerlicious-driver": "~2.103.0",
|
|
86
|
+
"@fluidframework/runtime-definitions": "~2.103.0",
|
|
87
|
+
"@fluidframework/runtime-utils": "~2.103.0",
|
|
88
|
+
"@fluidframework/shared-object-base": "~2.103.0",
|
|
89
|
+
"@fluidframework/telemetry-utils": "~2.103.0",
|
|
90
90
|
"best-random": "^1.0.0",
|
|
91
91
|
"debug": "^4.3.4",
|
|
92
92
|
"uuid": "^11.1.0"
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
96
96
|
"@biomejs/biome": "~2.4.5",
|
|
97
|
-
"@fluid-internal/mocha-test-setup": "~2.
|
|
97
|
+
"@fluid-internal/mocha-test-setup": "~2.103.0",
|
|
98
98
|
"@fluid-tools/build-cli": "^0.65.0",
|
|
99
99
|
"@fluidframework/build-common": "^2.0.3",
|
|
100
100
|
"@fluidframework/build-tools": "^0.65.0",
|
|
101
101
|
"@fluidframework/eslint-config-fluid": "^9.0.0",
|
|
102
|
-
"@fluidframework/test-utils-previous": "npm:@fluidframework/test-utils@2.
|
|
102
|
+
"@fluidframework/test-utils-previous": "npm:@fluidframework/test-utils@2.101.0",
|
|
103
103
|
"@microsoft/api-extractor": "7.58.1",
|
|
104
104
|
"@types/debug": "^4.1.5",
|
|
105
105
|
"@types/diff": "^3.5.1",
|
|
@@ -118,14 +118,7 @@
|
|
|
118
118
|
"typescript": "~5.4.5"
|
|
119
119
|
},
|
|
120
120
|
"typeValidation": {
|
|
121
|
-
"broken": {
|
|
122
|
-
"Interface_IProvideTestFluidObject": {
|
|
123
|
-
"forwardCompat": false
|
|
124
|
-
},
|
|
125
|
-
"Interface_ITestFluidObject": {
|
|
126
|
-
"forwardCompat": false
|
|
127
|
-
}
|
|
128
|
-
},
|
|
121
|
+
"broken": {},
|
|
129
122
|
"entrypoint": "legacy"
|
|
130
123
|
},
|
|
131
124
|
"scripts": {
|
package/src/containerUtils.ts
CHANGED
|
@@ -99,6 +99,26 @@ export async function getDataStoreEntryPointBackCompat<T>(dataStore: IDataStore)
|
|
|
99
99
|
return response.value as T;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Calls `container.getPendingLocalState()` and asserts the method is implemented.
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* `getPendingLocalState` is currently optional on `IContainer` for forward-compat with external
|
|
107
|
+
* implementers; the first-party `Container` always implements it. This helper centralises the
|
|
108
|
+
* existence check so test code does not duplicate `assert(... !== undefined, ...)` at every
|
|
109
|
+
* callsite. Once `getPendingLocalState` becomes required on `IContainer` this helper can be
|
|
110
|
+
* removed in favour of a direct call.
|
|
111
|
+
*
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
114
|
+
export async function getRequiredPendingLocalState(container: IContainer): Promise<string> {
|
|
115
|
+
assert(
|
|
116
|
+
container.getPendingLocalState !== undefined,
|
|
117
|
+
"IContainer.getPendingLocalState is not implemented by this container",
|
|
118
|
+
);
|
|
119
|
+
return container.getPendingLocalState();
|
|
120
|
+
}
|
|
121
|
+
|
|
102
122
|
/**
|
|
103
123
|
* Casts a delta manager to its full interface type with inbound/outbound queues.
|
|
104
124
|
*
|
package/src/index.ts
CHANGED
package/src/packageVersion.ts
CHANGED