@orpc/openapi-client 0.0.0-next.2fcf6dc → 0.0.0-next.32f3296

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.
@@ -1,27 +1,27 @@
1
1
  import { Segment } from '@orpc/shared';
2
2
 
3
- type BracketNotationSerialized = [string, unknown][];
4
- declare class BracketNotationSerializer {
5
- serialize(data: unknown, segments?: Segment[], result?: BracketNotationSerialized): BracketNotationSerialized;
6
- deserialize(serialized: BracketNotationSerialized): unknown;
3
+ type StandardBracketNotationSerialized = [string, unknown][];
4
+ declare class StandardBracketNotationSerializer {
5
+ serialize(data: unknown, segments?: Segment[], result?: StandardBracketNotationSerialized): StandardBracketNotationSerialized;
6
+ deserialize(serialized: StandardBracketNotationSerialized): Record<string, unknown> | unknown[];
7
7
  stringifyPath(segments: readonly Segment[]): string;
8
8
  parsePath(path: string): string[];
9
9
  }
10
10
 
11
- type OpenAPIJsonSerialized = [json: unknown, hasBlob: boolean];
12
- declare class OpenAPIJsonSerializer {
11
+ type StandardOpenAPIJsonSerialized = [json: unknown, hasBlob: boolean];
12
+ declare class StandardOpenAPIJsonSerializer {
13
13
  serialize(data: unknown, hasBlobRef?: {
14
14
  value: boolean;
15
- }): OpenAPIJsonSerialized;
15
+ }): StandardOpenAPIJsonSerialized;
16
16
  }
17
17
 
