@fluidframework/request-handler 2.0.0-dev-rc.1.0.0.224419 → 2.0.0-dev-rc.1.0.0.228517

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-rc.1.0.0
4
+
5
+ Dependency updates only.
6
+
3
7
  ## 2.0.0-internal.8.0.0
4
8
 
5
9
  ### Major Changes
package/README.md CHANGED
@@ -13,12 +13,6 @@ When taking a dependency on a Fluid Framework library, we recommend using a `^`
13
13
  While Fluid Framework libraries may use different ranges with interdependencies between other Fluid Framework libraries,
14
14
  library consumers should always prefer `^`.
15
15
 
16
- Note that when depending on a library version of the form `2.0.0-internal.x.y.z`, called the Fluid internal version scheme,
17
- you must use a `>= <` dependency range (such as `>=2.0.0-internal.x.y.z <2.0.0-internal.w.0.0` where `w` is `x+1`).
18
- Standard `^` and `~` ranges will not work as expected.
19
- See the [@fluid-tools/version-tools](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/version-tools/README.md)
20
- package for more information including tools to convert between version schemes.
21
-
22
16
  <!-- prettier-ignore-end -->
23
17
 
24
18
  <!-- AUTO-GENERATED-CONTENT:END -->
@@ -0,0 +1,4 @@
1
+ {
2
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
+ "extends": "../../../common/build/build-common/api-extractor-base-esm.json"
4
+ }
@@ -5,6 +5,6 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.buildRuntimeRequestHandler = void 0;
8
- var runtimeRequestHandlerBuilder_1 = require("./runtimeRequestHandlerBuilder.cjs");
8
+ var runtimeRequestHandlerBuilder_1 = require("./runtimeRequestHandlerBuilder");
9
9
  Object.defineProperty(exports, "buildRuntimeRequestHandler", { enumerable: true, get: function () { return runtimeRequestHandlerBuilder_1.buildRuntimeRequestHandler; } });
10
- //# sourceMappingURL=index.cjs.map
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+EAA4E;AAAnE,0IAAA,0BAA0B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { RuntimeRequestHandler } from \"./requestHandlers\";\nexport { buildRuntimeRequestHandler } from \"./runtimeRequestHandlerBuilder\";\n"]}
@@ -4,4 +4,4 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=requestHandlers.cjs.map
7
+ //# sourceMappingURL=requestHandlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestHandlers.js","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResponse } from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-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 once Loader LTS version is \"2.0.0-internal.7.0.0\". Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @alpha\n */\nexport type RuntimeRequestHandler = (\n\trequest: RequestParser,\n\truntime: IContainerRuntime,\n) => Promise<IResponse | undefined>;\n"]}
@@ -44,4 +44,4 @@ function buildRuntimeRequestHandler(...handlers) {
44
44
  return async (request, runtime) => builder.handleRequest(request, runtime);
45
45
  }
46
46
  exports.buildRuntimeRequestHandler = buildRuntimeRequestHandler;
47
- //# sourceMappingURL=runtimeRequestHandlerBuilder.cjs.map
47
+ //# sourceMappingURL=runtimeRequestHandlerBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,iEAAiF;AAIjF;;;GAGG;AACH,MAAM,4BAA4B;IAAlC;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;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 */\nclass 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 once Loader LTS version is \"2.0.0-internal.7.0.0\". Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\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/lib/index.d.mts CHANGED
@@ -4,4 +4,4 @@
4
4
  */
5
5
  export { RuntimeRequestHandler } from "./requestHandlers.mjs";
6
6
  export { buildRuntimeRequestHandler } from "./runtimeRequestHandlerBuilder.mjs";
7
- //# sourceMappingURL=index.d.ts.map
7
+ //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,qBAAqB,EAAE;OACzB,EAAE,0BAA0B,EAAE"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,qBAAqB,EAAE;OACzB,EAAE,0BAA0B,EAAE"}
@@ -15,4 +15,4 @@ import { RequestParser } from "@fluidframework/runtime-utils";
15
15
  * @alpha
16
16
  */
17
17
  export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
18
- //# sourceMappingURL=requestHandlers.d.ts.map
18
+ //# sourceMappingURL=requestHandlers.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,SAAS,EAAE,MAAM,iCAAiC;OACpD,EAAE,iBAAiB,EAAE,MAAM,+CAA+C;OAC1E,EAAE,aAAa,EAAE,MAAM,+BAA+B;AAE7D;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,iBAAiB,KACtB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC"}
1
+ {"version":3,"file":"requestHandlers.d.mts","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,SAAS,EAAE,MAAM,iCAAiC;OACpD,EAAE,iBAAiB,EAAE,MAAM,+CAA+C;OAC1E,EAAE,aAAa,EAAE,MAAM,+BAA+B;AAE7D;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,iBAAiB,KACtB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC"}
@@ -11,4 +11,4 @@ import { RuntimeRequestHandler } from "./requestHandlers.mjs";
11
11
  * @internal
