@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 +49 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/src/client/t3n-client.d.ts +6 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/types/user.d.ts +42 -0
- package/package.json +3 -1
|
@@ -370,6 +370,12 @@ export declare class T3nClient {
|
|
|
370
370
|
organisationDid?: string;
|
|
371
371
|
attestations?: unknown;
|
|
372
372
|
keys?: Record<string, unknown>;
|
|
373
|
+
/**
|
|
374
|
+
* MAT-1618 testnet self-admit, propagated to the inner
|
|
375
|
+
* {@link submitUserInput} call. Inspect `result.tenantAdmit` for
|
|
376
|
+
* the outcome.
|
|
377
|
+
*/
|
|
378
|
+
becomeDevTenant?: boolean;
|
|
373
379
|
getOtpCode: (contact: string, channel: OtpChannel) => Promise<string> | string;
|
|
374
380
|
}): Promise<SubmitUserInputResult>;
|
|
375
381
|
/**
|
package/dist/src/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type { SessionId, Did, OidcCredentials, AuthInput, EthAuthInput, OidcAuth
|
|
|
18
18
|
export { SessionStatus, AuthMethod, createEthAuthInput, createOidcAuthInput, } from "./types";
|
|
19
19
|
export type { KycStatus, KycStatusKind, KycPollOptions, KycPollCadence, } from "./types/kyc";
|
|
20
20
|
export { DEFAULT_KYC_POLL_CADENCE, TERMINAL_KYC_STATUSES, KycStatusTimeoutError, } from "./types/kyc";
|
|
21
|
-
export type { OtpChannel, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, OtpMergeSuggestion, UserInputProfile, SubmitUserInputArgs, SubmitUserInputResult, UserUpsertErrorKind, } from "./types/user";
|
|
21
|
+
export type { OtpChannel, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, OtpMergeSuggestion, UserInputProfile, SubmitUserInputArgs, SubmitUserInputResult, TenantAdmitProjection, TenantAdmitStatus, UserUpsertErrorKind, } from "./types/user";
|
|
22
22
|
export { UserUpsertError } from "./types/user";
|
|
23
23
|
export { OrgDataClient, SessionOrgDataClient, createOrgDataClientFromSession, } from "./client/org-data";
|
|
24
24
|
export type { OrgDataClientOptions, CreatePolicyInput, UpdateMetaInput, SetWritersInput, SetGrantsInput, DeleteGrantsInput, WriteDataInput, DeleteDataInput, DeleteScopeInput, PolicyGetInput, WritersGetInput, GrantsGetInput, DataListInput, DataGetInput, ExecuteOrgDataActionOptions, } from "./client/org-data";
|
package/dist/src/types/user.d.ts
CHANGED
|
@@ -119,6 +119,8 @@ export interface UserInputProfile {
|
|
|
119
119
|
phone_number?: string;
|
|
120
120
|
birthdate?: string;
|
|
121
121
|
nationality?: string;
|
|
122
|
+
campaign_code?: string;
|
|
123
|
+
role?: string;
|
|
122
124
|
[key: string]: unknown;
|
|
123
125
|
}
|
|
124
126
|
/**
|
|
@@ -138,6 +140,41 @@ export interface SubmitUserInputArgs {
|
|
|
138
140
|
* Most callers should leave this `undefined`.
|
|
139
141
|
*/
|
|
140
142
|
requireExistingUser?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* MAT-1618 testnet self-admit. When `true`, the contract additionally
|
|
145
|
+
* runs the self-admit side-effect after the profile commit: writes
|
|
146
|
+
* the caller's DID into `idx:_tenants` + `idx:_tenant_quotas` and
|
|
147
|
+
* mints any operator-configured welcome credits. Inspect the
|
|
148
|
+
* `tenantAdmit` field on the response for the outcome.
|
|
149
|
+
*
|
|
150
|
+
* Testnet-only. Production clusters return
|
|
151
|
+
* `tenantAdmit.status = "refused"` with
|
|
152
|
+
* `reason = "not_testnet" | "self_admit_disabled" | "not_eth_derived"`.
|
|
153
|
+
* The profile commit always succeeds regardless of the inner outcome.
|
|
154
|
+
*
|
|
155
|
+
* Most callers should leave this `undefined`.
|
|
156
|
+
*/
|
|
157
|
+
becomeDevTenant?: boolean;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* MAT-1618 self-admit projection from `user-upsert`. Present only
|
|
161
|
+
* when the caller set `becomeDevTenant: true` on the request.
|
|
162
|
+
*
|
|
163
|
+
* - `status: "admitted"` — first call for this DID; tenant record
|
|
164
|
+
* committed and (if configured) welcome credits minted into
|
|
165
|
+
* `grantedCredits`.
|
|
166
|
+
* - `status: "already-admitted"` — replay; idempotent no-op.
|
|
167
|
+
* - `status: "refused"` — the cluster declined the self-admit;
|
|
168
|
+
* `reason` is the machine-readable cause (`not_testnet`,
|
|
169
|
+
* `self_admit_disabled`, `not_eth_derived`), `detail` is a
|
|
170
|
+
* human-readable string.
|
|
171
|
+
*/
|
|
172
|
+
export type TenantAdmitStatus = "admitted" | "already-admitted" | "refused";
|
|
173
|
+
export interface TenantAdmitProjection {
|
|
174
|
+
status: TenantAdmitStatus;
|
|
175
|
+
grantedCredits?: string;
|
|
176
|
+
reason?: string;
|
|
177
|
+
detail?: string;
|
|
141
178
|
}
|
|
142
179
|
/**
|
|
143
180
|
* Response shape returned by the slim `user-upsert`. Carries the
|
|
@@ -150,6 +187,11 @@ export interface SubmitUserInputResult {
|
|
|
150
187
|
refusedFields?: string[];
|
|
151
188
|
mergeSuggestion?: OtpMergeSuggestion;
|
|
152
189
|
userFound?: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* MAT-1618 self-admit projection. Present only when the caller
|
|
192
|
+
* set `becomeDevTenant: true` on the request.
|
|
193
|
+
*/
|
|
194
|
+
tenantAdmit?: TenantAdmitProjection;
|
|
153
195
|
}
|
|
154
196
|
/**
|
|
155
197
|
* Discriminator for {@link UserUpsertError}. Mirrors the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@terminal3/t3n-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "T3n TypeScript SDK - A minimal SDK that mirrors the server's RPC handler approach",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -43,8 +43,10 @@
|
|
|
43
43
|
"demo:real-wasm": "tsx demo.ts",
|
|
44
44
|
"demo:tenant:admit": "tsx --tsconfig tsconfig.demo.json tenant-demo.ts --cmd admit",
|
|
45
45
|
"demo:tenant:setup": "tsx --tsconfig tsconfig.demo.json tenant-demo.ts --cmd setup",
|
|
46
|
+
"demo:tenant:fix-readers": "tsx --tsconfig tsconfig.demo.json tenant-demo.ts --cmd fix-readers",
|
|
46
47
|
"demo:tenant:search": "tsx --tsconfig tsconfig.demo.json tenant-demo.ts --cmd search",
|
|
47
48
|
"demo:tenant:book": "tsx --tsconfig tsconfig.demo.json tenant-demo.ts --cmd book",
|
|
49
|
+
"demo:tenant:self-admit": "tsx --tsconfig tsconfig.demo.json demo-tenant-self-admit.ts",
|
|
48
50
|
"verify:pack": "node scripts/verify-pack.js",
|
|
49
51
|
"prepublishOnly": "pnpm run build:public && pnpm run verify:pack",
|
|
50
52
|
"release": "node scripts/release.js release",
|