chore: re-generate openapi client

This commit is contained in:
Nicolas Meienberger 2026-06-02 21:04:04 +02:00
parent 25f60db703
commit ca325a01c5
No known key found for this signature in database
4 changed files with 16 additions and 20 deletions

View file

@ -49,10 +49,7 @@ export const createClient = (config: Config = {}): Client => {
}; };
if (opts.security) { if (opts.security) {
await setAuthParams({ await setAuthParams(opts);
...opts,
security: opts.security,
});
} }
if (opts.requestValidator) { if (opts.requestValidator) {

View file

@ -119,14 +119,12 @@ const checkForExistence = (
return false; return false;
}; };
export const setAuthParams = async ({ export async function setAuthParams(
security, options: Pick<RequestOptions, 'auth' | 'query' | 'security'> & {
...options
}: Pick<Required<RequestOptions>, 'security'> &
Pick<RequestOptions, 'auth' | 'query'> & {
headers: Headers; headers: Headers;
}) => { },
for (const auth of security) { ): Promise<void> {
for (const auth of options.security ?? []) {
if (checkForExistence(options, auth.name)) { if (checkForExistence(options, auth.name)) {
continue; continue;
} }
@ -155,7 +153,7 @@ export const setAuthParams = async ({
break; break;
} }
} }
}; }
export const buildUrl: Client['buildUrl'] = (options) => export const buildUrl: Client['buildUrl'] = (options) =>
getUrl({ getUrl({

View file

@ -2267,6 +2267,7 @@ export type RestoreSnapshotData = {
excludeXattr?: Array<string>; excludeXattr?: Array<string>;
delete?: boolean; delete?: boolean;
targetPath?: string; targetPath?: string;
targetAgentId?: string;
overwrite?: 'always' | 'if-changed' | 'if-newer' | 'never'; overwrite?: 'always' | 'if-changed' | 'if-newer' | 'never';
}; };
path: { path: {
@ -2278,13 +2279,11 @@ export type RestoreSnapshotData = {
export type RestoreSnapshotResponses = { export type RestoreSnapshotResponses = {
/** /**
* Snapshot restored successfully * Snapshot restore started
*/ */
200: { 202: {
success: boolean; restoreId: string;
message: string; status: 'started';
filesRestored: number;
filesSkipped: number;
}; };
}; };

View file

@ -1,8 +1,10 @@
import { execFileSync } from "node:child_process";
import { defaultPlugins, defineConfig } from "@hey-api/openapi-ts"; import { defaultPlugins, defineConfig } from "@hey-api/openapi-ts";
import { config } from "./app/server/core/config.js";
const openApiInput = `${execFileSync("portless", ["get", "zerobyte"], { encoding: "utf8" }).trim().replace(/\/$/, "")}/api/v1/openapi.json`;
export default defineConfig({ export default defineConfig({
input: `http://${config.serverIp}:3000/api/v1/openapi.json`, input: openApiInput,
output: { output: {
path: "./app/client/api-client", path: "./app/client/api-client",
header: ["// @ts-nocheck", "// This file is auto-generated by @hey-api/openapi-ts"], header: ["// @ts-nocheck", "// This file is auto-generated by @hey-api/openapi-ts"],