UNPKG

@pipedream/pushcut

Version:

Pipedream Pushcut Components

45 lines (41 loc) 916 B
import pushcut from "../../pushcut.app.mjs"; export default { key: "pushcut-execute-shortcut", name: "Execute Shortcut", description: "Schedules an Automation Server action request for a shortcut. [See the documentation](https://www.pushcut.io/webapi)", version: "0.0.1", type: "action", props: { pushcut, shortcut: { propDefinition: [ pushcut, "shortcut", ], }, timeout: { propDefinition: [ pushcut, "timeout", ], }, delay: { propDefinition: [ pushcut, "delay", ], }, }, async run({ $ }) { const response = await this.pushcut.executeAction({ data: { shortcut: this.shortcut, timeout: this.timeout, delay: this.delay, }, $, }); $.export("$summary", `Successfully executed shortcut ${this.shortcut}.`); return response; }, };