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,48 @@
1
+ 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';
2
+ import { U as UserRole } from '../../enums-Dume-V5Y.mjs';
3
+ import 'drizzle-orm/pg-core';
4
+
5
+ /**
6
+ * Auth Services - Password Utilities
7
+ * 密码哈希相关工具函数
8
+ */
9
+ /**
10
+ * 哈希密码
11
+ */
12
+ declare function hashPassword(password: string, saltRounds?: number): Promise<string>;
13
+ /**
14
+ * 验证密码
15
+ */
16
+ declare function verifyPassword(password: string, hashedPassword: string): Promise<boolean>;
17
+
18
+ /**
19
+ * Auth Services - Token Utilities
20
+ * Token 相关工具函数
21
+ */
22
+
23
+ /**
24
+ * JWT Payload
25
+ */
26
+ interface JwtPayload {
27
+ userId: string;
28
+ email: string;
29
+ username?: string;
30
+ role: UserRole;
31
+ iat?: number;
32
+ exp?: number;
33
+ }
34
+ /**
35
+ * 生成 JWT Token
36
+ */
37
+ declare function generateToken(payload: Omit<JwtPayload, 'iat' | 'exp'>, secret: string, expiresIn?: string | number): string;
38
+ /**
39
+ * 验证 JWT Token
40
+ */
41
+ declare function verifyJwtToken(token: string, secret: string): JwtPayload;
42
+ /**
43
+ * 从请求中获取 Token
44
+ * 优先从 Cookie 读取(Web),兼容 Authorization Header(Mobile/API)
45
+ */
46
+ declare function getTokenFromRequest(request: Request): string | null;
47
+
48
+ export { type JwtPayload, generateToken, getTokenFromRequest, hashPassword, verifyJwtToken, verifyPassword };
@@ -0,0 +1,48 @@
1
+ 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';
2
+ import { U as UserRole } from '../../enums-Dume-V5Y.js';
3
+ import 'drizzle-orm/pg-core';
4
+
5
+ /**
6
+ * Auth Services - Password Utilities
7
+ * 密码哈希相关工具函数
8
+ */
9
+ /**
10
+ * 哈希密码
11
+ */
12
+ declare function hashPassword(password: string, saltRounds?: number): Promise<string>;
13
+ /**
14
+ * 验证密码
15
+ */
16
+ declare function verifyPassword(password: string, hashedPassword: string): Promise<boolean>;
17
+
18
+ /**
19
+ * Auth Services - Token Utilities
20
+ * Token 相关工具函数
21
+ */
22
+
23
+ /**
24
+ * JWT Payload
25
+ */
26
+ interface JwtPayload {
27
+ userId: string;
28
+ email: string;
29
+ username?: string;
30
+ role: UserRole;
31
+ iat?: number;
32
+ exp?: number;
33
+ }
34
+ /**
35
+ * 生成 JWT Token
36
+ */
37
+ declare function generateToken(payload: Omit<JwtPayload, 'iat' | 'exp'>, secret: string, expiresIn?: string | number): string;
38
+ /**
39
+ * 验证 JWT Token
40
+ */
41
+ declare function verifyJwtToken(token: string, secret: string): JwtPayload;
42
+ /**
43
+ * 从请求中获取 Token
44
+ * 优先从 Cookie 读取(Web),兼容 Authorization Header(Mobile/API)
45
+ */
46
+ declare function getTokenFromRequest(request: Request): string | null;
47
+
48
+ export { type JwtPayload, generateToken, getTokenFromRequest, hashPassword, verifyJwtToken, verifyPassword };
@@ -0,0 +1,103 @@
1
+ import { S as StorageAdapter } from './types-BaZccpvk.js';
2
+ import { R as RequestAdapter } from './types-CbTsi9CZ.js';
3
+ import { I as IAuthClient, a as User, b as ApiResponse, A as AuthResponse } from './types-Dlu52uDy.js';
4
+
5
+ /**
6
+ * Auth Client - Base API Client
7
+ * 基础 API 客户端
8
+ */
9
+
10
+ /**
11
+ * 基础 API 客户端
12
+ * 提供统一的 API 调用逻辑,通过适配器模式支持多平台
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * import { BaseApiClient } from '@qhr123/sa2kit/auth/client';
17
+ * import { WebStorageAdapter } from '@qhr123/sa2kit/storage';
18
+ * import { WebRequestAdapter } from '@qhr123/sa2kit/request';
19
+ *
20
+ * const apiClient = new BaseApiClient(
21
+ * new WebStorageAdapter(),
22
+ * new WebRequestAdapter(),
23
+ * '/api'
24
+ * );
25
+ *
26
+ * await apiClient.init();
27
+ * const result = await apiClient.login('user@example.com', 'password');
28
+ * ```
29
+ */
30
+ declare class BaseApiClient implements IAuthClient {
31
+ private storage;
32
+ private request;
33
+ private baseUrl;
34
+ private token;
35
+ private user;
36
+ constructor(storage: StorageAdapter, request: RequestAdapter, baseUrl: string);
37
+ /**
38
+ * 初始化 - 从存储中加载 token 和用户信息
39
+ */
40
+ init(): Promise<void>;
41
+ /**
42
+ * 设置认证 token
43
+ */
44
+ setToken(token: string | null): Promise<void>;
45
+ /**
46
+ * 设置用户信息
47
+ */
48
+ setUser(user: User | null): Promise<void>;
49
+ /**
50
+ * 获取当前 token
51
+ */
52
+ getToken(): string | null;
53
+ /**
54
+ * 获取当前用户
55
+ */
56
+ getUser(): User | null;
57
+ /**
58
+ * 检查是否已登录
59
+ */
60
+ isAuthenticated(): Promise<boolean>;
61
+ /**
62
+ * 清除用户数据
63
+ */
64
+ clearUserData(): Promise<void>;
65
+ /**
66
+ * 发送请求的通用方法
67
+ */
68
+ private sendRequest;
69
+ /**
70
+ * 用户注册
71
+ */
72
+ register(email: string, password: string, username: string): Promise<ApiResponse<AuthResponse>>;
73
+ /**
74
+ * 用户登录
75
+ */
76
+ login(email: string, password: string): Promise<ApiResponse<AuthResponse>>;
77
+ /**
78
+ * 用户退出登录
79
+ */
80
+ logout(): Promise<void>;
81
+ /**
82
+ * 获取当前用户信息
83
+ */
84
+ getCurrentUser(): Promise<ApiResponse<User>>;
85
+ /**
86
+ * 发送 GET 请求
87
+ */
88
+ get<T = any>(url: string, params?: Record<string, any>): Promise<ApiResponse<T>>;
89
+ /**
90
+ * 发送 POST 请求
91
+ */
92
+ post<T = any>(url: string, body?: any): Promise<ApiResponse<T>>;
93
+ /**
94
+ * 发送 PUT 请求
95
+ */
96
+ put<T = any>(url: string, body?: any): Promise<ApiResponse<T>>;
97
+ /**
98
+ * 发送 DELETE 请求
99
+ */
100
+ delete<T = any>(url: string): Promise<ApiResponse<T>>;
101
+ }
102
+
103
+ export { BaseApiClient as B };
@@ -0,0 +1,103 @@
1
+ import { S as StorageAdapter } from './types-BaZccpvk.mjs';
2
+ import { R as RequestAdapter } from './types-CbTsi9CZ.mjs';
3
+ import { I as IAuthClient, a as User, b as ApiResponse, A as AuthResponse } from './types-CiYK5Klf.mjs';
4
+
5
+ /**
6
+ * Auth Client - Base API Client
7
+ * 基础 API 客户端
8
+ */
9
+
10
+ /**
11
+ * 基础 API 客户端
12
+ * 提供统一的 API 调用逻辑,通过适配器模式支持多平台
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * import { BaseApiClient } from '@qhr123/sa2kit/auth/client';
17
+ * import { WebStorageAdapter } from '@qhr123/sa2kit/storage';
18
+ * import { WebRequestAdapter } from '@qhr123/sa2kit/request';
19
+ *
20
+ * const apiClient = new BaseApiClient(
21
+ * new WebStorageAdapter(),
22
+ * new WebRequestAdapter(),
23
+ * '/api'
24
+ * );
25
+ *
26
+ * await apiClient.init();
27
+ * const result = await apiClient.login('user@example.com', 'password');
28
+ * ```
29
+ */
30
+ declare class BaseApiClient implements IAuthClient {
31
+ private storage;
32
+ private request;
33
+ private baseUrl;
34
+ private token;
35
+ private user;
36
+ constructor(storage: StorageAdapter, request: RequestAdapter, baseUrl: string);
37
+ /**
38
+ * 初始化 - 从存储中加载 token 和用户信息
39
+ */
40
+ init(): Promise<void>;
41
+ /**
42
+ * 设置认证 token
43
+ */
44
+ setToken(token: string | null): Promise<void>;
45
+ /**
46
+ * 设置用户信息
47
+ */
48
+ setUser(user: User | null): Promise<void>;
49
+ /**
50
+ * 获取当前 token
51
+ */
52
+ getToken(): string | null;
53
+ /**
54
+ * 获取当前用户
55
+ */
56
+ getUser(): User | null;
57
+ /**
58
+ * 检查是否已登录
59
+ */
60
+ isAuthenticated(): Promise<boolean>;
61
+ /**
62
+ * 清除用户数据
63
+ */
64
+ clearUserData(): Promise<void>;
65
+ /**
66
+ * 发送请求的通用方法
67
+ */
68
+ private sendRequest;
69
+ /**
70
+ * 用户注册
71
+ */
72
+ register(email: string, password: string, username: string): Promise<ApiResponse<AuthResponse>>;
73
+ /**
74
+ * 用户登录
75
+ */
76
+ login(email: string, password: string): Promise<ApiResponse<AuthResponse>>;
77
+ /**
78
+ * 用户退出登录
79
+ */
80
+ logout(): Promise<void>;
81
+ /**
82
+ * 获取当前用户信息
83
+ */
84
+ getCurrentUser(): Promise<ApiResponse<User>>;
85
+ /**
86
+ * 发送 GET 请求
87
+ */
88
+ get<T = any>(url: string, params?: Record<string, any>): Promise<ApiResponse<T>>;
89
+ /**
90
+ * 发送 POST 请求
91
+ */
92
+ post<T = any>(url: string, body?: any): Promise<ApiResponse<T>>;
93
+ /**
94
+ * 发送 PUT 请求
95
+ */
96
+ put<T = any>(url: string, body?: any): Promise<ApiResponse<T>>;
97
+ /**
98
+ * 发送 DELETE 请求
99
+ */
100
+ delete<T = any>(url: string): Promise<ApiResponse<T>>;
101
+ }
102
+
103
+ export { BaseApiClient as B };