@h-ai/iam 0.1.0-alpha.72 → 0.1.0-alpha.74

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/browser.d.ts CHANGED
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  import * as _h_ai_core from '@h-ai/core';
3
3
  import { HaiResult, PaginationOptionsInput, PaginatedResult } from '@h-ai/core';
4
4
  import { ReachFunctions } from '@h-ai/reach';
5
+ import { Challenge } from 'altcha/lib';
5
6
  import { DmlWithTxOperations } from '@h-ai/reldb';
6
7
 
7
8
  /**
@@ -61,7 +62,10 @@ declare const PasswordConfigSchema: z.ZodObject<{
61
62
  requireLowercase: z.ZodDefault<z.ZodBoolean>;
62
63
  requireNumber: z.ZodDefault<z.ZodBoolean>;
63
64
  requireSpecialChar: z.ZodDefault<z.ZodBoolean>;
65
+ minCharacterClasses: z.ZodDefault<z.ZodNumber>;
64
66
  expirationDays: z.ZodDefault<z.ZodNumber>;
67
+ preventSamePassword: z.ZodDefault<z.ZodBoolean>;
68
+ requireInitialChange: z.ZodDefault<z.ZodBoolean>;
65
69
  }, z.core.$strip>;
66
70
  /**
67
71
  * 密码配置类型
@@ -255,9 +259,25 @@ type RegisterConfig = z.infer<typeof RegisterConfigSchema>;
255
259
  * ```
256
260
  */
257
261
  declare const SecurityConfigSchema: z.ZodObject<{
262
+ lockoutEnabled: z.ZodDefault<z.ZodBoolean>;
263
+ failureWindow: z.ZodDefault<z.ZodNumber>;
258
264
  maxLoginAttempts: z.ZodDefault<z.ZodNumber>;
259
265
  lockoutDuration: z.ZodDefault<z.ZodNumber>;
260
266
  }, z.core.$strip>;
267
+ /**
268
+ * 自托管 ALTCHA 计算挑战;默认关闭,强度与有效期由应用设置。
269
+ * @example
270
+ * ```ts
271
+ * import { CaptchaConfigSchema } from '@h-ai/iam'
272
+ * const config = CaptchaConfigSchema.parse({ enabled: true, ttlSeconds: 120 })
273
+ * ```
274
+ */
275
+ declare const CaptchaConfigSchema: z.ZodObject<{
276
+ enabled: z.ZodDefault<z.ZodBoolean>;
277
+ ttlSeconds: z.ZodDefault<z.ZodNumber>;
278
+ cost: z.ZodDefault<z.ZodNumber>;
279
+ maxCounter: z.ZodDefault<z.ZodNumber>;
280
+ }, z.core.$strip>;
261
281
  /**
262
282
  * 服务端账户失败计数与锁定策略。
263
283
  * @example
@@ -267,6 +287,25 @@ declare const SecurityConfigSchema: z.ZodObject<{
267
287
  * ```
268
288
  */
269
289
  type SecurityConfig = z.infer<typeof SecurityConfigSchema>;
290
+ /**
291
+ * 登录时段与地址策略;空地址/时段列表不限制对应维度。周一为1,周日为7。
292
+ * @example
293
+ * ```ts
294
+ * import { LoginAccessConfigSchema } from '@h-ai/iam'
295
+ * const policy = LoginAccessConfigSchema.parse({ enabled: true, allowIps: ['192.0.2.0/24'], timezone: 'Asia/Shanghai' })
296
+ * ```
297
+ */
298
+ declare const LoginAccessConfigSchema: z.ZodObject<{
299
+ enabled: z.ZodDefault<z.ZodBoolean>;
300
+ allowIps: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6, z.ZodCIDRv4, z.ZodCIDRv6]>>>;
301
+ denyIps: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6, z.ZodCIDRv4, z.ZodCIDRv6]>>>;
302
+ timezone: z.ZodDefault<z.ZodString>;
303
+ windows: z.ZodDefault<z.ZodArray<z.ZodObject<{
304
+ days: z.ZodArray<z.ZodNumber>;
305
+ start: z.ZodString;
306
+ end: z.ZodString;
307
+ }, z.core.$strip>>>;
308
+ }, z.core.$strip>;
270
309
  /**
271
310
  * 协议展示配置
272
311
  * @example
@@ -340,8 +379,26 @@ type AuthUiConfig = z.infer<typeof AuthUiConfigSchema>;
340
379
  */
341
380
  declare const SessionConfigSchema: z.ZodObject<{
342
381
  maxAge: z.ZodDefault<z.ZodNumber>;
382
+ endOnPageHide: z.ZodDefault<z.ZodBoolean>;
343
383
  sliding: z.ZodDefault<z.ZodBoolean>;
344
384
  singleDevice: z.ZodDefault<z.ZodBoolean>;
385
+ singleDeviceMode: z.ZodDefault<z.ZodEnum<{
386
+ replace: "replace";
387
+ reject: "reject";
388
+ }>>;
389
+ maxSessions: z.ZodDefault<z.ZodNumber>;
390
+ terminalLimits: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
391
+ web: "web";
392
+ app: "app";
393
+ desktop: "desktop";
394
+ api: "api";
395
+ }> & z.core.$partial, z.ZodNumber>>;
396
+ terminalLimitMode: z.ZodDefault<z.ZodEnum<{
397
+ replace: "replace";
398
+ reject: "reject";
399
+ }>>;
400
+ idleTimeout: z.ZodDefault<z.ZodNumber>;
401
+ absoluteTimeout: z.ZodDefault<z.ZodNumber>;
345
402
  refreshTokenMaxAge: z.ZodDefault<z.ZodNumber>;
346
403
  }, z.core.$strip>;
347
404
  /**
@@ -378,6 +435,18 @@ declare const RbacConfigSchema: z.ZodObject<{
378
435
  * ```
379
436
  */
380
437
  type RbacConfig = z.infer<typeof RbacConfigSchema>;
438
+ /**
439
+ * 可选账号闲置扫描;0天关闭自动休眠,不影响明确设置的账号状态与到期时间。
440
+ * @example
441
+ * ```ts
442
+ * import { AccountConfigSchema } from '@h-ai/iam'
443
+ * const config = AccountConfigSchema.parse({ dormantAfterDays: 90, scanIntervalSeconds: 3600 })
444
+ * ```
445
+ */
446
+ declare const AccountConfigSchema: z.ZodObject<{
447
+ dormantAfterDays: z.ZodDefault<z.ZodNumber>;
448
+ scanIntervalSeconds: z.ZodDefault<z.ZodNumber>;
449
+ }, z.core.$strip>;
381
450
  /**
382
451
  * IAM 统一配置 Schema
383
452
  * @example
@@ -390,6 +459,29 @@ type RbacConfig = z.infer<typeof RbacConfigSchema>;
390
459
  * ```
391
460
  */
