sa2kit 1.6.8 → 1.6.10

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 (125) hide show
  1. package/dist/calendar/index.js +10 -8
  2. package/dist/calendar/index.js.map +1 -1
  3. package/dist/calendar/index.mjs +3 -1
  4. package/dist/calendar/index.mjs.map +1 -1
  5. package/dist/calendar/routes/index.js +21 -21
  6. package/dist/calendar/routes/index.mjs +1 -1
  7. package/dist/calendar/server.js +13 -13
  8. package/dist/calendar/server.mjs +2 -2
  9. package/dist/{chunk-VHU2YGRQ.mjs → chunk-4FOBBWXW.mjs} +25 -11
  10. package/dist/chunk-4FOBBWXW.mjs.map +1 -0
  11. package/dist/{chunk-ZDRBMSTS.js → chunk-G6WRJ2H2.js} +25 -11
  12. package/dist/chunk-G6WRJ2H2.js.map +1 -0
  13. package/dist/{chunk-6WXOA4BE.mjs → chunk-GVVS4IMM.mjs} +2 -2
  14. package/dist/chunk-GVVS4IMM.mjs.map +1 -0
  15. package/dist/{chunk-AXP7KROR.js → chunk-WC5QFO3T.js} +2 -2
  16. package/dist/chunk-WC5QFO3T.js.map +1 -0
  17. package/dist/index.js +5 -5
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +2 -2
  20. package/dist/index.mjs.map +1 -1
  21. package/package.json +41 -7
  22. package/dist/ConfigService-BxK06xP6.d.mts +0 -262
  23. package/dist/ConfigService-BxK06xP6.d.ts +0 -262
  24. package/dist/UniversalFileService-BuHN-jrR.d.ts +0 -515
  25. package/dist/UniversalFileService-CGGzYeeF.d.mts +0 -515
  26. package/dist/analytics/index.d.mts +0 -1084
  27. package/dist/analytics/index.d.ts +0 -1084
  28. package/dist/analytics/server/index.d.mts +0 -499
  29. package/dist/analytics/server/index.d.ts +0 -499
  30. package/dist/api/index.d.mts +0 -248
  31. package/dist/api/index.d.ts +0 -248
  32. package/dist/audioDetection/index.d.mts +0 -449
  33. package/dist/audioDetection/index.d.ts +0 -449
  34. package/dist/auth/client/index.d.mts +0 -153
  35. package/dist/auth/client/index.d.ts +0 -153
  36. package/dist/auth/components/index.d.mts +0 -227
  37. package/dist/auth/components/index.d.ts +0 -227
  38. package/dist/auth/hooks/index.d.mts +0 -31
  39. package/dist/auth/hooks/index.d.ts +0 -31
  40. package/dist/auth/index.d.mts +0 -40
  41. package/dist/auth/index.d.ts +0 -40
  42. package/dist/auth/middleware/index.d.mts +0 -75
  43. package/dist/auth/middleware/index.d.ts +0 -75
  44. package/dist/auth/routes/index.d.mts +0 -261
  45. package/dist/auth/routes/index.d.ts +0 -261
  46. package/dist/auth/schema/index.d.mts +0 -789
  47. package/dist/auth/schema/index.d.ts +0 -789
  48. package/dist/auth/services/index.d.mts +0 -48
  49. package/dist/auth/services/index.d.ts +0 -48
  50. package/dist/calendar/index.d.mts +0 -1197
  51. package/dist/calendar/index.d.ts +0 -1197
  52. package/dist/calendar/routes/index.d.mts +0 -118
  53. package/dist/calendar/routes/index.d.ts +0 -118
  54. package/dist/calendar/server.d.mts +0 -1184
  55. package/dist/calendar/server.d.ts +0 -1184
  56. package/dist/chunk-6WXOA4BE.mjs.map +0 -1
  57. package/dist/chunk-AXP7KROR.js.map +0 -1
  58. package/dist/chunk-VHU2YGRQ.mjs.map +0 -1
  59. package/dist/chunk-ZDRBMSTS.js.map +0 -1
  60. package/dist/config/index.d.mts +0 -64
  61. package/dist/config/index.d.ts +0 -64
  62. package/dist/config/server/index.d.mts +0 -1533
  63. package/dist/config/server/index.d.ts +0 -1533
  64. package/dist/drizzle-auth-service-Bxlovhv8.d.ts +0 -145
  65. package/dist/drizzle-auth-service-DZY2F1sv.d.mts +0 -145
  66. package/dist/drizzle-schema-BNhqj2AZ.d.mts +0 -1114
  67. package/dist/drizzle-schema-BNhqj2AZ.d.ts +0 -1114
  68. package/dist/enums-Dume-V5Y.d.mts +0 -16
  69. package/dist/enums-Dume-V5Y.d.ts +0 -16
  70. package/dist/i18n/index.d.mts +0 -417
  71. package/dist/i18n/index.d.ts +0 -417
  72. package/dist/imageCrop/index.d.mts +0 -165
  73. package/dist/imageCrop/index.d.ts +0 -165
  74. package/dist/index-DSel44Ke.d.mts +0 -93
  75. package/dist/index-DSel44Ke.d.ts +0 -93
  76. package/dist/index.d.mts +0 -693
  77. package/dist/index.d.ts +0 -693
  78. package/dist/logger/index.d.mts +0 -125
  79. package/dist/logger/index.d.ts +0 -125
  80. package/dist/mmd/admin/index.d.mts +0 -487
  81. package/dist/mmd/admin/index.d.ts +0 -487
  82. package/dist/mmd/index.d.mts +0 -599
  83. package/dist/mmd/index.d.ts +0 -599
  84. package/dist/mmd/server/index.d.mts +0 -138
  85. package/dist/mmd/server/index.d.ts +0 -138
  86. package/dist/music/index.d.mts +0 -74
  87. package/dist/music/index.d.ts +0 -74
  88. package/dist/music/server/index.d.mts +0 -1
  89. package/dist/music/server/index.d.ts +0 -1
  90. package/dist/request/index.d.mts +0 -51
  91. package/dist/request/index.d.ts +0 -51
  92. package/dist/storage/index.d.mts +0 -75
  93. package/dist/storage/index.d.ts +0 -75
  94. package/dist/testYourself/admin/index.d.mts +0 -58
  95. package/dist/testYourself/admin/index.d.ts +0 -58
  96. package/dist/testYourself/index.d.mts +0 -53
  97. package/dist/testYourself/index.d.ts +0 -53
  98. package/dist/testYourself/server/index.d.mts +0 -1029
  99. package/dist/testYourself/server/index.d.ts +0 -1029
  100. package/dist/types-B60F7EZZ.d.mts +0 -248
  101. package/dist/types-B60F7EZZ.d.ts +0 -248
  102. package/dist/types-BINlP9MK.d.mts +0 -286
  103. package/dist/types-BINlP9MK.d.ts +0 -286
  104. package/dist/types-BaZccpvk.d.mts +0 -48
  105. package/dist/types-BaZccpvk.d.ts +0 -48
  106. package/dist/types-CK4We_aI.d.mts +0 -270
  107. package/dist/types-CK4We_aI.d.ts +0 -270
  108. package/dist/types-CbTsi9CZ.d.mts +0 -31
  109. package/dist/types-CbTsi9CZ.d.ts +0 -31
  110. package/dist/types-CroexXnI.d.ts +0 -99
  111. package/dist/types-DmsXCWvm.d.mts +0 -99
  112. package/dist/types-Dt0oqeFM.d.mts +0 -70
  113. package/dist/types-zK6kDzDQ.d.ts +0 -70
  114. package/dist/universalExport/index.d.mts +0 -235
  115. package/dist/universalExport/index.d.ts +0 -235
  116. package/dist/universalExport/server/index.d.mts +0 -1270
  117. package/dist/universalExport/server/index.d.ts +0 -1270
  118. package/dist/universalFile/index.d.mts +0 -480
  119. package/dist/universalFile/index.d.ts +0 -480
  120. package/dist/universalFile/server/index.d.mts +0 -4516
  121. package/dist/universalFile/server/index.d.ts +0 -4516
  122. package/dist/useElectronStorage-Dj0rcorG.d.mts +0 -65
  123. package/dist/useElectronStorage-DwnNfIhl.d.ts +0 -65
  124. package/dist/utils/index.d.mts +0 -192
  125. package/dist/utils/index.d.ts +0 -192
