nuxt-api-party
Advanced tools
Comparing version 0.20.0 to 0.20.1
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "0.20.0" | ||
"version": "0.20.1" | ||
} |
@@ -9,3 +9,3 @@ import type { FetchError } from 'ofetch'; | ||
}; | ||
export type BaseUseApiDataOptions<T> = Omit<AsyncDataOptions<T>, 'watch'> & { | ||
export type BaseUseApiDataOptions<ResT, DataT = ResT> = Omit<AsyncDataOptions<ResT, DataT>, 'watch'> & { | ||
/** | ||
@@ -38,14 +38,14 @@ * Skip the Nuxt server proxy and fetch directly from the API. | ||
pathParams?: MaybeRefOrGetter<Record<string, string>>; | ||
body?: MaybeRef<string | Record<string, any> | FormData | null | undefined>; | ||
body?: MaybeRef<string | Record<string, any> | FormData | null>; | ||
} & BaseUseApiDataOptions<T>; | ||
export type UseOpenApiDataOptions<P extends PathItemObject, M extends IgnoreCase<keyof P & HttpMethod> = IgnoreCase<keyof P & 'get'>> = BaseUseApiDataOptions<OpenApiResponse<P[Lowercase<M>]>> & ComputedOptions<OpenApiRequestOptions<P, M>>; | ||
export type UseOpenApiDataOptions<P extends PathItemObject, M extends IgnoreCase<keyof P & HttpMethod> = IgnoreCase<keyof P & 'get'>, ResT = OpenApiResponse<P[Lowercase<M>]>, DataT = ResT> = BaseUseApiDataOptions<ResT, DataT> & ComputedOptions<OpenApiRequestOptions<P, M>>; | ||
export type UseApiData = <T = any>(path: MaybeRefOrGetter<string>, opts?: UseApiDataOptions<T>) => AsyncData<T | undefined, FetchError>; | ||
export interface UseOpenApiData<Paths extends Record<string, PathItemObject>> { | ||
<P extends GETPlainPaths<Paths>>(path: MaybeRefOrGetter<P>, opts?: Omit<UseOpenApiDataOptions<Paths[`/${P}`]>, 'method'>): AsyncData<OpenApiResponse<Paths[`/${P}`]['get']> | undefined, FetchError<OpenApiError<Paths[`/${P}`]['get']>>>; | ||
<P extends GETPaths<Paths>>(path: MaybeRefOrGetter<P>, opts: Omit<UseOpenApiDataOptions<Paths[`/${P}`]>, 'method'>): AsyncData<OpenApiResponse<Paths[`/${P}`]['get']> | undefined, FetchError<OpenApiError<Paths[`/${P}`]['get']>>>; | ||
<P extends AllPaths<Paths>, M extends IgnoreCase<keyof Paths[`/${P}`] & HttpMethod>>(path: MaybeRefOrGetter<P>, opts: UseOpenApiDataOptions<Paths[`/${P}`], M> & { | ||
<P extends GETPlainPaths<Paths>, ResT = OpenApiResponse<Paths[`/${P}`]['get']>, DataT = ResT>(path: MaybeRefOrGetter<P>, opts?: Omit<UseOpenApiDataOptions<Paths[`/${P}`], IgnoreCase<keyof Paths[`/${P}`] & HttpMethod>, ResT, DataT>, 'method'>): AsyncData<DataT, FetchError<OpenApiError<Paths[`/${P}`]['get']>>>; | ||
<P extends GETPaths<Paths>, ResT = OpenApiResponse<Paths[`/${P}`]['get']>, DataT = ResT>(path: MaybeRefOrGetter<P>, opts: Omit<UseOpenApiDataOptions<Paths[`/${P}`], IgnoreCase<keyof Paths[`/${P}`] & HttpMethod>, ResT, DataT>, 'method'>): AsyncData<DataT, FetchError<OpenApiError<Paths[`/${P}`]['get']>>>; | ||
<P extends AllPaths<Paths>, M extends IgnoreCase<keyof Paths[`/${P}`] & HttpMethod>, ResT = OpenApiResponse<Paths[`/${P}`][Lowercase<M>]>, DataT = ResT>(path: MaybeRefOrGetter<P>, opts: UseOpenApiDataOptions<Paths[`/${P}`], M, ResT, DataT> & { | ||
method: M; | ||
}): AsyncData<OpenApiResponse<Paths[`/${P}`][Lowercase<M>]> | undefined, FetchError<OpenApiError<Paths[`/${P}`][Lowercase<M>]>>>; | ||
}): AsyncData<DataT, FetchError<OpenApiError<Paths[`/${P}`][Lowercase<M>]>>>; | ||
} | ||
export declare function _useApiData<T = any>(endpointId: string, path: MaybeRefOrGetter<string>, opts?: UseApiDataOptions<T>): AsyncData<T | undefined, FetchError<any>>; | ||
export {}; |
{ | ||
"name": "nuxt-api-party", | ||
"type": "module", | ||
"version": "0.20.0", | ||
"version": "0.20.1", | ||
"packageManager": "pnpm@8.7.6", | ||
@@ -6,0 +6,0 @@ "description": "Nuxt 3 module to securely connect with any API", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42582
857