{ "kind": "open-flow-workflow", "version": 1, "name": "Share a Cocktail Banner in Rocket.Chat", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_bd570268bb8eaaf2": { "name": "Fridays at 18:00 UTC", "kind": "cron", "cronTimes": [ { "type": "cron", "expression": "0 18 * * 5", "timezone": "UTC" } ] }, "n_66e8fab8ef19eac2": { "inputs": { "initialUrl": { "kind": "value", "value": "https://www.thecocktaildb.com/api/json/v1/1/random.php" }, "previousState": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c79476f3c6c15cb7", "output": "state" } ] } }, "name": "Prepare the cocktail URL", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "initialUrl" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": true, "handle": "previousState" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" } ], "name": "Prepare the cocktail URL", "moduleId": "n_bb27501024618420", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_a92b7ef346f90847": { "inputs": { "url": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_66e8fab8ef19eac2", "output": "url" } ] } }, "name": "Get a random cocktail", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" } ], "name": "Get a random cocktail", "executor": { "method": "GET", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "none", "authentication": { "type": "none" }, "responseFormat": "text", "statusPolicy": "all", "kind": "http-request" } } }, "n_c79476f3c6c15cb7": { "inputs": { "url": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_66e8fab8ef19eac2", "output": "url" } ] }, "statusCode": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_a92b7ef346f90847", "output": "statusCode" } ] }, "headers": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_a92b7ef346f90847", "output": "headers" } ] }, "body": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_a92b7ef346f90847", "output": "body" } ] }, "previousState": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c79476f3c6c15cb7", "output": "state" } ] } }, "name": "Prepare the template layers", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "url" }, { "jsonSchema": { "type": "integer" }, "nullable": false, "handle": "statusCode" }, { "jsonSchema": { "type": "object", "additionalProperties": { "type": "string" } }, "nullable": false, "handle": "headers" }, { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "body" }, { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": true, "handle": "previousState" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "state" }, { "jsonSchema": { "type": "boolean" }, "nullable": false, "handle": "redirect" }, { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "The name of the template layer to modify." }, "text": { "type": "string", "description": "Replacement text for a text layer." }, "color": { "type": "string", "description": "Color in hex format, such as #FF0000." }, "background": { "type": "string", "description": "Background color in hex format, such as #FF0000." }, "background_border_color": { "type": "string", "description": "Background border color in hex format, such as #FF0000." }, "font_family": { "type": "string", "description": "The font family to use for a text layer." }, "text_align_h": { "type": "string", "enum": [ "left", "center", "right" ], "description": "Horizontal text alignment." }, "text_align_v": { "type": "string", "enum": [ "top", "center", "bottom" ], "description": "Vertical text alignment." }, "font_family_2": { "type": "string", "description": "The secondary font family to use for a text layer." }, "color_2": { "type": "string", "description": "The secondary font color in hex format." }, "image_url": { "type": "string", "format": "uri", "description": "Public image URL to use for an image layer." }, "effect": { "type": "string", "description": "The Bannerbear image effect to apply." }, "anchor_x": { "type": "string", "enum": [ "left", "center", "right" ], "description": "Horizontal image anchor point." }, "anchor_y": { "type": "string", "enum": [ "top", "center", "bottom" ], "description": "Vertical image anchor point." }, "fill_type": { "type": "string", "enum": [ "fill", "fit" ], "description": "Image fill mode." }, "disable_face_detect": { "type": "boolean", "description": "Whether to disable face detection for this image layer." }, "disable_smart_crop": { "type": "boolean", "description": "Whether to disable smart crop for this image layer." }, "chart_data": { "type": "string", "description": "Comma-delimited chart data values for chart layers." }, "rating": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Star rating value from 0 to 100." }, "target": { "type": "string", "description": "QR code target URL or text." }, "bar_code_data": { "type": "string", "description": "Text to encode as a bar code." }, "gradient": { "type": "array", "items": { "type": "string", "description": "One color value." }, "minItems": 1, "description": "Gradient colors, such as #000 and #FFF." }, "shadow": { "type": "string", "description": "Layer shadow setting, such as 5px 5px 0 #000." } }, "required": [ "name" ], "additionalProperties": true, "description": "One Bannerbear template modification." }, "minItems": 1, "description": "Template layer modifications to apply." }, "nullable": false, "handle": "modifications" } ], "name": "Prepare the template layers", "moduleId": "n_7f87831c9446969a", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_ab221d4942d3e798": { "inputs": {}, "name": "Follow redirect?", "kind": "condition", "matchMode": "first", "cases": [ { "output": "follow", "groups": [ { "expressions": [ { "left": { "kind": "source", "source": { "kind": "node", "nodeId": "n_c79476f3c6c15cb7", "output": "redirect" } }, "operator": "isTrue" } ] } ] } ] }, "n_5c17d8a6204eb91f": { "inputs": { "template": { "kind": "value", "value": "YOUR_BANNERBEAR_TEMPLATE_ID" }, "modifications": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_c79476f3c6c15cb7", "output": "modifications" } ] } }, "name": "Render the cocktail banner", "kind": "task", "task": { "inputs": [ { "description": "The template UID to use.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The template UID to use." }, "nullable": false, "handle": "template" }, { "description": "Template layer modifications to apply.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "description": "The name of the template layer to modify." }, "text": { "type": "string", "description": "Replacement text for a text layer." }, "color": { "type": "string", "description": "Color in hex format, such as #FF0000." }, "background": { "type": "string", "description": "Background color in hex format, such as #FF0000." }, "background_border_color": { "type": "string", "description": "Background border color in hex format, such as #FF0000." }, "font_family": { "type": "string", "description": "The font family to use for a text layer." }, "text_align_h": { "type": "string", "enum": [ "left", "center", "right" ], "description": "Horizontal text alignment." }, "text_align_v": { "type": "string", "enum": [ "top", "center", "bottom" ], "description": "Vertical text alignment." }, "font_family_2": { "type": "string", "description": "The secondary font family to use for a text layer." }, "color_2": { "type": "string", "description": "The secondary font color in hex format." }, "image_url": { "type": "string", "format": "uri", "description": "Public image URL to use for an image layer." }, "effect": { "type": "string", "description": "The Bannerbear image effect to apply." }, "anchor_x": { "type": "string", "enum": [ "left", "center", "right" ], "description": "Horizontal image anchor point." }, "anchor_y": { "type": "string", "enum": [ "top", "center", "bottom" ], "description": "Vertical image anchor point." }, "fill_type": { "type": "string", "enum": [ "fill", "fit" ], "description": "Image fill mode." }, "disable_face_detect": { "type": "boolean", "description": "Whether to disable face detection for this image layer." }, "disable_smart_crop": { "type": "boolean", "description": "Whether to disable smart crop for this image layer." }, "chart_data": { "type": "string", "description": "Comma-delimited chart data values for chart layers." }, "rating": { "type": "integer", "minimum": 0, "maximum": 100, "description": "Star rating value from 0 to 100." }, "target": { "type": "string", "description": "QR code target URL or text." }, "bar_code_data": { "type": "string", "description": "Text to encode as a bar code." }, "gradient": { "type": "array", "items": { "type": "string", "description": "One color value." }, "minItems": 1, "description": "Gradient colors, such as #000 and #FFF." }, "shadow": { "type": "string", "description": "Layer shadow setting, such as 5px 5px 0 #000." } }, "required": [ "name" ], "additionalProperties": true, "description": "One Bannerbear template modification." }, "minItems": 1, "description": "Template layer modifications to apply." }, "nullable": false, "handle": "modifications" }, { "description": "Whether to render a transparent PNG.", "jsonSchema": { "type": "boolean", "description": "Whether to render a transparent PNG." }, "nullable": true, "handle": "transparent", "value": null }, { "description": "Whether to also render a PDF.", "jsonSchema": { "type": "boolean", "description": "Whether to also render a PDF." }, "nullable": true, "handle": "render_pdf", "value": null }, { "description": "Custom metadata to store with the generated image.", "jsonSchema": { "type": "string", "description": "Custom metadata to store with the generated image." }, "nullable": true, "handle": "metadata", "value": null }, { "description": "The Bannerbear project UID. Required when using a Full Access Master API Key.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The Bannerbear project UID. Required when using a Full Access Master API Key." }, "nullable": true, "handle": "project_id", "value": null } ], "outputs": [ { "description": "One Bannerbear image.", "jsonSchema": { "type": "object", "properties": { "uid": { "type": "string", "description": "The unique image UID." }, "status": { "type": "string", "description": "The current image status, such as pending, completed, or failed." }, "self": { "type": "string", "format": "uri", "description": "The API URL for this image." }, "image_url": { "type": [ "string", "null" ], "format": "uri", "description": "The generated media URL." }, "pdf_url": { "type": [ "string", "null" ], "format": "uri", "description": "The generated media URL." }, "template": { "type": "string", "description": "The template UID used to create the image." }, "width": { "type": "integer", "description": "The rendered image width in pixels." }, "height": { "type": "integer", "description": "The rendered image height in pixels." }, "metadata": { "type": [ "string", "null" ], "description": "Custom metadata stored with the image." }, "created_at": { "type": "string", "description": "The image creation timestamp." }, "render_pdf": { "type": "boolean", "description": "Whether PDF rendering was requested." }, "transparent": { "type": "boolean", "description": "Whether transparent background rendering was requested." }, "webhook_url": { "type": [ "string", "null" ], "format": "uri", "description": "The webhook URL notified on completion." }, "webhook_response_code": { "type": [ "integer", "null" ], "description": "The HTTP status code returned by the webhook endpoint." }, "modifications": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The layer name." } }, "additionalProperties": true, "description": "One modification returned by Bannerbear." }, "description": "The modifications applied to the template." } }, "additionalProperties": true, "description": "One Bannerbear image." }, "nullable": false, "handle": "image" } ], "name": "Render the cocktail banner", "executor": { "kind": "connector", "action": "bannerbear.create_image_sync" } } }, "n_478703980207baa4": { "inputs": { "image": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_5c17d8a6204eb91f", "output": "image" } ] } }, "name": "Check the rendered image", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "uid": { "type": "string", "description": "The unique image UID." }, "status": { "type": "string", "description": "The current image status, such as pending, completed, or failed." }, "self": { "type": "string", "format": "uri", "description": "The API URL for this image." }, "image_url": { "type": [ "string", "null" ], "format": "uri", "description": "The generated media URL." }, "pdf_url": { "type": [ "string", "null" ], "format": "uri", "description": "The generated media URL." }, "template": { "type": "string", "description": "The template UID used to create the image." }, "width": { "type": "integer", "description": "The rendered image width in pixels." }, "height": { "type": "integer", "description": "The rendered image height in pixels." }, "metadata": { "type": [ "string", "null" ], "description": "Custom metadata stored with the image." }, "created_at": { "type": "string", "description": "The image creation timestamp." }, "render_pdf": { "type": "boolean", "description": "Whether PDF rendering was requested." }, "transparent": { "type": "boolean", "description": "Whether transparent background rendering was requested." }, "webhook_url": { "type": [ "string", "null" ], "format": "uri", "description": "The webhook URL notified on completion." }, "webhook_response_code": { "type": [ "integer", "null" ], "description": "The HTTP status code returned by the webhook endpoint." }, "modifications": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The layer name." } }, "additionalProperties": true, "description": "One modification returned by Bannerbear." }, "description": "The modifications applied to the template." } }, "additionalProperties": true, "description": "One Bannerbear image." }, "nullable": false, "handle": "image" } ], "outputs": [ { "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "audio_url": { "type": "string", "format": "uri", "description": "Audio URL for the attachment." }, "author_icon": { "type": "string", "format": "uri", "description": "Icon URL displayed next to the author name." }, "author_link": { "type": "string", "format": "uri", "description": "URL linked from the author name." }, "author_name": { "type": "string", "description": "Attachment author name." }, "collapsed": { "type": "boolean", "description": "Whether the attachment should render collapsed." }, "color": { "type": "string", "description": "Attachment accent color." }, "fields": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "description": "The attachment field title." }, "value": { "type": "string", "description": "The attachment field value." }, "short": { "type": "boolean", "description": "Whether this field should be displayed as a short field." } }, "required": [ "title", "value" ], "additionalProperties": false, "description": "Rocket.Chat attachment field." }, "description": "Attachment fields." }, "image_url": { "type": "string", "format": "uri", "description": "Image URL for the attachment." }, "message_link": { "type": "string", "format": "uri", "description": "URL linked from the attachment timestamp." }, "text": { "type": "string", "description": "Attachment text." }, "thumb_url": { "type": "string", "format": "uri", "description": "Thumbnail URL for the attachment." }, "title": { "type": "string", "description": "Attachment title." }, "title_link": { "type": "string", "format": "uri", "description": "URL linked from the attachment title." }, "title_link_download": { "type": "boolean", "description": "Whether title_link should download when clicked." }, "ts": { "type": "string", "description": "Attachment timestamp string." }, "video_url": { "type": "string", "format": "uri", "description": "Video URL for the attachment." } }, "additionalProperties": true, "description": "Rocket.Chat message attachment." }, "description": "Message attachments." }, "nullable": false, "handle": "attachments" } ], "name": "Check the rendered image", "moduleId": "n_63d389c9e18daf44", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_bbfb8c210a111353": { "inputs": { "roomId": { "kind": "value", "value": "YOUR_ROCKET_CHAT_ROOM" }, "text": { "kind": "value", "value": "" }, "attachments": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_478703980207baa4", "output": "attachments" } ] } }, "name": "Post the banner in Rocket.Chat", "kind": "task", "task": { "inputs": [ { "description": "The room ID, channel name, or username target. Channel names must include the # prefix and usernames can use @.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The room ID, channel name, or username target. Channel names must include the # prefix and usernames can use @." }, "nullable": false, "handle": "roomId" }, { "description": "The message text to send.", "jsonSchema": { "type": "string", "description": "The message text to send." }, "nullable": true, "handle": "text", "value": null }, { "description": "Whether Rocket.Chat should generate URL previews.", "jsonSchema": { "type": "boolean", "description": "Whether Rocket.Chat should generate URL previews." }, "nullable": true, "handle": "parseUrls", "value": null }, { "description": "Display alias for the message when the user has impersonation permission.", "jsonSchema": { "type": "string", "description": "Display alias for the message when the user has impersonation permission." }, "nullable": true, "handle": "alias", "value": null }, { "description": "Avatar URL for the message when the user has impersonation permission.", "jsonSchema": { "type": "string", "format": "uri", "description": "Avatar URL for the message when the user has impersonation permission." }, "nullable": true, "handle": "avatar", "value": null }, { "description": "Emoji avatar for the message when the user has impersonation permission.", "jsonSchema": { "type": "string", "description": "Emoji avatar for the message when the user has impersonation permission." }, "nullable": true, "handle": "emoji", "value": null }, { "description": "Message attachments.", "jsonSchema": { "type": "array", "items": { "type": "object", "properties": { "audio_url": { "type": "string", "format": "uri", "description": "Audio URL for the attachment." }, "author_icon": { "type": "string", "format": "uri", "description": "Icon URL displayed next to the author name." }, "author_link": { "type": "string", "format": "uri", "description": "URL linked from the author name." }, "author_name": { "type": "string", "description": "Attachment author name." }, "collapsed": { "type": "boolean", "description": "Whether the attachment should render collapsed." }, "color": { "type": "string", "description": "Attachment accent color." }, "fields": { "type": "array", "items": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "description": "The attachment field title." }, "value": { "type": "string", "description": "The attachment field value." }, "short": { "type": "boolean", "description": "Whether this field should be displayed as a short field." } }, "required": [ "title", "value" ], "additionalProperties": false, "description": "Rocket.Chat attachment field." }, "description": "Attachment fields." }, "image_url": { "type": "string", "format": "uri", "description": "Image URL for the attachment." }, "message_link": { "type": "string", "format": "uri", "description": "URL linked from the attachment timestamp." }, "text": { "type": "string", "description": "Attachment text." }, "thumb_url": { "type": "string", "format": "uri", "description": "Thumbnail URL for the attachment." }, "title": { "type": "string", "description": "Attachment title." }, "title_link": { "type": "string", "format": "uri", "description": "URL linked from the attachment title." }, "title_link_download": { "type": "boolean", "description": "Whether title_link should download when clicked." }, "ts": { "type": "string", "description": "Attachment timestamp string." }, "video_url": { "type": "string", "format": "uri", "description": "Video URL for the attachment." } }, "additionalProperties": true, "description": "Rocket.Chat message attachment." }, "description": "Message attachments." }, "nullable": true, "handle": "attachments", "value": null }, { "description": "The original message ID for a thread reply.", "jsonSchema": { "type": "string", "minLength": 1, "description": "The original message ID for a thread reply." }, "nullable": true, "handle": "tmid", "value": null }, { "description": "Custom message fields configured by the workspace.", "jsonSchema": { "type": "object", "properties": {}, "additionalProperties": true, "description": "Custom message fields configured by the workspace." }, "nullable": true, "handle": "customFields", "value": null } ], "outputs": [ { "description": "Rocket.Chat message object returned by the API.", "jsonSchema": { "type": "object", "properties": { "_id": { "type": "string", "minLength": 1, "description": "The Rocket.Chat message ID." }, "rid": { "type": "string", "minLength": 1, "description": "The room ID that owns the message." }, "msg": { "type": "string", "description": "The message text." } }, "additionalProperties": true, "description": "Rocket.Chat message object returned by the API." }, "nullable": false, "handle": "message" }, { "description": "Whether Rocket.Chat reported success.", "jsonSchema": { "type": "boolean", "description": "Whether Rocket.Chat reported success." }, "nullable": false, "handle": "success" } ], "name": "Post the banner in Rocket.Chat", "executor": { "kind": "connector", "action": "rocket_chat.post_message" } } }, "n_30643cc39ed93946": { "inputs": { "message": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_bbfb8c210a111353", "output": "message" } ] }, "success": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_bbfb8c210a111353", "output": "success" } ] } }, "name": "Confirm the Rocket.Chat post", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "object", "properties": { "_id": { "type": "string", "minLength": 1, "description": "The Rocket.Chat message ID." }, "rid": { "type": "string", "minLength": 1, "description": "The room ID that owns the message." }, "msg": { "type": "string", "description": "The message text." } }, "additionalProperties": true, "description": "Rocket.Chat message object returned by the API." }, "nullable": false, "handle": "message" }, { "jsonSchema": { "type": "boolean", "description": "Whether Rocket.Chat reported success." }, "nullable": false, "handle": "success" } ], "outputs": [ { "jsonSchema": { "type": "object", "additionalProperties": true }, "nullable": false, "handle": "message" } ], "name": "Confirm the Rocket.Chat post", "moduleId": "n_2bac8ed13dadb904", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } } }, "edges": [ { "source": "n_bd570268bb8eaaf2", "target": "n_66e8fab8ef19eac2" }, { "source": "n_66e8fab8ef19eac2", "target": "n_a92b7ef346f90847" }, { "source": "n_a92b7ef346f90847", "target": "n_c79476f3c6c15cb7" }, { "source": "n_c79476f3c6c15cb7", "target": "n_ab221d4942d3e798" }, { "source": "n_ab221d4942d3e798", "target": "n_66e8fab8ef19eac2", "sourceHandle": "follow" }, { "source": "n_ab221d4942d3e798", "target": "n_5c17d8a6204eb91f", "sourceHandle": "otherwise" }, { "source": "n_5c17d8a6204eb91f", "target": "n_478703980207baa4" }, { "source": "n_478703980207baa4", "target": "n_bbfb8c210a111353" }, { "source": "n_bbfb8c210a111353", "target": "n_30643cc39ed93946" } ] } }, "modules": { "n_bb27501024618420": { "name": "Prepare the cocktail URL", "imports": [], "source": "export default function hop({initialUrl,previousState}) {const candidate=previousState?.nextUrl||initialUrl;let url;try{url=new URL(candidate)}catch{throw Error('Configure a valid HTTP or HTTPS target URL')}if(!['http:','https:'].includes(url.protocol)||url.username||url.password)throw Error('Configure an HTTP or HTTPS URL without credentials');return{url:url.toString()};}\n" }, "n_7f87831c9446969a": { "name": "Prepare the template layers", "imports": [], "source": "export default function check({url,statusCode,headers,body,previousState}){const hops=previousState?.hops??0;if(!Number.isInteger(statusCode)||statusCode<100||statusCode>599||!Number.isInteger(hops)||hops<0)throw Error('Invalid response');if(statusCode>=300&&statusCode<400&&typeof headers?.location==='string'&&headers.location){if(hops>=21)throw Error('Too many redirects');let target;try{target=new URL(headers.location,url)}catch{throw Error('Invalid redirect')}if(!['http:','https:'].includes(target.protocol)||target.username||target.password)throw Error('Invalid redirect');return{state:{hops:hops+1,nextUrl:target.toString()},redirect:true,modifications:[{name:'redirect'}]}}if(statusCode<200||statusCode>=300)throw Error('Cocktail request failed');let result;try{result=JSON.parse(body)}catch{throw Error('Invalid cocktail JSON')}const d=result?.drinks?.[0];if(typeof d?.strDrink!=='string'||!d.strDrink.trim()||typeof d?.strInstructions!=='string'||!d.strInstructions.trim()||typeof d?.strDrinkThumb!=='string')throw Error('Cocktail response lacks name, instructions or image');if(!/^https?:\\/\\/[^/?#@\\s]+(?:[/?#][^\\s]*)?$/i.test(d.strDrinkThumb))throw Error('Invalid cocktail image URL');return{state:{hops,nextUrl:''},redirect:false,modifications:[{name:'cocktail-image',image_url:d.strDrinkThumb},{name:'title',text:d.strDrink},{name:'recipe',text:d.strInstructions}]}}\n" }, "n_63d389c9e18daf44": { "name": "Check the rendered image", "imports": [], "source": "export default function attachment({image}){if(!image||typeof image!=='object'||image.status!=='completed'||typeof image.uid!=='string'||!image.uid||typeof image.image_url!=='string')throw Error('Bannerbear did not return a completed image');if(!/^https?:\\/\\/[^/?#@\\s]+(?:[/?#][^\\s]*)?$/i.test(image.image_url))throw Error('Invalid rendered image URL');return{attachments:[{image_url:image.image_url}]}}\n" }, "n_2bac8ed13dadb904": { "name": "Confirm the Rocket.Chat post", "imports": [], "source": "function readRocketMessage(message, success) {\n if (success !== true || !message || typeof message !== 'object' || Array.isArray(message) || typeof message._id !== 'string' || message._id.length === 0 || typeof message.rid !== 'string' || message.rid.length === 0 || typeof message.msg !== 'string') throw new Error('Rocket.Chat did not confirm a sent message');\n return message;\n}\nexport default function rocketChatResult({ message, success }) {\n return { message: readRocketMessage(message, success) };\n}\n" } } }, "presentation": { "designer": { "version": 1, "flow": { "direction": "vertical" } } } }