mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-23 13:12:16 +00:00
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:
@@ -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",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user