{ "kind": "open-flow-workflow", "version": 1, "name": "Update an XML Slideshow in Dropbox", "content": { "modelVersion": 14, "document": { "bindings": {}, "graph": { "nodes": { "n_3fadb42d88cb20a6": { "name": "Update the slideshow", "kind": "start", "inputDefs": [] }, "n_d13db6a62daaa697": { "inputs": { "url": { "kind": "value", "value": "https://httpbin.org/xml" } }, "name": "Fetch slideshow XML", "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": "Fetch slideshow XML", "executor": { "method": "GET", "query": { "mode": "fields", "names": [] }, "headers": { "mode": "fields", "names": [] }, "bodyFormat": "none", "authentication": { "type": "none" }, "responseFormat": "text", "statusPolicy": "success", "kind": "http-request" } } }, "n_778747f0e6a09018": { "inputs": { "xml": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_d13db6a62daaa697", "output": "body" } ] }, "title": { "kind": "value", "value": "New Title Name" } }, "name": "Change the slideshow title", "kind": "task", "task": { "inputs": [ { "jsonSchema": { "type": "string" }, "nullable": true, "handle": "xml" }, { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "title" } ], "outputs": [ { "jsonSchema": { "type": "string" }, "nullable": false, "handle": "xml" } ], "name": "Change the slideshow title", "moduleId": "n_86f1626816e9f65d", "capabilities": [ { "kind": "connector", "mode": "independent", "actions": [] } ] } }, "n_460fe303ae53ab08": { "inputs": { "path": { "kind": "value", "value": "/my-xml-file.xml" }, "text": { "kind": "sources", "sources": [ { "kind": "node", "nodeId": "n_778747f0e6a09018", "output": "xml" } ] }, "mode": { "kind": "value", "value": "add" }, "autorename": { "kind": "value", "value": false }, "mute": { "kind": "value", "value": false } }, "name": "Save XML to Dropbox", "kind": "task", "task": { "inputs": [ { "description": "A Dropbox path, file ID, revision ID, or namespace-relative path.", "jsonSchema": { "type": "string", "description": "A Dropbox path, file ID, revision ID, or namespace-relative path." }, "nullable": false, "handle": "path" }, { "description": "Inline UTF-8 text content to upload.", "jsonSchema": { "type": "string", "description": "Inline UTF-8 text content to upload." }, "nullable": true, "handle": "text", "value": null }, { "description": "Base64-encoded binary content to upload.", "jsonSchema": { "type": "string", "description": "Base64-encoded binary content to upload." }, "nullable": true, "handle": "contentBase64", "value": null }, { "description": "Optional MIME type override for inline text or base64 content.", "jsonSchema": { "type": "string", "description": "Optional MIME type override for inline text or base64 content." }, "nullable": true, "handle": "mimeType", "value": null }, { "description": "How Dropbox should handle conflicts at the destination path.", "jsonSchema": { "type": "string", "enum": [ "add", "overwrite", "update" ], "description": "How Dropbox should handle conflicts at the destination path." }, "nullable": true, "handle": "mode", "value": null }, { "description": "The required file revision when mode is update.", "jsonSchema": { "type": "string", "description": "The required file revision when mode is update." }, "nullable": true, "handle": "updateRev", "value": null }, { "description": "Whether Dropbox should autorename on conflict when supported by the mode.", "jsonSchema": { "type": "boolean", "description": "Whether Dropbox should autorename on conflict when supported by the mode." }, "nullable": true, "handle": "autorename", "value": null }, { "description": "Optional client-side modification timestamp in ISO 8601 format.", "jsonSchema": { "type": "string", "format": "date-time", "description": "Optional client-side modification timestamp in ISO 8601 format." }, "nullable": true, "handle": "clientModified", "value": null }, { "description": "Whether the upload should avoid client-side user notifications.", "jsonSchema": { "type": "boolean", "description": "Whether the upload should avoid client-side user notifications." }, "nullable": true, "handle": "mute", "value": null }, { "description": "Whether Dropbox should use stricter conflict detection.", "jsonSchema": { "type": "boolean", "description": "Whether Dropbox should use stricter conflict detection." }, "nullable": true, "handle": "strictConflict", "value": null }, { "description": "Optional Dropbox content hash for integrity verification.", "jsonSchema": { "type": "string", "description": "Optional Dropbox content hash for integrity verification." }, "nullable": true, "handle": "contentHash", "value": null } ], "outputs": [ { "description": "A normalized Dropbox metadata or shared-link record.", "jsonSchema": { "type": "object", "properties": { "tag": { "type": "string", "description": "The Dropbox metadata tag such as file, folder, or deleted." }, "name": { "type": "string", "description": "The Dropbox item name." }, "id": { "type": [ "string", "null" ], "description": "The Dropbox item ID when available." }, "pathDisplay": { "type": [ "string", "null" ], "description": "The user-facing cased path when available." }, "pathLower": { "type": [ "string", "null" ], "description": "The lower-cased full path when available." }, "clientModified": { "type": [ "string", "null" ], "description": "The client-provided modification timestamp in ISO 8601 format when available." }, "serverModified": { "type": [ "string", "null" ], "description": "The server-side modification timestamp in ISO 8601 format when available." }, "rev": { "type": [ "string", "null" ], "description": "The Dropbox file revision when available." }, "sizeBytes": { "type": [ "integer", "null" ], "description": "The file size in bytes when available." }, "isDownloadable": { "type": [ "boolean", "null" ], "description": "Whether the file can be downloaded directly." }, "contentHash": { "type": [ "string", "null" ], "description": "The Dropbox content hash when available." }, "url": { "type": [ "string", "null" ], "description": "The shared link URL when available." }, "expiresAt": { "type": [ "string", "null" ], "description": "The shared link expiration timestamp in ISO 8601 format when available." }, "sharingInfo": { "type": [ "object", "null" ], "properties": {}, "additionalProperties": true, "description": "A generic JSON object returned by Dropbox." }, "hasExplicitSharedMembers": { "type": [ "boolean", "null" ], "description": "Whether the file has explicit members, when requested in the listing." }, "linkPermissions": { "type": [ "object", "null" ], "properties": {}, "additionalProperties": true, "description": "Shared-link permission metadata when Dropbox includes it." } }, "required": [ "tag", "name", "id", "pathDisplay", "pathLower", "clientModified", "serverModified", "rev", "sizeBytes", "isDownloadable", "contentHash", "url", "expiresAt", "sharingInfo", "hasExplicitSharedMembers", "linkPermissions" ], "additionalProperties": false, "description": "A normalized Dropbox metadata or shared-link record." }, "nullable": false, "handle": "metadata" } ], "name": "Save XML to Dropbox", "executor": { "kind": "connector", "action": "dropbox.upload_file" } } } }, "edges": [ { "source": "n_3fadb42d88cb20a6", "target": "n_d13db6a62daaa697" }, { "source": "n_d13db6a62daaa697", "target": "n_778747f0e6a09018" }, { "source": "n_778747f0e6a09018", "target": "n_460fe303ae53ab08" } ] } }, "modules": { "n_86f1626816e9f65d": { "name": "Change the slideshow title", "imports": [], "source": "export default function change({xml,title}){if(typeof xml!=='string'||typeof title!=='string'||!title)throw Error('Provide XML and a title');const m=/]*?)>/i.exec(xml);if(!m)throw Error('Missing slideshow root');const found=[...m[1].matchAll(/\\btitle\\s*=\\s*([\"'])(.*?)\\1/gis)];if(found.length!==1)throw Error('Expected one slideshow title attribute');const escaped=title.replace(/&/g,'&').replace(/