@terminal3/t3n-sdk 3.12.6 → 3.13.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
@@ -3257,6 +3257,18 @@ interface TenantClientConfig {
3257
3257
  environment?: TenantSdkEnvironment;
3258
3258
  /** Node URL for `getScriptVersion` during business contract execution. Falls back to `baseUrl`. */
3259
3259
  endpoint?: string;
3260
+ /**
3261
+ * Authenticated base client the TenantClient dispatches RPCs through.
3262
+ * **Optional**, but required by every operation that issues a control or
3263
+ * business RPC: all `tenant.*` and `maps.*` helpers,
3264
+ * `contracts.register`/`publish`/`disable`/`enable`/`unregister`/`execute`,
3265
+ * and `token.getUsage` (which additionally needs a full authenticated
3266
+ * `T3nClient` exposing `getUsage`). Those throw
3267
+ * `"TenantClient config requires t3n ..."` at call time when it is absent.
3268
+ * Operations that do NOT need `t3n`: `admitForOrg` (signed cluster-admin call
3269
+ * over `fetch`), `executeBusinessContract` (dispatches through the `session`
3270
+ * argument), and pure config accessors such as `getEnvironment`.
3271
+ */
3260
3272
  t3n?: TenantBaseClient;
3261
3273
  baseUrl?: string;
3262
3274
  tenantDid?: string;
@@ -3295,6 +3307,14 @@ interface MapCreateInput {
3295
3307
  tail: string;
3296
3308
  visibility: MapVisibility;
3297
3309
  writers: WriterSet;
3310
+ /**
3311
+ * Who may read the map. **Optional, but omitting it is a footgun:**
3312
+ * the runtime defaults an unspecified `readers` to a *deny-all* policy, so the
3313
+ * map is created successfully yet nobody — not even the creator — can read it,
3314
+ * with no error. `maps.create` emits a `console.warn` when this is omitted.
3315
+ * Set it explicitly: `"all"` for public reads, `{ only: [contractId, ...] }`
3316
+ * to scope reads, or `{ only: [] }` to deliberately make the map write-only.
3317
+ */
3298
3318
  readers?: ReaderSet;
3299
3319
  keyValidator?: unknown;
3300
3320
  }
@@ -3332,6 +3352,17 @@ interface ContractExecuteInput {
3332
3352
  functionName: string;
3333
3353
  input?: unknown;
3334
3354
  }
3355
+ /**
3356
+ * Result of a successful {@link TenantContractsNamespace.register} /
3357
+ * {@link TenantContractsNamespace.publish}. Mirrors the tenant contract's
3358
+ * `RegisterResponse` wire shape.
3359
+ */
3360
+ interface ContractRegisterResult {
3361
+ /** Canonical `z:<tid>:<tail>` name the contract was registered under. */
3362
+ name: string;
3363
+ /** Stable monotonic numeric contract id assigned at registration time. */
3364
+ contract_id: number;
3365
+ }
3335
3366
 
3336
3367
  type JsonObject = Record<string, unknown>;
3337
3368
  interface TenantExecutionSession {
@@ -3404,8 +3435,8 @@ declare class TenantMapsNamespace {
3404
3435
  declare class TenantContractsNamespace {
3405
3436
  private readonly client;
3406
3437
  constructor(client: TenantClient);
3407
- publish(input: ContractPublishInput, opts?: TenantTargetOptions): Promise<unknown>;
3408
- register(input: ContractPublishInput, opts?: TenantTargetOptions): Promise<unknown>;
3438
+ publish(input: ContractPublishInput, opts?: TenantTargetOptions): Promise<ContractRegisterResult>;
3439
+ register(input: ContractPublishInput, opts?: TenantTargetOptions): Promise<ContractRegisterResult>;
3409
3440
  disable(tail: string, opts?: TenantTargetOptions): Promise<unknown>;
3410
3441
  enable(tail: string, opts?: TenantTargetOptions): Promise<unknown>;
3411
3442
  unregister(tail: string, opts?: TenantTargetOptions): Promise<unknown>;
@@ -3505,4 +3536,4 @@ declare function validateTail(tail: string): string;
3505
3536
  declare function canonicalTenantName(tenantDid: string, tail: string): string;
3506
3537
 
3507
3538
  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 };
3508
- 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 };
3539
+ export type { AdmitForOrgOptions, AuthInput, BalanceRow, BuildDelegationCredentialOpts, BuildPayrollDirectInvocationOpts, BuildPayrollInvocationOpts, ChargeReason, ClientAuth, ClientHandshake, ConfigValidationResult, ContractExecuteInput, ContractPublishInput, ContractRegisterResult, 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 };