@pisell/pisellos 3.0.69 → 3.0.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,189 @@
1
+ import { Module, PisellCore } from '../../types';
2
+ import { BaseModule } from '../../modules/BaseModule';
3
+ import { RegisterParams, LoginParams, OAuthLoginParams, SendVerificationCodeParams, VerifyCodeParams, PasswordResetParams, UserInfo, ApiResponse, LoginResponse, RegisterResponse, OAuthLoginResponse, OAuthConfig, CountryInfo, SendSmsRegisterCodeParams, VerifyEmailRegistrationLinkParams, EmailPasswordLoginParams, SendSmsLoginCodeParams, PhoneCodeLoginParams, GuestLoginResponse, CheckEmailExistsParams, CheckEmailExistsResponse, CheckEmailCodeParams, CheckMobileCodeParams, CheckCodeValidResponse, PhonePasswordLoginParams, SendPasswordResetEmailParams, SendPasswordResetSmsParams, SendResetPasswordLinkParams, CheckResetPasswordCodeParams, ResetPasswordByCodeParams, EmailCodeRegisterParams, PhoneCodeRegisterParams, CheckEmailLinkCodeParams, CheckEmailLinkCodeResponse } from './types';
4
+ import { ApiCaller } from './config';
5
+ export * from './types';
6
+ export * from './config';
7
+ /**
8
+ * 注册登录解决方案实现
9
+ */
10
+ export declare class RegisterAndLoginImpl extends BaseModule implements Module {
11
+ protected defaultName: string;
12
+ protected defaultVersion: string;
13
+ isSolution: boolean;
14
+ private request;
15
+ private window;
16
+ private store;
17
+ private apiCaller;
18
+ private otherParams;
19
+ private channel;
20
+ private countriesCache;
21
+ constructor(name?: string, version?: string);
22
+ /**
23
+ * 重新发送邮箱注册链接
24
+ */
25
+ resendEmailRegisterLink(): Promise<ApiResponse>;
26
+ /**
27
+ * 邮箱验证码注册
28
+ * @param params 注册参数
29
+ * @returns 注册结果
30
+ */
31
+ emailCodeRegister(params: EmailCodeRegisterParams): Promise<ApiResponse<RegisterResponse>>;
32
+ /**
33
+ * 手机验证码注册
34
+ */
35
+ phoneCodeRegister(params: PhoneCodeRegisterParams): Promise<ApiResponse<RegisterResponse>>;
36
+ initialize(core: PisellCore, options: any): Promise<void>;
37
+ /**
38
+ * 从本地存储恢复登录状态
39
+ */
40
+ private restoreLoginState;
41
+ /**
42
+ * 验证 token 有效性
43
+ */
44
+ private validateToken;
45
+ /**
46
+ * 清除登录状态
47
+ */
48
+ private clearLoginState;
49
+ /**
50
+ * 发送邮箱验证码
51
+ */
52
+ sendEmailVerificationCode(params: SendVerificationCodeParams): Promise<ApiResponse>;
53
+ /**
54
+ * 发送邮箱登录验证码
55
+ */
56
+ sendEmailLoginCode(params: SendVerificationCodeParams): Promise<ApiResponse>;
57
+ /**
58
+ * 发送手机号注册验证码
59
+ */
60
+ sendSmsRegisterCode(params: SendSmsRegisterCodeParams): Promise<ApiResponse>;
61
+ /**
62
+ * 发送邮箱注册邀请链接
63
+ */
64
+ sendEmailRegisterLink(email: string): Promise<ApiResponse>;
65
+ /**
66
+ * 验证邮箱注册链接
67
+ */
68
+ verifyEmailRegistrationLink(params: VerifyEmailRegistrationLinkParams): Promise<ApiResponse>;
69
+ /**
70
+ * 邮箱密码登录
71
+ */
72
+ emailPasswordLogin(params: EmailPasswordLoginParams): Promise<ApiResponse<LoginResponse>>;
73
+ /**
74
+ * 验证验证码
75
+ */
76
+ verifyCode(params: VerifyCodeParams): Promise<ApiResponse>;
77
+ /**
78
+ * 用户注册
79
+ */
80
+ register(params: RegisterParams): Promise<ApiResponse<RegisterResponse>>;
81
+ /**
82
+ * 用户登录
83
+ */
84
+ login(params: LoginParams): Promise<ApiResponse<LoginResponse>>;
85
+ /**
86
+ * OAuth 登录
87
+ */
88
+ oauthLogin(params: OAuthLoginParams): Promise<ApiResponse<OAuthLoginResponse>>;
89
+ /**
90
+ * 用户登出
91
+ */
92
+ logout(): Promise<void>;
93
+ /** 发送重置密码邮箱链接 */
94
+ sendResetPasswordLink(params: SendResetPasswordLinkParams): Promise<ApiResponse>;
95
+ /** 检测重置密码链接code有效性 */
96
+ checkResetPasswordCode(params: CheckResetPasswordCodeParams): Promise<ApiResponse>;
97
+ /** 校验邮件链接 code 有效性 */
98
+ checkEmailLinkCode(params: CheckEmailLinkCodeParams): Promise<ApiResponse<CheckEmailLinkCodeResponse>>;
99
+ /** 通过code重置密码 */
100
+ resetPasswordByCode(params: ResetPasswordByCodeParams): Promise<ApiResponse>;
101
+ /**
102
+ * 重置密码
103
+ */
104
+ resetPassword(params: PasswordResetParams): Promise<ApiResponse>;
105
+ /** 发送手机登录验证码 */
106
+ sendSmsLoginCode(params: SendSmsLoginCodeParams): Promise<ApiResponse>;
107
+ /** 手机号+短信验证码登录 */
108
+ phoneCodeLogin(params: PhoneCodeLoginParams): Promise<ApiResponse<LoginResponse>>;
109
+ private formatLoginParams;
110
+ /** Guest 登录 */
111
+ guestLogin(): Promise<ApiResponse<GuestLoginResponse>>;
112
+ /** 检查邮箱是否已注册 */
113
+ checkEmailExists(params: CheckEmailExistsParams): Promise<ApiResponse<CheckEmailExistsResponse>>;
114
+ /** 检查邮箱验证码是否有效 */
115
+ checkEmailCode(params: CheckEmailCodeParams): Promise<ApiResponse<CheckCodeValidResponse>>;
116
+ /** 检查手机验证码是否有效 */
117
+ checkMobileCode(params: CheckMobileCodeParams): Promise<ApiResponse<CheckCodeValidResponse>>;
118
+ /** 手机号密码登录 */
119
+ phonePasswordLogin(params: PhonePasswordLoginParams): Promise<ApiResponse<LoginResponse>>;
120
+ /** 发送密码重置邮箱验证码 */
121
+ sendPasswordResetEmail(params: SendPasswordResetEmailParams): Promise<ApiResponse>;
122
+ /** 发送手机号验证码重置密码 */
123
+ sendPasswordResetSms(params: SendPasswordResetSmsParams): Promise<ApiResponse>;
124
+ /**
125
+ * 获取当前用户信息
126
+ */
127
+ getCurrentUser(): UserInfo | null;
128
+ /**
129
+ * 检查是否已登录
130
+ */
131
+ isLoggedIn(): boolean;
132
+ /**
133
+ * 获取加载状态
134
+ */
135
+ isLoading(): boolean;
136
+ /**
137
+ * 获取错误信息
138
+ */
139
+ getError(): string | null;
140
+ /**
141
+ * 清除错误信息
142
+ */
143
+ clearError(): void;
144
+ /**
145
+ * 检查验证码是否已发送且未过期
146
+ */
147
+ isVerificationCodeSent(target: string): boolean;
148
+ /**
149
+ * 获取验证码剩余时间(秒)
150
+ */
151
+ getVerificationCodeRemainingTime(target: string): number;
152
+ /**
153
+ * 初始化 Facebook SDK
154
+ */
155
+ initFacebookSDK(token: string): Promise<void>;
156
+ /**
157
+ * 初始化 Apple SDK
158
+ */
159
+ initAppleSDK(): Promise<void>;
160
+ /**
161
+ * Facebook 登录
162
+ */
163
+ loginWithFacebook(token: string): Promise<unknown>;
164
+ /**
165
+ * Apple 登录(需要在支持的环境中使用)
166
+ */
167
+ loginWithApple(token: string): Promise<unknown>;
168
+ /**
169
+ * 更新 OAuth 配置
170
+ */
171
+ updateOAuthConfig(config: Partial<OAuthConfig>): void;
172
+ /**
173
+ * 获取当前渠道
174
+ */
175
+ getCurrentChannel(): string;
176
+ /**
177
+ * 获取 API 调用器(用于高级用法)
178
+ */
179
+ getApiCaller(): ApiCaller;
180
+ /**
181
+ * 获取国家区号列表
182
+ */
183
+ getCountries(): Promise<CountryInfo[]>;
184
+ /**
185
+ * 异步更新国家缓存数据
186
+ */
187
+ private updateCountriesCache;
188
+ destroy(): Promise<void>;
189
+ }