UNPKG

@selldone/sdk-storefront

Version:

A TypeScript SDK to connect to your shop and build a fully functional storefront and website by simply developing a frontend web application. All backend operations are seamlessly managed by the serverless Selldone solution.

103 lines (102 loc) 3.44 kB
/** * Represents a user entity in the system. */ export declare class User { /** The unique identifier for the user. */ id: number; /** The user's full name. */ name: string; /** The user's email address. */ email?: string; /** The user's phone number. */ phone?: string; /** Timestamp when the user verified their email address. */ email_verified_at: Date; /** Social login flags for the user. */ socials_login?: User.SocialLogin; /** User preferences settings. */ preferences?: User.Preferences; /** User's interests grouped by categories. */ interest: User.Interest; /** Indicates if the user is subscribed. */ subscribed: boolean; /** Timestamp indicating when the user was blocked. */ block_at: Date; /** Duration (in hours) the user was last blocked. Used for calculating the next punishment period. */ block_hours: number; /** Ban level for the user. */ ban?: User.BanLevels; /** Key-value pairs for storing metadata (private). Used for keeping third-party customer IDs and other values. */ meta: { [key: string]: any; }; /** Timestamp when the user was soft deleted. */ deleted_at: Date; /** Timestamp when the user was created. */ created_at: Date; /** Timestamp when the user was last updated. */ updated_at: Date; constructor(data: any); } export declare namespace User { /** * Represents the social login flags for a user. */ type SocialLogin = { google?: boolean; linkedin?: boolean; github?: boolean; stripe?: boolean; }; /** * Represents user preferences settings. */ type Preferences = { level?: User.Preferences.AppLevelKey; rating?: number; lang?: string; dark?: boolean; template?: string; samples?: boolean; currency?: string; provider?: boolean; calendar?: string; }; namespace Preferences { /** * Interface representing the structure of an app level. * @interface * @property {string} title - The title of the app level, typically used for display purposes. * @property {number} level - The numeric representation of the app level, useful for comparisons and logic based on the level. * @property {string} code - The unique code identifier for the app level. */ interface IAppLevel { title: string; level: number; code: AppLevelKey; } /** * Represents the predefined keys for app levels. */ type AppLevelKey = "NEWBIE" | "BEGINNER" | "NOVICE" | "INTERMEDIATE" | "ADVANCED"; /** * Represents predefined app levels with their associated titles, levels, and codes. * This is part of the Selldone open-source library, enabling developers to build custom storefronts and back offices. */ const AppLevel: Record<AppLevelKey, IAppLevel>; } /** * Represents user's interests grouped by categories. */ type Interest = { business?: string[]; topic?: string[]; }; /** Possible ban levels for a user. */ enum BanLevels { TRANSACTION_BAN = "TRANSACTION_BAN", SHOP_ADMIN_BAN = "SHOP_ADMIN_BAN", SHOP_CUSTOMER_BAN = "SHOP_CUSTOMER_BAN", FULL_BAN = "FULL_BAN" } }