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,145 @@
1
+ import { U as UserRole } from './enums-Dume-V5Y.js';
2
+
3
+ /**
4
+ * Auth Services - Types
5
+ * 认证服务类型定义
6
+ */
7
+
8
+ /**
9
+ * 认证服务配置
10
+ */
11
+ interface AuthServiceConfig {
12
+ /**
13
+ * Drizzle 数据库实例
14
+ */
15
+ db: any;
16
+ /**
17
+ * JWT 密钥
18
+ */
19
+ jwtSecret: string;
20
+ /**
21
+ * JWT 过期时间 (默认: '7d')
22
+ */
23
+ jwtExpiresIn?: string;
24
+ /**
25
+ * bcrypt 加密轮数 (默认: 12)
26
+ */
27
+ saltRounds?: number;
28
+ /**
29
+ * 是否在生产环境检查密钥强度 (默认: true)
30
+ */
31
+ checkSecretStrength?: boolean;
32
+ }
33
+ /**
34
+ * 用户信息(返回给客户端的精简版)
35
+ */
36
+ interface UserInfo {
37
+ id: string;
38
+ email: string;
39
+ username: string;
40
+ role: UserRole;
41
+ }
42
+ /**
43
+ * 认证结果
44
+ */
45
+ interface AuthResult {
46
+ user: UserInfo;
47
+ token: string;
48
+ }
49
+ /**
50
+ * 会话信息
51
+ */
52
+ interface SessionInfo {
53
+ id: string;
54
+ userId: string;
55
+ token: string;
56
+ expiresAt: string;
57
+ ipAddress?: string | null;
58
+ userAgent?: string | null;
59
+ }
60
+ /**
61
+ * 验证结果
62
+ */
63
+ interface VerifyResult {
64
+ user: UserInfo;
65
+ session: SessionInfo;
66
+ }
67
+
68
+ /**
69
+ * Auth Services - Drizzle Auth Service
70
+ * 基于 Drizzle ORM 的认证服务
71
+ */
72
+
73
+ /**
74
+ * Drizzle 认证服务类
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * import { DrizzleAuthService } from '@qhr123/sa2kit/auth/services';
79
+ * import { db } from './db';
80
+ *
81
+ * const authService = new DrizzleAuthService({
82
+ * db,
83
+ * jwtSecret: process.env.JWT_SECRET!,
84
+ * jwtExpiresIn: '7d',
85
+ * });
86
+ *
87
+ * // 用户注册
88
+ * const result = await authService.signUp('user@example.com', 'password123', 'username');
89
+ *
90
+ * // 用户登录
91
+ * const loginResult = await authService.signIn('user@example.com', 'password123');
92
+ * ```
93
+ */
94
+ declare class DrizzleAuthService {
95
+ private config;
96
+ constructor(config: AuthServiceConfig);
97
+ /**
98
+ * 验证配置
99
+ */
100
+ private validateConfig;
101
+ /**
102
+ * 用户注册
103
+ */
104
+ signUp(email: string, password: string, username?: string, role?: UserRole): Promise<AuthResult>;
105
+ /**
106
+ * 用户登录
107
+ */
108
+ signIn(email: string, password: string): Promise<AuthResult>;
109
+ /**
110
+ * 验证 Token
111
+ */
112
+ verifyToken(token: string): Promise<VerifyResult>;
113
+ /**
114
+ * 创建会话
115
+ */
116
+ createSession(userId: string, token: string, ipAddress?: string, userAgent?: string): Promise<void>;
117
+ /**
118
+ * 删除会话(登出)
119
+ */
120
+ signOut(token: string): Promise<{
121
+ success: boolean;
122
+ }>;
123
+ /**
124
+ * 获取会话
125
+ */
126
+ getSession(token: string): Promise<VerifyResult | null>;
127
+ /**
128
+ * 检查管理员权限
129
+ */
130
+ requireAdmin(token: string): Promise<VerifyResult>;
131
+ /**
132
+ * 检查超级管理员权限
133
+ */
134
+ requireSuperAdmin(token: string): Promise<VerifyResult>;
135
+ /**
136
+ * 通过用户 ID 获取用户信息
137
+ */
138
+ getUserById(userId: string): Promise<UserInfo | null>;
139
+ /**
140
+ * 通过邮箱获取用户信息
141
+ */
142
+ getUserByEmail(email: string): Promise<UserInfo | null>;
143
+ }
144
+
145
+ export { type AuthResult as A, DrizzleAuthService as D, type SessionInfo as S, type UserInfo as U, type VerifyResult as V, type AuthServiceConfig as a };
@@ -0,0 +1,145 @@
1
+ import { U as UserRole } from './enums-Dume-V5Y.mjs';
2
+
3
+ /**
4
+ * Auth Services - Types
5
+ * 认证服务类型定义
6
+ */
7
+
8
+ /**
9
+ * 认证服务配置
10
+ */
11
+ interface AuthServiceConfig {
12
+ /**
13
+ * Drizzle 数据库实例
14
+ */
15
+ db: any;
16
+ /**
17
+ * JWT 密钥
18
+ */
19
+ jwtSecret: string;
20
+ /**
21
+ * JWT 过期时间 (默认: '7d')
22
+ */
23
+ jwtExpiresIn?: string;
24
+ /**
25
+ * bcrypt 加密轮数 (默认: 12)
26
+ */
27
+ saltRounds?: number;
28
+ /**
29
+ * 是否在生产环境检查密钥强度 (默认: true)
30
+ */
31
+ checkSecretStrength?: boolean;
32
+ }
33
+ /**
34
+ * 用户信息(返回给客户端的精简版)
35
+ */
36
+ interface UserInfo {
37
+ id: string;
38
+ email: string;
39
+ username: string;
40
+ role: UserRole;
41
+ }
42
+ /**
43
+ * 认证结果
44
+ */
45
+ interface AuthResult {
46
+ user: UserInfo;
47
+ token: string;
48
+ }
49
+ /**
50
+ * 会话信息
51
+ */
52
+ interface SessionInfo {
53
+ id: string;
54
+ userId: string;
55
+ token: string;
56
+ expiresAt: string;
57
+ ipAddress?: string | null;
58
+ userAgent?: string | null;
59
+ }
60
+ /**
61
+ * 验证结果
62
+ */
63
+ interface VerifyResult {
64
+ user: UserInfo;
65
+ session: SessionInfo;
66
+ }
67
+
68
+ /**
69
+ * Auth Services - Drizzle Auth Service
70
+ * 基于 Drizzle ORM 的认证服务
71
+ */
72
+
73
+ /**
74
+ * Drizzle 认证服务类
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * import { DrizzleAuthService } from '@qhr123/sa2kit/auth/services';
79
+ * import { db } from './db';
80
+ *
81
+ * const authService = new DrizzleAuthService({
82
+ * db,
83
+ * jwtSecret: process.env.JWT_SECRET!,
84
+ * jwtExpiresIn: '7d',
85
+ * });
86
+ *
87
+ * // 用户注册
88
+ * const result = await authService.signUp('user@example.com', 'password123', 'username');
89
+ *
90
+ * // 用户登录
91
+ * const loginResult = await authService.signIn('user@example.com', 'password123');
92
+ * ```
93
+ */
94
+ declare class DrizzleAuthService {
95
+ private config;
96
+ constructor(config: AuthServiceConfig);
97
+ /**
98
+ * 验证配置
99
+ */
100
+ private validateConfig;
101
+ /**
102
+ * 用户注册
103
+ */
104
+ signUp(email: string, password: string, username?: string, role?: UserRole): Promise<AuthResult>;
105
+ /**
106
+ * 用户登录
107
+ */
108
+ signIn(email: string, password: string): Promise<AuthResult>;
109
+ /**
110
+ * 验证 Token
111
+ */
112
+ verifyToken(token: string): Promise<VerifyResult>;
113
+ /**
114
+ * 创建会话
115
+ */
116
+ createSession(userId: string, token: string, ipAddress?: string, userAgent?: string): Promise<void>;
117
+ /**
118
+ * 删除会话(登出)
119
+ */
120
+ signOut(token: string): Promise<{
121
+ success: boolean;
122
+ }>;
123
+ /**
124
+ * 获取会话
125
+ */
126
+ getSession(token: string): Promise<VerifyResult | null>;
127
+ /**
128
+ * 检查管理员权限
129
+ */
130
+ requireAdmin(token: string): Promise<VerifyResult>;
131
+ /**
132
+ * 检查超级管理员权限
133
+ */
134
+ requireSuperAdmin(token: string): Promise<VerifyResult>;
135
+ /**
136
+ * 通过用户 ID 获取用户信息
137
+ */
138
+ getUserById(userId: string): Promise<UserInfo | null>;
139
+ /**
140
+ * 通过邮箱获取用户信息
141
+ */
142
+ getUserByEmail(email: string): Promise<UserInfo | null>;
143
+ }
144
+
145
+ export { type AuthResult as A, DrizzleAuthService as D, type SessionInfo as S, type UserInfo as U, type VerifyResult as V, type AuthServiceConfig as a };