@temporary-name/server 1.9.3-alpha.4275e976ddda4d8be107c2cfde9899bdea9a337d → 1.9.3-alpha.50b729ba628b987e14f5bd1004e5a04590fd4b4e
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/dist/adapters/aws-lambda/index.d.mts +12 -6
- package/dist/adapters/aws-lambda/index.d.ts +12 -6
- package/dist/adapters/aws-lambda/index.mjs +12 -4
- package/dist/adapters/fetch/index.d.mts +12 -6
- package/dist/adapters/fetch/index.d.ts +12 -6
- package/dist/adapters/fetch/index.mjs +12 -11
- package/dist/adapters/node/index.d.mts +12 -6
- package/dist/adapters/node/index.d.ts +12 -6
- package/dist/adapters/node/index.mjs +12 -11
- package/dist/adapters/standard/index.d.mts +23 -13
- package/dist/adapters/standard/index.d.ts +23 -13
- package/dist/adapters/standard/index.mjs +8 -100
- package/dist/index.d.mts +44 -368
- package/dist/index.d.ts +44 -368
- package/dist/index.mjs +108 -152
- package/dist/openapi/index.d.mts +220 -0
- package/dist/openapi/index.d.ts +220 -0
- package/dist/openapi/index.mjs +776 -0
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/shared/server.BEHw7Eyx.mjs +247 -0
- package/dist/shared/server.BVxcyR6X.mjs +287 -0
- package/dist/shared/{server.Btxrgkj5.d.ts → server.Bk5r0-2R.d.ts} +7 -24
- package/dist/shared/server.Bs6ka_UE.d.mts +23 -0
- package/dist/shared/{server.C1YnHvvf.d.ts → server.CZNLCQBm.d.mts} +3 -3
- package/dist/shared/{server.C1YnHvvf.d.mts → server.CZNLCQBm.d.ts} +3 -3
- package/dist/shared/{server.Bo94xDTv.d.mts → server.CbLTWfgn.d.mts} +7 -24
- package/dist/shared/server.D2UFMrxf.d.ts +23 -0
- package/dist/shared/{server.BEQrAa3A.mjs → server.DcfsPloY.mjs} +16 -21
- package/package.json +19 -13
- package/dist/shared/server.D6K9uoPI.mjs +0 -35
- package/dist/shared/server.DZ5BIITo.mjs +0 -9
- package/dist/shared/server.X0YaZxSJ.mjs +0 -13
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, APIGatewayProxyEventV2, ResponseStream } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { C as Context } from '../../shared/server.
|
|
4
|
-
import {
|
|
5
|
-
import { FriendlyStandardHandleOptions } from '
|
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.CZNLCQBm.mjs';
|
|
4
|
+
import { b as StandardHandlerOptions } from '../../shared/server.CbLTWfgn.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.Bs6ka_UE.mjs';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
7
|
import '@temporary-name/standard-server';
|
|
8
8
|
|
|
9
|
-
interface AwsLambdaHandlerOptions extends SendStandardResponseOptions {
|
|
9
|
+
interface AwsLambdaHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, SendStandardResponseOptions {
|
|
10
10
|
}
|
|
11
11
|
type AwsLambdaHandleResult = {
|
|
12
12
|
matched: true;
|
|
13
13
|
} | {
|
|
14
14
|
matched: false;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* OpenAPI Handler for AWS Lambda.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
20
|
+
* @see {@link https://orpc.unnoq.com/docs/adapters/http HTTP Adapter Docs}
|
|
21
|
+
*/
|
|
16
22
|
declare class AwsLambdaHandler<T extends Context> {
|
|
17
|
-
private readonly standardHandler;
|
|
18
23
|
private readonly sendStandardResponseOptions;
|
|
19
|
-
|
|
24
|
+
private readonly standardHandler;
|
|
25
|
+
constructor(router: Router<any, T>, options?: AwsLambdaHandlerOptions<T>);
|
|
20
26
|
handle(event: APIGatewayProxyEventV2, responseStream: ResponseStream, ...rest: MaybeOptionalOptions<FriendlyStandardHandleOptions<T>>): Promise<AwsLambdaHandleResult>;
|
|
21
27
|
}
|
|
22
28
|
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { MaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { SendStandardResponseOptions, APIGatewayProxyEventV2, ResponseStream } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { C as Context } from '../../shared/server.
|
|
4
|
-
import {
|
|
5
|
-
import { FriendlyStandardHandleOptions } from '
|
|
3
|
+
import { C as Context, R as Router } from '../../shared/server.CZNLCQBm.js';
|
|
4
|
+
import { b as StandardHandlerOptions } from '../../shared/server.Bk5r0-2R.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.D2UFMrxf.js';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
7
|
import '@temporary-name/standard-server';
|
|
8
8
|
|
|
9
|
-
interface AwsLambdaHandlerOptions extends SendStandardResponseOptions {
|
|
9
|
+
interface AwsLambdaHandlerOptions<T extends Context> extends StandardHandlerOptions<T>, SendStandardResponseOptions {
|
|
10
10
|
}
|
|
11
11
|
type AwsLambdaHandleResult = {
|
|
12
12
|
matched: true;
|
|
13
13
|
} | {
|
|
14
14
|
matched: false;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* OpenAPI Handler for AWS Lambda.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
20
|
+
* @see {@link https://orpc.unnoq.com/docs/adapters/http HTTP Adapter Docs}
|
|
21
|
+
*/
|
|
16
22
|
declare class AwsLambdaHandler<T extends Context> {
|
|
17
|
-
private readonly standardHandler;
|
|
18
23
|
private readonly sendStandardResponseOptions;
|
|
19
|
-
|
|
24
|
+
private readonly standardHandler;
|
|
25
|
+
constructor(router: Router<any, T>, options?: AwsLambdaHandlerOptions<T>);
|
|
20
26
|
handle(event: APIGatewayProxyEventV2, responseStream: ResponseStream, ...rest: MaybeOptionalOptions<FriendlyStandardHandleOptions<T>>): Promise<AwsLambdaHandleResult>;
|
|
21
27
|
}
|
|
22
28
|
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, sendStandardResponse } from '@temporary-name/standard-server-aws-lambda';
|
|
3
|
-
import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
3
|
+
import { S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.BVxcyR6X.mjs';
|
|
4
|
+
import '@temporary-name/contract';
|
|
5
|
+
import '@temporary-name/standard-server';
|
|
6
|
+
import '@temporary-name/server';
|
|
7
|
+
import 'rou3';
|
|
8
|
+
import '../../shared/server.DcfsPloY.mjs';
|
|
9
|
+
import '@temporary-name/zod';
|
|
10
|
+
import '../../shared/server.BEHw7Eyx.mjs';
|
|
4
11
|
|
|
5
12
|
class AwsLambdaHandler {
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
sendStandardResponseOptions;
|
|
14
|
+
standardHandler;
|
|
15
|
+
constructor(router, options = {}) {
|
|
16
|
+
this.standardHandler = new StandardHandler(router, options);
|
|
8
17
|
this.sendStandardResponseOptions = options;
|
|
9
18
|
}
|
|
10
|
-
sendStandardResponseOptions;
|
|
11
19
|
async handle(event, responseStream, ...rest) {
|
|
12
20
|
const standardRequest = toStandardLazyRequest(event, responseStream);
|
|
13
21
|
const options = resolveFriendlyStandardHandleOptions(resolveMaybeOptionalOptions(rest));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as Context } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.CZNLCQBm.mjs';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { ToFetchResponseOptions } from '@temporary-name/standard-server-fetch';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as
|
|
5
|
-
import { FriendlyStandardHandleOptions } from '
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.CbLTWfgn.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.Bs6ka_UE.mjs';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
7
|
import '@temporary-name/standard-server';
|
|
8
8
|
|
|
@@ -24,15 +24,21 @@ interface FetchHandlerInterceptorOptions<T extends Context> extends StandardHand
|
|
|
24
24
|
request: Request;
|
|
25
25
|
toFetchResponseOptions: ToFetchResponseOptions;
|
|
26
26
|
}
|
|
27
|
-
interface FetchHandlerOptions<T extends Context> extends ToFetchResponseOptions {
|
|
27
|
+
interface FetchHandlerOptions<T extends Context> extends ToFetchResponseOptions, Omit<StandardHandlerOptions<T>, 'plugins'> {
|
|
28
28
|
adapterInterceptors?: Interceptor<FetchHandlerInterceptorOptions<T>, Promise<FetchHandleResult>>[];
|
|
29
29
|
plugins?: FetchHandlerPlugin<T>[];
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* OpenAPI Handler for Fetch Server
|
|
33
|
+
*
|
|
34
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
35
|
+
* @see {@link https://orpc.unnoq.com/docs/adapters/http HTTP Adapter Docs}
|
|
36
|
+
*/
|
|
31
37
|
declare class FetchHandler<T extends Context> {
|
|
32
|
-
private readonly standardHandler;
|
|
33
38
|
private readonly toFetchResponseOptions;
|
|
34
39
|
private readonly adapterInterceptors;
|
|
35
|
-
|
|
40
|
+
private readonly standardHandler;
|
|
41
|
+
constructor(router: Router<any, T>, options?: NoInfer<FetchHandlerOptions<T>>);
|
|
36
42
|
handle(request: Request, ...rest: MaybeOptionalOptions<FriendlyStandardHandleOptions<T>>): Promise<FetchHandleResult>;
|
|
37
43
|
}
|
|
38
44
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as Context } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.CZNLCQBm.js';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { ToFetchResponseOptions } from '@temporary-name/standard-server-fetch';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as
|
|
5
|
-
import { FriendlyStandardHandleOptions } from '
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.Bk5r0-2R.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.D2UFMrxf.js';
|
|
6
6
|
import '@temporary-name/contract';
|
|
7
7
|
import '@temporary-name/standard-server';
|
|
8
8
|
|
|
@@ -24,15 +24,21 @@ interface FetchHandlerInterceptorOptions<T extends Context> extends StandardHand
|
|
|
24
24
|
request: Request;
|
|
25
25
|
toFetchResponseOptions: ToFetchResponseOptions;
|
|
26
26
|
}
|
|
27
|
-
interface FetchHandlerOptions<T extends Context> extends ToFetchResponseOptions {
|
|
27
|
+
interface FetchHandlerOptions<T extends Context> extends ToFetchResponseOptions, Omit<StandardHandlerOptions<T>, 'plugins'> {
|
|
28
28
|
adapterInterceptors?: Interceptor<FetchHandlerInterceptorOptions<T>, Promise<FetchHandleResult>>[];
|
|
29
29
|
plugins?: FetchHandlerPlugin<T>[];
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* OpenAPI Handler for Fetch Server
|
|
33
|
+
*
|
|
34
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
35
|
+
* @see {@link https://orpc.unnoq.com/docs/adapters/http HTTP Adapter Docs}
|
|
36
|
+
*/
|
|
31
37
|
declare class FetchHandler<T extends Context> {
|
|
32
|
-
private readonly standardHandler;
|
|
33
38
|
private readonly toFetchResponseOptions;
|
|
34
39
|
private readonly adapterInterceptors;
|
|
35
|
-
|
|
40
|
+
private readonly standardHandler;
|
|
41
|
+
constructor(router: Router<any, T>, options?: NoInfer<FetchHandlerOptions<T>>);
|
|
36
42
|
handle(request: Request, ...rest: MaybeOptionalOptions<FriendlyStandardHandleOptions<T>>): Promise<FetchHandleResult>;
|
|
37
43
|
}
|
|
38
44
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ORPCError, toArray, intercept, resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import { toStandardLazyRequest, toFetchResponse } from '@temporary-name/standard-server-fetch';
|
|
3
|
-
import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
4
|
-
import '@temporary-name/standard-server';
|
|
3
|
+
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.BVxcyR6X.mjs';
|
|
5
4
|
import '@temporary-name/contract';
|
|
6
|
-
import '
|
|
7
|
-
import
|
|
8
|
-
import '
|
|
9
|
-
import 'zod';
|
|
10
|
-
import '
|
|
5
|
+
import '@temporary-name/standard-server';
|
|
6
|
+
import '@temporary-name/server';
|
|
7
|
+
import 'rou3';
|
|
8
|
+
import '@temporary-name/zod';
|
|
9
|
+
import '../../shared/server.DcfsPloY.mjs';
|
|
10
|
+
import '../../shared/server.BEHw7Eyx.mjs';
|
|
11
11
|
|
|
12
12
|
class BodyLimitPlugin {
|
|
13
13
|
maxBodySize;
|
|
@@ -136,15 +136,16 @@ class CompositeFetchHandlerPlugin extends CompositeStandardHandlerPlugin {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
class FetchHandler {
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
toFetchResponseOptions;
|
|
140
|
+
adapterInterceptors;
|
|
141
|
+
standardHandler;
|
|
142
|
+
constructor(router, options = {}) {
|
|
143
|
+
this.standardHandler = new StandardHandler(router, options);
|
|
141
144
|
const plugin = new CompositeFetchHandlerPlugin(options.plugins);
|
|
142
145
|
plugin.initRuntimeAdapter(options);
|
|
143
146
|
this.adapterInterceptors = toArray(options.adapterInterceptors);
|
|
144
147
|
this.toFetchResponseOptions = options;
|
|
145
148
|
}
|
|
146
|
-
toFetchResponseOptions;
|
|
147
|
-
adapterInterceptors;
|
|
148
149
|
async handle(request, ...rest) {
|
|
149
150
|
return intercept(
|
|
150
151
|
this.adapterInterceptors,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as Context } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.CZNLCQBm.mjs';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as
|
|
5
|
-
import { FriendlyStandardHandleOptions } from '
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.CbLTWfgn.mjs';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.Bs6ka_UE.mjs';
|
|
6
6
|
import compression from '@temporary-name/interop/compression';
|
|
7
7
|
import '@temporary-name/contract';
|
|
8
8
|
import '@temporary-name/standard-server';
|
|
@@ -24,15 +24,21 @@ interface NodeHttpHandlerInterceptorOptions<T extends Context> extends StandardH
|
|
|
24
24
|
response: NodeHttpResponse;
|
|
25
25
|
sendStandardResponseOptions: SendStandardResponseOptions;
|
|
26
26
|
}
|
|
27
|
-
interface NodeHttpHandlerOptions<T extends Context> extends SendStandardResponseOptions {
|
|
27
|
+
interface NodeHttpHandlerOptions<T extends Context> extends SendStandardResponseOptions, Omit<StandardHandlerOptions<T>, 'plugins'> {
|
|
28
28
|
adapterInterceptors?: Interceptor<NodeHttpHandlerInterceptorOptions<T>, Promise<NodeHttpHandleResult>>[];
|
|
29
29
|
plugins?: NodeHttpHandlerPlugin<T>[];
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* OpenAPI Handler for Node Server
|
|
33
|
+
*
|
|
34
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
35
|
+
* @see {@link https://orpc.unnoq.com/docs/adapters/http HTTP Adapter Docs}
|
|
36
|
+
*/
|
|
31
37
|
declare class NodeHttpHandler<T extends Context> implements NodeHttpHandler<T> {
|
|
32
|
-
private readonly standardHandler;
|
|
33
38
|
private readonly sendStandardResponseOptions;
|
|
34
39
|
private readonly adapterInterceptors;
|
|
35
|
-
|
|
40
|
+
private readonly standardHandler;
|
|
41
|
+
constructor(router: Router<any, T>, options?: NoInfer<NodeHttpHandlerOptions<T>>);
|
|
36
42
|
handle(request: NodeHttpRequest, response: NodeHttpResponse, ...rest: MaybeOptionalOptions<FriendlyStandardHandleOptions<T>>): Promise<NodeHttpHandleResult>;
|
|
37
43
|
}
|
|
38
44
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as Context } from '../../shared/server.
|
|
1
|
+
import { C as Context, R as Router } from '../../shared/server.CZNLCQBm.js';
|
|
2
2
|
import { Interceptor, MaybeOptionalOptions } from '@temporary-name/shared';
|
|
3
3
|
import { SendStandardResponseOptions, NodeHttpRequest, NodeHttpResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as
|
|
5
|
-
import { FriendlyStandardHandleOptions } from '
|
|
4
|
+
import { a as StandardHandlerPlugin, C as CompositeStandardHandlerPlugin, b as StandardHandlerOptions, c as StandardHandleOptions } from '../../shared/server.Bk5r0-2R.js';
|
|
5
|
+
import { F as FriendlyStandardHandleOptions } from '../../shared/server.D2UFMrxf.js';
|
|
6
6
|
import compression from '@temporary-name/interop/compression';
|
|
7
7
|
import '@temporary-name/contract';
|
|
8
8
|
import '@temporary-name/standard-server';
|
|
@@ -24,15 +24,21 @@ interface NodeHttpHandlerInterceptorOptions<T extends Context> extends StandardH
|
|
|
24
24
|
response: NodeHttpResponse;
|
|
25
25
|
sendStandardResponseOptions: SendStandardResponseOptions;
|
|
26
26
|
}
|
|
27
|
-
interface NodeHttpHandlerOptions<T extends Context> extends SendStandardResponseOptions {
|
|
27
|
+
interface NodeHttpHandlerOptions<T extends Context> extends SendStandardResponseOptions, Omit<StandardHandlerOptions<T>, 'plugins'> {
|
|
28
28
|
adapterInterceptors?: Interceptor<NodeHttpHandlerInterceptorOptions<T>, Promise<NodeHttpHandleResult>>[];
|
|
29
29
|
plugins?: NodeHttpHandlerPlugin<T>[];
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* OpenAPI Handler for Node Server
|
|
33
|
+
*
|
|
34
|
+
* @see {@link https://orpc.unnoq.com/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
35
|
+
* @see {@link https://orpc.unnoq.com/docs/adapters/http HTTP Adapter Docs}
|
|
36
|
+
*/
|
|
31
37
|
declare class NodeHttpHandler<T extends Context> implements NodeHttpHandler<T> {
|
|
32
|
-
private readonly standardHandler;
|
|
33
38
|
private readonly sendStandardResponseOptions;
|
|
34
39
|
private readonly adapterInterceptors;
|
|
35
|
-
|
|
40
|
+
private readonly standardHandler;
|
|
41
|
+
constructor(router: Router<any, T>, options?: NoInfer<NodeHttpHandlerOptions<T>>);
|
|
36
42
|
handle(request: NodeHttpRequest, response: NodeHttpResponse, ...rest: MaybeOptionalOptions<FriendlyStandardHandleOptions<T>>): Promise<NodeHttpHandleResult>;
|
|
37
43
|
}
|
|
38
44
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { once, ORPCError, toArray, intercept, resolveMaybeOptionalOptions } from '@temporary-name/shared';
|
|
2
2
|
import compression from '@temporary-name/interop/compression';
|
|
3
3
|
import { toStandardLazyRequest, sendStandardResponse } from '@temporary-name/standard-server-node';
|
|
4
|
-
import { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.
|
|
5
|
-
import '@temporary-name/standard-server';
|
|
4
|
+
import { C as CompositeStandardHandlerPlugin, S as StandardHandler, r as resolveFriendlyStandardHandleOptions } from '../../shared/server.BVxcyR6X.mjs';
|
|
6
5
|
import '@temporary-name/contract';
|
|
7
|
-
import '
|
|
8
|
-
import
|
|
9
|
-
import '
|
|
10
|
-
import 'zod';
|
|
11
|
-
import '
|
|
6
|
+
import '@temporary-name/standard-server';
|
|
7
|
+
import '@temporary-name/server';
|
|
8
|
+
import 'rou3';
|
|
9
|
+
import '@temporary-name/zod';
|
|
10
|
+
import '../../shared/server.DcfsPloY.mjs';
|
|
11
|
+
import '../../shared/server.BEHw7Eyx.mjs';
|
|
12
12
|
|
|
13
13
|
class BodyLimitPlugin {
|
|
14
14
|
maxBodySize;
|
|
@@ -102,15 +102,16 @@ class CompositeNodeHttpHandlerPlugin extends CompositeStandardHandlerPlugin {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
class NodeHttpHandler {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
sendStandardResponseOptions;
|
|
106
|
+
adapterInterceptors;
|
|
107
|
+
standardHandler;
|
|
108
|
+
constructor(router, options = {}) {
|
|
109
|
+
this.standardHandler = new StandardHandler(router, options);
|
|
107
110
|
const plugin = new CompositeNodeHttpHandlerPlugin(options.plugins);
|
|
108
111
|
plugin.initRuntimeAdapter(options);
|
|
109
112
|
this.adapterInterceptors = toArray(options.adapterInterceptors);
|
|
110
113
|
this.sendStandardResponseOptions = options;
|
|
111
114
|
}
|
|
112
|
-
sendStandardResponseOptions;
|
|
113
|
-
adapterInterceptors;
|
|
114
115
|
async handle(request, response, ...rest) {
|
|
115
116
|
return intercept(
|
|
116
117
|
this.adapterInterceptors,
|
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.CbLTWfgn.mjs';
|
|
2
|
+
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
|
+
import { ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
+
import { StandardLazyRequest, StandardResponse } from '@temporary-name/standard-server';
|
|
5
|
+
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.Bs6ka_UE.mjs';
|
|
4
6
|
import '@temporary-name/contract';
|
|
5
|
-
import '
|
|
6
|
-
import '@temporary-name/standard-server';
|
|
7
|
+
import '../../shared/server.CZNLCQBm.mjs';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
context: T;
|
|
12
|
-
});
|
|
13
|
-
declare function resolveFriendlyStandardHandleOptions<T extends Context>(options: FriendlyStandardHandleOptions<T>): StandardHandleOptions<T>;
|
|
9
|
+
declare function decode(request: StandardLazyRequest, params: Record<string, string> | undefined, procedure: AnyProcedure): Promise<unknown>;
|
|
10
|
+
declare function encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
11
|
+
declare function encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
type StandardMatchResult = {
|
|
14
|
+
path: readonly string[];
|
|
15
|
+
procedure: AnyProcedure;
|
|
16
|
+
params?: Record<string, string>;
|
|
17
|
+
} | undefined;
|
|
18
|
+
declare class StandardOpenAPIMatcher {
|
|
19
|
+
private readonly tree;
|
|
20
|
+
private pendingRouters;
|
|
21
|
+
init(router: AnyRouter, path?: readonly string[]): void;
|
|
22
|
+
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { StandardOpenAPIMatcher, decode, encode, encodeError };
|
|
26
|
+
export type { StandardMatchResult };
|
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
export { C as CompositeStandardHandlerPlugin, c as StandardHandleOptions, d as StandardHandleResult, e as StandardHandler, S as StandardHandlerInterceptorOptions, b as StandardHandlerOptions, a as StandardHandlerPlugin } from '../../shared/server.Bk5r0-2R.js';
|
|
2
|
+
import { AnyProcedure, AnyRouter } from '@temporary-name/server';
|
|
3
|
+
import { ORPCError, HTTPPath } from '@temporary-name/shared';
|
|
4
|
+
import { StandardLazyRequest, StandardResponse } from '@temporary-name/standard-server';
|
|
5
|
+
export { F as FriendlyStandardHandleOptions, d as decodeParams, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.D2UFMrxf.js';
|
|
4
6
|
import '@temporary-name/contract';
|
|
5
|
-
import '
|
|
6
|
-
import '@temporary-name/standard-server';
|
|
7
|
+
import '../../shared/server.CZNLCQBm.js';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
context: T;
|
|
12
|
-
});
|
|
13
|
-
declare function resolveFriendlyStandardHandleOptions<T extends Context>(options: FriendlyStandardHandleOptions<T>): StandardHandleOptions<T>;
|
|
9
|
+
declare function decode(request: StandardLazyRequest, params: Record<string, string> | undefined, procedure: AnyProcedure): Promise<unknown>;
|
|
10
|
+
declare function encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
|
11
|
+
declare function encodeError(error: ORPCError<any, any>): StandardResponse;
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
type StandardMatchResult = {
|
|
14
|
+
path: readonly string[];
|
|
15
|
+
procedure: AnyProcedure;
|
|
16
|
+
params?: Record<string, string>;
|
|
17
|
+
} | undefined;
|
|
18
|
+
declare class StandardOpenAPIMatcher {
|
|
19
|
+
private readonly tree;
|
|
20
|
+
private pendingRouters;
|
|
21
|
+
init(router: AnyRouter, path?: readonly string[]): void;
|
|
22
|
+
match(method: string, pathname: HTTPPath): Promise<StandardMatchResult>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { StandardOpenAPIMatcher, decode, encode, encodeError };
|
|
26
|
+
export type { StandardMatchResult };
|
|
@@ -1,101 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
export { r as resolveFriendlyStandardHandleOptions } from '../../shared/server.DZ5BIITo.mjs';
|
|
1
|
+
export { C as CompositeStandardHandlerPlugin, S as StandardHandler, b as StandardOpenAPIMatcher, d as decode, c as decodeParams, e as encode, a as encodeError, r as resolveFriendlyStandardHandleOptions, t as toRou3Pattern } from '../../shared/server.BVxcyR6X.mjs';
|
|
2
|
+
import '@temporary-name/shared';
|
|
3
|
+
import '@temporary-name/standard-server';
|
|
4
|
+
import '../../shared/server.DcfsPloY.mjs';
|
|
6
5
|
import '@temporary-name/contract';
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
9
|
-
import '
|
|
10
|
-
import '
|
|
11
|
-
|
|
12
|
-
class StandardHandler {
|
|
13
|
-
constructor(router, matcher, codec, options) {
|
|
14
|
-
this.matcher = matcher;
|
|
15
|
-
this.codec = codec;
|
|
16
|
-
const plugins = new CompositeStandardHandlerPlugin(options.plugins);
|
|
17
|
-
plugins.init(options, router);
|
|
18
|
-
this.interceptors = toArray(options.interceptors);
|
|
19
|
-
this.clientInterceptors = toArray(options.clientInterceptors);
|
|
20
|
-
this.rootInterceptors = toArray(options.rootInterceptors);
|
|
21
|
-
this.matcher.init(router);
|
|
22
|
-
}
|
|
23
|
-
interceptors;
|
|
24
|
-
clientInterceptors;
|
|
25
|
-
rootInterceptors;
|
|
26
|
-
async handle(request, options) {
|
|
27
|
-
const prefix = options.prefix?.replace(/\/$/, "") || void 0;
|
|
28
|
-
if (prefix && !request.url.pathname.startsWith(`${prefix}/`) && request.url.pathname !== prefix) {
|
|
29
|
-
return { matched: false, response: void 0 };
|
|
30
|
-
}
|
|
31
|
-
return intercept(this.rootInterceptors, { ...options, request, prefix }, async (interceptorOptions) => {
|
|
32
|
-
return runWithSpan({ name: `${request.method} ${request.url.pathname}` }, async (span) => {
|
|
33
|
-
let step;
|
|
34
|
-
try {
|
|
35
|
-
return await intercept(
|
|
36
|
-
this.interceptors,
|
|
37
|
-
interceptorOptions,
|
|
38
|
-
async ({ request: request2, context, prefix: prefix2 }) => {
|
|
39
|
-
const method = request2.method;
|
|
40
|
-
const url = request2.url;
|
|
41
|
-
const pathname = prefix2 ? url.pathname.replace(prefix2, "") : url.pathname;
|
|
42
|
-
const match = await runWithSpan(
|
|
43
|
-
{ name: "find_procedure" },
|
|
44
|
-
() => this.matcher.match(method, `/${pathname.replace(/^\/|\/$/g, "")}`)
|
|
45
|
-
);
|
|
46
|
-
if (!match) {
|
|
47
|
-
return { matched: false, response: void 0 };
|
|
48
|
-
}
|
|
49
|
-
span?.updateName(`${ORPC_NAME}.${match.path.join("/")}`);
|
|
50
|
-
span?.setAttribute("rpc.system", ORPC_NAME);
|
|
51
|
-
span?.setAttribute("rpc.method", match.path.join("."));
|
|
52
|
-
step = "decode_input";
|
|
53
|
-
let input = await runWithSpan(
|
|
54
|
-
{ name: "decode_input" },
|
|
55
|
-
() => this.codec.decode(request2, match.params, match.procedure)
|
|
56
|
-
);
|
|
57
|
-
step = void 0;
|
|
58
|
-
if (isAsyncIteratorObject(input)) {
|
|
59
|
-
input = asyncIteratorWithSpan(
|
|
60
|
-
{ name: "consume_event_iterator_input", signal: request2.signal },
|
|
61
|
-
input
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
|
-
const client = createProcedureClient(match.procedure, {
|
|
65
|
-
context,
|
|
66
|
-
path: match.path,
|
|
67
|
-
interceptors: this.clientInterceptors
|
|
68
|
-
});
|
|
69
|
-
step = "call_procedure";
|
|
70
|
-
const output = await client(input, {
|
|
71
|
-
signal: request2.signal,
|
|
72
|
-
lastEventId: flattenHeader(request2.headers["last-event-id"])
|
|
73
|
-
});
|
|
74
|
-
step = void 0;
|
|
75
|
-
const response = this.codec.encode(output, match.procedure);
|
|
76
|
-
return {
|
|
77
|
-
matched: true,
|
|
78
|
-
response
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
} catch (e) {
|
|
83
|
-
if (step !== "call_procedure") {
|
|
84
|
-
setSpanError(span, e);
|
|
85
|
-
}
|
|
86
|
-
const error = step === "decode_input" && !(e instanceof ORPCError) ? new ORPCError("BAD_REQUEST", {
|
|
87
|
-
message: `Malformed request. Ensure the request body is properly formatted and the 'Content-Type' header is set correctly.`,
|
|
88
|
-
cause: e
|
|
89
|
-
}) : toORPCError(e);
|
|
90
|
-
const response = this.codec.encodeError(error);
|
|
91
|
-
return {
|
|
92
|
-
matched: true,
|
|
93
|
-
response
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export { CompositeStandardHandlerPlugin, StandardHandler };
|
|
6
|
+
import '@temporary-name/zod';
|
|
7
|
+
import '../../shared/server.BEHw7Eyx.mjs';
|
|
8
|
+
import '@temporary-name/server';
|
|
9
|
+
import 'rou3';
|