export type CreateApiAccountsAidCustomersChangePasswordArgs = {aid: unknown, body: {email: string, audience: string, type: 'customer' | 'company'}}; export type CreateApiAccountsAidCustomersChangePasswordOptions = {baseUrl?: string | undefined, JWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * aid_customers_change_password * * POST /accounts/{aid}/customers/change_password */ export const createApiAccountsAidCustomersChangePassword = async (args: CreateApiAccountsAidCustomersChangePasswordArgs, options?: CreateApiAccountsAidCustomersChangePasswordOptions) => { const {baseUrl = "https://api.dintero.com/v1", fetch: fetchFn = fetch, JWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (JWT !== undefined) headers.set('authorization', `Bearer ${JWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/accounts/${encodeURIComponent(String(args.aid))}/customers/change_password${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };