@orpc/openapi 0.45.1 → 0.46.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/dist/adapters/fetch/index.d.mts +1 -1
- package/dist/adapters/fetch/index.d.ts +1 -1
- package/dist/adapters/fetch/index.mjs +1 -1
- package/dist/adapters/hono/index.mjs +1 -1
- package/dist/adapters/next/index.mjs +1 -1
- package/dist/adapters/node/index.d.mts +1 -1
- package/dist/adapters/node/index.d.ts +1 -1
- package/dist/adapters/node/index.mjs +5 -3
- package/dist/adapters/standard/index.d.mts +2 -2
- package/dist/adapters/standard/index.d.ts +2 -2
- package/dist/shared/{openapi.D0VMNR6V.mjs → openapi.BcJH4F9P.mjs} +5 -3
- package/package.json +9 -9
@@ -8,7 +8,7 @@ import { O as OpenAPIHandlerOptions } from '../../shared/openapi.Dz_6xooR.mjs';
|
|
8
8
|
declare class OpenAPIHandler<T extends Context> implements FetchHandler<T> {
|
9
9
|
private readonly standardHandler;
|
10
10
|
constructor(router: Router<T, any>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
11
|
-
handle(request: Request, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
11
|
+
handle(request: Request, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
12
12
|
}
|
13
13
|
|
14
14
|
export { OpenAPIHandler };
|
@@ -8,7 +8,7 @@ import { O as OpenAPIHandlerOptions } from '../../shared/openapi.Dz_6xooR.js';
|
|
8
8
|
declare class OpenAPIHandler<T extends Context> implements FetchHandler<T> {
|
9
9
|
private readonly standardHandler;
|
10
10
|
constructor(router: Router<T, any>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
11
|
-
handle(request: Request, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
11
|
+
handle(request: Request, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & ToFetchResponseOptions>): Promise<FetchHandleResult>;
|
12
12
|
}
|
13
13
|
|
14
14
|
export { OpenAPIHandler };
|
@@ -8,7 +8,7 @@ import { O as OpenAPIHandlerOptions } from '../../shared/openapi.Dz_6xooR.mjs';
|
|
8
8
|
declare class OpenAPIHandler<T extends Context> implements NodeHttpHandler<T> {
|
9
9
|
private readonly standardHandler;
|
10
10
|
constructor(router: Router<T, any>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
11
|
-
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
11
|
+
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
12
12
|
}
|
13
13
|
|
14
14
|
export { OpenAPIHandler };
|
@@ -8,7 +8,7 @@ import { O as OpenAPIHandlerOptions } from '../../shared/openapi.Dz_6xooR.js';
|
|
8
8
|
declare class OpenAPIHandler<T extends Context> implements NodeHttpHandler<T> {
|
9
9
|
private readonly standardHandler;
|
10
10
|
constructor(router: Router<T, any>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
11
|
-
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
11
|
+
handle(req: NodeHttpRequest, res: NodeHttpResponse, ...[options,]: MaybeOptionalOptions<StandardHandleOptions<T> & SendStandardResponseOptions>): Promise<NodeHttpHandleResult>;
|
12
12
|
}
|
13
13
|
|
14
14
|
export { OpenAPIHandler };
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { StandardHandler } from '@orpc/server/standard';
|
2
|
-
import {
|
2
|
+
import { toStandardLazyRequest, sendStandardResponse } from '@orpc/standard-server-node';
|
3
3
|
import { a as OpenAPIMatcher, O as OpenAPICodec } from '../../shared/openapi.CDsfPHgw.mjs';
|
4
4
|
import '@orpc/contract';
|
5
5
|
import '@orpc/openapi-client/standard';
|
@@ -15,8 +15,10 @@ class OpenAPIHandler {
|
|
15
15
|
const codec = options?.codec ?? new OpenAPICodec();
|
16
16
|
this.standardHandler = new StandardHandler(router, matcher, codec, { ...options });
|
17
17
|
}
|
18
|
-
async handle(req, res, ...[
|
19
|
-
|
18
|
+
async handle(req, res, ...[
|
19
|
+
options = {}
|
20
|
+
]) {
|
21
|
+
const standardRequest = toStandardLazyRequest(req, res);
|
20
22
|
const result = await this.standardHandler.handle(standardRequest, options);
|
21
23
|
if (!result.matched) {
|
22
24
|
return { matched: false };
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ORPCError } from '@orpc/client';
|
2
2
|
import { AnyProcedure, AnyRouter } from '@orpc/server';
|
3
3
|
import { StandardCodec, StandardParams, StandardMatcher, StandardMatchResult } from '@orpc/server/standard';
|
4
|
-
import {
|
4
|
+
import { StandardLazyRequest, StandardResponse } from '@orpc/standard-server';
|
5
5
|
import { OpenAPISerializer } from '@orpc/openapi-client/standard';
|
6
6
|
export { O as OpenAPIHandlerOptions } from '../../shared/openapi.Dz_6xooR.mjs';
|
7
7
|
import { HTTPPath } from '@orpc/contract';
|
@@ -9,7 +9,7 @@ import { HTTPPath } from '@orpc/contract';
|
|
9
9
|
declare class OpenAPICodec implements StandardCodec {
|
10
10
|
private readonly serializer;
|
11
11
|
constructor(serializer?: OpenAPISerializer);
|
12
|
-
decode(request:
|
12
|
+
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure): Promise<unknown>;
|
13
13
|
encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
14
14
|
encodeError(error: ORPCError<any, any>): StandardResponse;
|
15
15
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ORPCError } from '@orpc/client';
|
2
2
|
import { AnyProcedure, AnyRouter } from '@orpc/server';
|
3
3
|
import { StandardCodec, StandardParams, StandardMatcher, StandardMatchResult } from '@orpc/server/standard';
|
4
|
-
import {
|
4
|
+
import { StandardLazyRequest, StandardResponse } from '@orpc/standard-server';
|
5
5
|
import { OpenAPISerializer } from '@orpc/openapi-client/standard';
|
6
6
|
export { O as OpenAPIHandlerOptions } from '../../shared/openapi.Dz_6xooR.js';
|
7
7
|
import { HTTPPath } from '@orpc/contract';
|
@@ -9,7 +9,7 @@ import { HTTPPath } from '@orpc/contract';
|
|
9
9
|
declare class OpenAPICodec implements StandardCodec {
|
10
10
|
private readonly serializer;
|
11
11
|
constructor(serializer?: OpenAPISerializer);
|
12
|
-
decode(request:
|
12
|
+
decode(request: StandardLazyRequest, params: StandardParams | undefined, procedure: AnyProcedure): Promise<unknown>;
|
13
13
|
encode(output: unknown, procedure: AnyProcedure): StandardResponse;
|
14
14
|
encodeError(error: ORPCError<any, any>): StandardResponse;
|
15
15
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { StandardHandler } from '@orpc/server/standard';
|
2
|
-
import {
|
2
|
+
import { toStandardLazyRequest, toFetchResponse } from '@orpc/standard-server-fetch';
|
3
3
|
import { a as OpenAPIMatcher, O as OpenAPICodec } from './openapi.CDsfPHgw.mjs';
|
4
4
|
|
5
5
|
class OpenAPIHandler {
|
@@ -9,8 +9,10 @@ class OpenAPIHandler {
|
|
9
9
|
const codec = options?.codec ?? new OpenAPICodec();
|
10
10
|
this.standardHandler = new StandardHandler(router, matcher, codec, options);
|
11
11
|
}
|
12
|
-
async handle(request, ...[
|
13
|
-
|
12
|
+
async handle(request, ...[
|
13
|
+
options = {}
|
14
|
+
]) {
|
15
|
+
const standardRequest = toStandardLazyRequest(request);
|
14
16
|
const result = await this.standardHandler.handle(standardRequest, options);
|
15
17
|
if (!result.matched) {
|
16
18
|
return result;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orpc/openapi",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.
|
4
|
+
"version": "0.46.0",
|
5
5
|
"license": "MIT",
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
7
7
|
"repository": {
|
@@ -52,14 +52,14 @@
|
|
52
52
|
"json-schema-typed": "^8.0.1",
|
53
53
|
"openapi3-ts": "^4.4.0",
|
54
54
|
"rou3": "^0.5.1",
|
55
|
-
"@orpc/client": "0.
|
56
|
-
"@orpc/
|
57
|
-
"@orpc/
|
58
|
-
"@orpc/
|
59
|
-
"@orpc/
|
60
|
-
"@orpc/standard-server": "0.
|
61
|
-
"@orpc/standard-server-fetch": "0.
|
62
|
-
"@orpc/standard-server-node": "0.
|
55
|
+
"@orpc/client": "0.46.0",
|
56
|
+
"@orpc/contract": "0.46.0",
|
57
|
+
"@orpc/openapi-client": "0.46.0",
|
58
|
+
"@orpc/shared": "0.46.0",
|
59
|
+
"@orpc/server": "0.46.0",
|
60
|
+
"@orpc/standard-server": "0.46.0",
|
61
|
+
"@orpc/standard-server-fetch": "0.46.0",
|
62
|
+
"@orpc/standard-server-node": "0.46.0"
|
63
63
|
},
|
64
64
|
"devDependencies": {
|
65
65
|
"zod": "^3.24.1"
|