@terminal3/t3n-sdk 2.11.0 → 2.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 CHANGED
@@ -573,6 +573,41 @@ interface SubmitUserInputArgs {
573
573
  * Most callers should leave this `undefined`.
574
574
  */
575
575
  requireExistingUser?: boolean;
576
+ /**
577
+ * MAT-1618 testnet self-admit. When `true`, the contract additionally
578
+ * runs the self-admit side-effect after the profile commit: writes
579
+ * the caller's DID into `idx:_tenants` + `idx:_tenant_quotas` and
580
+ * mints any operator-configured welcome credits. Inspect the
581
+ * `tenantAdmit` field on the response for the outcome.
582
+ *
583
+ * Testnet-only. Production clusters return
584
+ * `tenantAdmit.status = "refused"` with
585
+ * `reason = "not_testnet" | "self_admit_disabled" | "not_eth_derived"`.
586
+ * The profile commit always succeeds regardless of the inner outcome.
587
+ *
588
+ * Most callers should leave this `undefined`.
589
+ */
590
+ becomeDevTenant?: boolean;
591
+ }
592
+ /**
593
+ * MAT-1618 self-admit projection from `user-upsert`. Present only
594
+ * when the caller set `becomeDevTenant: true` on the request.
595
+ *
596
+ * - `status: "admitted"` — first call for this DID; tenant record
597
+ * committed and (if configured) welcome credits minted into
598
+ * `grantedCredits`.
599
+ * - `status: "already-admitted"` — replay; idempotent no-op.
600
+ * - `status: "refused"` — the cluster declined the self-admit;
601
+ * `reason` is the machine-readable cause (`not_testnet`,
602
+ * `self_admit_disabled`, `not_eth_derived`), `detail` is a
603
+ * human-readable string.
604
+ */
605
+ type TenantAdmitStatus = "admitted" | "already-admitted" | "refused";
606
+ interface TenantAdmitProjection {
607
+ status: TenantAdmitStatus;
608
+ grantedCredits?: string;
609
+ reason?: string;
610
+ detail?: string;
576
611
  }
577
612
  /**
578
613
  * Response shape returned by the slim `user-upsert`. Carries the
@@ -585,6 +620,11 @@ interface SubmitUserInputResult {
585
620
  refusedFields?: string[];
586
621
  mergeSuggestion?: OtpMergeSuggestion;
587
622
  userFound?: boolean;
623
+ /**
624
+ * MAT-1618 self-admit projection. Present only when the caller
625
+ * set `becomeDevTenant: true` on the request.
626
+ */
627
+ tenantAdmit?: TenantAdmitProjection;
588
628
  }
589
629
  /**
590
630
  * Discriminator for {@link UserUpsertError}. Mirrors the
@@ -1679,6 +1719,12 @@ declare class T3nClient {
1679
1719
  organisationDid?: string;
1680
1720
  attestations?: unknown;
1681
1721
  keys?: Record<string, unknown>;
1722
+ /**
1723
+ * MAT-1618 testnet self-admit, propagated to the inner
1724
+ * {@link submitUserInput} call. Inspect `result.tenantAdmit` for
1725
+ * the outcome.
1726
+ */
1727
+ becomeDevTenant?: boolean;
1682
1728
  getOtpCode: (contact: string, channel: OtpChannel) => Promise<string> | string;
1683
1729
  }): Promise<SubmitUserInputResult>;
