@fluidframework/request-handler 2.0.0-internal.6.4.0 → 2.0.0-internal.7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @fluidframework/request-handler
2
2
 
3
+ ## 2.0.0-internal.7.1.0
4
+
5
+ Dependency updates only.
6
+
7
+ ## 2.0.0-internal.7.0.0
8
+
9
+ ### Major Changes
10
+
11
+ - DEPRECATED: container-runtime: requestHandlers are deprecated [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
12
+
13
+ The concept of `requestHandlers` has been deprecated. Please migrate all usage of the following APIs to the new `entryPoint` pattern:
14
+
15
+ - `requestHandler` property in `ContainerRuntime.loadRuntime(...)`
16
+ - `RuntimeRequestHandler`
17
+ - `RuntimeRequestHandlerBuilder`
18
+ - `defaultFluidObjectRequestHandler(...)`
19
+ - `defaultRouteRequestHandler(...)`
20
+ - `mountableViewRequestHandler(...)`
21
+ - `buildRuntimeRequestHandler(...)`
22
+ - `createFluidObjectResponse(...)`
23
+ - `handleFromLegacyUri(...)`
24
+ - `rootDataStoreRequestHandler(...)`
25
+
26
+ See [Removing-IFluidRouter.md](https://github.com/microsoft/FluidFramework/blob/main/packages/common/core-interfaces/Removing-IFluidRouter.md) for more details.
27
+
28
+ - Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
29
+
30
+ The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
31
+
3
32
  ## 2.0.0-internal.6.4.0
4
33
 
5
34
  ### Minor Changes
@@ -1,4 +1,4 @@
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-common-report.json"
3
+ "extends": "@fluidframework/build-common/api-extractor-base.json"
4
4
  }
@@ -0,0 +1,45 @@
1
+ ## API Report File for "@fluidframework/request-handler"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { FluidObject } from '@fluidframework/core-interfaces';
8
+ 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
+ import { IRequest } from '@fluidframework/core-interfaces';
13
+ import { IResponse } from '@fluidframework/core-interfaces';
14
+ import { RequestParser } from '@fluidframework/runtime-utils';
15
+
16
+ // @public @deprecated (undocumented)
17
+ export function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
18
+
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
33
+ export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
34
+
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
+ // (No @packageDocumentation comment for this package)
44
+
45
+ ```
@@ -0,0 +1,71 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /**
11
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
12
+ *
13
+ * @public
14
+ */
15
+ export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
16
+
17
+ /**
18
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
19
+ *
20
+ * @public
21
+ */
22
+ export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
23
+ status: 200;
24
+ mimeType: "fluid/object";
25
+ value: FluidObject;
26
+ };
27
+
28
+ /**
29
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
30
+ *
31
+ * @public
32
+ */
33
+ export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
34
+
35
+ /**
36
+ * A request handler to expose access to all root data stores in the container by id.
37
+ * @param request - the request for the root data store. The first path part must be the data store's ID.
38
+ * @param runtime - the container runtime
39
+ * @returns the result of the request
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 const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
45
+
46
+ /**
47
+ * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
48
+ * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
49
+ * A handler should only return error if the request is for a route the handler owns, and there is a problem with
50
+ * the route, or fulling the specific request.
51
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
52
+ *
53
+ * @public
54
+ */
55
+ export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
56
+
57
+ /**
58
+ * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
59
+ * The provided handlers sequentially applied until one is able to satisfy the request.
60
+ *
61
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
62
+ *
63
+ * @public
64
+ */
65
+ export declare class RuntimeRequestHandlerBuilder {
66
+ private readonly handlers;
67
+ pushHandler(...handlers: RuntimeRequestHandler[]): void;
68
+ handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
69
+ }
70
+
71
+ export { }
@@ -0,0 +1,71 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /**
11
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
12
+ *
13
+ * @public
14
+ */
15
+ export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
16
+
17
+ /**
18
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
19
+ *
20
+ * @public
21
+ */
22
+ export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
23
+ status: 200;
24
+ mimeType: "fluid/object";
25
+ value: FluidObject;
26
+ };
27
+
28
+ /**
29
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
30
+ *
31
+ * @public
32
+ */
33
+ export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
34
+
35
+ /**
36
+ * A request handler to expose access to all root data stores in the container by id.
37
+ * @param request - the request for the root data store. The first path part must be the data store's ID.
38
+ * @param runtime - the container runtime
39
+ * @returns the result of the request
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 const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
45
+
46
+ /**
47
+ * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
48
+ * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
49
+ * A handler should only return error if the request is for a route the handler owns, and there is a problem with
50
+ * the route, or fulling the specific request.
51
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
52
+ *
53
+ * @public
54
+ */
55
+ export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
56
+
57
+ /**
58
+ * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
59
+ * The provided handlers sequentially applied until one is able to satisfy the request.
60
+ *
61
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
62
+ *
63
+ * @public
64
+ */
65
+ export declare class RuntimeRequestHandlerBuilder {
66
+ private readonly handlers;
67
+ pushHandler(...handlers: RuntimeRequestHandler[]): void;
68
+ handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
69
+ }
70
+
71
+ export { }
@@ -0,0 +1,71 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /**
11
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
12
+ *
13
+ * @public
14
+ */
15
+ export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
16
+
17
+ /**
18
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
19
+ *
20
+ * @public
21
+ */
22
+ export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
23
+ status: 200;
24
+ mimeType: "fluid/object";
25
+ value: FluidObject;
26
+ };
27
+
28
+ /**
29
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
30
+ *
31
+ * @public
32
+ */
33
+ export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
34
+
35
+ /**
36
+ * A request handler to expose access to all root data stores in the container by id.
37
+ * @param request - the request for the root data store. The first path part must be the data store's ID.
38
+ * @param runtime - the container runtime
39
+ * @returns the result of the request
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 const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
45
+
46
+ /**
47
+ * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
48
+ * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
49
+ * A handler should only return error if the request is for a route the handler owns, and there is a problem with
50
+ * the route, or fulling the specific request.
51
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
52
+ *
53
+ * @public
54
+ */
55
+ export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
56
+
57
+ /**
58
+ * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
59
+ * The provided handlers sequentially applied until one is able to satisfy the request.
60
+ *
61
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
62
+ *
63
+ * @public
64
+ */
65
+ export declare class RuntimeRequestHandlerBuilder {
66
+ private readonly handlers;
67
+ pushHandler(...handlers: RuntimeRequestHandler[]): void;
68
+ handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
69
+ }
70
+
71
+ export { }
@@ -0,0 +1,71 @@
1
+ import { FluidObject } from '@fluidframework/core-interfaces';
2
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
3
+ import { IContainerRuntimeBase } from '@fluidframework/runtime-definitions';
4
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
5
+ import { IFluidLoadable } from '@fluidframework/core-interfaces';
6
+ import { IRequest } from '@fluidframework/core-interfaces';
7
+ import { IResponse } from '@fluidframework/core-interfaces';
8
+ import { RequestParser } from '@fluidframework/runtime-utils';
9
+
10
+ /**
11
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
12
+ *
13
+ * @public
14
+ */
15
+ export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
16
+
17
+ /**
18
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
19
+ *
20
+ * @public
21
+ */
22
+ export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
23
+ status: 200;
24
+ mimeType: "fluid/object";
25
+ value: FluidObject;
26
+ };
27
+
28
+ /**
29
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
30
+ *
31
+ * @public
32
+ */
33
+ export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
34
+
35
+ /**
36
+ * A request handler to expose access to all root data stores in the container by id.
37
+ * @param request - the request for the root data store. The first path part must be the data store's ID.
38
+ * @param runtime - the container runtime
39
+ * @returns the result of the request
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 const rootDataStoreRequestHandler: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
45
+
46
+ /**
47
+ * A request handler for the container runtime. Each handler should handle a specific request, and return undefined
48
+ * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
49
+ * A handler should only return error if the request is for a route the handler owns, and there is a problem with
50
+ * the route, or fulling the specific request.
51
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
52
+ *
53
+ * @public
54
+ */
55
+ export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
56
+
57
+ /**
58
+ * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
59
+ * The provided handlers sequentially applied until one is able to satisfy the request.
60
+ *
61
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
62
+ *
63
+ * @public
64
+ */
65
+ export declare class RuntimeRequestHandlerBuilder {
66
+ private readonly handlers;
67
+ pushHandler(...handlers: RuntimeRequestHandler[]): void;
68
+ handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
69
+ }
70
+
71
+ export { }
@@ -11,19 +11,35 @@ import { RequestParser } from "@fluidframework/runtime-utils";
11
11
  * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
12
12
  * A handler should only return error if the request is for a route the handler owns, and there is a problem with
13
13
  * the route, or fulling the specific request.
14
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
15
+ *
16
+ * @public
14
17
  */
15
- export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
18
+ export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
16
19
  /**
17
20
  * A request handler to expose access to all root data stores in the container by id.
18
21
  * @param request - the request for the root data store. The first path part must be the data store's ID.
19
22
  * @param runtime - the container runtime
20
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
21
27
  */
22
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
+ */
23
34
  export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
24
35
  status: 200;
25
36
  mimeType: "fluid/object";
26
37
  value: FluidObject;
27
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
+ */
28
44
  export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
29
45
  //# 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,EAEX,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,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,iBAAiB,KACtB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,YAC9B,QAAQ,WACR,iBAAiB,mCAiB1B,CAAC;AAEF,eAAO,MAAM,yBAAyB,gBACxB,WAAW,KACtB;IAAE,QAAQ,GAAG,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAE7D,CAAC;AAkCF,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;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"}
@@ -12,11 +12,15 @@ const runtime_utils_1 = require("@fluidframework/runtime-utils");
12
12
  * @param request - the request for the root data store. The first path part must be the data store's ID.
13
13
  * @param runtime - the container runtime
14
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
15
18
  */
16
19
  const rootDataStoreRequestHandler = async (request, runtime) => {
17
20
  const requestParser = runtime_utils_1.RequestParser.create(request);
18
21
  const id = requestParser.pathParts[0];
19
22
  const wait = typeof request.headers?.wait === "boolean" ? request.headers.wait : undefined;
23
+ // eslint-disable-next-line import/no-deprecated
20
24
  let rootDataStore;
21
25
  try {
22
26
  // getRootDataStore currently throws if the data store is not found
@@ -33,19 +37,24 @@ const rootDataStoreRequestHandler = async (request, runtime) => {
33
37
  }
34
38
  };
35
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
+ */
36
45
  const createFluidObjectResponse = (fluidObject) => {
37
46
  return { status: 200, mimeType: "fluid/object", value: fluidObject };
38
47
  };
39
48
  exports.createFluidObjectResponse = createFluidObjectResponse;
40
49
  class LegacyUriHandle {
50
+ get IFluidHandle() {
51
+ return this;
52
+ }
41
53
  constructor(absolutePath, runtime) {
42
54
  this.absolutePath = absolutePath;
43
55
  this.runtime = runtime;
44
56
  this.isAttached = true;
45
57
  }
46
- get IFluidHandle() {
47
- return this;
48
- }
49
58
  attachGraph() {
50
59
  (0, core_utils_1.assert)(false, 0x0ca /* "Trying to use legacy graph attach!" */);
51
60
  }
@@ -63,6 +72,11 @@ class LegacyUriHandle {
63
72
  throw new Error("Cannot bind to LegacyUriHandle");
64
73
  }
65
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
+ */
66
80
  function handleFromLegacyUri(uri, runtime) {
67
81
  return new LegacyUriHandle(uri, runtime);
68
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"requestHandlers.js","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAAoD;AAWpD,iEAA8D;AAa9D;;;;;GAKG;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,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;AAnBW,QAAA,2BAA2B,+BAmBtC;AAEK,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;IAOpB,YACiB,YAAY,EACZ,OAA8B;QAD9B,iBAAY,GAAZ,YAAY,CAAA;QACZ,YAAO,GAAP,OAAO,CAAuB;QAR/B,eAAU,GAAG,IAAI,CAAC;IAS/B,CAAC;IAPJ,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAOM,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,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\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 */\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 */\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\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\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\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.js","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"]}
@@ -8,11 +8,20 @@ import { RuntimeRequestHandler } from "./requestHandlers";
8
8
  /**
9
9
  * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
10
10
  * The provided handlers sequentially applied until one is able to satisfy the request.
11
+ *
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
11
15
  */
12
16
  export declare class RuntimeRequestHandlerBuilder {
13
17
  private readonly handlers;
14
18
  pushHandler(...handlers: RuntimeRequestHandler[]): void;
15
19
  handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
16
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
25
+ */
17
26
  export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
18
27
  //# 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;AAElF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;GAGG;AACH,qBAAa,4BAA4B;IACxC,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;CAU7F;AAED,wBAAgB,0BAA0B,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,aAGvD,QAAQ,WAAW,iBAAiB,wBAE3D"}
1
+ {"version":3,"file":"runtimeRequestHandlerBuilder.d.ts","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAGlF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;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"}
@@ -9,11 +9,17 @@ 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
12
16
  */
13
17
  class RuntimeRequestHandlerBuilder {
14
18
  constructor() {
19
+ // eslint-disable-next-line import/no-deprecated
15
20
  this.handlers = [];
16
21
  }
22
+ // eslint-disable-next-line import/no-deprecated
17
23
  pushHandler(...handlers) {
18
24
  if (handlers !== undefined) {
19
25
  this.handlers.push(...handlers);
@@ -31,6 +37,12 @@ class RuntimeRequestHandlerBuilder {
31
37
  }
32
38
  }
33
39
  exports.RuntimeRequestHandlerBuilder = RuntimeRequestHandlerBuilder;
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
+ // eslint-disable-next-line import/no-deprecated
34
46
  function buildRuntimeRequestHandler(...handlers) {
35
47
  const builder = new RuntimeRequestHandlerBuilder();
36
48
  builder.pushHandler(...handlers);
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,iEAAiF;AAGjF;;;GAGG;AACH,MAAa,4BAA4B;IAAzC;QACkB,aAAQ,GAA4B,EAAE,CAAC;IAkBzD,CAAC;IAhBO,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;AAnBD,oEAmBC;AAED,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\";\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\tprivate readonly handlers: RuntimeRequestHandler[] = [];\n\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\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.js","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"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.34.9"
8
+ "packageVersion": "7.38.0"
9
9
  }
10
10
  ]
11
11
  }
@@ -11,19 +11,35 @@ import { RequestParser } from "@fluidframework/runtime-utils";
11
11
  * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
12
12
  * A handler should only return error if the request is for a route the handler owns, and there is a problem with
13
13
  * the route, or fulling the specific request.
14
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
15
+ *
16
+ * @public
14
17
  */
15
- export declare type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
18
+ export type RuntimeRequestHandler = (request: RequestParser, runtime: IContainerRuntime) => Promise<IResponse | undefined>;
16
19
  /**
17
20
  * A request handler to expose access to all root data stores in the container by id.
18
21
  * @param request - the request for the root data store. The first path part must be the data store's ID.
19
22
  * @param runtime - the container runtime
20
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
21
27
  */
22
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
+ */
23
34
  export declare const createFluidObjectResponse: (fluidObject: FluidObject) => {
24
35
  status: 200;
25
36
  mimeType: "fluid/object";
26
37
  value: FluidObject;
27
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
+ */
28
44
  export declare function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(uri: string, runtime: IContainerRuntimeBase): IFluidHandle<T>;
29
45
  //# 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,EAEX,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,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,iBAAiB,KACtB,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,YAC9B,QAAQ,WACR,iBAAiB,mCAiB1B,CAAC;AAEF,eAAO,MAAM,yBAAyB,gBACxB,WAAW,KACtB;IAAE,QAAQ,GAAG,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAE7D,CAAC;AAkCF,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;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"}
@@ -9,11 +9,15 @@ import { RequestParser } from "@fluidframework/runtime-utils";
9
9
  * @param request - the request for the root data store. The first path part must be the data store's ID.
10
10
  * @param runtime - the container runtime
11
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
12
15
  */
13
16
  export const rootDataStoreRequestHandler = async (request, runtime) => {
14
17
  const requestParser = RequestParser.create(request);
15
18
  const id = requestParser.pathParts[0];
16
19
  const wait = typeof request.headers?.wait === "boolean" ? request.headers.wait : undefined;
20
+ // eslint-disable-next-line import/no-deprecated
17
21
  let rootDataStore;
18
22
  try {
19
23
  // getRootDataStore currently throws if the data store is not found
@@ -29,18 +33,23 @@ export const rootDataStoreRequestHandler = async (request, runtime) => {
29
33
  return { status: 500, mimeType: "fluid/object", value: error };
30
34
  }
31
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
+ */
32
41
  export const createFluidObjectResponse = (fluidObject) => {
33
42
  return { status: 200, mimeType: "fluid/object", value: fluidObject };
34
43
  };
35
44
  class LegacyUriHandle {
45
+ get IFluidHandle() {
46
+ return this;
47
+ }
36
48
  constructor(absolutePath, runtime) {
37
49
  this.absolutePath = absolutePath;
38
50
  this.runtime = runtime;
39
51
  this.isAttached = true;
40
52
  }
41
- get IFluidHandle() {
42
- return this;
43
- }
44
53
  attachGraph() {
45
54
  assert(false, 0x0ca /* "Trying to use legacy graph attach!" */);
46
55
  }
@@ -58,6 +67,11 @@ class LegacyUriHandle {
58
67
  throw new Error("Cannot bind to LegacyUriHandle");
59
68
  }
60
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
+ */
61
75
  export function handleFromLegacyUri(uri, runtime) {
62
76
  return new LegacyUriHandle(uri, runtime);
63
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"requestHandlers.js","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAWpD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAa9D;;;;;GAKG;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,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,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;IAOpB,YACiB,YAAY,EACZ,OAA8B;QAD9B,iBAAY,GAAZ,YAAY,CAAA;QACZ,YAAO,GAAP,OAAO,CAAuB;QAR/B,eAAU,GAAG,IAAI,CAAC;IAS/B,CAAC;IAPJ,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAOM,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,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\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 */\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 */\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\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\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\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.js","sourceRoot":"","sources":["../src/requestHandlers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAYpD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAgB9D;;;;;;;;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"]}
@@ -8,11 +8,20 @@ import { RuntimeRequestHandler } from "./requestHandlers";
8
8
  /**
9
9
  * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
10
10
  * The provided handlers sequentially applied until one is able to satisfy the request.
11
+ *
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
11
15
  */
12
16
  export declare class RuntimeRequestHandlerBuilder {
13
17
  private readonly handlers;
14
18
  pushHandler(...handlers: RuntimeRequestHandler[]): void;
15
19
  handleRequest(request: IRequest, runtime: IContainerRuntime): Promise<IResponse>;
16
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
25
+ */
17
26
  export declare function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]): (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
18
27
  //# 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;AAElF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;GAGG;AACH,qBAAa,4BAA4B;IACxC,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;CAU7F;AAED,wBAAgB,0BAA0B,CAAC,GAAG,QAAQ,EAAE,qBAAqB,EAAE,aAGvD,QAAQ,WAAW,iBAAiB,wBAE3D"}
1
+ {"version":3,"file":"runtimeRequestHandlerBuilder.d.ts","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAGlF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D;;;;;;;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"}
@@ -6,11 +6,17 @@ 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
9
13
  */
10
14
  export class RuntimeRequestHandlerBuilder {
11
15
  constructor() {
16
+ // eslint-disable-next-line import/no-deprecated
12
17
  this.handlers = [];
13
18
  }
19
+ // eslint-disable-next-line import/no-deprecated
14
20
  pushHandler(...handlers) {
15
21
  if (handlers !== undefined) {
16
22
  this.handlers.push(...handlers);
@@ -27,6 +33,12 @@ export class RuntimeRequestHandlerBuilder {
27
33
  return create404Response(request);
28
34
  }
29
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
+ // eslint-disable-next-line import/no-deprecated
30
42
  export function buildRuntimeRequestHandler(...handlers) {
31
43
  const builder = new RuntimeRequestHandlerBuilder();
32
44
  builder.pushHandler(...handlers);
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeRequestHandlerBuilder.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGjF;;;GAGG;AACH,MAAM,OAAO,4BAA4B;IAAzC;QACkB,aAAQ,GAA4B,EAAE,CAAC;IAkBzD,CAAC;IAhBO,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,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\";\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\tprivate readonly handlers: RuntimeRequestHandler[] = [];\n\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\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.js","sourceRoot":"","sources":["../src/runtimeRequestHandlerBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAIjF;;;;;;;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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/request-handler",
3
- "version": "2.0.0-internal.6.4.0",
3
+ "version": "2.0.0-internal.7.1.0",
4
4
  "description": "A simple request handling library for Fluid Framework",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -35,21 +35,21 @@
35
35
  "temp-directory": "nyc/.nyc_output"
36
36
  },
37
37
  "dependencies": {
38
- "@fluidframework/container-runtime-definitions": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
39
- "@fluidframework/core-interfaces": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
40
- "@fluidframework/core-utils": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
41
- "@fluidframework/runtime-definitions": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
42
- "@fluidframework/runtime-utils": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0"
38
+ "@fluidframework/container-runtime-definitions": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
39
+ "@fluidframework/core-interfaces": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
40
+ "@fluidframework/core-utils": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
41
+ "@fluidframework/runtime-definitions": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
42
+ "@fluidframework/runtime-utils": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@fluid-tools/build-cli": "^0.22.0",
46
- "@fluidframework/build-common": "^2.0.0",
47
- "@fluidframework/build-tools": "^0.22.0",
48
- "@fluidframework/eslint-config-fluid": "^2.1.0",
49
- "@fluidframework/mocha-test-setup": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
50
- "@fluidframework/request-handler-previous": "npm:@fluidframework/request-handler@2.0.0-internal.6.3.0",
51
- "@fluidframework/test-runtime-utils": ">=2.0.0-internal.6.4.0 <2.0.0-internal.6.5.0",
52
- "@microsoft/api-extractor": "^7.34.4",
45
+ "@fluid-tools/build-cli": "^0.25.0",
46
+ "@fluidframework/build-common": "^2.0.1",
47
+ "@fluidframework/build-tools": "^0.25.0",
48
+ "@fluidframework/eslint-config-fluid": "^3.0.0",
49
+ "@fluidframework/mocha-test-setup": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
50
+ "@fluidframework/request-handler-previous": "npm:@fluidframework/request-handler@2.0.0-internal.7.0.0",
51
+ "@fluidframework/test-runtime-utils": ">=2.0.0-internal.7.1.0 <2.0.0-internal.7.2.0",
52
+ "@microsoft/api-extractor": "^7.37.0",
53
53
  "@types/diff": "^3.5.1",
54
54
  "@types/mocha": "^9.1.1",
55
55
  "@types/node": "^16.18.38",
@@ -57,14 +57,14 @@
57
57
  "copyfiles": "^2.4.1",
58
58
  "cross-env": "^7.0.3",
59
59
  "diff": "^3.5.0",
60
- "eslint": "~8.6.0",
60
+ "eslint": "~8.50.0",
61
61
  "mocha": "^10.2.0",
62
62
  "mocha-json-output-reporter": "^2.0.1",
63
63
  "mocha-multi-reporters": "^1.5.1",
64
64
  "moment": "^2.21.0",
65
- "prettier": "~2.6.2",
65
+ "prettier": "~3.0.3",
66
66
  "rimraf": "^4.4.0",
67
- "typescript": "~4.5.5"
67
+ "typescript": "~5.1.6"
68
68
  },
69
69
  "typeValidation": {
70
70
  "broken": {}
@@ -73,10 +73,10 @@
73
73
  "build": "fluid-build . --task build",
74
74
  "build:commonjs": "fluid-build . --task commonjs",
75
75
  "build:compile": "fluid-build . --task compile",
76
- "build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
76
+ "build:docs": "api-extractor run --local",
77
77
  "build:esnext": "tsc --project ./tsconfig.esnext.json",
78
78
  "build:test": "tsc --project ./src/test/tsconfig.json",
79
- "ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
79
+ "ci:build:docs": "api-extractor run",
80
80
  "clean": "rimraf --glob 'dist' 'lib' '*.tsbuildinfo' '*.build.log' '_api-extractor-temp' 'nyc'",
81
81
  "eslint": "eslint --format stylish src",
82
82
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
@@ -10,6 +10,7 @@ import {
10
10
  IFluidHandle,
11
11
  IFluidLoadable,
12
12
  FluidObject,
13
+ // eslint-disable-next-line import/no-deprecated
13
14
  IFluidRouter,
14
15
  } from "@fluidframework/core-interfaces";
15
16
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
@@ -21,6 +22,9 @@ import { RequestParser } from "@fluidframework/runtime-utils";
21
22
  * if it does not apply. These handlers are called in series, so there may be other handlers before or after.
22
23
  * A handler should only return error if the request is for a route the handler owns, and there is a problem with
23
24
  * 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
26
+ *
27
+ * @public
24
28
  */
25
29
  export type RuntimeRequestHandler = (
26
30
  request: RequestParser,
@@ -32,6 +36,9 @@ export type RuntimeRequestHandler = (
32
36
  * @param request - the request for the root data store. The first path part must be the data store's ID.
33
37
  * @param runtime - the container runtime
34
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
35
42
  */
36
43
  export const rootDataStoreRequestHandler = async (
37
44
  request: IRequest,
@@ -40,6 +47,7 @@ export const rootDataStoreRequestHandler = async (
40
47
  const requestParser = RequestParser.create(request);
41
48
  const id = requestParser.pathParts[0];
42
49
  const wait = typeof request.headers?.wait === "boolean" ? request.headers.wait : undefined;
50
+ // eslint-disable-next-line import/no-deprecated
43
51
  let rootDataStore: IFluidRouter;
44
52
  try {
45
53
  // getRootDataStore currently throws if the data store is not found
@@ -54,6 +62,11 @@ export const rootDataStoreRequestHandler = async (
54
62
  }
55
63
  };
56
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
+ */
57
70
  export const createFluidObjectResponse = (
58
71
  fluidObject: FluidObject,
59
72
  ): { status: 200; mimeType: "fluid/object"; value: FluidObject } => {
@@ -92,6 +105,11 @@ class LegacyUriHandle<T = FluidObject & IFluidLoadable> implements IFluidHandle<
92
105
  }
93
106
  }
94
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
+ */
95
113
  export function handleFromLegacyUri<T = FluidObject & IFluidLoadable>(
96
114
  uri: string,
97
115
  runtime: IContainerRuntimeBase,
@@ -6,15 +6,22 @@
6
6
  import { IRequest, IResponse } from "@fluidframework/core-interfaces";
7
7
  import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
8
8
  import { RequestParser, create404Response } from "@fluidframework/runtime-utils";
9
+ // eslint-disable-next-line import/no-deprecated
9
10
  import { RuntimeRequestHandler } from "./requestHandlers";
10
11
 
11
12
  /**
12
13
  * The RuntimeRequestHandlerBuilder creates a runtime request handler based on request handlers.
13
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
14
19
  */
15
20
  export class RuntimeRequestHandlerBuilder {
21
+ // eslint-disable-next-line import/no-deprecated
16
22
  private readonly handlers: RuntimeRequestHandler[] = [];
17
23
 
24
+ // eslint-disable-next-line import/no-deprecated
18
25
  public pushHandler(...handlers: RuntimeRequestHandler[]) {
19
26
  if (handlers !== undefined) {
20
27
  this.handlers.push(...handlers);
@@ -33,6 +40,12 @@ export class RuntimeRequestHandlerBuilder {
33
40
  }
34
41
  }
35
42
 
43
+ /**
44
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
45
+ *
46
+ * @public
47
+ */
48
+ // eslint-disable-next-line import/no-deprecated
36
49
  export function buildRuntimeRequestHandler(...handlers: RuntimeRequestHandler[]) {
37
50
  const builder = new RuntimeRequestHandlerBuilder();
38
51
  builder.pushHandler(...handlers);