chore: re-generate openapi client
This commit is contained in:
parent
25f60db703
commit
ca325a01c5
4 changed files with 16 additions and 20 deletions
|
|
@ -49,10 +49,7 @@ export const createClient = (config: Config = {}): Client => {
|
|||
};
|
||||
|
||||
if (opts.security) {
|
||||
await setAuthParams({
|
||||
...opts,
|
||||
security: opts.security,
|
||||
});
|
||||
await setAuthParams(opts);
|
||||
}
|
||||
|
||||
if (opts.requestValidator) {
|
||||
|
|
|
|||
|
|
@ -119,14 +119,12 @@ const checkForExistence = (
|
|||
return false;
|
||||
};
|
||||
|
||||
export const setAuthParams = async ({
|
||||
security,
|
||||
...options
|
||||
}: Pick<Required<RequestOptions>, 'security'> &
|
||||
Pick<RequestOptions, 'auth' | 'query'> & {
|
||||
export async function setAuthParams(
|
||||
options: Pick<RequestOptions, 'auth' | 'query' | 'security'> & {
|
||||
headers: Headers;
|
||||
}) => {
|
||||
for (const auth of security) {
|
||||
},
|
||||
): Promise<void> {
|
||||
for (const auth of options.security ?? []) {
|
||||
if (checkForExistence(options, auth.name)) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -155,7 +153,7 @@ export const setAuthParams = async ({
|
|||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export const buildUrl: Client['buildUrl'] = (options) =>
|
||||
getUrl({
|
||||
|
|
|
|||
|
|
@ -2267,6 +2267,7 @@ export type RestoreSnapshotData = {
|
|||
excludeXattr?: Array<string>;
|
||||
delete?: boolean;
|
||||
targetPath?: string;
|
||||
targetAgentId?: string;
|
||||
overwrite?: 'always' | 'if-changed' | 'if-newer' | 'never';
|
||||
};
|
||||
path: {
|
||||
|
|
@ -2278,13 +2279,11 @@ export type RestoreSnapshotData = {
|
|||
|
||||
export type RestoreSnapshotResponses = {
|
||||
/**
|
||||
* Snapshot restored successfully
|
||||
* Snapshot restore started
|
||||
*/
|
||||
200: {
|
||||
success: boolean;
|
||||
message: string;
|
||||
filesRestored: number;
|
||||
filesSkipped: number;
|
||||
202: {
|
||||
restoreId: string;
|
||||
status: 'started';
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import { execFileSync } from "node:child_process";
|
||||
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({
|
||||
input: `http://${config.serverIp}:3000/api/v1/openapi.json`,
|
||||
input: openApiInput,
|
||||
output: {
|
||||
path: "./app/client/api-client",
|
||||
header: ["// @ts-nocheck", "// This file is auto-generated by @hey-api/openapi-ts"],
|
||||
|
|
|
|||
Loading…
Reference in a new issue