{ "title": "Hacker News Angolia Search", "description": "Board which returns story contents using the Hacker News Angolia API", "version": "0.1.0", "edges": [ { "from": "fetch", "to": "spreadResponse", "out": "response", "in": "obj" }, { "from": "input-0", "to": "runJavascript-0", "out": "pageNumber", "in": "page" }, { "from": "input-0", "to": "runJavascript-0", "out": "tags", "in": "tags" }, { "from": "input-0", "to": "sliceOutput", "out": "searchLimit", "in": "limit" }, { "from": "input-0", "to": "urlTemplate", "out": "pageNumber", "in": "page" }, { "from": "input-0", "to": "urlTemplate", "out": "query", "in": "query" }, { "from": "input-0", "to": "urlTemplate", "out": "tags", "in": "tags" }, { "from": "runJavascript-0", "to": "urlTemplate", "out": "url", "in": "template" }, { "from": "sliceOutput", "to": "output-0", "out": "sliced", "in": "output" }, { "from": "spreadResponse", "to": "sliceOutput", "out": "hits", "in": "list" }, { "from": "urlTemplate", "to": "fetch", "out": "url", "in": "url" }, { "from": "urlTemplate", "to": "output-0", "out": "url", "in": "searchQuery" } ], "nodes": [ { "id": "input-0", "type": "input", "configuration": { "schema": { "type": "object", "properties": { "pageNumber": { "type": "string", "title": "Page", "description": "The page number to query", "default": "1", "examples": [ "1" ] }, "query": { "type": "string", "title": "Query", "description": "The term to search for", "examples": [ "Artificial Intelligence", "Machine Learning", "Deep Learning" ] }, "searchLimit": { "type": "number", "title": "limit", "description": "Limit the number of results returned by the search", "default": "5", "examples": [ "5" ] }, "tags": { "type": "string", "title": "Tags", "description": "Filter on a specific tag", "enum": [ "story", "comment", "poll", "pollopt", "show_hn", "ask_hn", "front_page" ] } }, "required": [ "query", "tags" ] } } }, { "id": "output-0", "type": "output", "configuration": { "schema": { "type": "object", "properties": { "output": { "type": [ "array", "boolean", "null", "number", "object", "string" ] }, "searchQuery": { "type": "string" } }, "required": [ "output", "searchQuery" ] } } }, { "id": "fetch", "type": "fetch", "configuration": { "method": "GET" } }, { "id": "runJavascript-0", "type": "runJavascript", "configuration": { "code": "const run = ({tags,page})=>{let baseURL=\"https://hn.algolia.com/api/v1/search?query={query}\";if(tags!=void 0){baseURL=baseURL+\"&tags={tags}\"}if(page!=void 0){baseURL=baseURL+\"&page={page}\"}return{url:baseURL}};", "id": "urlContructOutput", "inputSchema": { "type": "object", "properties": { "id": { "type": "string" }, "tags": { "type": "string", "enum": [ "story", "comment", "poll", "pollopt", "show_hn", "ask_hn", "front_page" ] }, "page": { "type": "string" } } }, "name": "run", "outputSchema": { "type": "object", "properties": { "url": { "type": "string" } } }, "raw": true } }, { "id": "sliceOutput", "type": "runJavascript", "configuration": { "code": "const sliceOutput = ({list,limit})=>{return{sliced:list.slice(0,limit)}};", "inputSchema": { "type": "object", "properties": { "list": { "type": "array", "items": { "type": "object", "properties": { "_highlightResult": { "type": "object", "properties": { "author": { "type": "object", "properties": { "matchLevel": { "type": "string" }, "matchedWords": { "type": "array", "items": { "type": "string" } }, "value": { "type": "string" } }, "required": [ "matchLevel", "matchedWords", "value" ], "additionalProperties": false }, "title": { "type": "object", "properties": { "fullyHighlighted": { "type": "boolean" }, "matchlevel": { "type": "string" }, "matchedWords": { "type": "array", "items": { "type": "string" } }, "value": { "type": "string" } }, "required": [ "fullyHighlighted", "matchlevel", "matchedWords", "value" ], "additionalProperties": false }, "url": { "type": "object", "properties": { "fullyHighlighted": { "type": "boolean" }, "matchlevel": { "type": "string" }, "matchedWords": { "type": "array", "items": { "type": "string" } }, "value": { "type": "string" } }, "required": [ "fullyHighlighted", "matchlevel", "matchedWords", "value" ], "additionalProperties": false } }, "required": [ "author", "title", "url" ], "additionalProperties": false }, "_tags": { "type": "array", "items": { "type": "string" } }, "author": { "type": "string" }, "children": { "type": "array", "items": { "type": "number" } }, "created_at": { "type": "string" }, "created_at_i": { "type": "number" }, "num_comments": { "type": "number" }, "objectID": { "type": "string" }, "points": { "type": "number" }, "story_id": { "type": "number" }, "title": { "type": "string" }, "updated_at": { "type": "string" }, "url": { "type": "string" } }, "required": [ "_highlightResult", "_tags", "author", "children", "created_at", "created_at_i", "num_comments", "objectID", "points", "story_id", "title", "updated_at", "url" ], "additionalProperties": false } }, "limit": { "type": "number" } } }, "name": "sliceOutput", "outputSchema": { "type": "object", "properties": { "sliced": { "type": [ "array", "boolean", "null", "number", "object", "string" ] } } }, "raw": true } }, { "id": "spreadResponse", "type": "runJavascript", "configuration": { "code": "const spreadResponse = ({obj})=>{const object2=obj;if(typeof object2!==\"object\"){throw new Error(`object is of type ${typeof object2} not object`)}return{...object2}};", "inputSchema": { "type": "object", "properties": { "obj": { "type": [ "array", "boolean", "null", "number", "object", "string" ] } } }, "name": "spreadResponse", "outputSchema": { "type": "object", "properties": { "hits": { "type": "array", "items": { "type": "object", "properties": { "_highlightResult": { "type": "object", "properties": { "author": { "type": "object", "properties": { "matchLevel": { "type": "string" }, "matchedWords": { "type": "array", "items": { "type": "string" } }, "value": { "type": "string" } }, "required": [ "matchLevel", "matchedWords", "value" ], "additionalProperties": false }, "title": { "type": "object", "properties": { "fullyHighlighted": { "type": "boolean" }, "matchlevel": { "type": "string" }, "matchedWords": { "type": "array", "items": { "type": "string" } }, "value": { "type": "string" } }, "required": [ "fullyHighlighted", "matchlevel", "matchedWords", "value" ], "additionalProperties": false }, "url": { "type": "object", "properties": { "fullyHighlighted": { "type": "boolean" }, "matchlevel": { "type": "string" }, "matchedWords": { "type": "array", "items": { "type": "string" } }, "value": { "type": "string" } }, "required": [ "fullyHighlighted", "matchlevel", "matchedWords", "value" ], "additionalProperties": false } }, "required": [ "author", "title", "url" ], "additionalProperties": false }, "_tags": { "type": "array", "items": { "type": "string" } }, "author": { "type": "string" }, "children": { "type": "array", "items": { "type": "number" } }, "created_at": { "type": "string" }, "created_at_i": { "type": "number" }, "num_comments": { "type": "number" }, "objectID": { "type": "string" }, "points": { "type": "number" }, "story_id": { "type": "number" }, "title": { "type": "string" }, "updated_at": { "type": "string" }, "url": { "type": "string" } }, "required": [ "_highlightResult", "_tags", "author", "children", "created_at", "created_at_i", "num_comments", "objectID", "points", "story_id", "title", "updated_at", "url" ], "additionalProperties": false } } } }, "raw": true } }, { "id": "urlTemplate", "type": "urlTemplate", "configuration": {} } ] }