export type DID = unknown; export type UpdateApiEntitiesEntityDIDFlowCustomersCustomerDIDArgs = {entityDID: DID, customerDID: string, body: {customerType?: ('natural_person' | 'legal_person') | undefined, profileData?: Record | undefined, verificationStatus?: ('pending' | 'verified' | 'rejected' | 'expired') | undefined, verificationLevel?: ('basic' | 'enhanced' | 'premium') | undefined, verifiedAt?: string | undefined, verificationExpiresAt?: string | undefined}}; export type UpdateApiEntitiesEntityDIDFlowCustomersCustomerDIDOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a customer profile within Flow workflows * * PUT /entities/{entityDID}/flow/customers/{customerDID} */ export const updateApiEntitiesEntityDIDFlowCustomersCustomerDID = async (args: UpdateApiEntitiesEntityDIDFlowCustomersCustomerDIDArgs, options?: UpdateApiEntitiesEntityDIDFlowCustomersCustomerDIDOptions) => { const {baseUrl = "https://api.eu1.notabene.id", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/entities/${encodeURIComponent(String(args.entityDID))}/flow/customers/${encodeURIComponent(String(args.customerDID))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };