export type MappingPropertiesIdentifier = string; export type DeleteApiV3MappingsIdentifierArgs = {identifier: MappingPropertiesIdentifier}; export type DeleteApiV3MappingsIdentifierOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete specific mapping * * DELETE /v3/mappings/{identifier} */ export const deleteApiV3MappingsIdentifier = async (args: DeleteApiV3MappingsIdentifierArgs, options?: DeleteApiV3MappingsIdentifierOptions) => { const {baseUrl = "https://api.affinda.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set('authorization', `Bearer ${ApiKeyAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v3/mappings/${encodeURIComponent(String(args.identifier))}${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 };