@fluidframework/test-utils 2.70.0-360374 → 2.70.0-360753

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.
@@ -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.70.0-360374";
8
+ export declare const pkgVersion = "2.70.0-360753";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -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.70.0-360374";
11
+ exports.pkgVersion = "2.70.0-360753";
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,eAAe,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.70.0-360374\";\n"]}
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,eAAe,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.70.0-360753\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"testContainerRuntimeFactory.d.ts","sourceRoot":"","sources":["../src/testContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EACN,gBAAgB,EAEhB,KAAK,gCAAgC,EAErC,KAAK,uBAAuB,EAC5B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACN,iBAAiB,EAGjB,MAAM,wDAAwD,CAAC;AAIhE,OAAO,EAEN,qBAAqB,EAGrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACN,sBAAsB,EAEtB,MAAM,8CAA8C,CAAC;AAmCtD;;;GAGG;AACH,eAAO,MAAM,iCAAiC,yBACvB,uBAAuB;eAI9B,MAAM,oBACM,sBAAsB,mBACxB,gCAAgC,wBAU3B,uBAAuB,GAAG,SAAS,oBAEvC,qBAAqB,EAAE;cAdlC,MAAM;0BACM,sBAAsB;wBACxB,gCAAgC;6BAU3B,uBAAuB,GAAG,SAAS;yBAEvC,qBAAqB,EAAE;sCAKL,gBAAgB,GAAG,QAAQ,IAAI,CAAC;yCAkB7B,gBAAgB,GAAG,QAAQ,IAAI,CAAC;+BAcpE,iBAAiB,YAChB,OAAO,GACf,QAAQ,QAAQ,GAAG,iBAAiB,CAAC;;;;;CAuDzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B;eAlHxB,MAAM,oBACM,sBAAsB,mBACxB,gCAAgC,wBAU3B,uBAAuB,GAAG,SAAS,oBAEvC,qBAAqB,EAAE;cAdlC,MAAM;0BACM,sBAAsB;wBACxB,gCAAgC;6BAU3B,uBAAuB,GAAG,SAAS;yBAEvC,qBAAqB,EAAE;sCAKL,gBAAgB,GAAG,QAAQ,IAAI,CAAC;yCAkB7B,gBAAgB,GAAG,QAAQ,IAAI,CAAC;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AG,QAAQ,IAAI,CAAC;+BAcpE,iBAAiB,YAChB,OAAO,GACf,QAAQ,QAAQ,GAAG,iBAAiB,CAAC;;;;;CAiEoD,CAAC"}
@@ -96,6 +96,9 @@ const createTestContainerRuntimeFactory = (containerRuntimeCtor) => {
96
96
  }
97
97
  return undefined; // continue search
98
98
  };
