# Copyright (c) 2025 Patrick Motsch
# Data transformation node definitions.

DATA_NODES = [
    {
        "id": "data.setFields",
        "category": "data",
        "label": {"en": "Set Fields", "de": "Felder setzen", "fr": "Définir champs"},
        "description": {"en": "Set or override fields on payload", "de": "Felder setzen oder überschreiben", "fr": "Définir ou écraser des champs"},
        "parameters": [
            {"name": "fields", "type": "object", "required": True, "description": {"en": "Key-value pairs", "de": "Schlüssel-Wert-Paare", "fr": "Paires clé-valeur"}},
        ],
        "inputs": 1,
        "outputs": 1,
        "executor": "data",
        "meta": {"icon": "mdi-pencil", "color": "#673AB7"},
    },
    {
        "id": "data.filter",
        "category": "data",
        "label": {"en": "Filter", "de": "Filtern", "fr": "Filtrer"},
        "description": {"en": "Filter array by condition", "de": "Array nach Bedingung filtern", "fr": "Filtrer tableau par condition"},
        "parameters": [
            {"name": "condition", "type": "string", "required": True, "description": {"en": "Expression (e.g. item.active == true)", "de": "Bedingung", "fr": "Condition"}},
            {"name": "itemsPath", "type": "string", "required": False, "description": {"en": "Path to array", "de": "Pfad zum Array", "fr": "Chemin vers le tableau"}},
        ],
        "inputs": 1,
        "outputs": 1,
        "executor": "data",
        "meta": {"icon": "mdi-filter", "color": "#673AB7"},
    },
    {
        "id": "data.parseJson",
        "category": "data",
        "label": {"en": "Parse JSON", "de": "JSON parsen", "fr": "Parser JSON"},
        "description": {"en": "Parse JSON string to object", "de": "JSON-String in Objekt parsen", "fr": "Parser chaîne JSON en objet"},
        "parameters": [
            {"name": "jsonPath", "type": "string", "required": False, "description": {"en": "Path to JSON string (default: input)", "de": "Pfad zum JSON", "fr": "Chemin vers JSON"}},
        ],
        "inputs": 1,
        "outputs": 1,
        "executor": "data",
        "meta": {"icon": "mdi-code-json", "color": "#673AB7"},
    },
    {
        "id": "data.template",
        "category": "data",
        "label": {"en": "Template / Interpolation", "de": "Vorlage / Interpolation", "fr": "Modèle / Interpolation"},
        "description": {"en": "Text with {{placeholder}} substitution", "de": "Text mit {{platzhalter}}-Ersetzung", "fr": "Texte avec substitution {{placeholder}}"},
        "parameters": [
            {"name": "template", "type": "string", "required": True, "description": {"en": "Template (use {{path}} for values)", "de": "Vorlage", "fr": "Modèle"}},
        ],
        "inputs": 1,
        "outputs": 1,
        "executor": "data",
        "meta": {"icon": "mdi-format-text", "color": "#673AB7"},
    },
]
