@pisell/pisellos 0.0.334 → 0.0.336

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.
@@ -153,7 +153,7 @@ export var CustomerModule = /*#__PURE__*/function (_BaseModule) {
153
153
  skip: skip,
154
154
  num: num,
155
155
  sort_by: SORT_BY,
156
- with: ['latestWalletDetail.wallet'],
156
+ with: ['latestWalletDetail.wallet', 'contactsInfo'],
157
157
  search_wallet_flag: 1,
158
158
  search_wallet_pass_flag: 1
159
159
  }, search && {
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -49,6 +49,7 @@ export interface RequestOptions {
49
49
  responseType?: 'json' | 'text' | 'arraybuffer' | 'blob';
50
50
  withCredentials?: boolean;
51
51
  useCache?: boolean;
52
+ customToast?: () => void;
52
53
  }
53
54
  /**
54
55
  * 响应接口
@@ -0,0 +1,86 @@
1
+ /**
2
+ * 注册登录解决方案配置
3
+ * 根据不同渠道配置不同的接口地址和参数
4
+ */
5
+ /**
6
+ * API 配置接口
7
+ */
8
+ export interface ApiConfig {
9
+ url: string;
10
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE';
11
+ transformParams?: (params: any) => any;
12
+ transformResponse?: (response: any) => any;
13
+ options?: Record<string, any>;
14
+ }
15
+ /**
16
+ * 渠道配置接口
17
+ */
18
+ export interface ChannelConfig {
19
+ sendEmailVerificationCode: ApiConfig;
20
+ sendSmsRegisterCode: ApiConfig;
21
+ sendEmailRegisterLink: ApiConfig;
22
+ verifyEmailRegistrationLink: ApiConfig;
23
+ emailPasswordLogin: ApiConfig;
24
+ emailCodeRegister: ApiConfig;
25
+ phoneCodeRegister: ApiConfig;
26
+ resendEmailRegisterLink: ApiConfig;
27
+ checkEmailLinkCode: ApiConfig;
28
+ sendSmsLoginCode: ApiConfig;
29
+ phoneCodeLogin: ApiConfig;
30
+ guestLogin: ApiConfig;
31
+ checkEmailExists: ApiConfig;
32
+ checkEmailCode: ApiConfig;
33
+ checkMobileCode: ApiConfig;
34
+ phonePasswordLogin: ApiConfig;
35
+ sendPasswordResetEmail: ApiConfig;
36
+ sendPasswordResetSms: ApiConfig;
37
+ sendResetPasswordLink: ApiConfig;
38
+ checkResetPasswordCode: ApiConfig;
39
+ resetPasswordByCode: ApiConfig;
40
+ resetPasswordByEmail: ApiConfig;
41
+ resetPasswordByPhone: ApiConfig;
42
+ verifyCode: ApiConfig;
43
+ register: ApiConfig;
44
+ login: ApiConfig;
45
+ oauthLogin: ApiConfig;
46
+ validateToken: ApiConfig;
47
+ logout: ApiConfig;
48
+ getCountries: ApiConfig;
49
+ facebookLogin: ApiConfig;
50
+ appleLogin: ApiConfig;
51
+ }
52
+ /**
53
+ * 渠道配置映射
54
+ */
55
+ export declare const channelConfigMap: Record<string, ChannelConfig>;
56
+ /**
57
+ * 获取渠道配置
58
+ */
59
+ export declare function getChannelConfig(channel: string): ChannelConfig;
60
+ /**
61
+ * API 调用器类
62
+ * 负责根据配置执行 API 调用
63
+ */
64
+ export declare class ApiCaller {
65
+ private request;
66
+ private config;
67
+ constructor(request: {
68
+ get: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
69
+ post: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
70
+ put: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
71
+ delete: <T = any>(url: string, options?: any) => Promise<T>;
72
+ }, config: ChannelConfig);
73
+ /**
74
+ * 执行 API 调用
75
+ */
76
+ call<T = any>(apiName: keyof ChannelConfig, params?: any, additionalOptions?: any): Promise<T>;
77
+ }
78
+ /**
79
+ * 创建 API 调用器
80
+ */
81
+ export declare function createApiCaller(request: {
82
+ get: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
83
+ post: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
84
+ put: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
85
+ delete: <T = any>(url: string, options?: any) => Promise<T>;
86
+ }, channel: string): ApiCaller;