feat: Add comprehensive API client modules and JWT authentication to Python SDK

- Add pyjwt>=2.10.0 dependency to requirements.txt
- Add AuthProvider class with API key and JWT token support (create_token, validate_token, refresh_token, get_headers methods)
- Add APIClient base class with retry logic, error handling, and async session management
- Add SubscriberAPI module (get, list, create, update, suspend, activate, terminate methods)
- Add UsageAPI module (get_stats, list_events, get_realtime methods
This commit is contained in:
nutcas3
2026-04-25 03:56:56 +03:00
parent 3b0f148265
commit 758bd5f075
6 changed files with 716 additions and 344 deletions
+41 -1
View File
@@ -1,4 +1,15 @@
from .client import TelecomSDK
from .auth import AuthProvider
from .api import (
APIClient,
SubscriberAPI,
UsageAPI,
PaymentAPI,
RatingPlanAPI,
SystemAPI,
GraphQLAPI,
)
from .websocket import WebSocketClient
from .types import (
Subscriber,
UsageStats,
@@ -6,25 +17,54 @@ from .types import (
SystemStats,
HealthStatus,
WebSocketMessage,
UsageEvent,
RatingPlan,
RealTimeUsage,
PaginatedResponse,
)
from .exceptions import (
TelecomError,
AuthenticationError,
APIError,
NetworkError,
ValidationError,
RateLimitError,
ServerError,
)
__version__ = "1.0.0"
__all__ = [
# Main SDK client
"TelecomSDK",
# Authentication
"AuthProvider",
# API modules
"APIClient",
"SubscriberAPI",
"UsageAPI",
"PaymentAPI",
"RatingPlanAPI",
"SystemAPI",
"GraphQLAPI",
# WebSocket
"WebSocketClient",
# Types
"Subscriber",
"UsageStats",
"UsageStats",
"PaymentTransaction",
"SystemStats",
"HealthStatus",
"WebSocketMessage",
"UsageEvent",
"RatingPlan",
"RealTimeUsage",
"PaginatedResponse",
# Exceptions
"TelecomError",
"AuthenticationError",
"APIError",
"NetworkError",
"ValidationError",
"RateLimitError",
"ServerError",
]