vesant-sdk 1.7.2 → 1.8.0-dev.00f6233
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/README.md +3 -3
- package/dist/{client-B3DCAHlg.d.ts → client-BPALLldd.d.ts} +2 -2
- package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
- package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
- package/dist/{client-D23KhWeh.d.mts → client-_OhkfnyJ.d.mts} +2 -2
- package/dist/compliance/index.d.mts +3 -3
- package/dist/compliance/index.d.ts +3 -3
- package/dist/compliance/index.js +66 -11
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +66 -11
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.js +8 -7
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +8 -7
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +2 -2
- package/dist/geolocation/index.d.ts +2 -2
- package/dist/geolocation/index.js +47 -8
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +47 -8
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/{index-DSDgS09k.d.ts → index-BosFSGan.d.ts} +57 -2
- package/dist/{index-C3zUKydT.d.mts → index-C49a7fg2.d.mts} +57 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +104 -169
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +101 -170
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +2 -2
- package/dist/kyc/core.d.ts +2 -2
- package/dist/kyc/core.js +39 -165
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +38 -166
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +219 -218
- package/dist/kyc/index.d.ts +219 -218
- package/dist/kyc/index.js +39 -165
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +38 -166
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +24 -115
- package/dist/react.d.ts +24 -115
- package/dist/react.js +23 -196
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +24 -194
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +16 -6
- package/dist/risk-profile/index.d.ts +16 -6
- package/dist/risk-profile/index.js +26 -9
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +26 -10
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.js +8 -7
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +8 -7
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.d.mts +1 -1
- package/dist/tax/index.d.ts +1 -1
- package/dist/tax/index.js +8 -7
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +8 -7
- package/dist/tax/index.mjs.map +1 -1
- package/dist/{types-BOFaMQxI.d.mts → types-DbvVph_0.d.mts} +45 -2
- package/dist/{types-UGyDl1fd.d.ts → types-qXamJr2q.d.ts} +45 -2
- package/dist/webhooks/index.d.mts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.js +6 -0
- package/dist/webhooks/index.js.map +1 -1
- package/dist/webhooks/index.mjs +6 -1
- package/dist/webhooks/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -296,7 +296,7 @@ var noopLogger = {
|
|
|
296
296
|
};
|
|
297
297
|
|
|
298
298
|
// src/core/version.ts
|
|
299
|
-
var SDK_VERSION = "1.
|
|
299
|
+
var SDK_VERSION = "1.8.0";
|
|
300
300
|
|
|
301
301
|
// src/shared/browser-utils.ts
|
|
302
302
|
function generateUUID() {
|
|
@@ -631,19 +631,20 @@ var BaseClient = class {
|
|
|
631
631
|
* Handle error responses from API
|
|
632
632
|
*/
|
|
633
633
|
handleErrorResponse(status, data, requestId) {
|
|
634
|
-
const
|
|
634
|
+
const structured = data.error && typeof data.error === "object" && !Array.isArray(data.error) ? data.error : void 0;
|
|
635
|
+
const message = typeof data.error === "string" && data.error || typeof structured?.message === "string" && structured.message || typeof data.message === "string" && data.message || `HTTP ${status}`;
|
|
635
636
|
const createError = () => {
|
|
636
637
|
switch (status) {
|
|
637
638
|
case 400:
|
|
638
|
-
return new VesantError(message, "BAD_REQUEST", 400);
|
|
639
|
+
return new VesantError(message, "BAD_REQUEST", 400, structured);
|
|
639
640
|
case 401:
|
|
640
641
|
return new AuthenticationError(message);
|
|
641
642
|
case 403:
|
|
642
|
-
return new VesantError(message, "FORBIDDEN", 403);
|
|
643
|
+
return new VesantError(message, "FORBIDDEN", 403, structured);
|
|
643
644
|
case 404:
|
|
644
|
-
return new VesantError(message, "NOT_FOUND", 404);
|
|
645
|
+
return new VesantError(message, "NOT_FOUND", 404, structured);
|
|
645
646
|
case 409:
|
|
646
|
-
return new VesantError(message, "DUPLICATE_PROFILE", 409);
|
|
647
|
+
return new VesantError(message, "DUPLICATE_PROFILE", 409, structured);
|
|
647
648
|
case 429: {
|
|
648
649
|
const retryAfter = data.retry_after || data.retryAfter;
|
|
649
650
|
return new RateLimitError(retryAfter);
|
|
@@ -654,7 +655,7 @@ var BaseClient = class {
|
|
|
654
655
|
case 504:
|
|
655
656
|
return new ServiceUnavailableError(message);
|
|
656
657
|
default:
|
|
657
|
-
return new VesantError(message, "UNKNOWN_ERROR", status);
|
|
658
|
+
return new VesantError(message, "UNKNOWN_ERROR", status, structured);
|
|
658
659
|
}
|
|
659
660
|
};
|
|
660
661
|
const error = createError();
|
|
@@ -1102,6 +1103,7 @@ function isCipherTextExpired(cipherText) {
|
|
|
1102
1103
|
}
|
|
1103
1104
|
|
|
1104
1105
|
// src/geolocation/client.ts
|
|
1106
|
+
var DEFAULT_GPS_CONFIG_TTL_MS = 5 * 60 * 1e3;
|
|
1105
1107
|
var GeolocationClient = class extends BaseClient {
|
|
1106
1108
|
constructor(config) {
|
|
1107
1109
|
const baseConfig = {
|
|
@@ -1117,6 +1119,8 @@ var GeolocationClient = class extends BaseClient {
|
|
|
1117
1119
|
environment: config.environment
|
|
1118
1120
|
};
|
|
1119
1121
|
super(baseConfig);
|
|
1122
|
+
this.gpsConfigCache = null;
|
|
1123
|
+
this.gpsConfigTtlMs = config.gpsConfigTtlMs ?? DEFAULT_GPS_CONFIG_TTL_MS;
|
|
1120
1124
|
}
|
|
1121
1125
|
// ============================================================================
|
|
1122
1126
|
// IP Verification & Compliance
|
|
@@ -1202,7 +1206,42 @@ var GeolocationClient = class extends BaseClient {
|
|
|
1202
1206
|
* ```
|
|
1203
1207
|
*/
|
|
1204
1208
|
async getGPSConfig(requestOptions) {
|
|
1205
|
-
|
|
1209
|
+
const cached = this.gpsConfigCache;
|
|
1210
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
1211
|
+
return cached.value;
|
|
1212
|
+
}
|
|
1213
|
+
return this.refreshGPSConfig(requestOptions);
|
|
1214
|
+
}
|
|
1215
|
+
/**
|
|
1216
|
+
* Re-read the tenant's GPS requirement configuration, ignoring any copy held
|
|
1217
|
+
* from an earlier read.
|
|
1218
|
+
*
|
|
1219
|
+
* These requirements are edited in the compliance console while your
|
|
1220
|
+
* application is running. `getGPSConfig` reuses a fetched copy for a short
|
|
1221
|
+
* period so a long-lived session does not call the API on every event; call
|
|
1222
|
+
* this when you need a change to take effect immediately — for example right
|
|
1223
|
+
* after an administrator saves new settings.
|
|
1224
|
+
*
|
|
1225
|
+
* @returns The current GPS requirement config per event type
|
|
1226
|
+
*
|
|
1227
|
+
* @example
|
|
1228
|
+
* ```typescript
|
|
1229
|
+
* const config = await client.refreshGPSConfig();
|
|
1230
|
+
* if (config.require_gps.login) {
|
|
1231
|
+
* // GPS is now required for login
|
|
1232
|
+
* }
|
|
1233
|
+
* ```
|
|
1234
|
+
*/
|
|
1235
|
+
async refreshGPSConfig(requestOptions) {
|
|
1236
|
+
const value = await this.requestWithRetry(
|
|
1237
|
+
"/api/v1/geo/config",
|
|
1238
|
+
void 0,
|
|
1239
|
+
void 0,
|
|
1240
|
+
void 0,
|
|
1241
|
+
requestOptions
|
|
1242
|
+
);
|
|
1243
|
+
this.gpsConfigCache = { value, expiresAt: Date.now() + this.gpsConfigTtlMs };
|
|
1244
|
+
return value;
|
|
1206
1245
|
}
|
|
1207
1246
|
/**
|
|
1208
1247
|
* Mint a short-lived, single-use device-signals nonce.
|
|
@@ -1619,17 +1658,27 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1619
1658
|
/**
|
|
1620
1659
|
* Update customer profile
|
|
1621
1660
|
*
|
|
1661
|
+
* Omitted fields keep their stored values. When the tenant has the
|
|
1662
|
+
* **On Account Sensitive Action** KYC trigger enabled and the update changes
|
|
1663
|
+
* the customer's name, date of birth or residential address, Vesant applies
|
|
1664
|
+
* the other fields, holds the sensitive ones and answers `202` with a
|
|
1665
|
+
* {@link ProfileUpdateHeldResponse} instead of the profile. Narrow with
|
|
1666
|
+
* {@link isProfileUpdateHeld}, then request a `profile_change` submit link.
|
|
1667
|
+
*
|
|
1622
1668
|
* @param profileId - Profile UUID
|
|
1623
1669
|
* @param updates - Fields to update
|
|
1624
|
-
* @returns Updated customer profile
|
|
1670
|
+
* @returns Updated customer profile, or the held change
|
|
1625
1671
|
*
|
|
1626
1672
|
* @example
|
|
1627
1673
|
* ```typescript
|
|
1628
|
-
* const
|
|
1674
|
+
* const result = await client.updateProfile(profileId, {
|
|
1629
1675
|
* location: 'New York, USA',
|
|
1630
1676
|
* location_compliance: 'compliant',
|
|
1631
1677
|
* last_recorded_activity: new Date().toISOString()
|
|
1632
1678
|
* });
|
|
1679
|
+
* if (isProfileUpdateHeld(result)) {
|
|
1680
|
+
* // name / DOB / address held: start KYC with trigger_event 'profile_change'
|
|
1681
|
+
* }
|
|
1633
1682
|
* ```
|
|
1634
1683
|
*/
|
|
1635
1684
|
async updateProfile(profileId, updates, requestOptions) {
|
|
@@ -1669,6 +1718,11 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1669
1718
|
}
|
|
1670
1719
|
};
|
|
1671
1720
|
|
|
1721
|
+
// src/risk-profile/types.ts
|
|
1722
|
+
function isProfileUpdateHeld(result) {
|
|
1723
|
+
return typeof result === "object" && result !== null && result.status === "kyc_required" && result.kyc_required === true;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1672
1726
|
// src/compliance/block-reasons.ts
|
|
1673
1727
|
var sdkReasons = {
|
|
1674
1728
|
// Jurisdiction
|
|
@@ -2199,11 +2253,12 @@ var ComplianceClient = class {
|
|
|
2199
2253
|
if (profileResult) {
|
|
2200
2254
|
profile = profileResult;
|
|
2201
2255
|
if (!isBlocked && this.shouldUpdateProfile(profile, geoVerification.location.city)) {
|
|
2202
|
-
|
|
2256
|
+
const updated = await this.riskClient.updateProfile(profile.id, {
|
|
2203
2257
|
last_recorded_activity: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2204
2258
|
location: `${geoVerification.location.city}, ${geoVerification.location.country}`,
|
|
2205
2259
|
location_compliance: geoVerification.is_compliant ? "compliant" : "non-compliant"
|
|
2206
2260
|
}, requestOptions);
|
|
2261
|
+
profile = isProfileUpdateHeld(updated) ? updated.profile : updated;
|
|
2207
2262
|
}
|
|
2208
2263
|
} else {
|
|
2209
2264
|
if (this.config.autoCreateProfiles && this.config.debug) {
|
|
@@ -3149,77 +3204,24 @@ var KycClient = class extends BaseClient {
|
|
|
3149
3204
|
}, void 0, requestOptions);
|
|
3150
3205
|
}
|
|
3151
3206
|
/**
|
|
3152
|
-
* Get a KYC
|
|
3207
|
+
* Get a KYC record by ID
|
|
3153
3208
|
*
|
|
3154
|
-
*
|
|
3155
|
-
*
|
|
3209
|
+
* Works with your tenant API key. Each entry in `proofs` carries a
|
|
3210
|
+
* short-lived `link` for downloading that document, and `reference` holds
|
|
3211
|
+
* your own customer reference (the `forward_reference`).
|
|
3212
|
+
*
|
|
3213
|
+
* @param id - KYC record ID (the `kyc_id` returned by `requestKycSubmitLink`)
|
|
3214
|
+
* @returns KYC record including proofs (with download links) and alerts
|
|
3156
3215
|
*
|
|
3157
3216
|
* @example
|
|
3158
3217
|
* ```typescript
|
|
3159
3218
|
* const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
|
|
3160
3219
|
* console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
|
|
3220
|
+
* kyc.proofs?.forEach(proof => console.log(`${proof.type}: ${proof.link}`));
|
|
3161
3221
|
* ```
|
|
3162
3222
|
*/
|
|
3163
3223
|
async getKycRequest(id) {
|
|
3164
|
-
return this.request(`/api/v1/kyc
|
|
3165
|
-
}
|
|
3166
|
-
/**
|
|
3167
|
-
* List KYC requests with filters and pagination
|
|
3168
|
-
*
|
|
3169
|
-
* @param filters - Optional filters (status, search, date range)
|
|
3170
|
-
* @param pagination - Optional pagination (page, page_size)
|
|
3171
|
-
* @returns Paginated list of KYC requests
|
|
3172
|
-
*
|
|
3173
|
-
* @example
|
|
3174
|
-
* ```typescript
|
|
3175
|
-
* const requests = await client.listKycRequests(
|
|
3176
|
-
* { status: "pending", search: "john" },
|
|
3177
|
-
* { page: 1, page_size: 20 }
|
|
3178
|
-
* );
|
|
3179
|
-
* console.log(`Found ${requests.total} pending requests`);
|
|
3180
|
-
* ```
|
|
3181
|
-
*/
|
|
3182
|
-
async listKycRequests(filters, pagination) {
|
|
3183
|
-
const params = {};
|
|
3184
|
-
if (filters) {
|
|
3185
|
-
addFilterParam(params, "status", filters.status);
|
|
3186
|
-
addSimpleParams(params, filters, ["search", "fromDate", "toDate", "sortBy", "order"]);
|
|
3187
|
-
}
|
|
3188
|
-
if (pagination) {
|
|
3189
|
-
if (pagination.page) params.page = pagination.page;
|
|
3190
|
-
if (pagination.page_size) params.limit = pagination.page_size;
|
|
3191
|
-
}
|
|
3192
|
-
return this.request(
|
|
3193
|
-
`/api/v1/kyc/requests${this.buildQueryString(params)}`,
|
|
3194
|
-
{ headers: this.getUserHeaders() }
|
|
3195
|
-
);
|
|
3196
|
-
}
|
|
3197
|
-
/**
|
|
3198
|
-
* Update KYC request status (accept/decline)
|
|
3199
|
-
*
|
|
3200
|
-
* @param request - Status update request with reference, status, and reason
|
|
3201
|
-
*
|
|
3202
|
-
* @example
|
|
3203
|
-
* ```typescript
|
|
3204
|
-
* // Accept a KYC request
|
|
3205
|
-
* await client.updateKycStatus({
|
|
3206
|
-
* reference: "kyc-ref-123",
|
|
3207
|
-
* status: "accepted",
|
|
3208
|
-
* reason: "All documents verified successfully"
|
|
3209
|
-
* });
|
|
3210
|
-
*
|
|
3211
|
-
* // Decline a KYC request
|
|
3212
|
-
* await client.updateKycStatus({
|
|
3213
|
-
* reference: "kyc-ref-456",
|
|
3214
|
-
* status: "declined",
|
|
3215
|
-
* reason: "Document expired"
|
|
3216
|
-
* });
|
|
3217
|
-
* ```
|
|
3218
|
-
*/
|
|
3219
|
-
async updateKycStatus(request) {
|
|
3220
|
-
await this.request("/api/v1/kyc/status", {
|
|
3221
|
-
method: "PUT",
|
|
3222
|
-
body: JSON.stringify(request),
|
|
3224
|
+
return this.request(`/api/v1/kyc/${encodeURIComponent(id)}`, {
|
|
3223
3225
|
headers: this.getUserHeaders()
|
|
3224
3226
|
});
|
|
3225
3227
|
}
|
|
@@ -3251,63 +3253,28 @@ var KycClient = class extends BaseClient {
|
|
|
3251
3253
|
/**
|
|
3252
3254
|
* Get downloadable URLs for KYC proofs/documents
|
|
3253
3255
|
*
|
|
3254
|
-
*
|
|
3255
|
-
*
|
|
3256
|
+
* Derived from the `proofs` of `getKycRequest`: the platform attaches a
|
|
3257
|
+
* short-lived download link to every proof on the KYC record, so no
|
|
3258
|
+
* separate endpoint is needed. Proofs without a link are omitted.
|
|
3259
|
+
*
|
|
3260
|
+
* @param kycId - KYC record ID
|
|
3261
|
+
* @returns Array of proof download URLs
|
|
3256
3262
|
*
|
|
3257
3263
|
* @example
|
|
3258
3264
|
* ```typescript
|
|
3259
3265
|
* const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
|
|
3260
3266
|
* proofs.forEach(proof => {
|
|
3261
|
-
* console.log(`${proof.type}: ${proof.url}
|
|
3267
|
+
* console.log(`${proof.type}: ${proof.url}`);
|
|
3262
3268
|
* });
|
|
3263
3269
|
* ```
|
|
3264
3270
|
*/
|
|
3265
3271
|
async getProofDownloadURLs(kycId) {
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
{ headers: this.getUserHeaders() }
|
|
3269
|
-
);
|
|
3270
|
-
}
|
|
3271
|
-
// ============================================================================
|
|
3272
|
-
// KYC Overview & Statistics
|
|
3273
|
-
// ============================================================================
|
|
3274
|
-
/**
|
|
3275
|
-
* Get KYC overview statistics
|
|
3276
|
-
*
|
|
3277
|
-
* @param fromDate - Optional start date (ISO 8601)
|
|
3278
|
-
* @param toDate - Optional end date (ISO 8601)
|
|
3279
|
-
* @returns KYC statistics including counts by status
|
|
3280
|
-
*
|
|
3281
|
-
* @example
|
|
3282
|
-
* ```typescript
|
|
3283
|
-
* const overview = await client.getOverview(
|
|
3284
|
-
* "2024-01-01T00:00:00Z",
|
|
3285
|
-
* "2024-12-31T23:59:59Z"
|
|
3286
|
-
* );
|
|
3287
|
-
* console.log(`Total: ${overview.total}, Pending: ${overview.pending}`);
|
|
3288
|
-
* console.log(`Approved: ${overview.approved}, Rejected: ${overview.rejected}`);
|
|
3289
|
-
* ```
|
|
3290
|
-
*/
|
|
3291
|
-
async getOverview(fromDate, toDate) {
|
|
3292
|
-
const params = {};
|
|
3293
|
-
if (fromDate) params.fromDate = fromDate;
|
|
3294
|
-
if (toDate) params.toDate = toDate;
|
|
3295
|
-
return this.request(
|
|
3296
|
-
`/api/v1/kyc/overview${this.buildQueryString(params)}`
|
|
3297
|
-
);
|
|
3272
|
+
const kyc = await this.getKycRequest(kycId);
|
|
3273
|
+
return (kyc.proofs ?? []).filter((proof) => typeof proof.link === "string" && proof.link !== "").map((proof) => ({ id: proof.id, type: proof.type, url: proof.link }));
|
|
3298
3274
|
}
|
|
3299
3275
|
// ============================================================================
|
|
3300
3276
|
// Alert Management
|
|
3301
3277
|
// ============================================================================
|
|
3302
|
-
/**
|
|
3303
|
-
* Get a KYC alert by ID
|
|
3304
|
-
*
|
|
3305
|
-
* @param alertId - Alert ID
|
|
3306
|
-
* @returns Alert details
|
|
3307
|
-
*/
|
|
3308
|
-
async getAlert(alertId) {
|
|
3309
|
-
return this.request(`/api/v1/kyc/alerts/${alertId}`);
|
|
3310
|
-
}
|
|
3311
3278
|
/**
|
|
3312
3279
|
* List KYC alerts with filters and pagination
|
|
3313
3280
|
*
|
|
@@ -3327,6 +3294,10 @@ var KycClient = class extends BaseClient {
|
|
|
3327
3294
|
* );
|
|
3328
3295
|
* console.log(`Found ${alerts.total} alerts`);
|
|
3329
3296
|
* ```
|
|
3297
|
+
*
|
|
3298
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3299
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3300
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3330
3301
|
*/
|
|
3331
3302
|
async listAlerts(filters, pagination) {
|
|
3332
3303
|
const params = {};
|
|
@@ -3346,66 +3317,15 @@ var KycClient = class extends BaseClient {
|
|
|
3346
3317
|
`/api/v1/kyc/alerts${this.buildQueryString(params)}`
|
|
3347
3318
|
);
|
|
3348
3319
|
}
|
|
3349
|
-
/**
|
|
3350
|
-
* Update a KYC alert
|
|
3351
|
-
*
|
|
3352
|
-
* @param alertId - Alert ID
|
|
3353
|
-
* @param update - Fields to update (status, assigned_for, reason, alert_type)
|
|
3354
|
-
*
|
|
3355
|
-
* @example
|
|
3356
|
-
* ```typescript
|
|
3357
|
-
* // Assign an alert
|
|
3358
|
-
* await client.updateAlert("alert_123", {
|
|
3359
|
-
* assigned_for: "analyst_user_id",
|
|
3360
|
-
* status: "in_progress"
|
|
3361
|
-
* });
|
|
3362
|
-
*
|
|
3363
|
-
* // Resolve an alert
|
|
3364
|
-
* await client.updateAlert("alert_123", {
|
|
3365
|
-
* status: "resolved",
|
|
3366
|
-
* reason: "Customer verified via phone call"
|
|
3367
|
-
* });
|
|
3368
|
-
*
|
|
3369
|
-
* // Escalate an alert
|
|
3370
|
-
* await client.updateAlert("alert_123", {
|
|
3371
|
-
* status: "escalated",
|
|
3372
|
-
* assigned_for: "manager_user_id",
|
|
3373
|
-
* reason: "Requires senior review - suspicious documents"
|
|
3374
|
-
* });
|
|
3375
|
-
* ```
|
|
3376
|
-
*/
|
|
3377
|
-
async updateAlert(alertId, update) {
|
|
3378
|
-
await this.request(`/api/v1/kyc/alerts/${alertId}`, {
|
|
3379
|
-
method: "PUT",
|
|
3380
|
-
body: JSON.stringify(update),
|
|
3381
|
-
headers: this.getUserHeaders()
|
|
3382
|
-
});
|
|
3383
|
-
}
|
|
3384
3320
|
// ============================================================================
|
|
3385
3321
|
// KYC Preferences
|
|
3386
3322
|
// ============================================================================
|
|
3387
|
-
/**
|
|
3388
|
-
* Get KYC preferences for the tenant
|
|
3389
|
-
*
|
|
3390
|
-
* @returns KYC preferences configuration
|
|
3391
|
-
*
|
|
3392
|
-
* @example
|
|
3393
|
-
* ```typescript
|
|
3394
|
-
* const prefs = await client.getPreferences();
|
|
3395
|
-
* console.log(`Face verification required: ${prefs.is_face_verification_required}`);
|
|
3396
|
-
* console.log(`Required documents: ${prefs.required_document_count}`);
|
|
3397
|
-
* ```
|
|
3398
|
-
*/
|
|
3399
|
-
async getPreferences() {
|
|
3400
|
-
return this.request("/api/v1/kyc/preferences");
|
|
3401
|
-
}
|
|
3402
3323
|
/**
|
|
3403
3324
|
* Update KYC preferences for the tenant
|
|
3404
3325
|
*
|
|
3405
3326
|
* @deprecated KYC preferences are managed in the Vesant console; the
|
|
3406
3327
|
* platform exposes no update operation to the SDK, so this call always
|
|
3407
|
-
* fails.
|
|
3408
|
-
* in a future release.
|
|
3328
|
+
* fails. This method will be removed in a future release.
|
|
3409
3329
|
*
|
|
3410
3330
|
* @param update - Fields to update
|
|
3411
3331
|
* @returns Updated preferences
|
|
@@ -3568,6 +3488,12 @@ var KYC_DECLINED_DESCRIPTIONS = {
|
|
|
3568
3488
|
function isKycDocumentExpiredCallbackEvent(value) {
|
|
3569
3489
|
return typeof value === "object" && value !== null && value.event === "kyc_document_expired";
|
|
3570
3490
|
}
|
|
3491
|
+
function isKycStatusCallbackEvent(value) {
|
|
3492
|
+
return typeof value === "object" && value !== null && value.event === "kyc";
|
|
3493
|
+
}
|
|
3494
|
+
function isProfileChangeCallbackEvent(value) {
|
|
3495
|
+
return typeof value === "object" && value !== null && value.event === "profile_change";
|
|
3496
|
+
}
|
|
3571
3497
|
|
|
3572
3498
|
// src/tax/client.ts
|
|
3573
3499
|
var TaxClient = class extends BaseClient {
|
|
@@ -3857,6 +3783,11 @@ function buildHandler(options) {
|
|
|
3857
3783
|
return handler;
|
|
3858
3784
|
}
|
|
3859
3785
|
|
|
3860
|
-
|
|
3786
|
+
// src/webhooks/types.ts
|
|
3787
|
+
function isAmlBlockCallbackEvent(value) {
|
|
3788
|
+
return typeof value === "object" && value !== null && value.event === "aml" && value.block === true;
|
|
3789
|
+
}
|
|
3790
|
+
|
|
3791
|
+
export { AuthenticationError, BaseClient, CGSError, CircuitBreaker, CircuitBreakerOpenError, ComplianceBlockedError, ComplianceClient, ComplianceError, DEFAULT_CURRENCY_RATES, GeolocationClient, InMemoryDedupStore, KYC_DECLINED_DESCRIPTIONS, KycClient, NetworkError, RateLimitError, RateLimitTracker, RefreshingTokenProvider, RiskProfileClient, SDK_VERSION, ServiceUnavailableError, StaticApiKeyProvider, TaxClient, TimeoutError, ValidationError, VesantError, WebhookHandler, assessGpsIntegrity, collectAll, collectDeviceSignals, createConsoleLogger, createNextWebhookHandler, createWebhookMiddleware, decodeCipherText, generateCipherText, gpsIntegrityInputFromPosition, isAmlBlockCallbackEvent, isCipherTextExpired, isKycDocumentExpiredCallbackEvent, isKycStatusCallbackEvent, isProfileChangeCallbackEvent, isProfileUpdateHeld, noopLogger, paginate, probeGeolocationPermission, sdkReasons, verifyWebhookSignature };
|
|
3861
3792
|
//# sourceMappingURL=index.mjs.map
|
|
3862
3793
|
//# sourceMappingURL=index.mjs.map
|