392
461
  declare const IamConfigSchema: z.ZodObject<{
462
+ initialCredentials: z.ZodOptional<z.ZodObject<{
463
+ enabled: z.ZodDefault<z.ZodBoolean>;
464
+ }, z.core.$strip>>;
465
+ reauthentication: z.ZodOptional<z.ZodObject<{
466
+ enabled: z.ZodDefault<z.ZodBoolean>;
467
+ operations: z.ZodDefault<z.ZodArray<z.ZodString>>;
468
+ ttlSeconds: z.ZodDefault<z.ZodNumber>;
469
+ }, z.core.$strip>>;
470
+ loginAccess: z.ZodOptional<z.ZodObject<{
471
+ enabled: z.ZodDefault<z.ZodBoolean>;
472
+ allowIps: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6, z.ZodCIDRv4, z.ZodCIDRv6]>>>;
473
+ denyIps: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodIPv4, z.ZodIPv6, z.ZodCIDRv4, z.ZodCIDRv6]>>>;
474
+ timezone: z.ZodDefault<z.ZodString>;
475
+ windows: z.ZodDefault<z.ZodArray<z.ZodObject<{
476
+ days: z.ZodArray<z.ZodNumber>;
477
+ start: z.ZodString;
478
+ end: z.ZodString;
479
+ }, z.core.$strip>>>;
480
+ }, z.core.$strip>>;
481
+ accounts: z.ZodOptional<z.ZodObject<{
482
+ dormantAfterDays: z.ZodDefault<z.ZodNumber>;
483
+ scanIntervalSeconds: z.ZodDefault<z.ZodNumber>;
484
+ }, z.core.$strip>>;
393
485
  ui: z.ZodOptional<z.ZodObject<{
394
486
  variant: z.ZodDefault<z.ZodEnum<{
395
487
  card: "card";
@@ -409,7 +501,10 @@ declare const IamConfigSchema: z.ZodObject<{
409
501
  requireLowercase: z.ZodDefault<z.ZodBoolean>;
410
502
  requireNumber: z.ZodDefault<z.ZodBoolean>;
411
503
  requireSpecialChar: z.ZodDefault<z.ZodBoolean>;
504
+ minCharacterClasses: z.ZodDefault<z.ZodNumber>;
412
505
  expirationDays: z.ZodDefault<z.ZodNumber>;
506
+ preventSamePassword: z.ZodDefault<z.ZodBoolean>;
507
+ requireInitialChange: z.ZodDefault<z.ZodBoolean>;
413
508
  }, z.core.$strip>>;
414
509
  otp: z.ZodOptional<z.ZodObject<{
415
510
  email: z.ZodDefault<z.ZodBoolean>;
@@ -464,14 +559,40 @@ declare const IamConfigSchema: z.ZodObject<{
464
559
  showOnRegister: z.ZodDefault<z.ZodBoolean>;
465
560
  showOnLogin: z.ZodDefault<z.ZodBoolean>;
466
561
  }, z.core.$strip>>;
562
+ captcha: z.ZodDefault<z.ZodObject<{
563
+ enabled: z.ZodDefault<z.ZodBoolean>;
564
+ ttlSeconds: z.ZodDefault<z.ZodNumber>;
565
+ cost: z.ZodDefault<z.ZodNumber>;
566
+ maxCounter: z.ZodDefault<z.ZodNumber>;
567
+ }, z.core.$strip>>;
467
568
  security: z.ZodDefault<z.ZodObject<{
569
+ lockoutEnabled: z.ZodDefault<z.ZodBoolean>;
570
+ failureWindow: z.ZodDefault<z.ZodNumber>;
468
571
  maxLoginAttempts: z.ZodDefault<z.ZodNumber>;
469
572
  lockoutDuration: z.ZodDefault<z.ZodNumber>;
470
573
  }, z.core.$strip>>;
471
574
  session: z.ZodOptional<z.ZodObject<{
472
575
  maxAge: z.ZodDefault<z.ZodNumber>;
576
+ endOnPageHide: z.ZodDefault<z.ZodBoolean>;
473
577
  sliding: z.ZodDefault<z.ZodBoolean>;
474
578
  singleDevice: z.ZodDefault<z.ZodBoolean>;
579
+ singleDeviceMode: z.ZodDefault<z.ZodEnum<{
580
+ replace: "replace";
581
+ reject: "reject";
582
+ }>>;
583
+ maxSessions: z.ZodDefault<z.ZodNumber>;
584
+ terminalLimits: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
585
+ web: "web";
586
+ app: "app";
587
+ desktop: "desktop";
588
+ api: "api";
589
+ }> & z.core.$partial, z.ZodNumber>>;
590
+ terminalLimitMode: z.ZodDefault<z.ZodEnum<{
591
+ replace: "replace";
592
+ reject: "reject";
593
+ }>>;
594
+ idleTimeout: z.ZodDefault<z.ZodNumber>;
595
+ absoluteTimeout: z.ZodDefault<z.ZodNumber>;
475
596
  refreshTokenMaxAge: z.ZodDefault<z.ZodNumber>;
476
597
  }, z.core.$strip>>;
477
598
  rbac: z.ZodDefault<z.ZodObject<{
@@ -717,6 +838,8 @@ interface PermissionQueryOptions extends PaginationOptionsInput {
717
838
  * ```
718
839
  */
719
840
  interface Permission {
841
+ /** 此资源权限要求二次认证的操作ID;与文件清单取并集,空或null表示不追加。 */
842
+ sensitiveOperations?: string[] | null;
720
843
  /** 权限 ID */
721
844
  id: string;
722
845
  /** 权限代码(如 users:read, posts:write) */
@@ -777,6 +900,10 @@ interface Role {
777
900
  * ```
778
901
  */
779
902
  interface AuthzOperations {
903
+ /** 实时读取RBAC中配置的敏感操作;RBAC关闭时为空,读取失败须拒绝受保护操作。 */
904
+ getSensitiveOperations: () => Promise<HaiResult<string[]>>;
905
+ /** 设置资源权限的敏感操作清单;空数组清除数据库追加规则,不清除文件中的规则。 */
906
+ setPermissionSensitiveOperations: (permissionId: string, operations: string[]) => Promise<HaiResult<void>>;
780
907
  /** 查询当前角色与权限代码,一次读取角色并批量聚合权限,不依赖会话缓存。 */
781
908
  getUserAuthorization: (userId: string) => Promise<HaiResult<Pick<Session, 'roles' | 'permissions'>>>;
782
909
  /**
@@ -1050,6 +1177,16 @@ interface User {
1050
1177
  avatarUrl?: string;
1051
1178
  /** 是否启用 */
1052
1179
  enabled: boolean;
1180
+ /** 账号类型;未设置时为长期账号。 */
1181
+ accountType?: 'permanent' | 'temporary';
1182
+ /** 账号生命周期;与管理员 enabled 开关共同决定可用性。 */
1183
+ accountStatus?: 'active' | 'dormant' | 'closed';
1184
+ /** 临时账号到期时间;长期账号可为 null,临时账号必须设置。 */
1185
+ accountExpiresAt?: Date | null;
1186
+ /** 最近成功登录时间,失败尝试不更新。 */
1187
+ lastLoginAt?: Date | null;
1188
+ /** 初始凭据尚未更换;此时不能签发或使用普通业务会话。 */
1189
+ mustChangePassword?: boolean;
1053
1190
  /** 是否邮箱验证 */
1054
1191
  emailVerified?: boolean;
1055
1192
  /** 是否手机验证 */
@@ -1113,6 +1250,8 @@ interface StoredUser extends User {
1113
1250
  passwordUpdatedAt?: Date;
1114
1251
  /** 登录失败次数 */
1115
1252
  loginFailedCount?: number;
1253
+ /** 当前固定失败计数窗口的起点。 */
1254
+ firstLoginFailedAt?: Date;
1116
1255
  /** 最后登录失败时间 */
1117
1256
  lastLoginFailedAt?: Date;
1118
1257
  /** 锁定截止时间 */
@@ -1127,6 +1266,14 @@ interface StoredUser extends User {
1127
1266
  * ```
1128
1267
  */
1129
1268
  interface RegisterOptions {
1269
+ /** 可选交互挑战证明;管理端 createUser/inviteUser 不使用。 */
1270
+ captcha?: string;
1271
+ /** 服务端管理入口可指定临时账号;公开注册接口不应允许修改生命周期字段。 */
1272
+ accountType?: 'permanent' | 'temporary';
1273
+ /** 管理入口指定初始状态;公开注册 Schema 不接受此字段。 */
1274
+ accountStatus?: 'active' | 'dormant' | 'closed';
1275
+ /** 临时账号的到期时间。 */
1276
+ accountExpiresAt?: Date;
1130
1277
  /** 用户名 */
1131
1278
  username: string;
1132
1279
  /** 邮箱 */
@@ -1199,6 +1346,14 @@ interface UpdateCurrentUserInput {
1199
1346
  * ```
1200
1347
  */
1201
1348
  interface UserOperations {
1349
+ /**
1350
+ * 创建独立随机初始凭据并发送短期单次邀请;不返回或通知原始初始密码。
1351
+ * initialCredentials.enabled、passwordReset 与通知通道必须就绪;接收人使用现有重置页面设密。
1352
+ * 投递未知时保留已创建账号并返回失败;核对后可通过重置通知流程恢复。
1353
+ * @param options - 可信管理端输入,必须包含通知通道对应的邮箱/手机号。
1354
+ * @returns 创建结果或失败;不能把通知结果未知当作未创建账号。
1355
+ */
1356
+ inviteUser: (options: Omit<RegisterOptions, 'password'>) => Promise<HaiResult<RegisterResult>>;
1202
1357
  /** 批量查询最多 1000 个用户 ID,去重并保持输入顺序,忽略不存在的 ID;可批量包含角色。 */
1203
1358
  getUsers: (userIds: readonly string[], options?: {
1204
1359
  include?: ('roles')[];
@@ -1253,6 +1408,17 @@ interface UserOperations {
1253
1408
  * @returns 成功返回分页用户列表
1254
1409
  */
1255
1410
  listUsers: (options?: ListUsersOptions) => Promise<HaiResult<PaginatedResult<User>>>;
1411
+ /**
1412
+ * 依据 accounts.dormantAfterDays 原子休眠长期未登录的账号,返回数量;0天时不执行。
1413
+ * IAM 开启自动扫描时定时调用;外露管理接口须自行验证管理员权限。
1414
+ * @example
1415
+ * ```ts
1416
+ * import { iam } from '@h-ai/iam'
1417
+ * const scanned = await iam.user.scanInactiveAccounts()
1418
+ * if (!scanned.success) throw new Error(scanned.error.message)
1419
+ * ```
1420
+ */
1421
+ scanInactiveAccounts: () => Promise<HaiResult<number>>;
1256
1422
  /**
1257
1423
  * 更新用户信息
1258
1424
  *
@@ -1282,6 +1448,22 @@ interface UserOperations {
1282
1448
  * @returns 成功返回 ok;用户不存在返回 USER_NOT_FOUND,密码不合规返回 PASSWORD_POLICY_VIOLATION
1283
1449
  */
1284
1450
  adminResetPassword: (userId: string, newPassword: string) => Promise<HaiResult<void>>;
1451
+ /**
1452
+ * 使用原凭据完成首次或过期改密,不需要先获得普通会话。
1453
+ * 仍执行账号状态、旧密码校验、失败锁定及新密码策略;成功后需重新登录。
1454
+ * @example
1455
+ * ```ts
1456
+ * import { iam } from '@h-ai/iam'
1457
+ * const changed = await iam.user.renewPassword({ identifier: 'alice', password: 'Temporary123!', newPassword: 'ChosenPassword456!' })
1458
+ * if (!changed.success) throw new Error(changed.error.message)
1459
+ * ```
1460
+ */
1461
+ renewPassword: (input: {
1462
+ identifier: string;
1463
+ password: string;
1464
+ newPassword: string;
1465
+ captcha?: string;
1466
+ }) => Promise<HaiResult<void>>;
1285
1467
  /**
1286
1468
  * 修改密码
1287
1469
  *
@@ -1320,7 +1502,9 @@ interface UserOperations {
1320
1502
  * requested.error.code // 投递未知不能当作成功或由调用端擅自重发通知。
1321
1503
  * ```
1322
1504
  */
1323
- requestPasswordReset: (identifier: string) => Promise<HaiResult<void>>;
1505
+ requestPasswordReset: (identifier: string, options?: {
1506
+ captcha?: string;
1507
+ }) => Promise<HaiResult<void>>;
1324
1508
  /**
1325
1509
  * 确认密码重置
1326
1510
  *
@@ -1423,6 +1607,8 @@ interface AuthResult {
1423
1607
  * ```
1424
1608
  */
1425
1609
  interface Session {
1610
+ /** 登录时固定的终端分组;旧记录未设置时归为 web,刷新不能切换分组。 */
1611
+ terminalType?: 'web' | 'app' | 'desktop' | 'api';
1426
1612
  /** 会话内容版本;显式更新产生新版本,内部滑动续期保留版本。 */
1427
1613
  version: string;
1428
1614
  /** 认证快照绑定的持久凭据代;改密后的旧会话即使缓存清理失败也拒绝。 */
@@ -1449,7 +1635,9 @@ interface Session {
1449
1635
  accessToken: string;
1450
1636
  /** 创建时间 */
1451
1637
  createdAt: Date;
1452
- /** 最后活动时间 */
1638
+ /** 首次签发时间;刷新保留,用于绝对期限。旧记录未设置时以 createdAt 为准。 */
1639
+ startedAt?: Date;
1640
+ /** 最后活动时间;启用闲置策略时,自动 refresh 不延长此值。 */
1453
1641
  lastActiveAt: Date;
1454
1642
  /** 过期时间 */
1455
1643
  expiresAt: Date;
@@ -1481,6 +1669,8 @@ type SessionData = Record<string, unknown> & {
1481
1669
  * ```
1482
1670
  */
1483
1671
  interface CreateSessionOptions {
1672
+ /** 可信宿主提供的终端分组;会话签发后不可通过 update/refresh 改变。 */
1673
+ terminalType?: 'web' | 'app' | 'desktop' | 'api';
1484
1674
  /** 策略已验证的凭据代;创建前须与当前数据库核对,省略时仅供可信服务端按当前用户签发。 */
1485
1675
  expectedCredentialVersion?: string;
1486
1676
  /** 服务端已验证的 API Key 绑定;不得来自未验证客户端输入。 */
@@ -1638,6 +1828,145 @@ interface SessionFieldUpdates {
1638
1828
  permissions?: string[];
1639
1829
  }
1640
1830
 
1831
+ /**
1832
+ * @h-ai/iam — 一次性票据类型
1833
+ *
1834
+ * 定义通用的短期、一次性能力票据(capability ticket):由已认证的上下文签发,
1835
+ * 绑定主体、用途与授权信息,在无法携带 Bearer Token 的通道(如 WebSocket URL)中
1836
+ * 用作一次性入场凭证。典型用途:AI 语音 WebSocket 接入。
1837
+ * @module ticket/iam-ticket-types
1838
+ */
1839
+
1840
+ /**
1841
+ * 票据授权绑定信息
1842
+ *
1843
+ * 消费时原样返回,供服务端确认本次操作、模型、会话等参数与签发时一致。
1844
+ * 除固定字段外允许应用自定义键值。
1845
+ * @example
1846
+ * ```ts
1847
+ * import type { TicketGrant } from '@h-ai/iam'
1848
+ * const value: TicketGrant = { operation: 'transcribe', model: 'speech-model', sessionId: 'conversation-1' }
1849
+ * ```
1850
+ */
1851
+ interface TicketGrant {
1852
+ /** 操作类型(如 `'transcribe'` | `'synthesize'` 或应用自定义) */
1853
+ operation?: string;
1854
+ /** 模型 ID */
1855
+ model?: string;
1856
+ /** 会话 ID */
1857
+ sessionId?: string;
1858
+ /** 应用自定义绑定字段 */
1859
+ [key: string]: unknown;
1860
+ }
1861
+ /**
1862
+ * 签发一次性票据的选项
1863
+ * @example
1864
+ * ```ts
1865
+ * import type { IssueTicketOptions } from '@h-ai/iam'
1866
+ * const value: IssueTicketOptions = { subjectId: 'user-1', purpose: 'ai-audio', ttlMs: 30000, grant: { operation: 'transcribe' } }
1867
+ * ```
1868
+ */
1869
+ interface IssueTicketOptions {
1870
+ /** 主体 ID(票据绑定的用户 / 主体,消费时原样返回) */
1871
+ subjectId: string;
1872
+ /** 票据用途(如 `'ai-audio'`),消费时校验一致 */
1873
+ purpose: string;
1874
+ /** 授权绑定信息(操作 / 模型 / 会话等,消费时原样返回) */
1875
+ grant?: TicketGrant;
1876
+ /** 有效期(毫秒,默认 30000) */
1877
+ ttlMs?: number;
1878
+ }
1879
+ /**
1880
+ * 签发结果
1881
+ * @example
1882
+ * ```ts
1883
+ * import { iam, type IssuedTicket } from '@h-ai/iam'
1884
+ * const issued = await iam.ticket.issue({ subjectId: 'user-1', purpose: 'ai-audio' })
1885
+ * if (issued.success) {
1886
+ * const value: IssuedTicket = issued.data
1887
+ * value.expiresAt // 不能延长服务端签发期限;票据只能消费一次。
1888
+ * }
1889
+ * ```
1890
+ */
1891
+ interface IssuedTicket {
1892
+ /** 一次性票据值(密码学安全随机,base64url) */
1893
+ ticket: string;
1894
+ /** 过期时间(Unix 毫秒) */
1895
+ expiresAt: number;
1896
+ }
1897
+ /**
1898
+ * 消费票据的选项
1899
+ * @example
1900
+ * ```ts
1901
+ * import type { ConsumeTicketOptions } from '@h-ai/iam'
1902
+ * const value: ConsumeTicketOptions = { purpose: 'ai-audio' }
1903
+ * ```
1904
+ */
1905
+ interface ConsumeTicketOptions {
1906
+ /** 期望用途;与签发用途不一致时返回 `TICKET_INVALID`(防止跨用途重放) */
1907
+ purpose?: string;
1908
+ }
1909
+ /**
1910
+ * 消费结果(校验通过并原子消费后返回)
1911
+ * @example
1912
+ * ```ts
1913
+ * import { iam, type ConsumedTicket } from '@h-ai/iam'
1914
+ * const consumed = await iam.ticket.consume('ticket-from-upgrade-request', { purpose: 'ai-audio' })
1915
+ * if (consumed.success) {
1916
+ * const authorization: ConsumedTicket = consumed.data
1917
+ * authorization.grant.operation // 校验与本次请求操作相同。
1918
+ * }
1919
+ * ```
1920
+ */
1921
+ interface ConsumedTicket {
1922
+ /** 票据绑定的主体 ID */
1923
+ subjectId: string;
1924
+ /** 票据用途 */
1925
+ purpose: string;
1926
+ /** 授权绑定信息 */
1927
+ grant: TicketGrant;
1928
+ }
1929
+ /**
1930
+ * 一次性票据操作接口(通过 `iam.ticket` 访问)
1931
+ *
1932
+ * 提供密码学安全、带 TTL、原子单次消费的能力票据签发与消费。
1933
+ * @example
1934
+ * ```ts
1935
+ * import { iam, type TicketOperations } from '@h-ai/iam'
1936
+ * // 应用已完成 RelDB、Cache、Crypto 和 IAM 初始化。
1937
+ * const operations: TicketOperations = iam.ticket
1938
+ * const result = await operations.issue({ subjectId: 'user-1', purpose: 'ai-audio', ttlMs: 30000 })
1939
+ * if (!result.success) {
1940
+ * result.error.code // 调用方将失败交给统一错误边界。
1941
+ * }
1942
+ * else {
1943
+ * result.data
1944
+ * }
1945
+ * ```
1946
+ */
1947
+ interface TicketOperations {
1948
+ /**
1949
+ * 签发一次性票据
1950
+ *
1951
+ * 生成密码学安全随机值,绑定主体 / 用途 / 授权信息并按 TTL 存入 cache。
1952
+ *
1953
+ * @param options - 签发选项
1954
+ * @returns 票据值与过期时间
1955
+ */
1956
+ issue: (options: IssueTicketOptions) => Promise<HaiResult<IssuedTicket>>;
1957
+ /**
1958
+ * 原子消费一次性票据
1959
+ *
1960
+ * 单次有效:并发消费同一票据时只有一个成功,其余返回 `TICKET_INVALID`。
1961
+ * 票据不存在 / 已过期 / 已消费 / 用途不匹配时返回错误。
1962
+ *
1963
+ * @param ticket - 票据值
1964
+ * @param options - 消费选项(可校验用途)
1965
+ * @returns 主体 + 用途 + 授权信息
1966
+ */
1967
+ consume: (ticket: string, options?: ConsumeTicketOptions) => Promise<HaiResult<ConsumedTicket>>;
1968
+ }
1969
+
1641
1970
  /**
1642
1971
  * @h-ai/iam — 认证类型定义
1643
1972
  *
@@ -1645,6 +1974,44 @@ interface SessionFieldUpdates {
1645
1974
  * @module iam-authn-types
1646
1975
  */
1647
1976
 
1977
+ /**
1978
+ * 交互鉴别用途;同一挑战不能用于另一入口,API Key 机器鉴别不使用它。
1979
+ * @example
1980
+ * ```ts
1981
+ * import type { CaptchaOperation } from '@h-ai/iam'
1982
+ * const operation: CaptchaOperation = 'login'
1983
+ * ```
1984
+ */
1985
+ type CaptchaOperation = 'login' | 'register' | 'sendOtp' | 'passwordReset' | 'renewPassword';
1986
+ /**
1987
+ * 可公开的 ALTCHA 挑战;签名秘密仅存共享缓存,不包含在返回值中。
1988
+ * @example
1989
+ * ```ts
1990
+ * import { iam, type IamCaptchaChallenge } from '@h-ai/iam'
1991
+ * const result = await iam.auth.createCaptcha({ operation: 'login' })
1992
+ * if (result.success) { const challenge: IamCaptchaChallenge = result.data; void challenge.id }
1993
+ * ```
1994
+ */
1995
+ interface IamCaptchaChallenge {
1996
+ id: string;
1997
+ challenge: Challenge;
1998
+ }
1999
+ /**
2000
+ * 由可信 HTTP 宿主提供的登录元数据,独立于客户端凭据输入。
2001
+ * @example
2002
+ * ```ts
2003
+ * import type { AuthRequestContext } from '@h-ai/iam'
2004
+ * const context: AuthRequestContext = { ip: '192.0.2.10', requestId: 'request-1' }
2005
+ * ```
2006
+ */
2007
+ interface AuthRequestContext {
2008
+ /** 宿主识别的接入终端分组;不是物理设备证明,省略时普通登录归为 web。 */
2009
+ terminalType?: 'web' | 'app' | 'desktop' | 'api';
2010
+ /** socket/平台或受信代理解析后的地址;不能直接复制 X-Forwarded-For。 */
2011
+ ip?: string;
2012
+ userAgent?: string;
2013
+ requestId?: string;
2014
+ }
1648
2015
  /**
1649
2016
  * 用户凭证(用于密码登录)
1650
2017
  * @example
@@ -1654,6 +2021,9 @@ interface SessionFieldUpdates {
1654
2021
  * ```
1655
2022
  */
1656
2023
  interface PasswordCredentials {
2024
+ /** 原地恢复会话时限定原主体;鉴别成功但不是此用户时也不签发新会话。 */
2025
+ expectedUserId?: string;
2026
+ captcha?: string;
1657
2027
  /** 用户名/邮箱/手机号 */
1658
2028
  identifier: string;
1659
2029
  /** 密码 */
@@ -1668,6 +2038,9 @@ interface PasswordCredentials {
1668
2038
  * ```
1669
2039
  */
1670
2040
  interface OtpCredentials {
2041
+ /** 会话恢复限定原主体,不能以其他账号的有效验证码恢复原业务动作。 */
2042
+ expectedUserId?: string;
2043
+ captcha?: string;
1671
2044
  /** 邮箱/手机号 */
1672
2045
  identifier: string;
1673
2046
  /** 验证码 */
@@ -1682,6 +2055,9 @@ interface OtpCredentials {
1682
2055
  * ```
1683
2056
  */
1684
2057
  interface LdapCredentials {
2058
+ /** 会话恢复限定原主体;其他账号鉴别成功也不签发恢复会话。 */
2059
+ expectedUserId?: string;
2060
+ captcha?: string;
1685
2061
  /** 用户名 */
1686
2062
  username: string;
1687
2063
  /** 密码 */
@@ -1781,29 +2157,54 @@ interface AuthStrategy {
1781
2157
  * ```
1782
2158
  */
1783
2159
  interface AuthnOperations {
2160
+ /** 生成短期单用、自托管挑战;启用后各交互入口在服务端校验解答。 */
2161
+ createCaptcha: (input: {
2162
+ operation: CaptchaOperation;
2163
+ }) => Promise<HaiResult<IamCaptchaChallenge>>;
2164
+ /**
2165
+ * 验证当前会话和原密码,为已配置的敏感操作签发短期单次证明。
2166
+ * 不创建新会话,不替代操作本身的权限/资源检查。
2167
+ * @param accessToken - 当前会话令牌。
2168
+ * @param password - 原密码;失败计数与登录共用。
2169
+ * @param operation - 配置中选定的操作 ID。
2170
+ * @returns 绑定用户、会话与操作的单次票据,或鉴别失败。
2171
+ */
2172
+ reauthenticate: (accessToken: string, password: string, operation: string) => Promise<HaiResult<IssuedTicket>>;
2173
+ /**
2174
+ * 操作入口完成权限检查后调用;关闭策略/未选操作仅验证当前会话。
2175
+ * 选定操作原子消费证明;不能跨会话、跨操作或重复使用。
2176
+ * @param accessToken - 当前会话令牌。
2177
+ * @param operation - 服务端确定的操作 ID,不能由客户端选择要执行的守卫。
2178
+ * @param ticket - reauthenticate 签发的短期证明。
2179
+ * @returns 允许继续时成功;拒绝或基础设施失败时返回错误。
2180
+ */
2181
+ checkSensitiveOperation: (accessToken: string, operation: string, ticket?: string) => Promise<HaiResult<void>>;
1784
2182
  /**
1785
2183
  * 登录(使用密码)
1786
2184
  *
1787
2185
  * 检查登录方式启用 → 密码策略认证 → 创建会话 → 返回令牌。
1788
2186
  *
1789
2187
  * @param credentials - 密码凭证(identifier + password)
2188
+ * @param context - 宿主提供的可信登录元数据,不从凭据输入复制 IP。
1790
2189
  * @returns 成功返回 AuthResult(用户信息、令牌、协议展示);失败返回错误
1791
2190
  */
1792
- login: (credentials: PasswordCredentials) => Promise<HaiResult<AuthResult>>;
2191
+ login: (credentials: PasswordCredentials, context?: AuthRequestContext) => Promise<HaiResult<AuthResult>>;
1793
2192
  /**
1794
2193
  * 使用验证码登录
1795
2194
  *
1796
2195
  * @param credentials - OTP 凭证(identifier + code)
2196
+ * @param context - 宿主提供的可信登录元数据,不从凭据输入复制 IP。
1797
2197
  * @returns 成功返回 AuthResult;验证码无效/过期返回 OTP_INVALID
1798
2198
  */
1799
- loginWithOtp: (credentials: OtpCredentials) => Promise<HaiResult<AuthResult>>;
2199
+ loginWithOtp: (credentials: OtpCredentials, context?: AuthRequestContext) => Promise<HaiResult<AuthResult>>;
1800
2200
  /**
1801
2201
  * 使用 LDAP 登录
1802
2202
  *
1803
2203
  * @param credentials - LDAP 凭证(username + password)
2204
+ * @param context - 宿主提供的可信登录元数据,不从凭据输入复制 IP。
1804
2205
  * @returns 成功返回 AuthResult(自动同步本地用户);失败返回错误
1805
2206
  */
1806
- loginWithLdap: (credentials: LdapCredentials) => Promise<HaiResult<AuthResult>>;
2207
+ loginWithLdap: (credentials: LdapCredentials, context?: AuthRequestContext) => Promise<HaiResult<AuthResult>>;
1807
2208
  /**
1808
2209
  * 使用 API Key 登录
1809
2210
  *
@@ -1811,9 +2212,10 @@ interface AuthnOperations {
1811
2212
  * 空 scopes 无操作权限;显式 * 也不超出主体权限。受限 key 通过 permission 授权,不保留角色入口。
1812
2213
  *
1813
2214
  * @param credentials - API Key 凭证
2215
+ * @param context - 宿主提供的可信登录元数据,不从凭据输入复制 IP。
1814
2216
  * @returns 成功返回 AuthResult;API Key 无效/过期/禁用返回对应错误
1815
2217
  */
1816
- loginWithApiKey: (credentials: ApiKeyCredentials) => Promise<HaiResult<AuthResult>>;
2218
+ loginWithApiKey: (credentials: ApiKeyCredentials, context?: AuthRequestContext) => Promise<HaiResult<AuthResult>>;
1817
2219
  /**
1818
2220
  * 登出
1819
2221
  *
@@ -1840,7 +2242,9 @@ interface AuthnOperations {
1840
2242
  * @param identifier - 用户标识(邮箱/手机号)
1841
2243
  * @returns 成功返回验证码过期时间;频率限制返回 OTP_RESEND_TOO_FAST
1842
2244
  */
1843
- sendOtp: (identifier: string) => Promise<HaiResult<{
2245
+ sendOtp: (identifier: string, options?: {
2246
+ captcha?: string;
2247
+ }) => Promise<HaiResult<{
1844
2248
  expiresAt: Date;
1845
2249
  }>>;
1846
2250
  /**
@@ -1852,7 +2256,7 @@ interface AuthnOperations {
1852
2256
  * @param options - 注册选项(用户名、密码、邮箱等)
1853
2257
  * @returns 成功返回 AuthResult(用户信息、令牌、协议展示);失败返回对应错误码
1854
2258
  */
1855
- registerAndLogin: (options: RegisterOptions) => Promise<HaiResult<AuthResult>>;
2259
+ registerAndLogin: (options: RegisterOptions, context?: AuthRequestContext) => Promise<HaiResult<AuthResult>>;
1856
2260
  }
1857
2261
 
1858
2262
  /**
@@ -1938,6 +2342,10 @@ type LdapClientFactory = (config: LdapConfig) => Promise<HaiResult<LdapClient>>;
1938
2342
  * ```
1939
2343
  */
1940
2344
  interface IamPublicConfig {
2345
+ /** 只公开是否需要交互挑战,不公开秘密或缓存状态。 */
2346
+ captcha: {
2347
+ enabled: boolean;
2348
+ };
1941
2349
  /** 页面显示密码策略,不包含密码哈希或账户信息。 */
1942
2350
  password: ReturnType<typeof PasswordConfigSchema.parse>;
1943
2351
  /** 自助注册开关;管理端创建账户仍需要独立授权。 */
@@ -1969,146 +2377,17 @@ interface IamPublicConfig {
1969
2377
  /** 默认 access 有效时长,单位秒;真实认证期限由服务端会话状态决定。 */
1970
2378
  session: {
1971
2379
  maxAge: number;
2380
+ endOnPageHide: boolean;
2381
+ };
2382
+ /** 仅公开操作清单,便于界面在选定操作前请求再鉴别。 */
2383
+ reauthentication: {
2384
+ enabled: boolean;
2385
+ operations: string[];
2386
+ };
2387
+ /** 邀请入口同时要求开关、密码重置与通知通道就绪。 */
2388
+ initialCredentials: {
2389
+ enabled: boolean;
1972
2390
  };
1973
- }
1974
-
1975
- /**
1976
- * @h-ai/iam — 一次性票据类型
1977
- *
1978
- * 定义通用的短期、一次性能力票据(capability ticket):由已认证的上下文签发,
1979
- * 绑定主体、用途与授权信息,在无法携带 Bearer Token 的通道(如 WebSocket URL)中
1980
- * 用作一次性入场凭证。典型用途:AI 语音 WebSocket 接入。
1981
- * @module ticket/iam-ticket-types
1982
- */
1983
-
1984
- /**
1985
- * 票据授权绑定信息
1986
- *
1987
- * 消费时原样返回,供服务端确认本次操作、模型、会话等参数与签发时一致。
1988
- * 除固定字段外允许应用自定义键值。
1989
- * @example
1990
- * ```ts
1991
- * import type { TicketGrant } from '@h-ai/iam'
1992
- * const value: TicketGrant = { operation: 'transcribe', model: 'speech-model', sessionId: 'conversation-1' }
1993
- * ```
1994
- */
1995
- interface TicketGrant {
1996
- /** 操作类型(如 `'transcribe'` | `'synthesize'` 或应用自定义) */
1997
- operation?: string;
1998
- /** 模型 ID */
1999
- model?: string;
2000
- /** 会话 ID */
2001
- sessionId?: string;
2002
- /** 应用自定义绑定字段 */
2003
- [key: string]: unknown;
2004
- }
2005
- /**
2006
- * 签发一次性票据的选项
2007
- * @example
2008
- * ```ts
2009
- * import type { IssueTicketOptions } from '@h-ai/iam'
2010
- * const value: IssueTicketOptions = { subjectId: 'user-1', purpose: 'ai-audio', ttlMs: 30000, grant: { operation: 'transcribe' } }
2011
- * ```
2012
- */
2013
- interface IssueTicketOptions {
2014
- /** 主体 ID(票据绑定的用户 / 主体,消费时原样返回) */
2015
- subjectId: string;
2016
- /** 票据用途(如 `'ai-audio'`),消费时校验一致 */
2017
- purpose: string;
2018
- /** 授权绑定信息(操作 / 模型 / 会话等,消费时原样返回) */
2019
- grant?: TicketGrant;
2020
- /** 有效期(毫秒,默认 30000) */
2021
- ttlMs?: number;
2022
- }
2023
- /**
2024
- * 签发结果
2025
- * @example
2026
- * ```ts
2027
- * import { iam, type IssuedTicket } from '@h-ai/iam'
2028
- * const issued = await iam.ticket.issue({ subjectId: 'user-1', purpose: 'ai-audio' })
2029
- * if (issued.success) {
2030
- * const value: IssuedTicket = issued.data
2031
- * value.expiresAt // 不能延长服务端签发期限;票据只能消费一次。
2032
- * }
2033
- * ```
2034
- */
2035
- interface IssuedTicket {
2036
- /** 一次性票据值(密码学安全随机,base64url) */
2037
- ticket: string;
2038
- /** 过期时间(Unix 毫秒) */
2039
- expiresAt: number;
2040
- }
2041
- /**
2042
- * 消费票据的选项
2043
- * @example
2044
- * ```ts
2045
- * import type { ConsumeTicketOptions } from '@h-ai/iam'
2046
- * const value: ConsumeTicketOptions = { purpose: 'ai-audio' }
2047
- * ```
2048
- */
2049
- interface ConsumeTicketOptions {
2050
- /** 期望用途;与签发用途不一致时返回 `TICKET_INVALID`(防止跨用途重放) */
2051
- purpose?: string;
2052
- }
2053
- /**
2054
- * 消费结果(校验通过并原子消费后返回)
2055
- * @example
2056
- * ```ts
2057
- * import { iam, type ConsumedTicket } from '@h-ai/iam'
2058
- * const consumed = await iam.ticket.consume('ticket-from-upgrade-request', { purpose: 'ai-audio' })
2059
- * if (consumed.success) {
2060
- * const authorization: ConsumedTicket = consumed.data
2061
- * authorization.grant.operation // 校验与本次请求操作相同。
2062
- * }
2063
- * ```
2064
- */
2065
- interface ConsumedTicket {
2066
- /** 票据绑定的主体 ID */
2067
- subjectId: string;
2068
- /** 票据用途 */
2069
- purpose: string;
2070
- /** 授权绑定信息 */
2071
- grant: TicketGrant;
2072
- }
2073
- /**
2074
- * 一次性票据操作接口(通过 `iam.ticket` 访问)
2075
- *
2076
- * 提供密码学安全、带 TTL、原子单次消费的能力票据签发与消费。
2077
- * @example
2078
- * ```ts
2079
- * import { iam, type TicketOperations } from '@h-ai/iam'
2080
- * // 应用已完成 RelDB、Cache、Crypto 和 IAM 初始化。
2081
- * const operations: TicketOperations = iam.ticket
2082
- * const result = await operations.issue({ subjectId: 'user-1', purpose: 'ai-audio', ttlMs: 30000 })
2083
- * if (!result.success) {
2084
- * result.error.code // 调用方将失败交给统一错误边界。
2085
- * }
2086
- * else {
2087
- * result.data
2088
- * }
2089
- * ```
2090
- */
2091
- interface TicketOperations {
2092
- /**
2093
- * 签发一次性票据
2094
- *
2095
- * 生成密码学安全随机值,绑定主体 / 用途 / 授权信息并按 TTL 存入 cache。
2096
- *
2097
- * @param options - 签发选项
2098
- * @returns 票据值与过期时间
2099
- */
2100
- issue: (options: IssueTicketOptions) => Promise<HaiResult<IssuedTicket>>;
2101
- /**
2102
- * 原子消费一次性票据
2103
- *
2104
- * 单次有效:并发消费同一票据时只有一个成功,其余返回 `TICKET_INVALID`。
2105
- * 票据不存在 / 已过期 / 已消费 / 用途不匹配时返回错误。
2106
- *
2107
- * @param ticket - 票据值
2108
- * @param options - 消费选项(可校验用途)
2109
- * @returns 主体 + 用途 + 授权信息
2110
- */
2111
- consume: (ticket: string, options?: ConsumeTicketOptions) => Promise<HaiResult<ConsumedTicket>>;
2112
2391
  }
2113
2392
 
2114
2393
  /**
@@ -2147,6 +2426,15 @@ declare const HaiIamError: {
2147
2426
  readonly OTP_EXPIRED: _h_ai_core.HaiErrorDef;
2148
2427
  readonly SECURITY_BUSY: _h_ai_core.HaiErrorDef;
2149
2428
  readonly PASSWORD_RESET_DISABLED: _h_ai_core.HaiErrorDef;
2429
+ readonly PASSWORD_CHANGE_REQUIRED: _h_ai_core.HaiErrorDef;
2430
+ readonly LOGIN_ACCESS_DENIED: _h_ai_core.HaiErrorDef;
2431
+ readonly REAUTHENTICATION_REQUIRED: _h_ai_core.HaiErrorDef;
2432
+ readonly INVITATION_DELIVERY_UNKNOWN: _h_ai_core.HaiErrorDef;
2433
+ readonly INVITATION_DISABLED: _h_ai_core.HaiErrorDef;
2434
+ readonly CAPTCHA_REQUIRED: _h_ai_core.HaiErrorDef;
2435
+ readonly CAPTCHA_INVALID: _h_ai_core.HaiErrorDef;
2436
+ readonly CAPTCHA_DISABLED: _h_ai_core.HaiErrorDef;
2437
+ readonly CAPTCHA_UNAVAILABLE: _h_ai_core.HaiErrorDef;
2150
2438
  readonly SESSION_NOT_FOUND: _h_ai_core.HaiErrorDef;
2151
2439
  readonly SESSION_EXPIRED: _h_ai_core.HaiErrorDef;
2152
2440
  readonly SESSION_INVALID: _h_ai_core.HaiErrorDef;
@@ -2154,6 +2442,7 @@ declare const HaiIamError: {
2154
2442
  readonly TOKEN_EXPIRED: _h_ai_core.HaiErrorDef;
2155
2443
  readonly TOKEN_INVALID: _h_ai_core.HaiErrorDef;
2156
2444
  readonly TOKEN_REFRESH_FAILED: _h_ai_core.HaiErrorDef;
2445
+ readonly SESSION_LIMIT_EXCEEDED: _h_ai_core.HaiErrorDef;
2157
2446
  readonly PERMISSION_DENIED: _h_ai_core.HaiErrorDef;
2158
2447
  readonly ROLE_NOT_FOUND: _h_ai_core.HaiErrorDef;
2159
2448
  readonly PERMISSION_NOT_FOUND: _h_ai_core.HaiErrorDef;
@@ -2297,8 +2586,19 @@ interface IamFunctions {
2297
2586
  close: () => Promise<void>;
2298
2587
  /** 当前脱敏后的配置快照(未初始化时为 null) */
2299
2588
  readonly config: IamConfig | null;
2300
- /** 安全且反映实际可用能力的认证页面配置。 */
2589
+ /** 安全的文件配置快照;含数据库敏感规则的有效配置使用 getPublicConfig()。 */
2301
2590
  readonly publicConfig: IamPublicConfig | null;
2591
+ /**
2592
+ * 读取包含文件与当前RBAC数据库敏感操作并集的公开配置;数据库读取失败返回失败。
2593
+ * @returns 独立公开快照;未初始化或启用策略时数据库故障返回 HaiResult 失败。
2594
+ * @example
2595
+ * ```ts
2596
+ * import { iam } from '@h-ai/iam'
2597
+ * const config = await iam.getPublicConfig()
2598
+ * if (config.success) config.data.reauthentication.operations
2599
+ * ```
2600
+ */
2601
+ getPublicConfig: () => Promise<HaiResult<IamPublicConfig>>;
2302
2602
  /** 是否已初始化 */
2303
2603
  readonly isInitialized: boolean;
2304
2604
  /** 注册功能是否启用(未初始化或未配置时默认启用) */
@@ -2317,4 +2617,4 @@ interface IamFunctions {
2317
2617
  readonly ticket: TicketOperations;
2318
2618
  }
2319
2619
 
2320
- export { type AgreementConfig, AgreementConfigSchema, type AgreementDisplay, type ApiKey, type ApiKeyConfig, ApiKeyConfigSchema, type ApiKeyCredentials, type ApiKeyOperations, type ApiKeySortDirection, type ApiKeySortField, type AuthResult, type AuthStrategy, type AuthStrategyType, AuthStrategyTypeSchema, type AuthUiConfig, AuthUiConfigSchema, type AuthnOperations, type AuthzOperations, type ConsumeTicketOptions, type ConsumedTicket, type CreateApiKeyOptions, type CreateApiKeyResult, type CreateSessionOptions, type Credentials, HaiIamError, type IamConfig, type IamConfigInput, IamConfigSchema, type IamConfigSettingsInput, type IamFunctions, type IamNotificationContext, type IamPublicConfig, type IssueTicketOptions, type IssuedTicket, type LdapClientFactory, type LdapConfig, LdapConfigSchema, type LdapCredentials, type ListApiKeysOptions, type ListUsersOptions, type LoginConfig, LoginConfigSchema, type OtpConfig, OtpConfigSchema, type OtpCredentials, type PasswordConfig, PasswordConfigSchema, type PasswordCredentials, type PasswordResetConfig, PasswordResetConfigSchema, type Permission, type PermissionQueryOptions, type PermissionType, type RbacConfig, RbacConfigSchema, type RegisterConfig, RegisterConfigSchema, type RegisterOptions, type RegisterResult, type Role, type SecurityConfig, SecurityConfigSchema, type Session, type SessionConfig, SessionConfigSchema, type SessionData, type SessionFieldUpdates, type SessionOperations, type StoredUser, type TicketGrant, type TicketOperations, type TokenPair, type UpdateCurrentUserInput, type User, type UserOperations, type UserSortDirection, type UserSortField };
2620
+ export { AccountConfigSchema, type AgreementConfig, AgreementConfigSchema, type AgreementDisplay, type ApiKey, type ApiKeyConfig, ApiKeyConfigSchema, type ApiKeyCredentials, type ApiKeyOperations, type ApiKeySortDirection, type ApiKeySortField, type AuthRequestContext, type AuthResult, type AuthStrategy, type AuthStrategyType, AuthStrategyTypeSchema, type AuthUiConfig, AuthUiConfigSchema, type AuthnOperations, type AuthzOperations, CaptchaConfigSchema, type CaptchaOperation, type ConsumeTicketOptions, type ConsumedTicket, type CreateApiKeyOptions, type CreateApiKeyResult, type CreateSessionOptions, type Credentials, HaiIamError, type IamCaptchaChallenge, type IamConfig, type IamConfigInput, IamConfigSchema, type IamConfigSettingsInput, type IamFunctions, type IamNotificationContext, type IamPublicConfig, type IssueTicketOptions, type IssuedTicket, type LdapClientFactory, type LdapConfig, LdapConfigSchema, type LdapCredentials, type ListApiKeysOptions, type ListUsersOptions, LoginAccessConfigSchema, type LoginConfig, LoginConfigSchema, type OtpConfig, OtpConfigSchema, type OtpCredentials, type PasswordConfig, PasswordConfigSchema, type PasswordCredentials, type PasswordResetConfig, PasswordResetConfigSchema, type Permission, type PermissionQueryOptions, type PermissionType, type RbacConfig, RbacConfigSchema, type RegisterConfig, RegisterConfigSchema, type RegisterOptions, type RegisterResult, type Role, type SecurityConfig, SecurityConfigSchema, type Session, type SessionConfig, SessionConfigSchema, type SessionData, type SessionFieldUpdates, type SessionOperations, type StoredUser, type TicketGrant, type TicketOperations, type TokenPair, type UpdateCurrentUserInput, type User, type UserOperations, type UserSortDirection, type UserSortField };