{ "kind": "open-flow-workflow", "version": 1, "name": "Parse and Validate a Phone Number with Uproc", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_ad23a28ecaa0e87c": { "name": "Enter a phone number", "kind": "start", "inputDefs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "phone" } ] }, "n_e2c6c8846d7ab827": { "inputs": { "phone": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_ad23a28ecaa0e87c", "output": "phone" } ] } }, "name": "Prepare phone lookup", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "phone" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "body" } ], "name": "Prepare phone lookup", "moduleId": "n_66c15ca543e903ad", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_f700491395bf5808": { "inputs": { "url": { "kind": "value", "value": "https://api.uproc.io/api/v2/process" }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_e2c6c8846d7ab827", "output": "body" } ] }, "auth.username": { "kind": "unset" }, "auth.password": { "kind": "unset" } }, "name": "Parse the phone number", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "auth.username" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "auth.password" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Parse the phone number", "executor": { "method": "POST", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "json", "authentication": { "type": "basic" }, "responseFormat": "json", "statusPolicy": "success", "kind": "http-request" } } }, "n_1335108a9b2c3d9b": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_f700491395bf5808", "output": "body" } ] } }, "name": "Check phone validity", "kind": "task", "task": { "inputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "results" } ], "name": "Check phone validity", "moduleId": "n_f25beb1a2377f982", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_3e5369fb5903f6ce": { "name": "Phone results", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "additionalProperties": true } }, "nullable": false, "handle": "results" } ], "outputMappings": { "results": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_1335108a9b2c3d9b", "output": "results" } ] } } } }, "edges": [ { "source": "n_ad23a28ecaa0e87c", "target": "n_e2c6c8846d7ab827" }, { "source": "n_e2c6c8846d7ab827", "target": "n_f700491395bf5808" }, { "source": "n_f700491395bf5808", "target": "n_1335108a9b2c3d9b" }, { "source": "n_1335108a9b2c3d9b", "target": "n_3e5369fb5903f6ce" } ] } }, "modules": { "n_66c15ca543e903ad": { "name": "Prepare phone lookup", "imports": [], "source": "export default function prepare({phone}) { if(typeof phone!=='string'||!phone)throw Error('Enter a phone number');return{body:{processor:'get-phone-parsed',params:{phone}}}; }\n" }, "n_f25beb1a2377f982": { "name": "Check phone validity", "imports": [], "source": "export default function results({body}){const rows=Array.isArray(body)?body:[body];return{results:rows.map(response=>({response,valid:String(response?.message?.valid)==='true'}))}}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }