···11----
22-'@hey-api/nuxt': minor
33----
44-55-feat: remove `@hey-api/client-nuxt` dependency
+4
.gitignore
···24242525# error files
2626openapi-ts-error-*
2727+2828+# But DO NOT ignore generated snapshots!
2929+!test/__snapshots__/test/generated
3030+!test/__snapshots__/test/generated/**
···11<script lang="ts" setup>
22import type { Pet } from '@/client'
33-import { createClient } from '@client/client'
33+import { createClient } from '@/client/client'
44import { PetSchema } from '@/client/schemas.gen'
55import {
66 addPetMutation,
···99} from '@/client/@tanstack/vue-query.gen'
1010import { useMutation, useQuery, useQueryClient } from '@tanstack/vue-query'
1111import { computed, ref, watch } from 'vue'
1212+import type { RequestOptions } from '@/client/client'
12131314const queryClient = useQueryClient()
1415···2526 }
2627})
27282828-localClient.interceptors.request.use((request, options) => {
2929+localClient.interceptors.request.use((request: Request, options: RequestOptions) => {
2930 // Middleware is great for adding authorization tokens to requests made to
3031 // protected paths. Headers are set randomly here to allow surfacing the
3132 // default headers, too.
···11// This file is auto-generated by @hey-api/openapi-ts
2233import type { ClientOptions } from './types.gen.js';
44-import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client.js';
44+import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client/index.js';
5566/**
77 * The `createClientConfig()` function will be called on client initialization
···11// This file is auto-generated by @hey-api/openapi-ts
2233import type { ClientOptions } from './types.gen.js';
44-import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client.js';
44+import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client/index.js';
5566/**
77 * The `createClientConfig()` function will be called on client initialization
···11-import type { Auth } from '../core/auth';
11+import type { Auth } from '../core/auth.js';
22import type {
33 Client as CoreClient,
44 Config as CoreConfig,
55-} from '../core/types';
66-import type { Middleware } from './utils';
55+} from '../core/types.js';
66+import type { Middleware } from './utils.js';
7788export type ResponseStyle = 'data' | 'fields';
99
···11// This file is auto-generated by @hey-api/openapi-ts
2233import type { ClientOptions } from './types.gen.js';
44-import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client.js';
44+import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client/index.js';
5566/**
77 * The `createClientConfig()` function will be called on client initialization
···11-import type { Auth } from '../core/auth';
11+import type { Auth } from '../core/auth.js';
22import type {
33 Client as CoreClient,
44 Config as CoreConfig,
55-} from '../core/types';
66-import type { Middleware } from './utils';
55+} from '../core/types.js';
66+import type { Middleware } from './utils.js';
7788export interface Config<T extends ClientOptions = ClientOptions>
99 extends Omit<RequestInit, 'body' | 'headers' | 'method'>,
···11// This file is auto-generated by @hey-api/openapi-ts
2233import type { ClientOptions } from './types.gen.js';
44-import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client.js';
44+import { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from './client/index.js';
5566/**
77 * The `createClientConfig()` function will be called on client initialization
···88} from 'nuxt/app';
99import type { Ref } from 'vue';
10101111-import type { Auth } from '../core/auth';
1212-import type { QuerySerializerOptions } from '../core/bodySerializer';
1111+import type { Auth } from '../core/auth.js';
1212+import type { QuerySerializerOptions } from '../core/bodySerializer.js';
1313import type {
1414 Client as CoreClient,
1515 Config as CoreConfig,
1616-} from '../core/types';
1616+} from '../core/types.js';
17171818export type ArraySeparatorStyle = ArrayStyle | MatrixStyle;
1919type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
···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+}