fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #2060 from hey-api/feat/plugin-valibot

fix(valibot): add valibot plugin

authored by

Lubos and committed by
GitHub
6f55225f 75af86e7

+4473 -132
+5
.changeset/three-lobsters-grow.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix(valibot): add valibot plugin
+4 -4
docs/.vitepress/config/en.ts
··· 95 95 collapsed: true, 96 96 items: [ 97 97 { 98 + link: '/openapi-ts/plugins/valibot', 99 + text: 'Valibot', 100 + }, 101 + { 98 102 link: '/openapi-ts/plugins/zod', 99 103 text: 'Zod', 100 104 }, ··· 117 121 { 118 122 link: '/openapi-ts/plugins/typebox', 119 123 text: 'TypeBox <span data-soon>soon</span>', 120 - }, 121 - { 122 - link: '/openapi-ts/plugins/valibot', 123 - text: 'Valibot <span data-soon>soon</span>', 124 124 }, 125 125 { 126 126 link: '/openapi-ts/plugins/yup',
+1 -1
docs/openapi-ts/plugins.md
··· 26 26 - [`@tanstack/svelte-query`](/openapi-ts/plugins/tanstack-query) 27 27 - [`@tanstack/vue-query`](/openapi-ts/plugins/tanstack-query) 28 28 - [`fastify`](/openapi-ts/plugins/fastify) 29 + - [`valibot`](/openapi-ts/plugins/valibot) 29 30 - [`zod`](/openapi-ts/plugins/zod) 30 31 31 32 ## Upcoming ··· 47 48 - [Supertest](/openapi-ts/plugins/supertest) <span data-soon>Soon</span> 48 49 - [SWR](/openapi-ts/plugins/swr) <span data-soon>Soon</span> 49 50 - [TypeBox](/openapi-ts/plugins/typebox) <span data-soon>Soon</span> 50 - - [Valibot](/openapi-ts/plugins/valibot) <span data-soon>Soon</span> 51 51 - [Yup](/openapi-ts/plugins/yup) <span data-soon>Soon</span> 52 52 - [Zustand](/openapi-ts/plugins/zustand) <span data-soon>Soon</span> 53 53
+62 -2
docs/openapi-ts/plugins/valibot.md
··· 3 3 description: Valibot plugin for Hey API. Compatible with all our features. 4 4 --- 5 5 6 - # Valibot <span data-soon>soon</span> 6 + # Valibot 7 7 8 8 ::: warning 9 - This feature isn't in development yet. Help us prioritize it by voting on [GitHub](https://github.com/hey-api/openapi-ts/issues/1474). 9 + This feature is in development! :tada: Try it out and provide feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues/1474). 10 10 ::: 11 11 12 12 ### About 13 13 14 14 [Valibot](https://valibot.dev) is the open source schema library for TypeScript with bundle size, type safety and developer experience in mind. 15 15 16 + <!-- ### Demo 17 + 18 + <button class="buttonLink" @click="(event) => embedProject('hey-api-client-fetch-plugin-valibot-example')(event)"> 19 + Launch demo 20 + </button> --> 21 + 22 + ## Features 23 + 24 + - seamless integration with `@hey-api/openapi-ts` ecosystem 25 + - Valibot schemas for requests, responses, and reusable components 26 + 27 + ## Installation 28 + 29 + In your [configuration](/openapi-ts/get-started), add `valibot` to your plugins and you'll be ready to generate Valibot artifacts. :tada: 30 + 31 + ```js 32 + import { defaultPlugins } from '@hey-api/openapi-ts'; 33 + 34 + export default { 35 + input: 'https://get.heyapi.dev/hey-api/backend', 36 + output: 'src/client', 37 + plugins: [ 38 + ...defaultPlugins, 39 + '@hey-api/client-fetch', 40 + 'valibot', // [!code ++] 41 + ], 42 + }; 43 + ``` 44 + 45 + ## SDKs 46 + 47 + To automatically validate response data in your SDKs, set `sdk.validator` to `true`. 48 + 49 + ```js 50 + import { defaultPlugins } from '@hey-api/openapi-ts'; 51 + 52 + export default { 53 + input: 'https://get.heyapi.dev/hey-api/backend', 54 + output: 'src/client', 55 + plugins: [ 56 + ...defaultPlugins, 57 + '@hey-api/client-fetch', 58 + 'valibot', 59 + { 60 + name: '@hey-api/sdk', // [!code ++] 61 + validator: true, // [!code ++] 62 + }, 63 + ], 64 + }; 65 + ``` 66 + 67 + ## Output 68 + 69 + The Valibot plugin will generate the following artifacts, depending on the input specification. 70 + 71 + ## Schemas 72 + 73 + More information will be provided as we finalize the plugin. 74 + 75 + <!--@include: ../../examples.md--> 16 76 <!--@include: ../../sponsors.md-->
+1 -1
docs/openapi-ts/validators.md
··· 13 13 14 14 Hey API natively supports the following validators. 15 15 16 + - [Valibot](/openapi-ts/plugins/valibot) 16 17 - [Zod](/openapi-ts/plugins/zod) 17 18 - [Ajv](/openapi-ts/plugins/ajv) <span data-soon>Soon</span> 18 19 - [Arktype](/openapi-ts/plugins/arktype) <span data-soon>Soon</span> 19 20 - [Joi](/openapi-ts/plugins/joi) <span data-soon>Soon</span> 20 21 - [TypeBox](/openapi-ts/plugins/typebox) <span data-soon>Soon</span> 21 - - [Valibot](/openapi-ts/plugins/valibot) <span data-soon>Soon</span> 22 22 - [Yup](/openapi-ts/plugins/yup) <span data-soon>Soon</span> 23 23 24 24 Don't see your validator? Let us know your interest by [opening an issue](https://github.com/hey-api/openapi-ts/issues).
+1
packages/openapi-ts-tests/package.json
··· 58 58 "ts-node": "10.9.2", 59 59 "tslib": "2.8.1", 60 60 "typescript": "5.8.3", 61 + "valibot": "1.1.0", 61 62 "vue": "3.5.13", 62 63 "zod": "3.23.8" 63 64 }
+3 -3
packages/openapi-ts-tests/test/3.0.x.test.ts
··· 419 419 config: createConfig({ 420 420 input: 'enum-null.json', 421 421 output: 'enum-null', 422 - plugins: ['@hey-api/typescript', 'zod'], 422 + plugins: ['@hey-api/typescript', 'valibot', 'zod'], 423 423 }), 424 424 description: 'handles null enums', 425 425 }, ··· 586 586 config: createConfig({ 587 587 input: 'validators.json', 588 588 output: 'validators', 589 - plugins: ['zod'], 589 + plugins: ['valibot', 'zod'], 590 590 }), 591 - description: 'generates Zod schemas', 591 + description: 'generates validator schemas', 592 592 }, 593 593 ]; 594 594
+20 -20
packages/openapi-ts-tests/test/3.1.x.test.ts
··· 433 433 config: createConfig({ 434 434 input: 'enum-null.json', 435 435 output: 'enum-null', 436 - plugins: ['@hey-api/typescript', 'zod'], 436 + plugins: ['@hey-api/typescript', 'valibot', 'zod'], 437 437 }), 438 438 description: 'handles null enums', 439 439 }, ··· 567 567 config: createConfig({ 568 568 input: 'schema-const.yaml', 569 569 output: 'schema-const', 570 - plugins: ['@hey-api/typescript', 'zod'], 570 + plugins: ['@hey-api/typescript', 'valibot', 'zod'], 571 571 }), 572 572 description: 'handles various constants', 573 573 }, ··· 684 684 config: createConfig({ 685 685 input: 'validators.json', 686 686 output: 'validators', 687 - plugins: ['zod'], 687 + plugins: ['valibot', 'zod'], 688 688 }), 689 - description: 'generates Zod schemas', 689 + description: 'generates validator schemas', 690 690 }, 691 691 { 692 692 config: createConfig({ 693 - input: 'zod-bigint-min-max.json', 694 - output: 'zod-bigint-min-max', 695 - plugins: ['zod'], 693 + input: 'validators-bigint-min-max.json', 694 + output: 'validators-bigint-min-max', 695 + plugins: ['valibot', 'zod'], 696 696 }), 697 - description: 'Zod schemas with BigInt and min/max constraints', 697 + description: 'validator schemas with BigInt and min/max constraints', 698 698 }, 699 699 { 700 700 config: createConfig({ 701 - input: 'zod-circular-ref.json', 702 - output: 'zod-circular-ref', 703 - plugins: ['zod'], 701 + input: 'validators-circular-ref.json', 702 + output: 'validators-circular-ref', 703 + plugins: ['valibot', 'zod'], 704 704 }), 705 - description: 'Zod schemas with circular reference', 705 + description: 'validator schemas with circular reference', 706 706 }, 707 707 { 708 708 config: createConfig({ 709 - input: 'zod-circular-ref-2.yaml', 710 - output: 'zod-circular-ref-2', 711 - plugins: ['zod'], 709 + input: 'validators-circular-ref-2.yaml', 710 + output: 'validators-circular-ref-2', 711 + plugins: ['valibot', 'zod'], 712 712 }), 713 - description: 'Zod schemas with circular reference 2', 713 + description: 'validator schemas with circular reference 2', 714 714 }, 715 715 { 716 716 config: createConfig({ 717 - input: 'zod-union-merge.json', 718 - output: 'zod-union-merge', 719 - plugins: ['zod'], 717 + input: 'validators-union-merge.json', 718 + output: 'validators-union-merge', 719 + plugins: ['valibot', 'zod'], 720 720 }), 721 - description: "Zod schemas with merged unions (can't use .merge())", 721 + description: "validator schemas with merged unions (can't use .merge())", 722 722 }, 723 723 ]; 724 724
+16
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/client.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { ClientOptions } from './types.gen'; 4 + import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; 5 + 6 + /** 7 + * The `createClientConfig()` function will be called on client initialization 8 + * and the returned object will become the client's initial configuration. 9 + * 10 + * You may want to initialize your client this way instead of calling 11 + * `setConfig()`. This is useful for example if you're using Next.js 12 + * to ensure your client always has the correct values. 13 + */ 14 + export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>; 15 + 16 + export const client = createClient(createConfig<ClientOptions>());
+3
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + export * from './types.gen'; 3 + export * from './sdk.gen';
+33
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/sdk.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; 4 + import type { PostFooData, PostFooResponse } from './types.gen'; 5 + import { postFooResponseTransformer } from './transformers.gen'; 6 + import { vPostFooResponse } from './valibot.gen'; 7 + import * as v from 'valibot'; 8 + import { client as _heyApiClient } from './client.gen'; 9 + 10 + export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & { 11 + /** 12 + * You can provide a client instance returned by `createClient()` instead of 13 + * individual options. This might be also useful if you want to implement a 14 + * custom client. 15 + */ 16 + client?: Client; 17 + /** 18 + * You can pass arbitrary values through the `meta` object. This can be 19 + * used to access values that aren't defined as part of the SDK function. 20 + */ 21 + meta?: Record<string, unknown>; 22 + }; 23 + 24 + export const postFoo = <ThrowOnError extends boolean = false>(options?: Options<PostFooData, ThrowOnError>) => { 25 + return (options?.client ?? _heyApiClient).post<PostFooResponse, unknown, ThrowOnError>({ 26 + responseTransformer: postFooResponseTransformer, 27 + responseValidator: async (data) => { 28 + return await v.parseAsync(vPostFooResponse, data); 29 + }, 30 + url: '/foo', 31 + ...options 32 + }); 33 + };
+13
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/transformers.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { PostFooResponse } from './types.gen'; 4 + 5 + const fooSchemaResponseTransformer = (data: any) => { 6 + data.foo = BigInt(data.foo.toString()); 7 + return data; 8 + }; 9 + 10 + export const postFooResponseTransformer = async (data: any): Promise<PostFooResponse> => { 11 + data = fooSchemaResponseTransformer(data); 12 + return data; 13 + };
+15
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vFoo = v.object({ 6 + bar: v.optional(v.pipe(v.number(), v.integer())), 7 + foo: v.bigint(), 8 + id: v.string() 9 + }); 10 + 11 + export const vBar = v.object({ 12 + foo: v.pipe(v.number(), v.integer()) 13 + }); 14 + 15 + export const vPostFooResponse = vFoo;
+32
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type Foo = { 4 + bar?: number; 5 + foo: bigint; 6 + id: string; 7 + }; 8 + 9 + export type Bar = { 10 + foo: number; 11 + [key: string]: number; 12 + }; 13 + 14 + export type PostFooData = { 15 + body?: never; 16 + path?: never; 17 + query?: never; 18 + url: '/foo'; 19 + }; 20 + 21 + export type PostFooResponses = { 22 + /** 23 + * OK 24 + */ 25 + 200: Foo; 26 + }; 27 + 28 + export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 + 30 + export type ClientOptions = { 31 + baseUrl: string; 32 + };
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/client.gen.ts
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format/index.ts packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/index.ts
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/sdk.gen.ts
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/transformers.gen.ts
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-valibot/types.gen.ts
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/transformers/type-format-zod/zod.gen.ts
+278
packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/valibot/default/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vCommentWithBreaks = v.pipe(v.number(), v.integer()); 6 + 7 + export const vCommentWithBackticks = v.pipe(v.number(), v.integer()); 8 + 9 + export const vCommentWithBackticksAndQuotes = v.pipe(v.number(), v.integer()); 10 + 11 + export const vCommentWithSlashes = v.pipe(v.number(), v.integer()); 12 + 13 + export const vCommentWithExpressionPlaceholders = v.pipe(v.number(), v.integer()); 14 + 15 + export const vCommentWithQuotes = v.pipe(v.number(), v.integer()); 16 + 17 + export const vCommentWithReservedCharacters = v.pipe(v.number(), v.integer()); 18 + 19 + export const vSimpleInteger = v.pipe(v.number(), v.integer()); 20 + 21 + export const vSimpleBoolean = v.boolean(); 22 + 23 + export const vSimpleString = v.string(); 24 + 25 + export const vNonAsciiStringæøåÆøÅöôêÊ字符串 = v.string(); 26 + 27 + export const vSimpleFile = v.string(); 28 + 29 + export const vModelWithString = v.object({ 30 + prop: v.optional(v.string()) 31 + }); 32 + 33 + export const vSimpleReference = vModelWithString; 34 + 35 + export const vSimpleStringWithPattern = v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)); 36 + 37 + export const vEnumWithStrings = v.picklist([ 38 + 'Success', 39 + 'Warning', 40 + 'Error', 41 + "'Single Quote'", 42 + '"Double Quotes"', 43 + 'Non-ascii: øæåôöØÆÅÔÖ字符串' 44 + ]); 45 + 46 + export const vEnumWithNumbers = v.unknown(); 47 + 48 + export const vEnumFromDescription = v.number(); 49 + 50 + export const vEnumWithExtensions = v.unknown(); 51 + 52 + export const vArrayWithNumbers = v.array(v.pipe(v.number(), v.integer())); 53 + 54 + export const vArrayWithBooleans = v.array(v.boolean()); 55 + 56 + export const vArrayWithStrings = v.array(v.string()); 57 + 58 + export const vArrayWithReferences = v.array(vModelWithString); 59 + 60 + export const vArrayWithArray = v.array(v.array(vModelWithString)); 61 + 62 + export const vArrayWithProperties = v.array(v.object({ 63 + foo: v.optional(v.string()), 64 + bar: v.optional(v.string()) 65 + })); 66 + 67 + export const vDictionaryWithString = v.object({}); 68 + 69 + export const vDictionaryWithReference = v.object({}); 70 + 71 + export const vDictionaryWithArray = v.object({}); 72 + 73 + export const vDictionaryWithDictionary = v.object({}); 74 + 75 + export const vDictionaryWithProperties = v.object({}); 76 + 77 + export const vDate = v.string(); 78 + 79 + export const vModelWithInteger = v.object({ 80 + prop: v.optional(v.pipe(v.number(), v.integer())) 81 + }); 82 + 83 + export const vModelWithBoolean = v.object({ 84 + prop: v.optional(v.boolean()) 85 + }); 86 + 87 + export const vModelWithStringError = v.object({ 88 + prop: v.optional(v.string()) 89 + }); 90 + 91 + export const vModelWithNullableString = v.object({ 92 + nullableProp: v.optional(v.union([ 93 + v.string(), 94 + v.null() 95 + ])), 96 + nullableRequiredProp: v.union([ 97 + v.string(), 98 + v.null() 99 + ]) 100 + }); 101 + 102 + export const vModelWithEnum = v.object({ 103 + test: v.optional(v.picklist([ 104 + 'Success', 105 + 'Warning', 106 + 'Error', 107 + 'ØÆÅ字符串' 108 + ])), 109 + statusCode: v.optional(v.picklist([ 110 + '100', 111 + '200 FOO', 112 + '300 FOO_BAR', 113 + '400 foo-bar', 114 + '500 foo.bar', 115 + '600 foo&bar' 116 + ])), 117 + bool: v.optional(v.unknown()) 118 + }); 119 + 120 + export const vModelWithEnumFromDescription = v.object({ 121 + test: v.optional(v.pipe(v.number(), v.integer())) 122 + }); 123 + 124 + export const vModelWithNestedEnums = v.object({ 125 + dictionaryWithEnum: v.optional(v.object({})), 126 + dictionaryWithEnumFromDescription: v.optional(v.object({})), 127 + arrayWithEnum: v.optional(v.array(v.picklist([ 128 + 'Success', 129 + 'Warning', 130 + 'Error' 131 + ]))), 132 + arrayWithDescription: v.optional(v.array(v.pipe(v.number(), v.integer()))) 133 + }); 134 + 135 + export const vModelWithProperties = v.object({ 136 + required: v.string(), 137 + requiredAndReadOnly: v.pipe(v.string(), v.readonly()), 138 + string: v.optional(v.string()), 139 + number: v.optional(v.number()), 140 + boolean: v.optional(v.boolean()), 141 + reference: v.optional(vModelWithString), 142 + 'property with space': v.optional(v.string()), 143 + default: v.optional(v.string()), 144 + try: v.optional(v.string()), 145 + '@namespace.string': v.optional(v.pipe(v.string(), v.readonly())), 146 + '@namespace.integer': v.optional(v.pipe(v.pipe(v.number(), v.integer()), v.readonly())) 147 + }); 148 + 149 + export const vModelWithReference = v.object({ 150 + prop: v.optional(vModelWithProperties) 151 + }); 152 + 153 + export const vModelWithArray = v.object({ 154 + prop: v.optional(v.array(vModelWithString)), 155 + propWithFile: v.optional(v.array(v.string())), 156 + propWithNumber: v.optional(v.array(v.number())) 157 + }); 158 + 159 + export const vModelWithDictionary = v.object({ 160 + prop: v.optional(v.object({})) 161 + }); 162 + 163 + export const vModelWithCircularReference: v.GenericSchema = v.object({ 164 + prop: v.optional(v.lazy(() => { 165 + return vModelWithCircularReference; 166 + })) 167 + }); 168 + 169 + export const vModelWithNestedProperties = v.object({ 170 + first: v.pipe(v.object({ 171 + second: v.pipe(v.object({ 172 + third: v.pipe(v.string(), v.readonly()) 173 + }), v.readonly()) 174 + }), v.readonly()) 175 + }); 176 + 177 + export const vModelWithDuplicateProperties = v.object({ 178 + prop: v.optional(vModelWithString) 179 + }); 180 + 181 + export const vModelWithOrderedProperties = v.object({ 182 + zebra: v.optional(v.string()), 183 + apple: v.optional(v.string()), 184 + hawaii: v.optional(v.string()) 185 + }); 186 + 187 + export const vModelWithDuplicateImports = v.object({ 188 + propA: v.optional(vModelWithString), 189 + propB: v.optional(vModelWithString), 190 + propC: v.optional(vModelWithString) 191 + }); 192 + 193 + export const vModelThatExtends = v.intersect([ 194 + vModelWithString, 195 + v.object({ 196 + propExtendsA: v.optional(v.string()), 197 + propExtendsB: v.optional(vModelWithString) 198 + }) 199 + ]); 200 + 201 + export const vModelThatExtendsExtends = v.intersect([ 202 + vModelWithString, 203 + vModelThatExtends, 204 + v.object({ 205 + propExtendsC: v.optional(v.string()), 206 + propExtendsD: v.optional(vModelWithString) 207 + }) 208 + ]); 209 + 210 + export const vDefault = v.object({ 211 + name: v.optional(v.string()) 212 + }); 213 + 214 + export const vModelWithPattern = v.object({ 215 + key: v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)), 216 + name: v.pipe(v.string(), v.maxLength(255)), 217 + enabled: v.optional(v.pipe(v.boolean(), v.readonly())), 218 + modified: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())), 219 + id: v.optional(v.pipe(v.string(), v.regex(/^\d{2}-\d{3}-\d{4}$/))), 220 + text: v.optional(v.pipe(v.string(), v.regex(/^\w+$/))), 221 + patternWithSingleQuotes: v.optional(v.pipe(v.string(), v.regex(/^[a-zA-Z0-9']*$/))), 222 + patternWithNewline: v.optional(v.pipe(v.string(), v.regex(/aaa\nbbb/))), 223 + patternWithBacktick: v.optional(v.pipe(v.string(), v.regex(/aaa`bbb/))) 224 + }); 225 + 226 + export const vParameterActivityParams = v.object({ 227 + description: v.optional(v.string()), 228 + graduate_id: v.optional(v.pipe(v.number(), v.integer())), 229 + organization_id: v.optional(v.pipe(v.number(), v.integer())), 230 + parent_activity: v.optional(v.pipe(v.number(), v.integer())), 231 + post_id: v.optional(v.pipe(v.number(), v.integer())) 232 + }); 233 + 234 + export const vResponsePostActivityResponse = v.object({ 235 + description: v.optional(v.string()), 236 + graduate_id: v.optional(v.pipe(v.number(), v.integer())), 237 + organization_id: v.optional(v.pipe(v.number(), v.integer())), 238 + parent_activity_id: v.optional(v.pipe(v.number(), v.integer())), 239 + post_id: v.optional(v.pipe(v.number(), v.integer())) 240 + }); 241 + 242 + export const vFailureFailure = v.object({ 243 + error: v.optional(v.string()), 244 + message: v.optional(v.string()), 245 + reference_code: v.optional(v.string()) 246 + }); 247 + 248 + export const vCallWithResponseAndNoContentResponseResponse = v.union([ 249 + v.number(), 250 + v.unknown() 251 + ]); 252 + 253 + export const vCallWithResponseResponse = vModelWithString; 254 + 255 + export const vCallWithDuplicateResponsesResponse = vModelWithString; 256 + 257 + export const vCallWithResponsesResponse = v.union([ 258 + v.object({ 259 + '@namespace.string': v.optional(v.pipe(v.string(), v.readonly())), 260 + '@namespace.integer': v.optional(v.pipe(v.pipe(v.number(), v.integer()), v.readonly())), 261 + value: v.optional(v.pipe(v.array(vModelWithString), v.readonly())) 262 + }), 263 + vModelThatExtends, 264 + vModelThatExtendsExtends 265 + ]); 266 + 267 + export const vTypesResponse = v.union([ 268 + v.number(), 269 + v.string(), 270 + v.boolean(), 271 + v.object({}) 272 + ]); 273 + 274 + export const vComplexTypesResponse = v.array(vModelWithString); 275 + 276 + export const vNonAsciiæøåÆøÅöôêÊ字符串Response = vNonAsciiStringæøåÆøÅöôêÊ字符串; 277 + 278 + export const vPostApiVbyApiVersionBodyResponse = vResponsePostActivityResponse;
+18
packages/openapi-ts-tests/test/__snapshots__/3.0.x/enum-null/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vFoo = v.nullable(v.picklist([ 6 + 'foo', 7 + 'bar' 8 + ])); 9 + 10 + export const vBar = v.picklist([ 11 + 'foo', 12 + 'bar' 13 + ]); 14 + 15 + export const vBaz = v.picklist([ 16 + 'foo', 17 + 'bar' 18 + ]);
+16
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/client.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { ClientOptions } from './types.gen'; 4 + import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; 5 + 6 + /** 7 + * The `createClientConfig()` function will be called on client initialization 8 + * and the returned object will become the client's initial configuration. 9 + * 10 + * You may want to initialize your client this way instead of calling 11 + * `setConfig()`. This is useful for example if you're using Next.js 12 + * to ensure your client always has the correct values. 13 + */ 14 + export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>; 15 + 16 + export const client = createClient(createConfig<ClientOptions>());
+3
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + export * from './types.gen'; 3 + export * from './sdk.gen';
+33
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/sdk.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; 4 + import type { PostFooData, PostFooResponse } from './types.gen'; 5 + import { postFooResponseTransformer } from './transformers.gen'; 6 + import { vPostFooResponse } from './valibot.gen'; 7 + import * as v from 'valibot'; 8 + import { client as _heyApiClient } from './client.gen'; 9 + 10 + export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & { 11 + /** 12 + * You can provide a client instance returned by `createClient()` instead of 13 + * individual options. This might be also useful if you want to implement a 14 + * custom client. 15 + */ 16 + client?: Client; 17 + /** 18 + * You can pass arbitrary values through the `meta` object. This can be 19 + * used to access values that aren't defined as part of the SDK function. 20 + */ 21 + meta?: Record<string, unknown>; 22 + }; 23 + 24 + export const postFoo = <ThrowOnError extends boolean = false>(options?: Options<PostFooData, ThrowOnError>) => { 25 + return (options?.client ?? _heyApiClient).post<PostFooResponse, unknown, ThrowOnError>({ 26 + responseTransformer: postFooResponseTransformer, 27 + responseValidator: async (data) => { 28 + return await v.parseAsync(vPostFooResponse, data); 29 + }, 30 + url: '/foo', 31 + ...options 32 + }); 33 + };
+13
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/transformers.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { PostFooResponse } from './types.gen'; 4 + 5 + const fooSchemaResponseTransformer = (data: any) => { 6 + data.foo = BigInt(data.foo.toString()); 7 + return data; 8 + }; 9 + 10 + export const postFooResponseTransformer = async (data: any): Promise<PostFooResponse> => { 11 + data = fooSchemaResponseTransformer(data); 12 + return data; 13 + };
+32
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type Foo = { 4 + bar?: number; 5 + foo: bigint; 6 + id: string; 7 + }; 8 + 9 + export type Bar = { 10 + foo: number; 11 + [key: string]: number; 12 + }; 13 + 14 + export type PostFooData = { 15 + body?: never; 16 + path?: never; 17 + query?: never; 18 + url: '/foo'; 19 + }; 20 + 21 + export type PostFooResponses = { 22 + /** 23 + * OK 24 + */ 25 + 200: Foo; 26 + }; 27 + 28 + export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 + 30 + export type ClientOptions = { 31 + baseUrl: `${string}://${string}` | (string & {}); 32 + };
+15
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-valibot/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vFoo = v.object({ 6 + bar: v.optional(v.pipe(v.number(), v.integer())), 7 + foo: v.bigint(), 8 + id: v.string() 9 + }); 10 + 11 + export const vBar = v.object({ 12 + foo: v.pipe(v.number(), v.integer()) 13 + }); 14 + 15 + export const vPostFooResponse = vFoo;
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format/client.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/client.gen.ts
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format/index.ts packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/index.ts
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/sdk.gen.ts
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/transformers.gen.ts
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format/types.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/types.gen.ts
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format/zod.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/@hey-api/transformers/type-format-zod/zod.gen.ts
+852
packages/openapi-ts-tests/test/__snapshots__/3.0.x/plugins/valibot/default/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const v400 = v.string(); 6 + 7 + export const vCamelCaseCommentWithBreaks = v.pipe(v.number(), v.integer()); 8 + 9 + export const vCommentWithBreaks = v.pipe(v.number(), v.integer()); 10 + 11 + export const vCommentWithBackticks = v.pipe(v.number(), v.integer()); 12 + 13 + export const vCommentWithBackticksAndQuotes = v.pipe(v.number(), v.integer()); 14 + 15 + export const vCommentWithSlashes = v.pipe(v.number(), v.integer()); 16 + 17 + export const vCommentWithExpressionPlaceholders = v.pipe(v.number(), v.integer()); 18 + 19 + export const vCommentWithQuotes = v.pipe(v.number(), v.integer()); 20 + 21 + export const vCommentWithReservedCharacters = v.pipe(v.number(), v.integer()); 22 + 23 + export const vSimpleInteger = v.pipe(v.number(), v.integer()); 24 + 25 + export const vSimpleBoolean = v.boolean(); 26 + 27 + export const vSimpleString = v.string(); 28 + 29 + export const vNonAsciiStringæøåÆøÅöôêÊ字符串 = v.string(); 30 + 31 + export const vSimpleFile = v.string(); 32 + 33 + export const vModelWithString = v.object({ 34 + prop: v.optional(v.string()) 35 + }); 36 + 37 + export const vSimpleReference = vModelWithString; 38 + 39 + export const vSimpleStringWithPattern = v.union([ 40 + v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)), 41 + v.null() 42 + ]); 43 + 44 + export const vEnumWithStrings = v.picklist([ 45 + 'Success', 46 + 'Warning', 47 + 'Error', 48 + "'Single Quote'", 49 + '"Double Quotes"', 50 + 'Non-ascii: øæåôöØÆÅÔÖ字符串' 51 + ]); 52 + 53 + export const vEnumWithReplacedCharacters = v.picklist([ 54 + "'Single Quote'", 55 + '"Double Quotes"', 56 + 'øæåôöØÆÅÔÖ字符串', 57 + '' 58 + ]); 59 + 60 + export const vEnumWithNumbers = v.unknown(); 61 + 62 + export const vEnumFromDescription = v.number(); 63 + 64 + export const vEnumWithExtensions = v.unknown(); 65 + 66 + export const vEnumWithXEnumNames = v.unknown(); 67 + 68 + export const vArrayWithNumbers = v.array(v.pipe(v.number(), v.integer())); 69 + 70 + export const vArrayWithBooleans = v.array(v.boolean()); 71 + 72 + export const vArrayWithStrings = v.optional(v.array(v.string()), ['test']); 73 + 74 + export const vArrayWithReferences = v.array(vModelWithString); 75 + 76 + export const vArrayWithArray = v.array(v.array(vModelWithString)); 77 + 78 + export const vArrayWithProperties = v.array(v.object({ 79 + '16x16': v.optional(vCamelCaseCommentWithBreaks), 80 + bar: v.optional(v.string()) 81 + })); 82 + 83 + export const vArrayWithAnyOfProperties = v.array(v.unknown()); 84 + 85 + export const vAnyOfAnyAndNull = v.object({ 86 + data: v.optional(v.unknown()) 87 + }); 88 + 89 + export const vAnyOfArrays = v.object({ 90 + results: v.optional(v.array(v.unknown())) 91 + }); 92 + 93 + export const vDictionaryWithString = v.object({}); 94 + 95 + export const vDictionaryWithPropertiesAndAdditionalProperties = v.object({ 96 + foo: v.optional(v.number()), 97 + bar: v.optional(v.boolean()) 98 + }); 99 + 100 + export const vDictionaryWithReference = v.object({}); 101 + 102 + export const vDictionaryWithArray = v.object({}); 103 + 104 + export const vDictionaryWithDictionary = v.object({}); 105 + 106 + export const vDictionaryWithProperties = v.object({}); 107 + 108 + export const vModelWithInteger = v.object({ 109 + prop: v.optional(v.pipe(v.number(), v.integer())) 110 + }); 111 + 112 + export const vModelWithBoolean = v.object({ 113 + prop: v.optional(v.boolean()) 114 + }); 115 + 116 + export const vModelWithStringError = v.object({ 117 + prop: v.optional(v.string()) 118 + }); 119 + 120 + export const vModelFromZendesk = v.string(); 121 + 122 + export const vModelWithNullableString = v.object({ 123 + nullableProp1: v.optional(v.union([ 124 + v.string(), 125 + v.null() 126 + ])), 127 + nullableRequiredProp1: v.union([ 128 + v.string(), 129 + v.null() 130 + ]), 131 + nullableProp2: v.optional(v.union([ 132 + v.string(), 133 + v.null() 134 + ])), 135 + nullableRequiredProp2: v.union([ 136 + v.string(), 137 + v.null() 138 + ]), 139 + 'foo_bar-enum': v.optional(v.picklist([ 140 + 'Success', 141 + 'Warning', 142 + 'Error', 143 + 'ØÆÅ字符串' 144 + ])) 145 + }); 146 + 147 + export const vModelWithEnum = v.object({ 148 + 'foo_bar-enum': v.optional(v.picklist([ 149 + 'Success', 150 + 'Warning', 151 + 'Error', 152 + 'ØÆÅ字符串' 153 + ])), 154 + statusCode: v.optional(v.picklist([ 155 + '100', 156 + '200 FOO', 157 + '300 FOO_BAR', 158 + '400 foo-bar', 159 + '500 foo.bar', 160 + '600 foo&bar' 161 + ])), 162 + bool: v.optional(v.unknown()) 163 + }); 164 + 165 + export const vModelWithEnumWithHyphen = v.object({ 166 + 'foo-bar-baz-qux': v.optional(v.picklist([ 167 + '3.0' 168 + ])) 169 + }); 170 + 171 + export const vModelWithEnumFromDescription = v.object({ 172 + test: v.optional(v.pipe(v.number(), v.integer())) 173 + }); 174 + 175 + export const vModelWithNestedEnums = v.object({ 176 + dictionaryWithEnum: v.optional(v.object({})), 177 + dictionaryWithEnumFromDescription: v.optional(v.object({})), 178 + arrayWithEnum: v.optional(v.array(v.picklist([ 179 + 'Success', 180 + 'Warning', 181 + 'Error' 182 + ]))), 183 + arrayWithDescription: v.optional(v.array(v.pipe(v.number(), v.integer()))), 184 + 'foo_bar-enum': v.optional(v.picklist([ 185 + 'Success', 186 + 'Warning', 187 + 'Error', 188 + 'ØÆÅ字符串' 189 + ])) 190 + }); 191 + 192 + export const vModelWithProperties = v.object({ 193 + required: v.string(), 194 + requiredAndReadOnly: v.pipe(v.string(), v.readonly()), 195 + requiredAndNullable: v.union([ 196 + v.string(), 197 + v.null() 198 + ]), 199 + string: v.optional(v.string()), 200 + number: v.optional(v.number()), 201 + boolean: v.optional(v.boolean()), 202 + reference: v.optional(vModelWithString), 203 + 'property with space': v.optional(v.string()), 204 + default: v.optional(v.string()), 205 + try: v.optional(v.string()), 206 + '@namespace.string': v.optional(v.pipe(v.string(), v.readonly())), 207 + '@namespace.integer': v.optional(v.pipe(v.pipe(v.number(), v.integer()), v.readonly())) 208 + }); 209 + 210 + export const vModelWithReference = v.object({ 211 + prop: v.optional(vModelWithProperties) 212 + }); 213 + 214 + export const vModelWithReadOnlyAndWriteOnly = v.object({ 215 + foo: v.string(), 216 + bar: v.pipe(v.string(), v.readonly()), 217 + baz: v.string() 218 + }); 219 + 220 + export const vModelWithArrayReadOnlyAndWriteOnly = v.object({ 221 + prop: v.optional(v.array(vModelWithReadOnlyAndWriteOnly)), 222 + propWithFile: v.optional(v.array(v.string())), 223 + propWithNumber: v.optional(v.array(v.number())) 224 + }); 225 + 226 + export const vModelWithArray = v.object({ 227 + prop: v.optional(v.array(vModelWithString)), 228 + propWithFile: v.optional(v.array(v.string())), 229 + propWithNumber: v.optional(v.array(v.number())) 230 + }); 231 + 232 + export const vModelWithDictionary = v.object({ 233 + prop: v.optional(v.object({})) 234 + }); 235 + 236 + export const vDeprecatedModel = v.object({ 237 + prop: v.optional(v.string()) 238 + }); 239 + 240 + export const vModelWithCircularReference: v.GenericSchema = v.object({ 241 + prop: v.optional(v.lazy(() => { 242 + return vModelWithCircularReference; 243 + })) 244 + }); 245 + 246 + export const vCompositionWithOneOf = v.object({ 247 + propA: v.optional(v.union([ 248 + vModelWithString, 249 + vModelWithEnum, 250 + vModelWithArray, 251 + vModelWithDictionary 252 + ])) 253 + }); 254 + 255 + export const vCompositionWithOneOfAnonymous = v.object({ 256 + propA: v.optional(v.union([ 257 + v.object({ 258 + propA: v.optional(v.string()) 259 + }), 260 + v.string(), 261 + v.pipe(v.number(), v.integer()) 262 + ])) 263 + }); 264 + 265 + export const vModelCircle = v.object({ 266 + kind: v.string(), 267 + radius: v.optional(v.number()) 268 + }); 269 + 270 + export const vModelSquare = v.object({ 271 + kind: v.string(), 272 + sideLength: v.optional(v.number()) 273 + }); 274 + 275 + export const vCompositionWithOneOfDiscriminator = v.union([ 276 + v.intersect([ 277 + v.object({ 278 + kind: v.literal('circle') 279 + }), 280 + vModelCircle 281 + ]), 282 + v.intersect([ 283 + v.object({ 284 + kind: v.literal('square') 285 + }), 286 + vModelSquare 287 + ]) 288 + ]); 289 + 290 + export const vCompositionWithAnyOf = v.object({ 291 + propA: v.optional(v.union([ 292 + vModelWithString, 293 + vModelWithEnum, 294 + vModelWithArray, 295 + vModelWithDictionary 296 + ])) 297 + }); 298 + 299 + export const vCompositionWithAnyOfAnonymous = v.object({ 300 + propA: v.optional(v.union([ 301 + v.object({ 302 + propA: v.optional(v.string()) 303 + }), 304 + v.string(), 305 + v.pipe(v.number(), v.integer()) 306 + ])) 307 + }); 308 + 309 + export const vCompositionWithNestedAnyAndTypeNull = v.object({ 310 + propA: v.optional(v.union([ 311 + v.array(v.union([ 312 + vModelWithDictionary, 313 + v.null() 314 + ])), 315 + v.array(v.union([ 316 + vModelWithArray, 317 + v.null() 318 + ])) 319 + ])) 320 + }); 321 + 322 + export const v3eNum1Период = v.picklist([ 323 + 'Bird', 324 + 'Dog' 325 + ]); 326 + 327 + export const vConstValue = v.picklist([ 328 + 'ConstValue' 329 + ]); 330 + 331 + export const vCompositionWithNestedAnyOfAndNull = v.object({ 332 + propA: v.optional(v.union([ 333 + v.array(v.unknown()), 334 + v.null() 335 + ])) 336 + }); 337 + 338 + export const vCompositionWithOneOfAndNullable = v.object({ 339 + propA: v.optional(v.union([ 340 + v.object({ 341 + boolean: v.optional(v.boolean()) 342 + }), 343 + vModelWithEnum, 344 + vModelWithArray, 345 + vModelWithDictionary, 346 + v.null() 347 + ])) 348 + }); 349 + 350 + export const vCompositionWithOneOfAndSimpleDictionary = v.object({ 351 + propA: v.optional(v.union([ 352 + v.boolean(), 353 + v.object({}) 354 + ])) 355 + }); 356 + 357 + export const vCompositionWithOneOfAndSimpleArrayDictionary = v.object({ 358 + propA: v.optional(v.union([ 359 + v.boolean(), 360 + v.object({}) 361 + ])) 362 + }); 363 + 364 + export const vCompositionWithOneOfAndComplexArrayDictionary = v.object({ 365 + propA: v.optional(v.union([ 366 + v.boolean(), 367 + v.object({}) 368 + ])) 369 + }); 370 + 371 + export const vCompositionWithAllOfAndNullable = v.object({ 372 + propA: v.optional(v.union([ 373 + v.intersect([ 374 + v.object({ 375 + boolean: v.optional(v.boolean()) 376 + }), 377 + vModelWithEnum, 378 + vModelWithArray, 379 + vModelWithDictionary 380 + ]), 381 + v.null() 382 + ])) 383 + }); 384 + 385 + export const vCompositionWithAnyOfAndNullable = v.object({ 386 + propA: v.optional(v.union([ 387 + v.object({ 388 + boolean: v.optional(v.boolean()) 389 + }), 390 + vModelWithEnum, 391 + vModelWithArray, 392 + vModelWithDictionary, 393 + v.null() 394 + ])) 395 + }); 396 + 397 + export const vCompositionBaseModel = v.object({ 398 + firstName: v.optional(v.string()), 399 + lastname: v.optional(v.string()) 400 + }); 401 + 402 + export const vCompositionExtendedModel = v.intersect([ 403 + vCompositionBaseModel, 404 + v.object({ 405 + age: v.number(), 406 + firstName: v.string(), 407 + lastname: v.string() 408 + }) 409 + ]); 410 + 411 + export const vModelWithNestedProperties = v.object({ 412 + first: v.pipe(v.union([ 413 + v.pipe(v.object({ 414 + second: v.pipe(v.union([ 415 + v.pipe(v.object({ 416 + third: v.pipe(v.union([ 417 + v.pipe(v.string(), v.readonly()), 418 + v.null() 419 + ]), v.readonly()) 420 + }), v.readonly()), 421 + v.null() 422 + ]), v.readonly()) 423 + }), v.readonly()), 424 + v.null() 425 + ]), v.readonly()) 426 + }); 427 + 428 + export const vModelWithDuplicateProperties = v.object({ 429 + prop: v.optional(vModelWithString) 430 + }); 431 + 432 + export const vModelWithOrderedProperties = v.object({ 433 + zebra: v.optional(v.string()), 434 + apple: v.optional(v.string()), 435 + hawaii: v.optional(v.string()) 436 + }); 437 + 438 + export const vModelWithDuplicateImports = v.object({ 439 + propA: v.optional(vModelWithString), 440 + propB: v.optional(vModelWithString), 441 + propC: v.optional(vModelWithString) 442 + }); 443 + 444 + export const vModelThatExtends = v.intersect([ 445 + vModelWithString, 446 + v.object({ 447 + propExtendsA: v.optional(v.string()), 448 + propExtendsB: v.optional(vModelWithString) 449 + }) 450 + ]); 451 + 452 + export const vModelThatExtendsExtends = v.intersect([ 453 + vModelWithString, 454 + vModelThatExtends, 455 + v.object({ 456 + propExtendsC: v.optional(v.string()), 457 + propExtendsD: v.optional(vModelWithString) 458 + }) 459 + ]); 460 + 461 + export const vModelWithPattern = v.object({ 462 + key: v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)), 463 + name: v.pipe(v.string(), v.maxLength(255)), 464 + enabled: v.optional(v.pipe(v.boolean(), v.readonly())), 465 + modified: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())), 466 + id: v.optional(v.pipe(v.string(), v.regex(/^\d{2}-\d{3}-\d{4}$/))), 467 + text: v.optional(v.pipe(v.string(), v.regex(/^\w+$/))), 468 + patternWithSingleQuotes: v.optional(v.pipe(v.string(), v.regex(/^[a-zA-Z0-9']*$/))), 469 + patternWithNewline: v.optional(v.pipe(v.string(), v.regex(/aaa\nbbb/))), 470 + patternWithBacktick: v.optional(v.pipe(v.string(), v.regex(/aaa`bbb/))) 471 + }); 472 + 473 + export const vFile = v.object({ 474 + id: v.optional(v.pipe(v.pipe(v.string(), v.minLength(1)), v.readonly())), 475 + updated_at: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())), 476 + created_at: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())), 477 + mime: v.pipe(v.string(), v.minLength(1), v.maxLength(24)), 478 + file: v.optional(v.pipe(v.pipe(v.string(), v.url()), v.readonly())) 479 + }); 480 + 481 + export const vDefault = v.object({ 482 + name: v.optional(v.string()) 483 + }); 484 + 485 + export const vPageable = v.object({ 486 + page: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0)), 0), 487 + size: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1))), 488 + sort: v.optional(v.array(v.string())) 489 + }); 490 + 491 + export const vFreeFormObjectWithoutAdditionalProperties = v.object({}); 492 + 493 + export const vFreeFormObjectWithAdditionalPropertiesEqTrue = v.object({}); 494 + 495 + export const vFreeFormObjectWithAdditionalPropertiesEqEmptyObject = v.object({}); 496 + 497 + export const vModelWithConst = v.object({ 498 + String: v.optional(v.picklist([ 499 + 'String' 500 + ])), 501 + number: v.optional(v.unknown()), 502 + null: v.optional(v.unknown()), 503 + withType: v.optional(v.picklist([ 504 + 'Some string' 505 + ])) 506 + }); 507 + 508 + export const vModelWithAdditionalPropertiesEqTrue = v.object({ 509 + prop: v.optional(v.string()) 510 + }); 511 + 512 + export const vNestedAnyOfArraysNullable = v.object({ 513 + nullableArray: v.optional(v.union([ 514 + v.array(v.unknown()), 515 + v.null() 516 + ])) 517 + }); 518 + 519 + export const vSimpleParameter = v.unknown(); 520 + 521 + export const vCompositionWithOneOfAndProperties = v.intersect([ 522 + v.union([ 523 + v.object({ 524 + foo: vSimpleParameter 525 + }), 526 + v.object({ 527 + bar: vNonAsciiStringæøåÆøÅöôêÊ字符串 528 + }) 529 + ]), 530 + v.object({ 531 + baz: v.union([ 532 + v.pipe(v.number(), v.integer(), v.minValue(0)), 533 + v.null() 534 + ]), 535 + qux: v.pipe(v.number(), v.integer(), v.minValue(0)) 536 + }) 537 + ]); 538 + 539 + export const vNullableObject = v.optional(v.union([ 540 + v.object({ 541 + foo: v.optional(v.string()) 542 + }), 543 + v.null() 544 + ]), null); 545 + 546 + export const vCharactersInDescription = v.string(); 547 + 548 + export const vModelWithNullableObject = v.object({ 549 + data: v.optional(vNullableObject) 550 + }); 551 + 552 + export const vModelWithOneOfEnum = v.union([ 553 + v.object({ 554 + foo: v.picklist([ 555 + 'Bar' 556 + ]) 557 + }), 558 + v.object({ 559 + foo: v.picklist([ 560 + 'Baz' 561 + ]) 562 + }), 563 + v.object({ 564 + foo: v.picklist([ 565 + 'Qux' 566 + ]) 567 + }), 568 + v.object({ 569 + content: v.pipe(v.string(), v.isoDateTime()), 570 + foo: v.picklist([ 571 + 'Quux' 572 + ]) 573 + }), 574 + v.object({ 575 + content: v.tuple([ 576 + v.pipe(v.string(), v.isoDateTime()), 577 + v.pipe(v.string(), v.isoDateTime()) 578 + ]), 579 + foo: v.picklist([ 580 + 'Corge' 581 + ]) 582 + }) 583 + ]); 584 + 585 + export const vModelWithNestedArrayEnumsDataFoo = v.picklist([ 586 + 'foo', 587 + 'bar' 588 + ]); 589 + 590 + export const vModelWithNestedArrayEnumsDataBar = v.picklist([ 591 + 'baz', 592 + 'qux' 593 + ]); 594 + 595 + export const vModelWithNestedArrayEnumsData = v.object({ 596 + foo: v.optional(v.array(vModelWithNestedArrayEnumsDataFoo)), 597 + bar: v.optional(v.array(vModelWithNestedArrayEnumsDataBar)) 598 + }); 599 + 600 + export const vModelWithNestedArrayEnums = v.object({ 601 + array_strings: v.optional(v.array(v.string())), 602 + data: v.optional(vModelWithNestedArrayEnumsData) 603 + }); 604 + 605 + export const vModelWithNestedCompositionEnums = v.object({ 606 + foo: v.optional(vModelWithNestedArrayEnumsDataFoo) 607 + }); 608 + 609 + export const vModelWithConstantSizeArray = v.tuple([ 610 + v.number(), 611 + v.number() 612 + ]); 613 + 614 + export const vModelWithAnyOfConstantSizeArray = v.tuple([ 615 + v.union([ 616 + v.number(), 617 + v.string() 618 + ]), 619 + v.union([ 620 + v.number(), 621 + v.string() 622 + ]), 623 + v.union([ 624 + v.number(), 625 + v.string() 626 + ]) 627 + ]); 628 + 629 + export const vModelWithPrefixItemsConstantSizeArray = v.array(v.unknown()); 630 + 631 + export const vModelWithAnyOfConstantSizeArrayNullable = v.tuple([ 632 + v.union([ 633 + v.number(), 634 + v.null(), 635 + v.string() 636 + ]), 637 + v.union([ 638 + v.number(), 639 + v.null(), 640 + v.string() 641 + ]), 642 + v.union([ 643 + v.number(), 644 + v.null(), 645 + v.string() 646 + ]) 647 + ]); 648 + 649 + export const vImport = v.string(); 650 + 651 + export const vModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = v.tuple([ 652 + v.union([ 653 + v.number(), 654 + vImport 655 + ]), 656 + v.union([ 657 + v.number(), 658 + vImport 659 + ]) 660 + ]); 661 + 662 + export const vModelWithAnyOfConstantSizeArrayAndIntersect = v.tuple([ 663 + v.intersect([ 664 + v.number(), 665 + v.string() 666 + ]), 667 + v.intersect([ 668 + v.number(), 669 + v.string() 670 + ]) 671 + ]); 672 + 673 + export const vModelWithNumericEnumUnion = v.object({ 674 + value: v.optional(v.unknown()) 675 + }); 676 + 677 + export const vModelWithBackticksInDescription = v.object({ 678 + template: v.optional(v.string()) 679 + }); 680 + 681 + export const vModelWithOneOfAndProperties = v.intersect([ 682 + v.union([ 683 + vSimpleParameter, 684 + vNonAsciiStringæøåÆøÅöôêÊ字符串 685 + ]), 686 + v.object({ 687 + baz: v.union([ 688 + v.pipe(v.number(), v.integer(), v.minValue(0)), 689 + v.null() 690 + ]), 691 + qux: v.pipe(v.number(), v.integer(), v.minValue(0)) 692 + }) 693 + ]); 694 + 695 + export const vParameterSimpleParameterUnused = v.string(); 696 + 697 + export const vPostServiceWithEmptyTagResponse = v.string(); 698 + 699 + export const vPostServiceWithEmptyTagResponse2 = v.string(); 700 + 701 + export const vDeleteFooData = v.string(); 702 + 703 + export const vDeleteFooData2 = v.string(); 704 + 705 + export const vSchemaWithFormRestrictedKeys = v.object({ 706 + description: v.optional(v.string()), 707 + 'x-enum-descriptions': v.optional(v.string()), 708 + 'x-enum-varnames': v.optional(v.string()), 709 + 'x-enumNames': v.optional(v.string()), 710 + title: v.optional(v.string()), 711 + object: v.optional(v.object({ 712 + description: v.optional(v.string()), 713 + 'x-enum-descriptions': v.optional(v.string()), 714 + 'x-enum-varnames': v.optional(v.string()), 715 + 'x-enumNames': v.optional(v.string()), 716 + title: v.optional(v.string()) 717 + })), 718 + array: v.optional(v.array(v.object({ 719 + description: v.optional(v.string()), 720 + 'x-enum-descriptions': v.optional(v.string()), 721 + 'x-enum-varnames': v.optional(v.string()), 722 + 'x-enumNames': v.optional(v.string()), 723 + title: v.optional(v.string()) 724 + }))) 725 + }); 726 + 727 + export const vIoK8sApimachineryPkgApisMetaV1Preconditions = v.object({ 728 + resourceVersion: v.optional(v.string()), 729 + uid: v.optional(v.string()) 730 + }); 731 + 732 + export const vIoK8sApimachineryPkgApisMetaV1DeleteOptions = v.object({ 733 + preconditions: v.optional(vIoK8sApimachineryPkgApisMetaV1Preconditions) 734 + }); 735 + 736 + export const vAdditionalPropertiesUnknownIssue = v.object({}); 737 + 738 + export const vAdditionalPropertiesUnknownIssue2 = v.object({}); 739 + 740 + export const vAdditionalPropertiesUnknownIssue3 = v.intersect([ 741 + v.string(), 742 + v.object({ 743 + entries: v.object({}) 744 + }) 745 + ]); 746 + 747 + export const vAdditionalPropertiesIntegerIssue = v.object({ 748 + value: v.pipe(v.number(), v.integer()) 749 + }); 750 + 751 + export const vGenericSchemaDuplicateIssue1SystemBoolean = v.object({ 752 + item: v.optional(v.boolean()), 753 + error: v.optional(v.union([ 754 + v.string(), 755 + v.null() 756 + ])), 757 + hasError: v.optional(v.pipe(v.boolean(), v.readonly())), 758 + data: v.optional(v.object({})) 759 + }); 760 + 761 + export const vGenericSchemaDuplicateIssue1SystemString = v.object({ 762 + item: v.optional(v.union([ 763 + v.string(), 764 + v.null() 765 + ])), 766 + error: v.optional(v.union([ 767 + v.string(), 768 + v.null() 769 + ])), 770 + hasError: v.optional(v.pipe(v.boolean(), v.readonly())) 771 + }); 772 + 773 + export const vOneOfAllOfIssue = v.union([ 774 + v.intersect([ 775 + v.union([ 776 + vConstValue, 777 + vGenericSchemaDuplicateIssue1SystemBoolean 778 + ]), 779 + v3eNum1Период 780 + ]), 781 + vGenericSchemaDuplicateIssue1SystemString 782 + ]); 783 + 784 + export const vImportResponse = v.union([ 785 + vModelFromZendesk, 786 + vModelWithReadOnlyAndWriteOnly 787 + ]); 788 + 789 + export const vApiVVersionODataControllerCountResponse = vModelFromZendesk; 790 + 791 + export const vGetApiVbyApiVersionSimpleOperationResponse = v.number(); 792 + 793 + export const vPostCallWithOptionalParamResponse = v.union([ 794 + v.number(), 795 + v.void() 796 + ]); 797 + 798 + export const vCallWithNoContentResponseResponse = v.void(); 799 + 800 + export const vCallWithResponseAndNoContentResponseResponse = v.union([ 801 + v.number(), 802 + v.void() 803 + ]); 804 + 805 + export const vDummyAResponse = v400; 806 + 807 + export const vDummyBResponse = v.void(); 808 + 809 + export const vCallWithResponseResponse = vImport; 810 + 811 + export const vCallWithDuplicateResponsesResponse = v.union([ 812 + v.intersect([ 813 + vModelWithBoolean, 814 + vModelWithInteger 815 + ]), 816 + vModelWithString 817 + ]); 818 + 819 + export const vCallWithResponsesResponse = v.union([ 820 + v.object({ 821 + '@namespace.string': v.optional(v.pipe(v.string(), v.readonly())), 822 + '@namespace.integer': v.optional(v.pipe(v.pipe(v.number(), v.integer()), v.readonly())), 823 + value: v.optional(v.pipe(v.array(vModelWithString), v.readonly())) 824 + }), 825 + vModelThatExtends, 826 + vModelThatExtendsExtends 827 + ]); 828 + 829 + export const vTypesResponse = v.union([ 830 + v.number(), 831 + v.string(), 832 + v.boolean(), 833 + v.object({}) 834 + ]); 835 + 836 + export const vUploadFileResponse = v.boolean(); 837 + 838 + export const vFileResponseResponse = v.string(); 839 + 840 + export const vComplexTypesResponse = v.array(vModelWithString); 841 + 842 + export const vMultipartResponseResponse = v.object({ 843 + file: v.optional(v.string()), 844 + metadata: v.optional(v.object({ 845 + foo: v.optional(v.string()), 846 + bar: v.optional(v.string()) 847 + })) 848 + }); 849 + 850 + export const vComplexParamsResponse = vModelWithString; 851 + 852 + export const vNonAsciiæøåÆøÅöôêÊ字符串Response = v.array(vNonAsciiStringæøåÆøÅöôêÊ字符串);
+23
packages/openapi-ts-tests/test/__snapshots__/3.0.x/validators/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vBar: v.GenericSchema = v.object({ 6 + foo: v.optional(v.lazy(() => { 7 + return vFoo; 8 + })) 9 + }); 10 + 11 + export const vFoo: v.GenericSchema = v.optional(v.union([ 12 + v.object({ 13 + foo: v.optional(v.pipe(v.string(), v.regex(/^\d{3}-\d{2}-\d{4}$/))), 14 + bar: v.optional(vBar), 15 + baz: v.optional(v.array(v.lazy(() => { 16 + return vFoo; 17 + }))), 18 + qux: v.optional(v.number(), 0) 19 + }), 20 + v.null() 21 + ]), null); 22 + 23 + export const vBaz = v.optional(v.pipe(v.pipe(v.string(), v.regex(/foo\nbar/)), v.readonly()), 'baz');
+18
packages/openapi-ts-tests/test/__snapshots__/3.1.x/enum-null/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vFoo = v.nullable(v.picklist([ 6 + 'foo', 7 + 'bar' 8 + ])); 9 + 10 + export const vBar = v.picklist([ 11 + 'foo', 12 + 'bar' 13 + ]); 14 + 15 + export const vBaz = v.picklist([ 16 + 'foo', 17 + 'bar' 18 + ]);
+16
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/client.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { ClientOptions } from './types.gen'; 4 + import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch'; 5 + 6 + /** 7 + * The `createClientConfig()` function will be called on client initialization 8 + * and the returned object will become the client's initial configuration. 9 + * 10 + * You may want to initialize your client this way instead of calling 11 + * `setConfig()`. This is useful for example if you're using Next.js 12 + * to ensure your client always has the correct values. 13 + */ 14 + export type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>; 15 + 16 + export const client = createClient(createConfig<ClientOptions>());
+3
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/index.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + export * from './types.gen'; 3 + export * from './sdk.gen';
+33
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/sdk.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; 4 + import type { PostFooData, PostFooResponse } from './types.gen'; 5 + import { postFooResponseTransformer } from './transformers.gen'; 6 + import { vPostFooResponse } from './valibot.gen'; 7 + import * as v from 'valibot'; 8 + import { client as _heyApiClient } from './client.gen'; 9 + 10 + export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & { 11 + /** 12 + * You can provide a client instance returned by `createClient()` instead of 13 + * individual options. This might be also useful if you want to implement a 14 + * custom client. 15 + */ 16 + client?: Client; 17 + /** 18 + * You can pass arbitrary values through the `meta` object. This can be 19 + * used to access values that aren't defined as part of the SDK function. 20 + */ 21 + meta?: Record<string, unknown>; 22 + }; 23 + 24 + export const postFoo = <ThrowOnError extends boolean = false>(options?: Options<PostFooData, ThrowOnError>) => { 25 + return (options?.client ?? _heyApiClient).post<PostFooResponse, unknown, ThrowOnError>({ 26 + responseTransformer: postFooResponseTransformer, 27 + responseValidator: async (data) => { 28 + return await v.parseAsync(vPostFooResponse, data); 29 + }, 30 + url: '/foo', 31 + ...options 32 + }); 33 + };
+13
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/transformers.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import type { PostFooResponse } from './types.gen'; 4 + 5 + const fooSchemaResponseTransformer = (data: any) => { 6 + data.foo = BigInt(data.foo.toString()); 7 + return data; 8 + }; 9 + 10 + export const postFooResponseTransformer = async (data: any): Promise<PostFooResponse> => { 11 + data = fooSchemaResponseTransformer(data); 12 + return data; 13 + };
+32
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/types.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + export type Foo = { 4 + bar?: number; 5 + foo: bigint; 6 + id: string; 7 + }; 8 + 9 + export type Bar = { 10 + foo: number; 11 + [key: string]: number; 12 + }; 13 + 14 + export type PostFooData = { 15 + body?: never; 16 + path?: never; 17 + query?: never; 18 + url: '/foo'; 19 + }; 20 + 21 + export type PostFooResponses = { 22 + /** 23 + * OK 24 + */ 25 + 200: Foo; 26 + }; 27 + 28 + export type PostFooResponse = PostFooResponses[keyof PostFooResponses]; 29 + 30 + export type ClientOptions = { 31 + baseUrl: `${string}://${string}` | (string & {}); 32 + };
+15
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-valibot/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vFoo = v.object({ 6 + bar: v.optional(v.pipe(v.number(), v.integer())), 7 + foo: v.bigint(), 8 + id: v.string() 9 + }); 10 + 11 + export const vBar = v.object({ 12 + foo: v.pipe(v.number(), v.integer()) 13 + }); 14 + 15 + export const vPostFooResponse = vFoo;
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format/client.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/client.gen.ts
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format/index.ts packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/index.ts
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format/sdk.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/sdk.gen.ts
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format/transformers.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/transformers.gen.ts
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format/types.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/types.gen.ts
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format/zod.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/@hey-api/transformers/type-format-zod/zod.gen.ts
+850
packages/openapi-ts-tests/test/__snapshots__/3.1.x/plugins/valibot/default/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const v400 = v.string(); 6 + 7 + export const vCamelCaseCommentWithBreaks = v.pipe(v.number(), v.integer()); 8 + 9 + export const vCommentWithBreaks = v.pipe(v.number(), v.integer()); 10 + 11 + export const vCommentWithBackticks = v.pipe(v.number(), v.integer()); 12 + 13 + export const vCommentWithBackticksAndQuotes = v.pipe(v.number(), v.integer()); 14 + 15 + export const vCommentWithSlashes = v.pipe(v.number(), v.integer()); 16 + 17 + export const vCommentWithExpressionPlaceholders = v.pipe(v.number(), v.integer()); 18 + 19 + export const vCommentWithQuotes = v.pipe(v.number(), v.integer()); 20 + 21 + export const vCommentWithReservedCharacters = v.pipe(v.number(), v.integer()); 22 + 23 + export const vSimpleInteger = v.pipe(v.number(), v.integer()); 24 + 25 + export const vSimpleBoolean = v.boolean(); 26 + 27 + export const vSimpleString = v.string(); 28 + 29 + export const vNonAsciiStringæøåÆøÅöôêÊ字符串 = v.string(); 30 + 31 + export const vSimpleFile = v.string(); 32 + 33 + export const vModelWithString = v.object({ 34 + prop: v.optional(v.string()) 35 + }); 36 + 37 + export const vSimpleReference = vModelWithString; 38 + 39 + export const vSimpleStringWithPattern = v.union([ 40 + v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)), 41 + v.null() 42 + ]); 43 + 44 + export const vEnumWithStrings = v.picklist([ 45 + 'Success', 46 + 'Warning', 47 + 'Error', 48 + "'Single Quote'", 49 + '"Double Quotes"', 50 + 'Non-ascii: øæåôöØÆÅÔÖ字符串' 51 + ]); 52 + 53 + export const vEnumWithReplacedCharacters = v.picklist([ 54 + "'Single Quote'", 55 + '"Double Quotes"', 56 + 'øæåôöØÆÅÔÖ字符串', 57 + '' 58 + ]); 59 + 60 + export const vEnumWithNumbers = v.unknown(); 61 + 62 + export const vEnumFromDescription = v.number(); 63 + 64 + export const vEnumWithExtensions = v.unknown(); 65 + 66 + export const vEnumWithXEnumNames = v.unknown(); 67 + 68 + export const vArrayWithNumbers = v.array(v.pipe(v.number(), v.integer())); 69 + 70 + export const vArrayWithBooleans = v.array(v.boolean()); 71 + 72 + export const vArrayWithStrings = v.optional(v.array(v.string()), ['test']); 73 + 74 + export const vArrayWithReferences = v.array(vModelWithString); 75 + 76 + export const vArrayWithArray = v.array(v.array(vModelWithString)); 77 + 78 + export const vArrayWithProperties = v.array(v.object({ 79 + '16x16': v.optional(vCamelCaseCommentWithBreaks), 80 + bar: v.optional(v.string()) 81 + })); 82 + 83 + export const vArrayWithAnyOfProperties = v.array(v.unknown()); 84 + 85 + export const vAnyOfAnyAndNull = v.object({ 86 + data: v.optional(v.union([ 87 + v.unknown(), 88 + v.null() 89 + ])) 90 + }); 91 + 92 + export const vAnyOfArrays = v.object({ 93 + results: v.optional(v.array(v.unknown())) 94 + }); 95 + 96 + export const vDictionaryWithString = v.object({}); 97 + 98 + export const vDictionaryWithPropertiesAndAdditionalProperties = v.object({ 99 + foo: v.optional(v.number()), 100 + bar: v.optional(v.boolean()) 101 + }); 102 + 103 + export const vDictionaryWithReference = v.object({}); 104 + 105 + export const vDictionaryWithArray = v.object({}); 106 + 107 + export const vDictionaryWithDictionary = v.object({}); 108 + 109 + export const vDictionaryWithProperties = v.object({}); 110 + 111 + export const vModelWithInteger = v.object({ 112 + prop: v.optional(v.pipe(v.number(), v.integer())) 113 + }); 114 + 115 + export const vModelWithBoolean = v.object({ 116 + prop: v.optional(v.boolean()) 117 + }); 118 + 119 + export const vModelWithStringError = v.object({ 120 + prop: v.optional(v.string()) 121 + }); 122 + 123 + export const vModelFromZendesk = v.string(); 124 + 125 + export const vModelWithNullableString = v.object({ 126 + nullableProp1: v.optional(v.union([ 127 + v.string(), 128 + v.null() 129 + ])), 130 + nullableRequiredProp1: v.union([ 131 + v.string(), 132 + v.null() 133 + ]), 134 + nullableProp2: v.optional(v.union([ 135 + v.string(), 136 + v.null() 137 + ])), 138 + nullableRequiredProp2: v.union([ 139 + v.string(), 140 + v.null() 141 + ]), 142 + 'foo_bar-enum': v.optional(v.picklist([ 143 + 'Success', 144 + 'Warning', 145 + 'Error', 146 + 'ØÆÅ字符串' 147 + ])) 148 + }); 149 + 150 + export const vModelWithEnum = v.object({ 151 + 'foo_bar-enum': v.optional(v.picklist([ 152 + 'Success', 153 + 'Warning', 154 + 'Error', 155 + 'ØÆÅ字符串' 156 + ])), 157 + statusCode: v.optional(v.picklist([ 158 + '100', 159 + '200 FOO', 160 + '300 FOO_BAR', 161 + '400 foo-bar', 162 + '500 foo.bar', 163 + '600 foo&bar' 164 + ])), 165 + bool: v.optional(v.unknown()) 166 + }); 167 + 168 + export const vModelWithEnumWithHyphen = v.object({ 169 + 'foo-bar-baz-qux': v.optional(v.picklist([ 170 + '3.0' 171 + ])) 172 + }); 173 + 174 + export const vModelWithEnumFromDescription = v.object({ 175 + test: v.optional(v.pipe(v.number(), v.integer())) 176 + }); 177 + 178 + export const vModelWithNestedEnums = v.object({ 179 + dictionaryWithEnum: v.optional(v.object({})), 180 + dictionaryWithEnumFromDescription: v.optional(v.object({})), 181 + arrayWithEnum: v.optional(v.array(v.picklist([ 182 + 'Success', 183 + 'Warning', 184 + 'Error' 185 + ]))), 186 + arrayWithDescription: v.optional(v.array(v.pipe(v.number(), v.integer()))), 187 + 'foo_bar-enum': v.optional(v.picklist([ 188 + 'Success', 189 + 'Warning', 190 + 'Error', 191 + 'ØÆÅ字符串' 192 + ])) 193 + }); 194 + 195 + export const vModelWithProperties = v.object({ 196 + required: v.string(), 197 + requiredAndReadOnly: v.pipe(v.string(), v.readonly()), 198 + requiredAndNullable: v.union([ 199 + v.string(), 200 + v.null() 201 + ]), 202 + string: v.optional(v.string()), 203 + number: v.optional(v.number()), 204 + boolean: v.optional(v.boolean()), 205 + reference: v.optional(vModelWithString), 206 + 'property with space': v.optional(v.string()), 207 + default: v.optional(v.string()), 208 + try: v.optional(v.string()), 209 + '@namespace.string': v.optional(v.pipe(v.string(), v.readonly())), 210 + '@namespace.integer': v.optional(v.pipe(v.pipe(v.number(), v.integer()), v.readonly())) 211 + }); 212 + 213 + export const vModelWithReference = v.object({ 214 + prop: v.optional(vModelWithProperties) 215 + }); 216 + 217 + export const vModelWithReadOnlyAndWriteOnly = v.object({ 218 + foo: v.string(), 219 + bar: v.pipe(v.string(), v.readonly()), 220 + baz: v.string() 221 + }); 222 + 223 + export const vModelWithArrayReadOnlyAndWriteOnly = v.object({ 224 + prop: v.optional(v.array(vModelWithReadOnlyAndWriteOnly)), 225 + propWithFile: v.optional(v.array(v.string())), 226 + propWithNumber: v.optional(v.array(v.number())) 227 + }); 228 + 229 + export const vModelWithArray = v.object({ 230 + prop: v.optional(v.array(vModelWithString)), 231 + propWithFile: v.optional(v.array(v.string())), 232 + propWithNumber: v.optional(v.array(v.number())) 233 + }); 234 + 235 + export const vModelWithDictionary = v.object({ 236 + prop: v.optional(v.object({})) 237 + }); 238 + 239 + export const vDeprecatedModel = v.object({ 240 + prop: v.optional(v.string()) 241 + }); 242 + 243 + export const vModelWithCircularReference: v.GenericSchema = v.object({ 244 + prop: v.optional(v.lazy(() => { 245 + return vModelWithCircularReference; 246 + })) 247 + }); 248 + 249 + export const vCompositionWithOneOf = v.object({ 250 + propA: v.optional(v.union([ 251 + vModelWithString, 252 + vModelWithEnum, 253 + vModelWithArray, 254 + vModelWithDictionary 255 + ])) 256 + }); 257 + 258 + export const vCompositionWithOneOfAnonymous = v.object({ 259 + propA: v.optional(v.union([ 260 + v.object({ 261 + propA: v.optional(v.string()) 262 + }), 263 + v.string(), 264 + v.pipe(v.number(), v.integer()) 265 + ])) 266 + }); 267 + 268 + export const vModelCircle = v.object({ 269 + kind: v.string(), 270 + radius: v.optional(v.number()) 271 + }); 272 + 273 + export const vModelSquare = v.object({ 274 + kind: v.string(), 275 + sideLength: v.optional(v.number()) 276 + }); 277 + 278 + export const vCompositionWithOneOfDiscriminator = v.union([ 279 + v.intersect([ 280 + v.object({ 281 + kind: v.literal('circle') 282 + }), 283 + vModelCircle 284 + ]), 285 + v.intersect([ 286 + v.object({ 287 + kind: v.literal('square') 288 + }), 289 + vModelSquare 290 + ]) 291 + ]); 292 + 293 + export const vCompositionWithAnyOf = v.object({ 294 + propA: v.optional(v.union([ 295 + vModelWithString, 296 + vModelWithEnum, 297 + vModelWithArray, 298 + vModelWithDictionary 299 + ])) 300 + }); 301 + 302 + export const vCompositionWithAnyOfAnonymous = v.object({ 303 + propA: v.optional(v.union([ 304 + v.object({ 305 + propA: v.optional(v.string()) 306 + }), 307 + v.string(), 308 + v.pipe(v.number(), v.integer()) 309 + ])) 310 + }); 311 + 312 + export const vCompositionWithNestedAnyAndTypeNull = v.object({ 313 + propA: v.optional(v.union([ 314 + v.array(v.unknown()), 315 + v.array(v.unknown()) 316 + ])) 317 + }); 318 + 319 + export const v3eNum1Период = v.picklist([ 320 + 'Bird', 321 + 'Dog' 322 + ]); 323 + 324 + export const vConstValue = v.literal('ConstValue'); 325 + 326 + export const vCompositionWithNestedAnyOfAndNull = v.object({ 327 + propA: v.optional(v.union([ 328 + v.array(v.unknown()), 329 + v.null() 330 + ])) 331 + }); 332 + 333 + export const vCompositionWithOneOfAndNullable = v.object({ 334 + propA: v.optional(v.union([ 335 + v.object({ 336 + boolean: v.optional(v.boolean()) 337 + }), 338 + vModelWithEnum, 339 + vModelWithArray, 340 + vModelWithDictionary, 341 + v.null() 342 + ])) 343 + }); 344 + 345 + export const vCompositionWithOneOfAndSimpleDictionary = v.object({ 346 + propA: v.optional(v.union([ 347 + v.boolean(), 348 + v.object({}) 349 + ])) 350 + }); 351 + 352 + export const vCompositionWithOneOfAndSimpleArrayDictionary = v.object({ 353 + propA: v.optional(v.union([ 354 + v.boolean(), 355 + v.object({}) 356 + ])) 357 + }); 358 + 359 + export const vCompositionWithOneOfAndComplexArrayDictionary = v.object({ 360 + propA: v.optional(v.union([ 361 + v.boolean(), 362 + v.object({}) 363 + ])) 364 + }); 365 + 366 + export const vCompositionWithAllOfAndNullable = v.object({ 367 + propA: v.optional(v.union([ 368 + v.intersect([ 369 + v.object({ 370 + boolean: v.optional(v.boolean()) 371 + }), 372 + vModelWithEnum, 373 + vModelWithArray, 374 + vModelWithDictionary 375 + ]), 376 + v.null() 377 + ])) 378 + }); 379 + 380 + export const vCompositionWithAnyOfAndNullable = v.object({ 381 + propA: v.optional(v.union([ 382 + v.object({ 383 + boolean: v.optional(v.boolean()) 384 + }), 385 + vModelWithEnum, 386 + vModelWithArray, 387 + vModelWithDictionary, 388 + v.null() 389 + ])) 390 + }); 391 + 392 + export const vCompositionBaseModel = v.object({ 393 + firstName: v.optional(v.string()), 394 + lastname: v.optional(v.string()) 395 + }); 396 + 397 + export const vCompositionExtendedModel = v.intersect([ 398 + vCompositionBaseModel, 399 + v.object({ 400 + age: v.number(), 401 + firstName: v.string(), 402 + lastname: v.string() 403 + }) 404 + ]); 405 + 406 + export const vModelWithNestedProperties = v.object({ 407 + first: v.pipe(v.union([ 408 + v.pipe(v.object({ 409 + second: v.pipe(v.union([ 410 + v.pipe(v.object({ 411 + third: v.pipe(v.union([ 412 + v.pipe(v.string(), v.readonly()), 413 + v.null() 414 + ]), v.readonly()) 415 + }), v.readonly()), 416 + v.null() 417 + ]), v.readonly()) 418 + }), v.readonly()), 419 + v.null() 420 + ]), v.readonly()) 421 + }); 422 + 423 + export const vModelWithDuplicateProperties = v.object({ 424 + prop: v.optional(vModelWithString) 425 + }); 426 + 427 + export const vModelWithOrderedProperties = v.object({ 428 + zebra: v.optional(v.string()), 429 + apple: v.optional(v.string()), 430 + hawaii: v.optional(v.string()) 431 + }); 432 + 433 + export const vModelWithDuplicateImports = v.object({ 434 + propA: v.optional(vModelWithString), 435 + propB: v.optional(vModelWithString), 436 + propC: v.optional(vModelWithString) 437 + }); 438 + 439 + export const vModelThatExtends = v.intersect([ 440 + vModelWithString, 441 + v.object({ 442 + propExtendsA: v.optional(v.string()), 443 + propExtendsB: v.optional(vModelWithString) 444 + }) 445 + ]); 446 + 447 + export const vModelThatExtendsExtends = v.intersect([ 448 + vModelWithString, 449 + vModelThatExtends, 450 + v.object({ 451 + propExtendsC: v.optional(v.string()), 452 + propExtendsD: v.optional(vModelWithString) 453 + }) 454 + ]); 455 + 456 + export const vModelWithPattern = v.object({ 457 + key: v.pipe(v.string(), v.maxLength(64), v.regex(/^[a-zA-Z0-9_]*$/)), 458 + name: v.pipe(v.string(), v.maxLength(255)), 459 + enabled: v.optional(v.pipe(v.boolean(), v.readonly())), 460 + modified: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())), 461 + id: v.optional(v.pipe(v.string(), v.regex(/^\d{2}-\d{3}-\d{4}$/))), 462 + text: v.optional(v.pipe(v.string(), v.regex(/^\w+$/))), 463 + patternWithSingleQuotes: v.optional(v.pipe(v.string(), v.regex(/^[a-zA-Z0-9']*$/))), 464 + patternWithNewline: v.optional(v.pipe(v.string(), v.regex(/aaa\nbbb/))), 465 + patternWithBacktick: v.optional(v.pipe(v.string(), v.regex(/aaa`bbb/))) 466 + }); 467 + 468 + export const vFile = v.object({ 469 + id: v.optional(v.pipe(v.pipe(v.string(), v.minLength(1)), v.readonly())), 470 + updated_at: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())), 471 + created_at: v.optional(v.pipe(v.pipe(v.string(), v.isoDateTime()), v.readonly())), 472 + mime: v.pipe(v.string(), v.minLength(1), v.maxLength(24)), 473 + file: v.optional(v.pipe(v.pipe(v.string(), v.url()), v.readonly())) 474 + }); 475 + 476 + export const vDefault = v.object({ 477 + name: v.optional(v.string()) 478 + }); 479 + 480 + export const vPageable = v.object({ 481 + page: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0)), 0), 482 + size: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1))), 483 + sort: v.optional(v.array(v.string())) 484 + }); 485 + 486 + export const vFreeFormObjectWithoutAdditionalProperties = v.object({}); 487 + 488 + export const vFreeFormObjectWithAdditionalPropertiesEqTrue = v.object({}); 489 + 490 + export const vFreeFormObjectWithAdditionalPropertiesEqEmptyObject = v.object({}); 491 + 492 + export const vModelWithConst = v.object({ 493 + String: v.optional(v.literal('String')), 494 + number: v.optional(v.literal(0)), 495 + null: v.optional(v.null()), 496 + withType: v.optional(v.literal('Some string')) 497 + }); 498 + 499 + export const vModelWithAdditionalPropertiesEqTrue = v.object({ 500 + prop: v.optional(v.string()) 501 + }); 502 + 503 + export const vNestedAnyOfArraysNullable = v.object({ 504 + nullableArray: v.optional(v.union([ 505 + v.array(v.unknown()), 506 + v.null() 507 + ])) 508 + }); 509 + 510 + export const vSimpleParameter = v.unknown(); 511 + 512 + export const vCompositionWithOneOfAndProperties = v.intersect([ 513 + v.union([ 514 + v.object({ 515 + foo: vSimpleParameter 516 + }), 517 + v.object({ 518 + bar: vNonAsciiStringæøåÆøÅöôêÊ字符串 519 + }) 520 + ]), 521 + v.object({ 522 + baz: v.union([ 523 + v.pipe(v.number(), v.integer(), v.minValue(0)), 524 + v.null() 525 + ]), 526 + qux: v.pipe(v.number(), v.integer(), v.minValue(0)) 527 + }) 528 + ]); 529 + 530 + export const vNullableObject = v.optional(v.union([ 531 + v.object({ 532 + foo: v.optional(v.string()) 533 + }), 534 + v.null() 535 + ]), null); 536 + 537 + export const vCharactersInDescription = v.string(); 538 + 539 + export const vModelWithNullableObject = v.object({ 540 + data: v.optional(vNullableObject) 541 + }); 542 + 543 + export const vModelWithOneOfEnum = v.union([ 544 + v.object({ 545 + foo: v.picklist([ 546 + 'Bar' 547 + ]) 548 + }), 549 + v.object({ 550 + foo: v.picklist([ 551 + 'Baz' 552 + ]) 553 + }), 554 + v.object({ 555 + foo: v.picklist([ 556 + 'Qux' 557 + ]) 558 + }), 559 + v.object({ 560 + content: v.pipe(v.string(), v.isoDateTime()), 561 + foo: v.picklist([ 562 + 'Quux' 563 + ]) 564 + }), 565 + v.object({ 566 + content: v.tuple([ 567 + v.pipe(v.string(), v.isoDateTime()), 568 + v.string() 569 + ]), 570 + foo: v.picklist([ 571 + 'Corge' 572 + ]) 573 + }) 574 + ]); 575 + 576 + export const vModelWithNestedArrayEnumsDataFoo = v.picklist([ 577 + 'foo', 578 + 'bar' 579 + ]); 580 + 581 + export const vModelWithNestedArrayEnumsDataBar = v.picklist([ 582 + 'baz', 583 + 'qux' 584 + ]); 585 + 586 + export const vModelWithNestedArrayEnumsData = v.object({ 587 + foo: v.optional(v.array(vModelWithNestedArrayEnumsDataFoo)), 588 + bar: v.optional(v.array(vModelWithNestedArrayEnumsDataBar)) 589 + }); 590 + 591 + export const vModelWithNestedArrayEnums = v.object({ 592 + array_strings: v.optional(v.array(v.string())), 593 + data: v.optional(vModelWithNestedArrayEnumsData) 594 + }); 595 + 596 + export const vModelWithNestedCompositionEnums = v.object({ 597 + foo: v.optional(vModelWithNestedArrayEnumsDataFoo) 598 + }); 599 + 600 + export const vModelWithConstantSizeArray = v.tuple([ 601 + v.number(), 602 + v.number() 603 + ]); 604 + 605 + export const vModelWithAnyOfConstantSizeArray = v.tuple([ 606 + v.union([ 607 + v.number(), 608 + v.string() 609 + ]), 610 + v.union([ 611 + v.number(), 612 + v.string() 613 + ]), 614 + v.union([ 615 + v.number(), 616 + v.string() 617 + ]) 618 + ]); 619 + 620 + export const vModelWithPrefixItemsConstantSizeArray = v.tuple([ 621 + vModelWithInteger, 622 + v.union([ 623 + v.number(), 624 + v.string() 625 + ]), 626 + v.string() 627 + ]); 628 + 629 + export const vModelWithAnyOfConstantSizeArrayNullable = v.tuple([ 630 + v.union([ 631 + v.number(), 632 + v.null(), 633 + v.string() 634 + ]), 635 + v.union([ 636 + v.number(), 637 + v.null(), 638 + v.string() 639 + ]), 640 + v.union([ 641 + v.number(), 642 + v.null(), 643 + v.string() 644 + ]) 645 + ]); 646 + 647 + export const vImport = v.string(); 648 + 649 + export const vModelWithAnyOfConstantSizeArrayWithNSizeAndOptions = v.tuple([ 650 + v.union([ 651 + v.number(), 652 + vImport 653 + ]), 654 + v.union([ 655 + v.number(), 656 + vImport 657 + ]) 658 + ]); 659 + 660 + export const vModelWithAnyOfConstantSizeArrayAndIntersect = v.tuple([ 661 + v.intersect([ 662 + v.number(), 663 + v.string() 664 + ]), 665 + v.intersect([ 666 + v.number(), 667 + v.string() 668 + ]) 669 + ]); 670 + 671 + export const vModelWithNumericEnumUnion = v.object({ 672 + value: v.optional(v.unknown()) 673 + }); 674 + 675 + export const vModelWithBackticksInDescription = v.object({ 676 + template: v.optional(v.string()) 677 + }); 678 + 679 + export const vModelWithOneOfAndProperties = v.intersect([ 680 + v.union([ 681 + vSimpleParameter, 682 + vNonAsciiStringæøåÆøÅöôêÊ字符串 683 + ]), 684 + v.object({ 685 + baz: v.union([ 686 + v.pipe(v.number(), v.integer(), v.minValue(0)), 687 + v.null() 688 + ]), 689 + qux: v.pipe(v.number(), v.integer(), v.minValue(0)) 690 + }) 691 + ]); 692 + 693 + export const vParameterSimpleParameterUnused = v.string(); 694 + 695 + export const vPostServiceWithEmptyTagResponse = v.string(); 696 + 697 + export const vPostServiceWithEmptyTagResponse2 = v.string(); 698 + 699 + export const vDeleteFooData = v.string(); 700 + 701 + export const vDeleteFooData2 = v.string(); 702 + 703 + export const vSchemaWithFormRestrictedKeys = v.object({ 704 + description: v.optional(v.string()), 705 + 'x-enum-descriptions': v.optional(v.string()), 706 + 'x-enum-varnames': v.optional(v.string()), 707 + 'x-enumNames': v.optional(v.string()), 708 + title: v.optional(v.string()), 709 + object: v.optional(v.object({ 710 + description: v.optional(v.string()), 711 + 'x-enum-descriptions': v.optional(v.string()), 712 + 'x-enum-varnames': v.optional(v.string()), 713 + 'x-enumNames': v.optional(v.string()), 714 + title: v.optional(v.string()) 715 + })), 716 + array: v.optional(v.array(v.object({ 717 + description: v.optional(v.string()), 718 + 'x-enum-descriptions': v.optional(v.string()), 719 + 'x-enum-varnames': v.optional(v.string()), 720 + 'x-enumNames': v.optional(v.string()), 721 + title: v.optional(v.string()) 722 + }))) 723 + }); 724 + 725 + export const vIoK8sApimachineryPkgApisMetaV1Preconditions = v.object({ 726 + resourceVersion: v.optional(v.string()), 727 + uid: v.optional(v.string()) 728 + }); 729 + 730 + export const vIoK8sApimachineryPkgApisMetaV1DeleteOptions = v.object({ 731 + preconditions: v.optional(vIoK8sApimachineryPkgApisMetaV1Preconditions) 732 + }); 733 + 734 + export const vAdditionalPropertiesUnknownIssue = v.object({}); 735 + 736 + export const vAdditionalPropertiesUnknownIssue2 = v.object({}); 737 + 738 + export const vAdditionalPropertiesUnknownIssue3 = v.intersect([ 739 + v.string(), 740 + v.object({ 741 + entries: v.object({}) 742 + }) 743 + ]); 744 + 745 + export const vAdditionalPropertiesIntegerIssue = v.object({ 746 + value: v.pipe(v.number(), v.integer()) 747 + }); 748 + 749 + export const vGenericSchemaDuplicateIssue1SystemBoolean = v.object({ 750 + item: v.optional(v.boolean()), 751 + error: v.optional(v.union([ 752 + v.string(), 753 + v.null() 754 + ])), 755 + hasError: v.optional(v.pipe(v.boolean(), v.readonly())), 756 + data: v.optional(v.object({})) 757 + }); 758 + 759 + export const vGenericSchemaDuplicateIssue1SystemString = v.object({ 760 + item: v.optional(v.union([ 761 + v.string(), 762 + v.null() 763 + ])), 764 + error: v.optional(v.union([ 765 + v.string(), 766 + v.null() 767 + ])), 768 + hasError: v.optional(v.pipe(v.boolean(), v.readonly())) 769 + }); 770 + 771 + export const vOneOfAllOfIssue = v.union([ 772 + v.intersect([ 773 + v.union([ 774 + vConstValue, 775 + vGenericSchemaDuplicateIssue1SystemBoolean 776 + ]), 777 + v3eNum1Период 778 + ]), 779 + vGenericSchemaDuplicateIssue1SystemString 780 + ]); 781 + 782 + export const vImportResponse = v.union([ 783 + vModelFromZendesk, 784 + vModelWithReadOnlyAndWriteOnly 785 + ]); 786 + 787 + export const vApiVVersionODataControllerCountResponse = vModelFromZendesk; 788 + 789 + export const vGetApiVbyApiVersionSimpleOperationResponse = v.number(); 790 + 791 + export const vPostCallWithOptionalParamResponse = v.union([ 792 + v.number(), 793 + v.void() 794 + ]); 795 + 796 + export const vCallWithNoContentResponseResponse = v.void(); 797 + 798 + export const vCallWithResponseAndNoContentResponseResponse = v.union([ 799 + v.number(), 800 + v.void() 801 + ]); 802 + 803 + export const vDummyAResponse = v400; 804 + 805 + export const vDummyBResponse = v.void(); 806 + 807 + export const vCallWithResponseResponse = vImport; 808 + 809 + export const vCallWithDuplicateResponsesResponse = v.union([ 810 + v.intersect([ 811 + vModelWithBoolean, 812 + vModelWithInteger 813 + ]), 814 + vModelWithString 815 + ]); 816 + 817 + export const vCallWithResponsesResponse = v.union([ 818 + v.object({ 819 + '@namespace.string': v.optional(v.pipe(v.string(), v.readonly())), 820 + '@namespace.integer': v.optional(v.pipe(v.pipe(v.number(), v.integer()), v.readonly())), 821 + value: v.optional(v.pipe(v.array(vModelWithString), v.readonly())) 822 + }), 823 + vModelThatExtends, 824 + vModelThatExtendsExtends 825 + ]); 826 + 827 + export const vTypesResponse = v.union([ 828 + v.number(), 829 + v.string(), 830 + v.boolean(), 831 + v.object({}) 832 + ]); 833 + 834 + export const vUploadFileResponse = v.boolean(); 835 + 836 + export const vFileResponseResponse = v.string(); 837 + 838 + export const vComplexTypesResponse = v.array(vModelWithString); 839 + 840 + export const vMultipartResponseResponse = v.object({ 841 + file: v.optional(v.string()), 842 + metadata: v.optional(v.object({ 843 + foo: v.optional(v.string()), 844 + bar: v.optional(v.string()) 845 + })) 846 + }); 847 + 848 + export const vComplexParamsResponse = vModelWithString; 849 + 850 + export const vNonAsciiæøåÆøÅöôêÊ字符串Response = v.array(vNonAsciiStringæøåÆøÅöôêÊ字符串);
+19
packages/openapi-ts-tests/test/__snapshots__/3.1.x/schema-const/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vFoo = v.object({ 6 + foo: v.optional(v.literal('foo')), 7 + bar: v.optional(v.literal(3.2)), 8 + baz: v.optional(v.literal(-1)), 9 + qux: v.optional(v.literal(true)), 10 + quux: v.optional(v.tuple([ 11 + v.literal(1), 12 + v.literal(2), 13 + v.literal(3), 14 + v.literal('foo'), 15 + v.literal(true) 16 + ])), 17 + corge: v.optional(v.object({})), 18 + garply: v.optional(v.bigint()) 19 + });
+7
packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators-bigint-min-max/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vFoo = v.object({ 6 + foo: v.optional(v.pipe(v.bigint(), v.minValue(BigInt(0)), v.maxValue(BigInt(100)))) 7 + });
+16
packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators-circular-ref-2/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vBar: v.GenericSchema = v.object({ 6 + bar: v.union([ 7 + v.array(v.lazy(() => { 8 + return vBar; 9 + })), 10 + v.null() 11 + ]) 12 + }); 13 + 14 + export const vFoo: v.GenericSchema = v.object({ 15 + foo: vBar 16 + });
+19
packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators-circular-ref/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vBar: v.GenericSchema = v.object({ 6 + bar: v.optional(v.array(v.lazy(() => { 7 + return vBar; 8 + }))) 9 + }); 10 + 11 + export const vFoo: v.GenericSchema = v.object({ 12 + foo: v.optional(vBar) 13 + }); 14 + 15 + export const vQux: v.GenericSchema = v.lazy(() => { 16 + return vQux; 17 + }); 18 + 19 + export const vBaz: v.GenericSchema = vQux;
+19
packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators-union-merge/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vBar = v.union([ 6 + v.object({ 7 + bar: v.string() 8 + }), 9 + v.object({ 10 + baz: v.string() 11 + }) 12 + ]); 13 + 14 + export const vFoo = v.intersect([ 15 + vBar, 16 + v.object({ 17 + foo: v.string() 18 + }) 19 + ]);
+23
packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators/valibot.gen.ts
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + import * as v from 'valibot'; 4 + 5 + export const vBar: v.GenericSchema = v.object({ 6 + foo: v.optional(v.lazy(() => { 7 + return vFoo; 8 + })) 9 + }); 10 + 11 + export const vFoo: v.GenericSchema = v.optional(v.union([ 12 + v.object({ 13 + foo: v.optional(v.pipe(v.string(), v.regex(/^\d{3}-\d{2}-\d{4}$/))), 14 + bar: v.optional(vBar), 15 + baz: v.optional(v.array(v.lazy(() => { 16 + return vFoo; 17 + }))), 18 + qux: v.optional(v.number(), 0) 19 + }), 20 + v.null() 21 + ]), null); 22 + 23 + export const vBaz = v.optional(v.pipe(v.pipe(v.string(), v.regex(/foo\nbar/)), v.readonly()), 'baz');
packages/openapi-ts-tests/test/__snapshots__/3.1.x/zod-bigint-min-max/zod.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators-bigint-min-max/zod.gen.ts
packages/openapi-ts-tests/test/__snapshots__/3.1.x/zod-circular-ref-2/zod.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators-circular-ref-2/zod.gen.ts
packages/openapi-ts-tests/test/__snapshots__/3.1.x/zod-circular-ref/zod.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators-circular-ref/zod.gen.ts
packages/openapi-ts-tests/test/__snapshots__/3.1.x/zod-union-merge/zod.gen.ts packages/openapi-ts-tests/test/__snapshots__/3.1.x/validators-union-merge/zod.gen.ts
+7 -3
packages/openapi-ts-tests/test/openapi-ts.config.ts
··· 36 36 // openapi: '3.1.0', 37 37 // paths: {}, 38 38 // }, 39 - path: path.resolve(__dirname, 'spec', '3.1.x', 'enum-null.json'), 39 + path: path.resolve(__dirname, 'spec', '3.1.x', 'full.json'), 40 40 // path: 'http://localhost:4000/', 41 41 // path: 'https://get.heyapi.dev/', 42 42 // path: 'https://get.heyapi.dev/hey-api/backend?branch=main&version=1.0.0', ··· 84 84 // auth: false, 85 85 // client: false, 86 86 // include... 87 - // name: '@hey-api/sdk', 87 + name: '@hey-api/sdk', 88 88 // operationId: false, 89 89 // serviceNameBuilder: '^Parameters', 90 90 // throwOnError: true, 91 91 // transformer: '@hey-api/transformers', 92 92 // transformer: true, 93 - // validator: 'zod', 93 + validator: 'valibot', 94 94 }, 95 95 { 96 96 bigInt: true, ··· 116 116 { 117 117 exportFromIndex: true, 118 118 // name: '@tanstack/react-query', 119 + }, 120 + { 121 + // exportFromIndex: true, 122 + name: 'valibot', 119 123 }, 120 124 { 121 125 // exportFromIndex: true,
+25 -1
packages/openapi-ts-tests/test/plugins.test.ts
··· 241 241 { 242 242 config: createConfig({ 243 243 output: 'default', 244 + plugins: ['valibot'], 245 + }), 246 + description: 'generate Valibot schemas with Valibot plugin', 247 + }, 248 + { 249 + config: createConfig({ 250 + output: 'default', 244 251 plugins: ['zod'], 245 252 }), 246 253 description: 'generate Zod schemas with Zod plugin', ··· 248 255 { 249 256 config: createConfig({ 250 257 input: 'type-format.yaml', 251 - output: 'type-format', 258 + output: 'type-format-valibot', 259 + plugins: [ 260 + '@hey-api/transformers', 261 + '@hey-api/client-fetch', 262 + 'valibot', 263 + { 264 + name: '@hey-api/sdk', 265 + transformer: true, 266 + validator: true, 267 + }, 268 + ], 269 + }), 270 + description: 'handles various schema types and formats', 271 + }, 272 + { 273 + config: createConfig({ 274 + input: 'type-format.yaml', 275 + output: 'type-format-zod', 252 276 plugins: [ 253 277 '@hey-api/transformers', 254 278 '@hey-api/client-fetch',
+1 -1
packages/openapi-ts-tests/test/spec/3.1.x/zod-bigint-min-max.json packages/openapi-ts-tests/test/spec/3.1.x/validators-bigint-min-max.json
··· 1 1 { 2 2 "openapi": "3.1.0", 3 3 "info": { 4 - "title": "OpenAPI 3.1.0 zod bigint min max example", 4 + "title": "OpenAPI 3.1.0 validators bigint min max example", 5 5 "version": "1" 6 6 }, 7 7 "components": {
+1 -1
packages/openapi-ts-tests/test/spec/3.1.x/zod-circular-ref-2.yaml packages/openapi-ts-tests/test/spec/3.1.x/validators-circular-ref-2.yaml
··· 1 1 openapi: 3.1.1 2 2 info: 3 - title: OpenAPI 3.1.1 zod circular ref 2 example 3 + title: OpenAPI 3.1.1 validators circular ref 2 example 4 4 version: 1 5 5 components: 6 6 schemas:
+1 -1
packages/openapi-ts-tests/test/spec/3.1.x/zod-circular-ref.json packages/openapi-ts-tests/test/spec/3.1.x/validators-circular-ref.json
··· 1 1 { 2 2 "openapi": "3.1.0", 3 3 "info": { 4 - "title": "OpenAPI 3.1.0 zod circular reference example", 4 + "title": "OpenAPI 3.1.0 validators circular reference example", 5 5 "version": "1" 6 6 }, 7 7 "components": {
+1 -1
packages/openapi-ts-tests/test/spec/3.1.x/zod-union-merge.json packages/openapi-ts-tests/test/spec/3.1.x/validators-union-merge.json
··· 1 1 { 2 2 "openapi": "3.1.0", 3 3 "info": { 4 - "title": "OpenAPI 3.1.0 zod union merge example", 4 + "title": "OpenAPI 3.1.0 validators union merge example", 5 5 "version": "1" 6 6 }, 7 7 "components": {
+19 -7
packages/openapi-ts/src/compiler/module.ts
··· 187 187 const hasNonTypeImport = importedTypes.some( 188 188 (item) => typeof item !== 'object' || !item.asType, 189 189 ); 190 - const elements = importedTypes.map((name) => { 190 + let namespaceImport: ImportExportItemObject | undefined; 191 + const elements: Array<ts.ImportSpecifier> = []; 192 + importedTypes.forEach((name) => { 191 193 const item = typeof name === 'string' ? { name } : name; 192 - return ots.import({ 193 - alias: item.alias, 194 - asType: hasNonTypeImport && item.asType, 195 - name: item.name, 196 - }); 194 + if (item.name === '*' && item.alias) { 195 + namespaceImport = item; 196 + } else { 197 + elements.push( 198 + ots.import({ 199 + alias: item.alias, 200 + asType: hasNonTypeImport && item.asType, 201 + name: item.name, 202 + }), 203 + ); 204 + } 197 205 }); 198 - const namedBindings = ts.factory.createNamedImports(elements); 206 + const namedBindings = namespaceImport 207 + ? ts.factory.createNamespaceImport( 208 + createIdentifier({ text: namespaceImport.alias! }), 209 + ) 210 + : ts.factory.createNamedImports(elements); 199 211 const importClause = ts.factory.createImportClause( 200 212 !hasNonTypeImport, 201 213 undefined,
+10 -48
packages/openapi-ts/src/plugins/@hey-api/sdk/plugin.ts
··· 12 12 import { getServiceName } from '../../../utils/postprocess'; 13 13 import { transformServiceName } from '../../../utils/transform'; 14 14 import { createOperationComment } from '../../shared/utils/operation'; 15 - import { operationIrRef } from '../../shared/utils/ref'; 16 15 import type { Plugin } from '../../types'; 17 - import { zodId } from '../../zod/plugin'; 18 16 import { clientId, getClientPlugin } from '../client-core/utils'; 19 17 import { 20 18 operationTransformerIrRef, ··· 29 27 import { serviceFunctionIdentifier } from './plugin-legacy'; 30 28 import { createTypeOptions } from './typeOptions'; 31 29 import type { Config } from './types'; 30 + import { createResponseValidator } from './validator'; 32 31 33 32 // copy-pasted from @hey-api/client-core 34 33 export interface Auth { ··· 394 393 } 395 394 } 396 395 397 - if (plugin.validator === 'zod') { 398 - const identifierSchema = context.file({ id: zodId })!.identifier({ 399 - $ref: operationIrRef({ 400 - case: 'camelCase', 401 - config: context.config, 402 - id: operation.id, 403 - type: 'response', 404 - }), 405 - namespace: 'value', 396 + const responseValidator = createResponseValidator({ 397 + context, 398 + operation, 399 + plugin, 400 + }); 401 + if (responseValidator) { 402 + requestOptions.push({ 403 + key: 'responseValidator', 404 + value: responseValidator, 406 405 }); 407 - 408 - if (identifierSchema.name) { 409 - file.import({ 410 - module: file.relativePathToFile({ 411 - context, 412 - id: zodId, 413 - }), 414 - name: identifierSchema.name, 415 - }); 416 - 417 - requestOptions.push({ 418 - key: 'responseValidator', 419 - value: compiler.arrowFunction({ 420 - async: true, 421 - parameters: [ 422 - { 423 - name: 'data', 424 - }, 425 - ], 426 - statements: [ 427 - compiler.returnStatement({ 428 - expression: compiler.awaitExpression({ 429 - expression: compiler.callExpression({ 430 - functionName: compiler.propertyAccessExpression({ 431 - expression: compiler.identifier({ 432 - text: identifierSchema.name, 433 - }), 434 - name: compiler.identifier({ text: 'parseAsync' }), 435 - }), 436 - parameters: [compiler.identifier({ text: 'data' })], 437 - }), 438 - }), 439 - }), 440 - ], 441 - }), 442 - }); 443 - } 444 406 } 445 407 446 408 requestOptions.push({
+150
packages/openapi-ts/src/plugins/@hey-api/sdk/validator.ts
··· 1 + import { compiler } from '../../../compiler'; 2 + import type { IR } from '../../../ir/types'; 3 + import { operationIrRef } from '../../shared/utils/ref'; 4 + import type { Plugin } from '../../types'; 5 + import { valibotId } from '../../valibot/constants'; 6 + import { zodId } from '../../zod/plugin'; 7 + import { sdkId } from './constants'; 8 + import type { Config } from './types'; 9 + 10 + const identifiers = { 11 + data: compiler.identifier({ text: 'data' }), 12 + parseAsync: compiler.identifier({ text: 'parseAsync' }), 13 + v: compiler.identifier({ text: 'v' }), 14 + }; 15 + 16 + const valibotResponseValidator = ({ 17 + context, 18 + operation, 19 + }: { 20 + context: IR.Context; 21 + operation: IR.OperationObject; 22 + }) => { 23 + const file = context.file({ id: sdkId })!; 24 + 25 + const identifierSchema = context.file({ id: valibotId })!.identifier({ 26 + $ref: operationIrRef({ 27 + case: 'camelCase', 28 + config: context.config, 29 + id: operation.id, 30 + type: 'response', 31 + }), 32 + namespace: 'value', 33 + }); 34 + 35 + if (!identifierSchema.name) { 36 + return; 37 + } 38 + 39 + file.import({ 40 + module: file.relativePathToFile({ 41 + context, 42 + id: valibotId, 43 + }), 44 + name: identifierSchema.name, 45 + }); 46 + 47 + file.import({ 48 + alias: identifiers.v.text, 49 + module: 'valibot', 50 + name: '*', 51 + }); 52 + 53 + return compiler.arrowFunction({ 54 + async: true, 55 + parameters: [ 56 + { 57 + name: 'data', 58 + }, 59 + ], 60 + statements: [ 61 + compiler.returnStatement({ 62 + expression: compiler.awaitExpression({ 63 + expression: compiler.callExpression({ 64 + functionName: compiler.propertyAccessExpression({ 65 + expression: identifiers.v, 66 + name: identifiers.parseAsync, 67 + }), 68 + parameters: [ 69 + compiler.identifier({ text: identifierSchema.name }), 70 + identifiers.data, 71 + ], 72 + }), 73 + }), 74 + }), 75 + ], 76 + }); 77 + }; 78 + 79 + const zodResponseValidator = ({ 80 + context, 81 + operation, 82 + }: { 83 + context: IR.Context; 84 + operation: IR.OperationObject; 85 + }) => { 86 + const file = context.file({ id: sdkId })!; 87 + 88 + const identifierSchema = context.file({ id: zodId })!.identifier({ 89 + $ref: operationIrRef({ 90 + case: 'camelCase', 91 + config: context.config, 92 + id: operation.id, 93 + type: 'response', 94 + }), 95 + namespace: 'value', 96 + }); 97 + 98 + if (!identifierSchema.name) { 99 + return; 100 + } 101 + 102 + file.import({ 103 + module: file.relativePathToFile({ 104 + context, 105 + id: zodId, 106 + }), 107 + name: identifierSchema.name, 108 + }); 109 + 110 + return compiler.arrowFunction({ 111 + async: true, 112 + parameters: [ 113 + { 114 + name: 'data', 115 + }, 116 + ], 117 + statements: [ 118 + compiler.returnStatement({ 119 + expression: compiler.awaitExpression({ 120 + expression: compiler.callExpression({ 121 + functionName: compiler.propertyAccessExpression({ 122 + expression: compiler.identifier({ text: identifierSchema.name }), 123 + name: identifiers.parseAsync, 124 + }), 125 + parameters: [identifiers.data], 126 + }), 127 + }), 128 + }), 129 + ], 130 + }); 131 + }; 132 + 133 + export const createResponseValidator = ({ 134 + context, 135 + operation, 136 + plugin, 137 + }: { 138 + context: IR.Context; 139 + operation: IR.OperationObject; 140 + plugin: Plugin.Instance<Config>; 141 + }) => { 142 + switch (plugin.validator) { 143 + case 'valibot': 144 + return valibotResponseValidator({ context, operation }); 145 + case 'zod': 146 + return zodResponseValidator({ context, operation }); 147 + default: 148 + return; 149 + } 150 + };
+4
packages/openapi-ts/src/plugins/index.ts
··· 72 72 } from './@tanstack/vue-query'; 73 73 import { type Config as Fastify, defaultConfig as fastify } from './fastify'; 74 74 import type { DefaultPluginConfigs, Plugin } from './types'; 75 + import { type Config as Valibot, defaultConfig as valibot } from './valibot'; 75 76 import { type Config as Zod, defaultConfig as zod } from './zod'; 76 77 77 78 /** ··· 97 98 | Plugin.UserConfig<TanStackSvelteQuery> 98 99 | Plugin.UserConfig<TanStackVueQuery> 99 100 | Plugin.UserConfig<Fastify> 101 + | Plugin.UserConfig<Valibot> 100 102 | Plugin.UserConfig<Zod>; 101 103 102 104 /** ··· 122 124 | Plugin.Config<TanStackSvelteQuery> 123 125 | Plugin.Config<TanStackVueQuery> 124 126 | Plugin.Config<Fastify> 127 + | Plugin.Config<Valibot> 125 128 | Plugin.Config<Zod>; 126 129 127 130 export const defaultPluginConfigs: DefaultPluginConfigs<ClientPlugins> = { ··· 144 147 'legacy/fetch': heyApiLegacyFetch, 145 148 'legacy/node': heyApiLegacyNode, 146 149 'legacy/xhr': heyApiLegacyXhr, 150 + valibot, 147 151 zod, 148 152 };
+1 -1
packages/openapi-ts/src/plugins/types.d.ts
··· 19 19 | 'legacy/node' 20 20 | 'legacy/xhr'; 21 21 22 - export type PluginValidatorNames = 'zod'; 22 + export type PluginValidatorNames = 'valibot' | 'zod'; 23 23 24 24 export type PluginNames = 25 25 | PluginClientNames
+20
packages/openapi-ts/src/plugins/valibot/config.ts
··· 1 + import type { Plugin } from '../types'; 2 + import { handler } from './plugin'; 3 + import type { Config } from './types'; 4 + 5 + export const defaultConfig: Plugin.Config<Config> = { 6 + _handler: handler, 7 + _handlerLegacy: () => {}, 8 + _tags: ['validator'], 9 + exportFromIndex: false, 10 + name: 'valibot', 11 + output: 'valibot', 12 + }; 13 + 14 + /** 15 + * Type helper for Valibot plugin, returns {@link Plugin.Config} object 16 + */ 17 + export const defineConfig: Plugin.DefineConfig<Config> = (config) => ({ 18 + ...defaultConfig, 19 + ...config, 20 + });
+225
packages/openapi-ts/src/plugins/valibot/constants.ts
··· 1 + import { compiler } from '../../compiler'; 2 + 3 + export const identifiers = { 4 + /** 5 + * {@link https://valibot.dev/api/#actions Actions} 6 + */ 7 + actions: { 8 + args: compiler.identifier({ text: 'args' }), 9 + base64: compiler.identifier({ text: 'base64' }), 10 + bic: compiler.identifier({ text: 'bic' }), 11 + brand: compiler.identifier({ text: 'brand' }), 12 + bytes: compiler.identifier({ text: 'bytes' }), 13 + check: compiler.identifier({ text: 'check' }), 14 + checkItems: compiler.identifier({ text: 'checkItems' }), 15 + creditCard: compiler.identifier({ text: 'creditCard' }), 16 + cuid2: compiler.identifier({ text: 'cuid2' }), 17 + decimal: compiler.identifier({ text: 'decimal' }), 18 + description: compiler.identifier({ text: 'description' }), 19 + digits: compiler.identifier({ text: 'digits' }), 20 + email: compiler.identifier({ text: 'email' }), 21 + emoji: compiler.identifier({ text: 'emoji' }), 22 + empty: compiler.identifier({ text: 'empty' }), 23 + endsWith: compiler.identifier({ text: 'endsWith' }), 24 + entries: compiler.identifier({ text: 'entries' }), 25 + everyItem: compiler.identifier({ text: 'everyItem' }), 26 + excludes: compiler.identifier({ text: 'excludes' }), 27 + filterItems: compiler.identifier({ text: 'filterItems' }), 28 + findItem: compiler.identifier({ text: 'findItem' }), 29 + finite: compiler.identifier({ text: 'finite' }), 30 + flavor: compiler.identifier({ text: 'flavor' }), 31 + graphemes: compiler.identifier({ text: 'graphemes' }), 32 + gtValue: compiler.identifier({ text: 'gtValue' }), 33 + hash: compiler.identifier({ text: 'hash' }), 34 + hexColor: compiler.identifier({ text: 'hexColor' }), 35 + hexadecimal: compiler.identifier({ text: 'hexadecimal' }), 36 + imei: compiler.identifier({ text: 'imei' }), 37 + includes: compiler.identifier({ text: 'includes' }), 38 + integer: compiler.identifier({ text: 'integer' }), 39 + ip: compiler.identifier({ text: 'ip' }), 40 + ipv4: compiler.identifier({ text: 'ipv4' }), 41 + ipv6: compiler.identifier({ text: 'ipv6' }), 42 + isoDate: compiler.identifier({ text: 'isoDate' }), 43 + isoDateTime: compiler.identifier({ text: 'isoDateTime' }), 44 + isoTime: compiler.identifier({ text: 'isoTime' }), 45 + isoTimeSecond: compiler.identifier({ text: 'isoTimeSecond' }), 46 + isoTimestamp: compiler.identifier({ text: 'isoTimestamp' }), 47 + isoWeek: compiler.identifier({ text: 'isoWeek' }), 48 + length: compiler.identifier({ text: 'length' }), 49 + ltValue: compiler.identifier({ text: 'ltValue' }), 50 + mac: compiler.identifier({ text: 'mac' }), 51 + mac48: compiler.identifier({ text: 'mac48' }), 52 + mac64: compiler.identifier({ text: 'mac64' }), 53 + mapItems: compiler.identifier({ text: 'mapItems' }), 54 + maxBytes: compiler.identifier({ text: 'maxBytes' }), 55 + maxEntries: compiler.identifier({ text: 'maxEntries' }), 56 + maxGraphemes: compiler.identifier({ text: 'maxGraphemes' }), 57 + maxLength: compiler.identifier({ text: 'maxLength' }), 58 + maxSize: compiler.identifier({ text: 'maxSize' }), 59 + maxValue: compiler.identifier({ text: 'maxValue' }), 60 + maxWords: compiler.identifier({ text: 'maxWords' }), 61 + metadata: compiler.identifier({ text: 'metadata' }), 62 + mimeType: compiler.identifier({ text: 'mimeType' }), 63 + minBytes: compiler.identifier({ text: 'minBytes' }), 64 + minEntries: compiler.identifier({ text: 'minEntries' }), 65 + minGraphemes: compiler.identifier({ text: 'minGraphemes' }), 66 + minLength: compiler.identifier({ text: 'minLength' }), 67 + minSize: compiler.identifier({ text: 'minSize' }), 68 + minValue: compiler.identifier({ text: 'minValue' }), 69 + minWords: compiler.identifier({ text: 'minWords' }), 70 + multipleOf: compiler.identifier({ text: 'multipleOf' }), 71 + nanoid: compiler.identifier({ text: 'nanoid' }), 72 + nonEmpty: compiler.identifier({ text: 'nonEmpty' }), 73 + normalize: compiler.identifier({ text: 'normalize' }), 74 + notBytes: compiler.identifier({ text: 'notBytes' }), 75 + notEntries: compiler.identifier({ text: 'notEntries' }), 76 + notGraphemes: compiler.identifier({ text: 'notGraphemes' }), 77 + notLength: compiler.identifier({ text: 'notLength' }), 78 + notSize: compiler.identifier({ text: 'notSize' }), 79 + notValue: compiler.identifier({ text: 'notValue' }), 80 + notValues: compiler.identifier({ text: 'notValues' }), 81 + notWords: compiler.identifier({ text: 'notWords' }), 82 + octal: compiler.identifier({ text: 'octal' }), 83 + parseJson: compiler.identifier({ text: 'parseJson' }), 84 + partialCheck: compiler.identifier({ text: 'partialCheck' }), 85 + rawCheck: compiler.identifier({ text: 'rawCheck' }), 86 + rawTransform: compiler.identifier({ text: 'rawTransform' }), 87 + readonly: compiler.identifier({ text: 'readonly' }), 88 + reduceItems: compiler.identifier({ text: 'reduceItems' }), 89 + regex: compiler.identifier({ text: 'regex' }), 90 + returns: compiler.identifier({ text: 'returns' }), 91 + rfcEmail: compiler.identifier({ text: 'rfcEmail' }), 92 + safeInteger: compiler.identifier({ text: 'safeInteger' }), 93 + size: compiler.identifier({ text: 'size' }), 94 + slug: compiler.identifier({ text: 'slug' }), 95 + someItem: compiler.identifier({ text: 'someItem' }), 96 + sortItems: compiler.identifier({ text: 'sortItems' }), 97 + startsWith: compiler.identifier({ text: 'startsWith' }), 98 + stringifyJson: compiler.identifier({ text: 'stringifyJson' }), 99 + title: compiler.identifier({ text: 'title' }), 100 + toLowerCase: compiler.identifier({ text: 'toLowerCase' }), 101 + toMaxValue: compiler.identifier({ text: 'toMaxValue' }), 102 + toMinValue: compiler.identifier({ text: 'toMinValue' }), 103 + toUpperCase: compiler.identifier({ text: 'toUpperCase' }), 104 + transform: compiler.identifier({ text: 'transform' }), 105 + trim: compiler.identifier({ text: 'trim' }), 106 + trimEnd: compiler.identifier({ text: 'trimEnd' }), 107 + trimStart: compiler.identifier({ text: 'trimStart' }), 108 + ulid: compiler.identifier({ text: 'ulid' }), 109 + url: compiler.identifier({ text: 'url' }), 110 + uuid: compiler.identifier({ text: 'uuid' }), 111 + value: compiler.identifier({ text: 'value' }), 112 + values: compiler.identifier({ text: 'values' }), 113 + words: compiler.identifier({ text: 'words' }), 114 + }, 115 + /** 116 + * {@link https://valibot.dev/api/#async Async} 117 + */ 118 + async: { 119 + // TODO: implement if necessary 120 + }, 121 + /** 122 + * {@link https://valibot.dev/api/#methods Methods} 123 + */ 124 + methods: { 125 + assert: compiler.identifier({ text: 'assert' }), 126 + config: compiler.identifier({ text: 'config' }), 127 + fallback: compiler.identifier({ text: 'fallback' }), 128 + flatten: compiler.identifier({ text: 'flatten' }), 129 + forward: compiler.identifier({ text: 'forward' }), 130 + getDefault: compiler.identifier({ text: 'getDefault' }), 131 + getDefaults: compiler.identifier({ text: 'getDefaults' }), 132 + getDescription: compiler.identifier({ text: 'getDescription' }), 133 + getFallback: compiler.identifier({ text: 'getFallback' }), 134 + getFallbacks: compiler.identifier({ text: 'getFallbacks' }), 135 + getMetadata: compiler.identifier({ text: 'getMetadata' }), 136 + getTitle: compiler.identifier({ text: 'getTitle' }), 137 + is: compiler.identifier({ text: 'is' }), 138 + keyof: compiler.identifier({ text: 'keyof' }), 139 + message: compiler.identifier({ text: 'message' }), 140 + omit: compiler.identifier({ text: 'omit' }), 141 + parse: compiler.identifier({ text: 'parse' }), 142 + parser: compiler.identifier({ text: 'parser' }), 143 + partial: compiler.identifier({ text: 'partial' }), 144 + pick: compiler.identifier({ text: 'pick' }), 145 + pipe: compiler.identifier({ text: 'pipe' }), 146 + required: compiler.identifier({ text: 'required' }), 147 + safeParse: compiler.identifier({ text: 'safeParse' }), 148 + safeParser: compiler.identifier({ text: 'safeParser' }), 149 + summarize: compiler.identifier({ text: 'summarize' }), 150 + unwrap: compiler.identifier({ text: 'unwrap' }), 151 + }, 152 + /** 153 + * {@link https://valibot.dev/api/#schemas Schemas} 154 + */ 155 + schemas: { 156 + any: compiler.identifier({ text: 'any' }), 157 + array: compiler.identifier({ text: 'array' }), 158 + bigInt: compiler.identifier({ text: 'bigint' }), 159 + blob: compiler.identifier({ text: 'blob' }), 160 + boolean: compiler.identifier({ text: 'boolean' }), 161 + custom: compiler.identifier({ text: 'custom' }), 162 + date: compiler.identifier({ text: 'date' }), 163 + enum: compiler.identifier({ text: 'enum' }), 164 + exactOptional: compiler.identifier({ text: 'exactOptional' }), 165 + file: compiler.identifier({ text: 'file' }), 166 + function: compiler.identifier({ text: 'function' }), 167 + instance: compiler.identifier({ text: 'instance' }), 168 + intersect: compiler.identifier({ text: 'intersect' }), 169 + lazy: compiler.identifier({ text: 'lazy' }), 170 + literal: compiler.identifier({ text: 'literal' }), 171 + looseObject: compiler.identifier({ text: 'looseObject' }), 172 + looseTuple: compiler.identifier({ text: 'looseTuple' }), 173 + map: compiler.identifier({ text: 'map' }), 174 + nan: compiler.identifier({ text: 'nan' }), 175 + never: compiler.identifier({ text: 'never' }), 176 + nonNullable: compiler.identifier({ text: 'nonNullable' }), 177 + nonNullish: compiler.identifier({ text: 'nonNullish' }), 178 + nonOptional: compiler.identifier({ text: 'nonOptional' }), 179 + null: compiler.identifier({ text: 'null' }), 180 + nullable: compiler.identifier({ text: 'nullable' }), 181 + nullish: compiler.identifier({ text: 'nullish' }), 182 + number: compiler.identifier({ text: 'number' }), 183 + object: compiler.identifier({ text: 'object' }), 184 + objectWithRest: compiler.identifier({ text: 'objectWithRest' }), 185 + optional: compiler.identifier({ text: 'optional' }), 186 + picklist: compiler.identifier({ text: 'picklist' }), 187 + promise: compiler.identifier({ text: 'promise' }), 188 + record: compiler.identifier({ text: 'record' }), 189 + set: compiler.identifier({ text: 'set' }), 190 + strictObject: compiler.identifier({ text: 'strictObject' }), 191 + strictTuple: compiler.identifier({ text: 'strictTuple' }), 192 + string: compiler.identifier({ text: 'string' }), 193 + symbol: compiler.identifier({ text: 'symbol' }), 194 + tuple: compiler.identifier({ text: 'tuple' }), 195 + tupleWithRest: compiler.identifier({ text: 'tupleWithRest' }), 196 + undefined: compiler.identifier({ text: 'undefined' }), 197 + undefinedable: compiler.identifier({ text: 'undefinedable' }), 198 + union: compiler.identifier({ text: 'union' }), 199 + unknown: compiler.identifier({ text: 'unknown' }), 200 + variant: compiler.identifier({ text: 'variant' }), 201 + void: compiler.identifier({ text: 'void' }), 202 + }, 203 + /** 204 + * {@link https://valibot.dev/api/#storages Storages} 205 + */ 206 + storages: { 207 + // TODO: implement if necessary 208 + }, 209 + /** 210 + * {@link https://valibot.dev/api/#types Types} 211 + */ 212 + types: { 213 + // TODO: implement if necessary 214 + GenericSchema: compiler.identifier({ text: 'GenericSchema' }), 215 + }, 216 + /** 217 + * {@link https://valibot.dev/api/#utils Utils} 218 + */ 219 + utils: { 220 + // TODO: implement if necessary 221 + }, 222 + v: compiler.identifier({ text: 'v' }), 223 + }; 224 + 225 + export const valibotId = 'valibot';
+2
packages/openapi-ts/src/plugins/valibot/index.ts
··· 1 + export { defaultConfig, defineConfig } from './config'; 2 + export type { Config } from './types';
+1126
packages/openapi-ts/src/plugins/valibot/plugin.ts
··· 1 + import ts from 'typescript'; 2 + 3 + import { compiler } from '../../compiler'; 4 + import { operationResponsesMap } from '../../ir/operation'; 5 + import { deduplicateSchema } from '../../ir/schema'; 6 + import type { IR } from '../../ir/types'; 7 + import { numberRegExp } from '../../utils/regexp'; 8 + import { operationIrRef } from '../shared/utils/ref'; 9 + import type { Plugin } from '../types'; 10 + import { identifiers, valibotId } from './constants'; 11 + import type { Config } from './types'; 12 + 13 + interface SchemaWithType<T extends Required<IR.SchemaObject>['type']> 14 + extends Omit<IR.SchemaObject, 'type'> { 15 + type: Extract<Required<IR.SchemaObject>['type'], T>; 16 + } 17 + 18 + interface Result { 19 + circularReferenceTracker: Set<string>; 20 + hasCircularReference: boolean; 21 + } 22 + 23 + const nameTransformer = (name: string) => `v-${name}`; 24 + 25 + const pipesToExpression = (pipes: Array<ts.Expression>) => { 26 + if (pipes.length === 1) { 27 + return pipes[0]!; 28 + } 29 + 30 + const expression = compiler.callExpression({ 31 + functionName: compiler.propertyAccessExpression({ 32 + expression: identifiers.v, 33 + name: identifiers.methods.pipe, 34 + }), 35 + parameters: pipes, 36 + }); 37 + return expression; 38 + }; 39 + 40 + const arrayTypeToValibotSchema = ({ 41 + context, 42 + result, 43 + schema, 44 + }: { 45 + context: IR.Context; 46 + result: Result; 47 + schema: SchemaWithType<'array'>; 48 + }): ts.CallExpression => { 49 + const functionName = compiler.propertyAccessExpression({ 50 + expression: identifiers.v, 51 + name: identifiers.schemas.array, 52 + }); 53 + 54 + let arrayExpression: ts.CallExpression | undefined; 55 + 56 + if (!schema.items) { 57 + arrayExpression = compiler.callExpression({ 58 + functionName, 59 + parameters: [ 60 + unknownTypeToValibotSchema({ 61 + context, 62 + schema: { 63 + type: 'unknown', 64 + }, 65 + }), 66 + ], 67 + }); 68 + } else { 69 + schema = deduplicateSchema({ schema }); 70 + 71 + // at least one item is guaranteed 72 + const itemExpressions = schema.items!.map((item) => { 73 + const schemaPipes = schemaToValibotSchema({ 74 + context, 75 + result, 76 + schema: item, 77 + }); 78 + return pipesToExpression(schemaPipes); 79 + }); 80 + 81 + if (itemExpressions.length === 1) { 82 + arrayExpression = compiler.callExpression({ 83 + functionName, 84 + parameters: itemExpressions, 85 + }); 86 + } else { 87 + if (schema.logicalOperator === 'and') { 88 + // TODO: parser - handle intersection 89 + // return compiler.typeArrayNode( 90 + // compiler.typeIntersectionNode({ types: itemExpressions }), 91 + // ); 92 + } 93 + 94 + // TODO: parser - handle union 95 + // return compiler.typeArrayNode(compiler.typeUnionNode({ types: itemExpressions })); 96 + 97 + arrayExpression = compiler.callExpression({ 98 + functionName, 99 + parameters: [ 100 + unknownTypeToValibotSchema({ 101 + context, 102 + schema: { 103 + type: 'unknown', 104 + }, 105 + }), 106 + ], 107 + }); 108 + } 109 + } 110 + 111 + if (schema.minItems === schema.maxItems && schema.minItems !== undefined) { 112 + arrayExpression = compiler.callExpression({ 113 + functionName: compiler.propertyAccessExpression({ 114 + expression: arrayExpression, 115 + name: identifiers.actions.length, 116 + }), 117 + parameters: [compiler.valueToExpression({ value: schema.minItems })], 118 + }); 119 + } else { 120 + if (schema.minItems !== undefined) { 121 + arrayExpression = compiler.callExpression({ 122 + functionName: compiler.propertyAccessExpression({ 123 + expression: arrayExpression, 124 + name: compiler.identifier({ text: 'min' }), 125 + }), 126 + parameters: [compiler.valueToExpression({ value: schema.minItems })], 127 + }); 128 + } 129 + 130 + if (schema.maxItems !== undefined) { 131 + arrayExpression = compiler.callExpression({ 132 + functionName: compiler.propertyAccessExpression({ 133 + expression: arrayExpression, 134 + name: compiler.identifier({ text: 'max' }), 135 + }), 136 + parameters: [compiler.valueToExpression({ value: schema.maxItems })], 137 + }); 138 + } 139 + } 140 + 141 + return arrayExpression; 142 + }; 143 + 144 + const booleanTypeToValibotSchema = ({ 145 + schema, 146 + }: { 147 + context: IR.Context; 148 + schema: SchemaWithType<'boolean'>; 149 + }) => { 150 + if (typeof schema.const === 'boolean') { 151 + const expression = compiler.callExpression({ 152 + functionName: compiler.propertyAccessExpression({ 153 + expression: identifiers.v, 154 + name: identifiers.schemas.literal, 155 + }), 156 + parameters: [compiler.ots.boolean(schema.const)], 157 + }); 158 + return expression; 159 + } 160 + 161 + const expression = compiler.callExpression({ 162 + functionName: compiler.propertyAccessExpression({ 163 + expression: identifiers.v, 164 + name: identifiers.schemas.boolean, 165 + }), 166 + }); 167 + return expression; 168 + }; 169 + 170 + const enumTypeToValibotSchema = ({ 171 + context, 172 + schema, 173 + }: { 174 + context: IR.Context; 175 + schema: SchemaWithType<'enum'>; 176 + }): ts.CallExpression => { 177 + const enumMembers: Array<ts.LiteralExpression> = []; 178 + 179 + let isNullable = false; 180 + 181 + for (const item of schema.items ?? []) { 182 + // Zod supports only string enums 183 + if (item.type === 'string' && typeof item.const === 'string') { 184 + enumMembers.push( 185 + compiler.stringLiteral({ 186 + text: item.const, 187 + }), 188 + ); 189 + } else if (item.type === 'null' || item.const === null) { 190 + isNullable = true; 191 + } 192 + } 193 + 194 + if (!enumMembers.length) { 195 + return unknownTypeToValibotSchema({ 196 + context, 197 + schema: { 198 + type: 'unknown', 199 + }, 200 + }); 201 + } 202 + 203 + let resultExpression = compiler.callExpression({ 204 + functionName: compiler.propertyAccessExpression({ 205 + expression: identifiers.v, 206 + name: identifiers.schemas.picklist, 207 + }), 208 + parameters: [ 209 + compiler.arrayLiteralExpression({ 210 + elements: enumMembers, 211 + multiLine: false, 212 + }), 213 + ], 214 + }); 215 + 216 + if (isNullable) { 217 + resultExpression = compiler.callExpression({ 218 + functionName: compiler.propertyAccessExpression({ 219 + expression: identifiers.v, 220 + name: identifiers.schemas.nullable, 221 + }), 222 + parameters: [resultExpression], 223 + }); 224 + } 225 + 226 + return resultExpression; 227 + }; 228 + 229 + const neverTypeToValibotSchema = ({ 230 + // eslint-disable-next-line @typescript-eslint/no-unused-vars 231 + schema, 232 + }: { 233 + context: IR.Context; 234 + schema: SchemaWithType<'never'>; 235 + }) => { 236 + const expression = compiler.callExpression({ 237 + functionName: compiler.propertyAccessExpression({ 238 + expression: identifiers.v, 239 + name: identifiers.schemas.never, 240 + }), 241 + }); 242 + return expression; 243 + }; 244 + 245 + const nullTypeToValibotSchema = ({ 246 + // eslint-disable-next-line @typescript-eslint/no-unused-vars 247 + schema, 248 + }: { 249 + context: IR.Context; 250 + schema: SchemaWithType<'null'>; 251 + }) => { 252 + const expression = compiler.callExpression({ 253 + functionName: compiler.propertyAccessExpression({ 254 + expression: identifiers.v, 255 + name: identifiers.schemas.null, 256 + }), 257 + }); 258 + return expression; 259 + }; 260 + 261 + const numberParameter = ({ 262 + isBigInt, 263 + value, 264 + }: { 265 + isBigInt: boolean; 266 + value: number; 267 + }) => { 268 + const expression = compiler.valueToExpression({ value }); 269 + 270 + if (isBigInt) { 271 + return compiler.callExpression({ 272 + functionName: 'BigInt', 273 + parameters: [expression], 274 + }); 275 + } 276 + 277 + return expression; 278 + }; 279 + 280 + const numberTypeToValibotSchema = ({ 281 + schema, 282 + }: { 283 + context: IR.Context; 284 + schema: SchemaWithType<'integer' | 'number'>; 285 + }) => { 286 + const isBigInt = schema.type === 'integer' && schema.format === 'int64'; 287 + 288 + if (typeof schema.const === 'number') { 289 + // TODO: parser - handle bigint constants 290 + const expression = compiler.callExpression({ 291 + functionName: compiler.propertyAccessExpression({ 292 + expression: identifiers.v, 293 + name: identifiers.schemas.literal, 294 + }), 295 + parameters: [compiler.ots.number(schema.const)], 296 + }); 297 + return expression; 298 + } 299 + 300 + const pipes: Array<ts.CallExpression> = []; 301 + 302 + // Zod uses coerce for bigint here, might be needed for Valibot too 303 + const expression = compiler.callExpression({ 304 + functionName: isBigInt 305 + ? compiler.propertyAccessExpression({ 306 + expression: identifiers.v, 307 + name: identifiers.schemas.bigInt, 308 + }) 309 + : compiler.propertyAccessExpression({ 310 + expression: identifiers.v, 311 + name: identifiers.schemas.number, 312 + }), 313 + }); 314 + pipes.push(expression); 315 + 316 + if (!isBigInt && schema.type === 'integer') { 317 + const expression = compiler.callExpression({ 318 + functionName: compiler.propertyAccessExpression({ 319 + expression: identifiers.v, 320 + name: identifiers.actions.integer, 321 + }), 322 + }); 323 + pipes.push(expression); 324 + } 325 + 326 + if (schema.exclusiveMinimum !== undefined) { 327 + const expression = compiler.callExpression({ 328 + functionName: compiler.propertyAccessExpression({ 329 + expression: identifiers.v, 330 + name: identifiers.actions.gtValue, 331 + }), 332 + parameters: [ 333 + numberParameter({ isBigInt, value: schema.exclusiveMinimum }), 334 + ], 335 + }); 336 + pipes.push(expression); 337 + } else if (schema.minimum !== undefined) { 338 + const expression = compiler.callExpression({ 339 + functionName: compiler.propertyAccessExpression({ 340 + expression: identifiers.v, 341 + name: identifiers.actions.minValue, 342 + }), 343 + parameters: [numberParameter({ isBigInt, value: schema.minimum })], 344 + }); 345 + pipes.push(expression); 346 + } 347 + 348 + if (schema.exclusiveMaximum !== undefined) { 349 + const expression = compiler.callExpression({ 350 + functionName: compiler.propertyAccessExpression({ 351 + expression: identifiers.v, 352 + name: identifiers.actions.ltValue, 353 + }), 354 + parameters: [ 355 + numberParameter({ isBigInt, value: schema.exclusiveMaximum }), 356 + ], 357 + }); 358 + pipes.push(expression); 359 + } else if (schema.maximum !== undefined) { 360 + const expression = compiler.callExpression({ 361 + functionName: compiler.propertyAccessExpression({ 362 + expression: identifiers.v, 363 + name: identifiers.actions.maxValue, 364 + }), 365 + parameters: [numberParameter({ isBigInt, value: schema.maximum })], 366 + }); 367 + pipes.push(expression); 368 + } 369 + 370 + return pipesToExpression(pipes); 371 + }; 372 + 373 + const objectTypeToValibotSchema = ({ 374 + context, 375 + result, 376 + schema, 377 + }: { 378 + context: IR.Context; 379 + result: Result; 380 + schema: SchemaWithType<'object'>; 381 + }): { 382 + anyType: string; 383 + expression: ts.CallExpression; 384 + } => { 385 + // TODO: parser - handle constants 386 + const properties: Array<ts.PropertyAssignment> = []; 387 + 388 + // let indexProperty: Property | undefined; 389 + // const schemaProperties: Array<Property> = []; 390 + // let indexPropertyItems: Array<IR.SchemaObject> = []; 391 + const required = schema.required ?? []; 392 + // let hasOptionalProperties = false; 393 + 394 + for (const name in schema.properties) { 395 + const property = schema.properties[name]!; 396 + const isRequired = required.includes(name); 397 + 398 + const schemaPipes = schemaToValibotSchema({ 399 + context, 400 + optional: !isRequired, 401 + result, 402 + schema: property, 403 + }); 404 + 405 + numberRegExp.lastIndex = 0; 406 + let propertyName; 407 + if (numberRegExp.test(name)) { 408 + // For numeric literals, we'll handle negative numbers by using a string literal 409 + // instead of trying to use a PrefixUnaryExpression 410 + propertyName = name.startsWith('-') 411 + ? ts.factory.createStringLiteral(name) 412 + : ts.factory.createNumericLiteral(name); 413 + } else { 414 + propertyName = name; 415 + } 416 + // TODO: parser - abstract safe property name logic 417 + if ( 418 + ((name.match(/^[0-9]/) && name.match(/\D+/g)) || name.match(/\W/g)) && 419 + !name.startsWith("'") && 420 + !name.endsWith("'") 421 + ) { 422 + propertyName = `'${name}'`; 423 + } 424 + properties.push( 425 + compiler.propertyAssignment({ 426 + initializer: pipesToExpression(schemaPipes), 427 + name: propertyName, 428 + }), 429 + ); 430 + 431 + // indexPropertyItems.push(property); 432 + // if (!isRequired) { 433 + // hasOptionalProperties = true; 434 + // } 435 + } 436 + 437 + // if ( 438 + // schema.additionalProperties && 439 + // (schema.additionalProperties.type !== 'never' || !indexPropertyItems.length) 440 + // ) { 441 + // if (schema.additionalProperties.type === 'never') { 442 + // indexPropertyItems = [schema.additionalProperties]; 443 + // } else { 444 + // indexPropertyItems.unshift(schema.additionalProperties); 445 + // } 446 + 447 + // if (hasOptionalProperties) { 448 + // indexPropertyItems.push({ 449 + // type: 'undefined', 450 + // }); 451 + // } 452 + 453 + // indexProperty = { 454 + // isRequired: true, 455 + // name: 'key', 456 + // type: schemaToValibotSchema({ 457 + // context, 458 + // schema: 459 + // indexPropertyItems.length === 1 460 + // ? indexPropertyItems[0] 461 + // : { 462 + // items: indexPropertyItems, 463 + // logicalOperator: 'or', 464 + // }, 465 + // }), 466 + // }; 467 + // } 468 + 469 + // return compiler.typeInterfaceNode({ 470 + // indexProperty, 471 + // properties: schemaProperties, 472 + // useLegacyResolution: false, 473 + // }); 474 + const expression = compiler.callExpression({ 475 + functionName: compiler.propertyAccessExpression({ 476 + expression: identifiers.v, 477 + name: identifiers.schemas.object, 478 + }), 479 + parameters: [ts.factory.createObjectLiteralExpression(properties, true)], 480 + }); 481 + return { 482 + // Zod uses AnyZodObject here, maybe we want to be more specific too 483 + anyType: identifiers.types.GenericSchema.text, 484 + expression, 485 + }; 486 + }; 487 + 488 + const stringTypeToValibotSchema = ({ 489 + schema, 490 + }: { 491 + context: IR.Context; 492 + schema: SchemaWithType<'string'>; 493 + }) => { 494 + if (typeof schema.const === 'string') { 495 + const expression = compiler.callExpression({ 496 + functionName: compiler.propertyAccessExpression({ 497 + expression: identifiers.v, 498 + name: identifiers.schemas.literal, 499 + }), 500 + parameters: [compiler.ots.string(schema.const)], 501 + }); 502 + return expression; 503 + } 504 + 505 + const pipes: Array<ts.CallExpression> = []; 506 + 507 + const expression = compiler.callExpression({ 508 + functionName: compiler.propertyAccessExpression({ 509 + expression: identifiers.v, 510 + name: identifiers.schemas.string, 511 + }), 512 + }); 513 + pipes.push(expression); 514 + 515 + if (schema.format) { 516 + switch (schema.format) { 517 + case 'date-time': 518 + pipes.push( 519 + compiler.callExpression({ 520 + functionName: compiler.propertyAccessExpression({ 521 + expression: identifiers.v, 522 + name: identifiers.actions.isoDateTime, 523 + }), 524 + }), 525 + ); 526 + break; 527 + case 'ipv4': 528 + case 'ipv6': 529 + pipes.push( 530 + compiler.callExpression({ 531 + functionName: compiler.propertyAccessExpression({ 532 + expression: identifiers.v, 533 + name: identifiers.actions.ip, 534 + }), 535 + }), 536 + ); 537 + break; 538 + case 'uri': 539 + pipes.push( 540 + compiler.callExpression({ 541 + functionName: compiler.propertyAccessExpression({ 542 + expression: identifiers.v, 543 + name: identifiers.actions.url, 544 + }), 545 + }), 546 + ); 547 + break; 548 + case 'date': 549 + case 'email': 550 + case 'time': 551 + case 'uuid': 552 + pipes.push( 553 + compiler.callExpression({ 554 + functionName: compiler.propertyAccessExpression({ 555 + expression: identifiers.v, 556 + name: compiler.identifier({ text: schema.format }), 557 + }), 558 + }), 559 + ); 560 + break; 561 + } 562 + } 563 + 564 + if (schema.minLength === schema.maxLength && schema.minLength !== undefined) { 565 + const expression = compiler.callExpression({ 566 + functionName: compiler.propertyAccessExpression({ 567 + expression: identifiers.v, 568 + name: identifiers.actions.length, 569 + }), 570 + parameters: [compiler.valueToExpression({ value: schema.minLength })], 571 + }); 572 + pipes.push(expression); 573 + } else { 574 + if (schema.minLength !== undefined) { 575 + const expression = compiler.callExpression({ 576 + functionName: compiler.propertyAccessExpression({ 577 + expression: identifiers.v, 578 + name: identifiers.actions.minLength, 579 + }), 580 + parameters: [compiler.valueToExpression({ value: schema.minLength })], 581 + }); 582 + pipes.push(expression); 583 + } 584 + 585 + if (schema.maxLength !== undefined) { 586 + const expression = compiler.callExpression({ 587 + functionName: compiler.propertyAccessExpression({ 588 + expression: identifiers.v, 589 + name: identifiers.actions.maxLength, 590 + }), 591 + parameters: [compiler.valueToExpression({ value: schema.maxLength })], 592 + }); 593 + pipes.push(expression); 594 + } 595 + } 596 + 597 + if (schema.pattern) { 598 + const expression = compiler.callExpression({ 599 + functionName: compiler.propertyAccessExpression({ 600 + expression: identifiers.v, 601 + name: identifiers.actions.regex, 602 + }), 603 + parameters: [compiler.regularExpressionLiteral({ text: schema.pattern })], 604 + }); 605 + pipes.push(expression); 606 + } 607 + 608 + return pipesToExpression(pipes); 609 + }; 610 + 611 + const tupleTypeToValibotSchema = ({ 612 + context, 613 + result, 614 + schema, 615 + }: { 616 + context: IR.Context; 617 + result: Result; 618 + schema: SchemaWithType<'tuple'>; 619 + }) => { 620 + if (schema.const && Array.isArray(schema.const)) { 621 + const tupleElements = schema.const.map((value) => 622 + compiler.callExpression({ 623 + functionName: compiler.propertyAccessExpression({ 624 + expression: identifiers.v, 625 + name: identifiers.schemas.literal, 626 + }), 627 + parameters: [compiler.valueToExpression({ value })], 628 + }), 629 + ); 630 + const expression = compiler.callExpression({ 631 + functionName: compiler.propertyAccessExpression({ 632 + expression: identifiers.v, 633 + name: identifiers.schemas.tuple, 634 + }), 635 + parameters: [ 636 + compiler.arrayLiteralExpression({ 637 + elements: tupleElements, 638 + }), 639 + ], 640 + }); 641 + return expression; 642 + } 643 + 644 + if (schema.items) { 645 + const tupleElements = schema.items.map((item) => { 646 + const schemaPipes = schemaToValibotSchema({ 647 + context, 648 + result, 649 + schema: item, 650 + }); 651 + return pipesToExpression(schemaPipes); 652 + }); 653 + const expression = compiler.callExpression({ 654 + functionName: compiler.propertyAccessExpression({ 655 + expression: identifiers.v, 656 + name: identifiers.schemas.tuple, 657 + }), 658 + parameters: [ 659 + compiler.arrayLiteralExpression({ 660 + elements: tupleElements, 661 + }), 662 + ], 663 + }); 664 + return expression; 665 + } 666 + 667 + return unknownTypeToValibotSchema({ 668 + context, 669 + schema: { 670 + type: 'unknown', 671 + }, 672 + }); 673 + }; 674 + 675 + const undefinedTypeToValibotSchema = ({ 676 + // eslint-disable-next-line @typescript-eslint/no-unused-vars 677 + schema, 678 + }: { 679 + context: IR.Context; 680 + schema: SchemaWithType<'undefined'>; 681 + }) => { 682 + const expression = compiler.callExpression({ 683 + functionName: compiler.propertyAccessExpression({ 684 + expression: identifiers.v, 685 + name: identifiers.schemas.undefined, 686 + }), 687 + }); 688 + return expression; 689 + }; 690 + 691 + const unknownTypeToValibotSchema = ({ 692 + // eslint-disable-next-line @typescript-eslint/no-unused-vars 693 + schema, 694 + }: { 695 + context: IR.Context; 696 + schema: SchemaWithType<'unknown'>; 697 + }) => { 698 + const expression = compiler.callExpression({ 699 + functionName: compiler.propertyAccessExpression({ 700 + expression: identifiers.v, 701 + name: identifiers.schemas.unknown, 702 + }), 703 + }); 704 + return expression; 705 + }; 706 + 707 + const voidTypeToValibotSchema = ({ 708 + // eslint-disable-next-line @typescript-eslint/no-unused-vars 709 + schema, 710 + }: { 711 + context: IR.Context; 712 + schema: SchemaWithType<'void'>; 713 + }) => { 714 + const expression = compiler.callExpression({ 715 + functionName: compiler.propertyAccessExpression({ 716 + expression: identifiers.v, 717 + name: identifiers.schemas.void, 718 + }), 719 + }); 720 + return expression; 721 + }; 722 + 723 + const schemaTypeToValibotSchema = ({ 724 + context, 725 + result, 726 + schema, 727 + }: { 728 + context: IR.Context; 729 + result: Result; 730 + schema: IR.SchemaObject; 731 + }): { 732 + anyType?: string; 733 + expression: ts.Expression; 734 + } => { 735 + switch (schema.type as Required<IR.SchemaObject>['type']) { 736 + case 'array': 737 + return { 738 + expression: arrayTypeToValibotSchema({ 739 + context, 740 + result, 741 + schema: schema as SchemaWithType<'array'>, 742 + }), 743 + }; 744 + case 'boolean': 745 + return { 746 + expression: booleanTypeToValibotSchema({ 747 + context, 748 + schema: schema as SchemaWithType<'boolean'>, 749 + }), 750 + }; 751 + case 'enum': 752 + return { 753 + expression: enumTypeToValibotSchema({ 754 + context, 755 + schema: schema as SchemaWithType<'enum'>, 756 + }), 757 + }; 758 + case 'integer': 759 + case 'number': 760 + return { 761 + expression: numberTypeToValibotSchema({ 762 + context, 763 + schema: schema as SchemaWithType<'integer' | 'number'>, 764 + }), 765 + }; 766 + case 'never': 767 + return { 768 + expression: neverTypeToValibotSchema({ 769 + context, 770 + schema: schema as SchemaWithType<'never'>, 771 + }), 772 + }; 773 + case 'null': 774 + return { 775 + expression: nullTypeToValibotSchema({ 776 + context, 777 + schema: schema as SchemaWithType<'null'>, 778 + }), 779 + }; 780 + case 'object': 781 + return objectTypeToValibotSchema({ 782 + context, 783 + result, 784 + schema: schema as SchemaWithType<'object'>, 785 + }); 786 + case 'string': 787 + return { 788 + expression: stringTypeToValibotSchema({ 789 + context, 790 + schema: schema as SchemaWithType<'string'>, 791 + }), 792 + }; 793 + case 'tuple': 794 + return { 795 + expression: tupleTypeToValibotSchema({ 796 + context, 797 + result, 798 + schema: schema as SchemaWithType<'tuple'>, 799 + }), 800 + }; 801 + case 'undefined': 802 + return { 803 + expression: undefinedTypeToValibotSchema({ 804 + context, 805 + schema: schema as SchemaWithType<'undefined'>, 806 + }), 807 + }; 808 + case 'unknown': 809 + return { 810 + expression: unknownTypeToValibotSchema({ 811 + context, 812 + schema: schema as SchemaWithType<'unknown'>, 813 + }), 814 + }; 815 + case 'void': 816 + return { 817 + expression: voidTypeToValibotSchema({ 818 + context, 819 + schema: schema as SchemaWithType<'void'>, 820 + }), 821 + }; 822 + } 823 + }; 824 + 825 + const operationToValibotSchema = ({ 826 + context, 827 + operation, 828 + result, 829 + }: { 830 + context: IR.Context; 831 + operation: IR.OperationObject; 832 + result: Result; 833 + }) => { 834 + if (operation.responses) { 835 + const { response } = operationResponsesMap(operation); 836 + 837 + if (response) { 838 + schemaToValibotSchema({ 839 + $ref: operationIrRef({ 840 + case: 'camelCase', 841 + config: context.config, 842 + id: operation.id, 843 + type: 'response', 844 + }), 845 + context, 846 + result, 847 + schema: response, 848 + }); 849 + } 850 + } 851 + }; 852 + 853 + const schemaToValibotSchema = ({ 854 + $ref, 855 + context, 856 + optional, 857 + result, 858 + schema, 859 + }: { 860 + /** 861 + * When $ref is supplied, a node will be emitted to the file. 862 + */ 863 + $ref?: string; 864 + context: IR.Context; 865 + /** 866 + * Accept `optional` to handle optional object properties. We can't handle 867 + * this inside the object function because `.optional()` must come before 868 + * `.default()` which is handled in this function. 869 + */ 870 + optional?: boolean; 871 + result: Result; 872 + schema: IR.SchemaObject; 873 + }): Array<ts.Expression> => { 874 + const file = context.file({ id: valibotId })!; 875 + 876 + let anyType: string | undefined; 877 + let identifier: ReturnType<typeof file.identifier> | undefined; 878 + let pipes: Array<ts.Expression> = []; 879 + 880 + if ($ref) { 881 + result.circularReferenceTracker.add($ref); 882 + 883 + identifier = file.identifier({ 884 + $ref, 885 + create: true, 886 + nameTransformer, 887 + namespace: 'value', 888 + }); 889 + } 890 + 891 + if (schema.$ref) { 892 + const isCircularReference = result.circularReferenceTracker.has( 893 + schema.$ref, 894 + ); 895 + 896 + // if $ref hasn't been processed yet, inline it to avoid the 897 + // "Block-scoped variable used before its declaration." error 898 + // this could be (maybe?) fixed by reshuffling the generation order 899 + let identifierRef = file.identifier({ 900 + $ref: schema.$ref, 901 + nameTransformer, 902 + namespace: 'value', 903 + }); 904 + 905 + if (!identifierRef.name) { 906 + const ref = context.resolveIrRef<IR.SchemaObject>(schema.$ref); 907 + const schemaPipes = schemaToValibotSchema({ 908 + $ref: schema.$ref, 909 + context, 910 + result, 911 + schema: ref, 912 + }); 913 + pipes.push(...schemaPipes); 914 + 915 + identifierRef = file.identifier({ 916 + $ref: schema.$ref, 917 + nameTransformer, 918 + namespace: 'value', 919 + }); 920 + } 921 + 922 + // if `identifierRef.name` is falsy, we already set expression above 923 + if (identifierRef.name) { 924 + const refIdentifier = compiler.identifier({ text: identifierRef.name }); 925 + if (isCircularReference) { 926 + const lazyExpression = compiler.callExpression({ 927 + functionName: compiler.propertyAccessExpression({ 928 + expression: identifiers.v, 929 + name: identifiers.schemas.lazy, 930 + }), 931 + parameters: [ 932 + compiler.arrowFunction({ 933 + statements: [ 934 + compiler.returnStatement({ 935 + expression: refIdentifier, 936 + }), 937 + ], 938 + }), 939 + ], 940 + }); 941 + pipes.push(lazyExpression); 942 + result.hasCircularReference = true; 943 + } else { 944 + pipes.push(refIdentifier); 945 + } 946 + } 947 + } else if (schema.type) { 948 + const valibotSchema = schemaTypeToValibotSchema({ 949 + context, 950 + result, 951 + schema, 952 + }); 953 + anyType = valibotSchema.anyType; 954 + pipes.push(valibotSchema.expression); 955 + } else if (schema.items) { 956 + schema = deduplicateSchema({ schema }); 957 + 958 + if (schema.items) { 959 + const itemTypes = schema.items.map((item) => { 960 + const schemaPipes = schemaToValibotSchema({ 961 + context, 962 + result, 963 + schema: item, 964 + }); 965 + return pipesToExpression(schemaPipes); 966 + }); 967 + 968 + if (schema.logicalOperator === 'and') { 969 + const intersectExpression = compiler.callExpression({ 970 + functionName: compiler.propertyAccessExpression({ 971 + expression: identifiers.v, 972 + name: identifiers.schemas.intersect, 973 + }), 974 + parameters: [ 975 + compiler.arrayLiteralExpression({ 976 + elements: itemTypes, 977 + }), 978 + ], 979 + }); 980 + pipes.push(intersectExpression); 981 + } else { 982 + const unionExpression = compiler.callExpression({ 983 + functionName: compiler.propertyAccessExpression({ 984 + expression: identifiers.v, 985 + name: identifiers.schemas.union, 986 + }), 987 + parameters: [ 988 + compiler.arrayLiteralExpression({ 989 + elements: itemTypes, 990 + }), 991 + ], 992 + }); 993 + pipes.push(unionExpression); 994 + } 995 + } else { 996 + const schemaPipes = schemaToValibotSchema({ 997 + context, 998 + result, 999 + schema, 1000 + }); 1001 + pipes.push(...schemaPipes); 1002 + } 1003 + } else { 1004 + // catch-all fallback for failed schemas 1005 + const valibotSchema = schemaTypeToValibotSchema({ 1006 + context, 1007 + result, 1008 + schema: { 1009 + type: 'unknown', 1010 + }, 1011 + }); 1012 + anyType = valibotSchema.anyType; 1013 + pipes.push(valibotSchema.expression); 1014 + } 1015 + 1016 + if ($ref) { 1017 + result.circularReferenceTracker.delete($ref); 1018 + } 1019 + 1020 + if (pipes.length) { 1021 + if (schema.accessScope === 'read') { 1022 + const readonlyExpression = compiler.callExpression({ 1023 + functionName: compiler.propertyAccessExpression({ 1024 + expression: identifiers.v, 1025 + name: identifiers.actions.readonly, 1026 + }), 1027 + }); 1028 + pipes.push(readonlyExpression); 1029 + } 1030 + } 1031 + 1032 + if (pipes.length) { 1033 + let callParameter: ts.Expression | undefined; 1034 + 1035 + if (schema.default !== undefined) { 1036 + callParameter = compiler.valueToExpression({ 1037 + value: schema.default, 1038 + }); 1039 + if (callParameter) { 1040 + pipes = [ 1041 + compiler.callExpression({ 1042 + functionName: compiler.propertyAccessExpression({ 1043 + expression: identifiers.v, 1044 + name: identifiers.schemas.optional, 1045 + }), 1046 + parameters: [pipesToExpression(pipes), callParameter], 1047 + }), 1048 + ]; 1049 + } 1050 + } 1051 + 1052 + if (optional && !callParameter) { 1053 + pipes = [ 1054 + compiler.callExpression({ 1055 + functionName: compiler.propertyAccessExpression({ 1056 + expression: identifiers.v, 1057 + name: identifiers.schemas.optional, 1058 + }), 1059 + parameters: [pipesToExpression(pipes)], 1060 + }), 1061 + ]; 1062 + } 1063 + } 1064 + 1065 + // emit nodes only if $ref points to a reusable component 1066 + if (identifier && identifier.name && identifier.created) { 1067 + const statement = compiler.constVariable({ 1068 + exportConst: true, 1069 + expression: pipesToExpression(pipes), 1070 + name: identifier.name, 1071 + typeName: result.hasCircularReference 1072 + ? (compiler.propertyAccessExpression({ 1073 + expression: identifiers.v, 1074 + name: anyType || identifiers.types.GenericSchema.text, 1075 + }) as unknown as ts.TypeNode) 1076 + : undefined, 1077 + }); 1078 + file.add(statement); 1079 + 1080 + return []; 1081 + } 1082 + 1083 + return pipes; 1084 + }; 1085 + 1086 + export const handler: Plugin.Handler<Config> = ({ context, plugin }) => { 1087 + const file = context.createFile({ 1088 + exportFromIndex: plugin.exportFromIndex, 1089 + id: valibotId, 1090 + identifierCase: 'camelCase', 1091 + path: plugin.output, 1092 + }); 1093 + 1094 + file.import({ 1095 + alias: identifiers.v.text, 1096 + module: 'valibot', 1097 + name: '*', 1098 + }); 1099 + 1100 + context.subscribe('operation', ({ operation }) => { 1101 + const result: Result = { 1102 + circularReferenceTracker: new Set(), 1103 + hasCircularReference: false, 1104 + }; 1105 + 1106 + operationToValibotSchema({ 1107 + context, 1108 + operation, 1109 + result, 1110 + }); 1111 + }); 1112 + 1113 + context.subscribe('schema', ({ $ref, schema }) => { 1114 + const result: Result = { 1115 + circularReferenceTracker: new Set(), 1116 + hasCircularReference: false, 1117 + }; 1118 + 1119 + schemaToValibotSchema({ 1120 + $ref, 1121 + context, 1122 + result, 1123 + schema, 1124 + }); 1125 + }); 1126 + };
+23
packages/openapi-ts/src/plugins/valibot/types.d.ts
··· 1 + // import type { IR } from '../../ir/types'; 2 + import type { Plugin } from '../types'; 3 + 4 + export interface Config extends Plugin.Name<'valibot'> { 5 + /** 6 + * Should the exports from the generated files be re-exported in the index 7 + * barrel file? 8 + * 9 + * @default false 10 + */ 11 + exportFromIndex?: boolean; 12 + /** 13 + * Customise the Valibot schema name. By default, `v{{name}}` is used, 14 + * where `name` is a definition name or an operation name. 15 + */ 16 + // nameBuilder?: (model: IR.OperationObject | IR.SchemaObject) => string; 17 + /** 18 + * Name of the generated file. 19 + * 20 + * @default 'valibot' 21 + */ 22 + output?: string; 23 + }
+282 -37
pnpm-lock.yaml
··· 477 477 devDependencies: 478 478 '@angular-devkit/build-angular': 479 479 specifier: ^19.2.0 480 - version: 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(typescript@5.8.3)(vite@6.1.0(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0))(yaml@2.7.0) 480 + version: 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(typescript@5.8.3)(vite@6.2.6(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0))(yaml@2.7.0) 481 481 '@angular/cli': 482 482 specifier: ^19.2.0 483 483 version: 19.2.0(@types/node@22.10.5)(chokidar@4.0.3) ··· 955 955 devDependencies: 956 956 '@angular-devkit/build-angular': 957 957 specifier: 19.2.0 958 - version: 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(typescript@5.8.3)(vite@6.2.6(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0))(yaml@2.7.0) 958 + version: 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(typescript@5.8.3)(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(yaml@2.7.0) 959 959 '@angular/animations': 960 960 specifier: 19.2.0 961 961 version: 19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)) ··· 1054 1054 version: 3.3.2 1055 1055 nuxt: 1056 1056 specifier: 3.14.1592 1057 - version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.1)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.0)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vite@6.2.6(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0)) 1057 + version: 3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.1)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.0)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)) 1058 1058 prettier: 1059 1059 specifier: 3.4.2 1060 1060 version: 3.4.2 ··· 1073 1073 typescript: 1074 1074 specifier: 5.8.3 1075 1075 version: 5.8.3 1076 + valibot: 1077 + specifier: 1.1.0 1078 + version: 1.1.0(typescript@5.8.3) 1076 1079 vue: 1077 1080 specifier: 3.5.13 1078 1081 version: 3.5.13(typescript@5.8.3) ··· 11183 11186 v8-compile-cache-lib@3.0.1: 11184 11187 resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} 11185 11188 11189 + valibot@1.1.0: 11190 + resolution: {integrity: sha512-Nk8lX30Qhu+9txPYTwM0cFlWLdPFsFr6LblzqIySfbZph9+BFsAHsNvHOymEviUepeIW6KFHzpX8TKhbptBXXw==} 11191 + peerDependencies: 11192 + typescript: '>=5' 11193 + peerDependenciesMeta: 11194 + typescript: 11195 + optional: true 11196 + 11186 11197 validate-npm-package-license@3.0.4: 11187 11198 resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} 11188 11199 ··· 11977 11988 transitivePeerDependencies: 11978 11989 - chokidar 11979 11990 11980 - '@angular-devkit/build-angular@19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(typescript@5.8.3)(vite@6.1.0(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0))(yaml@2.7.0)': 11991 + '@angular-devkit/build-angular@19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(typescript@5.8.3)(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(yaml@2.7.0)': 11981 11992 dependencies: 11982 11993 '@ampproject/remapping': 2.3.0 11983 11994 '@angular-devkit/architect': 0.1902.0(chokidar@4.0.3) 11984 - '@angular-devkit/build-webpack': 0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.2)))(webpack@5.98.0(esbuild@0.25.0)) 11995 + '@angular-devkit/build-webpack': 0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.0)))(webpack@5.98.0(esbuild@0.25.0)) 11985 11996 '@angular-devkit/core': 19.2.0(chokidar@4.0.3) 11986 11997 '@angular/build': 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(less@4.2.2)(postcss@8.5.2)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.0) 11987 11998 '@angular/compiler-cli': 19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3) ··· 11996 12007 '@babel/runtime': 7.26.9 11997 12008 '@discoveryjs/json-ext': 0.6.3 11998 12009 '@ngtools/webpack': 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(typescript@5.8.3)(webpack@5.98.0(esbuild@0.25.0)) 11999 - '@vitejs/plugin-basic-ssl': 1.2.0(vite@6.1.0(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0)) 12010 + '@vitejs/plugin-basic-ssl': 1.2.0(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)) 12000 12011 ansi-colors: 4.1.3 12001 12012 autoprefixer: 10.4.20(postcss@8.5.2) 12002 12013 babel-loader: 9.2.1(@babel/core@7.26.9)(webpack@5.98.0(esbuild@0.25.0)) ··· 12031 12042 tree-kill: 1.2.2 12032 12043 tslib: 2.8.1 12033 12044 typescript: 5.8.3 12034 - webpack: 5.98.0(esbuild@0.25.0) 12035 - webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.2)) 12036 - webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.2)) 12045 + webpack: 5.98.0(esbuild@0.25.2) 12046 + webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) 12047 + webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.0)) 12037 12048 webpack-merge: 6.0.1 12038 12049 webpack-subresource-integrity: 5.1.0(webpack@5.98.0(esbuild@0.25.0)) 12039 12050 optionalDependencies: ··· 12067 12078 dependencies: 12068 12079 '@ampproject/remapping': 2.3.0 12069 12080 '@angular-devkit/architect': 0.1902.0(chokidar@4.0.3) 12070 - '@angular-devkit/build-webpack': 0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.2)))(webpack@5.98.0(esbuild@0.25.0)) 12081 + '@angular-devkit/build-webpack': 0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.0)))(webpack@5.98.0(esbuild@0.25.0)) 12071 12082 '@angular-devkit/core': 19.2.0(chokidar@4.0.3) 12072 12083 '@angular/build': 19.2.0(@angular/compiler-cli@19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3))(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(@types/node@22.10.5)(chokidar@4.0.3)(jiti@2.4.2)(karma@6.4.4)(less@4.2.2)(postcss@8.5.2)(tailwindcss@3.4.9(ts-node@10.9.2(@types/node@22.10.5)(typescript@5.8.3)))(terser@5.39.0)(typescript@5.8.3)(yaml@2.7.0) 12073 12084 '@angular/compiler-cli': 19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3) ··· 12117 12128 tree-kill: 1.2.2 12118 12129 tslib: 2.8.1 12119 12130 typescript: 5.8.3 12120 - webpack: 5.98.0(esbuild@0.25.0) 12121 - webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.2)) 12122 - webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.2)) 12131 + webpack: 5.98.0(esbuild@0.25.2) 12132 + webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) 12133 + webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.0)) 12123 12134 webpack-merge: 6.0.1 12124 12135 webpack-subresource-integrity: 5.1.0(webpack@5.98.0(esbuild@0.25.0)) 12125 12136 optionalDependencies: ··· 12149 12160 - webpack-cli 12150 12161 - yaml 12151 12162 12152 - '@angular-devkit/build-webpack@0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.2)))(webpack@5.98.0(esbuild@0.25.0))': 12163 + '@angular-devkit/build-webpack@0.1902.0(chokidar@4.0.3)(webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.0)))(webpack@5.98.0(esbuild@0.25.0))': 12153 12164 dependencies: 12154 12165 '@angular-devkit/architect': 0.1902.0(chokidar@4.0.3) 12155 12166 rxjs: 7.8.1 12156 - webpack: 5.98.0(esbuild@0.25.0) 12157 - webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.2)) 12167 + webpack: 5.98.0(esbuild@0.25.2) 12168 + webpack-dev-server: 5.2.0(webpack@5.98.0(esbuild@0.25.0)) 12158 12169 transitivePeerDependencies: 12159 12170 - chokidar 12160 12171 ··· 14274 14285 dependencies: 14275 14286 '@angular/compiler-cli': 19.2.0(@angular/compiler@19.2.0(@angular/core@19.2.0(rxjs@7.8.1)(zone.js@0.15.0)))(typescript@5.8.3) 14276 14287 typescript: 5.8.3 14277 - webpack: 5.98.0(esbuild@0.25.0) 14288 + webpack: 5.98.0(esbuild@0.25.2) 14278 14289 14279 14290 '@nodelib/fs.scandir@2.1.5': 14280 14291 dependencies: ··· 14351 14362 14352 14363 '@nuxt/devalue@2.0.2': {} 14353 14364 14365 + '@nuxt/devtools-kit@1.7.0(magicast@0.3.5)(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))': 14366 + dependencies: 14367 + '@nuxt/kit': 3.15.4(magicast@0.3.5) 14368 + '@nuxt/schema': 3.16.2 14369 + execa: 7.2.0 14370 + vite: 5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) 14371 + transitivePeerDependencies: 14372 + - magicast 14373 + - supports-color 14374 + 14354 14375 '@nuxt/devtools-kit@1.7.0(magicast@0.3.5)(vite@6.2.6(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0))': 14355 14376 dependencies: 14356 14377 '@nuxt/kit': 3.15.4(magicast@0.3.5) ··· 14421 14442 - utf-8-validate 14422 14443 - vue 14423 14444 14445 + '@nuxt/devtools@1.7.0(rollup@4.39.0)(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3))': 14446 + dependencies: 14447 + '@antfu/utils': 0.7.10 14448 + '@nuxt/devtools-kit': 1.7.0(magicast@0.3.5)(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)) 14449 + '@nuxt/devtools-wizard': 1.7.0 14450 + '@nuxt/kit': 3.15.4(magicast@0.3.5) 14451 + '@vue/devtools-core': 7.6.8(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3)) 14452 + '@vue/devtools-kit': 7.6.8 14453 + birpc: 0.2.19 14454 + consola: 3.4.0 14455 + cronstrue: 2.56.0 14456 + destr: 2.0.3 14457 + error-stack-parser-es: 0.1.5 14458 + execa: 7.2.0 14459 + fast-npm-meta: 0.2.2 14460 + flatted: 3.3.3 14461 + get-port-please: 3.1.2 14462 + hookable: 5.5.3 14463 + image-meta: 0.2.1 14464 + is-installed-globally: 1.0.0 14465 + launch-editor: 2.10.0 14466 + local-pkg: 0.5.1 14467 + magicast: 0.3.5 14468 + nypm: 0.4.1 14469 + ohash: 1.1.6 14470 + pathe: 1.1.2 14471 + perfect-debounce: 1.0.0 14472 + pkg-types: 1.3.1 14473 + rc9: 2.1.2 14474 + scule: 1.3.0 14475 + semver: 7.7.1 14476 + simple-git: 3.27.0 14477 + sirv: 3.0.1 14478 + tinyglobby: 0.2.12 14479 + unimport: 3.14.6(rollup@4.39.0) 14480 + vite: 5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) 14481 + vite-plugin-inspect: 0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.39.0)(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)) 14482 + vite-plugin-vue-inspector: 5.3.1(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)) 14483 + which: 3.0.1 14484 + ws: 8.18.1 14485 + transitivePeerDependencies: 14486 + - bufferutil 14487 + - rollup 14488 + - supports-color 14489 + - utf-8-validate 14490 + - vue 14491 + 14424 14492 '@nuxt/devtools@1.7.0(rollup@4.39.0)(vite@6.2.6(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0))(vue@3.5.13(typescript@5.8.3))': 14425 14493 dependencies: 14426 14494 '@antfu/utils': 0.7.10 ··· 16493 16561 - rollup 16494 16562 - supports-color 16495 16563 16564 + '@vitejs/plugin-basic-ssl@1.2.0(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))': 16565 + dependencies: 16566 + vite: 5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) 16567 + 16496 16568 '@vitejs/plugin-basic-ssl@1.2.0(vite@6.1.0(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0))': 16497 16569 dependencies: 16498 16570 vite: 6.1.0(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0) ··· 16697 16769 '@vue/devtools-api@7.7.2': 16698 16770 dependencies: 16699 16771 '@vue/devtools-kit': 7.7.2 16772 + 16773 + '@vue/devtools-core@7.6.8(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3))': 16774 + dependencies: 16775 + '@vue/devtools-kit': 7.7.2 16776 + '@vue/devtools-shared': 7.7.2 16777 + mitt: 3.0.1 16778 + nanoid: 5.1.5 16779 + pathe: 1.1.2 16780 + vite-hot-client: 0.2.4(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)) 16781 + vue: 3.5.13(typescript@5.8.3) 16782 + transitivePeerDependencies: 16783 + - vite 16700 16784 16701 16785 '@vue/devtools-core@7.6.8(vite@6.2.6(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0))(vue@3.5.13(typescript@5.8.3))': 16702 16786 dependencies: ··· 17253 17337 '@babel/core': 7.26.9 17254 17338 find-cache-dir: 4.0.0 17255 17339 schema-utils: 4.3.0 17256 - webpack: 5.98.0(esbuild@0.25.0) 17340 + webpack: 5.98.0(esbuild@0.25.2) 17257 17341 17258 17342 babel-plugin-polyfill-corejs2@0.4.12(@babel/core@7.26.9): 17259 17343 dependencies: ··· 17785 17869 normalize-path: 3.0.0 17786 17870 schema-utils: 4.3.0 17787 17871 serialize-javascript: 6.0.2 17788 - webpack: 5.98.0(esbuild@0.25.0) 17872 + webpack: 5.98.0(esbuild@0.25.2) 17789 17873 17790 17874 core-js-compat@3.41.0: 17791 17875 dependencies: ··· 17857 17941 postcss-value-parser: 4.2.0 17858 17942 semver: 7.7.1 17859 17943 optionalDependencies: 17860 - webpack: 5.98.0(esbuild@0.25.0) 17944 + webpack: 5.98.0(esbuild@0.25.2) 17861 17945 17862 17946 css-select@5.1.0: 17863 17947 dependencies: ··· 20184 20268 dependencies: 20185 20269 less: 4.2.2 20186 20270 optionalDependencies: 20187 - webpack: 5.98.0(esbuild@0.25.0) 20271 + webpack: 5.98.0(esbuild@0.25.2) 20188 20272 20189 20273 less@4.2.2: 20190 20274 dependencies: ··· 20209 20293 dependencies: 20210 20294 webpack-sources: 3.2.3 20211 20295 optionalDependencies: 20212 - webpack: 5.98.0(esbuild@0.25.0) 20296 + webpack: 5.98.0(esbuild@0.25.2) 20213 20297 20214 20298 light-my-request@6.6.0: 20215 20299 dependencies: ··· 20537 20621 dependencies: 20538 20622 schema-utils: 4.3.0 20539 20623 tapable: 2.2.1 20540 - webpack: 5.98.0(esbuild@0.25.0) 20624 + webpack: 5.98.0(esbuild@0.25.2) 20541 20625 20542 20626 minimalistic-assert@1.0.1: {} 20543 20627 ··· 21105 21189 - vue-tsc 21106 21190 - xml2js 21107 21191 21192 + nuxt@3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.1)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.0)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)): 21193 + dependencies: 21194 + '@nuxt/devalue': 2.0.2 21195 + '@nuxt/devtools': 1.7.0(rollup@4.39.0)(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0))(vue@3.5.13(typescript@5.8.3)) 21196 + '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.39.0) 21197 + '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.39.0) 21198 + '@nuxt/telemetry': 2.6.5(magicast@0.3.5) 21199 + '@nuxt/vite-builder': 3.14.1592(@types/node@22.10.5)(eslint@9.17.0(jiti@2.4.2))(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vue@3.5.13(typescript@5.8.3)) 21200 + '@unhead/dom': 1.11.20 21201 + '@unhead/shared': 1.11.20 21202 + '@unhead/ssr': 1.11.20 21203 + '@unhead/vue': 1.11.20(vue@3.5.13(typescript@5.8.3)) 21204 + '@vue/shared': 3.5.13 21205 + acorn: 8.14.0 21206 + c12: 2.0.1(magicast@0.3.5) 21207 + chokidar: 4.0.3 21208 + compatx: 0.1.8 21209 + consola: 3.4.0 21210 + cookie-es: 1.2.2 21211 + defu: 6.1.4 21212 + destr: 2.0.3 21213 + devalue: 5.1.1 21214 + errx: 0.1.0 21215 + esbuild: 0.24.2 21216 + escape-string-regexp: 5.0.0 21217 + estree-walker: 3.0.3 21218 + globby: 14.1.0 21219 + h3: 1.15.1 21220 + hookable: 5.5.3 21221 + ignore: 6.0.2 21222 + impound: 0.2.2(rollup@4.39.0) 21223 + jiti: 2.4.2 21224 + klona: 2.0.6 21225 + knitwork: 1.2.0 21226 + magic-string: 0.30.17 21227 + mlly: 1.7.4 21228 + nanotar: 0.1.1 21229 + nitropack: 2.11.6(encoding@0.1.13)(typescript@5.8.3) 21230 + nuxi: 3.22.5 21231 + nypm: 0.3.12 21232 + ofetch: 1.4.1 21233 + ohash: 1.1.6 21234 + pathe: 1.1.2 21235 + perfect-debounce: 1.0.0 21236 + pkg-types: 1.3.1 21237 + radix3: 1.1.2 21238 + scule: 1.3.0 21239 + semver: 7.7.1 21240 + std-env: 3.8.1 21241 + strip-literal: 2.1.1 21242 + tinyglobby: 0.2.10 21243 + ufo: 1.5.4 21244 + ultrahtml: 1.5.3 21245 + uncrypto: 0.1.3 21246 + unctx: 2.4.1 21247 + unenv: 1.10.0 21248 + unhead: 1.11.20 21249 + unimport: 3.14.6(rollup@4.39.0) 21250 + unplugin: 1.16.1 21251 + unplugin-vue-router: 0.10.9(rollup@4.39.0)(vue-router@4.5.0(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3)) 21252 + unstorage: 1.15.0(db0@0.3.1)(ioredis@5.6.0) 21253 + untyped: 1.5.2 21254 + vue: 3.5.13(typescript@5.8.3) 21255 + vue-bundle-renderer: 2.1.1 21256 + vue-devtools-stub: 0.1.0 21257 + vue-router: 4.5.0(vue@3.5.13(typescript@5.8.3)) 21258 + optionalDependencies: 21259 + '@parcel/watcher': 2.5.1 21260 + '@types/node': 22.10.5 21261 + transitivePeerDependencies: 21262 + - '@azure/app-configuration' 21263 + - '@azure/cosmos' 21264 + - '@azure/data-tables' 21265 + - '@azure/identity' 21266 + - '@azure/keyvault-secrets' 21267 + - '@azure/storage-blob' 21268 + - '@biomejs/biome' 21269 + - '@capacitor/preferences' 21270 + - '@deno/kv' 21271 + - '@electric-sql/pglite' 21272 + - '@libsql/client' 21273 + - '@netlify/blobs' 21274 + - '@planetscale/database' 21275 + - '@upstash/redis' 21276 + - '@vercel/blob' 21277 + - '@vercel/kv' 21278 + - aws4fetch 21279 + - better-sqlite3 21280 + - bufferutil 21281 + - db0 21282 + - drizzle-orm 21283 + - encoding 21284 + - eslint 21285 + - idb-keyval 21286 + - ioredis 21287 + - less 21288 + - lightningcss 21289 + - magicast 21290 + - meow 21291 + - mysql2 21292 + - optionator 21293 + - rolldown 21294 + - rollup 21295 + - sass 21296 + - sass-embedded 21297 + - sqlite3 21298 + - stylelint 21299 + - stylus 21300 + - sugarss 21301 + - supports-color 21302 + - terser 21303 + - typescript 21304 + - uploadthing 21305 + - utf-8-validate 21306 + - vite 21307 + - vls 21308 + - vti 21309 + - vue-tsc 21310 + - xml2js 21311 + 21108 21312 nuxt@3.14.1592(@parcel/watcher@2.5.1)(@types/node@22.10.5)(db0@0.3.1)(encoding@0.1.13)(eslint@9.17.0(jiti@2.4.2))(ioredis@5.6.0)(less@4.2.2)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.39.0)(sass@1.85.0)(terser@5.39.0)(typescript@5.8.3)(vite@6.2.6(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0)): 21109 21313 dependencies: 21110 21314 '@nuxt/devalue': 2.0.2 ··· 21740 21944 postcss: 8.5.2 21741 21945 semver: 7.7.1 21742 21946 optionalDependencies: 21743 - webpack: 5.98.0(esbuild@0.25.0) 21947 + webpack: 5.98.0(esbuild@0.25.2) 21744 21948 transitivePeerDependencies: 21745 21949 - typescript 21746 21950 ··· 22476 22680 neo-async: 2.6.2 22477 22681 optionalDependencies: 22478 22682 sass: 1.85.0 22479 - webpack: 5.98.0(esbuild@0.25.0) 22683 + webpack: 5.98.0(esbuild@0.25.2) 22480 22684 22481 22685 sass@1.85.0: 22482 22686 dependencies: ··· 22816 23020 dependencies: 22817 23021 iconv-lite: 0.6.3 22818 23022 source-map-js: 1.2.1 22819 - webpack: 5.98.0(esbuild@0.25.0) 23023 + webpack: 5.98.0(esbuild@0.25.2) 22820 23024 22821 23025 source-map-support@0.5.21: 22822 23026 dependencies: ··· 23197 23401 23198 23402 term-size@2.2.1: {} 23199 23403 23200 - terser-webpack-plugin@5.3.14(esbuild@0.25.0)(webpack@5.98.0(esbuild@0.25.2)): 23404 + terser-webpack-plugin@5.3.14(esbuild@0.25.2)(webpack@5.98.0(esbuild@0.25.0)): 23201 23405 dependencies: 23202 23406 '@jridgewell/trace-mapping': 0.3.25 23203 23407 jest-worker: 27.5.1 23204 23408 schema-utils: 4.3.0 23205 23409 serialize-javascript: 6.0.2 23206 23410 terser: 5.39.0 23207 - webpack: 5.98.0(esbuild@0.25.0) 23411 + webpack: 5.98.0(esbuild@0.25.2) 23208 23412 optionalDependencies: 23209 - esbuild: 0.25.0 23413 + esbuild: 0.25.2 23210 23414 23211 23415 terser@5.39.0: 23212 23416 dependencies: ··· 23860 24064 23861 24065 v8-compile-cache-lib@3.0.1: {} 23862 24066 24067 + valibot@1.1.0(typescript@5.8.3): 24068 + optionalDependencies: 24069 + typescript: 5.8.3 24070 + 23863 24071 validate-npm-package-license@3.0.4: 23864 24072 dependencies: 23865 24073 spdx-correct: 3.2.0 ··· 23880 24088 dependencies: 23881 24089 '@types/unist': 3.0.3 23882 24090 vfile-message: 4.0.2 24091 + 24092 + vite-hot-client@0.2.4(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)): 24093 + dependencies: 24094 + vite: 5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) 23883 24095 23884 24096 vite-hot-client@0.2.4(vite@6.2.6(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0)): 23885 24097 dependencies: ··· 23964 24176 - rollup 23965 24177 - supports-color 23966 24178 24179 + vite-plugin-inspect@0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.39.0)(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)): 24180 + dependencies: 24181 + '@antfu/utils': 0.7.10 24182 + '@rollup/pluginutils': 5.1.4(rollup@4.39.0) 24183 + debug: 4.4.0(supports-color@9.4.0) 24184 + error-stack-parser-es: 0.1.5 24185 + fs-extra: 11.3.0 24186 + open: 10.1.0 24187 + perfect-debounce: 1.0.0 24188 + picocolors: 1.1.1 24189 + sirv: 3.0.1 24190 + vite: 5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) 24191 + optionalDependencies: 24192 + '@nuxt/kit': 3.15.4(magicast@0.3.5) 24193 + transitivePeerDependencies: 24194 + - rollup 24195 + - supports-color 24196 + 23967 24197 vite-plugin-inspect@0.8.9(@nuxt/kit@3.15.4(magicast@0.3.5))(rollup@4.39.0)(vite@6.2.6(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0)): 23968 24198 dependencies: 23969 24199 '@antfu/utils': 0.7.10 ··· 23997 24227 - rollup 23998 24228 - supports-color 23999 24229 - vue 24230 + 24231 + vite-plugin-vue-inspector@5.3.1(vite@5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)): 24232 + dependencies: 24233 + '@babel/core': 7.26.10 24234 + '@babel/plugin-proposal-decorators': 7.25.9(@babel/core@7.26.10) 24235 + '@babel/plugin-syntax-import-attributes': 7.26.0(@babel/core@7.26.10) 24236 + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.26.10) 24237 + '@babel/plugin-transform-typescript': 7.26.8(@babel/core@7.26.10) 24238 + '@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.26.10) 24239 + '@vue/compiler-dom': 3.5.13 24240 + kolorist: 1.8.0 24241 + magic-string: 0.30.17 24242 + vite: 5.4.16(@types/node@22.10.5)(less@4.2.2)(sass@1.85.0)(terser@5.39.0) 24243 + transitivePeerDependencies: 24244 + - supports-color 24000 24245 24001 24246 vite-plugin-vue-inspector@5.3.1(vite@6.2.6(@types/node@22.10.5)(jiti@2.4.2)(less@4.2.2)(sass@1.85.0)(terser@5.39.0)(yaml@2.7.0)): 24002 24247 dependencies: ··· 24283 24528 24284 24529 webidl-conversions@7.0.0: {} 24285 24530 24286 - webpack-dev-middleware@7.4.2(webpack@5.98.0(esbuild@0.25.2)): 24531 + webpack-dev-middleware@7.4.2(webpack@5.98.0(esbuild@0.25.0)): 24287 24532 dependencies: 24288 24533 colorette: 2.0.20 24289 24534 memfs: 4.17.0 ··· 24292 24537 range-parser: 1.2.1 24293 24538 schema-utils: 4.3.0 24294 24539 optionalDependencies: 24295 - webpack: 5.98.0(esbuild@0.25.0) 24540 + webpack: 5.98.0(esbuild@0.25.2) 24296 24541 24297 - webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.2)): 24542 + webpack-dev-server@5.2.0(webpack@5.98.0(esbuild@0.25.0)): 24298 24543 dependencies: 24299 24544 '@types/bonjour': 3.5.13 24300 24545 '@types/connect-history-api-fallback': 1.5.4 ··· 24321 24566 serve-index: 1.9.1 24322 24567 sockjs: 0.3.24 24323 24568 spdy: 4.0.2 24324 - webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.2)) 24569 + webpack-dev-middleware: 7.4.2(webpack@5.98.0(esbuild@0.25.0)) 24325 24570 ws: 8.18.1 24326 24571 optionalDependencies: 24327 - webpack: 5.98.0(esbuild@0.25.0) 24572 + webpack: 5.98.0(esbuild@0.25.2) 24328 24573 transitivePeerDependencies: 24329 24574 - bufferutil 24330 24575 - debug ··· 24342 24587 webpack-subresource-integrity@5.1.0(webpack@5.98.0(esbuild@0.25.0)): 24343 24588 dependencies: 24344 24589 typed-assert: 1.0.9 24345 - webpack: 5.98.0(esbuild@0.25.0) 24590 + webpack: 5.98.0(esbuild@0.25.2) 24346 24591 24347 24592 webpack-virtual-modules@0.6.2: {} 24348 24593 24349 - webpack@5.98.0(esbuild@0.25.0): 24594 + webpack@5.98.0(esbuild@0.25.2): 24350 24595 dependencies: 24351 24596 '@types/eslint-scope': 3.7.7 24352 24597 '@types/estree': 1.0.6 ··· 24368 24613 neo-async: 2.6.2 24369 24614 schema-utils: 4.3.0 24370 24615 tapable: 2.2.1 24371 - terser-webpack-plugin: 5.3.14(esbuild@0.25.0)(webpack@5.98.0(esbuild@0.25.2)) 24616 + terser-webpack-plugin: 5.3.14(esbuild@0.25.2)(webpack@5.98.0(esbuild@0.25.0)) 24372 24617 watchpack: 2.4.2 24373 24618 webpack-sources: 3.2.3 24374 24619 transitivePeerDependencies: