@amaster.ai/admin-sdk 1.1.72 → 1.1.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/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- interface RequestOptions {
2
- method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
3
- path: string;
4
- body?: unknown;
5
- query?: Record<string, string | number | boolean | undefined>;
6
- }
7
- type RequestFn = <T>(options: RequestOptions) => Promise<T>;
1
+ import * as _amaster_ai_auth_client_rbac from '@amaster.ai/auth-client/rbac';
2
+ import { ScopeType, RequestFn, createRolesModule, createPermissionsModule, createDepartmentsModule } from '@amaster.ai/auth-client/rbac';
3
+ export { AddDepartmentMemberParams, AssignPermissionToRoleParams, AssignPermissionToUserParams, AssigneeType, CreateDepartmentParams, CreatePermissionParams, CreateRoleParams, Department, DepartmentMember, Permission, Role, RoleAssignParams, RoleAssignee, RolePermission, ScopeType, UpdateDepartmentParams, UpdatePermissionParams, UpdatePermissionScopeParams, UpdateRoleParams, UserPermissionException } from '@amaster.ai/auth-client/rbac';
4
+ import * as _amaster_ai_http_client from '@amaster.ai/http-client';
5
+ import * as _amaster_ai_auth_client_tenant_management from '@amaster.ai/auth-client/tenant-management';
6
+ export { TenancyAuthorizationItem, TenancyAuthorizationPage, TenancyAuthorizationQuery, TenancyDataScope, TenancyHuman, TenancyManagedTenant, TenancyRoleAssignmentRequest } from '@amaster.ai/auth-client/tenant-management';
7
+ import * as _amaster_ai_entity_client from '@amaster.ai/entity-client';
8
8
 
9
9
  /**
10
10
  * @packageDocumentation
@@ -18,15 +18,20 @@ type RequestFn = <T>(options: RequestOptions) => Promise<T>;
18
18
  * - **id** (number): Database ID for roles, permissions, departments. Use for roles.get, permissions.listForRole, etc.
19
19
  */
20
20
  interface AdminSDKOptions {
21
- /** Runtime service base URL. Defaults to http://runtime:3000 in edge-function */
21
+ /** Application base URL constructed from the platform-managed APP_URL. */
22
22
  baseURL?: string;
23
- /** Application ID, sent as x-tenant-id header */
23
+ /** Legacy application context. Application-domain construction may omit it. */
24
24
  appId: string;
25
- /** Environment identifier, sent as x-env header. Defaults to "dev" */
25
+ /** Legacy environment context. With baseURL, the backend determines the environment. */
26
26
  env?: string;
27
27
  /** Service key for bypassing user-level auth checks */
28
28
  serviceKey?: string;
29
29
  }
