feat: pydantic descriptors

This commit is contained in:
TheNoxium
2025-10-06 19:13:55 +05:00
parent 8e01072ff6
commit 46d9381905
28 changed files with 589 additions and 582 deletions

View File

@@ -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 SetNodeData(BaseModel):
@@ -34,3 +35,43 @@ class SetNodeCoreSchema(BaseModel):
parent_id: Optional[int] = Field(default=None, description="ID родительского узла")
parent_port_number: Optional[int] = Field(default=None, description="Номер порта родительского узла")
data: Optional[SetNodeCoreSchemaData] = Field(default=None, description="Данные узла")
# Дескриптор формы узла SET
SET_FORM_DESCRIPTOR = FormDescriptor(
elements=[
RowElement(
name="variable_row",
type="row",
label="Parameter name",
elements=[
LineElement(
name="variable",
type="line",
label="Parameter name",
placeholder="Enter parameter name",
)
],
),
RowElement(
name="value_row",
type="row",
label="Value",
elements=[
AreaElement(
name="value",
type="area",
label="Value",
placeholder="Enter value",
)
],
),
RowElement(
name="link_row",
type="row",
label="Link",
link_port=LinkPort(id="then_output", label="then"),
elements=[],
),
]
)