rdapper 0.10.2 → 0.10.3

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.
Files changed (2) hide show
  1. package/dist/index.js +122 -51
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -316,10 +316,33 @@ const PRIVACY_NAME_KEYWORDS = [
316
316
  "withheld",
317
317
  "not disclosed",
318
318
  "protected",
319
- "protection"
319
+ "protection",
320
+ "privado",
321
+ "datos privados",
322
+ "data protected",
323
+ "data redacted",
324
+ "gdpr redacted",
325
+ "gdpr masked",
326
+ "non-public data",
327
+ "statutory masking",
328
+ "redacted.forprivacy",
329
+ "registration private",
330
+ "hidden upon user request",
331
+ "not available from registry"
332
+ ];
333
+ const NO_DATA_VALUES = [
334
+ "-",
335
+ ".",
336
+ "n/a",
337
+ "na",
338
+ "no data",
339
+ "not available",
340
+ "not applicable",
341
+ "none"
320
342
  ];
321
343
  function isPrivacyName(value) {
322
- const v = value.toLowerCase();
344
+ const v = value.toLowerCase().trim();
345
+ if (NO_DATA_VALUES.includes(v)) return true;
323
346
  return PRIVACY_NAME_KEYWORDS.some((k) => v.includes(k));
324
347
  }
325
348
 
@@ -845,6 +868,8 @@ const WHOIS_AVAILABLE_PATTERNS = [
845
868
  /\bdomain status[:\s]+available\b/i,
846
869
  /\bobject does not exist\b/i,
847
870
  /\bthe queried object does not exist\b/i,
871
+ /\bqueried object does not exist\b/i,
872
+ /\breturned 0 objects\b/i,
848
873
  /\bstatus:\s*free\b/i,
849
874
  /\bstatus:\s*available\b/i,
850
875
  /\bno object found\b/i,
@@ -867,52 +892,73 @@ function normalizeWhois(domain, tld, whoisText, whoisServer, includeRaw = false)
867
892
  const creationDate = anyValue(map, [
868
893
  "creation date",
869
894
  "created on",
895
+ "created",
870
896
  "registered on",
897
+ "registered",
898
+ "registration date",
871
899
  "domain registration date",
872
900
  "domain create date",
873
- "created",
874
- "registered",
875
901
  "domain name commencement date",
876
902
  "registration time",
877
903
  "domain record activated",
904
+ "domain registered",
905
+ "registered date",
878
906
  "assigned"
879
907
  ]);
880
908
  const updatedDate = anyValue(map, [
881
909
  "updated date",
910
+ "updated",
882
911
  "last updated",
912
+ "last updated on",
883
913
  "last update",
914
+ "last-update",
884
915
  "last modified",
885
916
  "modified",
917
+ "changed",
918
+ "modification date",
886
919
  "domain record last updated"
887
920
  ]);
888
921
  const expirationDate = anyValue(map, [
889
922
  "registry expiry date",
890
923
  "registry expiration date",
891
- "expiry date",
892
- "expiration date",
893
- "expire date",
894
- "expiration time",
895
924
  "registrar registration expiration date",
896
925
  "registrar registration expiry date",
897
926
  "registrar expiration date",
898
927
  "registrar expiry date",
899
- "domain expires",
900
- "paid-till",
928
+ "expiry date",
929
+ "expiration date",
930
+ "expiry",
931
+ "expire date",
932
+ "expire",
933
+ "expired",
901
934
  "expires on",
902
935
  "expires",
903
- "expire",
936
+ "expiration time",
937
+ "domain expires",
938
+ "paid-till",
904
939
  "renewal date",
905
- "validity"
940
+ "validity",
941
+ "record will expire on"
906
942
  ]);
907
943
  const registrar = (() => {
908
944
  const name = anyValue(map, [
909
945
  "registrar",
946
+ "registrar name",
947
+ "registrar organization",
948
+ "registrar organization name",
910
949
  "sponsoring registrar",
911
- "registrar name"
950
+ "organisation",
951
+ "record maintained by"
952
+ ]);
953
+ const ianaId = anyValue(map, [
954
+ "registrar iana id",
955
+ "sponsoring registrar iana id",
956
+ "iana id"
912
957
  ]);
913
- const ianaId = anyValue(map, ["registrar iana id", "iana id"]);
914
958
  const url = anyValue(map, [
915
959
  "registrar url",
960
+ "registrar website",
961
+ "registrar web",
916
962
  "url of the registrar",
917
963
  "referrer"
918
964
  ]);
@@ -927,7 +973,7 @@ function normalizeWhois(domain, tld, whoisText, whoisServer, includeRaw = false)
927
973
  phone: abusePhone || void 0
928
974
  };
929
975
  })();
