@orpc/openapi 1.14.11 → 1.14.12
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 +71 -52
- package/dist/adapters/aws-lambda/index.d.mts +20 -0
- package/dist/adapters/aws-lambda/index.d.ts +20 -0
- package/dist/adapters/aws-lambda/index.mjs +18 -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 +18 -0
- package/dist/adapters/fetch/index.d.mts +16 -20
- package/dist/adapters/fetch/index.d.ts +16 -20
- package/dist/adapters/fetch/index.mjs +8 -24
- package/dist/adapters/node/index.d.mts +13 -8
- package/dist/adapters/node/index.d.ts +13 -8
- package/dist/adapters/node/index.mjs +7 -10
- package/dist/adapters/standard/index.d.mts +16 -46
- package/dist/adapters/standard/index.d.ts +16 -46
- package/dist/adapters/standard/index.mjs +6 -9
- package/dist/index.d.mts +105 -117
- package/dist/index.d.ts +105 -117
- package/dist/index.mjs +32 -850
- package/dist/plugins/index.d.mts +51 -55
- package/dist/plugins/index.d.ts +51 -55
- package/dist/plugins/index.mjs +142 -147
- package/dist/shared/openapi.BGy4N6eR.d.mts +120 -0
- package/dist/shared/openapi.BGy4N6eR.d.ts +120 -0
- package/dist/shared/openapi.BwdtJjDu.mjs +878 -0
- package/dist/shared/openapi.CdeSk3f7.d.mts +54 -0
- package/dist/shared/openapi.CdeSk3f7.d.ts +54 -0
- package/dist/shared/openapi.DPiCV5hl.mjs +208 -0
- package/package.json +24 -46
- package/dist/extensions/route.d.mts +0 -43
- package/dist/extensions/route.d.ts +0 -43
- package/dist/extensions/route.mjs +0 -14
- package/dist/helpers/index.d.mts +0 -51
- package/dist/helpers/index.d.ts +0 -51
- package/dist/helpers/index.mjs +0 -39
- package/dist/shared/openapi.B6hEbRyF.d.ts +0 -83
- package/dist/shared/openapi.B9PQzqBn.mjs +0 -49
- package/dist/shared/openapi.BOOA-bde.d.mts +0 -142
- package/dist/shared/openapi.BOOA-bde.d.ts +0 -142
- package/dist/shared/openapi.BafbB3uM.d.mts +0 -83
- package/dist/shared/openapi.Bt87OzTt.mjs +0 -131
- package/dist/shared/openapi.ByT4oUeY.d.mts +0 -18
- package/dist/shared/openapi.ByT4oUeY.d.ts +0 -18
- package/dist/shared/openapi.C-p_Q2lb.mjs +0 -359
- package/dist/shared/openapi.CVgUshDP.mjs +0 -318
- package/dist/shared/openapi.DNNo0V-l.d.ts +0 -313
- package/dist/shared/openapi.hg_rhZ4x.d.mts +0 -313
- package/dist/shared/openapi.zZH_UksW.mjs +0 -278
package/README.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
<
|
|
1
|
+
<div align="center">
|
|
2
|
+
<image align="center" src="https://orpc.dev/logo.webp" width=280 alt="oRPC logo" />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<h1></h1>
|
|
2
6
|
|
|
3
7
|
<div align="center">
|
|
4
8
|
<a href="https://codecov.io/gh/middleapi/orpc">
|
|
5
|
-
<img alt="codecov" src="https://codecov.io/gh/middleapi/orpc/branch/
|
|
9
|
+
<img alt="codecov" src="https://codecov.io/gh/middleapi/orpc/branch/1.x/graph/badge.svg">
|
|
6
10
|
</a>
|
|
7
11
|
<a href="https://www.npmjs.com/package/@orpc/openapi">
|
|
8
12
|
<img alt="weekly downloads" src="https://img.shields.io/npm/dw/%40orpc%2Fopenapi?logo=npm" />
|
|
9
13
|
</a>
|
|
10
|
-
<a href="https://
|
|
11
|
-
<img alt="CodSpeed" src="https://img.shields.io/endpoint?url=https://codspeed.io/badge.json" />
|
|
12
|
-
</a>
|
|
13
|
-
<a href="https://github.com/middleapi/orpc/blob/main/LICENSE">
|
|
14
|
+
<a href="https://github.com/middleapi/orpc/blob/1.x/LICENSE">
|
|
14
15
|
<img alt="MIT License" src="https://img.shields.io/github/license/middleapi/orpc?logo=open-source-initiative" />
|
|
15
16
|
</a>
|
|
16
17
|
<a href="https://discord.gg/TXEbwRBvQn">
|
|
@@ -21,53 +22,78 @@
|
|
|
21
22
|
</a>
|
|
22
23
|
</div>
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
You can read the documentation [here](https://orpc.dev).
|
|
27
|
-
|
|
28
|
-
## Packages
|
|
29
|
-
|
|
30
|
-
**Core**
|
|
25
|
+
<h3 align="center">Typesafe APIs Made Simple 🪄</h3>
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
- [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build APIs or implement contracts.
|
|
34
|
-
- [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume APIs with end-to-end type safety.
|
|
35
|
-
- [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Add OpenAPI compatibility to APIs.
|
|
27
|
+
**oRPC is a powerful combination of RPC and OpenAPI**, makes it easy to build APIs that are end-to-end type-safe and adhere to OpenAPI standards
|
|
36
28
|
|
|
37
|
-
|
|
29
|
+
---
|
|
38
30
|
|
|
39
|
-
|
|
40
|
-
- [@orpc/valibot](https://www.npmjs.com/package/@orpc/valibot): Integrate with [Valibot](https://valibot.dev/).
|
|
41
|
-
- [@orpc/arktype](https://www.npmjs.com/package/@orpc/arktype): Integrate with [ArkType](https://arktype.io/).
|
|
31
|
+
## Highlights
|
|
42
32
|
|
|
43
|
-
|
|
33
|
+
- **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server.
|
|
34
|
+
- **📘 First-Class OpenAPI**: Built-in support that fully adheres to the OpenAPI standard.
|
|
35
|
+
- **📝 Contract-First Development**: Optionally define your API contract before implementation.
|
|
36
|
+
- **🔍 First-Class OpenTelemetry**: Seamlessly integrate with OpenTelemetry for observability.
|
|
37
|
+
- **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), SWR, Pinia Colada, and more.
|
|
38
|
+
- **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
|
|
39
|
+
- **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
|
|
40
|
+
- **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
|
|
41
|
+
- **⏱️ Lazy Router**: Enhance cold start times with our lazy routing feature.
|
|
42
|
+
- **📡 SSE & Streaming**: Enjoy full type-safe support for SSE and streaming.
|
|
43
|
+
- **🌍 Multi-Runtime Support**: Fast and lightweight on Cloudflare, Deno, Bun, Node.js, and beyond.
|
|
44
|
+
- **🔌 Extendability**: Easily extend functionality with plugins, middleware, and interceptors.
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
- [@orpc/ratelimit](https://www.npmjs.com/package/@orpc/ratelimit): Rate limiting with memory, Redis, and Upstash adapters.
|
|
47
|
-
- [@orpc/json-schema](https://www.npmjs.com/package/@orpc/json-schema): Smart coercion for OpenAPI requests.
|
|
48
|
-
|
|
49
|
-
**Framework & ecosystem integrations**
|
|
46
|
+
## Documentation
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
- [@orpc/ai-sdk](https://www.npmjs.com/package/@orpc/ai-sdk): Turn contracts and procedures into [AI SDK](https://ai-sdk.dev/) tools.
|
|
53
|
-
- [@orpc/tanstack-query](https://www.npmjs.com/package/@orpc/tanstack-query): Integrate with [TanStack Query](https://tanstack.com/query/latest).
|
|
54
|
-
- [@orpc/pinia-colada](https://www.npmjs.com/package/@orpc/pinia-colada): Integrate with [Pinia Colada](https://pinia-colada.esm.dev/).
|
|
55
|
-
- [@orpc/swr](https://www.npmjs.com/package/@orpc/swr): Integrate with [SWR](https://swr.vercel.app/).
|
|
56
|
-
- [@orpc/experimental-effect](https://www.npmjs.com/package/@orpc/experimental-effect): Integrate with [Effect](https://effect.website/).
|
|
57
|
-
- [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Implement your contract with [NestJS](https://nestjs.com/).
|
|
58
|
-
- [@orpc/bun](https://www.npmjs.com/package/@orpc/bun): Adapters for [Bun's Redis](https://bun.sh/).
|
|
59
|
-
- [@orpc/cloudflare](https://www.npmjs.com/package/@orpc/cloudflare): Adapters for [Cloudflare's RateLimit and Durable Objects](https://developers.cloudflare.com/workers/).
|
|
60
|
-
- [@orpc/trpc](https://www.npmjs.com/package/@orpc/trpc): Reuse existing [tRPC](https://trpc.io/) routers within oRPC.
|
|
48
|
+
You can find the full documentation [here](https://orpc.dev).
|
|
61
49
|
|
|
62
|
-
|
|
50
|
+
## Packages
|
|
63
51
|
|
|
64
|
-
- [@orpc/
|
|
65
|
-
- [@orpc/
|
|
66
|
-
- [@orpc/
|
|
52
|
+
- [@orpc/contract](https://www.npmjs.com/package/@orpc/contract): Build your API contract.
|
|
53
|
+
- [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
|
|
54
|
+
- [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
|
|
55
|
+
- [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
|
|
56
|
+
- [@orpc/otel](https://www.npmjs.com/package/@orpc/otel): [OpenTelemetry](https://opentelemetry.io/) integration for observability.
|
|
57
|
+
- [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with [NestJS](https://nestjs.com/).
|
|
58
|
+
- [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
|
|
59
|
+
- [@orpc/tanstack-query](https://www.npmjs.com/package/@orpc/tanstack-query): [TanStack Query](https://tanstack.com/query/latest) integration.
|
|
60
|
+
- [@orpc/experimental-react-swr](https://www.npmjs.com/package/@orpc/experimental-react-swr): [SWR](https://swr.vercel.app/) integration.
|
|
61
|
+
- [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
|
|
62
|
+
- [@orpc/hey-api](https://www.npmjs.com/package/@orpc/hey-api): [Hey API](https://heyapi.dev/) integration.
|
|
63
|
+
- [@orpc/zod](https://www.npmjs.com/package/@orpc/zod): More schemas that [Zod](https://zod.dev/) doesn't support yet.
|
|
64
|
+
- [@orpc/valibot](https://www.npmjs.com/package/@orpc/valibot): OpenAPI spec generation from [Valibot](https://valibot.dev/).
|
|
65
|
+
- [@orpc/arktype](https://www.npmjs.com/package/@orpc/arktype): OpenAPI spec generation from [ArkType](https://arktype.io/).
|
|
66
|
+
|
|
67
|
+
## `@orpc/openapi`
|
|
68
|
+
|
|
69
|
+
Generate OpenAPI specs and handle OpenAPI requests. Read the [documentation](https://orpc.dev/docs/openapi/getting-started) for more information.
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
import { createServer } from 'node:http'
|
|
73
|
+
import { OpenAPIHandler } from '@orpc/openapi/node'
|
|
74
|
+
import { CORSPlugin } from '@orpc/server/plugins'
|
|
75
|
+
|
|
76
|
+
const handler = new OpenAPIHandler(router, {
|
|
77
|
+
plugins: [new CORSPlugin()]
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
const server = createServer(async (req, res) => {
|
|
81
|
+
const result = await handler.handle(req, res, {
|
|
82
|
+
context: { headers: req.headers }
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
if (!result.matched) {
|
|
86
|
+
res.statusCode = 404
|
|
87
|
+
res.end('No procedure matched')
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
server.listen(3000, '127.0.0.1', () => console.log('Listening on 127.0.0.1:3000'))
|
|
92
|
+
```
|
|
67
93
|
|
|
68
94
|
## Sponsors
|
|
69
95
|
|
|
70
|
-
|
|
96
|
+
If you find oRPC valuable and would like to support its development, you can do so here: [GitHub Sponsors](https://github.com/sponsors/dinwwwh).
|
|
71
97
|
|
|
72
98
|
### 🏆 Platinum Sponsor
|
|
73
99
|
|
|
@@ -109,10 +135,11 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
109
135
|
<td align="center"><a href="https://github.com/valerii15298?ref=orpc" target="_blank" rel="noopener" title="Valerii Petryniak"><img src="https://avatars.githubusercontent.com/u/44531564?u=88ac74d9bacd20401518441907acad21063cd397&v=4" width="139" alt="Valerii Petryniak"/><br />Valerii Petryniak</a></td>
|
|
110
136
|
<td align="center"><a href="https://github.com/letstri?ref=orpc" target="_blank" rel="noopener" title="Valerii Strilets"><img src="https://avatars.githubusercontent.com/u/13253748?u=c7b10399ccc8f8081e24db94ec32cd9858e86ac3&v=4" width="139" alt="Valerii Strilets"/><br />Valerii Strilets</a></td>
|
|
111
137
|
<td align="center"><a href="https://github.com/K-Mistele?ref=orpc" target="_blank" rel="noopener" title="Kyle Mistele"><img src="https://avatars.githubusercontent.com/u/18430555?u=3afebeb81de666e35aaac3ed46f14159d7603ffb&v=4" width="139" alt="Kyle Mistele"/><br />Kyle Mistele</a></td>
|
|
138
|
+
<td align="center"><a href="https://github.com/R44VC0RP?ref=orpc" target="_blank" rel="noopener" title="Ryan Vogel"><img src="https://avatars.githubusercontent.com/u/89211796?u=1857347b9787d8d8a7ea5bfc333f96be92d5a683&v=4" width="139" alt="Ryan Vogel"/><br />Ryan Vogel</a></td>
|
|
112
139
|
<td align="center"><a href="https://github.com/christ12938?ref=orpc" target="_blank" rel="noopener" title="christ12938"><img src="https://avatars.githubusercontent.com/u/25758598?v=4" width="139" alt="christ12938"/><br />christ12938</a></td>
|
|
113
|
-
<td align="center"><a href="https://github.com/Ryanjso?ref=orpc" target="_blank" rel="noopener" title="Ryan Soderberg"><img src="https://avatars.githubusercontent.com/u/39172778?u=5ed913c31d57e7221b75784abcad48c7ebddde27&v=4" width="139" alt="Ryan Soderberg"/><br />Ryan Soderberg</a></td>
|
|
114
140
|
</tr>
|
|
115
141
|
<tr>
|
|
142
|
+
<td align="center"><a href="https://github.com/Ryanjso?ref=orpc" target="_blank" rel="noopener" title="Ryan Soderberg"><img src="https://avatars.githubusercontent.com/u/39172778?u=5ed913c31d57e7221b75784abcad48c7ebddde27&v=4" width="139" alt="Ryan Soderberg"/><br />Ryan Soderberg</a></td>
|
|
116
143
|
<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>
|
|
117
144
|
</tr>
|
|
118
145
|
</table>
|
|
@@ -172,7 +199,6 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
172
199
|
<a href="https://github.com/nguyenlc1993?ref=orpc" target="_blank" rel="noopener" title="Lê Cao Nguyên"><img src="https://avatars.githubusercontent.com/u/13871971?u=83c8b69d9e35b589c4e1f066cc113b1d9461386f&v=4" width="32" height="32" alt="Lê Cao Nguyên" /></a>
|
|
173
200
|
<a href="https://github.com/wobsoriano?ref=orpc" target="_blank" rel="noopener" title="Robert Soriano"><img src="https://avatars.githubusercontent.com/u/13049130?u=6d72104182e7c9ed25934815313fb69107332111&v=4" width="32" height="32" alt="Robert Soriano" /></a>
|
|
174
201
|
<a href="https://github.com/andrewpeters9?ref=orpc" target="_blank" rel="noopener" title="Andrew Peters"><img src="https://avatars.githubusercontent.com/u/36251325?v=4" width="32" height="32" alt="Andrew Peters" /></a>
|
|
175
|
-
<a href="https://github.com/R44VC0RP?ref=orpc" target="_blank" rel="noopener" title="Ryan Vogel"><img src="https://avatars.githubusercontent.com/u/89211796?u=1857347b9787d8d8a7ea5bfc333f96be92d5a683&v=4" width="32" height="32" alt="Ryan Vogel" /></a>
|
|
176
202
|
<a href="https://github.com/SKostyukovich?ref=orpc" target="_blank" rel="noopener" title="SKostyukovich"><img src="https://avatars.githubusercontent.com/u/10700067?v=4" width="32" height="32" alt="SKostyukovich" /></a>
|
|
177
203
|
<a href="https://github.com/peter-adam-dy?ref=orpc" target="_blank" rel="noopener" title="Peter Adam"><img src="https://avatars.githubusercontent.com/u/132129459?u=4f3dbbb3b443990b56acb7d6a5d11ed2c555f6db&v=4" width="32" height="32" alt="Peter Adam" /></a>
|
|
178
204
|
<a href="https://github.com/FabworksHQ?ref=orpc" target="_blank" rel="noopener" title="Fabworks"><img src="https://avatars.githubusercontent.com/u/160179500?v=4" width="32" height="32" alt="Fabworks" /></a>
|
|
@@ -187,13 +213,6 @@ Like what we build over at [middleapi](https://github.com/middleapi)? You can he
|
|
|
187
213
|
<a href="https://github.com/plancraft?ref=orpc" target="_blank" rel="noopener" title="plancraft"><img src="https://avatars.githubusercontent.com/u/46482287?v=4" width="32" height="32" alt="plancraft" /></a>
|
|
188
214
|
</p>
|
|
189
215
|
|
|
190
|
-
## References
|
|
191
|
-
|
|
192
|
-
oRPC is inspired by existing solutions that prioritize type safety and developer experience. Special acknowledgments to:
|
|
193
|
-
|
|
194
|
-
- [tRPC](https://trpc.io): For pioneering the concept of end-to-end type-safe RPC and influencing the development of type-safe APIs.
|
|
195
|
-
- [ts-rest](https://ts-rest.com): For its emphasis on contract-first development and OpenAPI integration, which have greatly inspired oRPC's feature set.
|
|
196
|
-
|
|
197
216
|
## License
|
|
198
217
|
|
|
199
|
-
Distributed under the MIT License. See [LICENSE](https://github.com/middleapi/orpc/blob/
|
|
218
|
+
Distributed under the MIT License. See [LICENSE](https://github.com/middleapi/orpc/blob/1.x/LICENSE) for more information.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Context, Router } from '@orpc/server';
|
|
2
|
+
import { AwsLambdaHandler, AwsLambdaHandlerOptions } from '@orpc/server/aws-lambda';
|
|
3
|
+
import { b as StandardOpenAPIHandlerOptions } from '../../shared/openapi.CdeSk3f7.mjs';
|
|
4
|
+
import '@orpc/openapi-client/standard';
|
|
5
|
+
import '@orpc/server/standard';
|
|
6
|
+
import '@orpc/client';
|
|
7
|
+
import '@orpc/standard-server';
|
|
8
|
+
import '@orpc/shared';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* OpenAPI Handler for AWS Lambda.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
14
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
15
|
+
*/
|
|
16
|
+
declare class OpenAPIHandler<T extends Context> extends AwsLambdaHandler<T> {
|
|
17
|
+
constructor(router: Router<any, T>, options?: NoInfer<StandardOpenAPIHandlerOptions<T> & AwsLambdaHandlerOptions>);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { OpenAPIHandler };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Context, Router } from '@orpc/server';
|
|
2
|
+
import { AwsLambdaHandler, AwsLambdaHandlerOptions } from '@orpc/server/aws-lambda';
|
|
3
|
+
import { b as StandardOpenAPIHandlerOptions } from '../../shared/openapi.CdeSk3f7.js';
|
|
4
|
+
import '@orpc/openapi-client/standard';
|
|
5
|
+
import '@orpc/server/standard';
|
|
6
|
+
import '@orpc/client';
|
|
7
|
+
import '@orpc/standard-server';
|
|
8
|
+
import '@orpc/shared';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* OpenAPI Handler for AWS Lambda.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
14
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
15
|
+
*/
|
|
16
|
+
declare class OpenAPIHandler<T extends Context> extends AwsLambdaHandler<T> {
|
|
17
|
+
constructor(router: Router<any, T>, options?: NoInfer<StandardOpenAPIHandlerOptions<T> & AwsLambdaHandlerOptions>);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { OpenAPIHandler };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AwsLambdaHandler } from '@orpc/server/aws-lambda';
|
|
2
|
+
import { a as StandardOpenAPIHandler } from '../../shared/openapi.DPiCV5hl.mjs';
|
|
3
|
+
import '@orpc/openapi-client/standard';
|
|
4
|
+
import '@orpc/server/standard';
|
|
5
|
+
import '@orpc/client';
|
|
6
|
+
import '@orpc/contract';
|
|
7
|
+
import '@orpc/shared';
|
|
8
|
+
import '@orpc/client/standard';
|
|
9
|
+
import '@orpc/server';
|
|
10
|
+
import 'rou3';
|
|
11
|
+
|
|
12
|
+
class OpenAPIHandler extends AwsLambdaHandler {
|
|
13
|
+
constructor(router, options = {}) {
|
|
14
|
+
super(new StandardOpenAPIHandler(router, options), options);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { OpenAPIHandler };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Context, Router } from '@orpc/server';
|
|
2
|
+
import { FastifyHandlerOptions, FastifyHandler } from '@orpc/server/fastify';
|
|
3
|
+
import { b as StandardOpenAPIHandlerOptions } from '../../shared/openapi.CdeSk3f7.mjs';
|
|
4
|
+
import '@orpc/openapi-client/standard';
|
|
5
|
+
import '@orpc/server/standard';
|
|
6
|
+
import '@orpc/client';
|
|
7
|
+
import '@orpc/standard-server';
|
|
8
|
+
import '@orpc/shared';
|
|
9
|
+
|
|
10
|
+
interface OpenAPIHandlerOptions<T extends Context> extends FastifyHandlerOptions<T>, StandardOpenAPIHandlerOptions<T> {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* OpenAPI Handler for Fastify Server
|
|
14
|
+
*
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
|
+
*/
|
|
18
|
+
declare class OpenAPIHandler<T extends Context> extends FastifyHandler<T> {
|
|
19
|
+
constructor(router: Router<any, 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 { FastifyHandlerOptions, FastifyHandler } from '@orpc/server/fastify';
|
|
3
|
+
import { b as StandardOpenAPIHandlerOptions } from '../../shared/openapi.CdeSk3f7.js';
|
|
4
|
+
import '@orpc/openapi-client/standard';
|
|
5
|
+
import '@orpc/server/standard';
|
|
6
|
+
import '@orpc/client';
|
|
7
|
+
import '@orpc/standard-server';
|
|
8
|
+
import '@orpc/shared';
|
|
9
|
+
|
|
10
|
+
interface OpenAPIHandlerOptions<T extends Context> extends FastifyHandlerOptions<T>, StandardOpenAPIHandlerOptions<T> {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* OpenAPI Handler for Fastify Server
|
|
14
|
+
*
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
|
+
*/
|
|
18
|
+
declare class OpenAPIHandler<T extends Context> extends FastifyHandler<T> {
|
|
19
|
+
constructor(router: Router<any, T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { OpenAPIHandler };
|
|
23
|
+
export type { OpenAPIHandlerOptions };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FastifyHandler } from '@orpc/server/fastify';
|
|
2
|
+
import { a as StandardOpenAPIHandler } from '../../shared/openapi.DPiCV5hl.mjs';
|
|
3
|
+
import '@orpc/openapi-client/standard';
|
|
4
|
+
import '@orpc/server/standard';
|
|
5
|
+
import '@orpc/client';
|
|
6
|
+
import '@orpc/contract';
|
|
7
|
+
import '@orpc/shared';
|
|
8
|
+
import '@orpc/client/standard';
|
|
9
|
+
import '@orpc/server';
|
|
10
|
+
import 'rou3';
|
|
11
|
+
|
|
12
|
+
class OpenAPIHandler extends FastifyHandler {
|
|
13
|
+
constructor(router, options = {}) {
|
|
14
|
+
super(new StandardOpenAPIHandler(router, options), options);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { OpenAPIHandler };
|
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { RouterContract } from '@orpc/contract';
|
|
9
|
-
import { OpenAPILinkCodecOptions } from '../standard/index.mjs';
|
|
2
|
+
import { FetchHandlerOptions, FetchHandler } from '@orpc/server/fetch';
|
|
3
|
+
import { b as StandardOpenAPIHandlerOptions } from '../../shared/openapi.CdeSk3f7.mjs';
|
|
4
|
+
import '@orpc/openapi-client/standard';
|
|
5
|
+
import '@orpc/server/standard';
|
|
6
|
+
import '@orpc/client';
|
|
7
|
+
import '@orpc/standard-server';
|
|
10
8
|
import '@orpc/shared';
|
|
11
|
-
import '@standardserver/core';
|
|
12
|
-
import '../../shared/openapi.BOOA-bde.mjs';
|
|
13
9
|
|
|
14
|
-
interface OpenAPIHandlerOptions<T extends Context> extends FetchHandlerOptions<T>, Omit<
|
|
10
|
+
interface OpenAPIHandlerOptions<T extends Context> extends FetchHandlerOptions<T>, Omit<StandardOpenAPIHandlerOptions<T>, 'plugins'> {
|
|
15
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* OpenAPI Handler for Fetch Server
|
|
14
|
+
*
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
|
+
*/
|
|
16
18
|
declare class OpenAPIHandler<T extends Context> extends FetchHandler<T> {
|
|
17
|
-
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
19
|
+
constructor(router: Router<any, T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
declare class OpenAPILink<T extends ClientContext> extends StandardLink<T> {
|
|
23
|
-
constructor(router: RouterContract, options?: OpenAPILinkOptions<T>);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { OpenAPIHandler, OpenAPILink };
|
|
27
|
-
export type { OpenAPIHandlerOptions, OpenAPILinkOptions };
|
|
22
|
+
export { OpenAPIHandler };
|
|
23
|
+
export type { OpenAPIHandlerOptions };
|
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { RouterContract } from '@orpc/contract';
|
|
9
|
-
import { OpenAPILinkCodecOptions } from '../standard/index.js';
|
|
2
|
+
import { FetchHandlerOptions, FetchHandler } from '@orpc/server/fetch';
|
|
3
|
+
import { b as StandardOpenAPIHandlerOptions } from '../../shared/openapi.CdeSk3f7.js';
|
|
4
|
+
import '@orpc/openapi-client/standard';
|
|
5
|
+
import '@orpc/server/standard';
|
|
6
|
+
import '@orpc/client';
|
|
7
|
+
import '@orpc/standard-server';
|
|
10
8
|
import '@orpc/shared';
|
|
11
|
-
import '@standardserver/core';
|
|
12
|
-
import '../../shared/openapi.BOOA-bde.js';
|
|
13
9
|
|
|
14
|
-
interface OpenAPIHandlerOptions<T extends Context> extends FetchHandlerOptions<T>, Omit<
|
|
10
|
+
interface OpenAPIHandlerOptions<T extends Context> extends FetchHandlerOptions<T>, Omit<StandardOpenAPIHandlerOptions<T>, 'plugins'> {
|
|
15
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* OpenAPI Handler for Fetch Server
|
|
14
|
+
*
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
|
+
*/
|
|
16
18
|
declare class OpenAPIHandler<T extends Context> extends FetchHandler<T> {
|
|
17
|
-
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
19
|
+
constructor(router: Router<any, T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
declare class OpenAPILink<T extends ClientContext> extends StandardLink<T> {
|
|
23
|
-
constructor(router: RouterContract, options?: OpenAPILinkOptions<T>);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { OpenAPIHandler, OpenAPILink };
|
|
27
|
-
export type { OpenAPIHandlerOptions, OpenAPILinkOptions };
|
|
22
|
+
export { OpenAPIHandler };
|
|
23
|
+
export type { OpenAPIHandlerOptions };
|
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
import { FetchHandler } from '@orpc/server/fetch';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { StandardLink } from '@orpc/client/standard';
|
|
6
|
-
import { O as OpenAPILinkCodec } from '../../shared/openapi.C-p_Q2lb.mjs';
|
|
2
|
+
import { a as StandardOpenAPIHandler } from '../../shared/openapi.DPiCV5hl.mjs';
|
|
3
|
+
import '@orpc/openapi-client/standard';
|
|
4
|
+
import '@orpc/server/standard';
|
|
7
5
|
import '@orpc/client';
|
|
8
|
-
import '@orpc/
|
|
6
|
+
import '@orpc/contract';
|
|
9
7
|
import '@orpc/shared';
|
|
10
|
-
import '@
|
|
11
|
-
import '
|
|
12
|
-
import '../../shared/openapi.Bt87OzTt.mjs';
|
|
13
|
-
import '../../shared/openapi.B9PQzqBn.mjs';
|
|
8
|
+
import '@orpc/client/standard';
|
|
9
|
+
import '@orpc/server';
|
|
14
10
|
import 'rou3';
|
|
15
|
-
import '@orpc/contract';
|
|
16
|
-
import '@standardserver/fetch';
|
|
17
11
|
|
|
18
12
|
class OpenAPIHandler extends FetchHandler {
|
|
19
13
|
constructor(router, options = {}) {
|
|
20
|
-
|
|
21
|
-
const handler = new StandardHandler(codec, options);
|
|
22
|
-
super(handler, options);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
class OpenAPILink extends StandardLink {
|
|
27
|
-
constructor(router, options = {}) {
|
|
28
|
-
const codec = new OpenAPILinkCodec(router, options);
|
|
29
|
-
const transport = new FetchLinkTransport(options);
|
|
30
|
-
super(codec, transport, options);
|
|
14
|
+
super(new StandardOpenAPIHandler(router, options), options);
|
|
31
15
|
}
|
|
32
16
|
}
|
|
33
17
|
|
|
34
|
-
export { OpenAPIHandler
|
|
18
|
+
export { OpenAPIHandler };
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { NodeHttpHandlerOptions, NodeHttpHandler } from '@orpc/server/node';
|
|
3
|
+
import { b as StandardOpenAPIHandlerOptions } from '../../shared/openapi.CdeSk3f7.mjs';
|
|
4
|
+
import '@orpc/openapi-client/standard';
|
|
5
|
+
import '@orpc/server/standard';
|
|
5
6
|
import '@orpc/client';
|
|
7
|
+
import '@orpc/standard-server';
|
|
6
8
|
import '@orpc/shared';
|
|
7
|
-
import '@standardserver/core';
|
|
8
|
-
import '@orpc/contract';
|
|
9
|
-
import '../../shared/openapi.BOOA-bde.mjs';
|
|
10
9
|
|
|
11
|
-
interface OpenAPIHandlerOptions<T extends Context> extends NodeHttpHandlerOptions<T>, Omit<
|
|
10
|
+
interface OpenAPIHandlerOptions<T extends Context> extends NodeHttpHandlerOptions<T>, Omit<StandardOpenAPIHandlerOptions<T>, 'plugins'> {
|
|
12
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* OpenAPI Handler for Node Server
|
|
14
|
+
*
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
|
+
*/
|
|
13
18
|
declare class OpenAPIHandler<T extends Context> extends NodeHttpHandler<T> {
|
|
14
|
-
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
19
|
+
constructor(router: Router<any, T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export { OpenAPIHandler };
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { Context, Router } from '@orpc/server';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { NodeHttpHandlerOptions, NodeHttpHandler } from '@orpc/server/node';
|
|
3
|
+
import { b as StandardOpenAPIHandlerOptions } from '../../shared/openapi.CdeSk3f7.js';
|
|
4
|
+
import '@orpc/openapi-client/standard';
|
|
5
|
+
import '@orpc/server/standard';
|
|
5
6
|
import '@orpc/client';
|
|
7
|
+
import '@orpc/standard-server';
|
|
6
8
|
import '@orpc/shared';
|
|
7
|
-
import '@standardserver/core';
|
|
8
|
-
import '@orpc/contract';
|
|
9
|
-
import '../../shared/openapi.BOOA-bde.js';
|
|
10
9
|
|
|
11
|
-
interface OpenAPIHandlerOptions<T extends Context> extends NodeHttpHandlerOptions<T>, Omit<
|
|
10
|
+
interface OpenAPIHandlerOptions<T extends Context> extends NodeHttpHandlerOptions<T>, Omit<StandardOpenAPIHandlerOptions<T>, 'plugins'> {
|
|
12
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* OpenAPI Handler for Node Server
|
|
14
|
+
*
|
|
15
|
+
* @see {@link https://orpc.dev/docs/openapi/openapi-handler OpenAPI Handler Docs}
|
|
16
|
+
* @see {@link https://orpc.dev/docs/adapters/http HTTP Adapter Docs}
|
|
17
|
+
*/
|
|
13
18
|
declare class OpenAPIHandler<T extends Context> extends NodeHttpHandler<T> {
|
|
14
|
-
constructor(router: Router<T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
19
|
+
constructor(router: Router<any, T>, options?: NoInfer<OpenAPIHandlerOptions<T>>);
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
export { OpenAPIHandler };
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { NodeHttpHandler } from '@orpc/server/node';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import { a as StandardOpenAPIHandler } from '../../shared/openapi.DPiCV5hl.mjs';
|
|
3
|
+
import '@orpc/openapi-client/standard';
|
|
4
|
+
import '@orpc/server/standard';
|
|
4
5
|
import '@orpc/client';
|
|
5
|
-
import '@orpc/
|
|
6
|
+
import '@orpc/contract';
|
|
6
7
|
import '@orpc/shared';
|
|
7
|
-
import '@
|
|
8
|
-
import '
|
|
9
|
-
import '../../shared/openapi.Bt87OzTt.mjs';
|
|
10
|
-
import '../../shared/openapi.B9PQzqBn.mjs';
|
|
8
|
+
import '@orpc/client/standard';
|
|
9
|
+
import '@orpc/server';
|
|
11
10
|
import 'rou3';
|
|
12
11
|
|
|
13
12
|
class OpenAPIHandler extends NodeHttpHandler {
|
|
14
13
|
constructor(router, options = {}) {
|
|
15
|
-
|
|
16
|
-
const handler = new StandardHandler(codec, options);
|
|
17
|
-
super(handler, options);
|
|
14
|
+
super(new StandardOpenAPIHandler(router, options), options);
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
17
|
|
|
@@ -1,50 +1,20 @@
|
|
|
1
|
-
export { a as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { RouterContract } from '@orpc/contract';
|
|
5
|
-
import { Value, Promisable } from '@orpc/shared';
|
|
6
|
-
import { StandardUrl, StandardHeaders, StandardLazyResponse, StandardRequest } from '@standardserver/core';
|
|
7
|
-
import { O as OpenAPISerializer } from '../../shared/openapi.BOOA-bde.mjs';
|
|
1
|
+
export { a as StandardOpenAPICodec, S as StandardOpenAPICodecOptions, c as StandardOpenAPIHandler, b as StandardOpenAPIHandlerOptions, e as StandardOpenAPIMatcher, d as StandardOpenAPIMatcherOptions } from '../../shared/openapi.CdeSk3f7.mjs';
|
|
2
|
+
import { HTTPPath } from '@orpc/client';
|
|
3
|
+
import '@orpc/openapi-client/standard';
|
|
8
4
|
import '@orpc/server';
|
|
9
5
|
import '@orpc/server/standard';
|
|
6
|
+
import '@orpc/standard-server';
|
|
7
|
+
import '@orpc/shared';
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Inject headers into the request.
|
|
23
|
-
*/
|
|
24
|
-
headers?: Value<Promisable<StandardHeaders | Headers>, [options: ClientOptions<T>, path: string[], input: unknown]>;
|
|
25
|
-
/**
|
|
26
|
-
* Override the default OpenAPI serializer.
|
|
27
|
-
*/
|
|
28
|
-
serializer?: Pick<OpenAPISerializer, keyof OpenAPISerializer>;
|
|
29
|
-
/**
|
|
30
|
-
* Customize how an error response body is converted into an ORPC error.
|
|
31
|
-
* Return `null` or `undefined` to fall back to the default decoding behavior.
|
|
32
|
-
*/
|
|
33
|
-
customErrorResponseBodyDecoder?: (deserializedBody: unknown, response: StandardLazyResponse) => AnyORPCError | null | undefined;
|
|
34
|
-
}
|
|
35
|
-
declare class OpenAPILinkCodec<T extends ClientContext> implements StandardLinkCodec<T> {
|
|
36
|
-
private readonly router;
|
|
37
|
-
private readonly baseUrl;
|
|
38
|
-
private readonly headers;
|
|
39
|
-
private readonly serializer;
|
|
40
|
-
private readonly customErrorResponseBodyDecoder;
|
|
41
|
-
constructor(router: RouterContract, options?: OpenAPILinkCodecOptions<T>);
|
|
42
|
-
encodeInput(input: unknown, path: string[], options: ClientOptions<T>): Promise<StandardRequest>;
|
|
43
|
-
private encodePathParam;
|
|
44
|
-
private serializeQueryString;
|
|
45
|
-
decodeResponse(response: StandardLazyResponse, path: string[], _options: ClientOptions<T>): Promise<StandardLinkCodecDecodedResponse>;
|
|
46
|
-
private resolveProcedure;
|
|
47
|
-
}
|
|
9
|
+
/**
|
|
10
|
+
* {@link https://github.com/unjs/rou3}
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
declare function toRou3Pattern(path: HTTPPath): string;
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
declare function decodeParams(params: Record<string, string>): Record<string, string>;
|
|
48
19
|
|
|
49
|
-
export {
|
|
50
|
-
export type { OpenAPILinkCodecOptions };
|
|
20
|
+
export { decodeParams, toRou3Pattern };
|