@orpc/client 0.0.0-next.b2e67f7 → 0.0.0-next.b36125c

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.
@@ -165,8 +165,8 @@ function onEventIteratorStatusChange(iterator, callback, notifyImmediately = tru
165
165
  }
166
166
 
167
167
  // src/event-iterator.ts
168
- import { retry } from "@orpc/shared";
169
- import { getEventMeta, isEventMetaContainer, withEventMeta } from "@orpc/standard-server";
168
+ import { isTypescriptObject, retry } from "@orpc/shared";
169
+ import { getEventMeta, withEventMeta } from "@orpc/standard-server";
170
170
  function mapEventIterator(iterator, maps) {
171
171
  return async function* () {
172
172
  try {
@@ -175,7 +175,7 @@ function mapEventIterator(iterator, maps) {
175
175
  let mappedValue = await maps.value(value, done);
176
176
  if (mappedValue !== value) {
177
177
  const meta = getEventMeta(value);
178
- if (meta && isEventMetaContainer(mappedValue)) {
178
+ if (meta && isTypescriptObject(mappedValue)) {
179
179
  mappedValue = withEventMeta(mappedValue, meta);
180
180
  }
181
181
  }
@@ -188,7 +188,7 @@ function mapEventIterator(iterator, maps) {
188
188
  let mappedError = await maps.error(error);
189
189
  if (mappedError !== error) {
190
190
  const meta = getEventMeta(error);
191
- if (meta && isEventMetaContainer(mappedError)) {
191
+ if (meta && isTypescriptObject(mappedError)) {
192
192
  mappedError = withEventMeta(mappedError, meta);
193
193
  }
194
194
  }
@@ -278,4 +278,4 @@ export {
278
278
  mapEventIterator,
279
279
  createAutoRetryEventIterator
280
280
  };
281
- //# sourceMappingURL=chunk-X34KXUAJ.js.map
281
+ //# sourceMappingURL=chunk-7F3XVLRJ.js.map
@@ -2,7 +2,7 @@ import {
2
2
  ORPCError,
3
3
  mapEventIterator,
4
4
  toORPCError
5
- } from "./chunk-X34KXUAJ.js";
5
+ } from "./chunk-7F3XVLRJ.js";
6
6
 
7
7
  // src/rpc/json-serializer.ts
8
8
  import { isObject } from "@orpc/shared";
@@ -123,7 +123,8 @@ var RPCJsonSerializer = class {
123
123
  };
124
124
 
125
125
  // src/rpc/serializer.ts
126
- import { ErrorEvent, isAsyncIteratorObject } from "@orpc/standard-server";
126
+ import { isAsyncIteratorObject, stringifyJSON } from "@orpc/shared";
127
+ import { ErrorEvent } from "@orpc/standard-server";
127
128
  var RPCSerializer = class {
128
129
  constructor(jsonSerializer = new RPCJsonSerializer()) {
129
130
  this.jsonSerializer = jsonSerializer;
@@ -133,12 +134,6 @@ var RPCSerializer = class {
133
134
  return mapEventIterator(data, {
134
135
  value: async (value) => this.#serialize(value, false),
135
136
  error: async (e) => {
136
- if (e instanceof ErrorEvent) {
137
- return new ErrorEvent({
138
- data: this.#serialize(e.data, false),
139
- cause: e
140
- });
141
- }
142
137
  return new ErrorEvent({
143
138
  data: this.#serialize(toORPCError(e).toJSON(), false),
144
139
  cause: e
@@ -161,7 +156,7 @@ var RPCSerializer = class {
161
156
  };
162
157
  }
163
158
  const form = new FormData();
164
- form.set("data", JSON.stringify({ json, meta, maps }));
159
+ form.set("data", stringifyJSON({ json, meta, maps }));
165
160
  blobs.forEach((blob, i) => {
166
161
  form.set(i.toString(), blob);
167
162
  });
@@ -209,4 +204,4 @@ export {
209
204
  RPCJsonSerializer,
210
205
  RPCSerializer
211
206
  };
212
- //# sourceMappingURL=chunk-4HZVK3GJ.js.map
207
+ //# sourceMappingURL=chunk-I4MCMTJ2.js.map
package/dist/fetch.js CHANGED
@@ -1,14 +1,13 @@
1
1
  import {
2
2
  RPCSerializer
3
- } from "./chunk-4HZVK3GJ.js";
3
+ } from "./chunk-I4MCMTJ2.js";
4
4
  import {
5
5
  ORPCError,
6
6
  createAutoRetryEventIterator
7
- } from "./chunk-X34KXUAJ.js";
7
+ } from "./chunk-7F3XVLRJ.js";
8
8
 
9
9
  // src/adapters/fetch/rpc-link.ts
10
- import { trim, value } from "@orpc/shared";
11
- import { isAsyncIteratorObject } from "@orpc/standard-server";
10
+ import { isAsyncIteratorObject, stringifyJSON, trim, value } from "@orpc/shared";
12
11
  import { toFetchBody, toStandardBody } from "@orpc/standard-server-fetch";
13
12
  var InvalidEventSourceRetryResponse = class extends Error {
14
13
  };
@@ -103,7 +102,7 @@ var RPCLink = class {
103
102
  const serialized = this.rpcSerializer.serialize(input);
104
103
  if (expectedMethod === "GET" && !(serialized instanceof FormData) && !(serialized instanceof Blob) && !isAsyncIteratorObject(serialized)) {
105
104
  const getUrl = new URL(url);
106
- getUrl.searchParams.append("data", JSON.stringify(serialized) ?? "");
105
+ getUrl.searchParams.append("data", stringifyJSON(serialized) ?? "");
107
106
  if (getUrl.toString().length <= this.maxUrlLength) {
108
107
  return {
109
108
  body: void 0,
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  registerEventIteratorState,
11
11
  toORPCError,
12
12
  updateEventIteratorStatus
13
- } from "./chunk-X34KXUAJ.js";
13
+ } from "./chunk-7F3XVLRJ.js";
14
14
 
15
15
  // src/client.ts
16
16
  function createORPCClient(link, options) {
@@ -71,9 +71,13 @@ async function safe(promise) {
71
71
  );
72
72
  }
73
73
  }
74
+
75
+ // src/index.ts
76
+ import { ErrorEvent } from "@orpc/standard-server";
74
77
  export {
75
78
  COMMON_ORPC_ERROR_DEFS,
76
79
  DynamicLink,
80
+ ErrorEvent,
77
81
  ORPCError,
78
82
  createAutoRetryEventIterator,
79
83
  createORPCClient,
package/dist/openapi.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  ORPCError,
3
3
  mapEventIterator,
4
4
  toORPCError
5
- } from "./chunk-X34KXUAJ.js";
5
+ } from "./chunk-7F3XVLRJ.js";
6
6
 
7
7
  // src/openapi/bracket-notation.ts
8
8
  import { isObject } from "@orpc/shared";
@@ -161,7 +161,8 @@ var OpenAPIJsonSerializer = class {
161
161
  };
162
162
 
163
163
  // src/openapi/serializer.ts
164
- import { ErrorEvent, isAsyncIteratorObject } from "@orpc/standard-server";
164
+ import { isAsyncIteratorObject } from "@orpc/shared";
165
+ import { ErrorEvent } from "@orpc/standard-server";
165
166
  var OpenAPISerializer = class {
166
167
  constructor(jsonSerializer = new OpenAPIJsonSerializer(), bracketNotation = new BracketNotationSerializer()) {
167
168
  this.jsonSerializer = jsonSerializer;
@@ -172,12 +173,6 @@ var OpenAPISerializer = class {
172
173
  return mapEventIterator(data, {
173
174
  value: async (value) => this.#serialize(value, false),
174
175
  error: async (e) => {
175
- if (e instanceof ErrorEvent) {
176
- return new ErrorEvent({
177
- data: this.#serialize(e.data, false),
178
- cause: e
179
- });
180
- }
181
176
  return new ErrorEvent({
182
177
  data: this.#serialize(toORPCError(e).toJSON(), false),
183
178
  cause: e
package/dist/rpc.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  RPCJsonSerializer,
3
3
  RPCSerializer
4
- } from "./chunk-4HZVK3GJ.js";
5
- import "./chunk-X34KXUAJ.js";
4
+ } from "./chunk-I4MCMTJ2.js";
5
+ import "./chunk-7F3XVLRJ.js";
6
6
  export {
7
7
  RPCJsonSerializer,
8
8
  RPCSerializer
@@ -6,4 +6,5 @@ export * from './event-iterator';
6
6
  export * from './event-iterator-state';
7
7
  export * from './types';
8
8
  export * from './utils';
9
+ export { ErrorEvent } from '@orpc/standard-server';
9
10
  //# sourceMappingURL=index.d.ts.map
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.b2e67f7",
4
+ "version": "0.0.0-next.b36125c",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -44,9 +44,9 @@
44
44
  "dist"
45
45
  ],
46
46
  "dependencies": {
47
- "@orpc/standard-server-fetch": "0.0.0-next.b2e67f7",
48
- "@orpc/shared": "0.0.0-next.b2e67f7",
49
- "@orpc/standard-server": "0.0.0-next.b2e67f7"
47
+ "@orpc/standard-server": "0.0.0-next.b36125c",
48
+ "@orpc/shared": "0.0.0-next.b36125c",
49
+ "@orpc/standard-server-fetch": "0.0.0-next.b36125c"
50
50
  },
51
51
  "devDependencies": {
52
52
  "zod": "^3.24.1"