@isvalid-dev/sdk 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/LICENSE +21 -0
- package/README.md +175 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +808 -0
- package/dist/index.d.ts +808 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,808 @@
|
|
|
1
|
+
interface RetryConfig {
|
|
2
|
+
maxRetries?: number;
|
|
3
|
+
initialDelayMs?: number;
|
|
4
|
+
maxDelayMs?: number;
|
|
5
|
+
retryOn?: number[];
|
|
6
|
+
}
|
|
7
|
+
interface IsValidConfig {
|
|
8
|
+
apiKey: string;
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
timeout?: number;
|
|
11
|
+
retry?: RetryConfig | false;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface LeiEntity {
|
|
15
|
+
legalName: string;
|
|
16
|
+
country: string | null;
|
|
17
|
+
entityStatus: string | null;
|
|
18
|
+
registrationStatus: string | null;
|
|
19
|
+
category: string | null;
|
|
20
|
+
initialRegistrationDate: string | null;
|
|
21
|
+
lastUpdate: string | null;
|
|
22
|
+
nextRenewal: string | null;
|
|
23
|
+
managingLou: string | null;
|
|
24
|
+
}
|
|
25
|
+
interface LeiLou {
|
|
26
|
+
lei: string;
|
|
27
|
+
name: string;
|
|
28
|
+
country: string | null;
|
|
29
|
+
status: string | null;
|
|
30
|
+
}
|
|
31
|
+
type LeiResponse = {
|
|
32
|
+
valid: false;
|
|
33
|
+
} | {
|
|
34
|
+
valid: true;
|
|
35
|
+
lei: string;
|
|
36
|
+
louCode: string;
|
|
37
|
+
checkDigits: string;
|
|
38
|
+
found: boolean | null;
|
|
39
|
+
dataSource: 'gleif-db' | 'gleif-api' | null;
|
|
40
|
+
entity: LeiEntity | null;
|
|
41
|
+
lou: LeiLou | null;
|
|
42
|
+
};
|
|
43
|
+
interface LeiSearchOptions {
|
|
44
|
+
country?: string;
|
|
45
|
+
entityStatus?: string;
|
|
46
|
+
page?: number;
|
|
47
|
+
limit?: number;
|
|
48
|
+
}
|
|
49
|
+
interface LeiSearchResult {
|
|
50
|
+
lei: string;
|
|
51
|
+
legalName: string;
|
|
52
|
+
country: string | null;
|
|
53
|
+
entityStatus: string | null;
|
|
54
|
+
registrationStatus: string | null;
|
|
55
|
+
category: string | null;
|
|
56
|
+
}
|
|
57
|
+
interface LeiSearchResponse {
|
|
58
|
+
results: LeiSearchResult[];
|
|
59
|
+
page: number;
|
|
60
|
+
limit: number;
|
|
61
|
+
total: number;
|
|
62
|
+
}
|
|
63
|
+
interface LeiLouItem {
|
|
64
|
+
louCode: string;
|
|
65
|
+
lei: string;
|
|
66
|
+
name: string;
|
|
67
|
+
country: string | null;
|
|
68
|
+
status: string | null;
|
|
69
|
+
}
|
|
70
|
+
interface LeiLousResponse {
|
|
71
|
+
lous: LeiLouItem[];
|
|
72
|
+
total: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
interface LeiNamespace {
|
|
76
|
+
(value: string): Promise<LeiResponse>;
|
|
77
|
+
search(query: string, opts?: LeiSearchOptions): Promise<LeiSearchResponse>;
|
|
78
|
+
lous(): Promise<LeiLousResponse>;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
type CountryResponse = {
|
|
82
|
+
valid: false;
|
|
83
|
+
} | {
|
|
84
|
+
valid: true;
|
|
85
|
+
value: string;
|
|
86
|
+
format: 'alpha-2' | 'alpha-3' | 'numeric';
|
|
87
|
+
alpha2: string;
|
|
88
|
+
alpha3: string;
|
|
89
|
+
numeric: string;
|
|
90
|
+
name: string;
|
|
91
|
+
};
|
|
92
|
+
interface CountryListItem {
|
|
93
|
+
alpha2: string;
|
|
94
|
+
alpha3: string;
|
|
95
|
+
numeric: string;
|
|
96
|
+
name: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface CountryNamespace {
|
|
100
|
+
(value: string): Promise<CountryResponse>;
|
|
101
|
+
list(): Promise<CountryListItem[]>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
type CurrencyResponse = {
|
|
105
|
+
valid: false;
|
|
106
|
+
} | {
|
|
107
|
+
valid: true;
|
|
108
|
+
format: 'alpha' | 'numeric';
|
|
109
|
+
code: string;
|
|
110
|
+
numericCode: string;
|
|
111
|
+
name: string;
|
|
112
|
+
minorUnit: number | null;
|
|
113
|
+
};
|
|
114
|
+
interface CurrencyListItem {
|
|
115
|
+
code: string;
|
|
116
|
+
numericCode: string;
|
|
117
|
+
name: string;
|
|
118
|
+
minorUnit: number | null;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
interface CurrencyNamespace {
|
|
122
|
+
(value: string): Promise<CurrencyResponse>;
|
|
123
|
+
list(): Promise<CurrencyListItem[]>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
type LanguageResponse = {
|
|
127
|
+
valid: false;
|
|
128
|
+
} | {
|
|
129
|
+
valid: true;
|
|
130
|
+
format: 'alpha-2' | 'alpha-3';
|
|
131
|
+
alpha2: string | null;
|
|
132
|
+
alpha3: string;
|
|
133
|
+
name: string;
|
|
134
|
+
};
|
|
135
|
+
interface LanguageListItem {
|
|
136
|
+
alpha2: string | null;
|
|
137
|
+
alpha3: string;
|
|
138
|
+
name: string;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
interface LanguageNamespace {
|
|
142
|
+
(value: string): Promise<LanguageResponse>;
|
|
143
|
+
list(): Promise<LanguageListItem[]>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
type IataFlightResponse = {
|
|
147
|
+
valid: false;
|
|
148
|
+
} | {
|
|
149
|
+
valid: true;
|
|
150
|
+
airlineCode: string;
|
|
151
|
+
flightNumber: string;
|
|
152
|
+
suffix: string | null;
|
|
153
|
+
};
|
|
154
|
+
type IataAirlineResponse = {
|
|
155
|
+
valid: false;
|
|
156
|
+
} | {
|
|
157
|
+
valid: true;
|
|
158
|
+
found: boolean;
|
|
159
|
+
iataCode?: string;
|
|
160
|
+
icaoCode?: string | null;
|
|
161
|
+
name?: string;
|
|
162
|
+
country?: string | null;
|
|
163
|
+
};
|
|
164
|
+
interface IataAirlineListItem {
|
|
165
|
+
iataCode: string;
|
|
166
|
+
icaoCode: string | null;
|
|
167
|
+
name: string;
|
|
168
|
+
country: string | null;
|
|
169
|
+
}
|
|
170
|
+
type IataAirportResponse = {
|
|
171
|
+
valid: false;
|
|
172
|
+
} | {
|
|
173
|
+
valid: true;
|
|
174
|
+
found: boolean;
|
|
175
|
+
iataCode?: string;
|
|
176
|
+
name?: string;
|
|
177
|
+
city?: string | null;
|
|
178
|
+
country?: string | null;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
interface IataAirlineNamespace {
|
|
182
|
+
(value: string): Promise<IataAirlineResponse>;
|
|
183
|
+
list(): Promise<IataAirlineListItem[]>;
|
|
184
|
+
}
|
|
185
|
+
interface IataNamespace {
|
|
186
|
+
flight(value: string): Promise<IataFlightResponse>;
|
|
187
|
+
airline: IataAirlineNamespace;
|
|
188
|
+
airport(value: string): Promise<IataAirportResponse>;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
type IpResponse = {
|
|
192
|
+
valid: false;
|
|
193
|
+
} | {
|
|
194
|
+
valid: true;
|
|
195
|
+
version: 4 | 6;
|
|
196
|
+
type: string;
|
|
197
|
+
expanded?: string;
|
|
198
|
+
};
|
|
199
|
+
type MacResponse = {
|
|
200
|
+
valid: false;
|
|
201
|
+
} | {
|
|
202
|
+
valid: true;
|
|
203
|
+
normalized: string;
|
|
204
|
+
type: string;
|
|
205
|
+
isLocal: boolean;
|
|
206
|
+
isBroadcast: boolean;
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
interface NetNamespace {
|
|
210
|
+
ip(value: string): Promise<IpResponse>;
|
|
211
|
+
mac(value: string): Promise<MacResponse>;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
type PeselResponse = {
|
|
215
|
+
valid: false;
|
|
216
|
+
} | {
|
|
217
|
+
valid: true;
|
|
218
|
+
birthDate: string;
|
|
219
|
+
gender: 'male' | 'female';
|
|
220
|
+
isOver15: boolean;
|
|
221
|
+
isOver18: boolean;
|
|
222
|
+
isOver21: boolean;
|
|
223
|
+
};
|
|
224
|
+
interface RegonLookup {
|
|
225
|
+
checked: boolean;
|
|
226
|
+
found?: boolean;
|
|
227
|
+
reason?: string;
|
|
228
|
+
name?: string | null;
|
|
229
|
+
nip?: string | null;
|
|
230
|
+
voivodeship?: string | null;
|
|
231
|
+
district?: string | null;
|
|
232
|
+
community?: string | null;
|
|
233
|
+
city?: string | null;
|
|
234
|
+
postalCode?: string | null;
|
|
235
|
+
street?: string | null;
|
|
236
|
+
houseNumber?: string | null;
|
|
237
|
+
flatNumber?: string | null;
|
|
238
|
+
activityEndDate?: string | null;
|
|
239
|
+
}
|
|
240
|
+
type RegonResponse = {
|
|
241
|
+
valid: false;
|
|
242
|
+
} | {
|
|
243
|
+
valid: true;
|
|
244
|
+
type: 'entity' | 'local-unit';
|
|
245
|
+
regon?: RegonLookup;
|
|
246
|
+
};
|
|
247
|
+
interface KrsAddress {
|
|
248
|
+
city: string | null;
|
|
249
|
+
voivodeship: string | null;
|
|
250
|
+
street: string | null;
|
|
251
|
+
houseNumber: string | null;
|
|
252
|
+
flatNumber: string | null;
|
|
253
|
+
postalCode: string | null;
|
|
254
|
+
country: string | null;
|
|
255
|
+
website: string | null;
|
|
256
|
+
}
|
|
257
|
+
interface KrsLookup {
|
|
258
|
+
checked: boolean;
|
|
259
|
+
found?: boolean;
|
|
260
|
+
reason?: string;
|
|
261
|
+
krs?: string | null;
|
|
262
|
+
registry?: string;
|
|
263
|
+
name?: string | null;
|
|
264
|
+
legalForm?: string | null;
|
|
265
|
+
nip?: string | null;
|
|
266
|
+
regon?: string | null;
|
|
267
|
+
hasOppStatus?: boolean | null;
|
|
268
|
+
registeredAt?: string | null;
|
|
269
|
+
dataAsOf?: string | null;
|
|
270
|
+
lastEntryAt?: string | null;
|
|
271
|
+
address?: KrsAddress | null;
|
|
272
|
+
}
|
|
273
|
+
type KrsResponse = {
|
|
274
|
+
valid: false;
|
|
275
|
+
} | {
|
|
276
|
+
valid: true;
|
|
277
|
+
number: string;
|
|
278
|
+
krs?: KrsLookup;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
interface PlNamespace {
|
|
282
|
+
pesel(value: string): Promise<PeselResponse>;
|
|
283
|
+
regon(value: string, opts?: {
|
|
284
|
+
lookup?: boolean;
|
|
285
|
+
}): Promise<RegonResponse>;
|
|
286
|
+
krs(value: string, opts?: {
|
|
287
|
+
lookup?: boolean;
|
|
288
|
+
}): Promise<KrsResponse>;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
type CnpjResponse = {
|
|
292
|
+
valid: false;
|
|
293
|
+
} | {
|
|
294
|
+
valid: true;
|
|
295
|
+
normalized: string;
|
|
296
|
+
type: 'matriz' | 'filial';
|
|
297
|
+
};
|
|
298
|
+
type CpfResponse = {
|
|
299
|
+
valid: false;
|
|
300
|
+
} | {
|
|
301
|
+
valid: true;
|
|
302
|
+
normalized: string;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
interface BrNamespace {
|
|
306
|
+
cnpj(value: string): Promise<CnpjResponse>;
|
|
307
|
+
cpf(value: string): Promise<CpfResponse>;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
type AbnResponse = {
|
|
311
|
+
valid: false;
|
|
312
|
+
} | {
|
|
313
|
+
valid: true;
|
|
314
|
+
normalized: string;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
interface AuNamespace {
|
|
318
|
+
abn(value: string): Promise<AbnResponse>;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
type NifResponse = {
|
|
322
|
+
valid: false;
|
|
323
|
+
} | {
|
|
324
|
+
valid: true;
|
|
325
|
+
type: string;
|
|
326
|
+
normalized: string;
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
interface EsNamespace {
|
|
330
|
+
nif(value: string): Promise<NifResponse>;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
type GstinResponse = {
|
|
334
|
+
valid: false;
|
|
335
|
+
} | {
|
|
336
|
+
valid: true;
|
|
337
|
+
stateCode: string;
|
|
338
|
+
stateName: string | null;
|
|
339
|
+
pan: string;
|
|
340
|
+
entityType: string;
|
|
341
|
+
checkDigit: string;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
interface InNamespace {
|
|
345
|
+
gstin(value: string): Promise<GstinResponse>;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
type NpiResponse = {
|
|
349
|
+
valid: false;
|
|
350
|
+
} | {
|
|
351
|
+
valid: true;
|
|
352
|
+
normalized: string;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
interface UsNamespace {
|
|
356
|
+
npi(value: string): Promise<NpiResponse>;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
type SortCodeResponse = {
|
|
360
|
+
valid: false;
|
|
361
|
+
} | {
|
|
362
|
+
valid: true;
|
|
363
|
+
normalized: string;
|
|
364
|
+
formatted: string;
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
interface GbNamespace {
|
|
368
|
+
sortCode(value: string): Promise<SortCodeResponse>;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
type EmailResponse = {
|
|
372
|
+
valid: false;
|
|
373
|
+
} | {
|
|
374
|
+
valid: true;
|
|
375
|
+
local: string;
|
|
376
|
+
domain: string;
|
|
377
|
+
mxValid?: boolean;
|
|
378
|
+
};
|
|
379
|
+
type IbanResponse = {
|
|
380
|
+
valid: false;
|
|
381
|
+
} | {
|
|
382
|
+
valid: true;
|
|
383
|
+
countryCode: string;
|
|
384
|
+
countryName: string;
|
|
385
|
+
bban: string;
|
|
386
|
+
isEU: boolean;
|
|
387
|
+
formatted: string;
|
|
388
|
+
bankCode: string | null;
|
|
389
|
+
bankName: string | null;
|
|
390
|
+
bankBic: string | null;
|
|
391
|
+
};
|
|
392
|
+
type IsinResponse = {
|
|
393
|
+
valid: false;
|
|
394
|
+
} | {
|
|
395
|
+
valid: true;
|
|
396
|
+
countryCode: string;
|
|
397
|
+
countryName: string | null;
|
|
398
|
+
nsin: string;
|
|
399
|
+
cusip: string | null;
|
|
400
|
+
checkDigit: string;
|
|
401
|
+
found: boolean | null;
|
|
402
|
+
dataSource?: 'firds' | 'openfigi' | 'firds+openfigi';
|
|
403
|
+
name?: string | null;
|
|
404
|
+
fisn?: string | null;
|
|
405
|
+
cfiCode?: string | null;
|
|
406
|
+
currency?: string | null;
|
|
407
|
+
tradingVenue?: string | null;
|
|
408
|
+
issuerLei?: string | null;
|
|
409
|
+
maturityDate?: string | null;
|
|
410
|
+
status?: string | null;
|
|
411
|
+
ticker?: string | null;
|
|
412
|
+
exchCode?: string | null;
|
|
413
|
+
securityType?: string | null;
|
|
414
|
+
marketSector?: string | null;
|
|
415
|
+
figi?: string | null;
|
|
416
|
+
compositeFIGI?: string | null;
|
|
417
|
+
};
|
|
418
|
+
type DtiResponse = {
|
|
419
|
+
valid: false;
|
|
420
|
+
} | {
|
|
421
|
+
valid: true;
|
|
422
|
+
normalized: string;
|
|
423
|
+
payload: string;
|
|
424
|
+
checkChar: string;
|
|
425
|
+
found: boolean | null;
|
|
426
|
+
identifierType?: string;
|
|
427
|
+
name?: string | null;
|
|
428
|
+
shortName?: string | null;
|
|
429
|
+
dtiType?: number | null;
|
|
430
|
+
};
|
|
431
|
+
type VatResponse = {
|
|
432
|
+
valid: false;
|
|
433
|
+
} | {
|
|
434
|
+
valid: true;
|
|
435
|
+
normalized: string;
|
|
436
|
+
countryCode: string;
|
|
437
|
+
countryName: string;
|
|
438
|
+
isEU: boolean;
|
|
439
|
+
vies?: {
|
|
440
|
+
checked: boolean;
|
|
441
|
+
valid?: boolean;
|
|
442
|
+
name?: string | null;
|
|
443
|
+
address?: string | null;
|
|
444
|
+
reason?: string;
|
|
445
|
+
};
|
|
446
|
+
};
|
|
447
|
+
type GpsResponse = {
|
|
448
|
+
valid: false;
|
|
449
|
+
} | {
|
|
450
|
+
valid: true;
|
|
451
|
+
format: 'dd' | 'dms' | 'ddm' | 'geo-uri';
|
|
452
|
+
lat: number;
|
|
453
|
+
lon: number;
|
|
454
|
+
latDir: 'N' | 'S';
|
|
455
|
+
lonDir: 'E' | 'W';
|
|
456
|
+
dms: {
|
|
457
|
+
lat: string;
|
|
458
|
+
lon: string;
|
|
459
|
+
};
|
|
460
|
+
};
|
|
461
|
+
type PhoneResponse = {
|
|
462
|
+
valid: false;
|
|
463
|
+
} | {
|
|
464
|
+
valid: true;
|
|
465
|
+
countryCode: string | null;
|
|
466
|
+
callingCode: string;
|
|
467
|
+
nationalNumber: string;
|
|
468
|
+
type: string;
|
|
469
|
+
e164: string;
|
|
470
|
+
national: string;
|
|
471
|
+
international: string;
|
|
472
|
+
};
|
|
473
|
+
type UrlResponse = {
|
|
474
|
+
valid: false;
|
|
475
|
+
} | {
|
|
476
|
+
valid: true;
|
|
477
|
+
protocol: string;
|
|
478
|
+
domain: string;
|
|
479
|
+
path: string;
|
|
480
|
+
query: Record<string, string | string[]>;
|
|
481
|
+
port: string | null;
|
|
482
|
+
hash: string | null;
|
|
483
|
+
};
|
|
484
|
+
type EanResponse = {
|
|
485
|
+
valid: false;
|
|
486
|
+
} | {
|
|
487
|
+
valid: true;
|
|
488
|
+
format: string;
|
|
489
|
+
prefix?: string;
|
|
490
|
+
prefixCountry?: string;
|
|
491
|
+
upcA?: string;
|
|
492
|
+
indicator?: string;
|
|
493
|
+
};
|
|
494
|
+
type IsbnResponse = {
|
|
495
|
+
valid: false;
|
|
496
|
+
} | {
|
|
497
|
+
valid: true;
|
|
498
|
+
format: 'ISBN-10' | 'ISBN-13';
|
|
499
|
+
isbn10: string | null;
|
|
500
|
+
isbn13: string;
|
|
501
|
+
};
|
|
502
|
+
type IssnResponse = {
|
|
503
|
+
valid: false;
|
|
504
|
+
} | {
|
|
505
|
+
valid: true;
|
|
506
|
+
issn: string;
|
|
507
|
+
};
|
|
508
|
+
type BicResponse = {
|
|
509
|
+
valid: false;
|
|
510
|
+
} | {
|
|
511
|
+
valid: true;
|
|
512
|
+
bankCode: string;
|
|
513
|
+
countryCode: string;
|
|
514
|
+
countryName: string | null;
|
|
515
|
+
locationCode: string;
|
|
516
|
+
branchCode: string | null;
|
|
517
|
+
bankName: string | null;
|
|
518
|
+
city: string | null;
|
|
519
|
+
branch: string | null;
|
|
520
|
+
};
|
|
521
|
+
type CusipResponse = {
|
|
522
|
+
valid: false;
|
|
523
|
+
} | {
|
|
524
|
+
valid: true;
|
|
525
|
+
issuerNumber: string;
|
|
526
|
+
issueNumber: string;
|
|
527
|
+
checkDigit: string;
|
|
528
|
+
};
|
|
529
|
+
type CfiResponse = {
|
|
530
|
+
valid: false;
|
|
531
|
+
} | {
|
|
532
|
+
valid: true;
|
|
533
|
+
cfi: string;
|
|
534
|
+
category: string;
|
|
535
|
+
categoryName: string;
|
|
536
|
+
group: string;
|
|
537
|
+
groupName: string | null;
|
|
538
|
+
attributes: Array<{
|
|
539
|
+
position: number;
|
|
540
|
+
code: string;
|
|
541
|
+
name: string | null;
|
|
542
|
+
value: string | null;
|
|
543
|
+
}>;
|
|
544
|
+
};
|
|
545
|
+
type MicResponse = {
|
|
546
|
+
valid: false;
|
|
547
|
+
} | {
|
|
548
|
+
valid: true;
|
|
549
|
+
found: boolean;
|
|
550
|
+
mic?: string;
|
|
551
|
+
operatingMic?: string;
|
|
552
|
+
name?: string;
|
|
553
|
+
type?: string;
|
|
554
|
+
status?: string;
|
|
555
|
+
countryCode?: string;
|
|
556
|
+
countryName?: string | null;
|
|
557
|
+
city?: string;
|
|
558
|
+
website?: string | null;
|
|
559
|
+
};
|
|
560
|
+
type NutsResponse = {
|
|
561
|
+
valid: false;
|
|
562
|
+
} | {
|
|
563
|
+
valid: true;
|
|
564
|
+
code: string;
|
|
565
|
+
level: number;
|
|
566
|
+
country: string;
|
|
567
|
+
countryName: string | null;
|
|
568
|
+
regionName: string | null;
|
|
569
|
+
};
|
|
570
|
+
type UuidResponse = {
|
|
571
|
+
valid: false;
|
|
572
|
+
} | {
|
|
573
|
+
valid: true;
|
|
574
|
+
version: number;
|
|
575
|
+
};
|
|
576
|
+
type JwtResponse = {
|
|
577
|
+
valid: false;
|
|
578
|
+
} | {
|
|
579
|
+
valid: true;
|
|
580
|
+
algorithm: string;
|
|
581
|
+
header: Record<string, unknown>;
|
|
582
|
+
payload: Record<string, unknown>;
|
|
583
|
+
issuedAt: string | null;
|
|
584
|
+
expiresAt: string | null;
|
|
585
|
+
expired: boolean | null;
|
|
586
|
+
};
|
|
587
|
+
type VinResponse = {
|
|
588
|
+
valid: false;
|
|
589
|
+
} | {
|
|
590
|
+
valid: true;
|
|
591
|
+
wmi: string;
|
|
592
|
+
vds: string;
|
|
593
|
+
checkDigit: string;
|
|
594
|
+
vin: string;
|
|
595
|
+
country: string | null;
|
|
596
|
+
region: string | null;
|
|
597
|
+
manufacturer: string | null;
|
|
598
|
+
modelYearCandidates: number[];
|
|
599
|
+
serialNumber: string;
|
|
600
|
+
};
|
|
601
|
+
type ImeiResponse = {
|
|
602
|
+
valid: false;
|
|
603
|
+
} | {
|
|
604
|
+
valid: true;
|
|
605
|
+
tac: string;
|
|
606
|
+
snr: string;
|
|
607
|
+
checkDigit: string;
|
|
608
|
+
};
|
|
609
|
+
type SemverResponse = {
|
|
610
|
+
valid: false;
|
|
611
|
+
} | {
|
|
612
|
+
valid: true;
|
|
613
|
+
major: number;
|
|
614
|
+
minor: number;
|
|
615
|
+
patch: number;
|
|
616
|
+
prerelease: string[] | null;
|
|
617
|
+
build: string[] | null;
|
|
618
|
+
};
|
|
619
|
+
type ColorResponse = {
|
|
620
|
+
valid: false;
|
|
621
|
+
} | {
|
|
622
|
+
valid: true;
|
|
623
|
+
format: string;
|
|
624
|
+
r: number;
|
|
625
|
+
g: number;
|
|
626
|
+
b: number;
|
|
627
|
+
h: number;
|
|
628
|
+
s: number;
|
|
629
|
+
l: number;
|
|
630
|
+
alpha: number;
|
|
631
|
+
hex: string;
|
|
632
|
+
};
|
|
633
|
+
type BooleanResponse = {
|
|
634
|
+
valid: false;
|
|
635
|
+
} | {
|
|
636
|
+
valid: true;
|
|
637
|
+
normalized: boolean;
|
|
638
|
+
};
|
|
639
|
+
type DateResponse = {
|
|
640
|
+
valid: false;
|
|
641
|
+
} | {
|
|
642
|
+
valid: true;
|
|
643
|
+
iso: string;
|
|
644
|
+
};
|
|
645
|
+
type BtcAddressResponse = {
|
|
646
|
+
valid: false;
|
|
647
|
+
} | {
|
|
648
|
+
valid: true;
|
|
649
|
+
type: string;
|
|
650
|
+
};
|
|
651
|
+
type PostalCodeResponse = {
|
|
652
|
+
valid: false;
|
|
653
|
+
} | {
|
|
654
|
+
valid: true;
|
|
655
|
+
country?: string;
|
|
656
|
+
countryName?: string | null;
|
|
657
|
+
format?: string;
|
|
658
|
+
location?: {
|
|
659
|
+
city: string;
|
|
660
|
+
region: string | null;
|
|
661
|
+
subregion: string | null;
|
|
662
|
+
lat: number | null;
|
|
663
|
+
lon: number | null;
|
|
664
|
+
} | null;
|
|
665
|
+
matchingCountries?: Array<{
|
|
666
|
+
country: string;
|
|
667
|
+
countryName: string | null;
|
|
668
|
+
format: string;
|
|
669
|
+
}>;
|
|
670
|
+
};
|
|
671
|
+
type AbaResponse = {
|
|
672
|
+
valid: false;
|
|
673
|
+
} | {
|
|
674
|
+
valid: true;
|
|
675
|
+
routingNumber: string;
|
|
676
|
+
checkDigit: string;
|
|
677
|
+
};
|
|
678
|
+
type Iso6346Response = {
|
|
679
|
+
valid: false;
|
|
680
|
+
} | {
|
|
681
|
+
valid: true;
|
|
682
|
+
ownerCode: string;
|
|
683
|
+
equipmentCategory: string;
|
|
684
|
+
serialNumber: string;
|
|
685
|
+
checkDigit: string;
|
|
686
|
+
};
|
|
687
|
+
type SsccResponse = {
|
|
688
|
+
valid: false;
|
|
689
|
+
} | {
|
|
690
|
+
valid: true;
|
|
691
|
+
extensionDigit: string;
|
|
692
|
+
gsPrefix: string;
|
|
693
|
+
serialRef: string;
|
|
694
|
+
checkDigit: string;
|
|
695
|
+
};
|
|
696
|
+
type GlnResponse = {
|
|
697
|
+
valid: false;
|
|
698
|
+
} | {
|
|
699
|
+
valid: true;
|
|
700
|
+
prefix: string;
|
|
701
|
+
locationRef: string;
|
|
702
|
+
checkDigit: string;
|
|
703
|
+
};
|
|
704
|
+
type QrResponse = {
|
|
705
|
+
valid: boolean;
|
|
706
|
+
format?: string;
|
|
707
|
+
data?: Record<string, unknown>;
|
|
708
|
+
error?: string;
|
|
709
|
+
};
|
|
710
|
+
type CreditCardResponse = {
|
|
711
|
+
valid: false;
|
|
712
|
+
} | {
|
|
713
|
+
valid: true;
|
|
714
|
+
type: string;
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
declare class IsValidError extends Error {
|
|
718
|
+
readonly status: number;
|
|
719
|
+
readonly body: {
|
|
720
|
+
error: string;
|
|
721
|
+
};
|
|
722
|
+
constructor(status: number, body: {
|
|
723
|
+
error: string;
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
declare class IsValidAuthError extends IsValidError {
|
|
727
|
+
constructor(body: {
|
|
728
|
+
error: string;
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
declare class IsValidRateLimitError extends IsValidError {
|
|
732
|
+
readonly retryAfter: number | null;
|
|
733
|
+
constructor(body: {
|
|
734
|
+
error: string;
|
|
735
|
+
}, retryAfter?: number | null);
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
type InvalidResponse = {
|
|
739
|
+
valid: false;
|
|
740
|
+
};
|
|
741
|
+
|
|
742
|
+
declare class IsValid {
|
|
743
|
+
private readonly client;
|
|
744
|
+
readonly lei: LeiNamespace;
|
|
745
|
+
readonly country: CountryNamespace;
|
|
746
|
+
readonly currency: CurrencyNamespace;
|
|
747
|
+
readonly language: LanguageNamespace;
|
|
748
|
+
readonly iata: IataNamespace;
|
|
749
|
+
readonly net: NetNamespace;
|
|
750
|
+
readonly pl: PlNamespace;
|
|
751
|
+
readonly br: BrNamespace;
|
|
752
|
+
readonly au: AuNamespace;
|
|
753
|
+
readonly es: EsNamespace;
|
|
754
|
+
readonly in: InNamespace;
|
|
755
|
+
readonly us: UsNamespace;
|
|
756
|
+
readonly gb: GbNamespace;
|
|
757
|
+
constructor(config: IsValidConfig);
|
|
758
|
+
email(value: string, opts?: {
|
|
759
|
+
checkMx?: boolean;
|
|
760
|
+
}): Promise<EmailResponse>;
|
|
761
|
+
iban(value: string, opts?: {
|
|
762
|
+
countryCode?: string;
|
|
763
|
+
}): Promise<IbanResponse>;
|
|
764
|
+
isin(value: string): Promise<IsinResponse>;
|
|
765
|
+
dti(value: string): Promise<DtiResponse>;
|
|
766
|
+
vat(value: string, opts?: {
|
|
767
|
+
countryCode?: string;
|
|
768
|
+
checkVies?: boolean;
|
|
769
|
+
}): Promise<VatResponse>;
|
|
770
|
+
gps(value: string): Promise<GpsResponse>;
|
|
771
|
+
phone(value: string, opts?: {
|
|
772
|
+
countryCode?: string;
|
|
773
|
+
}): Promise<PhoneResponse>;
|
|
774
|
+
url(value: string): Promise<UrlResponse>;
|
|
775
|
+
ean(value: string): Promise<EanResponse>;
|
|
776
|
+
isbn(value: string): Promise<IsbnResponse>;
|
|
777
|
+
issn(value: string): Promise<IssnResponse>;
|
|
778
|
+
bic(value: string): Promise<BicResponse>;
|
|
779
|
+
cusip(value: string): Promise<CusipResponse>;
|
|
780
|
+
cfi(value: string): Promise<CfiResponse>;
|
|
781
|
+
mic(value: string): Promise<MicResponse>;
|
|
782
|
+
nuts(value: string): Promise<NutsResponse>;
|
|
783
|
+
uuid(value: string, opts?: {
|
|
784
|
+
version?: number;
|
|
785
|
+
}): Promise<UuidResponse>;
|
|
786
|
+
jwt(value: string): Promise<JwtResponse>;
|
|
787
|
+
vin(value: string): Promise<VinResponse>;
|
|
788
|
+
imei(value: string): Promise<ImeiResponse>;
|
|
789
|
+
semver(value: string): Promise<SemverResponse>;
|
|
790
|
+
color(value: string): Promise<ColorResponse>;
|
|
791
|
+
boolean(value: string): Promise<BooleanResponse>;
|
|
792
|
+
date(value: string, opts?: {
|
|
793
|
+
format?: string;
|
|
794
|
+
}): Promise<DateResponse>;
|
|
795
|
+
btcAddress(value: string): Promise<BtcAddressResponse>;
|
|
796
|
+
postalCode(value: string, opts?: {
|
|
797
|
+
countryCode?: string;
|
|
798
|
+
}): Promise<PostalCodeResponse>;
|
|
799
|
+
aba(value: string): Promise<AbaResponse>;
|
|
800
|
+
iso6346(value: string): Promise<Iso6346Response>;
|
|
801
|
+
sscc(value: string): Promise<SsccResponse>;
|
|
802
|
+
gln(value: string): Promise<GlnResponse>;
|
|
803
|
+
qr(value: string): Promise<QrResponse>;
|
|
804
|
+
creditCard(number: string): Promise<CreditCardResponse>;
|
|
805
|
+
}
|
|
806
|
+
declare function createClient(config: IsValidConfig): IsValid;
|
|
807
|
+
|
|
808
|
+
export { type AbaResponse, type AbnResponse, type AuNamespace, type BicResponse, type BooleanResponse, type BrNamespace, type BtcAddressResponse, type CfiResponse, type CnpjResponse, type ColorResponse, type CountryListItem, type CountryNamespace, type CountryResponse, type CpfResponse, type CreditCardResponse, type CurrencyListItem, type CurrencyNamespace, type CurrencyResponse, type CusipResponse, type DateResponse, type DtiResponse, type EanResponse, type EmailResponse, type EsNamespace, type GbNamespace, type GlnResponse, type GpsResponse, type GstinResponse, type IataAirlineListItem, type IataAirlineNamespace, type IataAirlineResponse, type IataAirportResponse, type IataFlightResponse, type IataNamespace, type IbanResponse, type ImeiResponse, type InNamespace, type InvalidResponse, type IpResponse, IsValid, IsValidAuthError, type IsValidConfig, IsValidError, IsValidRateLimitError, type IsbnResponse, type IsinResponse, type Iso6346Response, type IssnResponse, type JwtResponse, type KrsAddress, type KrsLookup, type KrsResponse, type LanguageListItem, type LanguageNamespace, type LanguageResponse, type LeiEntity, type LeiLou, type LeiLouItem, type LeiLousResponse, type LeiNamespace, type LeiResponse, type LeiSearchOptions, type LeiSearchResponse, type LeiSearchResult, type MacResponse, type MicResponse, type NetNamespace, type NifResponse, type NpiResponse, type NutsResponse, type PeselResponse, type PhoneResponse, type PlNamespace, type PostalCodeResponse, type QrResponse, type RegonLookup, type RegonResponse, type RetryConfig, type SemverResponse, type SortCodeResponse, type SsccResponse, type UrlResponse, type UsNamespace, type UuidResponse, type VatResponse, type VinResponse, createClient };
|