@fluidframework/request-handler 2.0.0-internal.7.3.0 → 2.0.0-internal.7.4.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # @fluidframework/request-handler
2
2
 
3
+ ## 2.0.0-internal.7.4.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.0.0-internal.7.3.0
4
8
 
5
9
  Dependency updates only.
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-lint.json",
4
+ "messages": {
5
+ "extractorMessageReporting": {
6
+ // TODO: remove once base config has this enabled as an error
7
+ "ae-incompatible-release-tags": {
8
+ "logLevel": "error",
9
+ "addToApiReportFile": false
10
+ }
11
+ }
12
+ }
13
+ }
@@ -1,4 +1,12 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "@fluidframework/build-common/api-extractor-base.json"
3
+ "extends": "../../../common/build/build-common/api-extractor-base.json",
4
+ "messages": {
5
+ "extractorMessageReporting": {
6
+ // TODO: Add missing documentation and remove this rule override
7
+ "ae-undocumented": {
8
+ "logLevel": "none"
9
+ }
10
+ }
11
+ }
4
12
  }
@@ -13,26 +13,26 @@ import { IRequest } from '@fluidframework/core-interfaces';
13
13
  import { IResponse } from '@fluidframework/core-interfaces';
14
14
  import { RequestParser } from '@fluidframework/runtime-utils';
15
15
 
16
- // @public @deprecated (undocumented)
16
+ // @internal @deprecated (undocumented)
17
17
  export function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
18
18
 
19
- // @public @deprecated (undocumented)
19
+ // @internal @deprecated (undocumented)
20
20
  export const createFluidObjectResponse: (fluidObject: FluidObject) => {
21
21
  status: 200;
22
22
  mimeType: "fluid/object";
23
23
  value: FluidObject;
24
24
  };
25
25
 
26
- // @public @deprecated (undocumented)
26
+ // @internal @deprecated (undocumented)
27
27
  export function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
28
28
 
29
- // @public @deprecated
29
+ // @internal @deprecated
30
30
  export const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
31
31
 
32
- // @public @deprecated
32
+ // @alpha @deprecated
33
33
  export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
34
34
 
35
- // @public @deprecated
35
+ // @internal @deprecated
36
36
  export class RuntimeRequestHandlerBuilder {
37
37
  // (undocumented)
38
38
  handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
@@ -0,0 +1,30 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /* Excluded from this release type: buildRuntimeRequestHandler */
11
+
12
+ /* Excluded from this release type: createFluidObjectResponse */
13
+
14
+ /* Excluded from this release type: handleFromLegacyUri */
15
+
16
+ /* Excluded from this release type: rootDataStoreRequestHandler */
17
+
18
+ /**
19
+ * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
20
+ * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
21
+ * A handler should only return error if the request is for a route the handler owns, and there is a problem with
22
+ * the route, or fulling the specific request.
23
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
24
+ * @alpha
25
+ */
26
+ export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
27
+
28
+ /* Excluded from this release type: RuntimeRequestHandlerBuilder */
29
+
30
+ export { }
@@ -0,0 +1,38 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /* Excluded from this release type: buildRuntimeRequestHandler */
11
+
12
+ /* Excluded from this release type: createFluidObjectResponse */
13
+
14
+ /* Excluded from this release type: FluidObject */
15
+
16
+ /* Excluded from this release type: handleFromLegacyUri */
17
+
18
+ /* Excluded from this release type: IContainerRuntime */
19
+
20
+ /* Excluded from this release type: IContainerRuntimeBase */
21
+
22
+ /* Excluded from this release type: IFluidHandle */
23
+
24
+ /* Excluded from this release type: IFluidLoadable */
25
+
26
+ /* Excluded from this release type: IRequest */
27
+
28
+ /* Excluded from this release type: IResponse */
29
+
30
+ /* Excluded from this release type: RequestParser */
31
+
32
+ /* Excluded from this release type: rootDataStoreRequestHandler */
33
+
34
+ /* Excluded from this release type: RuntimeRequestHandler */
35
+
36
+ /* Excluded from this release type: RuntimeRequestHandlerBuilder */
37
+
38
+ export { }
@@ -0,0 +1,38 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /* Excluded from this release type: buildRuntimeRequestHandler */
11
+
12
+ /* Excluded from this release type: createFluidObjectResponse */
13
+
14
+ /* Excluded from this release type: FluidObject */
15
+
16
+ /* Excluded from this release type: handleFromLegacyUri */
17
+
18
+ /* Excluded from this release type: IContainerRuntime */
19
+
20
+ /* Excluded from this release type: IContainerRuntimeBase */
21
+
22
+ /* Excluded from this release type: IFluidHandle */
23
+
24
+ /* Excluded from this release type: IFluidLoadable */
25
+
26
+ /* Excluded from this release type: IRequest */
27
+
28
+ /* Excluded from this release type: IResponse */
29
+
30
+ /* Excluded from this release type: RequestParser */
31
+
32
+ /* Excluded from this release type: rootDataStoreRequestHandler */
33
+
34
+ /* Excluded from this release type: RuntimeRequestHandler */
35
+
36
+ /* Excluded from this release type: RuntimeRequestHandlerBuilder */
37
+
38
+ export { }
@@ -0,0 +1,65 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /**
11
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
12
+ * @internal
13
+ */
14
+ export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
15
+
16
+ /**
17
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
18
+ * @internal
19
+ */
20
+ export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
21
+ status: 200;
22
+ mimeType: "fluid/object";
23
+ value: FluidObject;
24
+ };
25
+
26
+ /**
27
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
28
+ * @internal
29
+ */
30
+ export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
31
+
32
+ /**
33
+ * A request handler to expose access to all root data stores in the container by id.
34
+ * @param request - the request for the root data store. The first path part must be the data store's ID.
35
+ * @param runtime - the container runtime
36
+ * @returns the result of the request
37
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
38
+ * @internal
39
+ */
40
+ export declare const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
41
+
42
+ /**
43
+ * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
44
+ * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
45
+ * A handler should only return error if the request is for a route the handler owns, and there is a problem with
46
+ * the route, or fulling the specific request.
47
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
48
+ * @alpha
49
+ */
50
+ export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
51
+
52
+ /**
53
+ * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
54
+ * The provided handlers sequentially applied until one is able to satisfy the request.
55
+ *
56
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
57
+ * @internal
58
+ */
59
+ export declare class RuntimeRequestHandlerBuilder {
60
+ private readonly handlers;
61
+ pushHandler(...handlers: RuntimeRequestHandler[]): void;
62
+ handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
63
+ }
64
+
65
+ export { }
@@ -13,8 +13,7 @@ const runtime_utils_1 = require("@fluidframework/runtime-utils");
13
13
  * @param runtime - the container runtime
14
14
  * @returns the result of the request
15
15
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
16
- *
17
- * @public
16
+ * @internal
18
17
  */
