Commit 7d40740
committed
feat: add core HTTP client with plugin system and built-in plugins
Introduce a new package `@tdanks2000/api-core` that provides a shared HTTP client runtime for the api-wrappers organization. This foundational library includes:
- A plugin-based architecture with lifecycle hooks (setup, beforeRequest, afterResponse, onError, dispose)
- Built-in plugins for caching, retry logic, logging, and timeouts
- GraphQL support with automatic error handling
- Transport abstraction with a default fetch-based implementation
- Comprehensive TypeScript types and error classes (ApiError, RateLimitError, TimeoutError)
- Test suite covering all major components
- Documentation including migration guide and plugin authoring guide
The implementation enables consistent HTTP behavior across all API wrapper packages while maintaining backward compatibility with existing wrapper interfaces.0 parents commit 7d40740
45 files changed
Lines changed: 3735 additions & 0 deletions
File tree
- docs
- src
- __tests__
- client
- context
- errors
- graphql
- plugins
- cache
- logger
- retry
- timeout
- plugin
- transport
- types
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments