feat: add vonage telephony (#35)

* refactor: telephony integration

* feat: add vonage telephony
This commit is contained in:
Sabiha Khan 2025-10-27 15:29:57 +05:30 committed by Sabiha Khan
parent 6503d806c5
commit 4cfdc3d420
39 changed files with 3382 additions and 335 deletions

View file

@ -1,7 +1,8 @@
from typing import List
from typing import List, Optional
from pydantic import BaseModel, Field
# TODO: Make schemas provider-agnostic
class TwilioConfigurationRequest(BaseModel):
"""Request schema for Twilio configuration."""
@ -23,7 +24,32 @@ class TwilioConfigurationResponse(BaseModel):
from_numbers: List[str]
class VonageConfigurationRequest(BaseModel):
"""Request schema for Vonage configuration."""
provider: str = Field(default="vonage")
api_key: Optional[str] = Field(None, description="Vonage API Key")
api_secret: Optional[str] = Field(None, description="Vonage API Secret")
application_id: str = Field(..., description="Vonage Application ID")
private_key: str = Field(..., description="Private key for JWT generation")
from_numbers: List[str] = Field(
..., min_length=1, description="List of Vonage phone numbers (without + prefix)"
)
class VonageConfigurationResponse(BaseModel):
"""Response schema for Vonage configuration with masked sensitive fields."""
provider: str
application_id: str # Not sensitive, can show full
api_key: Optional[str] # Masked if present
api_secret: Optional[str] # Masked if present
private_key: str # Masked (shows only if configured)
from_numbers: List[str]
class TelephonyConfigurationResponse(BaseModel):
"""Top-level telephony configuration response."""
twilio: TwilioConfigurationResponse | None = None
twilio: Optional[TwilioConfigurationResponse] = None
vonage: Optional[VonageConfigurationResponse] = None