Skip to content

Commit 6e8250a

Browse files
vahmoclaude
andcommitted
feat: v0.3.1 — DNS rebinding, AbortController, SWR cache, RDAP extensions, search API, distributed rate limiting, async config validation, usage telemetry, explain(), ESM dual export
New features: - DNS Rebinding Protection (SSRFProtection.dnsRebinding) - AbortController support in all query methods (QueryAbortedError) - Stale-While-Revalidate cache strategy (StaleWhileRevalidateCache) - RDAP extensions parsing (non-RFC-7483 fields → extensions field) - RDAP Search API: searchDomains() + searchEntities() (SearchNotSupportedError) - Distributed Rate Limiting via Redis INCR+PEXPIRE (DistributedRateLimiter) - Async config validation: client.validate() + validateOnStart option - Anonymous usage telemetry opt-in (UsageTelemetry, disabled by default) - client.explain() debug helper (ExplainResult) - ESM dual export: dist/cjs + dist/esm + dist/types Tests: 1114 passing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9b8a479 commit 6e8250a

File tree

51 files changed

+1705
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1705
-44
lines changed

api-snapshot.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"CompressionManager",
1212
"ConnectionPool",
1313
"DenoFetcher",
14+
"DistributedRateLimiter",
1415
"FileAuditAdapter",
1516
"InMemoryAuditAdapter",
1617
"InjectRdapClient",
@@ -40,8 +41,10 @@
4041
"ResponseValidator",
4142
"RetryStrategy",
4243
"SSRFProtectionError",
44+
"SearchNotSupportedError",
4345
"TelemetryExporter",
4446
"TimeoutError",
47+
"UsageTelemetry",
4548
"VERSION",
4649
"ValidationError",
4750
"asciiToIdn",

package.json

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,43 @@
11
{
22
"name": "rdapify",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "Unified, secure, high-performance RDAP client with built-in SSRF protection and privacy controls",
5-
"main": "dist/index.js",
6-
"types": "dist/index.d.ts",
5+
"main": "./dist/cjs/index.js",
6+
"module": "./dist/esm/index.js",
7+
"types": "dist/types/index.d.ts",
78
"exports": {
89
".": {
9-
"types": "./dist/index.d.ts",
10-
"require": "./dist/index.js",
11-
"import": "./dist/index.js"
10+
"import": "./dist/esm/index.js",
11+
"require": "./dist/cjs/index.js",
12+
"types": "./dist/types/index.d.ts"
13+
},
14+
"./worker": {
15+
"import": "./dist/esm/index.js",
16+
"require": "./dist/cjs/index.js"
1217
},
1318
"./node": {
14-
"types": "./dist/index.d.ts",
15-
"require": "./dist/index.js",
16-
"import": "./dist/index.js"
19+
"types": "./dist/types/index.d.ts",
20+
"require": "./dist/cjs/index.js",
21+
"import": "./dist/esm/index.js"
1722
},
1823
"./deno": {
19-
"types": "./dist/index.d.ts",
20-
"default": "./dist/index.js"
21-
},
22-
"./worker": {
23-
"types": "./dist/index.d.ts",
24-
"default": "./dist/index.js"
24+
"types": "./dist/types/index.d.ts",
25+
"default": "./dist/esm/index.js"
2526
},
2627
"./errors": {
27-
"types": "./dist/shared/errors/base.error.d.ts",
28-
"require": "./dist/shared/errors/base.error.js",
29-
"import": "./dist/shared/errors/base.error.js"
28+
"types": "./dist/types/shared/errors/base.error.d.ts",
29+
"require": "./dist/cjs/shared/errors/base.error.js",
30+
"import": "./dist/esm/shared/errors/base.error.js"
3031
},
3132
"./types": {
32-
"types": "./dist/shared/types/index.d.ts",
33-
"require": "./dist/shared/types/index.js",
34-
"import": "./dist/shared/types/index.js"
33+
"types": "./dist/types/shared/types/index.d.ts",
34+
"require": "./dist/cjs/shared/types/index.js",
35+
"import": "./dist/esm/shared/types/index.js"
3536
},
3637
"./validators": {
37-
"types": "./dist/shared/utils/validators/index.d.ts",
38-
"require": "./dist/shared/utils/validators/index.js",
39-
"import": "./dist/shared/utils/validators/index.js"
38+
"types": "./dist/types/shared/utils/validators/index.d.ts",
39+
"require": "./dist/cjs/shared/utils/validators/index.js",
40+
"import": "./dist/esm/shared/utils/validators/index.js"
4041
}
4142
},
4243
"bin": {
@@ -51,7 +52,10 @@
5152
],
5253
"scripts": {
5354
"dev": "tsc --watch",
54-
"build": "npm run clean && tsc",
55+
"build:cjs": "tsc -p tsconfig.cjs.json",
56+
"build:esm": "tsc -p tsconfig.esm.json",
57+
"build:types": "tsc -p tsconfig.types.json",
58+
"build": "npm run clean && npm run build:cjs && npm run build:esm && npm run build:types",
5559
"clean": "rimraf dist",
5660
"test": "jest --runInBand",
5761
"test:unit": "jest --testPathPattern=unit",

scripts/verify-api.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ const __dirname = path.dirname(__filename);
1313
const require = createRequire(import.meta.url);
1414

1515
const SNAPSHOT_PATH = path.join(__dirname, '..', 'api-snapshot.json');
16-
const DIST_PATH = path.join(__dirname, '..', 'dist', 'index.js');
16+
// Prefer dist/cjs/index.js (dual-export layout); fall back to dist/index.js for compat
17+
const DIST_CJS = path.join(__dirname, '..', 'dist', 'cjs', 'index.js');
18+
const DIST_LEGACY = path.join(__dirname, '..', 'dist', 'index.js');
19+
const DIST_PATH = fs.existsSync(DIST_CJS) ? DIST_CJS : DIST_LEGACY;
1720

1821
// Check if dist exists
1922
if (!fs.existsSync(DIST_PATH)) {
20-
console.error('❌ dist/index.js not found. Run `npm run build` first.');
23+
console.error('❌ dist/cjs/index.js not found. Run `npm run build` first.');
2124
process.exit(1);
2225
}
2326

0 commit comments

Comments
 (0)