vesant-sdk 1.8.0-dev.2b9e28d → 1.8.0-dev.2d679f1
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 +2 -2
- package/dist/{client-DUHC-68_.d.ts → client-BPALLldd.d.ts} +1 -1
- package/dist/{client-5q4whhGu.d.mts → client-_OhkfnyJ.d.mts} +1 -1
- package/dist/compliance/index.d.mts +2 -2
- package/dist/compliance/index.d.ts +2 -2
- package/dist/compliance/index.js +26 -9
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +26 -9
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.js +7 -6
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +7 -6
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.js +7 -6
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +7 -6
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +57 -167
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -168
- 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 +37 -164
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +36 -165
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +218 -218
- package/dist/kyc/index.d.ts +218 -218
- package/dist/kyc/index.js +37 -164
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +36 -165
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +16 -114
- package/dist/react.d.ts +16 -114
- package/dist/react.js +8 -186
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +9 -184
- 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 +25 -8
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +25 -9
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.js +7 -6
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +7 -6
- 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 +7 -6
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +7 -6
- 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/package.json +1 -1
package/README.md
CHANGED
|
@@ -352,8 +352,8 @@ interface ComplianceClientConfig {
|
|
|
352
352
|
| `requestKycSubmitLink(request)` | Generate a KYC submission link |
|
|
353
353
|
| `checkKycStatus(request)` | Check KYC verification status |
|
|
354
354
|
| `submitVerification(request)` | Submit document verification |
|
|
355
|
-
| `
|
|
356
|
-
| `
|
|
355
|
+
| `getKycRequest(id)` | Get a KYC record with proof download links |
|
|
356
|
+
| `getProofDownloadURLs(id)` | Download links for a record's proofs |
|
|
357
357
|
| `listAlerts(filters)` | List KYC alerts |
|
|
358
358
|
| `createEventBasedFaceVerificationSession(request)` | Start a face re-verification session (backend) |
|
|
359
359
|
| `submitEventBasedFaceVerificationSession(request)` | Submit a face capture for a session |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { D as DeviceFingerprintRequest, L as LocationVerification, V as ValidateCipherTextResponse, a as LocationRequest, G as GeolocationClient, b as LocationRequestFilters, c as LocationRequestListResponse } from './client-BaUekQT8.js';
|
|
2
2
|
import { RiskProfileClient } from './risk-profile/index.js';
|
|
3
3
|
import { V as VesantConfig, R as RequestOptions } from './client-q9fN8Hhf.js';
|
|
4
|
-
import { C as CustomerProfile } from './types-
|
|
4
|
+
import { C as CustomerProfile } from './types-qXamJr2q.js';
|
|
5
5
|
import { E as EntityType, B as BlockReason, P as PaginationParams } from './types-CBQRNL-l.js';
|
|
6
6
|
|
|
7
7
|
interface RegistrationVerificationRequest {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { D as DeviceFingerprintRequest, L as LocationVerification, V as ValidateCipherTextResponse, a as LocationRequest, G as GeolocationClient, b as LocationRequestFilters, c as LocationRequestListResponse } from './client-XDEhh9VN.mjs';
|
|
2
2
|
import { RiskProfileClient } from './risk-profile/index.mjs';
|
|
3
3
|
import { V as VesantConfig, R as RequestOptions } from './client-q9fN8Hhf.mjs';
|
|
4
|
-
import { C as CustomerProfile } from './types-
|
|
4
|
+
import { C as CustomerProfile } from './types-DbvVph_0.mjs';
|
|
5
5
|
import { E as EntityType, B as BlockReason, P as PaginationParams } from './types-CBQRNL-l.mjs';
|
|
6
6
|
|
|
7
7
|
interface RegistrationVerificationRequest {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { B as BlockReason } from '../types-CBQRNL-l.mjs';
|
|
2
|
-
export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-
|
|
2
|
+
export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-_OhkfnyJ.mjs';
|
|
3
3
|
export { p as CreateLocationRequestRequest, I as LocationCaptureRequest, K as LocationCaptureResponse, a as LocationRequest, M as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, N as LocationRequestResult, O as LocationRequestStatus, P as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-XDEhh9VN.mjs';
|
|
4
4
|
import '../risk-profile/index.mjs';
|
|
5
5
|
import '../client-q9fN8Hhf.mjs';
|
|
6
|
-
import '../types-
|
|
6
|
+
import '../types-DbvVph_0.mjs';
|
|
7
7
|
|
|
8
8
|
declare const sdkReasons: {
|
|
9
9
|
jurisdictionBlocked: (country: string, countryISO: string) => BlockReason;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { B as BlockReason } from '../types-CBQRNL-l.js';
|
|
2
|
-
export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-
|
|
2
|
+
export { C as ComplianceClient, a as ComplianceLocationRequestInput, b as ComplianceLocationRequestResult, c as CurrencyRates, D as DEFAULT_CURRENCY_RATES, E as EventVerificationRequest, d as EventVerificationResponse, L as LoginVerificationRequest, e as LoginVerificationResponse, R as RegistrationVerificationRequest, f as RegistrationVerificationResponse, T as TransactionRiskResult, g as TransactionVerificationRequest, h as TransactionVerificationResponse } from '../client-BPALLldd.js';
|
|
3
3
|
export { p as CreateLocationRequestRequest, I as LocationCaptureRequest, K as LocationCaptureResponse, a as LocationRequest, M as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, N as LocationRequestResult, O as LocationRequestStatus, P as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-BaUekQT8.js';
|
|
4
4
|
import '../risk-profile/index.js';
|
|
5
5
|
import '../client-q9fN8Hhf.js';
|
|
6
|
-
import '../types-
|
|
6
|
+
import '../types-qXamJr2q.js';
|
|
7
7
|
|
|
8
8
|
declare const sdkReasons: {
|
|
9
9
|
jurisdictionBlocked: (country: string, countryISO: string) => BlockReason;
|
package/dist/compliance/index.js
CHANGED
|
@@ -647,19 +647,20 @@ var BaseClient = class {
|
|
|
647
647
|
* Handle error responses from API
|
|
648
648
|
*/
|
|
649
649
|
handleErrorResponse(status, data, requestId) {
|
|
650
|
-
const
|
|
650
|
+
const structured = data.error && typeof data.error === "object" && !Array.isArray(data.error) ? data.error : void 0;
|
|
651
|
+
const message = typeof data.error === "string" && data.error || typeof structured?.message === "string" && structured.message || typeof data.message === "string" && data.message || `HTTP ${status}`;
|
|
651
652
|
const createError = () => {
|
|
652
653
|
switch (status) {
|
|
653
654
|
case 400:
|
|
654
|
-
return new VesantError(message, "BAD_REQUEST", 400);
|
|
655
|
+
return new VesantError(message, "BAD_REQUEST", 400, structured);
|
|
655
656
|
case 401:
|
|
656
657
|
return new AuthenticationError(message);
|
|
657
658
|
case 403:
|
|
658
|
-
return new VesantError(message, "FORBIDDEN", 403);
|
|
659
|
+
return new VesantError(message, "FORBIDDEN", 403, structured);
|
|
659
660
|
case 404:
|
|
660
|
-
return new VesantError(message, "NOT_FOUND", 404);
|
|
661
|
+
return new VesantError(message, "NOT_FOUND", 404, structured);
|
|
661
662
|
case 409:
|
|
662
|
-
return new VesantError(message, "DUPLICATE_PROFILE", 409);
|
|
663
|
+
return new VesantError(message, "DUPLICATE_PROFILE", 409, structured);
|
|
663
664
|
case 429: {
|
|
664
665
|
const retryAfter = data.retry_after || data.retryAfter;
|
|
665
666
|
return new RateLimitError(retryAfter);
|
|
@@ -670,7 +671,7 @@ var BaseClient = class {
|
|
|
670
671
|
case 504:
|
|
671
672
|
return new ServiceUnavailableError(message);
|
|
672
673
|
default:
|
|
673
|
-
return new VesantError(message, "UNKNOWN_ERROR", status);
|
|
674
|
+
return new VesantError(message, "UNKNOWN_ERROR", status, structured);
|
|
674
675
|
}
|
|
675
676
|
};
|
|
676
677
|
const error = createError();
|
|
@@ -1524,17 +1525,27 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1524
1525
|
/**
|
|
1525
1526
|
* Update customer profile
|
|
1526
1527
|
*
|
|
1528
|
+
* Omitted fields keep their stored values. When the tenant has the
|
|
1529
|
+
* **On Account Sensitive Action** KYC trigger enabled and the update changes
|
|
1530
|
+
* the customer's name, date of birth or residential address, Vesant applies
|
|
1531
|
+
* the other fields, holds the sensitive ones and answers `202` with a
|
|
1532
|
+
* {@link ProfileUpdateHeldResponse} instead of the profile. Narrow with
|
|
1533
|
+
* {@link isProfileUpdateHeld}, then request a `profile_change` submit link.
|
|
1534
|
+
*
|
|
1527
1535
|
* @param profileId - Profile UUID
|
|
1528
1536
|
* @param updates - Fields to update
|
|
1529
|
-
* @returns Updated customer profile
|
|
1537
|
+
* @returns Updated customer profile, or the held change
|
|
1530
1538
|
*
|
|
1531
1539
|
* @example
|
|
1532
1540
|
* ```typescript
|
|
1533
|
-
* const
|
|
1541
|
+
* const result = await client.updateProfile(profileId, {
|
|
1534
1542
|
* location: 'New York, USA',
|
|
1535
1543
|
* location_compliance: 'compliant',
|
|
1536
1544
|
* last_recorded_activity: new Date().toISOString()
|
|
1537
1545
|
* });
|
|
1546
|
+
* if (isProfileUpdateHeld(result)) {
|
|
1547
|
+
* // name / DOB / address held: start KYC with trigger_event 'profile_change'
|
|
1548
|
+
* }
|
|
1538
1549
|
* ```
|
|
1539
1550
|
*/
|
|
1540
1551
|
async updateProfile(profileId, updates, requestOptions) {
|
|
@@ -1574,6 +1585,11 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1574
1585
|
}
|
|
1575
1586
|
};
|
|
1576
1587
|
|
|
1588
|
+
// src/risk-profile/types.ts
|
|
1589
|
+
function isProfileUpdateHeld(result) {
|
|
1590
|
+
return typeof result === "object" && result !== null && result.status === "kyc_required" && result.kyc_required === true;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1577
1593
|
// src/compliance/types.ts
|
|
1578
1594
|
var DEFAULT_CURRENCY_RATES = {
|
|
1579
1595
|
USD: 1,
|
|
@@ -2029,11 +2045,12 @@ var ComplianceClient = class {
|
|
|
2029
2045
|
if (profileResult) {
|
|
2030
2046
|
profile = profileResult;
|
|
2031
2047
|
if (!isBlocked && this.shouldUpdateProfile(profile, geoVerification.location.city)) {
|
|
2032
|
-
|
|
2048
|
+
const updated = await this.riskClient.updateProfile(profile.id, {
|
|
2033
2049
|
last_recorded_activity: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2034
2050
|
location: `${geoVerification.location.city}, ${geoVerification.location.country}`,
|
|
2035
2051
|
location_compliance: geoVerification.is_compliant ? "compliant" : "non-compliant"
|
|
2036
2052
|
}, requestOptions);
|
|
2053
|
+
profile = isProfileUpdateHeld(updated) ? updated.profile : updated;
|
|
2037
2054
|
}
|
|
2038
2055
|
} else {
|
|
2039
2056
|
if (this.config.autoCreateProfiles && this.config.debug) {
|