@orpc/client 0.0.0-next.de766b3 → 0.0.0-next.de7ca70

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,7 +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
- - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte), Pinia Colada, and more.
33
+ - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), Pinia Colada, and more.
34
34
  - **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
35
35
  - **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
36
36
  - **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
@@ -1,8 +1,8 @@
1
1
  import { toFetchRequest, toStandardLazyResponse } from '@orpc/standard-server-fetch';
2
2
  import '@orpc/shared';
3
- import { c as StandardRPCLink } from '../../shared/client.CQCGVpTM.mjs';
3
+ import { c as StandardRPCLink } from '../../shared/client.DwfV9Oyl.mjs';
4
4
  import '@orpc/standard-server';
5
- import '../../shared/client.BX0_8bnM.mjs';
5
+ import '../../shared/client.DHOfWE0c.mjs';
6
6
 
7
7
  class LinkFetchClient {
8
8
  fetch;
@@ -29,7 +29,7 @@ type SupportedMessagePort = Pick<MessagePort, 'addEventListener' | 'postMessage'
29
29
  /**
30
30
  * Message port can support [The structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm)
31
31
  */
32
- type SupportedMessagePortData = string | ArrayBufferLike;
32
+ type SupportedMessagePortData = string | ArrayBufferLike | Uint8Array;
33
33
  declare function postMessagePortMessage(port: SupportedMessagePort, data: SupportedMessagePortData): void;
34
34
  declare function onMessagePortMessage(port: SupportedMessagePort, callback: (data: SupportedMessagePortData) => void): void;
35
35
  declare function onMessagePortClose(port: SupportedMessagePort, callback: () => void): void;
@@ -29,7 +29,7 @@ type SupportedMessagePort = Pick<MessagePort, 'addEventListener' | 'postMessage'
29
29
  /**
30
30
  * Message port can support [The structured clone algorithm](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm)
31
31
  */
32
- type SupportedMessagePortData = string | ArrayBufferLike;
32
+ type SupportedMessagePortData = string | ArrayBufferLike | Uint8Array;
33
33
  declare function postMessagePortMessage(port: SupportedMessagePort, data: SupportedMessagePortData): void;
34
34
  declare function onMessagePortMessage(port: SupportedMessagePort, callback: (data: SupportedMessagePortData) => void): void;
35
35
  declare function onMessagePortClose(port: SupportedMessagePort, callback: () => void): void;
@@ -1,8 +1,8 @@
1
1
  import { ClientPeer } from '@orpc/standard-server-peer';
2
2
  import '@orpc/shared';
3
- import { c as StandardRPCLink } from '../../shared/client.CQCGVpTM.mjs';
3
+ import { c as StandardRPCLink } from '../../shared/client.DwfV9Oyl.mjs';
4
4
  import '@orpc/standard-server';
5
- import '../../shared/client.BX0_8bnM.mjs';
5
+ import '../../shared/client.DHOfWE0c.mjs';
6
6
 
7
7
  function postMessagePortMessage(port, data) {
8
8
  port.postMessage(data);
@@ -1,4 +1,4 @@
1
- export { C as CompositeStandardLinkPlugin, a as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, S as StandardLink, b as StandardRPCJsonSerializer, c as StandardRPCLink, d as StandardRPCLinkCodec, e as StandardRPCSerializer, g as getMalformedResponseErrorCode, t as toHttpPath } from '../../shared/client.CQCGVpTM.mjs';
1
+ export { C as CompositeStandardLinkPlugin, a as STANDARD_RPC_JSON_SERIALIZER_BUILT_IN_TYPES, S as StandardLink, b as StandardRPCJsonSerializer, c as StandardRPCLink, d as StandardRPCLinkCodec, e as StandardRPCSerializer, g as getMalformedResponseErrorCode, t as toHttpPath } from '../../shared/client.DwfV9Oyl.mjs';
2
2
  import '@orpc/shared';
3
3
  import '@orpc/standard-server';
4
- import '../../shared/client.BX0_8bnM.mjs';
4
+ import '../../shared/client.DHOfWE0c.mjs';
@@ -1,8 +1,8 @@
1
+ import { readAsBuffer } from '@orpc/shared';
1
2
  import { ClientPeer } from '@orpc/standard-server-peer';
2
- import '@orpc/shared';
3
- import { c as StandardRPCLink } from '../../shared/client.CQCGVpTM.mjs';
3
+ import { c as StandardRPCLink } from '../../shared/client.DwfV9Oyl.mjs';
4
4
  import '@orpc/standard-server';
5
- import '../../shared/client.BX0_8bnM.mjs';
5
+ import '../../shared/client.DHOfWE0c.mjs';
6
6
 
7
7
  class experimental_LinkWebsocketClient {
8
8
  peer;
@@ -21,7 +21,7 @@ class experimental_LinkWebsocketClient {
21
21
  return options.websocket.send(message);
22
22
  });
23
23
  options.websocket.addEventListener("message", async (event) => {
24
- const message = event.data instanceof Blob ? await event.data.arrayBuffer() : event.data;
24
+ const message = event.data instanceof Blob ? await readAsBuffer(event.data) : event.data;
25
25
  this.peer.message(message);
26
26
  });
27
27
  options.websocket.addEventListener("close", () => {
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { i as isDefinedError } from './shared/client.BX0_8bnM.mjs';
2
- export { C as COMMON_ORPC_ERROR_DEFS, O as ORPCError, d as createORPCErrorFromJson, a as fallbackORPCErrorMessage, f as fallbackORPCErrorStatus, c as isORPCErrorJson, b as isORPCErrorStatus, m as mapEventIterator, t as toORPCError } from './shared/client.BX0_8bnM.mjs';
1
+ import { i as isDefinedError } from './shared/client.DHOfWE0c.mjs';
2
+ export { C as COMMON_ORPC_ERROR_DEFS, O as ORPCError, d as createORPCErrorFromJson, a as fallbackORPCErrorMessage, f as fallbackORPCErrorStatus, c as isORPCErrorJson, b as isORPCErrorStatus, m as mapEventIterator, t as toORPCError } from './shared/client.DHOfWE0c.mjs';
3
3
  export { EventPublisher, onError, onFinish, onStart, onSuccess } from '@orpc/shared';
4
4
  export { ErrorEvent } from '@orpc/standard-server';
5
5
 
@@ -142,30 +142,30 @@ function createORPCErrorFromJson(json, options = {}) {
142
142
 
143
143
  function mapEventIterator(iterator, maps) {
144
144
  return new AsyncIteratorClass(async () => {
145
- try {
146
- const { done, value } = await iterator.next();
147
- let mappedValue = await maps.value(value, done);
148
- if (mappedValue !== value) {
149
- const meta = getEventMeta(value);
150
- if (meta && isTypescriptObject(mappedValue)) {
151
- mappedValue = withEventMeta(mappedValue, meta);
145
+ const { done, value } = await (async () => {
146
+ try {
147
+ return await iterator.next();
148
+ } catch (error) {
149
+ let mappedError = await maps.error(error);
150
+ if (mappedError !== error) {
151
+ const meta = getEventMeta(error);
152
+ if (meta && isTypescriptObject(mappedError)) {
153
+ mappedError = withEventMeta(mappedError, meta);
154
+ }
152
155
  }
156
+ throw mappedError;
153
157
  }
154
- return { done, value: mappedValue };
155
- } catch (error) {
156
- let mappedError = await maps.error(error);
157
- if (mappedError !== error) {
158
- const meta = getEventMeta(error);
159
- if (meta && isTypescriptObject(mappedError)) {
160
- mappedError = withEventMeta(mappedError, meta);
161
- }
158
+ })();
159
+ let mappedValue = await maps.value(value, done);
160
+ if (mappedValue !== value) {
161
+ const meta = getEventMeta(value);
162
+ if (meta && isTypescriptObject(mappedValue)) {
163
+ mappedValue = withEventMeta(mappedValue, meta);
162
164
  }
163
- throw mappedError;
164
- }
165
- }, async (reason) => {
166
- if (reason !== "next") {
167
- await iterator.return?.();
168
165
  }
166
+ return { done, value: mappedValue };
167
+ }, async () => {
168
+ await iterator.return?.();
169
169
  });
170
170
  }
171
171
 
@@ -1,6 +1,6 @@
1
1
  import { toArray, intercept, isObject, value, isAsyncIteratorObject, stringifyJSON } from '@orpc/shared';
2
2
  import { mergeStandardHeaders, ErrorEvent } from '@orpc/standard-server';
3
- import { C as COMMON_ORPC_ERROR_DEFS, b as isORPCErrorStatus, c as isORPCErrorJson, d as createORPCErrorFromJson, O as ORPCError, m as mapEventIterator, t as toORPCError } from './client.BX0_8bnM.mjs';
3
+ import { C as COMMON_ORPC_ERROR_DEFS, b as isORPCErrorStatus, c as isORPCErrorJson, d as createORPCErrorFromJson, O as ORPCError, m as mapEventIterator, t as toORPCError } from './client.DHOfWE0c.mjs';
4
4
 
5
5
  class CompositeStandardLinkPlugin {
6
6
  plugins;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/client",
3
3
  "type": "module",
4
- "version": "0.0.0-next.de766b3",
4
+ "version": "0.0.0-next.de7ca70",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -49,13 +49,13 @@
49
49
  "dist"
50
50
  ],
51
51
  "dependencies": {
52
- "@orpc/shared": "0.0.0-next.de766b3",
53
- "@orpc/standard-server": "0.0.0-next.de766b3",
54
- "@orpc/standard-server-fetch": "0.0.0-next.de766b3",
55
- "@orpc/standard-server-peer": "0.0.0-next.de766b3"
52
+ "@orpc/standard-server": "0.0.0-next.de7ca70",
53
+ "@orpc/shared": "0.0.0-next.de7ca70",
54
+ "@orpc/standard-server-fetch": "0.0.0-next.de7ca70",
55
+ "@orpc/standard-server-peer": "0.0.0-next.de7ca70"
56
56
  },
57
57
  "devDependencies": {
58
- "zod": "^3.25.49"
58
+ "zod": "^3.25.76"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "unbuild",