@pisell/pisellos 0.10.75 → 0.10.76

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.
Files changed (189) hide show
  1. package/dist/modules/Product/index.d.ts +1 -1
  2. package/dist/server/index.js +14 -9
  3. package/dist/shared/receipt/small-ticket.d.ts +3 -0
  4. package/dist/shared/receipt/small-ticket.js +23 -2
  5. package/dist/solution/BookingByStep/index.d.ts +2 -2
  6. package/dist/solution/BookingTicket/index.d.ts +13 -1
  7. package/dist/solution/OrderInvoicePreview/index.js +13 -8
  8. package/lib/modules/Product/index.d.ts +1 -1
  9. package/lib/server/index.js +5 -0
  10. package/lib/shared/receipt/small-ticket.d.ts +3 -0
  11. package/lib/shared/receipt/small-ticket.js +21 -0
  12. package/lib/solution/BookingByStep/index.d.ts +2 -2
  13. package/lib/solution/BookingTicket/index.d.ts +13 -1
  14. package/lib/solution/OrderInvoicePreview/index.js +6 -1
  15. package/package.json +1 -1
  16. package/dist/apis/picoding.d.ts +0 -0
  17. package/dist/effects/index.d.ts +0 -19
  18. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  19. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -105
  20. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  21. package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  22. package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -173
  23. package/dist/model/strategy/adapter/promotion/adapter.d.ts +0 -70
  24. package/dist/model/strategy/adapter/promotion/examples.d.ts +0 -224
  25. package/dist/model/strategy/adapter/promotion/type.d.ts +0 -535
  26. package/dist/model/strategy/adapter/type.d.ts +0 -28
  27. package/dist/model/strategy/adapter/walletPass/index.d.ts +0 -32
  28. package/dist/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  29. package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -192
  30. package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  31. package/dist/model/strategy/engine.d.ts +0 -119
  32. package/dist/model/strategy/type.d.ts +0 -245
  33. package/dist/modules/Account/types.d.ts +0 -56
  34. package/dist/modules/BookingContext/types.d.ts +0 -104
  35. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  36. package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
  37. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  38. package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
  39. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  40. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  41. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  42. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  43. package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  44. package/dist/modules/Customer/constants.d.ts +0 -7
  45. package/dist/modules/Date/types.d.ts +0 -84
  46. package/dist/modules/Date/utils.d.ts +0 -36
  47. package/dist/modules/FulfillmentTiming/index.d.ts +0 -11
  48. package/dist/modules/FulfillmentTiming/types.d.ts +0 -67
  49. package/dist/modules/Order/payment-utils.d.ts +0 -26
  50. package/dist/modules/Order/pickupTiming.d.ts +0 -46
  51. package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  52. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +0 -68
  53. package/dist/modules/Order/utils/weighedProduct.d.ts +0 -12
  54. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -21
  55. package/dist/modules/Payment/mx51.d.ts +0 -0
  56. package/dist/modules/Payment/types.d.ts +0 -943
  57. package/dist/modules/Payment/utils.d.ts +0 -19
  58. package/dist/modules/Quotation/types.d.ts +0 -61
  59. package/dist/modules/Resource/types.d.ts +0 -50
  60. package/dist/modules/Resource/utils.d.ts +0 -23
  61. package/dist/modules/ResourcePlanner/localClock.d.ts +0 -33
  62. package/dist/modules/SalesSummary/types.d.ts +0 -69
  63. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
  64. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
  65. package/dist/modules/ScanOrderLogger/types.d.ts +0 -53
  66. package/dist/modules/Schedule/getDateIsInSchedule.d.ts +0 -32
  67. package/dist/modules/Schedule/type.d.ts +0 -157
  68. package/dist/modules/Schedule/types.d.ts +0 -201
  69. package/dist/modules/Schedule/utils.d.ts +0 -67
  70. package/dist/modules/Step/tyeps.d.ts +0 -20
  71. package/dist/modules/SurchargeList/types.d.ts +0 -15
  72. package/dist/plugins/app.d.ts +0 -10
  73. package/dist/plugins/shopStore.d.ts +0 -4
  74. package/dist/plugins/user.d.ts +0 -7
  75. package/dist/server/modules/floor-plan/types.d.ts +0 -43
  76. package/dist/server/modules/menu/types.d.ts +0 -68
  77. package/dist/server/modules/payment/types.d.ts +0 -9
  78. package/dist/server/modules/quotation/types.d.ts +0 -50
  79. package/dist/server/modules/resource/types.d.ts +0 -121
  80. package/dist/server/modules/schedule/types.d.ts +0 -1
  81. package/dist/server/modules/schedule/utils.d.ts +0 -32
  82. package/dist/server/types.d.ts +0 -66
  83. package/dist/server/utils/index.d.ts +0 -5
  84. package/dist/server/utils/schedule.d.ts +0 -14
  85. package/dist/server/utils/time.d.ts +0 -18
  86. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +0 -77
  87. package/dist/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  88. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  89. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -38
  90. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  91. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  92. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
  93. package/dist/solution/PlaceOrder/index.d.ts +0 -0
  94. package/dist/solution/RegisterAndLogin/config.d.ts +0 -93
  95. package/dist/solution/RegisterAndLogin/types.d.ts +0 -445
  96. package/dist/solution/RegisterAndLogin/utils.d.ts +0 -103
  97. package/dist/store/createStore.d.ts +0 -3
  98. package/dist/types/index.d.ts +0 -132
  99. package/dist/utils/os-private-payload.d.ts +0 -5
  100. package/dist/utils/payment-number.d.ts +0 -9
  101. package/dist/utils/task.d.ts +0 -40
  102. package/dist/utils/watch.d.ts +0 -102
  103. package/lib/apis/picoding.d.ts +0 -0
  104. package/lib/effects/index.d.ts +0 -19
  105. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  106. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -105
  107. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  108. package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  109. package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -173
  110. package/lib/model/strategy/adapter/promotion/adapter.d.ts +0 -70
  111. package/lib/model/strategy/adapter/promotion/examples.d.ts +0 -224
  112. package/lib/model/strategy/adapter/promotion/type.d.ts +0 -535
  113. package/lib/model/strategy/adapter/type.d.ts +0 -28
  114. package/lib/model/strategy/adapter/walletPass/index.d.ts +0 -32
  115. package/lib/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  116. package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -192
  117. package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  118. package/lib/model/strategy/engine.d.ts +0 -119
  119. package/lib/model/strategy/type.d.ts +0 -245
  120. package/lib/modules/Account/types.d.ts +0 -56
  121. package/lib/modules/BookingContext/types.d.ts +0 -104
  122. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  123. package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
  124. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  125. package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
  126. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  127. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  128. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  129. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  130. package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  131. package/lib/modules/Customer/constants.d.ts +0 -7
  132. package/lib/modules/Date/types.d.ts +0 -84
  133. package/lib/modules/Date/utils.d.ts +0 -36
  134. package/lib/modules/FulfillmentTiming/index.d.ts +0 -11
  135. package/lib/modules/FulfillmentTiming/types.d.ts +0 -67
  136. package/lib/modules/Order/payment-utils.d.ts +0 -26
  137. package/lib/modules/Order/pickupTiming.d.ts +0 -46
  138. package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  139. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +0 -68
  140. package/lib/modules/Order/utils/weighedProduct.d.ts +0 -12
  141. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -21
  142. package/lib/modules/Payment/mx51.d.ts +0 -0
  143. package/lib/modules/Payment/types.d.ts +0 -943
  144. package/lib/modules/Payment/utils.d.ts +0 -19
  145. package/lib/modules/Quotation/types.d.ts +0 -61
  146. package/lib/modules/Resource/types.d.ts +0 -50
  147. package/lib/modules/Resource/utils.d.ts +0 -23
  148. package/lib/modules/ResourcePlanner/localClock.d.ts +0 -33
  149. package/lib/modules/SalesSummary/types.d.ts +0 -69
  150. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
  151. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
  152. package/lib/modules/ScanOrderLogger/types.d.ts +0 -53
  153. package/lib/modules/Schedule/getDateIsInSchedule.d.ts +0 -32
  154. package/lib/modules/Schedule/type.d.ts +0 -157
  155. package/lib/modules/Schedule/types.d.ts +0 -201
  156. package/lib/modules/Schedule/utils.d.ts +0 -67
  157. package/lib/modules/Step/tyeps.d.ts +0 -20
  158. package/lib/modules/SurchargeList/types.d.ts +0 -15
  159. package/lib/plugins/app.d.ts +0 -10
  160. package/lib/plugins/shopStore.d.ts +0 -4
  161. package/lib/plugins/user.d.ts +0 -7
  162. package/lib/server/modules/floor-plan/types.d.ts +0 -43
  163. package/lib/server/modules/menu/types.d.ts +0 -68
  164. package/lib/server/modules/payment/types.d.ts +0 -9
  165. package/lib/server/modules/quotation/types.d.ts +0 -50
  166. package/lib/server/modules/resource/types.d.ts +0 -121
  167. package/lib/server/modules/schedule/types.d.ts +0 -1
  168. package/lib/server/modules/schedule/utils.d.ts +0 -32
  169. package/lib/server/types.d.ts +0 -66
  170. package/lib/server/utils/index.d.ts +0 -5
  171. package/lib/server/utils/schedule.d.ts +0 -14
  172. package/lib/server/utils/time.d.ts +0 -18
  173. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +0 -77
  174. package/lib/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  175. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  176. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -38
  177. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  178. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  179. package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
  180. package/lib/solution/PlaceOrder/index.d.ts +0 -0
  181. package/lib/solution/RegisterAndLogin/config.d.ts +0 -93
  182. package/lib/solution/RegisterAndLogin/types.d.ts +0 -445
  183. package/lib/solution/RegisterAndLogin/utils.d.ts +0 -103
  184. package/lib/store/createStore.d.ts +0 -3
  185. package/lib/types/index.d.ts +0 -132
  186. package/lib/utils/os-private-payload.d.ts +0 -5
  187. package/lib/utils/payment-number.d.ts +0 -9
  188. package/lib/utils/task.d.ts +0 -40
  189. package/lib/utils/watch.d.ts +0 -102
