@0xshariq/voxa-core 1.0.0

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 (48) hide show
  1. package/CHANGELOG.md +250 -0
  2. package/LICENSE +21 -0
  3. package/README.md +782 -0
  4. package/dist/config/index.d.ts +1 -0
  5. package/dist/config/index.js +1 -0
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +1 -0
  8. package/dist/lib/client/http-methods.d.ts +1 -0
  9. package/dist/lib/client/http-methods.js +1 -0
  10. package/dist/lib/client/logging.d.ts +1 -0
  11. package/dist/lib/client/logging.js +1 -0
  12. package/dist/lib/client/request.d.ts +1 -0
  13. package/dist/lib/client/request.js +1 -0
  14. package/dist/lib/client/security.d.ts +1 -0
  15. package/dist/lib/client/security.js +1 -0
  16. package/dist/lib/client/utils.d.ts +1 -0
  17. package/dist/lib/client/utils.js +1 -0
  18. package/dist/lib/client/voxa.d.ts +1 -0
  19. package/dist/lib/client/voxa.js +1 -0
  20. package/dist/lib/features/cache/file-storage.d.ts +1 -0
  21. package/dist/lib/features/cache/file-storage.js +1 -0
  22. package/dist/lib/features/cache/manager.d.ts +1 -0
  23. package/dist/lib/features/cache/manager.js +1 -0
  24. package/dist/lib/features/deduplication/manager.d.ts +1 -0
  25. package/dist/lib/features/deduplication/manager.js +1 -0
  26. package/dist/lib/features/errors/classifier.d.ts +1 -0
  27. package/dist/lib/features/errors/classifier.js +1 -0
  28. package/dist/lib/features/interceptors/manager.d.ts +1 -0
  29. package/dist/lib/features/interceptors/manager.js +1 -0
  30. package/dist/lib/features/logging/file-logger.d.ts +1 -0
  31. package/dist/lib/features/logging/file-logger.js +1 -0
  32. package/dist/lib/features/metadata/manager.d.ts +1 -0
  33. package/dist/lib/features/metadata/manager.js +1 -0
  34. package/dist/lib/features/queue/manager.d.ts +1 -0
  35. package/dist/lib/features/queue/manager.js +1 -0
  36. package/dist/lib/features/rate/limiter.d.ts +1 -0
  37. package/dist/lib/features/rate/limiter.js +1 -0
  38. package/dist/lib/features/retry/manager.d.ts +1 -0
  39. package/dist/lib/features/retry/manager.js +1 -0
  40. package/dist/lib/features/schema/validator.d.ts +1 -0
  41. package/dist/lib/features/schema/validator.js +1 -0
  42. package/dist/lib/index.d.ts +1 -0
  43. package/dist/lib/index.js +1 -0
  44. package/dist/lib/types/client-types.d.ts +1 -0
  45. package/dist/lib/types/client-types.js +1 -0
  46. package/dist/lib/version.d.ts +1 -0
  47. package/dist/lib/version.js +1 -0
  48. package/package.json +76 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,250 @@
