vesant-sdk 1.7.0-dev.ab7ff29 → 1.7.0-dev.b2c9ecf
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-BolQlL5e.d.mts → client-6sSaxufk.d.mts} +7 -0
- package/dist/{client-BolQlL5e.d.ts → client-6sSaxufk.d.ts} +7 -0
- package/dist/{client-DoMSYMMR.d.ts → client-B32yBt1b.d.ts} +14 -1
- package/dist/{client-DMIRx7Tu.d.mts → client-BqPVh5jH.d.mts} +14 -1
- package/dist/{client-ZNdnpWe7.d.mts → client-CHPEgasE.d.mts} +2 -2
- package/dist/{client-C3DCmGe9.d.ts → client-pKE_gii_.d.ts} +2 -2
- package/dist/compliance/index.d.mts +3 -3
- package/dist/compliance/index.d.ts +3 -3
- package/dist/compliance/index.js +19 -6
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +19 -6
- 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 +19 -3
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +19 -3
- 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 +19 -3
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +19 -3
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +54 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -21
- 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 +45 -15
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +45 -15
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +110 -13
- package/dist/kyc/index.d.ts +110 -13
- package/dist/kyc/index.js +45 -15
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +45 -15
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +5 -3
- package/dist/react.d.ts +5 -3
- package/dist/react.js +112 -73
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +112 -73
- 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 +19 -3
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +19 -3
- 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 +19 -3
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +19 -3
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.d.mts +20 -3
- package/dist/tax/index.d.ts +20 -3
- package/dist/tax/index.js +28 -6
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +28 -6
- package/dist/tax/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -196,6 +196,13 @@ declare abstract class BaseClient {
|
|
|
196
196
|
private circuitBreaker;
|
|
197
197
|
private rateLimitTracker;
|
|
198
198
|
constructor(config: BaseClientConfig);
|
|
199
|
+
/**
|
|
200
|
+
* Resolve the Idempotency-Key for a request. Mutating methods (POST/PUT/PATCH)
|
|
201
|
+
* get the caller-supplied key or a freshly minted UUID; non-mutating methods get
|
|
202
|
+
* none. requestWithRetry resolves this once and injects it so every retry reuses
|
|
203
|
+
* one key (letting the server dedup replays); a direct request() resolves per call.
|
|
204
|
+
*/
|
|
205
|
+
private resolveIdempotencyKey;
|
|
199
206
|
/**
|
|
200
207
|
* Make an HTTP request with timeout and error handling
|
|
201
208
|
*/
|
|
@@ -196,6 +196,13 @@ declare abstract class BaseClient {
|
|
|
196
196
|
private circuitBreaker;
|
|
197
197
|
private rateLimitTracker;
|
|
198
198
|
constructor(config: BaseClientConfig);
|
|
199
|
+
/**
|
|
200
|
+
* Resolve the Idempotency-Key for a request. Mutating methods (POST/PUT/PATCH)
|
|
201
|
+
* get the caller-supplied key or a freshly minted UUID; non-mutating methods get
|
|
202
|
+
* none. requestWithRetry resolves this once and injects it so every retry reuses
|
|
203
|
+
* one key (letting the server dedup replays); a direct request() resolves per call.
|
|
204
|
+
*/
|
|
205
|
+
private resolveIdempotencyKey;
|
|
199
206
|
/**
|
|
200
207
|
* Make an HTTP request with timeout and error handling
|
|
201
208
|
*/
|
|
@@ -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-6sSaxufk.js';
|
|
2
2
|
import { B as BlockReason, P as PaginationParams } from './types-CBQRNL-l.js';
|
|
3
3
|
|
|
4
4
|
interface DeviceFingerprintRequest {
|
|
@@ -212,6 +212,19 @@ interface ValidateCipherTextResponse {
|
|
|
212
212
|
geofence_evaluation?: GeofenceEvaluation;
|
|
213
213
|
record_id?: string;
|
|
214
214
|
gps_required?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* IP-derived location the GPS coordinates were cross-validated against.
|
|
217
|
+
* `location` carries the GPS-derived city when GPS was provided, so this is
|
|
218
|
+
* what explains a gps_ip_location_mismatch risk factor.
|
|
219
|
+
*/
|
|
220
|
+
ip_location?: {
|
|
221
|
+
country?: string;
|
|
222
|
+
country_iso?: string;
|
|
223
|
+
city?: string;
|
|
224
|
+
region?: string;
|
|
225
|
+
latitude: number;
|
|
226
|
+
longitude: number;
|
|
227
|
+
};
|
|
215
228
|
}
|
|
216
229
|
interface VerifyIPRequest {
|
|
217
230
|
ip_address: string;
|
|
@@ -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-6sSaxufk.mjs';
|
|
2
2
|
import { B as BlockReason, P as PaginationParams } from './types-CBQRNL-l.mjs';
|
|
3
3
|
|
|
4
4
|
interface DeviceFingerprintRequest {
|
|
@@ -212,6 +212,19 @@ interface ValidateCipherTextResponse {
|
|
|
212
212
|
geofence_evaluation?: GeofenceEvaluation;
|
|
213
213
|
record_id?: string;
|
|
214
214
|
gps_required?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* IP-derived location the GPS coordinates were cross-validated against.
|
|
217
|
+
* `location` carries the GPS-derived city when GPS was provided, so this is
|
|
218
|
+
* what explains a gps_ip_location_mismatch risk factor.
|
|
219
|
+
*/
|
|
220
|
+
ip_location?: {
|
|
221
|
+
country?: string;
|
|
222
|
+
country_iso?: string;
|
|
223
|
+
city?: string;
|
|
224
|
+
region?: string;
|
|
225
|
+
latitude: number;
|
|
226
|
+
longitude: number;
|
|
227
|
+
};
|
|
215
228
|
}
|
|
216
229
|
interface VerifyIPRequest {
|
|
217
230
|
ip_address: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
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-BqPVh5jH.mjs';
|
|
2
2
|
import { RiskProfileClient } from './risk-profile/index.mjs';
|
|
3
|
-
import { V as VesantConfig, R as RequestOptions } from './client-
|
|
3
|
+
import { V as VesantConfig, R as RequestOptions } from './client-6sSaxufk.mjs';
|
|
4
4
|
import { C as CustomerProfile } from './types-BOFaMQxI.mjs';
|
|
5
5
|
import { E as EntityType, B as BlockReason, P as PaginationParams } from './types-CBQRNL-l.mjs';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
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-B32yBt1b.js';
|
|
2
2
|
import { RiskProfileClient } from './risk-profile/index.js';
|
|
3
|
-
import { V as VesantConfig, R as RequestOptions } from './client-
|
|
3
|
+
import { V as VesantConfig, R as RequestOptions } from './client-6sSaxufk.js';
|
|
4
4
|
import { C as CustomerProfile } from './types-UGyDl1fd.js';
|
|
5
5
|
import { E as EntityType, B as BlockReason, P as PaginationParams } from './types-CBQRNL-l.js';
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
3
|
-
export { p as CreateLocationRequestRequest, H as LocationCaptureRequest, I as LocationCaptureResponse, a as LocationRequest, K as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, M as LocationRequestResult, N as LocationRequestStatus, O as LocationShareInfo, R as ResendLocationRequestRequest } 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-CHPEgasE.mjs';
|
|
3
|
+
export { p as CreateLocationRequestRequest, H as LocationCaptureRequest, I as LocationCaptureResponse, a as LocationRequest, K as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, M as LocationRequestResult, N as LocationRequestStatus, O as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-BqPVh5jH.mjs';
|
|
4
4
|
import '../risk-profile/index.mjs';
|
|
5
|
-
import '../client-
|
|
5
|
+
import '../client-6sSaxufk.mjs';
|
|
6
6
|
import '../types-BOFaMQxI.mjs';
|
|
7
7
|
|
|
8
8
|
declare const sdkReasons: {
|
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
3
|
-
export { p as CreateLocationRequestRequest, H as LocationCaptureRequest, I as LocationCaptureResponse, a as LocationRequest, K as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, M as LocationRequestResult, N as LocationRequestStatus, O as LocationShareInfo, R as ResendLocationRequestRequest } 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-pKE_gii_.js';
|
|
3
|
+
export { p as CreateLocationRequestRequest, H as LocationCaptureRequest, I as LocationCaptureResponse, a as LocationRequest, K as LocationRequestChannel, b as LocationRequestFilters, c as LocationRequestListResponse, M as LocationRequestResult, N as LocationRequestStatus, O as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-B32yBt1b.js';
|
|
4
4
|
import '../risk-profile/index.js';
|
|
5
|
-
import '../client-
|
|
5
|
+
import '../client-6sSaxufk.js';
|
|
6
6
|
import '../types-UGyDl1fd.js';
|
|
7
7
|
|
|
8
8
|
declare const sdkReasons: {
|
package/dist/compliance/index.js
CHANGED
|
@@ -411,6 +411,19 @@ var BaseClient = class {
|
|
|
411
411
|
this.rateLimitTracker = new RateLimitTracker();
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
|
+
/**
|
|
415
|
+
* Resolve the Idempotency-Key for a request. Mutating methods (POST/PUT/PATCH)
|
|
416
|
+
* get the caller-supplied key or a freshly minted UUID; non-mutating methods get
|
|
417
|
+
* none. requestWithRetry resolves this once and injects it so every retry reuses
|
|
418
|
+
* one key (letting the server dedup replays); a direct request() resolves per call.
|
|
419
|
+
*/
|
|
420
|
+
resolveIdempotencyKey(method, requestOptions) {
|
|
421
|
+
const isMutating = ["POST", "PUT", "PATCH"].includes((method || "GET").toUpperCase());
|
|
422
|
+
if (!isMutating) {
|
|
423
|
+
return void 0;
|
|
424
|
+
}
|
|
425
|
+
return requestOptions?.idempotencyKey ?? generateUUID();
|
|
426
|
+
}
|
|
414
427
|
/**
|
|
415
428
|
* Make an HTTP request with timeout and error handling
|
|
416
429
|
*/
|
|
@@ -443,8 +456,9 @@ var BaseClient = class {
|
|
|
443
456
|
headers["X-Sandbox"] = "true";
|
|
444
457
|
}
|
|
445
458
|
const method = (options.method || "GET").toUpperCase();
|
|
446
|
-
|
|
447
|
-
|
|
459
|
+
const idempotencyKey = this.resolveIdempotencyKey(method, requestOptions);
|
|
460
|
+
if (idempotencyKey) {
|
|
461
|
+
headers["Idempotency-Key"] = idempotencyKey;
|
|
448
462
|
}
|
|
449
463
|
const controller = new AbortController();
|
|
450
464
|
const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);
|
|
@@ -557,9 +571,11 @@ var BaseClient = class {
|
|
|
557
571
|
*/
|
|
558
572
|
async requestWithRetry(endpoint, options = {}, serviceURL, retries = this.config.retries, requestOptions) {
|
|
559
573
|
let lastError;
|
|
574
|
+
const idempotencyKey = this.resolveIdempotencyKey(options.method || "GET", requestOptions);
|
|
575
|
+
const attemptOptions = idempotencyKey ? { ...requestOptions, idempotencyKey } : requestOptions;
|
|
560
576
|
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
561
577
|
try {
|
|
562
|
-
return await this.request(endpoint, options, serviceURL,
|
|
578
|
+
return await this.request(endpoint, options, serviceURL, attemptOptions);
|
|
563
579
|
} catch (error) {
|
|
564
580
|
lastError = error instanceof Error ? error : new Error("Unknown error");
|
|
565
581
|
if (requestOptions?.signal?.aborted) {
|
|
@@ -1714,9 +1730,6 @@ var ComplianceClient = class {
|
|
|
1714
1730
|
if (cipherTextResult.risk?.is_blocked) {
|
|
1715
1731
|
blockReasons.push(...cipherTextResult.risk.block_reasons_structured ?? []);
|
|
1716
1732
|
}
|
|
1717
|
-
if (cipherTextResult.risk?.location_mismatch) {
|
|
1718
|
-
blockReasons.push(sdkReasons.gpsIPMismatch());
|
|
1719
|
-
}
|
|
1720
1733
|
}
|
|
1721
1734
|
if (geoVerification.gps_required && !cipherTextResult) {
|
|
1722
1735
|
blockReasons.push(sdkReasons.gpsRequired());
|