99
+ // This usage of `containerRuntimeCtor.loadRuntime`, an `@internal` API, called on past versions of this package,
100
+ // adds an extra constraint that makes changing that API more difficult than it otherwise would be.
101
+ // Actual customers / apps should not be dependent on stability of this API, but this code is, at least for now.
99
102
  return containerRuntimeCtor.loadRuntime({
100
103
  context,
101
104
  registryEntries: [
@@ -1 +1 @@
1
- {"version":3,"file":"testContainerRuntimeFactory.js","sourceRoot":"","sources":["../src/testContainerRuntimeFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAMoD;AAQpD,kEAA6D;AAC7D,uEAKkD;AAKlD,qEAA6F;AAO7F,MAAM,qCAAqC,GAAG,CAAC,aAAqB,EAAE,EAAE;IACvE,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE;QAC9D,MAAM,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OACC,OACA,CAAC,mBAAmB,CAAC,aAAa,CAAC;gBACnC,GAAG,EAAE,IAAI,aAAa,GAAG,MAAM,CAAC,KAAK,EAAE;gBACvC,OAAO,EAAE,OAAO,CAAC,OAAO;aACxB,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC,CAAC,kBAAkB;IACrC,CAAC,CAAC;AACH,CAAC,CAAC;AAcF;;;GAGG;AACI,MAAM,iCAAiC,GAAG,CAChD,oBAA6C,EAC5C,EAAE;IACH,OAAO,KAAM,SAAQ,+BAAoB;QACxC,YACQ,IAAY,EACZ,gBAAwC,EACxC,iBAAmD;YACzD,cAA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AAW,MAAM,CAAC,KAAK,EAAE;wBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;qBACxB,CAAC,CAAC;gBACJ,CAAC;gBACD,OAAO,SAAS,CAAC,CAAC,kBAAkB;YACrC,CAAC,CAAC;YACF,OAAO,oBAAoB,CAAC,WAAW,CAAC;gBACvC,OAAO;gBACP,eAAe,EAAE;oBAChB,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;oBACnD,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;iBACnD;gBACD,gDAAgD;gBAChD,cAAc,EAAE,IAAA,qCAA0B,EAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC;gBACrF,iBAAiB;gBACjB,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,cAAc,EAAE,OAAO,CAAC,KAAK;gBAC7B,QAAQ;gBACR,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aACR,CAAC,CAAC;QACzC,CAAC;KACD,CAAC;AACH,CAAC,CAAC;AAjHW,QAAA,iCAAiC,qCAiH5C;AAEF;;;GAGG;AACU,QAAA,2BAA2B,GAAG,IAAA,yCAAiC,EAAC,2BAAgB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainerContext, IRuntime } from \"@fluidframework/container-definitions/internal\";\nimport {\n\tContainerRuntime,\n\tDefaultSummaryConfiguration,\n\ttype IContainerRuntimeOptionsInternal,\n\ttype LoadContainerRuntimeParams,\n\ttype MinimumVersionForCollab,\n} from \"@fluidframework/container-runtime/internal\";\nimport {\n\tIContainerRuntime,\n\t// eslint-disable-next-line import/no-deprecated\n\tIContainerRuntimeWithResolveHandle_Deprecated,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport { FluidObject, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tRuntimeRequestHandler,\n\t// eslint-disable-next-line import/no-deprecated\n\tbuildRuntimeRequestHandler,\n} from \"@fluidframework/request-handler/internal\";\nimport {\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { RequestParser, RuntimeFactoryHelper } from \"@fluidframework/runtime-utils/internal\";\n\ninterface backCompat_IFluidRouter {\n\tIFluidRouter?: backCompat_IFluidRouter;\n\trequest(request: IRequest): Promise<IResponse>;\n}\n\nconst backCompat_DefaultRouteRequestHandler = (defaultRootId: string) => {\n\treturn async (request: IRequest, runtime: IContainerRuntime) => {\n\t\tconst parser = RequestParser.create(request);\n\t\tif (parser.pathParts.length === 0) {\n\t\t\treturn (\n\t\t\t\truntime as any as Required<FluidObject<IFluidHandleContext>>\n\t\t\t).IFluidHandleContext.resolveHandle({\n\t\t\t\turl: `/${defaultRootId}${parser.query}`,\n\t\t\t\theaders: request.headers,\n\t\t\t});\n\t\t}\n\t\treturn undefined; // continue search\n\t};\n};\n\ninterface backCompat_ContainerRuntime {\n\tload(\n\t\tcontext: IContainerContext,\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries,\n\t\trequestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>,\n\t\truntimeOptions?: IContainerRuntimeOptionsInternal,\n\t\tcontainerScope?: FluidObject,\n\t\texisting?: boolean,\n\t\tcontainerRuntimeCtor?: typeof ContainerRuntime,\n\t): Promise<ContainerRuntime>;\n}\n\n/**\n * Create a container runtime factory class that allows you to set runtime options\n * @internal\n */\nexport const createTestContainerRuntimeFactory = (\n\tcontainerRuntimeCtor: typeof ContainerRuntime,\n) => {\n\treturn class extends RuntimeFactoryHelper {\n\t\tconstructor(\n\t\t\tpublic type: string,\n\t\t\tpublic dataStoreFactory: IFluidDataStoreFactory,\n\t\t\tpublic runtimeOptions: IContainerRuntimeOptionsInternal = {\n\t\t\t\tsummaryOptions: {\n\t\t\t\t\tsummaryConfigOverrides: {\n\t\t\t\t\t\t...DefaultSummaryConfiguration,\n\t\t\t\t\t\t...{\n\t\t\t\t\t\t\tinitialSummarizerDelayMs: 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tpublic minVersionForCollab: MinimumVersionForCollab | undefined = undefined,\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tpublic requestHandlers: RuntimeRequestHandler[] = [],\n\t\t) {\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n\t\t\t// Back-compat - old code does not return IDataStore for rootContext.attachRuntime() call!\n\t\t\t// Thus need to leverage old API createDetachedRootDataStore() that is gone in latest releases.\n\t\t\tconst rootContext =\n\t\t\t\t\"createDetachedRootDataStore\" in runtime\n\t\t\t\t\t? (runtime as any).createDetachedRootDataStore([this.type], \"default\")\n\t\t\t\t\t: runtime.createDetachedDataStore([this.type]);\n\n\t\t\tconst rootRuntime = await this.dataStoreFactory.instantiateDataStore(\n\t\t\t\trootContext,\n\t\t\t\t/* existing */ false,\n\t\t\t);\n\t\t\tconst dataStore = await rootContext.attachRuntime(this.dataStoreFactory, rootRuntime);\n\n\t\t\tconst result = await dataStore?.trySetAlias(\"default\");\n\t\t\tassert(result === \"Success\" || result === undefined, \"success\");\n\t\t}\n\n\t\tpublic async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {\n\t\t\t// Validate we can load root data stores.\n\t\t\t// We should be able to load any data store that was created in initializeFirstTime!\n\t\t\t// Note: We use the deprecated `getRootDataStore` from v1.X here to allow for cross-major version compat\n\t\t\t// testing. Can be removed when we no longer support v1.X.\n\t\t\tawait (runtime.getAliasedDataStoreEntryPoint?.(\"default\") ??\n\t\t\t\t(\n\t\t\t\t\truntime as any as {\n\t\t\t\t\t\tgetRootDataStore(id: string, wait?: boolean): Promise<backCompat_IFluidRouter>;\n\t\t\t\t\t}\n\t\t\t\t).getRootDataStore(\"default\"));\n\t\t}\n\n\t\tasync preInitialize(\n\t\t\tcontext: IContainerContext,\n\t\t\texisting: boolean,\n\t\t): Promise<IRuntime & IContainerRuntime> {\n\t\t\tif (containerRuntimeCtor.loadRuntime === undefined) {\n\t\t\t\t// Note: We use the deprecated `load` from v1.X here to allow for cross-major version compat testing.\n\t\t\t\t// Can be removed when we no longer support v1.X.\n\t\t\t\treturn (containerRuntimeCtor as any as backCompat_ContainerRuntime).load(\n\t\t\t\t\tcontext,\n\t\t\t\t\t[\n\t\t\t\t\t\t[\"default\", Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t\t[this.type, Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t],\n\t\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\t\tbuildRuntimeRequestHandler(\n\t\t\t\t\t\tbackCompat_DefaultRouteRequestHandler(\"default\"),\n\t\t\t\t\t\t...this.requestHandlers,\n\t\t\t\t\t),\n\t\t\t\t\tthis.runtimeOptions,\n\t\t\t\t\tcontext.scope,\n\t\t\t\t\texisting,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst provideEntryPoint = async (runtime: IContainerRuntime) => {\n\t\t\t\tconst entryPoint = await runtime.getAliasedDataStoreEntryPoint(\"default\");\n\t\t\t\tif (entryPoint === undefined) {\n\t\t\t\t\tthrow new Error(\"default dataStore must exist\");\n\t\t\t\t}\n\t\t\t\treturn entryPoint.get();\n\t\t\t};\n\t\t\tconst getDefaultObject = async (request: IRequest, runtime: IContainerRuntime) => {\n\t\t\t\tconst parser = RequestParser.create(request);\n\t\t\t\tif (parser.pathParts.length === 0) {\n\t\t\t\t\t// This cast is safe as loadContainerRuntime is called below\n\t\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\t\treturn (runtime as IContainerRuntimeWithResolveHandle_Deprecated).resolveHandle({\n\t\t\t\t\t\turl: `/default${parser.query}`,\n\t\t\t\t\t\theaders: request.headers,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn undefined; // continue search\n\t\t\t};\n\t\t\treturn containerRuntimeCtor.loadRuntime({\n\t\t\t\tcontext,\n\t\t\t\tregistryEntries: [\n\t\t\t\t\t[\"default\", Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t[this.type, Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t],\n\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\trequestHandler: buildRuntimeRequestHandler(getDefaultObject, ...this.requestHandlers),\n\t\t\t\tprovideEntryPoint,\n\t\t\t\truntimeOptions: this.runtimeOptions,\n\t\t\t\tcontainerScope: context.scope,\n\t\t\t\texisting,\n\t\t\t\tminVersionForCollab: this.minVersionForCollab,\n\t\t\t} satisfies LoadContainerRuntimeParams);\n\t\t}\n\t};\n};\n\n/**\n * A container runtime factory that allows you to set runtime options\n * @internal\n */\nexport const TestContainerRuntimeFactory = createTestContainerRuntimeFactory(ContainerRuntime);\n"]}
1
+ {"version":3,"file":"testContainerRuntimeFactory.js","sourceRoot":"","sources":["../src/testContainerRuntimeFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAKoD;AAQpD,kEAA6D;AAC7D,uEAKkD;AAKlD,qEAA6F;AAO7F,MAAM,qCAAqC,GAAG,CAAC,aAAqB,EAAE,EAAE;IACvE,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE;QAC9D,MAAM,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OACC,OACA,CAAC,mBAAmB,CAAC,aAAa,CAAC;gBACnC,GAAG,EAAE,IAAI,aAAa,GAAG,MAAM,CAAC,KAAK,EAAE;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MAAM,gBAAgB,GAAG,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE;gBAChF,MAAM,MAAM,GAAG,wBAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBAC7C,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACnC,4DAA4D;oBAC5D,gDAAgD;oBAChD,OAAQ,OAAyD,CAAC,aAAa,CAAC;wBAC/E,GAAG,EAAE,WAAW,MAAM,CAAC,KAAK,EAAE;wBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;qBACxB,CAAC,CAAC;gBACJ,CAAC;gBACD,OAAO,SAAS,CAAC,CAAC,kBAAkB;YACrC,CAAC,CAAC;YAEF,iHAAiH;YACjH,mGAAmG;YACnG,gHAAgH;YAChH,OAAO,oBAAoB,CAAC,WAAW,CAAC;gBACvC,OAAO;gBACP,eAAe,EAAE;oBAChB,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;oBACnD,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;iBACnD;gBACD,gDAAgD;gBAChD,cAAc,EAAE,IAAA,qCAA0B,EAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC;gBACrF,iBAAiB;gBACjB,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,cAAc,EAAE,OAAO,CAAC,KAAK;gBAC7B,QAAQ;gBACR,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aAC7C,CAAC,CAAC;QACJ,CAAC;KACD,CAAC;AACH,CAAC,CAAC;AArHW,QAAA,iCAAiC,qCAqH5C;AAEF;;;GAGG;AACU,QAAA,2BAA2B,GAAG,IAAA,yCAAiC,EAAC,2BAAgB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainerContext, IRuntime } from \"@fluidframework/container-definitions/internal\";\nimport {\n\tContainerRuntime,\n\tDefaultSummaryConfiguration,\n\ttype IContainerRuntimeOptionsInternal,\n\ttype MinimumVersionForCollab,\n} from \"@fluidframework/container-runtime/internal\";\nimport {\n\tIContainerRuntime,\n\t// eslint-disable-next-line import/no-deprecated\n\tIContainerRuntimeWithResolveHandle_Deprecated,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport { FluidObject, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tRuntimeRequestHandler,\n\t// eslint-disable-next-line import/no-deprecated\n\tbuildRuntimeRequestHandler,\n} from \"@fluidframework/request-handler/internal\";\nimport {\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { RequestParser, RuntimeFactoryHelper } from \"@fluidframework/runtime-utils/internal\";\n\ninterface backCompat_IFluidRouter {\n\tIFluidRouter?: backCompat_IFluidRouter;\n\trequest(request: IRequest): Promise<IResponse>;\n}\n\nconst backCompat_DefaultRouteRequestHandler = (defaultRootId: string) => {\n\treturn async (request: IRequest, runtime: IContainerRuntime) => {\n\t\tconst parser = RequestParser.create(request);\n\t\tif (parser.pathParts.length === 0) {\n\t\t\treturn (\n\t\t\t\truntime as any as Required<FluidObject<IFluidHandleContext>>\n\t\t\t).IFluidHandleContext.resolveHandle({\n\t\t\t\turl: `/${defaultRootId}${parser.query}`,\n\t\t\t\theaders: request.headers,\n\t\t\t});\n\t\t}\n\t\treturn undefined; // continue search\n\t};\n};\n\ninterface backCompat_ContainerRuntime {\n\tload(\n\t\tcontext: IContainerContext,\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries,\n\t\trequestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>,\n\t\truntimeOptions?: IContainerRuntimeOptionsInternal,\n\t\tcontainerScope?: FluidObject,\n\t\texisting?: boolean,\n\t\tcontainerRuntimeCtor?: typeof ContainerRuntime,\n\t): Promise<ContainerRuntime>;\n}\n\n/**\n * Create a container runtime factory class that allows you to set runtime options\n * @internal\n */\nexport const createTestContainerRuntimeFactory = (\n\tcontainerRuntimeCtor: typeof ContainerRuntime,\n) => {\n\treturn class extends RuntimeFactoryHelper {\n\t\tconstructor(\n\t\t\tpublic type: string,\n\t\t\tpublic dataStoreFactory: IFluidDataStoreFactory,\n\t\t\tpublic runtimeOptions: IContainerRuntimeOptionsInternal = {\n\t\t\t\tsummaryOptions: {\n\t\t\t\t\tsummaryConfigOverrides: {\n\t\t\t\t\t\t...DefaultSummaryConfiguration,\n\t\t\t\t\t\t...{\n\t\t\t\t\t\t\tinitialSummarizerDelayMs: 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tpublic minVersionForCollab: MinimumVersionForCollab | undefined = undefined,\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tpublic requestHandlers: RuntimeRequestHandler[] = [],\n\t\t) {\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n\t\t\t// Back-compat - old code does not return IDataStore for rootContext.attachRuntime() call!\n\t\t\t// Thus need to leverage old API createDetachedRootDataStore() that is gone in latest releases.\n\t\t\tconst rootContext =\n\t\t\t\t\"createDetachedRootDataStore\" in runtime\n\t\t\t\t\t? (runtime as any).createDetachedRootDataStore([this.type], \"default\")\n\t\t\t\t\t: runtime.createDetachedDataStore([this.type]);\n\n\t\t\tconst rootRuntime = await this.dataStoreFactory.instantiateDataStore(\n\t\t\t\trootContext,\n\t\t\t\t/* existing */ false,\n\t\t\t);\n\t\t\tconst dataStore = await rootContext.attachRuntime(this.dataStoreFactory, rootRuntime);\n\n\t\t\tconst result = await dataStore?.trySetAlias(\"default\");\n\t\t\tassert(result === \"Success\" || result === undefined, \"success\");\n\t\t}\n\n\t\tpublic async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {\n\t\t\t// Validate we can load root data stores.\n\t\t\t// We should be able to load any data store that was created in initializeFirstTime!\n\t\t\t// Note: We use the deprecated `getRootDataStore` from v1.X here to allow for cross-major version compat\n\t\t\t// testing. Can be removed when we no longer support v1.X.\n\t\t\tawait (runtime.getAliasedDataStoreEntryPoint?.(\"default\") ??\n\t\t\t\t(\n\t\t\t\t\truntime as any as {\n\t\t\t\t\t\tgetRootDataStore(id: string, wait?: boolean): Promise<backCompat_IFluidRouter>;\n\t\t\t\t\t}\n\t\t\t\t).getRootDataStore(\"default\"));\n\t\t}\n\n\t\tasync preInitialize(\n\t\t\tcontext: IContainerContext,\n\t\t\texisting: boolean,\n\t\t): Promise<IRuntime & IContainerRuntime> {\n\t\t\tif (containerRuntimeCtor.loadRuntime === undefined) {\n\t\t\t\t// Note: We use the deprecated `load` from v1.X here to allow for cross-major version compat testing.\n\t\t\t\t// Can be removed when we no longer support v1.X.\n\t\t\t\treturn (containerRuntimeCtor as any as backCompat_ContainerRuntime).load(\n\t\t\t\t\tcontext,\n\t\t\t\t\t[\n\t\t\t\t\t\t[\"default\", Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t\t[this.type, Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t],\n\t\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\t\tbuildRuntimeRequestHandler(\n\t\t\t\t\t\tbackCompat_DefaultRouteRequestHandler(\"default\"),\n\t\t\t\t\t\t...this.requestHandlers,\n\t\t\t\t\t),\n\t\t\t\t\tthis.runtimeOptions,\n\t\t\t\t\tcontext.scope,\n\t\t\t\t\texisting,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst provideEntryPoint = async (runtime: IContainerRuntime) => {\n\t\t\t\tconst entryPoint = await runtime.getAliasedDataStoreEntryPoint(\"default\");\n\t\t\t\tif (entryPoint === undefined) {\n\t\t\t\t\tthrow new Error(\"default dataStore must exist\");\n\t\t\t\t}\n\t\t\t\treturn entryPoint.get();\n\t\t\t};\n\t\t\tconst getDefaultObject = async (request: IRequest, runtime: IContainerRuntime) => {\n\t\t\t\tconst parser = RequestParser.create(request);\n\t\t\t\tif (parser.pathParts.length === 0) {\n\t\t\t\t\t// This cast is safe as loadContainerRuntime is called below\n\t\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\t\treturn (runtime as IContainerRuntimeWithResolveHandle_Deprecated).resolveHandle({\n\t\t\t\t\t\turl: `/default${parser.query}`,\n\t\t\t\t\t\theaders: request.headers,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn undefined; // continue search\n\t\t\t};\n\n\t\t\t// This usage of `containerRuntimeCtor.loadRuntime`, an `@internal` API, called on past versions of this package,\n\t\t\t// adds an extra constraint that makes changing that API more difficult than it otherwise would be.\n\t\t\t// Actual customers / apps should not be dependent on stability of this API, but this code is, at least for now.\n\t\t\treturn containerRuntimeCtor.loadRuntime({\n\t\t\t\tcontext,\n\t\t\t\tregistryEntries: [\n\t\t\t\t\t[\"default\", Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t[this.type, Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t],\n\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\trequestHandler: buildRuntimeRequestHandler(getDefaultObject, ...this.requestHandlers),\n\t\t\t\tprovideEntryPoint,\n\t\t\t\truntimeOptions: this.runtimeOptions,\n\t\t\t\tcontainerScope: context.scope,\n\t\t\t\texisting,\n\t\t\t\tminVersionForCollab: this.minVersionForCollab,\n\t\t\t});\n\t\t}\n\t};\n};\n\n/**\n * A container runtime factory that allows you to set runtime options\n * @internal\n */\nexport const TestContainerRuntimeFactory = createTestContainerRuntimeFactory(ContainerRuntime);\n"]}
@@ -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.70.0-360374";
8
+ export declare const pkgVersion = "2.70.0-360753";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/test-utils";
8
- export const pkgVersion = "2.70.0-360374";
8
+ export const pkgVersion = "2.70.0-360753";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -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,eAAe,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.70.0-360374\";\n"]}
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,eAAe,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.70.0-360753\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"testContainerRuntimeFactory.d.ts","sourceRoot":"","sources":["../src/testContainerRuntimeFactory.ts"],"names":[],"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(containerRuntimeCtor) => {
95
95
  }
96
96
  return undefined; // continue search
97
97
  };
98
+ // This usage of `containerRuntimeCtor.loadRuntime`, an `@internal` API, called on past versions of this package,
99
+ // adds an extra constraint that makes changing that API more difficult than it otherwise would be.
100
+ // Actual customers / apps should not be dependent on stability of this API, but this code is, at least for now.
98
101
  return containerRuntimeCtor.loadRuntime({
99
102
  context,
100
103
  registryEntries: [
@@ -1 +1 @@
1
- {"version":3,"file":"testContainerRuntimeFactory.js","sourceRoot":"","sources":["../src/testContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,gBAAgB,EAChB,2BAA2B,GAI3B,MAAM,4CAA4C,CAAC;AAQpD,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO;AAGN,gDAAgD;AAChD,0BAA0B,GAC1B,MAAM,0CAA0C,CAAC;AAKlD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAO7F,MAAM,qCAAqC,GAAG,CAAC,aAAqB,EAAE,EAAE;IACvE,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE;QAC9D,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OACC,OACA,CAAC,mBAAmB,CAAC,aAAa,CAAC;gBACnC,GAAG,EAAE,IAAI,aAAa,GAAG,MAAM,CAAC,KAAK,EAAE;gBACvC,OAAO,EAAE,OAAO,CAAC,OAAO;aACxB,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC,CAAC,kBAAkB;IACrC,CAAC,CAAC;AACH,CAAC,CAAC;AAcF;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAChD,oBAA6C,EAC5C,EAAE;IACH,OAAO,KAAM,SAAQ,oBAAoB;QACxC,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C,aAAa,CAAC;wBAC/E,GAAG,EAAE,WAAW,MAAM,CAAC,KAAK,EAAE;wBAC9B,OAAO,EAAE,OAAO,CAAC,OAAO;qBACxB,CAAC,CAAC;gBACJ,CAAC;gBACD,OAAO,SAAS,CAAC,CAAC,kBAAkB;YACrC,CAAC,CAAC;YACF,OAAO,oBAAoB,CAAC,WAAW,CAAC;gBACvC,OAAO;gBACP,eAAe,EAAE;oBAChB,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;oBACnD,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;iBACnD;gBACD,gDAAgD;gBAChD,cAAc,EAAE,0BAA0B,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC;gBACrF,iBAAiB;gBACjB,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,cAAc,EAAE,OAAO,CAAC,KAAK;gBAC7B,QAAQ;gBACR,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;aACR,CAAC,CAAC;QACzC,CAAC;KACD,CAAC;AACH,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,iCAAiC,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainerContext, IRuntime } from \"@fluidframework/container-definitions/internal\";\nimport {\n\tContainerRuntime,\n\tDefaultSummaryConfiguration,\n\ttype IContainerRuntimeOptionsInternal,\n\ttype LoadContainerRuntimeParams,\n\ttype MinimumVersionForCollab,\n} from \"@fluidframework/container-runtime/internal\";\nimport {\n\tIContainerRuntime,\n\t// eslint-disable-next-line import/no-deprecated\n\tIContainerRuntimeWithResolveHandle_Deprecated,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport { FluidObject, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tRuntimeRequestHandler,\n\t// eslint-disable-next-line import/no-deprecated\n\tbuildRuntimeRequestHandler,\n} from \"@fluidframework/request-handler/internal\";\nimport {\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { RequestParser, RuntimeFactoryHelper } from \"@fluidframework/runtime-utils/internal\";\n\ninterface backCompat_IFluidRouter {\n\tIFluidRouter?: backCompat_IFluidRouter;\n\trequest(request: IRequest): Promise<IResponse>;\n}\n\nconst backCompat_DefaultRouteRequestHandler = (defaultRootId: string) => {\n\treturn async (request: IRequest, runtime: IContainerRuntime) => {\n\t\tconst parser = RequestParser.create(request);\n\t\tif (parser.pathParts.length === 0) {\n\t\t\treturn (\n\t\t\t\truntime as any as Required<FluidObject<IFluidHandleContext>>\n\t\t\t).IFluidHandleContext.resolveHandle({\n\t\t\t\turl: `/${defaultRootId}${parser.query}`,\n\t\t\t\theaders: request.headers,\n\t\t\t});\n\t\t}\n\t\treturn undefined; // continue search\n\t};\n};\n\ninterface backCompat_ContainerRuntime {\n\tload(\n\t\tcontext: IContainerContext,\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries,\n\t\trequestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>,\n\t\truntimeOptions?: IContainerRuntimeOptionsInternal,\n\t\tcontainerScope?: FluidObject,\n\t\texisting?: boolean,\n\t\tcontainerRuntimeCtor?: typeof ContainerRuntime,\n\t): Promise<ContainerRuntime>;\n}\n\n/**\n * Create a container runtime factory class that allows you to set runtime options\n * @internal\n */\nexport const createTestContainerRuntimeFactory = (\n\tcontainerRuntimeCtor: typeof ContainerRuntime,\n) => {\n\treturn class extends RuntimeFactoryHelper {\n\t\tconstructor(\n\t\t\tpublic type: string,\n\t\t\tpublic dataStoreFactory: IFluidDataStoreFactory,\n\t\t\tpublic runtimeOptions: IContainerRuntimeOptionsInternal = {\n\t\t\t\tsummaryOptions: {\n\t\t\t\t\tsummaryConfigOverrides: {\n\t\t\t\t\t\t...DefaultSummaryConfiguration,\n\t\t\t\t\t\t...{\n\t\t\t\t\t\t\tinitialSummarizerDelayMs: 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tpublic minVersionForCollab: MinimumVersionForCollab | undefined = undefined,\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tpublic requestHandlers: RuntimeRequestHandler[] = [],\n\t\t) {\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n\t\t\t// Back-compat - old code does not return IDataStore for rootContext.attachRuntime() call!\n\t\t\t// Thus need to leverage old API createDetachedRootDataStore() that is gone in latest releases.\n\t\t\tconst rootContext =\n\t\t\t\t\"createDetachedRootDataStore\" in runtime\n\t\t\t\t\t? (runtime as any).createDetachedRootDataStore([this.type], \"default\")\n\t\t\t\t\t: runtime.createDetachedDataStore([this.type]);\n\n\t\t\tconst rootRuntime = await this.dataStoreFactory.instantiateDataStore(\n\t\t\t\trootContext,\n\t\t\t\t/* existing */ false,\n\t\t\t);\n\t\t\tconst dataStore = await rootContext.attachRuntime(this.dataStoreFactory, rootRuntime);\n\n\t\t\tconst result = await dataStore?.trySetAlias(\"default\");\n\t\t\tassert(result === \"Success\" || result === undefined, \"success\");\n\t\t}\n\n\t\tpublic async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {\n\t\t\t// Validate we can load root data stores.\n\t\t\t// We should be able to load any data store that was created in initializeFirstTime!\n\t\t\t// Note: We use the deprecated `getRootDataStore` from v1.X here to allow for cross-major version compat\n\t\t\t// testing. Can be removed when we no longer support v1.X.\n\t\t\tawait (runtime.getAliasedDataStoreEntryPoint?.(\"default\") ??\n\t\t\t\t(\n\t\t\t\t\truntime as any as {\n\t\t\t\t\t\tgetRootDataStore(id: string, wait?: boolean): Promise<backCompat_IFluidRouter>;\n\t\t\t\t\t}\n\t\t\t\t).getRootDataStore(\"default\"));\n\t\t}\n\n\t\tasync preInitialize(\n\t\t\tcontext: IContainerContext,\n\t\t\texisting: boolean,\n\t\t): Promise<IRuntime & IContainerRuntime> {\n\t\t\tif (containerRuntimeCtor.loadRuntime === undefined) {\n\t\t\t\t// Note: We use the deprecated `load` from v1.X here to allow for cross-major version compat testing.\n\t\t\t\t// Can be removed when we no longer support v1.X.\n\t\t\t\treturn (containerRuntimeCtor as any as backCompat_ContainerRuntime).load(\n\t\t\t\t\tcontext,\n\t\t\t\t\t[\n\t\t\t\t\t\t[\"default\", Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t\t[this.type, Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t],\n\t\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\t\tbuildRuntimeRequestHandler(\n\t\t\t\t\t\tbackCompat_DefaultRouteRequestHandler(\"default\"),\n\t\t\t\t\t\t...this.requestHandlers,\n\t\t\t\t\t),\n\t\t\t\t\tthis.runtimeOptions,\n\t\t\t\t\tcontext.scope,\n\t\t\t\t\texisting,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst provideEntryPoint = async (runtime: IContainerRuntime) => {\n\t\t\t\tconst entryPoint = await runtime.getAliasedDataStoreEntryPoint(\"default\");\n\t\t\t\tif (entryPoint === undefined) {\n\t\t\t\t\tthrow new Error(\"default dataStore must exist\");\n\t\t\t\t}\n\t\t\t\treturn entryPoint.get();\n\t\t\t};\n\t\t\tconst getDefaultObject = async (request: IRequest, runtime: IContainerRuntime) => {\n\t\t\t\tconst parser = RequestParser.create(request);\n\t\t\t\tif (parser.pathParts.length === 0) {\n\t\t\t\t\t// This cast is safe as loadContainerRuntime is called below\n\t\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\t\treturn (runtime as IContainerRuntimeWithResolveHandle_Deprecated).resolveHandle({\n\t\t\t\t\t\turl: `/default${parser.query}`,\n\t\t\t\t\t\theaders: request.headers,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn undefined; // continue search\n\t\t\t};\n\t\t\treturn containerRuntimeCtor.loadRuntime({\n\t\t\t\tcontext,\n\t\t\t\tregistryEntries: [\n\t\t\t\t\t[\"default\", Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t[this.type, Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t],\n\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\trequestHandler: buildRuntimeRequestHandler(getDefaultObject, ...this.requestHandlers),\n\t\t\t\tprovideEntryPoint,\n\t\t\t\truntimeOptions: this.runtimeOptions,\n\t\t\t\tcontainerScope: context.scope,\n\t\t\t\texisting,\n\t\t\t\tminVersionForCollab: this.minVersionForCollab,\n\t\t\t} satisfies LoadContainerRuntimeParams);\n\t\t}\n\t};\n};\n\n/**\n * A container runtime factory that allows you to set runtime options\n * @internal\n */\nexport const TestContainerRuntimeFactory = createTestContainerRuntimeFactory(ContainerRuntime);\n"]}
1
+ {"version":3,"file":"testContainerRuntimeFactory.js","sourceRoot":"","sources":["../src/testContainerRuntimeFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,gBAAgB,EAChB,2BAA2B,GAG3B,MAAM,4CAA4C,CAAC;AAQpD,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO;AAGN,gDAAgD;AAChD,0BAA0B,GAC1B,MAAM,0CAA0C,CAAC;AAKlD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAO7F,MAAM,qCAAqC,GAAG,CAAC,aAAqB,EAAE,EAAE;IACvE,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE;QAC9D,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,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,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,iCAAiC,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainerContext, IRuntime } from \"@fluidframework/container-definitions/internal\";\nimport {\n\tContainerRuntime,\n\tDefaultSummaryConfiguration,\n\ttype IContainerRuntimeOptionsInternal,\n\ttype MinimumVersionForCollab,\n} from \"@fluidframework/container-runtime/internal\";\nimport {\n\tIContainerRuntime,\n\t// eslint-disable-next-line import/no-deprecated\n\tIContainerRuntimeWithResolveHandle_Deprecated,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport { FluidObject, IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IFluidHandleContext } from \"@fluidframework/core-interfaces/internal\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\t// eslint-disable-next-line import/no-deprecated\n\tRuntimeRequestHandler,\n\t// eslint-disable-next-line import/no-deprecated\n\tbuildRuntimeRequestHandler,\n} from \"@fluidframework/request-handler/internal\";\nimport {\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { RequestParser, RuntimeFactoryHelper } from \"@fluidframework/runtime-utils/internal\";\n\ninterface backCompat_IFluidRouter {\n\tIFluidRouter?: backCompat_IFluidRouter;\n\trequest(request: IRequest): Promise<IResponse>;\n}\n\nconst backCompat_DefaultRouteRequestHandler = (defaultRootId: string) => {\n\treturn async (request: IRequest, runtime: IContainerRuntime) => {\n\t\tconst parser = RequestParser.create(request);\n\t\tif (parser.pathParts.length === 0) {\n\t\t\treturn (\n\t\t\t\truntime as any as Required<FluidObject<IFluidHandleContext>>\n\t\t\t).IFluidHandleContext.resolveHandle({\n\t\t\t\turl: `/${defaultRootId}${parser.query}`,\n\t\t\t\theaders: request.headers,\n\t\t\t});\n\t\t}\n\t\treturn undefined; // continue search\n\t};\n};\n\ninterface backCompat_ContainerRuntime {\n\tload(\n\t\tcontext: IContainerContext,\n\t\tregistryEntries: NamedFluidDataStoreRegistryEntries,\n\t\trequestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>,\n\t\truntimeOptions?: IContainerRuntimeOptionsInternal,\n\t\tcontainerScope?: FluidObject,\n\t\texisting?: boolean,\n\t\tcontainerRuntimeCtor?: typeof ContainerRuntime,\n\t): Promise<ContainerRuntime>;\n}\n\n/**\n * Create a container runtime factory class that allows you to set runtime options\n * @internal\n */\nexport const createTestContainerRuntimeFactory = (\n\tcontainerRuntimeCtor: typeof ContainerRuntime,\n) => {\n\treturn class extends RuntimeFactoryHelper {\n\t\tconstructor(\n\t\t\tpublic type: string,\n\t\t\tpublic dataStoreFactory: IFluidDataStoreFactory,\n\t\t\tpublic runtimeOptions: IContainerRuntimeOptionsInternal = {\n\t\t\t\tsummaryOptions: {\n\t\t\t\t\tsummaryConfigOverrides: {\n\t\t\t\t\t\t...DefaultSummaryConfiguration,\n\t\t\t\t\t\t...{\n\t\t\t\t\t\t\tinitialSummarizerDelayMs: 0,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tpublic minVersionForCollab: MinimumVersionForCollab | undefined = undefined,\n\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\tpublic requestHandlers: RuntimeRequestHandler[] = [],\n\t\t) {\n\t\t\tsuper();\n\t\t}\n\n\t\tpublic async instantiateFirstTime(runtime: ContainerRuntime): Promise<void> {\n\t\t\t// Back-compat - old code does not return IDataStore for rootContext.attachRuntime() call!\n\t\t\t// Thus need to leverage old API createDetachedRootDataStore() that is gone in latest releases.\n\t\t\tconst rootContext =\n\t\t\t\t\"createDetachedRootDataStore\" in runtime\n\t\t\t\t\t? (runtime as any).createDetachedRootDataStore([this.type], \"default\")\n\t\t\t\t\t: runtime.createDetachedDataStore([this.type]);\n\n\t\t\tconst rootRuntime = await this.dataStoreFactory.instantiateDataStore(\n\t\t\t\trootContext,\n\t\t\t\t/* existing */ false,\n\t\t\t);\n\t\t\tconst dataStore = await rootContext.attachRuntime(this.dataStoreFactory, rootRuntime);\n\n\t\t\tconst result = await dataStore?.trySetAlias(\"default\");\n\t\t\tassert(result === \"Success\" || result === undefined, \"success\");\n\t\t}\n\n\t\tpublic async instantiateFromExisting(runtime: ContainerRuntime): Promise<void> {\n\t\t\t// Validate we can load root data stores.\n\t\t\t// We should be able to load any data store that was created in initializeFirstTime!\n\t\t\t// Note: We use the deprecated `getRootDataStore` from v1.X here to allow for cross-major version compat\n\t\t\t// testing. Can be removed when we no longer support v1.X.\n\t\t\tawait (runtime.getAliasedDataStoreEntryPoint?.(\"default\") ??\n\t\t\t\t(\n\t\t\t\t\truntime as any as {\n\t\t\t\t\t\tgetRootDataStore(id: string, wait?: boolean): Promise<backCompat_IFluidRouter>;\n\t\t\t\t\t}\n\t\t\t\t).getRootDataStore(\"default\"));\n\t\t}\n\n\t\tasync preInitialize(\n\t\t\tcontext: IContainerContext,\n\t\t\texisting: boolean,\n\t\t): Promise<IRuntime & IContainerRuntime> {\n\t\t\tif (containerRuntimeCtor.loadRuntime === undefined) {\n\t\t\t\t// Note: We use the deprecated `load` from v1.X here to allow for cross-major version compat testing.\n\t\t\t\t// Can be removed when we no longer support v1.X.\n\t\t\t\treturn (containerRuntimeCtor as any as backCompat_ContainerRuntime).load(\n\t\t\t\t\tcontext,\n\t\t\t\t\t[\n\t\t\t\t\t\t[\"default\", Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t\t[this.type, Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t],\n\t\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\t\tbuildRuntimeRequestHandler(\n\t\t\t\t\t\tbackCompat_DefaultRouteRequestHandler(\"default\"),\n\t\t\t\t\t\t...this.requestHandlers,\n\t\t\t\t\t),\n\t\t\t\t\tthis.runtimeOptions,\n\t\t\t\t\tcontext.scope,\n\t\t\t\t\texisting,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst provideEntryPoint = async (runtime: IContainerRuntime) => {\n\t\t\t\tconst entryPoint = await runtime.getAliasedDataStoreEntryPoint(\"default\");\n\t\t\t\tif (entryPoint === undefined) {\n\t\t\t\t\tthrow new Error(\"default dataStore must exist\");\n\t\t\t\t}\n\t\t\t\treturn entryPoint.get();\n\t\t\t};\n\t\t\tconst getDefaultObject = async (request: IRequest, runtime: IContainerRuntime) => {\n\t\t\t\tconst parser = RequestParser.create(request);\n\t\t\t\tif (parser.pathParts.length === 0) {\n\t\t\t\t\t// This cast is safe as loadContainerRuntime is called below\n\t\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\t\treturn (runtime as IContainerRuntimeWithResolveHandle_Deprecated).resolveHandle({\n\t\t\t\t\t\turl: `/default${parser.query}`,\n\t\t\t\t\t\theaders: request.headers,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn undefined; // continue search\n\t\t\t};\n\n\t\t\t// This usage of `containerRuntimeCtor.loadRuntime`, an `@internal` API, called on past versions of this package,\n\t\t\t// adds an extra constraint that makes changing that API more difficult than it otherwise would be.\n\t\t\t// Actual customers / apps should not be dependent on stability of this API, but this code is, at least for now.\n\t\t\treturn containerRuntimeCtor.loadRuntime({\n\t\t\t\tcontext,\n\t\t\t\tregistryEntries: [\n\t\t\t\t\t[\"default\", Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t\t[this.type, Promise.resolve(this.dataStoreFactory)],\n\t\t\t\t],\n\t\t\t\t// eslint-disable-next-line import/no-deprecated\n\t\t\t\trequestHandler: buildRuntimeRequestHandler(getDefaultObject, ...this.requestHandlers),\n\t\t\t\tprovideEntryPoint,\n\t\t\t\truntimeOptions: this.runtimeOptions,\n\t\t\t\tcontainerScope: context.scope,\n\t\t\t\texisting,\n\t\t\t\tminVersionForCollab: this.minVersionForCollab,\n\t\t\t});\n\t\t}\n\t};\n};\n\n/**\n * A container runtime factory that allows you to set runtime options\n * @internal\n */\nexport const TestContainerRuntimeFactory = createTestContainerRuntimeFactory(ContainerRuntime);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/test-utils",
3
- "version": "2.70.0-360374",
3
+ "version": "2.70.0-360753",
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.70.0-360374",
71
- "@fluidframework/container-definitions": "2.70.0-360374",
72
- "@fluidframework/container-loader": "2.70.0-360374",
73
- "@fluidframework/container-runtime": "2.70.0-360374",
74
- "@fluidframework/container-runtime-definitions": "2.70.0-360374",
75
- "@fluidframework/core-interfaces": "2.70.0-360374",
76
- "@fluidframework/core-utils": "2.70.0-360374",
77
- "@fluidframework/datastore": "2.70.0-360374",
78
- "@fluidframework/datastore-definitions": "2.70.0-360374",
79
- "@fluidframework/driver-definitions": "2.70.0-360374",
80
- "@fluidframework/driver-utils": "2.70.0-360374",
81
- "@fluidframework/local-driver": "2.70.0-360374",
82
- "@fluidframework/map": "2.70.0-360374",
83
- "@fluidframework/odsp-driver": "2.70.0-360374",
84
- "@fluidframework/request-handler": "2.70.0-360374",
85
- "@fluidframework/routerlicious-driver": "2.70.0-360374",
86
- "@fluidframework/runtime-definitions": "2.70.0-360374",
87
- "@fluidframework/runtime-utils": "2.70.0-360374",
88
- "@fluidframework/shared-object-base": "2.70.0-360374",
89
- "@fluidframework/telemetry-utils": "2.70.0-360374",
70
+ "@fluid-internal/test-driver-definitions": "2.70.0-360753",
71
+ "@fluidframework/container-definitions": "2.70.0-360753",
72
+ "@fluidframework/container-loader": "2.70.0-360753",
73
+ "@fluidframework/container-runtime": "2.70.0-360753",
74
+ "@fluidframework/container-runtime-definitions": "2.70.0-360753",
75
+ "@fluidframework/core-interfaces": "2.70.0-360753",
76
+ "@fluidframework/core-utils": "2.70.0-360753",
77
+ "@fluidframework/datastore": "2.70.0-360753",
78
+ "@fluidframework/datastore-definitions": "2.70.0-360753",
79
+ "@fluidframework/driver-definitions": "2.70.0-360753",
80
+ "@fluidframework/driver-utils": "2.70.0-360753",
81
+ "@fluidframework/local-driver": "2.70.0-360753",
82
+ "@fluidframework/map": "2.70.0-360753",
83
+ "@fluidframework/odsp-driver": "2.70.0-360753",
84
+ "@fluidframework/request-handler": "2.70.0-360753",
85
+ "@fluidframework/routerlicious-driver": "2.70.0-360753",
86
+ "@fluidframework/runtime-definitions": "2.70.0-360753",
87
+ "@fluidframework/runtime-utils": "2.70.0-360753",
88
+ "@fluidframework/shared-object-base": "2.70.0-360753",
89
+ "@fluidframework/telemetry-utils": "2.70.0-360753",
90
90
  "best-random": "^1.0.0",
91
91
  "debug": "^4.3.4",
92
92
  "mocha": "^10.8.2",
@@ -95,12 +95,12 @@
95
95
  "devDependencies": {
96
96
  "@arethetypeswrong/cli": "^0.17.1",
97
97
  "@biomejs/biome": "~1.9.3",
98
- "@fluid-internal/mocha-test-setup": "2.70.0-360374",
98
+ "@fluid-internal/mocha-test-setup": "2.70.0-360753",
99
99
  "@fluid-tools/build-cli": "^0.58.3",
100
100
  "@fluidframework/build-common": "^2.0.3",
101
101
  "@fluidframework/build-tools": "^0.58.3",
102
102
  "@fluidframework/eslint-config-fluid": "^6.0.0",
103
- "@fluidframework/test-utils-previous": "npm:@fluidframework/test-utils@2.62.0",
103
+ "@fluidframework/test-utils-previous": "npm:@fluidframework/test-utils@2.63.0",
104
104
  "@microsoft/api-extractor": "7.52.11",
105
105
  "@types/debug": "^4.1.5",
106
106
  "@types/diff": "^3.5.1",
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/test-utils";
9
- export const pkgVersion = "2.70.0-360374";
9
+ export const pkgVersion = "2.70.0-360753";
@@ -8,7 +8,6 @@ import {
8
8
  ContainerRuntime,
9
9
  DefaultSummaryConfiguration,
10
10
  type IContainerRuntimeOptionsInternal,
11
- type LoadContainerRuntimeParams,
12
11
  type MinimumVersionForCollab,
13
12
  } from "@fluidframework/container-runtime/internal";
14
13
  import {
@@ -164,6 +163,10 @@ export const createTestContainerRuntimeFactory = (
164
163
  }
165
164
  return undefined; // continue search
166
165
  };
166
+
167
+ // This usage of `containerRuntimeCtor.loadRuntime`, an `@internal` API, called on past versions of this package,
168
+ // adds an extra constraint that makes changing that API more difficult than it otherwise would be.
169
+ // Actual customers / apps should not be dependent on stability of this API, but this code is, at least for now.
167
170
  return containerRuntimeCtor.loadRuntime({
168
171
  context,
169
172
  registryEntries: [
@@ -177,7 +180,7 @@ export const createTestContainerRuntimeFactory = (
177
180
  containerScope: context.scope,
178
181
  existing,
179
182
  minVersionForCollab: this.minVersionForCollab,
180
- } satisfies LoadContainerRuntimeParams);
183
+ });
181
184
  }
182
185
  };
183
186
  };