@fluidframework/request-handler 2.0.0-internal.7.3.0 → 2.0.0-internal.8.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/api-extractor-lint.json +13 -0
  3. package/api-extractor.json +9 -1
  4. package/api-report/request-handler.api.md +2 -27
  5. package/dist/index.cjs +1 -6
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/request-handler-alpha.d.ts +19 -0
  10. package/dist/request-handler-beta.d.ts +18 -0
  11. package/dist/request-handler-public.d.ts +18 -0
  12. package/dist/request-handler-untrimmed.d.ts +24 -0
  13. package/dist/requestHandlers.cjs +0 -77
  14. package/dist/requestHandlers.cjs.map +1 -1
  15. package/dist/requestHandlers.d.ts +3 -30
  16. package/dist/requestHandlers.d.ts.map +1 -1
  17. package/dist/runtimeRequestHandlerBuilder.cjs +3 -8
  18. package/dist/runtimeRequestHandlerBuilder.cjs.map +1 -1
  19. package/dist/runtimeRequestHandlerBuilder.d.ts +2 -15
  20. package/dist/runtimeRequestHandlerBuilder.d.ts.map +1 -1
  21. package/lib/index.d.ts +2 -2
  22. package/lib/index.d.ts.map +1 -1
  23. package/lib/index.mjs +1 -2
  24. package/lib/index.mjs.map +1 -1
  25. package/lib/request-handler-alpha.d.ts +19 -0
  26. package/lib/request-handler-beta.d.ts +18 -0
  27. package/lib/request-handler-public.d.ts +18 -0
  28. package/lib/request-handler-untrimmed.d.ts +24 -0
  29. package/lib/requestHandlers.d.ts +3 -30
  30. package/lib/requestHandlers.d.ts.map +1 -1
  31. package/lib/requestHandlers.mjs +1 -73
  32. package/lib/requestHandlers.mjs.map +1 -1
  33. package/lib/runtimeRequestHandlerBuilder.d.ts +3 -16
  34. package/lib/runtimeRequestHandlerBuilder.d.ts.map +1 -1
  35. package/lib/runtimeRequestHandlerBuilder.mjs +3 -7
  36. package/lib/runtimeRequestHandlerBuilder.mjs.map +1 -1
  37. package/package.json +50 -26
  38. package/src/index.ts +2 -10
  39. package/src/requestHandlers.ts +3 -99
  40. package/src/runtimeRequestHandlerBuilder.ts +3 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @fluidframework/request-handler
2
2
 
3
+ ## 2.0.0-internal.8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - aqueduct: Removed requestHandler utilities [9a451d4946](https://github.com/microsoft/FluidFramework/commits/9a451d4946b5c51a52e4d1ab5bf51e7b285b0d74)
8
+
9
+ The following `requestHandler` utilities have been removed:
10
+
11
+ - `makeModelRequestHandler`
12
+ - `defaultFluidObjectRequestHandler`
13
+ - `defaultRouteRequestHandler`
14
+ - `mountableViewRequestHandler`
15
+ - `createFluidObjectResponse`
16
+ - `rootDataStoreRequestHandler`
17
+ - `handleFromLegacyUri`
18
+ - `RuntimeRequestHandlerBuilder`
19
+
20
+ Please migrate all usage to the new `entryPoint` pattern.
21
+
22
+ See [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md) for more details.
23
+
24
+ ## 2.0.0-internal.7.4.0
25
+
26
+ Dependency updates only.
27
+
3
28
  ## 2.0.0-internal.7.3.0
4
29
 
5
30
  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
  }
@@ -4,42 +4,17 @@
4
4
 
5
5
  ```ts
6
6
 
7
- import { FluidObject } from '@fluidframework/core-interfaces';
8
7
  import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
9
- import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
10
- import { IFluidHandle } from '@fluidframework/core-interfaces';
11
- import { IFluidLoadable } from '@fluidframework/core-interfaces';
12
8
  import { IRequest } from '@fluidframework/core-interfaces';
13
9
  import { IResponse } from '@fluidframework/core-interfaces';
14
10
  import { RequestParser } from '@fluidframework/runtime-utils';
15
11
 
16
- // @public @deprecated (undocumented)
12
+ // @internal @deprecated (undocumented)
17
13
  export function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
18
14
 
19
- // @public @deprecated (undocumented)
20
- export const createFluidObjectResponse: (fluidObject: FluidObject) => {
21
- status: 200;
22
- mimeType: "fluid/object";
23
- value: FluidObject;
24
- };
25
-
26
- // @public @deprecated (undocumented)
27
- export function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
28
-
29
- // @public @deprecated
30
- export const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
31
-
32
- // @public @deprecated
15
+ // @alpha @deprecated
33
16
  export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
34
17
 
35
- // @public @deprecated
36
- export class RuntimeRequestHandlerBuilder {
37
- // (undocumented)
38
- handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
39
- // (undocumented)
40
- pushHandler(...handlers: RuntimeRequestHandler[]): void;
41
- }
42
-
43
18
  // (No @packageDocumentation comment for this package)
44
19
 
45
20
  ```
