@orpc/trpc 2.0.0-beta.23 → 2.0.0-beta.25
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/index.d.mts +11 -4
- package/dist/index.d.ts +11 -4
- package/package.json +5 -5
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
|
|
package/dist/index.d.mts
CHANGED
|
@@ -8,7 +8,12 @@ type ToORPCRouterResult<TContext extends ORPC.Context, TRecord extends Record<st
|
|
|
8
8
|
[K in keyof TRecord]: TRecord[K] extends AnyProcedure ? ORPC.Procedure<TContext, object, ORPC.Schema<TRecord[K]['_def']['$types']['input'], unknown>, ORPC.Schema<unknown, ToORPCOutput<TRecord[K]['_def']['$types']['output']>>, object, never> : TRecord[K] extends Record<string, any> ? ToORPCRouterResult<TContext, TRecord[K]> : never;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Converts a tRPC router into an oRPC router that works with any oRPC feature.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* **Note**: tRPC Error Formatting is not supported — errors thrown by tRPC are wrapped in `ORPCError`.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://orpc.dev/docs/integrations/trpc | tRPC Integration}
|
|
12
17
|
*/
|
|
13
18
|
declare function toORPCRouter<T extends AnyRouter>(router: T): ToORPCRouterResult<inferRouterContext<T>, T['_def']['record']>;
|
|
14
19
|
|
|
@@ -18,6 +23,10 @@ declare function toORPCRouter<T extends AnyRouter>(router: T): ToORPCRouterResul
|
|
|
18
23
|
* This simulates how oRPC builders apply meta plugins, so well-known plugins
|
|
19
24
|
* like `openapi` from `@orpc/openapi` can be used with tRPC builders.
|
|
20
25
|
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* **Warning**: Chained tRPC `.meta` calls merge shallowly, so oRPC metadata merge logic
|
|
28
|
+
* (e.g. accumulating openapi `tags`) only works within a single `toTRPCMeta` call.
|
|
29
|
+
*
|
|
21
30
|
* @example
|
|
22
31
|
* ```ts
|
|
23
32
|
* const example = t.procedure
|
|
@@ -35,9 +44,7 @@ declare function toORPCRouter<T extends AnyRouter>(router: T): ToORPCRouterResul
|
|
|
35
44
|
* .mutation(() => 'Hello, World!')
|
|
36
45
|
* ```
|
|
37
46
|
*
|
|
38
|
-
* @
|
|
39
|
-
* (e.g. accumulating openapi `tags`) only works within a single `toTRPCMeta`
|
|
40
|
-
* call.
|
|
47
|
+
* @see {@link https://orpc.dev/docs/integrations/trpc | tRPC Integration}
|
|
41
48
|
*/
|
|
42
49
|
declare function toTRPCMeta(...plugins: AnyMetaPlugin[]): Record<string, any>;
|
|
43
50
|
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,12 @@ type ToORPCRouterResult<TContext extends ORPC.Context, TRecord extends Record<st
|
|
|
8
8
|
[K in keyof TRecord]: TRecord[K] extends AnyProcedure ? ORPC.Procedure<TContext, object, ORPC.Schema<TRecord[K]['_def']['$types']['input'], unknown>, ORPC.Schema<unknown, ToORPCOutput<TRecord[K]['_def']['$types']['output']>>, object, never> : TRecord[K] extends Record<string, any> ? ToORPCRouterResult<TContext, TRecord[K]> : never;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Converts a tRPC router into an oRPC router that works with any oRPC feature.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* **Note**: tRPC Error Formatting is not supported — errors thrown by tRPC are wrapped in `ORPCError`.
|
|
15
|
+
*
|
|
16
|
+
* @see {@link https://orpc.dev/docs/integrations/trpc | tRPC Integration}
|
|
12
17
|
*/
|
|
13
18
|
declare function toORPCRouter<T extends AnyRouter>(router: T): ToORPCRouterResult<inferRouterContext<T>, T['_def']['record']>;
|
|
14
19
|
|
|
@@ -18,6 +23,10 @@ declare function toORPCRouter<T extends AnyRouter>(router: T): ToORPCRouterResul
|
|
|
18
23
|
* This simulates how oRPC builders apply meta plugins, so well-known plugins
|
|
19
24
|
* like `openapi` from `@orpc/openapi` can be used with tRPC builders.
|
|
20
25
|
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* **Warning**: Chained tRPC `.meta` calls merge shallowly, so oRPC metadata merge logic
|
|
28
|
+
* (e.g. accumulating openapi `tags`) only works within a single `toTRPCMeta` call.
|
|
29
|
+
*
|
|
21
30
|
* @example
|
|
22
31
|
* ```ts
|
|
23
32
|
* const example = t.procedure
|
|
@@ -35,9 +44,7 @@ declare function toORPCRouter<T extends AnyRouter>(router: T): ToORPCRouterResul
|
|
|
35
44
|
* .mutation(() => 'Hello, World!')
|
|
36
45
|
* ```
|
|
37
46
|
*
|
|
38
|
-
* @
|
|
39
|
-
* (e.g. accumulating openapi `tags`) only works within a single `toTRPCMeta`
|
|
40
|
-
* call.
|
|
47
|
+
* @see {@link https://orpc.dev/docs/integrations/trpc | tRPC Integration}
|
|
41
48
|
*/
|
|
42
49
|
declare function toTRPCMeta(...plugins: AnyMetaPlugin[]): Record<string, any>;
|
|
43
50
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/trpc",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.25",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.dev",
|
|
7
7
|
"repository": {
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"@trpc/server": ">=11.4.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@orpc/
|
|
33
|
-
"@orpc/
|
|
34
|
-
"@orpc/
|
|
32
|
+
"@orpc/contract": "2.0.0-beta.25",
|
|
33
|
+
"@orpc/server": "2.0.0-beta.25",
|
|
34
|
+
"@orpc/shared": "2.0.0-beta.25"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@trpc/server": "^11.12.0",
|
|
38
38
|
"zod": "^4.4.3",
|
|
39
|
-
"@orpc/openapi": "2.0.0-beta.
|
|
39
|
+
"@orpc/openapi": "2.0.0-beta.25"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild",
|