@hey-api/openapi-ts 0.92.2 → 0.92.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clients/angular/client.ts +2 -1
- package/dist/clients/angular/types.ts +3 -2
- package/dist/clients/nuxt/client.ts +4 -4
- package/dist/index.d.mts +209 -318
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{init-DlaW5Djq.mjs → init-BxMu9GWq.mjs} +761 -952
- package/dist/init-BxMu9GWq.mjs.map +1 -0
- package/dist/internal.mjs +1 -1
- package/dist/run.mjs +3 -3
- package/dist/{src-BYA2YioO.mjs → src-BqiDMJko.mjs} +2 -2
- package/dist/src-BqiDMJko.mjs.map +1 -0
- package/package.json +13 -18
- package/dist/init-DlaW5Djq.mjs.map +0 -1
- package/dist/src-BYA2YioO.mjs.map +0 -1
|
@@ -53,10 +53,11 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
53
53
|
>();
|
|
54
54
|
|
|
55
55
|
const requestOptions = <
|
|
56
|
+
TData = unknown,
|
|
56
57
|
ThrowOnError extends boolean = false,
|
|
57
58
|
TResponseStyle extends ResponseStyle = 'fields',
|
|
58
59
|
>(
|
|
59
|
-
options: RequestOptions<
|
|
60
|
+
options: RequestOptions<TData, TResponseStyle, ThrowOnError>,
|
|
60
61
|
) => {
|
|
61
62
|
const opts = {
|
|
62
63
|
..._config,
|
|
@@ -170,11 +170,12 @@ type RequestFn = <
|
|
|
170
170
|
) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
171
171
|
|
|
172
172
|
type RequestOptionsFn = <
|
|
173
|
+
T,
|
|
173
174
|
ThrowOnError extends boolean = false,
|
|
174
175
|
TResponseStyle extends ResponseStyle = 'fields',
|
|
175
176
|
>(
|
|
176
|
-
options: RequestOptions<
|
|
177
|
-
) => HttpRequest<
|
|
177
|
+
options: RequestOptions<T, TResponseStyle, ThrowOnError>,
|
|
178
|
+
) => HttpRequest<T>;
|
|
178
179
|
|
|
179
180
|
type BuildUrlFn = <
|
|
180
181
|
TData extends {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useAsyncData, useFetch, useLazyAsyncData, useLazyFetch } from 'nuxt/app';
|
|
2
|
-
import { reactive, ref, watch } from 'vue';
|
|
2
|
+
import { reactive, ref, toValue, watch } from 'vue';
|
|
3
3
|
|
|
4
4
|
import { createSseClient } from '../core/serverSentEvents';
|
|
5
5
|
import type { HttpMethod } from '../core/types';
|
|
@@ -136,14 +136,14 @@ export const createClient = (config: Config = {}): Client => {
|
|
|
136
136
|
body: opts.body,
|
|
137
137
|
bodySerializer: opts.bodySerializer,
|
|
138
138
|
});
|
|
139
|
-
const body = ref(serializeBody(opts));
|
|
139
|
+
const body = ref(serializeBody({ ...opts, body: toValue(opts.body) }));
|
|
140
140
|
opts.body = body;
|
|
141
141
|
watch(bodyParams, (changed) => {
|
|
142
142
|
body.value = serializeBody(changed);
|
|
143
143
|
});
|
|
144
144
|
return composable === 'useLazyFetch'
|
|
145
|
-
? useLazyFetch(() => buildUrl(opts), opts)
|
|
146
|
-
: useFetch(() => buildUrl(opts), opts);
|
|
145
|
+
? useLazyFetch(() => buildUrl(opts), { ...opts, ...asyncDataOptions })
|
|
146
|
+
: useFetch(() => buildUrl(opts), { ...opts, ...asyncDataOptions });
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
const handler: any = () =>
|