vesant-sdk 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{types-DgNbBnEH.d.ts → client-BfeDYmrZ.d.mts} +250 -2
- package/dist/{types-DGbuL8c0.d.mts → client-i5QtnFIa.d.ts} +250 -2
- package/dist/compliance/index.d.mts +9 -4
- package/dist/compliance/index.d.ts +9 -4
- package/dist/compliance/index.js +11 -0
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +11 -0
- 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/index.d.mts +4 -6
- package/dist/index.d.ts +4 -6
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -0
- 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/index.d.mts +2 -3
- package/dist/kyc/index.d.ts +2 -3
- package/dist/react.d.mts +3 -5
- package/dist/react.d.ts +3 -5
- package/dist/risk-profile/index.d.mts +4 -5
- package/dist/risk-profile/index.d.ts +4 -5
- 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;
|
|
@@ -718,4 +718,252 @@ interface UseLocationCaptureResult {
|
|
|
718
718
|
captureAndSubmitGPS: () => Promise<LocationCaptureResponse>;
|
|
719
719
|
}
|
|
720
720
|
|
|
721
|
-
|
|
721
|
+
/**
|
|
722
|
+
* GeolocationClient - TypeScript SDK for CGS Geolocation & Compliance Service
|
|
723
|
+
*
|
|
724
|
+
* Provides type-safe methods to interact with the geolocation service API.
|
|
725
|
+
* Extends BaseClient for consistent retry logic, timeout handling, and error management.
|
|
726
|
+
*/
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* GeolocationClient extends BaseClient for:
|
|
730
|
+
* - Consistent retry logic with exponential backoff
|
|
731
|
+
* - Unified error handling (CGSError, NetworkError, TimeoutError, etc.)
|
|
732
|
+
* - Automatic timeout management
|
|
733
|
+
* - Debug logging
|
|
734
|
+
*
|
|
735
|
+
* All geolocation verification calls use requestWithRetry() to handle
|
|
736
|
+
* transient failures gracefully.
|
|
737
|
+
*/
|
|
738
|
+
declare class GeolocationClient extends BaseClient {
|
|
739
|
+
constructor(config: GeolocationClientConfig);
|
|
740
|
+
/**
|
|
741
|
+
* Verify an IP address and check compliance
|
|
742
|
+
*
|
|
743
|
+
* Uses requestWithRetry() for automatic retry on transient failures.
|
|
744
|
+
*
|
|
745
|
+
* @param request - Verification request with IP, user ID, event type, and optional device fingerprint
|
|
746
|
+
* @returns Location verification result with risk assessment
|
|
747
|
+
*
|
|
748
|
+
* @example
|
|
749
|
+
* ```typescript
|
|
750
|
+
* const result = await client.verifyIP({
|
|
751
|
+
* ip_address: "8.8.8.8",
|
|
752
|
+
* user_id: "user_123",
|
|
753
|
+
* event_type: "login",
|
|
754
|
+
* device_fingerprint: {
|
|
755
|
+
* device_id: "device_abc",
|
|
756
|
+
* user_agent: navigator.userAgent,
|
|
757
|
+
* platform: "web"
|
|
758
|
+
* }
|
|
759
|
+
* });
|
|
760
|
+
*
|
|
761
|
+
* if (result.is_blocked) {
|
|
762
|
+
* console.log("Access blocked:", result.risk_reasons);
|
|
763
|
+
* }
|
|
764
|
+
* ```
|
|
765
|
+
*/
|
|
766
|
+
verifyIP(request: VerifyIPRequest, requestOptions?: RequestOptions): Promise<LocationVerification>;
|
|
767
|
+
/**
|
|
768
|
+
* Check compliance for a specific country
|
|
769
|
+
*
|
|
770
|
+
* @param countryISO - ISO 3166-1 alpha-2 country code (e.g., "US", "GB")
|
|
771
|
+
* @returns Jurisdiction configuration and compliance status
|
|
772
|
+
*
|
|
773
|
+
* @example
|
|
774
|
+
* ```typescript
|
|
775
|
+
* const compliance = await client.checkCompliance("KP"); // North Korea
|
|
776
|
+
* if (!compliance.is_compliant) {
|
|
777
|
+
* console.log("Country is not allowed:", compliance.jurisdiction?.status);
|
|
778
|
+
* }
|
|
779
|
+
* ```
|
|
780
|
+
*/
|
|
781
|
+
checkCompliance(countryISO: string, requestOptions?: RequestOptions): Promise<ComplianceCheckResponse>;
|
|
782
|
+
/**
|
|
783
|
+
* Get the tenant's GPS requirement configuration
|
|
784
|
+
*
|
|
785
|
+
* Returns which event types require GPS location to be collected.
|
|
786
|
+
* Use this to auto-enable GPS collection in generateCipherText when required.
|
|
787
|
+
*
|
|
788
|
+
* @returns GPS requirement config per event type
|
|
789
|
+
*
|
|
790
|
+
* @example
|
|
791
|
+
* ```typescript
|
|
792
|
+
* const config = await client.getGPSConfig();
|
|
793
|
+
* if (config.require_gps.login) {
|
|
794
|
+
* // GPS is required for login — auto-enable location
|
|
795
|
+
* }
|
|
796
|
+
* ```
|
|
797
|
+
*/
|
|
798
|
+
getGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
799
|
+
/**
|
|
800
|
+
* Validate a cipherText generated by the frontend SDK
|
|
801
|
+
*
|
|
802
|
+
* The cipherText contains encrypted device fingerprint and optional location data.
|
|
803
|
+
* This method decrypts and validates the data, returning device info, location,
|
|
804
|
+
* and risk assessment.
|
|
805
|
+
*
|
|
806
|
+
* @param cipherText - The encrypted cipherText string from generateCipherText()
|
|
807
|
+
* @param userId - User ID associated with this verification
|
|
808
|
+
* @param eventType - Reason for verification (login, registration, etc.)
|
|
809
|
+
* @param expectedIP - Optional expected IP address for additional validation
|
|
810
|
+
* @param customerData - Optional customer data for risk profile creation (used when user is blocked)
|
|
811
|
+
* @returns Validation result with device info, location, and risk assessment
|
|
812
|
+
*
|
|
813
|
+
* @example
|
|
814
|
+
* ```typescript
|
|
815
|
+
* // Validate cipherText during registration with customer data
|
|
816
|
+
* const result = await client.validateCipherText(
|
|
817
|
+
* cipherText,
|
|
818
|
+
* "user_123",
|
|
819
|
+
* "registration",
|
|
820
|
+
* clientIP,
|
|
821
|
+
* {
|
|
822
|
+
* full_name: "John Doe",
|
|
823
|
+
* email: "john@example.com",
|
|
824
|
+
* country: "US",
|
|
825
|
+
* state: "CA"
|
|
826
|
+
* }
|
|
827
|
+
* );
|
|
828
|
+
*
|
|
829
|
+
* if (!result.valid) {
|
|
830
|
+
* console.log("CipherText validation failed:", result.errors);
|
|
831
|
+
* return;
|
|
832
|
+
* }
|
|
833
|
+
*
|
|
834
|
+
* if (result.risk.is_blocked) {
|
|
835
|
+
* console.log("Access blocked:", result.risk.block_reasons);
|
|
836
|
+
* // A risk profile with full customer data has been created for the alert
|
|
837
|
+
* }
|
|
838
|
+
* ```
|
|
839
|
+
*/
|
|
840
|
+
validateCipherText(cipherText: string, userId: string, eventType: CipherTextReason, expectedIP?: string, customerData?: CipherTextCustomerData, requestOptions?: RequestOptions): Promise<ValidateCipherTextResponse>;
|
|
841
|
+
/**
|
|
842
|
+
* Validate cipherText and verify IP in a single call
|
|
843
|
+
*
|
|
844
|
+
* Combines cipherText validation with IP verification for complete
|
|
845
|
+
* location and device verification in one request.
|
|
846
|
+
*
|
|
847
|
+
* @param cipherText - The encrypted cipherText string
|
|
848
|
+
* @param ipAddress - Client IP address
|
|
849
|
+
* @param userId - User ID
|
|
850
|
+
* @param eventType - Event type (login, registration, etc.)
|
|
851
|
+
* @returns Combined validation and verification result
|
|
852
|
+
*
|
|
853
|
+
* @example
|
|
854
|
+
* ```typescript
|
|
855
|
+
* const result = await client.validateAndVerify(
|
|
856
|
+
* cipherText,
|
|
857
|
+
* clientIP,
|
|
858
|
+
* "user_123",
|
|
859
|
+
* "registration"
|
|
860
|
+
* );
|
|
861
|
+
*
|
|
862
|
+
* if (!result.ciphertext_valid) {
|
|
863
|
+
* throw new Error("Device verification failed");
|
|
864
|
+
* }
|
|
865
|
+
*
|
|
866
|
+
* if (result.location.is_blocked) {
|
|
867
|
+
* throw new Error("Location not allowed");
|
|
868
|
+
* }
|
|
869
|
+
* ```
|
|
870
|
+
*/
|
|
871
|
+
validateAndVerify(cipherText: string, ipAddress: string, userId: string, eventType: CipherTextReason, requestOptions?: RequestOptions): Promise<{
|
|
872
|
+
ciphertext_valid: boolean;
|
|
873
|
+
ciphertext_result: ValidateCipherTextResponse;
|
|
874
|
+
location: LocationVerification;
|
|
875
|
+
}>;
|
|
876
|
+
/**
|
|
877
|
+
* Create a location request to get customer's live location
|
|
878
|
+
*
|
|
879
|
+
* @param request - Location request details
|
|
880
|
+
* @returns Location request result with share link
|
|
881
|
+
*
|
|
882
|
+
* @example
|
|
883
|
+
* ```typescript
|
|
884
|
+
* const result = await client.createLocationRequest({
|
|
885
|
+
* user_id: "customer_123",
|
|
886
|
+
* channel: "sms",
|
|
887
|
+
* phone: "+1234567890",
|
|
888
|
+
* reason: "Verification for high-value transaction"
|
|
889
|
+
* });
|
|
890
|
+
*
|
|
891
|
+
* console.log(`Share link sent: ${result.share_link}`);
|
|
892
|
+
* console.log(`Expires at: ${result.token_expiry}`);
|
|
893
|
+
* ```
|
|
894
|
+
*/
|
|
895
|
+
createLocationRequest(request: CreateLocationRequestRequest, requestOptions?: RequestOptions): Promise<LocationRequestResult>;
|
|
896
|
+
/**
|
|
897
|
+
* Get a location request by ID
|
|
898
|
+
*
|
|
899
|
+
* @param requestId - Location request ID
|
|
900
|
+
* @returns Location request details
|
|
901
|
+
*/
|
|
902
|
+
getLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<LocationRequest>;
|
|
903
|
+
/**
|
|
904
|
+
* List location requests with filters and pagination
|
|
905
|
+
*
|
|
906
|
+
* @param filters - Optional filters
|
|
907
|
+
* @param pagination - Optional pagination
|
|
908
|
+
* @returns Paginated list of location requests
|
|
909
|
+
*
|
|
910
|
+
* @example
|
|
911
|
+
* ```typescript
|
|
912
|
+
* const requests = await client.listLocationRequests(
|
|
913
|
+
* { status: "completed", user_id: "customer_123" },
|
|
914
|
+
* { page: 1, limit: 20 }
|
|
915
|
+
* );
|
|
916
|
+
* ```
|
|
917
|
+
*/
|
|
918
|
+
listLocationRequests(filters?: LocationRequestFilters, pagination?: PaginationParams, requestOptions?: RequestOptions): Promise<LocationRequestListResponse>;
|
|
919
|
+
/**
|
|
920
|
+
* Cancel a pending location request
|
|
921
|
+
*
|
|
922
|
+
* @param requestId - Location request ID
|
|
923
|
+
*/
|
|
924
|
+
cancelLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<void>;
|
|
925
|
+
/**
|
|
926
|
+
* Resend notification for a location request
|
|
927
|
+
*
|
|
928
|
+
* @param requestId - Location request ID
|
|
929
|
+
* @param contact - Email or phone to send to
|
|
930
|
+
*/
|
|
931
|
+
resendLocationRequest(requestId: string, contact: ResendLocationRequestRequest, requestOptions?: RequestOptions): Promise<void>;
|
|
932
|
+
/**
|
|
933
|
+
* Get location share info (customer-facing)
|
|
934
|
+
* This is called from the customer's device to get request details
|
|
935
|
+
*
|
|
936
|
+
* @param token - Secure token from share link
|
|
937
|
+
* @returns Location share info
|
|
938
|
+
*/
|
|
939
|
+
getLocationShareInfo(token: string, requestOptions?: RequestOptions): Promise<LocationShareInfo>;
|
|
940
|
+
/**
|
|
941
|
+
* Submit location capture (customer-facing)
|
|
942
|
+
* This is called from the customer's device to submit their location
|
|
943
|
+
*
|
|
944
|
+
* @param token - Secure token from share link
|
|
945
|
+
* @param capture - Location capture data (GPS or WiFi)
|
|
946
|
+
* @returns Capture response
|
|
947
|
+
*
|
|
948
|
+
* @example
|
|
949
|
+
* ```typescript
|
|
950
|
+
* // Using GPS (preferred)
|
|
951
|
+
* const result = await client.captureLocation(token, {
|
|
952
|
+
* latitude: 37.7749,
|
|
953
|
+
* longitude: -122.4194,
|
|
954
|
+
* accuracy: 10
|
|
955
|
+
* });
|
|
956
|
+
*
|
|
957
|
+
* // Using WiFi positioning (fallback)
|
|
958
|
+
* const result = await client.captureLocation(token, {
|
|
959
|
+
* wifi_networks: [
|
|
960
|
+
* { macAddress: "00:11:22:33:44:55", signalStrength: -50 },
|
|
961
|
+
* { macAddress: "AA:BB:CC:DD:EE:FF", signalStrength: -70 }
|
|
962
|
+
* ]
|
|
963
|
+
* });
|
|
964
|
+
* ```
|
|
965
|
+
*/
|
|
966
|
+
captureLocation(token: string, capture: LocationCaptureRequest, requestOptions?: RequestOptions): Promise<LocationCaptureResponse>;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
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;
|
|
@@ -718,4 +718,252 @@ interface UseLocationCaptureResult {
|
|
|
718
718
|
captureAndSubmitGPS: () => Promise<LocationCaptureResponse>;
|
|
719
719
|
}
|
|
720
720
|
|
|
721
|
-
|
|
721
|
+
/**
|
|
722
|
+
* GeolocationClient - TypeScript SDK for CGS Geolocation & Compliance Service
|
|
723
|
+
*
|
|
724
|
+
* Provides type-safe methods to interact with the geolocation service API.
|
|
725
|
+
* Extends BaseClient for consistent retry logic, timeout handling, and error management.
|
|
726
|
+
*/
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* GeolocationClient extends BaseClient for:
|
|
730
|
+
* - Consistent retry logic with exponential backoff
|
|
731
|
+
* - Unified error handling (CGSError, NetworkError, TimeoutError, etc.)
|
|
732
|
+
* - Automatic timeout management
|
|
733
|
+
* - Debug logging
|
|
734
|
+
*
|
|
735
|
+
* All geolocation verification calls use requestWithRetry() to handle
|
|
736
|
+
* transient failures gracefully.
|
|
737
|
+
*/
|
|
738
|
+
declare class GeolocationClient extends BaseClient {
|
|
739
|
+
constructor(config: GeolocationClientConfig);
|
|
740
|
+
/**
|
|
741
|
+
* Verify an IP address and check compliance
|
|
742
|
+
*
|
|
743
|
+
* Uses requestWithRetry() for automatic retry on transient failures.
|
|
744
|
+
*
|
|
745
|
+
* @param request - Verification request with IP, user ID, event type, and optional device fingerprint
|
|
746
|
+
* @returns Location verification result with risk assessment
|
|
747
|
+
*
|
|
748
|
+
* @example
|
|
749
|
+
* ```typescript
|
|
750
|
+
* const result = await client.verifyIP({
|
|
751
|
+
* ip_address: "8.8.8.8",
|
|
752
|
+
* user_id: "user_123",
|
|
753
|
+
* event_type: "login",
|
|
754
|
+
* device_fingerprint: {
|
|
755
|
+
* device_id: "device_abc",
|
|
756
|
+
* user_agent: navigator.userAgent,
|
|
757
|
+
* platform: "web"
|
|
758
|
+
* }
|
|
759
|
+
* });
|
|
760
|
+
*
|
|
761
|
+
* if (result.is_blocked) {
|
|
762
|
+
* console.log("Access blocked:", result.risk_reasons);
|
|
763
|
+
* }
|
|
764
|
+
* ```
|
|
765
|
+
*/
|
|
766
|
+
verifyIP(request: VerifyIPRequest, requestOptions?: RequestOptions): Promise<LocationVerification>;
|
|
767
|
+
/**
|
|
768
|
+
* Check compliance for a specific country
|
|
769
|
+
*
|
|
770
|
+
* @param countryISO - ISO 3166-1 alpha-2 country code (e.g., "US", "GB")
|
|
771
|
+
* @returns Jurisdiction configuration and compliance status
|
|
772
|
+
*
|
|
773
|
+
* @example
|
|
774
|
+
* ```typescript
|
|
775
|
+
* const compliance = await client.checkCompliance("KP"); // North Korea
|
|
776
|
+
* if (!compliance.is_compliant) {
|
|
777
|
+
* console.log("Country is not allowed:", compliance.jurisdiction?.status);
|
|
778
|
+
* }
|
|
779
|
+
* ```
|
|
780
|
+
*/
|
|
781
|
+
checkCompliance(countryISO: string, requestOptions?: RequestOptions): Promise<ComplianceCheckResponse>;
|
|
782
|
+
/**
|
|
783
|
+
* Get the tenant's GPS requirement configuration
|
|
784
|
+
*
|
|
785
|
+
* Returns which event types require GPS location to be collected.
|
|
786
|
+
* Use this to auto-enable GPS collection in generateCipherText when required.
|
|
787
|
+
*
|
|
788
|
+
* @returns GPS requirement config per event type
|
|
789
|
+
*
|
|
790
|
+
* @example
|
|
791
|
+
* ```typescript
|
|
792
|
+
* const config = await client.getGPSConfig();
|
|
793
|
+
* if (config.require_gps.login) {
|
|
794
|
+
* // GPS is required for login — auto-enable location
|
|
795
|
+
* }
|
|
796
|
+
* ```
|
|
797
|
+
*/
|
|
798
|
+
getGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
799
|
+
/**
|
|
800
|
+
* Validate a cipherText generated by the frontend SDK
|
|
801
|
+
*
|
|
802
|
+
* The cipherText contains encrypted device fingerprint and optional location data.
|
|
803
|
+
* This method decrypts and validates the data, returning device info, location,
|
|
804
|
+
* and risk assessment.
|
|
805
|
+
*
|
|
806
|
+
* @param cipherText - The encrypted cipherText string from generateCipherText()
|
|
807
|
+
* @param userId - User ID associated with this verification
|
|
808
|
+
* @param eventType - Reason for verification (login, registration, etc.)
|
|
809
|
+
* @param expectedIP - Optional expected IP address for additional validation
|
|
810
|
+
* @param customerData - Optional customer data for risk profile creation (used when user is blocked)
|
|
811
|
+
* @returns Validation result with device info, location, and risk assessment
|
|
812
|
+
*
|
|
813
|
+
* @example
|
|
814
|
+
* ```typescript
|
|
815
|
+
* // Validate cipherText during registration with customer data
|
|
816
|
+
* const result = await client.validateCipherText(
|
|
817
|
+
* cipherText,
|
|
818
|
+
* "user_123",
|
|
819
|
+
* "registration",
|
|
820
|
+
* clientIP,
|
|
821
|
+
* {
|
|
822
|
+
* full_name: "John Doe",
|
|
823
|
+
* email: "john@example.com",
|
|
824
|
+
* country: "US",
|
|
825
|
+
* state: "CA"
|
|
826
|
+
* }
|
|
827
|
+
* );
|
|
828
|
+
*
|
|
829
|
+
* if (!result.valid) {
|
|
830
|
+
* console.log("CipherText validation failed:", result.errors);
|
|
831
|
+
* return;
|
|
832
|
+
* }
|
|
833
|
+
*
|
|
834
|
+
* if (result.risk.is_blocked) {
|
|
835
|
+
* console.log("Access blocked:", result.risk.block_reasons);
|
|
836
|
+
* // A risk profile with full customer data has been created for the alert
|
|
837
|
+
* }
|
|
838
|
+
* ```
|
|
839
|
+
*/
|
|
840
|
+
validateCipherText(cipherText: string, userId: string, eventType: CipherTextReason, expectedIP?: string, customerData?: CipherTextCustomerData, requestOptions?: RequestOptions): Promise<ValidateCipherTextResponse>;
|
|
841
|
+
/**
|
|
842
|
+
* Validate cipherText and verify IP in a single call
|
|
843
|
+
*
|
|
844
|
+
* Combines cipherText validation with IP verification for complete
|
|
845
|
+
* location and device verification in one request.
|
|
846
|
+
*
|
|
847
|
+
* @param cipherText - The encrypted cipherText string
|
|
848
|
+
* @param ipAddress - Client IP address
|
|
849
|
+
* @param userId - User ID
|
|
850
|
+
* @param eventType - Event type (login, registration, etc.)
|
|
851
|
+
* @returns Combined validation and verification result
|
|
852
|
+
*
|
|
853
|
+
* @example
|
|
854
|
+
* ```typescript
|
|
855
|
+
* const result = await client.validateAndVerify(
|
|
856
|
+
* cipherText,
|
|
857
|
+
* clientIP,
|
|
858
|
+
* "user_123",
|
|
859
|
+
* "registration"
|
|
860
|
+
* );
|
|
861
|
+
*
|
|
862
|
+
* if (!result.ciphertext_valid) {
|
|
863
|
+
* throw new Error("Device verification failed");
|
|
864
|
+
* }
|
|
865
|
+
*
|
|
866
|
+
* if (result.location.is_blocked) {
|
|
867
|
+
* throw new Error("Location not allowed");
|
|
868
|
+
* }
|
|
869
|
+
* ```
|
|
870
|
+
*/
|
|
871
|
+
validateAndVerify(cipherText: string, ipAddress: string, userId: string, eventType: CipherTextReason, requestOptions?: RequestOptions): Promise<{
|
|
872
|
+
ciphertext_valid: boolean;
|
|
873
|
+
ciphertext_result: ValidateCipherTextResponse;
|
|
874
|
+
location: LocationVerification;
|
|
875
|
+
}>;
|
|
876
|
+
/**
|
|
877
|
+
* Create a location request to get customer's live location
|
|
878
|
+
*
|
|
879
|
+
* @param request - Location request details
|
|
880
|
+
* @returns Location request result with share link
|
|
881
|
+
*
|
|
882
|
+
* @example
|
|
883
|
+
* ```typescript
|
|
884
|
+
* const result = await client.createLocationRequest({
|
|
885
|
+
* user_id: "customer_123",
|
|
886
|
+
* channel: "sms",
|
|
887
|
+
* phone: "+1234567890",
|
|
888
|
+
* reason: "Verification for high-value transaction"
|
|
889
|
+
* });
|
|
890
|
+
*
|
|
891
|
+
* console.log(`Share link sent: ${result.share_link}`);
|
|
892
|
+
* console.log(`Expires at: ${result.token_expiry}`);
|
|
893
|
+
* ```
|
|
894
|
+
*/
|
|
895
|
+
createLocationRequest(request: CreateLocationRequestRequest, requestOptions?: RequestOptions): Promise<LocationRequestResult>;
|
|
896
|
+
/**
|
|
897
|
+
* Get a location request by ID
|
|
898
|
+
*
|
|
899
|
+
* @param requestId - Location request ID
|
|
900
|
+
* @returns Location request details
|
|
901
|
+
*/
|
|
902
|
+
getLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<LocationRequest>;
|
|
903
|
+
/**
|
|
904
|
+
* List location requests with filters and pagination
|
|
905
|
+
*
|
|
906
|
+
* @param filters - Optional filters
|
|
907
|
+
* @param pagination - Optional pagination
|
|
908
|
+
* @returns Paginated list of location requests
|
|
909
|
+
*
|
|
910
|
+
* @example
|
|
911
|
+
* ```typescript
|
|
912
|
+
* const requests = await client.listLocationRequests(
|
|
913
|
+
* { status: "completed", user_id: "customer_123" },
|
|
914
|
+
* { page: 1, limit: 20 }
|
|
915
|
+
* );
|
|
916
|
+
* ```
|
|
917
|
+
*/
|
|
918
|
+
listLocationRequests(filters?: LocationRequestFilters, pagination?: PaginationParams, requestOptions?: RequestOptions): Promise<LocationRequestListResponse>;
|
|
919
|
+
/**
|
|
920
|
+
* Cancel a pending location request
|
|
921
|
+
*
|
|
922
|
+
* @param requestId - Location request ID
|
|
923
|
+
*/
|
|
924
|
+
cancelLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<void>;
|
|
925
|
+
/**
|
|
926
|
+
* Resend notification for a location request
|
|
927
|
+
*
|
|
928
|
+
* @param requestId - Location request ID
|
|
929
|
+
* @param contact - Email or phone to send to
|
|
930
|
+
*/
|
|
931
|
+
resendLocationRequest(requestId: string, contact: ResendLocationRequestRequest, requestOptions?: RequestOptions): Promise<void>;
|
|
932
|
+
/**
|
|
933
|
+
* Get location share info (customer-facing)
|
|
934
|
+
* This is called from the customer's device to get request details
|
|
935
|
+
*
|
|
936
|
+
* @param token - Secure token from share link
|
|
937
|
+
* @returns Location share info
|
|
938
|
+
*/
|
|
939
|
+
getLocationShareInfo(token: string, requestOptions?: RequestOptions): Promise<LocationShareInfo>;
|
|
940
|
+
/**
|
|
941
|
+
* Submit location capture (customer-facing)
|
|
942
|
+
* This is called from the customer's device to submit their location
|
|
943
|
+
*
|
|
944
|
+
* @param token - Secure token from share link
|
|
945
|
+
* @param capture - Location capture data (GPS or WiFi)
|
|
946
|
+
* @returns Capture response
|
|
947
|
+
*
|
|
948
|
+
* @example
|
|
949
|
+
* ```typescript
|
|
950
|
+
* // Using GPS (preferred)
|
|
951
|
+
* const result = await client.captureLocation(token, {
|
|
952
|
+
* latitude: 37.7749,
|
|
953
|
+
* longitude: -122.4194,
|
|
954
|
+
* accuracy: 10
|
|
955
|
+
* });
|
|
956
|
+
*
|
|
957
|
+
* // Using WiFi positioning (fallback)
|
|
958
|
+
* const result = await client.captureLocation(token, {
|
|
959
|
+
* wifi_networks: [
|
|
960
|
+
* { macAddress: "00:11:22:33:44:55", signalStrength: -50 },
|
|
961
|
+
* { macAddress: "AA:BB:CC:DD:EE:FF", signalStrength: -70 }
|
|
962
|
+
* ]
|
|
963
|
+
* });
|
|
964
|
+
* ```
|
|
965
|
+
*/
|
|
966
|
+
captureLocation(token: string, capture: LocationCaptureRequest, requestOptions?: RequestOptions): Promise<LocationCaptureResponse>;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
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-BfeDYmrZ.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-BfeDYmrZ.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-i5QtnFIa.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-i5QtnFIa.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
|
*
|
package/dist/compliance/index.js
CHANGED
|
@@ -856,6 +856,17 @@ var ComplianceClient = class {
|
|
|
856
856
|
this.currencyRates = DEFAULT_CURRENCY_RATES;
|
|
857
857
|
}
|
|
858
858
|
// ============================================================================
|
|
859
|
+
// Sub-Client Accessors
|
|
860
|
+
// ============================================================================
|
|
861
|
+
/** Get the underlying GeolocationClient for direct geolocation API access */
|
|
862
|
+
getGeolocationClient() {
|
|
863
|
+
return this.geoClient;
|
|
864
|
+
}
|
|
865
|
+
/** Get the underlying RiskProfileClient for direct risk profile API access */
|
|
866
|
+
getRiskProfileClient() {
|
|
867
|
+
return this.riskClient;
|
|
868
|
+
}
|
|
869
|
+
// ============================================================================
|
|
859
870
|
// Main Verification Methods
|
|
860
871
|
// ============================================================================
|
|
861
872
|
/**
|