@orpc/standard-server-node 0.46.0 → 0.48.0

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
@@ -32,7 +32,7 @@
32
32
  - **Contract-First Development 📜**: (Optional) Define your API contract upfront and implement it with confidence.
33
33
  - **Exceptional Developer Experience ✨**: Enjoy a streamlined workflow with robust typing and clear, in-code documentation.
34
34
  - **Multi-Runtime Support 🌍**: Run your code seamlessly on Cloudflare, Deno, Bun, Node.js, and more.
35
- - **Framework Integrations 🧩**: Supports Tanstack Query (React, Vue), Pinia Colada, and more.
35
+ - **Framework Integrations 🧩**: Supports Tanstack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
36
36
  - **Server Actions ⚡️**: Fully compatible with React Server Actions on Next.js, TanStack Start, and more.
37
37
  - **Standard Schema Support 🗂️**: Effortlessly work with Zod, Valibot, ArkType, and others right out of the box.
38
38
  - **Fast & Lightweight 💨**: Built on native APIs across all runtimes – optimized for speed and efficiency.
@@ -55,6 +55,8 @@ You can find the full documentation [here](https://orpc.unnoq.com).
55
55
  - [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
56
56
  - [@orpc/react-query](https://www.npmjs.com/package/@orpc/react-query): Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
57
57
  - [@orpc/vue-query](https://www.npmjs.com/package/@orpc/vue-query): Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
58
+ - [@orpc/solid-query](https://www.npmjs.com/package/@orpc/solid-query): Integration with [Solid Query](https://tanstack.com/query/latest/docs/framework/solid/overview).
59
+ - [@orpc/svelte-query](https://www.npmjs.com/package/@orpc/svelte-query): Integration with [Svelte Query](https://tanstack.com/query/latest/docs/framework/svelte/overview).
58
60
  - [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
59
61
  - [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
60
62
  - [@orpc/zod](https://www.npmjs.com/package/@orpc/zod): More schemas that [Zod](https://zod.dev/) doesn't support yet.
package/dist/index.d.mts CHANGED
@@ -24,7 +24,7 @@ interface ToEventStreamOptions {
24
24
  */
25
25
  eventIteratorKeepAliveComment?: string;
26
26
  }
27
- declare function toEventStream(iterator: AsyncIterator<unknown | void, unknown | void, void>, options: ToEventStreamOptions): Readable;
27
+ declare function toEventStream(iterator: AsyncIterator<unknown | void, unknown | void, void>, options?: ToEventStreamOptions): Readable;
28
28
 
29
29
  type NodeHttpRequest = (IncomingMessage | Http2ServerRequest) & {
30
30
  /**
@@ -43,13 +43,13 @@ interface ToNodeHttpBodyOptions extends ToEventStreamOptions {
43
43
  * @param headers - WARNING: The headers can be changed by the function and effects on the original headers.
44
44
  * @param options
45
45
  */
46
- declare function toNodeHttpBody(body: StandardBody, headers: StandardHeaders, options: ToNodeHttpBodyOptions): Readable | undefined | string;
46
+ declare function toNodeHttpBody(body: StandardBody, headers: StandardHeaders, options?: ToNodeHttpBodyOptions): Readable | undefined | string;
47
47
 
48
48
  declare function toStandardLazyRequest(req: NodeHttpRequest, res: NodeHttpResponse): StandardLazyRequest;
49
49
 
50
50
  interface SendStandardResponseOptions extends ToNodeHttpBodyOptions {
51
51
  }
52
- declare function sendStandardResponse(res: NodeHttpResponse, standardResponse: StandardResponse, options: SendStandardResponseOptions): Promise<void>;
52
+ declare function sendStandardResponse(res: NodeHttpResponse, standardResponse: StandardResponse, options?: SendStandardResponseOptions): Promise<void>;
53
53
 
54
54
  declare function toAbortSignal(res: NodeHttpResponse): AbortSignal;
55
55
 
package/dist/index.d.ts CHANGED
@@ -24,7 +24,7 @@ interface ToEventStreamOptions {
24
24
  */
25
25
  eventIteratorKeepAliveComment?: string;
26
26
  }
27
- declare function toEventStream(iterator: AsyncIterator<unknown | void, unknown | void, void>, options: ToEventStreamOptions): Readable;
27
+ declare function toEventStream(iterator: AsyncIterator<unknown | void, unknown | void, void>, options?: ToEventStreamOptions): Readable;
28
28
 
29
29
  type NodeHttpRequest = (IncomingMessage | Http2ServerRequest) & {
30
30
  /**
@@ -43,13 +43,13 @@ interface ToNodeHttpBodyOptions extends ToEventStreamOptions {
43
43
  * @param headers - WARNING: The headers can be changed by the function and effects on the original headers.
44
44
  * @param options
45
45
  */
46
- declare function toNodeHttpBody(body: StandardBody, headers: StandardHeaders, options: ToNodeHttpBodyOptions): Readable | undefined | string;
46
+ declare function toNodeHttpBody(body: StandardBody, headers: StandardHeaders, options?: ToNodeHttpBodyOptions): Readable | undefined | string;
47
47
 
48
48
  declare function toStandardLazyRequest(req: NodeHttpRequest, res: NodeHttpResponse): StandardLazyRequest;
49
49
 
50
50
  interface SendStandardResponseOptions extends ToNodeHttpBodyOptions {
51
51
  }
52
- declare function sendStandardResponse(res: NodeHttpResponse, standardResponse: StandardResponse, options: SendStandardResponseOptions): Promise<void>;
52
+ declare function sendStandardResponse(res: NodeHttpResponse, standardResponse: StandardResponse, options?: SendStandardResponseOptions): Promise<void>;
53
53
 
54
54
  declare function toAbortSignal(res: NodeHttpResponse): AbortSignal;
55
55
 
package/dist/index.mjs CHANGED
@@ -43,7 +43,7 @@ function toEventIterator(stream) {
43
43
  }
44
44
  return gen();
45
45
  }
46
- function toEventStream(iterator, options) {
46
+ function toEventStream(iterator, options = {}) {
47
47
  const keepAliveEnabled = options.eventIteratorKeepAliveEnabled ?? true;
48
48
  const keepAliveInterval = options.eventIteratorKeepAliveInterval ?? 5e3;
49
49
  const keepAliveComment = options.eventIteratorKeepAliveComment ?? "";
@@ -121,7 +121,7 @@ async function toStandardBody(req) {
121
121
  }
122
122
  return _streamToFile(req, "blob", contentType);
123
123
  }
124
- function toNodeHttpBody(body, headers, options) {
124
+ function toNodeHttpBody(body, headers, options = {}) {
125
125
  delete headers["content-type"];
126
126
  delete headers["content-disposition"];
127
127
  if (body === void 0) {
@@ -206,7 +206,7 @@ function toStandardLazyRequest(req, res) {
206
206
  };
207
207
  }
208
208
 
209
- function sendStandardResponse(res, standardResponse, options) {
209
+ function sendStandardResponse(res, standardResponse, options = {}) {
210
210
  return new Promise((resolve, reject) => {
211
211
  res.on("error", reject);
212
212
  res.on("finish", resolve);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/standard-server-node",
3
3
  "type": "module",
4
- "version": "0.46.0",
4
+ "version": "0.48.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -23,8 +23,8 @@
23
23
  "dist"
24
24
  ],
25
25
  "dependencies": {
26
- "@orpc/shared": "0.46.0",
27
- "@orpc/standard-server": "0.46.0"
26
+ "@orpc/standard-server": "0.48.0",
27
+ "@orpc/shared": "0.48.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/node": "^22.13.1",