@orpc/nest 0.0.0-next.fd1ee2a → 0.0.0-next.fdd2389

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
@@ -17,6 +17,9 @@
17
17
  <a href="https://discord.gg/TXEbwRBvQn">
18
18
  <img alt="Discord" src="https://img.shields.io/discord/1308966753044398161?color=7389D8&label&logo=discord&logoColor=ffffff" />
19
19
  </a>
20
+ <a href="https://deepwiki.com/unnoq/orpc">
21
+ <img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki">
22
+ </a>
20
23
  </div>
21
24
 
22
25
  <h3 align="center">Typesafe APIs Made Simple 🪄</h3>
@@ -30,7 +33,8 @@
30
33
  - **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server.
31
34
  - **📘 First-Class OpenAPI**: Built-in support that fully adheres to the OpenAPI standard.
32
35
  - **📝 Contract-First Development**: Optionally define your API contract before implementation.
33
- - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), Pinia Colada, and more.
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.
34
38
  - **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
35
39
  - **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
36
40
  - **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
@@ -38,7 +42,6 @@
38
42
  - **📡 SSE & Streaming**: Enjoy full type-safe support for SSE and streaming.
39
43
  - **🌍 Multi-Runtime Support**: Fast and lightweight on Cloudflare, Deno, Bun, Node.js, and beyond.
40
44
  - **🔌 Extendability**: Easily extend functionality with plugins, middleware, and interceptors.
41
- - **🛡️ Reliability**: Well-tested, TypeScript-based, production-ready, and MIT licensed.
42
45
 
43
46
  ## Documentation
44
47
 