30
+ /** Additive domain-only construction; the existing AdminSDKOptions contract remains unchanged. */
31
+ type AdminSDKConfiguration = AdminSDKOptions | (Omit<AdminSDKOptions, "appId"> & {
32
+ appId?: string;
33
+ baseURL: string;
34
+ });
30
35
  interface CheckPermissionParams {
31
36
  /** Resource type, e.g. "page", "order", "report" */
32
37
  resource: string;
@@ -175,160 +180,6 @@ interface UpdateUserResult {
175
180
  displayName: string | null;
176
181
  updatedAt: string;
177
182
  }
178
- interface Role {
179
- id: number;
180
- code: string;
181
- /** May be null if not set */
182
- displayName: string | null;
183
- /** May be null if not set */
184
- description: string | null;
185
- isSystem: boolean;
186
- createdAt: string;
187
- }
188
- interface CreateRoleParams {
189
- code: string;
190
- displayName?: string;
191
- description?: string;
192
- }
193
- interface UpdateRoleParams {
194
- code?: string;
195
- displayName?: string;
196
- description?: string;
197
- }
198
- type AssigneeType = "user" | "team" | "department" | "role";
199
- interface RoleAssignParams {
200
- assigneeType: AssigneeType;
201
- /** Use assigneeUid for user type (preferred). assigneeId for department/role/team. */
202
- assigneeUid?: string;
203
- assigneeId?: number;
204
- }
205
- interface RoleAssignee {
206
- id: number;
207
- roleId: number;
208
- assigneeType: AssigneeType;
209
- assigneeId: number;
210
- createdAt: string;
211
- user?: {
212
- id: number;
213
- username: string | null;
214
- displayName: string | null;
215
- email: string | null;
216
- };
217
- department?: {
218
- id: number;
219
- name: string;
220
- parentId: number | null;
221
- };
222
- assigneeRole?: {
223
- id: number;
224
- code: string;
225
- displayName: string;
226
- };
227
- }
228
- interface Permission {
229
- id: number;
230
- /** May be null if not set */
231
- name: string | null;
232
- resource: string;
233
- action: string;
234
- /** May be null if not set */
235
- description: string | null;
236
- sourceType: string;
237
- createdAt: string;
238
- }
239
- interface CreatePermissionParams {
240
- resource: string;
241
- action: string;
242
- name?: string;
243
- description?: string;
244
- }
245
- interface UpdatePermissionParams {
246
- resource?: string;
247
- action?: string;
248
- name?: string;
249
- description?: string;
250
- }
251
- /** Data-scope values supported by Runtime. */
252
- type ScopeType = "all" | "own" | "dep" | "dep_and_sub" | "custom" | "none";
253
- interface RolePermission {
254
- id: number;
255
- roleId: number;
256
- permissionId: number;
257
- scopeType: ScopeType;
258
- scopeFilter?: string;
259
- permission: {
260
- resource: string;
261
- action: string;
262
- };
263
- }
264
- interface AssignPermissionToRoleParams {
265
- permissionId: number;
266
- /** Data scope type. Defaults to "all" */
267
- scopeType?: ScopeType;
268
- /** Custom filter condition (JSON string), used when scopeType is "custom" */
269
- scopeFilter?: string;
270
- }
271
- interface UpdatePermissionScopeParams {
272
- scopeType: ScopeType;
273
- scopeFilter?: string;
274
- }
275
- interface AssignPermissionToUserParams {
276
- permissionId: number;
277
- /** Data scope type. Defaults to "all" */
278
- scopeType?: ScopeType;
279
- /** Custom filter condition (JSON string), used when scopeType is "custom" */
280
- scopeFilter?: string;
281
- }
282
- interface UserPermissionException {
283
- id: number;
284
- userId: number;
285
- permissionId: number;
286
- scopeType: ScopeType;
287
- scopeFilter?: string;
288
- permission: {
289
- resource: string;
290
- action: string;
291
- };
292
- }
293
- interface Department {
294
- id: number;
295
- code: string;
296
- name: string;
297
- parentId: number | null;
298
- path: string | null;
299
- level: number;
300
- managerId: number | null;
301
- createdAt: string;
302
- }
303
- interface CreateDepartmentParams {
304
- name: string;
305
- parentId?: number;
306
- /** Department manager's numeric user ID */
307
- managerId?: number;
308
- }
309
- interface UpdateDepartmentParams {
310
- name?: string;
311
- parentId?: number;
312
- managerId?: number;
313
- }
314
- interface DepartmentMember {
315
- id: number;
316
- userId: number;
317
- departmentId: number;
318
- isPrimary: boolean;
319
- position: string | null;
320
- user: {
321
- id: number;
322
- username: string | null;
323
- displayName: string | null;
324
- };
325
- }
326
- interface AddDepartmentMemberParams {
327
- /** User UID (UUID string) */
328
- userUid: string;
329
- position?: string;
330
- isPrimary?: boolean;
331
- }
332
183
  /** Administrator-created binding; currently only enterprise WeChat is supported. */
333
184
  interface BindUserOAuthParams {
334
185
  provider: "wecom";
@@ -395,333 +246,6 @@ declare function createAuthModule(request: RequestFn): {
395
246
  getUserOAuthIdentity(uid: string, provider?: OAuthIdentityProvider): Promise<UserOAuthIdentity>;
396
247
  };
397
248
 
398
- declare function createDepartmentsModule(request: RequestFn): {
399
- /**
400
- * List all departments (flat list).
401
- *
402
- * @example
403
- * ```typescript
404
- * const depts = await admin.departments.list();
405
- * const techDept = depts.find(d => d.name === '技术部');
406
- * ```
407
- */
408
- list(): Promise<Department[]>;
409
- /**
410
- * Get a single department by ID.
411
- *
412
- * @example
413
- * ```typescript
414
- * const dept = await admin.departments.get(1);
415
- * ```
416
- */
417
- get(id: number): Promise<Department>;
418
- /**
419
- * Create a new department.
420
- *
421
- * @example
422
- * ```typescript
423
- * const dept = await admin.departments.create({
424
- * name: '测试组',
425
- * parentId: 1,
426
- * });
427
- * ```
428
- */
429
- create(params: CreateDepartmentParams): Promise<Department>;
430
- /**
431
- * Update a department.
432
- *
433
- * @example
434
- * ```typescript
435
- * await admin.departments.update(3, { name: '质量保证组' });
436
- * ```
437
- */
438
- update(id: number, params: UpdateDepartmentParams): Promise<void>;
439
- /**
440
- * Delete a department.
441
- * Note: departments with sub-departments or assigned users cannot be deleted directly.
442
- *
443
- * @example
444
- * ```typescript
445
- * await admin.departments.delete(3);
446
- * ```
447
- */
448
- delete(id: number): Promise<void>;
449
- /**
450
- * List members of a department.
451
- *
452
- * @param includeChildren - Whether to include members from sub-departments. Defaults to false.
453
- *
454
- * @example
455
- * ```typescript
456
- * const members = await admin.departments.listUsers(1);
457
- * const allMembers = await admin.departments.listUsers(1, true);
458
- * ```
459
- */
460
- listUsers(id: number, includeChildren?: boolean): Promise<DepartmentMember[]>;
461
- /**
462
- * Add a user to a department.
463
- *
464
- * @example
465
- * ```typescript
466
- * await admin.departments.addUser(deptId, {
467
- * userUid: user.uid,
468
- * isPrimary: true,
469
- * position: '高级工程师',
470
- * });
471
- * ```
472
- */
473
- addUser(deptId: number, params: AddDepartmentMemberParams): Promise<void>;
474
- /**
475
- * Remove a user from a department.
476
- *
477
- * @example
478
- * ```typescript
479
- * await admin.departments.removeUser(deptId, user.uid);
480
- * ```
481
- */
482
- removeUser(deptId: number, userUid: string): Promise<void>;
483
- };
484
-
485
- declare function createPermissionsModule(request: RequestFn): {
486
- /**
487
- * List all defined permissions.
488
- *
489
- * @example
490
- * ```typescript
491
- * const perms = await admin.permissions.list();
492
- * const orderRead = perms.find(p => p.resource === 'order' && p.action === 'read');
493
- * ```
494
- */
495
- list(): Promise<Permission[]>;
496
- /**
497
- * Create a new permission definition.
498
- *
499
- * @example
500
- * ```typescript
501
- * const perm = await admin.permissions.create({
502
- * resource: 'order',
503
- * action: 'export',
504
- * name: '导出订单',
505
- * });
506
- * ```
507
- */
508
- create(params: CreatePermissionParams): Promise<Permission>;
509
- /**
510
- * Update a permission definition.
511
- *
512
- * @example
513
- * ```typescript
514
- * await admin.permissions.update(10, { name: '导出报表' });
515
- * ```
516
- */
517
- update(id: number, params: UpdatePermissionParams): Promise<void>;
518
- /**
519
- * Delete a permission definition.
520
- *
521
- * @example
522
- * ```typescript
523
- * await admin.permissions.delete(10);
524
- * ```
525
- */
526
- delete(id: number): Promise<void>;
527
- /**
528
- * List all permissions assigned to a role.
529
- *
530
- * @example
531
- * ```typescript
532
- * const perms = await admin.permissions.listForRole(roleId);
533
- * ```
534
- */
535
- listForRole(roleId: number): Promise<RolePermission[]>;
536
- /**
537
- * Assign a permission to a role with a data scope.
538
- *
539
- * @example
540
- * ```typescript
541
- * // Department-scoped permission
542
- * await admin.permissions.assignToRole(roleId, {
543
- * permissionId: 10,
544
- * scopeType: 'dep',
545
- * });
546
- *
547
- * // Custom whitelist scope
548
- * await admin.permissions.assignToRole(roleId, {
549
- * permissionId: 20,
550
- * scopeType: 'custom',
551
- * scopeFilter: JSON.stringify({ id: [1, 2, 3] }),
552
- * });
553
- * ```
554
- */
555
- assignToRole(roleId: number, params: AssignPermissionToRoleParams): Promise<void>;
556
- /**
557
- * Remove a permission from a role.
558
- *
559
- * @example
560
- * ```typescript
561
- * await admin.permissions.removeFromRole(roleId, permId);
562
- * ```
563
- */
564
- removeFromRole(roleId: number, permId: number): Promise<void>;
565
- /**
566
- * Update the data scope of a role–permission assignment.
567
- *
568
- * @example
569
- * ```typescript
570
- * await admin.permissions.updateRolePermissionScope(roleId, permId, {
571
- * scopeType: 'all',
572
- * });
573
- * ```
574
- */
575
- updateRolePermissionScope(roleId: number, permId: number, params: UpdatePermissionScopeParams): Promise<void>;
576
- /**
577
- * Assign a direct (user-level) permission exception to a user.
578
- *
579
- * This bypasses role-based assignment and gives the user a direct
580
- * data-scope override for the specified permission.
581
- *
582
- * @example
583
- * ```typescript
584
- * await admin.permissions.assignToUser('u-123456', {
585
- * permissionId: 10,
586
- * scopeType: 'dep',
587
- * });
588
- * ```
589
- */
590
- assignToUser(uid: string, params: AssignPermissionToUserParams): Promise<void>;
591
- /**
592
- * Remove a direct permission exception from a user.
593
- *
594
- * @example
595
- * ```typescript
596
- * await admin.permissions.removeFromUser('u-123456', permId);
597
- * ```
598
- */
599
- removeFromUser(uid: string, permId: number): Promise<void>;
600
- /**
601
- * List permission exceptions for a specific user.
602
- *
603
- * @example
604
- * ```typescript
605
- * const exceptions = await admin.permissions.listForUser('u-123456');
606
- * ```
607
- */
608
- listForUser(uid: string): Promise<UserPermissionException[]>;
609
- /**
610
- * Update the data scope of a user-level permission exception.
611
- *
612
- * @example
613
- * ```typescript
614
- * await admin.permissions.updateUserPermissionScope('u-123456', permId, {
615
- * scopeType: 'custom',
616
- * scopeFilter: JSON.stringify({ id: [10, 20] }),
617
- * });
618
- * ```
619
- */
620
- updateUserPermissionScope(uid: string, permId: number, params: UpdatePermissionScopeParams): Promise<void>;
621
- };
622
-
623
- declare function createRolesModule(request: RequestFn): {
624
- /**
625
- * List all roles.
626
- *
627
- * @example
628
- * ```typescript
629
- * const roles = await admin.roles.list();
630
- * const managerRole = roles.find(r => r.code === 'manager');
631
- * ```
632
- */
633
- list(): Promise<Role[]>;
634
- /**
635
- * Get a role by its numeric ID.
636
- *
637
- * @example
638
- * ```typescript
639
- * const role = await admin.roles.get(1);
640
- * ```
641
- */
642
- get(id: number): Promise<Role>;
643
- /**
644
- * Create a new role.
645
- *
646
- * @example
647
- * ```typescript
648
- * const role = await admin.roles.create({
649
- * code: 'editor',
650
- * displayName: '编辑',
651
- * description: '负责内容编辑',
652
- * });
653
- * ```
654
- */
655
- create(params: CreateRoleParams): Promise<Role>;
656
- /**
657
- * Update a role.
658
- * Note: system roles (isSystem=true) cannot be modified.
659
- *
660
- * @example
661
- * ```typescript
662
- * await admin.roles.update(3, { displayName: '高级编辑' });
663
- * ```
664
- */
665
- update(id: number, params: UpdateRoleParams): Promise<void>;
666
- /**
667
- * Delete a role.
668
- * Note: system roles cannot be deleted.
669
- *
670
- * @example
671
- * ```typescript
672
- * await admin.roles.delete(3);
673
- * ```
674
- */
675
- delete(id: number): Promise<void>;
676
- /**
677
- * Assign a role to a user, department, team, or another role.
678
- * For users, prefer assigneeUid (string). For department/team/role, use assigneeId (number).
679
- *
680
- * @example
681
- * ```typescript
682
- * // Assign to a user (preferred: use uid)
683
- * await admin.roles.assign(roleId, { assigneeType: 'user', assigneeUid: user.uid });
684
- *
685
- * // Assign to an entire department
686
- * await admin.roles.assign(roleId, { assigneeType: 'department', assigneeId: 5 });
687
- * ```
688
- */
689
- assign(roleId: number, params: RoleAssignParams): Promise<void>;
690
- /**
691
- * Remove a role assignment.
692
- * For users, prefer assigneeUid. For department/team/role, use assigneeId.
693
- *
694
- * @example
695
- * ```typescript
696
- * await admin.roles.unassign(roleId, { assigneeType: 'user', assigneeUid: user.uid });
697
- * ```
698
- */
699
- unassign(roleId: number, params: RoleAssignParams): Promise<void>;
700
- /**
701
- * List all assignees (users, departments, etc.) for a role.
702
- *
703
- * @example
704
- * ```typescript
705
- * const assignees = await admin.roles.listAssignees(roleId);
706
- * const users = assignees.filter(a => a.assigneeType === 'user');
707
- * ```
708
- */
709
- listAssignees(roleId: number): Promise<RoleAssignee[]>;
710
- /**
711
- * Get all roles assigned to a user (by UID).
712
- *
713
- * Useful in Edge Functions to check what roles a user currently holds
714
- * without making a full ACL check.
715
- *
716
- * @example
717
- * ```typescript
718
- * const roles = await admin.roles.getUserRoles('u-123456');
719
- * if (roles.some(r => r.code === 'admin')) { ... }
720
- * ```
721
- */
722
- getUserRoles(uid: string): Promise<Role[]>;
723
- };
724
-
725
249
  declare function createUsersModule(request: RequestFn): {
726
250
  /**
727
251
  * List users with optional search and pagination.
@@ -784,6 +308,86 @@ declare function createUsersModule(request: RequestFn): {
784
308
  delete(uid: string): Promise<void>;
785
309
  };
786
310
 
311
+ interface AdminApplicationContext {
312
+ appId: string;
313
+ env: string;
314
+ }
315
+
316
+ declare function createApplicationTenantAccess(baseURL: string, appTenantId: string, serviceKey: string | undefined, resolve: () => Promise<AdminApplicationContext>, initial: AdminApplicationContext): {
317
+ auth: {
318
+ bindUserOAuth(uid: string, params: BindUserOAuthParams): Promise<UserOAuthBinding>;
319
+ checkPermission(uid: string, params: CheckPermissionParams): Promise<CheckPermissionResult>;
320
+ getRules(uid: string): Promise<AclRules>;
321
+ getUserOAuthIdentity(uid: string, provider?: OAuthIdentityProvider): Promise<UserOAuthIdentity>;
322
+ };
323
+ users: {
324
+ list(params?: UserListParams): Promise<UserListResult>;
325
+ get(uid: string): Promise<UserDetail>;
326
+ create(params: CreateUserParams): Promise<CreateUserResult>;
327
+ update(uid: string, params: UpdateUserParams): Promise<UpdateUserResult>;
328
+ delete(uid: string): Promise<void>;
329
+ };
330
+ roles: {
331
+ list(): Promise<_amaster_ai_auth_client_rbac.Role[]>;
332
+ get(id: number): Promise<_amaster_ai_auth_client_rbac.Role>;
333
+ create(params: _amaster_ai_auth_client_rbac.CreateRoleParams): Promise<_amaster_ai_auth_client_rbac.Role>;
334
+ update(id: number, params: _amaster_ai_auth_client_rbac.UpdateRoleParams): Promise<void>;
335
+ delete(id: number): Promise<void>;
336
+ assign(roleId: number, params: _amaster_ai_auth_client_rbac.RoleAssignParams): Promise<void>;
337
+ unassign(roleId: number, params: _amaster_ai_auth_client_rbac.RoleAssignParams): Promise<void>;
338
+ listAssignees(roleId: number): Promise<_amaster_ai_auth_client_rbac.RoleAssignee[]>;
339
+ getUserRoles(uid: string): Promise<_amaster_ai_auth_client_rbac.Role[]>;
340
+ };
341
+ permissions: {
342
+ list(): Promise<_amaster_ai_auth_client_rbac.Permission[]>;
343
+ create(params: _amaster_ai_auth_client_rbac.CreatePermissionParams): Promise<_amaster_ai_auth_client_rbac.Permission>;
344
+ update(id: number, params: _amaster_ai_auth_client_rbac.UpdatePermissionParams): Promise<void>;
345
+ delete(id: number): Promise<void>;
346
+ listForRole(roleId: number): Promise<_amaster_ai_auth_client_rbac.RolePermission[]>;
347
+ assignToRole(roleId: number, params: _amaster_ai_auth_client_rbac.AssignPermissionToRoleParams): Promise<void>;
348
+ removeFromRole(roleId: number, permId: number): Promise<void>;
349
+ updateRolePermissionScope(roleId: number, permId: number, params: _amaster_ai_auth_client_rbac.UpdatePermissionScopeParams): Promise<void>;
350
+ assignToUser(uid: string, params: _amaster_ai_auth_client_rbac.AssignPermissionToUserParams): Promise<void>;
351
+ removeFromUser(uid: string, permId: number): Promise<void>;
352
+ listForUser(uid: string): Promise<_amaster_ai_auth_client_rbac.UserPermissionException[]>;
353
+ updateUserPermissionScope(uid: string, permId: number, params: _amaster_ai_auth_client_rbac.UpdatePermissionScopeParams): Promise<void>;
354
+ };
355
+ departments: {
356
+ list(): Promise<_amaster_ai_auth_client_rbac.Department[]>;
357
+ get(id: number): Promise<_amaster_ai_auth_client_rbac.Department>;
358
+ create(params: _amaster_ai_auth_client_rbac.CreateDepartmentParams): Promise<_amaster_ai_auth_client_rbac.Department>;
359
+ update(id: number, params: _amaster_ai_auth_client_rbac.UpdateDepartmentParams): Promise<void>;
360
+ delete(id: number): Promise<void>;
361
+ listUsers(id: number, includeChildren?: boolean): Promise<_amaster_ai_auth_client_rbac.DepartmentMember[]>;
362
+ addUser(deptId: number, params: _amaster_ai_auth_client_rbac.AddDepartmentMemberParams): Promise<void>;
363
+ removeUser(deptId: number, userUid: string): Promise<void>;
364
+ };
365
+ entity: _amaster_ai_entity_client.EntityClient;
366
+ queryAuthorization(request: _amaster_ai_auth_client_tenant_management.TenancyAuthorizationQuery): Promise<_amaster_ai_http_client.ClientResult<_amaster_ai_auth_client_tenant_management.TenancyAuthorizationPage>>;
367
+ putRole(code: string, request: {
368
+ readonly expectedRevision: number;
369
+ readonly name: string;
370
+ readonly permissions: Readonly<Record<string, _amaster_ai_auth_client_tenant_management.TenancyDataScope>>;
371
+ }): Promise<_amaster_ai_http_client.ClientResult<_amaster_ai_auth_client_tenant_management.TenancyManagedTenant>>;
372
+ assignRole(request: _amaster_ai_auth_client_tenant_management.TenancyRoleAssignmentRequest): Promise<_amaster_ai_http_client.ClientResult<_amaster_ai_auth_client_tenant_management.TenancyManagedTenant>>;
373
+ revokeRole(request: _amaster_ai_auth_client_tenant_management.TenancyRoleAssignmentRequest): Promise<_amaster_ai_http_client.ClientResult<_amaster_ai_auth_client_tenant_management.TenancyManagedTenant>>;
374
+ putUserException(request: {
375
+ readonly expectedRevision: number;
376
+ readonly subject: _amaster_ai_auth_client_tenant_management.TenancyHuman;
377
+ readonly permission: string;
378
+ readonly scope: _amaster_ai_auth_client_tenant_management.TenancyDataScope;
379
+ }): Promise<_amaster_ai_http_client.ClientResult<_amaster_ai_auth_client_tenant_management.TenancyManagedTenant>>;
380
+ putMember(request: {
381
+ readonly expectedRevision: number;
382
+ readonly subject: _amaster_ai_auth_client_tenant_management.TenancyHuman;
383
+ readonly active: boolean;
384
+ }): Promise<_amaster_ai_http_client.ClientResult<_amaster_ai_auth_client_tenant_management.TenancyManagedTenant>>;
385
+ stopRole(code: string, expectedRevision: number): Promise<_amaster_ai_http_client.ClientResult<_amaster_ai_auth_client_tenant_management.TenancyManagedTenant>>;
386
+ };
387
+
388
+ interface TenantAdministration {
389
+ forTenant(appTenantId: string): ReturnType<typeof createApplicationTenantAccess>;
390
+ }
787
391
  declare class AdminSDK {
788
392
  /** Check and query user permissions without requiring a user token */
789
393
  readonly auth: ReturnType<typeof createAuthModule>;
@@ -795,7 +399,9 @@ declare class AdminSDK {
795
399
  readonly permissions: ReturnType<typeof createPermissionsModule>;
796
400
  /** Department management and membership */
797
401
  readonly departments: ReturnType<typeof createDepartmentsModule>;
798
- constructor(options: AdminSDKOptions);
402
+ /** Explicit tenant access using application administrator authority. */
403
+ readonly tenancy: TenantAdministration;
404
+ constructor(options: AdminSDKConfiguration);
799
405
  }
800
406
 
801
407
  declare class AdminSDKError extends Error {
@@ -804,4 +410,4 @@ declare class AdminSDKError extends Error {
804
410
  constructor(message: string, statusCode: number, response?: unknown | undefined);
805
411
  }
806
412
 
807
- export { type AclRules, type AddDepartmentMemberParams, AdminSDK, AdminSDKError, type AdminSDKOptions, type AssignPermissionToRoleParams, type AssignPermissionToUserParams, type AssigneeType, type AuthorizationScope, type BindUserOAuthParams, type CheckPermissionParams, type CheckPermissionResult, type CreateDepartmentParams, type CreatePermissionParams, type CreateRoleParams, type CreateUserParams, type CreateUserResult, type DataScopeResolved, type DataScopeRowFilter, type Department, type DepartmentMember, type MatchedPermission, type OAuthIdentityProvider, type Permission, type ResolvedPermissionScope, type Role, type RoleAssignParams, type RoleAssignee, type RolePermission, type ScopeType, type UpdateDepartmentParams, type UpdatePermissionParams, type UpdatePermissionScopeParams, type UpdateRoleParams, type UpdateUserParams, type UpdateUserResult, type UserDetail, type UserListItem, type UserListParams, type UserListResult, type UserOAuthBinding, type UserOAuthIdentity, type UserPermissionException };
413
+ export { type AclRules, AdminSDK, type AdminSDKConfiguration, AdminSDKError, type AdminSDKOptions, type AuthorizationScope, type BindUserOAuthParams, type CheckPermissionParams, type CheckPermissionResult, type CreateUserParams, type CreateUserResult, type DataScopeResolved, type DataScopeRowFilter, type MatchedPermission, type OAuthIdentityProvider, type ResolvedPermissionScope, type UpdateUserParams, type UpdateUserResult, type UserDetail, type UserListItem, type UserListParams, type UserListResult, type UserOAuthBinding, type UserOAuthIdentity };