export type IResendInvite = {email: string, tempPassword?: string | undefined}; export type UpdateApiUsersResendInviteArgs = {body: IResendInvite}; export type UpdateApiUsersResendInviteOptions = {baseUrl?: string | undefined, cognitoJwtAuthorizer?: string | undefined, fetch?: typeof fetch | undefined}; /** * resendInvite * * PUT /users/resend-invite */ export const updateApiUsersResendInvite = async (args: UpdateApiUsersResendInviteArgs, options?: UpdateApiUsersResendInviteOptions) => { const {baseUrl = "https://api-hub.extensiv.com", fetch: fetchFn = fetch, cognitoJwtAuthorizer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (cognitoJwtAuthorizer !== undefined) headers.set('authorization', `Bearer ${cognitoJwtAuthorizer}`) const url = `${baseUrl.replace(/\/+$/, '')}/users/resend-invite${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 };