@orpc/valibot 1.2.0 → 1.4.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
@@ -49,6 +49,7 @@ You can find the full documentation [here](https://orpc.unnoq.com).
49
49
  - [@orpc/contract](https://www.npmjs.com/package/@orpc/contract): Build your API contract.
50
50
  - [@orpc/server](https://www.npmjs.com/package/@orpc/server): Build your API or implement API contract.
51
51
  - [@orpc/client](https://www.npmjs.com/package/@orpc/client): Consume your API on the client with type-safety.
52
+ - [@orpc/nest](https://www.npmjs.com/package/@orpc/nest): Deeply integrate oRPC with NestJS.
52
53
  - [@orpc/react](https://www.npmjs.com/package/@orpc/react): Utilities for integrating oRPC with React and React Server Actions.
53
54
  - [@orpc/react-query](https://www.npmjs.com/package/@orpc/react-query): Integration with [React Query](https://tanstack.com/query/latest/docs/framework/react/overview).
54
55
  - [@orpc/vue-query](https://www.npmjs.com/package/@orpc/vue-query): Integration with [Vue Query](https://tanstack.com/query/latest/docs/framework/vue/overview).
package/dist/index.d.mts CHANGED
@@ -2,13 +2,13 @@ import { AnySchema } from '@orpc/contract';
2
2
  import { ConditionalSchemaConverter, SchemaConvertOptions, JSONSchema } from '@orpc/openapi';
3
3
  import { ConversionConfig } from '@valibot/to-json-schema';
4
4
 
5
- interface experimental_ValibotToJsonSchemaConverterOptions extends Pick<ConversionConfig, 'errorMode'> {
5
+ interface experimental_ValibotToJsonSchemaConverterOptions extends Omit<ConversionConfig, 'typeMode'> {
6
6
  }
7
7
  declare class experimental_ValibotToJsonSchemaConverter implements ConditionalSchemaConverter {
8
- private readonly errorMode;
8
+ private readonly conversionConfig;
9
9
  constructor(options?: experimental_ValibotToJsonSchemaConverterOptions);
10
10
  condition(schema: AnySchema | undefined): boolean;
11
- convert(schema: AnySchema | undefined, _options: SchemaConvertOptions): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>];
11
+ convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>];
12
12
  }
13
13
 
14
14
  export { experimental_ValibotToJsonSchemaConverter };
package/dist/index.d.ts CHANGED
@@ -2,13 +2,13 @@ import { AnySchema } from '@orpc/contract';
2
2
  import { ConditionalSchemaConverter, SchemaConvertOptions, JSONSchema } from '@orpc/openapi';
3
3
  import { ConversionConfig } from '@valibot/to-json-schema';
4
4
 
5
- interface experimental_ValibotToJsonSchemaConverterOptions extends Pick<ConversionConfig, 'errorMode'> {
5
+ interface experimental_ValibotToJsonSchemaConverterOptions extends Omit<ConversionConfig, 'typeMode'> {
6
6
  }
7
7
  declare class experimental_ValibotToJsonSchemaConverter implements ConditionalSchemaConverter {
8
- private readonly errorMode;
8
+ private readonly conversionConfig;
9
9
  constructor(options?: experimental_ValibotToJsonSchemaConverterOptions);
10
10
  condition(schema: AnySchema | undefined): boolean;
11
- convert(schema: AnySchema | undefined, _options: SchemaConvertOptions): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>];
11
+ convert(schema: AnySchema | undefined, options: SchemaConvertOptions): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>];
12
12
  }
13
13
 
14
14
  export { experimental_ValibotToJsonSchemaConverter };
package/dist/index.mjs CHANGED
@@ -1,15 +1,21 @@
1
1
  import { toJsonSchema } from '@valibot/to-json-schema';
2
2
 
3
3
  class experimental_ValibotToJsonSchemaConverter {
4
- errorMode;
4
+ conversionConfig;
5
5
  constructor(options = {}) {
6
- this.errorMode = options.errorMode ?? "ignore";
6
+ this.conversionConfig = {
7
+ errorMode: "ignore",
8
+ ...options
9
+ };
7
10
  }
8
11
  condition(schema) {
9
12
  return schema !== void 0 && schema["~standard"].vendor === "valibot";
10
13
  }
11
- convert(schema, _options) {
12
- const jsonSchema = toJsonSchema(schema, { errorMode: this.errorMode });
14
+ convert(schema, options) {
15
+ const jsonSchema = toJsonSchema(schema, {
16
+ ...this.conversionConfig,
17
+ typeMode: options.strategy
18
+ });
13
19
  return [true, jsonSchema];
14
20
  }
15
21
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/valibot",
3
3
  "type": "module",
4
- "version": "1.2.0",
4
+ "version": "1.4.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.unnoq.com",
7
7
  "repository": {
@@ -24,13 +24,16 @@
24
24
  "dist"
25
25
  ],
26
26
  "peerDependencies": {
27
- "valibot": "^1.0.0",
28
- "@orpc/contract": "1.2.0",
29
- "@orpc/server": "1.2.0"
27
+ "valibot": ">=1.0.0",
28
+ "@orpc/contract": "1.4.0",
29
+ "@orpc/server": "1.4.0"
30
30
  },
31
31
  "dependencies": {
32
- "@valibot/to-json-schema": "^1.0.0",
33
- "@orpc/openapi": "1.2.0"
32
+ "@valibot/to-json-schema": "^1.3.0",
33
+ "@orpc/openapi": "1.4.0"
34
+ },
35
+ "devDependencies": {
36
+ "valibot": "^1.1.0"
34
37
  },
35
38
  "scripts": {
36
39
  "build": "unbuild",