/** * Error thrown by unauthenticated sign-up requests. Carries the HTTP status * and, when the backend provides one, a machine-readable `code` * (e.g. 'emailExists' | 'domainClaimed' | 'domainBlocked'). */ export declare class CueRequestError extends Error { readonly status: number; readonly code?: string | undefined; constructor(message: string, status: number, code?: string | undefined); } export type OrgSignUpPlan = { type: 'freemium'; } | { type: 'custom'; monthlySpendChf: number; paymentMethod?: 'card' | 'invoice'; }; export interface OrgSignUpPayload { /** Display name of the new admin user. */ name: string; /** The organization domain is extracted from this address server-side. */ email: string; orgName: string; /** When provided, the account is created with this password and no * password-reset email is sent — the admin can sign in immediately. */ password?: string; /** Version of the terms accepted client-side — recorded immediately so the * admin isn't asked again on their next sign-in. */ termsVersion?: string; plan: OrgSignUpPlan; } /** * Unauthenticated account-creation calls — create a Firebase user (and, * for `signUpWithOrganization`, a new organisation) before any session * exists. Kept separate from `CueAuth`, which manages an *existing* session * (sign in/out, tokens, superadmin checks). */ export declare class CueSignUp { private readonly _gatewayUrl; constructor(_gatewayUrl: string); /** * Register a new user by name and email. * The backend validates that the email domain belongs to an existing organisation, * creates the Firebase Auth account, assigns org membership, and — when no * `password` is given — dispatches a "set your password" email to the * address provided. `termsVersion`, when given, is recorded as accepted * immediately so the user isn't asked again on their next sign-in. * Returns the new user's UID and the organisation name on success. */ signUp(name: string, email: string, password?: string, termsVersion?: string): Promise<{ uid: string; orgName: string; }>; /** * Self-service sign-up that creates a new organisation together with its * first (admin) user — for users whose email domain matches no existing * organisation. The backend records the selected plan, seeds the freemium * credit grant, and dispatches verification + "set your password" emails. * Throws `CueRequestError` with `code` 'emailExists' | 'domainClaimed' | * 'domainBlocked' for the mappable failure modes. */ signUpWithOrganization(payload: OrgSignUpPayload): Promise<{ uid: string; orgId: string; orgName: string; checkoutUrl?: string; }>; /** Re-send the verification + set-password emails after a sign-up. */ resendSignUpEmails(email: string): Promise<{ sent: boolean; }>; private _publicPost; }