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,253 +0,0 @@
|
|
|
1
|
-
import { B as BaseClient } from './client-B7YzKVEm.mjs';
|
|
2
|
-
import { R as RequestOptions, P as PaginationParams } from './types-DBGM-bFB.mjs';
|
|
3
|
-
import { G as GeolocationClientConfig, V as VerifyIPRequest, L as LocationVerification, C as ComplianceCheckResponse, a as GeolocationConfigResponse, b as CipherTextReason, c as CipherTextCustomerData, d as ValidateCipherTextResponse, e as CreateLocationRequestRequest, f as LocationRequestResult, g as LocationRequest, h as LocationRequestFilters, i as LocationRequestListResponse, R as ResendLocationRequestRequest, j as LocationShareInfo, k as LocationCaptureRequest, l as LocationCaptureResponse } from './types-DGbuL8c0.mjs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* GeolocationClient - TypeScript SDK for CGS Geolocation & Compliance Service
|
|
7
|
-
*
|
|
8
|
-
* Provides type-safe methods to interact with the geolocation service API.
|
|
9
|
-
* Extends BaseClient for consistent retry logic, timeout handling, and error management.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* GeolocationClient extends BaseClient for:
|
|
14
|
-
* - Consistent retry logic with exponential backoff
|
|
15
|
-
* - Unified error handling (CGSError, NetworkError, TimeoutError, etc.)
|
|
16
|
-
* - Automatic timeout management
|
|
17
|
-
* - Debug logging
|
|
18
|
-
*
|
|
19
|
-
* All geolocation verification calls use requestWithRetry() to handle
|
|
20
|
-
* transient failures gracefully.
|
|
21
|
-
*/
|
|
22
|
-
declare class GeolocationClient extends BaseClient {
|
|
23
|
-
constructor(config: GeolocationClientConfig);
|
|
24
|
-
/**
|
|
25
|
-
* Verify an IP address and check compliance
|
|
26
|
-
*
|
|
27
|
-
* Uses requestWithRetry() for automatic retry on transient failures.
|
|
28
|
-
*
|
|
29
|
-
* @param request - Verification request with IP, user ID, event type, and optional device fingerprint
|
|
30
|
-
* @returns Location verification result with risk assessment
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const result = await client.verifyIP({
|
|
35
|
-
* ip_address: "8.8.8.8",
|
|
36
|
-
* user_id: "user_123",
|
|
37
|
-
* event_type: "login",
|
|
38
|
-
* device_fingerprint: {
|
|
39
|
-
* device_id: "device_abc",
|
|
40
|
-
* user_agent: navigator.userAgent,
|
|
41
|
-
* platform: "web"
|
|
42
|
-
* }
|
|
43
|
-
* });
|
|
44
|
-
*
|
|
45
|
-
* if (result.is_blocked) {
|
|
46
|
-
* console.log("Access blocked:", result.risk_reasons);
|
|
47
|
-
* }
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
verifyIP(request: VerifyIPRequest, requestOptions?: RequestOptions): Promise<LocationVerification>;
|
|
51
|
-
/**
|
|
52
|
-
* Check compliance for a specific country
|
|
53
|
-
*
|
|
54
|
-
* @param countryISO - ISO 3166-1 alpha-2 country code (e.g., "US", "GB")
|
|
55
|
-
* @returns Jurisdiction configuration and compliance status
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```typescript
|
|
59
|
-
* const compliance = await client.checkCompliance("KP"); // North Korea
|
|
60
|
-
* if (!compliance.is_compliant) {
|
|
61
|
-
* console.log("Country is not allowed:", compliance.jurisdiction?.status);
|
|
62
|
-
* }
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
checkCompliance(countryISO: string, requestOptions?: RequestOptions): Promise<ComplianceCheckResponse>;
|
|
66
|
-
/**
|
|
67
|
-
* Get the tenant's GPS requirement configuration
|
|
68
|
-
*
|
|
69
|
-
* Returns which event types require GPS location to be collected.
|
|
70
|
-
* Use this to auto-enable GPS collection in generateCipherText when required.
|
|
71
|
-
*
|
|
72
|
-
* @returns GPS requirement config per event type
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```typescript
|
|
76
|
-
* const config = await client.getGPSConfig();
|
|
77
|
-
* if (config.require_gps.login) {
|
|
78
|
-
* // GPS is required for login — auto-enable location
|
|
79
|
-
* }
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
getGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
83
|
-
/**
|
|
84
|
-
* Validate a cipherText generated by the frontend SDK
|
|
85
|
-
*
|
|
86
|
-
* The cipherText contains encrypted device fingerprint and optional location data.
|
|
87
|
-
* This method decrypts and validates the data, returning device info, location,
|
|
88
|
-
* and risk assessment.
|
|
89
|
-
*
|
|
90
|
-
* @param cipherText - The encrypted cipherText string from generateCipherText()
|
|
91
|
-
* @param userId - User ID associated with this verification
|
|
92
|
-
* @param eventType - Reason for verification (login, registration, etc.)
|
|
93
|
-
* @param expectedIP - Optional expected IP address for additional validation
|
|
94
|
-
* @param customerData - Optional customer data for risk profile creation (used when user is blocked)
|
|
95
|
-
* @returns Validation result with device info, location, and risk assessment
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```typescript
|
|
99
|
-
* // Validate cipherText during registration with customer data
|
|
100
|
-
* const result = await client.validateCipherText(
|
|
101
|
-
* cipherText,
|
|
102
|
-
* "user_123",
|
|
103
|
-
* "registration",
|
|
104
|
-
* clientIP,
|
|
105
|
-
* {
|
|
106
|
-
* full_name: "John Doe",
|
|
107
|
-
* email: "john@example.com",
|
|
108
|
-
* country: "US",
|
|
109
|
-
* state: "CA"
|
|
110
|
-
* }
|
|
111
|
-
* );
|
|
112
|
-
*
|
|
113
|
-
* if (!result.valid) {
|
|
114
|
-
* console.log("CipherText validation failed:", result.errors);
|
|
115
|
-
* return;
|
|
116
|
-
* }
|
|
117
|
-
*
|
|
118
|
-
* if (result.risk.is_blocked) {
|
|
119
|
-
* console.log("Access blocked:", result.risk.block_reasons);
|
|
120
|
-
* // A risk profile with full customer data has been created for the alert
|
|
121
|
-
* }
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
124
|
-
validateCipherText(cipherText: string, userId: string, eventType: CipherTextReason, expectedIP?: string, customerData?: CipherTextCustomerData, requestOptions?: RequestOptions): Promise<ValidateCipherTextResponse>;
|
|
125
|
-
/**
|
|
126
|
-
* Validate cipherText and verify IP in a single call
|
|
127
|
-
*
|
|
128
|
-
* Combines cipherText validation with IP verification for complete
|
|
129
|
-
* location and device verification in one request.
|
|
130
|
-
*
|
|
131
|
-
* @param cipherText - The encrypted cipherText string
|
|
132
|
-
* @param ipAddress - Client IP address
|
|
133
|
-
* @param userId - User ID
|
|
134
|
-
* @param eventType - Event type (login, registration, etc.)
|
|
135
|
-
* @returns Combined validation and verification result
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```typescript
|
|
139
|
-
* const result = await client.validateAndVerify(
|
|
140
|
-
* cipherText,
|
|
141
|
-
* clientIP,
|
|
142
|
-
* "user_123",
|
|
143
|
-
* "registration"
|
|
144
|
-
* );
|
|
145
|
-
*
|
|
146
|
-
* if (!result.ciphertext_valid) {
|
|
147
|
-
* throw new Error("Device verification failed");
|
|
148
|
-
* }
|
|
149
|
-
*
|
|
150
|
-
* if (result.location.is_blocked) {
|
|
151
|
-
* throw new Error("Location not allowed");
|
|
152
|
-
* }
|
|
153
|
-
* ```
|
|
154
|
-
*/
|
|
155
|
-
validateAndVerify(cipherText: string, ipAddress: string, userId: string, eventType: CipherTextReason, requestOptions?: RequestOptions): Promise<{
|
|
156
|
-
ciphertext_valid: boolean;
|
|
157
|
-
ciphertext_result: ValidateCipherTextResponse;
|
|
158
|
-
location: LocationVerification;
|
|
159
|
-
}>;
|
|
160
|
-
/**
|
|
161
|
-
* Create a location request to get customer's live location
|
|
162
|
-
*
|
|
163
|
-
* @param request - Location request details
|
|
164
|
-
* @returns Location request result with share link
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* ```typescript
|
|
168
|
-
* const result = await client.createLocationRequest({
|
|
169
|
-
* user_id: "customer_123",
|
|
170
|
-
* channel: "sms",
|
|
171
|
-
* phone: "+1234567890",
|
|
172
|
-
* reason: "Verification for high-value transaction"
|
|
173
|
-
* });
|
|
174
|
-
*
|
|
175
|
-
* console.log(`Share link sent: ${result.share_link}`);
|
|
176
|
-
* console.log(`Expires at: ${result.token_expiry}`);
|
|
177
|
-
* ```
|
|
178
|
-
*/
|
|
179
|
-
createLocationRequest(request: CreateLocationRequestRequest, requestOptions?: RequestOptions): Promise<LocationRequestResult>;
|
|
180
|
-
/**
|
|
181
|
-
* Get a location request by ID
|
|
182
|
-
*
|
|
183
|
-
* @param requestId - Location request ID
|
|
184
|
-
* @returns Location request details
|
|
185
|
-
*/
|
|
186
|
-
getLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<LocationRequest>;
|
|
187
|
-
/**
|
|
188
|
-
* List location requests with filters and pagination
|
|
189
|
-
*
|
|
190
|
-
* @param filters - Optional filters
|
|
191
|
-
* @param pagination - Optional pagination
|
|
192
|
-
* @returns Paginated list of location requests
|
|
193
|
-
*
|
|
194
|
-
* @example
|
|
195
|
-
* ```typescript
|
|
196
|
-
* const requests = await client.listLocationRequests(
|
|
197
|
-
* { status: "completed", user_id: "customer_123" },
|
|
198
|
-
* { page: 1, limit: 20 }
|
|
199
|
-
* );
|
|
200
|
-
* ```
|
|
201
|
-
*/
|
|
202
|
-
listLocationRequests(filters?: LocationRequestFilters, pagination?: PaginationParams, requestOptions?: RequestOptions): Promise<LocationRequestListResponse>;
|
|
203
|
-
/**
|
|
204
|
-
* Cancel a pending location request
|
|
205
|
-
*
|
|
206
|
-
* @param requestId - Location request ID
|
|
207
|
-
*/
|
|
208
|
-
cancelLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<void>;
|
|
209
|
-
/**
|
|
210
|
-
* Resend notification for a location request
|
|
211
|
-
*
|
|
212
|
-
* @param requestId - Location request ID
|
|
213
|
-
* @param contact - Email or phone to send to
|
|
214
|
-
*/
|
|
215
|
-
resendLocationRequest(requestId: string, contact: ResendLocationRequestRequest, requestOptions?: RequestOptions): Promise<void>;
|
|
216
|
-
/**
|
|
217
|
-
* Get location share info (customer-facing)
|
|
218
|
-
* This is called from the customer's device to get request details
|
|
219
|
-
*
|
|
220
|
-
* @param token - Secure token from share link
|
|
221
|
-
* @returns Location share info
|
|
222
|
-
*/
|
|
223
|
-
getLocationShareInfo(token: string, requestOptions?: RequestOptions): Promise<LocationShareInfo>;
|
|
224
|
-
/**
|
|
225
|
-
* Submit location capture (customer-facing)
|
|
226
|
-
* This is called from the customer's device to submit their location
|
|
227
|
-
*
|
|
228
|
-
* @param token - Secure token from share link
|
|
229
|
-
* @param capture - Location capture data (GPS or WiFi)
|
|
230
|
-
* @returns Capture response
|
|
231
|
-
*
|
|
232
|
-
* @example
|
|
233
|
-
* ```typescript
|
|
234
|
-
* // Using GPS (preferred)
|
|
235
|
-
* const result = await client.captureLocation(token, {
|
|
236
|
-
* latitude: 37.7749,
|
|
237
|
-
* longitude: -122.4194,
|
|
238
|
-
* accuracy: 10
|
|
239
|
-
* });
|
|
240
|
-
*
|
|
241
|
-
* // Using WiFi positioning (fallback)
|
|
242
|
-
* const result = await client.captureLocation(token, {
|
|
243
|
-
* wifi_networks: [
|
|
244
|
-
* { macAddress: "00:11:22:33:44:55", signalStrength: -50 },
|
|
245
|
-
* { macAddress: "AA:BB:CC:DD:EE:FF", signalStrength: -70 }
|
|
246
|
-
* ]
|
|
247
|
-
* });
|
|
248
|
-
* ```
|
|
249
|
-
*/
|
|
250
|
-
captureLocation(token: string, capture: LocationCaptureRequest, requestOptions?: RequestOptions): Promise<LocationCaptureResponse>;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export { GeolocationClient as G };
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { B as BaseClient } from './client-BaNLT2Df.js';
|
|
2
|
-
import { R as RequestOptions, P as PaginationParams } from './types-DBGM-bFB.js';
|
|
3
|
-
import { G as GeolocationClientConfig, V as VerifyIPRequest, L as LocationVerification, C as ComplianceCheckResponse, a as GeolocationConfigResponse, b as CipherTextReason, c as CipherTextCustomerData, d as ValidateCipherTextResponse, e as CreateLocationRequestRequest, f as LocationRequestResult, g as LocationRequest, h as LocationRequestFilters, i as LocationRequestListResponse, R as ResendLocationRequestRequest, j as LocationShareInfo, k as LocationCaptureRequest, l as LocationCaptureResponse } from './types-DgNbBnEH.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* GeolocationClient - TypeScript SDK for CGS Geolocation & Compliance Service
|
|
7
|
-
*
|
|
8
|
-
* Provides type-safe methods to interact with the geolocation service API.
|
|
9
|
-
* Extends BaseClient for consistent retry logic, timeout handling, and error management.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* GeolocationClient extends BaseClient for:
|
|
14
|
-
* - Consistent retry logic with exponential backoff
|
|
15
|
-
* - Unified error handling (CGSError, NetworkError, TimeoutError, etc.)
|
|
16
|
-
* - Automatic timeout management
|
|
17
|
-
* - Debug logging
|
|
18
|
-
*
|
|
19
|
-
* All geolocation verification calls use requestWithRetry() to handle
|
|
20
|
-
* transient failures gracefully.
|
|
21
|
-
*/
|
|
22
|
-
declare class GeolocationClient extends BaseClient {
|
|
23
|
-
constructor(config: GeolocationClientConfig);
|
|
24
|
-
/**
|
|
25
|
-
* Verify an IP address and check compliance
|
|
26
|
-
*
|
|
27
|
-
* Uses requestWithRetry() for automatic retry on transient failures.
|
|
28
|
-
*
|
|
29
|
-
* @param request - Verification request with IP, user ID, event type, and optional device fingerprint
|
|
30
|
-
* @returns Location verification result with risk assessment
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* const result = await client.verifyIP({
|
|
35
|
-
* ip_address: "8.8.8.8",
|
|
36
|
-
* user_id: "user_123",
|
|
37
|
-
* event_type: "login",
|
|
38
|
-
* device_fingerprint: {
|
|
39
|
-
* device_id: "device_abc",
|
|
40
|
-
* user_agent: navigator.userAgent,
|
|
41
|
-
* platform: "web"
|
|
42
|
-
* }
|
|
43
|
-
* });
|
|
44
|
-
*
|
|
45
|
-
* if (result.is_blocked) {
|
|
46
|
-
* console.log("Access blocked:", result.risk_reasons);
|
|
47
|
-
* }
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
verifyIP(request: VerifyIPRequest, requestOptions?: RequestOptions): Promise<LocationVerification>;
|
|
51
|
-
/**
|
|
52
|
-
* Check compliance for a specific country
|
|
53
|
-
*
|
|
54
|
-
* @param countryISO - ISO 3166-1 alpha-2 country code (e.g., "US", "GB")
|
|
55
|
-
* @returns Jurisdiction configuration and compliance status
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```typescript
|
|
59
|
-
* const compliance = await client.checkCompliance("KP"); // North Korea
|
|
60
|
-
* if (!compliance.is_compliant) {
|
|
61
|
-
* console.log("Country is not allowed:", compliance.jurisdiction?.status);
|
|
62
|
-
* }
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
checkCompliance(countryISO: string, requestOptions?: RequestOptions): Promise<ComplianceCheckResponse>;
|
|
66
|
-
/**
|
|
67
|
-
* Get the tenant's GPS requirement configuration
|
|
68
|
-
*
|
|
69
|
-
* Returns which event types require GPS location to be collected.
|
|
70
|
-
* Use this to auto-enable GPS collection in generateCipherText when required.
|
|
71
|
-
*
|
|
72
|
-
* @returns GPS requirement config per event type
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```typescript
|
|
76
|
-
* const config = await client.getGPSConfig();
|
|
77
|
-
* if (config.require_gps.login) {
|
|
78
|
-
* // GPS is required for login — auto-enable location
|
|
79
|
-
* }
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
getGPSConfig(requestOptions?: RequestOptions): Promise<GeolocationConfigResponse>;
|
|
83
|
-
/**
|
|
84
|
-
* Validate a cipherText generated by the frontend SDK
|
|
85
|
-
*
|
|
86
|
-
* The cipherText contains encrypted device fingerprint and optional location data.
|
|
87
|
-
* This method decrypts and validates the data, returning device info, location,
|
|
88
|
-
* and risk assessment.
|
|
89
|
-
*
|
|
90
|
-
* @param cipherText - The encrypted cipherText string from generateCipherText()
|
|
91
|
-
* @param userId - User ID associated with this verification
|
|
92
|
-
* @param eventType - Reason for verification (login, registration, etc.)
|
|
93
|
-
* @param expectedIP - Optional expected IP address for additional validation
|
|
94
|
-
* @param customerData - Optional customer data for risk profile creation (used when user is blocked)
|
|
95
|
-
* @returns Validation result with device info, location, and risk assessment
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```typescript
|
|
99
|
-
* // Validate cipherText during registration with customer data
|
|
100
|
-
* const result = await client.validateCipherText(
|
|
101
|
-
* cipherText,
|
|
102
|
-
* "user_123",
|
|
103
|
-
* "registration",
|
|
104
|
-
* clientIP,
|
|
105
|
-
* {
|
|
106
|
-
* full_name: "John Doe",
|
|
107
|
-
* email: "john@example.com",
|
|
108
|
-
* country: "US",
|
|
109
|
-
* state: "CA"
|
|
110
|
-
* }
|
|
111
|
-
* );
|
|
112
|
-
*
|
|
113
|
-
* if (!result.valid) {
|
|
114
|
-
* console.log("CipherText validation failed:", result.errors);
|
|
115
|
-
* return;
|
|
116
|
-
* }
|
|
117
|
-
*
|
|
118
|
-
* if (result.risk.is_blocked) {
|
|
119
|
-
* console.log("Access blocked:", result.risk.block_reasons);
|
|
120
|
-
* // A risk profile with full customer data has been created for the alert
|
|
121
|
-
* }
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
124
|
-
validateCipherText(cipherText: string, userId: string, eventType: CipherTextReason, expectedIP?: string, customerData?: CipherTextCustomerData, requestOptions?: RequestOptions): Promise<ValidateCipherTextResponse>;
|
|
125
|
-
/**
|
|
126
|
-
* Validate cipherText and verify IP in a single call
|
|
127
|
-
*
|
|
128
|
-
* Combines cipherText validation with IP verification for complete
|
|
129
|
-
* location and device verification in one request.
|
|
130
|
-
*
|
|
131
|
-
* @param cipherText - The encrypted cipherText string
|
|
132
|
-
* @param ipAddress - Client IP address
|
|
133
|
-
* @param userId - User ID
|
|
134
|
-
* @param eventType - Event type (login, registration, etc.)
|
|
135
|
-
* @returns Combined validation and verification result
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```typescript
|
|
139
|
-
* const result = await client.validateAndVerify(
|
|
140
|
-
* cipherText,
|
|
141
|
-
* clientIP,
|
|
142
|
-
* "user_123",
|
|
143
|
-
* "registration"
|
|
144
|
-
* );
|
|
145
|
-
*
|
|
146
|
-
* if (!result.ciphertext_valid) {
|
|
147
|
-
* throw new Error("Device verification failed");
|
|
148
|
-
* }
|
|
149
|
-
*
|
|
150
|
-
* if (result.location.is_blocked) {
|
|
151
|
-
* throw new Error("Location not allowed");
|
|
152
|
-
* }
|
|
153
|
-
* ```
|
|
154
|
-
*/
|
|
155
|
-
validateAndVerify(cipherText: string, ipAddress: string, userId: string, eventType: CipherTextReason, requestOptions?: RequestOptions): Promise<{
|
|
156
|
-
ciphertext_valid: boolean;
|
|
157
|
-
ciphertext_result: ValidateCipherTextResponse;
|
|
158
|
-
location: LocationVerification;
|
|
159
|
-
}>;
|
|
160
|
-
/**
|
|
161
|
-
* Create a location request to get customer's live location
|
|
162
|
-
*
|
|
163
|
-
* @param request - Location request details
|
|
164
|
-
* @returns Location request result with share link
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* ```typescript
|
|
168
|
-
* const result = await client.createLocationRequest({
|
|
169
|
-
* user_id: "customer_123",
|
|
170
|
-
* channel: "sms",
|
|
171
|
-
* phone: "+1234567890",
|
|
172
|
-
* reason: "Verification for high-value transaction"
|
|
173
|
-
* });
|
|
174
|
-
*
|
|
175
|
-
* console.log(`Share link sent: ${result.share_link}`);
|
|
176
|
-
* console.log(`Expires at: ${result.token_expiry}`);
|
|
177
|
-
* ```
|
|
178
|
-
*/
|
|
179
|
-
createLocationRequest(request: CreateLocationRequestRequest, requestOptions?: RequestOptions): Promise<LocationRequestResult>;
|
|
180
|
-
/**
|
|
181
|
-
* Get a location request by ID
|
|
182
|
-
*
|
|
183
|
-
* @param requestId - Location request ID
|
|
184
|
-
* @returns Location request details
|
|
185
|
-
*/
|
|
186
|
-
getLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<LocationRequest>;
|
|
187
|
-
/**
|
|
188
|
-
* List location requests with filters and pagination
|
|
189
|
-
*
|
|
190
|
-
* @param filters - Optional filters
|
|
191
|
-
* @param pagination - Optional pagination
|
|
192
|
-
* @returns Paginated list of location requests
|
|
193
|
-
*
|
|
194
|
-
* @example
|
|
195
|
-
* ```typescript
|
|
196
|
-
* const requests = await client.listLocationRequests(
|
|
197
|
-
* { status: "completed", user_id: "customer_123" },
|
|
198
|
-
* { page: 1, limit: 20 }
|
|
199
|
-
* );
|
|
200
|
-
* ```
|
|
201
|
-
*/
|
|
202
|
-
listLocationRequests(filters?: LocationRequestFilters, pagination?: PaginationParams, requestOptions?: RequestOptions): Promise<LocationRequestListResponse>;
|
|
203
|
-
/**
|
|
204
|
-
* Cancel a pending location request
|
|
205
|
-
*
|
|
206
|
-
* @param requestId - Location request ID
|
|
207
|
-
*/
|
|
208
|
-
cancelLocationRequest(requestId: string, requestOptions?: RequestOptions): Promise<void>;
|
|
209
|
-
/**
|
|
210
|
-
* Resend notification for a location request
|
|
211
|
-
*
|
|
212
|
-
* @param requestId - Location request ID
|
|
213
|
-
* @param contact - Email or phone to send to
|
|
214
|
-
*/
|
|
215
|
-
resendLocationRequest(requestId: string, contact: ResendLocationRequestRequest, requestOptions?: RequestOptions): Promise<void>;
|
|
216
|
-
/**
|
|
217
|
-
* Get location share info (customer-facing)
|
|
218
|
-
* This is called from the customer's device to get request details
|
|
219
|
-
*
|
|
220
|
-
* @param token - Secure token from share link
|
|
221
|
-
* @returns Location share info
|
|
222
|
-
*/
|
|
223
|
-
getLocationShareInfo(token: string, requestOptions?: RequestOptions): Promise<LocationShareInfo>;
|
|
224
|
-
/**
|
|
225
|
-
* Submit location capture (customer-facing)
|
|
226
|
-
* This is called from the customer's device to submit their location
|
|
227
|
-
*
|
|
228
|
-
* @param token - Secure token from share link
|
|
229
|
-
* @param capture - Location capture data (GPS or WiFi)
|
|
230
|
-
* @returns Capture response
|
|
231
|
-
*
|
|
232
|
-
* @example
|
|
233
|
-
* ```typescript
|
|
234
|
-
* // Using GPS (preferred)
|
|
235
|
-
* const result = await client.captureLocation(token, {
|
|
236
|
-
* latitude: 37.7749,
|
|
237
|
-
* longitude: -122.4194,
|
|
238
|
-
* accuracy: 10
|
|
239
|
-
* });
|
|
240
|
-
*
|
|
241
|
-
* // Using WiFi positioning (fallback)
|
|
242
|
-
* const result = await client.captureLocation(token, {
|
|
243
|
-
* wifi_networks: [
|
|
244
|
-
* { macAddress: "00:11:22:33:44:55", signalStrength: -50 },
|
|
245
|
-
* { macAddress: "AA:BB:CC:DD:EE:FF", signalStrength: -70 }
|
|
246
|
-
* ]
|
|
247
|
-
* });
|
|
248
|
-
* ```
|
|
249
|
-
*/
|
|
250
|
-
captureLocation(token: string, capture: LocationCaptureRequest, requestOptions?: RequestOptions): Promise<LocationCaptureResponse>;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export { GeolocationClient as G };
|