@terminal3/t3n-sdk 2.11.0 → 2.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
@@ -554,6 +554,8 @@ interface UserInputProfile {
554
554
  phone_number?: string;
555
555
  birthdate?: string;
556
556
  nationality?: string;
557
+ campaign_code?: string;
558
+ role?: string;
557
559
  [key: string]: unknown;
558
560
  }
559
561
  /**
@@ -573,6 +575,41 @@ interface SubmitUserInputArgs {
573
575
  * Most callers should leave this `undefined`.
574
576
  */
575
577
  requireExistingUser?: boolean;
578
+ /**
579
+ * MAT-1618 testnet self-admit. When `true`, the contract additionally
580
+ * runs the self-admit side-effect after the profile commit: writes
581
+ * the caller's DID into `idx:_tenants` + `idx:_tenant_quotas` and
582
+ * mints any operator-configured welcome credits. Inspect the
583
+ * `tenantAdmit` field on the response for the outcome.
584
+ *
585
+ * Testnet-only. Production clusters return
586
+ * `tenantAdmit.status = "refused"` with
587
+ * `reason = "not_testnet" | "self_admit_disabled" | "not_eth_derived"`.
588
+ * The profile commit always succeeds regardless of the inner outcome.
589
+ *
590
+ * Most callers should leave this `undefined`.
591
+ */
592
+ becomeDevTenant?: boolean;
593
+ }
594
+ /**
595
+ * MAT-1618 self-admit projection from `user-upsert`. Present only
596
+ * when the caller set `becomeDevTenant: true` on the request.
597
+ *
598
+ * - `status: "admitted"` — first call for this DID; tenant record
599
+ * committed and (if configured) welcome credits minted into
600
+ * `grantedCredits`.
601
+ * - `status: "already-admitted"` — replay; idempotent no-op.
602
+ * - `status: "refused"` — the cluster declined the self-admit;
603
+ * `reason` is the machine-readable cause (`not_testnet`,
604
+ * `self_admit_disabled`, `not_eth_derived`), `detail` is a
605
+ * human-readable string.
606
+ */
607
+ type TenantAdmitStatus = "admitted" | "already-admitted" | "refused";
608
+ interface TenantAdmitProjection {
609
+ status: TenantAdmitStatus;
610
+ grantedCredits?: string;
611
+ reason?: string;
612
+ detail?: string;
576
613
  }
577
614
  /**
578
615
  * Response shape returned by the slim `user-upsert`. Carries the
@@ -585,6 +622,11 @@ interface SubmitUserInputResult {
585
622
  refusedFields?: string[];
586
623
  mergeSuggestion?: OtpMergeSuggestion;
587
624
  userFound?: boolean;
625
+ /**
626
+ * MAT-1618 self-admit projection. Present only when the caller
627
+ * set `becomeDevTenant: true` on the request.
628
+ */
629
+ tenantAdmit?: TenantAdmitProjection;
588
630
  }
589
631
  /**
590
632
  * Discriminator for {@link UserUpsertError}. Mirrors the
@@ -1679,6 +1721,12 @@ declare class T3nClient {
1679
1721
  organisationDid?: string;
1680
1722
  attestations?: unknown;
1681
1723
  keys?: Record<string, unknown>;
1724
+ /**
1725
+ * MAT-1618 testnet self-admit, propagated to the inner
1726
+ * {@link submitUserInput} call. Inspect `result.tenantAdmit` for
1727
+ * the outcome.
1728
+ */
1729
+ becomeDevTenant?: boolean;
1682
1730
  getOtpCode: (contact: string, channel: OtpChannel) => Promise<string> | string;
1683
1731
  }): Promise<SubmitUserInputResult>;
1684
1732
  /**
@@ -2722,4 +2770,4 @@ declare function clearKeyCache(): void;
2722
2770
  declare function loadConfig(baseUrl?: string): SdkConfig;
2723
2771
 
2724
2772
  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 };
2773
+ 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 };