@internetdata/internetdata 2.16.1 → 2.18.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.
@@ -537,7 +537,7 @@ export type LookupResponse = {
537
537
  */
538
538
  is_bogon: boolean;
539
539
  /**
540
- * In VPN IP: a VPN service's server. Paid plans and the trial.
540
+ * In VPN IP: a VPN service's server. On a paid plan or the trial.
541
541
  */
542
542
  is_vpn?: boolean;
543
543
  /**
@@ -549,27 +549,27 @@ export type LookupResponse = {
549
549
  */
550
550
  is_relay: boolean;
551
551
  /**
552
- * In Residential Proxy IP's 90-day window: a residential proxy exit. Paid plans and the trial.
552
+ * In Residential Proxy IP's 90-day window: a residential proxy exit. On a paid plan or the trial.
553
553
  */
554
554
  is_resproxy?: boolean;
555
555
  /**
556
- * In Datacenter Proxy IP's 90-day window. Paid plans and the trial.
556
+ * In Datacenter Proxy IP's 90-day window. On a paid plan or the trial.
557
557
  */
558
558
  is_dcproxy?: boolean;
559
559
  /**
560
- * In Mobile Proxy IP's 90-day window. Paid plans and the trial.
560
+ * In Mobile Proxy IP's 90-day window. On a paid plan or the trial.
561
561
  */
562
562
  is_mobproxy?: boolean;
563
563
  /**
564
- * In Public Proxy IP: a public proxy listens here, or its traffic left from here. Paid plans and the trial.
564
+ * In Public Proxy IP: a public proxy listens here, or its traffic left from here. On a paid plan or the trial.
565
565
  */
566
566
  is_pubproxy?: boolean;
567
567
  /**
568
- * In Hosting IP: a hosting or cloud network. Paid plans and the trial.
568
+ * In Hosting IP: a hosting or cloud network. On a paid plan or the trial.
569
569
  */
570
570
  is_hosting?: boolean;
571
571
  /**
572
- * In CDN IP: a content delivery network. Paid plans and the trial.
572
+ * In CDN IP: a content delivery network. On a paid plan or the trial.
573
573
  */
574
574
  is_cdn?: boolean;
575
575
  /**
@@ -609,7 +609,7 @@ export type LookupResponse = {
609
609
  */
610
610
  is_bittorrent: boolean;
611
611
  /**
612
- * VPN IP's row, `{}` when `is_vpn` is false. Paid plans and the trial.
612
+ * VPN IP's row, `{}` when `is_vpn` is false. On a paid plan or the trial.
613
613
  */
614
614
  vpn?: ClassDetail;
615
615
  /**
@@ -621,59 +621,59 @@ export type LookupResponse = {
621
621
  */
622
622
  relay: ClassDetail;
623
623
  /**
624
- * `{}` when `is_resproxy` is false. Paid plans and the trial.
624
+ * `{}` when `is_resproxy` is false. On a paid plan or the trial.
625
625
  */
626
626
  resproxy?: ProxyDetail;
627
627
  /**
628
- * `{}` when `is_dcproxy` is false. Paid plans and the trial.
628
+ * `{}` when `is_dcproxy` is false. On a paid plan or the trial.
629
629
  */
630
630
  dcproxy?: ProxyDetail;
631
631
  /**
632
- * `{}` when `is_mobproxy` is false. Paid plans and the trial.
632
+ * `{}` when `is_mobproxy` is false. On a paid plan or the trial.
633
633
  */
634
634
  mobproxy?: ProxyDetail;
635
635
  /**
636
- * `{}` when `is_pubproxy` is false. Paid plans and the trial.
636
+ * `{}` when `is_pubproxy` is false. On a paid plan or the trial.
637
637
  */
638
638
  pubproxy?: PubproxyDetail;
639
639
  /**
640
- * `{}` when `is_hosting` is false. Paid plans and the trial.
640
+ * `{}` when `is_hosting` is false. On a paid plan or the trial.
641
641
  */
642
642
  hosting?: ClassDetail;
643
643
  /**
644
- * `{}` when `is_cdn` is false. Paid plans and the trial.
644
+ * `{}` when `is_cdn` is false. On a paid plan or the trial.
645
645
  */
646
646
  cdn?: ClassDetail;
647
647
  /**
648
- * `{}` when `is_bot` is false. Paid plans and the trial.
648
+ * `{}` when `is_bot` is false. On a paid plan or the trial.
649
649
  */
650
650
  bot?: BotDetail;
651
651
  /**
652
- * `{}` when `is_carrier` is false. Paid plans and the trial.
652
+ * `{}` when `is_carrier` is false. On a paid plan or the trial.
653
653
  */
654
654
  carrier?: CarrierDetail;
655
655
  /**
656
- * `{}` when `is_satellite` is false. Paid plans and the trial.
656
+ * `{}` when `is_satellite` is false. On a paid plan or the trial.
657
657
  */
658
658
  satellite?: SatelliteDetail;
659
659
  /**
660
- * `{}` when `is_ssh` is false. Paid plans and the trial.
660
+ * `{}` when `is_ssh` is false. On a paid plan or the trial.
661
661
  */
662
662
  ssh?: SshDetail;
663
663
  /**
664
- * `{}` when `is_smtp` is false. Paid plans and the trial.
664
+ * `{}` when `is_smtp` is false. On a paid plan or the trial.
665
665
  */
666
666
  smtp?: SmtpDetail;
667
667
  /**
668
- * A row per port that answered, lowest first; `[]` when `is_web` is false. Paid plans and the trial.
668
+ * A row per port that answered, lowest first; `[]` when `is_web` is false. On a paid plan or the trial.
669
669
  */
670
670
  web?: Array<WebDetail>;
671
671
  /**
672
- * `{}` when `is_dns_resolver` is false. Paid plans and the trial.
672
+ * `{}` when `is_dns_resolver` is false. On a paid plan or the trial.
673
673
  */
674
674
  dns_resolver?: DnsResolverDetail;
675
675
  /**
676
- * `{}` when `is_bittorrent` is false. Paid plans and the trial.
676
+ * `{}` when `is_bittorrent` is false. On a paid plan or the trial.
677
677
  */
678
678
  bittorrent?: BitTorrentDetail;
679
679
  location: Location;
@@ -1105,43 +1105,43 @@ export type Location = {
1105
1105
  */
1106
1106
  flag_unicode: string;
1107
1107
  /**
1108
- * Region (state or province). Paid plans and the trial.
1108
+ * Region (state or province). On a paid plan or the trial.
1109
1109
  */
1110
1110
  region?: string;
1111
1111
  /**
1112
- * ISO 3166-2 region code. Paid plans and the trial.
1112
+ * ISO 3166-2 region code. On a paid plan or the trial.
1113
1113
  */
1114
1114
  region_code?: string;
1115
1115
  /**
1116
- * City. Paid plans and the trial.
1116
+ * City. On a paid plan or the trial.
1117
1117
  */
1118
1118
  city?: string;
1119
1119
  /**
1120
- * Postal code. Paid plans and the trial.
1120
+ * Postal code. On a paid plan or the trial.
1121
1121
  */
1122
1122
  postal_code?: string;
1123
1123
  /**
1124
- * Latitude of the city. Paid plans and the trial.
1124
+ * Latitude of the city. On a paid plan or the trial.
1125
1125
  */
1126
1126
  latitude?: number;
1127
1127
  /**
1128
- * Longitude of the city. Paid plans and the trial.
1128
+ * Longitude of the city. On a paid plan or the trial.
1129
1129
  */
1130
1130
  longitude?: number;
1131
1131
  /**
1132
- * Radius in km holding the true location with 67% confidence. Paid plans and the trial.
1132
+ * Radius in km holding the true location with 67% confidence. On a paid plan or the trial.
1133
1133
  */
1134
1134
  accuracy_radius?: number;
1135
1135
  /**
1136
- * GeoNames ID of the city. Paid plans and the trial.
1136
+ * GeoNames ID of the city. On a paid plan or the trial.
1137
1137
  */
1138
1138
  geoname_id?: string;
1139
1139
  /**
1140
- * US TV market (DMA) code. Paid plans and the trial.
1140
+ * US TV market (DMA) code. On a paid plan or the trial.
1141
1141
  */
1142
1142
  dma_code?: string;
1143
1143
  /**
1144
- * The day the range's location last changed. Paid plans and the trial.
1144
+ * The day the range's location last changed. On a paid plan or the trial.
1145
1145
  */
1146
1146
  last_changed?: string;
1147
1147
  };
@@ -1191,11 +1191,11 @@ export type Company = {
1191
1191
  */
1192
1192
  domain: string;
1193
1193
  /**
1194
- * What kind of organization: hosting, isp, business, education, government. Paid plans and the trial.
1194
+ * What kind of organization: hosting, isp, business, education, government. On a paid plan or the trial.
1195
1195
  */
1196
1196
  type?: string;
1197
1197
  /**
1198
- * ISO 3166 country code. Paid plans and the trial.
1198
+ * ISO 3166 country code. On a paid plan or the trial.
1199
1199
  */
1200
1200
  country?: string;
1201
1201
  };
@@ -1208,36 +1208,36 @@ export type AbuseContact = {
1208
1208
  */
1209
1209
  email: string;
1210
1210
  /**
1211
- * The contact. Paid plans and the trial.
1211
+ * The contact. On a paid plan or the trial.
1212
1212
  */
1213
1213
  name?: string;
1214
1214
  /**
1215
- * Its phone number. Paid plans and the trial.
1215
+ * Its phone number. On a paid plan or the trial.
1216
1216
  */
1217
1217
  phone?: string;
1218
1218
  /**
1219
- * Its postal address. Paid plans and the trial.
1219
+ * Its postal address. On a paid plan or the trial.
1220
1220
  */
1221
1221
  address?: string;
1222
1222
  /**
1223
- * ISO 3166 country code. Paid plans and the trial.
1223
+ * ISO 3166 country code. On a paid plan or the trial.
1224
1224
  */
1225
1225
  country?: string;
1226
1226
  /**
1227
- * The registry block it was derived from. Paid plans and the trial.
1227
+ * The registry block it was derived from. On a paid plan or the trial.
1228
1228
  */
1229
1229
  network?: string;
1230
1230
  /**
1231
- * ARIN reports the contact answered its yearly validation. Paid plans and the trial.
1231
+ * ARIN reports the contact answered its yearly validation. On a paid plan or the trial.
1232
1232
  */
1233
1233
  validated?: boolean;
1234
1234
  /**
1235
- * Since when it has not. Paid plans and the trial.
1235
+ * Since when it has not. On a paid plan or the trial.
1236
1236
  */
1237
1237
  unvalidated_since?: string;
1238
1238
  };
1239
1239
  /**
1240
- * IP Whois's most specific record covering the address. Paid plans and the trial.
1240
+ * IP Whois's most specific record covering the address. On a paid plan or the trial.
1241
1241
  */
1242
1242
  export type Whois = {
1243
1243
  /**
@@ -1278,7 +1278,7 @@ export type Whois = {
1278
1278
  asn: number;
1279
1279
  };
1280
1280
  /**
1281
- * IP RWHOIS's most specific network covering the address. Paid plans and the trial.
1281
+ * IP RWHOIS's most specific network covering the address. On a paid plan or the trial.
1282
1282
  */
1283
1283
  export type Rwhois = {
1284
1284
  /**
@@ -1307,7 +1307,7 @@ export type Rwhois = {
1307
1307
  abuse_email: string;
1308
1308
  };
1309
1309
  /**
1310
- * From IP Hosted Domains: how many registered domains resolve to the address, and the 10 most popular. Its database lists up to 1,000 an address. Paid plans and the trial.
1310
+ * From IP Hosted Domains: how many registered domains resolve to the address, and the 10 most popular. Its database lists up to 1,000 an address. On a paid plan or the trial.
1311
1311
  */
1312
1312
  export type HostedDomains = {
1313
1313
  /**
@@ -1320,7 +1320,7 @@ export type HostedDomains = {
1320
1320
  domains?: Array<string>;
1321
1321
  };
1322
1322
  /**
1323
- * From ASN Hosted Domains: how many registered domains the AS hosts, and the 10 most popular. Its database lists up to 1,000 an AS. Paid plans and the trial.
1323
+ * From ASN Hosted Domains: how many registered domains the AS hosts, and the 10 most popular. Its database lists up to 1,000 an AS. On a paid plan or the trial.
1324
1324
  */
1325
1325
  export type AsnHostedDomains = {
1326
1326
  /**
@@ -1361,73 +1361,73 @@ export type AsnLookupResponse = {
1361
1361
  */
1362
1362
  domain: string;
1363
1363
  /**
1364
- * The kind of network it runs. Paid plans and the trial.
1364
+ * The kind of network it runs. On a paid plan or the trial.
1365
1365
  */
1366
1366
  type?: string;
1367
1367
  /**
1368
- * IPv4 addresses it announces. Paid plans and the trial.
1368
+ * IPv4 addresses it announces. On a paid plan or the trial.
1369
1369
  */
1370
1370
  num_ips?: number;
1371
1371
  /**
1372
- * IPv4 prefixes it announces. Paid plans and the trial.
1372
+ * IPv4 prefixes it announces. On a paid plan or the trial.
1373
1373
  */
1374
1374
  num_prefixes4?: number;
1375
1375
  /**
1376
- * IPv6 prefixes it announces. Paid plans and the trial.
1376
+ * IPv6 prefixes it announces. On a paid plan or the trial.
1377
1377
  */
1378
1378
  num_prefixes6?: number;
1379
1379
  /**
1380
- * Its announcements RPKI calls valid. Paid plans and the trial.
1380
+ * Its announcements RPKI calls valid. On a paid plan or the trial.
1381
1381
  */
1382
1382
  rpki_valid?: number;
1383
1383
  /**
1384
- * Invalid. Paid plans and the trial.
1384
+ * Invalid. On a paid plan or the trial.
1385
1385
  */
1386
1386
  rpki_invalid?: number;
1387
1387
  /**
1388
- * With no RPKI record. Paid plans and the trial.
1388
+ * With no RPKI record. On a paid plan or the trial.
1389
1389
  */
1390
1390
  rpki_not_found?: number;
1391
1391
  /**
1392
- * Its ASN Whois record, every column, empty where the registry states nothing. Paid plans and the trial.
1392
+ * Its ASN Whois record, every column, empty where the registry states nothing. On a paid plan or the trial.
1393
1393
  */
1394
1394
  whois?: {
1395
1395
  [key: string]: string;
1396
1396
  };
1397
1397
  /**
1398
- * What it announces, IPv4 then IPv6, up to 20000 a family. Paid plans and the trial.
1398
+ * What it announces, IPv4 then IPv6, up to 20000 a family. On a paid plan or the trial.
1399
1399
  */
1400
1400
  prefixes?: Array<AsnPrefix>;
1401
1401
  /**
1402
- * Its rank in ASN Extended, by customer cone, 1 the largest; `0` for an AS seen in no AS path. Paid plans and the trial.
1402
+ * Its rank in ASN Extended, by customer cone, 1 the largest; `0` for an AS seen in no AS path. On a paid plan or the trial.
1403
1403
  */
1404
1404
  rank?: number;
1405
1405
  /**
1406
- * Whether it is one of the transit-free networks at the top of the hierarchy, which get transit from no one and peer with each other. Paid plans and the trial.
1406
+ * Whether it is one of the transit-free networks at the top of the hierarchy, which get transit from no one and peer with each other. On a paid plan or the trial.
1407
1407
  */
1408
1408
  tier1?: boolean;
1409
1409
  /**
1410
- * How many AS numbers it gets transit from. Paid plans and the trial.
1410
+ * How many AS numbers it gets transit from. On a paid plan or the trial.
1411
1411
  */
1412
1412
  num_upstreams?: number;
1413
1413
  /**
1414
- * Those AS numbers, ascending, up to 20000. Paid plans and the trial.
1414
+ * Those AS numbers, ascending, up to 20000. On a paid plan or the trial.
1415
1415
  */
1416
1416
  upstreams?: Array<number>;
1417
1417
  /**
1418
- * How many AS numbers it exchanges its own and its customers' routes with. Paid plans and the trial.
1418
+ * How many AS numbers it exchanges its own and its customers' routes with. On a paid plan or the trial.
1419
1419
  */
1420
1420
  num_peers?: number;
1421
1421
  /**
1422
- * Those AS numbers, ascending, up to 20000. Paid plans and the trial.
1422
+ * Those AS numbers, ascending, up to 20000. On a paid plan or the trial.
1423
1423
  */
1424
1424
  peers?: Array<number>;
1425
1425
  /**
1426
- * How many AS numbers it provides transit to. Paid plans and the trial.
1426
+ * How many AS numbers it provides transit to. On a paid plan or the trial.
1427
1427
  */
1428
1428
  num_downstreams?: number;
1429
1429
  /**
1430
- * Those AS numbers, ascending, up to 20000. Paid plans and the trial.
1430
+ * Those AS numbers, ascending, up to 20000. On a paid plan or the trial.
1431
1431
  */
1432
1432
  downstreams?: Array<number>;
1433
1433
  hosted_domains?: AsnHostedDomains;
@@ -1483,7 +1483,7 @@ export type DomainLookupResponse = {
1483
1483
  */
1484
1484
  is_registered: boolean;
1485
1485
  /**
1486
- * In Disposable Domain. Paid plans and the trial.
1486
+ * In Disposable Domain. On a paid plan or the trial.
1487
1487
  */
1488
1488
  is_disposable?: boolean;
1489
1489
  /**
@@ -1508,13 +1508,13 @@ export type DomainLookupResponse = {
1508
1508
  has_cname: boolean;
1509
1509
  dns?: DomainDns;
1510
1510
  /**
1511
- * The network announcing each address in `dns.a` and then `dns.aaaa`, from IP ASN; `[]` where it resolves to none. Paid plans and the trial.
1511
+ * The network announcing each address in `dns.a` and then `dns.aaaa`, from IP ASN; `[]` where it resolves to none. On a paid plan or the trial.
1512
1512
  */
1513
1513
  hosting?: Array<DomainHost>;
1514
1514
  cohosted_domains?: CohostedDomains;
1515
1515
  ip_ranges?: DomainIpRanges;
1516
1516
  /**
1517
- * `{}` when `is_disposable` is false. Paid plans and the trial.
1517
+ * `{}` when `is_disposable` is false. On a paid plan or the trial.
1518
1518
  */
1519
1519
  disposable?: DisposableDetail;
1520
1520
  web?: DomainWeb;
@@ -1543,7 +1543,7 @@ export type DomainHost = {
1543
1543
  asn: Asn;
1544
1544
  };
1545
1545
  /**
1546
- * From IP Hosted Domains: the other registered domains on the domain's first IPv4 address, how many and the 10 most popular. Paid plans and the trial.
1546
+ * From IP Hosted Domains: the other registered domains on the domain's first IPv4 address, how many and the 10 most popular. On a paid plan or the trial.
1547
1547
  */
1548
1548
  export type CohostedDomains = {
1549
1549
  /**
@@ -1560,7 +1560,7 @@ export type CohostedDomains = {
1560
1560
  domains: Array<string>;
1561
1561
  };
1562
1562
  /**
1563
- * What our crawl last read of the domain's own home page, every member empty where it holds none. Paid plans and the trial.
1563
+ * What our crawl last read of the domain's own home page, every member empty where it holds none. On a paid plan or the trial.
1564
1564
  */
1565
1565
  export type DomainWeb = {
1566
1566
  /**
@@ -1576,7 +1576,7 @@ export type DomainWeb = {
1576
1576
  */
1577
1577
  description: string;
1578
1578
  /**
1579
- * The day it was last read.
1579
+ * The day it was last read, empty when the crawl holds no page.
1580
1580
  */
1581
1581
  last_seen: string;
1582
1582
  links: DomainWebLinks;
@@ -1595,7 +1595,7 @@ export type DomainWebLinks = {
1595
1595
  hosts: Array<string>;
1596
1596
  };
1597
1597
  /**
1598
- * The registered domains whose home page redirects to this one, how many and the 10 most popular. Paid plans and the trial.
1598
+ * The registered domains whose home page redirects to this one, how many and the 10 most popular. On a paid plan or the trial.
1599
1599
  */
1600
1600
  export type DomainRedirects = {
1601
1601
  /**
@@ -1608,7 +1608,7 @@ export type DomainRedirects = {
1608
1608
  domains: Array<string>;
1609
1609
  };
1610
1610
  /**
1611
- * The registered domains whose home page links to this one, how many and the 10 most popular. Paid plans and the trial.
1611
+ * The registered domains whose home page links to this one, how many and the 10 most popular. On a paid plan or the trial.
1612
1612
  */
1613
1613
  export type DomainBacklinks = {
1614
1614
  /**
@@ -1621,7 +1621,7 @@ export type DomainBacklinks = {
1621
1621
  domains: Array<string>;
1622
1622
  };
1623
1623
  /**
1624
- * Its records in Domain DNS, up to 100 a type. Paid plans and the trial.
1624
+ * Its records in Domain DNS, up to 100 a type. On a paid plan or the trial.
1625
1625
  */
1626
1626
  export type DomainDns = {
1627
1627
  a: Array<DnsAddressRecord>;
@@ -1675,7 +1675,7 @@ export type DnsCnameRecord = {
1675
1675
  last_seen: string;
1676
1676
  };
1677
1677
  /**
1678
- * The organization's IP ranges, from Domain IP Ranges. Paid plans and the trial.
1678
+ * The organization's IP ranges, from Domain IP Ranges. On a paid plan or the trial.
1679
1679
  */
1680
1680
  export type DomainIpRanges = {
1681
1681
  /**
@@ -1816,7 +1816,8 @@ export type EntitlementPlan = {
1816
1816
  * The plan the organization is on, as an identifier that is never
1817
1817
  * renamed or reused: `free` for the free plan, or a paid plan's key.
1818
1818
  * Compare against it and show `name`. On `free`, usage counts its
1819
- * trial, the lookups answered with every field.
1819
+ * trial, the lookups answered with every field. The Data plan is a key
1820
+ * per quota, `data_1` to `data_7`, each named Data.
1820
1821
  *
1821
1822
  */
1822
1823
  key: string;
@@ -1859,11 +1860,15 @@ export type EntitlementUsage = {
1859
1860
  */
1860
1861
  hard_limit: number | null;
1861
1862
  /**
1862
- * When the current allowance period began.
1863
+ * When the current allowance period began. On the free plan, when
1864
+ * its trial began, or now before a first lookup starts it.
1865
+ *
1863
1866
  */
1864
1867
  window_start: string;
1865
1868
  /**
1866
- * When the allowance next resets.
1869
+ * When the allowance next resets. On the free plan, when its trial
1870
+ * ends, which it does once.
1871
+ *
1867
1872
  */
1868
1873
  window_end: string;
1869
1874
  };
@@ -1 +1 @@
1
- export declare const VERSION = "2.16.1";
1
+ export declare const VERSION = "2.18.0";
@@ -1,2 +1,2 @@
1
- export const VERSION = '2.16.1';
1
+ export const VERSION = '2.18.0';
2
2
  //# sourceMappingURL=version.js.map
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { InternetData, DatabaseApi, DEFAULT_BASE_URL } from './client.js';
2
- export type { BatchOptions, CacheOptions, DownloadDestination, DownloadOptions, DownloadsOptions, DownloadUrlOptions, LookupOptions, Options, } from './client.js';
2
+ export type { BatchOptions, CacheOptions, CallOptions, DownloadDestination, DownloadOptions, DownloadsOptions, DownloadUrlOptions, LookupOptions, Options, } from './client.js';
3
3
  export { OauthApi } from './oauth.js';
4
4
  export type { OauthOptions, DeviceAuthorizationOptions, PollDeviceTokenOptions, AuthorizationUrlOptions, RegisterOptions, OauthMetadata, DeviceAuthorization, TokenResponse, Pkce, ClientRegistration, } from './oauth.js';
5
5
  export { isBogon } from './bogon.js';
@@ -7,4 +7,4 @@ export { InternetDataError, OauthError, OauthAccessDeniedError, OauthExpiredToke
7
7
  export type { ErrorKind } from './errors.js';
8
8
  export { DATABASE_FORMATS, DATASET_FORMATS, LICENSE_TYPES, STANDINGS } from './types.js';
9
9
  export type { Database, DatabaseFormat, DatabaseMetadata, DatabaseMetadataColumn, DatabaseVersion, DatasetFormat, DbChecksums, Download, LicenseType, Standing, } from './types.js';
10
- export type { Result, AsnResult, DomainResult, LookupResponse, AsnLookupResponse, DomainLookupResponse, ClassDetail, ProxyDetail, PubproxyDetail, CarrierDetail, SatelliteDetail, SshDetail, SmtpDetail, WebDetail, DnsResolverDetail, BitTorrentDetail, Location, Asn, Company, AbuseContact, Whois, Rwhois, HostedDomains, AsnPrefix, DomainDns, DnsAddressRecord, DnsMxRecord, DnsNsRecord, DnsCnameRecord, DomainIpRanges, DomainIpRange, DisposableDetail, DomainHost, CohostedDomains, DomainWeb, DomainWebLinks, DomainRedirects, DomainBacklinks, Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, } from './types.js';
10
+ export type { Result, AsnResult, DomainResult, LookupResponse, AsnLookupResponse, DomainLookupResponse, ClassDetail, ProxyDetail, PubproxyDetail, CarrierDetail, SatelliteDetail, SshDetail, SmtpDetail, WebDetail, DnsResolverDetail, BitTorrentDetail, BotDetail, UserAgentVerdict, Location, Asn, Company, AbuseContact, Whois, Rwhois, HostedDomains, AsnPrefix, DomainDns, DnsAddressRecord, DnsMxRecord, DnsNsRecord, DnsCnameRecord, DomainIpRanges, DomainIpRange, DisposableDetail, DomainHost, CohostedDomains, DomainWeb, DomainWebLinks, DomainRedirects, DomainBacklinks, Entitlement, EntitlementApikey, EntitlementPlan, EntitlementUsage, } from './types.js';
@@ -10,8 +10,9 @@ export interface NumericBound {
10
10
  lt?: number;
11
11
  }
12
12
  type LeafCondition<T> = T extends number ? number | number[] | NumericBound : T extends string ? string | string[] : T extends boolean ? boolean : never;
13
+ type MemberCondition<V> = V extends readonly (infer E)[] ? MemberCondition<NonNullable<E>> : V extends object ? ConditionOn<V> : LeafCondition<V> | false | null;
13
14
  type ConditionOn<T> = {
14
- [K in keyof T]?: NonNullable<T[K]> extends object ? ConditionOn<NonNullable<T[K]>> : LeafCondition<NonNullable<T[K]>> | false | null;
15
+ [K in keyof T]?: MemberCondition<NonNullable<T[K]>>;
15
16
  };
16
17
  /**
17
18
  * What makes a request worth blocking, written in the shape of a `Result`.
@@ -27,7 +28,10 @@ type ConditionOn<T> = {
27
28
  * { isResproxy: true, resproxy: { hits: { gte: 5 } } }
28
29
  * ```
29
30
  *
30
- * A list means OR, so any one of its entries blocking is enough.
31
+ * A list means OR, so any one of its entries blocking is enough. A member the
32
+ * answer holds as a list matches when any one element does, every member of an
33
+ * object term on the same element: `{ web: { port: 443 } }`,
34
+ * `{ pubproxy: { protocols: 'socks5' } }`.
31
35
  */
32
36
  export type BlockCondition = ConditionOn<Omit<Result, 'raw'>>;
33
37
  /** Whether an answer satisfies the condition, and should therefore be blocked. */
@@ -79,6 +79,10 @@ function matchesObject(condition, value) {
79
79
  return true;
80
80
  }
81
81
  function matchesValue(want, got) {
82
+ // Through 2.16 a term on a list member compared the list itself, so it never matched.
83
+ if (Array.isArray(got)) {
84
+ return got.some((element) => matchesValue(want, element));
85
+ }
82
86
  if (Array.isArray(want)) {
83
87
  return want.some((entry) => matchesValue(entry, got));
84
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../src/middleware/condition.ts"],"names":[],"mappings":"AA2CA,kFAAkF;AAClF,MAAM,UAAU,gBAAgB,CAC5B,SAA4C,EAAE,MAAc;IAE5D,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC/D,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAClC,GAA8B,EAAE,MAA4C,CAC/E,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,cAAc,CAC1B,SAA4C,EAAE,MAAc;IAE5D,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACpB,cAAc,CACV,GAA8B,EAAE,MAA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AE9C,SAAS,cAAc,CAAC,KAAc;IAClC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChF,CAAC"}
@@ -21,6 +21,8 @@ export interface RequestView {
21
21
  * and your edge, so this is yours to choose.
22
22
  */
23
23
  export type IpSelector<Req> = (request: Req) => string | undefined;
24
+ /** How the request's own `User-Agent` is read, for `allowBots`. */
25
+ export type UserAgentSelector<Req> = (request: Req) => string | undefined;
24
26
  /** What a lookup attached to the request, whether or not it succeeded. */
25
27
  export interface Lookup {
26
28
  /** The address that was classified, as the selector resolved it. */
@@ -72,7 +74,19 @@ export interface MiddlewareOptions<Req> {
72
74
  * become yours.
73
75
  */
74
76
  failClosed?: boolean;
75
- /** What to do when the condition names a member your plan does not serve. Default `warn`. */
77
+ /**
78
+ * Let a verified crawler through. Default false. On, the lookup sends the request's own
79
+ * `User-Agent`, and a request whose answer's `userAgent.verdict` is `verified` is never
80
+ * blocked, whatever `blockCondition` matches; the answer is still attached. An absent or
81
+ * empty header sends none. Off, no agent is sent, so the cache keeps one entry per address.
82
+ * A verdict needs every field (a paid plan or the trial): a served answer without one is
83
+ * reported once under `onMissingField`.
84
+ */
85
+ allowBots?: boolean;
86
+ /**
87
+ * What to do when the condition names a member your plan does not serve, or when `allowBots`
88
+ * sent an agent and the answer carries no verdict. Default `warn`.
89
+ */
76
90
  onMissingField?: MissingFieldAction;
77
91
  /** Skip classification for this request entirely. */
78
92
  skip?: (request: Req) => boolean;
@@ -88,9 +102,11 @@ export interface Core<Req> {
88
102
  * and decide whether the condition matched.
89
103
  *
90
104
  * Adapters own the framework-shaped parts - reading a request, attaching the
91
- * answer, and refusing a request - and share everything here.
105
+ * answer, and refusing a request - and share everything here. `userAgent`
106
+ * reads the request's `User-Agent`, which `allowBots` needs; an adapter gets
107
+ * one from `bindSelectors`.
92
108
  */
93
- export declare function createCore<Req>(options: MiddlewareOptions<Req>, defaultIpSelector: IpSelector<Req>): Core<Req>;
109
+ export declare function createCore<Req>(options: MiddlewareOptions<Req>, defaultIpSelector: IpSelector<Req>, userAgent?: UserAgentSelector<Req>): Core<Req>;
94
110
  /**
95
111
  * Selectors bound to one framework's request type.
96
112
  *
@@ -125,4 +141,6 @@ export declare function bindSelectors<Req>(view: (request: Req) => RequestView):
125
141
  * Falls back to the framework's accessor when the header is absent.
126
142
  */
127
143
  headerIpSelector: (name: string) => (request: Req) => string | undefined;
144
+ /** The request's own `User-Agent`, which `allowBots` sends. */
145
+ userAgentSelector: (request: Req) => string | undefined;
128
146
  };