19
18
  const rootDataStoreRequestHandler = async (request, runtime) => {
20
19
  const requestParser = runtime_utils_1.RequestParser.create(request);
@@ -39,8 +38,7 @@ const rootDataStoreRequestHandler = async (request, runtime) => {
39
38
  exports.rootDataStoreRequestHandler = rootDataStoreRequestHandler;
40
39
  /**
41
40
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
42
- *
43
- * @public
41
+ * @internal
44
42
  */
45
43
  const createFluidObjectResponse = (fluidObject) => {
46
44
  return { status: 200, mimeType: "fluid/object", value: fluidObject };
@@ -74,8 +72,7 @@ class LegacyUriHandle {
74
72
  }
75
73
  /**
76
74
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
77
- *
78
- * @public
75
+ * @internal
79
76
  */
80
77
  function handleFromLegacyUri(uri, runtime) {
81
78
  return new LegacyUriHandle(uri, runtime);
@@ -1 +1 @@
1
- {"version":3,"file":"requestHandlers.cjs","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAYpD,iEAA8D;AAgB9D;;;;;;;;GAQG;AACI,MAAM,2BAA2B,GAAG,KAAK,EAC/C,OAAiB,EACjB,OAA0B,EACzB,EAAE;IACH,MAAM,aAAa,GAAG,6BAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,EAAE,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,OAAO,OAAO,CAA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C,aAAa,CAAC;YACrE,GAAG,EAAE,IAAI,CAAC,YAAY;SACtB,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;YACpE,+DAA+D;YAC/D,OAAO,QAAQ,CAAC,KAAK,CAAC;SACtB;QACD,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IAC1E,CAAC;IAEM,IAAI,CAAC,MAAoB;QAC/B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACnD,CAAC;CACD;AAED;;;;GAIG;AACH,SAAgB,mBAAmB,CAClC,GAAW,EACX,OAA8B;IAE9B,OAAO,IAAI,eAAe,CAAI,GAAG,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AALD,kDAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tIResponse,\n\tIRequest,\n\tIFluidHandle,\n\tIFluidLoadable,\n\tFluidObject,\n\t// eslint-disable-next-line import/no-deprecated\n\tIFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IContainerRuntimeBase } from \"@fluidframework/runtime-definitions\";\nimport { RequestParser } from \"@fluidframework/runtime-utils\";\n\n/**\n * A request handler for the container runtime. Each handler should handle a specific request, and return undefined\n * if it does not apply. These handlers are called in series, so there may be other handlers before or after.\n * A handler should only return error if the request is for a route the handler owns, and there is a problem with\n * the route, or fulling the specific request.\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\nexport type RuntimeRequestHandler = (\n\trequest: RequestParser,\n\truntime: IContainerRuntime,\n) => Promise<IResponse | undefined>;\n\n/**\n * A request handler to expose access to all root data stores in the container by id.\n * @param request - the request for the root data store. The first path part must be the data store's ID.\n * @param runtime - the container runtime\n * @returns the result of the request\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\nexport const rootDataStoreRequestHandler = async (\n\trequest: IRequest,\n\truntime: IContainerRuntime,\n) => {\n\tconst requestParser = RequestParser.create(request);\n\tconst id = requestParser.pathParts[0];\n\tconst wait = typeof request.headers?.wait === \"boolean\" ? request.headers.wait : undefined;\n\t// eslint-disable-next-line import/no-deprecated\n\tlet rootDataStore: IFluidRouter;\n\ttry {\n\t\t// getRootDataStore currently throws if the data store is not found\n\t\trootDataStore = await runtime.getRootDataStore(id, wait);\n\t} catch (error) {\n\t\treturn undefined; // continue search\n\t}\n\ttry {\n\t\treturn await rootDataStore.IFluidRouter.request(requestParser.createSubRequest(1));\n\t} catch (error) {\n\t\treturn { status: 500, mimeType: \"fluid/object\", value: error };\n\t}\n};\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\nexport const createFluidObjectResponse = (\n\tfluidObject: FluidObject,\n): { status: 200; mimeType: \"fluid/object\"; value: FluidObject } => {\n\treturn { status: 200, mimeType: \"fluid/object\", value: fluidObject };\n};\n\nclass LegacyUriHandle<T = FluidObject & IFluidLoadable> implements IFluidHandle<T> {\n\tpublic readonly isAttached = true;\n\n\tpublic get IFluidHandle(): IFluidHandle {\n\t\treturn this;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly absolutePath,\n\t\tpublic readonly runtime: IContainerRuntimeBase,\n\t) {}\n\n\tpublic attachGraph() {\n\t\tassert(false, 0x0ca /* \"Trying to use legacy graph attach!\" */);\n\t}\n\n\tpublic async get(): Promise<any> {\n\t\tconst response = await this.runtime.IFluidHandleContext.resolveHandle({\n\t\t\turl: this.absolutePath,\n\t\t});\n\t\tif (response.status === 200 && response.mimeType === \"fluid/object\") {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\treturn response.value;\n\t\t}\n\t\tthrow new Error(`Failed to resolve container path ${this.absolutePath}`);\n\t}\n\n\tpublic bind(handle: IFluidHandle) {\n\t\tthrow new Error(\"Cannot bind to LegacyUriHandle\");\n\t}\n}\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\nexport function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(\n\turi: string,\n\truntime: IContainerRuntimeBase,\n): IFluidHandle<T> {\n\treturn new LegacyUriHandle<T>(uri, runtime);\n}\n"]}
1
+ {"version":3,"file":"requestHandlers.cjs","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAYpD,iEAA8D;AAe9D;;;;;;;GAOG;AACI,MAAM,2BAA2B,GAAG,KAAK,EAC/C,OAAiB,EACjB,OAA0B,EACzB,EAAE;IACH,MAAM,aAAa,GAAG,6BAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,EAAE,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,gDAAgD;IAChD,IAAI,aAA2B,CAAC;IAChC,IAAI;QACH,mEAAmE;QACnE,aAAa,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;KACzD;IAAC,OAAO,KAAK,EAAE;QACf,OAAO,SAAS,CAAC,CAAC,kBAAkB;KACpC;IACD,IAAI;QACH,OAAO,MAAM,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CA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GG;AACH,SAAgB,mBAAmB,CAClC,GAAW,EACX,OAA8B;IAE9B,OAAO,IAAI,eAAe,CAAI,GAAG,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AALD,kDAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tIResponse,\n\tIRequest,\n\tIFluidHandle,\n\tIFluidLoadable,\n\tFluidObject,\n\t// eslint-disable-next-line import/no-deprecated\n\tIFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IContainerRuntimeBase } from \"@fluidframework/runtime-definitions\";\nimport { RequestParser } from \"@fluidframework/runtime-utils\";\n\n/**\n * A request handler for the container runtime. Each handler should handle a specific request, and return undefined\n * if it does not apply. These handlers are called in series, so there may be other handlers before or after.\n * A handler should only return error if the request is for a route the handler owns, and there is a problem with\n * the route, or fulling the specific request.\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @alpha\n */\nexport type RuntimeRequestHandler = (\n\trequest: RequestParser,\n\truntime: IContainerRuntime,\n) => Promise<IResponse | undefined>;\n\n/**\n * A request handler to expose access to all root data stores in the container by id.\n * @param request - the request for the root data store. The first path part must be the data store's ID.\n * @param runtime - the container runtime\n * @returns the result of the request\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\nexport const rootDataStoreRequestHandler = async (\n\trequest: IRequest,\n\truntime: IContainerRuntime,\n) => {\n\tconst requestParser = RequestParser.create(request);\n\tconst id = requestParser.pathParts[0];\n\tconst wait = typeof request.headers?.wait === \"boolean\" ? request.headers.wait : undefined;\n\t// eslint-disable-next-line import/no-deprecated\n\tlet rootDataStore: IFluidRouter;\n\ttry {\n\t\t// getRootDataStore currently throws if the data store is not found\n\t\trootDataStore = await runtime.getRootDataStore(id, wait);\n\t} catch (error) {\n\t\treturn undefined; // continue search\n\t}\n\ttry {\n\t\treturn await rootDataStore.IFluidRouter.request(requestParser.createSubRequest(1));\n\t} catch (error) {\n\t\treturn { status: 500, mimeType: \"fluid/object\", value: error };\n\t}\n};\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\nexport const createFluidObjectResponse = (\n\tfluidObject: FluidObject,\n): { status: 200; mimeType: \"fluid/object\"; value: FluidObject } => {\n\treturn { status: 200, mimeType: \"fluid/object\", value: fluidObject };\n};\n\nclass LegacyUriHandle<T = FluidObject & IFluidLoadable> implements IFluidHandle<T> {\n\tpublic readonly isAttached = true;\n\n\tpublic get IFluidHandle(): IFluidHandle {\n\t\treturn this;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly absolutePath,\n\t\tpublic readonly runtime: IContainerRuntimeBase,\n\t) {}\n\n\tpublic attachGraph() {\n\t\tassert(false, 0x0ca /* \"Trying to use legacy graph attach!\" */);\n\t}\n\n\tpublic async get(): Promise<any> {\n\t\tconst response = await this.runtime.IFluidHandleContext.resolveHandle({\n\t\t\turl: this.absolutePath,\n\t\t});\n\t\tif (response.status === 200 && response.mimeType === \"fluid/object\") {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\treturn response.value;\n\t\t}\n\t\tthrow new Error(`Failed to resolve container path ${this.absolutePath}`);\n\t}\n\n\tpublic bind(handle: IFluidHandle) {\n\t\tthrow new Error(\"Cannot bind to LegacyUriHandle\");\n\t}\n}\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\nexport function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(\n\turi: string,\n\truntime: IContainerRuntimeBase,\n): IFluidHandle<T> {\n\treturn new LegacyUriHandle<T>(uri, runtime);\n}\n"]}
@@ -12,8 +12,7 @@ import { RequestParser } from "@fluidframework/runtime-utils";
12
12
  * A handler should only return error if the request is for a route the handler owns, and there is a problem with
13
13
  * the route, or fulling the specific request.
14
14
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
15
- *
16
- * @public
15
+ * @alpha
17
16
  */
18
17
  export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
19
18
  /**
@@ -22,14 +21,12 @@ export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainer
22
21
  * @param runtime - the container runtime
23
22
  * @returns the result of the request
24
23
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
25
- *
26
- * @public
24
+ * @internal
27
25
  */
28
26
  export declare const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
29
27
  /**
30
28
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
31
- *
32
- * @public
29
+ * @internal
33
30
  */
34
31
  export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
35
32
  status: 200;
@@ -38,8 +35,7 @@ export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
38
35
  };
39
36
  /**
40
37
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
41
- *
42
- * @public
38
+ * @internal
43
39
  */
44
40
  export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
45
41
  //# sourceMappingURL=requestHandlers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,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O,EAAE,iBAAiB,KACtB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAEpC;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,YAC9B,QAAQ,WACR,iBAAiB,mCAkB1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,gBACxB,WAAW,KACtB;IAAE,QAAQ,GAAG,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAE7D,CAAC;AAkCF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,GAAG,WAAW,GAAG,cAAc,EACnE,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,qBAAqB,GAC5B,YAAY,CAAC,CAAC,CAAC,CAEjB"}
@@ -11,8 +11,7 @@ const runtime_utils_1 = require("@fluidframework/runtime-utils");
11
11
  * The provided handlers sequentially applied until one is able to satisfy the request.
12
12
  *
13
13
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
14
- *
15
- * @public
14
+ * @internal
16
15
  */
17
16
  class RuntimeRequestHandlerBuilder {
18
17
  constructor() {
@@ -39,8 +38,7 @@ class RuntimeRequestHandlerBuilder {
39
38
  exports.RuntimeRequestHandlerBuilder = RuntimeRequestHandlerBuilder;
40
39
  /**
41
40
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
42
- *
43
- * @public
41
+ * @internal
44
42
  */
45
43
  // eslint-disable-next-line import/no-deprecated
46
44
  function buildRuntimeRequestHandler(...handlers) {
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeRequestHandlerBuilder.cjs","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,iEAAiF;AAIjF;;;;;;;GAOG;AACH,MAAa,4BAA4B;IAAzC;QACC,gDAAgD;QAC/B,aAAQ,GAA4B,EAAE,CAAC;IAmBzD,CAAC;IAjBA,gDAAgD;IACzC,WAAW,CAAC,GAAG,QAAiC;QACtD,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC3B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;SAChC;IACF,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,OAAiB,EAAE,OAA0B;QACvE,MAAM,MAAM,GAAG,6BAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;YACpC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,QAAQ,KAAK,SAAS,EAAE;gBAC3B,OAAO,QAAQ,CAAC;aAChB;SACD;QACD,OAAO,IAAA,iCAAiB,EAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACD;AArBD,oEAqBC;AAED;;;;GAIG;AACH,gDAAgD;AAChD,SAAgB,0BAA0B,CAAC,GAAG,QAAiC;IAC9E,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;IACnD,OAAO,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC;IACjC,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE,CAC9D,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AALD,gEAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils\";\n// eslint-disable-next-line import/no-deprecated\nimport { RuntimeRequestHandler } from \"./requestHandlers\";\n\n/**\n * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.\n * The provided handlers sequentially applied until one is able to satisfy the request.\n *\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\nexport class RuntimeRequestHandlerBuilder {\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly handlers: RuntimeRequestHandler[] = [];\n\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic pushHandler(...handlers: RuntimeRequestHandler[]) {\n\t\tif (handlers !== undefined) {\n\t\t\tthis.handlers.push(...handlers);\n\t\t}\n\t}\n\n\tpublic async handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse> {\n\t\tconst parser = RequestParser.create(request);\n\t\tfor (const handler of this.handlers) {\n\t\t\tconst response = await handler(parser, runtime);\n\t\t\tif (response !== undefined) {\n\t\t\t\treturn response;\n\t\t\t}\n\t\t}\n\t\treturn create404Response(request);\n\t}\n}\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\n// eslint-disable-next-line import/no-deprecated\nexport function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]) {\n\tconst builder = new RuntimeRequestHandlerBuilder();\n\tbuilder.pushHandler(...handlers);\n\treturn async (request: IRequest, runtime: IContainerRuntime) =>\n\t\tbuilder.handleRequest(request, runtime);\n}\n"]}
1
+ {"version":3,"file":"runtimeRequestHandlerBuilder.cjs","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,iEAAiF;AAIjF;;;;;;GAMG;AACH,MAAa,4BAA4B;IAAzC;QACC,gDAAgD;QAC/B,aAAQ,GAA4B,EAAE,CAAC;IAmBzD,CAAC;IAjBA,gDAAgD;IACzC,WAAW,CAAC,GAAG,QAAiC;QACtD,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC3B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;SAChC;IACF,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,OAAiB,EAAE,OAA0B;QACvE,MAAM,MAAM,GAAG,6BAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;YACpC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,QAAQ,KAAK,SAAS,EAAE;gBAC3B,OAAO,QAAQ,CAAC;aAChB;SACD;QACD,OAAO,IAAA,iCAAiB,EAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACD;AArBD,oEAqBC;AAED;;;GAGG;AACH,gDAAgD;AAChD,SAAgB,0BAA0B,CAAC,GAAG,QAAiC;IAC9E,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;IACnD,OAAO,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC;IACjC,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE,CAC9D,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AALD,gEAKC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils\";\n// eslint-disable-next-line import/no-deprecated\nimport { RuntimeRequestHandler } from \"./requestHandlers\";\n\n/**\n * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.\n * The provided handlers sequentially applied until one is able to satisfy the request.\n *\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\nexport class RuntimeRequestHandlerBuilder {\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly handlers: RuntimeRequestHandler[] = [];\n\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic pushHandler(...handlers: RuntimeRequestHandler[]) {\n\t\tif (handlers !== undefined) {\n\t\t\tthis.handlers.push(...handlers);\n\t\t}\n\t}\n\n\tpublic async handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse> {\n\t\tconst parser = RequestParser.create(request);\n\t\tfor (const handler of this.handlers) {\n\t\t\tconst response = await handler(parser, runtime);\n\t\t\tif (response !== undefined) {\n\t\t\t\treturn response;\n\t\t\t}\n\t\t}\n\t\treturn create404Response(request);\n\t}\n}\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\n// eslint-disable-next-line import/no-deprecated\nexport function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]) {\n\tconst builder = new RuntimeRequestHandlerBuilder();\n\tbuilder.pushHandler(...handlers);\n\treturn async (request: IRequest, runtime: IContainerRuntime) =>\n\t\tbuilder.handleRequest(request, runtime);\n}\n"]}
@@ -10,8 +10,7 @@ import { RuntimeRequestHandler } from "./requestHandlers";
10
10
  * The provided handlers sequentially applied until one is able to satisfy the request.
11
11
  *
12
12
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
13
- *
14
- * @public
13
+ * @internal
15
14
  */
16
15
  export declare class RuntimeRequestHandlerBuilder {
17
16
  private readonly handlers;
@@ -20,8 +19,7 @@ export declare class RuntimeRequestHandlerBuilder {
20
19
  }
21
20
  /**
22
21
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
23
- *
24
- * @public
22
+ * @internal
25
23
  */
26
24
  export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
27
25
  //# sourceMappingURL=runtimeRequestHandlerBuilder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeRequestHandlerBuilder.d.ts","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAGlF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;GAOG;AACH,qBAAa,4BAA4B;IAExC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+B;IAGjD,WAAW,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE;IAM1C,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC;CAU7F;AAED;;;;GAIG;AAEH,wBAAgB,0BAA0B,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,aAGvD,QAAQ,WAAW,iBAAiB,wBAE3D"}
1
+ {"version":3,"file":"runtimeRequestHandlerBuilder.d.ts","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAGlF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;GAMG;AACH,qBAAa,4BAA4B;IAExC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+B;IAGjD,WAAW,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE;IAM1C,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC;CAU7F;AAED;;;GAGG;AAEH,wBAAgB,0BAA0B,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,aAGvD,QAAQ,WAAW,iBAAiB,wBAE3D"}
package/lib/index.d.ts CHANGED
@@ -2,6 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { createFluidObjectResponse, handleFromLegacyUri, rootDataStoreRequestHandler, RuntimeRequestHandler, } from "./requestHandlers";
6
- export { buildRuntimeRequestHandler, RuntimeRequestHandlerBuilder, } from "./runtimeRequestHandlerBuilder";
5
+ export { createFluidObjectResponse, handleFromLegacyUri, rootDataStoreRequestHandler, RuntimeRequestHandler, } from "./requestHandlers.mjs";
6
+ export { buildRuntimeRequestHandler, RuntimeRequestHandlerBuilder, } from "./runtimeRequestHandlerBuilder.mjs";
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,0BAA0B,EAC1B,4BAA4B,GAC5B,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,GACrB;OACM,EACN,0BAA0B,EAC1B,4BAA4B,GAC5B"}
@@ -0,0 +1,30 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /* Excluded from this release type: buildRuntimeRequestHandler */
11
+
12
+ /* Excluded from this release type: createFluidObjectResponse */
13
+
14
+ /* Excluded from this release type: handleFromLegacyUri */
15
+
16
+ /* Excluded from this release type: rootDataStoreRequestHandler */
17
+
18
+ /**
19
+ * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
20
+ * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
21
+ * A handler should only return error if the request is for a route the handler owns, and there is a problem with
22
+ * the route, or fulling the specific request.
23
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
24
+ * @alpha
25
+ */
26
+ export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
27
+
28
+ /* Excluded from this release type: RuntimeRequestHandlerBuilder */
29
+
30
+ export { }
@@ -0,0 +1,38 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /* Excluded from this release type: buildRuntimeRequestHandler */
11
+
12
+ /* Excluded from this release type: createFluidObjectResponse */
13
+
14
+ /* Excluded from this release type: FluidObject */
15
+
16
+ /* Excluded from this release type: handleFromLegacyUri */
17
+
18
+ /* Excluded from this release type: IContainerRuntime */
19
+
20
+ /* Excluded from this release type: IContainerRuntimeBase */
21
+
22
+ /* Excluded from this release type: IFluidHandle */
23
+
24
+ /* Excluded from this release type: IFluidLoadable */
25
+
26
+ /* Excluded from this release type: IRequest */
27
+
28
+ /* Excluded from this release type: IResponse */
29
+
30
+ /* Excluded from this release type: RequestParser */
31
+
32
+ /* Excluded from this release type: rootDataStoreRequestHandler */
33
+
34
+ /* Excluded from this release type: RuntimeRequestHandler */
35
+
36
+ /* Excluded from this release type: RuntimeRequestHandlerBuilder */
37
+
38
+ export { }
@@ -0,0 +1,38 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /* Excluded from this release type: buildRuntimeRequestHandler */
11
+
12
+ /* Excluded from this release type: createFluidObjectResponse */
13
+
14
+ /* Excluded from this release type: FluidObject */
15
+
16
+ /* Excluded from this release type: handleFromLegacyUri */
17
+
18
+ /* Excluded from this release type: IContainerRuntime */
19
+
20
+ /* Excluded from this release type: IContainerRuntimeBase */
21
+
22
+ /* Excluded from this release type: IFluidHandle */
23
+
24
+ /* Excluded from this release type: IFluidLoadable */
25
+
26
+ /* Excluded from this release type: IRequest */
27
+
28
+ /* Excluded from this release type: IResponse */
29
+
30
+ /* Excluded from this release type: RequestParser */
31
+
32
+ /* Excluded from this release type: rootDataStoreRequestHandler */
33
+
34
+ /* Excluded from this release type: RuntimeRequestHandler */
35
+
36
+ /* Excluded from this release type: RuntimeRequestHandlerBuilder */
37
+
38
+ export { }
@@ -0,0 +1,65 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /**
11
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
12
+ * @internal
13
+ */
14
+ export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
15
+
16
+ /**
17
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
18
+ * @internal
19
+ */
20
+ export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
21
+ status: 200;
22
+ mimeType: "fluid/object";
23
+ value: FluidObject;
24
+ };
25
+
26
+ /**
27
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
28
+ * @internal
29
+ */
30
+ export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
31
+
32
+ /**
33
+ * A request handler to expose access to all root data stores in the container by id.
34
+ * @param request - the request for the root data store. The first path part must be the data store's ID.
35
+ * @param runtime - the container runtime
36
+ * @returns the result of the request
37
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
38
+ * @internal
39
+ */
40
+ export declare const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
41
+
42
+ /**
43
+ * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
44
+ * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
45
+ * A handler should only return error if the request is for a route the handler owns, and there is a problem with
46
+ * the route, or fulling the specific request.
47
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
48
+ * @alpha
49
+ */
50
+ export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
51
+
52
+ /**
53
+ * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
54
+ * The provided handlers sequentially applied until one is able to satisfy the request.
55
+ *
56
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
57
+ * @internal
58
+ */
59
+ export declare class RuntimeRequestHandlerBuilder {
60
+ private readonly handlers;
61
+ pushHandler(...handlers: RuntimeRequestHandler[]): void;
62
+ handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
63
+ }
64
+
65
+ export { }
@@ -12,8 +12,7 @@ import { RequestParser } from "@fluidframework/runtime-utils";
12
12
  * A handler should only return error if the request is for a route the handler owns, and there is a problem with
13
13
  * the route, or fulling the specific request.
14
14
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
15
- *
16
- * @public
15
+ * @alpha
17
16
  */
18
17
  export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
19
18
  /**
@@ -22,14 +21,12 @@ export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainer
22
21
  * @param runtime - the container runtime
23
22
  * @returns the result of the request
24
23
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
25
- *
26
- * @public
24
+ * @internal
27
25
  */
28
26
  export declare const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
29
27
  /**
30
28
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
31
- *
32
- * @public
29
+ * @internal
33
30
  */
34
31
  export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
35
32
  status: 200;
@@ -38,8 +35,7 @@ export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
38
35
  };
39
36
  /**
40
37
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
41
- *
42
- * @public
38
+ * @internal
43
39
  */
44
40
  export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
45
41
  //# sourceMappingURL=requestHandlers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,WAAW,EAGX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,iBAAiB,KACtB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAEpC;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,YAC9B,QAAQ,WACR,iBAAiB,mCAkB1B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,gBACxB,WAAW,KACtB;IAAE,QAAQ,GAAG,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAE7D,CAAC;AAkCF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,GAAG,WAAW,GAAG,cAAc,EACnE,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,qBAAqB,GAC5B,YAAY,CAAC,CAAC,CAAC,CAEjB"}
1
+ {"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EACN,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,WAAW,EAGX,MAAM,iCAAiC;OACjC,EAAE,iBAAiB,EAAE,MAAM,+CAA+C;OAC1E,EAAE,qBAAqB,EAAE,MAAM,qCAAqC;OACpE,EAAE,aAAa,EAAE,MAAM,+BAA+B;AAE7D;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,iBAAiB,KACtB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAEpC;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,YAC9B,QAAQ,WACR,iBAAiB,mCAkB1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,gBACxB,WAAW,KACtB;IAAE,QAAQ,GAAG,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAE7D,CAAC;AAkCF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,GAAG,WAAW,GAAG,cAAc,EACnE,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,qBAAqB,GAC5B,YAAY,CAAC,CAAC,CAAC,CAEjB"}
@@ -10,8 +10,7 @@ import { RequestParser } from "@fluidframework/runtime-utils";
10
10
  * @param runtime - the container runtime
11
11
  * @returns the result of the request
12
12
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
13
- *
14
- * @public
13
+ * @internal
15
14
  */
16
15
  export const rootDataStoreRequestHandler = async (request, runtime) => {
17
16
  const requestParser = RequestParser.create(request);
@@ -35,8 +34,7 @@ export const rootDataStoreRequestHandler = async (request, runtime) => {
35
34
  };
36
35
  /**
37
36
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
38
- *
39
- * @public
37
+ * @internal
40
38
  */
41
39
  export const createFluidObjectResponse = (fluidObject) => {
42
40
  return { status: 200, mimeType: "fluid/object", value: fluidObject };
@@ -69,8 +67,7 @@ class LegacyUriHandle {
69
67
  }
70
68
  /**
71
69
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
72
- *
73
- * @public
70
+ * @internal
74
71
  */
75
72
  export function handleFromLegacyUri(uri, runtime) {
76
73
  return new LegacyUriHandle(uri, runtime);
@@ -1 +1 @@
1
- {"version":3,"file":"requestHandlers.mjs","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,MAAM,EAAE,MAAM,4BAA4B;OAY5C,EAAE,aAAa,EAAE,MAAM,+BAA+B;AAgB7D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,EAC/C,OAAiB,EACjB,OAA0B,EACzB,EAAE;IACH,MAAM,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,EAAE,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,OAAO,OAAO,CAAC,OAAO,EAAE,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,gDAAgD;IAChD,IAAI,aAA2B,CAAC;IAChC,IAAI;QACH,mEAAmE;QACnE,aAAa,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;KACzD;IAAC,OAAO,KAAK,EAAE;QACf,OAAO,SAAS,CAAC,CAAC,kBAAkB;KACpC;IACD,IAAI;QACH,O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;GAIG;AACH,MAAM,UAAU,mBAAmB,CAClC,GAAW,EACX,OAA8B;IAE9B,OAAO,IAAI,eAAe,CAAI,GAAG,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tIResponse,\n\tIRequest,\n\tIFluidHandle,\n\tIFluidLoadable,\n\tFluidObject,\n\t// eslint-disable-next-line import/no-deprecated\n\tIFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IContainerRuntimeBase } from \"@fluidframework/runtime-definitions\";\nimport { RequestParser } from \"@fluidframework/runtime-utils\";\n\n/**\n * A request handler for the container runtime. Each handler should handle a specific request, and return undefined\n * if it does not apply. These handlers are called in series, so there may be other handlers before or after.\n * A handler should only return error if the request is for a route the handler owns, and there is a problem with\n * the route, or fulling the specific request.\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\nexport type RuntimeRequestHandler = (\n\trequest: RequestParser,\n\truntime: IContainerRuntime,\n) => Promise<IResponse | undefined>;\n\n/**\n * A request handler to expose access to all root data stores in the container by id.\n * @param request - the request for the root data store. The first path part must be the data store's ID.\n * @param runtime - the container runtime\n * @returns the result of the request\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\nexport const rootDataStoreRequestHandler = async (\n\trequest: IRequest,\n\truntime: IContainerRuntime,\n) => {\n\tconst requestParser = RequestParser.create(request);\n\tconst id = requestParser.pathParts[0];\n\tconst wait = typeof request.headers?.wait === \"boolean\" ? request.headers.wait : undefined;\n\t// eslint-disable-next-line import/no-deprecated\n\tlet rootDataStore: IFluidRouter;\n\ttry {\n\t\t// getRootDataStore currently throws if the data store is not found\n\t\trootDataStore = await runtime.getRootDataStore(id, wait);\n\t} catch (error) {\n\t\treturn undefined; // continue search\n\t}\n\ttry {\n\t\treturn await rootDataStore.IFluidRouter.request(requestParser.createSubRequest(1));\n\t} catch (error) {\n\t\treturn { status: 500, mimeType: \"fluid/object\", value: error };\n\t}\n};\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\nexport const createFluidObjectResponse = (\n\tfluidObject: FluidObject,\n): { status: 200; mimeType: \"fluid/object\"; value: FluidObject } => {\n\treturn { status: 200, mimeType: \"fluid/object\", value: fluidObject };\n};\n\nclass LegacyUriHandle<T = FluidObject & IFluidLoadable> implements IFluidHandle<T> {\n\tpublic readonly isAttached = true;\n\n\tpublic get IFluidHandle(): IFluidHandle {\n\t\treturn this;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly absolutePath,\n\t\tpublic readonly runtime: IContainerRuntimeBase,\n\t) {}\n\n\tpublic attachGraph() {\n\t\tassert(false, 0x0ca /* \"Trying to use legacy graph attach!\" */);\n\t}\n\n\tpublic async get(): Promise<any> {\n\t\tconst response = await this.runtime.IFluidHandleContext.resolveHandle({\n\t\t\turl: this.absolutePath,\n\t\t});\n\t\tif (response.status === 200 && response.mimeType === \"fluid/object\") {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\treturn response.value;\n\t\t}\n\t\tthrow new Error(`Failed to resolve container path ${this.absolutePath}`);\n\t}\n\n\tpublic bind(handle: IFluidHandle) {\n\t\tthrow new Error(\"Cannot bind to LegacyUriHandle\");\n\t}\n}\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\nexport function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(\n\turi: string,\n\truntime: IContainerRuntimeBase,\n): IFluidHandle<T> {\n\treturn new L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W,EAAE,CAAC;AACtE,CAAC,CAAC;AAEF,MAAM,eAAe;IAGpB,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,YACiB,YAAY,EACZ,OAA8B;QAD9B,iBAAY,GAAZ,YAAY,CAAA;QACZ,YAAO,GAAP,OAAO,CAAuB;QAR/B,eAAU,GAAG,IAAI,CAAC;IAS/B,CAAC;IAEG,WAAW;QACjB,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,GAAG;QACf,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC;YACrE,GAAG,EAAE,IAAI,CAAC,YAAY;SACtB,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;YACpE,+DAA+D;YAC/D,OAAO,QAAQ,CAAC,KAAK,CAAC;SACtB;QACD,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IAC1E,CAAC;IAEM,IAAI,CAAC,MAAoB;QAC/B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACnD,CAAC;CACD;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAClC,GAAW,EACX,OAA8B;IAE9B,OAAO,IAAI,eAAe,CAAI,GAAG,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils\";\nimport {\n\tIResponse,\n\tIRequest,\n\tIFluidHandle,\n\tIFluidLoadable,\n\tFluidObject,\n\t// eslint-disable-next-line import/no-deprecated\n\tIFluidRouter,\n} from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { IContainerRuntimeBase } from \"@fluidframework/runtime-definitions\";\nimport { RequestParser } from \"@fluidframework/runtime-utils\";\n\n/**\n * A request handler for the container runtime. Each handler should handle a specific request, and return undefined\n * if it does not apply. These handlers are called in series, so there may be other handlers before or after.\n * A handler should only return error if the request is for a route the handler owns, and there is a problem with\n * the route, or fulling the specific request.\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @alpha\n */\nexport type RuntimeRequestHandler = (\n\trequest: RequestParser,\n\truntime: IContainerRuntime,\n) => Promise<IResponse | undefined>;\n\n/**\n * A request handler to expose access to all root data stores in the container by id.\n * @param request - the request for the root data store. The first path part must be the data store's ID.\n * @param runtime - the container runtime\n * @returns the result of the request\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\nexport const rootDataStoreRequestHandler = async (\n\trequest: IRequest,\n\truntime: IContainerRuntime,\n) => {\n\tconst requestParser = RequestParser.create(request);\n\tconst id = requestParser.pathParts[0];\n\tconst wait = typeof request.headers?.wait === \"boolean\" ? request.headers.wait : undefined;\n\t// eslint-disable-next-line import/no-deprecated\n\tlet rootDataStore: IFluidRouter;\n\ttry {\n\t\t// getRootDataStore currently throws if the data store is not found\n\t\trootDataStore = await runtime.getRootDataStore(id, wait);\n\t} catch (error) {\n\t\treturn undefined; // continue search\n\t}\n\ttry {\n\t\treturn await rootDataStore.IFluidRouter.request(requestParser.createSubRequest(1));\n\t} catch (error) {\n\t\treturn { status: 500, mimeType: \"fluid/object\", value: error };\n\t}\n};\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\nexport const createFluidObjectResponse = (\n\tfluidObject: FluidObject,\n): { status: 200; mimeType: \"fluid/object\"; value: FluidObject } => {\n\treturn { status: 200, mimeType: \"fluid/object\", value: fluidObject };\n};\n\nclass LegacyUriHandle<T = FluidObject & IFluidLoadable> implements IFluidHandle<T> {\n\tpublic readonly isAttached = true;\n\n\tpublic get IFluidHandle(): IFluidHandle {\n\t\treturn this;\n\t}\n\n\tpublic constructor(\n\t\tpublic readonly absolutePath,\n\t\tpublic readonly runtime: IContainerRuntimeBase,\n\t) {}\n\n\tpublic attachGraph() {\n\t\tassert(false, 0x0ca /* \"Trying to use legacy graph attach!\" */);\n\t}\n\n\tpublic async get(): Promise<any> {\n\t\tconst response = await this.runtime.IFluidHandleContext.resolveHandle({\n\t\t\turl: this.absolutePath,\n\t\t});\n\t\tif (response.status === 200 && response.mimeType === \"fluid/object\") {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\t\treturn response.value;\n\t\t}\n\t\tthrow new Error(`Failed to resolve container path ${this.absolutePath}`);\n\t}\n\n\tpublic bind(handle: IFluidHandle) {\n\t\tthrow new Error(\"Cannot bind to LegacyUriHandle\");\n\t}\n}\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\nexport function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(\n\turi: string,\n\truntime: IContainerRuntimeBase,\n): IFluidHandle<T> {\n\treturn new LegacyUriHandle<T>(uri, runtime);\n}\n"]}
@@ -4,14 +4,13 @@
4
4
  */
5
5
  import { IRequest, IResponse } from "@fluidframework/core-interfaces";
6
6
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
7
- import { RuntimeRequestHandler } from "./requestHandlers";
7
+ import { RuntimeRequestHandler } from "./requestHandlers.mjs";
8
8
  /**
9
9
  * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
10
10
  * The provided handlers sequentially applied until one is able to satisfy the request.
11
11
  *
12
12
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
13
- *
14
- * @public
13
+ * @internal
15
14
  */
16
15
  export declare class RuntimeRequestHandlerBuilder {
17
16
  private readonly handlers;
@@ -20,8 +19,7 @@ export declare class RuntimeRequestHandlerBuilder {
20
19
  }
21
20
  /**
22
21
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
23
- *
24
- * @public
22
+ * @internal
25
23
  */
26
24
  export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
27
25
  //# sourceMappingURL=runtimeRequestHandlerBuilder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeRequestHandlerBuilder.d.ts","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAGlF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;GAOG;AACH,qBAAa,4BAA4B;IAExC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+B;IAGjD,WAAW,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE;IAM1C,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC;CAU7F;AAED;;;;GAIG;AAEH,wBAAgB,0BAA0B,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,aAGvD,QAAQ,WAAW,iBAAiB,wBAE3D"}
1
+ {"version":3,"file":"runtimeRequestHandlerBuilder.d.ts","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC;OAC9D,EAAE,iBAAiB,EAAE,MAAM,+CAA+C;OAG1E,EAAE,qBAAqB,EAAE;AAEhC;;;;;;GAMG;AACH,qBAAa,4BAA4B;IAExC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+B;IAGjD,WAAW,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE;IAM1C,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC;CAU7F;AAED;;;GAGG;AAEH,wBAAgB,0BAA0B,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,aAGvD,QAAQ,WAAW,iBAAiB,wBAE3D"}
@@ -8,8 +8,7 @@ import { RequestParser, create404Response } from "@fluidframework/runtime-utils"
8
8
  * The provided handlers sequentially applied until one is able to satisfy the request.
9
9
  *
10
10
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
11
- *
12
- * @public
11
+ * @internal
13
12
  */
14
13
  export class RuntimeRequestHandlerBuilder {
15
14
  constructor() {
@@ -35,8 +34,7 @@ export class RuntimeRequestHandlerBuilder {
35
34
  }
36
35
  /**
37
36
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
38
- *
39
- * @public
37
+ * @internal
40
38
  */
41
39
  // eslint-disable-next-line import/no-deprecated
42
40
  export function buildRuntimeRequestHandler(...handlers) {
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeRequestHandlerBuilder.mjs","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAII,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+BAA+B;AAIhF;;;;;;;GAOG;AACH,MAAM,OAAO,4BAA4B;IAAzC;QACC,gDAAgD;QAC/B,aAAQ,GAA4B,EAAE,CAAC;IAmBzD,CAAC;IAjBA,gDAAgD;IACzC,WAAW,CAAC,GAAG,QAAiC;QACtD,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC3B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;SAChC;IACF,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,OAAiB,EAAE,OAA0B;QACvE,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;YACpC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,QAAQ,KAAK,SAAS,EAAE;gBAC3B,OAAO,QAAQ,CAAC;aAChB;SACD;QACD,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACD;AAED;;;;GAIG;AACH,gDAAgD;AAChD,MAAM,UAAU,0BAA0B,CAAC,GAAG,QAAiC;IAC9E,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;IACnD,OAAO,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC;IACjC,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE,CAC9D,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils\";\n// eslint-disable-next-line import/no-deprecated\nimport { RuntimeRequestHandler } from \"./requestHandlers\";\n\n/**\n * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.\n * The provided handlers sequentially applied until one is able to satisfy the request.\n *\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\nexport class RuntimeRequestHandlerBuilder {\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly handlers: RuntimeRequestHandler[] = [];\n\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic pushHandler(...handlers: RuntimeRequestHandler[]) {\n\t\tif (handlers !== undefined) {\n\t\t\tthis.handlers.push(...handlers);\n\t\t}\n\t}\n\n\tpublic async handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse> {\n\t\tconst parser = RequestParser.create(request);\n\t\tfor (const handler of this.handlers) {\n\t\t\tconst response = await handler(parser, runtime);\n\t\t\tif (response !== undefined) {\n\t\t\t\treturn response;\n\t\t\t}\n\t\t}\n\t\treturn create404Response(request);\n\t}\n}\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @public\n */\n// eslint-disable-next-line import/no-deprecated\nexport function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]) {\n\tconst builder = new RuntimeRequestHandlerBuilder();\n\tbuilder.pushHandler(...handlers);\n\treturn async (request: IRequest, runtime: IContainerRuntime) =>\n\t\tbuilder.handleRequest(request, runtime);\n}\n"]}
1
+ {"version":3,"file":"runtimeRequestHandlerBuilder.mjs","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAII,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+BAA+B;AAIhF;;;;;;GAMG;AACH,MAAM,OAAO,4BAA4B;IAAzC;QACC,gDAAgD;QAC/B,aAAQ,GAA4B,EAAE,CAAC;IAmBzD,CAAC;IAjBA,gDAAgD;IACzC,WAAW,CAAC,GAAG,QAAiC;QACtD,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC3B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;SAChC;IACF,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,OAAiB,EAAE,OAA0B;QACvE,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;YACpC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,QAAQ,KAAK,SAAS,EAAE;gBAC3B,OAAO,QAAQ,CAAC;aAChB;SACD;QACD,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACD;AAED;;;GAGG;AACH,gDAAgD;AAChD,MAAM,UAAU,0BAA0B,CAAC,GAAG,QAAiC;IAC9E,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;IACnD,OAAO,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC;IACjC,OAAO,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE,CAC9D,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IRequest, IResponse } from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-runtime-definitions\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils\";\n// eslint-disable-next-line import/no-deprecated\nimport { RuntimeRequestHandler } from \"./requestHandlers\";\n\n/**\n * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.\n * The provided handlers sequentially applied until one is able to satisfy the request.\n *\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\nexport class RuntimeRequestHandlerBuilder {\n\t// eslint-disable-next-line import/no-deprecated\n\tprivate readonly handlers: RuntimeRequestHandler[] = [];\n\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic pushHandler(...handlers: RuntimeRequestHandler[]) {\n\t\tif (handlers !== undefined) {\n\t\t\tthis.handlers.push(...handlers);\n\t\t}\n\t}\n\n\tpublic async handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse> {\n\t\tconst parser = RequestParser.create(request);\n\t\tfor (const handler of this.handlers) {\n\t\t\tconst response = await handler(parser, runtime);\n\t\t\tif (response !== undefined) {\n\t\t\t\treturn response;\n\t\t\t}\n\t\t}\n\t\treturn create404Response(request);\n\t}\n}\n\n/**\n * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n * @internal\n */\n// eslint-disable-next-line import/no-deprecated\nexport function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]) {\n\tconst builder = new RuntimeRequestHandlerBuilder();\n\tbuilder.pushHandler(...handlers);\n\treturn async (request: IRequest, runtime: IContainerRuntime) =>\n\t\tbuilder.handleRequest(request, runtime);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/request-handler",
3
- "version": "2.0.0-internal.7.3.0",
3
+ "version": "2.0.0-internal.7.4.0",
4
4
  "description": "A simple request handling library for Fluid Framework",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -11,18 +11,6 @@
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
13
  "sideEffects": false,
14
- "exports": {
15
- ".": {
16
- "import": {
17
- "types": "./lib/index.d.ts",
18
- "default": "./lib/index.mjs"
19
- },
20
- "require": {
21
- "types": "./dist/index.d.ts",
22
- "default": "./dist/index.cjs"
23
- }
24
- }
25
- },
26
14
  "main": "dist/index.cjs",
27
15
  "module": "lib/index.mjs",
28
16
  "types": "dist/index.d.ts",
@@ -47,25 +35,27 @@
47
35
  "temp-directory": "nyc/.nyc_output"
48
36
  },
49
37
  "dependencies": {
50
- "@fluidframework/container-runtime-definitions": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
51
- "@fluidframework/core-interfaces": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
52
- "@fluidframework/core-utils": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
53
- "@fluidframework/runtime-definitions": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
54
- "@fluidframework/runtime-utils": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0"
38
+ "@fluidframework/container-runtime-definitions": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
39
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
40
+ "@fluidframework/core-utils": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
41
+ "@fluidframework/runtime-definitions": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
42
+ "@fluidframework/runtime-utils": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0"
55
43
  },
56
44
  "devDependencies": {
45
+ "@arethetypeswrong/cli": "^0.13.3",
57
46
  "@fluid-tools/build-cli": "^0.28.0",
58
47
  "@fluidframework/build-common": "^2.0.3",
59
48
  "@fluidframework/build-tools": "^0.28.0",
60
49
  "@fluidframework/eslint-config-fluid": "^3.1.0",
61
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
50
+ "@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
62
51
  "@fluidframework/request-handler-previous": "npm:@fluidframework/request-handler@2.0.0-internal.7.2.0",
63
- "@fluidframework/test-runtime-utils": ">=2.0.0-internal.7.3.0 <2.0.0-internal.7.4.0",
52
+ "@fluidframework/test-runtime-utils": ">=2.0.0-internal.7.4.0 <2.0.0-internal.7.5.0",
64
53
  "@microsoft/api-extractor": "^7.38.3",
65
54
  "@types/diff": "^3.5.1",
66
55
  "@types/mocha": "^9.1.1",
67
- "@types/node": "^16.18.38",
56
+ "@types/node": "^18.19.0",
68
57
  "c8": "^7.7.1",
58
+ "copyfiles": "^2.4.1",
69
59
  "cross-env": "^7.0.3",
70
60
  "diff": "^3.5.0",
71
61
  "eslint": "~8.50.0",
@@ -78,25 +68,42 @@
78
68
  "tsc-multi": "^1.1.0",
79
69
  "typescript": "~5.1.6"
80
70
  },
71
+ "fluidBuild": {
72
+ "tasks": {
73
+ "build:docs": {
74
+ "dependsOn": [
75
+ "...",
76
+ "api-extractor:commonjs",
77
+ "api-extractor:esnext"
78
+ ],
79
+ "script": false
80
+ }
81
+ }
82
+ },
81
83
  "typeValidation": {
82
84
  "broken": {}
83
85
  },
84
86
  "scripts": {
87
+ "api": "fluid-build . --task api",
88
+ "api-extractor:commonjs": "api-extractor run --local",
89
+ "api-extractor:esnext": "copyfiles -u 1 \"dist/**/*-@(alpha|beta|public|untrimmed).d.ts\" lib",
85
90
  "build": "fluid-build . --task build",
86
91
  "build:commonjs": "fluid-build . --task commonjs",
87
92
  "build:compile": "fluid-build . --task compile",
88
- "build:docs": "api-extractor run --local",
93
+ "build:docs": "fluid-build . --task api",
89
94
  "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
90
95
  "build:test": "tsc-multi --config ./tsc-multi.test.json",
96
+ "check:are-the-types-wrong": "attw --pack",
97
+ "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
91
98
  "ci:build:docs": "api-extractor run",
92
99
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
93
100
  "eslint": "eslint --format stylish src",
94
101
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
95
102
  "format": "npm run prettier:fix",
96
- "lint": "npm run prettier && npm run eslint",
103
+ "lint": "npm run prettier && npm run check:release-tags && npm run eslint",
97
104
  "lint:fix": "npm run prettier:fix && npm run eslint:fix",
98
- "prettier": "prettier --check . --ignore-path ../../../.prettierignore",
99
- "prettier:fix": "prettier --write . --ignore-path ../../../.prettierignore",
105
+ "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
106
+ "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
100
107
  "test": "npm run test:mocha",
101
108
  "test:coverage": "c8 npm test",
102
109
  "test:mocha": "mocha --ignore \"dist/test/types/*\" --recursive dist/test --exit -r node_modules/@fluidframework/mocha-test-setup",
@@ -23,8 +23,7 @@ import { RequestParser } from "@fluidframework/runtime-utils";
23
23
  * A handler should only return error if the request is for a route the handler owns, and there is a problem with
24
24
  * the route, or fulling the specific request.
25
25
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
26
- *
27
- * @public
26
+ * @alpha
28
27
  */
29
28
  export type RuntimeRequestHandler = (
30
29
  request: RequestParser,
@@ -37,8 +36,7 @@ export type RuntimeRequestHandler = (
37
36
  * @param runtime - the container runtime
38
37
  * @returns the result of the request
39
38
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
40
- *
41
- * @public
39
+ * @internal
42
40
  */
43
41
  export const rootDataStoreRequestHandler = async (
44
42
  request: IRequest,
@@ -64,8 +62,7 @@ export const rootDataStoreRequestHandler = async (
64
62
 
65
63
  /**
66
64
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
67
- *
68
- * @public
65
+ * @internal
69
66
  */
70
67
  export const createFluidObjectResponse = (
71
68
  fluidObject: FluidObject,
@@ -107,8 +104,7 @@ class LegacyUriHandle<T = FluidObject & IFluidLoadable> implements IFluidHandle<
107
104
 
108
105
  /**
109
106
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
110
- *
111
- * @public
107
+ * @internal
112
108
  */
113
109
  export function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(
114
110
  uri: string,
@@ -14,8 +14,7 @@ import { RuntimeRequestHandler } from "./requestHandlers";
14
14
  * The provided handlers sequentially applied until one is able to satisfy the request.
15
15
  *
16
16
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
17
- *
18
- * @public
17
+ * @internal
19
18
  */
20
19
  export class RuntimeRequestHandlerBuilder {
21
20
  // eslint-disable-next-line import/no-deprecated
@@ -42,8 +41,7 @@ export class RuntimeRequestHandlerBuilder {
42
41
 
43
42
  /**
44
43
  * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
45
- *
46
- * @public
44
+ * @internal
47
45
  */
48
46
  // eslint-disable-next-line import/no-deprecated
49
47
  export function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]) {