@orpc/json-schema 0.0.0-next.ee5598c → 0.0.0-next.f01f7b1

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
@@ -1,5 +1,5 @@
1
1
  <div align="center">
2
- <image align="center" src="https://orpc.unnoq.com/logo.webp" width=280 alt="oRPC logo" />
2
+ <image align="center" src="https://orpc.dev/logo.webp" width=280 alt="oRPC logo" />
3
3
  </div>
4
4
 
5
5
  <h1></h1>
@@ -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>
@@ -30,7 +33,8 @@
30
33
  - **🔗 End-to-End Type Safety**: Ensure type-safe inputs, outputs, and errors from client to server.
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
- - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), Pinia Colada, and more.
36
+ - **🔍 First-Class OpenTelemetry**: Seamlessly integrate with OpenTelemetry for observability.
37
+ - **⚙️ Framework Integrations**: Seamlessly integrate with TanStack Query (React, Vue, Solid, Svelte, Angular), SWR, Pinia Colada, and more.
34
38
  - **🚀 Server Actions**: Fully compatible with React Server Actions on Next.js, TanStack Start, and other platforms.
35
39
  - **🔠 Standard Schema Support**: Works out of the box with Zod, Valibot, ArkType, and other schema validators.
36
40
  - **🗃️ Native Types**: Supports native types like Date, File, Blob, BigInt, URL, and more.
@@ -38,11 +42,10 @@
38
42
  - **📡 SSE & Streaming**: Enjoy full type-safe support for SSE and streaming.
39
43
  - **🌍 Multi-Runtime Support**: Fast and lightweight on Cloudflare, Deno, Bun, Node.js, and beyond.
40
44
  - **🔌 Extendability**: Easily extend functionality with plugins, middleware, and interceptors.
41
- - **🛡️ Reliability**: Well-tested, TypeScript-based, production-ready, and MIT licensed.
42
45
 
43
46
  ## Documentation
44
47
 
