vesant-sdk 1.8.0-dev.31d63f0 → 1.8.0-dev.9f7204d
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 +5 -3
- package/dist/{client-DUHC-68_.d.ts → client-4oLoc31v.d.ts} +1 -1
- package/dist/{client-5q4whhGu.d.mts → client-CJI8VO1i.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 +19 -3
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +19 -3
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +72 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +71 -15
- 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 +52 -11
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +52 -12
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +156 -12
- package/dist/kyc/index.d.ts +156 -12
- package/dist/kyc/index.js +52 -11
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +52 -12
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +21 -3
- package/dist/react.d.ts +21 -3
- package/dist/react.js +8 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +8 -1
- 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 +18 -2
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +18 -3
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/{types-UGyDl1fd.d.ts → types-1kI4SsKB.d.ts} +44 -1
- package/dist/{types-BOFaMQxI.d.mts → types-DfbnIaW_.d.mts} +44 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6,10 +6,10 @@ export { A as AmlBlockCallbackData, a as AmlBlockCallbackEvent, b as AmlCallback
|
|
|
6
6
|
export { A as APIError, d as AlertFilters, e as AlertListResponse, f as AlertSeverity, g as AlertStatus, h as AlertType, C as CipherTextCustomerData, i as CipherTextOptions, j as CipherTextPayload, k as CipherTextReason, l as CipherTextResult, m as ComplianceCheckResponse, n as CreateGeofenceRuleRequest, o as CreateJurisdictionRequest, p as CreateLocationRequestRequest, q as DashboardMetrics, r as DecryptedCipherText, s as DeviceFingerprint, D as DeviceFingerprintRequest, t as DeviceSignalsEnvelope, u as DeviceTrustResult, v as GeoIPResult, w as GeofenceAction, x as GeofenceEvaluation, y as GeofenceRule, z as GeofenceRuleType, B as GeolocationAlert, G as GeolocationClient, E as GeolocationClientConfig, F as GeolocationConfigResponse, H as GeolocationRecord, J as JurisdictionConfig, 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, L as LocationVerification, R as ResendLocationRequestRequest, S as SignalsNonce, U as UpdateDeviceTrustRequest, Q as UpdateGeofenceRuleRequest, T as UpdateJurisdictionRequest, W as UseAlertsOptions, X as UseAlertsResult, Y as UseGeolocationOptions, Z as UseGeolocationResult, _ as UseLocationCaptureOptions, $ as UseLocationCaptureResult, a0 as UseLocationRequestsOptions, a1 as UseLocationRequestsResult, a2 as ValidateCipherTextRequest, V as ValidateCipherTextResponse, a3 as VerifyIPRequest } from './client-XDEhh9VN.mjs';
|
|
7
7
|
export { GpsIntegrityInput, GpsIntegrityOptions, GpsIntegrityResult, assessGpsIntegrity, collectDeviceSignals, decodeCipherText, generateCipherText, gpsIntegrityInputFromPosition, isCipherTextExpired, probeGeolocationPermission } from './geolocation/index.mjs';
|
|
8
8
|
export { RiskProfileClient } from './risk-profile/index.mjs';
|
|
9
|
-
export { a as CreateCustomerProfileRequest, a as CreateProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse, E as EmploymentType, L as LegalForm, c as ProfileDetailsResponse, P as ProfileFilters, b as ProfileListResponse, R as RiskCategory,
|
|
9
|
+
export { a as CreateCustomerProfileRequest, a as CreateProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse, E as EmploymentType, L as LegalForm, c as ProfileDetailsResponse, P as ProfileFilters, b as ProfileListResponse, d as ProfileUpdateHeldResponse, R as RiskCategory, e as RiskConfiguration, f as RiskDashboardMetrics, g as RiskFactor, h as RiskFactorType, i as RiskHistory, S as ScreeningStatus, U as UpdateProfileRequest, j as UpdateProfileResult, k as isProfileUpdateHeld } from './types-DfbnIaW_.mjs';
|
|
10
10
|
export { sdkReasons } from './compliance/index.mjs';
|
|
11
|
-
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-
|
|
12
|
-
export { CheckKycStatusRequest, CheckKycStatusResponse, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, EventBasedFaceVerificationCallback, EventBasedFaceVerificationDeviceType, EventBasedFaceVerificationEvent, EventBasedFaceVerificationFrequencyTrigger, EventBasedFaceVerificationReactionResult, EventBasedFaceVerificationReactions, EventBasedFaceVerificationThresholdTrigger, EventBasedFaceVerificationTriggers, FaceProof, KYC_DECLINED_DESCRIPTIONS, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycRequestReason, KycRequestReasonCode, KycSkipOptions, KycStatus, KycTriggerEvent, KycVerificationTriggers, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedAddressDocumentType, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent } from './kyc/index.mjs';
|
|
11
|
+
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-CJI8VO1i.mjs';
|
|
12
|
+
export { AccountSensitiveActionTrigger, CheckKycStatusRequest, CheckKycStatusResponse, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, EventBasedFaceVerificationCallback, EventBasedFaceVerificationDeviceType, EventBasedFaceVerificationEvent, EventBasedFaceVerificationFrequencyTrigger, EventBasedFaceVerificationReactionResult, EventBasedFaceVerificationReactions, EventBasedFaceVerificationThresholdTrigger, EventBasedFaceVerificationTriggers, FaceProof, KYC_DECLINED_DESCRIPTIONS, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycCallbackReactions, KycClient, KycClientConfig, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycRequestReason, KycRequestReasonCode, KycSkipOptions, KycStatus, KycTriggerEvent, KycVerificationTriggers, Name, ProfileChangeCallbackEvent, ProfileChangeField, ProfileChangeStatus, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedAddressDocumentType, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent, isProfileChangeCallbackEvent } from './kyc/index.mjs';
|
|
13
13
|
export { CTPFormStatus, CTPTINStatus, ComplianceStats, ComplianceStatsFilters, CustomerTaxProfileDocuments, CustomerTaxProfileRecord, CustomerType, DocumentRequestBreakdown, EmailSendingMethod, EnableWithholdingInput, EnableWithholdingResponse, GlobalTaxRule, ReRequestTaxFormInput, RemindersRunResult, TINCheckResult, TINStatusBreakdown, TaxClient, TaxClientConfig, TaxRuleApprovalStatus, TaxRuleVersion, TaxRules, TransactionAction, TreatyCountry, TreatyCountryListResponse, UpdateTaxRulesInput, WFormCountBreakdown, WFormStatusBreakdown } from './tax/index.mjs';
|
|
14
14
|
|
|
15
15
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ export { A as AmlBlockCallbackData, a as AmlBlockCallbackEvent, b as AmlCallback
|
|
|
6
6
|
export { A as APIError, d as AlertFilters, e as AlertListResponse, f as AlertSeverity, g as AlertStatus, h as AlertType, C as CipherTextCustomerData, i as CipherTextOptions, j as CipherTextPayload, k as CipherTextReason, l as CipherTextResult, m as ComplianceCheckResponse, n as CreateGeofenceRuleRequest, o as CreateJurisdictionRequest, p as CreateLocationRequestRequest, q as DashboardMetrics, r as DecryptedCipherText, s as DeviceFingerprint, D as DeviceFingerprintRequest, t as DeviceSignalsEnvelope, u as DeviceTrustResult, v as GeoIPResult, w as GeofenceAction, x as GeofenceEvaluation, y as GeofenceRule, z as GeofenceRuleType, B as GeolocationAlert, G as GeolocationClient, E as GeolocationClientConfig, F as GeolocationConfigResponse, H as GeolocationRecord, J as JurisdictionConfig, 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, L as LocationVerification, R as ResendLocationRequestRequest, S as SignalsNonce, U as UpdateDeviceTrustRequest, Q as UpdateGeofenceRuleRequest, T as UpdateJurisdictionRequest, W as UseAlertsOptions, X as UseAlertsResult, Y as UseGeolocationOptions, Z as UseGeolocationResult, _ as UseLocationCaptureOptions, $ as UseLocationCaptureResult, a0 as UseLocationRequestsOptions, a1 as UseLocationRequestsResult, a2 as ValidateCipherTextRequest, V as ValidateCipherTextResponse, a3 as VerifyIPRequest } from './client-BaUekQT8.js';
|
|
7
7
|
export { GpsIntegrityInput, GpsIntegrityOptions, GpsIntegrityResult, assessGpsIntegrity, collectDeviceSignals, decodeCipherText, generateCipherText, gpsIntegrityInputFromPosition, isCipherTextExpired, probeGeolocationPermission } from './geolocation/index.js';
|
|
8
8
|
export { RiskProfileClient } from './risk-profile/index.js';
|
|
9
|
-
export { a as CreateCustomerProfileRequest, a as CreateProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse, E as EmploymentType, L as LegalForm, c as ProfileDetailsResponse, P as ProfileFilters, b as ProfileListResponse, R as RiskCategory,
|
|
9
|
+
export { a as CreateCustomerProfileRequest, a as CreateProfileRequest, C as CustomerProfile, P as CustomerProfileFilters, b as CustomerProfileListResponse, E as EmploymentType, L as LegalForm, c as ProfileDetailsResponse, P as ProfileFilters, b as ProfileListResponse, d as ProfileUpdateHeldResponse, R as RiskCategory, e as RiskConfiguration, f as RiskDashboardMetrics, g as RiskFactor, h as RiskFactorType, i as RiskHistory, S as ScreeningStatus, U as UpdateProfileRequest, j as UpdateProfileResult, k as isProfileUpdateHeld } from './types-1kI4SsKB.js';
|
|
10
10
|
export { sdkReasons } from './compliance/index.js';
|
|
11
|
-
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-
|
|
12
|
-
export { CheckKycStatusRequest, CheckKycStatusResponse, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, EventBasedFaceVerificationCallback, EventBasedFaceVerificationDeviceType, EventBasedFaceVerificationEvent, EventBasedFaceVerificationFrequencyTrigger, EventBasedFaceVerificationReactionResult, EventBasedFaceVerificationReactions, EventBasedFaceVerificationThresholdTrigger, EventBasedFaceVerificationTriggers, FaceProof, KYC_DECLINED_DESCRIPTIONS, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycClient, KycClientConfig, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycRequestReason, KycRequestReasonCode, KycSkipOptions, KycStatus, KycTriggerEvent, KycVerificationTriggers, Name, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedAddressDocumentType, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent } from './kyc/index.js';
|
|
11
|
+
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-4oLoc31v.js';
|
|
12
|
+
export { AccountSensitiveActionTrigger, CheckKycStatusRequest, CheckKycStatusResponse, CreateEventBasedFaceVerificationSessionRequest, CreateEventBasedFaceVerificationSessionResponse, DocumentType, DocumentVerificationRequest, DocumentVerificationResponse, EventBasedFaceVerificationCallback, EventBasedFaceVerificationDeviceType, EventBasedFaceVerificationEvent, EventBasedFaceVerificationFrequencyTrigger, EventBasedFaceVerificationReactionResult, EventBasedFaceVerificationReactions, EventBasedFaceVerificationThresholdTrigger, EventBasedFaceVerificationTriggers, FaceProof, KYC_DECLINED_DESCRIPTIONS, KycAlert, KycAlertFilters, KycAlertListResponse, KycAlertStatus, KycAlertType, KycCallbackReactions, KycClient, KycClientConfig, KycCustomerData, KycCustomerProfile, KycDeclinedCode, KycDisclosureConsent, KycDocumentExpiredCallbackEvent, KycHandoffSession, KycOtherReason, KycOverview, KycPagination, KycPreferences, KycRequest, KycRequestFilters, KycRequestListResponse, KycRequestReason, KycRequestReasonCode, KycSkipOptions, KycStatus, KycTriggerEvent, KycVerificationTriggers, Name, ProfileChangeCallbackEvent, ProfileChangeField, ProfileChangeStatus, Proof, ProofDownloadURL, ProofType, RequestAdditionalDocumentsRequest, RequestKycSubmitLinkRequest, RequestKycSubmitLinkResponse, SubmitEventBasedFaceVerificationSessionRequest, SubmittedDocument, SupportedAddressDocumentType, SupportedDocumentType, UpdateKycAlertRequest, UpdateKycPreferencesRequest, UpdateKycStatusRequest, UseKycAlertsOptions, UseKycAlertsResult, UseKycOverviewOptions, UseKycOverviewResult, UseKycPreferencesResult, UseKycRequestsOptions, UseKycRequestsResult, UseKycSubmissionOptions, UseKycSubmissionResult, isKycDocumentExpiredCallbackEvent, isProfileChangeCallbackEvent } from './kyc/index.js';
|
|
13
13
|
export { CTPFormStatus, CTPTINStatus, ComplianceStats, ComplianceStatsFilters, CustomerTaxProfileDocuments, CustomerTaxProfileRecord, CustomerType, DocumentRequestBreakdown, EmailSendingMethod, EnableWithholdingInput, EnableWithholdingResponse, GlobalTaxRule, ReRequestTaxFormInput, RemindersRunResult, TINCheckResult, TINStatusBreakdown, TaxClient, TaxClientConfig, TaxRuleApprovalStatus, TaxRuleVersion, TaxRules, TransactionAction, TreatyCountry, TreatyCountryListResponse, UpdateTaxRulesInput, WFormCountBreakdown, WFormStatusBreakdown } from './tax/index.js';
|
|
14
14
|
|
|
15
15
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1659,17 +1659,27 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1659
1659
|
/**
|
|
1660
1660
|
* Update customer profile
|
|
1661
1661
|
*
|
|
1662
|
+
* Omitted fields keep their stored values. When the tenant has the
|
|
1663
|
+
* **On Account Sensitive Action** KYC trigger enabled and the update changes
|
|
1664
|
+
* the customer's name, date of birth or residential address, Vesant applies
|
|
1665
|
+
* the other fields, holds the sensitive ones and answers `202` with a
|
|
1666
|
+
* {@link ProfileUpdateHeldResponse} instead of the profile. Narrow with
|
|
1667
|
+
* {@link isProfileUpdateHeld}, then request a `profile_change` submit link.
|
|
1668
|
+
*
|
|
1662
1669
|
* @param profileId - Profile UUID
|
|
1663
1670
|
* @param updates - Fields to update
|
|
1664
|
-
* @returns Updated customer profile
|
|
1671
|
+
* @returns Updated customer profile, or the held change
|
|
1665
1672
|
*
|
|
1666
1673
|
* @example
|
|
1667
1674
|
* ```typescript
|
|
1668
|
-
* const
|
|
1675
|
+
* const result = await client.updateProfile(profileId, {
|
|
1669
1676
|
* location: 'New York, USA',
|
|
1670
1677
|
* location_compliance: 'compliant',
|
|
1671
1678
|
* last_recorded_activity: new Date().toISOString()
|
|
1672
1679
|
* });
|
|
1680
|
+
* if (isProfileUpdateHeld(result)) {
|
|
1681
|
+
* // name / DOB / address held: start KYC with trigger_event 'profile_change'
|
|
1682
|
+
* }
|
|
1673
1683
|
* ```
|
|
1674
1684
|
*/
|
|
1675
1685
|
async updateProfile(profileId, updates, requestOptions) {
|
|
@@ -1709,6 +1719,11 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1709
1719
|
}
|
|
1710
1720
|
};
|
|
1711
1721
|
|
|
1722
|
+
// src/risk-profile/types.ts
|
|
1723
|
+
function isProfileUpdateHeld(result) {
|
|
1724
|
+
return typeof result === "object" && result !== null && result.status === "kyc_required" && result.kyc_required === true;
|
|
1725
|
+
}
|
|
1726
|
+
|
|
1712
1727
|
// src/compliance/block-reasons.ts
|
|
1713
1728
|
var sdkReasons = {
|
|
1714
1729
|
// Jurisdiction
|
|
@@ -2239,11 +2254,12 @@ var ComplianceClient = class {
|
|
|
2239
2254
|
if (profileResult) {
|
|
2240
2255
|
profile = profileResult;
|
|
2241
2256
|
if (!isBlocked && this.shouldUpdateProfile(profile, geoVerification.location.city)) {
|
|
2242
|
-
|
|
2257
|
+
const updated = await this.riskClient.updateProfile(profile.id, {
|
|
2243
2258
|
last_recorded_activity: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2244
2259
|
location: `${geoVerification.location.city}, ${geoVerification.location.country}`,
|
|
2245
2260
|
location_compliance: geoVerification.is_compliant ? "compliant" : "non-compliant"
|
|
2246
2261
|
}, requestOptions);
|
|
2262
|
+
profile = isProfileUpdateHeld(updated) ? updated.profile : updated;
|
|
2247
2263
|
}
|
|
2248
2264
|
} else {
|
|
2249
2265
|
if (this.config.autoCreateProfiles && this.config.debug) {
|
|
@@ -3189,19 +3205,26 @@ var KycClient = class extends BaseClient {
|
|
|
3189
3205
|
}, void 0, requestOptions);
|
|
3190
3206
|
}
|
|
3191
3207
|
/**
|
|
3192
|
-
* Get a KYC
|
|
3208
|
+
* Get a KYC record by ID
|
|
3209
|
+
*
|
|
3210
|
+
* Works with your tenant API key. Each entry in `proofs` carries a
|
|
3211
|
+
* short-lived `link` for downloading that document, and `reference` holds
|
|
3212
|
+
* your own customer reference (the `forward_reference`).
|
|
3193
3213
|
*
|
|
3194
|
-
* @param id - KYC
|
|
3195
|
-
* @returns KYC
|
|
3214
|
+
* @param id - KYC record ID (the `kyc_id` returned by `requestKycSubmitLink`)
|
|
3215
|
+
* @returns KYC record including proofs (with download links) and alerts
|
|
3196
3216
|
*
|
|
3197
3217
|
* @example
|
|
3198
3218
|
* ```typescript
|
|
3199
3219
|
* const kyc = await client.getKycRequest("550e8400-e29b-41d4-a716-446655440000");
|
|
3200
3220
|
* console.log(`Status: ${kyc.status}, ID Verified: ${kyc.id_verified}`);
|
|
3221
|
+
* kyc.proofs?.forEach(proof => console.log(`${proof.type}: ${proof.link}`));
|
|
3201
3222
|
* ```
|
|
3202
3223
|
*/
|
|
3203
3224
|
async getKycRequest(id) {
|
|
3204
|
-
return this.request(`/api/v1/kyc
|
|
3225
|
+
return this.request(`/api/v1/kyc/${encodeURIComponent(id)}`, {
|
|
3226
|
+
headers: this.getUserHeaders()
|
|
3227
|
+
});
|
|
3205
3228
|
}
|
|
3206
3229
|
/**
|
|
3207
3230
|
* List KYC requests with filters and pagination
|
|
@@ -3218,6 +3241,10 @@ var KycClient = class extends BaseClient {
|
|
|
3218
3241
|
* );
|
|
3219
3242
|
* console.log(`Found ${requests.total} pending requests`);
|
|
3220
3243
|
* ```
|
|
3244
|
+
*
|
|
3245
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3246
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3247
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3221
3248
|
*/
|
|
3222
3249
|
async listKycRequests(filters, pagination) {
|
|
3223
3250
|
const params = {};
|
|
@@ -3255,6 +3282,10 @@ var KycClient = class extends BaseClient {
|
|
|
3255
3282
|
* reason: "Document expired"
|
|
3256
3283
|
* });
|
|
3257
3284
|
* ```
|
|
3285
|
+
*
|
|
3286
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3287
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3288
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3258
3289
|
*/
|
|
3259
3290
|
async updateKycStatus(request) {
|
|
3260
3291
|
await this.request("/api/v1/kyc/status", {
|
|
@@ -3291,22 +3322,24 @@ var KycClient = class extends BaseClient {
|
|
|
3291
3322
|
/**
|
|
3292
3323
|
* Get downloadable URLs for KYC proofs/documents
|
|
3293
3324
|
*
|
|
3294
|
-
*
|
|
3295
|
-
*
|
|
3325
|
+
* Derived from the `proofs` of `getKycRequest`: the platform attaches a
|
|
3326
|
+
* short-lived download link to every proof on the KYC record, so no
|
|
3327
|
+
* separate endpoint is needed. Proofs without a link are omitted.
|
|
3328
|
+
*
|
|
3329
|
+
* @param kycId - KYC record ID
|
|
3330
|
+
* @returns Array of proof download URLs
|
|
3296
3331
|
*
|
|
3297
3332
|
* @example
|
|
3298
3333
|
* ```typescript
|
|
3299
3334
|
* const proofs = await client.getProofDownloadURLs("550e8400-e29b-41d4-a716-446655440000");
|
|
3300
3335
|
* proofs.forEach(proof => {
|
|
3301
|
-
* console.log(`${proof.type}: ${proof.url}
|
|
3336
|
+
* console.log(`${proof.type}: ${proof.url}`);
|
|
3302
3337
|
* });
|
|
3303
3338
|
* ```
|
|
3304
3339
|
*/
|
|
3305
3340
|
async getProofDownloadURLs(kycId) {
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
{ headers: this.getUserHeaders() }
|
|
3309
|
-
);
|
|
3341
|
+
const kyc = await this.getKycRequest(kycId);
|
|
3342
|
+
return (kyc.proofs ?? []).filter((proof) => typeof proof.link === "string" && proof.link !== "").map((proof) => ({ id: proof.id, type: proof.type, url: proof.link }));
|
|
3310
3343
|
}
|
|
3311
3344
|
// ============================================================================
|
|
3312
3345
|
// KYC Overview & Statistics
|
|
@@ -3327,6 +3360,10 @@ var KycClient = class extends BaseClient {
|
|
|
3327
3360
|
* console.log(`Total: ${overview.total}, Pending: ${overview.pending}`);
|
|
3328
3361
|
* console.log(`Approved: ${overview.approved}, Rejected: ${overview.rejected}`);
|
|
3329
3362
|
* ```
|
|
3363
|
+
*
|
|
3364
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3365
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3366
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3330
3367
|
*/
|
|
3331
3368
|
async getOverview(fromDate, toDate) {
|
|
3332
3369
|
const params = {};
|
|
@@ -3344,6 +3381,10 @@ var KycClient = class extends BaseClient {
|
|
|
3344
3381
|
*
|
|
3345
3382
|
* @param alertId - Alert ID
|
|
3346
3383
|
* @returns Alert details
|
|
3384
|
+
*
|
|
3385
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3386
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3387
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3347
3388
|
*/
|
|
3348
3389
|
async getAlert(alertId) {
|
|
3349
3390
|
return this.request(`/api/v1/kyc/alerts/${alertId}`);
|
|
@@ -3367,6 +3408,10 @@ var KycClient = class extends BaseClient {
|
|
|
3367
3408
|
* );
|
|
3368
3409
|
* console.log(`Found ${alerts.total} alerts`);
|
|
3369
3410
|
* ```
|
|
3411
|
+
*
|
|
3412
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3413
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3414
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3370
3415
|
*/
|
|
3371
3416
|
async listAlerts(filters, pagination) {
|
|
3372
3417
|
const params = {};
|
|
@@ -3413,6 +3458,10 @@ var KycClient = class extends BaseClient {
|
|
|
3413
3458
|
* reason: "Requires senior review - suspicious documents"
|
|
3414
3459
|
* });
|
|
3415
3460
|
* ```
|
|
3461
|
+
*
|
|
3462
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3463
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3464
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3416
3465
|
*/
|
|
3417
3466
|
async updateAlert(alertId, update) {
|
|
3418
3467
|
await this.request(`/api/v1/kyc/alerts/${alertId}`, {
|
|
@@ -3435,6 +3484,10 @@ var KycClient = class extends BaseClient {
|
|
|
3435
3484
|
* console.log(`Face verification required: ${prefs.is_face_verification_required}`);
|
|
3436
3485
|
* console.log(`Required documents: ${prefs.required_document_count}`);
|
|
3437
3486
|
* ```
|
|
3487
|
+
*
|
|
3488
|
+
* @remarks Console session only. This endpoint accepts a Vesant console
|
|
3489
|
+
* (dashboard login) token, not a tenant API key; called with an API key it
|
|
3490
|
+
* fails with `AuthenticationError` or a permission error.
|
|
3438
3491
|
*/
|
|
3439
3492
|
async getPreferences() {
|
|
3440
3493
|
return this.request("/api/v1/kyc/preferences");
|
|
@@ -3608,6 +3661,9 @@ var KYC_DECLINED_DESCRIPTIONS = {
|
|
|
3608
3661
|
function isKycDocumentExpiredCallbackEvent(value) {
|
|
3609
3662
|
return typeof value === "object" && value !== null && value.event === "kyc_document_expired";
|
|
3610
3663
|
}
|
|
3664
|
+
function isProfileChangeCallbackEvent(value) {
|
|
3665
|
+
return typeof value === "object" && value !== null && value.event === "profile_change";
|
|
3666
|
+
}
|
|
3611
3667
|
|
|
3612
3668
|
// src/tax/client.ts
|
|
3613
3669
|
var TaxClient = class extends BaseClient {
|
|
@@ -3940,6 +3996,8 @@ exports.gpsIntegrityInputFromPosition = gpsIntegrityInputFromPosition;
|
|
|
3940
3996
|
exports.isAmlBlockCallbackEvent = isAmlBlockCallbackEvent;
|
|
3941
3997
|
exports.isCipherTextExpired = isCipherTextExpired;
|
|
3942
3998
|
exports.isKycDocumentExpiredCallbackEvent = isKycDocumentExpiredCallbackEvent;
|
|
3999
|
+
exports.isProfileChangeCallbackEvent = isProfileChangeCallbackEvent;
|
|
4000
|
+
exports.isProfileUpdateHeld = isProfileUpdateHeld;
|
|
3943
4001
|
exports.noopLogger = noopLogger;
|
|
3944
4002
|
exports.paginate = paginate;
|
|
3945
4003
|
exports.probeGeolocationPermission = probeGeolocationPermission;
|