| { |
| "type": "if", |
| "test": { |
| "type": "action", |
| "name": "/_/authenticate", |
| "action": { |
| "exec": { |
| "kind": "nodejs:default", |
| "code": "const main = function ({ password }) { return { value: password === 'abc123' } }" |
| } |
| } |
| }, |
| "consequent": { |
| "type": "action", |
| "name": "/_/success", |
| "action": { |
| "exec": { |
| "kind": "nodejs:default", |
| "code": "const main = function () { return { message: 'success' } }" |
| } |
| } |
| }, |
| "alternate": { |
| "type": "action", |
| "name": "/_/failure", |
| "action": { |
| "exec": { |
| "kind": "nodejs:default", |
| "code": "const main = function () { return { message: 'failure' } }" |
| } |
| } |
| } |
| } |