@orpc/nest 0.0.0-next.d53d856 → 0.0.0-next.d53e45e
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 +6 -2
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +19 -1
- package/package.json +11 -11
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>
|
|
@@ -31,7 +34,7 @@
|
|
|
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
36
|
- **🔍 First-Class OpenTelemetry**: Seamlessly integrate with OpenTelemetry for observability.
|
|
34
|
-
- **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), Pinia Colada, and more.
|
|
37
|
+
- **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), SWR, Pinia Colada, and more.
|
|
35
38
|
- **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
|
|
36
39
|
- **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
|
|
37
40
|
- **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
|
|
@@ -54,6 +57,7 @@ You can find the full documentation [here](https://orpc.unnoq.com).
|
|
|
54
57
|
- [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with [NestJS](https://nestjs.com/).
|
|
55
58
|
- [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
|
|
56
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.
|
|
57
61
|
- [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
|
|
58
62
|
- [@orpc/hey-api](https://www.npmjs.com/package/@orpc/hey-api): [Hey API](https://heyapi.dev/) integration.
|
|
59
63
|
- [@orpc/zod](https://www.npmjs.com/package/@orpc/zod): More schemas that [Zod](https://zod.dev/) doesn't support yet.
|
|
@@ -86,7 +90,7 @@ export class PlanetController {
|
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
/**
|
|
89
|
-
* Implement entire
|
|
93
|
+
* Implement entire contract
|
|
90
94
|
*/
|
|
91
95
|
@Implement(contract.planet)
|
|
92
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(
|
|
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.
|
|
4
|
+
"version": "0.0.0-next.d53e45e",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@orpc/client": "0.0.0-next.
|
|
43
|
-
"@orpc/contract": "0.0.0-next.
|
|
44
|
-
"@orpc/openapi": "0.0.0-next.
|
|
45
|
-
"@orpc/openapi
|
|
46
|
-
"@orpc/
|
|
47
|
-
"@orpc/
|
|
48
|
-
"@orpc/standard-server
|
|
49
|
-
"@orpc/standard-server": "0.0.0-next.
|
|
42
|
+
"@orpc/client": "0.0.0-next.d53e45e",
|
|
43
|
+
"@orpc/contract": "0.0.0-next.d53e45e",
|
|
44
|
+
"@orpc/openapi-client": "0.0.0-next.d53e45e",
|
|
45
|
+
"@orpc/openapi": "0.0.0-next.d53e45e",
|
|
46
|
+
"@orpc/server": "0.0.0-next.d53e45e",
|
|
47
|
+
"@orpc/shared": "0.0.0-next.d53e45e",
|
|
48
|
+
"@orpc/standard-server": "0.0.0-next.d53e45e",
|
|
49
|
+
"@orpc/standard-server-node": "0.0.0-next.d53e45e"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@nestjs/common": "^11.1.6",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"@ts-rest/core": "^3.52.1",
|
|
58
58
|
"@types/express": "^5.0.3",
|
|
59
59
|
"express": "^5.0.0",
|
|
60
|
-
"fastify": "^5.
|
|
60
|
+
"fastify": "^5.6.1",
|
|
61
61
|
"rxjs": "^7.8.1",
|
|
62
62
|
"supertest": "^7.1.4",
|
|
63
|
-
"zod": "^4.
|
|
63
|
+
"zod": "^4.1.11"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "unbuild",
|