export type CreateApiConfigTenantLocatorDeploymentsDeployArgs = {tenantLocator: string, overwrite?: boolean | undefined, body: BodyInit}; export type CreateApiConfigTenantLocatorDeploymentsDeployOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /config/{tenantLocator}/deployments/deploy */ export const createApiConfigTenantLocatorDeploymentsDeploy = async (args: CreateApiConfigTenantLocatorDeploymentsDeployArgs, options: CreateApiConfigTenantLocatorDeploymentsDeployOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/zip") headers.set('accept', "*/*") if (args.overwrite != null) query.append("overwrite", String(args.overwrite)) const url = `${baseUrl.replace(/\/+$/, '')}/config/${encodeURIComponent(String(args.tenantLocator))}/deployments/deploy${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };