···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-import { type ClientOptions, type Config, createClient, createConfig } from './client';
44-import type { ClientOptions as ClientOptions2 } from './types.gen';
55-66-/**
77- * The `createClientConfig()` function will be called on client initialization
88- * and the returned object will become the client's initial configuration.
99- *
1010- * You may want to initialize your client this way instead of calling
1111- * `setConfig()`. This is useful for example if you're using Next.js
1212- * to ensure your client always has the correct values.
1313- */
1414-export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
1515-1616-export const client = createClient(createConfig<ClientOptions2>());
···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-import type { Auth, AuthToken } from './auth.gen';
44-import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer.gen';
55-66-export type HttpMethod =
77- | 'connect'
88- | 'delete'
99- | 'get'
1010- | 'head'
1111- | 'options'
1212- | 'patch'
1313- | 'post'
1414- | 'put'
1515- | 'trace';
1616-1717-export type Client<
1818- RequestFn = never,
1919- Config = unknown,
2020- MethodFn = never,
2121- BuildUrlFn = never,
2222- SseFn = never,
2323-> = {
2424- /**
2525- * Returns the final request URL.
2626- */
2727- buildUrl: BuildUrlFn;
2828- getConfig: () => Config;
2929- request: RequestFn;
3030- setConfig: (config: Config) => Config;
3131-} & {
3232- [K in HttpMethod]: MethodFn;
3333-} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } });
3434-3535-export interface Config {
3636- /**
3737- * Auth token or a function returning auth token. The resolved value will be
3838- * added to the request payload as defined by its `security` array.
3939- */
4040- auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
4141- /**
4242- * A function for serializing request body parameter. By default,
4343- * {@link JSON.stringify()} will be used.
4444- */
4545- bodySerializer?: BodySerializer | null;
4646- /**
4747- * An object containing any HTTP headers that you want to pre-populate your
4848- * `Headers` object with.
4949- *
5050- * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
5151- */
5252- headers?:
5353- | RequestInit['headers']
5454- | Record<
5555- string,
5656- string | number | boolean | (string | number | boolean)[] | null | undefined | unknown
5757- >;
5858- /**
5959- * The request method.
6060- *
6161- * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
6262- */
6363- method?: Uppercase<HttpMethod>;
6464- /**
6565- * A function for serializing request query parameters. By default, arrays
6666- * will be exploded in form style, objects will be exploded in deepObject
6767- * style, and reserved characters are percent-encoded.
6868- *
6969- * This method will have no effect if the native `paramsSerializer()` Axios
7070- * API function is used.
7171- *
7272- * {@link https://swagger.io/docs/specification/serialization/#query View examples}
7373- */
7474- querySerializer?: QuerySerializer | QuerySerializerOptions;
7575- /**
7676- * A function validating request data. This is useful if you want to ensure
7777- * the request conforms to the desired shape, so it can be safely sent to
7878- * the server.
7979- */
8080- requestValidator?: (data: unknown) => Promise<unknown>;
8181- /**
8282- * A function transforming response data before it's returned. This is useful
8383- * for post-processing data, e.g. converting ISO strings into Date objects.
8484- */
8585- responseTransformer?: (data: unknown) => Promise<unknown>;
8686- /**
8787- * A function validating response data. This is useful if you want to ensure
8888- * the response conforms to the desired shape, so it can be safely passed to
8989- * the transformers and returned to the user.
9090- */
9191- responseValidator?: (data: unknown) => Promise<unknown>;
9292-}
9393-9494-type IsExactlyNeverOrNeverUndefined<T> = [T] extends [never]
9595- ? true
9696- : [T] extends [never | undefined]
9797- ? [undefined] extends [T]
9898- ? false
9999- : true
100100- : false;
101101-102102-export type OmitNever<T extends Record<string, unknown>> = {
103103- [K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true ? never : K]: T[K];
104104-};
···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-export { type Options, postFoo } from './sdk.gen';
44-export type { Bar, ClientOptions, Foo, PostFooData, PostFooResponse, PostFooResponses, TypeID, UserId } from './types.gen';
···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-import * as v from 'valibot';
44-55-import type { Client, Options as Options2, TDataShape } from './client';
66-import { client } from './client.gen';
77-import { postFooResponseTransformer } from './transformers.gen';
88-import type { PostFooData, PostFooResponses } from './types.gen';
99-import { vPostFooData, vPostFooResponse } from './valibot.gen';
1010-1111-export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
1212- /**
1313- * You can provide a client instance returned by `createClient()` instead of
1414- * individual options. This might be also useful if you want to implement a
1515- * custom client.
1616- */
1717- client?: Client;
1818- /**
1919- * You can pass arbitrary values through the `meta` object. This can be
2020- * used to access values that aren't defined as part of the SDK function.
2121- */
2222- meta?: Record<string, unknown>;
2323-};
2424-2525-export const postFoo = <ThrowOnError extends boolean = false>(options?: Options<PostFooData, ThrowOnError>) => (options?.client ?? client).post<PostFooResponses, unknown, ThrowOnError>({
2626- requestValidator: async (data) => await v.parseAsync(vPostFooData, data),
2727- responseTransformer: postFooResponseTransformer,
2828- responseValidator: async (data) => await v.parseAsync(vPostFooResponse, data),
2929- url: '/foo',
3030- ...options
3131-});
···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-import { type ClientOptions, type Config, createClient, createConfig } from './client';
44-import type { ClientOptions as ClientOptions2 } from './types.gen';
55-66-/**
77- * The `createClientConfig()` function will be called on client initialization
88- * and the returned object will become the client's initial configuration.
99- *
1010- * You may want to initialize your client this way instead of calling
1111- * `setConfig()`. This is useful for example if you're using Next.js
1212- * to ensure your client always has the correct values.
1313- */
1414-export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
1515-1616-export const client = createClient(createConfig<ClientOptions2>({ baseUrl: 'http://localhost:3000/base' }));
···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-import { type ClientOptions, type Config, createClient, createConfig } from './client';
44-import type { ClientOptions as ClientOptions2 } from './types.gen';
55-66-/**
77- * The `createClientConfig()` function will be called on client initialization
88- * and the returned object will become the client's initial configuration.
99- *
1010- * You may want to initialize your client this way instead of calling
1111- * `setConfig()`. This is useful for example if you're using Next.js
1212- * to ensure your client always has the correct values.
1313- */
1414-export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
1515-1616-export const client = createClient(createConfig<ClientOptions2>());
···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-import type { Auth, AuthToken } from './auth.gen';
44-import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer.gen';
55-66-export type HttpMethod =
77- | 'connect'
88- | 'delete'
99- | 'get'
1010- | 'head'
1111- | 'options'
1212- | 'patch'
1313- | 'post'
1414- | 'put'
1515- | 'trace';
1616-1717-export type Client<
1818- RequestFn = never,
1919- Config = unknown,
2020- MethodFn = never,
2121- BuildUrlFn = never,
2222- SseFn = never,
2323-> = {
2424- /**
2525- * Returns the final request URL.
2626- */
2727- buildUrl: BuildUrlFn;
2828- getConfig: () => Config;
2929- request: RequestFn;
3030- setConfig: (config: Config) => Config;
3131-} & {
3232- [K in HttpMethod]: MethodFn;
3333-} & ([SseFn] extends [never] ? { sse?: never } : { sse: { [K in HttpMethod]: SseFn } });
3434-3535-export interface Config {
3636- /**
3737- * Auth token or a function returning auth token. The resolved value will be
3838- * added to the request payload as defined by its `security` array.
3939- */
4040- auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
4141- /**
4242- * A function for serializing request body parameter. By default,
4343- * {@link JSON.stringify()} will be used.
4444- */
4545- bodySerializer?: BodySerializer | null;
4646- /**
4747- * An object containing any HTTP headers that you want to pre-populate your
4848- * `Headers` object with.
4949- *
5050- * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
5151- */
5252- headers?:
5353- | RequestInit['headers']
5454- | Record<
5555- string,
5656- string | number | boolean | (string | number | boolean)[] | null | undefined | unknown
5757- >;
5858- /**
5959- * The request method.
6060- *
6161- * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
6262- */
6363- method?: Uppercase<HttpMethod>;
6464- /**
6565- * A function for serializing request query parameters. By default, arrays
6666- * will be exploded in form style, objects will be exploded in deepObject
6767- * style, and reserved characters are percent-encoded.
6868- *
6969- * This method will have no effect if the native `paramsSerializer()` Axios
7070- * API function is used.
7171- *
7272- * {@link https://swagger.io/docs/specification/serialization/#query View examples}
7373- */
7474- querySerializer?: QuerySerializer | QuerySerializerOptions;
7575- /**
7676- * A function validating request data. This is useful if you want to ensure
7777- * the request conforms to the desired shape, so it can be safely sent to
7878- * the server.
7979- */
8080- requestValidator?: (data: unknown) => Promise<unknown>;
8181- /**
8282- * A function transforming response data before it's returned. This is useful
8383- * for post-processing data, e.g. converting ISO strings into Date objects.
8484- */
8585- responseTransformer?: (data: unknown) => Promise<unknown>;
8686- /**
8787- * A function validating response data. This is useful if you want to ensure
8888- * the response conforms to the desired shape, so it can be safely passed to
8989- * the transformers and returned to the user.
9090- */
9191- responseValidator?: (data: unknown) => Promise<unknown>;
9292-}
9393-9494-type IsExactlyNeverOrNeverUndefined<T> = [T] extends [never]
9595- ? true
9696- : [T] extends [never | undefined]
9797- ? [undefined] extends [T]
9898- ? false
9999- : true
100100- : false;
101101-102102-export type OmitNever<T extends Record<string, unknown>> = {
103103- [K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true ? never : K]: T[K];
104104-};
···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-export { type Options, postFoo } from './sdk.gen';
44-export type { Bar, ClientOptions, Foo, PostFooData, PostFooResponse, PostFooResponses, TypeID, UserId } from './types.gen';
···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-import * as v from 'valibot';
44-55-import type { Client, Options as Options2, TDataShape } from './client';
66-import { client } from './client.gen';
77-import { postFooResponseTransformer } from './transformers.gen';
88-import type { PostFooData, PostFooResponses } from './types.gen';
99-import { vPostFooData, vPostFooResponse } from './valibot.gen';
1010-1111-export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
1212- /**
1313- * You can provide a client instance returned by `createClient()` instead of
1414- * individual options. This might be also useful if you want to implement a
1515- * custom client.
1616- */
1717- client?: Client;
1818- /**
1919- * You can pass arbitrary values through the `meta` object. This can be
2020- * used to access values that aren't defined as part of the SDK function.
2121- */
2222- meta?: Record<string, unknown>;
2323-};
2424-2525-export const postFoo = <ThrowOnError extends boolean = false>(options?: Options<PostFooData, ThrowOnError>) => (options?.client ?? client).post<PostFooResponses, unknown, ThrowOnError>({
2626- requestValidator: async (data) => await v.parseAsync(vPostFooData, data),
2727- responseTransformer: postFooResponseTransformer,
2828- responseValidator: async (data) => await v.parseAsync(vPostFooResponse, data),
2929- url: '/foo',
3030- ...options
3131-});
···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-import { type ClientOptions, type Config, createClient, createConfig } from './client';
44-import type { ClientOptions as ClientOptions2 } from './types.gen';
55-66-/**
77- * The `createClientConfig()` function will be called on client initialization
88- * and the returned object will become the client's initial configuration.
99- *
1010- * You may want to initialize your client this way instead of calling
1111- * `setConfig()`. This is useful for example if you're using Next.js
1212- * to ensure your client always has the correct values.
1313- */
1414-export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
1515-1616-export const client = createClient(createConfig<ClientOptions2>());
···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-import type { Auth, AuthToken } from './auth.gen';
44-import type {
55- BodySerializer,
66- QuerySerializer,
77- QuerySerializerOptions,
88-} from './bodySerializer.gen';
99-1010-export type HttpMethod =
1111- | 'connect'
1212- | 'delete'
1313- | 'get'
1414- | 'head'
1515- | 'options'
1616- | 'patch'
1717- | 'post'
1818- | 'put'
1919- | 'trace';
2020-2121-export type Client<
2222- RequestFn = never,
2323- Config = unknown,
2424- MethodFn = never,
2525- BuildUrlFn = never,
2626- SseFn = never,
2727-> = {
2828- /**
2929- * Returns the final request URL.
3030- */
3131- buildUrl: BuildUrlFn;
3232- getConfig: () => Config;
3333- request: RequestFn;
3434- setConfig: (config: Config) => Config;
3535-} & {
3636- [K in HttpMethod]: MethodFn;
3737-} & ([SseFn] extends [never]
3838- ? { sse?: never }
3939- : { sse: { [K in HttpMethod]: SseFn } });
4040-4141-export interface Config {
4242- /**
4343- * Auth token or a function returning auth token. The resolved value will be
4444- * added to the request payload as defined by its `security` array.
4545- */
4646- auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
4747- /**
4848- * A function for serializing request body parameter. By default,
4949- * {@link JSON.stringify()} will be used.
5050- */
5151- bodySerializer?: BodySerializer | null;
5252- /**
5353- * An object containing any HTTP headers that you want to pre-populate your
5454- * `Headers` object with.
5555- *
5656- * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
5757- */
5858- headers?:
5959- | RequestInit['headers']
6060- | Record<
6161- string,
6262- | string
6363- | number
6464- | boolean
6565- | (string | number | boolean)[]
6666- | null
6767- | undefined
6868- | unknown
6969- >;
7070- /**
7171- * The request method.
7272- *
7373- * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
7474- */
7575- method?: Uppercase<HttpMethod>;
7676- /**
7777- * A function for serializing request query parameters. By default, arrays
7878- * will be exploded in form style, objects will be exploded in deepObject
7979- * style, and reserved characters are percent-encoded.
8080- *
8181- * This method will have no effect if the native `paramsSerializer()` Axios
8282- * API function is used.
8383- *
8484- * {@link https://swagger.io/docs/specification/serialization/#query View examples}
8585- */
8686- querySerializer?: QuerySerializer | QuerySerializerOptions;
8787- /**
8888- * A function validating request data. This is useful if you want to ensure
8989- * the request conforms to the desired shape, so it can be safely sent to
9090- * the server.
9191- */
9292- requestValidator?: (data: unknown) => Promise<unknown>;
9393- /**
9494- * A function transforming response data before it's returned. This is useful
9595- * for post-processing data, e.g. converting ISO strings into Date objects.
9696- */
9797- responseTransformer?: (data: unknown) => Promise<unknown>;
9898- /**
9999- * A function validating response data. This is useful if you want to ensure
100100- * the response conforms to the desired shape, so it can be safely passed to
101101- * the transformers and returned to the user.
102102- */
103103- responseValidator?: (data: unknown) => Promise<unknown>;
104104-}
105105-106106-type IsExactlyNeverOrNeverUndefined<T> = [T] extends [never]
107107- ? true
108108- : [T] extends [never | undefined]
109109- ? [undefined] extends [T]
110110- ? false
111111- : true
112112- : false;
113113-114114-export type OmitNever<T extends Record<string, unknown>> = {
115115- [K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true
116116- ? never
117117- : K]: T[K];
118118-};
···11-// This file is auto-generated by @hey-api/openapi-ts
22-33-export { getBar, getFoo, type Options } from './sdk.gen';
44-export type { ClientOptions, GetBarData, GetBarResponses, GetFooData, GetFooResponses } from './types.gen';
···11import * as v from 'valibot';
2233-import { setupValibotTest } from './test-helper';
33+import { setupValibotTest } from './utils';
4455// TODO: further clean up
66describe('Object Additional Properties Tests', () => {
···11import * as v from 'valibot';
2233-import { setupValibotTest } from './test-helper';
33+import { setupValibotTest } from './utils';
4455// TODO: further clean up
66describe('Number Type Const Values Tests', () => {
···11import * as v from 'valibot';
2233-import { setupValibotTest } from './test-helper';
33+import { setupValibotTest } from './utils';
4455// TODO: further clean up
66describe('Number Type Formats Tests', () => {
···11import * as v from 'valibot';
2233-import { setupValibotTest } from './test-helper';
33+import { setupValibotTest } from './utils';
4455// TODO: further clean up
66describe('Number Type Min/Max Constraints Tests', () => {