export type CreateApiPipelineAccountLocalDeployConfigArgs = {body: {edge_id?: string | undefined, replica?: string | undefined, namespace?: string | undefined, name?: string | undefined, deployment_group?: string | undefined, ports?: Array | undefined, version?: string | undefined, chart_version?: string | undefined, vector_version?: string | undefined, uptime_sec?: number | undefined}}; export type CreateApiPipelineAccountLocalDeployConfigOptions = {baseUrl?: string | undefined, PipelineServiceKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Post client config * * POST /pipeline/account/local-deploy/config */ export const createApiPipelineAccountLocalDeployConfig = async (args: CreateApiPipelineAccountLocalDeployConfigArgs, options?: CreateApiPipelineAccountLocalDeployConfigOptions) => { const {baseUrl = "https://api.mezmo.com/v3", fetch: fetchFn = fetch, PipelineServiceKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (PipelineServiceKey !== undefined) headers.set("Authorization", PipelineServiceKey) const url = `${baseUrl.replace(/\/+$/, '')}/pipeline/account/local-deploy/config${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };