@terminal3/t3n-sdk 4.9.0 → 4.10.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 CHANGED
@@ -3717,6 +3717,18 @@ type TenantMapUpdatePatch = MapUpdateInput;
3717
3717
  type TenantContractPublishInput = ContractPublishInput;
3718
3718
  type TenantContractSetDescriptorInput = ContractSetDescriptorInput;
3719
3719
  type TenantContractExecuteInput = ContractExecuteInput;
3720
+ /**
3721
+ * Coarse lifecycle state of a tenant map, mirroring the contract's
3722
+ * `MapLifecycleStatus` enum on the `tee:tenant/contracts::map-get-status` op.
3723
+ * Exported from the SDK public barrel so FE code has a single source of truth
3724
+ * for the union instead of re-declaring it.
3725
+ *
3726
+ * - `"active"` — a live map (`Private`/`Public`) exists at this name.
3727
+ * - `"deleting"` — deleted, host sweeper still draining. Poll until `"absent"`.
3728
+ * - `"absent"` — no row (never created, or deletion fully settled); name is
3729
+ * free to (re-)create.
3730
+ */
3731
+ type MapLifecycleStatus = "active" | "deleting" | "absent";
3720
3732
  /**
3721
3733
  * Options shared by the `tee:tenant` management calls that accept an optional
3722
3734
  * `tenant` target argument.
@@ -3769,6 +3781,45 @@ declare class TenantMapsNamespace {
3769
3781
  create(input: MapCreateInput, opts?: TenantTargetOptions): Promise<unknown>;
3770
3782
  update(tail: string, patch: MapUpdateInput, opts?: TenantTargetOptions): Promise<unknown>;
3771
3783
  delete(tail: string, opts?: TenantTargetOptions): Promise<unknown>;
3784
+ /**
3785
+ * Write a UTF-8 key/value entry into an owned map via the tenant management
3786
+ * surface (`map-entry-set`). Mirrors the `.delete` shape: canonical name is
3787
+ * always rooted at the target tenant, and `payload.tenant` is included only
3788
+ * when `opts.tenantTarget` is supplied (`exactOptionalPropertyTypes` — never
3789
+ * pass a stringified `null`, the contract's `deny_unknown_fields` accepts an
3790
+ * absent field, not a literal `null`).
3791
+ *
3792
+ * SDK-only addition: the `map-entry-set` contract op
3793
+ * has always accepted the optional `tenant` field and routed through
3794
+ * `resolve_tenant_did` — this helper simply completes the SDK's map-entry
3795
+ * surface so `set` / `get` / `getStatus` are all first-class alongside the
3796
+ * lifecycle trio.
3797
+ */
3798
+ entrySet(tail: string, key: string, value: string, opts?: TenantTargetOptions): Promise<void>;
3799
+ /**
3800
+ * Read back a UTF-8 key/value entry from an owned map via the tenant
3801
+ * management surface (`map-entry-get`). Requires the paired contract-side
3802
+ * 1.24.0-or-later registration for the `tenant` argument to be accepted —
3803
+ * a node on an earlier contract rejects `tenant`-bearing requests with
3804
+ * `deny_unknown_fields`.
3805
+ *
3806
+ * Unwraps the contract's `{ value: string | null }` envelope to
3807
+ * `string | null` for caller ergonomics; `null` is the deliberate
3808
+ * "key absent" signal, not an error.
3809
+ */
3810
+ entryGet(tail: string, key: string, opts?: TenantTargetOptions): Promise<string | null>;
3811
+ /**
3812
+ * Report the lifecycle status of an owned map (`map-get-status`),
3813
+ * so a client can poll a delete → recreate cycle instead of guessing.
3814
+ * Requires the paired contract-side 1.24.0-or-later registration for the
3815
+ * `tenant` argument to be accepted.
3816
+ *
3817
+ * `"absent"` (never created, or deletion fully settled) is a *success*
3818
+ * answer meaning the name is free to (re-)create; it is not an error.
3819
+ * `"deleting"` means the host sweeper is still draining the map — poll
3820
+ * again until `"absent"`.
3821
+ */
3822
+ getStatus(tail: string, opts?: TenantTargetOptions): Promise<MapLifecycleStatus>;
3772
3823
  }
3773
3824
  declare class TenantContractsNamespace {
3774
3825
  private readonly client;
@@ -3892,4 +3943,4 @@ declare function validateTail(tail: string): string;
3892
3943
  declare function canonicalTenantName(tenantDid: string, tail: string): string;
3893
3944
 
3894
3945
  export { AuthMethod, AuthenticationError, BASE_UNITS_PER_TOKEN, ContractResponseError, DEFAULT_ENVIRONMENT, DEFAULT_INDIVIDUAL_THRESHOLD_CENTS, DEFAULT_KYC_POLL_CADENCE, HandshakeError, HttpTransport, KycStatusTimeoutError, LogLevel, MockTransport, NODE_URLS, OrgDataClient, OtpRateLimitedError, RpcError, SessionExpiredError, SessionOrgDataClient, SessionStateError, SessionStatus, SessionUsageReportClient, T3nClient, T3nError, TERMINAL_KYC_STATUSES, TOKEN_DECIMALS, TenantClient, TenantContractsNamespace, TenantMapsNamespace, TenantNamespace, TenantSdkValidationError, TenantTokenNamespace, UnsupportedTenantSdkOperationError, UserUpsertError, WasmError, WireEncodingError, Z_PAYROLL_AUDIT_READ_FUNCTIONS, Z_PAYROLL_RUN_FUNCTIONS, _b64uEncode, assertShape, b64uDecodeStrict, b64uEncodeBytes, bytesToString, canonicalTenantName, clearKeyCache, compactDidFromBytes, createDefaultHandlers, createEmailOtpAuthInput, createEthAuthInput, createLogger, createMlKemPublicKeyHandler, createOidcAuthInput, createOrgDataClientFromSession, createRandomHandler, createUsageReportClientFromSession, createWorkloadAuthInput, decodeWasmErrorMessage, eth_get_address, extractWasmError, fetchDkgAttestation, fetchMlKemPublicKey, formatTokens, generateRandomString, generateUUID, getEnvironment, getEnvironmentName, getGlobalLogLevel, getLogger, getNodeUrl, getScriptVersion, isDataGetResponse, isDataListResponse, isMutationResponse, isObject, isOrgContractGrants, isOrgPolicyMeta, isOrgPolicyView, isOrgUsageReport, isOrgWriters, isUnsafeTrustServer, loadConfig, loadWasmComponent, maskKeyMaterial, mergeAgentAuthEntries, mergeDiscoverDids, metamask_get_address, metamask_sign, parseAgentAuthGet, parseAgentAuthPolicy, parseContractResponse, redactSecrets, redactSecretsFromJson, requestToWire, setEnvironment, setGlobalLogLevel, setNodeUrl, stringToBytes, tenantDidHex, toAgentAuthUpdateWire, toBaseUnits, validateConfig, validateTail, verifyDkgAttestation, verifyTdxQuote };
3895
- export type { AdmitForOrgOptions, AgentAuthEntry, AgentAuthMergeResult, AgentAuthPolicy, AgentAuthScriptGrant, AgentAuthUpdateInput, AuthInput, BalanceRow, ChargeReason, ClientAuth, ClientHandshake, ConfigValidationResult, ContractExecuteInput, ContractKind, ContractPublishInput, ContractRegisterResult, ContractResponseSchema, ContractSetDescriptorInput, CreatePolicyInput, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DelegationGrantKind, DelegationGrantRef, DeleteDataInput, DeleteGrantsInput, DeleteScopeInput, Did, Direction, DkgAttestation, DkgVerifyResult, EmailOtpAuthInput, EmailOtpCredentials, Environment, EthAuthInput, ExecuteBusinessContractOptions, ExecuteOrgDataActionOptions, GetUsageOptions, GrantCheckParams, GrantCheckResult, GrantsGetInput, GuestToHostHandler, GuestToHostHandlers, HandshakeResult, JsonRpcRequest, JsonRpcResponse, KycPollCadence, KycPollOptions, KycStatus, KycStatusKind, ListContractsParams, ListContractsResult, ListContractsScope, ListedContract, Logger, MapCreateInput, MapResponse, MapUpdateInput, MapVisibility, MutationResponse, OidcAuthInput, OidcCredentials, OrgContractGrants, OrgDataActionWire, OrgDataClientOptions, OrgPolicyMeta, OrgPolicyView, OrgUsageReport, OrgUsageReportInput, OrgWriters, OtpChannel, OtpMergeSuggestion, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, PayrollRunRequest, PeerQuoteResult, PolicyGetInput, QuoteVerifyResult, ReaderSet, SdkConfig, SessionCrypto, SessionId, SetGrantsInput, SetWritersInput, StringEncoding, SubmitUserInputArgs, SubmitUserInputResult, T3nClientConfig, TenantAdmitProjection, TenantAdmitStatus, TenantBaseClient, TenantClientConfig, TenantContractExecuteInput, TenantContractPublishInput, TenantContractSetDescriptorInput, TenantExecutionSession, TenantMapCreateInput, TenantMapUpdatePatch, TenantMeResponse, TenantSdkEnvironment, TenantSelfAdmitResult, TenantStatus, TenantTargetOptions, TokenTxKind, Transport, TrustAnchor, TrustAnchorOrUnsafe, UnsafeTrustServer, UpdateMetaInput, UsageEntry, UsagePage, UsageReportSignature, UserGrant, UserInputProfile, UserUpsertErrorKind, WasmComponent, WasmNextResult, WireBlock, WorkloadAuthInput, WriteDataInput, WriterSet, WritersGetInput };
3946
+ export type { AdmitForOrgOptions, AgentAuthEntry, AgentAuthMergeResult, AgentAuthPolicy, AgentAuthScriptGrant, AgentAuthUpdateInput, AuthInput, BalanceRow, ChargeReason, ClientAuth, ClientHandshake, ConfigValidationResult, ContractExecuteInput, ContractKind, ContractPublishInput, ContractRegisterResult, ContractResponseSchema, ContractSetDescriptorInput, CreatePolicyInput, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DelegationGrantKind, DelegationGrantRef, DeleteDataInput, DeleteGrantsInput, DeleteScopeInput, Did, Direction, DkgAttestation, DkgVerifyResult, EmailOtpAuthInput, EmailOtpCredentials, Environment, EthAuthInput, ExecuteBusinessContractOptions, ExecuteOrgDataActionOptions, GetUsageOptions, GrantCheckParams, GrantCheckResult, GrantsGetInput, GuestToHostHandler, GuestToHostHandlers, HandshakeResult, JsonRpcRequest, JsonRpcResponse, KycPollCadence, KycPollOptions, KycStatus, KycStatusKind, ListContractsParams, ListContractsResult, ListContractsScope, ListedContract, Logger, MapCreateInput, MapLifecycleStatus, MapResponse, MapUpdateInput, MapVisibility, MutationResponse, OidcAuthInput, OidcCredentials, OrgContractGrants, OrgDataActionWire, OrgDataClientOptions, OrgPolicyMeta, OrgPolicyView, OrgUsageReport, OrgUsageReportInput, OrgWriters, OtpChannel, OtpMergeSuggestion, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, PayrollRunRequest, PeerQuoteResult, PolicyGetInput, QuoteVerifyResult, ReaderSet, SdkConfig, SessionCrypto, SessionId, SetGrantsInput, SetWritersInput, StringEncoding, SubmitUserInputArgs, SubmitUserInputResult, T3nClientConfig, TenantAdmitProjection, TenantAdmitStatus, TenantBaseClient, TenantClientConfig, TenantContractExecuteInput, TenantContractPublishInput, TenantContractSetDescriptorInput, TenantExecutionSession, TenantMapCreateInput, TenantMapUpdatePatch, TenantMeResponse, TenantSdkEnvironment, TenantSelfAdmitResult, TenantStatus, TenantTargetOptions, TokenTxKind, Transport, TrustAnchor, TrustAnchorOrUnsafe, UnsafeTrustServer, UpdateMetaInput, UsageEntry, UsagePage, UsageReportSignature, UserGrant, UserInputProfile, UserUpsertErrorKind, WasmComponent, WasmNextResult, WireBlock, WorkloadAuthInput, WriteDataInput, WriterSet, WritersGetInput };