930
- const statusLines = map["domain status"] || map.status || [];
976
+ const statusLines = map["domain status"] || map.status || map.flags || map.state || map["registration status"] || map.eppstatus || [];
931
977
  const statuses = statusLines.length ? statusLines.map((line) => ({
932
978
  status: line.split(/\s+/)[0],
933
979
  raw: line
@@ -936,7 +982,18 @@ function normalizeWhois(domain, tld, whoisText, whoisServer, includeRaw = false)
936
982
  ...map["name server"] || [],
937
983
  ...map.nameserver || [],
938
984
  ...map["name servers"] || [],
939
- ...map.nserver || []
985
+ ...map.nserver || [],
986
+ ...map["name server information"] || [],
987
+ ...map.dns || [],
988
+ ...map.hostname || [],
989
+ ...map["domain nameservers"] || [],
990
+ ...map["domain servers in listed order"] || [],
991
+ ...map["domain servers"] || [],
992
+ ...map["name servers dns"] || [],
993
+ ...map["ns 1"] || [],
994
+ ...map["ns 2"] || [],
995
+ ...map["ns 3"] || [],
996
+ ...map["ns 4"] || []
940
997
  ];
941
998
  const nameservers = nsLines.length ? uniq(nsLines.map((line) => line.trim()).filter(Boolean).map((line) => {
942
999
  const parts = line.split(/\s+/);
@@ -995,57 +1052,71 @@ function collectContacts(map) {
995
1052
  const roles = [
996
1053
  {
997
1054
  role: "registrant",
998
- prefix: "registrant"
1055
+ prefixes: [
1056
+ "registrant",
1057
+ "owner",
1058
+ "holder"
1059
+ ]
999
1060
  },
1000
1061
  {
1001
1062
  role: "admin",
1002
- prefix: "admin"
1063
+ prefixes: ["admin", "administrative"]
1003
1064
  },
1004
1065
  {
1005
1066
  role: "tech",
1006
- prefix: "tech"
1067
+ prefixes: ["tech", "technical"]
1007
1068
  },
1008
1069
  {
1009
1070
  role: "billing",
1010
- prefix: "billing"
1071
+ prefixes: ["billing"]
1011
1072
  },
1012
1073
  {
1013
1074
  role: "abuse",
1014
- prefix: "abuse"
1075
+ prefixes: ["abuse"]
1015
1076
  }
1016
1077
  ];
1017
1078
  const contacts = [];
1018
1079
  for (const r of roles) {
1019
- const name = anyValue(map, [
1020
- `${r.prefix} name`,
1021
- `${r.prefix} contact name`,
1022
- `${r.prefix}`
1023
- ]);
1024
- const org = anyValue(map, [`${r.prefix} organization`, `${r.prefix} org`]);
1025
- const email = anyValue(map, [
1026
- `${r.prefix} email`,
1027
- `${r.prefix} contact email`,
1028
- `${r.prefix} e-mail`
1029
- ]);
1030
- const phone = anyValue(map, [
1031
- `${r.prefix} phone`,
1032
- `${r.prefix} contact phone`,
1033
- `${r.prefix} telephone`
1034
- ]);
1035
- const fax = anyValue(map, [`${r.prefix} fax`, `${r.prefix} facsimile`]);
1036
- const street = multi(map, [`${r.prefix} street`, `${r.prefix} address`]);
1037
- const city = anyValue(map, [`${r.prefix} city`]);
1038
- const state = anyValue(map, [
1039
- `${r.prefix} state`,
1040
- `${r.prefix} province`,
1041
- `${r.prefix} state/province`
1042
- ]);
1043
- const postalCode = anyValue(map, [
1044
- `${r.prefix} postal code`,
1045
- `${r.prefix} postcode`,
1046
- `${r.prefix} zip`
1047
- ]);
1048
- const country = anyValue(map, [`${r.prefix} country`]);
1080
+ const nameKeys = [];
1081
+ const orgKeys = [];
1082
+ const emailKeys = [];
1083
+ const phoneKeys = [];
1084
+ const faxKeys = [];
1085
+ const streetKeys = [];
1086
+ const cityKeys = [];
1087
+ const stateKeys = [];
1088
+ const postalCodeKeys = [];
1089
+ const countryKeys = [];
1090
+ for (const prefix of r.prefixes) {
1091
+ nameKeys.push(`${prefix} name`, `${prefix} contact name`, `${prefix}`);
1092
+ if (prefix === "registrant") nameKeys.push("registrant person");
1093
+ if (prefix === "owner") nameKeys.push("owner name");
1094
+ orgKeys.push(`${prefix} organization`, `${prefix} organisation`, `${prefix} org`);
1095
+ if (prefix === "registrant") {
1096
+ orgKeys.push("trading as");
1097
+ orgKeys.push("org");
1098
+ }
1099
+ if (prefix === "owner") orgKeys.push("owner orgname");
1100
+ emailKeys.push(`${prefix} email`, `${prefix} contact email`, `${prefix} e-mail`);
1101
+ phoneKeys.push(`${prefix} phone`, `${prefix} contact phone`, `${prefix} telephone`);
1102
+ faxKeys.push(`${prefix} fax`, `${prefix} facsimile`);
1103
+ streetKeys.push(`${prefix} street`, `${prefix} address`, `${prefix}'s address`);
1104
+ if (prefix === "owner") streetKeys.push("owner addr");
1105
+ cityKeys.push(`${prefix} city`);
1106
+ stateKeys.push(`${prefix} state`, `${prefix} province`, `${prefix} state/province`);
1107
+ postalCodeKeys.push(`${prefix} postal code`, `${prefix} postcode`, `${prefix} zip`);
1108
+ countryKeys.push(`${prefix} country`);
1109
+ }
1110
+ const name = anyValue(map, nameKeys);
1111
+ const org = anyValue(map, orgKeys);
1112
+ const email = anyValue(map, emailKeys);
1113
+ const phone = anyValue(map, phoneKeys);
1114
+ const fax = anyValue(map, faxKeys);
1115
+ const street = multi(map, streetKeys);
1116
+ const city = anyValue(map, cityKeys);
1117
+ const state = anyValue(map, stateKeys);
1118
+ const postalCode = anyValue(map, postalCodeKeys);
1119
+ const country = anyValue(map, countryKeys);
1049
1120
  if (name || org || email || phone || street?.length) contacts.push({
1050
1121
  type: r.role,
1051
1122
  name: name || void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rdapper",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "license": "MIT",
5
5
  "description": "🎩 RDAP/WHOIS fetcher, parser, and normalizer for Node",
6
6
  "repository": {