Skip to content

Commit 8beb194

Browse files
committed
chore: refresh generated openapi client
1 parent eed6bc2 commit 8beb194

14 files changed

Lines changed: 301 additions & 367 deletions

frontend/src/api/generated/client.gen.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ import type { ClientOptions as ClientOptions2 } from './types.gen';
1111
* `setConfig()`. This is useful for example if you're using Next.js
1212
* to ensure your client always has the correct values.
1313
*/
14-
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (
15-
override?: Config<ClientOptions & T>
16-
) => Config<Required<ClientOptions> & T> | Promise<Config<Required<ClientOptions> & T>>;
14+
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T> | Promise<Config<Required<ClientOptions> & T>>;
1715

18-
export const client = createClient(
19-
createConfig<ClientOptions2>({ baseUrl: 'https://api.html2rss.dev/api/v1' })
20-
);
16+
export const client = createClient(createConfig<ClientOptions2>({ baseUrl: 'https://api.html2rss.dev/api/v1' }));

frontend/src/api/generated/client/client.gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ export const createClient = (config: Config = {}): Client => {
128128

129129
if (response.ok) {
130130
const parseAs =
131-
(opts.parseAs === 'auto' ? getParseAs(response.headers.get('Content-Type')) : opts.parseAs) ?? 'json';
131+
(opts.parseAs === 'auto'
132+
? getParseAs(response.headers.get('Content-Type'))
133+
: opts.parseAs) ?? 'json';
132134

133135
if (response.status === 204 || response.headers.get('Content-Length') === '0') {
134136
let emptyData: any;

frontend/src/api/generated/client/types.gen.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

33
import type { Auth } from '../core/auth.gen';
4-
import type { ServerSentEventsOptions, ServerSentEventsResult } from '../core/serverSentEvents.gen';
4+
import type {
5+
ServerSentEventsOptions,
6+
ServerSentEventsResult,
7+
} from '../core/serverSentEvents.gen';
58
import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen';
69
import type { Middleware } from './utils.gen';
710

@@ -140,7 +143,7 @@ type MethodFn = <
140143
ThrowOnError extends boolean = false,
141144
TResponseStyle extends ResponseStyle = 'fields',
142145
>(
143-
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>
146+
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>,
144147
) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
145148

146149
type SseFn = <
@@ -149,7 +152,7 @@ type SseFn = <
149152
ThrowOnError extends boolean = false,
150153
TResponseStyle extends ResponseStyle = 'fields',
151154
>(
152-
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>
155+
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>,
153156
) => Promise<ServerSentEventsResult<TData, TError>>;
154157

155158
type RequestFn = <
@@ -159,7 +162,7 @@ type RequestFn = <
159162
TResponseStyle extends ResponseStyle = 'fields',
160163
>(
161164
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> &
162-
Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>
165+
Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>,
163166
) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
164167

165168
type BuildUrlFn = <
@@ -170,7 +173,7 @@ type BuildUrlFn = <
170173
url: string;
171174
},
172175
>(
173-
options: TData & Options<TData>
176+
options: TData & Options<TData>,
174177
) => string;
175178

176179
export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
@@ -186,7 +189,7 @@ export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn>
186189
* to ensure your client always has the correct values.
187190
*/
188191
export type CreateClientConfig<T extends ClientOptions = ClientOptions> = (
189-
override?: Config<ClientOptions & T>
192+
override?: Config<ClientOptions & T>,
190193
) => Config<Required<ClientOptions> & T> | Promise<Config<Required<ClientOptions> & T>>;
191194

192195
export interface TDataShape {
@@ -204,5 +207,8 @@ export type Options<
204207
ThrowOnError extends boolean = boolean,
205208
TResponse = unknown,
206209
TResponseStyle extends ResponseStyle = 'fields',
207-
> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> &
210+
> = OmitKeys<
211+
RequestOptions<TResponse, TResponseStyle, ThrowOnError>,
212+
'body' | 'path' | 'query' | 'url'
213+
> &
208214
([TData] extends [never] ? unknown : Omit<TData, 'url'>);

frontend/src/api/generated/client/utils.gen.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ export const getParseAs = (contentType: string | null): Exclude<Config['parseAs'
8686
return 'formData';
8787
}
8888

89-
if (['application/', 'audio/', 'image/', 'video/'].some((type) => cleanContent.startsWith(type))) {
89+
if (
90+
['application/', 'audio/', 'image/', 'video/'].some((type) => cleanContent.startsWith(type))
91+
) {
9092
return 'blob';
9193
}
9294

@@ -101,7 +103,7 @@ const checkForExistence = (
101103
options: Pick<RequestOptions, 'auth' | 'query'> & {
102104
headers: Headers;
103105
},
104-
name?: string
106+
name?: string,
105107
): boolean => {
106108
if (!name) {
107109
return false;
@@ -183,7 +185,9 @@ const headersEntries = (headers: Headers): Array<[string, string]> => {
183185
return entries;
184186
};
185187

186-
export const mergeHeaders = (...headers: Array<Required<Config>['headers'] | undefined>): Headers => {
188+
export const mergeHeaders = (
189+
...headers: Array<Required<Config>['headers'] | undefined>
190+
): Headers => {
187191
const mergedHeaders = new Headers();
188192
for (const header of headers) {
189193
if (!header) {
@@ -202,7 +206,10 @@ export const mergeHeaders = (...headers: Array<Required<Config>['headers'] | und
202206
} else if (value !== undefined) {
203207
// assume object headers are meant to be JSON stringified, i.e. their
204208
// content value in OpenAPI specification is 'application/json'
205-
mergedHeaders.set(key, typeof value === 'object' ? JSON.stringify(value) : (value as string));
209+
mergedHeaders.set(
210+
key,
211+
typeof value === 'object' ? JSON.stringify(value) : (value as string),
212+
);
206213
}
207214
}
208215
}
@@ -213,15 +220,15 @@ type ErrInterceptor<Err, Res, Req, Options> = (
213220
error: Err,
214221
response: Res,
215222
request: Req,
216-
options: Options
223+
options: Options,
217224
) => Err | Promise<Err>;
218225

219226
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
220227

221228
type ResInterceptor<Res, Req, Options> = (
222229
response: Res,
223230
request: Req,
224-
options: Options
231+
options: Options,
225232
) => Res | Promise<Res>;
226233

227234
class Interceptors<Interceptor> {
@@ -271,7 +278,12 @@ export interface Middleware<Req, Res, Err, Options> {
271278
response: Interceptors<ResInterceptor<Res, Req, Options>>;
272279
}
273280

274-
export const createInterceptors = <Req, Res, Err, Options>(): Middleware<Req, Res, Err, Options> => ({
281+
export const createInterceptors = <Req, Res, Err, Options>(): Middleware<
282+
Req,
283+
Res,
284+
Err,
285+
Options
286+
> => ({
275287
error: new Interceptors<ErrInterceptor<Err, Res, Req, Options>>(),
276288
request: new Interceptors<ReqInterceptor<Req, Options>>(),
277289
response: new Interceptors<ResInterceptor<Res, Req, Options>>(),
@@ -294,7 +306,7 @@ const defaultHeaders = {
294306
};
295307

296308
export const createConfig = <T extends ClientOptions = ClientOptions>(
297-
override: Config<Omit<ClientOptions, keyof T> & T> = {}
309+
override: Config<Omit<ClientOptions, keyof T> & T> = {},
298310
): Config<Omit<ClientOptions, keyof T> & T> => ({
299311
...jsonBodySerializer,
300312
headers: defaultHeaders,

frontend/src/api/generated/core/auth.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface Auth {
2121

2222
export const getAuthToken = async (
2323
auth: Auth,
24-
callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken
24+
callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken,
2525
): Promise<string | undefined> => {
2626
const token = typeof callback === 'function' ? await callback(auth) : callback;
2727

frontend/src/api/generated/core/bodySerializer.gen.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value:
3939
};
4040

4141
export const formDataBodySerializer = {
42-
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(body: T): FormData => {
42+
bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
43+
body: T,
44+
): FormData => {
4345
const data = new FormData();
4446

4547
Object.entries(body).forEach(([key, value]) => {

frontend/src/api/generated/core/pathSerializer.gen.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ export const serializeArrayParam = ({
7474
value: unknown[];
7575
}) => {
7676
if (!explode) {
77-
const joinedValues = (allowReserved ? value : value.map((v) => encodeURIComponent(v as string))).join(
78-
separatorArrayNoExplode(style)
79-
);
77+
const joinedValues = (
78+
allowReserved ? value : value.map((v) => encodeURIComponent(v as string))
79+
).join(separatorArrayNoExplode(style));
8080
switch (style) {
8181
case 'label':
8282
return `.${joinedValues}`;
@@ -106,14 +106,18 @@ export const serializeArrayParam = ({
106106
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;
107107
};
108108

109-
export const serializePrimitiveParam = ({ allowReserved, name, value }: SerializePrimitiveParam) => {
109+
export const serializePrimitiveParam = ({
110+
allowReserved,
111+
name,
112+
value,
113+
}: SerializePrimitiveParam) => {
110114
if (value === undefined || value === null) {
111115
return '';
112116
}
113117

114118
if (typeof value === 'object') {
115119
throw new Error(
116-
'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.'
120+
'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.',
117121
);
118122
}
119123

@@ -160,7 +164,7 @@ export const serializeObjectParam = ({
160164
allowReserved,
161165
name: style === 'deepObject' ? `${name}[${key}]` : key,
162166
value: v as string,
163-
})
167+
}),
164168
)
165169
.join(separator);
166170
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;

frontend/src/api/generated/core/queryKeySerializer.gen.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
/**
44
* JSON-friendly union that mirrors what Pinia Colada can hash.
55
*/
6-
export type JsonValue = null | string | number | boolean | JsonValue[] | { [key: string]: JsonValue };
6+
export type JsonValue =
7+
| null
8+
| string
9+
| number
10+
| boolean
11+
| JsonValue[]
12+
| { [key: string]: JsonValue };
713

814
/**
915
* Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.

frontend/src/api/generated/core/serverSentEvents.gen.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ export interface StreamEvent<TData = unknown> {
7272
}
7373

7474
export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
75-
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
75+
stream: AsyncGenerator<
76+
TData extends Record<string, unknown> ? TData[keyof TData] : TData,
77+
TReturn,
78+
TNext
79+
>;
7680
};
7781

7882
export const createSseClient = <TData = unknown>({

frontend/src/api/generated/core/types.gen.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ export interface Config {
5151
*/
5252
headers?:
5353
| RequestInit['headers']
54-
| Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
54+
| Record<
55+
string,
56+
string | number | boolean | (string | number | boolean)[] | null | undefined | unknown
57+
>;
5558
/**
5659
* The request method.
5760
*

0 commit comments

Comments
 (0)