@isvalid-dev/sdk 0.2.0 → 0.3.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/index.d.ts CHANGED
@@ -205,10 +205,32 @@ type MacResponse = {
205
205
  isLocal: boolean;
206
206
  isBroadcast: boolean;
207
207
  };
208
+ type NetPortResponse = {
209
+ valid: false;
210
+ } | {
211
+ valid: true;
212
+ port: number;
213
+ range: string;
214
+ wellKnown: boolean;
215
+ serviceName: string | null;
216
+ protocol: string | null;
217
+ description: string | null;
218
+ };
219
+ type NetPortListItem = {
220
+ port: number;
221
+ serviceName: string;
222
+ protocol: string;
223
+ description: string;
224
+ };
208
225
 
226
+ interface NetPortNamespace {
227
+ (value: string): Promise<NetPortResponse>;
228
+ list(): Promise<NetPortListItem[]>;
229
+ }
209
230
  interface NetNamespace {
210
231
  ip(value: string): Promise<IpResponse>;
211
232
  mac(value: string): Promise<MacResponse>;
233
+ port: NetPortNamespace;
212
234
  }
213
235
 
214
236
  type PeselResponse = {
@@ -368,6 +390,245 @@ interface GbNamespace {
368
390
  sortCode(value: string): Promise<SortCodeResponse>;
369
391
  }
370
392
 
393
+ type HsCodeResponse = {
394
+ valid: false;
395
+ code?: string;
396
+ level?: string;
397
+ error?: string;
398
+ } | {
399
+ valid: true;
400
+ code: string;
401
+ level: string;
402
+ description: string;
403
+ formatted: string;
404
+ chapter?: {
405
+ code: string;
406
+ description: string;
407
+ } | null;
408
+ heading?: {
409
+ code: string;
410
+ description: string;
411
+ } | null;
412
+ };
413
+ interface HsCodeListItem {
414
+ code: string;
415
+ level: string;
416
+ description: string;
417
+ }
418
+ type HsCodeListResponse = HsCodeListItem[];
419
+
420
+ interface HsCodeNamespace {
421
+ (value: string): Promise<HsCodeResponse>;
422
+ list(opts?: {
423
+ chapter?: string;
424
+ level?: string;
425
+ }): Promise<HsCodeListResponse>;
426
+ }
427
+
428
+ type Gs1PrefixResponse = {
429
+ valid: false;
430
+ prefix?: string;
431
+ error?: string;
432
+ } | {
433
+ valid: true;
434
+ prefix: string;
435
+ country: string;
436
+ inputType?: string;
437
+ };
438
+ interface Gs1PrefixListItem {
439
+ rangeStart: string;
440
+ rangeEnd: string;
441
+ country: string;
442
+ }
443
+ type Gs1PrefixListResponse = Gs1PrefixListItem[];
444
+
445
+ interface Gs1PrefixNamespace {
446
+ (value: string): Promise<Gs1PrefixResponse>;
447
+ list(): Promise<Gs1PrefixListResponse>;
448
+ }
449
+
450
+ type IndustryResponse = {
451
+ valid: false;
452
+ error?: string;
453
+ suggestedSystem?: string;
454
+ } | {
455
+ valid: true;
456
+ system: string;
457
+ edition: string;
458
+ code: string;
459
+ description: string;
460
+ level: string;
461
+ parent: string | null;
462
+ hierarchy: Array<{
463
+ code: string;
464
+ description: string;
465
+ }>;
466
+ };
467
+ interface IndustryListItem {
468
+ code: string;
469
+ level: string;
470
+ parent: string | null;
471
+ description: string;
472
+ }
473
+ type IndustryListResponse = IndustryListItem[];
474
+
475
+ interface IndustryNamespace {
476
+ (value: string, opts?: {
477
+ system?: string;
478
+ }): Promise<IndustryResponse>;
479
+ list(opts: {
480
+ system: string;
481
+ level?: string;
482
+ parent?: string;
483
+ }): Promise<IndustryListResponse>;
484
+ }
485
+
486
+ type TimezoneResponse = {
487
+ valid: false;
488
+ } | {
489
+ valid: true;
490
+ timezone: string;
491
+ region: string | null;
492
+ utcOffset: string;
493
+ abbreviation: string | null;
494
+ isDST: boolean;
495
+ };
496
+ type TimezoneListItem = {
497
+ timezone: string;
498
+ region: string | null;
499
+ utcOffset: string;
500
+ abbreviation: string | null;
501
+ isDST: boolean;
502
+ };
503
+
504
+ interface TimezoneNamespace {
505
+ (value: string): Promise<TimezoneResponse>;
506
+ list(opts?: {
507
+ region?: string;
508
+ }): Promise<TimezoneListItem[]>;
509
+ }
510
+
511
+ type MimeTypeResponse = {
512
+ valid: false;
513
+ type?: string;
514
+ subtype?: string;
515
+ } | {
516
+ valid: true;
517
+ mime: string;
518
+ type: string;
519
+ subtype: string;
520
+ extensions: string[];
521
+ compressible: boolean | null;
522
+ charset: string | null;
523
+ source: string | null;
524
+ };
525
+ type MimeTypeExtResponse = {
526
+ valid: false;
527
+ extension?: string;
528
+ } | {
529
+ valid: true;
530
+ extension: string;
531
+ mimeTypes: Array<{
532
+ mime: string;
533
+ type: string;
534
+ subtype: string;
535
+ extensions: string[];
536
+ compressible: boolean | null;
537
+ charset: string | null;
538
+ source: string | null;
539
+ }>;
540
+ };
541
+ type MimeTypeListItem = {
542
+ mime: string;
543
+ type: string;
544
+ subtype: string;
545
+ extensions: string[];
546
+ };
547
+
548
+ interface MimeTypeNamespace {
549
+ (value: string): Promise<MimeTypeResponse>;
550
+ ext(value: string): Promise<MimeTypeExtResponse>;
551
+ list(opts?: {
552
+ type?: string;
553
+ }): Promise<MimeTypeListItem[]>;
554
+ }
555
+
556
+ type HttpStatusResponse = {
557
+ valid: false;
558
+ } | {
559
+ valid: true;
560
+ code: number;
561
+ reasonPhrase: string;
562
+ category: string;
563
+ };
564
+ type HttpStatusListItem = {
565
+ code: number;
566
+ reasonPhrase: string;
567
+ category: string;
568
+ };
569
+
570
+ interface HttpStatusNamespace {
571
+ (value: string): Promise<HttpStatusResponse>;
572
+ list(): Promise<HttpStatusListItem[]>;
573
+ }
574
+
575
+ type SwiftMtResponse = {
576
+ valid: false;
577
+ } | {
578
+ valid: true;
579
+ type: string;
580
+ category: number;
581
+ group: string;
582
+ description: string;
583
+ };
584
+ type SwiftMtListItem = {
585
+ type: string;
586
+ category: number;
587
+ group: string;
588
+ description: string;
589
+ };
590
+
591
+ interface SwiftMtNamespace {
592
+ (value: string): Promise<SwiftMtResponse>;
593
+ list(opts?: {
594
+ category?: number;
595
+ }): Promise<SwiftMtListItem[]>;
596
+ }
597
+
598
+ type LocodeResponse = {
599
+ valid: false;
600
+ } | {
601
+ valid: true;
602
+ locode: string;
603
+ country: string;
604
+ location: string;
605
+ name: string | null;
606
+ nameAscii: string | null;
607
+ subdivision: string | null;
608
+ functions: string[];
609
+ iata: string | null;
610
+ coordinates: string | null;
611
+ found: boolean;
612
+ };
613
+ type LocodeListItem = {
614
+ locode: string;
615
+ country: string;
616
+ location: string;
617
+ name: string;
618
+ nameAscii: string;
619
+ subdivision: string | null;
620
+ functions: string[];
621
+ iata: string | null;
622
+ coordinates: string | null;
623
+ };
624
+
625
+ interface LocodeNamespace {
626
+ (value: string): Promise<LocodeResponse>;
627
+ list(opts: {
628
+ country: string;
629
+ }): Promise<LocodeListItem[]>;
630
+ }
631
+
371
632
  type EmailResponse = {
372
633
  valid: false;
373
634
  } | {
@@ -713,6 +974,132 @@ type CreditCardResponse = {
713
974
  valid: true;
714
975
  type: string;
715
976
  };
977
+ type CasResponse = {
978
+ valid: false;
979
+ error?: string;
980
+ } | {
981
+ valid: true;
982
+ formatted: string;
983
+ };
984
+ type EoriResponse = {
985
+ valid: false;
986
+ countryCode?: string;
987
+ country?: string;
988
+ error?: string;
989
+ } | {
990
+ valid: true;
991
+ countryCode: string;
992
+ country: string;
993
+ identifier: string;
994
+ formatted: string;
995
+ ec?: {
996
+ checked: boolean;
997
+ valid?: boolean;
998
+ statusDescr?: string | null;
999
+ name?: string | null;
1000
+ street?: string | null;
1001
+ postalCode?: string | null;
1002
+ city?: string | null;
1003
+ reason?: string;
1004
+ };
1005
+ };
1006
+ type OrcidResponse = {
1007
+ valid: false;
1008
+ error?: string;
1009
+ } | {
1010
+ valid: true;
1011
+ formatted: string;
1012
+ uri: string;
1013
+ profile?: {
1014
+ found: boolean;
1015
+ givenNames?: string | null;
1016
+ familyName?: string | null;
1017
+ organization?: string | null;
1018
+ reason?: string;
1019
+ };
1020
+ };
1021
+ type DoiResponse = {
1022
+ valid: false;
1023
+ error?: string;
1024
+ } | {
1025
+ valid: true;
1026
+ doi: string;
1027
+ prefix: string;
1028
+ suffix: string;
1029
+ registrantCode: string;
1030
+ registrant?: string;
1031
+ url: string;
1032
+ metadata?: {
1033
+ found: boolean;
1034
+ title?: string | null;
1035
+ authors?: string[] | null;
1036
+ publisher?: string | null;
1037
+ type?: string | null;
1038
+ issued?: unknown;
1039
+ reason?: string;
1040
+ };
1041
+ };
1042
+ type BarcodeResponse = {
1043
+ valid: false;
1044
+ error?: string;
1045
+ } | {
1046
+ valid: true;
1047
+ type: string;
1048
+ data: string;
1049
+ hasCheckDigit?: boolean;
1050
+ checkDigitValid?: boolean | null;
1051
+ encoding?: string;
1052
+ indicator?: string;
1053
+ length?: number;
1054
+ };
1055
+ type Base64Response = {
1056
+ valid: false;
1057
+ error?: string;
1058
+ } | {
1059
+ valid: true;
1060
+ variant: 'standard' | 'url-safe' | 'ambiguous';
1061
+ isPadded: boolean;
1062
+ decodedLength: number;
1063
+ };
1064
+ type EthAddressResponse = {
1065
+ valid: false;
1066
+ } | {
1067
+ valid: true;
1068
+ address: string;
1069
+ isChecksumValid: boolean;
1070
+ };
1071
+ type CronResponse = {
1072
+ valid: false;
1073
+ } | {
1074
+ valid: true;
1075
+ expression: string;
1076
+ fields: number;
1077
+ hasSeconds: boolean;
1078
+ humanReadable: string | null;
1079
+ nextRun: string;
1080
+ nextRuns: string[];
1081
+ };
1082
+ type DomainResponse = {
1083
+ valid: false;
1084
+ } | {
1085
+ valid: true;
1086
+ domain: string;
1087
+ tld: string;
1088
+ sld: string | null;
1089
+ isIDN: boolean;
1090
+ dnsValid: boolean;
1091
+ hasA: boolean;
1092
+ hasAAAA: boolean;
1093
+ };
1094
+ type RegexResponse = {
1095
+ valid: false;
1096
+ error?: string;
1097
+ } | {
1098
+ valid: true;
1099
+ pattern: string;
1100
+ flags: string | null;
1101
+ namedGroups: string[];
1102
+ };
716
1103
 
717
1104
  declare class IsValidError extends Error {
718
1105
  readonly status: number;
@@ -754,6 +1141,14 @@ declare class IsValid {
754
1141
  readonly in: InNamespace;
755
1142
  readonly us: UsNamespace;
756
1143
  readonly gb: GbNamespace;
1144
+ readonly hsCode: HsCodeNamespace;
1145
+ readonly gs1Prefix: Gs1PrefixNamespace;
1146
+ readonly industry: IndustryNamespace;
1147
+ readonly timezone: TimezoneNamespace;
1148
+ readonly mimeType: MimeTypeNamespace;
1149
+ readonly httpStatus: HttpStatusNamespace;
1150
+ readonly swiftMt: SwiftMtNamespace;
1151
+ readonly locode: LocodeNamespace;
757
1152
  constructor(config: IsValidConfig);
758
1153
  email(value: string, opts?: {
759
1154
  checkMx?: boolean;
@@ -802,7 +1197,27 @@ declare class IsValid {
802
1197
  gln(value: string): Promise<GlnResponse>;
803
1198
  qr(value: string): Promise<QrResponse>;
804
1199
  creditCard(number: string): Promise<CreditCardResponse>;
1200
+ cas(value: string): Promise<CasResponse>;
1201
+ eori(value: string, opts?: {
1202
+ check?: boolean;
1203
+ }): Promise<EoriResponse>;
1204
+ orcid(value: string, opts?: {
1205
+ lookup?: boolean;
1206
+ }): Promise<OrcidResponse>;
1207
+ doi(value: string, opts?: {
1208
+ lookup?: boolean;
1209
+ }): Promise<DoiResponse>;
1210
+ barcode(value: string, opts?: {
1211
+ type?: string;
1212
+ }): Promise<BarcodeResponse>;
1213
+ base64(value: string): Promise<Base64Response>;
1214
+ ethAddress(value: string): Promise<EthAddressResponse>;
1215
+ cron(value: string): Promise<CronResponse>;
1216
+ domain(value: string): Promise<DomainResponse>;
1217
+ regex(pattern: string, opts?: {
1218
+ flags?: string;
1219
+ }): Promise<RegexResponse>;
805
1220
  }
806
1221
  declare function createClient(config: IsValidConfig): IsValid;
807
1222
 
808
- export { type AbaResponse, type AbnResponse, type AuNamespace, type BicResponse, type BooleanResponse, type BrNamespace, type BtcAddressResponse, type CfiResponse, type CnpjResponse, type ColorResponse, type ContainerCodeResponse, 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 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 };
1223
+ export { type AbaResponse, type AbnResponse, type AuNamespace, type BarcodeResponse, type Base64Response, type BicResponse, type BooleanResponse, type BrNamespace, type BtcAddressResponse, type CasResponse, type CfiResponse, type CnpjResponse, type ColorResponse, type ContainerCodeResponse, type CountryListItem, type CountryNamespace, type CountryResponse, type CpfResponse, type CreditCardResponse, type CronResponse, type CurrencyListItem, type CurrencyNamespace, type CurrencyResponse, type CusipResponse, type DateResponse, type DoiResponse, type DomainResponse, type DtiResponse, type EanResponse, type EmailResponse, type EoriResponse, type EsNamespace, type EthAddressResponse, type GbNamespace, type GlnResponse, type GpsResponse, type Gs1PrefixListItem, type Gs1PrefixListResponse, type Gs1PrefixNamespace, type Gs1PrefixResponse, type GstinResponse, type HsCodeListItem, type HsCodeListResponse, type HsCodeNamespace, type HsCodeResponse, type HttpStatusListItem, type HttpStatusNamespace, type HttpStatusResponse, type IataAirlineListItem, type IataAirlineNamespace, type IataAirlineResponse, type IataAirportResponse, type IataFlightResponse, type IataNamespace, type IbanResponse, type ImeiResponse, type InNamespace, type IndustryListItem, type IndustryListResponse, type IndustryNamespace, type IndustryResponse, type InvalidResponse, type IpResponse, IsValid, IsValidAuthError, type IsValidConfig, IsValidError, IsValidRateLimitError, type IsbnResponse, type IsinResponse, 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 LocodeListItem, type LocodeNamespace, type LocodeResponse, type MacResponse, type MicResponse, type MimeTypeExtResponse, type MimeTypeListItem, type MimeTypeNamespace, type MimeTypeResponse, type NetNamespace, type NetPortListItem, type NetPortNamespace, type NetPortResponse, type NifResponse, type NpiResponse, type NutsResponse, type OrcidResponse, type PeselResponse, type PhoneResponse, type PlNamespace, type PostalCodeResponse, type QrResponse, type RegexResponse, type RegonLookup, type RegonResponse, type RetryConfig, type SemverResponse, type SortCodeResponse, type SsccResponse, type SwiftMtListItem, type SwiftMtNamespace, type SwiftMtResponse, type TimezoneListItem, type TimezoneNamespace, type TimezoneResponse, type UrlResponse, type UsNamespace, type UuidResponse, type VatResponse, type VinResponse, createClient };
package/dist/index.js CHANGED
@@ -68,13 +68,14 @@ var HttpClient = class {
68
68
  });
69
69
  }
70
70
  buildUrl(path, params) {
71
- const url = new URL(path, this.baseUrl);
71
+ let result = this.baseUrl + path;
72
72
  if (params) {
73
- for (const [k, v] of Object.entries(params)) {
74
- if (v !== void 0) url.searchParams.set(k, v);
73
+ const entries = Object.entries(params).filter((e) => e[1] !== void 0);
74
+ if (entries.length > 0) {
75
+ result += "?" + entries.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join("&");
75
76
  }
76
77
  }
77
- return url.toString();
78
+ return result;
78
79
  }
79
80
  async request(url, init) {
80
81
  const headers = {
@@ -158,9 +159,12 @@ function createIataNamespace(client) {
158
159
 
159
160
  // src/namespaces/net.ts
160
161
  function createNetNamespace(client) {
162
+ const port = ((value) => client.get("/v0/net/port", { value }));
163
+ port.list = () => client.get("/v0/net/port/list");
161
164
  return {
162
165
  ip: (value) => client.get("/v0/net/ip", { value }),
163
- mac: (value) => client.get("/v0/net/mac", { value })
166
+ mac: (value) => client.get("/v0/net/mac", { value }),
167
+ port
164
168
  };
165
169
  }
166
170
 
@@ -222,6 +226,73 @@ function createGbNamespace(client) {
222
226
  };
223
227
  }
224
228
 
229
+ // src/namespaces/hsCode.ts
230
+ function createHsCodeNamespace(client) {
231
+ const hsCode = ((value) => client.get("/v0/hs-code", { value }));
232
+ hsCode.list = (opts) => client.get("/v0/hs-code/list", {
233
+ chapter: opts?.chapter,
234
+ level: opts?.level
235
+ });
236
+ return hsCode;
237
+ }
238
+
239
+ // src/namespaces/gs1Prefix.ts
240
+ function createGs1PrefixNamespace(client) {
241
+ const gs1Prefix = ((value) => client.get("/v0/gs1-prefix", { value }));
242
+ gs1Prefix.list = () => client.get("/v0/gs1-prefix/list");
243
+ return gs1Prefix;
244
+ }
245
+
246
+ // src/namespaces/industry.ts
247
+ function createIndustryNamespace(client) {
248
+ const industry = ((value, opts) => client.get("/v0/industry", {
249
+ value,
250
+ system: opts?.system
251
+ }));
252
+ industry.list = (opts) => client.get("/v0/industry/list", {
253
+ system: opts.system,
254
+ level: opts?.level,
255
+ parent: opts?.parent
256
+ });
257
+ return industry;
258
+ }
259
+
260
+ // src/namespaces/timezone.ts
261
+ function createTimezoneNamespace(client) {
262
+ const timezone = ((value) => client.get("/v0/timezone", { value }));
263
+ timezone.list = (opts) => client.get("/v0/timezone/list", { region: opts?.region });
264
+ return timezone;
265
+ }
266
+
267
+ // src/namespaces/mimeType.ts
268
+ function createMimeTypeNamespace(client) {
269
+ const mimeType = ((value) => client.get("/v0/mime-type", { value }));
270
+ mimeType.ext = (value) => client.get("/v0/mime-type/ext", { value });
271
+ mimeType.list = (opts) => client.get("/v0/mime-type/list", { type: opts?.type });
272
+ return mimeType;
273
+ }
274
+
275
+ // src/namespaces/httpStatus.ts
276
+ function createHttpStatusNamespace(client) {
277
+ const httpStatus = ((value) => client.get("/v0/http-status", { value }));
278
+ httpStatus.list = () => client.get("/v0/http-status/list");
279
+ return httpStatus;
280
+ }
281
+
282
+ // src/namespaces/swiftMt.ts
283
+ function createSwiftMtNamespace(client) {
284
+ const swiftMt = ((value) => client.get("/v0/swift-mt", { value }));
285
+ swiftMt.list = (opts) => client.get("/v0/swift-mt/list", { category: opts?.category?.toString() });
286
+ return swiftMt;
287
+ }
288
+
289
+ // src/namespaces/locode.ts
290
+ function createLocodeNamespace(client) {
291
+ const locode = ((value) => client.get("/v0/locode", { value }));
292
+ locode.list = (opts) => client.get("/v0/locode/list", { country: opts.country });
293
+ return locode;
294
+ }
295
+
225
296
  // src/index.ts
226
297
  var IsValid = class {
227
298
  constructor(config) {
@@ -239,6 +310,14 @@ var IsValid = class {
239
310
  this.in = createInNamespace(this.client);
240
311
  this.us = createUsNamespace(this.client);
241
312
  this.gb = createGbNamespace(this.client);
313
+ this.hsCode = createHsCodeNamespace(this.client);
314
+ this.gs1Prefix = createGs1PrefixNamespace(this.client);
315
+ this.industry = createIndustryNamespace(this.client);
316
+ this.timezone = createTimezoneNamespace(this.client);
317
+ this.mimeType = createMimeTypeNamespace(this.client);
318
+ this.httpStatus = createHttpStatusNamespace(this.client);
319
+ this.swiftMt = createSwiftMtNamespace(this.client);
320
+ this.locode = createLocodeNamespace(this.client);
242
321
  }
243
322
  // --- Simple endpoints ---
244
323
  email(value, opts) {
@@ -341,6 +420,36 @@ var IsValid = class {
341
420
  creditCard(number) {
342
421
  return this.client.post("/v0/credit-card", { number });
343
422
  }
423
+ cas(value) {
424
+ return this.client.get("/v0/cas", { value });
425
+ }
426
+ eori(value, opts) {
427
+ return this.client.get("/v0/eori", { value, check: opts?.check?.toString() });
428
+ }
429
+ orcid(value, opts) {
430
+ return this.client.get("/v0/orcid", { value, lookup: opts?.lookup?.toString() });
431
+ }
432
+ doi(value, opts) {
433
+ return this.client.get("/v0/doi", { value, lookup: opts?.lookup?.toString() });
434
+ }
435
+ barcode(value, opts) {
436
+ return this.client.get("/v0/barcode", { value, type: opts?.type });
437
+ }
438
+ base64(value) {
439
+ return this.client.get("/v0/base64", { value });
440
+ }
441
+ ethAddress(value) {
442
+ return this.client.get("/v0/eth-address", { value });
443
+ }
444
+ cron(value) {
445
+ return this.client.get("/v0/cron", { value });
446
+ }
447
+ domain(value) {
448
+ return this.client.get("/v0/domain", { value });
449
+ }
450
+ regex(pattern, opts) {
451
+ return this.client.post("/v0/regex", { pattern, flags: opts?.flags });
452
+ }
344
453
  };
345
454
  function createClient(config) {
346
455
  return new IsValid(config);