export type DeleteApiKybFormsCompanyIdDocumentsIdArgs = {companyId: string, id: string}; export type DeleteApiKybFormsCompanyIdDocumentsIdOptions = {baseUrl?: string | undefined, kybTokenAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete document * * DELETE /kyb/forms/{companyId}/documents/{id}/ * * Also accepts auth: apiKeyPair */ export const deleteApiKybFormsCompanyIdDocumentsId = async (args: DeleteApiKybFormsCompanyIdDocumentsIdArgs, options?: DeleteApiKybFormsCompanyIdDocumentsIdOptions) => { const {baseUrl = "https://ivs.idenfy.com", fetch: fetchFn = fetch, kybTokenAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (kybTokenAuth !== undefined) headers.set('authorization', `Bearer ${kybTokenAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/kyb/forms/${encodeURIComponent(String(args.companyId))}/documents/${encodeURIComponent(String(args.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 };