@uverifyng/node 0.1.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/README.md +109 -0
- package/dist/index.cjs +355 -0
- package/dist/index.d.cts +498 -0
- package/dist/index.d.ts +498 -0
- package/dist/index.js +322 -0
- package/package.json +34 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
/** Anything that becomes base64 for an image field: a Buffer/Uint8Array, a base64 string, or a data: URL. */
|
|
2
|
+
type ImageInput = Buffer | Uint8Array | string;
|
|
3
|
+
type Environment = 'test' | 'live';
|
|
4
|
+
interface Page<T> {
|
|
5
|
+
items: T[];
|
|
6
|
+
pagination: {
|
|
7
|
+
page: number;
|
|
8
|
+
per_page: number;
|
|
9
|
+
total: number;
|
|
10
|
+
total_pages: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface PageParams {
|
|
14
|
+
page?: number;
|
|
15
|
+
per_page?: number;
|
|
16
|
+
}
|
|
17
|
+
interface CheckBase {
|
|
18
|
+
/** Your unique ID for the check. Generated for you when omitted; reusing one never charges twice. */
|
|
19
|
+
reference?: string;
|
|
20
|
+
/** When the record is found, screen it against the sanctions lists (billed per name). */
|
|
21
|
+
aml_screening?: boolean;
|
|
22
|
+
/** Screen as above and keep watching the names (billed monthly per name). */
|
|
23
|
+
aml_monitoring?: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface PersonCheckParams extends CheckBase {
|
|
26
|
+
id_number: string;
|
|
27
|
+
first_name?: string;
|
|
28
|
+
last_name?: string;
|
|
29
|
+
/** YYYY-MM-DD, compared with the record. */
|
|
30
|
+
dob?: string;
|
|
31
|
+
/** Return the photo on the ID record (never stored by UVerify). */
|
|
32
|
+
include_photo?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** BVN, driver's licence and voter's card need the person's names. */
|
|
35
|
+
interface NamedCheckParams extends PersonCheckParams {
|
|
36
|
+
first_name: string;
|
|
37
|
+
last_name: string;
|
|
38
|
+
}
|
|
39
|
+
/** The face to match: a passed liveness session (recommended) or a selfie image. */
|
|
40
|
+
type FaceInput = {
|
|
41
|
+
liveness_session_id: string;
|
|
42
|
+
selfie_image?: never;
|
|
43
|
+
} | {
|
|
44
|
+
selfie_image: ImageInput;
|
|
45
|
+
liveness_session_id?: never;
|
|
46
|
+
};
|
|
47
|
+
interface CacCheckParams extends CheckBase {
|
|
48
|
+
/** RC, BN or IT number, e.g. RC123456. */
|
|
49
|
+
id_number: string;
|
|
50
|
+
business_type?: string;
|
|
51
|
+
}
|
|
52
|
+
interface AmlSummary {
|
|
53
|
+
status: 'clear' | 'potential_match' | 'unavailable';
|
|
54
|
+
reason?: string;
|
|
55
|
+
screenings: {
|
|
56
|
+
id: string;
|
|
57
|
+
subject: 'person' | 'company' | 'director';
|
|
58
|
+
status: 'clear' | 'potential_match';
|
|
59
|
+
matches: number;
|
|
60
|
+
monitor_id?: string | null;
|
|
61
|
+
}[];
|
|
62
|
+
}
|
|
63
|
+
interface Verification {
|
|
64
|
+
id: string;
|
|
65
|
+
reference: string;
|
|
66
|
+
type: 'bvn' | 'nin' | 'drivers_license' | 'voters_card' | 'tin' | 'cac';
|
|
67
|
+
type_label: string;
|
|
68
|
+
service: string;
|
|
69
|
+
service_label: string;
|
|
70
|
+
environment: Environment;
|
|
71
|
+
/** verified (record found) · not_found · failed (registry unreachable; refunded) · pending. */
|
|
72
|
+
status: 'pending' | 'verified' | 'not_found' | 'failed';
|
|
73
|
+
message: string;
|
|
74
|
+
id_number: string;
|
|
75
|
+
field_matches: Record<string, boolean | null> | null;
|
|
76
|
+
face_match: {
|
|
77
|
+
status: 'matched' | 'not_matched' | 'unavailable';
|
|
78
|
+
score: number | null;
|
|
79
|
+
liveness: 'passed' | 'not_checked';
|
|
80
|
+
liveness_session_id?: string;
|
|
81
|
+
reason?: string;
|
|
82
|
+
} | null;
|
|
83
|
+
duplicate_check: {
|
|
84
|
+
status: 'clear' | 'returning' | 'other_id' | 'flagged';
|
|
85
|
+
matches: unknown[];
|
|
86
|
+
} | null;
|
|
87
|
+
aml_screening: AmlSummary | null;
|
|
88
|
+
/** The record. Present on the check's response and on get(); lists leave it out. */
|
|
89
|
+
data: Record<string, unknown> | null;
|
|
90
|
+
photo?: string;
|
|
91
|
+
data_deleted_at?: string;
|
|
92
|
+
amount_charged: number;
|
|
93
|
+
currency: 'NGN';
|
|
94
|
+
created_at: string;
|
|
95
|
+
}
|
|
96
|
+
interface ListVerificationsParams extends PageParams {
|
|
97
|
+
type?: Verification['type'];
|
|
98
|
+
service?: string;
|
|
99
|
+
status?: Verification['status'];
|
|
100
|
+
reference?: string;
|
|
101
|
+
}
|
|
102
|
+
interface CreateLivenessParams {
|
|
103
|
+
reference?: string;
|
|
104
|
+
/** https URL to send the person to when they finish. */
|
|
105
|
+
redirect_url?: string;
|
|
106
|
+
}
|
|
107
|
+
interface LivenessSession {
|
|
108
|
+
id: string;
|
|
109
|
+
reference: string;
|
|
110
|
+
environment: Environment;
|
|
111
|
+
status: 'pending' | 'passed' | 'failed' | 'expired';
|
|
112
|
+
live: boolean;
|
|
113
|
+
score: number | null;
|
|
114
|
+
reasons: string[];
|
|
115
|
+
attempts: number;
|
|
116
|
+
max_attempts: number;
|
|
117
|
+
usable_for_face_match: boolean;
|
|
118
|
+
used_by_verification_id: string | null;
|
|
119
|
+
duplicates: {
|
|
120
|
+
count: number;
|
|
121
|
+
matches: unknown[];
|
|
122
|
+
} | null;
|
|
123
|
+
redirect_url: string | null;
|
|
124
|
+
amount_charged: number;
|
|
125
|
+
currency: 'NGN';
|
|
126
|
+
expires_at: string;
|
|
127
|
+
completed_at: string | null;
|
|
128
|
+
created_at: string;
|
|
129
|
+
/** Only when created: the hosted page to send the person to. */
|
|
130
|
+
url?: string;
|
|
131
|
+
}
|
|
132
|
+
interface SimulateLivenessParams {
|
|
133
|
+
outcome: 'passed' | 'failed' | 'expired';
|
|
134
|
+
/** Sandbox stand-in for a face: the same string on two sessions is the same person. */
|
|
135
|
+
face?: string;
|
|
136
|
+
}
|
|
137
|
+
type DocumentType = 'nin_slip' | 'nin_card' | 'drivers_license' | 'voters_card' | 'passport';
|
|
138
|
+
interface VerifyDocumentParams {
|
|
139
|
+
front_image: ImageInput;
|
|
140
|
+
back_image?: ImageInput;
|
|
141
|
+
document_type?: DocumentType;
|
|
142
|
+
liveness_session_id?: string;
|
|
143
|
+
selfie_image?: ImageInput;
|
|
144
|
+
/** Look the number up in the registry (billed as that lookup). Default true. */
|
|
145
|
+
verify_with_registry?: boolean;
|
|
146
|
+
reference?: string;
|
|
147
|
+
/** Sandbox only: the result to act out. */
|
|
148
|
+
sandbox_outcome?: 'verified' | 'unreadable' | 'expired' | 'tampered' | 'not_in_registry' | 'other_person' | 'face_mismatch';
|
|
149
|
+
}
|
|
150
|
+
interface IdDocument {
|
|
151
|
+
id: string;
|
|
152
|
+
reference: string;
|
|
153
|
+
environment: Environment;
|
|
154
|
+
/** verified · review (a person should look) · rejected · failed (couldn't be checked; refunded). */
|
|
155
|
+
status: 'verified' | 'review' | 'rejected' | 'failed';
|
|
156
|
+
reasons: string[];
|
|
157
|
+
document_type: DocumentType | 'other' | null;
|
|
158
|
+
expected_type: DocumentType | null;
|
|
159
|
+
id_number: string | null;
|
|
160
|
+
checks: Record<string, unknown> | null;
|
|
161
|
+
verification_id: string | null;
|
|
162
|
+
liveness_session_id: string | null;
|
|
163
|
+
/** What was read off the document (on verify and get). */
|
|
164
|
+
extracted?: Record<string, unknown> | null;
|
|
165
|
+
amount_charged: number;
|
|
166
|
+
currency: 'NGN';
|
|
167
|
+
created_at: string;
|
|
168
|
+
}
|
|
169
|
+
interface ScreenParams {
|
|
170
|
+
/** Full name (a person needs at least two names), or an organisation's name. */
|
|
171
|
+
name: string;
|
|
172
|
+
entity_type?: 'person' | 'entity';
|
|
173
|
+
/** YYYY-MM-DD or YYYY: sharpens matches. */
|
|
174
|
+
date_of_birth?: string;
|
|
175
|
+
nationality?: string;
|
|
176
|
+
reference?: string;
|
|
177
|
+
/** Keep watching this name after screening. */
|
|
178
|
+
monitor?: boolean;
|
|
179
|
+
}
|
|
180
|
+
interface AmlMatch {
|
|
181
|
+
source: 'un' | 'ofac' | 'uk' | 'eu' | 'ng';
|
|
182
|
+
source_label: string;
|
|
183
|
+
list_id: string;
|
|
184
|
+
kind: 'person' | 'entity';
|
|
185
|
+
name: string;
|
|
186
|
+
matched_name: string;
|
|
187
|
+
score: number;
|
|
188
|
+
date_of_birth: string[];
|
|
189
|
+
dob_match: boolean | null;
|
|
190
|
+
nationalities: string[];
|
|
191
|
+
programs: string[];
|
|
192
|
+
listed_on: string | null;
|
|
193
|
+
}
|
|
194
|
+
interface AmlScreening {
|
|
195
|
+
id: string;
|
|
196
|
+
reference: string;
|
|
197
|
+
environment: Environment;
|
|
198
|
+
status: 'clear' | 'potential_match';
|
|
199
|
+
entity_type: 'person' | 'entity';
|
|
200
|
+
name: string | null;
|
|
201
|
+
date_of_birth: string | null;
|
|
202
|
+
nationality: string | null;
|
|
203
|
+
matches: AmlMatch[];
|
|
204
|
+
lists_checked: {
|
|
205
|
+
source: string;
|
|
206
|
+
synced_at: string | null;
|
|
207
|
+
entries: number;
|
|
208
|
+
}[];
|
|
209
|
+
decision: 'cleared' | 'confirmed' | null;
|
|
210
|
+
decision_note: string | null;
|
|
211
|
+
decided_at: string | null;
|
|
212
|
+
monitor_id?: string | null;
|
|
213
|
+
amount_charged: number;
|
|
214
|
+
currency: 'NGN';
|
|
215
|
+
created_at: string;
|
|
216
|
+
}
|
|
217
|
+
type MonitorParams = Omit<ScreenParams, 'monitor'>;
|
|
218
|
+
interface AmlMonitor {
|
|
219
|
+
id: string;
|
|
220
|
+
reference: string;
|
|
221
|
+
environment: Environment;
|
|
222
|
+
status: 'active' | 'paused' | 'stopped';
|
|
223
|
+
entity_type: 'person' | 'entity';
|
|
224
|
+
name?: string | null;
|
|
225
|
+
date_of_birth?: string | null;
|
|
226
|
+
matches_known: number;
|
|
227
|
+
last_screening_id: string | null;
|
|
228
|
+
last_checked_at: string | null;
|
|
229
|
+
verification_id: string | null;
|
|
230
|
+
created_at: string;
|
|
231
|
+
stopped_at: string | null;
|
|
232
|
+
}
|
|
233
|
+
interface SanctionsList {
|
|
234
|
+
source: string;
|
|
235
|
+
label: string;
|
|
236
|
+
publisher: string;
|
|
237
|
+
url: string;
|
|
238
|
+
status: 'ok' | 'error' | 'never';
|
|
239
|
+
entries: number;
|
|
240
|
+
synced_at: string | null;
|
|
241
|
+
}
|
|
242
|
+
interface CreateKycLinkParams {
|
|
243
|
+
reference?: string;
|
|
244
|
+
/** IDs the customer may choose from. Default: bvn and nin. */
|
|
245
|
+
id_types?: ('bvn' | 'nin' | 'drivers_license' | 'voters_card')[];
|
|
246
|
+
customer_name?: string;
|
|
247
|
+
customer_email?: string;
|
|
248
|
+
redirect_url?: string;
|
|
249
|
+
/** Also ask for a photo of their ID after the face check. */
|
|
250
|
+
require_document?: boolean;
|
|
251
|
+
aml_screening?: boolean;
|
|
252
|
+
aml_monitoring?: boolean;
|
|
253
|
+
}
|
|
254
|
+
interface KycLink {
|
|
255
|
+
id: string;
|
|
256
|
+
reference: string;
|
|
257
|
+
environment: Environment;
|
|
258
|
+
status: 'pending' | 'in_progress' | 'completed' | 'failed' | 'expired';
|
|
259
|
+
outcome: 'verified' | 'face_mismatch' | 'face_unavailable' | 'not_found' | 'liveness_failed' | 'error' | 'document_rejected' | 'document_mismatch' | null;
|
|
260
|
+
customer_name: string | null;
|
|
261
|
+
customer_email: string | null;
|
|
262
|
+
id_types: string[];
|
|
263
|
+
id_type: string | null;
|
|
264
|
+
id_number: string | null;
|
|
265
|
+
attempts: number;
|
|
266
|
+
verification: Verification | null;
|
|
267
|
+
liveness: {
|
|
268
|
+
id: string;
|
|
269
|
+
status: string;
|
|
270
|
+
score: number | null;
|
|
271
|
+
attempts: number;
|
|
272
|
+
} | null;
|
|
273
|
+
require_document: boolean;
|
|
274
|
+
document: {
|
|
275
|
+
id: string;
|
|
276
|
+
status: string;
|
|
277
|
+
reasons: string[];
|
|
278
|
+
document_type: string | null;
|
|
279
|
+
} | null;
|
|
280
|
+
aml_screening?: boolean;
|
|
281
|
+
aml_monitoring?: boolean;
|
|
282
|
+
amount_charged: number;
|
|
283
|
+
currency: 'NGN';
|
|
284
|
+
redirect_url: string | null;
|
|
285
|
+
expires_at: string;
|
|
286
|
+
completed_at: string | null;
|
|
287
|
+
created_at: string;
|
|
288
|
+
/** Only when created: send this to the customer. */
|
|
289
|
+
url?: string;
|
|
290
|
+
}
|
|
291
|
+
interface ListKycLinksParams extends PageParams {
|
|
292
|
+
status?: KycLink['status'];
|
|
293
|
+
outcome?: NonNullable<KycLink['outcome']>;
|
|
294
|
+
reference?: string;
|
|
295
|
+
}
|
|
296
|
+
interface Balance {
|
|
297
|
+
balance: number;
|
|
298
|
+
currency: 'NGN';
|
|
299
|
+
billing_mode?: 'prepaid' | 'postpaid';
|
|
300
|
+
credit_limit?: number;
|
|
301
|
+
available?: number;
|
|
302
|
+
owed?: number;
|
|
303
|
+
}
|
|
304
|
+
interface Price {
|
|
305
|
+
check_type: string;
|
|
306
|
+
label: string;
|
|
307
|
+
default_price: number;
|
|
308
|
+
custom_price: number | null;
|
|
309
|
+
price: number;
|
|
310
|
+
currency: 'NGN';
|
|
311
|
+
is_enabled: boolean;
|
|
312
|
+
}
|
|
313
|
+
type WebhookEventType = 'verification.completed' | 'liveness.completed' | 'kyc.completed' | 'document.completed' | 'aml.match_found' | 'webhook.test';
|
|
314
|
+
interface WebhookEvent<T = unknown> {
|
|
315
|
+
/** Unique per event; deliveries can repeat, so dedupe on it. */
|
|
316
|
+
id: string;
|
|
317
|
+
type: WebhookEventType | string;
|
|
318
|
+
created_at: string;
|
|
319
|
+
environment: Environment;
|
|
320
|
+
data: T;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Verify a webhook and return its event. Pass the raw request body exactly as
|
|
325
|
+
* received (a Buffer or string, not re-serialised JSON), the UVerify-Signature
|
|
326
|
+
* header, and your endpoint's signing secret (whsec_…).
|
|
327
|
+
*
|
|
328
|
+
* Throws UVerifySignatureError if the signature doesn't match or the event is
|
|
329
|
+
* older than `toleranceSeconds` (a replay). Deliveries can repeat: dedupe on
|
|
330
|
+
* `event.id`.
|
|
331
|
+
*/
|
|
332
|
+
declare function constructEvent<T = unknown>(rawBody: string | Buffer | Uint8Array, signatureHeader: string | string[] | undefined | null, secret: string, toleranceSeconds?: number): WebhookEvent<T>;
|
|
333
|
+
/** Sign a payload the way UVerify does, for your own tests. */
|
|
334
|
+
declare function signPayload(body: string, secret: string, timestamp?: number): string;
|
|
335
|
+
|
|
336
|
+
declare const VERSION = "0.1.0";
|
|
337
|
+
interface UVerifyOptions {
|
|
338
|
+
/** uvk_test_… (sandbox, free) or uvk_live_…. Defaults to the UVERIFY_API_KEY environment variable. */
|
|
339
|
+
apiKey?: string;
|
|
340
|
+
/** Defaults to https://api.uverify.com.ng/v1. */
|
|
341
|
+
baseUrl?: string;
|
|
342
|
+
/** Per attempt. Face matches and ID documents can take several seconds. Default 60s. */
|
|
343
|
+
timeoutMs?: number;
|
|
344
|
+
/** Retries after a timeout, a connection error, a 5xx or a rate limit. Default 2. */
|
|
345
|
+
maxRetries?: number;
|
|
346
|
+
/** Bring your own fetch (tests, proxies). Defaults to the global fetch (Node 18+). */
|
|
347
|
+
fetch?: typeof fetch;
|
|
348
|
+
}
|
|
349
|
+
interface RequestOptions {
|
|
350
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
351
|
+
body?: Record<string, unknown>;
|
|
352
|
+
/** Safe to repeat: GETs, and POSTs that carry a reference. */
|
|
353
|
+
retryable?: boolean;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* The UVerify API client.
|
|
357
|
+
*
|
|
358
|
+
* ```ts
|
|
359
|
+
* import { UVerify } from '@uverifyng/node';
|
|
360
|
+
* const uverify = new UVerify({ apiKey: process.env.UVERIFY_API_KEY });
|
|
361
|
+
* const v = await uverify.identity.nin({ id_number: '12345678901' });
|
|
362
|
+
* if (v.status === 'verified') { … }
|
|
363
|
+
* ```
|
|
364
|
+
*/
|
|
365
|
+
declare class UVerify {
|
|
366
|
+
readonly identity: IdentityResource;
|
|
367
|
+
readonly business: BusinessResource;
|
|
368
|
+
readonly verifications: VerificationsResource;
|
|
369
|
+
readonly liveness: LivenessResource;
|
|
370
|
+
readonly documents: DocumentsResource;
|
|
371
|
+
readonly aml: AmlResource;
|
|
372
|
+
readonly kyc: KycResource;
|
|
373
|
+
readonly account: AccountResource;
|
|
374
|
+
static readonly webhooks: {
|
|
375
|
+
constructEvent: typeof constructEvent;
|
|
376
|
+
signPayload: typeof signPayload;
|
|
377
|
+
};
|
|
378
|
+
/** Verify webhook signatures. Also usable without a client: `UVerify.webhooks.constructEvent(…)`. */
|
|
379
|
+
readonly webhooks: {
|
|
380
|
+
constructEvent: typeof constructEvent;
|
|
381
|
+
signPayload: typeof signPayload;
|
|
382
|
+
};
|
|
383
|
+
private readonly apiKey;
|
|
384
|
+
private readonly baseUrl;
|
|
385
|
+
private readonly timeoutMs;
|
|
386
|
+
private readonly maxRetries;
|
|
387
|
+
private readonly fetchImpl;
|
|
388
|
+
constructor(options?: UVerifyOptions | string);
|
|
389
|
+
/** 'test' for a sandbox key, 'live' for a live one. */
|
|
390
|
+
get environment(): 'test' | 'live';
|
|
391
|
+
/** @internal */
|
|
392
|
+
request<T>(method: 'GET' | 'POST' | 'DELETE', path: string, opts?: RequestOptions): Promise<T>;
|
|
393
|
+
/** @internal An identity/business check: always carries a reference, so it can be retried safely. */
|
|
394
|
+
check(path: string, params: object): Promise<Verification>;
|
|
395
|
+
/** @internal A create that carries a reference (safe to retry). */
|
|
396
|
+
create<T>(path: string, params: object, prefix: string): Promise<T>;
|
|
397
|
+
}
|
|
398
|
+
declare class Resource {
|
|
399
|
+
protected readonly client: UVerify;
|
|
400
|
+
constructor(client: UVerify);
|
|
401
|
+
}
|
|
402
|
+
declare class IdentityResource extends Resource {
|
|
403
|
+
/** BVN lookup. Names are required by the registry. */
|
|
404
|
+
bvn(params: NamedCheckParams): Promise<Verification>;
|
|
405
|
+
/** BVN lookup + face match against the BVN photo. */
|
|
406
|
+
bvnFaceMatch(params: NamedCheckParams & FaceInput): Promise<Verification>;
|
|
407
|
+
nin(params: PersonCheckParams): Promise<Verification>;
|
|
408
|
+
ninFaceMatch(params: PersonCheckParams & FaceInput): Promise<Verification>;
|
|
409
|
+
driversLicense(params: NamedCheckParams): Promise<Verification>;
|
|
410
|
+
driversLicenseFaceMatch(params: NamedCheckParams & FaceInput): Promise<Verification>;
|
|
411
|
+
votersCard(params: NamedCheckParams): Promise<Verification>;
|
|
412
|
+
votersCardFaceMatch(params: NamedCheckParams & FaceInput): Promise<Verification>;
|
|
413
|
+
/** Tax ID lookup. */
|
|
414
|
+
tin(params: {
|
|
415
|
+
id_number: string;
|
|
416
|
+
reference?: string;
|
|
417
|
+
}): Promise<Verification>;
|
|
418
|
+
}
|
|
419
|
+
declare class BusinessResource extends Resource {
|
|
420
|
+
/** CAC lookup: status, address, directors, owners. */
|
|
421
|
+
cac(params: CacCheckParams): Promise<Verification>;
|
|
422
|
+
}
|
|
423
|
+
declare class VerificationsResource extends Resource {
|
|
424
|
+
list(params?: ListVerificationsParams): Promise<Page<Verification>>;
|
|
425
|
+
/** One verification, with its record. */
|
|
426
|
+
get(id: string): Promise<Verification>;
|
|
427
|
+
}
|
|
428
|
+
declare class LivenessResource extends Resource {
|
|
429
|
+
/** A hosted camera check. Send the person to `session.url`, then pass `session.id` to a face match. */
|
|
430
|
+
createSession(params?: CreateLivenessParams): Promise<LivenessSession>;
|
|
431
|
+
getSession(id: string): Promise<LivenessSession>;
|
|
432
|
+
/** Sandbox only: finish a session without a camera. */
|
|
433
|
+
simulate(id: string, params: SimulateLivenessParams): Promise<LivenessSession>;
|
|
434
|
+
}
|
|
435
|
+
declare class DocumentsResource extends Resource {
|
|
436
|
+
/** Read and check a photo of an ID (NIN slip or card, licence, voter's card, passport). Images: Buffer or base64. */
|
|
437
|
+
verify(params: VerifyDocumentParams): Promise<IdDocument>;
|
|
438
|
+
get(id: string): Promise<IdDocument>;
|
|
439
|
+
}
|
|
440
|
+
declare class AmlMonitorsResource extends Resource {
|
|
441
|
+
/** Screen a name now and keep watching it (billed monthly). */
|
|
442
|
+
create(params: MonitorParams): Promise<AmlMonitor>;
|
|
443
|
+
list(params?: PageParams & {
|
|
444
|
+
status?: AmlMonitor['status'];
|
|
445
|
+
}): Promise<Page<AmlMonitor>>;
|
|
446
|
+
get(id: string): Promise<AmlMonitor>;
|
|
447
|
+
/** Stop watching a name. */
|
|
448
|
+
stop(id: string): Promise<AmlMonitor>;
|
|
449
|
+
}
|
|
450
|
+
declare class AmlResource extends Resource {
|
|
451
|
+
readonly monitors: AmlMonitorsResource;
|
|
452
|
+
/** Screen a person or organisation against the UN, OFAC, UK, EU and Nigeria sanctions lists. */
|
|
453
|
+
screen(params: ScreenParams): Promise<AmlScreening & {
|
|
454
|
+
monitor_id?: string;
|
|
455
|
+
}>;
|
|
456
|
+
getScreening(id: string): Promise<AmlScreening>;
|
|
457
|
+
/** The lists screened, and how fresh each is. */
|
|
458
|
+
lists(): Promise<SanctionsList[]>;
|
|
459
|
+
}
|
|
460
|
+
declare class KycResource extends Resource {
|
|
461
|
+
/** A hosted verification link: send `link.url` to your customer. */
|
|
462
|
+
createLink(params?: CreateKycLinkParams): Promise<KycLink>;
|
|
463
|
+
getLink(id: string): Promise<KycLink>;
|
|
464
|
+
listLinks(params?: ListKycLinksParams): Promise<Page<KycLink>>;
|
|
465
|
+
}
|
|
466
|
+
declare class AccountResource extends Resource {
|
|
467
|
+
balance(): Promise<Balance>;
|
|
468
|
+
/** Your prices per check (custom prices included). */
|
|
469
|
+
pricing(): Promise<Price[]>;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/** Every API error. Branch on `code`: it's stable (https://uverify.com.ng/docs#responses). */
|
|
473
|
+
declare class UVerifyError extends Error {
|
|
474
|
+
/** e.g. validation_error, insufficient_balance, duplicate_reference, rate_limited. */
|
|
475
|
+
readonly code: string;
|
|
476
|
+
/** HTTP status (0 when the request never got a response). */
|
|
477
|
+
readonly status: number;
|
|
478
|
+
/** Quote this to UVerify support to trace the request. */
|
|
479
|
+
readonly requestId: string | null;
|
|
480
|
+
/** Field errors for validation_error; retry_after_seconds for rate_limited; … */
|
|
481
|
+
readonly details: unknown;
|
|
482
|
+
constructor(message: string, opts: {
|
|
483
|
+
code: string;
|
|
484
|
+
status: number;
|
|
485
|
+
requestId?: string | null;
|
|
486
|
+
details?: unknown;
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
/** The request didn't complete: timeout, DNS, connection reset. Safe to retry with the same reference. */
|
|
490
|
+
declare class UVerifyConnectionError extends UVerifyError {
|
|
491
|
+
constructor(message: string, cause?: unknown);
|
|
492
|
+
}
|
|
493
|
+
/** A webhook failed signature or timestamp verification. Don't trust its body. */
|
|
494
|
+
declare class UVerifySignatureError extends Error {
|
|
495
|
+
constructor(message: string);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export { type AmlMatch, type AmlMonitor, type AmlScreening, type AmlSummary, type Balance, type CacCheckParams, type CreateKycLinkParams, type CreateLivenessParams, type DocumentType, type Environment, type FaceInput, type IdDocument, type ImageInput, type KycLink, type ListKycLinksParams, type ListVerificationsParams, type LivenessSession, type MonitorParams, type NamedCheckParams, type Page, type PageParams, type PersonCheckParams, type Price, type SanctionsList, type ScreenParams, type SimulateLivenessParams, UVerify, UVerifyConnectionError, UVerifyError, type UVerifyOptions, UVerifySignatureError, VERSION, type Verification, type VerifyDocumentParams, type WebhookEvent, type WebhookEventType, constructEvent, UVerify as default, signPayload };
|