12
12
  */
13
13
  export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
14
- //# sourceMappingURL=runtimeRequestHandlerBuilder.d.ts.map
14
+ //# sourceMappingURL=runtimeRequestHandlerBuilder.d.mts.map
@@ -1 +1 @@
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;AA6BhC;;;;GAIG;AAEH,wBAAgB,0BAA0B,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,aAGvD,QAAQ,WAAW,iBAAiB,wBAE3D"}
1
+ {"version":3,"file":"runtimeRequestHandlerBuilder.d.mts","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;AA6BhC;;;;GAIG;AAEH,wBAAgB,0BAA0B,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,aAGvD,QAAQ,WAAW,iBAAiB,wBAE3D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/request-handler",
3
- "version": "2.0.0-dev-rc.1.0.0.224419",
3
+ "version": "2.0.0-dev-rc.1.0.0.228517",
4
4
  "description": "A simple request handling library for Fluid Framework",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -19,11 +19,51 @@
19
19
  },
20
20
  "require": {
21
21
  "types": "./dist/index.d.ts",
22
- "default": "./dist/index.cjs"
22
+ "default": "./dist/index.js"
23
+ }
24
+ },
25
+ "./alpha": {
26
+ "import": {
27
+ "types": "./lib/request-handler-alpha.d.mts",
28
+ "default": "./lib/index.mjs"
29
+ },
30
+ "require": {
31
+ "types": "./dist/request-handler-alpha.d.ts",
32
+ "default": "./dist/index.js"
33
+ }
34
+ },
35
+ "./beta": {
36
+ "import": {
37
+ "types": "./lib/request-handler-beta.d.mts",
38
+ "default": "./lib/index.mjs"
39
+ },
40
+ "require": {
41
+ "types": "./dist/request-handler-beta.d.ts",
42
+ "default": "./dist/index.js"
43
+ }
44
+ },
45
+ "./internal": {
46
+ "import": {
47
+ "types": "./lib/index.d.mts",
48
+ "default": "./lib/index.mjs"
49
+ },
50
+ "require": {
51
+ "types": "./dist/index.d.ts",
52
+ "default": "./dist/index.js"
53
+ }
54
+ },
55
+ "./public": {
56
+ "import": {
57
+ "types": "./lib/request-handler-public.d.mts",
58
+ "default": "./lib/index.mjs"
59
+ },
60
+ "require": {
61
+ "types": "./dist/request-handler-public.d.ts",
62
+ "default": "./dist/index.js"
23
63
  }
24
64
  }
25
65
  },
26
- "main": "dist/index.cjs",
66
+ "main": "dist/index.js",
27
67
  "module": "lib/index.mjs",
28
68
  "types": "dist/index.d.ts",
29
69
  "c8": {
@@ -47,26 +87,26 @@
47
87
  "temp-directory": "nyc/.nyc_output"
48
88
  },
49
89
  "dependencies": {
50
- "@fluidframework/container-runtime-definitions": "2.0.0-dev-rc.1.0.0.224419",
51
- "@fluidframework/core-interfaces": "2.0.0-dev-rc.1.0.0.224419",
52
- "@fluidframework/core-utils": "2.0.0-dev-rc.1.0.0.224419",
53
- "@fluidframework/runtime-definitions": "2.0.0-dev-rc.1.0.0.224419",
54
- "@fluidframework/runtime-utils": "2.0.0-dev-rc.1.0.0.224419"
90
+ "@fluidframework/container-runtime-definitions": "2.0.0-dev-rc.1.0.0.228517",
91
+ "@fluidframework/core-interfaces": "2.0.0-dev-rc.1.0.0.228517",
92
+ "@fluidframework/core-utils": "2.0.0-dev-rc.1.0.0.228517",
93
+ "@fluidframework/runtime-definitions": "2.0.0-dev-rc.1.0.0.228517",
94
+ "@fluidframework/runtime-utils": "2.0.0-dev-rc.1.0.0.228517"
55
95
  },
56
96
  "devDependencies": {
57
97
  "@arethetypeswrong/cli": "^0.13.3",
58
- "@fluid-tools/build-cli": "0.29.0-222379",
98
+ "@fluid-tools/build-cli": "^0.29.0",
59
99
  "@fluidframework/build-common": "^2.0.3",
60
- "@fluidframework/build-tools": "0.29.0-222379",
61
- "@fluidframework/eslint-config-fluid": "^3.1.0",
62
- "@fluidframework/mocha-test-setup": "2.0.0-dev-rc.1.0.0.224419",
63
- "@fluidframework/request-handler-previous": "npm:@fluidframework/request-handler@2.0.0-internal.7.2.0",
64
- "@fluidframework/test-runtime-utils": "2.0.0-dev-rc.1.0.0.224419",
100
+ "@fluidframework/build-tools": "^0.29.0",
101
+ "@fluidframework/eslint-config-fluid": "^3.2.0",
102
+ "@fluidframework/mocha-test-setup": "2.0.0-dev-rc.1.0.0.228517",
103
+ "@fluidframework/request-handler-previous": "npm:@fluidframework/request-handler@2.0.0-internal.8.0.0",
104
+ "@fluidframework/test-runtime-utils": "2.0.0-dev-rc.1.0.0.228517",
65
105
  "@microsoft/api-extractor": "^7.38.3",
66
106
  "@types/diff": "^3.5.1",
67
107
  "@types/mocha": "^9.1.1",
68
108
  "@types/node": "^18.19.0",
69
- "c8": "^7.7.1",
109
+ "c8": "^8.0.1",
70
110
  "copyfiles": "^2.4.1",
71
111
  "cross-env": "^7.0.3",
72
112
  "diff": "^3.5.0",
@@ -76,7 +116,6 @@
76
116
  "mocha-multi-reporters": "^1.5.1",
77
117
  "moment": "^2.21.0",
78
118
  "prettier": "~3.0.3",
79
- "renamer": "^4.0.0",
80
119
  "rimraf": "^4.4.0",
81
120
  "tsc-multi": "^1.1.0",
82
121
  "typescript": "~5.1.6"
@@ -94,37 +133,19 @@
94
133
  }
95
134
  },
96
135
  "typeValidation": {
97
- "broken": {
98
- "RemovedVariableDeclaration_createFluidObjectResponse": {
99
- "forwardCompat": false,
100
- "backCompat": false
101
- },
102
- "RemovedVariableDeclaration_rootDataStoreRequestHandler": {
103
- "forwardCompat": false,
104
- "backCompat": false
105
- },
106
- "RemovedFunctionDeclaration_handleFromLegacyUri": {
107
- "forwardCompat": false,
108
- "backCompat": false
109
- },
110
- "RemovedClassDeclaration_RuntimeRequestHandlerBuilder": {
111
- "forwardCompat": false,
112
- "backCompat": false
113
- }
114
- }
136
+ "broken": {}
115
137
  },
116
138
  "scripts": {
117
139
  "api": "fluid-build . --task api",
118
140
  "api-extractor:commonjs": "api-extractor run --local",
119
- "api-extractor:esnext": "copyfiles -u 1 \"dist/**/*-@(alpha|beta|public|untrimmed).d.ts\" lib",
141
+ "api-extractor:esnext": "api-extractor run --config ./api-extractor-esm.json",
120
142
  "build": "fluid-build . --task build",
121
143
  "build:commonjs": "fluid-build . --task commonjs",
122
144
  "build:compile": "fluid-build . --task compile",
123
145
  "build:docs": "fluid-build . --task api",
124
146
  "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
125
- "build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
126
- "build:test": "tsc-multi --config ./tsc-multi.test.json",
127
- "check:are-the-types-wrong": "attw --pack",
147
+ "build:test": "tsc --project ./src/test/tsconfig.json",
148
+ "check:are-the-types-wrong": "attw --pack . --entrypoints .",
128
149
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
129
150
  "ci:build:docs": "api-extractor run",
130
151
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
@@ -139,7 +160,7 @@
139
160
  "test:coverage": "c8 npm test",
140
161
  "test:mocha": "mocha --ignore \"dist/test/types/*\" --recursive dist/test --exit -r node_modules/@fluidframework/mocha-test-setup",
141
162
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
142
- "tsc": "tsc-multi --config ../../../common/build/build-common/tsc-multi.cjs.json",
163
+ "tsc": "tsc",
143
164
  "typetests:gen": "fluid-type-test-generator",
144
165
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
145
166
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,mFAA4E;AAAnE,0IAAA,0BAA0B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { RuntimeRequestHandler } from \"./requestHandlers\";\nexport { buildRuntimeRequestHandler } from \"./runtimeRequestHandlerBuilder\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"requestHandlers.cjs","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IResponse } from \"@fluidframework/core-interfaces\";\nimport { IContainerRuntime } from \"@fluidframework/container-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 once Loader LTS version is \"2.0.0-internal.7.0.0\". Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\n * @alpha\n */\nexport type RuntimeRequestHandler = (\n\trequest: RequestParser,\n\truntime: IContainerRuntime,\n) => Promise<IResponse | undefined>;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtimeRequestHandlerBuilder.cjs","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,iEAAiF;AAIjF;;;GAGG;AACH,MAAM,4BAA4B;IAAlC;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;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 */\nclass 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 once Loader LTS version is \"2.0.0-internal.7.0.0\". Migrate all usage of IFluidRouter to the \"entryPoint\" pattern. Refer to Removing-IFluidRouter.md\n *\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"]}
@@ -1,4 +0,0 @@
1
- {
2
- "targets": [{ "extname": ".cjs", "module": "CommonJS", "moduleResolution": "Node10" }],
3
- "projects": ["./tsconfig.json", "./src/test/tsconfig.json"]
4
- }