{
  "$meta": {
    "package": "@walkeros/transformer-demo",
    "version": "4.3.1",
    "type": "transformer",
    "platform": [
      "web",
      "server"
    ],
    "docs": "https://www.walkeros.io/docs/transformers/demo",
    "source": "https://github.com/elbwalker/walkerOS/tree/main/packages/transformers/demo/src"
  },
  "schemas": {
    "settings": {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "type": "object",
      "properties": {
        "name": {
          "description": "Custom name for logging prefix. Default: \"transformer-demo\"",
          "type": "string"
        },
        "fields": {
          "description": "Dot-notation paths to log from the event. If omitted, logs entire event.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "addProcessedFlag": {
          "description": "If true, adds _processed and _processedBy flags to event.data",
          "type": "boolean"
        }
      },
      "additionalProperties": false,
      "description": "Demo transformer: logs events and optionally adds processed flag"
    }
  },
  "examples": {
    "env": {
      "init": {},
      "push": {
        "log": {
          "$code": "()=>{}"
        }
      },
      "simulation": [
        "call:log"
      ]
    },
    "step": {
      "addProcessedFlag": {
        "title": "Add processed flag",
        "description": "With addProcessedFlag: true, adds _processed and _processedBy to event.data",
        "in": {
          "name": "product add",
          "data": {
            "name": "Everyday Ruck Snack",
            "price": 420
          },
          "id": "ev-1700000601",
          "trigger": "click",
          "entity": "product",
          "action": "add",
          "timestamp": 1700000601,
          "source": {
            "type": "browser",
            "platform": "web",
            "url": "https://example.com/"
          }
        },
        "out": [
          [
            "return",
            {
              "name": "product add",
              "data": {
                "name": "Everyday Ruck Snack",
                "price": 420,
                "_processed": true,
                "_processedBy": "transformer-demo"
              },
              "id": "ev-1700000601",
              "trigger": "click",
              "entity": "product",
              "action": "add",
              "timestamp": 1700000601,
              "source": {
                "type": "browser",
                "platform": "web",
                "url": "https://example.com/"
              }
            }
          ]
        ]
      },
      "passthrough": {
        "public": false,
        "description": "Default config: logs event, passes through unchanged",
        "in": {
          "name": "page view",
          "data": {
            "title": "Getting Started",
            "id": "/docs/getting-started"
          },
          "id": "ev-1700000600",
          "trigger": "load",
          "entity": "page",
          "action": "view",
          "timestamp": 1700000600,
          "source": {
            "type": "browser",
            "platform": "web",
            "url": "https://example.com/"
          }
        },
        "out": []
      }
    }
  }
}