axiam-sdk 1.0.0-beta02 → 1.0.0-beta05

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +33 -4
  2. package/dist/{authzCore-Ct8ZzJL4.d.cts → authzCore-CrrzL1vM.d.cts} +1 -1
  3. package/dist/{authzCore-CiMC6Eru.d.ts → authzCore-IhJd8o4F.d.ts} +1 -1
  4. package/dist/browser/index.d.cts +3 -3
  5. package/dist/browser/index.d.ts +3 -3
  6. package/dist/{client-DjCaHR3c.d.cts → client-Djmfy2Wz.d.cts} +209 -9
  7. package/dist/{client-y9dwy3p3.d.ts → client-RqlANL2T.d.ts} +209 -9
  8. package/dist/{cookieJar-BCILMWdK.d.cts → cookieJar-BWoZxJLO.d.cts} +2 -2
  9. package/dist/{cookieJar-DVW2SSf5.d.ts → cookieJar-V4kHLAnX.d.ts} +2 -2
  10. package/dist/grpc/index.d.cts +5 -5
  11. package/dist/grpc/index.d.ts +5 -5
  12. package/dist/grpc/index.js +216 -29
  13. package/dist/grpc/index.js.map +1 -1
  14. package/dist/grpc/index.mjs +216 -29
  15. package/dist/grpc/index.mjs.map +1 -1
  16. package/dist/index.d.cts +3 -3
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.js +218 -29
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +217 -30
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/middleware/index.d.cts +6 -6
  23. package/dist/middleware/index.d.ts +6 -6
  24. package/dist/nestjs/index.d.cts +2 -2
  25. package/dist/nestjs/index.d.ts +2 -2
  26. package/dist/node/index.d.cts +5 -5
  27. package/dist/node/index.d.ts +5 -5
  28. package/dist/node/index.js +216 -29
  29. package/dist/node/index.js.map +1 -1
  30. package/dist/node/index.mjs +216 -29
  31. package/dist/node/index.mjs.map +1 -1
  32. package/dist/{oidcState-C4YtEKPT.d.cts → oidcState-DKX3dJ8i.d.cts} +1 -1
  33. package/dist/{oidcState-BMcyBUz-.d.ts → oidcState-irUgXhRo.d.ts} +1 -1
  34. package/dist/rest/index.d.cts +6 -6
  35. package/dist/rest/index.d.ts +6 -6
  36. package/dist/rest/index.js +218 -29
  37. package/dist/rest/index.js.map +1 -1
  38. package/dist/rest/index.mjs +217 -30
  39. package/dist/rest/index.mjs.map +1 -1
  40. package/dist/{session-CMgYRxLP.d.cts → session-BIRL5RKr.d.cts} +11 -0
  41. package/dist/{session-BJHqprWm.d.ts → session-DU6fggqX.d.ts} +11 -0
  42. package/dist/{types-DHnCMjtY.d.ts → types-BOX-6Srv.d.ts} +46 -1
  43. package/dist/{types-CpbckLcy.d.cts → types-zXSpiQM-.d.cts} +46 -1
  44. package/package.json +1 -1
package/README.md CHANGED
@@ -25,7 +25,7 @@ This SDK conforms to CONTRACT.md §1–§13 and §12.7, §14, §15, §17, §19,
25
25
  local-verification set, the §12 OIDC/SSO relying-party helpers, and the §13
26
26
  `verifyWebhook` signature verifier).
27
27
 
28
- §27 is implemented **in full**, both halves: the 146-operation imperative surface *and*
28
+ §27 is implemented **in full**, both halves: the 147-operation imperative surface *and*
29
29
  the §27.6 declarative manifest with its §27.7 `defineManifest` and decorator forms. The
30
30
  contract asks an SDK that ships only one half to say which; this one ships both.
31
31
 
@@ -1120,6 +1120,35 @@ produces a `403` — so a UI that offers the switch to everyone has turned a
1120
1120
  distinction the server made into a failure the user discovers. `false` against a
1121
1121
  server older than contract 1.31, which is the safe reading of absent.
1122
1122
 
1123
+ #### Signing one in (§5.2.1)
1124
+
1125
+ The reserved tenant has a fixed slug, `organization`, the same in every
1126
+ deployment — so signing in as an organization-level principal needs no new
1127
+ surface, only the ordinary constructor:
1128
+
1129
+ ```ts
1130
+ const client = new AxiamClient({
1131
+ baseUrl: 'https://iam.example.com',
1132
+ tenantSlug: 'organization',
1133
+ orgSlug: 'globex',
1134
+ });
1135
+ await client.login('root@example.com', password);
1136
+ ```
1137
+
1138
+ Prefer that form. The server also reads a login body that names *no* tenant as
1139
+ "the organization's own scope", but §5 rule 2 still requires a tenant on the
1140
+ `X-Tenant-ID` header of every request after the login, so the client needs one
1141
+ either way.
1142
+
1143
+ What §5.2.1 forbids is the third possibility: an empty-string slug. No row can
1144
+ carry one, so `tenant_slug: ""` resolves nothing — and on
1145
+ `/auth/opaque/login/start` it fails on the workspace *before* the tenant's
1146
+ OPAQUE mode is read, so the `404` that means "OPAQUE is not offered here" never
1147
+ arrives and the caller has no fallback to take. This SDK cannot emit one:
1148
+ `tenantSlug: ''` fails §5's tenant requirement at construction, and
1149
+ `buildLoginBody` omits an identifier it was not given rather than sending it
1150
+ blank.
1151
+
1123
1152
  `requestPasswordReset` resolves **whether or not the address exists**, and this
1124
1153
  SDK exposes no way to tell the difference. That is not an omission to improve on:
1125
1154
  any signal distinguishing them — including one inferred from timing — turns the