package/dist/index.cjs CHANGED
@@ -4,12 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.RuntimeRequestHandlerBuilder = exports.buildRuntimeRequestHandler = exports.rootDataStoreRequestHandler = exports.handleFromLegacyUri = exports.createFluidObjectResponse = void 0;
8
- var requestHandlers_1 = require("./requestHandlers.cjs");
9
- Object.defineProperty(exports, "createFluidObjectResponse", { enumerable: true, get: function () { return requestHandlers_1.createFluidObjectResponse; } });
10
- Object.defineProperty(exports, "handleFromLegacyUri", { enumerable: true, get: function () { return requestHandlers_1.handleFromLegacyUri; } });
11
- Object.defineProperty(exports, "rootDataStoreRequestHandler", { enumerable: true, get: function () { return requestHandlers_1.rootDataStoreRequestHandler; } });
7
+ exports.buildRuntimeRequestHandler = void 0;
12
8
  var runtimeRequestHandlerBuilder_1 = require("./runtimeRequestHandlerBuilder.cjs");
13
9
  Object.defineProperty(exports, "buildRuntimeRequestHandler", { enumerable: true, get: function () { return runtimeRequestHandlerBuilder_1.buildRuntimeRequestHandler; } });
14
- Object.defineProperty(exports, "RuntimeRequestHandlerBuilder", { enumerable: true, get: function () { return runtimeRequestHandlerBuilder_1.RuntimeRequestHandlerBuilder; } });
15
10
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yDAK2B;AAJ1B,4HAAA,yBAAyB,OAAA;AACzB,sHAAA,mBAAmB,OAAA;AACnB,8HAAA,2BAA2B,OAAA;AAG5B,mFAGwC;AAFvC,0IAAA,0BAA0B,OAAA;AAC1B,4IAAA,4BAA4B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreateFluidObjectResponse,\n\thandleFromLegacyUri,\n\trootDataStoreRequestHandler,\n\tRuntimeRequestHandler,\n} from \"./requestHandlers\";\nexport {\n\tbuildRuntimeRequestHandler,\n\tRuntimeRequestHandlerBuilder,\n} from \"./runtimeRequestHandlerBuilder\";\n"]}
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"]}
package/dist/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 { RuntimeRequestHandler } from "./requestHandlers";
6
+ export { buildRuntimeRequestHandler } from "./runtimeRequestHandlerBuilder";
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;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,19 @@
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 { }
@@ -0,0 +1,18 @@
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: IRequest */
11
+
12
+ /* Excluded from this release type: IResponse */
13
+
14
+ /* Excluded from this release type: RequestParser */
15
+
16
+ /* Excluded from this release type: RuntimeRequestHandler */
17
+
18
+ export { }
@@ -0,0 +1,18 @@
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: IRequest */
11
+
12
+ /* Excluded from this release type: IResponse */
13
+
14
+ /* Excluded from this release type: RequestParser */
15
+
16
+ /* Excluded from this release type: RuntimeRequestHandler */
17
+
18
+ export { }
@@ -0,0 +1,24 @@
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 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
8
+ *
9
+ * @internal
10
+ */
11
+ export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
12
+
13
+ /**
14
+ * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
15
+ * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
16
+ * A handler should only return error if the request is for a route the handler owns, and there is a problem with
17
+ * the route, or fulling the specific request.
18
+ * @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
19
+ *
20
+ * @alpha
21
+ */
22
+ export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
23
+
24
+ export { }
@@ -4,81 +4,4 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.handleFromLegacyUri = exports.createFluidObjectResponse = exports.rootDataStoreRequestHandler = void 0;
8
- const core_utils_1 = require("@fluidframework/core-utils");
9
- const runtime_utils_1 = require("@fluidframework/runtime-utils");
10
- /**
11
- * A request handler to expose access to all root data stores in the container by id.
12
- * @param request - the request for the root data store. The first path part must be the data store's ID.
13
- * @param runtime - the container runtime
14
- * @returns the result of the request
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
18
- */
19
- const rootDataStoreRequestHandler = async (request, runtime) => {
20
- const requestParser = runtime_utils_1.RequestParser.create(request);
21
- const id = requestParser.pathParts[0];
22
- const wait = typeof request.headers?.wait === "boolean" ? request.headers.wait : undefined;
23
- // eslint-disable-next-line import/no-deprecated
24
- let rootDataStore;
25
- try {
26
- // getRootDataStore currently throws if the data store is not found
27
- rootDataStore = await runtime.getRootDataStore(id, wait);
28
- }
29
- catch (error) {
30
- return undefined; // continue search
31
- }
32
- try {
33
- return await rootDataStore.IFluidRouter.request(requestParser.createSubRequest(1));
34
- }
35
- catch (error) {
36
- return { status: 500, mimeType: "fluid/object", value: error };
37
- }
38
- };
39
- exports.rootDataStoreRequestHandler = rootDataStoreRequestHandler;
40
- /**
41
- * @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
44
- */
45
- const createFluidObjectResponse = (fluidObject) => {
46
- return { status: 200, mimeType: "fluid/object", value: fluidObject };
47
- };
48
- exports.createFluidObjectResponse = createFluidObjectResponse;
49
- class LegacyUriHandle {
50
- get IFluidHandle() {
51
- return this;
52
- }
53
- constructor(absolutePath, runtime) {
54
- this.absolutePath = absolutePath;
55
- this.runtime = runtime;
56
- this.isAttached = true;
57
- }
58
- attachGraph() {
59
- (0, core_utils_1.assert)(false, 0x0ca /* "Trying to use legacy graph attach!" */);
60
- }
61
- async get() {
62
- const response = await this.runtime.IFluidHandleContext.resolveHandle({
63
- url: this.absolutePath,
64
- });
65
- if (response.status === 200 && response.mimeType === "fluid/object") {
66
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
67
- return response.value;
68
- }
69
- throw new Error(`Failed to resolve container path ${this.absolutePath}`);
70
- }
71
- bind(handle) {
72
- throw new Error("Cannot bind to LegacyUriHandle");
73
- }
74
- }
75
- /**
76
- * @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
79
- */
80
- function handleFromLegacyUri(uri, runtime) {
81
- return new LegacyUriHandle(uri, runtime);
82
- }
83
- exports.handleFromLegacyUri = handleFromLegacyUri;
84
7
  //# sourceMappingURL=requestHandlers.cjs.map
