vesant-sdk 1.1.0 → 1.2.0
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/{types-DgNbBnEH.d.ts → client-BIfLMfuC.d.mts} +274 -2
- package/dist/{types-DGbuL8c0.d.mts → client-BWp5FI3x.d.ts} +274 -2
- package/dist/compliance/index.d.mts +9 -4
- package/dist/compliance/index.d.ts +9 -4
- package/dist/compliance/index.js +297 -2
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +297 -2
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +3 -5
- package/dist/geolocation/index.d.ts +3 -5
- package/dist/geolocation/index.js +310 -250
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +310 -250
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +5 -7
- package/dist/index.d.ts +5 -7
- package/dist/index.js +322 -251
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +322 -251
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +2 -3
- package/dist/kyc/core.d.ts +2 -3
- package/dist/kyc/core.js +1 -1
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +1 -1
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +2 -3
- package/dist/kyc/index.d.ts +2 -3
- package/dist/kyc/index.js +1 -1
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +1 -1
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +3 -5
- package/dist/react.d.ts +3 -5
- package/dist/react.js +29 -3
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +29 -3
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +4 -5
- package/dist/risk-profile/index.d.ts +4 -5
- 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/{types-DBGM-bFB.d.mts → types-BpKxSXGF.d.mts} +50 -1
- package/dist/{types-DBGM-bFB.d.ts → types-BpKxSXGF.d.ts} +50 -1
- package/dist/{types-BQTkTvNp.d.mts → types-DKCQN4C5.d.mts} +1 -1
- package/dist/{types-BF8mYH2W.d.ts → types-DfHLp_tz.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/client-B7YzKVEm.d.mts +0 -52
- package/dist/client-BaNLT2Df.d.ts +0 -52
- package/dist/client-VKJg2GGT.d.mts +0 -253
- package/dist/client-hXdrPhA4.d.ts +0 -253
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as Logger, P as PaginationParams, B as BaseClient, R as RequestOptions } from './types-BpKxSXGF.mjs';
|
|
2
2
|
|
|
3
3
|
interface DeviceFingerprintRequest {
|
|
4
4
|
device_id: string;
|
|
@@ -73,6 +73,10 @@ type CipherTextReason = 'registration' | 'login' | 'transaction' | 'interval_che
|
|
|
73
73
|
interface CipherTextOptions {
|
|
74
74
|
/** Reason for collection (required) */
|
|
75
75
|
reason: CipherTextReason;
|
|
76
|
+
/** Public signing key (pk_) for HMAC signing (produces v02 signed cipherText) */
|
|
77
|
+
signingKey?: string;
|
|
78
|
+
/** @deprecated Use signingKey instead. API key for HMAC signing (backward compat) */
|
|
79
|
+
apiKey?: string;
|
|
76
80
|
/** Request GPS location (default: false) */
|
|
77
81
|
requestLocation?: boolean;
|
|
78
82
|
/** GPS timeout in milliseconds (default: 10000) */
|
|
@@ -449,6 +453,8 @@ interface GeolocationConfigResponse {
|
|
|
449
453
|
registration: boolean;
|
|
450
454
|
transaction: boolean;
|
|
451
455
|
};
|
|
456
|
+
/** Public signing key (pk_) for client-side HMAC signing */
|
|
457
|
+
signing_key?: string;
|
|
452
458
|
}
|
|
453
459
|
interface GeolocationClientConfig {
|
|
454
460
|
/** Base URL of the API Gateway (e.g., "https://api.example.com") */
|
|
@@ -718,4 +724,270 @@ interface UseLocationCaptureResult {
|
|
|
718
724
|
captureAndSubmitGPS: () => Promise<LocationCaptureResponse>;
|
|
719
725
|
}
|
|
720
726
|
|
|
721
|
-
|
|
727
|
+
/**
|
|
728
|
+
* GeolocationClient - TypeScript SDK for CGS Geolocation & Compliance Service
|
|
729
|
+
*
|
|
730
|
+
* Provides type-safe methods to interact with the geolocation service API.
|
|
731
|
+
* Extends BaseClient for consistent retry logic, timeout handling, and error management.
|
|
732
|
+
*/
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* GeolocationClient extends BaseClient for:
|
|
736
|
+
* - Consistent retry logic with exponential backoff
|
|
737
|
+
* - Unified error handling (CGSError, NetworkError, TimeoutError, etc.)
|
|
738
|
+
* - Automatic timeout management
|
|
739
|
+
* - Debug logging
|
|
740
|
+
*
|
|
741
|
+
* All geolocation verification calls use requestWithRetry() to handle
|
|
742
|
+
* transient failures gracefully.
|
|
743
|
+
*/
|
|
744
|
+
declare class GeolocationClient extends BaseClient {
|
|
745
|
+
private cachedSigningKey?;
|
|
746
|
+
constructor(config: GeolocationClientConfig);
|
|
747
|
+
/**
|
|
748
|
+
* Verify an IP address and check compliance
|
|
749
|
+
*
|
|
750
|
+
* Uses requestWithRetry() for automatic retry on transient failures.
|
|
751
|
+
*
|
|
752
|
+
* @param request - Verification request with IP, user ID, event type, and optional device fingerprint
|
|
753
|
+
* @returns Location verification result with risk assessment
|
|
754
|
+
*
|
|
755
|
+
* @example
|
|
756
|
+
* ```typescript
|
|
757
|
+
* const result = await client.verifyIP({
|
|
758
|
+
* ip_address: "8.8.8.8",
|
|
759
|
+
* user_id: "user_123",
|
|
760
|
+
* event_type: "login",
|
|
761
|
+
* device_fingerprint: {
|
|
762
|
+
* device_id: "device_abc",
|
|
763
|
+
* user_agent: navigator.userAgent,
|
|
764
|
+
* platform: "web"
|
|
765
|
+
* }
|
|
766
|
+
* });
|
|
767
|
+
*
|
|
768
|
+
* if (result.is_blocked) {
|
|
769
|
+
* console.log("Access blocked:", result.risk_reasons);
|
|
770
|
+
* }
|
|
771
|
+
* ```
|
|
772
|
+
*/
|
|
773
|
+
verifyIP(request: VerifyIPRequest, requestOptions?: RequestOptions): Promise<LocationVerification>;
|
|
774
|
+
/**
|
|
775
|
+
* Check compliance for a specific country
|
|
776
|
+
*
|
|
777
|
+
* @param countryISO - ISO 3166-1 alpha-2 country code (e.g., "US", "GB")
|
|
778
|
+
* @returns Jurisdiction configuration and compliance status
|
|
779
|
+
*
|
|
780
|
+
* @example
|
|
781
|
+
* ```typescript
|
|
782
|
+
* const compliance = await client.checkCompliance("KP"); // North Korea
|
|
783
|
+
* if (!compliance.is_compliant) {
|
|
784
|
+
* console.log("Country is not allowed:", compliance.jurisdiction?.status);
|
|
785
|
+
* }
|
|
786
|
+
* ```
|
|
787
|
+
*/
|
|
788
|
+
checkCompliance(countryISO: string, requestOptions?: RequestOptions): Promise<ComplianceCheckResponse>;
|
|
789
|
+
/**
|
|
790
|
+
* Get the tenant's GPS requirement configuration
|
|
791
|
+
*
|
|
792
|
+
* Returns which event types require GPS location to be collected.
|
|
793
|
+
* Use this to auto-enable GPS collection in generateCipherText when required.
|
|
794
|
+
*
|
|
795
|
+
* @returns GPS requirement config per event type
|
|
796
|
+
*
|
|
797
|
+
* @example
|
|
798
|
+
* ```typescript
|
|
799
|
+
* const config = await client.getGPSConfig();
|
|
800
|
+
* if (config.require_gps.login) {
|
|
801
|
+
* // GPS is required for login — auto-enable location
|
|
802
|
+
* }
|
|
803
|
+
* ```
|
|
804
|
+
*/
|
|
805
|
+
getGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
806
|
+
/**
|
|
807
|
+
* Validate a cipherText generated by the frontend SDK
|
|
808
|
+
*
|
|
809
|
+
* The cipherText contains encrypted device fingerprint and optional location data.
|
|
810
|
+
* This method decrypts and validates the data, returning device info, location,
|
|
811
|
+
* and risk assessment.
|
|
812
|
+
*
|
|
813
|
+
* @param cipherText - The encrypted cipherText string from generateCipherText()
|
|
814
|
+
* @param userId - User ID associated with this verification
|
|
815
|
+
* @param eventType - Reason for verification (login, registration, etc.)
|
|
816
|
+
* @param expectedIP - Optional expected IP address for additional validation
|
|
817
|
+
* @param customerData - Optional customer data for risk profile creation (used when user is blocked)
|
|
818
|
+
* @returns Validation result with device info, location, and risk assessment
|
|
819
|
+
*
|
|
820
|
+
* @example
|
|
821
|
+
* ```typescript
|
|
822
|
+
* // Validate cipherText during registration with customer data
|
|
823
|
+
* const result = await client.validateCipherText(
|
|
824
|
+
* cipherText,
|
|
825
|
+
* "user_123",
|
|
826
|
+
* "registration",
|
|
827
|
+
* clientIP,
|
|
828
|
+
* {
|
|
829
|
+
* full_name: "John Doe",
|
|
830
|
+
* email: "john@example.com",
|
|
831
|
+
* country: "US",
|
|
832
|
+
* state: "CA"
|
|
833
|
+
* }
|
|
834
|
+
* );
|
|
835
|
+
*
|
|
836
|
+
* if (!result.valid) {
|
|
837
|
+
* console.log("CipherText validation failed:", result.errors);
|
|
838
|
+
* return;
|
|
839
|
+
* }
|
|
840
|
+
*
|
|
841
|
+
* if (result.risk.is_blocked) {
|
|
842
|
+
* console.log("Access blocked:", result.risk.block_reasons);
|
|
843
|
+
* // A risk profile with full customer data has been created for the alert
|
|
844
|
+
* }
|
|
845
|
+
* ```
|
|
846
|
+
*/
|
|
847
|
+
validateCipherText(cipherText: string, userId: string, eventType: CipherTextReason, expectedIP?: string, customerData?: CipherTextCustomerData, requestOptions?: RequestOptions): Promise<ValidateCipherTextResponse>;
|
|
848
|
+
/**
|
|
849
|
+
* Validate cipherText and verify IP in a single call
|
|
850
|
+
*
|
|
851
|
+
* Combines cipherText validation with IP verification for complete
|
|
852
|
+
* location and device verification in one request.
|
|
853
|
+
*
|
|
854
|
+
* @param cipherText - The encrypted cipherText string
|
|
855
|
+
* @param ipAddress - Client IP address
|
|
856
|
+
* @param userId - User ID
|
|
857
|
+
* @param eventType - Event type (login, registration, etc.)
|
|
858
|
+
* @returns Combined validation and verification result
|
|
859
|
+
*
|
|
860
|
+
* @example
|
|
861
|
+
* ```typescript
|
|
862
|
+
* const result = await client.validateAndVerify(
|
|
863
|
+
* cipherText,
|
|
864
|
+
* clientIP,
|
|
865
|
+
* "user_123",
|
|
866
|
+
* "registration"
|
|
867
|
+
* );
|
|
868
|
+
*
|
|
869
|
+
* if (!result.ciphertext_valid) {
|
|
870
|
+
* throw new Error("Device verification failed");
|
|
871
|
+
* }
|
|
872
|
+
*
|
|
873
|
+
* if (result.location.is_blocked) {
|
|
874
|
+
* throw new Error("Location not allowed");
|
|
875
|
+
* }
|
|
876
|
+
* ```
|
|
877
|
+
*/
|
|
878
|
+
validateAndVerify(cipherText: string, ipAddress: string, userId: string, eventType: CipherTextReason, requestOptions?: RequestOptions): Promise<{
|
|
879
|
+
ciphertext_valid: boolean;
|
|
880
|
+
ciphertext_result: ValidateCipherTextResponse;
|
|
881
|
+
location: LocationVerification;
|
|
882
|
+
}>;
|
|
883
|
+
/**
|
|
884
|
+
* Create a location request to get customer's live location
|
|
885
|
+
*
|
|
886
|
+
* @param request - Location request details
|
|
887
|
+
* @returns Location request result with share link
|
|
888
|
+
*
|
|
889
|
+
* @example
|
|
890
|
+
* ```typescript
|
|
891
|
+
* const result = await client.createLocationRequest({
|
|
892
|
+
* user_id: "customer_123",
|
|
893
|
+
* channel: "sms",
|
|
894
|
+
* phone: "+1234567890",
|
|
895
|
+
* reason: "Verification for high-value transaction"
|
|
896
|
+
* });
|
|
897
|
+
*
|
|
898
|
+
* console.log(`Share link sent: ${result.share_link}`);
|
|
899
|
+
* console.log(`Expires at: ${result.token_expiry}`);
|
|
900
|
+
* ```
|
|
901
|
+
*/
|
|
902
|
+
createLocationRequest(request: CreateLocationRequestRequest, requestOptions?: RequestOptions): Promise<LocationRequestResult>;
|
|
903
|
+
/**
|
|
904
|
+
* Get a location request by ID
|
|
905
|
+
*
|
|
906
|
+
* @param requestId - Location request ID
|
|
907
|
+
* @returns Location request details
|
|
908
|
+
*/
|
|
909
|
+
getLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<LocationRequest>;
|
|
910
|
+
/**
|
|
911
|
+
* List location requests with filters and pagination
|
|
912
|
+
*
|
|
913
|
+
* @param filters - Optional filters
|
|
914
|
+
* @param pagination - Optional pagination
|
|
915
|
+
* @returns Paginated list of location requests
|
|
916
|
+
*
|
|
917
|
+
* @example
|
|
918
|
+
* ```typescript
|
|
919
|
+
* const requests = await client.listLocationRequests(
|
|
920
|
+
* { status: "completed", user_id: "customer_123" },
|
|
921
|
+
* { page: 1, limit: 20 }
|
|
922
|
+
* );
|
|
923
|
+
* ```
|
|
924
|
+
*/
|
|
925
|
+
listLocationRequests(filters?: LocationRequestFilters, pagination?: PaginationParams, requestOptions?: RequestOptions): Promise<LocationRequestListResponse>;
|
|
926
|
+
/**
|
|
927
|
+
* Cancel a pending location request
|
|
928
|
+
*
|
|
929
|
+
* @param requestId - Location request ID
|
|
930
|
+
*/
|
|
931
|
+
cancelLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<void>;
|
|
932
|
+
/**
|
|
933
|
+
* Resend notification for a location request
|
|
934
|
+
*
|
|
935
|
+
* @param requestId - Location request ID
|
|
936
|
+
* @param contact - Email or phone to send to
|
|
937
|
+
*/
|
|
938
|
+
resendLocationRequest(requestId: string, contact: ResendLocationRequestRequest, requestOptions?: RequestOptions): Promise<void>;
|
|
939
|
+
/**
|
|
940
|
+
* Get location share info (customer-facing)
|
|
941
|
+
* This is called from the customer's device to get request details
|
|
942
|
+
*
|
|
943
|
+
* @param token - Secure token from share link
|
|
944
|
+
* @returns Location share info
|
|
945
|
+
*/
|
|
946
|
+
getLocationShareInfo(token: string, requestOptions?: RequestOptions): Promise<LocationShareInfo>;
|
|
947
|
+
/**
|
|
948
|
+
* Submit location capture (customer-facing)
|
|
949
|
+
* This is called from the customer's device to submit their location
|
|
950
|
+
*
|
|
951
|
+
* @param token - Secure token from share link
|
|
952
|
+
* @param capture - Location capture data (GPS or WiFi)
|
|
953
|
+
* @returns Capture response
|
|
954
|
+
*
|
|
955
|
+
* @example
|
|
956
|
+
* ```typescript
|
|
957
|
+
* // Using GPS (preferred)
|
|
958
|
+
* const result = await client.captureLocation(token, {
|
|
959
|
+
* latitude: 37.7749,
|
|
960
|
+
* longitude: -122.4194,
|
|
961
|
+
* accuracy: 10
|
|
962
|
+
* });
|
|
963
|
+
*
|
|
964
|
+
* // Using WiFi positioning (fallback)
|
|
965
|
+
* const result = await client.captureLocation(token, {
|
|
966
|
+
* wifi_networks: [
|
|
967
|
+
* { macAddress: "00:11:22:33:44:55", signalStrength: -50 },
|
|
968
|
+
* { macAddress: "AA:BB:CC:DD:EE:FF", signalStrength: -70 }
|
|
969
|
+
* ]
|
|
970
|
+
* });
|
|
971
|
+
* ```
|
|
972
|
+
*/
|
|
973
|
+
captureLocation(token: string, capture: LocationCaptureRequest, requestOptions?: RequestOptions): Promise<LocationCaptureResponse>;
|
|
974
|
+
/**
|
|
975
|
+
* Generate a signed cipherText containing device and location data.
|
|
976
|
+
*
|
|
977
|
+
* Automatically passes the client's API key for HMAC signing (v02 format).
|
|
978
|
+
* If no API key is configured, falls back to unsigned v01 format.
|
|
979
|
+
*
|
|
980
|
+
* @param options - Options for cipherText generation
|
|
981
|
+
* @param gpsConfig - Optional GPS config (from getGPSConfig)
|
|
982
|
+
* @returns CipherText result with the signed string
|
|
983
|
+
*
|
|
984
|
+
* @example
|
|
985
|
+
* ```typescript
|
|
986
|
+
* const result = await client.generateCipherText({ reason: 'login' });
|
|
987
|
+
* console.log(result.cipherText); // v02 signed cipherText
|
|
988
|
+
* ```
|
|
989
|
+
*/
|
|
990
|
+
generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
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 {
|
|
1
|
+
import { b as Logger, P as PaginationParams, B as BaseClient, R as RequestOptions } from './types-BpKxSXGF.js';
|
|
2
2
|
|
|
3
3
|
interface DeviceFingerprintRequest {
|
|
4
4
|
device_id: string;
|
|
@@ -73,6 +73,10 @@ type CipherTextReason = 'registration' | 'login' | 'transaction' | 'interval_che
|
|
|
73
73
|
interface CipherTextOptions {
|
|
74
74
|
/** Reason for collection (required) */
|
|
75
75
|
reason: CipherTextReason;
|
|
76
|
+
/** Public signing key (pk_) for HMAC signing (produces v02 signed cipherText) */
|
|
77
|
+
signingKey?: string;
|
|
78
|
+
/** @deprecated Use signingKey instead. API key for HMAC signing (backward compat) */
|
|
79
|
+
apiKey?: string;
|
|
76
80
|
/** Request GPS location (default: false) */
|
|
77
81
|
requestLocation?: boolean;
|
|
78
82
|
/** GPS timeout in milliseconds (default: 10000) */
|
|
@@ -449,6 +453,8 @@ interface GeolocationConfigResponse {
|
|
|
449
453
|
registration: boolean;
|
|
450
454
|
transaction: boolean;
|
|
451
455
|
};
|
|
456
|
+
/** Public signing key (pk_) for client-side HMAC signing */
|
|
457
|
+
signing_key?: string;
|
|
452
458
|
}
|
|
453
459
|
interface GeolocationClientConfig {
|
|
454
460
|
/** Base URL of the API Gateway (e.g., "https://api.example.com") */
|
|
@@ -718,4 +724,270 @@ interface UseLocationCaptureResult {
|
|
|
718
724
|
captureAndSubmitGPS: () => Promise<LocationCaptureResponse>;
|
|
719
725
|
}
|
|
720
726
|
|
|
721
|
-
|
|
727
|
+
/**
|
|
728
|
+
* GeolocationClient - TypeScript SDK for CGS Geolocation & Compliance Service
|
|
729
|
+
*
|
|
730
|
+
* Provides type-safe methods to interact with the geolocation service API.
|
|
731
|
+
* Extends BaseClient for consistent retry logic, timeout handling, and error management.
|
|
732
|
+
*/
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* GeolocationClient extends BaseClient for:
|
|
736
|
+
* - Consistent retry logic with exponential backoff
|
|
737
|
+
* - Unified error handling (CGSError, NetworkError, TimeoutError, etc.)
|
|
738
|
+
* - Automatic timeout management
|
|
739
|
+
* - Debug logging
|
|
740
|
+
*
|
|
741
|
+
* All geolocation verification calls use requestWithRetry() to handle
|
|
742
|
+
* transient failures gracefully.
|
|
743
|
+
*/
|
|
744
|
+
declare class GeolocationClient extends BaseClient {
|
|
745
|
+
private cachedSigningKey?;
|
|
746
|
+
constructor(config: GeolocationClientConfig);
|
|
747
|
+
/**
|
|
748
|
+
* Verify an IP address and check compliance
|
|
749
|
+
*
|
|
750
|
+
* Uses requestWithRetry() for automatic retry on transient failures.
|
|
751
|
+
*
|
|
752
|
+
* @param request - Verification request with IP, user ID, event type, and optional device fingerprint
|
|
753
|
+
* @returns Location verification result with risk assessment
|
|
754
|
+
*
|
|
755
|
+
* @example
|
|
756
|
+
* ```typescript
|
|
757
|
+
* const result = await client.verifyIP({
|
|
758
|
+
* ip_address: "8.8.8.8",
|
|
759
|
+
* user_id: "user_123",
|
|
760
|
+
* event_type: "login",
|
|
761
|
+
* device_fingerprint: {
|
|
762
|
+
* device_id: "device_abc",
|
|
763
|
+
* user_agent: navigator.userAgent,
|
|
764
|
+
* platform: "web"
|
|
765
|
+
* }
|
|
766
|
+
* });
|
|
767
|
+
*
|
|
768
|
+
* if (result.is_blocked) {
|
|
769
|
+
* console.log("Access blocked:", result.risk_reasons);
|
|
770
|
+
* }
|
|
771
|
+
* ```
|
|
772
|
+
*/
|
|
773
|
+
verifyIP(request: VerifyIPRequest, requestOptions?: RequestOptions): Promise<LocationVerification>;
|
|
774
|
+
/**
|
|
775
|
+
* Check compliance for a specific country
|
|
776
|
+
*
|
|
777
|
+
* @param countryISO - ISO 3166-1 alpha-2 country code (e.g., "US", "GB")
|
|
778
|
+
* @returns Jurisdiction configuration and compliance status
|
|
779
|
+
*
|
|
780
|
+
* @example
|
|
781
|
+
* ```typescript
|
|
782
|
+
* const compliance = await client.checkCompliance("KP"); // North Korea
|
|
783
|
+
* if (!compliance.is_compliant) {
|
|
784
|
+
* console.log("Country is not allowed:", compliance.jurisdiction?.status);
|
|
785
|
+
* }
|
|
786
|
+
* ```
|
|
787
|
+
*/
|
|
788
|
+
checkCompliance(countryISO: string, requestOptions?: RequestOptions): Promise<ComplianceCheckResponse>;
|
|
789
|
+
/**
|
|
790
|
+
* Get the tenant's GPS requirement configuration
|
|
791
|
+
*
|
|
792
|
+
* Returns which event types require GPS location to be collected.
|
|
793
|
+
* Use this to auto-enable GPS collection in generateCipherText when required.
|
|
794
|
+
*
|
|
795
|
+
* @returns GPS requirement config per event type
|
|
796
|
+
*
|
|
797
|
+
* @example
|
|
798
|
+
* ```typescript
|
|
799
|
+
* const config = await client.getGPSConfig();
|
|
800
|
+
* if (config.require_gps.login) {
|
|
801
|
+
* // GPS is required for login — auto-enable location
|
|
802
|
+
* }
|
|
803
|
+
* ```
|
|
804
|
+
*/
|
|
805
|
+
getGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
806
|
+
/**
|
|
807
|
+
* Validate a cipherText generated by the frontend SDK
|
|
808
|
+
*
|
|
809
|
+
* The cipherText contains encrypted device fingerprint and optional location data.
|
|
810
|
+
* This method decrypts and validates the data, returning device info, location,
|
|
811
|
+
* and risk assessment.
|
|
812
|
+
*
|
|
813
|
+
* @param cipherText - The encrypted cipherText string from generateCipherText()
|
|
814
|
+
* @param userId - User ID associated with this verification
|
|
815
|
+
* @param eventType - Reason for verification (login, registration, etc.)
|
|
816
|
+
* @param expectedIP - Optional expected IP address for additional validation
|
|
817
|
+
* @param customerData - Optional customer data for risk profile creation (used when user is blocked)
|
|
818
|
+
* @returns Validation result with device info, location, and risk assessment
|
|
819
|
+
*
|
|
820
|
+
* @example
|
|
821
|
+
* ```typescript
|
|
822
|
+
* // Validate cipherText during registration with customer data
|
|
823
|
+
* const result = await client.validateCipherText(
|
|
824
|
+
* cipherText,
|
|
825
|
+
* "user_123",
|
|
826
|
+
* "registration",
|
|
827
|
+
* clientIP,
|
|
828
|
+
* {
|
|
829
|
+
* full_name: "John Doe",
|
|
830
|
+
* email: "john@example.com",
|
|
831
|
+
* country: "US",
|
|
832
|
+
* state: "CA"
|
|
833
|
+
* }
|
|
834
|
+
* );
|
|
835
|
+
*
|
|
836
|
+
* if (!result.valid) {
|
|
837
|
+
* console.log("CipherText validation failed:", result.errors);
|
|
838
|
+
* return;
|
|
839
|
+
* }
|
|
840
|
+
*
|
|
841
|
+
* if (result.risk.is_blocked) {
|
|
842
|
+
* console.log("Access blocked:", result.risk.block_reasons);
|
|
843
|
+
* // A risk profile with full customer data has been created for the alert
|
|
844
|
+
* }
|
|
845
|
+
* ```
|
|
846
|
+
*/
|
|
847
|
+
validateCipherText(cipherText: string, userId: string, eventType: CipherTextReason, expectedIP?: string, customerData?: CipherTextCustomerData, requestOptions?: RequestOptions): Promise<ValidateCipherTextResponse>;
|
|
848
|
+
/**
|
|
849
|
+
* Validate cipherText and verify IP in a single call
|
|
850
|
+
*
|
|
851
|
+
* Combines cipherText validation with IP verification for complete
|
|
852
|
+
* location and device verification in one request.
|
|
853
|
+
*
|
|
854
|
+
* @param cipherText - The encrypted cipherText string
|
|
855
|
+
* @param ipAddress - Client IP address
|
|
856
|
+
* @param userId - User ID
|
|
857
|
+
* @param eventType - Event type (login, registration, etc.)
|
|
858
|
+
* @returns Combined validation and verification result
|
|
859
|
+
*
|
|
860
|
+
* @example
|
|
861
|
+
* ```typescript
|
|
862
|
+
* const result = await client.validateAndVerify(
|
|
863
|
+
* cipherText,
|
|
864
|
+
* clientIP,
|
|
865
|
+
* "user_123",
|
|
866
|
+
* "registration"
|
|
867
|
+
* );
|
|
868
|
+
*
|
|
869
|
+
* if (!result.ciphertext_valid) {
|
|
870
|
+
* throw new Error("Device verification failed");
|
|
871
|
+
* }
|
|
872
|
+
*
|
|
873
|
+
* if (result.location.is_blocked) {
|
|
874
|
+
* throw new Error("Location not allowed");
|
|
875
|
+
* }
|
|
876
|
+
* ```
|
|
877
|
+
*/
|
|
878
|
+
validateAndVerify(cipherText: string, ipAddress: string, userId: string, eventType: CipherTextReason, requestOptions?: RequestOptions): Promise<{
|
|
879
|
+
ciphertext_valid: boolean;
|
|
880
|
+
ciphertext_result: ValidateCipherTextResponse;
|
|
881
|
+
location: LocationVerification;
|
|
882
|
+
}>;
|
|
883
|
+
/**
|
|
884
|
+
* Create a location request to get customer's live location
|
|
885
|
+
*
|
|
886
|
+
* @param request - Location request details
|
|
887
|
+
* @returns Location request result with share link
|
|
888
|
+
*
|
|
889
|
+
* @example
|
|
890
|
+
* ```typescript
|
|
891
|
+
* const result = await client.createLocationRequest({
|
|
892
|
+
* user_id: "customer_123",
|
|
893
|
+
* channel: "sms",
|
|
894
|
+
* phone: "+1234567890",
|
|
895
|
+
* reason: "Verification for high-value transaction"
|
|
896
|
+
* });
|
|
897
|
+
*
|
|
898
|
+
* console.log(`Share link sent: ${result.share_link}`);
|
|
899
|
+
* console.log(`Expires at: ${result.token_expiry}`);
|
|
900
|
+
* ```
|
|
901
|
+
*/
|
|
902
|
+
createLocationRequest(request: CreateLocationRequestRequest, requestOptions?: RequestOptions): Promise<LocationRequestResult>;
|
|
903
|
+
/**
|
|
904
|
+
* Get a location request by ID
|
|
905
|
+
*
|
|
906
|
+
* @param requestId - Location request ID
|
|
907
|
+
* @returns Location request details
|
|
908
|
+
*/
|
|
909
|
+
getLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<LocationRequest>;
|
|
910
|
+
/**
|
|
911
|
+
* List location requests with filters and pagination
|
|
912
|
+
*
|
|
913
|
+
* @param filters - Optional filters
|
|
914
|
+
* @param pagination - Optional pagination
|
|
915
|
+
* @returns Paginated list of location requests
|
|
916
|
+
*
|
|
917
|
+
* @example
|
|
918
|
+
* ```typescript
|
|
919
|
+
* const requests = await client.listLocationRequests(
|
|
920
|
+
* { status: "completed", user_id: "customer_123" },
|
|
921
|
+
* { page: 1, limit: 20 }
|
|
922
|
+
* );
|
|
923
|
+
* ```
|
|
924
|
+
*/
|
|
925
|
+
listLocationRequests(filters?: LocationRequestFilters, pagination?: PaginationParams, requestOptions?: RequestOptions): Promise<LocationRequestListResponse>;
|
|
926
|
+
/**
|
|
927
|
+
* Cancel a pending location request
|
|
928
|
+
*
|
|
929
|
+
* @param requestId - Location request ID
|
|
930
|
+
*/
|
|
931
|
+
cancelLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<void>;
|
|
932
|
+
/**
|
|
933
|
+
* Resend notification for a location request
|
|
934
|
+
*
|
|
935
|
+
* @param requestId - Location request ID
|
|
936
|
+
* @param contact - Email or phone to send to
|
|
937
|
+
*/
|
|
938
|
+
resendLocationRequest(requestId: string, contact: ResendLocationRequestRequest, requestOptions?: RequestOptions): Promise<void>;
|
|
939
|
+
/**
|
|
940
|
+
* Get location share info (customer-facing)
|
|
941
|
+
* This is called from the customer's device to get request details
|
|
942
|
+
*
|
|
943
|
+
* @param token - Secure token from share link
|
|
944
|
+
* @returns Location share info
|
|
945
|
+
*/
|
|
946
|
+
getLocationShareInfo(token: string, requestOptions?: RequestOptions): Promise<LocationShareInfo>;
|
|
947
|
+
/**
|
|
948
|
+
* Submit location capture (customer-facing)
|
|
949
|
+
* This is called from the customer's device to submit their location
|
|
950
|
+
*
|
|
951
|
+
* @param token - Secure token from share link
|
|
952
|
+
* @param capture - Location capture data (GPS or WiFi)
|
|
953
|
+
* @returns Capture response
|
|
954
|
+
*
|
|
955
|
+
* @example
|
|
956
|
+
* ```typescript
|
|
957
|
+
* // Using GPS (preferred)
|
|
958
|
+
* const result = await client.captureLocation(token, {
|
|
959
|
+
* latitude: 37.7749,
|
|
960
|
+
* longitude: -122.4194,
|
|
961
|
+
* accuracy: 10
|
|
962
|
+
* });
|
|
963
|
+
*
|
|
964
|
+
* // Using WiFi positioning (fallback)
|
|
965
|
+
* const result = await client.captureLocation(token, {
|
|
966
|
+
* wifi_networks: [
|
|
967
|
+
* { macAddress: "00:11:22:33:44:55", signalStrength: -50 },
|
|
968
|
+
* { macAddress: "AA:BB:CC:DD:EE:FF", signalStrength: -70 }
|
|
969
|
+
* ]
|
|
970
|
+
* });
|
|
971
|
+
* ```
|
|
972
|
+
*/
|
|
973
|
+
captureLocation(token: string, capture: LocationCaptureRequest, requestOptions?: RequestOptions): Promise<LocationCaptureResponse>;
|
|
974
|
+
/**
|
|
975
|
+
* Generate a signed cipherText containing device and location data.
|
|
976
|
+
*
|
|
977
|
+
* Automatically passes the client's API key for HMAC signing (v02 format).
|
|
978
|
+
* If no API key is configured, falls back to unsigned v01 format.
|
|
979
|
+
*
|
|
980
|
+
* @param options - Options for cipherText generation
|
|
981
|
+
* @param gpsConfig - Optional GPS config (from getGPSConfig)
|
|
982
|
+
* @returns CipherText result with the signed string
|
|
983
|
+
*
|
|
984
|
+
* @example
|
|
985
|
+
* ```typescript
|
|
986
|
+
* const result = await client.generateCipherText({ reason: 'login' });
|
|
987
|
+
* console.log(result.cipherText); // v02 signed cipherText
|
|
988
|
+
* ```
|
|
989
|
+
*/
|
|
990
|
+
generateCipherText(options: Omit<CipherTextOptions, 'apiKey' | 'signingKey'>, gpsConfig?: GeolocationConfigResponse): Promise<CipherTextResult>;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
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,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { D as DeviceFingerprintRequest, L as LocationVerification, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-BIfLMfuC.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-BIfLMfuC.mjs';
|
|
3
|
+
import { RiskProfileClient } from '../risk-profile/index.mjs';
|
|
4
|
+
import { E as EntityType, e as CGSConfig, R as RequestOptions, P as PaginationParams } from '../types-BpKxSXGF.mjs';
|
|
5
|
+
import { C as CustomerProfile } from '../types-DKCQN4C5.mjs';
|
|
5
6
|
|
|
6
7
|
interface RegistrationVerificationRequest {
|
|
7
8
|
customerId: string;
|
|
@@ -124,6 +125,10 @@ declare class ComplianceClient {
|
|
|
124
125
|
private _currencyRatesCustomized;
|
|
125
126
|
private _currencyRatesWarned;
|
|
126
127
|
constructor(config: CGSConfig);
|
|
128
|
+
/** Get the underlying GeolocationClient for direct geolocation API access */
|
|
129
|
+
getGeolocationClient(): GeolocationClient;
|
|
130
|
+
/** Get the underlying RiskProfileClient for direct risk profile API access */
|
|
131
|
+
getRiskProfileClient(): RiskProfileClient;
|
|
127
132
|
/**
|
|
128
133
|
* Verify customer registration with automatic profile creation
|
|
129
134
|
*
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { D as DeviceFingerprintRequest, L as LocationVerification, P as LocationRequest, G as GeolocationClient, S as LocationRequestFilters, T as LocationRequestListResponse } from '../client-BWp5FI3x.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-BWp5FI3x.js';
|
|
3
|
+
import { RiskProfileClient } from '../risk-profile/index.js';
|
|
4
|
+
import { E as EntityType, e as CGSConfig, R as RequestOptions, P as PaginationParams } from '../types-BpKxSXGF.js';
|
|
5
|
+
import { C as CustomerProfile } from '../types-DfHLp_tz.js';
|
|
5
6
|
|
|
6
7
|
interface RegistrationVerificationRequest {
|
|
7
8
|
customerId: string;
|
|
@@ -124,6 +125,10 @@ declare class ComplianceClient {
|
|
|
124
125
|
private _currencyRatesCustomized;
|
|
125
126
|
private _currencyRatesWarned;
|
|
126
127
|
constructor(config: CGSConfig);
|
|
128
|
+
/** Get the underlying GeolocationClient for direct geolocation API access */
|
|
129
|
+
getGeolocationClient(): GeolocationClient;
|
|
130
|
+
/** Get the underlying RiskProfileClient for direct risk profile API access */
|
|
131
|
+
getRiskProfileClient(): RiskProfileClient;
|
|
127
132
|
/**
|
|
128
133
|
* Verify customer registration with automatic profile creation
|
|
129
134
|
*
|