Skip to content

Commit eed6bc2

Browse files
committed
style: prettier
1 parent 89abd53 commit eed6bc2

17 files changed

Lines changed: 533 additions & 467 deletions

frontend/src/api/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const resolveBaseUrl = (): string => {
1212
export const apiClient = createClient(
1313
createConfig({
1414
baseUrl: resolveBaseUrl(),
15-
}),
15+
})
1616
);
1717

1818
export const bearerHeaders = (token: string | null): Record<string, string> =>

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ 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> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T> | Promise<Config<Required<ClientOptions> & T>>;
14+
export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (
15+
override?: Config<ClientOptions & T>
16+
) => Config<Required<ClientOptions> & T> | Promise<Config<Required<ClientOptions> & T>>;
1517

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

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

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

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

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

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

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

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

@@ -143,7 +140,7 @@ type MethodFn = <
143140
ThrowOnError extends boolean = false,
144141
TResponseStyle extends ResponseStyle = 'fields',
145142
>(
146-
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>,
143+
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>
147144
) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
148145

149146
type SseFn = <
@@ -152,7 +149,7 @@ type SseFn = <
152149
ThrowOnError extends boolean = false,
153150
TResponseStyle extends ResponseStyle = 'fields',
154151
>(
155-
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>,
152+
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>
156153
) => Promise<ServerSentEventsResult<TData, TError>>;
157154

158155
type RequestFn = <
@@ -162,7 +159,7 @@ type RequestFn = <
162159
TResponseStyle extends ResponseStyle = 'fields',
163160
>(
164161
options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> &
165-
Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>,
162+
Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>
166163
) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
167164

168165
type BuildUrlFn = <
@@ -173,7 +170,7 @@ type BuildUrlFn = <
173170
url: string;
174171
},
175172
>(
176-
options: TData & Options<TData>,
173+
options: TData & Options<TData>
177174
) => string;
178175

179176
export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
@@ -189,7 +186,7 @@ export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn>
189186
* to ensure your client always has the correct values.
190187
*/
191188
export type CreateClientConfig<T extends ClientOptions = ClientOptions> = (
192-
override?: Config<ClientOptions & T>,
189+
override?: Config<ClientOptions & T>
193190
) => Config<Required<ClientOptions> & T> | Promise<Config<Required<ClientOptions> & T>>;
194191

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

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

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

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

@@ -103,7 +101,7 @@ const checkForExistence = (
103101
options: Pick<RequestOptions, 'auth' | 'query'> & {
104102
headers: Headers;
105103
},
106-
name?: string,
104+
name?: string
107105
): boolean => {
108106
if (!name) {
109107
return false;
@@ -185,9 +183,7 @@ const headersEntries = (headers: Headers): Array<[string, string]> => {
185183
return entries;
186184
};
187185

188-
export const mergeHeaders = (
189-
...headers: Array<Required<Config>['headers'] | undefined>
190-
): Headers => {
186+
export const mergeHeaders = (...headers: Array<Required<Config>['headers'] | undefined>): Headers => {
191187
const mergedHeaders = new Headers();
192188
for (const header of headers) {
193189
if (!header) {
@@ -206,10 +202,7 @@ export const mergeHeaders = (
206202
} else if (value !== undefined) {
207203
// assume object headers are meant to be JSON stringified, i.e. their
208204
// content value in OpenAPI specification is 'application/json'
209-
mergedHeaders.set(
210-
key,
211-
typeof value === 'object' ? JSON.stringify(value) : (value as string),
212-
);
205+
mergedHeaders.set(key, typeof value === 'object' ? JSON.stringify(value) : (value as string));
213206
}
214207
}
215208
}
@@ -220,15 +213,15 @@ type ErrInterceptor<Err, Res, Req, Options> = (
220213
error: Err,
221214
response: Res,
222215
request: Req,
223-
options: Options,
216+
options: Options
224217
) => Err | Promise<Err>;
225218

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

228221
type ResInterceptor<Res, Req, Options> = (
229222
response: Res,
230223
request: Req,
231-
options: Options,
224+
options: Options
232225
) => Res | Promise<Res>;
233226

234227
class Interceptors<Interceptor> {
@@ -278,12 +271,7 @@ export interface Middleware<Req, Res, Err, Options> {
278271
response: Interceptors<ResInterceptor<Res, Req, Options>>;
279272
}
280273

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

308296
export const createConfig = <T extends ClientOptions = ClientOptions>(
309-
override: Config<Omit<ClientOptions, keyof T> & T> = {},
297+
override: Config<Omit<ClientOptions, keyof T> & T> = {}
310298
): Config<Omit<ClientOptions, keyof T> & T> => ({
311299
...jsonBodySerializer,
312300
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: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ const serializeUrlSearchParamsPair = (data: URLSearchParams, key: string, value:
3939
};
4040

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

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

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

Lines changed: 6 additions & 10 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 = (
78-
allowReserved ? value : value.map((v) => encodeURIComponent(v as string))
79-
).join(separatorArrayNoExplode(style));
77+
const joinedValues = (allowReserved ? value : value.map((v) => encodeURIComponent(v as string))).join(
78+
separatorArrayNoExplode(style)
79+
);
8080
switch (style) {
8181
case 'label':
8282
return `.${joinedValues}`;
@@ -106,18 +106,14 @@ export const serializeArrayParam = ({
106106
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;
107107
};
108108

109-
export const serializePrimitiveParam = ({
110-
allowReserved,
111-
name,
112-
value,
113-
}: SerializePrimitiveParam) => {
109+
export const serializePrimitiveParam = ({ allowReserved, name, value }: SerializePrimitiveParam) => {
114110
if (value === undefined || value === null) {
115111
return '';
116112
}
117113

118114
if (typeof value === 'object') {
119115
throw new Error(
120-
'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.',
116+
'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.'
121117
);
122118
}
123119

@@ -164,7 +160,7 @@ export const serializeObjectParam = ({
164160
allowReserved,
165161
name: style === 'deepObject' ? `${name}[${key}]` : key,
166162
value: v as string,
167-
}),
163+
})
168164
)
169165
.join(separator);
170166
return style === 'label' || style === 'matrix' ? separator + joinedValues : joinedValues;

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)