@fluidframework/request-handler 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.224419
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/.eslintrc.js +5 -7
- package/.mocharc.js +12 -0
- package/CHANGELOG.md +119 -0
- package/README.md +37 -1
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/request-handler.api.md +20 -0
- package/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/request-handler-alpha.d.ts +19 -0
- package/dist/request-handler-beta.d.ts +14 -0
- package/dist/request-handler-public.d.ts +14 -0
- package/dist/request-handler-untrimmed.d.ts +24 -0
- package/dist/requestHandlers.cjs +7 -0
- package/dist/requestHandlers.cjs.map +1 -0
- package/dist/requestHandlers.d.ts +5 -16
- package/dist/requestHandlers.d.ts.map +1 -1
- package/dist/{runtimeRequestHandlerBuilder.js → runtimeRequestHandlerBuilder.cjs} +13 -6
- package/dist/runtimeRequestHandlerBuilder.cjs.map +1 -0
- package/dist/runtimeRequestHandlerBuilder.d.ts +4 -8
- package/dist/runtimeRequestHandlerBuilder.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/index.d.mts +7 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/{index.js → index.mjs} +2 -3
- package/lib/index.mjs.map +1 -0
- package/lib/request-handler-alpha.d.mts +19 -0
- package/lib/request-handler-beta.d.mts +14 -0
- package/lib/request-handler-public.d.mts +14 -0
- package/lib/request-handler-untrimmed.d.mts +24 -0
- package/lib/requestHandlers.d.mts +18 -0
- package/lib/requestHandlers.d.mts.map +1 -0
- package/lib/{index.d.ts → requestHandlers.mjs} +2 -3
- package/lib/requestHandlers.mjs.map +1 -0
- package/lib/runtimeRequestHandlerBuilder.d.mts +14 -0
- package/lib/runtimeRequestHandlerBuilder.d.mts.map +1 -0
- package/lib/{runtimeRequestHandlerBuilder.js → runtimeRequestHandlerBuilder.mjs} +13 -5
- package/lib/runtimeRequestHandlerBuilder.mjs.map +1 -0
- package/package.json +109 -61
- package/prettier.config.cjs +8 -0
- package/src/index.ts +2 -2
- package/src/requestHandlers.ts +8 -74
- package/src/runtimeRequestHandlerBuilder.ts +33 -23
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +11 -13
- package/dist/index.js +0 -19
- package/dist/index.js.map +0 -1
- package/dist/packageVersion.d.ts +0 -9
- package/dist/packageVersion.d.ts.map +0 -1
- package/dist/packageVersion.js +0 -12
- package/dist/packageVersion.js.map +0 -1
- package/dist/requestHandlers.js +0 -67
- package/dist/requestHandlers.js.map +0 -1
- package/dist/runtimeRequestHandlerBuilder.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/packageVersion.d.ts +0 -9
- package/lib/packageVersion.d.ts.map +0 -1
- package/lib/packageVersion.js +0 -9
- package/lib/packageVersion.js.map +0 -1
- package/lib/requestHandlers.d.ts +0 -29
- package/lib/requestHandlers.d.ts.map +0 -1
- package/lib/requestHandlers.js +0 -61
- package/lib/requestHandlers.js.map +0 -1
- package/lib/runtimeRequestHandlerBuilder.d.ts +0 -18
- package/lib/runtimeRequestHandlerBuilder.d.ts.map +0 -1
- package/lib/runtimeRequestHandlerBuilder.js.map +0 -1
- package/src/packageVersion.ts +0 -9
- package/tsconfig.esnext.json +0 -7
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport * from \"./requestHandlers\";\nexport * from \"./runtimeRequestHandlerBuilder\";\n"]}
|
package/lib/packageVersion.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*
|
|
5
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
|
-
*/
|
|
7
|
-
export declare const pkgName = "@fluidframework/request-handler";
|
|
8
|
-
export declare const pkgVersion = "1.4.0-121020";
|
|
9
|
-
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,oCAAoC,CAAC;AACzD,eAAO,MAAM,UAAU,iBAAiB,CAAC"}
|
package/lib/packageVersion.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*
|
|
5
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
|
-
*/
|
|
7
|
-
export const pkgName = "@fluidframework/request-handler";
|
|
8
|
-
export const pkgVersion = "1.4.0-121020";
|
|
9
|
-
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,iCAAiC,CAAC;AACzD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/request-handler\";\nexport const pkgVersion = \"1.4.0-121020\";\n"]}
|
package/lib/requestHandlers.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IResponse, IRequest, IFluidHandle, IFluidLoadable, FluidObject } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
7
|
-
import { IContainerRuntimeBase } from "@fluidframework/runtime-definitions";
|
|
8
|
-
import { RequestParser } from "@fluidframework/runtime-utils";
|
|
9
|
-
/**
|
|
10
|
-
* A request handler for the container runtime. Each handler should handle a specific request, and return undefined
|
|
11
|
-
* if it does not apply. These handlers are called in series, so there may be other handlers before or after.
|
|
12
|
-
* A handler should only return error if the request is for a route the handler owns, and there is a problem with
|
|
13
|
-
* the route, or fulling the specific request.
|
|
14
|
-
*/
|
|
15
|
-
export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
|
|
16
|
-
/**
|
|
17
|
-
* A request handler to expose access to all root data stores in the container by id.
|
|
18
|
-
* @param request - the request for the root data store. The first path part must be the data store's ID.
|
|
19
|
-
* @param runtime - the container runtime
|
|
20
|
-
* @returns the result of the request
|
|
21
|
-
*/
|
|
22
|
-
export declare const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
|
|
23
|
-
export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
|
|
24
|
-
status: 200;
|
|
25
|
-
mimeType: "fluid/object";
|
|
26
|
-
value: FluidObject;
|
|
27
|
-
};
|
|
28
|
-
export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
|
|
29
|
-
//# sourceMappingURL=requestHandlers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACH,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,WAAW,EAEd,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;;;;;GAKG;AACH,oBAAY,qBAAqB,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,iBAAiB,KAChF,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,YAAmB,QAAQ,WAAW,iBAAiB,mCAgB9F,CAAC;AAEF,eAAO,MAAM,yBAAyB,gBAAiB,WAAW,KAC9D;IAAE,QAAQ,GAAG,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,WAAW,CAAC;CAE/D,CAAC;AA4BF,wBAAgB,mBAAmB,CAAC,CAAC,GAAG,WAAW,GAAG,cAAc,EAChE,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,qBAAqB,GAC/B,YAAY,CAAC,CAAC,CAAC,CAEjB"}
|
package/lib/requestHandlers.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { assert } from "@fluidframework/common-utils";
|
|
6
|
-
import { RequestParser } from "@fluidframework/runtime-utils";
|
|
7
|
-
/**
|
|
8
|
-
* A request handler to expose access to all root data stores in the container by id.
|
|
9
|
-
* @param request - the request for the root data store. The first path part must be the data store's ID.
|
|
10
|
-
* @param runtime - the container runtime
|
|
11
|
-
* @returns the result of the request
|
|
12
|
-
*/
|
|
13
|
-
export const rootDataStoreRequestHandler = async (request, runtime) => {
|
|
14
|
-
var _a;
|
|
15
|
-
const requestParser = RequestParser.create(request);
|
|
16
|
-
const id = requestParser.pathParts[0];
|
|
17
|
-
const wait = typeof ((_a = request.headers) === null || _a === void 0 ? void 0 : _a.wait) === "boolean" ? request.headers.wait : undefined;
|
|
18
|
-
let rootDataStore;
|
|
19
|
-
try {
|
|
20
|
-
// getRootDataStore currently throws if the data store is not found
|
|
21
|
-
rootDataStore = await runtime.getRootDataStore(id, wait);
|
|
22
|
-
}
|
|
23
|
-
catch (error) {
|
|
24
|
-
return undefined; // continue search
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
return rootDataStore.IFluidRouter.request(requestParser.createSubRequest(1));
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
return { status: 500, mimeType: "fluid/object", value: error };
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
export const createFluidObjectResponse = (fluidObject) => {
|
|
34
|
-
return { status: 200, mimeType: "fluid/object", value: fluidObject };
|
|
35
|
-
};
|
|
36
|
-
class LegacyUriHandle {
|
|
37
|
-
constructor(absolutePath, runtime) {
|
|
38
|
-
this.absolutePath = absolutePath;
|
|
39
|
-
this.runtime = runtime;
|
|
40
|
-
this.isAttached = true;
|
|
41
|
-
}
|
|
42
|
-
get IFluidHandle() { return this; }
|
|
43
|
-
attachGraph() {
|
|
44
|
-
assert(false, 0x0ca /* "Trying to use legacy graph attach!" */);
|
|
45
|
-
}
|
|
46
|
-
async get() {
|
|
47
|
-
const response = await this.runtime.IFluidHandleContext.resolveHandle({ url: this.absolutePath });
|
|
48
|
-
if (response.status === 200 && response.mimeType === "fluid/object") {
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
50
|
-
return response.value;
|
|
51
|
-
}
|
|
52
|
-
throw new Error(`Failed to resolve container path ${this.absolutePath}`);
|
|
53
|
-
}
|
|
54
|
-
bind(handle) {
|
|
55
|
-
throw new Error("Cannot bind to LegacyUriHandle");
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
export function handleFromLegacyUri(uri, runtime) {
|
|
59
|
-
return new LegacyUriHandle(uri, runtime);
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=requestHandlers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requestHandlers.js","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAWtD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAW9D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,EAAE,OAAiB,EAAE,OAA0B,EAAE,EAAE;;IAC/F,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,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,IAAI,CAAA,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,IAAI,aAA2B,CAAC;IAChC,IAAI;QACA,mEAAmE;QACnE,aAAa,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;KAC5D;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,SAAS,CAAC,CAAC,kBAAkB;KACvC;IACD,IAAI;QACA,OAAO,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;KAChF;IAAC,OAAO,KAAK,EAAE;QACZ,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;KAClE;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,WAAwB,EACC,EAAE;IACjE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AACzE,CAAC,CAAC;AAEF,MAAM,eAAe;IAKjB,YAAmC,YAAY,EAAkB,OAA8B;QAA5D,iBAAY,GAAZ,YAAY,CAAA;QAAkB,YAAO,GAAP,OAAO,CAAuB;QAJ/E,eAAU,GAAG,IAAI,CAAC;IAKlC,CAAC;IAHD,IAAW,YAAY,KAAmB,OAAO,IAAI,CAAC,CAAC,CAAC;IAKjD,WAAW;QACd,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,0CAA0C,CAAC,CAAC;IACpE,CAAC;IAEM,KAAK,CAAC,GAAG;QACZ,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAClG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,QAAQ,KAAK,cAAc,EAAE;YACjE,+DAA+D;YAC/D,OAAO,QAAQ,CAAC,KAAK,CAAC;SACzB;QACD,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IAC7E,CAAC;IAEM,IAAI,CAAC,MAAoB;QAC5B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;CACJ;AAED,MAAM,UAAU,mBAAmB,CAC/B,GAAW,EACX,OAA8B;IAE9B,OAAO,IAAI,eAAe,CAAI,GAAG,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport {\n IResponse,\n IRequest,\n IFluidHandle,\n IFluidLoadable,\n FluidObject,\n IFluidRouter,\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 */\nexport type RuntimeRequestHandler = (request: RequestParser, runtime: 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 */\nexport const rootDataStoreRequestHandler = async (request: IRequest, runtime: IContainerRuntime) => {\n const requestParser = RequestParser.create(request);\n const id = requestParser.pathParts[0];\n const wait = typeof request.headers?.wait === \"boolean\" ? request.headers.wait : undefined;\n let rootDataStore: IFluidRouter;\n try {\n // getRootDataStore currently throws if the data store is not found\n rootDataStore = await runtime.getRootDataStore(id, wait);\n } catch (error) {\n return undefined; // continue search\n }\n try {\n return rootDataStore.IFluidRouter.request(requestParser.createSubRequest(1));\n } catch (error) {\n return { status: 500, mimeType: \"fluid/object\", value: error };\n }\n};\n\nexport const createFluidObjectResponse = (fluidObject: FluidObject):\n { status: 200; mimeType: \"fluid/object\"; value: FluidObject; } => {\n return { status: 200, mimeType: \"fluid/object\", value: fluidObject };\n};\n\nclass LegacyUriHandle<T = FluidObject & IFluidLoadable> implements IFluidHandle<T> {\n public readonly isAttached = true;\n\n public get IFluidHandle(): IFluidHandle { return this; }\n\n public constructor(public readonly absolutePath, public readonly runtime: IContainerRuntimeBase) {\n }\n\n public attachGraph() {\n assert(false, 0x0ca /* \"Trying to use legacy graph attach!\" */);\n }\n\n public async get(): Promise<any> {\n const response = await this.runtime.IFluidHandleContext.resolveHandle({ url: this.absolutePath });\n if (response.status === 200 && response.mimeType === \"fluid/object\") {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return response.value;\n }\n throw new Error(`Failed to resolve container path ${this.absolutePath}`);\n }\n\n public bind(handle: IFluidHandle) {\n throw new Error(\"Cannot bind to LegacyUriHandle\");\n }\n}\n\nexport function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(\n uri: string,\n runtime: IContainerRuntimeBase,\n): IFluidHandle<T> {\n return new LegacyUriHandle<T>(uri, runtime);\n}\n"]}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
7
|
-
import { RuntimeRequestHandler } from "./requestHandlers";
|
|
8
|
-
/**
|
|
9
|
-
* The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
|
|
10
|
-
* The provided handlers sequentially applied until one is able to satisfy the request.
|
|
11
|
-
*/
|
|
12
|
-
export declare class RuntimeRequestHandlerBuilder {
|
|
13
|
-
private readonly handlers;
|
|
14
|
-
pushHandler(...handlers: RuntimeRequestHandler[]): void;
|
|
15
|
-
handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
|
|
16
|
-
}
|
|
17
|
-
export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
|
|
18
|
-
//# sourceMappingURL=runtimeRequestHandlerBuilder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAElF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;IAGI;AACJ,qBAAa,4BAA4B;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+B;IAEjD,WAAW,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE;IAM1C,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC;CAUhG;AAED,wBAAgB,0BAA0B,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,aAGpD,QAAQ,WAAW,iBAAiB,wBAC9D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGjF;;;IAGI;AACJ,MAAM,OAAO,4BAA4B;IAAzC;QACqB,aAAQ,GAA4B,EAAE,CAAC;IAkB5D,CAAC;IAhBU,WAAW,CAAC,GAAG,QAAiC;QACnD,IAAI,QAAQ,KAAK,SAAS,EAAE;YACxB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;SACnC;IACL,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,OAAiB,EAAE,OAA0B;QACpE,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC7C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAChD,IAAI,QAAQ,KAAK,SAAS,EAAE;gBACxB,OAAO,QAAQ,CAAC;aACnB;SACJ;QACD,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACJ;AAED,MAAM,UAAU,0BAA0B,CAAC,GAAG,QAAiC;IAC3E,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,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC5G,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\";\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 */\nexport class RuntimeRequestHandlerBuilder {\n private readonly handlers: RuntimeRequestHandler[] = [];\n\n public pushHandler(...handlers: RuntimeRequestHandler[]) {\n if (handlers !== undefined) {\n this.handlers.push(...handlers);\n }\n }\n\n public async handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse> {\n const parser = RequestParser.create(request);\n for (const handler of this.handlers) {\n const response = await handler(parser, runtime);\n if (response !== undefined) {\n return response;\n }\n }\n return create404Response(request);\n }\n}\n\nexport function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]) {\n const builder = new RuntimeRequestHandlerBuilder();\n builder.pushHandler(...handlers);\n return async (request: IRequest, runtime: IContainerRuntime) => builder.handleRequest(request, runtime);\n}\n"]}
|
package/src/packageVersion.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*
|
|
5
|
-
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export const pkgName = "@fluidframework/request-handler";
|
|
9
|
-
export const pkgVersion = "1.4.0-121020";
|