refactor: switch from go to bun

This commit is contained in:
Nicolas Meienberger
2025-08-31 17:32:00 +02:00
parent a0be690eb9
commit a16fc37b44
76 changed files with 4283 additions and 4173 deletions

View File

@@ -0,0 +1,71 @@
// This file is auto-generated by @hey-api/openapi-ts
import { type Options, getApiV1Volumes } from "../sdk.gen";
import { queryOptions } from "@tanstack/react-query";
import type { GetApiV1VolumesData } from "../types.gen";
import { client as _heyApiClient } from "../client.gen";
export type QueryKey<TOptions extends Options> = [
Pick<TOptions, "baseUrl" | "body" | "headers" | "path" | "query"> & {
_id: string;
_infinite?: boolean;
tags?: ReadonlyArray<string>;
},
];
const createQueryKey = <TOptions extends Options>(
id: string,
options?: TOptions,
infinite?: boolean,
tags?: ReadonlyArray<string>,
): [QueryKey<TOptions>[0]] => {
const params: QueryKey<TOptions>[0] = {
_id: id,
baseUrl:
options?.baseUrl ||
(options?.client ?? _heyApiClient).getConfig().baseUrl,
} as QueryKey<TOptions>[0];
if (infinite) {
params._infinite = infinite;
}
if (tags) {
params.tags = tags;
}
if (options?.body) {
params.body = options.body;
}
if (options?.headers) {
params.headers = options.headers;
}
if (options?.path) {
params.path = options.path;
}
if (options?.query) {
params.query = options.query;
}
return [params];
};
export const getApiV1VolumesQueryKey = (
options?: Options<GetApiV1VolumesData>,
) => createQueryKey("getApiV1Volumes", options);
/**
* List all volumes
*/
export const getApiV1VolumesOptions = (
options?: Options<GetApiV1VolumesData>,
) => {
return queryOptions({
queryFn: async ({ queryKey, signal }) => {
const { data } = await getApiV1Volumes({
...options,
...queryKey[0],
signal,
throwOnError: true,
});
return data;
},
queryKey: getApiV1VolumesQueryKey(options),
});
};