@orpc/openapi 2.0.0-beta.23 → 2.0.0-beta.24
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/README.md +4 -1
- package/dist/adapters/aws-lambda/index.d.mts +26 -0
- package/dist/adapters/aws-lambda/index.d.ts +26 -0
- package/dist/adapters/aws-lambda/index.mjs +21 -0
- package/dist/adapters/fastify/index.d.mts +23 -0
- package/dist/adapters/fastify/index.d.ts +23 -0
- package/dist/adapters/fastify/index.mjs +21 -0
- package/dist/adapters/fetch/index.d.mts +13 -3
- package/dist/adapters/fetch/index.d.ts +13 -3
- package/dist/adapters/node/index.d.mts +7 -2
- package/dist/adapters/node/index.d.ts +7 -2
- package/dist/adapters/standard/index.d.mts +3 -3
- package/dist/adapters/standard/index.d.ts +3 -3
- package/dist/extensions/route.d.mts +2 -2
- package/dist/extensions/route.d.ts +2 -2
- package/dist/helpers/index.d.mts +9 -1
- package/dist/helpers/index.d.ts +9 -1
- package/dist/index.d.mts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/plugins/index.d.mts +10 -1
- package/dist/plugins/index.d.ts +10 -1
- package/dist/shared/{openapi.Dam82YDK.d.mts → openapi.9smDzQwj.d.mts} +1 -1
- package/dist/shared/{openapi.CTxN9oam.d.mts → openapi.B2hM6qoN.d.mts} +1 -1
- package/dist/shared/{openapi.BWJ1qv3c.d.ts → openapi.CEDnaiYB.d.ts} +1 -1
- package/dist/shared/{openapi.Du7gMjyF.d.ts → openapi.DPcT6OhO.d.ts} +8 -1
- package/dist/shared/{openapi.DBFXInk5.d.mts → openapi.Dz-JaXHo.d.mts} +6 -0
- package/dist/shared/{openapi.DBFXInk5.d.ts → openapi.Dz-JaXHo.d.ts} +6 -0
- package/dist/shared/{openapi.COG_72WY.d.mts → openapi.W_GSmPls.d.mts} +8 -1
- package/dist/shared/{openapi.D7Fpk6aV.d.ts → openapi.YCiBHaJ-.d.ts} +1 -1
- package/dist/shared/{openapi.Bsz7d8xx.d.mts → openapi.zfTTuQ4S.d.mts} +3 -1
- package/dist/shared/{openapi.Bsz7d8xx.d.ts → openapi.zfTTuQ4S.d.ts} +3 -1
- package/package.json +20 -9
package/README.md
CHANGED
|
@@ -44,6 +44,7 @@ You can read the documentation [here](https://orpc.dev).
|
|
|
44
44
|
|
|
45
45
|
- [@orpc/publisher](https://www.npmjs.com/package/@orpc/publisher): Pub/Sub with memory, Redis, and Upstash adapters.
|
|
46
46
|
- [@orpc/ratelimit](https://www.npmjs.com/package/@orpc/ratelimit): Rate limiting with memory, Redis, and Upstash adapters.
|
|
47
|
+
- [@orpc/hibernation](https://www.npmjs.com/package/@orpc/hibernation): Leverage Hibernation APIs like [Cloudflare's Hibernation WebSocket](https://developers.cloudflare.com/durable-objects/best-practices/websockets/#durable-objects-hibernation-websocket-api).
|
|
47
48
|
- [@orpc/json-schema](https://www.npmjs.com/package/@orpc/json-schema): Smart coercion for OpenAPI requests.
|
|
48
49
|
|
|
49
50
|
**Framework & ecosystem integrations**
|
|
@@ -114,6 +115,7 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
114
115
|
</tr>
|
|
115
116
|
<tr>
|
|
116
117
|
<td align="center"><a href="https://github.com/itigoore01?ref=orpc" target="_blank" rel="noopener" title="shota"><img src="https://avatars.githubusercontent.com/u/11831107?u=c976a6dc7e055eb026304c46c99100ed22b0c8e0&v=4" width="139" alt="shota"/><br />shota</a></td>
|
|
118
|
+
<td align="center"><a href="https://github.com/ellis-driscoll?ref=orpc" target="_blank" rel="noopener" title="Ellis Driscoll"><img src="https://avatars.githubusercontent.com/u/70685966?u=c5f95bc33b5991d9744abe00052542e4a2ed3cb9&v=4" width="139" alt="Ellis Driscoll"/><br />Ellis Driscoll</a></td>
|
|
117
119
|
</tr>
|
|
118
120
|
</table>
|
|
119
121
|
|
|
@@ -139,8 +141,9 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
139
141
|
<td align="center"><a href="https://github.com/mr-kelly?ref=orpc" target="_blank" rel="noopener" title="Kelly Peilin Chan"><img src="https://avatars.githubusercontent.com/u/520852?u=6b0f7105f694e7b5cacf410a3f04c7044b469dc8&v=4" width="119" alt="Kelly Peilin Chan"/><br />Kelly Peilin Chan</a></td>
|
|
140
142
|
</tr>
|
|
141
143
|
<tr>
|
|
144
|
+
<td align="center"><a href="https://github.com/guyariely?ref=orpc" target="_blank" rel="noopener" title="Guy Ariely"><img src="https://avatars.githubusercontent.com/u/42813496?u=edb6b7f563bf28e160a290832e7da57c0506f8ca&v=4" width="119" alt="Guy Ariely"/><br />Guy Ariely</a></td>
|
|
142
145
|
<td align="center"><a href="https://github.com/piscis?ref=orpc" target="_blank" rel="noopener" title="Alex"><img src="https://avatars.githubusercontent.com/u/326163?u=b245f368bd940cf51d08c0b6bf55f8257f359437&v=4" width="119" alt="Alex"/><br />Alex</a></td>
|
|
143
|
-
<td align="center"><a href="https://github.com/finom?ref=orpc" target="_blank" rel="noopener" title="Andrey Gubanov"><img src="https://avatars.githubusercontent.com/u/1082083?u=
|
|
146
|
+
<td align="center"><a href="https://github.com/finom?ref=orpc" target="_blank" rel="noopener" title="Andrey Gubanov"><img src="https://avatars.githubusercontent.com/u/1082083?u=c5f2daf7ebece498e85c83367bb37b4e10e2649d&v=4" width="119" alt="Andrey Gubanov"/><br />Andrey Gubanov</a></td>
|
|
144
147
|
</tr>
|
|
145
148
|
</table>
|
|
146
149
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Context, Router } from '@orpc/server';
|
|
2
|
+
import { AwsLambdaHandler, AwsLambdaHandlerOptions } from '@orpc/server/aws-lambda';
|
|
3
|
+
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.9smDzQwj.mjs';
|
|
5
|
+
import '@orpc/client';
|
|
6
|
+
import '@orpc/shared';
|
|
7
|
+
import '@standardserver/core';
|
|
8
|
+
import '@orpc/contract';
|
|
9
|
+
import '../../shared/openapi.Dz-JaXHo.mjs';
|
|
10
|
+
|
|
11
|
+
interface OpenAPIHandlerOptions<T extends Context> extends AwsLambdaHandlerOptions<T>, Omit<StandardHandlerOptions<T>, 'plugins'>, OpenAPIHandlerCodecOptions<T> {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Serves oRPC procedures over the OpenAPI (RESTful) protocol on AWS Lambda.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* **Warning**: Requires the AWS Lambda Node.js runtime with response streaming enabled — handlers should be wrapped with `awslambda.streamifyResponse`.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link https://orpc.dev/docs/adapters/aws-lambda | AWS Lambda Adapter}
|
|
20
|
+
*/
|
|
21
|
+
declare class OpenAPIHandler<T extends Context> extends AwsLambdaHandler<T> {
|
|
22
|
+
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { OpenAPIHandler };
|
|
26
|
+
export type { OpenAPIHandlerOptions };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Context, Router } from '@orpc/server';
|
|
2
|
+
import { AwsLambdaHandler, AwsLambdaHandlerOptions } from '@orpc/server/aws-lambda';
|
|
3
|
+
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.YCiBHaJ-.js';
|
|
5
|
+
import '@orpc/client';
|
|
6
|
+
import '@orpc/shared';
|
|
7
|
+
import '@standardserver/core';
|
|
8
|
+
import '@orpc/contract';
|
|
9
|
+
import '../../shared/openapi.Dz-JaXHo.js';
|
|
10
|
+
|
|
11
|
+
interface OpenAPIHandlerOptions<T extends Context> extends AwsLambdaHandlerOptions<T>, Omit<StandardHandlerOptions<T>, 'plugins'>, OpenAPIHandlerCodecOptions<T> {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Serves oRPC procedures over the OpenAPI (RESTful) protocol on AWS Lambda.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* **Warning**: Requires the AWS Lambda Node.js runtime with response streaming enabled — handlers should be wrapped with `awslambda.streamifyResponse`.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link https://orpc.dev/docs/adapters/aws-lambda | AWS Lambda Adapter}
|
|
20
|
+
*/
|
|
21
|
+
declare class OpenAPIHandler<T extends Context> extends AwsLambdaHandler<T> {
|
|
22
|
+
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { OpenAPIHandler };
|
|
26
|
+
export type { OpenAPIHandlerOptions };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AwsLambdaHandler } from '@orpc/server/aws-lambda';
|
|
2
|
+
import { StandardHandler } from '@orpc/server/standard';
|
|
3
|
+
import { O as OpenAPIHandlerCodec } from '../../shared/openapi.BaqI61Xi.mjs';
|
|
4
|
+
import '@orpc/client';
|
|
5
|
+
import '@orpc/server';
|
|
6
|
+
import '@orpc/shared';
|
|
7
|
+
import '@standardserver/core';
|
|
8
|
+
import '../../shared/openapi.0yE-t1W-.mjs';
|
|
9
|
+
import '../../shared/openapi.s_p5sN-P.mjs';
|
|
10
|
+
import '../../shared/openapi.B9PQzqBn.mjs';
|
|
11
|
+
import 'rou3';
|
|
12
|
+
|
|
13
|
+
class OpenAPIHandler extends AwsLambdaHandler {
|
|
14
|
+
constructor(router, options = {}) {
|
|
15
|
+
const codec = new OpenAPIHandlerCodec(router, options);
|
|
16
|
+
const handler = new StandardHandler(codec, options);
|
|
17
|
+
super(handler, options);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { OpenAPIHandler };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Context, Router } from '@orpc/server';
|
|
2
|
+
import { FastifyHandler, FastifyHandlerOptions } from '@orpc/server/fastify';
|
|
3
|
+
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.9smDzQwj.mjs';
|
|
5
|
+
import '@orpc/client';
|
|
6
|
+
import '@orpc/shared';
|
|
7
|
+
import '@standardserver/core';
|
|
8
|
+
import '@orpc/contract';
|
|
9
|
+
import '../../shared/openapi.Dz-JaXHo.mjs';
|
|
10
|
+
|
|
11
|
+
interface OpenAPIHandlerOptions<T extends Context> extends FastifyHandlerOptions<T>, Omit<StandardHandlerOptions<T>, 'plugins'>, OpenAPIHandlerCodecOptions<T> {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Serves oRPC procedures over the OpenAPI (RESTful) protocol as part of a Fastify server.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/fastify | Fastify Adapter}
|
|
17
|
+
*/
|
|
18
|
+
declare class OpenAPIHandler<T extends Context> extends FastifyHandler<T> {
|
|
19
|
+
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { OpenAPIHandler };
|
|
23
|
+
export type { OpenAPIHandlerOptions };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Context, Router } from '@orpc/server';
|
|
2
|
+
import { FastifyHandler, FastifyHandlerOptions } from '@orpc/server/fastify';
|
|
3
|
+
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.YCiBHaJ-.js';
|
|
5
|
+
import '@orpc/client';
|
|
6
|
+
import '@orpc/shared';
|
|
7
|
+
import '@standardserver/core';
|
|
8
|
+
import '@orpc/contract';
|
|
9
|
+
import '../../shared/openapi.Dz-JaXHo.js';
|
|
10
|
+
|
|
11
|
+
interface OpenAPIHandlerOptions<T extends Context> extends FastifyHandlerOptions<T>, Omit<StandardHandlerOptions<T>, 'plugins'>, OpenAPIHandlerCodecOptions<T> {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Serves oRPC procedures over the OpenAPI (RESTful) protocol as part of a Fastify server.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/fastify | Fastify Adapter}
|
|
17
|
+
*/
|
|
18
|
+
declare class OpenAPIHandler<T extends Context> extends FastifyHandler<T> {
|
|
19
|
+
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { OpenAPIHandler };
|
|
23
|
+
export type { OpenAPIHandlerOptions };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FastifyHandler } from '@orpc/server/fastify';
|
|
2
|
+
import { StandardHandler } from '@orpc/server/standard';
|
|
3
|
+
import { O as OpenAPIHandlerCodec } from '../../shared/openapi.BaqI61Xi.mjs';
|
|
4
|
+
import '@orpc/client';
|
|
5
|
+
import '@orpc/server';
|
|
6
|
+
import '@orpc/shared';
|
|
7
|
+
import '@standardserver/core';
|
|
8
|
+
import '../../shared/openapi.0yE-t1W-.mjs';
|
|
9
|
+
import '../../shared/openapi.s_p5sN-P.mjs';
|
|
10
|
+
import '../../shared/openapi.B9PQzqBn.mjs';
|
|
11
|
+
import 'rou3';
|
|
12
|
+
|
|
13
|
+
class OpenAPIHandler extends FastifyHandler {
|
|
14
|
+
constructor(router, options = {}) {
|
|
15
|
+
const codec = new OpenAPIHandlerCodec(router, options);
|
|
16
|
+
const handler = new StandardHandler(codec, options);
|
|
17
|
+
super(handler, options);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { OpenAPIHandler };
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
2
|
import { FetchHandler, FetchHandlerOptions } from '@orpc/server/fetch';
|
|
3
3
|
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
-
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.9smDzQwj.mjs';
|
|
5
5
|
import { ClientContext } from '@orpc/client';
|
|
6
6
|
import { FetchLinkTransportOptions } from '@orpc/client/fetch';
|
|
7
7
|
import { StandardLink, StandardLinkOptions } from '@orpc/client/standard';
|
|
8
8
|
import { RouterContract } from '@orpc/contract';
|
|
9
|
-
import { O as OpenAPILinkCodecOptions } from '../../shared/openapi.
|
|
9
|
+
import { O as OpenAPILinkCodecOptions } from '../../shared/openapi.B2hM6qoN.mjs';
|
|
10
10
|
import '@orpc/shared';
|
|
11
11
|
import '@standardserver/core';
|
|
12
|
-
import '../../shared/openapi.
|
|
12
|
+
import '../../shared/openapi.Dz-JaXHo.mjs';
|
|
13
13
|
|
|
14
14
|
interface OpenAPIHandlerOptions<T extends Context> extends FetchHandlerOptions<T>, Omit<StandardHandlerOptions<T>, 'plugins'>, OpenAPIHandlerCodecOptions<T> {
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Serves oRPC procedures over the OpenAPI (RESTful) protocol using the Fetch API `Request`/`Response`.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link https://orpc.dev/docs/adapters/fetch-api | Fetch API Adapter}
|
|
20
|
+
*/
|
|
16
21
|
declare class OpenAPIHandler<T extends Context> extends FetchHandler<T> {
|
|
17
22
|
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
interface OpenAPILinkOptions<T extends ClientContext> extends Omit<StandardLinkOptions<T>, 'plugins'>, FetchLinkTransportOptions<T>, OpenAPILinkCodecOptions<T> {
|
|
21
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Client link that calls an OpenAPI (RESTful) oRPC server over HTTP using the Fetch API.
|
|
29
|
+
*
|
|
30
|
+
* @see {@link https://orpc.dev/docs/openapi/link | OpenAPI Link}
|
|
31
|
+
*/
|
|
22
32
|
declare class OpenAPILink<T extends ClientContext> extends StandardLink<T> {
|
|
23
33
|
constructor(router: RouterContract, options?: OpenAPILinkOptions<T>);
|
|
24
34
|
}
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
2
|
import { FetchHandler, FetchHandlerOptions } from '@orpc/server/fetch';
|
|
3
3
|
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
-
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.YCiBHaJ-.js';
|
|
5
5
|
import { ClientContext } from '@orpc/client';
|
|
6
6
|
import { FetchLinkTransportOptions } from '@orpc/client/fetch';
|
|
7
7
|
import { StandardLink, StandardLinkOptions } from '@orpc/client/standard';
|
|
8
8
|
import { RouterContract } from '@orpc/contract';
|
|
9
|
-
import { O as OpenAPILinkCodecOptions } from '../../shared/openapi.
|
|
9
|
+
import { O as OpenAPILinkCodecOptions } from '../../shared/openapi.CEDnaiYB.js';
|
|
10
10
|
import '@orpc/shared';
|
|
11
11
|
import '@standardserver/core';
|
|
12
|
-
import '../../shared/openapi.
|
|
12
|
+
import '../../shared/openapi.Dz-JaXHo.js';
|
|
13
13
|
|
|
14
14
|
interface OpenAPIHandlerOptions<T extends Context> extends FetchHandlerOptions<T>, Omit<StandardHandlerOptions<T>, 'plugins'>, OpenAPIHandlerCodecOptions<T> {
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Serves oRPC procedures over the OpenAPI (RESTful) protocol using the Fetch API `Request`/`Response`.
|
|
18
|
+
*
|
|
19
|
+
* @see {@link https://orpc.dev/docs/adapters/fetch-api | Fetch API Adapter}
|
|
20
|
+
*/
|
|
16
21
|
declare class OpenAPIHandler<T extends Context> extends FetchHandler<T> {
|
|
17
22
|
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
interface OpenAPILinkOptions<T extends ClientContext> extends Omit<StandardLinkOptions<T>, 'plugins'>, FetchLinkTransportOptions<T>, OpenAPILinkCodecOptions<T> {
|
|
21
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Client link that calls an OpenAPI (RESTful) oRPC server over HTTP using the Fetch API.
|
|
29
|
+
*
|
|
30
|
+
* @see {@link https://orpc.dev/docs/openapi/link | OpenAPI Link}
|
|
31
|
+
*/
|
|
22
32
|
declare class OpenAPILink<T extends ClientContext> extends StandardLink<T> {
|
|
23
33
|
constructor(router: RouterContract, options?: OpenAPILinkOptions<T>);
|
|
24
34
|
}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
2
|
import { NodeHttpHandler, NodeHttpHandlerOptions } from '@orpc/server/node';
|
|
3
3
|
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
-
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.9smDzQwj.mjs';
|
|
5
5
|
import '@orpc/client';
|
|
6
6
|
import '@orpc/shared';
|
|
7
7
|
import '@standardserver/core';
|
|
8
8
|
import '@orpc/contract';
|
|
9
|
-
import '../../shared/openapi.
|
|
9
|
+
import '../../shared/openapi.Dz-JaXHo.mjs';
|
|
10
10
|
|
|
11
11
|
interface OpenAPIHandlerOptions<T extends Context> extends NodeHttpHandlerOptions<T>, Omit<StandardHandlerOptions<T>, 'plugins'>, OpenAPIHandlerCodecOptions<T> {
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Serves oRPC procedures over the OpenAPI (RESTful) protocol using Node.js built-in HTTP request/response.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/node-http | Node HTTP Adapter}
|
|
17
|
+
*/
|
|
13
18
|
declare class OpenAPIHandler<T extends Context> extends NodeHttpHandler<T> {
|
|
14
19
|
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
15
20
|
}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
2
|
import { NodeHttpHandler, NodeHttpHandlerOptions } from '@orpc/server/node';
|
|
3
3
|
import { StandardHandlerOptions } from '@orpc/server/standard';
|
|
4
|
-
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.
|
|
4
|
+
import { O as OpenAPIHandlerCodecOptions } from '../../shared/openapi.YCiBHaJ-.js';
|
|
5
5
|
import '@orpc/client';
|
|
6
6
|
import '@orpc/shared';
|
|
7
7
|
import '@standardserver/core';
|
|
8
8
|
import '@orpc/contract';
|
|
9
|
-
import '../../shared/openapi.
|
|
9
|
+
import '../../shared/openapi.Dz-JaXHo.js';
|
|
10
10
|
|
|
11
11
|
interface OpenAPIHandlerOptions<T extends Context> extends NodeHttpHandlerOptions<T>, Omit<StandardHandlerOptions<T>, 'plugins'>, OpenAPIHandlerCodecOptions<T> {
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Serves oRPC procedures over the OpenAPI (RESTful) protocol using Node.js built-in HTTP request/response.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/node-http | Node HTTP Adapter}
|
|
17
|
+
*/
|
|
13
18
|
declare class OpenAPIHandler<T extends Context> extends NodeHttpHandler<T> {
|
|
14
19
|
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
15
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { a as OpenAPIHandlerCodec, b as OpenAPIHandlerCodecCore, c as OpenAPIHandlerCodecCoreOptions, O as OpenAPIHandlerCodecOptions, d as OpenAPIMatcher, e as OpenAPIMatcherOptions } from '../../shared/openapi.
|
|
2
|
-
export { a as OpenAPILinkCodec, b as OpenAPILinkCodecError, O as OpenAPILinkCodecOptions } from '../../shared/openapi.
|
|
1
|
+
export { a as OpenAPIHandlerCodec, b as OpenAPIHandlerCodecCore, c as OpenAPIHandlerCodecCoreOptions, O as OpenAPIHandlerCodecOptions, d as OpenAPIMatcher, e as OpenAPIMatcherOptions } from '../../shared/openapi.9smDzQwj.mjs';
|
|
2
|
+
export { a as OpenAPILinkCodec, b as OpenAPILinkCodecError, O as OpenAPILinkCodecOptions } from '../../shared/openapi.B2hM6qoN.mjs';
|
|
3
3
|
import { StandardHeaders } from '@standardserver/core';
|
|
4
|
-
import { O as OpenAPISerializer } from '../../shared/openapi.
|
|
4
|
+
import { O as OpenAPISerializer } from '../../shared/openapi.Dz-JaXHo.mjs';
|
|
5
5
|
import '@orpc/client';
|
|
6
6
|
import '@orpc/server';
|
|
7
7
|
import '@orpc/server/standard';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { a as OpenAPIHandlerCodec, b as OpenAPIHandlerCodecCore, c as OpenAPIHandlerCodecCoreOptions, O as OpenAPIHandlerCodecOptions, d as OpenAPIMatcher, e as OpenAPIMatcherOptions } from '../../shared/openapi.
|
|
2
|
-
export { a as OpenAPILinkCodec, b as OpenAPILinkCodecError, O as OpenAPILinkCodecOptions } from '../../shared/openapi.
|
|
1
|
+
export { a as OpenAPIHandlerCodec, b as OpenAPIHandlerCodecCore, c as OpenAPIHandlerCodecCoreOptions, O as OpenAPIHandlerCodecOptions, d as OpenAPIMatcher, e as OpenAPIMatcherOptions } from '../../shared/openapi.YCiBHaJ-.js';
|
|
2
|
+
export { a as OpenAPILinkCodec, b as OpenAPILinkCodecError, O as OpenAPILinkCodecOptions } from '../../shared/openapi.CEDnaiYB.js';
|
|
3
3
|
import { StandardHeaders } from '@standardserver/core';
|
|
4
|
-
import { O as OpenAPISerializer } from '../../shared/openapi.
|
|
4
|
+
import { O as OpenAPISerializer } from '../../shared/openapi.Dz-JaXHo.js';
|
|
5
5
|
import '@orpc/client';
|
|
6
6
|
import '@orpc/server';
|
|
7
7
|
import '@orpc/server/standard';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AnyORPCError } from '@orpc/client';
|
|
2
2
|
import { ErrorMap, AnySchema } from '@orpc/contract';
|
|
3
3
|
import { Context } from '@orpc/server';
|
|
4
|
-
import { O as OpenAPIMeta } from '../shared/openapi.
|
|
4
|
+
import { O as OpenAPIMeta } from '../shared/openapi.W_GSmPls.mjs';
|
|
5
5
|
import '@orpc/shared';
|
|
6
6
|
import '@standardserver/core';
|
|
7
|
-
import '../shared/openapi.
|
|
7
|
+
import '../shared/openapi.zfTTuQ4S.mjs';
|
|
8
8
|
import '@hey-api/spec-types';
|
|
9
9
|
|
|
10
10
|
declare module '@orpc/contract' {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AnyORPCError } from '@orpc/client';
|
|
2
2
|
import { ErrorMap, AnySchema } from '@orpc/contract';
|
|
3
3
|
import { Context } from '@orpc/server';
|
|
4
|
-
import { O as OpenAPIMeta } from '../shared/openapi.
|
|
4
|
+
import { O as OpenAPIMeta } from '../shared/openapi.DPcT6OhO.js';
|
|
5
5
|
import '@orpc/shared';
|
|
6
6
|
import '@standardserver/core';
|
|
7
|
-
import '../shared/openapi.
|
|
7
|
+
import '../shared/openapi.zfTTuQ4S.js';
|
|
8
8
|
import '@hey-api/spec-types';
|
|
9
9
|
|
|
10
10
|
declare module '@orpc/contract' {
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -23,10 +23,15 @@
|
|
|
23
23
|
* // thumb: form.get('thumb'),
|
|
24
24
|
* // }
|
|
25
25
|
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see {@link https://orpc.dev/docs/helpers/form-data#parseformdata | Form Data Helpers - parseFormData}
|
|
26
28
|
*/
|
|
27
29
|
declare function parseFormData(form: FormData): any;
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* Gets the issue message from the error for a given field path.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* **Note**: Requires validation errors to follow the standard schema issue format, stored under `data.issues` — customized validation errors may not be found.
|
|
30
35
|
*
|
|
31
36
|
* @example
|
|
32
37
|
* ```tsx
|
|
@@ -42,9 +47,12 @@ declare function parseFormData(form: FormData): any;
|
|
|
42
47
|
* <input name="images[]" type="file" />
|
|
43
48
|
* <p>{getIssueMessage(error, 'images[]')}</p>
|
|
44
49
|
* </form>
|
|
50
|
+
* ```
|
|
45
51
|
*
|
|
46
52
|
* @param error - The error (can be anything) can contain `data.issues` (standard schema issues)
|
|
47
53
|
* @param path - The path of the field that has the issue follow [bracket notation](https://orpc.dev/docs/openapi/bracket-notation)
|
|
54
|
+
*
|
|
55
|
+
* @see {@link https://orpc.dev/docs/helpers/form-data#getissuemessage | Form Data Helpers - getIssueMessage}
|
|
48
56
|
*/
|
|
49
57
|
declare function getIssueMessage(error: unknown, path: string): string | undefined;
|
|
50
58
|
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -23,10 +23,15 @@
|
|
|
23
23
|
* // thumb: form.get('thumb'),
|
|
24
24
|
* // }
|
|
25
25
|
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see {@link https://orpc.dev/docs/helpers/form-data#parseformdata | Form Data Helpers - parseFormData}
|
|
26
28
|
*/
|
|
27
29
|
declare function parseFormData(form: FormData): any;
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
31
|
+
* Gets the issue message from the error for a given field path.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* **Note**: Requires validation errors to follow the standard schema issue format, stored under `data.issues` — customized validation errors may not be found.
|
|
30
35
|
*
|
|
31
36
|
* @example
|
|
32
37
|
* ```tsx
|
|
@@ -42,9 +47,12 @@ declare function parseFormData(form: FormData): any;
|
|
|
42
47
|
* <input name="images[]" type="file" />
|
|
43
48
|
* <p>{getIssueMessage(error, 'images[]')}</p>
|
|
44
49
|
* </form>
|
|
50
|
+
* ```
|
|
45
51
|
*
|
|
46
52
|
* @param error - The error (can be anything) can contain `data.issues` (standard schema issues)
|
|
47
53
|
* @param path - The path of the field that has the issue follow [bracket notation](https://orpc.dev/docs/openapi/bracket-notation)
|
|
54
|
+
*
|
|
55
|
+
* @see {@link https://orpc.dev/docs/helpers/form-data#getissuemessage | Form Data Helpers - getIssueMessage}
|
|
48
56
|
*/
|
|
49
57
|
declare function getIssueMessage(error: unknown, path: string): string | undefined;
|
|
50
58
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { O as OpenAPISerializer } from './shared/openapi.
|
|
2
|
-
export { B as BracketNotationSerializeResult, a as BracketNotationSerializer, b as BracketNotationSerializerOptions, c as OpenAPIJsonSerialization, d as OpenAPIJsonSerializer, e as OpenAPIJsonSerializerHandler, f as OpenAPIJsonSerializerOptions, g as OpenAPISerializerOptions, h as OpenAPISerializerSerializeOptions } from './shared/openapi.
|
|
1
|
+
import { O as OpenAPISerializer } from './shared/openapi.Dz-JaXHo.mjs';
|
|
2
|
+
export { B as BracketNotationSerializeResult, a as BracketNotationSerializer, b as BracketNotationSerializerOptions, c as OpenAPIJsonSerialization, d as OpenAPIJsonSerializer, e as OpenAPIJsonSerializerHandler, f as OpenAPIJsonSerializerOptions, g as OpenAPISerializerOptions, h as OpenAPISerializerSerializeOptions } from './shared/openapi.Dz-JaXHo.mjs';
|
|
3
3
|
import { ClientContext, ORPCClientOptions, ClientLink } from '@orpc/client';
|
|
4
4
|
export { COMMON_ERROR_STATUS_MAP } from '@orpc/client';
|
|
5
5
|
import { RouterContract, RouterContractClient, AnyProcedureContract, ProcedureContract } from '@orpc/contract';
|
|
6
|
-
import { J as JsonifiedClient, O as OpenAPIDocument } from './shared/openapi.
|
|
7
|
-
export { a as JsonifiedArray, b as JsonifiedClientError, c as JsonifiedValue, d as OpenAPIOperationObject } from './shared/openapi.
|
|
8
|
-
export { a as OpenAPIFunction, O as OpenAPIMeta, b as OpenAPIMetaPlugin, c as OpenAPIMethodMetaPlugin, d as OpenAPIPathMetaPlugin, e as OpenAPIPrefixMetaPlugin, f as OpenAPISpecMetaPlugin, g as getOpenAPIMeta, o as openapi } from './shared/openapi.
|
|
6
|
+
import { J as JsonifiedClient, O as OpenAPIDocument } from './shared/openapi.zfTTuQ4S.mjs';
|
|
7
|
+
export { a as JsonifiedArray, b as JsonifiedClientError, c as JsonifiedValue, d as OpenAPIOperationObject } from './shared/openapi.zfTTuQ4S.mjs';
|
|
8
|
+
export { a as OpenAPIFunction, O as OpenAPIMeta, b as OpenAPIMetaPlugin, c as OpenAPIMethodMetaPlugin, d as OpenAPIPathMetaPlugin, e as OpenAPIPrefixMetaPlugin, f as OpenAPISpecMetaPlugin, g as getOpenAPIMeta, o as openapi } from './shared/openapi.W_GSmPls.mjs';
|
|
9
9
|
import { JsonSchema, JsonSchemaConverter } from '@orpc/json-schema';
|
|
10
10
|
import { AnyRouter, AnyProcedure } from '@orpc/server';
|
|
11
11
|
import { Value } from '@orpc/shared';
|
|
@@ -99,6 +99,12 @@ interface OpenAPIGeneratorGenerateOptions {
|
|
|
99
99
|
*/
|
|
100
100
|
errorStatusMap?: Record<string, number> | undefined;
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Generates an OpenAPI 3.1 document from a contract or a router.
|
|
104
|
+
* Relies on JSON schema converters to translate input, output, and error schemas into JSON Schemas.
|
|
105
|
+
*
|
|
106
|
+
* @see {@link https://orpc.dev/docs/openapi/specification#openapi-generator | OpenAPI Specification - OpenAPI Generator}
|
|
107
|
+
*/
|
|
102
108
|
declare class OpenAPIGenerator {
|
|
103
109
|
private readonly serializer;
|
|
104
110
|
private readonly converter;
|
|
@@ -122,6 +128,8 @@ interface PopulateRouterContractOpenAPIPathsOptions {
|
|
|
122
128
|
*
|
|
123
129
|
* Builds paths by joining router keys with `/`.
|
|
124
130
|
* Useful when you want to ensure all contracts define openapi.path, such as for NestJS integration requirements.
|
|
131
|
+
*
|
|
132
|
+
* @see {@link https://orpc.dev/docs/integrations/nest | Implement oRPC contract with NestJS}
|
|
125
133
|
*/
|
|
126
134
|
declare function populateRouterContractOpenAPIPaths<T extends RouterContract>(router: T, options?: PopulateRouterContractOpenAPIPathsOptions): PopulatedContractRouterOpenAPIPaths<T>;
|
|
127
135
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { O as OpenAPISerializer } from './shared/openapi.
|
|
2
|
-
export { B as BracketNotationSerializeResult, a as BracketNotationSerializer, b as BracketNotationSerializerOptions, c as OpenAPIJsonSerialization, d as OpenAPIJsonSerializer, e as OpenAPIJsonSerializerHandler, f as OpenAPIJsonSerializerOptions, g as OpenAPISerializerOptions, h as OpenAPISerializerSerializeOptions } from './shared/openapi.
|
|
1
|
+
import { O as OpenAPISerializer } from './shared/openapi.Dz-JaXHo.js';
|
|
2
|
+
export { B as BracketNotationSerializeResult, a as BracketNotationSerializer, b as BracketNotationSerializerOptions, c as OpenAPIJsonSerialization, d as OpenAPIJsonSerializer, e as OpenAPIJsonSerializerHandler, f as OpenAPIJsonSerializerOptions, g as OpenAPISerializerOptions, h as OpenAPISerializerSerializeOptions } from './shared/openapi.Dz-JaXHo.js';
|
|
3
3
|
import { ClientContext, ORPCClientOptions, ClientLink } from '@orpc/client';
|
|
4
4
|
export { COMMON_ERROR_STATUS_MAP } from '@orpc/client';
|
|
5
5
|
import { RouterContract, RouterContractClient, AnyProcedureContract, ProcedureContract } from '@orpc/contract';
|
|
6
|
-
import { J as JsonifiedClient, O as OpenAPIDocument } from './shared/openapi.
|
|
7
|
-
export { a as JsonifiedArray, b as JsonifiedClientError, c as JsonifiedValue, d as OpenAPIOperationObject } from './shared/openapi.
|
|
8
|
-
export { a as OpenAPIFunction, O as OpenAPIMeta, b as OpenAPIMetaPlugin, c as OpenAPIMethodMetaPlugin, d as OpenAPIPathMetaPlugin, e as OpenAPIPrefixMetaPlugin, f as OpenAPISpecMetaPlugin, g as getOpenAPIMeta, o as openapi } from './shared/openapi.
|
|
6
|
+
import { J as JsonifiedClient, O as OpenAPIDocument } from './shared/openapi.zfTTuQ4S.js';
|
|
7
|
+
export { a as JsonifiedArray, b as JsonifiedClientError, c as JsonifiedValue, d as OpenAPIOperationObject } from './shared/openapi.zfTTuQ4S.js';
|
|
8
|
+
export { a as OpenAPIFunction, O as OpenAPIMeta, b as OpenAPIMetaPlugin, c as OpenAPIMethodMetaPlugin, d as OpenAPIPathMetaPlugin, e as OpenAPIPrefixMetaPlugin, f as OpenAPISpecMetaPlugin, g as getOpenAPIMeta, o as openapi } from './shared/openapi.DPcT6OhO.js';
|
|
9
9
|
import { JsonSchema, JsonSchemaConverter } from '@orpc/json-schema';
|
|
10
10
|
import { AnyRouter, AnyProcedure } from '@orpc/server';
|
|
11
11
|
import { Value } from '@orpc/shared';
|
|
@@ -99,6 +99,12 @@ interface OpenAPIGeneratorGenerateOptions {
|
|
|
99
99
|
*/
|
|
100
100
|
errorStatusMap?: Record<string, number> | undefined;
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Generates an OpenAPI 3.1 document from a contract or a router.
|
|
104
|
+
* Relies on JSON schema converters to translate input, output, and error schemas into JSON Schemas.
|
|
105
|
+
*
|
|
106
|
+
* @see {@link https://orpc.dev/docs/openapi/specification#openapi-generator | OpenAPI Specification - OpenAPI Generator}
|
|
107
|
+
*/
|
|
102
108
|
declare class OpenAPIGenerator {
|
|
103
109
|
private readonly serializer;
|
|
104
110
|
private readonly converter;
|
|
@@ -122,6 +128,8 @@ interface PopulateRouterContractOpenAPIPathsOptions {
|
|
|
122
128
|
*
|
|
123
129
|
* Builds paths by joining router keys with `/`.
|
|
124
130
|
* Useful when you want to ensure all contracts define openapi.path, such as for NestJS integration requirements.
|
|
131
|
+
*
|
|
132
|
+
* @see {@link https://orpc.dev/docs/integrations/nest | Implement oRPC contract with NestJS}
|
|
125
133
|
*/
|
|
126
134
|
declare function populateRouterContractOpenAPIPaths<T extends RouterContract>(router: T, options?: PopulateRouterContractOpenAPIPathsOptions): PopulatedContractRouterOpenAPIPaths<T>;
|
|
127
135
|
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { Value, Promisable } from '@orpc/shared';
|
|
|
4
4
|
import { ApiReferenceConfiguration } from '@scalar/api-reference';
|
|
5
5
|
import { StandardUrl } from '@standardserver/core';
|
|
6
6
|
import { SwaggerUIOptions } from 'swagger-ui';
|
|
7
|
-
import { O as OpenAPIDocument } from '../shared/openapi.
|
|
7
|
+
import { O as OpenAPIDocument } from '../shared/openapi.zfTTuQ4S.mjs';
|
|
8
8
|
import '@hey-api/spec-types';
|
|
9
9
|
import '@orpc/client';
|
|
10
10
|
|
|
@@ -71,6 +71,15 @@ interface OpenAPIReferenceHandlerPluginOptions<T extends Context, TProvider exte
|
|
|
71
71
|
*/
|
|
72
72
|
docsHead?: Value<Promisable<string>, [StandardHandlerRoutingInterceptorOptions<T>]>;
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Serves API reference documentation powered by Scalar or Swagger UI,
|
|
76
|
+
* and exposes the OpenAPI specification as JSON.
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* **Note**: By default, the API reference UI is served from `/` and the OpenAPI specification from `/spec.json`.
|
|
80
|
+
*
|
|
81
|
+
* @see {@link https://orpc.dev/docs/plugins/openapi-reference | OpenAPI Reference Plugin (Swagger/Scalar)}
|
|
82
|
+
*/
|
|
74
83
|
declare class OpenAPIReferenceHandlerPlugin<T extends Context, TProvider extends OpenAPIReferenceHandlerPluginProvider> implements StandardHandlerPlugin<T> {
|
|
75
84
|
name: string;
|
|
76
85
|
private readonly spec;
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Value, Promisable } from '@orpc/shared';
|
|
|
4
4
|
import { ApiReferenceConfiguration } from '@scalar/api-reference';
|
|
5
5
|
import { StandardUrl } from '@standardserver/core';
|
|
6
6
|
import { SwaggerUIOptions } from 'swagger-ui';
|
|
7
|
-
import { O as OpenAPIDocument } from '../shared/openapi.
|
|
7
|
+
import { O as OpenAPIDocument } from '../shared/openapi.zfTTuQ4S.js';
|
|
8
8
|
import '@hey-api/spec-types';
|
|
9
9
|
import '@orpc/client';
|
|
10
10
|
|
|
@@ -71,6 +71,15 @@ interface OpenAPIReferenceHandlerPluginOptions<T extends Context, TProvider exte
|
|
|
71
71
|
*/
|
|
72
72
|
docsHead?: Value<Promisable<string>, [StandardHandlerRoutingInterceptorOptions<T>]>;
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Serves API reference documentation powered by Scalar or Swagger UI,
|
|
76
|
+
* and exposes the OpenAPI specification as JSON.
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* **Note**: By default, the API reference UI is served from `/` and the OpenAPI specification from `/spec.json`.
|
|
80
|
+
*
|
|
81
|
+
* @see {@link https://orpc.dev/docs/plugins/openapi-reference | OpenAPI Reference Plugin (Swagger/Scalar)}
|
|
82
|
+
*/
|
|
74
83
|
declare class OpenAPIReferenceHandlerPlugin<T extends Context, TProvider extends OpenAPIReferenceHandlerPluginProvider> implements StandardHandlerPlugin<T> {
|
|
75
84
|
name: string;
|
|
76
85
|
private readonly spec;
|
|
@@ -4,7 +4,7 @@ import { StandardHandlerCodec, StandardHandlerHandleOptions, StandardHandlerCode
|
|
|
4
4
|
import { Value, Promisable } from '@orpc/shared';
|
|
5
5
|
import { StandardLazyRequest, StandardResponse } from '@standardserver/core';
|
|
6
6
|
import { AnyProcedureContract } from '@orpc/contract';
|
|
7
|
-
import { O as OpenAPISerializer } from './openapi.
|
|
7
|
+
import { O as OpenAPISerializer } from './openapi.Dz-JaXHo.mjs';
|
|
8
8
|
|
|
9
9
|
interface OpenAPIMatcherOptions {
|
|
10
10
|
/**
|
|
@@ -3,7 +3,7 @@ import { StandardLinkCodec, StandardLinkCodecDecodedResponse } from '@orpc/clien
|
|
|
3
3
|
import { RouterContract } from '@orpc/contract';
|
|
4
4
|
import { Value, Promisable } from '@orpc/shared';
|
|
5
5
|
import { StandardUrl, StandardHeaders, StandardLazyResponse, StandardRequest } from '@standardserver/core';
|
|
6
|
-
import { O as OpenAPISerializer } from './openapi.
|
|
6
|
+
import { O as OpenAPISerializer } from './openapi.Dz-JaXHo.mjs';
|
|
7
7
|
|
|
8
8
|
declare class OpenAPILinkCodecError extends TypeError {
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ import { StandardLinkCodec, StandardLinkCodecDecodedResponse } from '@orpc/clien
|
|
|
3
3
|
import { RouterContract } from '@orpc/contract';
|
|
4
4
|
import { Value, Promisable } from '@orpc/shared';
|
|
5
5
|
import { StandardUrl, StandardHeaders, StandardLazyResponse, StandardRequest } from '@standardserver/core';
|
|
6
|
-
import { O as OpenAPISerializer } from './openapi.
|
|
6
|
+
import { O as OpenAPISerializer } from './openapi.Dz-JaXHo.js';
|
|
7
7
|
|
|
8
8
|
declare class OpenAPILinkCodecError extends TypeError {
|
|
9
9
|
}
|
|
@@ -2,7 +2,7 @@ import { AnySchema, ErrorMap, MetaPlugin, AnyProcedureContract } from '@orpc/con
|
|
|
2
2
|
import { Lazy } from '@orpc/server';
|
|
3
3
|
import { Value } from '@orpc/shared';
|
|
4
4
|
import { StandardBodyHint } from '@standardserver/core';
|
|
5
|
-
import { d as OpenAPIOperationObject } from './openapi.
|
|
5
|
+
import { d as OpenAPIOperationObject } from './openapi.zfTTuQ4S.js';
|
|
6
6
|
|
|
7
7
|
interface OpenAPIMeta {
|
|
8
8
|
/**
|
|
@@ -306,6 +306,13 @@ interface OpenAPIFunction {
|
|
|
306
306
|
spec(method: OpenAPIMeta['spec']): OpenAPISpecMetaPlugin<any, any, any>;
|
|
307
307
|
prefix(method: OpenAPIMeta['prefix']): OpenAPIPrefixMetaPlugin<any, any, any>;
|
|
308
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* Creates OpenAPI meta plugins that control how a procedure is exposed over HTTP,
|
|
311
|
+
* such as its method, path, prefix, and OpenAPI operation spec.
|
|
312
|
+
*
|
|
313
|
+
* @see {@link https://orpc.dev/docs/openapi/routing | OpenAPI Routing}
|
|
314
|
+
* @see {@link https://orpc.dev/docs/openapi/specification | OpenAPI Specification}
|
|
315
|
+
*/
|
|
309
316
|
declare const openapi: OpenAPIFunction;
|
|
310
317
|
declare function getOpenAPIMeta(procedureOrLazy: AnyProcedureContract | Lazy<any>): OpenAPIMeta | undefined;
|
|
311
318
|
|
|
@@ -133,6 +133,12 @@ interface OpenAPISerializerOptions extends OpenAPIJsonSerializerOptions {
|
|
|
133
133
|
*/
|
|
134
134
|
serialize?: OpenAPISerializerSerializeOptions | undefined;
|
|
135
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Handles one-way serialization of oRPC payloads into JSON-friendly formats,
|
|
138
|
+
* partially supporting complex data types beyond plain JSON such as `Date`, `BigInt`, and `Set`.
|
|
139
|
+
*
|
|
140
|
+
* @see {@link https://orpc.dev/docs/openapi/serializer | OpenAPI Serializer}
|
|
141
|
+
*/
|
|
136
142
|
declare class OpenAPISerializer {
|
|
137
143
|
private readonly jsonSerializer;
|
|
138
144
|
private readonly bracketNotation;
|
|
@@ -133,6 +133,12 @@ interface OpenAPISerializerOptions extends OpenAPIJsonSerializerOptions {
|
|
|
133
133
|
*/
|
|
134
134
|
serialize?: OpenAPISerializerSerializeOptions | undefined;
|
|
135
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Handles one-way serialization of oRPC payloads into JSON-friendly formats,
|
|
138
|
+
* partially supporting complex data types beyond plain JSON such as `Date`, `BigInt`, and `Set`.
|
|
139
|
+
*
|
|
140
|
+
* @see {@link https://orpc.dev/docs/openapi/serializer | OpenAPI Serializer}
|
|
141
|
+
*/
|
|
136
142
|
declare class OpenAPISerializer {
|
|
137
143
|
private readonly jsonSerializer;
|
|
138
144
|
private readonly bracketNotation;
|
|
@@ -2,7 +2,7 @@ import { AnySchema, ErrorMap, MetaPlugin, AnyProcedureContract } from '@orpc/con
|
|
|
2
2
|
import { Lazy } from '@orpc/server';
|
|
3
3
|
import { Value } from '@orpc/shared';
|
|
4
4
|
import { StandardBodyHint } from '@standardserver/core';
|
|
5
|
-
import { d as OpenAPIOperationObject } from './openapi.
|
|
5
|
+
import { d as OpenAPIOperationObject } from './openapi.zfTTuQ4S.mjs';
|
|
6
6
|
|
|
7
7
|
interface OpenAPIMeta {
|
|
8
8
|
/**
|
|
@@ -306,6 +306,13 @@ interface OpenAPIFunction {
|
|
|
306
306
|
spec(method: OpenAPIMeta['spec']): OpenAPISpecMetaPlugin<any, any, any>;
|
|
307
307
|
prefix(method: OpenAPIMeta['prefix']): OpenAPIPrefixMetaPlugin<any, any, any>;
|
|
308
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* Creates OpenAPI meta plugins that control how a procedure is exposed over HTTP,
|
|
311
|
+
* such as its method, path, prefix, and OpenAPI operation spec.
|
|
312
|
+
*
|
|
313
|
+
* @see {@link https://orpc.dev/docs/openapi/routing | OpenAPI Routing}
|
|
314
|
+
* @see {@link https://orpc.dev/docs/openapi/specification | OpenAPI Specification}
|
|
315
|
+
*/
|
|
309
316
|
declare const openapi: OpenAPIFunction;
|
|
310
317
|
declare function getOpenAPIMeta(procedureOrLazy: AnyProcedureContract | Lazy<any>): OpenAPIMeta | undefined;
|
|
311
318
|
|
|
@@ -4,7 +4,7 @@ import { StandardHandlerCodec, StandardHandlerHandleOptions, StandardHandlerCode
|
|
|
4
4
|
import { Value, Promisable } from '@orpc/shared';
|
|
5
5
|
import { StandardLazyRequest, StandardResponse } from '@standardserver/core';
|
|
6
6
|
import { AnyProcedureContract } from '@orpc/contract';
|
|
7
|
-
import { O as OpenAPISerializer } from './openapi.
|
|
7
|
+
import { O as OpenAPISerializer } from './openapi.Dz-JaXHo.js';
|
|
8
8
|
|
|
9
9
|
interface OpenAPIMatcherOptions {
|
|
10
10
|
/**
|
|
@@ -9,7 +9,9 @@ type JsonifiedValue<T> = T extends string ? T : T extends number ? T : T extends
|
|
|
9
9
|
type JsonifiedArray<T extends Array<unknown>> = T extends readonly [] ? [] : T extends readonly [infer U, ...infer V] ? [U extends undefined ? null : JsonifiedValue<U>, ...JsonifiedArray<V>] : T extends Array<infer U> ? Array<JsonifiedValue<U>> : unknown;
|
|
10
10
|
type JsonifiedClientError<T> = T extends ORPCError<infer UCode, infer UData> ? ORPCError<UCode, JsonifiedValue<UData>> : T;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Client type whose outputs and error data replace types JSON cannot represent with their JSON equivalents.
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://orpc.dev/docs/openapi/link | OpenAPI Link}
|
|
13
15
|
*/
|
|
14
16
|
type JsonifiedClient<T extends AnyNestedClient> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? Client<UClientContext, UInput, JsonifiedValue<UOutput>, JsonifiedClientError<UError>> : {
|
|
15
17
|
[K in keyof T]: T[K] extends AnyNestedClient ? JsonifiedClient<T[K]> : T[K];
|
|
@@ -9,7 +9,9 @@ type JsonifiedValue<T> = T extends string ? T : T extends number ? T : T extends
|
|
|
9
9
|
type JsonifiedArray<T extends Array<unknown>> = T extends readonly [] ? [] : T extends readonly [infer U, ...infer V] ? [U extends undefined ? null : JsonifiedValue<U>, ...JsonifiedArray<V>] : T extends Array<infer U> ? Array<JsonifiedValue<U>> : unknown;
|
|
10
10
|
type JsonifiedClientError<T> = T extends ORPCError<infer UCode, infer UData> ? ORPCError<UCode, JsonifiedValue<UData>> : T;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Client type whose outputs and error data replace types JSON cannot represent with their JSON equivalents.
|
|
13
|
+
*
|
|
14
|
+
* @see {@link https://orpc.dev/docs/openapi/link | OpenAPI Link}
|
|
13
15
|
*/
|
|
14
16
|
type JsonifiedClient<T extends AnyNestedClient> = T extends Client<infer UClientContext, infer UInput, infer UOutput, infer UError> ? Client<UClientContext, UInput, JsonifiedValue<UOutput>, JsonifiedClientError<UError>> : {
|
|
15
17
|
[K in keyof T]: T[K] extends AnyNestedClient ? JsonifiedClient<T[K]> : T[K];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/openapi",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.24",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.dev",
|
|
7
7
|
"repository": {
|
|
@@ -48,6 +48,16 @@
|
|
|
48
48
|
"import": "./dist/adapters/node/index.mjs",
|
|
49
49
|
"default": "./dist/adapters/node/index.mjs"
|
|
50
50
|
},
|
|
51
|
+
"./aws-lambda": {
|
|
52
|
+
"types": "./dist/adapters/aws-lambda/index.d.mts",
|
|
53
|
+
"import": "./dist/adapters/aws-lambda/index.mjs",
|
|
54
|
+
"default": "./dist/adapters/aws-lambda/index.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./fastify": {
|
|
57
|
+
"types": "./dist/adapters/fastify/index.d.mts",
|
|
58
|
+
"import": "./dist/adapters/fastify/index.mjs",
|
|
59
|
+
"default": "./dist/adapters/fastify/index.mjs"
|
|
60
|
+
},
|
|
51
61
|
"./extensions/route": {
|
|
52
62
|
"types": "./dist/extensions/route.d.mts",
|
|
53
63
|
"import": "./dist/extensions/route.mjs",
|
|
@@ -75,19 +85,20 @@
|
|
|
75
85
|
},
|
|
76
86
|
"dependencies": {
|
|
77
87
|
"@hey-api/spec-types": "0.0.0-next-20260408030107",
|
|
78
|
-
"@standardserver/core": "^0.
|
|
79
|
-
"@standardserver/fetch": "^0.
|
|
88
|
+
"@standardserver/core": "^0.7.1",
|
|
89
|
+
"@standardserver/fetch": "^0.7.1",
|
|
80
90
|
"rou3": "^0.9.1",
|
|
81
|
-
"@orpc/client": "2.0.0-beta.
|
|
82
|
-
"@orpc/contract": "2.0.0-beta.
|
|
83
|
-
"@orpc/json-schema": "2.0.0-beta.
|
|
84
|
-
"@orpc/server": "2.0.0-beta.
|
|
85
|
-
"@orpc/shared": "2.0.0-beta.
|
|
91
|
+
"@orpc/client": "2.0.0-beta.24",
|
|
92
|
+
"@orpc/contract": "2.0.0-beta.24",
|
|
93
|
+
"@orpc/json-schema": "2.0.0-beta.24",
|
|
94
|
+
"@orpc/server": "2.0.0-beta.24",
|
|
95
|
+
"@orpc/shared": "2.0.0-beta.24"
|
|
86
96
|
},
|
|
87
97
|
"devDependencies": {
|
|
88
98
|
"@scalar/api-reference": "^1.63.0",
|
|
99
|
+
"@standardserver/aws-lambda": "^0.7.1",
|
|
89
100
|
"@types/swagger-ui": "^5.32.0",
|
|
90
|
-
"fastify": "^5.
|
|
101
|
+
"fastify": "^5.11.0",
|
|
91
102
|
"swagger-ui": "^5.32.11",
|
|
92
103
|
"zod": "^4.4.3"
|
|
93
104
|
},
|