@movk/nuxt 1.0.0 → 1.1.0
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.
- package/dist/module.d.mts +11 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +56 -13
- package/dist/runtime/components/AutoForm.vue +1 -0
- package/dist/runtime/components/SlideVerify.d.vue.ts +107 -0
- package/dist/runtime/components/SlideVerify.vue +147 -0
- package/dist/runtime/components/SlideVerify.vue.d.ts +107 -0
- package/dist/runtime/components/StarRating.vue +1 -0
- package/dist/runtime/components/auto-form-renderer/AutoFormRendererArray.vue +1 -1
- package/dist/runtime/components/theme-picker/ThemePicker.d.vue.ts +3 -0
- package/dist/runtime/components/theme-picker/ThemePicker.vue +235 -0
- package/dist/runtime/components/theme-picker/ThemePicker.vue.d.ts +3 -0
- package/dist/runtime/components/theme-picker/ThemePickerButton.d.vue.ts +18 -0
- package/dist/runtime/components/theme-picker/ThemePickerButton.vue +34 -0
- package/dist/runtime/components/theme-picker/ThemePickerButton.vue.d.ts +18 -0
- package/dist/runtime/composables/useApiFetch.js +1 -3
- package/dist/runtime/composables/useAutoForm.d.ts +81 -1425
- package/dist/runtime/composables/useAutoForm.js +3 -1
- package/dist/runtime/composables/useTheme.d.ts +21 -0
- package/dist/runtime/composables/useTheme.js +143 -0
- package/dist/runtime/composables/useUploadWithProgress.js +2 -2
- package/dist/runtime/internal/useAutoFormProvider.js +2 -2
- package/dist/runtime/plugins/api.factory.js +28 -30
- package/dist/runtime/plugins/theme.d.ts +2 -0
- package/dist/runtime/plugins/theme.js +89 -0
- package/dist/runtime/schemas/api.d.ts +336 -100
- package/dist/runtime/schemas/api.js +114 -98
- package/dist/runtime/style.css +1 -0
- package/dist/runtime/types/api.d.ts +108 -108
- package/dist/runtime/types/api.js +0 -8
- package/dist/runtime/utils/api-utils.d.ts +45 -30
- package/package.json +19 -19
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* API 响应配置 Schema
|
|
4
|
+
* @description 定义业务状态码判断规则和数据/消息字段的映射关系
|
|
4
5
|
*/
|
|
5
|
-
export declare const
|
|
6
|
+
export declare const apiResponseConfigSchema: z.ZodObject<{
|
|
6
7
|
successCodes: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
7
8
|
codeKey: z.ZodDefault<z.ZodString>;
|
|
8
9
|
messageKey: z.ZodDefault<z.ZodString>;
|
|
9
10
|
dataKey: z.ZodDefault<z.ZodString>;
|
|
10
11
|
}, z.core.$strip>;
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
13
|
+
* 401 未授权处理配置 Schema
|
|
14
|
+
* @description 定义当接收到 401 响应时的自动处理行为
|
|
14
15
|
*/
|
|
15
|
-
export declare const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
userDataPath: z.ZodDefault<z.ZodString>;
|
|
20
|
-
sessionTokenPath: z.ZodDefault<z.ZodString>;
|
|
16
|
+
export declare const apiUnauthorizedConfigSchema: z.ZodObject<{
|
|
17
|
+
redirect: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
loginPath: z.ZodDefault<z.ZodString>;
|
|
19
|
+
clearSession: z.ZodDefault<z.ZodBoolean>;
|
|
21
20
|
}, z.core.$strip>;
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* API 认证配置 Schema
|
|
23
|
+
* @description 定义认证令牌的来源、格式和请求头配置
|
|
25
24
|
*/
|
|
26
25
|
export declare const apiAuthConfigSchema: z.ZodObject<{
|
|
27
26
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -37,52 +36,79 @@ export declare const apiAuthConfigSchema: z.ZodObject<{
|
|
|
37
36
|
}>>;
|
|
38
37
|
customTokenType: z.ZodOptional<z.ZodString>;
|
|
39
38
|
headerName: z.ZodDefault<z.ZodString>;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
unauthorized: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
redirect: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
loginPath: z.ZodDefault<z.ZodString>;
|
|
42
|
+
clearSession: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
43
44
|
}, z.core.$strip>;
|
|
44
45
|
/**
|
|
45
46
|
* Toast 提示配置 Schema
|
|
46
|
-
* @
|
|
47
|
+
* @description 定义成功和错误提示的全局样式和行为
|
|
47
48
|
*/
|
|
48
49
|
export declare const apiToastConfigSchema: z.ZodObject<{
|
|
50
|
+
/**
|
|
51
|
+
* 是否启用 Toast 提示
|
|
52
|
+
* @defaultValue true
|
|
53
|
+
*/
|
|
49
54
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
+
/** 成功提示配置 */
|
|
50
56
|
success: z.ZodOptional<z.ZodObject<{
|
|
51
57
|
show: z.ZodDefault<z.ZodBoolean>;
|
|
52
58
|
color: z.ZodDefault<z.ZodString>;
|
|
53
59
|
icon: z.ZodOptional<z.ZodString>;
|
|
54
60
|
duration: z.ZodDefault<z.ZodNumber>;
|
|
55
|
-
}, z.core.$
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
/** 错误提示配置 */
|
|
56
63
|
error: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
/**
|
|
65
|
+
* 是否显示错误提示
|
|
66
|
+
* @defaultValue true
|
|
67
|
+
*/
|
|
57
68
|
show: z.ZodDefault<z.ZodBoolean>;
|
|
69
|
+
/**
|
|
70
|
+
* 提示颜色
|
|
71
|
+
* @defaultValue 'error'
|
|
72
|
+
*/
|
|
58
73
|
color: z.ZodDefault<z.ZodString>;
|
|
74
|
+
/**
|
|
75
|
+
* 图标类名
|
|
76
|
+
* @defaultValue 'i-lucide-circle-x'
|
|
77
|
+
*/
|
|
59
78
|
icon: z.ZodOptional<z.ZodString>;
|
|
79
|
+
/**
|
|
80
|
+
* 显示时长(毫秒)
|
|
81
|
+
* @defaultValue 3000
|
|
82
|
+
*/
|
|
60
83
|
duration: z.ZodDefault<z.ZodNumber>;
|
|
61
84
|
}, z.core.$loose>>;
|
|
62
|
-
}, z.core.$
|
|
85
|
+
}, z.core.$loose>;
|
|
63
86
|
/**
|
|
64
|
-
*
|
|
87
|
+
* API 端点公共配置 Schema
|
|
88
|
+
* @description 定义单个 API 端点的配置(可在客户端访问的配置)
|
|
65
89
|
*/
|
|
66
|
-
export declare const
|
|
90
|
+
export declare const apiEndpointPublicConfigSchema: z.ZodObject<{
|
|
67
91
|
baseURL: z.ZodString;
|
|
68
92
|
alias: z.ZodOptional<z.ZodString>;
|
|
69
93
|
auth: z.ZodOptional<z.ZodObject<{
|
|
70
|
-
enabled: z.ZodOptional<z.
|
|
71
|
-
tokenSource: z.ZodOptional<z.
|
|
94
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
95
|
+
tokenSource: z.ZodOptional<z.ZodEnum<{
|
|
72
96
|
custom: "custom";
|
|
73
97
|
session: "session";
|
|
74
|
-
}
|
|
75
|
-
sessionTokenPath: z.ZodOptional<z.
|
|
76
|
-
tokenType: z.ZodOptional<z.
|
|
98
|
+
}>>;
|
|
99
|
+
sessionTokenPath: z.ZodOptional<z.ZodString>;
|
|
100
|
+
tokenType: z.ZodOptional<z.ZodEnum<{
|
|
77
101
|
Bearer: "Bearer";
|
|
78
102
|
Basic: "Basic";
|
|
79
103
|
Custom: "Custom";
|
|
80
|
-
}
|
|
81
|
-
customTokenType: z.ZodOptional<z.
|
|
82
|
-
headerName: z.ZodOptional<z.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
104
|
+
}>>;
|
|
105
|
+
customTokenType: z.ZodOptional<z.ZodString>;
|
|
106
|
+
headerName: z.ZodOptional<z.ZodString>;
|
|
107
|
+
unauthorized: z.ZodOptional<z.ZodObject<{
|
|
108
|
+
redirect: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
loginPath: z.ZodOptional<z.ZodString>;
|
|
110
|
+
clearSession: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
}, z.core.$strip>>;
|
|
86
112
|
}, z.core.$strip>>;
|
|
87
113
|
toast: z.ZodOptional<z.ZodObject<{
|
|
88
114
|
enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -91,48 +117,73 @@ export declare const apiEndpointConfigSchema: z.ZodObject<{
|
|
|
91
117
|
color: z.ZodDefault<z.ZodString>;
|
|
92
118
|
icon: z.ZodOptional<z.ZodString>;
|
|
93
119
|
duration: z.ZodDefault<z.ZodNumber>;
|
|
94
|
-
}, z.core.$
|
|
120
|
+
}, z.core.$strip>>>;
|
|
95
121
|
error: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
122
|
+
/**
|
|
123
|
+
* 是否显示错误提示
|
|
124
|
+
* @defaultValue true
|
|
125
|
+
*/
|
|
96
126
|
show: z.ZodDefault<z.ZodBoolean>;
|
|
127
|
+
/**
|
|
128
|
+
* 提示颜色
|
|
129
|
+
* @defaultValue 'error'
|
|
130
|
+
*/
|
|
97
131
|
color: z.ZodDefault<z.ZodString>;
|
|
132
|
+
/**
|
|
133
|
+
* 图标类名
|
|
134
|
+
* @defaultValue 'i-lucide-circle-x'
|
|
135
|
+
*/
|
|
98
136
|
icon: z.ZodOptional<z.ZodString>;
|
|
137
|
+
/**
|
|
138
|
+
* 显示时长(毫秒)
|
|
139
|
+
* @defaultValue 3000
|
|
140
|
+
*/
|
|
99
141
|
duration: z.ZodDefault<z.ZodNumber>;
|
|
100
142
|
}, z.core.$loose>>>;
|
|
101
|
-
}, z.core.$
|
|
102
|
-
|
|
143
|
+
}, z.core.$loose>>;
|
|
144
|
+
response: z.ZodOptional<z.ZodObject<{
|
|
103
145
|
successCodes: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>>;
|
|
104
146
|
codeKey: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
105
147
|
messageKey: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
106
148
|
dataKey: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
107
149
|
}, z.core.$strip>>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
/**
|
|
152
|
+
* API 端点私有配置 Schema
|
|
153
|
+
* @description 定义仅在服务端可访问的端点配置(不会暴露给客户端)
|
|
154
|
+
*/
|
|
155
|
+
export declare const apiEndpointPrivateConfigSchema: z.ZodObject<{
|
|
108
156
|
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
109
157
|
}, z.core.$strip>;
|
|
110
158
|
/**
|
|
111
|
-
* Movk API
|
|
159
|
+
* Movk API 模块公共配置 Schema
|
|
160
|
+
* @description 定义模块的全局配置(可在客户端访问)
|
|
112
161
|
*/
|
|
113
|
-
export declare const
|
|
114
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
162
|
+
export declare const movkApiPublicConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
115
163
|
defaultEndpoint: z.ZodDefault<z.ZodString>;
|
|
164
|
+
debug: z.ZodDefault<z.ZodBoolean>;
|
|
116
165
|
endpoints: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
117
166
|
baseURL: z.ZodString;
|
|
118
167
|
alias: z.ZodOptional<z.ZodString>;
|
|
119
168
|
auth: z.ZodOptional<z.ZodObject<{
|
|
120
|
-
enabled: z.ZodOptional<z.
|
|
121
|
-
tokenSource: z.ZodOptional<z.
|
|
169
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
tokenSource: z.ZodOptional<z.ZodEnum<{
|
|
122
171
|
custom: "custom";
|
|
123
172
|
session: "session";
|
|
124
|
-
}
|
|
125
|
-
sessionTokenPath: z.ZodOptional<z.
|
|
126
|
-
tokenType: z.ZodOptional<z.
|
|
173
|
+
}>>;
|
|
174
|
+
sessionTokenPath: z.ZodOptional<z.ZodString>;
|
|
175
|
+
tokenType: z.ZodOptional<z.ZodEnum<{
|
|
127
176
|
Bearer: "Bearer";
|
|
128
177
|
Basic: "Basic";
|
|
129
178
|
Custom: "Custom";
|
|
130
|
-
}
|
|
131
|
-
customTokenType: z.ZodOptional<z.
|
|
132
|
-
headerName: z.ZodOptional<z.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
179
|
+
}>>;
|
|
180
|
+
customTokenType: z.ZodOptional<z.ZodString>;
|
|
181
|
+
headerName: z.ZodOptional<z.ZodString>;
|
|
182
|
+
unauthorized: z.ZodOptional<z.ZodObject<{
|
|
183
|
+
redirect: z.ZodOptional<z.ZodBoolean>;
|
|
184
|
+
loginPath: z.ZodOptional<z.ZodString>;
|
|
185
|
+
clearSession: z.ZodOptional<z.ZodBoolean>;
|
|
186
|
+
}, z.core.$strip>>;
|
|
136
187
|
}, z.core.$strip>>;
|
|
137
188
|
toast: z.ZodOptional<z.ZodObject<{
|
|
138
189
|
enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
@@ -141,22 +192,43 @@ export declare const movkApiModuleOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
141
192
|
color: z.ZodDefault<z.ZodString>;
|
|
142
193
|
icon: z.ZodOptional<z.ZodString>;
|
|
143
194
|
duration: z.ZodDefault<z.ZodNumber>;
|
|
144
|
-
}, z.core.$
|
|
195
|
+
}, z.core.$strip>>>;
|
|
145
196
|
error: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
197
|
+
/**
|
|
198
|
+
* 是否显示错误提示
|
|
199
|
+
* @defaultValue true
|
|
200
|
+
*/
|
|
146
201
|
show: z.ZodDefault<z.ZodBoolean>;
|
|
202
|
+
/**
|
|
203
|
+
* 提示颜色
|
|
204
|
+
* @defaultValue 'error'
|
|
205
|
+
*/
|
|
147
206
|
color: z.ZodDefault<z.ZodString>;
|
|
207
|
+
/**
|
|
208
|
+
* 图标类名
|
|
209
|
+
* @defaultValue 'i-lucide-circle-x'
|
|
210
|
+
*/
|
|
148
211
|
icon: z.ZodOptional<z.ZodString>;
|
|
212
|
+
/**
|
|
213
|
+
* 显示时长(毫秒)
|
|
214
|
+
* @defaultValue 3000
|
|
215
|
+
*/
|
|
149
216
|
duration: z.ZodDefault<z.ZodNumber>;
|
|
150
217
|
}, z.core.$loose>>>;
|
|
151
|
-
}, z.core.$
|
|
152
|
-
|
|
218
|
+
}, z.core.$loose>>;
|
|
219
|
+
response: z.ZodOptional<z.ZodObject<{
|
|
153
220
|
successCodes: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>>;
|
|
154
221
|
codeKey: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
155
222
|
messageKey: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
156
223
|
dataKey: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
157
224
|
}, z.core.$strip>>;
|
|
158
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
159
225
|
}, z.core.$strip>>>;
|
|
226
|
+
response: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
successCodes: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
228
|
+
codeKey: z.ZodDefault<z.ZodString>;
|
|
229
|
+
messageKey: z.ZodDefault<z.ZodString>;
|
|
230
|
+
dataKey: z.ZodDefault<z.ZodString>;
|
|
231
|
+
}, z.core.$strip>>;
|
|
160
232
|
auth: z.ZodOptional<z.ZodObject<{
|
|
161
233
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
162
234
|
tokenSource: z.ZodDefault<z.ZodEnum<{
|
|
@@ -171,48 +243,73 @@ export declare const movkApiModuleOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
171
243
|
}>>;
|
|
172
244
|
customTokenType: z.ZodOptional<z.ZodString>;
|
|
173
245
|
headerName: z.ZodDefault<z.ZodString>;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
246
|
+
unauthorized: z.ZodOptional<z.ZodObject<{
|
|
247
|
+
redirect: z.ZodDefault<z.ZodBoolean>;
|
|
248
|
+
loginPath: z.ZodDefault<z.ZodString>;
|
|
249
|
+
clearSession: z.ZodDefault<z.ZodBoolean>;
|
|
250
|
+
}, z.core.$strip>>;
|
|
177
251
|
}, z.core.$strip>>;
|
|
178
252
|
toast: z.ZodOptional<z.ZodObject<{
|
|
253
|
+
/**
|
|
254
|
+
* 是否启用 Toast 提示
|
|
255
|
+
* @defaultValue true
|
|
256
|
+
*/
|
|
179
257
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
258
|
+
/** 成功提示配置 */
|
|
180
259
|
success: z.ZodOptional<z.ZodObject<{
|
|
181
260
|
show: z.ZodDefault<z.ZodBoolean>;
|
|
182
261
|
color: z.ZodDefault<z.ZodString>;
|
|
183
262
|
icon: z.ZodOptional<z.ZodString>;
|
|
184
263
|
duration: z.ZodDefault<z.ZodNumber>;
|
|
185
|
-
}, z.core.$
|
|
264
|
+
}, z.core.$strip>>;
|
|
265
|
+
/** 错误提示配置 */
|
|
186
266
|
error: z.ZodOptional<z.ZodObject<{
|
|
267
|
+
/**
|
|
268
|
+
* 是否显示错误提示
|
|
269
|
+
* @defaultValue true
|
|
270
|
+
*/
|
|
187
271
|
show: z.ZodDefault<z.ZodBoolean>;
|
|
272
|
+
/**
|
|
273
|
+
* 提示颜色
|
|
274
|
+
* @defaultValue 'error'
|
|
275
|
+
*/
|
|
188
276
|
color: z.ZodDefault<z.ZodString>;
|
|
277
|
+
/**
|
|
278
|
+
* 图标类名
|
|
279
|
+
* @defaultValue 'i-lucide-circle-x'
|
|
280
|
+
*/
|
|
189
281
|
icon: z.ZodOptional<z.ZodString>;
|
|
282
|
+
/**
|
|
283
|
+
* 显示时长(毫秒)
|
|
284
|
+
* @defaultValue 3000
|
|
285
|
+
*/
|
|
190
286
|
duration: z.ZodDefault<z.ZodNumber>;
|
|
191
287
|
}, z.core.$loose>>;
|
|
192
|
-
}, z.core.$
|
|
193
|
-
success: z.ZodOptional<z.ZodObject<{
|
|
194
|
-
successCodes: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
195
|
-
codeKey: z.ZodDefault<z.ZodString>;
|
|
196
|
-
messageKey: z.ZodDefault<z.ZodString>;
|
|
197
|
-
dataKey: z.ZodDefault<z.ZodString>;
|
|
198
|
-
}, z.core.$strip>>;
|
|
199
|
-
debug: z.ZodDefault<z.ZodBoolean>;
|
|
288
|
+
}, z.core.$loose>>;
|
|
200
289
|
}, z.core.$strip>, z.ZodTransform<{
|
|
290
|
+
response: {
|
|
291
|
+
successCodes: (string | number)[];
|
|
292
|
+
codeKey: string;
|
|
293
|
+
messageKey: string;
|
|
294
|
+
dataKey: string;
|
|
295
|
+
};
|
|
201
296
|
auth: {
|
|
202
297
|
enabled: boolean;
|
|
203
298
|
tokenSource: "custom" | "session";
|
|
204
299
|
sessionTokenPath: string;
|
|
205
300
|
tokenType: "Bearer" | "Basic" | "Custom";
|
|
206
301
|
headerName: string;
|
|
207
|
-
redirectOnUnauthorized: boolean;
|
|
208
|
-
loginPath: string;
|
|
209
|
-
clearSessionOnUnauthorized: boolean;
|
|
210
302
|
customTokenType?: string | undefined;
|
|
303
|
+
unauthorized?: {
|
|
304
|
+
redirect: boolean;
|
|
305
|
+
loginPath: string;
|
|
306
|
+
clearSession: boolean;
|
|
307
|
+
} | undefined;
|
|
211
308
|
};
|
|
212
309
|
toast: {
|
|
310
|
+
[x: string]: unknown;
|
|
213
311
|
enabled: boolean;
|
|
214
312
|
success?: {
|
|
215
|
-
[x: string]: unknown;
|
|
216
313
|
show: boolean;
|
|
217
314
|
color: string;
|
|
218
315
|
duration: number;
|
|
@@ -226,14 +323,8 @@ export declare const movkApiModuleOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
226
323
|
icon?: string | undefined;
|
|
227
324
|
} | undefined;
|
|
228
325
|
};
|
|
229
|
-
success: {
|
|
230
|
-
successCodes: (string | number)[];
|
|
231
|
-
codeKey: string;
|
|
232
|
-
messageKey: string;
|
|
233
|
-
dataKey: string;
|
|
234
|
-
};
|
|
235
|
-
enabled: boolean;
|
|
236
326
|
defaultEndpoint: string;
|
|
327
|
+
debug: boolean;
|
|
237
328
|
endpoints: Record<string, {
|
|
238
329
|
baseURL: string;
|
|
239
330
|
alias?: string | undefined;
|
|
@@ -244,14 +335,16 @@ export declare const movkApiModuleOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
244
335
|
tokenType?: "Bearer" | "Basic" | "Custom" | undefined;
|
|
245
336
|
customTokenType?: string | undefined;
|
|
246
337
|
headerName?: string | undefined;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
338
|
+
unauthorized?: {
|
|
339
|
+
redirect?: boolean | undefined;
|
|
340
|
+
loginPath?: string | undefined;
|
|
341
|
+
clearSession?: boolean | undefined;
|
|
342
|
+
} | undefined;
|
|
250
343
|
} | undefined;
|
|
251
344
|
toast?: {
|
|
345
|
+
[x: string]: unknown;
|
|
252
346
|
enabled?: boolean | undefined;
|
|
253
347
|
success?: {
|
|
254
|
-
[x: string]: unknown;
|
|
255
348
|
show: boolean;
|
|
256
349
|
color: string;
|
|
257
350
|
duration: number;
|
|
@@ -265,18 +358,16 @@ export declare const movkApiModuleOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
265
358
|
icon?: string | undefined;
|
|
266
359
|
} | undefined;
|
|
267
360
|
} | undefined;
|
|
268
|
-
|
|
361
|
+
response?: {
|
|
269
362
|
successCodes?: (string | number)[] | undefined;
|
|
270
363
|
codeKey?: string | undefined;
|
|
271
364
|
messageKey?: string | undefined;
|
|
272
365
|
dataKey?: string | undefined;
|
|
273
366
|
} | undefined;
|
|
274
|
-
headers?: Record<string, string> | undefined;
|
|
275
367
|
}>;
|
|
276
|
-
debug: boolean;
|
|
277
368
|
}, {
|
|
278
|
-
enabled: boolean;
|
|
279
369
|
defaultEndpoint: string;
|
|
370
|
+
debug: boolean;
|
|
280
371
|
endpoints: Record<string, {
|
|
281
372
|
baseURL: string;
|
|
282
373
|
alias?: string | undefined;
|
|
@@ -287,14 +378,16 @@ export declare const movkApiModuleOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
287
378
|
tokenType?: "Bearer" | "Basic" | "Custom" | undefined;
|
|
288
379
|
customTokenType?: string | undefined;
|
|
289
380
|
headerName?: string | undefined;
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
381
|
+
unauthorized?: {
|
|
382
|
+
redirect?: boolean | undefined;
|
|
383
|
+
loginPath?: string | undefined;
|
|
384
|
+
clearSession?: boolean | undefined;
|
|
385
|
+
} | undefined;
|
|
293
386
|
} | undefined;
|
|
294
387
|
toast?: {
|
|
388
|
+
[x: string]: unknown;
|
|
295
389
|
enabled?: boolean | undefined;
|
|
296
390
|
success?: {
|
|
297
|
-
[x: string]: unknown;
|
|
298
391
|
show: boolean;
|
|
299
392
|
color: string;
|
|
300
393
|
duration: number;
|
|
@@ -308,30 +401,36 @@ export declare const movkApiModuleOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
308
401
|
icon?: string | undefined;
|
|
309
402
|
} | undefined;
|
|
310
403
|
} | undefined;
|
|
311
|
-
|
|
404
|
+
response?: {
|
|
312
405
|
successCodes?: (string | number)[] | undefined;
|
|
313
406
|
codeKey?: string | undefined;
|
|
314
407
|
messageKey?: string | undefined;
|
|
315
408
|
dataKey?: string | undefined;
|
|
316
409
|
} | undefined;
|
|
317
|
-
headers?: Record<string, string> | undefined;
|
|
318
410
|
}>;
|
|
319
|
-
|
|
411
|
+
response?: {
|
|
412
|
+
successCodes: (string | number)[];
|
|
413
|
+
codeKey: string;
|
|
414
|
+
messageKey: string;
|
|
415
|
+
dataKey: string;
|
|
416
|
+
} | undefined;
|
|
320
417
|
auth?: {
|
|
321
418
|
enabled: boolean;
|
|
322
419
|
tokenSource: "custom" | "session";
|
|
323
420
|
sessionTokenPath: string;
|
|
324
421
|
tokenType: "Bearer" | "Basic" | "Custom";
|
|
325
422
|
headerName: string;
|
|
326
|
-
redirectOnUnauthorized: boolean;
|
|
327
|
-
loginPath: string;
|
|
328
|
-
clearSessionOnUnauthorized: boolean;
|
|
329
423
|
customTokenType?: string | undefined;
|
|
424
|
+
unauthorized?: {
|
|
425
|
+
redirect: boolean;
|
|
426
|
+
loginPath: string;
|
|
427
|
+
clearSession: boolean;
|
|
428
|
+
} | undefined;
|
|
330
429
|
} | undefined;
|
|
331
430
|
toast?: {
|
|
431
|
+
[x: string]: unknown;
|
|
332
432
|
enabled: boolean;
|
|
333
433
|
success?: {
|
|
334
|
-
[x: string]: unknown;
|
|
335
434
|
show: boolean;
|
|
336
435
|
color: string;
|
|
337
436
|
duration: number;
|
|
@@ -345,10 +444,147 @@ export declare const movkApiModuleOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
345
444
|
icon?: string | undefined;
|
|
346
445
|
} | undefined;
|
|
347
446
|
} | undefined;
|
|
348
|
-
success?: {
|
|
349
|
-
successCodes: (string | number)[];
|
|
350
|
-
codeKey: string;
|
|
351
|
-
messageKey: string;
|
|
352
|
-
dataKey: string;
|
|
353
|
-
} | undefined;
|
|
354
447
|
}>>;
|
|
448
|
+
/**
|
|
449
|
+
* Movk API 模块私有配置 Schema
|
|
450
|
+
* @description 定义模块的私有配置(仅服务端可访问,不会暴露给客户端)
|
|
451
|
+
*/
|
|
452
|
+
export declare const movkApiPrivateConfigSchema: z.ZodObject<{
|
|
453
|
+
endpoints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
454
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
455
|
+
}, z.core.$strip>>>;
|
|
456
|
+
}, z.core.$strip>;
|
|
457
|
+
/**
|
|
458
|
+
* Movk API 模块完整配置 Schema
|
|
459
|
+
* @description 定义模块的完整配置(公共+私有),用于模块初始化时的配置验证
|
|
460
|
+
*/
|
|
461
|
+
export declare const movkApiFullConfigSchema: z.ZodObject<{
|
|
462
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
463
|
+
defaultEndpoint: z.ZodDefault<z.ZodString>;
|
|
464
|
+
debug: z.ZodDefault<z.ZodBoolean>;
|
|
465
|
+
endpoints: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
466
|
+
baseURL: z.ZodString;
|
|
467
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
468
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
469
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
470
|
+
tokenSource: z.ZodOptional<z.ZodEnum<{
|
|
471
|
+
custom: "custom";
|
|
472
|
+
session: "session";
|
|
473
|
+
}>>;
|
|
474
|
+
sessionTokenPath: z.ZodOptional<z.ZodString>;
|
|
475
|
+
tokenType: z.ZodOptional<z.ZodEnum<{
|
|
476
|
+
Bearer: "Bearer";
|
|
477
|
+
Basic: "Basic";
|
|
478
|
+
Custom: "Custom";
|
|
479
|
+
}>>;
|
|
480
|
+
customTokenType: z.ZodOptional<z.ZodString>;
|
|
481
|
+
headerName: z.ZodOptional<z.ZodString>;
|
|
482
|
+
unauthorized: z.ZodOptional<z.ZodObject<{
|
|
483
|
+
redirect: z.ZodOptional<z.ZodBoolean>;
|
|
484
|
+
loginPath: z.ZodOptional<z.ZodString>;
|
|
485
|
+
clearSession: z.ZodOptional<z.ZodBoolean>;
|
|
486
|
+
}, z.core.$strip>>;
|
|
487
|
+
}, z.core.$strip>>;
|
|
488
|
+
toast: z.ZodOptional<z.ZodObject<{
|
|
489
|
+
enabled: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
490
|
+
success: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
491
|
+
show: z.ZodDefault<z.ZodBoolean>;
|
|
492
|
+
color: z.ZodDefault<z.ZodString>;
|
|
493
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
494
|
+
duration: z.ZodDefault<z.ZodNumber>;
|
|
495
|
+
}, z.core.$strip>>>;
|
|
496
|
+
error: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
497
|
+
/**
|
|
498
|
+
* 是否显示错误提示
|
|
499
|
+
* @defaultValue true
|
|
500
|
+
*/
|
|
501
|
+
show: z.ZodDefault<z.ZodBoolean>;
|
|
502
|
+
/**
|
|
503
|
+
* 提示颜色
|
|
504
|
+
* @defaultValue 'error'
|
|
505
|
+
*/
|
|
506
|
+
color: z.ZodDefault<z.ZodString>;
|
|
507
|
+
/**
|
|
508
|
+
* 图标类名
|
|
509
|
+
* @defaultValue 'i-lucide-circle-x'
|
|
510
|
+
*/
|
|
511
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
512
|
+
/**
|
|
513
|
+
* 显示时长(毫秒)
|
|
514
|
+
* @defaultValue 3000
|
|
515
|
+
*/
|
|
516
|
+
duration: z.ZodDefault<z.ZodNumber>;
|
|
517
|
+
}, z.core.$loose>>>;
|
|
518
|
+
}, z.core.$loose>>;
|
|
519
|
+
response: z.ZodOptional<z.ZodObject<{
|
|
520
|
+
successCodes: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>>;
|
|
521
|
+
codeKey: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
522
|
+
messageKey: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
523
|
+
dataKey: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
524
|
+
}, z.core.$strip>>;
|
|
525
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
526
|
+
}, z.core.$strip>>>;
|
|
527
|
+
response: z.ZodOptional<z.ZodObject<{
|
|
528
|
+
successCodes: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
529
|
+
codeKey: z.ZodDefault<z.ZodString>;
|
|
530
|
+
messageKey: z.ZodDefault<z.ZodString>;
|
|
531
|
+
dataKey: z.ZodDefault<z.ZodString>;
|
|
532
|
+
}, z.core.$strip>>;
|
|
533
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
534
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
535
|
+
tokenSource: z.ZodDefault<z.ZodEnum<{
|
|
536
|
+
custom: "custom";
|
|
537
|
+
session: "session";
|
|
538
|
+
}>>;
|
|
539
|
+
sessionTokenPath: z.ZodDefault<z.ZodString>;
|
|
540
|
+
tokenType: z.ZodDefault<z.ZodEnum<{
|
|
541
|
+
Bearer: "Bearer";
|
|
542
|
+
Basic: "Basic";
|
|
543
|
+
Custom: "Custom";
|
|
544
|
+
}>>;
|
|
545
|
+
customTokenType: z.ZodOptional<z.ZodString>;
|
|
546
|
+
headerName: z.ZodDefault<z.ZodString>;
|
|
547
|
+
unauthorized: z.ZodOptional<z.ZodObject<{
|
|
548
|
+
redirect: z.ZodDefault<z.ZodBoolean>;
|
|
549
|
+
loginPath: z.ZodDefault<z.ZodString>;
|
|
550
|
+
clearSession: z.ZodDefault<z.ZodBoolean>;
|
|
551
|
+
}, z.core.$strip>>;
|
|
552
|
+
}, z.core.$strip>>;
|
|
553
|
+
toast: z.ZodOptional<z.ZodObject<{
|
|
554
|
+
/**
|
|
555
|
+
* 是否启用 Toast 提示
|
|
556
|
+
* @defaultValue true
|
|
557
|
+
*/
|
|
558
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
559
|
+
/** 成功提示配置 */
|
|
560
|
+
success: z.ZodOptional<z.ZodObject<{
|
|
561
|
+
show: z.ZodDefault<z.ZodBoolean>;
|
|
562
|
+
color: z.ZodDefault<z.ZodString>;
|
|
563
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
564
|
+
duration: z.ZodDefault<z.ZodNumber>;
|
|
565
|
+
}, z.core.$strip>>;
|
|
566
|
+
/** 错误提示配置 */
|
|
567
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
568
|
+
/**
|
|
569
|
+
* 是否显示错误提示
|
|
570
|
+
* @defaultValue true
|
|
571
|
+
*/
|
|
572
|
+
show: z.ZodDefault<z.ZodBoolean>;
|
|
573
|
+
/**
|
|
574
|
+
* 提示颜色
|
|
575
|
+
* @defaultValue 'error'
|
|
576
|
+
*/
|
|
577
|
+
color: z.ZodDefault<z.ZodString>;
|
|
578
|
+
/**
|
|
579
|
+
* 图标类名
|
|
580
|
+
* @defaultValue 'i-lucide-circle-x'
|
|
581
|
+
*/
|
|
582
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
583
|
+
/**
|
|
584
|
+
* 显示时长(毫秒)
|
|
585
|
+
* @defaultValue 3000
|
|
586
|
+
*/
|
|
587
|
+
duration: z.ZodDefault<z.ZodNumber>;
|
|
588
|
+
}, z.core.$loose>>;
|
|
589
|
+
}, z.core.$loose>>;
|
|
590
|
+
}, z.core.$strip>;
|