@h-ai/iam 0.1.0-alpha5
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/LICENSE +202 -0
- package/README.md +513 -0
- package/dist/api/index.d.ts +746 -0
- package/dist/api/index.js +3 -0
- package/dist/api/index.js.map +1 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +3 -0
- package/dist/browser.js.map +1 -0
- package/dist/chunk-CBZ4LHKU.js +374 -0
- package/dist/chunk-CBZ4LHKU.js.map +1 -0
- package/dist/index.d.ts +1394 -0
- package/dist/index.js +4762 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,746 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @h-ai/iam — API 端点契约定义
|
|
5
|
+
*
|
|
6
|
+
* 所有 iam 模块的 API 端点(path + method + schema),
|
|
7
|
+
* 客户端和服务端都从此处引用,编译时保证一致性。
|
|
8
|
+
* @module iam-api-contract
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
interface EndpointDef<TInput = unknown, TOutput = unknown> {
|
|
12
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
13
|
+
path: string;
|
|
14
|
+
input: z.ZodType<TInput>;
|
|
15
|
+
output: z.ZodType<TOutput>;
|
|
16
|
+
requireAuth?: boolean;
|
|
17
|
+
meta?: {
|
|
18
|
+
summary?: string;
|
|
19
|
+
tags?: string[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* iam 所有 API 端点
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* // 客户端
|
|
28
|
+
* import { iamEndpoints } from '@h-ai/iam/api'
|
|
29
|
+
* const result = await api.call(iamEndpoints.login, { identifier: 'alice', password: 'xxx' })
|
|
30
|
+
*
|
|
31
|
+
* // 服务端
|
|
32
|
+
* export const POST = kit.fromContract(iamEndpoints.login, async (input, event) => { ... })
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare const iamEndpoints: {
|
|
36
|
+
/** 密码登录 */
|
|
37
|
+
readonly login: EndpointDef<{
|
|
38
|
+
identifier: string;
|
|
39
|
+
password: string;
|
|
40
|
+
rememberMe?: boolean | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
user: {
|
|
43
|
+
id: string;
|
|
44
|
+
username: string;
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
createdAt: Date;
|
|
47
|
+
updatedAt: Date;
|
|
48
|
+
email?: string | undefined;
|
|
49
|
+
phone?: string | undefined;
|
|
50
|
+
displayName?: string | undefined;
|
|
51
|
+
avatarUrl?: string | undefined;
|
|
52
|
+
emailVerified?: boolean | undefined;
|
|
53
|
+
phoneVerified?: boolean | undefined;
|
|
54
|
+
metadata?: Record<string, unknown> | undefined;
|
|
55
|
+
};
|
|
56
|
+
tokens: {
|
|
57
|
+
accessToken: string;
|
|
58
|
+
refreshToken: string;
|
|
59
|
+
expiresIn: number;
|
|
60
|
+
tokenType: "Bearer";
|
|
61
|
+
};
|
|
62
|
+
agreements?: {
|
|
63
|
+
showOnRegister: boolean;
|
|
64
|
+
showOnLogin: boolean;
|
|
65
|
+
userAgreementUrl?: string | undefined;
|
|
66
|
+
privacyPolicyUrl?: string | undefined;
|
|
67
|
+
} | undefined;
|
|
68
|
+
}>;
|
|
69
|
+
/** OTP 验证码登录 */
|
|
70
|
+
readonly loginWithOtp: EndpointDef<{
|
|
71
|
+
identifier: string;
|
|
72
|
+
code: string;
|
|
73
|
+
}, {
|
|
74
|
+
user: {
|
|
75
|
+
id: string;
|
|
76
|
+
username: string;
|
|
77
|
+
enabled: boolean;
|
|
78
|
+
createdAt: Date;
|
|
79
|
+
updatedAt: Date;
|
|
80
|
+
email?: string | undefined;
|
|
81
|
+
phone?: string | undefined;
|
|
82
|
+
displayName?: string | undefined;
|
|
83
|
+
avatarUrl?: string | undefined;
|
|
84
|
+
emailVerified?: boolean | undefined;
|
|
85
|
+
phoneVerified?: boolean | undefined;
|
|
86
|
+
metadata?: Record<string, unknown> | undefined;
|
|
87
|
+
};
|
|
88
|
+
tokens: {
|
|
89
|
+
accessToken: string;
|
|
90
|
+
refreshToken: string;
|
|
91
|
+
expiresIn: number;
|
|
92
|
+
tokenType: "Bearer";
|
|
93
|
+
};
|
|
94
|
+
agreements?: {
|
|
95
|
+
showOnRegister: boolean;
|
|
96
|
+
showOnLogin: boolean;
|
|
97
|
+
userAgreementUrl?: string | undefined;
|
|
98
|
+
privacyPolicyUrl?: string | undefined;
|
|
99
|
+
} | undefined;
|
|
100
|
+
}>;
|
|
101
|
+
/** 登出 */
|
|
102
|
+
readonly logout: EndpointDef<{
|
|
103
|
+
accessToken: string;
|
|
104
|
+
}, void>;
|
|
105
|
+
/** 获取当前用户 */
|
|
106
|
+
readonly currentUser: EndpointDef<Record<string, never>, {
|
|
107
|
+
id: string;
|
|
108
|
+
username: string;
|
|
109
|
+
enabled: boolean;
|
|
110
|
+
createdAt: Date;
|
|
111
|
+
updatedAt: Date;
|
|
112
|
+
email?: string | undefined;
|
|
113
|
+
phone?: string | undefined;
|
|
114
|
+
displayName?: string | undefined;
|
|
115
|
+
avatarUrl?: string | undefined;
|
|
116
|
+
emailVerified?: boolean | undefined;
|
|
117
|
+
phoneVerified?: boolean | undefined;
|
|
118
|
+
metadata?: Record<string, unknown> | undefined;
|
|
119
|
+
}>;
|
|
120
|
+
/** 刷新 Token */
|
|
121
|
+
readonly refreshToken: EndpointDef<{
|
|
122
|
+
refreshToken: string;
|
|
123
|
+
}, {
|
|
124
|
+
tokens: {
|
|
125
|
+
accessToken: string;
|
|
126
|
+
refreshToken: string;
|
|
127
|
+
expiresIn: number;
|
|
128
|
+
tokenType: "Bearer";
|
|
129
|
+
};
|
|
130
|
+
}>;
|
|
131
|
+
/** 发送验证码 */
|
|
132
|
+
readonly sendOtp: EndpointDef<{
|
|
133
|
+
identifier: string;
|
|
134
|
+
}, {
|
|
135
|
+
expiresAt: Date;
|
|
136
|
+
}>;
|
|
137
|
+
/** 用户注册 */
|
|
138
|
+
readonly register: EndpointDef<{
|
|
139
|
+
username: string;
|
|
140
|
+
password: string;
|
|
141
|
+
email?: string | undefined;
|
|
142
|
+
phone?: string | undefined;
|
|
143
|
+
displayName?: string | undefined;
|
|
144
|
+
}, {
|
|
145
|
+
user: {
|
|
146
|
+
id: string;
|
|
147
|
+
username: string;
|
|
148
|
+
enabled: boolean;
|
|
149
|
+
createdAt: Date;
|
|
150
|
+
updatedAt: Date;
|
|
151
|
+
email?: string | undefined;
|
|
152
|
+
phone?: string | undefined;
|
|
153
|
+
displayName?: string | undefined;
|
|
154
|
+
avatarUrl?: string | undefined;
|
|
155
|
+
emailVerified?: boolean | undefined;
|
|
156
|
+
phoneVerified?: boolean | undefined;
|
|
157
|
+
metadata?: Record<string, unknown> | undefined;
|
|
158
|
+
};
|
|
159
|
+
tokens: {
|
|
160
|
+
accessToken: string;
|
|
161
|
+
refreshToken: string;
|
|
162
|
+
expiresIn: number;
|
|
163
|
+
tokenType: "Bearer";
|
|
164
|
+
};
|
|
165
|
+
}>;
|
|
166
|
+
/** 修改密码 */
|
|
167
|
+
readonly changePassword: EndpointDef<{
|
|
168
|
+
oldPassword: string;
|
|
169
|
+
newPassword: string;
|
|
170
|
+
}, void>;
|
|
171
|
+
/** 更新当前用户信息 */
|
|
172
|
+
readonly updateCurrentUser: EndpointDef<{
|
|
173
|
+
displayName?: string | undefined;
|
|
174
|
+
avatarUrl?: string | undefined;
|
|
175
|
+
email?: string | undefined;
|
|
176
|
+
phone?: string | undefined;
|
|
177
|
+
}, {
|
|
178
|
+
id: string;
|
|
179
|
+
username: string;
|
|
180
|
+
enabled: boolean;
|
|
181
|
+
createdAt: Date;
|
|
182
|
+
updatedAt: Date;
|
|
183
|
+
email?: string | undefined;
|
|
184
|
+
phone?: string | undefined;
|
|
185
|
+
displayName?: string | undefined;
|
|
186
|
+
avatarUrl?: string | undefined;
|
|
187
|
+
emailVerified?: boolean | undefined;
|
|
188
|
+
phoneVerified?: boolean | undefined;
|
|
189
|
+
metadata?: Record<string, unknown> | undefined;
|
|
190
|
+
}>;
|
|
191
|
+
/** 用户列表(分页 + 搜索 + 状态过滤) */
|
|
192
|
+
readonly listUsers: EndpointDef<{
|
|
193
|
+
page?: number | undefined;
|
|
194
|
+
pageSize?: number | undefined;
|
|
195
|
+
search?: string | undefined;
|
|
196
|
+
enabled?: boolean | undefined;
|
|
197
|
+
}, {
|
|
198
|
+
items: {
|
|
199
|
+
id: string;
|
|
200
|
+
username: string;
|
|
201
|
+
enabled: boolean;
|
|
202
|
+
createdAt: Date;
|
|
203
|
+
updatedAt: Date;
|
|
204
|
+
email?: string | undefined;
|
|
205
|
+
phone?: string | undefined;
|
|
206
|
+
displayName?: string | undefined;
|
|
207
|
+
avatarUrl?: string | undefined;
|
|
208
|
+
emailVerified?: boolean | undefined;
|
|
209
|
+
phoneVerified?: boolean | undefined;
|
|
210
|
+
metadata?: Record<string, unknown> | undefined;
|
|
211
|
+
}[];
|
|
212
|
+
total: number;
|
|
213
|
+
page: number;
|
|
214
|
+
pageSize: number;
|
|
215
|
+
}>;
|
|
216
|
+
/** 获取单个用户 */
|
|
217
|
+
readonly getUser: EndpointDef<{
|
|
218
|
+
id: string;
|
|
219
|
+
}, {
|
|
220
|
+
id: string;
|
|
221
|
+
username: string;
|
|
222
|
+
enabled: boolean;
|
|
223
|
+
createdAt: Date;
|
|
224
|
+
updatedAt: Date;
|
|
225
|
+
email?: string | undefined;
|
|
226
|
+
phone?: string | undefined;
|
|
227
|
+
displayName?: string | undefined;
|
|
228
|
+
avatarUrl?: string | undefined;
|
|
229
|
+
emailVerified?: boolean | undefined;
|
|
230
|
+
phoneVerified?: boolean | undefined;
|
|
231
|
+
metadata?: Record<string, unknown> | undefined;
|
|
232
|
+
}>;
|
|
233
|
+
/** 创建用户 */
|
|
234
|
+
readonly createUser: EndpointDef<{
|
|
235
|
+
username: string;
|
|
236
|
+
password: string;
|
|
237
|
+
email?: string | undefined;
|
|
238
|
+
displayName?: string | undefined;
|
|
239
|
+
roles?: string[] | undefined;
|
|
240
|
+
enabled?: boolean | undefined;
|
|
241
|
+
}, {
|
|
242
|
+
id: string;
|
|
243
|
+
username: string;
|
|
244
|
+
enabled: boolean;
|
|
245
|
+
createdAt: Date;
|
|
246
|
+
updatedAt: Date;
|
|
247
|
+
email?: string | undefined;
|
|
248
|
+
phone?: string | undefined;
|
|
249
|
+
displayName?: string | undefined;
|
|
250
|
+
avatarUrl?: string | undefined;
|
|
251
|
+
emailVerified?: boolean | undefined;
|
|
252
|
+
phoneVerified?: boolean | undefined;
|
|
253
|
+
metadata?: Record<string, unknown> | undefined;
|
|
254
|
+
}>;
|
|
255
|
+
/** 更新用户 */
|
|
256
|
+
readonly updateUser: EndpointDef<{
|
|
257
|
+
username?: string | undefined;
|
|
258
|
+
email?: string | undefined;
|
|
259
|
+
displayName?: string | undefined;
|
|
260
|
+
enabled?: boolean | undefined;
|
|
261
|
+
password?: string | undefined;
|
|
262
|
+
roles?: string[] | undefined;
|
|
263
|
+
}, {
|
|
264
|
+
id: string;
|
|
265
|
+
username: string;
|
|
266
|
+
enabled: boolean;
|
|
267
|
+
createdAt: Date;
|
|
268
|
+
updatedAt: Date;
|
|
269
|
+
email?: string | undefined;
|
|
270
|
+
phone?: string | undefined;
|
|
271
|
+
displayName?: string | undefined;
|
|
272
|
+
avatarUrl?: string | undefined;
|
|
273
|
+
emailVerified?: boolean | undefined;
|
|
274
|
+
phoneVerified?: boolean | undefined;
|
|
275
|
+
metadata?: Record<string, unknown> | undefined;
|
|
276
|
+
}>;
|
|
277
|
+
/** 删除用户 */
|
|
278
|
+
readonly deleteUser: EndpointDef<{
|
|
279
|
+
id: string;
|
|
280
|
+
}, void>;
|
|
281
|
+
/** Admin 重置用户密码 */
|
|
282
|
+
readonly adminResetPassword: EndpointDef<{
|
|
283
|
+
newPassword: string;
|
|
284
|
+
}, void>;
|
|
285
|
+
/** 角色列表 */
|
|
286
|
+
readonly listRoles: EndpointDef<{
|
|
287
|
+
page?: number | undefined;
|
|
288
|
+
pageSize?: number | undefined;
|
|
289
|
+
}, {
|
|
290
|
+
items: {
|
|
291
|
+
id: string;
|
|
292
|
+
code: string;
|
|
293
|
+
name: string;
|
|
294
|
+
createdAt: Date;
|
|
295
|
+
updatedAt: Date;
|
|
296
|
+
description?: string | undefined;
|
|
297
|
+
isSystem?: boolean | undefined;
|
|
298
|
+
}[];
|
|
299
|
+
total: number;
|
|
300
|
+
page: number;
|
|
301
|
+
pageSize: number;
|
|
302
|
+
}>;
|
|
303
|
+
/** 获取单个角色 */
|
|
304
|
+
readonly getRole: EndpointDef<{
|
|
305
|
+
id: string;
|
|
306
|
+
}, {
|
|
307
|
+
id: string;
|
|
308
|
+
code: string;
|
|
309
|
+
name: string;
|
|
310
|
+
createdAt: Date;
|
|
311
|
+
updatedAt: Date;
|
|
312
|
+
description?: string | undefined;
|
|
313
|
+
isSystem?: boolean | undefined;
|
|
314
|
+
}>;
|
|
315
|
+
/** 创建角色 */
|
|
316
|
+
readonly createRole: EndpointDef<{
|
|
317
|
+
name: string;
|
|
318
|
+
description?: string | undefined;
|
|
319
|
+
permissions?: string[] | undefined;
|
|
320
|
+
}, {
|
|
321
|
+
id: string;
|
|
322
|
+
code: string;
|
|
323
|
+
name: string;
|
|
324
|
+
createdAt: Date;
|
|
325
|
+
updatedAt: Date;
|
|
326
|
+
description?: string | undefined;
|
|
327
|
+
isSystem?: boolean | undefined;
|
|
328
|
+
}>;
|
|
329
|
+
/** 更新角色 */
|
|
330
|
+
readonly updateRole: EndpointDef<{
|
|
331
|
+
name?: string | undefined;
|
|
332
|
+
description?: string | undefined;
|
|
333
|
+
permissions?: string[] | undefined;
|
|
334
|
+
}, {
|
|
335
|
+
id: string;
|
|
336
|
+
code: string;
|
|
337
|
+
name: string;
|
|
338
|
+
createdAt: Date;
|
|
339
|
+
updatedAt: Date;
|
|
340
|
+
description?: string | undefined;
|
|
341
|
+
isSystem?: boolean | undefined;
|
|
342
|
+
}>;
|
|
343
|
+
/** 删除角色 */
|
|
344
|
+
readonly deleteRole: EndpointDef<{
|
|
345
|
+
id: string;
|
|
346
|
+
}, void>;
|
|
347
|
+
/** 权限列表(分页 + 搜索 + 类型过滤) */
|
|
348
|
+
readonly listPermissions: EndpointDef<{
|
|
349
|
+
page?: number | undefined;
|
|
350
|
+
pageSize?: number | undefined;
|
|
351
|
+
search?: string | undefined;
|
|
352
|
+
type?: "menu" | "api" | "button" | undefined;
|
|
353
|
+
}, {
|
|
354
|
+
items: {
|
|
355
|
+
id: string;
|
|
356
|
+
code: string;
|
|
357
|
+
name: string;
|
|
358
|
+
createdAt: Date;
|
|
359
|
+
updatedAt: Date;
|
|
360
|
+
description?: string | undefined;
|
|
361
|
+
type?: "menu" | "api" | "button" | undefined;
|
|
362
|
+
resource?: string | undefined;
|
|
363
|
+
action?: string | undefined;
|
|
364
|
+
}[];
|
|
365
|
+
total: number;
|
|
366
|
+
page: number;
|
|
367
|
+
pageSize: number;
|
|
368
|
+
}>;
|
|
369
|
+
/** 获取单个权限 */
|
|
370
|
+
readonly getPermission: EndpointDef<{
|
|
371
|
+
id: string;
|
|
372
|
+
}, {
|
|
373
|
+
id: string;
|
|
374
|
+
code: string;
|
|
375
|
+
name: string;
|
|
376
|
+
createdAt: Date;
|
|
377
|
+
updatedAt: Date;
|
|
378
|
+
description?: string | undefined;
|
|
379
|
+
type?: "menu" | "api" | "button" | undefined;
|
|
380
|
+
resource?: string | undefined;
|
|
381
|
+
action?: string | undefined;
|
|
382
|
+
}>;
|
|
383
|
+
/** 创建权限 */
|
|
384
|
+
readonly createPermission: EndpointDef<{
|
|
385
|
+
name: string;
|
|
386
|
+
resource: string;
|
|
387
|
+
action: string;
|
|
388
|
+
description?: string | undefined;
|
|
389
|
+
type?: "menu" | "api" | "button" | undefined;
|
|
390
|
+
}, {
|
|
391
|
+
id: string;
|
|
392
|
+
code: string;
|
|
393
|
+
name: string;
|
|
394
|
+
createdAt: Date;
|
|
395
|
+
updatedAt: Date;
|
|
396
|
+
description?: string | undefined;
|
|
397
|
+
type?: "menu" | "api" | "button" | undefined;
|
|
398
|
+
resource?: string | undefined;
|
|
399
|
+
action?: string | undefined;
|
|
400
|
+
}>;
|
|
401
|
+
/** 删除权限 */
|
|
402
|
+
readonly deletePermission: EndpointDef<{
|
|
403
|
+
id: string;
|
|
404
|
+
}, void>;
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* @h-ai/iam — API 契约 Zod Schema
|
|
409
|
+
*
|
|
410
|
+
* 入参/出参 Schema,作为服务端校验和客户端类型推导的唯一真相源。
|
|
411
|
+
* @module iam-api-schemas
|
|
412
|
+
*/
|
|
413
|
+
|
|
414
|
+
/** 用户基础信息 */
|
|
415
|
+
declare const UserSchema: z.ZodObject<{
|
|
416
|
+
id: z.ZodString;
|
|
417
|
+
username: z.ZodString;
|
|
418
|
+
email: z.ZodOptional<z.ZodString>;
|
|
419
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
420
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
421
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
422
|
+
enabled: z.ZodBoolean;
|
|
423
|
+
emailVerified: z.ZodOptional<z.ZodBoolean>;
|
|
424
|
+
phoneVerified: z.ZodOptional<z.ZodBoolean>;
|
|
425
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
426
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
427
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
428
|
+
}, z.core.$strip>;
|
|
429
|
+
/** Token 对 */
|
|
430
|
+
declare const TokenPairSchema: z.ZodObject<{
|
|
431
|
+
accessToken: z.ZodString;
|
|
432
|
+
refreshToken: z.ZodString;
|
|
433
|
+
expiresIn: z.ZodNumber;
|
|
434
|
+
tokenType: z.ZodLiteral<"Bearer">;
|
|
435
|
+
}, z.core.$strip>;
|
|
436
|
+
/** 协议展示 */
|
|
437
|
+
declare const AgreementDisplaySchema: z.ZodObject<{
|
|
438
|
+
userAgreementUrl: z.ZodOptional<z.ZodString>;
|
|
439
|
+
privacyPolicyUrl: z.ZodOptional<z.ZodString>;
|
|
440
|
+
showOnRegister: z.ZodBoolean;
|
|
441
|
+
showOnLogin: z.ZodBoolean;
|
|
442
|
+
}, z.core.$strip>;
|
|
443
|
+
/** 密码登录入参 */
|
|
444
|
+
declare const LoginInputSchema: z.ZodObject<{
|
|
445
|
+
identifier: z.ZodString;
|
|
446
|
+
password: z.ZodString;
|
|
447
|
+
rememberMe: z.ZodOptional<z.ZodBoolean>;
|
|
448
|
+
}, z.core.$strip>;
|
|
449
|
+
/** 登录出参 */
|
|
450
|
+
declare const LoginOutputSchema: z.ZodObject<{
|
|
451
|
+
user: z.ZodObject<{
|
|
452
|
+
id: z.ZodString;
|
|
453
|
+
username: z.ZodString;
|
|
454
|
+
email: z.ZodOptional<z.ZodString>;
|
|
455
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
456
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
457
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
458
|
+
enabled: z.ZodBoolean;
|
|
459
|
+
emailVerified: z.ZodOptional<z.ZodBoolean>;
|
|
460
|
+
phoneVerified: z.ZodOptional<z.ZodBoolean>;
|
|
461
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
462
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
463
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
464
|
+
}, z.core.$strip>;
|
|
465
|
+
tokens: z.ZodObject<{
|
|
466
|
+
accessToken: z.ZodString;
|
|
467
|
+
refreshToken: z.ZodString;
|
|
468
|
+
expiresIn: z.ZodNumber;
|
|
469
|
+
tokenType: z.ZodLiteral<"Bearer">;
|
|
470
|
+
}, z.core.$strip>;
|
|
471
|
+
agreements: z.ZodOptional<z.ZodObject<{
|
|
472
|
+
userAgreementUrl: z.ZodOptional<z.ZodString>;
|
|
473
|
+
privacyPolicyUrl: z.ZodOptional<z.ZodString>;
|
|
474
|
+
showOnRegister: z.ZodBoolean;
|
|
475
|
+
showOnLogin: z.ZodBoolean;
|
|
476
|
+
}, z.core.$strip>>;
|
|
477
|
+
}, z.core.$strip>;
|
|
478
|
+
/** OTP 登录入参 */
|
|
479
|
+
declare const OtpLoginInputSchema: z.ZodObject<{
|
|
480
|
+
identifier: z.ZodString;
|
|
481
|
+
code: z.ZodString;
|
|
482
|
+
}, z.core.$strip>;
|
|
483
|
+
/** 登出入参 */
|
|
484
|
+
declare const LogoutInputSchema: z.ZodObject<{
|
|
485
|
+
accessToken: z.ZodString;
|
|
486
|
+
}, z.core.$strip>;
|
|
487
|
+
/** 发送 OTP 入参 */
|
|
488
|
+
declare const SendOtpInputSchema: z.ZodObject<{
|
|
489
|
+
identifier: z.ZodString;
|
|
490
|
+
}, z.core.$strip>;
|
|
491
|
+
/** 发送 OTP 出参 */
|
|
492
|
+
declare const SendOtpOutputSchema: z.ZodObject<{
|
|
493
|
+
expiresAt: z.ZodCoercedDate<unknown>;
|
|
494
|
+
}, z.core.$strip>;
|
|
495
|
+
/** Token 刷新入参 */
|
|
496
|
+
declare const RefreshTokenInputSchema: z.ZodObject<{
|
|
497
|
+
refreshToken: z.ZodString;
|
|
498
|
+
}, z.core.$strip>;
|
|
499
|
+
/** Token 刷新出参 */
|
|
500
|
+
declare const RefreshTokenOutputSchema: z.ZodObject<{
|
|
501
|
+
tokens: z.ZodObject<{
|
|
502
|
+
accessToken: z.ZodString;
|
|
503
|
+
refreshToken: z.ZodString;
|
|
504
|
+
expiresIn: z.ZodNumber;
|
|
505
|
+
tokenType: z.ZodLiteral<"Bearer">;
|
|
506
|
+
}, z.core.$strip>;
|
|
507
|
+
}, z.core.$strip>;
|
|
508
|
+
/** 注册入参 */
|
|
509
|
+
declare const RegisterInputSchema: z.ZodObject<{
|
|
510
|
+
username: z.ZodString;
|
|
511
|
+
password: z.ZodString;
|
|
512
|
+
email: z.ZodOptional<z.ZodString>;
|
|
513
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
514
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
515
|
+
}, z.core.$strip>;
|
|
516
|
+
/** 注册出参 */
|
|
517
|
+
declare const RegisterOutputSchema: z.ZodObject<{
|
|
518
|
+
user: z.ZodObject<{
|
|
519
|
+
id: z.ZodString;
|
|
520
|
+
username: z.ZodString;
|
|
521
|
+
email: z.ZodOptional<z.ZodString>;
|
|
522
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
523
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
524
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
525
|
+
enabled: z.ZodBoolean;
|
|
526
|
+
emailVerified: z.ZodOptional<z.ZodBoolean>;
|
|
527
|
+
phoneVerified: z.ZodOptional<z.ZodBoolean>;
|
|
528
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
529
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
530
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
531
|
+
}, z.core.$strip>;
|
|
532
|
+
tokens: z.ZodObject<{
|
|
533
|
+
accessToken: z.ZodString;
|
|
534
|
+
refreshToken: z.ZodString;
|
|
535
|
+
expiresIn: z.ZodNumber;
|
|
536
|
+
tokenType: z.ZodLiteral<"Bearer">;
|
|
537
|
+
}, z.core.$strip>;
|
|
538
|
+
}, z.core.$strip>;
|
|
539
|
+
/** 修改密码入参 */
|
|
540
|
+
declare const ChangePasswordInputSchema: z.ZodObject<{
|
|
541
|
+
oldPassword: z.ZodString;
|
|
542
|
+
newPassword: z.ZodString;
|
|
543
|
+
}, z.core.$strip>;
|
|
544
|
+
/** 当前用户信息出参 */
|
|
545
|
+
declare const CurrentUserOutputSchema: z.ZodObject<{
|
|
546
|
+
id: z.ZodString;
|
|
547
|
+
username: z.ZodString;
|
|
548
|
+
email: z.ZodOptional<z.ZodString>;
|
|
549
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
550
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
551
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
552
|
+
enabled: z.ZodBoolean;
|
|
553
|
+
emailVerified: z.ZodOptional<z.ZodBoolean>;
|
|
554
|
+
phoneVerified: z.ZodOptional<z.ZodBoolean>;
|
|
555
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
556
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
557
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
558
|
+
}, z.core.$strip>;
|
|
559
|
+
/** 更新当前用户入参 */
|
|
560
|
+
declare const UpdateCurrentUserInputSchema: z.ZodObject<{
|
|
561
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
562
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
563
|
+
email: z.ZodOptional<z.ZodString>;
|
|
564
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
565
|
+
}, z.core.$strip>;
|
|
566
|
+
/** 通用分页参数 */
|
|
567
|
+
declare const PaginationQuerySchema: z.ZodObject<{
|
|
568
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
569
|
+
pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
570
|
+
}, z.core.$strip>;
|
|
571
|
+
/** 用户列表查询入参 */
|
|
572
|
+
declare const ListUsersInputSchema: z.ZodObject<{
|
|
573
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
574
|
+
pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
575
|
+
search: z.ZodOptional<z.ZodString>;
|
|
576
|
+
enabled: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
|
|
577
|
+
}, z.core.$strip>;
|
|
578
|
+
/** 用户列表出参 */
|
|
579
|
+
declare const ListUsersOutputSchema: z.ZodObject<{
|
|
580
|
+
items: z.ZodArray<z.ZodObject<{
|
|
581
|
+
id: z.ZodString;
|
|
582
|
+
username: z.ZodString;
|
|
583
|
+
email: z.ZodOptional<z.ZodString>;
|
|
584
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
585
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
586
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
587
|
+
enabled: z.ZodBoolean;
|
|
588
|
+
emailVerified: z.ZodOptional<z.ZodBoolean>;
|
|
589
|
+
phoneVerified: z.ZodOptional<z.ZodBoolean>;
|
|
590
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
591
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
592
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
593
|
+
}, z.core.$strip>>;
|
|
594
|
+
total: z.ZodNumber;
|
|
595
|
+
page: z.ZodNumber;
|
|
596
|
+
pageSize: z.ZodNumber;
|
|
597
|
+
}, z.core.$strip>;
|
|
598
|
+
/** Admin 创建用户入参 */
|
|
599
|
+
declare const AdminCreateUserInputSchema: z.ZodObject<{
|
|
600
|
+
username: z.ZodString;
|
|
601
|
+
email: z.ZodOptional<z.ZodString>;
|
|
602
|
+
password: z.ZodString;
|
|
603
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
604
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
605
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
606
|
+
}, z.core.$strip>;
|
|
607
|
+
/** Admin 更新用户入参 */
|
|
608
|
+
declare const AdminUpdateUserInputSchema: z.ZodObject<{
|
|
609
|
+
username: z.ZodOptional<z.ZodString>;
|
|
610
|
+
email: z.ZodOptional<z.ZodString>;
|
|
611
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
612
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
613
|
+
password: z.ZodOptional<z.ZodString>;
|
|
614
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
615
|
+
}, z.core.$strip>;
|
|
616
|
+
/** ID 路径参数 */
|
|
617
|
+
declare const IdParamSchema: z.ZodObject<{
|
|
618
|
+
id: z.ZodString;
|
|
619
|
+
}, z.core.$strip>;
|
|
620
|
+
/** Admin 重置密码入参 */
|
|
621
|
+
declare const AdminResetPasswordInputSchema: z.ZodObject<{
|
|
622
|
+
newPassword: z.ZodString;
|
|
623
|
+
}, z.core.$strip>;
|
|
624
|
+
/** 角色基础信息 */
|
|
625
|
+
declare const RoleSchema: z.ZodObject<{
|
|
626
|
+
id: z.ZodString;
|
|
627
|
+
code: z.ZodString;
|
|
628
|
+
name: z.ZodString;
|
|
629
|
+
description: z.ZodOptional<z.ZodString>;
|
|
630
|
+
isSystem: z.ZodOptional<z.ZodBoolean>;
|
|
631
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
632
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
633
|
+
}, z.core.$strip>;
|
|
634
|
+
/** 角色列表出参 */
|
|
635
|
+
declare const ListRolesOutputSchema: z.ZodObject<{
|
|
636
|
+
items: z.ZodArray<z.ZodObject<{
|
|
637
|
+
id: z.ZodString;
|
|
638
|
+
code: z.ZodString;
|
|
639
|
+
name: z.ZodString;
|
|
640
|
+
description: z.ZodOptional<z.ZodString>;
|
|
641
|
+
isSystem: z.ZodOptional<z.ZodBoolean>;
|
|
642
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
643
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
644
|
+
}, z.core.$strip>>;
|
|
645
|
+
total: z.ZodNumber;
|
|
646
|
+
page: z.ZodNumber;
|
|
647
|
+
pageSize: z.ZodNumber;
|
|
648
|
+
}, z.core.$strip>;
|
|
649
|
+
/** 创建角色入参 */
|
|
650
|
+
declare const CreateRoleInputSchema: z.ZodObject<{
|
|
651
|
+
name: z.ZodString;
|
|
652
|
+
description: z.ZodOptional<z.ZodString>;
|
|
653
|
+
permissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
654
|
+
}, z.core.$strip>;
|
|
655
|
+
/** 更新角色入参 */
|
|
656
|
+
declare const UpdateRoleInputSchema: z.ZodObject<{
|
|
657
|
+
name: z.ZodOptional<z.ZodString>;
|
|
658
|
+
description: z.ZodOptional<z.ZodString>;
|
|
659
|
+
permissions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
660
|
+
}, z.core.$strip>;
|
|
661
|
+
/** 权限类型 */
|
|
662
|
+
declare const PermissionTypeSchema: z.ZodEnum<{
|
|
663
|
+
menu: "menu";
|
|
664
|
+
api: "api";
|
|
665
|
+
button: "button";
|
|
666
|
+
}>;
|
|
667
|
+
/** 权限基础信息 */
|
|
668
|
+
declare const PermissionSchema: z.ZodObject<{
|
|
669
|
+
id: z.ZodString;
|
|
670
|
+
code: z.ZodString;
|
|
671
|
+
name: z.ZodString;
|
|
672
|
+
description: z.ZodOptional<z.ZodString>;
|
|
673
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
674
|
+
menu: "menu";
|
|
675
|
+
api: "api";
|
|
676
|
+
button: "button";
|
|
677
|
+
}>>;
|
|
678
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
679
|
+
action: z.ZodOptional<z.ZodString>;
|
|
680
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
681
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
682
|
+
}, z.core.$strip>;
|
|
683
|
+
/** 权限列表查询入参 */
|
|
684
|
+
declare const ListPermissionsInputSchema: z.ZodObject<{
|
|
685
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
686
|
+
pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
687
|
+
search: z.ZodOptional<z.ZodString>;
|
|
688
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
689
|
+
menu: "menu";
|
|
690
|
+
api: "api";
|
|
691
|
+
button: "button";
|
|
692
|
+
}>>;
|
|
693
|
+
}, z.core.$strip>;
|
|
694
|
+
/** 权限列表出参 */
|
|
695
|
+
declare const ListPermissionsOutputSchema: z.ZodObject<{
|
|
696
|
+
items: z.ZodArray<z.ZodObject<{
|
|
697
|
+
id: z.ZodString;
|
|
698
|
+
code: z.ZodString;
|
|
699
|
+
name: z.ZodString;
|
|
700
|
+
description: z.ZodOptional<z.ZodString>;
|
|
701
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
702
|
+
menu: "menu";
|
|
703
|
+
api: "api";
|
|
704
|
+
button: "button";
|
|
705
|
+
}>>;
|
|
706
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
707
|
+
action: z.ZodOptional<z.ZodString>;
|
|
708
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
709
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
710
|
+
}, z.core.$strip>>;
|
|
711
|
+
total: z.ZodNumber;
|
|
712
|
+
page: z.ZodNumber;
|
|
713
|
+
pageSize: z.ZodNumber;
|
|
714
|
+
}, z.core.$strip>;
|
|
715
|
+
/** 创建权限入参 */
|
|
716
|
+
declare const CreatePermissionInputSchema: z.ZodObject<{
|
|
717
|
+
name: z.ZodString;
|
|
718
|
+
description: z.ZodOptional<z.ZodString>;
|
|
719
|
+
resource: z.ZodString;
|
|
720
|
+
action: z.ZodString;
|
|
721
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
722
|
+
menu: "menu";
|
|
723
|
+
api: "api";
|
|
724
|
+
button: "button";
|
|
725
|
+
}>>;
|
|
726
|
+
}, z.core.$strip>;
|
|
727
|
+
type LoginInput = z.infer<typeof LoginInputSchema>;
|
|
728
|
+
type LoginOutput = z.infer<typeof LoginOutputSchema>;
|
|
729
|
+
type OtpLoginInput = z.infer<typeof OtpLoginInputSchema>;
|
|
730
|
+
type RegisterInput = z.infer<typeof RegisterInputSchema>;
|
|
731
|
+
type RegisterOutput = z.infer<typeof RegisterOutputSchema>;
|
|
732
|
+
type ChangePasswordInput = z.infer<typeof ChangePasswordInputSchema>;
|
|
733
|
+
type RefreshTokenInput = z.infer<typeof RefreshTokenInputSchema>;
|
|
734
|
+
type RefreshTokenOutput = z.infer<typeof RefreshTokenOutputSchema>;
|
|
735
|
+
type UpdateCurrentUserInput = z.infer<typeof UpdateCurrentUserInputSchema>;
|
|
736
|
+
type SendOtpInput = z.infer<typeof SendOtpInputSchema>;
|
|
737
|
+
type SendOtpOutput = z.infer<typeof SendOtpOutputSchema>;
|
|
738
|
+
type ListUsersInput = z.infer<typeof ListUsersInputSchema>;
|
|
739
|
+
type AdminCreateUserInput = z.infer<typeof AdminCreateUserInputSchema>;
|
|
740
|
+
type AdminUpdateUserInput = z.infer<typeof AdminUpdateUserInputSchema>;
|
|
741
|
+
type CreateRoleInput = z.infer<typeof CreateRoleInputSchema>;
|
|
742
|
+
type UpdateRoleInput = z.infer<typeof UpdateRoleInputSchema>;
|
|
743
|
+
type ListPermissionsInput = z.infer<typeof ListPermissionsInputSchema>;
|
|
744
|
+
type CreatePermissionInput = z.infer<typeof CreatePermissionInputSchema>;
|
|
745
|
+
|
|
746
|
+
export { type AdminCreateUserInput, AdminCreateUserInputSchema, AdminResetPasswordInputSchema, type AdminUpdateUserInput, AdminUpdateUserInputSchema, AgreementDisplaySchema, type ChangePasswordInput, ChangePasswordInputSchema, type CreatePermissionInput, CreatePermissionInputSchema, type CreateRoleInput, CreateRoleInputSchema, CurrentUserOutputSchema, IdParamSchema, type ListPermissionsInput, ListPermissionsInputSchema, ListPermissionsOutputSchema, ListRolesOutputSchema, type ListUsersInput, ListUsersInputSchema, ListUsersOutputSchema, type LoginInput, LoginInputSchema, type LoginOutput, LoginOutputSchema, LogoutInputSchema, type OtpLoginInput, OtpLoginInputSchema, PaginationQuerySchema, PermissionSchema, PermissionTypeSchema, type RefreshTokenInput, RefreshTokenInputSchema, type RefreshTokenOutput, RefreshTokenOutputSchema, type RegisterInput, RegisterInputSchema, type RegisterOutput, RegisterOutputSchema, RoleSchema, type SendOtpInput, SendOtpInputSchema, type SendOtpOutput, SendOtpOutputSchema, TokenPairSchema, type UpdateCurrentUserInput, UpdateCurrentUserInputSchema, type UpdateRoleInput, UpdateRoleInputSchema, UserSchema, iamEndpoints };
|