@@ -1539,7 +1568,7 @@ entries are keyed by subject rather than by session.
1539
1568
  Everything above assumes a populated tenant. `login` signs a user in,
1540
1569
  `checkAccess` asks about a resource, `verifyWebhook` checks a delivery signature — and
1541
1570
  none of them can create the user, declare the resource or register the webhook. The
1542
- management surface is the part that can: **146 operations across 24 namespaces**,
1571
+ management surface is the part that can: **147 operations across 24 namespaces**,
1543
1572
  generated from `management-registry.json`, which is the whole server API minus what other
1544
1573
  contract sections own and minus organization creation and deletion (§27.0 keeps those out
1545
1574
  of reach of a client library on purpose).
@@ -1650,7 +1679,7 @@ back.
1650
1679
 
1651
1680
  ### Declarative manifests (§27.6, §27.7)
1652
1681
 
1653
- Calling 146 operations one at a time is rarely what an application wants. What it does at
1682
+ Calling 147 operations one at a time is rarely what an application wants. What it does at
1654
1683
  start-up, in a migration, or in a test fixture is assert a shape:
1655
1684
 
1656
1685
  ```ts
@@ -1688,7 +1717,7 @@ actions that would reconcile the tenant.
1688
1717
  a tenant that also holds hand-made state.
1689
1718
  - **Applying twice converges**: the second plan is all `no-change`. That is what makes
1690
1719
  re-running after a failure safe.
1691
- - **There is no transaction** across 146 independent HTTP endpoints, and `ApplyReport` does
1720
+ - **There is no transaction** across 147 independent HTTP endpoints, and `ApplyReport` does
1692
1721
  not pretend there is. If step 12 of 30 fails, steps 1–11 have happened; the report says
1693
1722
  which, execution stops rather than continuing blindly, and there is no `rollback` —
1694
1723
  because this SDK could not honour one.
@@ -1,5 +1,5 @@
1
1
  import { S as Sensitive } from './sensitive-BC_s7Rrd.cjs';
2
- import { A as AccessCheck, a as AccessDecision } from './types-CpbckLcy.cjs';
2
+ import { A as AccessCheck, a as AccessDecision } from './types-zXSpiQM-.cjs';
3
3
  import { V as Verifier } from './jwks-CSXHo3DS.cjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { S as Sensitive } from './sensitive-BC_s7Rrd.js';
2
- import { A as AccessCheck, a as AccessDecision } from './types-DHnCMjtY.js';
2
+ import { A as AccessCheck, a as AccessDecision } from './types-BOX-6Srv.js';
3
3
  import { V as Verifier } from './jwks-CSXHo3DS.js';
4
4
 
5
5
  /**
@@ -1,10 +1,10 @@
1
- import { A as AxiamClient, W as WebauthnWorkspace, a as WebauthnLoginResult, b as WebauthnCredential } from '../client-DjCaHR3c.cjs';
1
+ import { A as AxiamClient, W as WebauthnWorkspace, a as WebauthnLoginResult, b as WebauthnCredential } from '../client-Djmfy2Wz.cjs';
2
2
  export { W as WebauthnFailure, c as classifyWebauthnError, w as webauthnErrorMessage } from '../webauthnErrors-fLgfOflO.cjs';
3
3
  import '../sensitive-BC_s7Rrd.cjs';
4
- import '../session-CMgYRxLP.cjs';
4
+ import '../session-BIRL5RKr.cjs';
5
5
  import 'axios';
6
6
  import '../telemetry-DrGqL4kb.cjs';
7
- import '../types-CpbckLcy.cjs';
7
+ import '../types-zXSpiQM-.cjs';
8
8
 
9
9
  /**
10
10
  * Whether this runtime can perform a WebAuthn ceremony at all.
@@ -1,10 +1,10 @@
1
- import { A as AxiamClient, W as WebauthnWorkspace, a as WebauthnLoginResult, b as WebauthnCredential } from '../client-y9dwy3p3.js';
1
+ import { A as AxiamClient, W as WebauthnWorkspace, a as WebauthnLoginResult, b as WebauthnCredential } from '../client-RqlANL2T.js';
2
2
  export { W as WebauthnFailure, c as classifyWebauthnError, w as webauthnErrorMessage } from '../webauthnErrors-fLgfOflO.js';
3
3
  import '../sensitive-BC_s7Rrd.js';
4
- import '../session-BJHqprWm.js';
4
+ import '../session-DU6fggqX.js';
5
5
  import 'axios';
6
6
  import '../telemetry-DrGqL4kb.js';
7
- import '../types-DHnCMjtY.js';
7
+ import '../types-BOX-6Srv.js';
8
8
 
9
9
  /**
10
10
  * Whether this runtime can perform a WebAuthn ceremony at all.
@@ -1,6 +1,6 @@
1
1
  import { S as Sensitive } from './sensitive-BC_s7Rrd.cjs';
2
- import { S as SharedSession, A as AxiamClientOptions } from './session-CMgYRxLP.cjs';
3
- import { a as AccessDecision, L as LoginResult, A as AccessCheck } from './types-CpbckLcy.cjs';
2
+ import { S as SharedSession, A as AxiamClientOptions } from './session-BIRL5RKr.cjs';
3
+ import { a as AccessDecision, L as LoginResult, A as AccessCheck } from './types-zXSpiQM-.cjs';
4
4
  import { a as TelemetryDispatcher, O as Outcome } from './telemetry-DrGqL4kb.cjs';
5
5
 
6
6
  /**
@@ -198,8 +198,15 @@ interface OpaqueEnrollment {
198
198
  registration_record: string;
199
199
  }
200
200
  /**
201
- * Build a registration record for `password`, to send with any request that
202
- * sets one (user creation, change-password, reset completion).
201
+ * Build a registration record for `password`, sealed against the tenant this
202
+ * client is **acting on**.
203
+ *
204
+ * That is the right tenant when the record is for an account being created in
205
+ * it — §27 `users.create`, and the reset-completion flow, which names its own
206
+ * tenant. It is the **wrong** tenant for the caller's own password change
207
+ * once an organization-level principal has selected another one to act on:
208
+ * the account's credentials live where the account does. Use
209
+ * {@link opaqueEnrollmentForSelf} there — CONTRACT.md §5.2.2 rule 2.
203
210
  *
204
211
  * This performs a `register/start` round trip, which the SRP verifier it
205
212
  * replaces did not need: OPAQUE's envelope is sealed under the server's
@@ -213,6 +220,26 @@ interface OpaqueEnrollment {
213
220
  * cannot invalidate it.
214
221
  */
215
222
  declare function opaqueEnrollment(client: AxiamClient, password: string): Promise<OpaqueEnrollment>;
223
+ /**
224
+ * Build a registration record for the **caller's own** new password, sealed
225
+ * against the tenant the caller's account lives in.
226
+ *
227
+ * CONTRACT.md §5.2.2 rule 2. `POST /auth/password/change` and the record that
228
+ * accompanies it are about the account, not about whatever tenant the client
229
+ * is currently pointed at, and a record sealed against the acting tenant is
230
+ * refused with *"the OPAQUE session was issued for a different tenant"*.
231
+ *
232
+ * The distinction only bites for an organization-level principal that has
233
+ * selected another tenant to act on; for everyone else the two tenants are the
234
+ * same value and this behaves identically to {@link opaqueEnrollment}. It is
235
+ * still the function to call for a self-service password change, because which
236
+ * principal is signed in is not something the call site usually knows.
237
+ *
238
+ * @throws NetworkError when no login has completed on this client yet — the
239
+ * principal tenant is reported by the login response, so there is nothing to
240
+ * seal against before then.
241
+ */
242
+ declare function opaqueEnrollmentForSelf(client: AxiamClient, password: string): Promise<OpaqueEnrollment>;
216
243
 
217
244
  /** A reference to one credential, in the WebAuthn JSON form. */
218
245
  interface WebauthnCredentialDescriptorJson {
@@ -551,6 +578,24 @@ interface PasswordResetConfirmation {
551
578
  * secret an ordinary string.
552
579
  */
553
580
 
581
+ /**
582
+ * Drops a `tenant_scope` that names no tenants.
583
+ *
584
+ * CONTRACT.md §5.2.3 rule 1: the server refuses `tenant_scope: []` with
585
+ * `400`. An assignment reaching no tenant contributes nothing anywhere, so it
586
+ * is a grant that does not exist rather than a restriction, and the server
587
+ * declines to guess which was meant.
588
+ *
589
+ * `JSON.stringify` already drops `undefined`, so the absent case needs no
590
+ * help. `[]` is the one that does: the natural way to build the field is to
591
+ * collect into an array and pass it, which yields `[]` for "no tenants named"
592
+ * and would put the refused shape on the wire. Both spellings of absent
593
+ * therefore travel the same way — by not appearing.
594
+ *
595
+ * Returns the body unchanged when there is nothing to drop, so the common
596
+ * path allocates nothing.
597
+ */
598
+ declare function omitEmptyTenantScope<T>(body: T): T;
554
599
  /**
555
600
  * `ActorType` (generated from openapi.json).
556
601
  *
@@ -568,6 +613,11 @@ interface AddMemberRequest {
568
613
  /** `user_id`. */
569
614
  user_id: string;
570
615
  }
616
+ /** `AddServiceAccountMemberRequest` (generated from openapi.json). */
617
+ interface AddServiceAccountMemberRequest {
618
+ /** `service_account_id`. */
619
+ service_account_id: string;
620
+ }
571
621
  /**
572
622
  * API-based provider configuration (SendGrid, Postmark, Resend, Brevo).
573
623
  *
@@ -588,11 +638,60 @@ interface AssignRoleToGroupRequest {
588
638
  group_id: string;
589
639
  /** `resource_id`. */
590
640
  resource_id?: string | null;
641
+ /**
642
+ * The tenants this assignment reaches.
643
+ *
644
+ * Only meaningful for an assignment made in an organization's scope, whose
645
+ * global roles otherwise reach every tenant of the organization; naming
646
+ * tenants here confines the assignment to those and to nothing else, the
647
+ * organization's own scope included. Omitted — the default — reaches
648
+ * wherever the role does.
649
+ *
650
+ * Refused with 400 outside an organization scope, when empty, and when it
651
+ * names a tenant of another organization or the organization's own scope
652
+ * tenant.
653
+ */
654
+ tenant_scope?: string[] | null;
655
+ }
656
+ /** `AssignRoleToServiceAccountRequest` (generated from openapi.json). */
657
+ interface AssignRoleToServiceAccountRequest {
658
+ /** `resource_id`. */
659
+ resource_id?: string | null;
660
+ /** `service_account_id`. */
661
+ service_account_id: string;
662
+ /**
663
+ * The tenants this assignment reaches.
664
+ *
665
+ * Only meaningful for an assignment made in an organization's scope, whose
666
+ * global roles otherwise reach every tenant of the organization; naming
667
+ * tenants here confines the assignment to those and to nothing else, the
668
+ * organization's own scope included. Omitted — the default — reaches
669
+ * wherever the role does.
670
+ *
671
+ * Refused with 400 outside an organization scope, when empty, and when it
672
+ * names a tenant of another organization or the organization's own scope
673
+ * tenant.
674
+ */
675
+ tenant_scope?: string[] | null;
591
676
  }
592
677
  /** `AssignRoleToUserRequest` (generated from openapi.json). */
593
678
  interface AssignRoleToUserRequest {
594
679
  /** `resource_id`. */
595
680
  resource_id?: string | null;
681
+ /**
682
+ * The tenants this assignment reaches.
683
+ *
684
+ * Only meaningful for an assignment made in an organization's scope, whose
685
+ * global roles otherwise reach every tenant of the organization; naming
686
+ * tenants here confines the assignment to those and to nothing else, the
687
+ * organization's own scope included. Omitted — the default — reaches
688
+ * wherever the role does.
689
+ *
690
+ * Refused with 400 outside an organization scope, when empty, and when it
691
+ * names a tenant of another organization or the organization's own scope
692
+ * tenant.
693
+ */
694
+ tenant_scope?: string[] | null;
596
695
  /** `user_id`. */
597
696
  user_id: string;
598
697
  }
@@ -2659,6 +2758,8 @@ interface RoleAssignment {
2659
2758
  resource_id?: string | null;
2660
2759
  /** `role`. */
2661
2760
  role: Role;
2761
+ /** The tenants this assignment reaches. See [`TenantScope`]. */
2762
+ tenant_scope?: string[] | null;
2662
2763
  }
2663
2764
  /** A group together with the resource scope of its assignment of this role. */
2664
2765
  interface RoleGroupAssignment {
@@ -2666,11 +2767,39 @@ interface RoleGroupAssignment {
2666
2767
  group: Group;
2667
2768
  /** `None` means the role was assigned globally (no resource scope). */
2668
2769
  resource_id?: string | null;
2770
+ /**
2771
+ * The tenants this assignment reaches, or omitted for "wherever the role
2772
+ * does". Shown next to the assignment so an operator can tell a deliberately
2773
+ * narrowed grant from an organization-wide one.
2774
+ */
2775
+ tenant_scope?: string[] | null;
2776
+ }
2777
+ /** A service account together with the resource scope of its assignment. */
2778
+ interface RoleServiceAccountAssignment {
2779
+ /** `None` means the role was assigned globally (no resource scope). */
2780
+ resource_id?: string | null;
2781
+ /**
2782
+ * The assigned service account. Carries no secret — the client secret is
2783
+ * returned once, at creation, and never again.
2784
+ */
2785
+ service_account: ServiceAccountResponse;
2786
+ /**
2787
+ * The tenants this assignment reaches, or omitted for "wherever the role
2788
+ * does". Shown next to the assignment so an operator can tell a deliberately
2789
+ * narrowed grant from an organization-wide one.
2790
+ */
2791
+ tenant_scope?: string[] | null;
2669
2792
  }
2670
2793
  /** A user together with the resource scope of their assignment of this role. */
2671
2794
  interface RoleUserAssignment {
2672
2795
  /** `None` means the role was assigned globally (no resource scope). */
2673
2796
  resource_id?: string | null;
2797
+ /**
2798
+ * The tenants this assignment reaches, or omitted for "wherever the role
2799
+ * does". Shown next to the assignment so an operator can tell a deliberately
2800
+ * narrowed grant from an organization-wide one.
2801
+ */
2802
+ tenant_scope?: string[] | null;
2674
2803
  /** The assigned user. */
2675
2804
  user: UserResponse;
2676
2805
  }
@@ -3902,7 +4031,7 @@ declare class ManifestApi {
3902
4031
  /**
3903
4032
  * Pagination for the §27 management surface.
3904
4033
  *
3905
- * Twenty of the 146 operations take `offset`/`limit` and answer with the
4034
+ * Twenty of the 147 operations take `offset`/`limit` and answer with the
3906
4035
  * envelope `{ items, total, offset, limit }`. The other thirteen collection
3907
4036
  * reads answer with a bare array and are **not** paginated — §27.4 rule 4
3908
4037
  * forbids modelling those as a page, because a `Page` reporting
@@ -3992,7 +4121,7 @@ declare function collectPages<T>(start: PageRequest, fetch: (page: PageRequest)
3992
4121
  /**
3993
4122
  * Where `{org_id}` and `{tenant_id}` come from — CONTRACT §27.4 rule 3.
3994
4123
  *
3995
- * Thirty of the 146 routes carry one or both, and in almost every call they
4124
+ * Thirty-one of the 147 routes carry one or both, and in almost every call they
3996
4125
  * are the client's own. Making the caller restate them every time is ceremony
3997
4126
  * that gets wrapped in a helper anyway; making them impossible to override is
3998
4127
  * worse, because a platform-admin token legitimately administers a tenant
@@ -4124,6 +4253,13 @@ declare class TenantsApi {
4124
4253
  * issued exactly once, including the ones that look idempotent.
4125
4254
  */
4126
4255
  delete(tenantId: string): Promise<void>;
4256
+ /**
4257
+ * `POST /api/v1/organizations/{org_id}/tenants/{tenant_id}/audit-export`
4258
+ *
4259
+ * Not retried on failure (§27.4 rule 8): every write on this surface is
4260
+ * issued exactly once, including the ones that look idempotent.
4261
+ */
4262
+ exportAudit(tenantId: string): Promise<void>;
4127
4263
  }
4128
4264
 
4129
4265
  /**
@@ -4285,6 +4421,31 @@ declare class GroupsApi {
4285
4421
  removeMember(groupId: string, userId: string): Promise<void>;
4286
4422
  /** `GET /api/v1/groups/{group_id}/roles` */
4287
4423
  listRoles(groupId: string): Promise<RoleAssignment[]>;
4424
+ /** `GET /api/v1/groups/{group_id}/service-accounts` */
4425
+ listServiceAccounts(groupId: string, page?: PageRequest): Promise<Page<ServiceAccountResponse>>;
4426
+ /**
4427
+ * Walk `groups.list_service_accounts` to exhaustion, concatenating every
4428
+ * page.
4429
+ *
4430
+ * The auto-paging form §27.4 rule 4 requires. It stops on an empty page even
4431
+ * if `total` disagrees, so a misreporting server costs one wasted request
4432
+ * rather than an unbounded loop.
4433
+ */
4434
+ listServiceAccountsAll(groupId: string, start?: PageRequest): Promise<ServiceAccountResponse[]>;
4435
+ /**
4436
+ * `POST /api/v1/groups/{group_id}/service-accounts`
4437
+ *
4438
+ * Not retried on failure (§27.4 rule 8): every write on this surface is
4439
+ * issued exactly once, including the ones that look idempotent.
4440
+ */
4441
+ addServiceAccount(groupId: string, body: AddServiceAccountMemberRequest): Promise<void>;
4442
+ /**
4443
+ * `DELETE /api/v1/groups/{group_id}/service-accounts/{service_account_id}`
4444
+ *
4445
+ * Not retried on failure (§27.4 rule 8): every write on this surface is
4446
+ * issued exactly once, including the ones that look idempotent.
4447
+ */
4448
+ removeServiceAccount(groupId: string, serviceAccountId: string): Promise<void>;
4288
4449
  }
4289
4450
 
4290
4451
  /**
@@ -4386,6 +4547,22 @@ declare class RolesApi {
4386
4547
  * issued exactly once, including the ones that look idempotent.
4387
4548
  */
4388
4549
  revokePermission(roleId: string, permissionId: string): Promise<void>;
4550
+ /** `GET /api/v1/roles/{role_id}/service-accounts` */
4551
+ listServiceAccounts(roleId: string): Promise<RoleServiceAccountAssignment[]>;
4552
+ /**
4553
+ * `POST /api/v1/roles/{role_id}/service-accounts`
4554
+ *
4555
+ * Not retried on failure (§27.4 rule 8): every write on this surface is
4556
+ * issued exactly once, including the ones that look idempotent.
4557
+ */
4558
+ assignToServiceAccount(roleId: string, body: AssignRoleToServiceAccountRequest): Promise<void>;
4559
+ /**
4560
+ * `DELETE /api/v1/roles/{role_id}/service-accounts/{service_account_id}`
4561
+ *
4562
+ * Not retried on failure (§27.4 rule 8): every write on this surface is
4563
+ * issued exactly once, including the ones that look idempotent.
4564
+ */
4565
+ unassignFromServiceAccount(roleId: string, serviceAccountId: string, resourceId?: string): Promise<void>;
4389
4566
  }
4390
4567
 
4391
4568
  /**
@@ -4620,6 +4797,10 @@ declare class ServiceAccountsApi {
4620
4797
  * issued exactly once, including the ones that look idempotent.
4621
4798
  */
4622
4799
  bindCertificate(saId: string, body: BindCertificate): Promise<void>;
4800
+ /** `GET /api/v1/service-accounts/{service_account_id}/roles` */
4801
+ listRoles(serviceAccountId: string): Promise<RoleAssignment[]>;
4802
+ /** `GET /api/v1/service-accounts/{service_account_id}/groups` */
4803
+ listGroups(serviceAccountId: string): Promise<Group[]>;
4623
4804
  }
4624
4805
 
4625
4806
  /**
@@ -5562,7 +5743,7 @@ declare class PlatformApi {
5562
5743
  * One handle per §27 namespace, and the accessors that reach them.
5563
5744
  *
5564
5745
  * §27.2 makes this namespacing normative rather than stylistic: twenty
5565
- * namespaces have a `list` and fourteen a `get`, so flattening 146 operations
5746
+ * namespaces have a `list` and fourteen a `get`, so flattening 147 operations
5566
5747
  * onto the client would need a disambiguating prefix invented once per
5567
5748
  * operation — and would bury the eight §1 methods most callers actually want
5568
5749
  * under five times as many they do not.
@@ -5759,7 +5940,12 @@ declare class AxiamClient {
5759
5940
  loginOpaque(usernameOrEmail: string, password: string): Promise<LoginResult>;
5760
5941
  /**
5761
5942
  * Build an OPAQUE registration record to send with any request that sets a
5762
- * password (§23). The server cannot build one — it never sees the plaintext.
5943
+ * password (§23), sealed against the tenant this client is **acting on**.
5944
+ * The server cannot build one — it never sees the plaintext.
5945
+ *
5946
+ * Right for creating **another** account (§27 `users.create`); for the
5947
+ * caller's *own* password change use {@link opaqueEnrollmentForSelf}, which
5948
+ * seals against the tenant the account lives in (§5.2.2 rule 2).
5763
5949
  *
5764
5950
  * Asynchronous because it performs a `register/start` round trip: the
5765
5951
  * envelope is sealed under the server's oblivious PRF, so unlike the SRP
@@ -5767,6 +5953,20 @@ declare class AxiamClient {
5767
5953
  * valid record.
5768
5954
  */
5769
5955
  opaqueEnrollment(password: string): Promise<OpaqueEnrollment>;
5956
+ /**
5957
+ * Build an OPAQUE registration record for the **caller's own** new password,
5958
+ * sealed against the tenant the caller's account lives in (§5.2.2 rule 2).
5959
+ *
5960
+ * Identical to {@link opaqueEnrollment} for every ordinary principal — the
5961
+ * two tenants are the same value there. They diverge for an
5962
+ * organization-level principal that has selected another tenant to act on,
5963
+ * and a record sealed against the acting one is refused with *"the OPAQUE
5964
+ * session was issued for a different tenant"*.
5965
+ *
5966
+ * Requires a completed login: the principal tenant is reported by the login
5967
+ * response, so there is nothing to seal against before then.
5968
+ */
5969
+ opaqueEnrollmentForSelf(password: string): Promise<OpaqueEnrollment>;
5770
5970
  /**
5771
5971
  * Whether this installation can perform OPAQUE (§23.2).
5772
5972
  *
@@ -5828,4 +6028,4 @@ declare class AxiamClient {
5828
6028
  confirmPasswordReset(confirmation: PasswordResetConfirmation): Promise<void>;
5829
6029
  }
5830
6030
 
5831
- export { type CreateScimTokenResponse as $, AxiamClient as A, BASE_DELAY_MS as B, type CaCertificate as C, type ClientAuthMethod as D, type ClientProfile as E, type ComplianceReportEntry as F, type GrantSpec as G, type CreateCaCertificateRequest as H, type CreateCertificateRequest as I, type CreateFederationConfigRequest as J, type CreateFederationConfigRequestWire as K, type CreateGroupRequest as L, type ManagementManifest as M, type CreateIntermediateCaRequest as N, type CreateNotificationRuleRequest as O, type PermissionSpec as P, type CreateOAuth2ClientRequest as Q, type ResourceSpec as R, type ScopeSpec as S, type CreatePermissionRequest as T, type UserSpec as U, type CreatePgpKeyRequest as V, type WebauthnWorkspace as W, type CreateReactorRequest as X, type CreateResourceRequest as Y, type CreateRoleRequest as Z, type CreateScimTokenRequest as _, type WebauthnLoginResult as a, type OidcCallbackResponse as a$, type CreateScimTokenResponseWire as a0, type CreateScopeRequest as a1, type CreateServiceAccountRequest as a2, type CreateTenantRequest as a3, type CreateUserRequest as a4, type CreateUserRequestWire as a5, type CreateWebhookRequest as a6, type CreateWebhookRequestWire as a7, DecisionMemo as a8, type EmailConfig as a9, MAX_ATTEMPTS as aA, MAX_DELAY_MS as aB, MAX_TTL_MS as aC, type ManagementNamespaces as aD, type ManagementPlan as aE, ManifestApi as aF, type ManifestFailure as aG, type MdsRefreshOutcome as aH, type MdsStatusResponse as aI, type MfaEnrollment as aJ, type MfaMethodResponse as aK, type MfaMethodType as aL, type MfaPolicy as aM, type MigrateCustodyResponse as aN, type MtlsTrustAnchorResponse as aO, type NamespaceScope as aP, type NotificationEventType as aQ, type NotificationPolicy as aR, type NotificationRuleResponse as aS, NotificationRulesApi as aT, type OAuth2ClientCreatedResponse as aU, type OAuth2ClientCreatedResponseWire as aV, type OAuth2ClientResponse as aW, Oauth2ClientsApi as aX, type OidcAuthorizeRequest as aY, type OidcAuthorizeResponse as aZ, type OidcCallbackRequest as a_, EmailConfigApi as aa, type EmailConfigOverride as ab, type EmailTestResult as ac, type EmailVerificationPolicy as ad, type EncryptRequest as ae, type EncryptedExport as af, type FailurePolicy as ag, FederationApi as ah, type FederationConfigResponse as ai, type FederationLinkResponse as aj, type FinishRequest as ak, type GeneratedCaCertificate as al, type GeneratedCaCertificateWire as am, type GeneratedCertificate as an, type GeneratedCertificateWire as ao, type GeneratedPgpKey as ap, type GeneratedPgpKeyWire as aq, type GrantPermissionRequest as ar, type GrantedScope as as, type Group as at, GroupsApi as au, type HealthResponse as av, type ImportCaCertificateRequest as aw, type ImportCaCertificateRequestWire as ax, type KeyAlgorithm as ay, type LockoutPolicy as az, type WebauthnCredential as b, TelemetryReporter as b$, type OpaqueEnrollment as b0, type OpaqueEnrollmentPayload as b1, type OpaquePolicy as b2, type Organization as b3, OrganizationsApi as b4, type Page as b5, type PageRequest as b6, type PasswordPolicy as b7, type PasswordResetConfirmation as b8, type PasswordResetContext as b9, type RoleAssignment as bA, type RoleGroupAssignment as bB, type RoleUserAssignment as bC, RolesApi as bD, type RotateSecretResponse as bE, type RotateSecretResponseWire as bF, type ScimTokenResponse as bG, type ScimTokenStatus as bH, ScimTokensApi as bI, type Scope as bJ, ScopesApi as bK, type SecuritySettings as bL, type ServiceAccountCreatedResponse as bM, type ServiceAccountCreatedResponseWire as bN, type ServiceAccountResponse as bO, ServiceAccountsApi as bP, type SetMtlsTrustAnchor as bQ, type SetOrgEmailConfig as bR, type SetOrgSettings as bS, SettingsApi as bT, type SettingsScope as bU, type SignAuditBatchRequest as bV, type SignIntermediateCsrRequest as bW, type SignedAuditBatch as bX, type SmtpConfig as bY, type StepOutcome as bZ, type Target as b_, type PasswordResetRequest as ba, type Permission as bb, type PermissionEffect as bc, PermissionsApi as bd, type PgpKey as be, type PgpKeyAlgorithm as bf, type PgpKeyPurpose as bg, type PgpKeyStatus as bh, PgpKeysApi as bi, type PlannedAction as bj, PlatformApi as bk, type PolicyResponse as bl, PrivacyApi as bm, type PrivacyPolicy as bn, type ProviderConfig as bo, type ReactorEventDescriptor as bp, type ReactorMode as bq, type ReactorResponse as br, ReactorsApi as bs, type ReadyResponse as bt, type ResolvedPermissionGrant as bu, type Resource as bv, ResourcesApi as bw, type RetryOptions as bx, type RetryPolicy as by, type Role as bz, type GroupSpec as c, pageQuery as c$, type Tenant as c0, type TenantKind as c1, type TenantSettingsOverride as c2, type TenantStatus as c3, TenantsApi as c4, type TokenExchangeTrustRequest as c5, type TokenExchangeTrustResponse as c6, type TokenPolicy as c7, type UnknownAaguidAction as c8, type UpdateFederationConfigRequest as c9, type WebauthnRegistrationResponse as cA, type WebauthnRequestChallenge as cB, type WebauthnRequestOptionsJson as cC, type WebhookResponse as cD, WebhooksApi as cE, backoffMs as cF, changedCount as cG, changes as cH, collectPages as cI, createFederationConfigRequestToWire as cJ, createScimTokenResponseFromWire as cK, createUserRequestToWire as cL, createWebhookRequestToWire as cM, delayMs as cN, failure as cO, generatedCaCertificateFromWire as cP, generatedCertificateFromWire as cQ, generatedPgpKeyFromWire as cR, hasMore as cS, importCaCertificateRequestToWire as cT, isComplete as cU, isConverged as cV, managementNamespaces as cW, memoKey as cX, normalizeSearch as cY, oAuth2ClientCreatedResponseFromWire as cZ, opaqueEnrollment as c_, type UpdateFederationConfigRequestWire as ca, type UpdateGroup as cb, type UpdateNotificationRuleRequest as cc, type UpdateOAuth2ClientRequest as cd, type UpdateOrganizationRequest as ce, type UpdatePermissionRequest as cf, type UpdateReactorRequest as cg, type UpdateResourceRequest as ch, type UpdateRole as ci, type UpdateScopeRequest as cj, type UpdateServiceAccount as ck, type UpdateTenant as cl, type UpdateUserRequest as cm, type UpdateWebhookRequest as cn, type UpdateWebhookRequestWire as co, type UserResponse as cp, type UserStatus as cq, UsersApi as cr, type WebauthnAttestationPolicy as cs, type WebauthnAuthenticationChallenge as ct, type WebauthnAuthenticationResponse as cu, type WebauthnCreationChallenge as cv, type WebauthnCreationOptionsJson as cw, type WebauthnCredentialDescriptorJson as cx, WebauthnPolicyApi as cy, type WebauthnRegistrationChallenge as cz, type RoleSpec as d, rotateSecretResponseFromWire as d0, serviceAccountCreatedResponseFromWire as d1, topologicalOrder as d2, updateFederationConfigRequestToWire as d3, updateWebhookRequestToWire as d4, validate as d5, webauthnRequestJson as d6, withRetry as d7, type ActorType as e, type AddMemberRequest as f, type ApiProviderConfig as g, type AppliedStep as h, type ApplyReport as i, type AssignRoleToGroupRequest as j, type AssignRoleToUserRequest as k, type AttestationMode as l, AuditApi as m, type AuditListFilter as n, type AuditListSystemFilter as o, type AuditLogEntry as p, type AuditOutcome as q, type BindCertificate as r, CaCertificatesApi as s, type Certificate as t, type CertificatePolicy as u, type CertificateStatus as v, type CertificateType as w, CertificatesApi as x, type CertificationLevel as y, type Change as z };
6031
+ export { type CreateRoleRequest as $, AxiamClient as A, BASE_DELAY_MS as B, type CaCertificate as C, type CertificationLevel as D, type Change as E, type ClientAuthMethod as F, type GrantSpec as G, type ClientProfile as H, type ComplianceReportEntry as I, type CreateCaCertificateRequest as J, type CreateCertificateRequest as K, type CreateFederationConfigRequest as L, type ManagementManifest as M, type CreateFederationConfigRequestWire as N, type CreateGroupRequest as O, type PermissionSpec as P, type CreateIntermediateCaRequest as Q, type ResourceSpec as R, type ScopeSpec as S, type CreateNotificationRuleRequest as T, type UserSpec as U, type CreateOAuth2ClientRequest as V, type WebauthnWorkspace as W, type CreatePermissionRequest as X, type CreatePgpKeyRequest as Y, type CreateReactorRequest as Z, type CreateResourceRequest as _, type WebauthnLoginResult as a, type OidcAuthorizeResponse as a$, type CreateScimTokenRequest as a0, type CreateScimTokenResponse as a1, type CreateScimTokenResponseWire as a2, type CreateScopeRequest as a3, type CreateServiceAccountRequest as a4, type CreateTenantRequest as a5, type CreateUserRequest as a6, type CreateUserRequestWire as a7, type CreateWebhookRequest as a8, type CreateWebhookRequestWire as a9, type KeyAlgorithm as aA, type LockoutPolicy as aB, MAX_ATTEMPTS as aC, MAX_DELAY_MS as aD, MAX_TTL_MS as aE, type ManagementNamespaces as aF, type ManagementPlan as aG, ManifestApi as aH, type ManifestFailure as aI, type MdsRefreshOutcome as aJ, type MdsStatusResponse as aK, type MfaEnrollment as aL, type MfaMethodResponse as aM, type MfaMethodType as aN, type MfaPolicy as aO, type MigrateCustodyResponse as aP, type MtlsTrustAnchorResponse as aQ, type NamespaceScope as aR, type NotificationEventType as aS, type NotificationPolicy as aT, type NotificationRuleResponse as aU, NotificationRulesApi as aV, type OAuth2ClientCreatedResponse as aW, type OAuth2ClientCreatedResponseWire as aX, type OAuth2ClientResponse as aY, Oauth2ClientsApi as aZ, type OidcAuthorizeRequest as a_, DecisionMemo as aa, type EmailConfig as ab, EmailConfigApi as ac, type EmailConfigOverride as ad, type EmailTestResult as ae, type EmailVerificationPolicy as af, type EncryptRequest as ag, type EncryptedExport as ah, type FailurePolicy as ai, FederationApi as aj, type FederationConfigResponse as ak, type FederationLinkResponse as al, type FinishRequest as am, type GeneratedCaCertificate as an, type GeneratedCaCertificateWire as ao, type GeneratedCertificate as ap, type GeneratedCertificateWire as aq, type GeneratedPgpKey as ar, type GeneratedPgpKeyWire as as, type GrantPermissionRequest as at, type GrantedScope as au, type Group as av, GroupsApi as aw, type HealthResponse as ax, type ImportCaCertificateRequest as ay, type ImportCaCertificateRequestWire as az, type WebauthnCredential as b, type SmtpConfig as b$, type OidcCallbackRequest as b0, type OidcCallbackResponse as b1, type OpaqueEnrollment as b2, type OpaqueEnrollmentPayload as b3, type OpaquePolicy as b4, type Organization as b5, OrganizationsApi as b6, type Page as b7, type PageRequest as b8, type PasswordPolicy as b9, type RetryPolicy as bA, type Role as bB, type RoleAssignment as bC, type RoleGroupAssignment as bD, type RoleServiceAccountAssignment as bE, type RoleUserAssignment as bF, RolesApi as bG, type RotateSecretResponse as bH, type RotateSecretResponseWire as bI, type ScimTokenResponse as bJ, type ScimTokenStatus as bK, ScimTokensApi as bL, type Scope as bM, ScopesApi as bN, type SecuritySettings as bO, type ServiceAccountCreatedResponse as bP, type ServiceAccountCreatedResponseWire as bQ, type ServiceAccountResponse as bR, ServiceAccountsApi as bS, type SetMtlsTrustAnchor as bT, type SetOrgEmailConfig as bU, type SetOrgSettings as bV, SettingsApi as bW, type SettingsScope as bX, type SignAuditBatchRequest as bY, type SignIntermediateCsrRequest as bZ, type SignedAuditBatch as b_, type PasswordResetConfirmation as ba, type PasswordResetContext as bb, type PasswordResetRequest as bc, type Permission as bd, type PermissionEffect as be, PermissionsApi as bf, type PgpKey as bg, type PgpKeyAlgorithm as bh, type PgpKeyPurpose as bi, type PgpKeyStatus as bj, PgpKeysApi as bk, type PlannedAction as bl, PlatformApi as bm, type PolicyResponse as bn, PrivacyApi as bo, type PrivacyPolicy as bp, type ProviderConfig as bq, type ReactorEventDescriptor as br, type ReactorMode as bs, type ReactorResponse as bt, ReactorsApi as bu, type ReadyResponse as bv, type ResolvedPermissionGrant as bw, type Resource as bx, ResourcesApi as by, type RetryOptions as bz, type GroupSpec as c, normalizeSearch as c$, type StepOutcome as c0, type Target as c1, TelemetryReporter as c2, type Tenant as c3, type TenantKind as c4, type TenantSettingsOverride as c5, type TenantStatus as c6, TenantsApi as c7, type TokenExchangeTrustRequest as c8, type TokenExchangeTrustResponse as c9, type WebauthnCredentialDescriptorJson as cA, WebauthnPolicyApi as cB, type WebauthnRegistrationChallenge as cC, type WebauthnRegistrationResponse as cD, type WebauthnRequestChallenge as cE, type WebauthnRequestOptionsJson as cF, type WebhookResponse as cG, WebhooksApi as cH, backoffMs as cI, changedCount as cJ, changes as cK, collectPages as cL, createFederationConfigRequestToWire as cM, createScimTokenResponseFromWire as cN, createUserRequestToWire as cO, createWebhookRequestToWire as cP, delayMs as cQ, failure as cR, generatedCaCertificateFromWire as cS, generatedCertificateFromWire as cT, generatedPgpKeyFromWire as cU, hasMore as cV, importCaCertificateRequestToWire as cW, isComplete as cX, isConverged as cY, managementNamespaces as cZ, memoKey as c_, type TokenPolicy as ca, type UnknownAaguidAction as cb, type UpdateFederationConfigRequest as cc, type UpdateFederationConfigRequestWire as cd, type UpdateGroup as ce, type UpdateNotificationRuleRequest as cf, type UpdateOAuth2ClientRequest as cg, type UpdateOrganizationRequest as ch, type UpdatePermissionRequest as ci, type UpdateReactorRequest as cj, type UpdateResourceRequest as ck, type UpdateRole as cl, type UpdateScopeRequest as cm, type UpdateServiceAccount as cn, type UpdateTenant as co, type UpdateUserRequest as cp, type UpdateWebhookRequest as cq, type UpdateWebhookRequestWire as cr, type UserResponse as cs, type UserStatus as ct, UsersApi as cu, type WebauthnAttestationPolicy as cv, type WebauthnAuthenticationChallenge as cw, type WebauthnAuthenticationResponse as cx, type WebauthnCreationChallenge as cy, type WebauthnCreationOptionsJson as cz, type RoleSpec as d, oAuth2ClientCreatedResponseFromWire as d0, omitEmptyTenantScope as d1, opaqueEnrollment as d2, opaqueEnrollmentForSelf as d3, pageQuery as d4, rotateSecretResponseFromWire as d5, serviceAccountCreatedResponseFromWire as d6, topologicalOrder as d7, updateFederationConfigRequestToWire as d8, updateWebhookRequestToWire as d9, validate as da, webauthnRequestJson as db, withRetry as dc, type ActorType as e, type AddMemberRequest as f, type AddServiceAccountMemberRequest as g, type ApiProviderConfig as h, type AppliedStep as i, type ApplyReport as j, type AssignRoleToGroupRequest as k, type AssignRoleToServiceAccountRequest as l, type AssignRoleToUserRequest as m, type AttestationMode as n, AuditApi as o, type AuditListFilter as p, type AuditListSystemFilter as q, type AuditLogEntry as r, type AuditOutcome as s, type BindCertificate as t, CaCertificatesApi as u, type Certificate as v, type CertificatePolicy as w, type CertificateStatus as x, type CertificateType as y, CertificatesApi as z };