recker 1.0.14 → 1.0.15-next.3794a15
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/README.md +78 -100
- package/dist/ai/client.d.ts +2 -3
- package/dist/ai/client.d.ts.map +1 -1
- package/dist/ai/client.js +5 -6
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/cli/tui/ai-chat.js +2 -2
- package/dist/dns/index.d.ts +35 -0
- package/dist/dns/index.d.ts.map +1 -0
- package/dist/dns/index.js +124 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/recker.d.ts +47 -0
- package/dist/recker.d.ts.map +1 -0
- package/dist/recker.js +99 -0
- package/dist/transport/base-udp.d.ts.map +1 -1
- package/dist/transport/base-udp.js +1 -0
- package/dist/transport/udp-response.d.ts +2 -2
- package/dist/transport/udp-response.d.ts.map +1 -1
- package/dist/transport/udp-response.js +2 -2
- package/dist/transport/udp.d.ts +4 -3
- package/dist/transport/udp.d.ts.map +1 -1
- package/dist/transport/udp.js +16 -7
- package/dist/types/udp.d.ts +1 -0
- package/dist/types/udp.d.ts.map +1 -1
- package/dist/udp/index.d.ts +2 -2
- package/dist/udp/index.d.ts.map +1 -1
- package/dist/udp/index.js +2 -2
- package/dist/utils/whois.d.ts +18 -0
- package/dist/utils/whois.d.ts.map +1 -1
- package/dist/utils/whois.js +63 -0
- package/dist/webrtc/index.d.ts +80 -0
- package/dist/webrtc/index.d.ts.map +1 -0
- package/dist/webrtc/index.js +311 -0
- package/dist/websocket/client.d.ts +1 -1
- package/dist/websocket/client.d.ts.map +1 -1
- package/dist/websocket/client.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,158 +1,136 @@
|
|
|
1
|
-
# Recker
|
|
2
|
-
|
|
3
1
|
<div align="center">
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
# ⚡ Recker
|
|
6
4
|
|
|
7
|
-
### The
|
|
5
|
+
### The Network SDK for the AI Era
|
|
8
6
|
|
|
9
|
-
**
|
|
7
|
+
**Zero-config HTTP. Multi-protocol support. AI-native streaming. Observable to the millisecond.**
|
|
10
8
|
|
|
11
9
|
[](https://www.npmjs.com/package/recker)
|
|
12
10
|
[](https://www.npmjs.com/package/recker)
|
|
13
11
|
[](https://www.typescriptlang.org/)
|
|
14
12
|
[](https://nodejs.org/)
|
|
15
|
-
[](https://github.com/forattini-dev/recker)
|
|
16
14
|
[](https://github.com/forattini-dev/recker/blob/main/LICENSE)
|
|
17
15
|
|
|
18
|
-
[Documentation](https://forattini-dev.github.io/recker) · [
|
|
16
|
+
[Documentation](https://forattini-dev.github.io/recker) · [API Reference](./docs/reference/01-api.md) · [Examples](./docs/examples/README.md)
|
|
19
17
|
|
|
20
18
|
</div>
|
|
21
19
|
|
|
22
20
|
---
|
|
23
21
|
|
|
24
|
-
##
|
|
22
|
+
## Install
|
|
25
23
|
|
|
26
24
|
```bash
|
|
27
25
|
npm install recker
|
|
28
26
|
```
|
|
29
27
|
|
|
30
|
-
##
|
|
28
|
+
## Quick Start
|
|
31
29
|
|
|
32
30
|
```typescript
|
|
33
|
-
import {
|
|
31
|
+
import { get, post, whois, dns } from 'recker';
|
|
32
|
+
|
|
33
|
+
// HTTP - zero config
|
|
34
|
+
const users = await get('https://api.example.com/users').json();
|
|
35
|
+
await post('https://api.example.com/users', { json: { name: 'John' } });
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
// WHOIS
|
|
38
|
+
const info = await whois('github.com');
|
|
36
39
|
|
|
37
|
-
//
|
|
38
|
-
const
|
|
40
|
+
// DNS
|
|
41
|
+
const ips = await dns('google.com');
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Unified Namespace
|
|
39
45
|
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
```typescript
|
|
47
|
+
import { recker } from 'recker';
|
|
42
48
|
|
|
43
|
-
//
|
|
44
|
-
await
|
|
49
|
+
// Everything in one place
|
|
50
|
+
await recker.get('https://api.example.com/users').json();
|
|
51
|
+
await recker.whois('github.com');
|
|
52
|
+
await recker.dns('google.com');
|
|
53
|
+
await recker.ai.chat('Hello!');
|
|
54
|
+
|
|
55
|
+
const socket = recker.ws('wss://api.example.com/ws');
|
|
45
56
|
```
|
|
46
57
|
|
|
47
|
-
|
|
58
|
+
### With Configuration
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { createClient } from 'recker';
|
|
62
|
+
|
|
63
|
+
const api = createClient({
|
|
64
|
+
baseUrl: 'https://api.example.com',
|
|
65
|
+
headers: { 'Authorization': 'Bearer token' },
|
|
66
|
+
timeout: 10000,
|
|
67
|
+
retry: { maxAttempts: 3 }
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const user = await api.get('/users/:id', { params: { id: '123' } }).json();
|
|
71
|
+
```
|
|
48
72
|
|
|
49
|
-
|
|
73
|
+
## Features
|
|
50
74
|
|
|
51
75
|
| Feature | Description |
|
|
52
76
|
|:---|:---|
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
77
|
+
| **Zero Config** | Direct functions work out of the box. No setup required. |
|
|
78
|
+
| **Multi-Protocol** | HTTP, WebSocket, DNS, WHOIS, FTP, SFTP, Telnet in one SDK. |
|
|
79
|
+
| **AI-Native** | SSE streaming, token counting, provider abstraction. |
|
|
80
|
+
| **Type-Safe** | Full TypeScript with Zod schema validation. |
|
|
81
|
+
| **Observable** | DNS/TCP/TLS/TTFB timing breakdown per request. |
|
|
82
|
+
| **Resilient** | Retry, circuit breaker, rate limiting, deduplication. |
|
|
59
83
|
|
|
60
|
-
##
|
|
84
|
+
## Highlights
|
|
61
85
|
|
|
62
|
-
###
|
|
63
|
-
Handle LLM streams effortlessly with the `.sse()` iterator.
|
|
86
|
+
### AI Streaming
|
|
64
87
|
|
|
65
88
|
```typescript
|
|
66
|
-
for await (const event of
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
89
|
+
for await (const event of recker.ai.stream({
|
|
90
|
+
model: 'gpt-4',
|
|
91
|
+
messages: [{ role: 'user', content: 'Hello!' }]
|
|
92
|
+
})) {
|
|
93
|
+
process.stdout.write(event.choices[0]?.delta?.content || '');
|
|
70
94
|
}
|
|
71
95
|
```
|
|
72
96
|
|
|
73
|
-
###
|
|
74
|
-
|
|
97
|
+
### Request Timing
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
const response = await get('https://api.example.com/data');
|
|
101
|
+
console.log(response.timings);
|
|
102
|
+
// { dns: 12, tcp: 8, tls: 45, firstByte: 23, total: 156 }
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Scraping
|
|
75
106
|
|
|
76
107
|
```typescript
|
|
77
108
|
const doc = await client.scrape('https://example.com');
|
|
78
109
|
const titles = doc.selectAll('h1').map(el => el.text());
|
|
79
110
|
```
|
|
80
111
|
|
|
81
|
-
###
|
|
82
|
-
Configure advanced retry policies in declarative style.
|
|
112
|
+
### Circuit Breaker
|
|
83
113
|
|
|
84
114
|
```typescript
|
|
115
|
+
import { createClient, circuitBreaker } from 'recker';
|
|
116
|
+
|
|
85
117
|
const client = createClient({
|
|
118
|
+
baseUrl: 'https://api.example.com',
|
|
86
119
|
plugins: [
|
|
87
|
-
|
|
120
|
+
circuitBreaker({ threshold: 5, resetTimeout: 30000 })
|
|
88
121
|
]
|
|
89
122
|
});
|
|
90
123
|
```
|
|
91
124
|
|
|
92
|
-
|
|
93
|
-
Know exactly where your latency comes from.
|
|
94
|
-
|
|
95
|
-
```typescript
|
|
96
|
-
const { timings } = await client.get('/api/data');
|
|
97
|
-
console.log(timings);
|
|
98
|
-
// { dns: 12ms, tcp: 8ms, tls: 45ms, firstByte: 23ms, total: 156ms }
|
|
99
|
-
```
|
|
125
|
+
## Documentation
|
|
100
126
|
|
|
101
|
-
|
|
127
|
+
- **[Quick Start](./docs/http/01-quickstart.md)** - Get running in 2 minutes
|
|
128
|
+
- **[API Reference](./docs/reference/01-api.md)** - Complete API documentation
|
|
129
|
+
- **[Configuration](./docs/http/05-configuration.md)** - Client options
|
|
130
|
+
- **[Plugins](./docs/http/10-plugins.md)** - Extend functionality
|
|
131
|
+
- **[AI Integration](./docs/ai/01-overview.md)** - OpenAI, Anthropic, and more
|
|
132
|
+
- **[Protocols](./docs/protocols/01-websocket.md)** - WebSocket, DNS, WHOIS
|
|
102
133
|
|
|
103
|
-
|
|
104
|
-
- [Installation](./docs/getting-started/installation.md)
|
|
105
|
-
- [Quick Start](./docs/http/01-quickstart.md)
|
|
106
|
-
- [Client Configuration](./docs/http/05-configuration.md)
|
|
107
|
-
|
|
108
|
-
**Core Features**
|
|
109
|
-
- [HTTP Fundamentals](./docs/http/02-fundamentals.md)
|
|
110
|
-
- [Streaming & SSE](./docs/ai/02-streaming.md)
|
|
111
|
-
- [Retry & Resilience](./docs/http/07-resilience.md)
|
|
112
|
-
- [Caching](./docs/http/09-cache.md)
|
|
113
|
-
- [Concurrency](./docs/http/08-concurrency.md)
|
|
114
|
-
|
|
115
|
-
**Integrations**
|
|
116
|
-
- [GraphQL](./docs/http/13-graphql.md)
|
|
117
|
-
- [Scraping](./docs/http/14-scraping.md)
|
|
118
|
-
- [Plugins](./docs/http/10-plugins.md)
|
|
119
|
-
|
|
120
|
-
**Reference**
|
|
121
|
-
- [API Reference](./docs/reference/01-api.md)
|
|
122
|
-
- [Troubleshooting](./docs/reference/05-troubleshooting.md)
|
|
123
|
-
- [Examples](./docs/examples/README.md)
|
|
124
|
-
|
|
125
|
-
## ❤️ Acknowledgements
|
|
126
|
-
|
|
127
|
-
At Recker, we are passionate about these incredible open-source technologies. We are here to celebrate the past achievements that shaped the internet as we know it today, and to prepare ourselves for the future of web development.
|
|
128
|
-
|
|
129
|
-
Recker stands on the shoulders of giants. We extend our deepest gratitude to these projects:
|
|
130
|
-
|
|
131
|
-
<div align="center">
|
|
132
|
-
|
|
133
|
-
| | | |
|
|
134
|
-
|:---|:---|:---|
|
|
135
|
-
| **[Apollo Client](https://github.com/apollographql/apollo-client)** | **[Axios](https://github.com/axios/axios)** | **[Cheerio](https://github.com/cheeriojs/cheerio)** |
|
|
136
|
-
| **[Cookie](https://github.com/jshttp/cookie)** | **[Got](https://github.com/sindresorhus/got)** | **[GraphQL.js](https://github.com/graphql/graphql-js)** |
|
|
137
|
-
| **[Ky](https://github.com/sindresorhus/ky)** | **[Needle](https://github.com/tomas/needle)** | **[Node-libcurl](https://github.com/JCMais/node-libcurl)** |
|
|
138
|
-
| **[SuperAgent](https://github.com/ladjs/superagent)** | **[Undici](https://github.com/nodejs/undici)** | **[WS](https://github.com/websockets/ws)** |
|
|
139
|
-
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
## 🤝 Contributing
|
|
143
|
-
|
|
144
|
-
We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
145
|
-
|
|
146
|
-
## 📄 License
|
|
134
|
+
## License
|
|
147
135
|
|
|
148
136
|
MIT © [Forattini](https://github.com/forattini-dev)
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
<div align="center">
|
|
153
|
-
|
|
154
|
-
**Built for the AI era.**
|
|
155
|
-
|
|
156
|
-
[Documentation](https://forattini-dev.github.io/recker) · [GitHub](https://github.com/forattini-dev/recker) · [npm](https://www.npmjs.com/package/recker)
|
|
157
|
-
|
|
158
|
-
</div>
|
package/dist/ai/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AIClient, AIClientConfig, ChatOptions, AIResponse, AIStream, EmbedOptions, EmbedResponse, AIMetrics } from '../types/ai.js';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class UnifiedAIClient implements AIClient {
|
|
3
3
|
private config;
|
|
4
4
|
private providers;
|
|
5
5
|
private _metrics;
|
|
@@ -19,6 +19,5 @@ export declare class AIClientImpl implements AIClient {
|
|
|
19
19
|
private logResponse;
|
|
20
20
|
private sleep;
|
|
21
21
|
}
|
|
22
|
-
export declare function
|
|
23
|
-
export declare const ai: AIClient;
|
|
22
|
+
export declare function createAI(config?: AIClientConfig): AIClient;
|
|
24
23
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/ai/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/ai/client.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,SAAS,EAGV,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/ai/client.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAEV,QAAQ,EACR,cAAc,EACd,WAAW,EACX,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,SAAS,EAGV,MAAM,gBAAgB,CAAC;AA+IxB,qBAAa,eAAgB,YAAW,QAAQ;IAC9C,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,SAAS,CAA8C;IAC/D,OAAO,CAAC,QAAQ,CAA4C;gBAEhD,MAAM,GAAE,cAAmB;IAevC,IAAI,OAAO,IAAI,SAAS,CAEvB;IAKK,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IA8BhE,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAQ/C,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAQ1D,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,QAAQ;IAwBhD,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,gBAAgB;YAYV,gBAAgB;IAwE9B,OAAO,CAAC,WAAW;IAoBnB,OAAO,CAAC,gBAAgB;IAgCxB,OAAO,CAAC,aAAa;IAwBrB,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,KAAK;CAGd;AAiBD,wBAAgB,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,QAAQ,CAE1D"}
|
package/dist/ai/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AIError, RateLimitError, ContextLengthError, OverloadedError } from './providers/base.js';
|
|
2
2
|
import { OpenAIProvider } from './providers/openai.js';
|
|
3
3
|
import { AnthropicProvider } from './providers/anthropic.js';
|
|
4
|
-
class
|
|
4
|
+
class AIMetricsTracker {
|
|
5
5
|
data = {
|
|
6
6
|
totalRequests: 0,
|
|
7
7
|
totalTokens: 0,
|
|
@@ -87,10 +87,10 @@ class AIMetricsImpl {
|
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
export class
|
|
90
|
+
export class UnifiedAIClient {
|
|
91
91
|
config;
|
|
92
92
|
providers = new Map();
|
|
93
|
-
_metrics = new
|
|
93
|
+
_metrics = new AIMetricsTracker();
|
|
94
94
|
constructor(config = {}) {
|
|
95
95
|
this.config = {
|
|
96
96
|
defaultProvider: 'openai',
|
|
@@ -283,7 +283,6 @@ export class AIClientImpl {
|
|
|
283
283
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
export function
|
|
287
|
-
return new
|
|
286
|
+
export function createAI(config) {
|
|
287
|
+
return new UnifiedAIClient(config);
|
|
288
288
|
}
|
|
289
|
-
export const ai = createAIClient();
|
package/dist/ai/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { UnifiedAIClient, createAI } from './client.js';
|
|
2
2
|
export { BaseAIProvider, AIError, RateLimitError, ContextLengthError, OverloadedError, AuthenticationError } from './providers/base.js';
|
|
3
3
|
export { OpenAIProvider } from './providers/openai.js';
|
|
4
4
|
export { AnthropicProvider } from './providers/anthropic.js';
|
package/dist/ai/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AA2DA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AA2DA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACxI,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG1G,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAEV,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,cAAc,EACd,QAAQ,EAGR,UAAU,EACV,QAAQ,EACR,SAAS,EAGT,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EAGZ,UAAU,EACV,aAAa,EAGb,eAAe,EACf,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EAGR,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EAGZ,QAAQ,EACR,SAAS,EACT,gBAAgB,EAGhB,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,KAAK,GACN,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/ai/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { UnifiedAIClient, createAI } from './client.js';
|
|
2
2
|
export { BaseAIProvider, AIError, RateLimitError, ContextLengthError, OverloadedError, AuthenticationError } from './providers/base.js';
|
|
3
3
|
export { OpenAIProvider } from './providers/openai.js';
|
|
4
4
|
export { AnthropicProvider } from './providers/anthropic.js';
|
package/dist/cli/tui/ai-chat.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import readline from 'node:readline';
|
|
2
2
|
import pc from '../../utils/colors.js';
|
|
3
|
-
import {
|
|
3
|
+
import { createAI } from '../../ai/client.js';
|
|
4
4
|
export async function startAIChat(rl, provider = 'openai', apiKey, model) {
|
|
5
5
|
console.clear();
|
|
6
6
|
console.log(pc.bold(pc.magenta(`🤖 Rek AI Chat (${provider})`)));
|
|
@@ -14,7 +14,7 @@ Warning: No API Key found for ${provider}.`));
|
|
|
14
14
|
console.log(`Example: set ${envKey}=sk-... inside the shell.`);
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
const client =
|
|
17
|
+
const client = createAI({
|
|
18
18
|
defaultProvider: provider,
|
|
19
19
|
providers: {
|
|
20
20
|
[provider]: { apiKey: key }
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type DnsSecurityRecords } from '../utils/dns-toolkit.js';
|
|
2
|
+
export { createLookupFunction, customDNSLookup } from '../utils/dns.js';
|
|
3
|
+
export { createDoHLookup } from '../utils/doh.js';
|
|
4
|
+
export { getSecurityRecords, type DnsSecurityRecords } from '../utils/dns-toolkit.js';
|
|
5
|
+
export type { DNSOptions } from '../types/index.js';
|
|
6
|
+
export type RecordType = 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS' | 'SOA' | 'SRV' | 'CAA' | 'PTR';
|
|
7
|
+
export type DoHProvider = 'cloudflare' | 'google' | 'quad9' | 'system';
|
|
8
|
+
export interface DNSClientOptions {
|
|
9
|
+
provider?: DoHProvider;
|
|
10
|
+
timeout?: number;
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
servers?: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare class DNSClient {
|
|
15
|
+
private options;
|
|
16
|
+
constructor(options?: DNSClientOptions);
|
|
17
|
+
private log;
|
|
18
|
+
resolve(hostname: string, type?: RecordType): Promise<string[]>;
|
|
19
|
+
resolve4(hostname: string): Promise<string[]>;
|
|
20
|
+
resolve6(hostname: string): Promise<string[]>;
|
|
21
|
+
resolveMx(hostname: string): Promise<{
|
|
22
|
+
priority: number;
|
|
23
|
+
exchange: string;
|
|
24
|
+
}[]>;
|
|
25
|
+
resolveTxt(hostname: string): Promise<string[]>;
|
|
26
|
+
resolveNs(hostname: string): Promise<string[]>;
|
|
27
|
+
resolveSoa(hostname: string): Promise<import("dns").SoaRecord>;
|
|
28
|
+
resolveSrv(hostname: string): Promise<import("dns").SrvRecord[]>;
|
|
29
|
+
resolveCaa(hostname: string): Promise<import("dns").CaaRecord[]>;
|
|
30
|
+
reverse(ip: string): Promise<string[]>;
|
|
31
|
+
resolveAll(hostname: string): Promise<Record<string, unknown[]>>;
|
|
32
|
+
getSecurityRecords(domain: string): Promise<DnsSecurityRecords>;
|
|
33
|
+
}
|
|
34
|
+
export declare function createDNS(options?: DNSClientOptions): DNSClient;
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dns/index.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAgD,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGhH,OAAO,EAAE,oBAAoB,EAAE,eAAe,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AAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAO9C,UAAU,CAAC,QAAQ,EAAE,MAAM;IAO3B,UAAU,CAAC,QAAQ,EAAE,MAAM;IAO3B,UAAU,CAAC,QAAQ,EAAE,MAAM;IAO3B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAOhC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IA4BhE,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAItE;AA0BD,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAE/D"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { promises as nodeDns } from 'node:dns';
|
|
2
|
+
import { getSecurityRecords as getSecurityRecordsUtil } from '../utils/dns-toolkit.js';
|
|
3
|
+
export { createLookupFunction, customDNSLookup } from '../utils/dns.js';
|
|
4
|
+
export { createDoHLookup } from '../utils/doh.js';
|
|
5
|
+
export { getSecurityRecords } from '../utils/dns-toolkit.js';
|
|
6
|
+
export class DNSClient {
|
|
7
|
+
options;
|
|
8
|
+
constructor(options = {}) {
|
|
9
|
+
this.options = {
|
|
10
|
+
provider: options.provider ?? 'system',
|
|
11
|
+
timeout: options.timeout ?? 5000,
|
|
12
|
+
debug: options.debug ?? false,
|
|
13
|
+
servers: options.servers ?? [],
|
|
14
|
+
};
|
|
15
|
+
if (this.options.servers.length > 0 && this.options.provider === 'system') {
|
|
16
|
+
nodeDns.setServers(this.options.servers);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
log(message, ...args) {
|
|
20
|
+
if (this.options.debug) {
|
|
21
|
+
console.log(`[DNS] ${message}`, ...args);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async resolve(hostname, type = 'A') {
|
|
25
|
+
this.log(`Resolving ${hostname} (${type})`);
|
|
26
|
+
const start = Date.now();
|
|
27
|
+
try {
|
|
28
|
+
let result;
|
|
29
|
+
switch (type) {
|
|
30
|
+
case 'A':
|
|
31
|
+
result = await nodeDns.resolve4(hostname);
|
|
32
|
+
break;
|
|
33
|
+
case 'AAAA':
|
|
34
|
+
result = await nodeDns.resolve6(hostname);
|
|
35
|
+
break;
|
|
36
|
+
case 'CNAME':
|
|
37
|
+
result = await nodeDns.resolveCname(hostname);
|
|
38
|
+
break;
|
|
39
|
+
case 'NS':
|
|
40
|
+
result = await nodeDns.resolveNs(hostname);
|
|
41
|
+
break;
|
|
42
|
+
case 'PTR':
|
|
43
|
+
result = await nodeDns.resolvePtr(hostname);
|
|
44
|
+
break;
|
|
45
|
+
case 'TXT': {
|
|
46
|
+
const txt = await nodeDns.resolveTxt(hostname);
|
|
47
|
+
result = txt.map(chunks => chunks.join(''));
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
default: {
|
|
51
|
+
const records = await nodeDns.resolve(hostname, type);
|
|
52
|
+
if (Array.isArray(records)) {
|
|
53
|
+
result = records.map(r => typeof r === 'string' ? r : JSON.stringify(r));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
result = [JSON.stringify(records)];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
this.log(`Resolved ${hostname} in ${Date.now() - start}ms:`, result);
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
this.log(`Failed to resolve ${hostname}:`, error);
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
resolve4(hostname) {
|
|
69
|
+
return nodeDns.resolve4(hostname);
|
|
70
|
+
}
|
|
71
|
+
resolve6(hostname) {
|
|
72
|
+
return nodeDns.resolve6(hostname);
|
|
73
|
+
}
|
|
74
|
+
resolveMx(hostname) {
|
|
75
|
+
return nodeDns.resolveMx(hostname);
|
|
76
|
+
}
|
|
77
|
+
async resolveTxt(hostname) {
|
|
78
|
+
const records = await nodeDns.resolveTxt(hostname);
|
|
79
|
+
return records.map(chunks => chunks.join(''));
|
|
80
|
+
}
|
|
81
|
+
resolveNs(hostname) {
|
|
82
|
+
return nodeDns.resolveNs(hostname);
|
|
83
|
+
}
|
|
84
|
+
resolveSoa(hostname) {
|
|
85
|
+
return nodeDns.resolveSoa(hostname);
|
|
86
|
+
}
|
|
87
|
+
resolveSrv(hostname) {
|
|
88
|
+
return nodeDns.resolveSrv(hostname);
|
|
89
|
+
}
|
|
90
|
+
resolveCaa(hostname) {
|
|
91
|
+
return nodeDns.resolveCaa(hostname);
|
|
92
|
+
}
|
|
93
|
+
reverse(ip) {
|
|
94
|
+
return nodeDns.reverse(ip);
|
|
95
|
+
}
|
|
96
|
+
async resolveAll(hostname) {
|
|
97
|
+
this.log(`Resolving all records for ${hostname}`);
|
|
98
|
+
const results = {};
|
|
99
|
+
const tryResolve = async (type, fn) => {
|
|
100
|
+
try {
|
|
101
|
+
results[type] = await fn();
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
await Promise.all([
|
|
107
|
+
tryResolve('A', () => nodeDns.resolve4(hostname)),
|
|
108
|
+
tryResolve('AAAA', () => nodeDns.resolve6(hostname)),
|
|
109
|
+
tryResolve('MX', () => nodeDns.resolveMx(hostname)),
|
|
110
|
+
tryResolve('TXT', () => nodeDns.resolveTxt(hostname)),
|
|
111
|
+
tryResolve('NS', () => nodeDns.resolveNs(hostname)),
|
|
112
|
+
tryResolve('CAA', () => nodeDns.resolveCaa(hostname)),
|
|
113
|
+
]);
|
|
114
|
+
this.log(`Resolved all for ${hostname}:`, Object.keys(results));
|
|
115
|
+
return results;
|
|
116
|
+
}
|
|
117
|
+
async getSecurityRecords(domain) {
|
|
118
|
+
this.log(`Getting security records for ${domain}`);
|
|
119
|
+
return getSecurityRecordsUtil(domain);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
export function createDNS(options) {
|
|
123
|
+
return new DNSClient(options);
|
|
124
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -64,4 +64,6 @@ export * as protocols from './protocols/index.js';
|
|
|
64
64
|
export * from './mcp/client.js';
|
|
65
65
|
export * from './mcp/contract.js';
|
|
66
66
|
export { Client as Recker } from './core/client.js';
|
|
67
|
+
export { get, post, put, patch, del, del as delete, head, options, whois, whoisAvailable, dns, dnsSecurity, ws, recker, } from './recker.js';
|
|
68
|
+
export { default } from './recker.js';
|
|
67
69
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B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AAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAGlD,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAOpD,OAAO,EACL,GAAG,EACH,IAAI,EACJ,GAAG,EACH,KAAK,EACL,GAAG,EACH,GAAG,IAAI,MAAM,EACb,IAAI,EACJ,OAAO,EACP,KAAK,EACL,cAAc,EACd,GAAG,EACH,WAAW,EACX,EAAE,EACF,MAAM,GACP,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -64,3 +64,5 @@ export * as protocols from './protocols/index.js';
|
|
|
64
64
|
export * from './mcp/client.js';
|
|
65
65
|
export * from './mcp/contract.js';
|
|
66
66
|
export { Client as Recker } from './core/client.js';
|
|
67
|
+
export { get, post, put, patch, del, del as delete, head, options, whois, whoisAvailable, dns, dnsSecurity, ws, recker, } from './recker.js';
|
|
68
|
+
export { default } from './recker.js';
|
package/dist/recker.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Client, type ExtendedClientOptions } from './core/client.js';
|
|
2
|
+
import { type RequestPromise } from './core/request-promise.js';
|
|
3
|
+
import type { RequestOptions } from './types/index.js';
|
|
4
|
+
import { type WebSocketOptions, type ReckerWebSocket } from './websocket/client.js';
|
|
5
|
+
import { createWhois, type WhoisResult, type WhoisOptions } from './utils/whois.js';
|
|
6
|
+
import { type DNSClientOptions, type DNSClient } from './dns/index.js';
|
|
7
|
+
import type { AIClientConfig } from './types/ai.js';
|
|
8
|
+
export declare function get(url: string, options?: RequestOptions): RequestPromise;
|
|
9
|
+
export declare function post(url: string, options?: RequestOptions): RequestPromise;
|
|
10
|
+
export declare function put(url: string, options?: RequestOptions): RequestPromise;
|
|
11
|
+
export declare function patch(url: string, options?: RequestOptions): RequestPromise;
|
|
12
|
+
export declare function del(url: string, options?: RequestOptions): RequestPromise;
|
|
13
|
+
export declare function head(url: string, options?: RequestOptions): RequestPromise;
|
|
14
|
+
export declare function options(url: string, options?: RequestOptions): RequestPromise;
|
|
15
|
+
export declare function whois(query: string, options?: WhoisOptions): Promise<WhoisResult>;
|
|
16
|
+
export declare function whoisAvailable(domain: string): Promise<boolean>;
|
|
17
|
+
export declare function dns(hostname: string, type?: 'A' | 'AAAA' | 'MX' | 'TXT' | 'NS' | 'CNAME'): Promise<string[]>;
|
|
18
|
+
export declare function dnsSecurity(domain: string): Promise<import("./utils/dns-toolkit.js").DnsSecurityRecords>;
|
|
19
|
+
export declare function ws(url: string, options?: WebSocketOptions): ReckerWebSocket;
|
|
20
|
+
export declare const recker: {
|
|
21
|
+
get: typeof get;
|
|
22
|
+
post: typeof post;
|
|
23
|
+
put: typeof put;
|
|
24
|
+
patch: typeof patch;
|
|
25
|
+
delete: typeof del;
|
|
26
|
+
head: typeof head;
|
|
27
|
+
options: typeof options;
|
|
28
|
+
whois: typeof whois;
|
|
29
|
+
whoisAvailable: typeof whoisAvailable;
|
|
30
|
+
dns: typeof dns;
|
|
31
|
+
dnsSecurity: typeof dnsSecurity;
|
|
32
|
+
ws: typeof ws;
|
|
33
|
+
ai: {
|
|
34
|
+
chat: (optionsOrPrompt: string | import("./types/ai.js").ChatOptions) => Promise<import("./types/ai.js").AIResponse<string>>;
|
|
35
|
+
stream: (options: import("./types/ai.js").ChatOptions) => Promise<import("./types/ai.js").AIStream>;
|
|
36
|
+
embed: (options: import("./types/ai.js").EmbedOptions) => Promise<import("./types/ai.js").EmbedResponse>;
|
|
37
|
+
extend: (defaults: Partial<import("./types/ai.js").ChatOptions>) => import("./types/ai.js").AIClient;
|
|
38
|
+
readonly metrics: import("./types/ai.js").AIMetrics;
|
|
39
|
+
};
|
|
40
|
+
client: (options?: ExtendedClientOptions) => Client;
|
|
41
|
+
dnsClient: (options?: DNSClientOptions) => DNSClient;
|
|
42
|
+
whoisClient: typeof createWhois;
|
|
43
|
+
aiClient: (options?: AIClientConfig) => import("./types/ai.js").AIClient;
|
|
44
|
+
reset: () => void;
|
|
45
|
+
};
|
|
46
|
+
export default recker;
|
|
47
|
+
//# sourceMappingURL=recker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recker.d.ts","sourceRoot":"","sources":["../src/recker.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,MAAM,EAAgB,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAmB,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAA2C,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC7H,OAAO,EAAa,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAElF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AA0CpD,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE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