18
- declare class OpenAPISerializer {
18
+ declare class StandardOpenAPISerializer {
19
19
  #private;
20
20
  private readonly jsonSerializer;
21
21
  private readonly bracketNotation;
22
- constructor(jsonSerializer?: OpenAPIJsonSerializer, bracketNotation?: BracketNotationSerializer);
22
+ constructor(jsonSerializer: StandardOpenAPIJsonSerializer, bracketNotation: StandardBracketNotationSerializer);
23
23
  serialize(data: unknown): unknown;
24
24
  deserialize(data: unknown): unknown;
25
25
  }
26
26
 
27
- export { type BracketNotationSerialized, BracketNotationSerializer, type OpenAPIJsonSerialized, OpenAPIJsonSerializer, OpenAPISerializer };
27
+ export { type StandardBracketNotationSerialized, StandardBracketNotationSerializer, type StandardOpenAPIJsonSerialized, StandardOpenAPIJsonSerializer, StandardOpenAPISerializer };
@@ -1,27 +1,27 @@
1
1
  import { Segment } from '@orpc/shared';
2
2
 
3
- type BracketNotationSerialized = [string, unknown][];
4
- declare class BracketNotationSerializer {
5
- serialize(data: unknown, segments?: Segment[], result?: BracketNotationSerialized): BracketNotationSerialized;
6
- deserialize(serialized: BracketNotationSerialized): unknown;
3
+ type StandardBracketNotationSerialized = [string, unknown][];
4
+ declare class StandardBracketNotationSerializer {
5
+ serialize(data: unknown, segments?: Segment[], result?: StandardBracketNotationSerialized): StandardBracketNotationSerialized;
6
+ deserialize(serialized: StandardBracketNotationSerialized): Record<string, unknown> | unknown[];
7
7
  stringifyPath(segments: readonly Segment[]): string;
8
8
  parsePath(path: string): string[];
9
9
  }
10
10
 
11
- type OpenAPIJsonSerialized = [json: unknown, hasBlob: boolean];
12
- declare class OpenAPIJsonSerializer {
11
+ type StandardOpenAPIJsonSerialized = [json: unknown, hasBlob: boolean];
12
+ declare class StandardOpenAPIJsonSerializer {
13
13
  serialize(data: unknown, hasBlobRef?: {
14
14
  value: boolean;
15
- }): OpenAPIJsonSerialized;
15
+ }): StandardOpenAPIJsonSerialized;
16
16
  }
17
17
 
18
- declare class OpenAPISerializer {
18
+ declare class StandardOpenAPISerializer {
19
19
  #private;
20
20
  private readonly jsonSerializer;
21
21
  private readonly bracketNotation;
22
- constructor(jsonSerializer?: OpenAPIJsonSerializer, bracketNotation?: BracketNotationSerializer);
22
+ constructor(jsonSerializer: StandardOpenAPIJsonSerializer, bracketNotation: StandardBracketNotationSerializer);
23
23
  serialize(data: unknown): unknown;
24
24
  deserialize(data: unknown): unknown;
25
25
  }
26
26
 
27
- export { type BracketNotationSerialized, BracketNotationSerializer, type OpenAPIJsonSerialized, OpenAPIJsonSerializer, OpenAPISerializer };
27
+ export { type StandardBracketNotationSerialized, StandardBracketNotationSerializer, type StandardOpenAPIJsonSerialized, StandardOpenAPIJsonSerializer, StandardOpenAPISerializer };
@@ -2,7 +2,7 @@ import { isObject, isAsyncIteratorObject } from '@orpc/shared';
2
2
  import { mapEventIterator, toORPCError, ORPCError } from '@orpc/client';
3
3
  import { ErrorEvent } from '@orpc/standard-server';
4
4
 
5
- class BracketNotationSerializer {
5
+ class StandardBracketNotationSerializer {
6
6
  serialize(data, segments = [], result = []) {
7
7
  if (Array.isArray(data)) {
8
8
  data.forEach((item, i) => {
@@ -18,6 +18,9 @@ class BracketNotationSerializer {
18
18
  return result;
19
19
  }
20
20
  deserialize(serialized) {
21
+ if (serialized.length === 0) {
22
+ return {};
23
+ }
21
24
  const arrayPushStyles = /* @__PURE__ */ new WeakSet();
22
25
  const ref = { value: [] };
23
26
  for (const [path, value] of serialized) {
@@ -118,7 +121,7 @@ function isValidArrayIndex(value) {
118
121
  return /^0$|^[1-9]\d*$/.test(value);
119
122
  }
120
123
 
121
- class OpenAPIJsonSerializer {
124
+ class StandardOpenAPIJsonSerializer {
122
125
  serialize(data, hasBlobRef = { value: false }) {
123
126
  if (data instanceof Blob) {
124
127
  hasBlobRef.value = true;
@@ -154,8 +157,8 @@ class OpenAPIJsonSerializer {
154
157
  }
155
158
  }
156
159
 
157
- class OpenAPISerializer {
158
- constructor(jsonSerializer = new OpenAPIJsonSerializer(), bracketNotation = new BracketNotationSerializer()) {
160
+ class StandardOpenAPISerializer {
161
+ constructor(jsonSerializer, bracketNotation) {
159
162
  this.jsonSerializer = jsonSerializer;
160
163
  this.bracketNotation = bracketNotation;
161
164
  }
@@ -210,4 +213,4 @@ class OpenAPISerializer {
210
213
  }
211
214
  }
212
215
 
213
- export { BracketNotationSerializer, OpenAPIJsonSerializer, OpenAPISerializer };
216
+ export { StandardBracketNotationSerializer, StandardOpenAPIJsonSerializer, StandardOpenAPISerializer };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/openapi-client",
3
3
  "type": "module",
4
- "version": "0.0.0-next.2fcf6dc",
4
+ "version": "0.0.0-next.32f3296",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -29,9 +29,9 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@orpc/client": "0.0.0-next.2fcf6dc",
33
- "@orpc/shared": "0.0.0-next.2fcf6dc",
34
- "@orpc/standard-server": "0.0.0-next.2fcf6dc"
32
+ "@orpc/client": "0.0.0-next.32f3296",
33
+ "@orpc/shared": "0.0.0-next.32f3296",
34
+ "@orpc/standard-server": "0.0.0-next.32f3296"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "unbuild",