@@ -50,9 +53,11 @@ You can find the full documentation [here](https://orpc.unnoq.com).
50
53
  - [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
51
54
  - [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
52
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.
53
57
  - [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with [NestJS](https://nestjs.com/).
54
58
  - [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
55
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.
56
61
  - [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
57
62
  - [@orpc/hey-api](https://www.npmjs.com/package/@orpc/hey-api): [Hey API](https://heyapi.dev/) integration.
58
63
  - [@orpc/zod](https://www.npmjs.com/package/@orpc/zod): More schemas that [Zod](https://zod.dev/) doesn't support yet.
@@ -85,7 +90,7 @@ export class PlanetController {
85
90
  }
86
91
 
87
92
  /**
88
- * Implement entire a contract
93
+ * Implement entire contract
89
94
  */
90
95
  @Implement(contract.planet)
91
96
  planet() {
package/dist/index.d.mts CHANGED
@@ -11,6 +11,11 @@ interface ORPCModuleConfig extends CreateProcedureClientOptions<object, AnySchem
11
11
  }
12
12
  declare class ORPCModule {
13
13
  static forRoot(config: ORPCModuleConfig): DynamicModule;
14
+ static forRootAsync(options: {
15
+ imports?: any[];
16
+ useFactory: (...args: any[]) => Promise<ORPCModuleConfig> | ORPCModuleConfig;
17
+ inject?: any[];
18
+ }): DynamicModule;
14
19
  }
15
20
 
16
21
  /**
package/dist/index.d.ts CHANGED
@@ -11,6 +11,11 @@ interface ORPCModuleConfig extends CreateProcedureClientOptions<object, AnySchem
11
11
  }
12
12
  declare class ORPCModule {
13
13
  static forRoot(config: ORPCModuleConfig): DynamicModule;
14
+ static forRootAsync(options: {
15
+ imports?: any[];
16
+ useFactory: (...args: any[]) => Promise<ORPCModuleConfig> | ORPCModuleConfig;
17
+ inject?: any[];
18
+ }): DynamicModule;
14
19
  }
15
20
 
16
21
  /**
package/dist/index.mjs CHANGED
@@ -35,6 +35,22 @@ let ORPCModule = class {
35
35
  global: true
36
36
  };
37
37
  }
38
+ static forRootAsync(options) {
39
+ return {
40
+ module: ORPCModule,
41
+ imports: options.imports,
42
+ providers: [
43
+ {
44
+ provide: ORPC_MODULE_CONFIG_SYMBOL,
45
+ useFactory: options.useFactory,
46
+ inject: options.inject
47
+ },
48
+ ImplementInterceptor
49
+ ],
50
+ exports: [ORPC_MODULE_CONFIG_SYMBOL, ImplementInterceptor],
51
+ global: true
52
+ };
53
+ }
38
54
  };
39
55
  ORPCModule = __decorateClass$1([
40
56
  Module({})
@@ -145,7 +161,9 @@ let ImplementInterceptor = class {
145
161
  const nodeRes = "raw" in res ? res.raw : res;
146
162
  const standardRequest = toStandardLazyRequest(nodeReq, nodeRes);
147
163
  const fallbackStandardBody = standardRequest.body.bind(standardRequest);
148
- standardRequest.body = () => Promise.resolve(req.body ?? fallbackStandardBody());
164
+ standardRequest.body = () => Promise.resolve(
165
+ req.body === void 0 ? fallbackStandardBody() : req.body
166
+ );
149
167
  const standardResponse = await (async () => {
150
168
  let isDecoding = false;
151
169
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/nest",
3
3
  "type": "module",
4
- "version": "0.0.0-next.fd1ee2a",
4
+ "version": "0.0.0-next.fdd2389",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -39,28 +39,28 @@
39
39
  }
40
40
  },
41
41
  "dependencies": {
42
- "@orpc/client": "0.0.0-next.fd1ee2a",
43
- "@orpc/contract": "0.0.0-next.fd1ee2a",
44
- "@orpc/openapi": "0.0.0-next.fd1ee2a",
45
- "@orpc/openapi-client": "0.0.0-next.fd1ee2a",
46
- "@orpc/server": "0.0.0-next.fd1ee2a",
47
- "@orpc/standard-server": "0.0.0-next.fd1ee2a",
48
- "@orpc/standard-server-node": "0.0.0-next.fd1ee2a",
49
- "@orpc/shared": "0.0.0-next.fd1ee2a"
42
+ "@orpc/client": "0.0.0-next.fdd2389",
43
+ "@orpc/contract": "0.0.0-next.fdd2389",
44
+ "@orpc/openapi-client": "0.0.0-next.fdd2389",
45
+ "@orpc/openapi": "0.0.0-next.fdd2389",
46
+ "@orpc/server": "0.0.0-next.fdd2389",
47
+ "@orpc/standard-server": "0.0.0-next.fdd2389",
48
+ "@orpc/shared": "0.0.0-next.fdd2389",
49
+ "@orpc/standard-server-node": "0.0.0-next.fdd2389"
50
50
  },
51
51
  "devDependencies": {
52
- "@nestjs/common": "^11.1.4",
53
- "@nestjs/core": "^11.1.4",
54
- "@nestjs/platform-express": "^11.1.4",
55
- "@nestjs/platform-fastify": "^11.1.4",
56
- "@nestjs/testing": "^11.1.4",
52
+ "@nestjs/common": "^11.1.6",
53
+ "@nestjs/core": "^11.1.6",
54
+ "@nestjs/platform-express": "^11.1.6",
55
+ "@nestjs/platform-fastify": "^11.1.6",
56
+ "@nestjs/testing": "^11.1.6",
57
57
  "@ts-rest/core": "^3.52.1",
58
58
  "@types/express": "^5.0.3",
59
59
  "express": "^5.0.0",
60
- "fastify": "^5.4.0",
60
+ "fastify": "^5.6.1",
61
61
  "rxjs": "^7.8.1",
62
- "supertest": "^7.1.3",
63
- "zod": "^4.0.5"
62
+ "supertest": "^7.1.4",
63
+ "zod": "^4.1.11"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "unbuild",