78 lines
3.5 KiB
Python
78 lines
3.5 KiB
Python
# Copyright (c) 2025 Patrick Motsch
|
|
# Data manipulation node definitions: aggregate, transform, filter.
|
|
|
|
from modules.shared.i18nRegistry import t
|
|
|
|
DATA_NODES = [
|
|
{
|
|
"id": "data.aggregate",
|
|
"category": "data",
|
|
"label": t("Sammeln"),
|
|
"description": t("Ergebnisse aus Schleifen-Iterationen sammeln"),
|
|
"parameters": [
|
|
{"name": "mode", "type": "string", "required": False, "frontendType": "select",
|
|
"frontendOptions": {"options": ["collect", "concat", "sum", "count"]},
|
|
"description": t("Aggregationsmodus"), "default": "collect"},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["Transit"]}},
|
|
"outputPorts": {0: {"schema": "AggregateResult"}},
|
|
"executor": "data",
|
|
"meta": {"icon": "mdi-playlist-plus", "color": "#607D8B", "usesAi": False},
|
|
},
|
|
{
|
|
"id": "data.transform",
|
|
"category": "data",
|
|
"label": t("Umwandeln"),
|
|
"description": t("Daten umstrukturieren"),
|
|
"parameters": [
|
|
{"name": "mappings", "type": "json", "required": True, "frontendType": "mappingTable",
|
|
"description": t("Feld-Zuordnungen"), "default": []},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["Transit"]}},
|
|
"outputPorts": {0: {"schema": "ActionResult", "dynamic": True, "deriveFrom": "mappings"}},
|
|
"executor": "data",
|
|
"meta": {"icon": "mdi-swap-horizontal-bold", "color": "#607D8B", "usesAi": False},
|
|
},
|
|
{
|
|
"id": "data.filter",
|
|
"category": "data",
|
|
"label": t("Filtern"),
|
|
"description": t("Elemente nach Bedingung filtern"),
|
|
"parameters": [
|
|
{"name": "condition", "type": "string", "required": True, "frontendType": "filterExpression",
|
|
"description": t("Filterbedingung")},
|
|
{"name": "udmContentType", "type": "string", "required": False, "frontendType": "select",
|
|
"frontendOptions": {"options": ["", "text", "image", "table", "code", "media", "link", "formula"]},
|
|
"description": t("UDM-ContentType-Filter (optional, leer = kein UDM-Filter)"), "default": ""},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["AggregateResult", "FileList", "TaskList", "EmailList", "DocumentList", "UdmDocument", "UdmNodeList"]}},
|
|
"outputPorts": {0: {"schema": "Transit"}},
|
|
"executor": "data",
|
|
"meta": {"icon": "mdi-filter-outline", "color": "#607D8B", "usesAi": False},
|
|
},
|
|
{
|
|
"id": "data.consolidate",
|
|
"category": "data",
|
|
"label": t("Konsolidieren"),
|
|
"description": t("Gesammelte Ergebnisse deterministisch zusammenführen (Tabelle, CSV, Merge)"),
|
|
"parameters": [
|
|
{"name": "mode", "type": "string", "required": False, "frontendType": "select",
|
|
"frontendOptions": {"options": ["table", "concat", "merge", "csvJoin"]},
|
|
"description": t("Konsolidierungsmodus"), "default": "table"},
|
|
{"name": "separator", "type": "string", "required": False, "frontendType": "text",
|
|
"description": t("Trennzeichen (für concat/csvJoin)"), "default": "\n"},
|
|
],
|
|
"inputs": 1,
|
|
"outputs": 1,
|
|
"inputPorts": {0: {"accepts": ["AggregateResult", "Transit"]}},
|
|
"outputPorts": {0: {"schema": "ConsolidateResult"}},
|
|
"executor": "data",
|
|
"meta": {"icon": "mdi-table-merge-cells", "color": "#607D8B", "usesAi": False},
|
|
},
|
|
]
|