1684
1730
  /**
@@ -2722,4 +2768,4 @@ declare function clearKeyCache(): void;
2722
2768
  declare function loadConfig(baseUrl?: string): SdkConfig;
2723
2769
 
2724
2770
  export { AGENT_PUBKEY_LEN, AuthMethod, AuthenticationError, ContractResponseError, DEFAULT_INDIVIDUAL_THRESHOLD_CENTS, DEFAULT_KYC_POLL_CADENCE, DELEGATION_CREDENTIAL_DOMAIN, DELEGATION_INVOCATION_DOMAIN, DelegationCustodialClient, ETH_SIG_LEN, HandshakeError, HttpTransport, KycStatusTimeoutError, LogLevel, MockTransport, NODE_URLS, NONCE_LEN, OrgDataClient, REQUEST_HASH_LEN, RpcError, SessionExpiredError, SessionOrgDataClient, SessionStateError, SessionStatus, T3nClient, T3nError, TERMINAL_KYC_STATUSES, UserUpsertError, VC_ID_LEN, WasmError, _b64uEncode, assertShape, b64uDecodeStrict, b64uEncodeBytes, buildDelegationCredential, buildInvocationPreimage, buildPayrollDirectInvocation, buildPayrollInvocation, bytesToString, canonicaliseCredential, canonicaliseRequest, clearKeyCache, compactDidFromBytes, createDefaultHandlers, createEthAuthInput, createLogger, createMlKemPublicKeyHandler, createOidcAuthInput, createOrgDataClientFromSession, createRandomHandler, decodeWasmErrorMessage, eip191Digest, ethRecoverEip191, eth_get_address, extractWasmError, fetchDkgAttestation, fetchMlKemPublicKey, generateRandomString, generateUUID, getEnvironment, getEnvironmentName, getGlobalLogLevel, getLogger, getNodeUrl, getScriptVersion, isDataGetResponse, isDataListResponse, isMutationResponse, isObject, isOrgContractGrants, isOrgPolicyMeta, isOrgWriters, loadConfig, loadWasmComponent, metamask_get_address, metamask_sign, parseContractResponse, redactSecrets, redactSecretsFromJson, requestHash, setEnvironment, setGlobalLogLevel, setNodeUrl, signAgentInvocation, signCredential, stringToBytes, validateConfig, validateCredentialBody, verifyDkgAttestation, verifyTdxQuote };
2725
- export type { AgeBand, AuthInput, BuildDelegationCredentialOpts, BuildPayrollDirectInvocationOpts, BuildPayrollInvocationOpts, ClientAuth, ClientHandshake, ConfigValidationResult, ContractResponseSchema, CreatePolicyInput, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DelegationCredential, DelegationCustodialClientOpts, DelegationEnvelope, DeleteDataInput, DeleteGrantsInput, DeleteScopeInput, Did, DkgAttestation, DkgVerifyResult, EmployeeRecord, EmploymentStatus, Environment, EthAuthInput, ExecuteOrgDataActionOptions, ExpenseClaim, GrantsGetInput, GuestToHostHandler, GuestToHostHandlers, HandshakeResult, JsonRpcRequest, JsonRpcResponse, KycPollCadence, KycPollOptions, KycStatus, KycStatusKind, Logger, MutationResponse, OidcAuthInput, OidcCredentials, OrgContractGrants, OrgDataActionWire, OrgDataClientOptions, OrgPolicyMeta, OrgWriters, OtpChannel, OtpMergeSuggestion, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, PayrollInvocation, PayrollInvocationDelegated, PayrollInvocationDirect, PayrollRunRequest, PeerQuoteResult, PolicyGetInput, QuoteVerifyResult, ResidencyCategory, SdkConfig, SessionCrypto, SessionId, SetGrantsInput, SetWritersInput, SignCustodialResult, SignDelegationResponse, SubmitUserInputArgs, SubmitUserInputResult, T3nClientConfig, Transport, UpdateMetaInput, UserGrant, UserInputProfile, UserUpsertErrorKind, WasmComponent, WasmNextResult, WriteDataInput, WritersGetInput };
2771
+ export type { AgeBand, AuthInput, BuildDelegationCredentialOpts, BuildPayrollDirectInvocationOpts, BuildPayrollInvocationOpts, ClientAuth, ClientHandshake, ConfigValidationResult, ContractResponseSchema, CreatePolicyInput, DataGetInput, DataGetResponse, DataListInput, DataListResponse, DelegationCredential, DelegationCustodialClientOpts, DelegationEnvelope, DeleteDataInput, DeleteGrantsInput, DeleteScopeInput, Did, DkgAttestation, DkgVerifyResult, EmployeeRecord, EmploymentStatus, Environment, EthAuthInput, ExecuteOrgDataActionOptions, ExpenseClaim, GrantsGetInput, GuestToHostHandler, GuestToHostHandlers, HandshakeResult, JsonRpcRequest, JsonRpcResponse, KycPollCadence, KycPollOptions, KycStatus, KycStatusKind, Logger, MutationResponse, OidcAuthInput, OidcCredentials, OrgContractGrants, OrgDataActionWire, OrgDataClientOptions, OrgPolicyMeta, OrgWriters, OtpChannel, OtpMergeSuggestion, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, PayrollInvocation, PayrollInvocationDelegated, PayrollInvocationDirect, PayrollRunRequest, PeerQuoteResult, PolicyGetInput, QuoteVerifyResult, ResidencyCategory, SdkConfig, SessionCrypto, SessionId, SetGrantsInput, SetWritersInput, SignCustodialResult, SignDelegationResponse, SubmitUserInputArgs, SubmitUserInputResult, T3nClientConfig, TenantAdmitProjection, TenantAdmitStatus, Transport, UpdateMetaInput, UserGrant, UserInputProfile, UserUpsertErrorKind, WasmComponent, WasmNextResult, WriteDataInput, WritersGetInput };