1
+ # Changelog
2
+
3
+ All notable changes to Voxa HTTP Client will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+ - Comprehensive test suite with Vitest
12
+ - Integration tests for feature combinations
13
+ - Architecture documentation with diagrams
14
+ - Migration guide from Axios
15
+ - Enhanced contribution guidelines
16
+
17
+ ## [2.4.1] - 2024-12-05
18
+
19
+ ### Added
20
+ - **HTTP/2 Server Push Support**: Automatic detection and caching of server-pushed resources
21
+ - `Http2PushManager` for managing pushed resources
22
+ - Push resource detection using Performance API
23
+ - Automatic caching of pushed resources
24
+ - Configurable push handling with `http2Push` config option
25
+ - **Developer Experience Improvements**:
26
+ - Debug mode with `VoxaClient.enableDebug()` and `VoxaClient.disableDebug()`
27
+ - Public getters for accessing configuration safely
28
+ - Enhanced logging with safe redaction of sensitive data
29
+ - Better TypeScript intellisense and documentation
30
+ - **Documentation Enhancements**:
31
+ - Complete streaming guide (`docs/STREAMING.md`)
32
+ - Comprehensive troubleshooting guide (`docs/TROUBLESHOOTING.md`)
33
+ - Developer experience guide (`docs/DEVELOPER_EXPERIENCE.md`)
34
+ - Feature comparison table in README
35
+ - All features documented in `FEATURES.md`
36
+
37
+ ### Fixed
38
+ - Performance API type errors in universal (browser+Node.js) code
39
+ - Type safety improvements across all managers
40
+ - Build errors with strict TypeScript compilation
41
+
42
+ ### Changed
43
+ - Centralized all types in `client-types.ts` for better organization
44
+ - Improved error messages and debugging information
45
+ - Enhanced SSRF protection with better validation
46
+
47
+ ## [2.4.0] - 2024-11-28
48
+
49
+ ### Added
50
+ - **Streaming Support**: Upload and download progress tracking for large files
51
+ - `StreamingManager` for handling chunked transfers
52
+ - Real-time progress callbacks
53
+ - Support for images, videos, and large files
54
+ - Configurable chunk size and buffer management
55
+ - **Advanced Caching Strategies**:
56
+ - Memory cache with LRU eviction
57
+ - Redis cache for distributed systems
58
+ - File system cache for persistent storage
59
+ - Cache invalidation patterns and TTL management
60
+ - **Circuit Breaker Pattern**: Automatic failure detection and recovery
61
+ - Configurable failure thresholds
62
+ - Half-open state for testing recovery
63
+ - Per-endpoint circuit breaker isolation
64
+ - **Enhanced Authentication**:
65
+ - Automatic token refresh with configurable callbacks
66
+ - Bearer token and API key support
67
+ - Token storage and retrieval
68
+ - Pre-request authentication hooks
69
+
70
+ ### Improved
71
+ - Cache performance with better memory management
72
+ - Retry logic with exponential backoff and jitter
73
+ - Request deduplication for parallel identical requests
74
+ - Rate limiting with token bucket algorithm
75
+
76
+ ## [2.3.0] - 2024-11-15
77
+
78
+ ### Added
79
+ - **SSRF Protection**: Block requests to private IP ranges
80
+ - Automatic validation of URLs before requests
81
+ - Redirect validation to prevent DNS rebinding
82
+ - Configurable whitelist for allowed private IPs
83
+ - **Header Security**: Whitelist/blacklist for headers
84
+ - Safe headers allowed by default
85
+ - Sensitive headers (Cookie, Set-Cookie) blocked
86
+ - Custom header validation
87
+ - **Request/Response Interceptors**: Middleware pattern
88
+ - Pre-request interceptors for modifying requests
89
+ - Post-response interceptors for transforming responses
90
+ - Error interceptors for custom error handling
91
+ - Async interceptor support
92
+
93
+ ### Fixed
94
+ - Memory leaks in request deduplication manager
95
+ - Race conditions in cache invalidation
96
+ - Type inference issues with generic request methods
97
+
98
+ ## [2.2.0] - 2024-11-01
99
+
100
+ ### Added
101
+ - **Rate Limiting**: Token bucket and sliding window algorithms
102
+ - Per-endpoint rate limiting
103
+ - Configurable request limits and time windows
104
+ - Automatic request queuing
105
+ - **Request Deduplication**: Prevent duplicate in-flight requests
106
+ - Automatic deduplication based on request signature
107
+ - Shared promise resolution for identical requests
108
+ - Configurable deduplication key generation
109
+ - **Batch Requests**: Efficient batch processing
110
+ - Parallel batch execution
111
+ - Sequential batch execution with dependencies
112
+ - Batch error handling and partial success
113
+ - **AbortController Support**: Request cancellation
114
+ - Timeout-based cancellation
115
+ - Manual cancellation with abort signals
116
+ - Cleanup of in-flight requests
117
+
118
+ ### Changed
119
+ - Improved TypeScript types for better type inference
120
+ - Enhanced error messages with more context
121
+ - Better documentation with more examples
122
+
123
+ ## [2.1.0] - 2024-10-15
124
+
125
+ ### Added
126
+ - **Smart Retry Logic**: Exponential backoff with jitter
127
+ - Configurable retry attempts and delays
128
+ - Retry only on idempotent methods by default
129
+ - Custom retry condition functions
130
+ - Circuit breaker integration
131
+ - **Advanced Caching**: Multi-layer cache with TTL
132
+ - In-memory cache with LRU eviction
133
+ - Configurable cache keys
134
+ - Cache invalidation patterns
135
+ - Conditional requests (ETag, Last-Modified)
136
+ - **Timeout Management**: Request and connection timeouts
137
+ - Global timeout configuration
138
+ - Per-request timeout override
139
+ - Automatic cleanup on timeout
140
+
141
+ ### Improved
142
+ - Performance optimizations for cache lookups
143
+ - Memory usage reduction in cache manager
144
+ - Error handling with better error messages
145
+
146
+ ## [2.0.0] - 2024-10-01
147
+
148
+ ### Added
149
+ - **TypeScript Rewrite**: Full TypeScript implementation
150
+ - Strong type safety
151
+ - Generic request/response types
152
+ - Type inference for request methods
153
+ - **Native Fetch API**: Built on modern Fetch API
154
+ - Browser and Node.js 18+ support
155
+ - Universal compatibility
156
+ - Streaming support
157
+ - **ESM Modules**: Modern module system
158
+ - Tree-shakable exports
159
+ - Better bundle sizes
160
+ - Import/export syntax
161
+
162
+ ### Breaking Changes
163
+ - **Minimum Node.js version**: Now requires Node.js 18+
164
+ - **Module system**: Changed from CommonJS to ESM
165
+ - **API changes**:
166
+ - Constructor now accepts single config object
167
+ - Response format changed to native Response object
168
+ - Error handling uses custom VoxaError class
169
+ - **Removed features**:
170
+ - Legacy callback-based API
171
+ - XMLHttpRequest support
172
+ - CommonJS builds
173
+
174
+ ### Migration Guide
175
+ See [MIGRATION.md](./MIGRATION.md) for detailed migration instructions from v1.x to v2.x.
176
+
177
+ ## [1.5.0] - 2024-09-01
178
+
179
+ ### Added
180
+ - Basic caching support
181
+ - Simple retry mechanism
182
+ - Request/response logging
183
+ - TypeScript definitions
184
+
185
+ ### Fixed
186
+ - Memory leaks in request handling
187
+ - Error handling edge cases
188
+ - Type definition issues
189
+
190
+ ## [1.0.0] - 2024-08-01
191
+
192
+ ### Added
193
+ - Initial release
194
+ - Basic HTTP client functionality
195
+ - GET, POST, PUT, PATCH, DELETE methods
196
+ - Request configuration
197
+ - Error handling
198
+ - Node.js and browser support
199
+
200
+ ---
201
+
202
+ ## Version Support
203
+
204
+ | Version | Status | Node.js | Browser |
205
+ |---------|--------|---------|---------|
206
+ | 2.4.x | Active | 18+ | Modern |
207
+ | 2.3.x | Active | 18+ | Modern |
208
+ | 2.2.x | Maintenance | 18+ | Modern |
209
+ | 2.1.x | Maintenance | 18+ | Modern |
210
+ | 2.0.x | End of Life | 18+ | Modern |
211
+ | 1.x.x | End of Life | 14+ | All |
212
+
213
+ ## Upgrade Notes
214
+
215
+ ### 2.4.x → 2.5.x (Upcoming)
216
+ - No breaking changes expected
217
+ - New features will be additive
218
+ - Deprecation notices will be provided 6 months before removal
219
+
220
+ ### 2.3.x → 2.4.x
221
+ - No breaking changes
222
+ - HTTP/2 push support is opt-in
223
+ - New debug mode available via static methods
224
+
225
+ ### 2.2.x → 2.3.x
226
+ - No breaking changes
227
+ - SSRF protection enabled by default (can be disabled)
228
+ - Header security enabled by default
229
+
230
+ ### 2.1.x → 2.2.x
231
+ - No breaking changes
232
+ - Rate limiting is opt-in
233
+ - Request deduplication enabled by default (can be disabled)
234
+
235
+ ### 2.0.x → 2.1.x
236
+ - No breaking changes
237
+ - Retry and cache improvements are backward compatible
238
+
239
+ ### 1.x.x → 2.0.x
240
+ See [MIGRATION.md](./MIGRATION.md) for detailed breaking changes and migration path.
241
+
242
+ ---
243
+
244
+ ## Contributing
245
+
246
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for how to contribute to this project.
247
+
248
+ ## Security
249
+
250
+ See [SECURITY.md](./SECURITY.md) for security policies and vulnerability reporting.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2025 Sharique Chaudhary
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.