@@ -1,99 +0,0 @@
1
- import { U as UserRole } from './enums-Dume-V5Y.mjs';
2
-
3
- /**
4
- * Auth 模块类型定义
5
- * Auth Module Types
6
- */
7
-
8
- /**
9
- * 用户基础信息(核心字段)
10
- * Base User Information
11
- */
12
- interface BaseUser {
13
- id: string;
14
- email: string;
15
- username: string;
16
- role: UserRole;
17
- }
18
- /**
19
- * 扩展用户信息(可选字段)
20
- * Extended User Information
21
- */
22
- interface User extends BaseUser {
23
- nickname?: string;
24
- avatar?: string;
25
- createdAt?: string;
26
- updatedAt?: string;
27
- [key: string]: any;
28
- }
29
- /**
30
- * 登录表单数据
31
- * Login Form Data
32
- */
33
- interface LoginForm {
34
- email: string;
35
- password: string;
36
- rememberMe?: boolean;
37
- }
38
- /**
39
- * 注册表单数据
40
- * Register Form Data
41
- */
42
- interface RegisterForm {
43
- email: string;
44
- username: string;
45
- password: string;
46
- confirmPassword?: string;
47
- nickname?: string;
48
- }
49
- /**
50
- * API 客户端基础接口
51
- */
52
- interface BaseApiClient {
53
- isAuthenticated(): Promise<boolean>;
54
- getCurrentUser(): Promise<{
55
- success: boolean;
56
- data?: User;
57
- error?: string;
58
- }>;
59
- login(email: string, password: string): Promise<{
60
- success: boolean;
61
- data?: {
62
- user: User;
63
- };
64
- error?: string;
65
- }>;
66
- register(email: string, password: string, username: string): Promise<{
67
- success: boolean;
68
- data?: {
69
- user: User;
70
- };
71
- error?: string;
72
- }>;
73
- logout(): Promise<void>;
74
- clearUserData(): Promise<void>;
75
- }
76
- /**
77
- * 认证操作结果接口
78
- */
79
- interface AuthResult {
80
- success: boolean;
81
- error?: string;
82
- }
83
- /**
84
- * useAuth Hook 返回值接口
85
- */
86
- interface UseAuthReturn {
87
- user: User | null;
88
- isLoggedIn: boolean;
89
- loading: boolean;
90
- checkingAuth: boolean;
91
- error: string | null;
92
- login: (email: string, password: string) => Promise<AuthResult>;
93
- register: (email: string, password: string, username: string) => Promise<AuthResult>;
94
- logout: () => Promise<void>;
95
- refresh: () => Promise<void>;
96
- clearError: () => void;
97
- }
98
-
99
- export type { AuthResult as A, BaseUser as B, LoginForm as L, RegisterForm as R, UseAuthReturn as U, User as a, BaseApiClient as b };
@@ -1,70 +0,0 @@
1
- import { User } from './auth/client/index.mjs';
2
-
3
- /**
4
- * Auth Components - Types
5
- * 组件类型定义
6
- */
7
-
8
- /**
9
- * 登录表单状态
10
- */
11
- interface LoginFormState {
12
- email: string;
13
- password: string;
14
- loading: boolean;
15
- error: string | null;
16
- handleEmailChange: (value: string) => void;
17
- handlePasswordChange: (value: string) => void;
18
- handleSubmit: (e?: React.FormEvent) => Promise<void>;
19
- }
20
- /**
21
- * 注册表单状态
22
- */
23
- interface RegisterFormState {
24
- email: string;
25
- password: string;
26
- username: string;
27
- loading: boolean;
28
- error: string | null;
29
- handleEmailChange: (value: string) => void;
30
- handlePasswordChange: (value: string) => void;
31
- handleUsernameChange: (value: string) => void;
32
- handleSubmit: (e?: React.FormEvent) => Promise<void>;
33
- }
34
- /**
35
- * 表单基础属性
36
- */
37
- interface BaseFormProps {
38
- /**
39
- * API 客户端实例
40
- */
41
- apiClient: any;
42
- /**
43
- * 成功回调
44
- */
45
- onSuccess?: (user: User) => void;
46
- /**
47
- * 错误回调
48
- */
49
- onError?: (error: string) => void;
50
- }
51
- /**
52
- * Headless 登录表单属性
53
- */
54
- interface HeadlessLoginFormProps extends BaseFormProps {
55
- /**
56
- * Render prop 函数
57
- */
58
- children: (state: LoginFormState) => React.ReactNode;
59
- }
60
- /**
61
- * Headless 注册表单属性
62
- */
63
- interface HeadlessRegisterFormProps extends BaseFormProps {
64
- /**
65
- * Render prop 函数
66
- */
67
- children: (state: RegisterFormState) => React.ReactNode;
68
- }
69
-
70
- export type { BaseFormProps as B, HeadlessLoginFormProps as H, LoginFormState as L, RegisterFormState as R, HeadlessRegisterFormProps as a };
@@ -1,70 +0,0 @@
1
- import { User } from './auth/client/index.js';
2
-
3
- /**
4
- * Auth Components - Types
5
- * 组件类型定义
6
- */
7
-
8
- /**
9
- * 登录表单状态
10
- */
11
- interface LoginFormState {
12
- email: string;
13
- password: string;
14
- loading: boolean;
15
- error: string | null;
16
- handleEmailChange: (value: string) => void;
17
- handlePasswordChange: (value: string) => void;
18
- handleSubmit: (e?: React.FormEvent) => Promise<void>;
19
- }
20
- /**
21
- * 注册表单状态
22
- */
23
- interface RegisterFormState {
24
- email: string;
25
- password: string;
26
- username: string;
27
- loading: boolean;
28
- error: string | null;
29
- handleEmailChange: (value: string) => void;
30
- handlePasswordChange: (value: string) => void;
31
- handleUsernameChange: (value: string) => void;
32
- handleSubmit: (e?: React.FormEvent) => Promise<void>;
33
- }
34
- /**
35
- * 表单基础属性
36
- */
37
- interface BaseFormProps {
38
- /**
39
- * API 客户端实例
40
- */
41
- apiClient: any;
42
- /**
43
- * 成功回调
44
- */
45
- onSuccess?: (user: User) => void;
46
- /**
47
- * 错误回调
48
- */
49
- onError?: (error: string) => void;
50
- }
51
- /**
52
- * Headless 登录表单属性
53
- */
54
- interface HeadlessLoginFormProps extends BaseFormProps {
55
- /**
56
- * Render prop 函数
57
- */
58
- children: (state: LoginFormState) => React.ReactNode;
59
- }
60
- /**
61
- * Headless 注册表单属性
62
- */
63
- interface HeadlessRegisterFormProps extends BaseFormProps {
64
- /**
65
- * Render prop 函数
66
- */
67
- children: (state: RegisterFormState) => React.ReactNode;
68
- }
69
-
70
- export type { BaseFormProps as B, HeadlessLoginFormProps as H, LoginFormState as L, RegisterFormState as R, HeadlessRegisterFormProps as a };
@@ -1,235 +0,0 @@
1
- import { E as ExportConfig, a as ExportRequest, b as ExportResult, c as ExportProgress, d as ExportFormat, F as Formatter } from '../types-BINlP9MK.mjs';
2
- export { D as DataTransformer, f as ExportConfigError, g as ExportDataError, r as ExportError, t as ExportEvent, u as ExportEventListener, s as ExportEventType, m as ExportField, h as ExportFileError, p as ExportFilter, e as ExportServiceError, q as ExportSort, k as ExportStatus, j as FieldAlignment, v as FieldMapper, i as FieldType, l as GroupValueProcessing, o as GroupingConfig, n as GroupingField, G as GroupingMode, U as UniversalExportServiceConfig, V as Validator } from '../types-BINlP9MK.mjs';
3
-
4
- /**
5
- * 通用导出服务客户端SDK
6
- *
7
- * 提供与后端API交互的客户端接口
8
- */
9
-
10
- interface UniversalExportClientConfig {
11
- /** API基础URL */
12
- baseUrl?: string;
13
- /** 请求超时时间(毫秒) */
14
- timeout?: number;
15
- /** 自定义请求头 */
16
- headers?: Record<string, string>;
17
- }
18
- /**
19
- * 通用导出服务客户端
20
- */
21
- declare class UniversalExportClient {
22
- private config;
23
- constructor(config?: UniversalExportClientConfig);
24
- /**
25
- * 获取模块的导出配置列表
26
- */
27
- getConfigsByModule(moduleId: string, businessId?: string): Promise<ExportConfig[]>;
28
- /**
29
- * 创建导出配置
30
- */
31
- createConfig(config: Omit<ExportConfig, 'id' | 'createdAt' | 'updatedAt'>): Promise<ExportConfig>;
32
- /**
33
- * 更新导出配置
34
- */
35
- updateConfig(configId: string, updates: Partial<ExportConfig>): Promise<ExportConfig>;
36
- /**
37
- * 删除导出配置
38
- */
39
- deleteConfig(configId: string): Promise<void>;
40
- /**
41
- * 触发数据导出
42
- */
43
- exportData(request: Omit<ExportRequest, 'callbacks'>): Promise<ExportResult>;
44
- /**
45
- * 查询导出进度
46
- */
47
- getExportProgress(exportId: string): Promise<ExportProgress>;
48
- /**
49
- * 下载导出文件
50
- */
51
- downloadExportFile(exportId: string): Promise<Blob>;
52
- /**
53
- * 获取请求头
54
- */
55
- private getHeaders;
56
- /**
57
- * 带超时的fetch请求
58
- */
59
- private fetchWithTimeout;
60
- /**
61
- * 转换API返回的配置数据
62
- */
63
- private transformConfigFromAPI;
64
- /**
65
- * 转换API返回的配置列表
66
- */
67
- private transformConfigsFromAPI;
68
- /**
69
- * 转换API返回的导出结果
70
- */
71
- private transformExportResultFromAPI;
72
- /**
73
- * 转换API返回的进度数据
74
- */
75
- private transformProgressFromAPI;
76
- }
77
- /**
78
- * 默认客户端实例
79
- */
80
- declare const universalExportClient: UniversalExportClient;
81
- /**
82
- * 创建自定义客户端实例
83
- */
84
- declare function createExportClient(config?: UniversalExportClientConfig): UniversalExportClient;
85
-
86
- /**
87
- * 通用导出服务常量定义
88
- */
89
-
90
- /** 模块版本 */
91
- declare const UNIVERSAL_EXPORT_VERSION = "1.0.0";
92
- /** 模块名称 */
93
- declare const UNIVERSAL_EXPORT_NAME = "@lyricnote/universal-export";
94
- /** 默认导出格式 */
95
- declare const DEFAULT_EXPORT_FORMAT: ExportFormat;
96
- /** 默认CSV分隔符 */
97
- declare const DEFAULT_CSV_DELIMITER = ",";
98
- /** 默认编码格式 */
99
- declare const DEFAULT_ENCODING = "utf-8";
100
- /** 默认是否添加BOM */
101
- declare const DEFAULT_ADD_BOM = true;
102
- /** 默认最大文件大小(字节) - 100MB */
103
- declare const DEFAULT_MAX_FILE_SIZE: number;
104
- /** 默认最大行数限制 */
105
- declare const DEFAULT_MAX_ROWS = 100000;
106
- /** 默认并发导出数量 */
107
- declare const DEFAULT_MAX_CONCURRENT_EXPORTS = 5;
108
- /** 默认导出超时时间(毫秒) - 5分钟 */
109
- declare const DEFAULT_EXPORT_TIMEOUT = 300000;
110
- /** 默认配置缓存TTL(秒) - 1小时 */
111
- declare const DEFAULT_CONFIG_CACHE_TTL = 3600;
112
- /** 默认结果缓存TTL(秒) - 30分钟 */
113
- declare const DEFAULT_RESULT_CACHE_TTL = 1800;
114
- /** 导出格式对应的文件扩展名 */
115
- declare const EXPORT_FORMAT_EXTENSIONS: Record<ExportFormat, string>;
116
- /** 导出格式对应的MIME类型 */
117
- declare const EXPORT_FORMAT_MIME_TYPES: Record<ExportFormat, string>;
118
- /** API基础路径 */
119
- declare const API_BASE_PATH = "/api/universal-export";
120
- /** API端点 */
121
- declare const API_ENDPOINTS: {
122
- /** 获取配置列表 */
123
- readonly GET_CONFIGS: "/api/universal-export/configs";
124
- /** 创建配置 */
125
- readonly CREATE_CONFIG: "/api/universal-export/configs";
126
- /** 更新配置 */
127
- readonly UPDATE_CONFIG: (configId: string) => string;
128
- /** 删除配置 */
129
- readonly DELETE_CONFIG: (configId: string) => string;
130
- /** 触发导出 */
131
- readonly EXPORT_DATA: "/api/universal-export/export";
132
- /** 查询导出进度 */
133
- readonly GET_PROGRESS: (exportId: string) => string;
134
- /** 下载导出文件 */
135
- readonly DOWNLOAD_FILE: (exportId: string) => string;
136
- };
137
- /** 错误代码 */
138
- declare const ERROR_CODES: {
139
- /** 导出配置错误 */
140
- readonly EXPORT_CONFIG_ERROR: "EXPORT_CONFIG_ERROR";
141
- /** 导出数据错误 */
142
- readonly EXPORT_DATA_ERROR: "EXPORT_DATA_ERROR";
143
- /** 导出文件错误 */
144
- readonly EXPORT_FILE_ERROR: "EXPORT_FILE_ERROR";
145
- /** 网络错误 */
146
- readonly NETWORK_ERROR: "NETWORK_ERROR";
147
- /** 超时错误 */
148
- readonly TIMEOUT_ERROR: "TIMEOUT_ERROR";
149
- /** 未授权 */
150
- readonly UNAUTHORIZED: "UNAUTHORIZED";
151
- /** 服务器错误 */
152
- readonly SERVER_ERROR: "SERVER_ERROR";
153
- };
154
-
155
- /**
156
- * 通用导出服务工具函数
157
- */
158
-
159
- /**
160
- * 生成导出文件名
161
- */
162
- declare function generateExportFileName(template: string, format: ExportFormat): string;
163
- /**
164
- * 验证文件名是否合法
165
- */
166
- declare function validateFileName(fileName: string): boolean;
167
- /**
168
- * 清理文件名,移除非法字符
169
- */
170
- declare function sanitizeFileName(fileName: string): string;
171
- /**
172
- * 转义CSV字段
173
- */
174
- declare function escapeCSVField(value: string, delimiter?: string): string;
175
- /**
176
- * 解析CSV字段
177
- */
178
- declare function parseCSVField(field: string): string;
179
- /**
180
- * 内置格式化器集合
181
- */
182
- declare const DEFAULT_FORMATTERS: Record<string, Formatter>;
183
- /**
184
- * 应用格式化器
185
- */
186
- declare function applyFormatter(value: any, formatter?: Formatter, type?: string): string;
187
- /**
188
- * 验证导出配置
189
- */
190
- declare function validateExportConfig(config: any): {
191
- valid: boolean;
192
- errors: string[];
193
- };
194
- /**
195
- * 验证导出请求
196
- */
197
- declare function validateExportRequest(request: any): {
198
- valid: boolean;
199
- errors: string[];
200
- };
201
- /**
202
- * 格式化文件大小
203
- */
204
- declare function formatFileSize(bytes: number): string;
205
- /**
206
- * 格式化持续时间
207
- */
208
- declare function formatDuration(milliseconds: number): string;
209
- /**
210
- * 计算预计完成时间
211
- */
212
- declare function estimateEndTime(startTime: Date, processedRows: number, totalRows: number): Date | undefined;
213
- /**
214
- * 获取嵌套对象的值
215
- */
216
- declare function getNestedValue(obj: any, path: string): any;
217
- /**
218
- * 设置嵌套对象的值
219
- */
220
- declare function setNestedValue(obj: any, path: string, value: any): void;
221
- /**
222
- * 创建导出错误对象
223
- */
224
- declare function createExportError(code: string, message: string, details?: Record<string, any>): {
225
- code: string;
226
- message: string;
227
- details?: Record<string, any>;
228
- timestamp: Date;
229
- };
230
- /**
231
- * 格式化错误消息
232
- */
233
- declare function formatErrorMessage(error: unknown): string;
234
-
235
- export { API_BASE_PATH, API_ENDPOINTS, DEFAULT_ADD_BOM, DEFAULT_CONFIG_CACHE_TTL, DEFAULT_CSV_DELIMITER, DEFAULT_ENCODING, DEFAULT_EXPORT_FORMAT, DEFAULT_EXPORT_TIMEOUT, DEFAULT_FORMATTERS, DEFAULT_MAX_CONCURRENT_EXPORTS, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_ROWS, DEFAULT_RESULT_CACHE_TTL, ERROR_CODES, EXPORT_FORMAT_EXTENSIONS, EXPORT_FORMAT_MIME_TYPES, ExportConfig, ExportFormat, ExportProgress, ExportRequest, ExportResult, Formatter, UNIVERSAL_EXPORT_NAME, UNIVERSAL_EXPORT_VERSION, UniversalExportClient, type UniversalExportClientConfig, applyFormatter, createExportClient, createExportError, escapeCSVField, estimateEndTime, formatDuration, formatErrorMessage, formatFileSize, generateExportFileName, getNestedValue, parseCSVField, sanitizeFileName, setNestedValue, universalExportClient, validateExportConfig, validateExportRequest, validateFileName };
@@ -1,235 +0,0 @@
1
- import { E as ExportConfig, a as ExportRequest, b as ExportResult, c as ExportProgress, d as ExportFormat, F as Formatter } from '../types-BINlP9MK.js';
2
- export { D as DataTransformer, f as ExportConfigError, g as ExportDataError, r as ExportError, t as ExportEvent, u as ExportEventListener, s as ExportEventType, m as ExportField, h as ExportFileError, p as ExportFilter, e as ExportServiceError, q as ExportSort, k as ExportStatus, j as FieldAlignment, v as FieldMapper, i as FieldType, l as GroupValueProcessing, o as GroupingConfig, n as GroupingField, G as GroupingMode, U as UniversalExportServiceConfig, V as Validator } from '../types-BINlP9MK.js';
3
-
4
- /**
5
- * 通用导出服务客户端SDK
6
- *
7
- * 提供与后端API交互的客户端接口
8
- */
9
-
10
- interface UniversalExportClientConfig {
11
- /** API基础URL */
12
- baseUrl?: string;
13
- /** 请求超时时间(毫秒) */
14
- timeout?: number;
15
- /** 自定义请求头 */
16
- headers?: Record<string, string>;
17
- }
18
- /**
19
- * 通用导出服务客户端
20
- */
21
- declare class UniversalExportClient {
22
- private config;
23
- constructor(config?: UniversalExportClientConfig);
24
- /**
25
- * 获取模块的导出配置列表
26
- */
27
- getConfigsByModule(moduleId: string, businessId?: string): Promise<ExportConfig[]>;
28
- /**
29
- * 创建导出配置
30
- */
31
- createConfig(config: Omit<ExportConfig, 'id' | 'createdAt' | 'updatedAt'>): Promise<ExportConfig>;
32
- /**
33
- * 更新导出配置
34
- */
35
- updateConfig(configId: string, updates: Partial<ExportConfig>): Promise<ExportConfig>;
36
- /**
37
- * 删除导出配置
38
- */
39
- deleteConfig(configId: string): Promise<void>;
40
- /**
41
- * 触发数据导出
42
- */
43
- exportData(request: Omit<ExportRequest, 'callbacks'>): Promise<ExportResult>;
44
- /**
45
- * 查询导出进度
46
- */
47
- getExportProgress(exportId: string): Promise<ExportProgress>;
48
- /**
49
- * 下载导出文件
50
- */
51
- downloadExportFile(exportId: string): Promise<Blob>;
52
- /**
53
- * 获取请求头
54
- */
55
- private getHeaders;
56
- /**
57
- * 带超时的fetch请求
58
- */
59
- private fetchWithTimeout;
60
- /**
61
- * 转换API返回的配置数据
62
- */
63
- private transformConfigFromAPI;
64
- /**
65
- * 转换API返回的配置列表
66
- */
67
- private transformConfigsFromAPI;
68
- /**
69
- * 转换API返回的导出结果
70
- */
71
- private transformExportResultFromAPI;
72
- /**
73
- * 转换API返回的进度数据
74
- */
75
- private transformProgressFromAPI;
76
- }
77
- /**
78
- * 默认客户端实例
79
- */
80
- declare const universalExportClient: UniversalExportClient;
81
- /**
82
- * 创建自定义客户端实例
83
- */
84
- declare function createExportClient(config?: UniversalExportClientConfig): UniversalExportClient;
85
-
86
- /**
87
- * 通用导出服务常量定义
88
- */
89
-
90
- /** 模块版本 */
91
- declare const UNIVERSAL_EXPORT_VERSION = "1.0.0";
92
- /** 模块名称 */
93
- declare const UNIVERSAL_EXPORT_NAME = "@lyricnote/universal-export";
94
- /** 默认导出格式 */
95
- declare const DEFAULT_EXPORT_FORMAT: ExportFormat;
96
- /** 默认CSV分隔符 */
97
- declare const DEFAULT_CSV_DELIMITER = ",";
98
- /** 默认编码格式 */
99
- declare const DEFAULT_ENCODING = "utf-8";
100
- /** 默认是否添加BOM */
101
- declare const DEFAULT_ADD_BOM = true;
102
- /** 默认最大文件大小(字节) - 100MB */
103
- declare const DEFAULT_MAX_FILE_SIZE: number;
104
- /** 默认最大行数限制 */
105
- declare const DEFAULT_MAX_ROWS = 100000;
106
- /** 默认并发导出数量 */
107
- declare const DEFAULT_MAX_CONCURRENT_EXPORTS = 5;
108
- /** 默认导出超时时间(毫秒) - 5分钟 */
109
- declare const DEFAULT_EXPORT_TIMEOUT = 300000;
110
- /** 默认配置缓存TTL(秒) - 1小时 */
111
- declare const DEFAULT_CONFIG_CACHE_TTL = 3600;
112
- /** 默认结果缓存TTL(秒) - 30分钟 */
113
- declare const DEFAULT_RESULT_CACHE_TTL = 1800;
114
- /** 导出格式对应的文件扩展名 */
115
- declare const EXPORT_FORMAT_EXTENSIONS: Record<ExportFormat, string>;
116
- /** 导出格式对应的MIME类型 */
117
- declare const EXPORT_FORMAT_MIME_TYPES: Record<ExportFormat, string>;
118
- /** API基础路径 */
119
- declare const API_BASE_PATH = "/api/universal-export";
120
- /** API端点 */
121
- declare const API_ENDPOINTS: {
122
- /** 获取配置列表 */
123
- readonly GET_CONFIGS: "/api/universal-export/configs";
124
- /** 创建配置 */
125
- readonly CREATE_CONFIG: "/api/universal-export/configs";
126
- /** 更新配置 */
127
- readonly UPDATE_CONFIG: (configId: string) => string;
128
- /** 删除配置 */
129
- readonly DELETE_CONFIG: (configId: string) => string;
130
- /** 触发导出 */
131
- readonly EXPORT_DATA: "/api/universal-export/export";
132
- /** 查询导出进度 */
133
- readonly GET_PROGRESS: (exportId: string) => string;
134
- /** 下载导出文件 */
135
- readonly DOWNLOAD_FILE: (exportId: string) => string;
136
- };
137
- /** 错误代码 */
138
- declare const ERROR_CODES: {
139
- /** 导出配置错误 */
140
- readonly EXPORT_CONFIG_ERROR: "EXPORT_CONFIG_ERROR";
141
- /** 导出数据错误 */
142
- readonly EXPORT_DATA_ERROR: "EXPORT_DATA_ERROR";
143
- /** 导出文件错误 */
144
- readonly EXPORT_FILE_ERROR: "EXPORT_FILE_ERROR";
145
- /** 网络错误 */
146
- readonly NETWORK_ERROR: "NETWORK_ERROR";
147
- /** 超时错误 */
148
- readonly TIMEOUT_ERROR: "TIMEOUT_ERROR";
149
- /** 未授权 */
150
- readonly UNAUTHORIZED: "UNAUTHORIZED";
151
- /** 服务器错误 */
152
- readonly SERVER_ERROR: "SERVER_ERROR";
153
- };
154
-
155
- /**
156
- * 通用导出服务工具函数
157
- */
158
-
159
- /**
160
- * 生成导出文件名
161
- */
162
- declare function generateExportFileName(template: string, format: ExportFormat): string;
163
- /**
164
- * 验证文件名是否合法
165
- */
166
- declare function validateFileName(fileName: string): boolean;
167
- /**
168
- * 清理文件名,移除非法字符
169
- */
170
- declare function sanitizeFileName(fileName: string): string;
171
- /**
172
- * 转义CSV字段
173
- */
174
- declare function escapeCSVField(value: string, delimiter?: string): string;
175
- /**
176
- * 解析CSV字段
177
- */
178
- declare function parseCSVField(field: string): string;
179
- /**
180
- * 内置格式化器集合
181
- */
182
- declare const DEFAULT_FORMATTERS: Record<string, Formatter>;
183
- /**
184
- * 应用格式化器
185
- */
186
- declare function applyFormatter(value: any, formatter?: Formatter, type?: string): string;
187
- /**
188
- * 验证导出配置
189
- */
190
- declare function validateExportConfig(config: any): {
191
- valid: boolean;
192
- errors: string[];
193
- };
194
- /**
195
- * 验证导出请求
196
- */
197
- declare function validateExportRequest(request: any): {
198
- valid: boolean;
199
- errors: string[];
200
- };
201
- /**
202
- * 格式化文件大小
203
- */
204
- declare function formatFileSize(bytes: number): string;
205
- /**
206
- * 格式化持续时间
207
- */
208
- declare function formatDuration(milliseconds: number): string;
209
- /**
210
- * 计算预计完成时间
211
- */
212
- declare function estimateEndTime(startTime: Date, processedRows: number, totalRows: number): Date | undefined;
213
- /**
214
- * 获取嵌套对象的值
215
- */
216
- declare function getNestedValue(obj: any, path: string): any;
217
- /**
218
- * 设置嵌套对象的值
219
- */
220
- declare function setNestedValue(obj: any, path: string, value: any): void;
221
- /**
222
- * 创建导出错误对象
223
- */
224
- declare function createExportError(code: string, message: string, details?: Record<string, any>): {
225
- code: string;
226
- message: string;
227
- details?: Record<string, any>;
228
- timestamp: Date;
229
- };
230
- /**
231
- * 格式化错误消息
232
- */
233
- declare function formatErrorMessage(error: unknown): string;
234
-
235
- export { API_BASE_PATH, API_ENDPOINTS, DEFAULT_ADD_BOM, DEFAULT_CONFIG_CACHE_TTL, DEFAULT_CSV_DELIMITER, DEFAULT_ENCODING, DEFAULT_EXPORT_FORMAT, DEFAULT_EXPORT_TIMEOUT, DEFAULT_FORMATTERS, DEFAULT_MAX_CONCURRENT_EXPORTS, DEFAULT_MAX_FILE_SIZE, DEFAULT_MAX_ROWS, DEFAULT_RESULT_CACHE_TTL, ERROR_CODES, EXPORT_FORMAT_EXTENSIONS, EXPORT_FORMAT_MIME_TYPES, ExportConfig, ExportFormat, ExportProgress, ExportRequest, ExportResult, Formatter, UNIVERSAL_EXPORT_NAME, UNIVERSAL_EXPORT_VERSION, UniversalExportClient, type UniversalExportClientConfig, applyFormatter, createExportClient, createExportError, escapeCSVField, estimateEndTime, formatDuration, formatErrorMessage, formatFileSize, generateExportFileName, getNestedValue, parseCSVField, sanitizeFileName, setNestedValue, universalExportClient, validateExportConfig, validateExportRequest, validateFileName };