@@ -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,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,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;KACnF;IAAC,OAAO,KAAK,EAAE;QACf,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;KAC/D;AACF,CAAC,CAAC;AApBW,QAAA,2BAA2B,+BAoBtC;AAEF;;;;GAIG;AACI,MAAM,yBAAyB,GAAG,CACxC,WAAwB,EACwC,EAAE;IAClE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AACtE,CAAC,CAAC;AAJW,QAAA,yBAAyB,6BAIpC;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,IAAA,mBAAM,EAAC,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;;;;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","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"]}
@@ -2,44 +2,17 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IResponse, IRequest, IFluidHandle, IFluidLoadable, FluidObject } from "@fluidframework/core-interfaces";
5
+ import { IResponse } from "@fluidframework/core-interfaces";
6
6
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
7
- import { IContainerRuntimeBase } from "@fluidframework/runtime-definitions";
8
7
  import { RequestParser } from "@fluidframework/runtime-utils";
9
8
  /**
10
9
  * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
11
10
  * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
12
11
  * A handler should only return error if the request is for a route the handler owns, and there is a problem with
13
12
  * the route, or fulling the specific request.
14
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
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
15
14
  *
16
- * @public
15
+ * @alpha
17
16
  */
18
17
  export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
19
- /**
20
- * A request handler to expose access to all root data stores in the container by id.
21
- * @param request - the request for the root data store. The first path part must be the data store's ID.
22
- * @param runtime - the container runtime
23
- * @returns the result of the request
24
- * @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
27
- */
28
- export declare const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
29
- /**
30
- * @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
33
- */
34
- export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
35
- status: 200;
36
- mimeType: "fluid/object";
37
- value: FluidObject;
38
- };
39
- /**
40
- * @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
43
- */
44
- export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
45
18
  //# 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;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,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"}
