···11-import type { Auth } from '@hey-api/client-core';
21import { describe, expect, it, vi } from 'vitest';
3233+import type { Auth } from '../core/auth';
44import { getParseAs, setAuthParams } from '../utils';
5566describe('getParseAs', () => {
···11-import type {
22- Auth,
33- Client as CoreClient,
44- Config as CoreConfig,
55-} from '@hey-api/client-core';
66-11+import type { Auth } from './core/auth';
22+import type { Client as CoreClient, Config as CoreConfig } from './core/types';
73import type { Middleware } from './utils';
8495export interface Config<T extends ClientOptions = ClientOptions>
···11+import type { Auth, AuthToken } from './auth';
22+import type {
33+ BodySerializer,
44+ QuerySerializer,
55+ QuerySerializerOptions,
66+} from './bodySerializer';
77+88+export interface Client<
99+ RequestFn = never,
1010+ Config = unknown,
1111+ MethodFn = never,
1212+ BuildUrlFn = never,
1313+> {
1414+ /**
1515+ * Returns the final request URL.
1616+ */
1717+ buildUrl: BuildUrlFn;
1818+ connect: MethodFn;
1919+ delete: MethodFn;
2020+ get: MethodFn;
2121+ getConfig: () => Config;
2222+ head: MethodFn;
2323+ options: MethodFn;
2424+ patch: MethodFn;
2525+ post: MethodFn;
2626+ put: MethodFn;
2727+ request: RequestFn;
2828+ setConfig: (config: Config) => Config;
2929+ trace: MethodFn;
3030+}
3131+3232+export interface Config {
3333+ /**
3434+ * Auth token or a function returning auth token. The resolved value will be
3535+ * added to the request payload as defined by its `security` array.
3636+ */
3737+ auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
3838+ /**
3939+ * A function for serializing request body parameter. By default,
4040+ * {@link JSON.stringify()} will be used.
4141+ */
4242+ bodySerializer?: BodySerializer | null;
4343+ /**
4444+ * An object containing any HTTP headers that you want to pre-populate your
4545+ * `Headers` object with.
4646+ *
4747+ * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
4848+ */
4949+ headers?:
5050+ | RequestInit['headers']
5151+ | Record<
5252+ string,
5353+ | string
5454+ | number
5555+ | boolean
5656+ | (string | number | boolean)[]
5757+ | null
5858+ | undefined
5959+ | unknown
6060+ >;
6161+ /**
6262+ * The request method.
6363+ *
6464+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
6565+ */
6666+ method?:
6767+ | 'CONNECT'
6868+ | 'DELETE'
6969+ | 'GET'
7070+ | 'HEAD'
7171+ | 'OPTIONS'
7272+ | 'PATCH'
7373+ | 'POST'
7474+ | 'PUT'
7575+ | 'TRACE';
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 transforming response data before it's returned. This is useful
8989+ * for post-processing data, e.g. converting ISO strings into Date objects.
9090+ */
9191+ responseTransformer?: (data: unknown) => Promise<unknown>;
9292+ /**
9393+ * A function validating response data. This is useful if you want to ensure
9494+ * the response conforms to the desired shape, so it can be safely passed to
9595+ * the transformers and returned to the user.
9696+ */
9797+ responseValidator?: (data: unknown) => Promise<unknown>;
9898+}
···22import path from 'node:path';
33import { fileURLToPath } from 'node:url';
4455-import { customClientPlugin } from '@hey-api/client-custom/plugin';
55+import { customClientPlugin } from '@hey-api/custom-client/plugin';
66import { createClient, type UserConfig } from '@hey-api/openapi-ts';
77import { describe, expect, it } from 'vitest';
88