@@ -1,93 +0,0 @@
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> | ((params: any) => Record<string, any>);
14
- }
15
- export interface ApiCallerOptions {
16
- baseUrl?: string;
17
- shopDomain?: string;
18
- }
19
- /**
20
- * 渠道配置接口
21
- */
22
- export interface ChannelConfig {
23
- sendEmailVerificationCode: ApiConfig;
24
- sendEmailLoginCode: ApiConfig;
25
- sendSmsRegisterCode: ApiConfig;
26
- sendEmailRegisterLink: ApiConfig;
27
- verifyEmailRegistrationLink: ApiConfig;
28
- emailPasswordLogin: ApiConfig;
29
- emailCodeRegister: ApiConfig;
30
- phoneCodeRegister: ApiConfig;
31
- resendEmailRegisterLink: ApiConfig;
32
- checkEmailLinkCode: ApiConfig;
33
- sendSmsLoginCode: ApiConfig;
34
- phoneCodeLogin: ApiConfig;
35
- guestLogin: ApiConfig;
36
- checkEmailExists: ApiConfig;
37
- checkEmailCode: ApiConfig;
38
- checkMobileCode: ApiConfig;
39
- phonePasswordLogin: ApiConfig;
40
- sendPasswordResetEmail: ApiConfig;
41
- sendPasswordResetSms: ApiConfig;
42
- sendResetPasswordLink: ApiConfig;
43
- checkResetPasswordCode: ApiConfig;
44
- resetPasswordByCode: ApiConfig;
45
- resetPasswordByEmail: ApiConfig;
46
- resetPasswordByPhone: ApiConfig;
47
- verifyCode: ApiConfig;
48
- register: ApiConfig;
49
- login: ApiConfig;
50
- oauthLogin: ApiConfig;
51
- validateToken: ApiConfig;
52
- logout: ApiConfig;
53
- getCountries: ApiConfig;
54
- facebookLogin: ApiConfig;
55
- appleLogin: ApiConfig;
56
- }
57
- /**
58
- * 渠道配置映射
59
- */
60
- export declare const channelConfigMap: Record<string, ChannelConfig>;
61
- /**
62
- * 获取渠道配置
63
- */
64
- export declare function getChannelConfig(channel: string): ChannelConfig;
65
- /**
66
- * API 调用器类
67
- * 负责根据配置执行 API 调用
68
- */
69
- export declare class ApiCaller {
70
- private request;
71
- private config;
72
- private options;
73
- constructor(request: {
74
- get: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
75
- post: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
76
- put: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
77
- delete: <T = any>(url: string, options?: any) => Promise<T>;
78
- }, config: ChannelConfig, options?: ApiCallerOptions);
79
- private resolveUrl;
80
- /**
81
- * 执行 API 调用
82
- */
83
- call<T = any>(apiName: keyof ChannelConfig, params?: any, additionalOptions?: any): Promise<T>;
84
- }
85
- /**
86
- * 创建 API 调用器
87
- */
88
- export declare function createApiCaller(request: {
89
- get: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
90
- post: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
91
- put: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
92
- delete: <T = any>(url: string, options?: any) => Promise<T>;
93
- }, channel: string, options?: ApiCallerOptions): ApiCaller;
@@ -1,445 +0,0 @@
1
- /**
2
- * 注册登录解决方案类型定义
3
- */
4
- /**
5
- * 注册登录流程 hooks
6
- */
7
- export declare enum RegisterAndLoginHooks {
8
- onInited = "registerAndLogin:onInited",
9
- onDestroy = "registerAndLogin:onDestroy",
10
- onEmailVerificationSent = "registerAndLogin:onEmailVerificationSent",
11
- onEmailVerificationVerified = "registerAndLogin:onEmailVerificationVerified",
12
- onEmailVerificationFailed = "registerAndLogin:onEmailVerificationFailed",
13
- onSmsVerificationSent = "registerAndLogin:onSmsVerificationSent",
14
- onSmsVerificationVerified = "registerAndLogin:onSmsVerificationVerified",
15
- onSmsVerificationFailed = "registerAndLogin:onSmsVerificationFailed",
16
- onOAuthLoginStarted = "registerAndLogin:onOAuthLoginStarted",
17
- onOAuthLoginSuccess = "registerAndLogin:onOAuthLoginSuccess",
18
- onOAuthLoginFailed = "registerAndLogin:onOAuthLoginFailed",
19
- onRegisterStarted = "registerAndLogin:onRegisterStarted",
20
- onRegisterSuccess = "registerAndLogin:onRegisterSuccess",
21
- onRegisterFailed = "registerAndLogin:onRegisterFailed",
22
- onLoginStarted = "registerAndLogin:onLoginStarted",
23
- onLoginSuccess = "registerAndLogin:onLoginSuccess",
24
- onLoginFailed = "registerAndLogin:onLoginFailed",
25
- onPasswordResetStarted = "registerAndLogin:onPasswordResetStarted",
26
- onPasswordResetSuccess = "registerAndLogin:onPasswordResetSuccess",
27
- onPasswordResetFailed = "registerAndLogin:onPasswordResetFailed"
28
- }
29
- /**
30
- * OAuth 提供商类型
31
- */
32
- export declare enum OAuthProvider {
33
- FACEBOOK = "facebook",
34
- APPLE = "apple",
35
- GOOGLE = "google",
36
- WECHAT = "wechat",
37
- GITHUB = "github"
38
- }
39
- /**
40
- * 验证码类型
41
- */
42
- export declare enum VerificationCodeType {
43
- EMAIL = "email",
44
- SMS = "sms"
45
- }
46
- /**
47
- * 验证码用途
48
- */
49
- export declare enum VerificationPurpose {
50
- REGISTER = "register",
51
- LOGIN = "login",
52
- PASSWORD_RESET = "password_reset",
53
- CHANGE_EMAIL = "change_email",
54
- CHANGE_PHONE = "change_phone"
55
- }
56
- /**
57
- * 用户信息接口
58
- */
59
- export interface UserInfo {
60
- id: string;
61
- email?: string;
62
- phone?: string;
63
- name?: string;
64
- avatar?: string;
65
- isEmailVerified: boolean;
66
- isPhoneVerified: boolean;
67
- createdAt: string;
68
- updatedAt: string;
69
- [key: string]: any;
70
- }
71
- /**
72
- * 注册参数接口
73
- */
74
- export interface RegisterParams {
75
- email?: string;
76
- phone?: string;
77
- password: string;
78
- name?: string;
79
- verificationCode?: string;
80
- verificationCodeType?: VerificationCodeType;
81
- [key: string]: any;
82
- }
83
- /**
84
- * 登录参数接口
85
- */
86
- export interface LoginParams {
87
- email?: string;
88
- phone?: string;
89
- password?: string;
90
- verificationCode?: string;
91
- verificationCodeType?: VerificationCodeType;
92
- rememberMe?: boolean;
93
- [key: string]: any;
94
- }
95
- /**
96
- * OAuth 登录参数接口
97
- */
98
- export interface OAuthLoginParams {
99
- provider: OAuthProvider;
100
- code?: string;
101
- accessToken?: string;
102
- redirectUri?: string;
103
- [key: string]: any;
104
- }
105
- /**
106
- * 发送验证码参数接口
107
- */
108
- export interface SendVerificationCodeParams {
109
- type: VerificationCodeType;
110
- target: string;
111
- purpose: VerificationPurpose;
112
- [key: string]: any;
113
- }
114
- /**
115
- * 验证验证码参数接口
116
- */
117
- export interface VerifyCodeParams {
118
- type: VerificationCodeType;
119
- target: string;
120
- code: string;
121
- purpose: VerificationPurpose;
122
- [key: string]: any;
123
- }
124
- /**
125
- * 密码重置参数接口
126
- */
127
- export interface PasswordResetParams {
128
- type: 'email' | 'phone';
129
- target: {
130
- email?: string;
131
- phone?: string;
132
- country_calling_code?: string;
133
- };
134
- password: string;
135
- code: string;
136
- }
137
- /**
138
- * OAuth 配置接口
139
- */
140
- export interface OAuthConfig {
141
- [OAuthProvider.FACEBOOK]?: {
142
- appId: string;
143
- appSecret?: string;
144
- redirectUri?: string;
145
- scope?: string[];
146
- };
147
- [OAuthProvider.APPLE]?: {
148
- clientId: string;
149
- teamId?: string;
150
- keyId?: string;
151
- privateKey?: string;
152
- redirectUri?: string;
153
- scope?: string[];
154
- };
155
- [OAuthProvider.GOOGLE]?: {
156
- clientId: string;
157
- clientSecret?: string;
158
- redirectUri?: string;
159
- scope?: string[];
160
- };
161
- [OAuthProvider.WECHAT]?: {
162
- appId: string;
163
- appSecret?: string;
164
- redirectUri?: string;
165
- scope?: string[];
166
- };
167
- [OAuthProvider.GITHUB]?: {
168
- clientId: string;
169
- clientSecret?: string;
170
- redirectUri?: string;
171
- scope?: string[];
172
- };
173
- }
174
- /**
175
- * 注册登录状态接口
176
- */
177
- export interface RegisterAndLoginState {
178
- currentUser: UserInfo | null;
179
- isLoggedIn: boolean;
180
- isLoading: boolean;
181
- verificationCodeSent: {
182
- [key: string]: {
183
- sent: boolean;
184
- sentAt: number;
185
- expiresAt: number;
186
- };
187
- };
188
- emailRegisterLinkCode: string | null;
189
- oauthConfig: OAuthConfig;
190
- error: string | null;
191
- [key: string]: any;
192
- }
193
- /**
194
- * API 响应接口
195
- */
196
- export interface ApiResponse<T = any> {
197
- status: boolean;
198
- data?: T;
199
- message?: string;
200
- error?: string;
201
- code?: number;
202
- }
203
- /**
204
- * 登录响应接口
205
- */
206
- export interface LoginResponse {
207
- user: UserInfo;
208
- token: string;
209
- refreshToken?: string;
210
- expiresAt: number;
211
- }
212
- /**
213
- * 注册响应接口
214
- */
215
- export interface RegisterResponse {
216
- user: UserInfo;
217
- token?: string;
218
- refreshToken?: string;
219
- expiresAt?: number;
220
- needVerification?: boolean;
221
- }
222
- /**
223
- * OAuth 登录响应接口
224
- */
225
- export interface OAuthLoginResponse {
226
- user: UserInfo;
227
- token: string;
228
- refreshToken?: string;
229
- expiresAt: number;
230
- isNewUser: boolean;
231
- }
232
- /**
233
- * 国家信息接口
234
- */
235
- export interface CountryInfo {
236
- name: string;
237
- code: string;
238
- calling_code: string;
239
- currency_code: string;
240
- }
241
- /**
242
- * 获取国家区号响应接口
243
- */
244
- export interface GetCountriesResponse {
245
- status: boolean;
246
- code: number;
247
- message: string;
248
- data: CountryInfo[];
249
- }
250
- /**
251
- * 发送手机号注册验证码参数接口
252
- */
253
- export interface SendSmsRegisterCodeParams {
254
- phone: string;
255
- country_calling_code: string;
256
- }
257
- /**
258
- * 发送邮箱注册邀请链接参数接口
259
- */
260
- export interface SendEmailRegisterLinkParams {
261
- email: string;
262
- }
263
- /**
264
- * 验证邮箱注册链接参数接口
265
- */
266
- export interface VerifyEmailRegistrationLinkParams {
267
- code: string;
268
- password: string;
269
- }
270
- /**
271
- * 邮箱密码登录参数接口
272
- */
273
- export interface EmailPasswordLoginParams {
274
- email: string;
275
- password: string;
276
- }
277
- /**
278
- * 发送手机登录验证码参数接口
279
- */
280
- export interface SendSmsLoginCodeParams {
281
- phone: string;
282
- country_calling_code: string;
283
- }
284
- /**
285
- * 手机号验证码登录参数接口
286
- */
287
- export interface PhoneCodeLoginParams {
288
- phone: string;
289
- country_calling_code: string;
290
- code: string;
291
- }
292
- /**
293
- * Guest 登录响应接口
294
- */
295
- export interface GuestLoginResponse {
296
- user: UserInfo;
297
- token: string;
298
- refreshToken?: string;
299
- customer: any;
300
- }
301
- /**
302
- * 检查邮箱是否已注册参数接口
303
- */
304
- export interface CheckEmailExistsParams {
305
- email: string;
306
- shop_id: number;
307
- }
308
- /**
309
- * 检查邮箱是否已注册响应接口
310
- */
311
- export interface CheckEmailExistsResponse {
312
- exists: boolean;
313
- }
314
- /**
315
- * 检查邮箱验证码是否有效参数接口
316
- */
317
- export interface CheckEmailCodeParams {
318
- email: string;
319
- shop_id: number;
320
- code: string;
321
- action: string;
322
- }
323
- /**
324
- * 检查手机验证码是否有效参数接口
325
- */
326
- export interface CheckMobileCodeParams {
327
- phone: string;
328
- shop_id: number;
329
- code: string;
330
- country_calling_code: string;
331
- action: string;
332
- }
333
- /**
334
- * 验证码有效性检查响应接口
335
- */
336
- export interface CheckCodeValidResponse {
337
- valid: boolean;
338
- }
339
- /**
340
- * 手机号密码登录参数接口
341
- */
342
- export interface PhonePasswordLoginParams {
343
- phone: string;
344
- password: string;
345
- country_calling_code: string;
346
- }
347
- /**
348
- * 发送密码重置邮箱验证码参数接口
349
- */
350
- export interface SendPasswordResetEmailParams {
351
- email: string;
352
- }
353
- /**
354
- * 发送重置密码手机号验证码参数接口
355
- */
356
- export interface SendPasswordResetSmsParams {
357
- phone: string;
358
- country_calling_code: string;
359
- }
360
- /**
361
- * 发送重置密码邮箱链接参数接口
362
- */
363
- export interface SendResetPasswordLinkParams {
364
- email: string;
365
- }
366
- /**
367
- * 检测重置密码链接code有效性参数接口
368
- */
369
- export interface CheckResetPasswordCodeParams {
370
- code: string;
371
- }
372
- /**
373
- * 通过code重置密码参数接口
374
- */
375
- export interface ResetPasswordByCodeParams {
376
- code: string;
377
- password: string;
378
- }
379
- /**
380
- * 邮箱验证码注册参数接口
381
- */
382
- export interface EmailCodeRegisterParams {
383
- email: string;
384
- code: string;
385
- password: string;
386
- }
387
- /**
388
- * 手机验证码注册参数接口
389
- */
390
- export interface PhoneCodeRegisterParams {
391
- phone: string;
392
- password: string;
393
- code: string;
394
- country_calling_code: string;
395
- }
396
- /**
397
- * 重新发送邮箱注册链接参数接口
398
- */
399
- export interface ResendEmailRegisterLinkParams {
400
- code: string;
401
- }
402
- /**
403
- * 校验邮件链接 code 有效性参数接口
404
- */
405
- export interface CheckEmailLinkCodeParams {
406
- code: string;
407
- }
408
- /**
409
- * 校验邮件链接 code 有效性响应接口
410
- */
411
- export interface CheckEmailLinkCodeResponse {
412
- valid: boolean;
413
- }
414
- /**
415
- * Apple 登录参数
416
- */
417
- export interface AppleLoginParams {
418
- token: string;
419
- }
420
- /**
421
- * Apple 登录响应
422
- */
423
- export interface AppleLoginResponse {
424
- user: UserInfo;
425
- token: string;
426
- refreshToken?: string;
427
- expiresAt: number;
428
- isNewUser: boolean;
429
- }
430
- /**
431
- * Facebook 登录参数
432
- */
433
- export interface FacebookLoginParams {
434
- token: string;
435
- }
436
- /**
437
- * Facebook 登录响应
438
- */
439
- export interface FacebookLoginResponse {
440
- user: UserInfo;
441
- token: string;
442
- refreshToken?: string;
443
- expiresAt: number;
444
- isNewUser: boolean;
445
- }
@@ -1,103 +0,0 @@
1
- /**
2
- * 注册登录工具函数
3
- */
4
- import { VerificationCodeType, OAuthProvider } from './types';
5
- /**
6
- * 验证邮箱格式
7
- */
8
- export declare function validateEmail(email: string): boolean;
9
- /**
10
- * 验证手机号格式(支持多种国际格式)
11
- */
12
- export declare function validatePhone(phone: string): boolean;
13
- export interface PasswordValidationOptions {
14
- minLength?: number;
15
- maxLength?: number;
16
- requireLowercase?: boolean;
17
- requireUppercase?: boolean;
18
- requireNumber?: boolean;
19
- requireSpecialCharacters?: boolean;
20
- specialCharactersPattern?: RegExp;
21
- messages?: Partial<Record<'minLength' | 'maxLength' | 'requireLowercase' | 'requireUppercase' | 'requireNumber' | 'requireSpecialCharacters', string>>;
22
- }
23
- /** 验证密码强度;不传 options 时保持原有规则与返回格式。 */
24
- export declare function validatePassword(password: string, options?: PasswordValidationOptions): {
25
- isValid: boolean;
26
- errors: string[];
27
- };
28
- /**
29
- * 验证验证码格式
30
- */
31
- export declare function validateVerificationCode(code: string, type: VerificationCodeType): boolean;
32
- /**
33
- * 格式化手机号显示
34
- */
35
- export declare function formatPhoneDisplay(phone: string): string;
36
- /**
37
- * 格式化邮箱显示(隐藏部分字符)
38
- */
39
- export declare function formatEmailDisplay(email: string, maskLength?: number): string;
40
- /**
41
- * 生成随机字符串(用于状态参数等)
42
- */
43
- export declare function generateRandomString(length?: number): string;
44
- /**
45
- * 获取 OAuth 提供商的显示名称
46
- */
47
- export declare function getOAuthProviderDisplayName(provider: OAuthProvider): string;
48
- /**
49
- * 获取 OAuth 提供商的图标 URL
50
- */
51
- export declare function getOAuthProviderIconUrl(provider: OAuthProvider): string;
52
- /**
53
- * 检查是否在移动设备上
54
- */
55
- export declare function isMobileDevice(): boolean;
56
- /**
57
- * 检查是否支持 WebAuthn
58
- */
59
- export declare function isWebAuthnSupported(): boolean;
60
- /**
61
- * 检查是否在 iOS 设备上
62
- */
63
- export declare function isIOSDevice(): boolean;
64
- /**
65
- * 检查是否在 Android 设备上
66
- */
67
- export declare function isAndroidDevice(): boolean;
68
- /**
69
- * 获取设备类型
70
- */
71
- export declare function getDeviceType(): 'desktop' | 'mobile' | 'tablet';
72
- /**
73
- * 防抖函数
74
- */
75
- export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
76
- /**
77
- * 节流函数
78
- */
79
- export declare function throttle<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
80
- /**
81
- * 深拷贝对象
82
- */
83
- export declare function deepClone<T>(obj: T): T;
84
- /**
85
- * 安全的 JSON 解析
86
- */
87
- export declare function safeJsonParse<T = any>(jsonString: string, defaultValue: T): T;
88
- /**
89
- * 安全的 JSON 字符串化
90
- */
91
- export declare function safeJsonStringify(obj: any, defaultValue?: string): string;
92
- /**
93
- * 格式化时间戳为可读时间
94
- */
95
- export declare function formatTimestamp(timestamp: number, format?: string): string;
96
- /**
97
- * 计算两个时间戳之间的差值(秒)
98
- */
99
- export declare function getTimeDifference(timestamp1: number, timestamp2: number): number;
100
- /**
101
- * 检查时间戳是否过期
102
- */
103
- export declare function isTimestampExpired(timestamp: number, expirationTime?: number): boolean;
@@ -1,3 +0,0 @@
1
- export declare function createStore<T extends object>(initialState: T, moduleName: string, onChange?: (path: string, value: any) => void): {
2
- proxy: T;
3
- };