{ "kind": "open-flow-workflow", "version": 1, "name": "GitHub Repository Profile", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_47f018558fcbb171": { "name": "Enter repository details", "kind": "start", "inputDefs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "owner" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "repo" } ] }, "n_b47bd84e70f56183": { "inputs": { "owner": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_47f018558fcbb171", "output": "owner" } ] }, "repo": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_47f018558fcbb171", "output": "repo" } ] } }, "name": "Prepare community profile URL", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "owner" }, { "jsonSchema": { "type": "string", "minLength": 1 }, "nullable": false, "handle": "repo" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "endpoint" } ], "name": "Prepare community profile URL", "moduleId": "n_ac61b02bea18f03f", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_8a9868f093407e11": { "inputs": { "endpoint": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_b47bd84e70f56183", "output": "endpoint" } ] } }, "name": "Read GitHub community profile", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "endpoint" } ], "outputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" }, { "jsonSchema": { "const": "base64" }, "nullable": true, "handle": "bodyEncoding" } ], "name": "Read GitHub community profile", "executor": { "providerId": "github", "method": "GET", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "none", "kind": "connector-proxy" } } }, "n_d49246460c3c6359": { "inputs": { "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_8a9868f093407e11", "output": "body" } ] }, "statusCode": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_8a9868f093407e11", "output": "statusCode" } ] }, "bodyEncoding": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_8a9868f093407e11", "output": "bodyEncoding" } ] } }, "name": "Read community health result", "kind": "task", "task": { "inputs": [ { "jsonSchema": {}, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "const": "base64" }, "nullable": true, "handle": "bodyEncoding" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "profile" } ], "name": "Read community health result", "moduleId": "n_dd1c682c17bde7df", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_0892aa3dda942256": { "name": "Repository community profile", "kind": "outputs", "outputDefs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "profile" } ], "outputMappings": { "profile": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d49246460c3c6359", "output": "profile" } ] } } } }, "edges": [ { "source": "n_47f018558fcbb171", "target": "n_b47bd84e70f56183" }, { "source": "n_b47bd84e70f56183", "target": "n_8a9868f093407e11" }, { "source": "n_8a9868f093407e11", "target": "n_d49246460c3c6359" }, { "source": "n_d49246460c3c6359", "target": "n_0892aa3dda942256" } ] } }, "modules": { "n_ac61b02bea18f03f": { "name": "Prepare community profile URL", "imports": [], "source": "export default function profileRequest({ owner, repo }) {\n if (typeof owner !== 'string' || !owner || typeof repo !== 'string' || !repo) throw new Error('Configure the repository owner and name');\n return { endpoint: '/repos/' + encodeURIComponent(owner) + '/' + encodeURIComponent(repo) + '/community/profile' };\n}\n" }, "n_dd1c682c17bde7df": { "name": "Read community health result", "imports": [], "source": "export default function profileResult({ body, statusCode, bodyEncoding }) {\n if (statusCode !== 200 || bodyEncoding != null || !body || typeof body !== 'object' || Array.isArray(body) || typeof body.health_percentage !== 'number' || !Number.isFinite(body.health_percentage) || body.health_percentage < 0 || body.health_percentage > 100) throw new Error('GitHub did not return a completed community profile response');\n return { profile: body };\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }