export type SignUpUserDto = {provider: 'local' | 'saml' | 'google' | 'github' | 'facebook' | 'microsoft' | 'scim2' | 'slack' | 'apple', metadata?: string | undefined, email: string, name?: string | undefined, profilePictureUrl?: string | undefined, password?: string | undefined, phoneNumber?: string | undefined, skipInviteEmail?: boolean | undefined, roleIds?: Array | undefined, emailMetadata?: Record | undefined, companyName: string, recaptchaToken?: string | undefined, invitationToken?: string | undefined}; export type CreateApiResourcesUsersV1SignUpArgs = {'frontegg-vendor-host': string, 'frontegg-application-id': string, body: SignUpUserDto}; export type CreateApiResourcesUsersV1SignUpOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Signup user * * POST /resources/users/v1/signUp */ export const createApiResourcesUsersV1SignUp = async (args: CreateApiResourcesUsersV1SignUpArgs, options?: CreateApiResourcesUsersV1SignUpOptions) => { const {baseUrl = "http://localhost:8181", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['frontegg-vendor-host'] != null) headers.set("frontegg-vendor-host", String(args['frontegg-vendor-host'])) if (args['frontegg-application-id'] != null) headers.set("frontegg-application-id", String(args['frontegg-application-id'])) if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/resources/users/v1/signUp${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 };