@orpc/trpc 0.0.0-next.f50512c → 0.0.0-next.f9e0a4c

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 CHANGED
@@ -30,6 +30,7 @@
30
30
  - **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server.
31
31
  - **📘 First-Class OpenAPI**: Built-in support that fully adheres to the OpenAPI standard.
32
32
  - **📝 Contract-First Development**: Optionally define your API contract before implementation.
33
+ - **🔍 First-Class OpenTelemetry**: Seamlessly integrate with OpenTelemetry for observability.
33
34
  - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), Pinia Colada, and more.
34
35
  - **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
35
36
  - **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
@@ -38,7 +39,6 @@
38
39
  - **📡 SSE & Streaming**: Enjoy full type-safe support for SSE and streaming.
39
40
  - **🌍 Multi-Runtime Support**: Fast and lightweight on Cloudflare, Deno, Bun, Node.js, and beyond.
40
41
  - **🔌 Extendability**: Easily extend functionality with plugins, middleware, and interceptors.
41
- - **🛡️ Reliability**: Well-tested, TypeScript-based, production-ready, and MIT licensed.
42
42
 
43
43
  ## Documentation
44
44
 
@@ -50,6 +50,7 @@ You can find the full documentation [here](https://orpc.unnoq.com).
50
50
  - [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
51
51
  - [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
52
52
  - [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
53
+ - [@orpc/otel](https://www.npmjs.com/package/@orpc/otel): [OpenTelemetry](https://opentelemetry.io/) integration for observability.
53
54
  - [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with [NestJS](https://nestjs.com/).
54
55
  - [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
55
56
  - [@orpc/tanstack-query](https://www.npmjs.com/package/@orpc/tanstack-query): [TanStack Query](https://tanstack.com/query/latest) integration.
package/dist/index.d.mts CHANGED
@@ -3,19 +3,19 @@ import { AnyProcedure, AnyRouter, inferRouterContext } from '@trpc/server';
3
3
  import { inferRouterMeta } from '@trpc/server/unstable-core-do-not-import';
4
4
  import * as ORPC from '@orpc/server';
5
5
 
6
- interface experimental_ORPCMeta {
6
+ interface ORPCMeta {
7
7
  route?: ORPC.Route;
8
8
  }
9
- type experimental_ToORPCOutput<T> = T extends AsyncIterable<infer TData, infer TReturn, infer TNext> ? AsyncIteratorClass<TData, TReturn, TNext> : T;
10
- type experimental_ToORPCRouterResult<TContext extends ORPC.Context, TMeta extends ORPC.Meta, TRecord extends Record<string, any>> = {
11
- [K in keyof TRecord]: TRecord[K] extends AnyProcedure ? ORPC.Procedure<TContext, object, ORPC.Schema<TRecord[K]['_def']['$types']['input'], unknown>, ORPC.Schema<unknown, experimental_ToORPCOutput<TRecord[K]['_def']['$types']['output']>>, object, TMeta> : TRecord[K] extends Record<string, any> ? experimental_ToORPCRouterResult<TContext, TMeta, TRecord[K]> : never;
9
+ type ToORPCOutput<T> = T extends AsyncIterable<infer TData, infer TReturn, infer TNext> ? AsyncIteratorClass<TData, TReturn, TNext> : T;
10
+ type ToORPCRouterResult<TContext extends ORPC.Context, TMeta extends ORPC.Meta, TRecord extends Record<string, any>> = {
11
+ [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, TMeta> : TRecord[K] extends Record<string, any> ? ToORPCRouterResult<TContext, TMeta, TRecord[K]> : never;
12
12
  };
13
13
  /**
14
14
  * Convert a tRPC router to an oRPC router.
15
15
  *
16
16
  * @warning You should set the `meta` type to `ORPCMeta` when creating your tRPC builder, to ensure OpenAPI features work correctly.
17
17
  */
18
- declare function experimental_toORPCRouter<T extends AnyRouter>(router: T): experimental_ToORPCRouterResult<inferRouterContext<T>, inferRouterMeta<T>, T['_def']['record']>;
18
+ declare function toORPCRouter<T extends AnyRouter>(router: T): ToORPCRouterResult<inferRouterContext<T>, inferRouterMeta<T>, T['_def']['record']>;
19
19
 
20
- export { experimental_toORPCRouter };
21
- export type { experimental_ORPCMeta, experimental_ToORPCOutput, experimental_ToORPCRouterResult };
20
+ export { toORPCRouter };
21
+ export type { ORPCMeta, ToORPCOutput, ToORPCRouterResult };
package/dist/index.d.ts CHANGED
@@ -3,19 +3,19 @@ import { AnyProcedure, AnyRouter, inferRouterContext } from '@trpc/server';
3
3
  import { inferRouterMeta } from '@trpc/server/unstable-core-do-not-import';
4
4
  import * as ORPC from '@orpc/server';
5
5
 
6
- interface experimental_ORPCMeta {
6
+ interface ORPCMeta {
7
7
  route?: ORPC.Route;
8
8
  }
9
- type experimental_ToORPCOutput<T> = T extends AsyncIterable<infer TData, infer TReturn, infer TNext> ? AsyncIteratorClass<TData, TReturn, TNext> : T;
10
- type experimental_ToORPCRouterResult<TContext extends ORPC.Context, TMeta extends ORPC.Meta, TRecord extends Record<string, any>> = {
11
- [K in keyof TRecord]: TRecord[K] extends AnyProcedure ? ORPC.Procedure<TContext, object, ORPC.Schema<TRecord[K]['_def']['$types']['input'], unknown>, ORPC.Schema<unknown, experimental_ToORPCOutput<TRecord[K]['_def']['$types']['output']>>, object, TMeta> : TRecord[K] extends Record<string, any> ? experimental_ToORPCRouterResult<TContext, TMeta, TRecord[K]> : never;
9
+ type ToORPCOutput<T> = T extends AsyncIterable<infer TData, infer TReturn, infer TNext> ? AsyncIteratorClass<TData, TReturn, TNext> : T;
10
+ type ToORPCRouterResult<TContext extends ORPC.Context, TMeta extends ORPC.Meta, TRecord extends Record<string, any>> = {
11
+ [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, TMeta> : TRecord[K] extends Record<string, any> ? ToORPCRouterResult<TContext, TMeta, TRecord[K]> : never;
12
12
  };
13
13
  /**
14
14
  * Convert a tRPC router to an oRPC router.
15
15
  *
16
16
  * @warning You should set the `meta` type to `ORPCMeta` when creating your tRPC builder, to ensure OpenAPI features work correctly.
17
17
  */
18
- declare function experimental_toORPCRouter<T extends AnyRouter>(router: T): experimental_ToORPCRouterResult<inferRouterContext<T>, inferRouterMeta<T>, T['_def']['record']>;
18
+ declare function toORPCRouter<T extends AnyRouter>(router: T): ToORPCRouterResult<inferRouterContext<T>, inferRouterMeta<T>, T['_def']['record']>;
19
19
 
20
- export { experimental_toORPCRouter };
21
- export type { experimental_ORPCMeta, experimental_ToORPCOutput, experimental_ToORPCRouterResult };
20
+ export { toORPCRouter };
21
+ export type { ORPCMeta, ToORPCOutput, ToORPCRouterResult };
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { get, isObject, isTypescriptObject } from '@orpc/shared';
4
4
  import { isTrackedEnvelope, TRPCError } from '@trpc/server';
5
5
  import { isAsyncIterable, getHTTPStatusCodeFromError } from '@trpc/server/unstable-core-do-not-import';
6
6
 
7
- function experimental_toORPCRouter(router) {
7
+ function toORPCRouter(router) {
8
8
  const result = {
9
9
  ...lazyToORPCRouter(router._def.lazy),
10
10
  ...recordToORPCRouterRecord(router._def.record)
@@ -17,7 +17,7 @@ function lazyToORPCRouter(lazies) {
17
17
  const item = lazies[key];
18
18
  orpcRouter[key] = ORPC.createAccessibleLazyRouter(ORPC.lazy(async () => {
19
19
  const router = await item.ref();
20
- return { default: experimental_toORPCRouter(router) };
20
+ return { default: toORPCRouter(router) };
21
21
  }));
22
22
  }
23
23
  return orpcRouter;
@@ -107,4 +107,4 @@ function toDisabledStandardSchema(schema) {
107
107
  });
108
108
  }
109
109
 
110
- export { experimental_toORPCRouter };
110
+ export { toORPCRouter };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/trpc",
3
3
  "type": "module",
4
- "version": "0.0.0-next.f50512c",
4
+ "version": "0.0.0-next.f9e0a4c",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -28,13 +28,13 @@
28
28
  "@trpc/server": ">=11.4.2"
29
29
  },
30
30
  "dependencies": {
31
- "@orpc/client": "0.0.0-next.f50512c",
32
- "@orpc/shared": "0.0.0-next.f50512c",
33
- "@orpc/server": "0.0.0-next.f50512c"
31
+ "@orpc/client": "0.0.0-next.f9e0a4c",
32
+ "@orpc/server": "0.0.0-next.f9e0a4c",
33
+ "@orpc/shared": "0.0.0-next.f9e0a4c"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@trpc/server": "^11.4.3",
37
- "zod": "^4.0.5"
37
+ "zod": "^4.0.17"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "unbuild",