@gsb-core/core
Version:
GSB core services and classes for platform-independent web applications
66 lines (65 loc) • 1.73 kB
TypeScript
import { GsbCmRegistration } from '../../models/gsb-subscription.model';
export declare enum RegistrationType {
Free = 1,
Basic = 2,
Premium = 4,
Enterprise = 8,
Social = 16
}
export declare enum SocialProviders {
None = 0,
Google = 1,
Github = 2,
Facebook = 4
}
export interface IRegistrationData {
email: string;
password?: string;
name: string;
surname: string;
phoneNumber?: string;
subscriptionType: RegistrationType;
paymentInfo?: {
token?: string;
saveInfo?: boolean;
};
socialInfo?: {
provider: SocialProviders;
token: string;
};
}
/**
* Registration service for handling user registration
*/
export declare class RegistrationService {
private static instance;
private subscriptionService;
private constructor();
static getInstance(): RegistrationService;
/**
* Register a new user
*/
registerUser(data: IRegistrationData): Promise<GsbCmRegistration>;
/**
* Verify user email with validation code
*/
verifyUserEmail(email: string, validationCode: string): Promise<boolean>;
/**
* Complete user registration and set up subscription if needed
*/
completeRegistration(registrationId: string, verificationKey: string, subscriptionData?: any): Promise<{
success: boolean;
userId?: string;
tenantId?: string;
subscriptionPlanId?: string;
}>;
/**
* Process a social login based registration
*/
processSocialRegistration(provider: SocialProviders, token: string): Promise<{
success: boolean;
isNewUser: boolean;
userId?: string;
registrationId?: string;
}>;
}