{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "required": ["id", "name", "startAuth", "checkAuth", "getDocuments"], "properties": { "$schema": { "type": "string", "description": "The URL of the JSON schema used to validate the plugin", "title": "JSON Schema" }, "id": { "type": "string", "description": "The unique ID of the plugin", "title": "Plugin ID" }, "name": { "type": "string", "description": "The unique name of the plugin", "title": "Plugin Name" }, "description": { "type": "string", "description": "A short summary describing what the plugin does", "title": "Plugin Description" }, "homepage": { "type": "string", "description": "The URL of the service the plugin is for. Used for linking to the service and for the plugin logo.", "title": "Plugin Homepage" }, "configSchema": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "object", "required": ["type"], "properties": { "required": { "type": "boolean", "description": "Whether or not this property is required for the plugin to function", "title": "Required" }, "title": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A brief description of what this property is used for", "title": "Description" }, "example": { "type": "string", "description": "An example value for this property", "title": "Example" }, "type": { "enum": ["string", "number", "boolean", "password"], "description": "The type of the property.", "title": "Type" }, "default": { "anyOf": [ { "type": "string", "description": "a string", "title": "string" }, { "type": "number", "description": "a number", "title": "number" }, { "type": "boolean", "description": "a boolean", "title": "boolean" } ], "description": "The default value for this property", "title": "Default" } }, "additionalProperties": false, "description": "Defines a single property in the plugin configuration schema", "title": "Configuration Property", "examples": [ { "type": "string", "title": "Username", "description": "The username for login", "required": true } ] }, "description": "A list of properties that can be configured for the plugin", "title": "Configuration Properties" }, "startAuth": { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": ["action", "script"], "properties": { "action": { "const": "runJs" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "script": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "click" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "value"], "properties": { "action": { "const": "type" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "value": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "waitForElement" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action"], "properties": { "action": { "const": "waitForNavigation" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action"], "properties": { "action": { "const": "waitForNetworkIdle" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "navigate" }, "waitForNetworkIdle": { "type": "boolean", "description": "Whether or not to wait for the network to be idle after navigation", "title": "Wait for Network Idle", "default": false }, "url": { "type": "string", "description": "The URL to navigate to", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "checkElementExists" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "checkURL" }, "url": { "type": "string", "description": "The URL to check against", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "document"], "properties": { "action": { "const": "waitForPdfDownload" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "waitForURL" }, "url": { "type": "string", "description": "The URL to wait for", "title": "URL" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "value"], "properties": { "action": { "const": "dropdownSelect" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "value": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "document"], "properties": { "action": { "const": "printPdf" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "variable", "script"], "properties": { "action": { "const": "extract" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. Defaults to `item`", "title": "Variable" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "variable", "fields"], "properties": { "action": { "const": "extract" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. Defaults to `item`", "title": "Variable" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "fields": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "anyOf": [ { "type": "object", "required": ["selector"], "properties": { "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "attribute": { "type": "string", "description": "The attribute to get from the element. If not specified, the inner text will be used", "title": "Attribute" }, "transform": { "type": "string", "description": "A JavaScript function to transform the value", "title": "Transform", "examples": ["(v) => Number(v.replace('$', ''))"] } }, "additionalProperties": false }, { "type": "string", "description": "a string", "title": "string" } ] } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "duration"], "properties": { "action": { "const": "sleep" }, "duration": { "type": "number", "description": "The number of milliseconds to wait for", "title": "Duration" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url", "document"], "properties": { "action": { "const": "downloadPdf" }, "url": { "type": "string", "description": "The URL to download the PDF from", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "base64", "document"], "properties": { "action": { "const": "downloadBase64Pdf" }, "base64": { "type": "string", "description": "The base64 encoded PDF content", "title": "Base64" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false } ] }, { "anyOf": [ { "type": "object", "required": ["action", "script", "forEach"], "properties": { "action": { "const": "extractAll" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. This is only available inside the forEach step, and represents a single item. Defaults to `item`", "title": "Variable", "default": "item" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "pagination": { "anyOf": [ { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "next" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "waitForSelector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false }, { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "loadMore" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false } ], "description": "Defines how to paginate through the results", "title": "Pagination" }, "forEach": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "forEach", "fields"], "properties": { "action": { "const": "extractAll" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. This is only available inside the forEach step, and represents a single item. Defaults to `item`", "title": "Variable", "default": "item" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "pagination": { "anyOf": [ { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "next" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "waitForSelector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false }, { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "loadMore" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false } ], "description": "Defines how to paginate through the results", "title": "Pagination" }, "forEach": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "fields": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "anyOf": [ { "type": "object", "required": ["selector"], "properties": { "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "attribute": { "type": "string", "description": "The attribute to get from the element. If not specified, the inner text will be used", "title": "Attribute" }, "transform": { "type": "string", "description": "A JavaScript function to transform the value", "title": "Transform", "examples": ["(v) => Number(v.replace('$', ''))"] } }, "additionalProperties": false }, { "type": "string", "description": "a string", "title": "string" } ] } } }, "additionalProperties": false } ], "description": "Extracts a list of data from the page, and runs the given steps for each item", "title": "Extract All" }, { "anyOf": [ { "type": "object", "required": ["action", "script", "then"], "properties": { "action": { "const": "if" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "then": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "else": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "then"], "properties": { "action": { "const": "if" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "then": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "else": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false } ], "description": "Runs the given steps if the condition is true", "title": "If" }, { "type": "object", "required": ["action", "snippet", "args"], "properties": { "action": { "const": "runSnippet" }, "snippet": { "enum": [ "getInvoiceFromStripeUrl", "getInvoicesFromStripeBillingPortal" ] }, "args": { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "description": "The URL to use in the snippet", "title": "URL" } }, "additionalProperties": false } }, "additionalProperties": false, "description": "Runs a predefined snippet with the given configuration", "title": "Run Snippet", "examples": [ { "action": "runSnippet", "snippet": "getInvoiceFromStripeUrl", "args": { "url": "https://example.com/invoice" } } ] } ] }, "description": "Steps to authenticate the user", "title": "Authentication" }, "checkAuth": { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": ["action", "script"], "properties": { "action": { "const": "runJs" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "script": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "click" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "value"], "properties": { "action": { "const": "type" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "value": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "waitForElement" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action"], "properties": { "action": { "const": "waitForNavigation" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action"], "properties": { "action": { "const": "waitForNetworkIdle" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "navigate" }, "waitForNetworkIdle": { "type": "boolean", "description": "Whether or not to wait for the network to be idle after navigation", "title": "Wait for Network Idle", "default": false }, "url": { "type": "string", "description": "The URL to navigate to", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "checkElementExists" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "checkURL" }, "url": { "type": "string", "description": "The URL to check against", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "document"], "properties": { "action": { "const": "waitForPdfDownload" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "waitForURL" }, "url": { "type": "string", "description": "The URL to wait for", "title": "URL" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "value"], "properties": { "action": { "const": "dropdownSelect" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "value": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "document"], "properties": { "action": { "const": "printPdf" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "variable", "script"], "properties": { "action": { "const": "extract" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. Defaults to `item`", "title": "Variable" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "variable", "fields"], "properties": { "action": { "const": "extract" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. Defaults to `item`", "title": "Variable" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "fields": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "anyOf": [ { "type": "object", "required": ["selector"], "properties": { "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "attribute": { "type": "string", "description": "The attribute to get from the element. If not specified, the inner text will be used", "title": "Attribute" }, "transform": { "type": "string", "description": "A JavaScript function to transform the value", "title": "Transform", "examples": ["(v) => Number(v.replace('$', ''))"] } }, "additionalProperties": false }, { "type": "string", "description": "a string", "title": "string" } ] } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "duration"], "properties": { "action": { "const": "sleep" }, "duration": { "type": "number", "description": "The number of milliseconds to wait for", "title": "Duration" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url", "document"], "properties": { "action": { "const": "downloadPdf" }, "url": { "type": "string", "description": "The URL to download the PDF from", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "base64", "document"], "properties": { "action": { "const": "downloadBase64Pdf" }, "base64": { "type": "string", "description": "The base64 encoded PDF content", "title": "Base64" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false } ] }, { "anyOf": [ { "type": "object", "required": ["action", "script", "forEach"], "properties": { "action": { "const": "extractAll" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. This is only available inside the forEach step, and represents a single item. Defaults to `item`", "title": "Variable", "default": "item" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "pagination": { "anyOf": [ { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "next" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "waitForSelector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false }, { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "loadMore" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false } ], "description": "Defines how to paginate through the results", "title": "Pagination" }, "forEach": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "forEach", "fields"], "properties": { "action": { "const": "extractAll" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. This is only available inside the forEach step, and represents a single item. Defaults to `item`", "title": "Variable", "default": "item" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "pagination": { "anyOf": [ { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "next" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "waitForSelector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false }, { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "loadMore" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false } ], "description": "Defines how to paginate through the results", "title": "Pagination" }, "forEach": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "fields": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "anyOf": [ { "type": "object", "required": ["selector"], "properties": { "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "attribute": { "type": "string", "description": "The attribute to get from the element. If not specified, the inner text will be used", "title": "Attribute" }, "transform": { "type": "string", "description": "A JavaScript function to transform the value", "title": "Transform", "examples": ["(v) => Number(v.replace('$', ''))"] } }, "additionalProperties": false }, { "type": "string", "description": "a string", "title": "string" } ] } } }, "additionalProperties": false } ], "description": "Extracts a list of data from the page, and runs the given steps for each item", "title": "Extract All" }, { "anyOf": [ { "type": "object", "required": ["action", "script", "then"], "properties": { "action": { "const": "if" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "then": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "else": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "then"], "properties": { "action": { "const": "if" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "then": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "else": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false } ], "description": "Runs the given steps if the condition is true", "title": "If" }, { "type": "object", "required": ["action", "snippet", "args"], "properties": { "action": { "const": "runSnippet" }, "snippet": { "enum": [ "getInvoiceFromStripeUrl", "getInvoicesFromStripeBillingPortal" ] }, "args": { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "description": "The URL to use in the snippet", "title": "URL" } }, "additionalProperties": false } }, "additionalProperties": false, "description": "Runs a predefined snippet with the given configuration", "title": "Run Snippet", "examples": [ { "action": "runSnippet", "snippet": "getInvoiceFromStripeUrl", "args": { "url": "https://example.com/invoice" } } ] } ] }, "description": "Steps to check if the user is already authenticated", "title": "Verify Authentication" }, "getDocuments": { "type": "array", "items": { "anyOf": [ { "anyOf": [ { "type": "object", "required": ["action", "script"], "properties": { "action": { "const": "runJs" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "script": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "click" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "value"], "properties": { "action": { "const": "type" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "value": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "waitForElement" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action"], "properties": { "action": { "const": "waitForNavigation" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action"], "properties": { "action": { "const": "waitForNetworkIdle" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "navigate" }, "waitForNetworkIdle": { "type": "boolean", "description": "Whether or not to wait for the network to be idle after navigation", "title": "Wait for Network Idle", "default": false }, "url": { "type": "string", "description": "The URL to navigate to", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "checkElementExists" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "checkURL" }, "url": { "type": "string", "description": "The URL to check against", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "document"], "properties": { "action": { "const": "waitForPdfDownload" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "waitForURL" }, "url": { "type": "string", "description": "The URL to wait for", "title": "URL" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "value"], "properties": { "action": { "const": "dropdownSelect" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "value": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "document"], "properties": { "action": { "const": "printPdf" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "variable", "script"], "properties": { "action": { "const": "extract" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. Defaults to `item`", "title": "Variable" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "variable", "fields"], "properties": { "action": { "const": "extract" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. Defaults to `item`", "title": "Variable" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "fields": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "anyOf": [ { "type": "object", "required": ["selector"], "properties": { "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "attribute": { "type": "string", "description": "The attribute to get from the element. If not specified, the inner text will be used", "title": "Attribute" }, "transform": { "type": "string", "description": "A JavaScript function to transform the value", "title": "Transform", "examples": ["(v) => Number(v.replace('$', ''))"] } }, "additionalProperties": false }, { "type": "string", "description": "a string", "title": "string" } ] } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "duration"], "properties": { "action": { "const": "sleep" }, "duration": { "type": "number", "description": "The number of milliseconds to wait for", "title": "Duration" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url", "document"], "properties": { "action": { "const": "downloadPdf" }, "url": { "type": "string", "description": "The URL to download the PDF from", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "base64", "document"], "properties": { "action": { "const": "downloadBase64Pdf" }, "base64": { "type": "string", "description": "The base64 encoded PDF content", "title": "Base64" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false } ] }, { "anyOf": [ { "type": "object", "required": ["action", "script", "forEach"], "properties": { "action": { "const": "extractAll" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. This is only available inside the forEach step, and represents a single item. Defaults to `item`", "title": "Variable", "default": "item" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "pagination": { "anyOf": [ { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "next" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "waitForSelector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false }, { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "loadMore" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false } ], "description": "Defines how to paginate through the results", "title": "Pagination" }, "forEach": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "forEach", "fields"], "properties": { "action": { "const": "extractAll" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. This is only available inside the forEach step, and represents a single item. Defaults to `item`", "title": "Variable", "default": "item" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "pagination": { "anyOf": [ { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "next" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "waitForSelector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false }, { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "loadMore" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false } ], "description": "Defines how to paginate through the results", "title": "Pagination" }, "forEach": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "fields": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "anyOf": [ { "type": "object", "required": ["selector"], "properties": { "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "attribute": { "type": "string", "description": "The attribute to get from the element. If not specified, the inner text will be used", "title": "Attribute" }, "transform": { "type": "string", "description": "A JavaScript function to transform the value", "title": "Transform", "examples": ["(v) => Number(v.replace('$', ''))"] } }, "additionalProperties": false }, { "type": "string", "description": "a string", "title": "string" } ] } } }, "additionalProperties": false } ], "description": "Extracts a list of data from the page, and runs the given steps for each item", "title": "Extract All" }, { "anyOf": [ { "type": "object", "required": ["action", "script", "then"], "properties": { "action": { "const": "if" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "then": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "else": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "then"], "properties": { "action": { "const": "if" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "then": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "else": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false } ], "description": "Runs the given steps if the condition is true", "title": "If" }, { "type": "object", "required": ["action", "snippet", "args"], "properties": { "action": { "const": "runSnippet" }, "snippet": { "enum": [ "getInvoiceFromStripeUrl", "getInvoicesFromStripeBillingPortal" ] }, "args": { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "description": "The URL to use in the snippet", "title": "URL" } }, "additionalProperties": false } }, "additionalProperties": false, "description": "Runs a predefined snippet with the given configuration", "title": "Run Snippet", "examples": [ { "action": "runSnippet", "snippet": "getInvoiceFromStripeUrl", "args": { "url": "https://example.com/invoice" } } ] } ] }, "description": "Steps to get all invoices as PDF", "title": "Collect Invoices" } }, "additionalProperties": false, "description": "Schema definition for a JSON-based plugin", "title": "JSON Plugin Schema", "examples": [ { "name": "ExamplePlugin", "description": "This is an example plugin", "configSchema": { "exampleProperty": { "type": "string", "title": "Example Property", "description": "An example property for demonstration", "required": true } }, "startAuth": [ { "action": "navigate", "url": "https://example.com/login" } ], "checkAuth": [ { "action": "checkElementExists", "selector": "#logout" } ], "getDocuments": [ { "action": "navigate", "url": "https://example.com/invoices" } ], "id": "example-plugin" } ], "$defs": { "Step": { "anyOf": [ { "anyOf": [ { "type": "object", "required": ["action", "script"], "properties": { "action": { "const": "runJs" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "script": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "click" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "value"], "properties": { "action": { "const": "type" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "value": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "waitForElement" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action"], "properties": { "action": { "const": "waitForNavigation" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action"], "properties": { "action": { "const": "waitForNetworkIdle" }, "optional": { "type": "boolean", "description": "Whether or not the flow should continue if this step fails", "title": "Optional" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "navigate" }, "waitForNetworkIdle": { "type": "boolean", "description": "Whether or not to wait for the network to be idle after navigation", "title": "Wait for Network Idle", "default": false }, "url": { "type": "string", "description": "The URL to navigate to", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector"], "properties": { "action": { "const": "checkElementExists" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "checkURL" }, "url": { "type": "string", "description": "The URL to check against", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "document"], "properties": { "action": { "const": "waitForPdfDownload" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url"], "properties": { "action": { "const": "waitForURL" }, "url": { "type": "string", "description": "The URL to wait for", "title": "URL" }, "timeout": { "type": "number", "description": "The number of milliseconds to wait for. Defaults to 15s.", "title": "Timeout", "examples": [15000], "default": 15000 }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "value"], "properties": { "action": { "const": "dropdownSelect" }, "scopeSelector": { "type": "boolean", "description": "Defaults to true. If set, the selector will be scoped to the parent element", "title": "Scope Selector", "default": true }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "value": { "type": "string", "description": "a string", "title": "string" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "document"], "properties": { "action": { "const": "printPdf" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "variable", "script"], "properties": { "action": { "const": "extract" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. Defaults to `item`", "title": "Variable" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "variable", "fields"], "properties": { "action": { "const": "extract" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. Defaults to `item`", "title": "Variable" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "fields": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "anyOf": [ { "type": "object", "required": ["selector"], "properties": { "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "attribute": { "type": "string", "description": "The attribute to get from the element. If not specified, the inner text will be used", "title": "Attribute" }, "transform": { "type": "string", "description": "A JavaScript function to transform the value", "title": "Transform", "examples": ["(v) => Number(v.replace('$', ''))"] } }, "additionalProperties": false }, { "type": "string", "description": "a string", "title": "string" } ] } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "duration"], "properties": { "action": { "const": "sleep" }, "duration": { "type": "number", "description": "The number of milliseconds to wait for", "title": "Duration" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "url", "document"], "properties": { "action": { "const": "downloadPdf" }, "url": { "type": "string", "description": "The URL to download the PDF from", "title": "URL" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false }, { "type": "object", "required": ["action", "base64", "document"], "properties": { "action": { "const": "downloadBase64Pdf" }, "base64": { "type": "string", "description": "The base64 encoded PDF content", "title": "Base64" }, "description": { "type": "string", "description": "A human-readable description of what this step does", "title": "Description" }, "document": { "anyOf": [ { "type": "object", "required": ["id", "date"], "properties": { "id": { "type": "string", "description": "The ID of the document", "title": "Document ID" }, "date": { "type": "string", "description": "The date of the document", "title": "Document Date" }, "type": { "enum": [ "invoice", "receipt", "refund", "outgoing_invoice", "other", "auto" ], "description": "The type of the document", "title": "Document Type", "default": "auto" }, "total": { "type": "string", "description": "The amount of the document, including the currency symbol or code.", "title": "Document Amount" } }, "additionalProperties": false }, { "type": "string", "description": "Shorthand to pass a variable that contains the document data, e.g. `{{invoice}}`. Needs to include required fields `id`, `date`, and `total`", "title": "Document Variable", "pattern": "^.*}}$" } ] }, "metadata": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "string", "description": "a string", "title": "string" }, "description": "Additional metadata to include in the exported invoice", "title": "Metadata" } }, "additionalProperties": false } ] }, { "anyOf": [ { "type": "object", "required": ["action", "script", "forEach"], "properties": { "action": { "const": "extractAll" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. This is only available inside the forEach step, and represents a single item. Defaults to `item`", "title": "Variable", "default": "item" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "pagination": { "anyOf": [ { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "next" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "waitForSelector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false }, { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "loadMore" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false } ], "description": "Defines how to paginate through the results", "title": "Pagination" }, "forEach": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "forEach", "fields"], "properties": { "action": { "const": "extractAll" }, "variable": { "type": "string", "description": "The name of the variable to store the extracted value in. This is only available inside the forEach step, and represents a single item. Defaults to `item`", "title": "Variable", "default": "item" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "pagination": { "anyOf": [ { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "next" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "waitForSelector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false }, { "type": "object", "required": ["type", "selector"], "properties": { "type": { "const": "loadMore" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] } }, "additionalProperties": false } ], "description": "Defines how to paginate through the results", "title": "Pagination" }, "forEach": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "fields": { "type": "object", "required": [], "properties": {}, "additionalProperties": { "anyOf": [ { "type": "object", "required": ["selector"], "properties": { "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "attribute": { "type": "string", "description": "The attribute to get from the element. If not specified, the inner text will be used", "title": "Attribute" }, "transform": { "type": "string", "description": "A JavaScript function to transform the value", "title": "Transform", "examples": ["(v) => Number(v.replace('$', ''))"] } }, "additionalProperties": false }, { "type": "string", "description": "a string", "title": "string" } ] } } }, "additionalProperties": false } ], "description": "Extracts a list of data from the page, and runs the given steps for each item", "title": "Extract All" }, { "anyOf": [ { "type": "object", "required": ["action", "script", "then"], "properties": { "action": { "const": "if" }, "script": { "type": "string", "description": "A JavaScript script to run in the page context", "title": "Script", "examples": ["console.log(\"Hello World\");"] }, "then": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "else": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false }, { "type": "object", "required": ["action", "selector", "then"], "properties": { "action": { "const": "if" }, "selector": { "type": "string", "description": "The CSS selector to use to find the element", "title": "Selector", "examples": ["#example"] }, "then": { "type": "array", "items": { "$ref": "#/$defs/Step" } }, "else": { "type": "array", "items": { "$ref": "#/$defs/Step" } } }, "additionalProperties": false } ], "description": "Runs the given steps if the condition is true", "title": "If" }, { "type": "object", "required": ["action", "snippet", "args"], "properties": { "action": { "const": "runSnippet" }, "snippet": { "enum": [ "getInvoiceFromStripeUrl", "getInvoicesFromStripeBillingPortal" ] }, "args": { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "description": "The URL to use in the snippet", "title": "URL" } }, "additionalProperties": false } }, "additionalProperties": false, "description": "Runs a predefined snippet with the given configuration", "title": "Run Snippet", "examples": [ { "action": "runSnippet", "snippet": "getInvoiceFromStripeUrl", "args": { "url": "https://example.com/invoice" } } ] } ] } } }