fix: fix superadmin impersonation

This commit is contained in:
Abhishek Kumar 2026-07-11 15:51:36 +05:30
parent d1339970a5
commit e405457676
16 changed files with 593 additions and 172 deletions

View file

@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: dograh-openapi-XXXXXX.json.XNTNNgR8o4
# timestamp: 2026-07-09T13:05:30+00:00
# filename: dograh-openapi-XXXXXX.json.73JcjTo19T
# timestamp: 2026-07-11T10:21:09+00:00
from __future__ import annotations
@ -534,6 +534,15 @@ class ToolResponse(BaseModel):
created_by: CreatedByResponse | None = None
class DestinationSource(Enum):
"""
Whether transfer destination is static/template or resolved by HTTP.
"""
static = 'static'
dynamic = 'dynamic'
class MessageType1(Enum):
"""
Type of message to play before transfer.
@ -544,52 +553,6 @@ class MessageType1(Enum):
audio = 'audio'
class TransferCallConfig(BaseModel):
"""
Configuration for Transfer Call tools.
"""
destination: Annotated[str, Field(title='Destination')]
"""
Phone number, SIP endpoint, or template to transfer the call to, e.g. +1234567890, PJSIP/1234, or {{initial_context.transfer_destination}}.
"""
messageType: Annotated[MessageType1 | None, Field(title='Messagetype')] = 'none'
"""
Type of message to play before transfer.
"""
customMessage: Annotated[str | None, Field(title='Custommessage')] = None
"""
Custom message to play before transferring.
"""
audioRecordingId: Annotated[str | None, Field(title='Audiorecordingid')] = None
"""
Recording ID for audio message before transfer.
"""
timeout: Annotated[int | None, Field(ge=5, le=120, title='Timeout')] = 30
"""
Maximum seconds to wait for the destination to answer.
"""
class TransferCallToolDefinition(BaseModel):
"""
Tool definition for Transfer Call tools.
"""
schema_version: Annotated[int | None, Field(title='Schema Version')] = 1
"""
Schema version.
"""
type: Annotated[Literal['transfer_call'], Field(title='Type')]
"""
Tool type.
"""
config: TransferCallConfig
"""
Transfer Call configuration.
"""
class ValidationError(BaseModel):
loc: Annotated[list[str | int], Field(title='Location')]
msg: Annotated[str, Field(title='Message')]
@ -762,6 +725,47 @@ class HttpApiToolDefinition(BaseModel):
"""
class HttpTransferResolverConfig(BaseModel):
"""
HTTP endpoint used to resolve transfer destination at call time.
"""
type: Annotated[Literal['http'], Field(title='Type')] = 'http'
"""
Resolver type.
"""
url: Annotated[str, Field(title='Url')]
"""
HTTP or HTTPS endpoint for transfer resolution.
"""
headers: Annotated[dict[str, str] | None, Field(title='Headers')] = None
"""
Static headers to include with every resolver request.
"""
credential_uuid: Annotated[str | None, Field(title='Credential Uuid')] = None
"""
Reference to an external credential for resolver authentication.
"""
timeout_ms: Annotated[int | None, Field(ge=500, le=5000, title='Timeout Ms')] = 3000
"""
Resolver request timeout in milliseconds.
"""
wait_message: Annotated[str | None, Field(title='Wait Message')] = None
"""
Optional short message played while Dograh resolves routing.
"""
parameters: Annotated[list[ToolParameter] | None, Field(title='Parameters')] = None
"""
Parameters the model may provide when calling this transfer tool.
"""
preset_parameters: Annotated[
list[PresetToolParameter] | None, Field(title='Preset Parameters')
] = None
"""
Parameters injected by Dograh from fixed values or workflow context templates.
"""
class PropertySpec(BaseModel):
"""
Single field on a node.
@ -814,6 +818,66 @@ class RecordingListResponseSchema(BaseModel):
total: Annotated[int, Field(title='Total')]
class TransferCallConfig(BaseModel):
"""
Configuration for Transfer Call tools.
"""
destination_source: Annotated[
DestinationSource | None, Field(title='Destination Source')
] = 'static'
"""
Whether transfer destination is static/template or resolved by HTTP.
"""
destination: Annotated[str | None, Field(title='Destination')] = ''
"""
Phone number, SIP endpoint, or template to transfer the call to, e.g. +1234567890, PJSIP/1234, or {{initial_context.transfer_destination}}.
"""
messageType: Annotated[MessageType1 | None, Field(title='Messagetype')] = 'none'
"""
Type of message to play before transfer.
"""
customMessage: Annotated[str | None, Field(title='Custommessage')] = None
"""
Custom message to play before transferring.
"""
audioRecordingId: Annotated[str | None, Field(title='Audiorecordingid')] = None
"""
Recording ID for audio message before transfer.
"""
timeout: Annotated[int | None, Field(ge=5, le=120, title='Timeout')] = 30
"""
Maximum seconds to wait for the destination to answer.
"""
parameters: Annotated[list[ToolParameter] | None, Field(title='Parameters')] = None
"""
Parameters the model may provide when calling this transfer tool, for example state, department, or transfer reason.
"""
resolver: HttpTransferResolverConfig | None = None
"""
Optional resolver that determines transfer routing at call time.
"""
class TransferCallToolDefinition(BaseModel):
"""
Tool definition for Transfer Call tools.
"""
schema_version: Annotated[int | None, Field(title='Schema Version')] = 1
"""
Schema version.
"""
type: Annotated[Literal['transfer_call'], Field(title='Type')]
"""
Tool type.
"""
config: TransferCallConfig
"""
Transfer Call configuration.
"""
class UpdateWorkflowRequest(BaseModel):
name: Annotated[str | None, Field(title='Name')] = None
workflow_definition: Annotated[