45
- You can find the full documentation [here](https://orpc.unnoq.com).
48
+ You can find the full documentation [here](https://orpc.dev).
46
49
 
47
50
  ## Packages
48
51
 
@@ -50,9 +53,11 @@ You can find the full documentation [here](https://orpc.unnoq.com).
50
53
  - [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
51
54
  - [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
52
55
  - [@orpc/openapi](https://www.npmjs.com/package/@orpc/openapi): Generate OpenAPI specs and handle OpenAPI requests.
56
+ - [@orpc/otel](https://www.npmjs.com/package/@orpc/otel): [OpenTelemetry](https://opentelemetry.io/) integration for observability.
53
57
  - [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with [NestJS](https://nestjs.com/).
54
58
  - [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
55
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.
56
61
  - [@orpc/vue-colada](https://www.npmjs.com/package/@orpc/vue-colada): Integration with [Pinia Colada](https://pinia-colada.esm.dev/).
57
62
  - [@orpc/hey-api](https://www.npmjs.com/package/@orpc/hey-api): [Hey API](https://heyapi.dev/) integration.
58
63
  - [@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
@@ -15,25 +15,25 @@ declare enum JsonSchemaXNativeType {
15
15
  Map = "map"
16
16
  }
17
17
 
18
- interface experimental_JsonSchemaCoerceOptions {
18
+ interface JsonSchemaCoerceOptions {
19
19
  components?: Record<string, JsonSchema>;
20
20
  }
21
- declare class experimental_JsonSchemaCoercer {
21
+ declare class JsonSchemaCoercer {
22
22
  #private;
23
- coerce(schema: JsonSchema, value: unknown, options?: experimental_JsonSchemaCoerceOptions): unknown;
23
+ coerce(schema: JsonSchema, value: unknown, options?: JsonSchemaCoerceOptions): unknown;
24
24
  }
25
25
 
26
- interface experimental_SmartCoercionPluginOptions {
26
+ interface SmartCoercionPluginOptions {
27
27
  schemaConverters?: readonly ConditionalSchemaConverter[];
28
28
  }
29
- declare class experimental_SmartCoercionPlugin<T extends Context> implements StandardHandlerPlugin<T> {
29
+ declare class SmartCoercionPlugin<T extends Context> implements StandardHandlerPlugin<T> {
30
30
  #private;
31
31
  private readonly converter;
32
32
  private readonly coercer;
33
33
  private readonly cache;
34
- constructor(options?: experimental_SmartCoercionPluginOptions);
34
+ constructor(options?: SmartCoercionPluginOptions);
35
35
  init(options: StandardHandlerOptions<T>): void;
36
36
  }
37
37
 
38
- export { JsonSchemaXNativeType, experimental_JsonSchemaCoercer, experimental_SmartCoercionPlugin };
39
- export type { JsonSchema, experimental_JsonSchemaCoerceOptions, experimental_SmartCoercionPluginOptions };
38
+ export { JsonSchemaCoercer, JsonSchemaXNativeType, SmartCoercionPlugin };
39
+ export type { JsonSchema, JsonSchemaCoerceOptions, SmartCoercionPluginOptions };
package/dist/index.d.ts CHANGED
@@ -15,25 +15,25 @@ declare enum JsonSchemaXNativeType {
15
15
  Map = "map"
16
16
  }
17
17
 
18
- interface experimental_JsonSchemaCoerceOptions {
18
+ interface JsonSchemaCoerceOptions {
19
19
  components?: Record<string, JsonSchema>;
20
20
  }
21
- declare class experimental_JsonSchemaCoercer {
21
+ declare class JsonSchemaCoercer {
22
22
  #private;
23
- coerce(schema: JsonSchema, value: unknown, options?: experimental_JsonSchemaCoerceOptions): unknown;
23
+ coerce(schema: JsonSchema, value: unknown, options?: JsonSchemaCoerceOptions): unknown;
24
24
  }
25
25
 
26
- interface experimental_SmartCoercionPluginOptions {
26
+ interface SmartCoercionPluginOptions {
27
27
  schemaConverters?: readonly ConditionalSchemaConverter[];
28
28
  }
29
- declare class experimental_SmartCoercionPlugin<T extends Context> implements StandardHandlerPlugin<T> {
29
+ declare class SmartCoercionPlugin<T extends Context> implements StandardHandlerPlugin<T> {
30
30
  #private;
31
31
  private readonly converter;
32
32
  private readonly coercer;
33
33
  private readonly cache;
34
- constructor(options?: experimental_SmartCoercionPluginOptions);
34
+ constructor(options?: SmartCoercionPluginOptions);
35
35
  init(options: StandardHandlerOptions<T>): void;
36
36
  }
37
37
 
38
- export { JsonSchemaXNativeType, experimental_JsonSchemaCoercer, experimental_SmartCoercionPlugin };
39
- export type { JsonSchema, experimental_JsonSchemaCoerceOptions, experimental_SmartCoercionPluginOptions };
38
+ export { JsonSchemaCoercer, JsonSchemaXNativeType, SmartCoercionPlugin };
39
+ export type { JsonSchema, JsonSchemaCoerceOptions, SmartCoercionPluginOptions };
package/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ var JsonSchemaXNativeType = /* @__PURE__ */ ((JsonSchemaXNativeType2) => {
12
12
  })(JsonSchemaXNativeType || {});
13
13
 
14
14
  const FLEXIBLE_DATE_FORMAT_REGEX = /^[^-]+-[^-]+-[^-]+$/;
15
- class experimental_JsonSchemaCoercer {
15
+ class JsonSchemaCoercer {
16
16
  coerce(schema, value, options = {}) {
17
17
  const [, coerced] = this.#coerce(schema, value, options);
18
18
  return coerced;
@@ -323,17 +323,21 @@ class experimental_JsonSchemaCoercer {
323
323
  if (value.some((item) => !Array.isArray(item) || item.length !== 2)) {
324
324
  return value;
325
325
  }
326
- return new Map(value);
326
+ const result = new Map(value);
327
+ if (result.size !== value.length) {
328
+ return value;
329
+ }
330
+ return result;
327
331
  }
328
332
  }
329
333
 
330
- class experimental_SmartCoercionPlugin {
334
+ class SmartCoercionPlugin {
331
335
  converter;
332
336
  coercer;
333
337
  cache = /* @__PURE__ */ new WeakMap();
334
338
  constructor(options = {}) {
335
339
  this.converter = new CompositeSchemaConverter(toArray(options.schemaConverters));
336
- this.coercer = new experimental_JsonSchemaCoercer();
340
+ this.coercer = new JsonSchemaCoercer();
337
341
  }
338
342
  init(options) {
339
343
  options.clientInterceptors ??= [];
@@ -356,4 +360,4 @@ class experimental_SmartCoercionPlugin {
356
360
  }
357
361
  }
358
362
 
359
- export { JsonSchemaXNativeType, experimental_JsonSchemaCoercer, experimental_SmartCoercionPlugin };
363
+ export { JsonSchemaCoercer, JsonSchemaXNativeType, SmartCoercionPlugin };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@orpc/json-schema",
3
3
  "type": "module",
4
- "version": "0.0.0-next.ee5598c",
4
+ "version": "0.0.0-next.f01f7b1",
5
5
  "license": "MIT",
6
- "homepage": "https://orpc.unnoq.com",
6
+ "homepage": "https://orpc.dev",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/unnoq/orpc.git",
@@ -24,14 +24,15 @@
24
24
  "dist"
25
25
  ],
26
26
  "dependencies": {
27
- "json-schema-typed": "^8.0.1",
28
- "@orpc/openapi": "0.0.0-next.ee5598c",
29
- "@orpc/shared": "0.0.0-next.ee5598c",
30
- "@orpc/contract": "0.0.0-next.ee5598c",
31
- "@orpc/server": "0.0.0-next.ee5598c"
27
+ "json-schema-typed": "^8.0.2",
28
+ "@orpc/contract": "0.0.0-next.f01f7b1",
29
+ "@orpc/interop": "0.0.0-next.f01f7b1",
30
+ "@orpc/openapi": "0.0.0-next.f01f7b1",
31
+ "@orpc/server": "0.0.0-next.f01f7b1",
32
+ "@orpc/shared": "0.0.0-next.f01f7b1"
32
33
  },
33
34
  "devDependencies": {
34
- "zod": "^3.25.74"
35
+ "zod": "^4.1.12"
35
36
  },
36
37
  "scripts": {
37
38
  "build": "unbuild",