@@ -4,15 +4,11 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.buildRuntimeRequestHandler = exports.RuntimeRequestHandlerBuilder = void 0;
7
+ exports.buildRuntimeRequestHandler = void 0;
8
8
  const runtime_utils_1 = require("@fluidframework/runtime-utils");
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.
12
- *
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
16
12
  */
17
13
  class RuntimeRequestHandlerBuilder {
18
14
  constructor() {
@@ -36,11 +32,10 @@ class RuntimeRequestHandlerBuilder {
36
32
  return (0, runtime_utils_1.create404Response)(request);
37
33
  }
38
34
  }
39
- exports.RuntimeRequestHandlerBuilder = RuntimeRequestHandlerBuilder;
40
35
  /**
41
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
36
+ * @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
42
37
  *
43
- * @public
38
+ * @internal
44
39
  */
45
40
  // eslint-disable-next-line import/no-deprecated
46
41
  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;;;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"]}
@@ -6,22 +6,9 @@ import { IRequest, IResponse } from "@fluidframework/core-interfaces";
6
6
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
7
7
  import { RuntimeRequestHandler } from "./requestHandlers";
8
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.
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
11
10
  *
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
15
- */
16
- export declare class RuntimeRequestHandlerBuilder {
17
- private readonly handlers;
18
- pushHandler(...handlers: RuntimeRequestHandler[]): void;
19
- handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
20
- }
21
- /**
22
- * @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
11
+ * @internal
25
12
  */
26
13
  export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
27
14
  //# 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;AA6B1D;;;;GAIG;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 { RuntimeRequestHandler } from "./requestHandlers.mjs";
6
+ export { buildRuntimeRequestHandler } 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,EAAE,qBAAqB,EAAE;OACzB,EAAE,0BAA0B,EAAE"}
package/lib/index.mjs CHANGED
@@ -2,6 +2,5 @@
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, } from "./requestHandlers.mjs";
6
- export { buildRuntimeRequestHandler, RuntimeRequestHandlerBuilder, } from "./runtimeRequestHandlerBuilder.mjs";
5
+ export { buildRuntimeRequestHandler } from "./runtimeRequestHandlerBuilder.mjs";
7
6
  //# sourceMappingURL=index.mjs.map
package/lib/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,GAE3B;OACM,EACN,0BAA0B,EAC1B,4BAA4B,GAC5B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tcreateFluidObjectResponse,\n\thandleFromLegacyUri,\n\trootDataStoreRequestHandler,\n\tRuntimeRequestHandler,\n} from \"./requestHandlers\";\nexport {\n\tbuildRuntimeRequestHandler,\n\tRuntimeRequestHandlerBuilder,\n} from \"./runtimeRequestHandlerBuilder\";\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAAE,0BAA0B,EAAE","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"]}
@@ -0,0 +1,19 @@
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 { }
@@ -0,0 +1,18 @@
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: IRequest */
11
+
12
+ /* Excluded from this release type: IResponse */
13
+
14
+ /* Excluded from this release type: RequestParser */
15
+
16
+ /* Excluded from this release type: RuntimeRequestHandler */
17
+
18
+ export { }
@@ -0,0 +1,18 @@
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: IRequest */
11
+
12
+ /* Excluded from this release type: IResponse */
13
+
14
+ /* Excluded from this release type: RequestParser */
15
+
16
+ /* Excluded from this release type: RuntimeRequestHandler */
17
+
18
+ export { }
@@ -0,0 +1,24 @@
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 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
8
+ *
9
+ * @internal
10
+ */
11
+ export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
12
+
13
+ /**
14
+ * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
15
+ * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
16
+ * A handler should only return error if the request is for a route the handler owns, and there is a problem with
17
+ * the route, or fulling the specific request.
18
+ * @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
19
+ *
20
+ * @alpha
21
+ */
22
+ export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
23
+
24
+ export { }
@@ -2,44 +2,17 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { IResponse, IRequest, IFluidHandle, IFluidLoadable, FluidObject } from "@fluidframework/core-interfaces";
5
+ import { IResponse } from "@fluidframework/core-interfaces";
6
6
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
7
- import { IContainerRuntimeBase } from "@fluidframework/runtime-definitions";
8
7
  import { RequestParser } from "@fluidframework/runtime-utils";
