| 123456789101112131415161718192021222324252627282930313233343536 |
- {
- "name": "verify-template-json",
- "nodes": [
- {"id": "n1", "name": "Trigger", "type": "click-trigger", "position": {"x": 0, "y": 0}, "config": {}},
- {"id": "n2", "name": "Fixture", "type": "code", "position": {"x": 0, "y": 100},
- "config": {"code": "return { name: 'Ada', payload: '{\"nested\":{\"count\":7}}' };"}},
- {"id": "n3", "name": "Parse", "type": "json", "position": {"x": -100, "y": 200},
- "config": {"operation": "parse", "inputField": "data.result.payload", "outputField": "value"}},
- {"id": "n4", "name": "Extract", "type": "json", "position": {"x": -100, "y": 300},
- "config": {"operation": "extract", "inputField": "data.value", "path": "nested.count", "outputField": "count"}},
- {"id": "n5", "name": "Bad", "type": "json", "position": {"x": 100, "y": 200},
- "config": {"operation": "parse", "inputField": "data.result.name", "outputField": "value", "onError": "null"}},
- {"id": "n6", "name": "Render", "type": "template", "position": {"x": 0, "y": 400},
- "config": {"template": "Hello {{data.result.name}}", "outputField": "text"}},
- {"id": "n7", "name": "TemplateText", "type": "code", "position": {"x": 200, "y": 100},
- "config": {"code": "var o = String.fromCharCode(123, 123); var c = String.fromCharCode(125, 125); return { message: 'Hi ' + o + 'result.who' + c + ', you have ' + o + 'result.n' + c + ' new items', who: 'Zora', n: 5 };"}},
- {"id": "n8", "name": "RenderFromInput", "type": "template", "position": {"x": 200, "y": 200},
- "config": {"templateSource": "input", "templateField": "data.result.message", "outputField": "text"}}
- ],
- "connections": [
- {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "n2", "targetInput": "data"},
- {"sourceNodeId": "n2", "sourceOutput": "main", "targetNodeId": "n3", "targetInput": "data"},
- {"sourceNodeId": "n3", "sourceOutput": "main", "targetNodeId": "n4", "targetInput": "data"},
- {"sourceNodeId": "n2", "sourceOutput": "main", "targetNodeId": "n5", "targetInput": "data"},
- {"sourceNodeId": "n2", "sourceOutput": "main", "targetNodeId": "n6", "targetInput": "data"},
- {"sourceNodeId": "n1", "sourceOutput": "main", "targetNodeId": "n7", "targetInput": "data"},
- {"sourceNodeId": "n7", "sourceOutput": "main", "targetNodeId": "n8", "targetInput": "data"}
- ],
- "expect": {
- "n3": {"status": "completed", "output": {"value": {"nested": {"count": 7}}}},
- "n4": {"status": "completed", "output": {"count": 7}},
- "n5": {"status": "completed", "output": {"value": null}},
- "n6": {"status": "completed", "output": {"text": "Hello Ada"}},
- "n8": {"status": "completed", "output": {"text": "Hi Zora, you have 5 new items"}}
- }
- }
|