aziosxjs 1.0.0 โ 1.0.2
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 +393 -93
- package/dist/adapters/httpAdapter.d.ts +18 -0
- package/dist/adapters/httpAdapter.js +156 -0
- package/dist/adapters/httpAdapter.js.map +1 -1
- package/dist/adapters/index.d.ts +1 -0
- package/dist/adapters/index.js +7 -0
- package/dist/adapters/index.js.map +1 -1
- package/dist/auth/AuthManager.d.ts +100 -0
- package/dist/auth/AuthManager.js +226 -0
- package/dist/auth/AuthManager.js.map +1 -0
- package/dist/core/Azios.d.ts +2 -0
- package/dist/core/Azios.js +45 -30
- package/dist/core/Azios.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/monitoring/RequestMonitor.d.ts +113 -0
- package/dist/monitoring/RequestMonitor.js +264 -0
- package/dist/monitoring/RequestMonitor.js.map +1 -0
- package/dist/runtimes/AdapterFactory.js +15 -1
- package/dist/runtimes/AdapterFactory.js.map +1 -1
- package/dist/types/request.d.ts +2 -0
- package/package.json +62 -49
- package/src/adapters/httpAdapter.ts +152 -0
- package/src/adapters/index.ts +1 -0
- package/src/auth/AuthManager.ts +283 -0
- package/src/core/Azios.ts +51 -31
- package/src/index.ts +16 -6
- package/src/monitoring/RequestMonitor.ts +326 -0
- package/src/runtimes/AdapterFactory.ts +17 -1
- package/src/types/request.ts +4 -0
package/README.md
CHANGED
|
@@ -1,176 +1,476 @@
|
|
|
1
1
|
# Aziosxjs
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/aziosxjs)
|
|
4
|
+
[](https://www.npmjs.com/package/aziosxjs)
|
|
5
|
+
[](https://www.npmjs.com/package/aziosxjs)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
[](https://nodejs.org/)
|
|
9
|
+
[](CONTRIBUTING.md)
|
|
4
10
|
|
|
5
|
-
|
|
11
|
+
> ๐ **Advanced HTTP client with request monitoring, built-in auth, plugins, middleware, and universal runtime support**
|
|
6
12
|
|
|
7
|
-
|
|
13
|
+
**Aziosxjs** is a modern, lightweight, and highly extensible HTTP client for JavaScript/TypeScript applications. Built for production, featuring intelligent request monitoring, native authentication management, and a powerful plugin architecture.
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
---
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
17
|
+
## ๐ Why Aziosxjs?
|
|
18
|
+
|
|
19
|
+
| Feature | Aziosxjs | Axios | Fetch |
|
|
20
|
+
|---------|----------|-------|-------|
|
|
21
|
+
| **Request Monitoring** | โ
Built-in dashboard | โ 3rd party | โ No |
|
|
22
|
+
| **Auth Manager** | โ
Native + auto-refresh | โ Manual | โ No |
|
|
23
|
+
| **Plugin System** | โ
Full lifecycle | โ No | โ No |
|
|
24
|
+
| **Middleware** | โ
Koa-style | โ No | โ No |
|
|
25
|
+
| **Interceptors** | โ
Request/Response | โ
Yes | โ No |
|
|
26
|
+
| **Retry Logic** | โ
Exponential backoff | โ No | โ No |
|
|
27
|
+
| **Caching** | โ
TTL-based | โ No | โ No |
|
|
28
|
+
| **Rate Limiting** | โ
Built-in | โ No | โ No |
|
|
29
|
+
| **TypeScript** | โ
Full support | โ
Yes | โ
Partial |
|
|
30
|
+
| **Universal Runtime** | โ
Node/Browser/Deno | โ Node/Browser | โ
Universal |
|
|
20
31
|
|
|
21
32
|
---
|
|
22
33
|
|
|
23
|
-
##
|
|
34
|
+
## ๐ Quick Start
|
|
35
|
+
|
|
36
|
+
### Installation
|
|
24
37
|
|
|
25
38
|
```bash
|
|
26
39
|
npm install aziosxjs
|
|
27
40
|
```
|
|
28
41
|
|
|
29
|
-
|
|
42
|
+
### Basic Usage
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import azios from 'aziosxjs'
|
|
46
|
+
|
|
47
|
+
// GET request
|
|
48
|
+
const user = await azios.get('https://api.example.com/users/1')
|
|
49
|
+
console.log(user.data)
|
|
30
50
|
|
|
31
|
-
|
|
51
|
+
// POST request
|
|
52
|
+
const post = await azios.post('https://api.example.com/posts', {
|
|
53
|
+
title: 'Hello World',
|
|
54
|
+
body: 'My first post'
|
|
55
|
+
})
|
|
32
56
|
|
|
33
|
-
|
|
34
|
-
|
|
57
|
+
// PUT request
|
|
58
|
+
await azios.put('https://api.example.com/posts/1', {
|
|
59
|
+
title: 'Updated Title'
|
|
60
|
+
})
|
|
35
61
|
|
|
36
|
-
|
|
37
|
-
|
|
62
|
+
// DELETE request
|
|
63
|
+
await azios.delete('https://api.example.com/posts/1')
|
|
38
64
|
```
|
|
39
65
|
|
|
40
66
|
---
|
|
41
67
|
|
|
42
|
-
##
|
|
68
|
+
## โจ Key Features
|
|
69
|
+
|
|
70
|
+
### 1. ๐ Request Monitoring & Debug Dashboard
|
|
71
|
+
|
|
72
|
+
Monitor all HTTP requests with real-time debugging:
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import azios from 'aziosxjs'
|
|
76
|
+
|
|
77
|
+
// Enable monitoring
|
|
78
|
+
azios.monitor.enable()
|
|
79
|
+
|
|
80
|
+
// Make requests...
|
|
81
|
+
await azios.get('https://api.example.com/users')
|
|
43
82
|
|
|
44
|
-
|
|
83
|
+
// View request history
|
|
84
|
+
console.log(azios.monitor.getHistory())
|
|
45
85
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
86
|
+
// Get statistics
|
|
87
|
+
console.log(azios.monitor.getStats())
|
|
88
|
+
// { totalRequests: 5, totalErrors: 1, averageDuration: 245, ... }
|
|
89
|
+
|
|
90
|
+
// Export for analysis
|
|
91
|
+
const json = azios.monitor.exportJSON()
|
|
92
|
+
const csv = azios.monitor.exportCSV()
|
|
93
|
+
|
|
94
|
+
// Filter and analyze
|
|
95
|
+
const errors = azios.monitor.getErrors()
|
|
96
|
+
const getRequests = azios.monitor.getByMethod('GET')
|
|
51
97
|
```
|
|
52
98
|
|
|
53
|
-
###
|
|
99
|
+
### 2. ๐ Built-in Authentication Manager
|
|
54
100
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
101
|
+
Enterprise-grade authentication with automatic token refresh:
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
import azios, { createAuthPlugin } from 'aziosxjs'
|
|
105
|
+
|
|
106
|
+
// Setup auth
|
|
107
|
+
const authPlugin = createAuthPlugin({
|
|
108
|
+
refreshUrl: 'https://api.example.com/auth/refresh',
|
|
109
|
+
logoutUrl: 'https://api.example.com/auth/logout'
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
await azios.installPlugin(authPlugin)
|
|
113
|
+
|
|
114
|
+
// Now all requests:
|
|
115
|
+
// โ
Attach Authorization headers
|
|
116
|
+
// โ
Detect 401 responses
|
|
117
|
+
// โ
Refresh token automatically
|
|
118
|
+
// โ
Retry with new token
|
|
64
119
|
```
|
|
65
120
|
|
|
66
|
-
###
|
|
121
|
+
### 3. ๐ Plugin System
|
|
67
122
|
|
|
68
|
-
|
|
69
|
-
import { createInstance } from "aziosxjs";
|
|
123
|
+
Extend functionality with a clean plugin architecture:
|
|
70
124
|
|
|
71
|
-
|
|
72
|
-
|
|
125
|
+
```typescript
|
|
126
|
+
import azios, { AziosPlugin } from 'aziosxjs'
|
|
127
|
+
|
|
128
|
+
const loggingPlugin: AziosPlugin = {
|
|
129
|
+
name: 'logger',
|
|
130
|
+
version: '1.0.0',
|
|
131
|
+
hooks: {
|
|
132
|
+
beforeRequest: (config) => {
|
|
133
|
+
console.log(`๐ก ${config.method} ${config.url}`)
|
|
134
|
+
return config
|
|
135
|
+
},
|
|
136
|
+
afterResponse: (response) => {
|
|
137
|
+
console.log(`โ
Status: ${response.status}`)
|
|
138
|
+
return response
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
await azios.installPlugin(loggingPlugin)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 4. โ๏ธ Middleware Pipeline
|
|
147
|
+
|
|
148
|
+
Koa-style middleware for request processing:
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
azios.use(async (ctx, next) => {
|
|
152
|
+
console.log('Before request')
|
|
153
|
+
await next()
|
|
154
|
+
console.log('After response')
|
|
155
|
+
})
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 5. ๐ Interceptors
|
|
159
|
+
|
|
160
|
+
Intercept and transform requests/responses:
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
azios.interceptors.request.use(
|
|
164
|
+
(config) => {
|
|
165
|
+
config.headers.Authorization = `Bearer ${token}`
|
|
166
|
+
return config
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
azios.interceptors.response.use(
|
|
171
|
+
(response) => response,
|
|
172
|
+
(error) => {
|
|
173
|
+
if (error.response?.status === 401) {
|
|
174
|
+
// Handle unauthorized
|
|
175
|
+
}
|
|
176
|
+
return Promise.reject(error)
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### 6. โก Performance Features
|
|
182
|
+
|
|
183
|
+
#### Retry with Exponential Backoff
|
|
184
|
+
```typescript
|
|
185
|
+
await azios.get('/api/data', {
|
|
186
|
+
retry: 3, // Retry 3 times
|
|
187
|
+
retryDelay: 1000 // 1s, 2s, 4s delays
|
|
188
|
+
})
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
#### Response Caching
|
|
192
|
+
```typescript
|
|
193
|
+
await azios.get('/api/users', {
|
|
194
|
+
cache: true, // Enable caching
|
|
195
|
+
cacheTTL: 60000 // Cache for 60 seconds
|
|
196
|
+
})
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
#### Rate Limiting
|
|
200
|
+
```typescript
|
|
201
|
+
await azios.post('/api/data', payload, {
|
|
202
|
+
rateLimit: 1000 // 1 request per second
|
|
203
|
+
})
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### Request Deduplication
|
|
207
|
+
```typescript
|
|
208
|
+
// Both use the same network call
|
|
209
|
+
const [data1, data2] = await Promise.all([
|
|
210
|
+
azios.get('/api/users/1'),
|
|
211
|
+
azios.get('/api/users/1')
|
|
212
|
+
])
|
|
73
213
|
```
|
|
74
214
|
|
|
75
215
|
---
|
|
76
216
|
|
|
77
|
-
##
|
|
217
|
+
## ๐ Complete Examples
|
|
78
218
|
|
|
79
|
-
###
|
|
219
|
+
### Example 1: Simple GET/POST
|
|
80
220
|
|
|
81
|
-
|
|
221
|
+
```typescript
|
|
222
|
+
import azios from 'aziosxjs'
|
|
82
223
|
|
|
83
|
-
|
|
84
|
-
|
|
224
|
+
async function main() {
|
|
225
|
+
const users = await azios.get('https://jsonplaceholder.typicode.com/users')
|
|
226
|
+
console.log(users.data)
|
|
85
227
|
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
228
|
+
const post = await azios.post('https://jsonplaceholder.typicode.com/posts', {
|
|
229
|
+
title: 'My Post',
|
|
230
|
+
body: 'Content',
|
|
231
|
+
userId: 1
|
|
232
|
+
})
|
|
233
|
+
console.log(post.data)
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Example 2: With Request Monitoring
|
|
96
238
|
|
|
97
|
-
|
|
239
|
+
```typescript
|
|
240
|
+
azios.monitor.enable()
|
|
241
|
+
|
|
242
|
+
await azios.get('https://api.example.com/users')
|
|
243
|
+
await azios.post('https://api.example.com/data', { /* data */ })
|
|
244
|
+
|
|
245
|
+
console.log(azios.monitor.getSummary())
|
|
246
|
+
console.log(azios.monitor.getStats())
|
|
98
247
|
```
|
|
99
248
|
|
|
100
|
-
###
|
|
249
|
+
### Example 3: With Authentication
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
const authPlugin = createAuthPlugin({
|
|
253
|
+
refreshUrl: 'https://api.example.com/refresh',
|
|
254
|
+
logoutUrl: 'https://api.example.com/logout'
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
await azios.installPlugin(authPlugin)
|
|
258
|
+
|
|
259
|
+
// Requests automatically handle auth and token refresh
|
|
260
|
+
const data = await azios.get('https://api.example.com/protected')
|
|
261
|
+
```
|
|
101
262
|
|
|
102
|
-
|
|
263
|
+
### Example 4: Custom Instances
|
|
103
264
|
|
|
104
|
-
```
|
|
105
|
-
import
|
|
265
|
+
```typescript
|
|
266
|
+
import { createInstance } from 'aziosxjs'
|
|
106
267
|
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
268
|
+
const api = createInstance({
|
|
269
|
+
baseURL: 'https://api.example.com',
|
|
270
|
+
timeout: 10000,
|
|
271
|
+
headers: {
|
|
272
|
+
'X-Custom-Header': 'value'
|
|
273
|
+
}
|
|
274
|
+
})
|
|
113
275
|
|
|
114
|
-
|
|
276
|
+
const data = await api.get('/users')
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Example 5: Advanced Configuration
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
const response = await azios.request({
|
|
283
|
+
url: '/api/users',
|
|
284
|
+
method: 'GET',
|
|
285
|
+
baseURL: 'https://api.example.com',
|
|
286
|
+
headers: { Authorization: 'Bearer token' },
|
|
287
|
+
params: { page: 1, limit: 10 },
|
|
288
|
+
timeout: 5000,
|
|
289
|
+
retry: 2,
|
|
290
|
+
retryDelay: 500,
|
|
291
|
+
cache: true,
|
|
292
|
+
cacheTTL: 30000,
|
|
293
|
+
rateLimit: 1000
|
|
294
|
+
})
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## ๐ง Configuration
|
|
300
|
+
|
|
301
|
+
### Request Config API
|
|
302
|
+
|
|
303
|
+
```typescript
|
|
304
|
+
interface AziosRequestConfig {
|
|
305
|
+
url?: string
|
|
306
|
+
method?: string
|
|
307
|
+
baseURL?: string
|
|
308
|
+
headers?: Record<string, any>
|
|
309
|
+
params?: Record<string, any>
|
|
310
|
+
data?: any
|
|
311
|
+
timeout?: number
|
|
312
|
+
responseType?: string
|
|
313
|
+
signal?: AbortSignal
|
|
314
|
+
retry?: number
|
|
315
|
+
retryDelay?: number
|
|
316
|
+
cache?: boolean
|
|
317
|
+
cacheTTL?: number
|
|
318
|
+
rateLimit?: number
|
|
319
|
+
}
|
|
115
320
|
```
|
|
116
321
|
|
|
117
322
|
---
|
|
118
323
|
|
|
119
|
-
##
|
|
324
|
+
## ๐ฆ TypeScript Support
|
|
325
|
+
|
|
326
|
+
Full TypeScript support with complete type safety:
|
|
120
327
|
|
|
121
|
-
|
|
328
|
+
```typescript
|
|
329
|
+
import azios, {
|
|
330
|
+
AziosInstance,
|
|
331
|
+
AziosRequestConfig,
|
|
332
|
+
AziosResponse,
|
|
333
|
+
RequestLog,
|
|
334
|
+
TokenConfig
|
|
335
|
+
} from 'aziosxjs'
|
|
122
336
|
|
|
123
|
-
|
|
124
|
-
await azios.get("/unstable", { retry: 3, retryDelay: 500 });
|
|
337
|
+
const response: AziosResponse = await azios.get('/api/users')
|
|
125
338
|
```
|
|
126
339
|
|
|
127
|
-
|
|
340
|
+
---
|
|
128
341
|
|
|
129
|
-
|
|
342
|
+
## ๐ Universal Runtime Support
|
|
130
343
|
|
|
131
|
-
|
|
344
|
+
Works across different JavaScript runtimes:
|
|
132
345
|
|
|
133
|
-
```
|
|
134
|
-
|
|
346
|
+
```typescript
|
|
347
|
+
import { detectRuntime, currentRuntime } from 'aziosxjs'
|
|
348
|
+
|
|
349
|
+
console.log(currentRuntime) // 'node' | 'browser' | 'deno' | 'bun'
|
|
135
350
|
```
|
|
136
351
|
|
|
137
|
-
|
|
352
|
+
Supported: Node.js, Browser, Deno, Bun
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## ๐ฏ API Reference
|
|
357
|
+
|
|
358
|
+
### Monitoring API
|
|
359
|
+
|
|
360
|
+
```typescript
|
|
361
|
+
azios.monitor.enable() // Enable tracking
|
|
362
|
+
azios.monitor.disable() // Disable tracking
|
|
363
|
+
azios.monitor.getHistory() // Get all logs
|
|
364
|
+
azios.monitor.getStats() // Get statistics
|
|
365
|
+
azios.monitor.getErrors() // Get failed requests
|
|
366
|
+
azios.monitor.getByMethod(method) // Filter by HTTP method
|
|
367
|
+
azios.monitor.getByUrl(pattern) // Filter by URL
|
|
368
|
+
azios.monitor.exportJSON() // Export as JSON
|
|
369
|
+
azios.monitor.exportCSV() // Export as CSV
|
|
370
|
+
azios.monitor.getSummary() // Get formatted summary
|
|
371
|
+
azios.monitor.clear() // Clear all logs
|
|
372
|
+
```
|
|
138
373
|
|
|
139
|
-
|
|
140
|
-
|
|
374
|
+
### Auth Manager API
|
|
375
|
+
|
|
376
|
+
```typescript
|
|
377
|
+
const auth = new AuthManager()
|
|
378
|
+
|
|
379
|
+
auth.initialize(endpoints) // Setup endpoints
|
|
380
|
+
auth.setToken(token) // Store token
|
|
381
|
+
auth.getToken() // Get stored token
|
|
382
|
+
auth.getAccessToken() // Get access token string
|
|
383
|
+
auth.hasToken() // Check if token exists
|
|
384
|
+
auth.isTokenExpired() // Check expiration
|
|
385
|
+
auth.refreshAccessToken() // Refresh token
|
|
386
|
+
auth.attachAuthHeader(config) // Add auth header
|
|
387
|
+
auth.handle401(config) // Handle 401 response
|
|
388
|
+
auth.logout() // Logout and clear
|
|
389
|
+
auth.getStatus() // Get auth status
|
|
141
390
|
```
|
|
142
391
|
|
|
143
392
|
---
|
|
144
393
|
|
|
145
|
-
##
|
|
394
|
+
## ๐ก๏ธ Best Practices
|
|
146
395
|
|
|
147
|
-
|
|
396
|
+
### Security
|
|
397
|
+
|
|
398
|
+
```typescript
|
|
399
|
+
// โ
DO: Use secure token storage
|
|
400
|
+
const authPlugin = createAuthPlugin({
|
|
401
|
+
refreshUrl: 'https://api.example.com/auth/refresh',
|
|
402
|
+
logoutUrl: 'https://api.example.com/auth/logout'
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
// โ DON'T: Store tokens in localStorage
|
|
406
|
+
// localStorage.setItem('token', sensitiveToken)
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
### Error Handling
|
|
410
|
+
|
|
411
|
+
```typescript
|
|
412
|
+
import { AziosError } from 'aziosxjs'
|
|
148
413
|
|
|
149
|
-
```js
|
|
150
414
|
try {
|
|
151
|
-
await azios.get(
|
|
152
|
-
} catch (
|
|
153
|
-
|
|
415
|
+
await azios.get('/api/users')
|
|
416
|
+
} catch (error) {
|
|
417
|
+
if (error instanceof AziosError) {
|
|
418
|
+
console.log(`[${error.response?.status}] ${error.message}`)
|
|
419
|
+
}
|
|
154
420
|
}
|
|
155
421
|
```
|
|
156
422
|
|
|
423
|
+
### Production Monitoring
|
|
424
|
+
|
|
425
|
+
```typescript
|
|
426
|
+
if (process.env.NODE_ENV === 'development') {
|
|
427
|
+
azios.monitor.enable()
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
setInterval(() => {
|
|
431
|
+
const stats = azios.monitor.getStats()
|
|
432
|
+
if (stats.totalErrors > 10) {
|
|
433
|
+
alerting.warn('High error rate!')
|
|
434
|
+
}
|
|
435
|
+
}, 60000)
|
|
436
|
+
```
|
|
437
|
+
|
|
157
438
|
---
|
|
158
439
|
|
|
159
|
-
##
|
|
440
|
+
## ๐งช Testing
|
|
160
441
|
|
|
161
442
|
```bash
|
|
162
|
-
npm test
|
|
443
|
+
npm test # Run all tests
|
|
444
|
+
npm run test:sprint8:monitoring # Test monitoring
|
|
445
|
+
npm run test:sprint8:auth # Test auth
|
|
163
446
|
```
|
|
164
447
|
|
|
165
448
|
---
|
|
166
449
|
|
|
167
|
-
##
|
|
450
|
+
## ๐ Documentation
|
|
451
|
+
|
|
452
|
+
- [Full Documentation](./docs/)
|
|
453
|
+
- [Examples](./examples/)
|
|
454
|
+
- [Changelog](./CHANGELOG.md)
|
|
455
|
+
|
|
456
|
+
---
|
|
457
|
+
|
|
458
|
+
## ๐ค Contributing
|
|
459
|
+
|
|
460
|
+
Contributions welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
461
|
+
|
|
462
|
+
---
|
|
463
|
+
|
|
464
|
+
## ๐ License
|
|
168
465
|
|
|
169
|
-
|
|
466
|
+
MIT ยฉ 2024 [Azeem Ali](https://github.com/azeemali2001)
|
|
170
467
|
|
|
171
468
|
---
|
|
172
469
|
|
|
173
|
-
##
|
|
470
|
+
## ๐ Support
|
|
174
471
|
|
|
175
|
-
|
|
472
|
+
- ๐ [Documentation](https://github.com/azeemali2001/azios)
|
|
473
|
+
- ๐ [Report Issues](https://github.com/azeemali2001/azios/issues)
|
|
474
|
+
- ๐ฌ [Discussions](https://github.com/azeemali2001/azios/discussions)
|
|
176
475
|
|
|
476
|
+
**Made with โค๏ธ for the JavaScript community**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AziosRequestConfig } from '../types/config';
|
|
2
|
+
import type { AziosResponse } from '../types/response';
|
|
3
|
+
import { BaseAdapter } from '../runtimes/HttpAdapter';
|
|
4
|
+
/**
|
|
5
|
+
* Node.js HTTP adapter using built-in http/https modules
|
|
6
|
+
* Compatible with Node.js 16+ (before global fetch was available)
|
|
7
|
+
*/
|
|
8
|
+
export declare class NodeHttpAdapter extends BaseAdapter {
|
|
9
|
+
/**
|
|
10
|
+
* Check if this adapter is supported (Node.js environment)
|
|
11
|
+
*/
|
|
12
|
+
isSupported(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Execute HTTP request using Node.js http/https modules
|
|
15
|
+
*/
|
|
16
|
+
request(config: AziosRequestConfig): Promise<AziosResponse>;
|
|
17
|
+
}
|
|
18
|
+
export default NodeHttpAdapter;
|