diff --git a/components/slack/actions/send-block-kit-message/send-block-kit-message.mjs b/components/slack/actions/send-block-kit-message/send-block-kit-message.mjs new file mode 100644 index 0000000000000..4f252d36a5485 --- /dev/null +++ b/components/slack/actions/send-block-kit-message/send-block-kit-message.mjs @@ -0,0 +1,43 @@ +import buildBlocks from "../common/build-blocks.mjs"; +import common from "../common/send-message.mjs"; + +export default { + ...common, + ...buildBlocks, + key: "slack-send-block-kit-message", + name: "Build and Send a Block Kit Message", + description: "Configure custom blocks and send to a channel, group, or user. [See the documentation](https://api.slack.com/tools/block-kit-builder).", + version: "0.4.0", + type: "action", + props: { + slack: common.props.slack, + conversation: { + propDefinition: [ + common.props.slack, + "conversation", + ], + }, + text: { + type: "string", + label: "Notification Text", + description: "Optionally provide a string for Slack to display as the new message notification (if you do not provide this, notification will be blank).", + optional: true, + }, + ...common.props, + ...buildBlocks.props, + }, + methods: { + ...common.methods, + ...buildBlocks.methods, + async getGeneratedBlocks() { + return await buildBlocks.run.call(this); // call buildBlocks.run with the current context + }, + }, + async run({ $ }) { + this.blocks = await this.getGeneratedBlocks(); // set the blocks prop for common.run to use + const resp = await common.run.call(this, { + $, + }); // call common.run with the current context + return resp; + }, +}; diff --git a/components/slack/package.json b/components/slack/package.json index 6cd894efe2f81..a0f2b324ea0ee 100644 --- a/components/slack/package.json +++ b/components/slack/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/slack", - "version": "0.6.7", + "version": "0.7.0", "description": "Pipedream Slack Components", "main": "slack.app.mjs", "keywords": [