vesant-sdk 1.6.0 → 1.6.1
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-C4g596fI.d.mts → client-DW1Xiz6a.d.mts} +2 -2
- package/dist/{client-Bd9a5o0C.d.ts → client-eLbtPRkh.d.ts} +2 -2
- package/dist/{client-CIon-bGS.d.mts → client-ePzhQKp9.d.mts} +2 -0
- package/dist/{client-CIon-bGS.d.ts → client-ePzhQKp9.d.ts} +2 -0
- package/dist/compliance/index.d.mts +5 -5
- package/dist/compliance/index.d.ts +5 -5
- package/dist/compliance/index.js +25 -7
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +25 -7
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.d.mts +1 -1
- package/dist/decisions/index.d.ts +1 -1
- package/dist/decisions/index.js +14 -1
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +14 -1
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +3 -3
- package/dist/geolocation/index.d.ts +3 -3
- package/dist/geolocation/index.js +14 -1
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +14 -1
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +6 -376
- package/dist/index.d.ts +6 -376
- package/dist/index.js +92 -216
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +92 -216
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +1 -1
- package/dist/kyc/core.d.ts +1 -1
- package/dist/kyc/core.js +14 -1
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +14 -1
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +1 -1
- package/dist/kyc/index.d.ts +1 -1
- package/dist/kyc/index.js +14 -1
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +14 -1
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +1 -1
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +1 -1
- package/dist/risk-profile/index.d.ts +1 -1
- package/dist/risk-profile/index.js +14 -1
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +14 -1
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.d.mts +1 -1
- package/dist/scores/index.d.ts +1 -1
- package/dist/scores/index.js +14 -1
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +14 -1
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.d.mts +256 -0
- package/dist/tax/index.d.ts +256 -0
- package/dist/tax/index.js +652 -0
- package/dist/tax/index.js.map +1 -0
- package/dist/tax/index.mjs +650 -0
- package/dist/tax/index.mjs.map +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-
|
|
1
|
+
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-ePzhQKp9.mjs';
|
|
2
2
|
import { P as PaginationParams } from './types-B4Ezqo7V.mjs';
|
|
3
3
|
|
|
4
4
|
interface DeviceFingerprintRequest {
|
|
@@ -1010,4 +1010,4 @@ declare class GeolocationClient extends BaseClient {
|
|
|
1010
1010
|
generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
|
-
export { type
|
|
1013
|
+
export { type UseLocationRequestsOptions as $, type AlertStatus as A, type APIError as B, type CipherTextPayload as C, type DeviceFingerprintRequest as D, type GeolocationConfigResponse as E, type GeolocationClientConfig as F, GeolocationClient as G, type UseGeolocationOptions as H, type UseGeolocationResult as I, type JurisdictionConfig as J, type UseAlertsOptions as K, type LocationVerification as L, type UseAlertsResult as M, type LocationRequestStatus as N, type LocationRequestChannel as O, type LocationRequest as P, type CreateLocationRequestRequest as Q, type LocationRequestResult as R, type LocationRequestFilters as S, type LocationRequestListResponse as T, type UpdateJurisdictionRequest as U, type ValidateCipherTextRequest as V, type ResendLocationRequestRequest as W, type WiFiNetwork as X, type LocationCaptureRequest as Y, type LocationShareInfo as Z, type LocationCaptureResponse as _, type CipherTextReason as a, type UseLocationRequestsResult as a0, type UseLocationCaptureOptions as a1, type UseLocationCaptureResult as a2, type CipherTextOptions as b, type CipherTextResult as c, type DecryptedCipherText as d, type CipherTextCustomerData as e, type ValidateCipherTextResponse as f, type VerifyIPRequest as g, type GeoIPResult as h, type GeofenceEvaluation as i, type DeviceFingerprint as j, type DeviceTrustResult as k, type ComplianceCheckResponse as l, type AlertSeverity as m, type AlertType as n, type GeolocationAlert as o, type AlertFilters as p, type AlertListResponse as q, type DashboardMetrics as r, type CreateJurisdictionRequest as s, type GeofenceRuleType as t, type GeofenceAction as u, type GeofenceRule as v, type CreateGeofenceRuleRequest as w, type UpdateGeofenceRuleRequest as x, type UpdateDeviceTrustRequest as y, type GeolocationRecord as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-
|
|
1
|
+
import { L as Logger, B as BaseClient, R as RequestOptions } from './client-ePzhQKp9.js';
|
|
2
2
|
import { P as PaginationParams } from './types-B4Ezqo7V.js';
|
|
3
3
|
|
|
4
4
|
interface DeviceFingerprintRequest {
|
|
@@ -1010,4 +1010,4 @@ declare class GeolocationClient extends BaseClient {
|
|
|
1010
1010
|
generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
|
-
export { type
|
|
1013
|
+
export { type UseLocationRequestsOptions as $, type AlertStatus as A, type APIError as B, type CipherTextPayload as C, type DeviceFingerprintRequest as D, type GeolocationConfigResponse as E, type GeolocationClientConfig as F, GeolocationClient as G, type UseGeolocationOptions as H, type UseGeolocationResult as I, type JurisdictionConfig as J, type UseAlertsOptions as K, type LocationVerification as L, type UseAlertsResult as M, type LocationRequestStatus as N, type LocationRequestChannel as O, type LocationRequest as P, type CreateLocationRequestRequest as Q, type LocationRequestResult as R, type LocationRequestFilters as S, type LocationRequestListResponse as T, type UpdateJurisdictionRequest as U, type ValidateCipherTextRequest as V, type ResendLocationRequestRequest as W, type WiFiNetwork as X, type LocationCaptureRequest as Y, type LocationShareInfo as Z, type LocationCaptureResponse as _, type CipherTextReason as a, type UseLocationRequestsResult as a0, type UseLocationCaptureOptions as a1, type UseLocationCaptureResult as a2, type CipherTextOptions as b, type CipherTextResult as c, type DecryptedCipherText as d, type CipherTextCustomerData as e, type ValidateCipherTextResponse as f, type VerifyIPRequest as g, type GeoIPResult as h, type GeofenceEvaluation as i, type DeviceFingerprint as j, type DeviceTrustResult as k, type ComplianceCheckResponse as l, type AlertSeverity as m, type AlertType as n, type GeolocationAlert as o, type AlertFilters as p, type AlertListResponse as q, type DashboardMetrics as r, type CreateJurisdictionRequest as s, type GeofenceRuleType as t, type GeofenceAction as u, type GeofenceRule as v, type CreateGeofenceRuleRequest as w, type UpdateGeofenceRuleRequest as x, type UpdateDeviceTrustRequest as y, type GeolocationRecord as z };
|
|
@@ -64,6 +64,8 @@ interface RequestOptions {
|
|
|
64
64
|
signal?: AbortSignal;
|
|
65
65
|
/** Idempotency key for POST/PUT/PATCH requests */
|
|
66
66
|
idempotencyKey?: string;
|
|
67
|
+
/** Response type — defaults to 'json'. Use 'arraybuffer' for binary downloads (PDF, etc.) */
|
|
68
|
+
responseType?: 'json' | 'arraybuffer';
|
|
67
69
|
}
|
|
68
70
|
interface RequestInterceptor {
|
|
69
71
|
/** Called before each request. Can modify headers or options. */
|
|
@@ -64,6 +64,8 @@ interface RequestOptions {
|
|
|
64
64
|
signal?: AbortSignal;
|
|
65
65
|
/** Idempotency key for POST/PUT/PATCH requests */
|
|
66
66
|
idempotencyKey?: string;
|
|
67
|
+
/** Response type — defaults to 'json'. Use 'arraybuffer' for binary downloads (PDF, etc.) */
|
|
68
|
+
responseType?: 'json' | 'arraybuffer';
|
|
67
69
|
}
|
|
68
70
|
interface RequestInterceptor {
|
|
69
71
|
/** Called before each request. Can modify headers or options. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as DeviceFingerprintRequest, L as LocationVerification,
|
|
2
|
-
export {
|
|
1
|
+
import { D as DeviceFingerprintRequest, L as LocationVerification, f as ValidateCipherTextResponse, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-DW1Xiz6a.mjs';
|
|
2
|
+
export { Q as CreateLocationRequestRequest, Y as LocationCaptureRequest, _ as LocationCaptureResponse, O as LocationRequestChannel, R as LocationRequestResult, N as LocationRequestStatus, Z as LocationShareInfo, W as ResendLocationRequestRequest } from '../client-DW1Xiz6a.mjs';
|
|
3
3
|
import { RiskProfileClient } from '../risk-profile/index.mjs';
|
|
4
|
-
import { V as VesantConfig, R as RequestOptions } from '../client-
|
|
4
|
+
import { V as VesantConfig, R as RequestOptions } from '../client-ePzhQKp9.mjs';
|
|
5
5
|
import { C as CustomerProfile } from '../types-1RzYeSal.mjs';
|
|
6
6
|
import { E as EntityType, P as PaginationParams } from '../types-B4Ezqo7V.mjs';
|
|
7
7
|
|
|
@@ -38,7 +38,7 @@ interface LoginVerificationRequest {
|
|
|
38
38
|
interface LoginVerificationResponse {
|
|
39
39
|
allowed: boolean;
|
|
40
40
|
geolocation: LocationVerification;
|
|
41
|
-
profile: CustomerProfile;
|
|
41
|
+
profile: CustomerProfile | null;
|
|
42
42
|
requiresStepUp: boolean;
|
|
43
43
|
blockReasons: string[];
|
|
44
44
|
processingTime: number;
|
|
@@ -57,7 +57,7 @@ interface TransactionVerificationRequest {
|
|
|
57
57
|
interface TransactionVerificationResponse {
|
|
58
58
|
allowed: boolean;
|
|
59
59
|
geolocation: LocationVerification;
|
|
60
|
-
profile: CustomerProfile;
|
|
60
|
+
profile: CustomerProfile | null;
|
|
61
61
|
transactionRisk: TransactionRiskResult;
|
|
62
62
|
requiresApproval: boolean;
|
|
63
63
|
blockReasons: string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as DeviceFingerprintRequest, L as LocationVerification,
|
|
2
|
-
export {
|
|
1
|
+
import { D as DeviceFingerprintRequest, L as LocationVerification, f as ValidateCipherTextResponse, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-eLbtPRkh.js';
|
|
2
|
+
export { Q as CreateLocationRequestRequest, Y as LocationCaptureRequest, _ as LocationCaptureResponse, O as LocationRequestChannel, R as LocationRequestResult, N as LocationRequestStatus, Z as LocationShareInfo, W as ResendLocationRequestRequest } from '../client-eLbtPRkh.js';
|
|
3
3
|
import { RiskProfileClient } from '../risk-profile/index.js';
|
|
4
|
-
import { V as VesantConfig, R as RequestOptions } from '../client-
|
|
4
|
+
import { V as VesantConfig, R as RequestOptions } from '../client-ePzhQKp9.js';
|
|
5
5
|
import { C as CustomerProfile } from '../types-X5Md_dD_.js';
|
|
6
6
|
import { E as EntityType, P as PaginationParams } from '../types-B4Ezqo7V.js';
|
|
7
7
|
|
|
@@ -38,7 +38,7 @@ interface LoginVerificationRequest {
|
|
|
38
38
|
interface LoginVerificationResponse {
|
|
39
39
|
allowed: boolean;
|
|
40
40
|
geolocation: LocationVerification;
|
|
41
|
-
profile: CustomerProfile;
|
|
41
|
+
profile: CustomerProfile | null;
|
|
42
42
|
requiresStepUp: boolean;
|
|
43
43
|
blockReasons: string[];
|
|
44
44
|
processingTime: number;
|
|
@@ -57,7 +57,7 @@ interface TransactionVerificationRequest {
|
|
|
57
57
|
interface TransactionVerificationResponse {
|
|
58
58
|
allowed: boolean;
|
|
59
59
|
geolocation: LocationVerification;
|
|
60
|
-
profile: CustomerProfile;
|
|
60
|
+
profile: CustomerProfile | null;
|
|
61
61
|
transactionRisk: TransactionRiskResult;
|
|
62
62
|
requiresApproval: boolean;
|
|
63
63
|
blockReasons: string[];
|
package/dist/compliance/index.js
CHANGED
|
@@ -224,7 +224,7 @@ function createConsoleLogger() {
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
// src/core/version.ts
|
|
227
|
-
var SDK_VERSION = "1.6.
|
|
227
|
+
var SDK_VERSION = "1.6.1";
|
|
228
228
|
|
|
229
229
|
// src/shared/browser-utils.ts
|
|
230
230
|
function generateUUID() {
|
|
@@ -398,6 +398,19 @@ var BaseClient = class {
|
|
|
398
398
|
if (this.rateLimitTracker) {
|
|
399
399
|
this.rateLimitTracker.updateFromHeaders(response.headers);
|
|
400
400
|
}
|
|
401
|
+
if (requestOptions?.responseType === "arraybuffer") {
|
|
402
|
+
if (!response.ok) {
|
|
403
|
+
let errData = {};
|
|
404
|
+
try {
|
|
405
|
+
errData = await response.json();
|
|
406
|
+
} catch {
|
|
407
|
+
}
|
|
408
|
+
this.handleErrorResponse(response.status, errData, requestId);
|
|
409
|
+
}
|
|
410
|
+
this.circuitBreaker?.onSuccess();
|
|
411
|
+
const buffer = await response.arrayBuffer();
|
|
412
|
+
return buffer;
|
|
413
|
+
}
|
|
401
414
|
let data;
|
|
402
415
|
try {
|
|
403
416
|
data = await response.json();
|
|
@@ -1739,7 +1752,7 @@ var ComplianceClient = class {
|
|
|
1739
1752
|
}, requestOptions),
|
|
1740
1753
|
this.riskClient.getProfile(request.customerId, requestOptions).catch(() => null)
|
|
1741
1754
|
]);
|
|
1742
|
-
const loginBlockReasons = this.getBlockReasons(geoVerification, profileResult
|
|
1755
|
+
const loginBlockReasons = this.getBlockReasons(geoVerification, profileResult, cipherTextResult);
|
|
1743
1756
|
const isBlocked = !geoVerification.is_compliant || geoVerification.is_blocked || !!cipherTextResult?.risk?.is_blocked || cipherTextResult?.valid === false || geoVerification.gps_required && !cipherTextResult;
|
|
1744
1757
|
if (isBlocked && !profileResult) {
|
|
1745
1758
|
return {
|
|
@@ -1858,6 +1871,9 @@ var ComplianceClient = class {
|
|
|
1858
1871
|
cipherTextValidation: cipherTextResult
|
|
1859
1872
|
};
|
|
1860
1873
|
}
|
|
1874
|
+
if (!profileResult) {
|
|
1875
|
+
throw new ComplianceError("Customer profile not found", request.customerId);
|
|
1876
|
+
}
|
|
1861
1877
|
const profile = profileResult;
|
|
1862
1878
|
const transactionRisk = this.calculateTransactionRisk(
|
|
1863
1879
|
request.amount,
|
|
@@ -2070,11 +2086,13 @@ var ComplianceClient = class {
|
|
|
2070
2086
|
if (geoVerification.is_blocked) {
|
|
2071
2087
|
reasons.push(...geoVerification.risk_reasons);
|
|
2072
2088
|
}
|
|
2073
|
-
if (profile
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2089
|
+
if (profile) {
|
|
2090
|
+
if (profile.customer_status === "suspended") {
|
|
2091
|
+
reasons.push("account_suspended");
|
|
2092
|
+
}
|
|
2093
|
+
if (profile.has_sanctions) {
|
|
2094
|
+
reasons.push("sanctions_match");
|
|
2095
|
+
}
|
|
2078
2096
|
}
|
|
2079
2097
|
if (cipherTextResult) {
|
|
2080
2098
|
if (!cipherTextResult.valid) {
|