sa2kit 1.6.10 → 1.6.11

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 (149) hide show
  1. package/dist/ConfigService-BxK06xP6.d.mts +262 -0
  2. package/dist/ConfigService-BxK06xP6.d.ts +262 -0
  3. package/dist/UniversalFileService-BuHN-jrR.d.ts +515 -0
  4. package/dist/UniversalFileService-CGGzYeeF.d.mts +515 -0
  5. package/dist/analytics/index.d.mts +1084 -0
  6. package/dist/analytics/index.d.ts +1084 -0
  7. package/dist/analytics/server/index.d.mts +499 -0
  8. package/dist/analytics/server/index.d.ts +499 -0
  9. package/dist/api/index.d.mts +248 -0
  10. package/dist/api/index.d.ts +248 -0
  11. package/dist/audioDetection/index.d.mts +449 -0
  12. package/dist/audioDetection/index.d.ts +449 -0
  13. package/dist/auth/client/index.d.mts +32 -0
  14. package/dist/auth/client/index.d.ts +32 -0
  15. package/dist/auth/client/index.js +4 -4
  16. package/dist/auth/client/index.mjs +1 -1
  17. package/dist/auth/components/index.d.mts +227 -0
  18. package/dist/auth/components/index.d.ts +227 -0
  19. package/dist/auth/components/index.js +4 -4
  20. package/dist/auth/components/index.mjs +1 -1
  21. package/dist/auth/hooks/index.d.mts +31 -0
  22. package/dist/auth/hooks/index.d.ts +31 -0
  23. package/dist/auth/hooks/index.js +3 -3
  24. package/dist/auth/hooks/index.mjs +1 -1
  25. package/dist/auth/index.d.mts +41 -0
  26. package/dist/auth/index.d.ts +41 -0
  27. package/dist/auth/index.js +17 -36
  28. package/dist/auth/index.js.map +1 -1
  29. package/dist/auth/index.mjs +3 -33
  30. package/dist/auth/index.mjs.map +1 -1
  31. package/dist/auth/middleware/index.d.mts +75 -0
  32. package/dist/auth/middleware/index.d.ts +75 -0
  33. package/dist/auth/routes/index.d.mts +261 -0
  34. package/dist/auth/routes/index.d.ts +261 -0
  35. package/dist/auth/schema/index.d.mts +789 -0
  36. package/dist/auth/schema/index.d.ts +789 -0
  37. package/dist/auth/services/index.d.mts +48 -0
  38. package/dist/auth/services/index.d.ts +48 -0
  39. package/dist/base-api-client-B-yUCal3.d.ts +103 -0
  40. package/dist/base-api-client-BQ8ZPZjk.d.mts +103 -0
  41. package/dist/calendar/index.d.mts +1197 -0
  42. package/dist/calendar/index.d.ts +1197 -0
  43. package/dist/calendar/index.js +8 -8
  44. package/dist/calendar/index.js.map +1 -1
  45. package/dist/calendar/index.mjs +1 -1
  46. package/dist/calendar/index.mjs.map +1 -1
  47. package/dist/calendar/routes/index.d.mts +118 -0
  48. package/dist/calendar/routes/index.d.ts +118 -0
  49. package/dist/calendar/server.d.mts +1184 -0
  50. package/dist/calendar/server.d.ts +1184 -0
  51. package/dist/{chunk-ROEYW4A7.js → chunk-5QMBZP7S.js} +2 -2
  52. package/dist/chunk-5QMBZP7S.js.map +1 -0
  53. package/dist/chunk-6BZ3QFA5.mjs +33 -0
  54. package/dist/chunk-6BZ3QFA5.mjs.map +1 -0
  55. package/dist/{chunk-HEMA7SWK.mjs → chunk-6YKMCPQI.mjs} +2 -2
  56. package/dist/chunk-6YKMCPQI.mjs.map +1 -0
  57. package/dist/chunk-BH5TLVS5.mjs +1593 -0
  58. package/dist/chunk-BH5TLVS5.mjs.map +1 -0
  59. package/dist/chunk-E72D5KHY.js +1723 -0
  60. package/dist/chunk-E72D5KHY.js.map +1 -0
  61. package/dist/chunk-FAHLZIYQ.js +36 -0
  62. package/dist/chunk-FAHLZIYQ.js.map +1 -0
  63. package/dist/{chunk-KGRQNEIR.mjs → chunk-KW5JH6V6.mjs} +2 -2
  64. package/dist/chunk-KW5JH6V6.mjs.map +1 -0
  65. package/dist/{chunk-O26VCNS3.js → chunk-UOFTHYIH.js} +2 -2
  66. package/dist/chunk-UOFTHYIH.js.map +1 -0
  67. package/dist/config/index.d.mts +64 -0
  68. package/dist/config/index.d.ts +64 -0
  69. package/dist/config/server/index.d.mts +1533 -0
  70. package/dist/config/server/index.d.ts +1533 -0
  71. package/dist/drizzle-auth-service-Bxlovhv8.d.ts +145 -0
  72. package/dist/drizzle-auth-service-DZY2F1sv.d.mts +145 -0
  73. package/dist/drizzle-schema-BNhqj2AZ.d.mts +1114 -0
  74. package/dist/drizzle-schema-BNhqj2AZ.d.ts +1114 -0
  75. package/dist/enums-Dume-V5Y.d.mts +16 -0
  76. package/dist/enums-Dume-V5Y.d.ts +16 -0
  77. package/dist/i18n/index.d.mts +417 -0
  78. package/dist/i18n/index.d.ts +417 -0
  79. package/dist/imageCrop/index.d.mts +165 -0
  80. package/dist/imageCrop/index.d.ts +165 -0
  81. package/dist/index-DSel44Ke.d.mts +93 -0
  82. package/dist/index-DSel44Ke.d.ts +93 -0
  83. package/dist/index.d.mts +933 -0
  84. package/dist/index.d.ts +933 -0
  85. package/dist/index.js +1626 -2184
  86. package/dist/index.js.map +1 -1
  87. package/dist/index.mjs +708 -1543
  88. package/dist/index.mjs.map +1 -1
  89. package/dist/logger/index.d.mts +125 -0
  90. package/dist/logger/index.d.ts +125 -0
  91. package/dist/mmd/admin/index.d.mts +487 -0
  92. package/dist/mmd/admin/index.d.ts +487 -0
  93. package/dist/mmd/index.d.mts +1412 -0
  94. package/dist/mmd/index.d.ts +1412 -0
  95. package/dist/mmd/index.js +2695 -625
  96. package/dist/mmd/index.js.map +1 -1
  97. package/dist/mmd/index.mjs +2501 -448
  98. package/dist/mmd/index.mjs.map +1 -1
  99. package/dist/mmd/server/index.d.mts +138 -0
  100. package/dist/mmd/server/index.d.ts +138 -0
  101. package/dist/music/index.d.mts +74 -0
  102. package/dist/music/index.d.ts +74 -0
  103. package/dist/music/server/index.d.mts +1 -0
  104. package/dist/music/server/index.d.ts +1 -0
  105. package/dist/request/index.d.mts +51 -0
  106. package/dist/request/index.d.ts +51 -0
  107. package/dist/storage/index.d.mts +75 -0
  108. package/dist/storage/index.d.ts +75 -0
  109. package/dist/testYourself/admin/index.d.mts +58 -0
  110. package/dist/testYourself/admin/index.d.ts +58 -0
  111. package/dist/testYourself/index.d.mts +53 -0
  112. package/dist/testYourself/index.d.ts +53 -0
  113. package/dist/testYourself/server/index.d.mts +1029 -0
  114. package/dist/testYourself/server/index.d.ts +1029 -0
  115. package/dist/types-BB-7_WtE.d.mts +253 -0
  116. package/dist/types-BB-7_WtE.d.ts +253 -0
  117. package/dist/types-BINlP9MK.d.mts +286 -0
  118. package/dist/types-BINlP9MK.d.ts +286 -0
  119. package/dist/types-BaZccpvk.d.mts +48 -0
  120. package/dist/types-BaZccpvk.d.ts +48 -0
  121. package/dist/types-CK4We_aI.d.mts +270 -0
  122. package/dist/types-CK4We_aI.d.ts +270 -0
  123. package/dist/types-CbTsi9CZ.d.mts +31 -0
  124. package/dist/types-CbTsi9CZ.d.ts +31 -0
  125. package/dist/types-CiYK5Klf.d.mts +99 -0
  126. package/dist/types-D3R6GzOw.d.mts +70 -0
  127. package/dist/types-Dlu52uDy.d.ts +99 -0
  128. package/dist/types-iFeyR443.d.ts +70 -0
  129. package/dist/universalExport/index.d.mts +235 -0
  130. package/dist/universalExport/index.d.ts +235 -0
  131. package/dist/universalExport/server/index.d.mts +1270 -0
  132. package/dist/universalExport/server/index.d.ts +1270 -0
  133. package/dist/universalFile/index.d.mts +480 -0
  134. package/dist/universalFile/index.d.ts +480 -0
  135. package/dist/universalFile/server/index.d.mts +4516 -0
  136. package/dist/universalFile/server/index.d.ts +4516 -0
  137. package/dist/useElectronStorage-Dj0rcorG.d.mts +65 -0
  138. package/dist/useElectronStorage-DwnNfIhl.d.ts +65 -0
  139. package/dist/utils/index.d.mts +192 -0
  140. package/dist/utils/index.d.ts +192 -0
  141. package/package.json +2 -1
  142. package/dist/chunk-4FOBBWXW.mjs +0 -179
  143. package/dist/chunk-4FOBBWXW.mjs.map +0 -1
  144. package/dist/chunk-G6WRJ2H2.js +0 -187
  145. package/dist/chunk-G6WRJ2H2.js.map +0 -1
  146. package/dist/chunk-HEMA7SWK.mjs.map +0 -1
  147. package/dist/chunk-KGRQNEIR.mjs.map +0 -1
  148. package/dist/chunk-O26VCNS3.js.map +0 -1
  149. package/dist/chunk-ROEYW4A7.js.map +0 -1
