@terminal3/t3n-sdk 3.10.1 → 3.12.0
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.ts +191 -62
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -749,9 +749,9 @@ declare class UserUpsertError extends T3nError {
|
|
|
749
749
|
interface UserGrant {
|
|
750
750
|
/** The user this grant applies to (`did:t3n:<40-hex>`). */
|
|
751
751
|
user_did: string;
|
|
752
|
-
/** WIT function names the user may invoke (e.g. `"
|
|
752
|
+
/** WIT function names the user may invoke (e.g. `"set-records"`). */
|
|
753
753
|
functions: string[];
|
|
754
|
-
/** Data scope paths the user may access (e.g. `"
|
|
754
|
+
/** Data scope paths the user may access (e.g. `"example/records"`). */
|
|
755
755
|
scopes: string[];
|
|
756
756
|
/**
|
|
757
757
|
* Optional key-value constraints that must match the request metadata
|
|
@@ -775,44 +775,38 @@ interface OrgPolicyMeta {
|
|
|
775
775
|
created_at_secs: number;
|
|
776
776
|
/** Unix timestamp (secs) of the most recent policy update. */
|
|
777
777
|
updated_at_secs: number;
|
|
778
|
+
/**
|
|
779
|
+
* Per-org ceiling on delegation-credential validity (seconds).
|
|
780
|
+
*
|
|
781
|
+
* Absent when no org-level cap is set — the contract omits the field
|
|
782
|
+
* (never serialises null) and the cluster-wide
|
|
783
|
+
* `delegation.max_credential_validity_secs` governs instead. When set,
|
|
784
|
+
* the effective cap is `min(max_credential_validity_secs, cluster_ceiling)`.
|
|
785
|
+
*/
|
|
786
|
+
max_credential_validity_secs?: number;
|
|
778
787
|
}
|
|
779
788
|
/** Shallow runtime guard for {@link OrgPolicyMeta}. */
|
|
780
789
|
declare function isOrgPolicyMeta(value: unknown): value is OrgPolicyMeta;
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
employee_id: string;
|
|
799
|
-
employment_status: EmploymentStatus;
|
|
800
|
-
is_on_probation: boolean;
|
|
801
|
-
hire_date: string;
|
|
802
|
-
termination_date?: string;
|
|
803
|
-
/** Monthly gross base salary in integer cents SGD. */
|
|
804
|
-
base_salary_cents: number;
|
|
805
|
-
unpaid_leave_days: number;
|
|
806
|
-
working_days_in_period: number;
|
|
807
|
-
overtime_hours: number;
|
|
808
|
-
hourly_rate_cents: number;
|
|
809
|
-
residency: ResidencyCategory;
|
|
810
|
-
age_band: AgeBand;
|
|
811
|
-
expense_claims: ExpenseClaim[];
|
|
812
|
-
/** Opaque reference used by the service layer for disbursement. */
|
|
813
|
-
bank_account_ref: string;
|
|
814
|
-
bank_account_changed_recently: boolean;
|
|
790
|
+
/**
|
|
791
|
+
* Effective org policy view returned by `org-policy-view`.
|
|
792
|
+
*
|
|
793
|
+
* Readable by any authenticated session (non-sensitive metadata).
|
|
794
|
+
* Returns the **effective** credential validity cap:
|
|
795
|
+
* `min(org.max_credential_validity_secs, cluster_ceiling)`, equal to the
|
|
796
|
+
* cluster ceiling when the org has not set a per-org cap. The contract
|
|
797
|
+
* always returns a value (or errors) — the field is never null.
|
|
798
|
+
*/
|
|
799
|
+
interface OrgPolicyView {
|
|
800
|
+
/**
|
|
801
|
+
* Effective delegation-credential validity cap in seconds:
|
|
802
|
+
* `min(org value, cluster ceiling)`, equal to the cluster ceiling when the
|
|
803
|
+
* org has not set a per-org cap. Always present — mirrors the contract's
|
|
804
|
+
* `PolicyViewResponse.effective_validity_secs` (org-data `org-policy-view`).
|
|
805
|
+
*/
|
|
806
|
+
effective_validity_secs: number;
|
|
815
807
|
}
|
|
808
|
+
/** Shallow runtime guard for {@link OrgPolicyView}. */
|
|
809
|
+
declare function isOrgPolicyView(value: unknown): value is OrgPolicyView;
|
|
816
810
|
/**
|
|
817
811
|
* Standard response returned by all policy write and data mutation operations.
|
|
818
812
|
*
|
|
@@ -1708,6 +1702,28 @@ declare class T3nClient {
|
|
|
1708
1702
|
* @throws {ContractResponseError} when the response is not valid JSON
|
|
1709
1703
|
*/
|
|
1710
1704
|
executeAndDecode<T = unknown>(payload: unknown, schema?: ContractResponseSchema<T>): Promise<T>;
|
|
1705
|
+
/**
|
|
1706
|
+
* Create a new organisation owned by the authenticated caller.
|
|
1707
|
+
*
|
|
1708
|
+
* Dispatches `organisation-create-self` on `tee:organisation/contracts`
|
|
1709
|
+
* over the standard authenticated `action.execute` path. The node
|
|
1710
|
+
* injects the caller's DID into the contract call context, and the
|
|
1711
|
+
* contract forces the new organisation's sole initial admin to that
|
|
1712
|
+
* caller — the caller cannot nominate a different admin, and the
|
|
1713
|
+
* organisation is always created as a root. The caller must already be
|
|
1714
|
+
* a registered user, and the call is metered against the caller's own
|
|
1715
|
+
* credits.
|
|
1716
|
+
*
|
|
1717
|
+
* The returned DID is the org identifier the org-data and payroll
|
|
1718
|
+
* surfaces expect (e.g. `OrgDataClient.setGrants({ orgDid, … })`).
|
|
1719
|
+
*
|
|
1720
|
+
* @param name - human-readable organisation name (1..=128 bytes)
|
|
1721
|
+
* @returns the new organisation's DID (`did:t3n:<40-hex>`)
|
|
1722
|
+
* @throws if the session is not authenticated, or if the contract
|
|
1723
|
+
* refuses (e.g. the caller is not a registered user, or the name is
|
|
1724
|
+
* empty / too long)
|
|
1725
|
+
*/
|
|
1726
|
+
createOrganisation(name: string): Promise<Did>;
|
|
1711
1727
|
/**
|
|
1712
1728
|
* Build the canonical `ExecuteActionRequest` shape the server
|
|
1713
1729
|
* expects (`script_name`, `script_version`, `function_name`, `input`,
|
|
@@ -2248,11 +2264,20 @@ declare const AGENT_PUBKEY_LEN = 33;
|
|
|
2248
2264
|
declare const ETH_SIG_LEN = 65;
|
|
2249
2265
|
declare const MAX_FUNCTIONS_PER_CREDENTIAL = 16;
|
|
2250
2266
|
/**
|
|
2251
|
-
* Canonical sorted
|
|
2252
|
-
*
|
|
2253
|
-
*
|
|
2267
|
+
* Canonical sorted run-pipeline function surface for the z-payroll contract
|
|
2268
|
+
* (`z:<org-tid>:payroll`). Sorted ascending as required by the credential
|
|
2269
|
+
* validator. Mirrors `Z_PAYROLL_RUN_FUNCTIONS` in the Trinity harness.
|
|
2270
|
+
*
|
|
2271
|
+
* Pass this (or a sorted subset) as `functions` to
|
|
2272
|
+
* {@link buildDelegationCredential} for z-payroll credentials.
|
|
2273
|
+
*/
|
|
2274
|
+
declare const Z_PAYROLL_RUN_FUNCTIONS: readonly ["compute-payroll", "execute-disbursement", "finalize-audit", "submit-escalations", "validate-credentials"];
|
|
2275
|
+
/**
|
|
2276
|
+
* Canonical sorted audit-read function surface for the z-payroll contract.
|
|
2277
|
+
* These functions authorise history reads via `list-audit-cycles` /
|
|
2278
|
+
* `get-audit-entry`.
|
|
2254
2279
|
*/
|
|
2255
|
-
declare const
|
|
2280
|
+
declare const Z_PAYROLL_AUDIT_READ_FUNCTIONS: readonly ["get-audit-entry", "list-audit-cycles"];
|
|
2256
2281
|
/** User-to-agent delegation credential body. */
|
|
2257
2282
|
interface DelegationCredential {
|
|
2258
2283
|
/** Domain tag, must equal {@link DELEGATION_CREDENTIAL_DOMAIN}. */
|
|
@@ -2263,7 +2288,7 @@ interface DelegationCredential {
|
|
|
2263
2288
|
agent_pubkey: Uint8Array;
|
|
2264
2289
|
/** `did:t3n:<40-hex>` org DID. */
|
|
2265
2290
|
org_did: string;
|
|
2266
|
-
/** Contract id, e.g. `"tee:payroll"`. */
|
|
2291
|
+
/** Contract id, e.g. `"tee:z-payroll"`. */
|
|
2267
2292
|
contract: string;
|
|
2268
2293
|
/**
|
|
2269
2294
|
* Functions this credential authorises. Sorted ascending, deduped,
|
|
@@ -2325,7 +2350,7 @@ interface PayrollInvocationDelegated {
|
|
|
2325
2350
|
* Direct invocation: the agent acts on its own behalf. No delegation
|
|
2326
2351
|
* envelope is included. The principal DID is resolved by the service layer
|
|
2327
2352
|
* from `DynamicContext.authenticated_did`; authorisation falls through to
|
|
2328
|
-
* `OrgContractGrants[org || "tee:payroll"]` for the agent's own DID.
|
|
2353
|
+
* `OrgContractGrants[org || "tee:z-payroll"]` for the agent's own DID.
|
|
2329
2354
|
*
|
|
2330
2355
|
* Wire shape is `{ request }` — no `envelope` field and no
|
|
2331
2356
|
* `authenticated_did` field. The contract's entry-point handler injects
|
|
@@ -2511,6 +2536,9 @@ interface RevokeDelegationOpts {
|
|
|
2511
2536
|
* enforces, and each entry must already appear in the credential's
|
|
2512
2537
|
* `functions` list (a revocation can only narrow the set, never grow
|
|
2513
2538
|
* it).
|
|
2539
|
+
*
|
|
2540
|
+
* Ignored when routing to a z-space contract (`revoke-credential` drops
|
|
2541
|
+
* per-function granularity — whole-credential only).
|
|
2514
2542
|
*/
|
|
2515
2543
|
revokedFunctions?: string[];
|
|
2516
2544
|
/** Authenticated {@link T3nClient} for the credential's `user_did`. */
|
|
@@ -2519,6 +2547,9 @@ interface RevokeDelegationOpts {
|
|
|
2519
2547
|
* Override the resolved delegation contract version. Defaults to
|
|
2520
2548
|
* whatever `GET /api/contracts/current?name=tee:delegation/contracts`
|
|
2521
2549
|
* returns at call time.
|
|
2550
|
+
*
|
|
2551
|
+
* For z-space credentials this field is REQUIRED — `GET /api/contracts/current`
|
|
2552
|
+
* 404s for z: names, so there is no dynamic resolution path.
|
|
2522
2553
|
*/
|
|
2523
2554
|
scriptVersion?: string;
|
|
2524
2555
|
/** Override the node base URL used for `"latest"` resolution. */
|
|
@@ -2533,19 +2564,27 @@ interface RevokeDelegationResult {
|
|
|
2533
2564
|
* whole-credential, a sorted array means per-function. The contract
|
|
2534
2565
|
* may return a larger set than `opts.revokedFunctions` when an
|
|
2535
2566
|
* earlier per-function revocation existed for the same credential.
|
|
2567
|
+
*
|
|
2568
|
+
* Always `null` for z-space credentials (whole-credential granularity only).
|
|
2536
2569
|
*/
|
|
2537
2570
|
revokedFunctions: string[] | null;
|
|
2538
2571
|
}
|
|
2539
2572
|
/**
|
|
2540
|
-
*
|
|
2541
|
-
*
|
|
2542
|
-
*
|
|
2543
|
-
*
|
|
2573
|
+
* Revoke a delegation credential, routing automatically to the correct
|
|
2574
|
+
* revocation endpoint based on the credential's `contract` field:
|
|
2575
|
+
*
|
|
2576
|
+
* - **`tee:` credentials** — calls `tee:delegation/contracts::revoke`.
|
|
2577
|
+
* Only the credential's `user_did` may call this; the contract reads the
|
|
2578
|
+
* authenticated DID from session context and rejects other callers with
|
|
2579
|
+
* `NotCredentialHolder`. Per-function granularity via `revokedFunctions`
|
|
2580
|
+
* is supported. Merge semantics are handled server-side.
|
|
2544
2581
|
*
|
|
2545
|
-
*
|
|
2546
|
-
*
|
|
2547
|
-
*
|
|
2548
|
-
*
|
|
2582
|
+
* - **`z:` credentials** — routes to `<z-contract>::revoke-credential`.
|
|
2583
|
+
* The tenant owns its own revocation list; the global
|
|
2584
|
+
* `tee:delegation.revoke` rejects z-space credential names with a typed
|
|
2585
|
+
* `TenantScopedCredential` error. `revokedFunctions` is ignored (z-payroll
|
|
2586
|
+
* revokes whole credentials only). `scriptVersion` is REQUIRED for z:
|
|
2587
|
+
* contracts — `GET /api/contracts/current` 404s for them.
|
|
2549
2588
|
*/
|
|
2550
2589
|
declare function revokeDelegation(opts: RevokeDelegationOpts): Promise<RevokeDelegationResult>;
|
|
2551
2590
|
/** Options for {@link buildPayrollInvocation}. */
|
|
@@ -2581,7 +2620,7 @@ interface BuildPayrollDirectInvocationOpts {
|
|
|
2581
2620
|
* `DynamicContext.authenticated_did` at runtime.
|
|
2582
2621
|
*
|
|
2583
2622
|
* Callers in direct mode must hold a grant in
|
|
2584
|
-
* `OrgContractGrants[org || "tee:payroll"]` under their own DID.
|
|
2623
|
+
* `OrgContractGrants[org || "tee:z-payroll"]` under their own DID.
|
|
2585
2624
|
*
|
|
2586
2625
|
* When `request.individual_disbursement_threshold_cents` is undefined this
|
|
2587
2626
|
* function fills in {@link DEFAULT_INDIVIDUAL_THRESHOLD_CENTS} so the wire
|
|
@@ -2615,6 +2654,17 @@ interface UpdateMetaInput {
|
|
|
2615
2654
|
orgDid: string;
|
|
2616
2655
|
admins: string[];
|
|
2617
2656
|
maxAdmins?: number;
|
|
2657
|
+
/**
|
|
2658
|
+
* Per-org ceiling on delegation-credential validity (seconds).
|
|
2659
|
+
*
|
|
2660
|
+
* Omit to preserve the org's existing cap — the contract merges an
|
|
2661
|
+
* absent field with the stored value, so there is no way to clear the
|
|
2662
|
+
* cap through this call (the contract does not accept an explicit
|
|
2663
|
+
* null). To effectively disable the org cap, set a value at or above
|
|
2664
|
+
* the cluster ceiling — the effective cap is always
|
|
2665
|
+
* `min(org value, cluster ceiling)`.
|
|
2666
|
+
*/
|
|
2667
|
+
maxCredentialValiditySecs?: number;
|
|
2618
2668
|
}
|
|
2619
2669
|
interface SetWritersInput {
|
|
2620
2670
|
orgDid: string;
|
|
@@ -2730,7 +2780,10 @@ declare class OrgDataClient {
|
|
|
2730
2780
|
*/
|
|
2731
2781
|
createPolicy(input: CreatePolicyInput): Promise<MutationResponse>;
|
|
2732
2782
|
/**
|
|
2733
|
-
* Replace the admin list and/or `max_admins` cap on an existing policy
|
|
2783
|
+
* Replace the admin list and/or `max_admins` cap on an existing policy,
|
|
2784
|
+
* and optionally set the per-org credential validity cap
|
|
2785
|
+
* (`maxCredentialValiditySecs`; omitted fields preserve stored values —
|
|
2786
|
+
* see {@link UpdateMetaInput}).
|
|
2734
2787
|
*
|
|
2735
2788
|
* The calling user cannot remove themselves when they are the sole
|
|
2736
2789
|
* remaining admin; another admin must be added first.
|
|
@@ -2771,6 +2824,16 @@ declare class OrgDataClient {
|
|
|
2771
2824
|
deleteScope(input: DeleteScopeInput): Promise<MutationResponse>;
|
|
2772
2825
|
/** Read the policy metadata for an org (admin-only). */
|
|
2773
2826
|
policyGet(input: PolicyGetInput): Promise<OrgPolicyMeta>;
|
|
2827
|
+
/**
|
|
2828
|
+
* Read the effective org policy view (any authenticated session).
|
|
2829
|
+
*
|
|
2830
|
+
* Returns the **effective** credential validity cap:
|
|
2831
|
+
* `min(org.max_credential_validity_secs, cluster_ceiling)`.
|
|
2832
|
+
* Unlike `policyGet`, this function is not admin-gated — any session
|
|
2833
|
+
* may call it so minting clients can default the requested validity
|
|
2834
|
+
* without needing admin access.
|
|
2835
|
+
*/
|
|
2836
|
+
policyView(input: PolicyGetInput): Promise<OrgPolicyView>;
|
|
2774
2837
|
/** Read the writer list for a scope (admin-only). */
|
|
2775
2838
|
writersGet(input: WritersGetInput): Promise<OrgWriters>;
|
|
2776
2839
|
/** Read the grant list for a contract (admin-only). */
|
|
@@ -2844,6 +2907,8 @@ declare class SessionOrgDataClient {
|
|
|
2844
2907
|
deleteScope(input: DeleteScopeInput): Promise<MutationResponse>;
|
|
2845
2908
|
/** Mirrors {@link OrgDataClient.policyGet}. */
|
|
2846
2909
|
policyGet(input: PolicyGetInput): Promise<OrgPolicyMeta>;
|
|
2910
|
+
/** Mirrors {@link OrgDataClient.policyView}. */
|
|
2911
|
+
policyView(input: PolicyGetInput): Promise<OrgPolicyView>;
|
|
2847
2912
|
/** Mirrors {@link OrgDataClient.writersGet}. */
|
|
2848
2913
|
writersGet(input: WritersGetInput): Promise<OrgWriters>;
|
|
2849
2914
|
/** Mirrors {@link OrgDataClient.grantsGet}. */
|
|
@@ -3274,6 +3339,46 @@ type TenantMapCreateInput = MapCreateInput;
|
|
|
3274
3339
|
type TenantMapUpdatePatch = MapUpdateInput;
|
|
3275
3340
|
type TenantContractPublishInput = ContractPublishInput;
|
|
3276
3341
|
type TenantContractExecuteInput = ContractExecuteInput;
|
|
3342
|
+
/**
|
|
3343
|
+
* Options shared by the `tee:tenant` management calls that accept an optional
|
|
3344
|
+
* `tenant` target argument.
|
|
3345
|
+
*
|
|
3346
|
+
* When omitted the server resolves the target from the authenticated session
|
|
3347
|
+
* DID — the original individual-tenant wire-compatible behaviour. When
|
|
3348
|
+
* supplied it must be a 40-hex tid (or `did:t3n:<tid>`):
|
|
3349
|
+
* - individual tenant: must equal the authenticated DID (no new power);
|
|
3350
|
+
* - org-owned tenant: authenticated DID must be in the org's admin set.
|
|
3351
|
+
*/
|
|
3352
|
+
interface TenantTargetOptions {
|
|
3353
|
+
/**
|
|
3354
|
+
* Optional 40-hex tenant id (bare or `did:t3n:` prefixed) of the tenant
|
|
3355
|
+
* being managed. Omit for individual self-management (wire-compatible with
|
|
3356
|
+
* the original individual-tenant calls).
|
|
3357
|
+
*/
|
|
3358
|
+
tenantTarget?: string;
|
|
3359
|
+
}
|
|
3360
|
+
/**
|
|
3361
|
+
* Options for {@link TenantClient.admitForOrg}.
|
|
3362
|
+
*/
|
|
3363
|
+
interface AdmitForOrgOptions {
|
|
3364
|
+
/** 40-hex or `did:t3n:` org DID to admit as an org-owned tenant. */
|
|
3365
|
+
orgDid: string;
|
|
3366
|
+
/** Human-readable label stored with the tenant record. */
|
|
3367
|
+
tenantLabel: string;
|
|
3368
|
+
/** Tenant quotas (same shape as individual tenant admission). */
|
|
3369
|
+
quotas: Record<string, unknown>;
|
|
3370
|
+
/** Storage location (same shape as individual tenant admission). */
|
|
3371
|
+
storageLocation: Record<string, unknown>;
|
|
3372
|
+
/**
|
|
3373
|
+
* A sign function that takes the serialised request body (JSON string) and
|
|
3374
|
+
* returns a hex-encoded Ethereum personal-sign signature. The signed body is
|
|
3375
|
+
* sent to `POST /api/admin` as `x-admin-signature`. The signature format is
|
|
3376
|
+
* identical to other admin operations (`token.transfer`, `tenant.admit`).
|
|
3377
|
+
*/
|
|
3378
|
+
signAdminBody: (body: string) => Promise<string>;
|
|
3379
|
+
/** Override the node base URL (defaults to `config.baseUrl`). */
|
|
3380
|
+
baseUrl?: string;
|
|
3381
|
+
}
|
|
3277
3382
|
declare class TenantNamespace {
|
|
3278
3383
|
private readonly client;
|
|
3279
3384
|
constructor(client: TenantClient);
|
|
@@ -3283,18 +3388,18 @@ declare class TenantNamespace {
|
|
|
3283
3388
|
declare class TenantMapsNamespace {
|
|
3284
3389
|
private readonly client;
|
|
3285
3390
|
constructor(client: TenantClient);
|
|
3286
|
-
create(input: MapCreateInput): Promise<unknown>;
|
|
3287
|
-
update(tail: string, patch: MapUpdateInput): Promise<unknown>;
|
|
3288
|
-
delete(tail: string): Promise<unknown>;
|
|
3391
|
+
create(input: MapCreateInput, opts?: TenantTargetOptions): Promise<unknown>;
|
|
3392
|
+
update(tail: string, patch: MapUpdateInput, opts?: TenantTargetOptions): Promise<unknown>;
|
|
3393
|
+
delete(tail: string, opts?: TenantTargetOptions): Promise<unknown>;
|
|
3289
3394
|
}
|
|
3290
3395
|
declare class TenantContractsNamespace {
|
|
3291
3396
|
private readonly client;
|
|
3292
3397
|
constructor(client: TenantClient);
|
|
3293
|
-
publish(input: ContractPublishInput): Promise<unknown>;
|
|
3294
|
-
register(input: ContractPublishInput): Promise<unknown>;
|
|
3295
|
-
disable(tail: string): Promise<unknown>;
|
|
3296
|
-
enable(tail: string): Promise<unknown>;
|
|
3297
|
-
unregister(tail: string): Promise<unknown>;
|
|
3398
|
+
publish(input: ContractPublishInput, opts?: TenantTargetOptions): Promise<unknown>;
|
|
3399
|
+
register(input: ContractPublishInput, opts?: TenantTargetOptions): Promise<unknown>;
|
|
3400
|
+
disable(tail: string, opts?: TenantTargetOptions): Promise<unknown>;
|
|
3401
|
+
enable(tail: string, opts?: TenantTargetOptions): Promise<unknown>;
|
|
3402
|
+
unregister(tail: string, opts?: TenantTargetOptions): Promise<unknown>;
|
|
3298
3403
|
/**
|
|
3299
3404
|
* Read back debug log entries the tenant's own contract emitted via
|
|
3300
3405
|
* `logging::info/debug/error`. Scans the per-(tenant, contract) ring written
|
|
@@ -3348,8 +3453,32 @@ declare class TenantClient {
|
|
|
3348
3453
|
readonly contracts: TenantContractsNamespace;
|
|
3349
3454
|
readonly token: TenantTokenNamespace;
|
|
3350
3455
|
constructor(config: TenantClientConfig);
|
|
3456
|
+
/**
|
|
3457
|
+
* Admit an org-owned tenant via the cluster-admin `tenant.admit-for-org`
|
|
3458
|
+
* action.
|
|
3459
|
+
*
|
|
3460
|
+
* This is a signed cluster-admin operation dispatched to `POST /api/admin`
|
|
3461
|
+
* with an `x-admin-signature` header. The caller supplies a `signAdminBody`
|
|
3462
|
+
* function that signs the serialised JSON body (Ethereum personal-sign style,
|
|
3463
|
+
* identical to the `token.transfer` admin operation pattern).
|
|
3464
|
+
*
|
|
3465
|
+
* The org DID becomes the tenant DID (the org's `z:<org-did-hex>:` namespace).
|
|
3466
|
+
* The call is rejected if an `idx:_tenants` row already exists for the org DID,
|
|
3467
|
+
* if `OrgPolicyMeta` is absent, or if the admin set is empty.
|
|
3468
|
+
*/
|
|
3469
|
+
admitForOrg(opts: AdmitForOrgOptions): Promise<unknown>;
|
|
3351
3470
|
getEnvironment(): TenantClientConfig["environment"];
|
|
3352
3471
|
canonicalName(tail: string): string;
|
|
3472
|
+
/**
|
|
3473
|
+
* Build a canonical `z:<tid>:<tail>` map/contract name for a tenant-targeted
|
|
3474
|
+
* control call. When `tenantTarget` is supplied the name is rooted at that
|
|
3475
|
+
* tenant's namespace, so the `tenant` arg and the resource name agree;
|
|
3476
|
+
* otherwise it falls back to the configured `tenantDid`. Deriving the name
|
|
3477
|
+
* from `config.tenantDid` while targeting a different tenant produces a
|
|
3478
|
+
* `z:<configTid>:` name the server rejects (or, worse, mutates the caller's
|
|
3479
|
+
* own namespace) — this keeps the two in lockstep.
|
|
3480
|
+
*/
|
|
3481
|
+
canonicalNameForTarget(tail: string, tenantTarget?: string): string;
|
|
3353
3482
|
controlPayload(functionName: string, input: unknown): Promise<JsonObject>;
|
|
3354
3483
|
executeControl(functionName: string, input: unknown): Promise<unknown>;
|
|
3355
3484
|
executeBusinessContract<T = unknown>(session: TenantExecutionSession, options: ExecuteBusinessContractOptions<T>): Promise<T>;
|
|
@@ -3366,5 +3495,5 @@ declare function tenantDidHex(tenantDid: string): string;
|
|
|
3366
3495
|
declare function validateTail(tail: string): string;
|
|
3367
3496
|
declare function canonicalTenantName(tenantDid: string, tail: string): string;
|
|
3368
3497
|
|
|
3369
|
-
export { AGENT_PUBKEY_LEN, AuthMethod, AuthenticationError, BASE_UNITS_PER_TOKEN, ContractResponseError, DEFAULT_INDIVIDUAL_THRESHOLD_CENTS, DEFAULT_KYC_POLL_CADENCE, DELEGATION_CREDENTIAL_DOMAIN, DELEGATION_INVOCATION_DOMAIN, DelegationCustodialClient, ETH_SIG_LEN, HandshakeError, HttpTransport, KycStatusTimeoutError, LogLevel, MAX_FUNCTIONS_PER_CREDENTIAL, MockTransport, NODE_URLS, NONCE_LEN, OrgDataClient, OtpRateLimitedError,
|
|
3370
|
-
export type {
|
|
3498
|
+
export { AGENT_PUBKEY_LEN, AuthMethod, AuthenticationError, BASE_UNITS_PER_TOKEN, ContractResponseError, DEFAULT_INDIVIDUAL_THRESHOLD_CENTS, DEFAULT_KYC_POLL_CADENCE, DELEGATION_CREDENTIAL_DOMAIN, DELEGATION_INVOCATION_DOMAIN, DelegationCustodialClient, ETH_SIG_LEN, HandshakeError, HttpTransport, KycStatusTimeoutError, LogLevel, MAX_FUNCTIONS_PER_CREDENTIAL, MockTransport, NODE_URLS, NONCE_LEN, OrgDataClient, OtpRateLimitedError, REQUEST_HASH_LEN, RpcError, SessionExpiredError, SessionOrgDataClient, SessionStateError, SessionStatus, T3nClient, T3nError, TERMINAL_KYC_STATUSES, TOKEN_DECIMALS, TenantClient, TenantContractsNamespace, TenantMapsNamespace, TenantNamespace, TenantSdkValidationError, TenantTokenNamespace, UnsupportedTenantSdkOperationError, UserUpsertError, VC_ID_LEN, WasmError, Z_PAYROLL_AUDIT_READ_FUNCTIONS, Z_PAYROLL_RUN_FUNCTIONS, _b64uEncode, assertShape, b64uDecodeStrict, b64uEncodeBytes, buildDelegationCredential, buildInvocationPreimage, buildPayrollDirectInvocation, buildPayrollInvocation, bytesToString, canonicalTenantName, canonicaliseCredential, canonicaliseRequest, clearKeyCache, compactDidFromBytes, createDefaultHandlers, createEmailOtpAuthInput, createEthAuthInput, createLogger, createMlKemPublicKeyHandler, createOidcAuthInput, createOrgDataClientFromSession, createRandomHandler, decodeWasmErrorMessage, eip191Digest, ethRecoverEip191, eth_get_address, extractWasmError, fetchDkgAttestation, fetchMlKemPublicKey, formatTokens, generateRandomString, generateUUID, getEnvironment, getEnvironmentName, getGlobalLogLevel, getLogger, getNodeUrl, getScriptVersion, isDataGetResponse, isDataListResponse, isMutationResponse, isObject, isOrgContractGrants, isOrgPolicyMeta, isOrgPolicyView, isOrgWriters, loadConfig, loadWasmComponent, maskKeyMaterial, metamask_get_address, metamask_sign, parseContractResponse, redactSecrets, redactSecretsFromJson, requestHash, revokeDelegation, setEnvironment, setGlobalLogLevel, setNodeUrl, signAgentInvocation, signCredential, stringToBytes, tenantDidHex, toBaseUnits, validateConfig, validateCredentialBody, validateTail, verifyDkgAttestation, verifyTdxQuote };
|
|
3499
|
+
export type { AdmitForOrgOptions, AuthInput, BalanceRow, BuildDelegationCredentialOpts, BuildPayrollDirectInvocationOpts, BuildPayrollInvocationOpts, ChargeReason, ClientAuth, ClientHandshake, ConfigValidationResult, ContractExecuteInput, ContractPublishInput, ContractResponseSchema, CreatePolicyInput, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DelegationCredential, DelegationCustodialClientOpts, DelegationEnvelope, DeleteDataInput, DeleteGrantsInput, DeleteScopeInput, Did, Direction, DkgAttestation, DkgVerifyResult, EmailOtpAuthInput, EmailOtpCredentials, Environment, EthAuthInput, ExecuteBusinessContractOptions, ExecuteOrgDataActionOptions, GetUsageOptions, GrantsGetInput, GuestToHostHandler, GuestToHostHandlers, HandshakeResult, JsonRpcRequest, JsonRpcResponse, KycPollCadence, KycPollOptions, KycStatus, KycStatusKind, Logger, MapCreateInput, MapResponse, MapUpdateInput, MapVisibility, MutationResponse, OidcAuthInput, OidcCredentials, OrgContractGrants, OrgDataActionWire, OrgDataClientOptions, OrgPolicyMeta, OrgPolicyView, OrgWriters, OtpChannel, OtpMergeSuggestion, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, PayrollInvocation, PayrollInvocationDelegated, PayrollInvocationDirect, PayrollRunRequest, PeerQuoteResult, PolicyGetInput, QuoteVerifyResult, ReaderSet, RevokeDelegationOpts, RevokeDelegationResult, SdkConfig, SessionCrypto, SessionId, SetGrantsInput, SetWritersInput, SignCustodialResult, SignDelegationResponse, SubmitUserInputArgs, SubmitUserInputResult, T3nClientConfig, TenantAdmitProjection, TenantAdmitStatus, TenantBaseClient, TenantClientConfig, TenantContractExecuteInput, TenantContractPublishInput, TenantExecutionSession, TenantMapCreateInput, TenantMapUpdatePatch, TenantMeResponse, TenantSdkEnvironment, TenantSelfAdmitResult, TenantStatus, TenantTargetOptions, TokenTxKind, Transport, UpdateMetaInput, UsageEntry, UsagePage, UserGrant, UserInputProfile, UserUpsertErrorKind, WasmComponent, WasmNextResult, WriteDataInput, WriterSet, WritersGetInput };
|