rdapify 0.1.6 → 0.1.7

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 (59) hide show
  1. package/CHANGELOG.md +139 -94
  2. package/README.md +168 -146
  3. package/dist/application/client/RDAPClient.d.ts +3 -1
  4. package/dist/application/client/RDAPClient.d.ts.map +1 -1
  5. package/dist/application/client/RDAPClient.js +6 -0
  6. package/dist/application/client/RDAPClient.js.map +1 -1
  7. package/dist/application/hooks/MiddlewareHooks.d.ts +1 -1
  8. package/dist/application/hooks/MiddlewareHooks.d.ts.map +1 -1
  9. package/dist/application/services/BatchProcessor.d.ts +1 -0
  10. package/dist/application/services/BatchProcessor.d.ts.map +1 -1
  11. package/dist/application/services/BatchProcessor.js +9 -0
  12. package/dist/application/services/BatchProcessor.js.map +1 -1
  13. package/dist/application/services/QueryOrchestrator.d.ts +3 -1
  14. package/dist/application/services/QueryOrchestrator.d.ts.map +1 -1
  15. package/dist/application/services/QueryOrchestrator.js +192 -0
  16. package/dist/application/services/QueryOrchestrator.js.map +1 -1
  17. package/dist/cli/index.js +78 -5
  18. package/dist/cli/index.js.map +1 -1
  19. package/dist/index.d.ts +4 -3
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +14 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/infrastructure/http/BootstrapDiscovery.d.ts +1 -0
  24. package/dist/infrastructure/http/BootstrapDiscovery.d.ts.map +1 -1
  25. package/dist/infrastructure/http/BootstrapDiscovery.js +19 -0
  26. package/dist/infrastructure/http/BootstrapDiscovery.js.map +1 -1
  27. package/dist/infrastructure/http/Fetcher.js +1 -1
  28. package/dist/infrastructure/http/Normalizer.d.ts +2 -0
  29. package/dist/infrastructure/http/Normalizer.d.ts.map +1 -1
  30. package/dist/infrastructure/http/Normalizer.js +57 -0
  31. package/dist/infrastructure/http/Normalizer.js.map +1 -1
  32. package/dist/infrastructure/logging/AuditLogger.d.ts +7 -7
  33. package/dist/infrastructure/logging/AuditLogger.d.ts.map +1 -1
  34. package/dist/infrastructure/logging/AuditLogger.js.map +1 -1
  35. package/dist/infrastructure/monitoring/MetricsCollector.d.ts +3 -3
  36. package/dist/infrastructure/monitoring/MetricsCollector.d.ts.map +1 -1
  37. package/dist/infrastructure/monitoring/MetricsCollector.js.map +1 -1
  38. package/dist/shared/constants/rdap.constants.d.ts +1 -1
  39. package/dist/shared/constants/rdap.constants.js +1 -1
  40. package/dist/shared/types/generics.d.ts +6 -3
  41. package/dist/shared/types/generics.d.ts.map +1 -1
  42. package/dist/shared/types/index.d.ts +1 -1
  43. package/dist/shared/types/index.d.ts.map +1 -1
  44. package/dist/shared/types/options.js +1 -1
  45. package/dist/shared/types/responses.d.ts +42 -2
  46. package/dist/shared/types/responses.d.ts.map +1 -1
  47. package/dist/shared/utils/validators/entity.d.ts +3 -0
  48. package/dist/shared/utils/validators/entity.d.ts.map +1 -0
  49. package/dist/shared/utils/validators/entity.js +27 -0
  50. package/dist/shared/utils/validators/entity.js.map +1 -0
  51. package/dist/shared/utils/validators/index.d.ts +2 -0
  52. package/dist/shared/utils/validators/index.d.ts.map +1 -1
  53. package/dist/shared/utils/validators/index.js +7 -1
  54. package/dist/shared/utils/validators/index.js.map +1 -1
  55. package/dist/shared/utils/validators/nameserver.d.ts +3 -0
  56. package/dist/shared/utils/validators/nameserver.d.ts.map +1 -0
  57. package/dist/shared/utils/validators/nameserver.js +49 -0
  58. package/dist/shared/utils/validators/nameserver.js.map +1 -0
  59. package/package.json +6 -10
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateClientOptions = exports.isLinkLocal = exports.isLocalhost = exports.isPrivateIP = exports.normalizeASN = exports.validateASN = exports.normalizeIP = exports.validateIPv6 = exports.validateIPv4 = exports.validateIP = exports.normalizeDomain = exports.validateDomain = void 0;
3
+ exports.validateClientOptions = exports.isLinkLocal = exports.isLocalhost = exports.isPrivateIP = exports.normalizeEntityHandle = exports.validateEntityHandle = exports.normalizeNameserver = exports.validateNameserver = exports.normalizeASN = exports.validateASN = exports.normalizeIP = exports.validateIPv6 = exports.validateIPv4 = exports.validateIP = exports.normalizeDomain = exports.validateDomain = void 0;
4
4
  var domain_1 = require("./domain");
