axiam-sdk 1.0.0-beta02 → 1.0.0-beta04

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/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,4 +1,4 @@
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-8OMNECCl.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
4
  import '../session-CMgYRxLP.cjs';
@@ -1,4 +1,4 @@
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-DTr9zaC0.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
4
  import '../session-BJHqprWm.js';
@@ -3902,7 +3902,7 @@ declare class ManifestApi {
3902
3902
  /**
3903
3903
  * Pagination for the §27 management surface.
3904
3904
  *
3905
- * Twenty of the 146 operations take `offset`/`limit` and answer with the
3905
+ * Twenty of the 147 operations take `offset`/`limit` and answer with the
3906
3906
  * envelope `{ items, total, offset, limit }`. The other thirteen collection
3907
3907
  * reads answer with a bare array and are **not** paginated — §27.4 rule 4
3908
3908
  * forbids modelling those as a page, because a `Page` reporting
@@ -3992,7 +3992,7 @@ declare function collectPages<T>(start: PageRequest, fetch: (page: PageRequest)
3992
3992
  /**
3993
3993
  * Where `{org_id}` and `{tenant_id}` come from — CONTRACT §27.4 rule 3.
3994
3994
  *
3995
- * Thirty of the 146 routes carry one or both, and in almost every call they
3995
+ * Thirty-one of the 147 routes carry one or both, and in almost every call they
3996
3996
  * are the client's own. Making the caller restate them every time is ceremony
3997
3997
  * that gets wrapped in a helper anyway; making them impossible to override is
3998
3998
  * worse, because a platform-admin token legitimately administers a tenant
@@ -4124,6 +4124,13 @@ declare class TenantsApi {
4124
4124
  * issued exactly once, including the ones that look idempotent.
4125
4125
  */
4126
4126
  delete(tenantId: string): Promise<void>;
4127
+ /**
4128
+ * `POST /api/v1/organizations/{org_id}/tenants/{tenant_id}/audit-export`
4129
+ *
4130
+ * Not retried on failure (§27.4 rule 8): every write on this surface is
4131
+ * issued exactly once, including the ones that look idempotent.
4132
+ */
4133
+ exportAudit(tenantId: string): Promise<void>;
4127
4134
  }
4128
4135
 
4129
4136
  /**
@@ -5562,7 +5569,7 @@ declare class PlatformApi {
5562
5569
  * One handle per §27 namespace, and the accessors that reach them.
5563
5570
  *
5564
5571
  * §27.2 makes this namespacing normative rather than stylistic: twenty
5565
- * namespaces have a `list` and fourteen a `get`, so flattening 146 operations
5572
+ * namespaces have a `list` and fourteen a `get`, so flattening 147 operations
5566
5573
  * onto the client would need a disambiguating prefix invented once per
5567
5574
  * operation — and would bury the eight §1 methods most callers actually want
5568
5575
  * under five times as many they do not.
@@ -3902,7 +3902,7 @@ declare class ManifestApi {
3902
3902
  /**
3903
3903
  * Pagination for the §27 management surface.
3904
3904
  *
3905
- * Twenty of the 146 operations take `offset`/`limit` and answer with the
3905
+ * Twenty of the 147 operations take `offset`/`limit` and answer with the
3906
3906
  * envelope `{ items, total, offset, limit }`. The other thirteen collection
3907
3907
  * reads answer with a bare array and are **not** paginated — §27.4 rule 4
3908
3908
  * forbids modelling those as a page, because a `Page` reporting
@@ -3992,7 +3992,7 @@ declare function collectPages<T>(start: PageRequest, fetch: (page: PageRequest)
3992
3992
  /**
3993
3993
  * Where `{org_id}` and `{tenant_id}` come from — CONTRACT §27.4 rule 3.
3994
3994
  *
3995
- * Thirty of the 146 routes carry one or both, and in almost every call they
3995
+ * Thirty-one of the 147 routes carry one or both, and in almost every call they
3996
3996
  * are the client's own. Making the caller restate them every time is ceremony
3997
3997
  * that gets wrapped in a helper anyway; making them impossible to override is
3998
3998
  * worse, because a platform-admin token legitimately administers a tenant
@@ -4124,6 +4124,13 @@ declare class TenantsApi {
4124
4124
  * issued exactly once, including the ones that look idempotent.
4125
4125
  */
4126
4126
  delete(tenantId: string): Promise<void>;
4127
+ /**
4128
+ * `POST /api/v1/organizations/{org_id}/tenants/{tenant_id}/audit-export`
4129
+ *
4130
+ * Not retried on failure (§27.4 rule 8): every write on this surface is
4131
+ * issued exactly once, including the ones that look idempotent.
4132
+ */
4133
+ exportAudit(tenantId: string): Promise<void>;
4127
4134
  }
4128
4135
 
