vesant-sdk 1.7.2 → 1.8.0-dev.153299b
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/{client-B3DCAHlg.d.ts → client-4oLoc31v.d.ts} +2 -2
- package/dist/{client-fy3trF2K.d.ts → client-BaUekQT8.d.ts} +32 -10
- package/dist/{client-D23KhWeh.d.mts → client-CJI8VO1i.d.mts} +2 -2
- package/dist/{client-BwXMQA2a.d.mts → client-XDEhh9VN.d.mts} +32 -10
- package/dist/compliance/index.d.mts +3 -3
- package/dist/compliance/index.d.ts +3 -3
- package/dist/compliance/index.js +59 -5
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +59 -5
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.js +1 -1
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +1 -1
- 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 +40 -2
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +40 -2
- 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 +70 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +68 -6
- 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 +5 -1
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +5 -2
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +103 -4
- package/dist/kyc/index.d.ts +103 -4
- package/dist/kyc/index.js +5 -1
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +5 -2
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +17 -4
- package/dist/react.d.ts +17 -4
- package/dist/react.js +23 -11
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +23 -11
- 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 +19 -3
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +19 -4
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.js +1 -1
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +1 -1
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.js +1 -1
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +1 -1
- package/dist/tax/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/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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as RiskLevel, T as Timestamp, U as UUID } from './types-CBQRNL-l.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Pluggable dedup store for webhook replay protection.
|
|
@@ -189,6 +189,61 @@ type WebhookEventHandler<T extends WebhookEventType = WebhookEventType> = (event
|
|
|
189
189
|
event_type: T;
|
|
190
190
|
}>) => void | Promise<void>;
|
|
191
191
|
type WebhookAnyHandler = (event: WebhookEvent) => void | Promise<void>;
|
|
192
|
+
/** Watchlist category an AML screening matched. */
|
|
193
|
+
type AmlCallbackCategory = 'sanction' | 'pep' | 'adverse_media' | 'fraud' | 'terrorism' | 'narcotics' | 'financial_crime' | 'warning' | 'fitness_probity' | 'previous_client' | 'unknown' | (string & Record<string, never>);
|
|
194
|
+
interface AmlBlockCallbackData {
|
|
195
|
+
/** Your customer identifier — the one the screening ran against. */
|
|
196
|
+
customer_id: string;
|
|
197
|
+
/** Screened full name. Omitted when the screening had no full name. */
|
|
198
|
+
customer_name?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Derived from the number of matches against your tenant's risk thresholds —
|
|
201
|
+
* not from the category. A sanction match is not automatically `high`.
|
|
202
|
+
*/
|
|
203
|
+
risk_level: RiskLevel;
|
|
204
|
+
/** The category that matched. `previous_client` is a match on your internal watchlist only. */
|
|
205
|
+
category: AmlCallbackCategory;
|
|
206
|
+
/** Total matches, including internal watchlist matches. */
|
|
207
|
+
hits_count: number;
|
|
208
|
+
/** Name of the AML alert rule that decided the block. */
|
|
209
|
+
applied_rule?: string;
|
|
210
|
+
/** ISO 8601 UTC time the screening ran. */
|
|
211
|
+
screened_at?: Timestamp;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Body POSTed to the webhook URL in your AML screening settings when a
|
|
215
|
+
* screening matches a watchlist and the governing alert rule carries the
|
|
216
|
+
* `block` reaction. Signed with `X-Webhook-Signature: sha256=<hex>`
|
|
217
|
+
* (HMAC-SHA256 of the raw body).
|
|
218
|
+
*
|
|
219
|
+
* Sent only for blocks — nothing is delivered for a clear screening or for a
|
|
220
|
+
* rule that only alerts. Screenings that run without a request from you (after
|
|
221
|
+
* an accepted KYC, or after a name or date-of-birth change) are reported only
|
|
222
|
+
* through this webhook.
|
|
223
|
+
*/
|
|
224
|
+
interface AmlBlockCallbackEvent {
|
|
225
|
+
/** Always `"aml"` — dispatch on this. */
|
|
226
|
+
event: 'aml';
|
|
227
|
+
/** The screening reference you supplied, or a generated identifier for automatic screenings. */
|
|
228
|
+
reference: string;
|
|
229
|
+
/** The screening record ID — unique per screening, so dedup on it. */
|
|
230
|
+
resource_id: string;
|
|
231
|
+
/** Always `"blocked"`. */
|
|
232
|
+
status: 'blocked';
|
|
233
|
+
/** Always `true`. */
|
|
234
|
+
block: true;
|
|
235
|
+
/**
|
|
236
|
+
* Human-readable reason for display and audit. Wording is not stable — branch
|
|
237
|
+
* on `data.category` and `data.risk_level` instead.
|
|
238
|
+
*/
|
|
239
|
+
block_reason: string;
|
|
240
|
+
data: AmlBlockCallbackData;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Type guard for the AML block webhook. Narrows an already signature-verified,
|
|
244
|
+
* parsed payload to {@link AmlBlockCallbackEvent}.
|
|
245
|
+
*/
|
|
246
|
+
declare function isAmlBlockCallbackEvent(value: unknown): value is AmlBlockCallbackEvent;
|
|
192
247
|
|
|
193
248
|
/**
|
|
194
249
|
* Webhook event handler with signature verification and typed dispatch.
|
|
@@ -261,4 +316,4 @@ declare function createWebhookMiddleware(options: WebhookMiddlewareOptions): (re
|
|
|
261
316
|
*/
|
|
262
317
|
declare function createNextWebhookHandler(options: WebhookMiddlewareOptions): (request: Request) => Promise<Response>;
|
|
263
318
|
|
|
264
|
-
export { type BaseWebhookEvent as B, type ComplianceCheckFailedPayload as C, type DecisionRecordedPayload as D, type GeolocationBlockedPayload as G, InMemoryDedupStore as I, type KycStatusChangedPayload as K, type LabelAppliedPayload as L, type NotificationWebhookEvent as N, type ProfileCreatedPayload as P, type RiskCategoryChangedPayload as R, type TaxReminderSentPayload as T, type VerifyWebhookSignatureOptions as V, type WebhookAnyHandler as W, type
|
|
319
|
+
export { type AmlBlockCallbackData as A, type BaseWebhookEvent as B, type ComplianceCheckFailedPayload as C, type DecisionRecordedPayload as D, type GeolocationBlockedPayload as G, InMemoryDedupStore as I, type KycStatusChangedPayload as K, type LabelAppliedPayload as L, type NotificationWebhookEvent as N, type ProfileCreatedPayload as P, type RiskCategoryChangedPayload as R, type TaxReminderSentPayload as T, type VerifyWebhookSignatureOptions as V, type WebhookAnyHandler as W, type AmlBlockCallbackEvent as a, type AmlCallbackCategory as b, type GeolocationVerifiedPayload as c, type InMemoryDedupStoreOptions as d, type LocationRequestCompletedPayload as e, type ProfileUpdatedPayload as f, type RiskScoreChangedPayload as g, type WebhookDedupStore as h, type WebhookEvent as i, type WebhookEventHandler as j, type WebhookEventType as k, WebhookHandler as l, type WebhookHandlerConfig as m, type WebhookMiddlewareOptions as n, type WebhookNotification as o, createNextWebhookHandler as p, createWebhookMiddleware as q, isAmlBlockCallbackEvent as r, verifyWebhookSignature as v };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as RiskLevel, T as Timestamp, U as UUID } from './types-CBQRNL-l.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Pluggable dedup store for webhook replay protection.
|
|
@@ -189,6 +189,61 @@ type WebhookEventHandler<T extends WebhookEventType = WebhookEventType> = (event
|
|
|
189
189
|
event_type: T;
|
|
190
190
|
}>) => void | Promise<void>;
|
|
191
191
|
type WebhookAnyHandler = (event: WebhookEvent) => void | Promise<void>;
|
|
192
|
+
/** Watchlist category an AML screening matched. */
|
|
193
|
+
type AmlCallbackCategory = 'sanction' | 'pep' | 'adverse_media' | 'fraud' | 'terrorism' | 'narcotics' | 'financial_crime' | 'warning' | 'fitness_probity' | 'previous_client' | 'unknown' | (string & Record<string, never>);
|
|
194
|
+
interface AmlBlockCallbackData {
|
|
195
|
+
/** Your customer identifier — the one the screening ran against. */
|
|
196
|
+
customer_id: string;
|
|
197
|
+
/** Screened full name. Omitted when the screening had no full name. */
|
|
198
|
+
customer_name?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Derived from the number of matches against your tenant's risk thresholds —
|
|
201
|
+
* not from the category. A sanction match is not automatically `high`.
|
|
202
|
+
*/
|
|
203
|
+
risk_level: RiskLevel;
|
|
204
|
+
/** The category that matched. `previous_client` is a match on your internal watchlist only. */
|
|
205
|
+
category: AmlCallbackCategory;
|
|
206
|
+
/** Total matches, including internal watchlist matches. */
|
|
207
|
+
hits_count: number;
|
|
208
|
+
/** Name of the AML alert rule that decided the block. */
|
|
209
|
+
applied_rule?: string;
|
|
210
|
+
/** ISO 8601 UTC time the screening ran. */
|
|
211
|
+
screened_at?: Timestamp;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Body POSTed to the webhook URL in your AML screening settings when a
|
|
215
|
+
* screening matches a watchlist and the governing alert rule carries the
|
|
216
|
+
* `block` reaction. Signed with `X-Webhook-Signature: sha256=<hex>`
|
|
217
|
+
* (HMAC-SHA256 of the raw body).
|
|
218
|
+
*
|
|
219
|
+
* Sent only for blocks — nothing is delivered for a clear screening or for a
|
|
220
|
+
* rule that only alerts. Screenings that run without a request from you (after
|
|
221
|
+
* an accepted KYC, or after a name or date-of-birth change) are reported only
|
|
222
|
+
* through this webhook.
|
|
223
|
+
*/
|
|
224
|
+
interface AmlBlockCallbackEvent {
|
|
225
|
+
/** Always `"aml"` — dispatch on this. */
|
|
226
|
+
event: 'aml';
|
|
227
|
+
/** The screening reference you supplied, or a generated identifier for automatic screenings. */
|
|
228
|
+
reference: string;
|
|
229
|
+
/** The screening record ID — unique per screening, so dedup on it. */
|
|
230
|
+
resource_id: string;
|
|
231
|
+
/** Always `"blocked"`. */
|
|
232
|
+
status: 'blocked';
|
|
233
|
+
/** Always `true`. */
|
|
234
|
+
block: true;
|
|
235
|
+
/**
|
|
236
|
+
* Human-readable reason for display and audit. Wording is not stable — branch
|
|
237
|
+
* on `data.category` and `data.risk_level` instead.
|
|
238
|
+
*/
|
|
239
|
+
block_reason: string;
|
|
240
|
+
data: AmlBlockCallbackData;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Type guard for the AML block webhook. Narrows an already signature-verified,
|
|
244
|
+
* parsed payload to {@link AmlBlockCallbackEvent}.
|
|
245
|
+
*/
|
|
246
|
+
declare function isAmlBlockCallbackEvent(value: unknown): value is AmlBlockCallbackEvent;
|
|
192
247
|
|
|
193
248
|
/**
|
|
194
249
|
* Webhook event handler with signature verification and typed dispatch.
|
|
@@ -261,4 +316,4 @@ declare function createWebhookMiddleware(options: WebhookMiddlewareOptions): (re
|
|
|
261
316
|
*/
|
|
262
317
|
declare function createNextWebhookHandler(options: WebhookMiddlewareOptions): (request: Request) => Promise<Response>;
|
|
263
318
|
|
|
264
|
-
export { type BaseWebhookEvent as B, type ComplianceCheckFailedPayload as C, type DecisionRecordedPayload as D, type GeolocationBlockedPayload as G, InMemoryDedupStore as I, type KycStatusChangedPayload as K, type LabelAppliedPayload as L, type NotificationWebhookEvent as N, type ProfileCreatedPayload as P, type RiskCategoryChangedPayload as R, type TaxReminderSentPayload as T, type VerifyWebhookSignatureOptions as V, type WebhookAnyHandler as W, type
|
|
319
|
+
export { type AmlBlockCallbackData as A, type BaseWebhookEvent as B, type ComplianceCheckFailedPayload as C, type DecisionRecordedPayload as D, type GeolocationBlockedPayload as G, InMemoryDedupStore as I, type KycStatusChangedPayload as K, type LabelAppliedPayload as L, type NotificationWebhookEvent as N, type ProfileCreatedPayload as P, type RiskCategoryChangedPayload as R, type TaxReminderSentPayload as T, type VerifyWebhookSignatureOptions as V, type WebhookAnyHandler as W, type AmlBlockCallbackEvent as a, type AmlCallbackCategory as b, type GeolocationVerifiedPayload as c, type InMemoryDedupStoreOptions as d, type LocationRequestCompletedPayload as e, type ProfileUpdatedPayload as f, type RiskScoreChangedPayload as g, type WebhookDedupStore as h, type WebhookEvent as i, type WebhookEventHandler as j, type WebhookEventType as k, WebhookHandler as l, type WebhookHandlerConfig as m, type WebhookMiddlewareOptions as n, type WebhookNotification as o, createNextWebhookHandler as p, createWebhookMiddleware as q, isAmlBlockCallbackEvent as r, verifyWebhookSignature as v };
|
package/dist/index.d.mts
CHANGED
|
@@ -2,14 +2,14 @@ import { L as Logger } from './client-q9fN8Hhf.mjs';
|
|
|
2
2
|
export { A as AuthCredential, B as BaseClient, a as BaseClientConfig, C as CGSConfig, b as CircuitBreaker, c as CircuitBreakerConfig, d as CircuitBreakerState, e as CircuitBreakerStatus, f as RateLimitStatus, g as RateLimitTracker, h as RefreshingTokenProvider, i as RefreshingTokenProviderOptions, j as RequestInterceptor, R as RequestOptions, k as RequiredBaseClientConfig, l as RequiredCGSConfig, m as RequiredVesantConfig, S as StaticApiKeyProvider, T as TokenProvider, n as TokenProviderContext, V as VesantConfig } from './client-q9fN8Hhf.mjs';
|
|
3
3
|
import { a as PaginatedResponse } from './types-CBQRNL-l.mjs';
|
|
4
4
|
export { A as APIResponse, B as BlockReason, C as CustomerStatus, E as EntityType, b as ErrorResponse, L as LocationCompliance, P as PaginationParams, c as Reason, d as Result, R as RiskLevel, S as SuccessResponse, T as Timestamp, U as UUID, V as VerificationEventType } from './types-CBQRNL-l.mjs';
|
|
5
|
-
export { B as BaseWebhookEvent, C as ComplianceCheckFailedPayload, D as DecisionRecordedPayload, G as GeolocationBlockedPayload,
|
|
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-
|
|
5
|
+
export { A as AmlBlockCallbackData, a as AmlBlockCallbackEvent, b as AmlCallbackCategory, B as BaseWebhookEvent, C as ComplianceCheckFailedPayload, D as DecisionRecordedPayload, G as GeolocationBlockedPayload, c as GeolocationVerifiedPayload, I as InMemoryDedupStore, d as InMemoryDedupStoreOptions, K as KycStatusChangedPayload, L as LabelAppliedPayload, e as LocationRequestCompletedPayload, N as NotificationWebhookEvent, P as ProfileCreatedPayload, f as ProfileUpdatedPayload, R as RiskCategoryChangedPayload, g as RiskScoreChangedPayload, T as TaxReminderSentPayload, V as VerifyWebhookSignatureOptions, W as WebhookAnyHandler, h as WebhookDedupStore, i as WebhookEvent, j as WebhookEventHandler, k as WebhookEventType, l as WebhookHandler, m as WebhookHandlerConfig, n as WebhookMiddlewareOptions, o as WebhookNotification, p as createNextWebhookHandler, q as createWebhookMiddleware, r as isAmlBlockCallbackEvent, v as verifyWebhookSignature } from './index-C49a7fg2.mjs';
|
|
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
|
/**
|
|
@@ -83,6 +83,6 @@ declare const noopLogger: Logger;
|
|
|
83
83
|
/**
|
|
84
84
|
* Single source of truth for the SDK version.
|
|
85
85
|
*/
|
|
86
|
-
declare const SDK_VERSION = "1.
|
|
86
|
+
declare const SDK_VERSION = "1.8.0";
|
|
87
87
|
|
|
88
88
|
export { AuthenticationError, CGSError, CircuitBreakerOpenError, ComplianceBlockedError, ComplianceError, Logger, NetworkError, PaginatedResponse, RateLimitError, SDK_VERSION, ServiceUnavailableError, TimeoutError, ValidationError, VesantError, collectAll, createConsoleLogger, noopLogger, paginate };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ import { L as Logger } from './client-q9fN8Hhf.js';
|
|
|
2
2
|
export { A as AuthCredential, B as BaseClient, a as BaseClientConfig, C as CGSConfig, b as CircuitBreaker, c as CircuitBreakerConfig, d as CircuitBreakerState, e as CircuitBreakerStatus, f as RateLimitStatus, g as RateLimitTracker, h as RefreshingTokenProvider, i as RefreshingTokenProviderOptions, j as RequestInterceptor, R as RequestOptions, k as RequiredBaseClientConfig, l as RequiredCGSConfig, m as RequiredVesantConfig, S as StaticApiKeyProvider, T as TokenProvider, n as TokenProviderContext, V as VesantConfig } from './client-q9fN8Hhf.js';
|
|
3
3
|
import { a as PaginatedResponse } from './types-CBQRNL-l.js';
|
|
4
4
|
export { A as APIResponse, B as BlockReason, C as CustomerStatus, E as EntityType, b as ErrorResponse, L as LocationCompliance, P as PaginationParams, c as Reason, d as Result, R as RiskLevel, S as SuccessResponse, T as Timestamp, U as UUID, V as VerificationEventType } from './types-CBQRNL-l.js';
|
|
5
|
-
export { B as BaseWebhookEvent, C as ComplianceCheckFailedPayload, D as DecisionRecordedPayload, G as GeolocationBlockedPayload,
|
|
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-
|
|
5
|
+
export { A as AmlBlockCallbackData, a as AmlBlockCallbackEvent, b as AmlCallbackCategory, B as BaseWebhookEvent, C as ComplianceCheckFailedPayload, D as DecisionRecordedPayload, G as GeolocationBlockedPayload, c as GeolocationVerifiedPayload, I as InMemoryDedupStore, d as InMemoryDedupStoreOptions, K as KycStatusChangedPayload, L as LabelAppliedPayload, e as LocationRequestCompletedPayload, N as NotificationWebhookEvent, P as ProfileCreatedPayload, f as ProfileUpdatedPayload, R as RiskCategoryChangedPayload, g as RiskScoreChangedPayload, T as TaxReminderSentPayload, V as VerifyWebhookSignatureOptions, W as WebhookAnyHandler, h as WebhookDedupStore, i as WebhookEvent, j as WebhookEventHandler, k as WebhookEventType, l as WebhookHandler, m as WebhookHandlerConfig, n as WebhookMiddlewareOptions, o as WebhookNotification, p as createNextWebhookHandler, q as createWebhookMiddleware, r as isAmlBlockCallbackEvent, v as verifyWebhookSignature } from './index-BosFSGan.js';
|
|
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
|
/**
|
|
@@ -83,6 +83,6 @@ declare const noopLogger: Logger;
|
|
|
83
83
|
/**
|
|
84
84
|
* Single source of truth for the SDK version.
|
|
85
85
|
*/
|
|
86
|
-
declare const SDK_VERSION = "1.
|
|
86
|
+
declare const SDK_VERSION = "1.8.0";
|
|
87
87
|
|
|
88
88
|
export { AuthenticationError, CGSError, CircuitBreakerOpenError, ComplianceBlockedError, ComplianceError, Logger, NetworkError, PaginatedResponse, RateLimitError, SDK_VERSION, ServiceUnavailableError, TimeoutError, ValidationError, VesantError, collectAll, createConsoleLogger, noopLogger, paginate };
|
package/dist/index.js
CHANGED
|
@@ -298,7 +298,7 @@ var noopLogger = {
|
|
|
298
298
|
};
|
|
299
299
|
|
|
300
300
|
// src/core/version.ts
|
|
301
|
-
var SDK_VERSION = "1.
|
|
301
|
+
var SDK_VERSION = "1.8.0";
|
|
302
302
|
|
|
303
303
|
// src/shared/browser-utils.ts
|
|
304
304
|
function generateUUID() {
|
|
@@ -1104,6 +1104,7 @@ function isCipherTextExpired(cipherText) {
|
|
|
1104
1104
|
}
|
|
1105
1105
|
|
|
1106
1106
|
// src/geolocation/client.ts
|
|
1107
|
+
var DEFAULT_GPS_CONFIG_TTL_MS = 5 * 60 * 1e3;
|
|
1107
1108
|
var GeolocationClient = class extends BaseClient {
|
|
1108
1109
|
constructor(config) {
|
|
1109
1110
|
const baseConfig = {
|
|
@@ -1119,6 +1120,8 @@ var GeolocationClient = class extends BaseClient {
|
|
|
1119
1120
|
environment: config.environment
|
|
1120
1121
|
};
|
|
1121
1122
|
super(baseConfig);
|
|
1123
|
+
this.gpsConfigCache = null;
|
|
1124
|
+
this.gpsConfigTtlMs = config.gpsConfigTtlMs ?? DEFAULT_GPS_CONFIG_TTL_MS;
|
|
1122
1125
|
}
|
|
1123
1126
|
// ============================================================================
|
|
1124
1127
|
// IP Verification & Compliance
|
|
@@ -1204,7 +1207,42 @@ var GeolocationClient = class extends BaseClient {
|
|
|
1204
1207
|
* ```
|
|
1205
1208
|
*/
|
|
1206
1209
|
async getGPSConfig(requestOptions) {
|
|
1207
|
-
|
|
1210
|
+
const cached = this.gpsConfigCache;
|
|
1211
|
+
if (cached && cached.expiresAt > Date.now()) {
|
|
1212
|
+
return cached.value;
|
|
1213
|
+
}
|
|
1214
|
+
return this.refreshGPSConfig(requestOptions);
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Re-read the tenant's GPS requirement configuration, ignoring any copy held
|
|
1218
|
+
* from an earlier read.
|
|
1219
|
+
*
|
|
1220
|
+
* These requirements are edited in the compliance console while your
|
|
1221
|
+
* application is running. `getGPSConfig` reuses a fetched copy for a short
|
|
1222
|
+
* period so a long-lived session does not call the API on every event; call
|
|
1223
|
+
* this when you need a change to take effect immediately — for example right
|
|
1224
|
+
* after an administrator saves new settings.
|
|
1225
|
+
*
|
|
1226
|
+
* @returns The current GPS requirement config per event type
|
|
1227
|
+
*
|
|
1228
|
+
* @example
|
|
1229
|
+
* ```typescript
|
|
1230
|
+
* const config = await client.refreshGPSConfig();
|
|
1231
|
+
* if (config.require_gps.login) {
|
|
1232
|
+
* // GPS is now required for login
|
|
1233
|
+
* }
|
|
1234
|
+
* ```
|
|
1235
|
+
*/
|
|
1236
|
+
async refreshGPSConfig(requestOptions) {
|
|
1237
|
+
const value = await this.requestWithRetry(
|
|
1238
|
+
"/api/v1/geo/config",
|
|
1239
|
+
void 0,
|
|
1240
|
+
void 0,
|
|
1241
|
+
void 0,
|
|
1242
|
+
requestOptions
|
|
1243
|
+
);
|
|
1244
|
+
this.gpsConfigCache = { value, expiresAt: Date.now() + this.gpsConfigTtlMs };
|
|
1245
|
+
return value;
|
|
1208
1246
|
}
|
|
1209
1247
|
/**
|
|
1210
1248
|
* Mint a short-lived, single-use device-signals nonce.
|
|
@@ -1621,17 +1659,27 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1621
1659
|
/**
|
|
1622
1660
|
* Update customer profile
|
|
1623
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
|
+
*
|
|
1624
1669
|
* @param profileId - Profile UUID
|
|
1625
1670
|
* @param updates - Fields to update
|
|
1626
|
-
* @returns Updated customer profile
|
|
1671
|
+
* @returns Updated customer profile, or the held change
|
|
1627
1672
|
*
|
|
1628
1673
|
* @example
|
|
1629
1674
|
* ```typescript
|
|
1630
|
-
* const
|
|
1675
|
+
* const result = await client.updateProfile(profileId, {
|
|
1631
1676
|
* location: 'New York, USA',
|
|
1632
1677
|
* location_compliance: 'compliant',
|
|
1633
1678
|
* last_recorded_activity: new Date().toISOString()
|
|
1634
1679
|
* });
|
|
1680
|
+
* if (isProfileUpdateHeld(result)) {
|
|
1681
|
+
* // name / DOB / address held: start KYC with trigger_event 'profile_change'
|
|
1682
|
+
* }
|
|
1635
1683
|
* ```
|
|
1636
1684
|
*/
|
|
1637
1685
|
async updateProfile(profileId, updates, requestOptions) {
|
|
@@ -1671,6 +1719,11 @@ var RiskProfileClient = class extends BaseClient {
|
|
|
1671
1719
|
}
|
|
1672
1720
|
};
|
|
1673
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
|
+
|
|
1674
1727
|
// src/compliance/block-reasons.ts
|
|
1675
1728
|
var sdkReasons = {
|
|
1676
1729
|
// Jurisdiction
|
|
@@ -2201,11 +2254,12 @@ var ComplianceClient = class {
|
|
|
2201
2254
|
if (profileResult) {
|
|
2202
2255
|
profile = profileResult;
|
|
2203
2256
|
if (!isBlocked && this.shouldUpdateProfile(profile, geoVerification.location.city)) {
|
|
2204
|
-
|
|
2257
|
+
const updated = await this.riskClient.updateProfile(profile.id, {
|
|
2205
2258
|
last_recorded_activity: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2206
2259
|
location: `${geoVerification.location.city}, ${geoVerification.location.country}`,
|
|
2207
2260
|
location_compliance: geoVerification.is_compliant ? "compliant" : "non-compliant"
|
|
2208
2261
|
}, requestOptions);
|
|
2262
|
+
profile = isProfileUpdateHeld(updated) ? updated.profile : updated;
|
|
2209
2263
|
}
|
|
2210
2264
|
} else {
|
|
2211
2265
|
if (this.config.autoCreateProfiles && this.config.debug) {
|
|
@@ -3570,6 +3624,9 @@ var KYC_DECLINED_DESCRIPTIONS = {
|
|
|
3570
3624
|
function isKycDocumentExpiredCallbackEvent(value) {
|
|
3571
3625
|
return typeof value === "object" && value !== null && value.event === "kyc_document_expired";
|
|
3572
3626
|
}
|
|
3627
|
+
function isProfileChangeCallbackEvent(value) {
|
|
3628
|
+
return typeof value === "object" && value !== null && value.event === "profile_change";
|
|
3629
|
+
}
|
|
3573
3630
|
|
|
3574
3631
|
// src/tax/client.ts
|
|
3575
3632
|
var TaxClient = class extends BaseClient {
|
|
@@ -3859,6 +3916,11 @@ function buildHandler(options) {
|
|
|
3859
3916
|
return handler;
|
|
3860
3917
|
}
|
|
3861
3918
|
|
|
3919
|
+
// src/webhooks/types.ts
|
|
3920
|
+
function isAmlBlockCallbackEvent(value) {
|
|
3921
|
+
return typeof value === "object" && value !== null && value.event === "aml" && value.block === true;
|
|
3922
|
+
}
|
|
3923
|
+
|
|
3862
3924
|
exports.AuthenticationError = AuthenticationError;
|
|
3863
3925
|
exports.BaseClient = BaseClient;
|
|
3864
3926
|
exports.CGSError = CGSError;
|
|
@@ -3894,8 +3956,11 @@ exports.createWebhookMiddleware = createWebhookMiddleware;
|
|
|
3894
3956
|
exports.decodeCipherText = decodeCipherText;
|
|
3895
3957
|
exports.generateCipherText = generateCipherText;
|
|
3896
3958
|
exports.gpsIntegrityInputFromPosition = gpsIntegrityInputFromPosition;
|
|
3959
|
+
exports.isAmlBlockCallbackEvent = isAmlBlockCallbackEvent;
|
|
3897
3960
|
exports.isCipherTextExpired = isCipherTextExpired;
|
|
3898
3961
|
exports.isKycDocumentExpiredCallbackEvent = isKycDocumentExpiredCallbackEvent;
|
|
3962
|
+
exports.isProfileChangeCallbackEvent = isProfileChangeCallbackEvent;
|
|
3963
|
+
exports.isProfileUpdateHeld = isProfileUpdateHeld;
|
|
3899
3964
|
exports.noopLogger = noopLogger;
|
|
3900
3965
|
exports.paginate = paginate;
|
|
3901
3966
|
exports.probeGeolocationPermission = probeGeolocationPermission;
|