vesant-sdk 1.6.5 → 1.6.6-next.ac58d2b
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 +10 -0
- package/dist/{client-ePzhQKp9.d.mts → client-BolQlL5e.d.mts} +1 -1
- package/dist/{client-ePzhQKp9.d.ts → client-BolQlL5e.d.ts} +1 -1
- package/dist/{client-BlCxjbY2.d.mts → client-D6PE3pcB.d.mts} +2 -2
- package/dist/{client-C_A7QLcB.d.ts → client-DPtiuQvW.d.ts} +2 -2
- package/dist/compliance/index.d.mts +4 -4
- package/dist/compliance/index.d.ts +4 -4
- package/dist/compliance/index.js +10 -25
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +10 -25
- 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 +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 +3 -3
- package/dist/geolocation/index.d.ts +3 -3
- package/dist/geolocation/index.js +6 -24
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +6 -24
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +9 -68
- package/dist/index.d.ts +9 -68
- package/dist/index.js +49 -204
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -203
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +3 -3
- package/dist/kyc/core.d.ts +3 -3
- package/dist/kyc/core.js +10 -13
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +10 -13
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +15 -26
- package/dist/kyc/index.d.ts +15 -26
- package/dist/kyc/index.js +10 -13
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +10 -13
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +5 -5
- package/dist/react.d.ts +5 -5
- package/dist/react.js +18 -5
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +18 -5
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +3 -3
- package/dist/risk-profile/index.d.ts +3 -3
- package/dist/risk-profile/index.js +1 -1
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +1 -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 +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.d.mts +6 -41
- package/dist/tax/index.d.ts +6 -41
- package/dist/tax/index.js +1 -36
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +1 -36
- package/dist/tax/index.mjs.map +1 -1
- package/dist/{types-1RzYeSal.d.mts → types-DGDVnogO.d.mts} +1 -1
- package/dist/{types-X5Md_dD_.d.ts → types-_YQdS3Ax.d.ts} +1 -1
- package/dist/webhooks/index.d.mts +181 -2
- package/dist/webhooks/index.d.ts +181 -2
- package/dist/webhooks/index.js +49 -7
- package/dist/webhooks/index.js.map +1 -1
- package/dist/webhooks/index.mjs +49 -7
- package/dist/webhooks/index.mjs.map +1 -1
- package/package.json +16 -13
- package/dist/fraud/index.d.mts +0 -80
- package/dist/fraud/index.d.ts +0 -80
- package/dist/fraud/index.js +0 -606
- package/dist/fraud/index.js.map +0 -1
- package/dist/fraud/index.mjs +0 -604
- package/dist/fraud/index.mjs.map +0 -1
- package/dist/index-B04H4xfJ.d.mts +0 -320
- package/dist/index-CItMPmLL.d.ts +0 -320
package/README.md
CHANGED
|
@@ -27,6 +27,16 @@ yarn add vesant-sdk
|
|
|
27
27
|
pnpm add vesant-sdk
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
### Fraud scoring
|
|
31
|
+
|
|
32
|
+
Fraud event scoring uses a separate package (not a `vesant-sdk` subpath export):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install @vesant-sdk/fraud
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
See [Fraud integration guide](./docs/guides/fraud-integration.md).
|
|
39
|
+
|
|
30
40
|
## Quick Start
|
|
31
41
|
|
|
32
42
|
### Initialize the SDK
|
|
@@ -237,4 +237,4 @@ declare abstract class BaseClient {
|
|
|
237
237
|
}>;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
export { BaseClient as B, type
|
|
240
|
+
export { BaseClient as B, type CGSConfig as C, type Logger as L, type RequestOptions as R, type VesantConfig as V, type BaseClientConfig as a, CircuitBreaker as b, type CircuitBreakerConfig as c, type CircuitBreakerState as d, type CircuitBreakerStatus as e, type RateLimitStatus as f, RateLimitTracker as g, type RequestInterceptor as h, type RequiredBaseClientConfig as i, type RequiredCGSConfig as j, type RequiredVesantConfig as k };
|
|
@@ -237,4 +237,4 @@ declare abstract class BaseClient {
|
|
|
237
237
|
}>;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
export { BaseClient as B, type
|
|
240
|
+
export { BaseClient as B, type CGSConfig as C, type Logger as L, type RequestOptions as R, type VesantConfig as V, type BaseClientConfig as a, CircuitBreaker as b, type CircuitBreakerConfig as c, type CircuitBreakerState as d, type CircuitBreakerStatus as e, type RateLimitStatus as f, RateLimitTracker as g, type RequestInterceptor as h, type RequiredBaseClientConfig as i, type RequiredCGSConfig as j, type RequiredVesantConfig as k };
|
|
@@ -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-BolQlL5e.mjs';
|
|
2
2
|
import { P as PaginationParams } from './types-B4Ezqo7V.mjs';
|
|
3
3
|
|
|
4
4
|
interface DeviceFingerprintRequest {
|
|
@@ -1016,4 +1016,4 @@ declare class GeolocationClient extends BaseClient {
|
|
|
1016
1016
|
generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
|
|
1017
1017
|
}
|
|
1018
1018
|
|
|
1019
|
-
export { type
|
|
1019
|
+
export { type ValidateCipherTextRequest as $, type APIError as A, type LocationCaptureResponse as B, type CipherTextCustomerData as C, type DashboardMetrics as D, type LocationRequest as E, type LocationRequestChannel as F, type GeoIPResult as G, type LocationRequestFilters as H, type LocationRequestListResponse as I, type JurisdictionConfig as J, type LocationRequestResult as K, type LocationCaptureRequest as L, type LocationRequestStatus as M, type LocationShareInfo as N, type LocationVerification as O, type UpdateGeofenceRuleRequest as P, type UpdateJurisdictionRequest as Q, type ResendLocationRequestRequest as R, type UseAlertsOptions as S, type UseAlertsResult as T, type UpdateDeviceTrustRequest as U, type UseGeolocationOptions as V, type UseGeolocationResult as W, type UseLocationCaptureOptions as X, type UseLocationCaptureResult as Y, type UseLocationRequestsOptions as Z, type UseLocationRequestsResult as _, type AlertFilters as a, type ValidateCipherTextResponse as a0, type VerifyIPRequest as a1, type WiFiNetwork as a2, type AlertListResponse as b, type AlertSeverity as c, type AlertStatus as d, type AlertType as e, type CipherTextOptions as f, type CipherTextPayload as g, type CipherTextReason as h, type CipherTextResult as i, type ComplianceCheckResponse as j, type CreateGeofenceRuleRequest as k, type CreateJurisdictionRequest as l, type CreateLocationRequestRequest as m, type DecryptedCipherText as n, type DeviceFingerprint as o, type DeviceFingerprintRequest as p, type DeviceTrustResult as q, type GeofenceAction as r, type GeofenceEvaluation as s, type GeofenceRule as t, type GeofenceRuleType as u, type GeolocationAlert as v, GeolocationClient as w, type GeolocationClientConfig as x, type GeolocationConfigResponse 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-BolQlL5e.js';
|
|
2
2
|
import { P as PaginationParams } from './types-B4Ezqo7V.js';
|
|
3
3
|
|
|
4
4
|
interface DeviceFingerprintRequest {
|
|
@@ -1016,4 +1016,4 @@ declare class GeolocationClient extends BaseClient {
|
|
|
1016
1016
|
generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
|
|
1017
1017
|
}
|
|
1018
1018
|
|
|
1019
|
-
export { type
|
|
1019
|
+
export { type ValidateCipherTextRequest as $, type APIError as A, type LocationCaptureResponse as B, type CipherTextCustomerData as C, type DashboardMetrics as D, type LocationRequest as E, type LocationRequestChannel as F, type GeoIPResult as G, type LocationRequestFilters as H, type LocationRequestListResponse as I, type JurisdictionConfig as J, type LocationRequestResult as K, type LocationCaptureRequest as L, type LocationRequestStatus as M, type LocationShareInfo as N, type LocationVerification as O, type UpdateGeofenceRuleRequest as P, type UpdateJurisdictionRequest as Q, type ResendLocationRequestRequest as R, type UseAlertsOptions as S, type UseAlertsResult as T, type UpdateDeviceTrustRequest as U, type UseGeolocationOptions as V, type UseGeolocationResult as W, type UseLocationCaptureOptions as X, type UseLocationCaptureResult as Y, type UseLocationRequestsOptions as Z, type UseLocationRequestsResult as _, type AlertFilters as a, type ValidateCipherTextResponse as a0, type VerifyIPRequest as a1, type WiFiNetwork as a2, type AlertListResponse as b, type AlertSeverity as c, type AlertStatus as d, type AlertType as e, type CipherTextOptions as f, type CipherTextPayload as g, type CipherTextReason as h, type CipherTextResult as i, type ComplianceCheckResponse as j, type CreateGeofenceRuleRequest as k, type CreateJurisdictionRequest as l, type CreateLocationRequestRequest as m, type DecryptedCipherText as n, type DeviceFingerprint as o, type DeviceFingerprintRequest as p, type DeviceTrustResult as q, type GeofenceAction as r, type GeofenceEvaluation as s, type GeofenceRule as t, type GeofenceRuleType as u, type GeolocationAlert as v, GeolocationClient as w, type GeolocationClientConfig as x, type GeolocationConfigResponse as y, type GeolocationRecord as z };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { p as DeviceFingerprintRequest, O as LocationVerification, a0 as ValidateCipherTextResponse, E as LocationRequest, w as GeolocationClient, H as LocationRequestFilters, I as LocationRequestListResponse } from '../client-D6PE3pcB.mjs';
|
|
2
|
+
export { m as CreateLocationRequestRequest, L as LocationCaptureRequest, B as LocationCaptureResponse, F as LocationRequestChannel, K as LocationRequestResult, M as LocationRequestStatus, N as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-D6PE3pcB.mjs';
|
|
3
3
|
import { RiskProfileClient } from '../risk-profile/index.mjs';
|
|
4
|
-
import { V as VesantConfig, R as RequestOptions } from '../client-
|
|
5
|
-
import {
|
|
4
|
+
import { V as VesantConfig, R as RequestOptions } from '../client-BolQlL5e.mjs';
|
|
5
|
+
import { a as CustomerProfile } from '../types-DGDVnogO.mjs';
|
|
6
6
|
import { E as EntityType, P as PaginationParams } from '../types-B4Ezqo7V.mjs';
|
|
7
7
|
|
|
8
8
|
interface RegistrationVerificationRequest {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { p as DeviceFingerprintRequest, O as LocationVerification, a0 as ValidateCipherTextResponse, E as LocationRequest, w as GeolocationClient, H as LocationRequestFilters, I as LocationRequestListResponse } from '../client-DPtiuQvW.js';
|
|
2
|
+
export { m as CreateLocationRequestRequest, L as LocationCaptureRequest, B as LocationCaptureResponse, F as LocationRequestChannel, K as LocationRequestResult, M as LocationRequestStatus, N as LocationShareInfo, R as ResendLocationRequestRequest } from '../client-DPtiuQvW.js';
|
|
3
3
|
import { RiskProfileClient } from '../risk-profile/index.js';
|
|
4
|
-
import { V as VesantConfig, R as RequestOptions } from '../client-
|
|
5
|
-
import {
|
|
4
|
+
import { V as VesantConfig, R as RequestOptions } from '../client-BolQlL5e.js';
|
|
5
|
+
import { a as CustomerProfile } from '../types-_YQdS3Ax.js';
|
|
6
6
|
import { E as EntityType, P as PaginationParams } from '../types-B4Ezqo7V.js';
|
|
7
7
|
|
|
8
8
|
interface RegistrationVerificationRequest {
|
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.6";
|
|
228
228
|
|
|
229
229
|
// src/shared/browser-utils.ts
|
|
230
230
|
function generateUUID() {
|
|
@@ -727,7 +727,7 @@ function encodePayload(payload) {
|
|
|
727
727
|
} else if (typeof Buffer !== "undefined") {
|
|
728
728
|
return Buffer.from(json, "utf-8").toString("base64");
|
|
729
729
|
}
|
|
730
|
-
throw new
|
|
730
|
+
throw new VesantError("No base64 encoding method available", "BASE64_UNAVAILABLE");
|
|
731
731
|
}
|
|
732
732
|
async function generateCipherText(options, config) {
|
|
733
733
|
const warnings = [];
|
|
@@ -752,8 +752,9 @@ async function generateCipherText(options, config) {
|
|
|
752
752
|
if (location) {
|
|
753
753
|
locationData = location;
|
|
754
754
|
} else if (gpsRequiredByConfig) {
|
|
755
|
-
throw new
|
|
756
|
-
`GPS location is required for ${options.reason} by tenant configuration, but GPS was not available or permission was denied
|
|
755
|
+
throw new VesantError(
|
|
756
|
+
`GPS location is required for ${options.reason} by tenant configuration, but GPS was not available or permission was denied`,
|
|
757
|
+
"GPS_REQUIRED"
|
|
757
758
|
);
|
|
758
759
|
} else {
|
|
759
760
|
warnings.push("GPS location not available or permission denied");
|
|
@@ -847,10 +848,9 @@ var GeolocationClient = class extends BaseClient {
|
|
|
847
848
|
if (!request.ip_address?.trim()) {
|
|
848
849
|
throw new ValidationError("ip_address is required and must be a non-empty string", ["ip_address"]);
|
|
849
850
|
}
|
|
850
|
-
const enrichedRequest = request.device_fingerprint ? request : { ...request, device_fingerprint: collectDeviceFingerprint() };
|
|
851
851
|
return this.requestWithRetry("/api/v1/geo/verify", {
|
|
852
852
|
method: "POST",
|
|
853
|
-
body: JSON.stringify(
|
|
853
|
+
body: JSON.stringify(request)
|
|
854
854
|
}, void 0, void 0, requestOptions);
|
|
855
855
|
}
|
|
856
856
|
/**
|
|
@@ -1254,24 +1254,6 @@ var GeolocationClient = class extends BaseClient {
|
|
|
1254
1254
|
// Utility Methods (inherited from BaseClient: healthCheck, updateConfig, getConfig, buildQueryString)
|
|
1255
1255
|
// ============================================================================
|
|
1256
1256
|
};
|
|
1257
|
-
function collectDeviceFingerprint() {
|
|
1258
|
-
const deviceId = generateDeviceId();
|
|
1259
|
-
const browserInfo = getBrowserInfo();
|
|
1260
|
-
const userAgent = typeof navigator !== "undefined" ? navigator.userAgent : "server";
|
|
1261
|
-
const platform = typeof navigator !== "undefined" ? navigator.platform || "unknown" : "server";
|
|
1262
|
-
return {
|
|
1263
|
-
device_id: deviceId,
|
|
1264
|
-
user_agent: userAgent,
|
|
1265
|
-
platform,
|
|
1266
|
-
browser: browserInfo.browser,
|
|
1267
|
-
browser_version: browserInfo.browser_version,
|
|
1268
|
-
os: browserInfo.os,
|
|
1269
|
-
os_version: browserInfo.os_version,
|
|
1270
|
-
screen_resolution: typeof screen !== "undefined" ? `${screen.width}x${screen.height}` : void 0,
|
|
1271
|
-
language: typeof navigator !== "undefined" ? navigator.language : void 0,
|
|
1272
|
-
timezone: Intl?.DateTimeFormat?.()?.resolvedOptions?.()?.timeZone
|
|
1273
|
-
};
|
|
1274
|
-
}
|
|
1275
1257
|
|
|
1276
1258
|
// src/risk-profile/client.ts
|
|
1277
1259
|
var RiskProfileClient = class extends BaseClient {
|
|
@@ -1588,10 +1570,13 @@ var ComplianceClient = class {
|
|
|
1588
1570
|
} catch (error) {
|
|
1589
1571
|
if (this.config.debug) {
|
|
1590
1572
|
this.logger.error("Registration verification failed", {
|
|
1591
|
-
code: error instanceof
|
|
1573
|
+
code: error instanceof VesantError ? error.code : void 0,
|
|
1592
1574
|
message: error instanceof Error ? error.message : "Unknown error"
|
|
1593
1575
|
});
|
|
1594
1576
|
}
|
|
1577
|
+
if (error instanceof VesantError && error.code === "DUPLICATE_PROFILE") {
|
|
1578
|
+
throw error;
|
|
1579
|
+
}
|
|
1595
1580
|
throw new ComplianceError(
|
|
1596
1581
|
"Registration verification failed",
|
|
1597
1582
|
error instanceof Error ? error.message : void 0,
|