@@ -0,0 +1,227 @@
1
+ import React__default from 'react';
2
+ import { H as HeadlessLoginFormProps, a as HeadlessRegisterFormProps } from '../../types-D3R6GzOw.mjs';
3
+ export { B as BaseFormProps, L as LoginFormState, R as RegisterFormState } from '../../types-D3R6GzOw.mjs';
4
+ import { B as BaseApiClient } from '../../base-api-client-BQ8ZPZjk.mjs';
5
+ import { a as User } from '../../types-CiYK5Klf.mjs';
6
+ import '../../types-BaZccpvk.mjs';
7
+ import '../../types-CbTsi9CZ.mjs';
8
+ import '../../enums-Dume-V5Y.mjs';
9
+ import 'drizzle-orm/pg-core';
10
+
11
+ /**
12
+ * Auth Components - LoginForm (Headless)
13
+ * 无样式的登录表单组件
14
+ */
15
+
16
+ /**
17
+ * Headless 登录表单组件
18
+ *
19
+ * 提供登录逻辑但不包含任何 UI 样式,
20
+ * 使用 render props 模式让用户完全控制 UI
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <LoginForm apiClient={apiClient}>
25
+ * {({ email, password, loading, error, handleEmailChange, handlePasswordChange, handleSubmit }) => (
26
+ * <form onSubmit={handleSubmit}>
27
+ * <input
28
+ * value={email}
29
+ * onChange={(e) => handleEmailChange(e.target.value)}
30
+ * />
31
+ * <input
32
+ * type="password"
33
+ * value={password}
34
+ * onChange={(e) => handlePasswordChange(e.target.value)}
35
+ * />
36
+ * {error && <div>{error}</div>}
37
+ * <button disabled={loading}>
38
+ * {loading ? '登录中...' : '登录'}
39
+ * </button>
40
+ * </form>
41
+ * )}
42
+ * </LoginForm>
43
+ * ```
44
+ */
45
+ declare function LoginForm({ apiClient, onSuccess, onError, children }: HeadlessLoginFormProps): React__default.JSX.Element;
46
+
47
+ /**
48
+ * Auth Components - RegisterForm (Headless)
49
+ * 无样式的注册表单组件
50
+ */
51
+
52
+ /**
53
+ * Headless 注册表单组件
54
+ *
55
+ * 提供注册逻辑但不包含任何 UI 样式,
56
+ * 使用 render props 模式让用户完全控制 UI
57
+ *
58
+ * @example
59
+ * ```tsx
60
+ * <RegisterForm apiClient={apiClient}>
61
+ * {({ email, password, username, loading, error, handleEmailChange, handlePasswordChange, handleUsernameChange, handleSubmit }) => (
62
+ * <form onSubmit={handleSubmit}>
63
+ * <input
64
+ * value={email}
65
+ * onChange={(e) => handleEmailChange(e.target.value)}
66
+ * />
67
+ * <input
68
+ * value={username}
69
+ * onChange={(e) => handleUsernameChange(e.target.value)}
70
+ * />
71
+ * <input
72
+ * type="password"
73
+ * value={password}
74
+ * onChange={(e) => handlePasswordChange(e.target.value)}
75
+ * />
76
+ * {error && <div>{error}</div>}
77
+ * <button disabled={loading}>
78
+ * {loading ? '注册中...' : '注册'}
79
+ * </button>
80
+ * </form>
81
+ * )}
82
+ * </RegisterForm>
83
+ * ```
84
+ */
85
+ declare function RegisterForm({ apiClient, onSuccess, onError, children, }: HeadlessRegisterFormProps): React__default.JSX.Element;
86
+
87
+ /**
88
+ * Admin Login Page Component
89
+ * 完整的管理后台登录页面组件
90
+ *
91
+ * 功能:
92
+ * - 邮箱密码登录
93
+ * - 开发环境测试账户自动填充
94
+ * - Analytics 埋点集成
95
+ * - 角色权限检查
96
+ * - 响应式设计
97
+ */
98
+
99
+ interface AdminLoginPageProps {
100
+ /**
101
+ * API 客户端实例
102
+ */
103
+ apiClient: BaseApiClient;
104
+ /**
105
+ * 登录成功后的回调
106
+ */
107
+ onLoginSuccess?: (user: User) => void;
108
+ /**
109
+ * 登录失败的回调
110
+ */
111
+ onLoginError?: (error: string) => void;
112
+ /**
113
+ * 权限检查函数(可选)
114
+ * 返回 true 表示有权限,false 表示无权限
115
+ */
116
+ checkPermission?: (user: User) => boolean;
117
+ /**
118
+ * 权限不足时的错误消息
119
+ */
120
+ permissionDeniedMessage?: string;
121
+ /**
122
+ * 开发环境配置
123
+ */
124
+ devConfig?: {
125
+ /**
126
+ * 是否启用开发模式功能(自动填充等)
127
+ */
128
+ enabled?: boolean;
129
+ /**
130
+ * 测试账户邮箱
131
+ */
132
+ testEmail?: string;
133
+ /**
134
+ * 测试账户密码
135
+ */
136
+ testPassword?: string;
137
+ /**
138
+ * 自动填充延迟(毫秒)
139
+ */
140
+ autoFillDelay?: number;
141
+ };
142
+ /**
143
+ * 页面文本配置
144
+ */
145
+ texts?: {
146
+ appName?: string;
147
+ appDescription?: string;
148
+ pageTitle?: string;
149
+ pageSubtitle?: string;
150
+ emailLabel?: string;
151
+ emailPlaceholder?: string;
152
+ passwordLabel?: string;
153
+ passwordPlaceholder?: string;
154
+ loginButton?: string;
155
+ loggingInButton?: string;
156
+ fillTestAccount?: string;
157
+ copyCredentials?: string;
158
+ devModeLabel?: string;
159
+ testAccountInfo?: string;
160
+ testAccountFilled?: string;
161
+ footer?: string;
162
+ };
163
+ /**
164
+ * Analytics 集成(可选)
165
+ */
166
+ analytics?: {
167
+ /**
168
+ * 页面访问埋点
169
+ */
170
+ trackPageView?: (data: Record<string, any>) => void;
171
+ /**
172
+ * 登录成功埋点
173
+ */
174
+ trackLoginSuccess?: (user: User) => void;
175
+ /**
176
+ * 登录失败埋点
177
+ */
178
+ trackLoginFailed?: (error: string, email: string) => void;
179
+ /**
180
+ * 权限拒绝埋点
181
+ */
182
+ trackPermissionDenied?: (user: User) => void;
183
+ /**
184
+ * 设置用户信息
185
+ */
186
+ setUser?: (user: {
187
+ userId: string;
188
+ email: string;
189
+ role: string;
190
+ }) => void;
191
+ };
192
+ /**
193
+ * UI 组件(可选,用于自定义样式)
194
+ */
195
+ components?: {
196
+ Container?: React__default.ComponentType<{
197
+ children: React__default.ReactNode;
198
+ }>;
199
+ Card?: React__default.ComponentType<{
200
+ children: React__default.ReactNode;
201
+ }>;
202
+ Input?: React__default.ComponentType<any>;
203
+ Button?: React__default.ComponentType<any>;
204
+ Alert?: React__default.ComponentType<{
205
+ children: React__default.ReactNode;
206
+ }>;
207
+ Badge?: React__default.ComponentType<{
208
+ children: React__default.ReactNode;
209
+ variant?: string;
210
+ }>;
211
+ };
212
+ /**
213
+ * className 配置(用于 Tailwind CSS)
214
+ */
215
+ classNames?: {
216
+ container?: string;
217
+ card?: string;
218
+ header?: string;
219
+ form?: string;
220
+ input?: string;
221
+ button?: string;
222
+ alert?: string;
223
+ };
224
+ }
225
+ declare function AdminLoginPage(props: AdminLoginPageProps): React__default.JSX.Element;
226
+
227
+ export { AdminLoginPage, type AdminLoginPageProps, HeadlessLoginFormProps, HeadlessRegisterFormProps, LoginForm, RegisterForm };
@@ -0,0 +1,227 @@
1
+ import React__default from 'react';
2
+ import { H as HeadlessLoginFormProps, a as HeadlessRegisterFormProps } from '../../types-iFeyR443.js';
3
+ export { B as BaseFormProps, L as LoginFormState, R as RegisterFormState } from '../../types-iFeyR443.js';
4
+ import { B as BaseApiClient } from '../../base-api-client-B-yUCal3.js';
5
+ import { a as User } from '../../types-Dlu52uDy.js';
6
+ import '../../types-BaZccpvk.js';
7
+ import '../../types-CbTsi9CZ.js';
8
+ import '../../enums-Dume-V5Y.js';
9
+ import 'drizzle-orm/pg-core';
10
+
11
+ /**
12
+ * Auth Components - LoginForm (Headless)
13
+ * 无样式的登录表单组件
14
+ */
15
+
16
+ /**
17
+ * Headless 登录表单组件
18
+ *
19
+ * 提供登录逻辑但不包含任何 UI 样式,
20
+ * 使用 render props 模式让用户完全控制 UI
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <LoginForm apiClient={apiClient}>
25
+ * {({ email, password, loading, error, handleEmailChange, handlePasswordChange, handleSubmit }) => (
26
+ * <form onSubmit={handleSubmit}>
27
+ * <input
28
+ * value={email}
29
+ * onChange={(e) => handleEmailChange(e.target.value)}
30
+ * />
31
+ * <input
32
+ * type="password"
33
+ * value={password}
34
+ * onChange={(e) => handlePasswordChange(e.target.value)}
35
+ * />
36
+ * {error && <div>{error}</div>}
37
+ * <button disabled={loading}>
38
+ * {loading ? '登录中...' : '登录'}
39
+ * </button>
40
+ * </form>
41
+ * )}
42
+ * </LoginForm>
43
+ * ```
44
+ */
45
+ declare function LoginForm({ apiClient, onSuccess, onError, children }: HeadlessLoginFormProps): React__default.JSX.Element;
46
+
47
+ /**
48
+ * Auth Components - RegisterForm (Headless)
49
+ * 无样式的注册表单组件
50
+ */
51
+
52
+ /**
53
+ * Headless 注册表单组件
54
+ *
55
+ * 提供注册逻辑但不包含任何 UI 样式,
56
+ * 使用 render props 模式让用户完全控制 UI
57
+ *
58
+ * @example
59
+ * ```tsx
60
+ * <RegisterForm apiClient={apiClient}>
61
+ * {({ email, password, username, loading, error, handleEmailChange, handlePasswordChange, handleUsernameChange, handleSubmit }) => (
62
+ * <form onSubmit={handleSubmit}>
63
+ * <input
64
+ * value={email}
65
+ * onChange={(e) => handleEmailChange(e.target.value)}
66
+ * />
67
+ * <input
68
+ * value={username}
69
+ * onChange={(e) => handleUsernameChange(e.target.value)}
70
+ * />
71
+ * <input
72
+ * type="password"
73
+ * value={password}
74
+ * onChange={(e) => handlePasswordChange(e.target.value)}
75
+ * />
76
+ * {error && <div>{error}</div>}
77
+ * <button disabled={loading}>
78
+ * {loading ? '注册中...' : '注册'}
79
+ * </button>
80
+ * </form>
81
+ * )}
82
+ * </RegisterForm>
83
+ * ```
84
+ */
85
+ declare function RegisterForm({ apiClient, onSuccess, onError, children, }: HeadlessRegisterFormProps): React__default.JSX.Element;
86
+
87
+ /**
88
+ * Admin Login Page Component
89
+ * 完整的管理后台登录页面组件
90
+ *
91
+ * 功能:
92
+ * - 邮箱密码登录
93
+ * - 开发环境测试账户自动填充
94
+ * - Analytics 埋点集成
95
+ * - 角色权限检查
96
+ * - 响应式设计
97
+ */
98
+
99
+ interface AdminLoginPageProps {
100
+ /**
101
+ * API 客户端实例
102
+ */
103
+ apiClient: BaseApiClient;
104
+ /**
105
+ * 登录成功后的回调
106
+ */
107
+ onLoginSuccess?: (user: User) => void;
108
+ /**
109
+ * 登录失败的回调
110
+ */
111
+ onLoginError?: (error: string) => void;
112
+ /**
113
+ * 权限检查函数(可选)
114
+ * 返回 true 表示有权限,false 表示无权限
115
+ */
116
+ checkPermission?: (user: User) => boolean;
117
+ /**
118
+ * 权限不足时的错误消息
119
+ */
120
+ permissionDeniedMessage?: string;
121
+ /**
122
+ * 开发环境配置
123
+ */
124
+ devConfig?: {
125
+ /**
126
+ * 是否启用开发模式功能(自动填充等)
127
+ */
128
+ enabled?: boolean;
129
+ /**
130
+ * 测试账户邮箱
131
+ */
132
+ testEmail?: string;
133
+ /**
134
+ * 测试账户密码
135
+ */
136
+ testPassword?: string;
137
+ /**
138
+ * 自动填充延迟(毫秒)
139
+ */
140
+ autoFillDelay?: number;
141
+ };
142
+ /**
143
+ * 页面文本配置
144
+ */
145
+ texts?: {
146
+ appName?: string;
147
+ appDescription?: string;
148
+ pageTitle?: string;
149
+ pageSubtitle?: string;
150
+ emailLabel?: string;
151
+ emailPlaceholder?: string;
152
+ passwordLabel?: string;
153
+ passwordPlaceholder?: string;
154
+ loginButton?: string;
155
+ loggingInButton?: string;
156
+ fillTestAccount?: string;
157
+ copyCredentials?: string;
158
+ devModeLabel?: string;
159
+ testAccountInfo?: string;
160
+ testAccountFilled?: string;
161
+ footer?: string;
162
+ };
163
+ /**
164
+ * Analytics 集成(可选)
165
+ */
166
+ analytics?: {
167
+ /**
168
+ * 页面访问埋点
169
+ */
170
+ trackPageView?: (data: Record<string, any>) => void;
171
+ /**
172
+ * 登录成功埋点
173
+ */
174
+ trackLoginSuccess?: (user: User) => void;
175
+ /**
176
+ * 登录失败埋点
177
+ */
178
+ trackLoginFailed?: (error: string, email: string) => void;
179
+ /**
180
+ * 权限拒绝埋点
181
+ */
182
+ trackPermissionDenied?: (user: User) => void;
183
+ /**
184
+ * 设置用户信息
185
+ */
186
+ setUser?: (user: {
187
+ userId: string;
188
+ email: string;
189
+ role: string;
190
+ }) => void;
191
+ };
192
+ /**
193
+ * UI 组件(可选,用于自定义样式)
194
+ */
195
+ components?: {
196
+ Container?: React__default.ComponentType<{
197
+ children: React__default.ReactNode;
198
+ }>;
199
+ Card?: React__default.ComponentType<{
200
+ children: React__default.ReactNode;
201
+ }>;
202
+ Input?: React__default.ComponentType<any>;
203
+ Button?: React__default.ComponentType<any>;
204
+ Alert?: React__default.ComponentType<{
205
+ children: React__default.ReactNode;
206
+ }>;
207
+ Badge?: React__default.ComponentType<{
208
+ children: React__default.ReactNode;
209
+ variant?: string;
210
+ }>;
211
+ };
212
+ /**
213
+ * className 配置(用于 Tailwind CSS)
214
+ */
215
+ classNames?: {
216
+ container?: string;
217
+ card?: string;
218
+ header?: string;
219
+ form?: string;
220
+ input?: string;
221
+ button?: string;
222
+ alert?: string;
223
+ };
224
+ }
225
+ declare function AdminLoginPage(props: AdminLoginPageProps): React__default.JSX.Element;
226
+
227
+ export { AdminLoginPage, type AdminLoginPageProps, HeadlessLoginFormProps, HeadlessRegisterFormProps, LoginForm, RegisterForm };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkROEYW4A7_js = require('../../chunk-ROEYW4A7.js');
3
+ var chunk5QMBZP7S_js = require('../../chunk-5QMBZP7S.js');
4
4
  require('../../chunk-DGUM43GV.js');
5
5
  var React3 = require('react');
6
6
 
@@ -9,7 +9,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
9
  var React3__default = /*#__PURE__*/_interopDefault(React3);
10
10
 
11
11
  function LoginForm({ apiClient, onSuccess, onError, children }) {
12
- const { login, loading, error: authError, clearError } = chunkROEYW4A7_js.useAuth(apiClient);
12
+ const { login, loading, error: authError, clearError } = chunk5QMBZP7S_js.useAuth(apiClient);
13
13
  const [email, setEmail] = React3.useState("");
14
14
  const [password, setPassword] = React3.useState("");
15
15
  const handleSubmit = async (e) => {
@@ -44,7 +44,7 @@ function RegisterForm({
44
44
  onError,
45
45
  children
46
46
  }) {
47
- const { register, loading, error: authError, clearError } = chunkROEYW4A7_js.useAuth(apiClient);
47
+ const { register, loading, error: authError, clearError } = chunk5QMBZP7S_js.useAuth(apiClient);
48
48
  const [email, setEmail] = React3.useState("");
49
49
  const [password, setPassword] = React3.useState("");
50
50
  const [username, setUsername] = React3.useState("");
@@ -212,7 +212,7 @@ function AdminLoginPage(props) {
212
212
  const testEmail = devConfig?.testEmail || "admin@example.com";
213
213
  const testPassword = devConfig?.testPassword || "admin123";
214
214
  const autoFillDelay = devConfig?.autoFillDelay || 2e3;
215
- const { user, isLoggedIn, loading, error: authError, login, clearError } = chunkROEYW4A7_js.useAuth(apiClient);
215
+ const { user, isLoggedIn, loading, error: authError, login, clearError } = chunk5QMBZP7S_js.useAuth(apiClient);
216
216
  const error = authError || localError;
217
217
  React3.useEffect(() => {
218
218
  if (typeof window !== "undefined" && analytics?.trackPageView) {
@@ -1,4 +1,4 @@
1
- import { useAuth } from '../../chunk-KGRQNEIR.mjs';
1
+ import { useAuth } from '../../chunk-KW5JH6V6.mjs';
2
2
  import '../../chunk-BJTO5JO5.mjs';
3
3
  import React3, { useState, useEffect } from 'react';
4
4
 
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+ import { I as IAuthClient, U as UseAuthReturn } from '../../types-CiYK5Klf.mjs';
3
+ export { c as AuthResult, a as User } from '../../types-CiYK5Klf.mjs';
4
+ import '../../enums-Dume-V5Y.mjs';
5
+ import 'drizzle-orm/pg-core';
6
+
7
+ declare function useAuth(apiClient: IAuthClient): UseAuthReturn;
8
+ /**
9
+ * 表单验证 Hook
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * const { values, errors, handleChange, handleBlur, validate } = useAuthForm({
14
+ * email: '',
15
+ * password: ''
16
+ * })
17
+ * ```
18
+ */
19
+ declare function useAuthForm<T extends Record<string, any>>(initialValues: T): {
20
+ values: T;
21
+ errors: Partial<Record<keyof T, string>>;
22
+ touched: Partial<Record<keyof T, boolean>>;
23
+ handleChange: (field: keyof T, value: any) => void;
24
+ handleBlur: (field: keyof T) => void;
25
+ validate: (validationRules: Partial<Record<keyof T, (value: any) => string | undefined>>) => boolean;
26
+ reset: () => void;
27
+ setValues: React.Dispatch<React.SetStateAction<T>>;
28
+ setErrors: React.Dispatch<React.SetStateAction<Partial<Record<keyof T, string>>>>;
29
+ };
30
+
31
+ export { IAuthClient as BaseApiClient, UseAuthReturn, useAuth, useAuthForm };
@@ -0,0 +1,31 @@
1
+ import * as React from 'react';
2
+ import { I as IAuthClient, U as UseAuthReturn } from '../../types-Dlu52uDy.js';
3
+ export { c as AuthResult, a as User } from '../../types-Dlu52uDy.js';
4
+ import '../../enums-Dume-V5Y.js';
5
+ import 'drizzle-orm/pg-core';
6
+
7
+ declare function useAuth(apiClient: IAuthClient): UseAuthReturn;
8
+ /**
9
+ * 表单验证 Hook
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * const { values, errors, handleChange, handleBlur, validate } = useAuthForm({
14
+ * email: '',
15
+ * password: ''
16
+ * })
17
+ * ```
18
+ */
19
+ declare function useAuthForm<T extends Record<string, any>>(initialValues: T): {
20
+ values: T;
21
+ errors: Partial<Record<keyof T, string>>;
22
+ touched: Partial<Record<keyof T, boolean>>;
23
+ handleChange: (field: keyof T, value: any) => void;
24
+ handleBlur: (field: keyof T) => void;
25
+ validate: (validationRules: Partial<Record<keyof T, (value: any) => string | undefined>>) => boolean;
26
+ reset: () => void;
27
+ setValues: React.Dispatch<React.SetStateAction<T>>;
28
+ setErrors: React.Dispatch<React.SetStateAction<Partial<Record<keyof T, string>>>>;
29
+ };
30
+
31
+ export { IAuthClient as BaseApiClient, UseAuthReturn, useAuth, useAuthForm };
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var chunkROEYW4A7_js = require('../../chunk-ROEYW4A7.js');
3
+ var chunk5QMBZP7S_js = require('../../chunk-5QMBZP7S.js');
4
4
  require('../../chunk-DGUM43GV.js');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "useAuth", {
9
9
  enumerable: true,
10
- get: function () { return chunkROEYW4A7_js.useAuth; }
10
+ get: function () { return chunk5QMBZP7S_js.useAuth; }
11
11
  });
12
12
  Object.defineProperty(exports, "useAuthForm", {
13
13
  enumerable: true,
14
- get: function () { return chunkROEYW4A7_js.useAuthForm; }
14
+ get: function () { return chunk5QMBZP7S_js.useAuthForm; }
15
15
  });
16
16
  //# sourceMappingURL=index.js.map
17
17
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- export { useAuth, useAuthForm } from '../../chunk-KGRQNEIR.mjs';
1
+ export { useAuth, useAuthForm } from '../../chunk-KW5JH6V6.mjs';
2
2
  import '../../chunk-BJTO5JO5.mjs';
3
3
  //# sourceMappingURL=index.mjs.map
4
4
  //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,41 @@
1
+ import { U as UserRole } from '../enums-Dume-V5Y.mjs';
2
+ export { u as userRole } from '../enums-Dume-V5Y.mjs';
3
+ export { Account, NewAccount, NewSession, NewUser, NewVerification, Session, User, Verification, account, accountRelations, session, sessionRelations, user, userRelations, verifications } from './schema/index.mjs';
4
+ export { A as AuthResult, a as AuthServiceConfig, D as DrizzleAuthService, S as SessionInfo, U as UserInfo, V as VerifyResult } from '../drizzle-auth-service-DZY2F1sv.mjs';
5
+ export { JwtPayload, generateToken, getTokenFromRequest, hashPassword, verifyJwtToken, verifyPassword } from './services/index.mjs';
6
+ import { NextRequest } from 'next/server';
7
+ export { AnalyticsEvent, AnalyticsService, ApiResponse, BaseRouteConfig, LoginRouteConfig, RegisterRouteConfig, createAnalyticsAdapter, createDefaultBaseConfig, createDefaultLoginConfig, createDefaultRegisterConfig, createLoginHandler, createLoginOptionsHandler, createLogoutHandler, createLogoutOptionsHandler, createMeHandler, createMeOptionsHandler, createRegisterHandler, createRegisterOptionsHandler } from './routes/index.mjs';
8
+ export { AuthLevel, AuthMiddlewareConfig, RouteContext, RouteHandler, createAuthMiddleware } from './middleware/index.mjs';
9
+ export { useAuth, useAuthForm } from './hooks/index.mjs';
10
+ export { B as BaseApiClient } from '../base-api-client-BQ8ZPZjk.mjs';
11
+ export { API_ROUTES, STORAGE_KEYS } from './client/index.mjs';
12
+ export { L as LoginFormState, R as RegisterFormState } from '../types-D3R6GzOw.mjs';
13
+ export { A as AuthResponse, B as BaseUser, I as IAuthClient, L as LoginForm, R as RegisterForm, U as UseAuthReturn } from '../types-CiYK5Klf.mjs';
14
+ import 'drizzle-orm/pg-core';
15
+ import 'drizzle-orm';
16
+ import 'react';
17
+ import '../types-BaZccpvk.mjs';
18
+ import '../types-CbTsi9CZ.mjs';
19
+
20
+ /**
21
+ * 验证 API 请求的身份
22
+ * 从请求头中获取 Token 并验证,返回用户信息
23
+ */
24
+ declare function validateApiAuth(request: NextRequest): Promise<{
25
+ id: string;
26
+ email: string;
27
+ username: string | undefined;
28
+ role: UserRole;
29
+ } | null>;
30
+ /**
31
+ * 验证 API 请求的身份(针对使用数字 ID 的项目)
32
+ * 将 string 类型的 userId 转换为 number 类型
33
+ */
34
+ declare function validateApiAuthNumeric(request: NextRequest): Promise<{
35
+ id: number;
36
+ email: string;
37
+ username: string | undefined;
38
+ role: UserRole;
39
+ } | null>;
40
+
41
+ export { UserRole, validateApiAuth, validateApiAuthNumeric };
@@ -0,0 +1,41 @@
1
+ import { U as UserRole } from '../enums-Dume-V5Y.js';
2
+ export { u as userRole } from '../enums-Dume-V5Y.js';
3
+ export { Account, NewAccount, NewSession, NewUser, NewVerification, Session, User, Verification, account, accountRelations, session, sessionRelations, user, userRelations, verifications } from './schema/index.js';
4
+ export { A as AuthResult, a as AuthServiceConfig, D as DrizzleAuthService, S as SessionInfo, U as UserInfo, V as VerifyResult } from '../drizzle-auth-service-Bxlovhv8.js';
5
+ export { JwtPayload, generateToken, getTokenFromRequest, hashPassword, verifyJwtToken, verifyPassword } from './services/index.js';
6
+ import { NextRequest } from 'next/server';
7
+ export { AnalyticsEvent, AnalyticsService, ApiResponse, BaseRouteConfig, LoginRouteConfig, RegisterRouteConfig, createAnalyticsAdapter, createDefaultBaseConfig, createDefaultLoginConfig, createDefaultRegisterConfig, createLoginHandler, createLoginOptionsHandler, createLogoutHandler, createLogoutOptionsHandler, createMeHandler, createMeOptionsHandler, createRegisterHandler, createRegisterOptionsHandler } from './routes/index.js';
8
+ export { AuthLevel, AuthMiddlewareConfig, RouteContext, RouteHandler, createAuthMiddleware } from './middleware/index.js';
9
+ export { useAuth, useAuthForm } from './hooks/index.js';
10
+ export { B as BaseApiClient } from '../base-api-client-B-yUCal3.js';
11
+ export { API_ROUTES, STORAGE_KEYS } from './client/index.js';
12
+ export { L as LoginFormState, R as RegisterFormState } from '../types-iFeyR443.js';
13
+ export { A as AuthResponse, B as BaseUser, I as IAuthClient, L as LoginForm, R as RegisterForm, U as UseAuthReturn } from '../types-Dlu52uDy.js';
14
+ import 'drizzle-orm/pg-core';
15
+ import 'drizzle-orm';
16
+ import 'react';
17
+ import '../types-BaZccpvk.js';
18
+ import '../types-CbTsi9CZ.js';
19
+
20
+ /**
21
+ * 验证 API 请求的身份
22
+ * 从请求头中获取 Token 并验证,返回用户信息
23
+ */
24
+ declare function validateApiAuth(request: NextRequest): Promise<{
25
+ id: string;
26
+ email: string;
27
+ username: string | undefined;
28
+ role: UserRole;
29
+ } | null>;
30
+ /**
31
+ * 验证 API 请求的身份(针对使用数字 ID 的项目)
32
+ * 将 string 类型的 userId 转换为 number 类型
33
+ */
34
+ declare function validateApiAuthNumeric(request: NextRequest): Promise<{
35
+ id: number;
36
+ email: string;
37
+ username: string | undefined;
38
+ role: UserRole;
39
+ } | null>;
40
+
41
+ export { UserRole, validateApiAuth, validateApiAuthNumeric };