@hey-api/openapi-ts 0.92.3 → 0.93.0
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 +4 -2
- package/dist/clients/axios/types.ts +1 -0
- package/dist/clients/fetch/types.ts +1 -0
- package/dist/clients/ky/types.ts +1 -0
- package/dist/clients/next/types.ts +1 -0
- package/dist/clients/nuxt/client.ts +4 -4
- package/dist/index.d.mts +163 -242
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{init-W7OZahc5.mjs → init-BVQKw3ZX.mjs} +2276 -1988
- package/dist/init-BVQKw3ZX.mjs.map +1 -0
- package/dist/internal.mjs +1 -1
- package/dist/run.mjs +3 -3
- package/dist/{src-BbXkGzWZ.mjs → src-BD5OAshH.mjs} +8 -4
- package/dist/src-BD5OAshH.mjs.map +1 -0
- package/package.json +13 -18
- package/dist/init-W7OZahc5.mjs.map +0 -1
- package/dist/src-BbXkGzWZ.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,
|
|
@@ -67,6 +67,7 @@ export interface RequestOptions<
|
|
|
67
67
|
}>,
|
|
68
68
|
Pick<
|
|
69
69
|
ServerSentEventsOptions<TData>,
|
|
70
|
+
| 'onRequest'
|
|
70
71
|
| 'onSseError'
|
|
71
72
|
| 'onSseEvent'
|
|
72
73
|
| 'sseDefaultRetryDelay'
|
|
@@ -170,11 +171,12 @@ type RequestFn = <
|
|
|
170
171
|
) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
171
172
|
|
|
172
173
|
type RequestOptionsFn = <
|
|
174
|
+
T,
|
|
173
175
|
ThrowOnError extends boolean = false,
|
|
174
176
|
TResponseStyle extends ResponseStyle = 'fields',
|
|
175
177
|
>(
|
|
176
|
-
options: RequestOptions<
|
|
177
|
-
) => HttpRequest<
|
|
178
|
+
options: RequestOptions<T, TResponseStyle, ThrowOnError>,
|
|
179
|
+
) => HttpRequest<T>;
|
|
178
180
|
|
|
179
181
|
type BuildUrlFn = <
|
|
180
182
|
TData extends {
|
package/dist/clients/ky/types.ts
CHANGED
|
@@ -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 = () =>
|