export type DeleteApiApiProjectsIdSecretsKeyArgs = {id: number, key: string}; export type DeleteApiApiProjectsIdSecretsKeyOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a secret from a project * * DELETE /api/projects/{id}/secrets/{key} */ export const deleteApiApiProjectsIdSecretsKey = async (args: DeleteApiApiProjectsIdSecretsKeyArgs, options?: DeleteApiApiProjectsIdSecretsKeyOptions) => { const {baseUrl = "https://api-workflow.treasuredata.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set('authorization', `TD1 ${ApiKeyAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/projects/${encodeURIComponent(String(args.id))}/secrets/${encodeURIComponent(String(args.key))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };