feat: pydantic descriptors
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, Field
|
||||
from .form_base_descriptor_models import FormDescriptor, RowElement, LineElement, AreaElement, LinkPort
|
||||
|
||||
|
||||
class TriggerNodeData(BaseModel):
|
||||
@@ -34,3 +35,42 @@ class TriggerNodeCoreSchema(BaseModel):
|
||||
parent_id: Optional[int] = Field(default=None, description="ID родительского узла")
|
||||
parent_port_number: Optional[int] = Field(default=None, description="Номер порта родительского узла")
|
||||
data: Optional[TriggerNodeCoreSchemaData] = Field(default=None, description="Данные узла")
|
||||
|
||||
|
||||
# Дескриптор формы узла TRIGGER
|
||||
TRIGGER_FORM_DESCRIPTOR = FormDescriptor(
|
||||
elements=[
|
||||
RowElement(
|
||||
name="event_row",
|
||||
type="row",
|
||||
label="Event",
|
||||
elements=[
|
||||
LineElement(
|
||||
name="event_name",
|
||||
type="line",
|
||||
label="Event",
|
||||
placeholder="Event identifier",
|
||||
)
|
||||
],
|
||||
),
|
||||
RowElement(
|
||||
name="context_row",
|
||||
type="row",
|
||||
label="Context",
|
||||
elements=[
|
||||
AreaElement(
|
||||
name="context",
|
||||
type="area",
|
||||
label="Payload",
|
||||
placeholder="Build request JSON from provided environment variables",
|
||||
)
|
||||
],
|
||||
),
|
||||
RowElement(
|
||||
name="then_row",
|
||||
type="row",
|
||||
label="Then",
|
||||
link_port=LinkPort(id="then_output", label="Then"),
|
||||
),
|
||||
]
|
||||
)
|
||||
|
Reference in New Issue
Block a user