vesant-sdk 1.7.0-dev.6f300f7 → 1.7.0-dev.6f4bf05
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-D9JZgN3X.d.ts → client-0NOPDnT0.d.ts} +15 -25
- package/dist/{client-BG8KtVMc.d.mts → client-CvWNRwwg.d.mts} +15 -25
- package/dist/{client-CRZea-eJ.d.mts → client-Dps40EtF.d.mts} +1 -1
- package/dist/{client-749WqhDT.d.ts → client-SMxqod4j.d.ts} +1 -1
- package/dist/compliance/index.d.mts +2 -2
- package/dist/compliance/index.d.ts +2 -2
- package/dist/compliance/index.js +71 -12
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +71 -12
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/decisions/index.js +6 -0
- package/dist/decisions/index.js.map +1 -1
- package/dist/decisions/index.mjs +6 -0
- package/dist/decisions/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +58 -3
- package/dist/geolocation/index.d.ts +58 -3
- package/dist/geolocation/index.js +74 -12
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +72 -13
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index-CPOrMRaH.d.ts +264 -0
- package/dist/index-CimDmgZb.d.mts +264 -0
- package/dist/index.d.mts +23 -6
- package/dist/index.d.ts +23 -6
- package/dist/index.js +186 -33
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +181 -34
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.js +6 -0
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +6 -0
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.js +6 -0
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +6 -0
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +6 -2
- package/dist/react.d.ts +6 -2
- package/dist/react.js +68 -4
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +68 -4
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.js +6 -0
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +6 -0
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/scores/index.js +6 -0
- package/dist/scores/index.js.map +1 -1
- package/dist/scores/index.mjs +6 -0
- package/dist/scores/index.mjs.map +1 -1
- package/dist/tax/index.js +6 -0
- package/dist/tax/index.js.map +1 -1
- package/dist/tax/index.mjs +6 -0
- package/dist/tax/index.mjs.map +1 -1
- package/dist/webhooks/index.d.mts +2 -189
- package/dist/webhooks/index.d.ts +2 -189
- package/dist/webhooks/index.js +85 -21
- package/dist/webhooks/index.js.map +1 -1
- package/dist/webhooks/index.mjs +85 -22
- package/dist/webhooks/index.mjs.map +1 -1
- package/package.json +4 -1
|
@@ -47,6 +47,8 @@ interface CipherTextPayload {
|
|
|
47
47
|
heading?: number;
|
|
48
48
|
speed?: number;
|
|
49
49
|
timestamp: number;
|
|
50
|
+
/** Advisory client-side GPS integrity flags; the server weighs these as risk factors. */
|
|
51
|
+
integrity_flags?: string[];
|
|
50
52
|
};
|
|
51
53
|
/** Network information */
|
|
52
54
|
network?: {
|
|
@@ -227,7 +229,11 @@ interface ValidateCipherTextResponse {
|
|
|
227
229
|
};
|
|
228
230
|
}
|
|
229
231
|
interface VerifyIPRequest {
|
|
230
|
-
|
|
232
|
+
/**
|
|
233
|
+
* Optional. Omit to let the server derive the connecting IP — the SDK never
|
|
234
|
+
* asserts the client IP (spoofable, and the server extracts it authoritatively).
|
|
235
|
+
*/
|
|
236
|
+
ip_address?: string;
|
|
231
237
|
user_id: string;
|
|
232
238
|
event_type: string;
|
|
233
239
|
device_fingerprint?: DeviceFingerprintRequest;
|
|
@@ -624,16 +630,6 @@ interface ResendLocationRequestRequest {
|
|
|
624
630
|
email?: string;
|
|
625
631
|
phone?: string;
|
|
626
632
|
}
|
|
627
|
-
interface WiFiNetwork {
|
|
628
|
-
/** MAC address (BSSID) */
|
|
629
|
-
macAddress: string;
|
|
630
|
-
/** Signal strength in dBm (negative number) */
|
|
631
|
-
signalStrength?: number;
|
|
632
|
-
/** WiFi channel */
|
|
633
|
-
channel?: number;
|
|
634
|
-
/** Network name (optional) */
|
|
635
|
-
ssid?: string;
|
|
636
|
-
}
|
|
637
633
|
interface LocationCaptureRequest {
|
|
638
634
|
/** GPS latitude (if available) */
|
|
639
635
|
latitude?: number;
|
|
@@ -641,8 +637,8 @@ interface LocationCaptureRequest {
|
|
|
641
637
|
longitude?: number;
|
|
642
638
|
/** GPS accuracy in meters */
|
|
643
639
|
accuracy?: number;
|
|
644
|
-
/**
|
|
645
|
-
|
|
640
|
+
/** Advisory client-side GPS integrity flags; the server weighs these as risk factors. */
|
|
641
|
+
integrity_flags?: string[];
|
|
646
642
|
/** User agent string */
|
|
647
643
|
user_agent?: string;
|
|
648
644
|
/** Device metadata */
|
|
@@ -662,6 +658,10 @@ interface LocationShareInfo {
|
|
|
662
658
|
status: string;
|
|
663
659
|
is_expired: boolean;
|
|
664
660
|
is_completed: boolean;
|
|
661
|
+
/**
|
|
662
|
+
* Server-only hint. The web SDK cannot enumerate WiFi networks (no browser API
|
|
663
|
+
* for BSSIDs); this flag is informational and never satisfied client-side.
|
|
664
|
+
*/
|
|
665
665
|
requires_wifi: boolean;
|
|
666
666
|
}
|
|
667
667
|
interface LocationCaptureResponse {
|
|
@@ -730,8 +730,6 @@ interface UseLocationCaptureOptions {
|
|
|
730
730
|
autoFetch?: boolean;
|
|
731
731
|
/** Auto-request GPS permission on mount */
|
|
732
732
|
autoRequestGPS?: boolean;
|
|
733
|
-
/** Collect WiFi data as fallback (requires explicit permission) */
|
|
734
|
-
collectWiFi?: boolean;
|
|
735
733
|
}
|
|
736
734
|
interface UseLocationCaptureResult {
|
|
737
735
|
/** Location share info */
|
|
@@ -995,20 +993,12 @@ declare class GeolocationClient extends BaseClient {
|
|
|
995
993
|
*
|
|
996
994
|
* @example
|
|
997
995
|
* ```typescript
|
|
998
|
-
* //
|
|
996
|
+
* // GPS (the web SDK is GPS + IP only; the server handles the IP fallback)
|
|
999
997
|
* const result = await client.captureLocation(token, {
|
|
1000
998
|
* latitude: 37.7749,
|
|
1001
999
|
* longitude: -122.4194,
|
|
1002
1000
|
* accuracy: 10
|
|
1003
1001
|
* });
|
|
1004
|
-
*
|
|
1005
|
-
* // Using WiFi positioning (fallback)
|
|
1006
|
-
* const result = await client.captureLocation(token, {
|
|
1007
|
-
* wifi_networks: [
|
|
1008
|
-
* { macAddress: "00:11:22:33:44:55", signalStrength: -50 },
|
|
1009
|
-
* { macAddress: "AA:BB:CC:DD:EE:FF", signalStrength: -70 }
|
|
1010
|
-
* ]
|
|
1011
|
-
* });
|
|
1012
1002
|
* ```
|
|
1013
1003
|
*/
|
|
1014
1004
|
captureLocation(token: string, capture: LocationCaptureRequest, requestOptions?: RequestOptions): Promise<LocationCaptureResponse>;
|
|
@@ -1031,4 +1021,4 @@ declare class GeolocationClient extends BaseClient {
|
|
|
1031
1021
|
generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
|
|
1032
1022
|
}
|
|
1033
1023
|
|
|
1034
|
-
export { type UseLocationRequestsResult as $, type APIError as A, type GeolocationClientConfig as B, type CipherTextCustomerData as C, type DeviceFingerprintRequest as D, type GeolocationConfigResponse as E, type GeolocationRecord as F, GeolocationClient as G, type LocationCaptureRequest as H, type LocationCaptureResponse as I, type JurisdictionConfig as J, type LocationRequestChannel as K, type LocationVerification as L, type LocationRequestResult as M, type LocationRequestStatus as N, type LocationShareInfo 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 ValidateCipherTextResponse as V, type UseGeolocationOptions as W, type UseGeolocationResult as X, type UseLocationCaptureOptions as Y, type UseLocationCaptureResult as Z, type UseLocationRequestsOptions as _, type LocationRequest as a, type ValidateCipherTextRequest as a0, type VerifyIPRequest as a1, type
|
|
1024
|
+
export { type UseLocationRequestsResult as $, type APIError as A, type GeolocationClientConfig as B, type CipherTextCustomerData as C, type DeviceFingerprintRequest as D, type GeolocationConfigResponse as E, type GeolocationRecord as F, GeolocationClient as G, type LocationCaptureRequest as H, type LocationCaptureResponse as I, type JurisdictionConfig as J, type LocationRequestChannel as K, type LocationVerification as L, type LocationRequestResult as M, type LocationRequestStatus as N, type LocationShareInfo 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 ValidateCipherTextResponse as V, type UseGeolocationOptions as W, type UseGeolocationResult as X, type UseLocationCaptureOptions as Y, type UseLocationCaptureResult as Z, type UseLocationRequestsOptions as _, type LocationRequest as a, type ValidateCipherTextRequest as a0, type VerifyIPRequest as a1, type LocationRequestFilters as b, type LocationRequestListResponse as c, type AlertFilters as d, type AlertListResponse as e, type AlertSeverity as f, type AlertStatus as g, type AlertType as h, type CipherTextOptions as i, type CipherTextPayload as j, type CipherTextReason as k, type CipherTextResult as l, type ComplianceCheckResponse as m, type CreateGeofenceRuleRequest as n, type CreateJurisdictionRequest as o, type CreateLocationRequestRequest as p, type DashboardMetrics as q, type DecryptedCipherText as r, type DeviceFingerprint as s, type DeviceTrustResult as t, type GeoIPResult as u, type GeofenceAction as v, type GeofenceEvaluation as w, type GeofenceRule as x, type GeofenceRuleType as y, type GeolocationAlert as z };
|
|
@@ -47,6 +47,8 @@ interface CipherTextPayload {
|
|
|
47
47
|
heading?: number;
|
|
48
48
|
speed?: number;
|
|
49
49
|
timestamp: number;
|
|
50
|
+
/** Advisory client-side GPS integrity flags; the server weighs these as risk factors. */
|
|
51
|
+
integrity_flags?: string[];
|
|
50
52
|
};
|
|
51
53
|
/** Network information */
|
|
52
54
|
network?: {
|
|
@@ -227,7 +229,11 @@ interface ValidateCipherTextResponse {
|
|
|
227
229
|
};
|
|
228
230
|
}
|
|
229
231
|
interface VerifyIPRequest {
|
|
230
|
-
|
|
232
|
+
/**
|
|
233
|
+
* Optional. Omit to let the server derive the connecting IP — the SDK never
|
|
234
|
+
* asserts the client IP (spoofable, and the server extracts it authoritatively).
|
|
235
|
+
*/
|
|
236
|
+
ip_address?: string;
|
|
231
237
|
user_id: string;
|
|
232
238
|
event_type: string;
|
|
233
239
|
device_fingerprint?: DeviceFingerprintRequest;
|
|
@@ -624,16 +630,6 @@ interface ResendLocationRequestRequest {
|
|
|
624
630
|
email?: string;
|
|
625
631
|
phone?: string;
|
|
626
632
|
}
|
|
627
|
-
interface WiFiNetwork {
|
|
628
|
-
/** MAC address (BSSID) */
|
|
629
|
-
macAddress: string;
|
|
630
|
-
/** Signal strength in dBm (negative number) */
|
|
631
|
-
signalStrength?: number;
|
|
632
|
-
/** WiFi channel */
|
|
633
|
-
channel?: number;
|
|
634
|
-
/** Network name (optional) */
|
|
635
|
-
ssid?: string;
|
|
636
|
-
}
|
|
637
633
|
interface LocationCaptureRequest {
|
|
638
634
|
/** GPS latitude (if available) */
|
|
639
635
|
latitude?: number;
|
|
@@ -641,8 +637,8 @@ interface LocationCaptureRequest {
|
|
|
641
637
|
longitude?: number;
|
|
642
638
|
/** GPS accuracy in meters */
|
|
643
639
|
accuracy?: number;
|
|
644
|
-
/**
|
|
645
|
-
|
|
640
|
+
/** Advisory client-side GPS integrity flags; the server weighs these as risk factors. */
|
|
641
|
+
integrity_flags?: string[];
|
|
646
642
|
/** User agent string */
|
|
647
643
|
user_agent?: string;
|
|
648
644
|
/** Device metadata */
|
|
@@ -662,6 +658,10 @@ interface LocationShareInfo {
|
|
|
662
658
|
status: string;
|
|
663
659
|
is_expired: boolean;
|
|
664
660
|
is_completed: boolean;
|
|
661
|
+
/**
|
|
662
|
+
* Server-only hint. The web SDK cannot enumerate WiFi networks (no browser API
|
|
663
|
+
* for BSSIDs); this flag is informational and never satisfied client-side.
|
|
664
|
+
*/
|
|
665
665
|
requires_wifi: boolean;
|
|
666
666
|
}
|
|
667
667
|
interface LocationCaptureResponse {
|
|
@@ -730,8 +730,6 @@ interface UseLocationCaptureOptions {
|
|
|
730
730
|
autoFetch?: boolean;
|
|
731
731
|
/** Auto-request GPS permission on mount */
|
|
732
732
|
autoRequestGPS?: boolean;
|
|
733
|
-
/** Collect WiFi data as fallback (requires explicit permission) */
|
|
734
|
-
collectWiFi?: boolean;
|
|
735
733
|
}
|
|
736
734
|
interface UseLocationCaptureResult {
|
|
737
735
|
/** Location share info */
|
|
@@ -995,20 +993,12 @@ declare class GeolocationClient extends BaseClient {
|
|
|
995
993
|
*
|
|
996
994
|
* @example
|
|
997
995
|
* ```typescript
|
|
998
|
-
* //
|
|
996
|
+
* // GPS (the web SDK is GPS + IP only; the server handles the IP fallback)
|
|
999
997
|
* const result = await client.captureLocation(token, {
|
|
1000
998
|
* latitude: 37.7749,
|
|
1001
999
|
* longitude: -122.4194,
|
|
1002
1000
|
* accuracy: 10
|
|
1003
1001
|
* });
|
|
1004
|
-
*
|
|
1005
|
-
* // Using WiFi positioning (fallback)
|
|
1006
|
-
* const result = await client.captureLocation(token, {
|
|
1007
|
-
* wifi_networks: [
|
|
1008
|
-
* { macAddress: "00:11:22:33:44:55", signalStrength: -50 },
|
|
1009
|
-
* { macAddress: "AA:BB:CC:DD:EE:FF", signalStrength: -70 }
|
|
1010
|
-
* ]
|
|
1011
|
-
* });
|
|
1012
1002
|
* ```
|
|
1013
1003
|
*/
|
|
1014
1004
|
captureLocation(token: string, capture: LocationCaptureRequest, requestOptions?: RequestOptions): Promise<LocationCaptureResponse>;
|
|
@@ -1031,4 +1021,4 @@ declare class GeolocationClient extends BaseClient {
|
|
|
1031
1021
|
generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
|
|
1032
1022
|
}
|
|
1033
1023
|
|
|
1034
|
-
export { type UseLocationRequestsResult as $, type APIError as A, type GeolocationClientConfig as B, type CipherTextCustomerData as C, type DeviceFingerprintRequest as D, type GeolocationConfigResponse as E, type GeolocationRecord as F, GeolocationClient as G, type LocationCaptureRequest as H, type LocationCaptureResponse as I, type JurisdictionConfig as J, type LocationRequestChannel as K, type LocationVerification as L, type LocationRequestResult as M, type LocationRequestStatus as N, type LocationShareInfo 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 ValidateCipherTextResponse as V, type UseGeolocationOptions as W, type UseGeolocationResult as X, type UseLocationCaptureOptions as Y, type UseLocationCaptureResult as Z, type UseLocationRequestsOptions as _, type LocationRequest as a, type ValidateCipherTextRequest as a0, type VerifyIPRequest as a1, type
|
|
1024
|
+
export { type UseLocationRequestsResult as $, type APIError as A, type GeolocationClientConfig as B, type CipherTextCustomerData as C, type DeviceFingerprintRequest as D, type GeolocationConfigResponse as E, type GeolocationRecord as F, GeolocationClient as G, type LocationCaptureRequest as H, type LocationCaptureResponse as I, type JurisdictionConfig as J, type LocationRequestChannel as K, type LocationVerification as L, type LocationRequestResult as M, type LocationRequestStatus as N, type LocationShareInfo 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 ValidateCipherTextResponse as V, type UseGeolocationOptions as W, type UseGeolocationResult as X, type UseLocationCaptureOptions as Y, type UseLocationCaptureResult as Z, type UseLocationRequestsOptions as _, type LocationRequest as a, type ValidateCipherTextRequest as a0, type VerifyIPRequest as a1, type LocationRequestFilters as b, type LocationRequestListResponse as c, type AlertFilters as d, type AlertListResponse as e, type AlertSeverity as f, type AlertStatus as g, type AlertType as h, type CipherTextOptions as i, type CipherTextPayload as j, type CipherTextReason as k, type CipherTextResult as l, type ComplianceCheckResponse as m, type CreateGeofenceRuleRequest as n, type CreateJurisdictionRequest as o, type CreateLocationRequestRequest as p, type DashboardMetrics as q, type DecryptedCipherText as r, type DeviceFingerprint as s, type DeviceTrustResult as t, type GeoIPResult as u, type GeofenceAction as v, type GeofenceEvaluation as w, type GeofenceRule as x, type GeofenceRuleType as y, type GeolocationAlert as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
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-CvWNRwwg.mjs';
|
|
2
2
|
import { RiskProfileClient } from './risk-profile/index.mjs';
|
|
3
3
|
import { V as VesantConfig, R as RequestOptions } from './client-q9fN8Hhf.mjs';
|
|
4
4
|
import { C as CustomerProfile } from './types-BOFaMQxI.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
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-0NOPDnT0.js';
|
|
2
2
|
import { RiskProfileClient } from './risk-profile/index.js';
|
|
3
3
|
import { V as VesantConfig, R as RequestOptions } from './client-q9fN8Hhf.js';
|
|
4
4
|
import { C as CustomerProfile } from './types-UGyDl1fd.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
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-Dps40EtF.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-CvWNRwwg.mjs';
|
|
4
4
|
import '../risk-profile/index.mjs';
|
|
5
5
|
import '../client-q9fN8Hhf.mjs';
|
|
6
6
|
import '../types-BOFaMQxI.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
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-SMxqod4j.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-0NOPDnT0.js';
|
|
4
4
|
import '../risk-profile/index.js';
|
|
5
5
|
import '../client-q9fN8Hhf.js';
|
|
6
6
|
import '../types-UGyDl1fd.js';
|
package/dist/compliance/index.js
CHANGED
|
@@ -394,6 +394,12 @@ var BaseClient = class {
|
|
|
394
394
|
if (!config.tenantId?.trim()) {
|
|
395
395
|
throw new ValidationError("tenantId is required and must be a non-empty string", ["tenantId"]);
|
|
396
396
|
}
|
|
397
|
+
if (typeof fetch === "undefined") {
|
|
398
|
+
throw new VesantError(
|
|
399
|
+
"The Vesant SDK requires a global fetch (Node.js >= 18). Upgrade Node or provide a fetch polyfill.",
|
|
400
|
+
"RUNTIME_UNSUPPORTED"
|
|
401
|
+
);
|
|
402
|
+
}
|
|
397
403
|
this.interceptors = config.interceptors || [];
|
|
398
404
|
this.logger = config.logger || createConsoleLogger();
|
|
399
405
|
let environment = config.environment;
|
|
@@ -738,6 +744,61 @@ var BaseClient = class {
|
|
|
738
744
|
}
|
|
739
745
|
};
|
|
740
746
|
|
|
747
|
+
// src/geolocation/integrity.ts
|
|
748
|
+
var isNil = (v) => v === null || v === void 0;
|
|
749
|
+
function assessGpsIntegrity(input, opts = {}) {
|
|
750
|
+
const flags = [];
|
|
751
|
+
const now = opts.now ?? (() => Date.now());
|
|
752
|
+
const maxAgeMs = opts.maxAgeMs ?? 6e4;
|
|
753
|
+
const minAccuracy = opts.minAccuracyMeters ?? 1;
|
|
754
|
+
const { accuracy, altitude, altitudeAccuracy, heading, speed, timestamp } = input;
|
|
755
|
+
if (isNil(accuracy)) {
|
|
756
|
+
flags.push("accuracy_missing");
|
|
757
|
+
} else if (accuracy === 0) {
|
|
758
|
+
flags.push("accuracy_zero");
|
|
759
|
+
} else if (accuracy < minAccuracy) {
|
|
760
|
+
flags.push("accuracy_implausibly_small");
|
|
761
|
+
}
|
|
762
|
+
const hasMotion = !isNil(heading) || !isNil(speed);
|
|
763
|
+
if (hasMotion && (isNil(accuracy) || accuracy === 0)) {
|
|
764
|
+
flags.push("motion_without_accuracy");
|
|
765
|
+
}
|
|
766
|
+
if (!isNil(altitude) && isNil(altitudeAccuracy)) {
|
|
767
|
+
flags.push("altitude_without_accuracy");
|
|
768
|
+
}
|
|
769
|
+
if (timestamp !== void 0 && now() - timestamp > maxAgeMs) {
|
|
770
|
+
flags.push("stale_timestamp");
|
|
771
|
+
}
|
|
772
|
+
if (opts.permissionState === "denied" || opts.permissionState === "prompt") {
|
|
773
|
+
flags.push(`permission_${opts.permissionState}`);
|
|
774
|
+
}
|
|
775
|
+
return { suspicious: flags.length > 0, flags };
|
|
776
|
+
}
|
|
777
|
+
function gpsIntegrityInputFromPosition(position) {
|
|
778
|
+
const c = position.coords;
|
|
779
|
+
return {
|
|
780
|
+
latitude: c.latitude,
|
|
781
|
+
longitude: c.longitude,
|
|
782
|
+
accuracy: c.accuracy,
|
|
783
|
+
altitude: c.altitude,
|
|
784
|
+
altitudeAccuracy: c.altitudeAccuracy,
|
|
785
|
+
heading: c.heading,
|
|
786
|
+
speed: c.speed,
|
|
787
|
+
timestamp: position.timestamp
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
async function probeGeolocationPermission() {
|
|
791
|
+
try {
|
|
792
|
+
if (typeof navigator === "undefined" || !navigator.permissions?.query) {
|
|
793
|
+
return "unavailable";
|
|
794
|
+
}
|
|
795
|
+
const status = await navigator.permissions.query({ name: "geolocation" });
|
|
796
|
+
return status.state;
|
|
797
|
+
} catch {
|
|
798
|
+
return "unavailable";
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
|
|
741
802
|
// src/geolocation/ciphertext.ts
|
|
742
803
|
var CIPHER_TEXT_EXPIRY_MINUTES = 5;
|
|
743
804
|
async function computeHMAC(key, message) {
|
|
@@ -790,6 +851,7 @@ async function requestGPSLocation(timeout = 1e4, highAccuracy = true) {
|
|
|
790
851
|
if (typeof navigator === "undefined" || !navigator.geolocation) {
|
|
791
852
|
return null;
|
|
792
853
|
}
|
|
854
|
+
const permissionState = await probeGeolocationPermission();
|
|
793
855
|
return new Promise((resolve) => {
|
|
794
856
|
navigator.geolocation.getCurrentPosition(
|
|
795
857
|
(position) => {
|
|
@@ -806,6 +868,7 @@ async function requestGPSLocation(timeout = 1e4, highAccuracy = true) {
|
|
|
806
868
|
resolve(null);
|
|
807
869
|
return;
|
|
808
870
|
}
|
|
871
|
+
const { flags } = assessGpsIntegrity(gpsIntegrityInputFromPosition(position), { permissionState });
|
|
809
872
|
resolve({
|
|
810
873
|
latitude,
|
|
811
874
|
longitude,
|
|
@@ -814,7 +877,8 @@ async function requestGPSLocation(timeout = 1e4, highAccuracy = true) {
|
|
|
814
877
|
altitude_accuracy: position.coords.altitudeAccuracy ?? void 0,
|
|
815
878
|
heading: position.coords.heading ?? void 0,
|
|
816
879
|
speed: position.coords.speed ?? void 0,
|
|
817
|
-
timestamp: position.timestamp
|
|
880
|
+
timestamp: position.timestamp,
|
|
881
|
+
integrity_flags: flags.length ? flags : void 0
|
|
818
882
|
});
|
|
819
883
|
},
|
|
820
884
|
() => {
|
|
@@ -881,6 +945,9 @@ async function generateCipherText(options, config) {
|
|
|
881
945
|
);
|
|
882
946
|
if (location) {
|
|
883
947
|
locationData = location;
|
|
948
|
+
if (location.integrity_flags?.length) {
|
|
949
|
+
warnings.push(`GPS integrity flags (advisory): ${location.integrity_flags.join(", ")}`);
|
|
950
|
+
}
|
|
884
951
|
} else if (gpsRequiredByConfig) {
|
|
885
952
|
throw new VesantError(
|
|
886
953
|
`GPS location is required for ${options.reason} by tenant configuration, but GPS was not available or permission was denied`,
|
|
@@ -975,8 +1042,8 @@ var GeolocationClient = class extends BaseClient {
|
|
|
975
1042
|
* ```
|
|
976
1043
|
*/
|
|
977
1044
|
async verifyIP(request, requestOptions) {
|
|
978
|
-
if (!request.ip_address
|
|
979
|
-
throw new ValidationError("ip_address
|
|
1045
|
+
if (request.ip_address !== void 0 && !request.ip_address.trim()) {
|
|
1046
|
+
throw new ValidationError("ip_address, when provided, must be a non-empty string", ["ip_address"]);
|
|
980
1047
|
}
|
|
981
1048
|
return this.requestWithRetry("/api/v1/geo/verify", {
|
|
982
1049
|
method: "POST",
|
|
@@ -1326,20 +1393,12 @@ var GeolocationClient = class extends BaseClient {
|
|
|
1326
1393
|
*
|
|
1327
1394
|
* @example
|
|
1328
1395
|
* ```typescript
|
|
1329
|
-
* //
|
|
1396
|
+
* // GPS (the web SDK is GPS + IP only; the server handles the IP fallback)
|
|
1330
1397
|
* const result = await client.captureLocation(token, {
|
|
1331
1398
|
* latitude: 37.7749,
|
|
1332
1399
|
* longitude: -122.4194,
|
|
1333
1400
|
* accuracy: 10
|
|
1334
1401
|
* });
|
|
1335
|
-
*
|
|
1336
|
-
* // Using WiFi positioning (fallback)
|
|
1337
|
-
* const result = await client.captureLocation(token, {
|
|
1338
|
-
* wifi_networks: [
|
|
1339
|
-
* { macAddress: "00:11:22:33:44:55", signalStrength: -50 },
|
|
1340
|
-
* { macAddress: "AA:BB:CC:DD:EE:FF", signalStrength: -70 }
|
|
1341
|
-
* ]
|
|
1342
|
-
* });
|
|
1343
1402
|
* ```
|
|
1344
1403
|
*/
|
|
1345
1404
|
async captureLocation(token, capture, requestOptions) {
|