9
8
  /**
10
9
  * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
11
10
  * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
12
11
  * A handler should only return error if the request is for a route the handler owns, and there is a problem with
13
12
  * the route, or fulling the specific request.
14
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
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
15
14
  *
16
- * @public
15
+ * @alpha
17
16
  */
18
17
  export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
19
- /**
20
- * A request handler to expose access to all root data stores in the container by id.
21
- * @param request - the request for the root data store. The first path part must be the data store's ID.
22
- * @param runtime - the container runtime
23
- * @returns the result of the request
24
- * @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
27
- */
28
- export declare const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
29
- /**
30
- * @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
33
- */
34
- export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
35
- status: 200;
36
- mimeType: "fluid/object";
37
- value: FluidObject;
38
- };
39
- /**
40
- * @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
43
- */
44
- export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
45
18
  //# 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;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"}
@@ -2,77 +2,5 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { assert } from "@fluidframework/core-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
- * @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
15
- */
16
- export const rootDataStoreRequestHandler = async (request, runtime) => {
17
- const requestParser = RequestParser.create(request);
18
- const id = requestParser.pathParts[0];
19
- const wait = typeof request.headers?.wait === "boolean" ? request.headers.wait : undefined;
20
- // eslint-disable-next-line import/no-deprecated
21
- let rootDataStore;
22
- try {
23
- // getRootDataStore currently throws if the data store is not found
24
- rootDataStore = await runtime.getRootDataStore(id, wait);
25
- }
26
- catch (error) {
27
- return undefined; // continue search
28
- }
29
- try {
30
- return await rootDataStore.IFluidRouter.request(requestParser.createSubRequest(1));
31
- }
32
- catch (error) {
33
- return { status: 500, mimeType: "fluid/object", value: error };
34
- }
35
- };
36
- /**
37
- * @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
40
- */
41
- export const createFluidObjectResponse = (fluidObject) => {
42
- return { status: 200, mimeType: "fluid/object", value: fluidObject };
43
- };
44
- class LegacyUriHandle {
45
- get IFluidHandle() {
46
- return this;
47
- }
48
- constructor(absolutePath, runtime) {
49
- this.absolutePath = absolutePath;
50
- this.runtime = runtime;
51
- this.isAttached = true;
52
- }
53
- attachGraph() {
54
- assert(false, 0x0ca /* "Trying to use legacy graph attach!" */);
55
- }
56
- async get() {
57
- const response = await this.runtime.IFluidHandleContext.resolveHandle({
58
- url: this.absolutePath,
59
- });
60
- if (response.status === 200 && response.mimeType === "fluid/object") {
61
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
62
- return response.value;
63
- }
64
- throw new Error(`Failed to resolve container path ${this.absolutePath}`);
65
- }
66
- bind(handle) {
67
- throw new Error("Cannot bind to LegacyUriHandle");
68
- }
69
- }
70
- /**
71
- * @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
74
- */
75
- export function handleFromLegacyUri(uri, runtime) {
76
- return new LegacyUriHandle(uri, runtime);
77
- }
5
+ export {};
78
6
  //# sourceMappingURL=requestHandlers.mjs.map
@@ -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,OAAO,MAAM,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;KACnF;IAAC,OAAO,KAAK,EAAE;QACf,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;KAC/D;AACF,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACxC,WAAwB,EACwC,EAAE;IAClE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,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;;;;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 LegacyUriHandle<T>(uri, runtime);\n}\n"]}
1
+ {"version":3,"file":"requestHandlers.mjs","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"]}
@@ -4,24 +4,11 @@
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
- * 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.
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
11
10
  *
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
15
- */
16
- export declare class RuntimeRequestHandlerBuilder {
17
- private readonly handlers;
18
- pushHandler(...handlers: RuntimeRequestHandler[]): void;
19
- handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
20
- }
21
- /**
22
- * @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
11
+ * @internal
25
12
  */
26
13
  export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
27
14
  //# 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;AA6BhC;;;;GAIG;AAEH,wBAAgB,0BAA0B,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,aAGvD,QAAQ,WAAW,iBAAiB,wBAE3D"}
@@ -6,12 +6,8 @@ import { RequestParser, create404Response } from "@fluidframework/runtime-utils"
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.
9
- *
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
13
9
  */
