export type DeleteApiV1DomainsDomainIdComplianceProvidersProviderArgs = {domainId: string, provider: 'ELLIPTIC' | 'CHAINALYSIS' | 'NOTABENE'}; export type DeleteApiV1DomainsDomainIdComplianceProvidersProviderOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes provider connection and screening rules for the given domain & provider * * DELETE /v1/domains/{domainId}/compliance/providers/{provider} */ export const deleteApiV1DomainsDomainIdComplianceProvidersProvider = async (args: DeleteApiV1DomainsDomainIdComplianceProvidersProviderArgs, options: DeleteApiV1DomainsDomainIdComplianceProvidersProviderOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/domains/${encodeURIComponent(String(args.domainId))}/compliance/providers/${encodeURIComponent(String(args.provider))}${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 };