export type CreateApiConfigTenantLocatorDeploymentsValidateArgs = {tenantLocator: string, body: BodyInit}; export type CreateApiConfigTenantLocatorDeploymentsValidateOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /config/{tenantLocator}/deployments/validate */ export const createApiConfigTenantLocatorDeploymentsValidate = async (args: CreateApiConfigTenantLocatorDeploymentsValidateArgs, options: CreateApiConfigTenantLocatorDeploymentsValidateOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/zip") headers.set('accept', "application/zip") const url = `${baseUrl.replace(/\/+$/, '')}/config/${encodeURIComponent(String(args.tenantLocator))}/deployments/validate${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() };