14
- export class RuntimeRequestHandlerBuilder {
10
+ class RuntimeRequestHandlerBuilder {
15
11
  constructor() {
16
12
  // eslint-disable-next-line import/no-deprecated
17
13
  this.handlers = [];
@@ -34,9 +30,9 @@ export class RuntimeRequestHandlerBuilder {
34
30
  }
35
31
  }
36
32
  /**
37
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
33
+ * @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
38
34
  *
39
- * @public
35
+ * @internal
40
36
  */
41
37
  // eslint-disable-next-line import/no-deprecated
42
38
  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;;;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;;;;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 */\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/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.8.0.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.8.0.0 <2.0.0-internal.8.1.0",
39
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
40
+ "@fluidframework/core-utils": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
41
+ "@fluidframework/runtime-definitions": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.0",
42
+ "@fluidframework/runtime-utils": ">=2.0.0-internal.8.0.0 <2.0.0-internal.8.1.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.8.0.0 <2.0.0-internal.8.1.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.8.0.0 <2.0.0-internal.8.1.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,59 @@
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
- "broken": {}
84
+ "broken": {
85
+ "RemovedVariableDeclaration_createFluidObjectResponse": {
86
+ "forwardCompat": false,
87
+ "backCompat": false
88
+ },
89
+ "RemovedVariableDeclaration_rootDataStoreRequestHandler": {
90
+ "forwardCompat": false,
91
+ "backCompat": false
92
+ },
93
+ "RemovedFunctionDeclaration_handleFromLegacyUri": {
94
+ "forwardCompat": false,
95
+ "backCompat": false
96
+ },
97
+ "RemovedClassDeclaration_RuntimeRequestHandlerBuilder": {
98
+ "forwardCompat": false,
99
+ "backCompat": false
100
+ }
101
+ }
83
102
  },
84
103
  "scripts": {
104
+ "api": "fluid-build . --task api",
105
+ "api-extractor:commonjs": "api-extractor run --local",
106
+ "api-extractor:esnext": "copyfiles -u 1 \"dist/**/*-@(alpha|beta|public|untrimmed).d.ts\" lib",
85
107
  "build": "fluid-build . --task build",
86
108
  "build:commonjs": "fluid-build . --task commonjs",
87
109
  "build:compile": "fluid-build . --task compile",
88
- "build:docs": "api-extractor run --local",
110
+ "build:docs": "fluid-build . --task api",
89
111
  "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
90
112
  "build:test": "tsc-multi --config ./tsc-multi.test.json",
113
+ "check:are-the-types-wrong": "attw --pack",
114
+ "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
91
115
  "ci:build:docs": "api-extractor run",
92
116
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
93
117
  "eslint": "eslint --format stylish src",
94
118
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
95
119
  "format": "npm run prettier:fix",
96
- "lint": "npm run prettier && npm run eslint",
120
+ "lint": "npm run prettier && npm run check:release-tags && npm run eslint",
97
121
  "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",
122
+ "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
123
+ "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
100
124
  "test": "npm run test:mocha",
101
125
  "test:coverage": "c8 npm test",
102
126
  "test:mocha": "mocha --ignore \"dist/test/types/*\" --recursive dist/test --exit -r node_modules/@fluidframework/mocha-test-setup",
package/src/index.ts CHANGED
@@ -3,13 +3,5 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- export {
7
- createFluidObjectResponse,
8
- handleFromLegacyUri,
9
- rootDataStoreRequestHandler,
10
- RuntimeRequestHandler,
11
- } from "./requestHandlers";
12
- export {
13
- buildRuntimeRequestHandler,
14
- RuntimeRequestHandlerBuilder,
15
- } from "./runtimeRequestHandlerBuilder";
6
+ export { RuntimeRequestHandler } from "./requestHandlers";
7
+ export { buildRuntimeRequestHandler } from "./runtimeRequestHandlerBuilder";
@@ -3,18 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { assert } from "@fluidframework/core-utils";
7
- import {
8
- IResponse,
9
- IRequest,
10
- IFluidHandle,
11
- IFluidLoadable,
12
- FluidObject,
13
- // eslint-disable-next-line import/no-deprecated
14
- IFluidRouter,
15
- } from "@fluidframework/core-interfaces";
6
+ import { IResponse } from "@fluidframework/core-interfaces";
16
7
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
17
- import { IContainerRuntimeBase } from "@fluidframework/runtime-definitions";
18
8
  import { RequestParser } from "@fluidframework/runtime-utils";
19
9
 
20
10
  /**
@@ -22,97 +12,11 @@ import { RequestParser } from "@fluidframework/runtime-utils";
22
12
  * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
23
13
  * A handler should only return error if the request is for a route the handler owns, and there is a problem with
24
14
  * the route, or fulling the specific request.
25
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
15
+ * @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
26
16
  *
27
- * @public
17
+ * @alpha
28
18
  */
29
19
  export type RuntimeRequestHandler = (
30
20
  request: RequestParser,
31
21
  runtime: IContainerRuntime,
32
22
  ) => Promise<IResponse | undefined>;
33
-
34
- /**
35
- * A request handler to expose access to all root data stores in the container by id.
36
- * @param request - the request for the root data store. The first path part must be the data store's ID.
37
- * @param runtime - the container runtime
38
- * @returns the result of the request
39
- * @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
42
- */
43
- export const rootDataStoreRequestHandler = async (
44
- request: IRequest,
45
- runtime: IContainerRuntime,
46
- ) => {
47
- const requestParser = RequestParser.create(request);
48
- const id = requestParser.pathParts[0];
49
- const wait = typeof request.headers?.wait === "boolean" ? request.headers.wait : undefined;
50
- // eslint-disable-next-line import/no-deprecated
51
- let rootDataStore: IFluidRouter;
52
- try {
53
- // getRootDataStore currently throws if the data store is not found
54
- rootDataStore = await runtime.getRootDataStore(id, wait);
55
- } catch (error) {
56
- return undefined; // continue search
57
- }
58
- try {
59
- return await rootDataStore.IFluidRouter.request(requestParser.createSubRequest(1));
60
- } catch (error) {
61
- return { status: 500, mimeType: "fluid/object", value: error };
62
- }
63
- };
64
-
65
- /**
66
- * @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
69
- */
70
- export const createFluidObjectResponse = (
71
- fluidObject: FluidObject,
72
- ): { status: 200; mimeType: "fluid/object"; value: FluidObject } => {
73
- return { status: 200, mimeType: "fluid/object", value: fluidObject };
74
- };
75
-
76
- class LegacyUriHandle<T = FluidObject & IFluidLoadable> implements IFluidHandle<T> {
77
- public readonly isAttached = true;
78
-
79
- public get IFluidHandle(): IFluidHandle {
80
- return this;
81
- }
82
-
83
- public constructor(
84
- public readonly absolutePath,
85
- public readonly runtime: IContainerRuntimeBase,
86
- ) {}
87
-
88
- public attachGraph() {
89
- assert(false, 0x0ca /* "Trying to use legacy graph attach!" */);
90
- }
91
-
92
- public async get(): Promise<any> {
93
- const response = await this.runtime.IFluidHandleContext.resolveHandle({
94
- url: this.absolutePath,
95
- });
96
- if (response.status === 200 && response.mimeType === "fluid/object") {
97
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
98
- return response.value;
99
- }
100
- throw new Error(`Failed to resolve container path ${this.absolutePath}`);
101
- }
102
-
103
- public bind(handle: IFluidHandle) {
104
- throw new Error("Cannot bind to LegacyUriHandle");
105
- }
106
- }
107
-
108
- /**
109
- * @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
112
- */
113
- export function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(
114
- uri: string,
115
- runtime: IContainerRuntimeBase,
116
- ): IFluidHandle<T> {
117
- return new LegacyUriHandle<T>(uri, runtime);
118
- }
@@ -12,12 +12,8 @@ import { RuntimeRequestHandler } from "./requestHandlers";
12
12
  /**
13
13
  * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
14
14
  * The provided handlers sequentially applied until one is able to satisfy the request.
15
- *
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
19
15
  */
20
- export class RuntimeRequestHandlerBuilder {
16
+ class RuntimeRequestHandlerBuilder {
21
17
  // eslint-disable-next-line import/no-deprecated
22
18
  private readonly handlers: RuntimeRequestHandler[] = [];
23
19
 
@@ -41,9 +37,9 @@ export class RuntimeRequestHandlerBuilder {
41
37
  }
42
38
 
43
39
  /**
44
- * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
40
+ * @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
45
41
  *
46
- * @public
42
+ * @internal
47
43
  */
48
44
  // eslint-disable-next-line import/no-deprecated
49
45
  export function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]) {