4129
4136
  /**
@@ -5562,7 +5569,7 @@ declare class PlatformApi {
5562
5569
  * One handle per §27 namespace, and the accessors that reach them.
5563
5570
  *
5564
5571
  * §27.2 makes this namespacing normative rather than stylistic: twenty
5565
- * namespaces have a `list` and fourteen a `get`, so flattening 146 operations
5572
+ * namespaces have a `list` and fourteen a `get`, so flattening 147 operations
5566
5573
  * onto the client would need a disambiguating prefix invented once per
5567
5574
  * operation — and would bury the eight §1 methods most callers actually want
5568
5575
  * under five times as many they do not.
@@ -1,6 +1,6 @@
1
1
  import { CookieJar } from 'tough-cookie';
2
2
  import { S as SharedSession, A as AxiamClientOptions, N as NodeTlsOptions } from './session-CMgYRxLP.cjs';
3
- import { A as AxiamClient } from './client-DjCaHR3c.cjs';
3
+ import { A as AxiamClient } from './client-8OMNECCl.cjs';
4
4
  import { S as Sensitive } from './sensitive-BC_s7Rrd.cjs';
5
5
  import { V as Verifier } from './jwks-CSXHo3DS.cjs';
6
6
  import { AxiosInstance } from 'axios';
@@ -1,6 +1,6 @@
1
1
  import { CookieJar } from 'tough-cookie';
2
2
  import { S as SharedSession, A as AxiamClientOptions, N as NodeTlsOptions } from './session-BJHqprWm.js';
3
- import { A as AxiamClient } from './client-y9dwy3p3.js';
3
+ import { A as AxiamClient } from './client-DTr9zaC0.js';
4
4
  import { S as Sensitive } from './sensitive-BC_s7Rrd.js';
5
5
  import { V as Verifier } from './jwks-CSXHo3DS.js';
6
6
  import { AxiosInstance } from 'axios';
@@ -1,14 +1,14 @@
1
1
  import * as grpc from '@grpc/grpc-js';
2
2
  import { Interceptor } from '@grpc/grpc-js';
3
- import { N as NodeSession } from '../cookieJar-BCILMWdK.cjs';
4
- export { A as ACCESS_COOKIE, C as CSRF_COOKIE, R as REFRESH_COOKIE, T as TokenManager, c as createJar, a as createNodeClient, b as createNodeSession, e as extractCookieValue, w as wrapAxios } from '../cookieJar-BCILMWdK.cjs';
3
+ import { N as NodeSession } from '../cookieJar-BU4bgCBi.cjs';
4
+ export { A as ACCESS_COOKIE, C as CSRF_COOKIE, R as REFRESH_COOKIE, T as TokenManager, c as createJar, a as createNodeClient, b as createNodeSession, e as extractCookieValue, w as wrapAxios } from '../cookieJar-BU4bgCBi.cjs';
5
5
  import { a as AccessDecision } from '../types-CpbckLcy.cjs';
6
6
  export { A as AxiamClaims, J as JWKS_PATH, V as Verifier, c as createVerifier } from '../jwks-CSXHo3DS.cjs';
7
7
  import 'tough-cookie';
8
8
  import '../session-CMgYRxLP.cjs';
9
9
  import 'axios';
10
10
  import '../telemetry-DrGqL4kb.cjs';
11
- import '../client-DjCaHR3c.cjs';
11
+ import '../client-8OMNECCl.cjs';
12
12
  import '../sensitive-BC_s7Rrd.cjs';
13
13
 
14
14
  /**
@@ -1,14 +1,14 @@
1
1
  import * as grpc from '@grpc/grpc-js';
2
2
  import { Interceptor } from '@grpc/grpc-js';
3
- import { N as NodeSession } from '../cookieJar-DVW2SSf5.js';
4
- export { A as ACCESS_COOKIE, C as CSRF_COOKIE, R as REFRESH_COOKIE, T as TokenManager, c as createJar, a as createNodeClient, b as createNodeSession, e as extractCookieValue, w as wrapAxios } from '../cookieJar-DVW2SSf5.js';
3
+ import { N as NodeSession } from '../cookieJar-BX9-9VSw.js';
4
+ export { A as ACCESS_COOKIE, C as CSRF_COOKIE, R as REFRESH_COOKIE, T as TokenManager, c as createJar, a as createNodeClient, b as createNodeSession, e as extractCookieValue, w as wrapAxios } from '../cookieJar-BX9-9VSw.js';
5
5
  import { a as AccessDecision } from '../types-DHnCMjtY.js';
6
6
  export { A as AxiamClaims, J as JWKS_PATH, V as Verifier, c as createVerifier } from '../jwks-CSXHo3DS.js';
7
7
  import 'tough-cookie';
8
8
  import '../session-BJHqprWm.js';
9
9
  import 'axios';
10
10
  import '../telemetry-DrGqL4kb.js';
11
- import '../client-y9dwy3p3.js';
11
+ import '../client-DTr9zaC0.js';
12
12
  import '../sensitive-BC_s7Rrd.js';
13
13
 
14
14
  /**
@@ -2656,6 +2656,21 @@ var TenantsApi = class _TenantsApi {
2656
2656
  path: `/api/v1/organizations/${orgId}/tenants/${encodeURIComponent(tenantId)}`
2657
2657
  });
2658
2658
  }
2659
+ /**
2660
+ * `POST /api/v1/organizations/{org_id}/tenants/{tenant_id}/audit-export`
2661
+ *
2662
+ * Not retried on failure (§27.4 rule 8): every write on this surface is
2663
+ * issued exactly once, including the ones that look idempotent.
2664
+ */
2665
+ async exportAudit(tenantId) {
2666
+ const orgId = resolveOrg(this.#client, this.#scope, "tenants.export_audit");
2667
+ await sendManagement(this.#client, {
2668
+ operation: "tenants.export_audit",
2669
+ method: "POST",
2670
+ pathTemplate: "/api/v1/organizations/{org_id}/tenants/{tenant_id}/audit-export",
2671
+ path: `/api/v1/organizations/${orgId}/tenants/${encodeURIComponent(tenantId)}/audit-export`
2672
+ });
2673
+ }
2659
2674
  };
2660
2675
 
2661
2676
  // src/management/models.ts