export type DeleteApiV1ExtractionSchemasSchemaIdArgs = {schema_id: string}; export type DeleteApiV1ExtractionSchemasSchemaIdOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * delete_extraction_schema * * DELETE /v1/extraction-schemas/{schema_id} */ export const deleteApiV1ExtractionSchemasSchemaId = async (args: DeleteApiV1ExtractionSchemasSchemaIdArgs, options?: DeleteApiV1ExtractionSchemasSchemaIdOptions) => { const {baseUrl = "https://ndi-api.nace.ai", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (APIKeyHeader !== undefined) headers.set("X-API-Key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v1/extraction-schemas/${encodeURIComponent(String(args.schema_id))}${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 };