@fluidframework/request-handler 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.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 +23 -0
- package/api-report/request-handler.api.md +2 -2
- package/dist/legacy.d.ts +14 -0
- package/dist/public.d.ts +12 -0
- package/dist/requestHandlers.d.ts +2 -2
- package/dist/requestHandlers.d.ts.map +1 -1
- package/dist/requestHandlers.js.map +1 -1
- package/dist/runtimeRequestHandlerBuilder.d.ts +1 -1
- package/dist/runtimeRequestHandlerBuilder.d.ts.map +1 -1
- package/dist/runtimeRequestHandlerBuilder.js +3 -3
- package/dist/runtimeRequestHandlerBuilder.js.map +1 -1
- package/internal.d.ts +11 -0
- package/legacy.d.ts +11 -0
- package/lib/legacy.d.ts +14 -0
- package/lib/public.d.ts +12 -0
- package/lib/requestHandlers.d.ts +2 -2
- package/lib/requestHandlers.d.ts.map +1 -1
- package/lib/requestHandlers.js.map +1 -1
- package/lib/runtimeRequestHandlerBuilder.d.ts +1 -1
- package/lib/runtimeRequestHandlerBuilder.d.ts.map +1 -1
- package/lib/runtimeRequestHandlerBuilder.js +1 -1
- package/lib/runtimeRequestHandlerBuilder.js.map +1 -1
- package/package.json +29 -50
- package/src/requestHandlers.ts +2 -2
- package/src/runtimeRequestHandlerBuilder.ts +3 -2
- package/api-extractor-cjs.json +0 -8
- package/dist/request-handler-alpha.d.ts +0 -19
- package/dist/request-handler-beta.d.ts +0 -14
- package/dist/request-handler-public.d.ts +0 -14
- package/dist/request-handler-untrimmed.d.ts +0 -26
- package/lib/request-handler-alpha.d.ts +0 -19
- package/lib/request-handler-beta.d.ts +0 -14
- package/lib/request-handler-public.d.ts +0 -14
- package/lib/request-handler-untrimmed.d.ts +0 -26
- package/lib/test/requestHandler.spec.js +0 -8
- package/lib/test/requestHandler.spec.js.map +0 -1
- package/lib/test/types/validateRequestHandlerPrevious.generated.js +0 -6
- package/lib/test/types/validateRequestHandlerPrevious.generated.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @fluidframework/request-handler
|
|
2
2
|
|
|
3
|
+
## 2.0.0-rc.3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Packages now use package.json "exports" and require modern module resolution [97d68aa06b](https://github.com/microsoft/FluidFramework/commit/97d68aa06bd5c022ecb026655814aea222a062ae)
|
|
8
|
+
|
|
9
|
+
Fluid Framework packages have been updated to use the [package.json "exports"
|
|
10
|
+
field](https://nodejs.org/docs/latest-v18.x/api/packages.html#exports) to define explicit entry points for both
|
|
11
|
+
TypeScript types and implementation code.
|
|
12
|
+
|
|
13
|
+
This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
|
|
14
|
+
|
|
15
|
+
- `"moduleResolution": "Node16"` with `"module": "Node16"`
|
|
16
|
+
- `"moduleResolution": "Bundler"` with `"module": "ESNext"`
|
|
17
|
+
|
|
18
|
+
We recommend using Node16/Node16 unless absolutely necessary. That will produce transpiled JavaScript that is suitable
|
|
19
|
+
for use with modern versions of Node.js _and_ Bundlers.
|
|
20
|
+
[See the TypeScript documentation](https://www.typescriptlang.org/tsconfig#moduleResolution) for more information
|
|
21
|
+
regarding the module and moduleResolution options.
|
|
22
|
+
|
|
23
|
+
**Node10 moduleResolution is not supported; it does not support Fluid Framework's API structuring pattern that is used
|
|
24
|
+
to distinguish stable APIs from those that are in development.**
|
|
25
|
+
|
|
3
26
|
## 2.0.0-rc.2.0.0
|
|
4
27
|
|
|
5
28
|
Dependency updates only.
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
|
|
7
|
-
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
7
|
+
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions/internal';
|
|
8
8
|
import { IRequest } from '@fluidframework/core-interfaces';
|
|
9
9
|
import { IResponse } from '@fluidframework/core-interfaces';
|
|
10
|
-
import { RequestParser } from '@fluidframework/runtime-utils';
|
|
10
|
+
import { RequestParser } from '@fluidframework/runtime-utils/internal';
|
|
11
11
|
|
|
12
12
|
// @internal @deprecated
|
|
13
13
|
export function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
|
package/dist/legacy.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints" in @fluidframework/build-tools.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
// alpha APIs
|
|
13
|
+
RuntimeRequestHandler
|
|
14
|
+
} from "./index.js";
|
package/dist/public.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints" in @fluidframework/build-tools.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export {}
|
|
12
|
+
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
|
|
5
6
|
import { type IResponse } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { type
|
|
7
|
-
import { type RequestParser } from "@fluidframework/runtime-utils";
|
|
7
|
+
import { type RequestParser } from "@fluidframework/runtime-utils/internal";
|
|
8
8
|
/**
|
|
9
9
|
* A request handler for the container runtime. Each handler should handle a specific request, and return undefined
|
|
10
10
|
* if it does not apply. These handlers are called in series, so there may be other handlers before or after.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAE5E;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,iBAAiB,KACtB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC"}
|
|
@@ -1 +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 { type
|
|
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 { type IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport { type IResponse } from \"@fluidframework/core-interfaces\";\nimport { type RequestParser } from \"@fluidframework/runtime-utils/internal\";\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"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
|
|
5
6
|
import { type IRequest, type IResponse } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
7
7
|
import { type RuntimeRequestHandler } from "./requestHandlers.js";
|
|
8
8
|
/**
|
|
9
9
|
* Deprecated.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeRequestHandlerBuilder.d.ts","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"runtimeRequestHandlerBuilder.d.ts","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAIhF,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AA6BlE;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAEzC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,GAClC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,SAAS,CAAC,CAKvE"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.buildRuntimeRequestHandler = void 0;
|
|
8
|
-
const
|
|
8
|
+
const internal_1 = require("@fluidframework/runtime-utils/internal");
|
|
9
9
|
/**
|
|
10
10
|
* The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
|
|
11
11
|
* The provided handlers sequentially applied until one is able to satisfy the request.
|
|
@@ -22,14 +22,14 @@ class RuntimeRequestHandlerBuilder {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
async handleRequest(request, runtime) {
|
|
25
|
-
const parser =
|
|
25
|
+
const parser = internal_1.RequestParser.create(request);
|
|
26
26
|
for (const handler of this.handlers) {
|
|
27
27
|
const response = await handler(parser, runtime);
|
|
28
28
|
if (response !== undefined) {
|
|
29
29
|
return response;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
return (0,
|
|
32
|
+
return (0, internal_1.create404Response)(request);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,
|
|
1
|
+
{"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,qEAA0F;AAK1F;;;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,wBAAa,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,4BAAiB,EAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CACD;AAED;;;;;;GAMG;AACH,SAAgB,0BAA0B;AACzC,gDAAgD;AAChD,GAAG,QAAiC;IAEpC,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;AARD,gEAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport { type IRequest, type IResponse } from \"@fluidframework/core-interfaces\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils/internal\";\n\n// eslint-disable-next-line import/no-deprecated\nimport { type RuntimeRequestHandler } from \"./requestHandlers.js\";\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[]): void {\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.\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 */\nexport function buildRuntimeRequestHandler(\n\t// eslint-disable-next-line import/no-deprecated\n\t...handlers: RuntimeRequestHandler[]\n): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse> {\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/internal.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints" in @fluidframework/build-tools.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export * from "./lib/index.js";
|
package/legacy.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints" in @fluidframework/build-tools.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export * from "./lib/legacy.js";
|
package/lib/legacy.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints" in @fluidframework/build-tools.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
// alpha APIs
|
|
13
|
+
RuntimeRequestHandler
|
|
14
|
+
} from "./index.js";
|
package/lib/public.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
8
|
+
* Generated by "flub generate entrypoints" in @fluidframework/build-tools.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export {}
|
|
12
|
+
|
package/lib/requestHandlers.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
|
|
5
6
|
import { type IResponse } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { type
|
|
7
|
-
import { type RequestParser } from "@fluidframework/runtime-utils";
|
|
7
|
+
import { type RequestParser } from "@fluidframework/runtime-utils/internal";
|
|
8
8
|
/**
|
|
9
9
|
* A request handler for the container runtime. Each handler should handle a specific request, and return undefined
|
|
10
10
|
* if it does not apply. These handlers are called in series, so there may be other handlers before or after.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAE5E;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,iBAAiB,KACtB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC"}
|
|
@@ -1 +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 { type
|
|
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 { type IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport { type IResponse } from \"@fluidframework/core-interfaces\";\nimport { type RequestParser } from \"@fluidframework/runtime-utils/internal\";\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"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
|
|
5
6
|
import { type IRequest, type IResponse } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
7
7
|
import { type RuntimeRequestHandler } from "./requestHandlers.js";
|
|
8
8
|
/**
|
|
9
9
|
* Deprecated.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeRequestHandlerBuilder.d.ts","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"runtimeRequestHandlerBuilder.d.ts","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAIhF,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AA6BlE;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAEzC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,GAClC,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,SAAS,CAAC,CAKvE"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { RequestParser, create404Response } from "@fluidframework/runtime-utils";
|
|
5
|
+
import { RequestParser, create404Response } from "@fluidframework/runtime-utils/internal";
|
|
6
6
|
/**
|
|
7
7
|
* The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
|
|
8
8
|
* The provided handlers sequentially applied until one is able to satisfy the request.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAK1F;;;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,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;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B;AACzC,gDAAgD;AAChD,GAAG,QAAiC;IAEpC,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 { type IContainerRuntime } from \"@fluidframework/container-runtime-definitions/internal\";\nimport { type IRequest, type IResponse } from \"@fluidframework/core-interfaces\";\nimport { RequestParser, create404Response } from \"@fluidframework/runtime-utils/internal\";\n\n// eslint-disable-next-line import/no-deprecated\nimport { type RuntimeRequestHandler } from \"./requestHandlers.js\";\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[]): void {\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.\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 */\nexport function buildRuntimeRequestHandler(\n\t// eslint-disable-next-line import/no-deprecated\n\t...handlers: RuntimeRequestHandler[]\n): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse> {\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-rc.
|
|
3
|
+
"version": "2.0.0-rc.3.0.0",
|
|
4
4
|
"description": "A simple request handling library for Fluid Framework",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -15,31 +15,21 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
17
|
"import": {
|
|
18
|
-
"types": "./lib/
|
|
19
|
-
"default": "./lib/index.js"
|
|
20
|
-
},
|
|
21
|
-
"require": {
|
|
22
|
-
"types": "./dist/index.d.ts",
|
|
23
|
-
"default": "./dist/index.js"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"./public": {
|
|
27
|
-
"import": {
|
|
28
|
-
"types": "./lib/request-handler-public.d.ts",
|
|
18
|
+
"types": "./lib/public.d.ts",
|
|
29
19
|
"default": "./lib/index.js"
|
|
30
20
|
},
|
|
31
21
|
"require": {
|
|
32
|
-
"types": "./dist/
|
|
22
|
+
"types": "./dist/public.d.ts",
|
|
33
23
|
"default": "./dist/index.js"
|
|
34
24
|
}
|
|
35
25
|
},
|
|
36
|
-
"./
|
|
26
|
+
"./legacy": {
|
|
37
27
|
"import": {
|
|
38
|
-
"types": "./lib/
|
|
28
|
+
"types": "./lib/legacy.d.ts",
|
|
39
29
|
"default": "./lib/index.js"
|
|
40
30
|
},
|
|
41
31
|
"require": {
|
|
42
|
-
"types": "./dist/
|
|
32
|
+
"types": "./dist/legacy.d.ts",
|
|
43
33
|
"default": "./dist/index.js"
|
|
44
34
|
}
|
|
45
35
|
},
|
|
@@ -54,8 +44,8 @@
|
|
|
54
44
|
}
|
|
55
45
|
}
|
|
56
46
|
},
|
|
57
|
-
"main": "
|
|
58
|
-
"types": "
|
|
47
|
+
"main": "lib/index.js",
|
|
48
|
+
"types": "lib/public.d.ts",
|
|
59
49
|
"c8": {
|
|
60
50
|
"all": true,
|
|
61
51
|
"cache-dir": "nyc/.cache",
|
|
@@ -77,19 +67,20 @@
|
|
|
77
67
|
"temp-directory": "nyc/.nyc_output"
|
|
78
68
|
},
|
|
79
69
|
"dependencies": {
|
|
80
|
-
"@fluidframework/container-runtime-definitions": ">=2.0.0-rc.
|
|
81
|
-
"@fluidframework/core-interfaces": ">=2.0.0-rc.
|
|
82
|
-
"@fluidframework/core-utils": ">=2.0.0-rc.
|
|
83
|
-
"@fluidframework/runtime-definitions": ">=2.0.0-rc.
|
|
84
|
-
"@fluidframework/runtime-utils": ">=2.0.0-rc.
|
|
70
|
+
"@fluidframework/container-runtime-definitions": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
71
|
+
"@fluidframework/core-interfaces": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
72
|
+
"@fluidframework/core-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
73
|
+
"@fluidframework/runtime-definitions": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
74
|
+
"@fluidframework/runtime-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0"
|
|
85
75
|
},
|
|
86
76
|
"devDependencies": {
|
|
87
|
-
"@arethetypeswrong/cli": "^0.
|
|
88
|
-
"@
|
|
89
|
-
"@fluid-
|
|
77
|
+
"@arethetypeswrong/cli": "^0.15.2",
|
|
78
|
+
"@biomejs/biome": "^1.6.2",
|
|
79
|
+
"@fluid-internal/mocha-test-setup": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
|
|
80
|
+
"@fluid-tools/build-cli": "^0.37.0",
|
|
90
81
|
"@fluidframework/build-common": "^2.0.3",
|
|
91
|
-
"@fluidframework/build-tools": "^0.
|
|
92
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
82
|
+
"@fluidframework/build-tools": "^0.37.0",
|
|
83
|
+
"@fluidframework/eslint-config-fluid": "^5.1.0",
|
|
93
84
|
"@fluidframework/request-handler-previous": "npm:@fluidframework/request-handler@2.0.0-internal.8.0.0",
|
|
94
85
|
"@microsoft/api-extractor": "^7.42.3",
|
|
95
86
|
"@types/diff": "^3.5.1",
|
|
@@ -108,44 +99,32 @@
|
|
|
108
99
|
"rimraf": "^4.4.0",
|
|
109
100
|
"typescript": "~5.1.6"
|
|
110
101
|
},
|
|
111
|
-
"fluidBuild": {
|
|
112
|
-
"tasks": {
|
|
113
|
-
"build:docs": {
|
|
114
|
-
"dependsOn": [
|
|
115
|
-
"...",
|
|
116
|
-
"api-extractor:commonjs",
|
|
117
|
-
"api-extractor:esnext"
|
|
118
|
-
],
|
|
119
|
-
"script": false
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
102
|
"typeValidation": {
|
|
124
103
|
"broken": {}
|
|
125
104
|
},
|
|
126
105
|
"scripts": {
|
|
127
106
|
"api": "fluid-build . --task api",
|
|
128
|
-
"api-extractor:commonjs": "
|
|
129
|
-
"api-extractor:esnext": "
|
|
107
|
+
"api-extractor:commonjs": "flub generate entrypoints --outFileAlpha legacy --outDir ./dist",
|
|
108
|
+
"api-extractor:esnext": "flub generate entrypoints --outFileAlpha legacy --outDir ./lib --node10TypeCompat",
|
|
130
109
|
"build": "fluid-build . --task build",
|
|
131
110
|
"build:commonjs": "fluid-build . --task commonjs",
|
|
132
111
|
"build:compile": "fluid-build . --task compile",
|
|
133
|
-
"build:docs": "
|
|
112
|
+
"build:docs": "api-extractor run --local",
|
|
134
113
|
"build:esnext": "tsc --project ./tsconfig.json",
|
|
135
114
|
"build:test": "npm run build:test:esm && npm run build:test:cjs",
|
|
136
115
|
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
|
|
137
116
|
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
|
|
138
|
-
"check:are-the-types-wrong": "attw --pack .
|
|
117
|
+
"check:are-the-types-wrong": "attw --pack .",
|
|
118
|
+
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
139
119
|
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
140
120
|
"ci:build:docs": "api-extractor run",
|
|
141
|
-
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
121
|
+
"clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
142
122
|
"eslint": "eslint --format stylish src",
|
|
143
123
|
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
144
|
-
"format": "
|
|
145
|
-
"
|
|
146
|
-
"lint
|
|
147
|
-
"
|
|
148
|
-
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
124
|
+
"format": "fluid-build --task format .",
|
|
125
|
+
"format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
126
|
+
"lint": "fluid-build . --task lint",
|
|
127
|
+
"lint:fix": "fluid-build . --task eslint:fix --task format",
|
|
149
128
|
"test": "npm run test:mocha",
|
|
150
129
|
"test:coverage": "c8 npm test",
|
|
151
130
|
"test:mocha": "npm run test:mocha:esm && echo skipping cjs to avoid overhead - npm run test:mocha:cjs",
|
package/src/requestHandlers.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
|
|
6
7
|
import { type IResponse } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { type
|
|
8
|
-
import { type RequestParser } from "@fluidframework/runtime-utils";
|
|
8
|
+
import { type RequestParser } from "@fluidframework/runtime-utils/internal";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* A request handler for the container runtime. Each handler should handle a specific request, and return undefined
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { type IContainerRuntime } from "@fluidframework/container-runtime-definitions/internal";
|
|
6
7
|
import { type IRequest, type IResponse } from "@fluidframework/core-interfaces";
|
|
7
|
-
import {
|
|
8
|
-
|
|
8
|
+
import { RequestParser, create404Response } from "@fluidframework/runtime-utils/internal";
|
|
9
|
+
|
|
9
10
|
// eslint-disable-next-line import/no-deprecated
|
|
10
11
|
import { type RuntimeRequestHandler } from "./requestHandlers.js";
|
|
11
12
|
|
package/api-extractor-cjs.json
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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.cjs.primary.json",
|
|
4
|
-
// CJS is actually secondary; so, no report.
|
|
5
|
-
"apiReport": {
|
|
6
|
-
"enabled": false
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
2
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
3
|
-
import { IResponse } from '@fluidframework/core-interfaces';
|
|
4
|
-
import { RequestParser } from '@fluidframework/runtime-utils';
|
|
5
|
-
|
|
6
|
-
/* Excluded from this release type: buildRuntimeRequestHandler */
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A request handler for the container runtime. Each handler should handle a specific request, and return undefined
|
|
10
|
-
* if it does not apply. These handlers are called in series, so there may be other handlers before or after.
|
|
11
|
-
* A handler should only return error if the request is for a route the handler owns, and there is a problem with
|
|
12
|
-
* the route, or fulling the specific request.
|
|
13
|
-
* @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
|
|
14
|
-
*
|
|
15
|
-
* @alpha
|
|
16
|
-
*/
|
|
17
|
-
export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
|
|
18
|
-
|
|
19
|
-
export { }
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
2
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
3
|
-
import { IResponse } from '@fluidframework/core-interfaces';
|
|
4
|
-
import { RequestParser } from '@fluidframework/runtime-utils';
|
|
5
|
-
|
|
6
|
-
/* Excluded from this release type: buildRuntimeRequestHandler */
|
|
7
|
-
|
|
8
|
-
/* Excluded from this release type: IContainerRuntime */
|
|
9
|
-
|
|
10
|
-
/* Excluded from this release type: RequestParser */
|
|
11
|
-
|
|
12
|
-
/* Excluded from this release type: RuntimeRequestHandler */
|
|
13
|
-
|
|
14
|
-
export { }
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
2
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
3
|
-
import { IResponse } from '@fluidframework/core-interfaces';
|
|
4
|
-
import { RequestParser } from '@fluidframework/runtime-utils';
|
|
5
|
-
|
|
6
|
-
/* Excluded from this release type: buildRuntimeRequestHandler */
|
|
7
|
-
|
|
8
|
-
/* Excluded from this release type: IContainerRuntime */
|
|
9
|
-
|
|
10
|
-
/* Excluded from this release type: RequestParser */
|
|
11
|
-
|
|
12
|
-
/* Excluded from this release type: RuntimeRequestHandler */
|
|
13
|
-
|
|
14
|
-
export { }
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
2
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
3
|
-
import { IResponse } from '@fluidframework/core-interfaces';
|
|
4
|
-
import { RequestParser } from '@fluidframework/runtime-utils';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Deprecated.
|
|
8
|
-
*
|
|
9
|
-
* @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
|
|
10
|
-
*
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A request handler for the container runtime. Each handler should handle a specific request, and return undefined
|
|
17
|
-
* if it does not apply. These handlers are called in series, so there may be other handlers before or after.
|
|
18
|
-
* A handler should only return error if the request is for a route the handler owns, and there is a problem with
|
|
19
|
-
* the route, or fulling the specific request.
|
|
20
|
-
* @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
|
|
21
|
-
*
|
|
22
|
-
* @alpha
|
|
23
|
-
*/
|
|
24
|
-
export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
|
|
25
|
-
|
|
26
|
-
export { }
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
2
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
3
|
-
import { IResponse } from '@fluidframework/core-interfaces';
|
|
4
|
-
import { RequestParser } from '@fluidframework/runtime-utils';
|
|
5
|
-
|
|
6
|
-
/* Excluded from this release type: buildRuntimeRequestHandler */
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A request handler for the container runtime. Each handler should handle a specific request, and return undefined
|
|
10
|
-
* if it does not apply. These handlers are called in series, so there may be other handlers before or after.
|
|
11
|
-
* A handler should only return error if the request is for a route the handler owns, and there is a problem with
|
|
12
|
-
* the route, or fulling the specific request.
|
|
13
|
-
* @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
|
|
14
|
-
*
|
|
15
|
-
* @alpha
|
|
16
|
-
*/
|
|
17
|
-
export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
|
|
18
|
-
|
|
19
|
-
export { }
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
2
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
3
|
-
import { IResponse } from '@fluidframework/core-interfaces';
|
|
4
|
-
import { RequestParser } from '@fluidframework/runtime-utils';
|
|
5
|
-
|
|
6
|
-
/* Excluded from this release type: buildRuntimeRequestHandler */
|
|
7
|
-
|
|
8
|
-
/* Excluded from this release type: IContainerRuntime */
|
|
9
|
-
|
|
10
|
-
/* Excluded from this release type: RequestParser */
|
|
11
|
-
|
|
12
|
-
/* Excluded from this release type: RuntimeRequestHandler */
|
|
13
|
-
|
|
14
|
-
export { }
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
2
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
3
|
-
import { IResponse } from '@fluidframework/core-interfaces';
|
|
4
|
-
import { RequestParser } from '@fluidframework/runtime-utils';
|
|
5
|
-
|
|
6
|
-
/* Excluded from this release type: buildRuntimeRequestHandler */
|
|
7
|
-
|
|
8
|
-
/* Excluded from this release type: IContainerRuntime */
|
|
9
|
-
|
|
10
|
-
/* Excluded from this release type: RequestParser */
|
|
11
|
-
|
|
12
|
-
/* Excluded from this release type: RuntimeRequestHandler */
|
|
13
|
-
|
|
14
|
-
export { }
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
|
|
2
|
-
import { IRequest } from '@fluidframework/core-interfaces';
|
|
3
|
-
import { IResponse } from '@fluidframework/core-interfaces';
|
|
4
|
-
import { RequestParser } from '@fluidframework/runtime-utils';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Deprecated.
|
|
8
|
-
*
|
|
9
|
-
* @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
|
|
10
|
-
*
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A request handler for the container runtime. Each handler should handle a specific request, and return undefined
|
|
17
|
-
* if it does not apply. These handlers are called in series, so there may be other handlers before or after.
|
|
18
|
-
* A handler should only return error if the request is for a route the handler owns, and there is a problem with
|
|
19
|
-
* the route, or fulling the specific request.
|
|
20
|
-
* @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
|
|
21
|
-
*
|
|
22
|
-
* @alpha
|
|
23
|
-
*/
|
|
24
|
-
export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
|
|
25
|
-
|
|
26
|
-
export { }
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
// Build pipeline breaks without this file ("No test files found")
|
|
6
|
-
describe("requestHandler-placeholder", () => { });
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=requestHandler.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requestHandler.spec.js","sourceRoot":"","sources":["../../src/test/requestHandler.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kEAAkE;AAClE,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Build pipeline breaks without this file (\"No test files found\")\ndescribe(\"requestHandler-placeholder\", () => {});\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
use_current_TypeAliasDeclaration_RuntimeRequestHandler(get_old_TypeAliasDeclaration_RuntimeRequestHandler());
|
|
2
|
-
use_old_TypeAliasDeclaration_RuntimeRequestHandler(get_current_TypeAliasDeclaration_RuntimeRequestHandler());
|
|
3
|
-
use_current_FunctionDeclaration_buildRuntimeRequestHandler(get_old_FunctionDeclaration_buildRuntimeRequestHandler());
|
|
4
|
-
use_old_FunctionDeclaration_buildRuntimeRequestHandler(get_current_FunctionDeclaration_buildRuntimeRequestHandler());
|
|
5
|
-
export {};
|
|
6
|
-
//# sourceMappingURL=validateRequestHandlerPrevious.generated.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateRequestHandlerPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateRequestHandlerPrevious.generated.ts"],"names":[],"mappings":"AAgCA,sDAAsD,CAClD,kDAAkD,EAAE,CAAC,CAAC;AAW1D,kDAAkD,CAC9C,sDAAsD,EAAE,CAAC,CAAC;AAW9D,0DAA0D,CACtD,sDAAsD,EAAE,CAAC,CAAC;AAW9D,sDAAsD,CAClD,0DAA0D,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport type * as old from \"@fluidframework/request-handler-previous\";\nimport type * as current from \"../../index.js\";\n\n\n// See 'build-tools/src/type-test-generator/compatibility.ts' for more information.\ntype TypeOnly<T> = T extends number\n\t? number\n\t: T extends string\n\t? string\n\t: T extends boolean | bigint | symbol\n\t? T\n\t: {\n\t\t\t[P in keyof T]: TypeOnly<T[P]>;\n\t };\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_RuntimeRequestHandler\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_RuntimeRequestHandler():\n TypeOnly<old.RuntimeRequestHandler>;\ndeclare function use_current_TypeAliasDeclaration_RuntimeRequestHandler(\n use: TypeOnly<current.RuntimeRequestHandler>): void;\nuse_current_TypeAliasDeclaration_RuntimeRequestHandler(\n get_old_TypeAliasDeclaration_RuntimeRequestHandler());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_RuntimeRequestHandler\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_RuntimeRequestHandler():\n TypeOnly<current.RuntimeRequestHandler>;\ndeclare function use_old_TypeAliasDeclaration_RuntimeRequestHandler(\n use: TypeOnly<old.RuntimeRequestHandler>): void;\nuse_old_TypeAliasDeclaration_RuntimeRequestHandler(\n get_current_TypeAliasDeclaration_RuntimeRequestHandler());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_buildRuntimeRequestHandler\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_FunctionDeclaration_buildRuntimeRequestHandler():\n TypeOnly<typeof old.buildRuntimeRequestHandler>;\ndeclare function use_current_FunctionDeclaration_buildRuntimeRequestHandler(\n use: TypeOnly<typeof current.buildRuntimeRequestHandler>): void;\nuse_current_FunctionDeclaration_buildRuntimeRequestHandler(\n get_old_FunctionDeclaration_buildRuntimeRequestHandler());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"FunctionDeclaration_buildRuntimeRequestHandler\": {\"backCompat\": false}\n*/\ndeclare function get_current_FunctionDeclaration_buildRuntimeRequestHandler():\n TypeOnly<typeof current.buildRuntimeRequestHandler>;\ndeclare function use_old_FunctionDeclaration_buildRuntimeRequestHandler(\n use: TypeOnly<typeof old.buildRuntimeRequestHandler>): void;\nuse_old_FunctionDeclaration_buildRuntimeRequestHandler(\n get_current_FunctionDeclaration_buildRuntimeRequestHandler());\n"]}
|
|
File without changes
|