5
5
  Object.defineProperty(exports, "validateDomain", { enumerable: true, get: function () { return domain_1.validateDomain; } });
6
6
  Object.defineProperty(exports, "normalizeDomain", { enumerable: true, get: function () { return domain_1.normalizeDomain; } });
@@ -12,6 +12,12 @@ Object.defineProperty(exports, "normalizeIP", { enumerable: true, get: function
12
12
  var asn_1 = require("./asn");
13
13
  Object.defineProperty(exports, "validateASN", { enumerable: true, get: function () { return asn_1.validateASN; } });
14
14
  Object.defineProperty(exports, "normalizeASN", { enumerable: true, get: function () { return asn_1.normalizeASN; } });
15
+ var nameserver_1 = require("./nameserver");
16
+ Object.defineProperty(exports, "validateNameserver", { enumerable: true, get: function () { return nameserver_1.validateNameserver; } });
17
+ Object.defineProperty(exports, "normalizeNameserver", { enumerable: true, get: function () { return nameserver_1.normalizeNameserver; } });
18
+ var entity_1 = require("./entity");
19
+ Object.defineProperty(exports, "validateEntityHandle", { enumerable: true, get: function () { return entity_1.validateEntityHandle; } });
20
+ Object.defineProperty(exports, "normalizeEntityHandle", { enumerable: true, get: function () { return entity_1.normalizeEntityHandle; } });
15
21
  var network_1 = require("./network");
16
22
  Object.defineProperty(exports, "isPrivateIP", { enumerable: true, get: function () { return network_1.isPrivateIP; } });
17
23
  Object.defineProperty(exports, "isLocalhost", { enumerable: true, get: function () { return network_1.isLocalhost; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared/utils/validators/index.ts"],"names":[],"mappings":";;;AAKA,mCAA2D;AAAlD,wGAAA,cAAc,OAAA;AAAE,yGAAA,eAAe,OAAA;AACxC,2BAA2E;AAAlE,gGAAA,UAAU,OAAA;AAAE,kGAAA,YAAY,OAAA;AAAE,kGAAA,YAAY,OAAA;AAAE,iGAAA,WAAW,OAAA;AAC5D,6BAAkD;AAAzC,kGAAA,WAAW,OAAA;AAAE,mGAAA,YAAY,OAAA;AAClC,qCAAkE;AAAzD,sGAAA,WAAW,OAAA;AAAE,sGAAA,WAAW,OAAA;AAAE,sGAAA,WAAW,OAAA;AAG9C,yDAA4D;AAAnD,0HAAA,qBAAqB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared/utils/validators/index.ts"],"names":[],"mappings":";;;AAKA,mCAA2D;AAAlD,wGAAA,cAAc,OAAA;AAAE,yGAAA,eAAe,OAAA;AACxC,2BAA2E;AAAlE,gGAAA,UAAU,OAAA;AAAE,kGAAA,YAAY,OAAA;AAAE,kGAAA,YAAY,OAAA;AAAE,iGAAA,WAAW,OAAA;AAC5D,6BAAkD;AAAzC,kGAAA,WAAW,OAAA;AAAE,mGAAA,YAAY,OAAA;AAClC,2CAAuE;AAA9D,gHAAA,kBAAkB,OAAA;AAAE,iHAAA,mBAAmB,OAAA;AAChD,mCAAuE;AAA9D,8GAAA,oBAAoB,OAAA;AAAE,+GAAA,qBAAqB,OAAA;AACpD,qCAAkE;AAAzD,sGAAA,WAAW,OAAA;AAAE,sGAAA,WAAW,OAAA;AAAE,sGAAA,WAAW,OAAA;AAG9C,yDAA4D;AAAnD,0HAAA,qBAAqB,OAAA"}
@@ -0,0 +1,3 @@
1
+ export declare function validateNameserver(nameserver: string): void;
2
+ export declare function normalizeNameserver(nameserver: string): string;
3
+ //# sourceMappingURL=nameserver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nameserver.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/validators/nameserver.ts"],"names":[],"mappings":"AAcA,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAmD3D;AAQD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE9D"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateNameserver = validateNameserver;
4
+ exports.normalizeNameserver = normalizeNameserver;
5
+ const errors_1 = require("../../types/errors");
6
+ function validateNameserver(nameserver) {
7
+ if (!nameserver || typeof nameserver !== 'string') {
8
+ throw new errors_1.ValidationError('Nameserver must be a non-empty string', { nameserver });
9
+ }
10
+ const trimmed = nameserver.trim();
11
+ if (trimmed.length === 0) {
12
+ throw new errors_1.ValidationError('Nameserver cannot be empty', { nameserver });
13
+ }
14
+ if (trimmed.length > 253) {
15
+ throw new errors_1.ValidationError('Nameserver hostname exceeds maximum length of 253 characters', {
16
+ nameserver,
17
+ length: trimmed.length,
18
+ });
19
+ }
20
+ if (!trimmed.includes('.')) {
21
+ throw new errors_1.ValidationError('Nameserver must be a fully-qualified hostname (e.g., ns1.example.com)', { nameserver });
22
+ }
23
+ const labels = trimmed.split('.');
24
+ for (const label of labels) {
25
+ if (label.length === 0) {
26
+ throw new errors_1.ValidationError('Nameserver hostname contains empty label (double dot or leading/trailing dot)', {
27
+ nameserver,
28
+ });
29
+ }
30
+ if (label.length > 63) {
31
+ throw new errors_1.ValidationError(`Nameserver label "${label}" exceeds maximum length of 63 characters`, {
32
+ nameserver,
33
+ label,
34
+ });
35
+ }
36
+ if (!/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/.test(label) && !/^[a-zA-Z0-9]$/.test(label)) {
37
+ if (!/^[a-zA-Z0-9][a-zA-Z0-9-]*$/.test(label)) {
38
+ throw new errors_1.ValidationError(`Nameserver label "${label}" contains invalid characters`, {
39
+ nameserver,
40
+ label,
41
+ });
42
+ }
43
+ }
44
+ }
45
+ }
46
+ function normalizeNameserver(nameserver) {
47
+ return nameserver.trim().toLowerCase();
48
+ }
49
+ //# sourceMappingURL=nameserver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nameserver.js","sourceRoot":"","sources":["../../../../src/shared/utils/validators/nameserver.ts"],"names":[],"mappings":";;AA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C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAE5F,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC9C,MAAM,IAAI,wBAAe,CAAC,qBAAqB,KAAK,+BAA+B,EAAE;oBACnF,UAAU;oBACV,KAAK;iBACN,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAQD,SAAgB,mBAAmB,CAAC,UAAkB;IACpD,OAAO,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AACzC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rdapify",
3
- "version": "0.1.6",
4
- "description": "Unified, secure, high-performance RDAP client for enterprise applications with built-in privacy controls",
3
+ "version": "0.1.7",
4
+ "description": "Unified, secure, high-performance RDAP client with built-in SSRF protection and privacy controls",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -104,25 +104,21 @@
104
104
  },
105
105
  "devDependencies": {
106
106
  "@types/jest": "^29.5.11",
107
- "@types/node": "^20.11.5",
107
+ "@types/node": "^25.5.0",
108
108
  "@typescript-eslint/eslint-plugin": "^8.53.1",
109
109
  "@typescript-eslint/parser": "^8.53.1",
110
110
  "eslint": "^8.56.0",
111
- "eslint-config-prettier": "^9.1.0",
111
+ "eslint-config-prettier": "^10.1.8",
112
112
  "eslint-plugin-import": "^2.32.0",
113
113
  "eslint-plugin-prettier": "^5.1.3",
114
114
  "eslint-plugin-security": "^3.0.1",
115
- "husky": "^8.0.3",
115
+ "husky": "^9.1.7",
116
116
  "jest": "^29.7.0",
117
117
  "prettier": "^3.2.4",
118
- "rimraf": "^5.0.5",
118
+ "rimraf": "^6.1.3",
119
119
  "ts-jest": "^29.1.1",
120
120
  "typescript": "^5.9.3"
121
121
  },
122
- "funding": {
123
- "type": "opencollective",
124
- "url": "https://opencollective.com/rdapify"
125
- },
126
122
  "dependencies": {
127
123
  "ipaddr.js": "^2.3.0",
128
124
  "tslib": "^2.8.1"