diff --git a/components/frontapp/actions/add-comment/add-comment.mjs b/components/frontapp/actions/add-comment/add-comment.mjs index 72e214fe8840f..61897c97bdfe9 100644 --- a/components/frontapp/actions/add-comment/add-comment.mjs +++ b/components/frontapp/actions/add-comment/add-comment.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-add-comment", name: "Add Comment", description: "Add a comment to a conversation. [See the documentation](https://dev.frontapp.com/reference/add-comment)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/archive-conversation/archive-conversation.mjs b/components/frontapp/actions/archive-conversation/archive-conversation.mjs index e5d3f85ac5c61..d57e128561ba9 100644 --- a/components/frontapp/actions/archive-conversation/archive-conversation.mjs +++ b/components/frontapp/actions/archive-conversation/archive-conversation.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-archive-conversation", name: "Archive Conversation", description: "Archives a conversation. [See the documentation](https://dev.frontapp.com/reference/patch_conversations-conversation-id)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/assign-conversation/assign-conversation.mjs b/components/frontapp/actions/assign-conversation/assign-conversation.mjs index e2229f8c4d79f..7ae3041319858 100644 --- a/components/frontapp/actions/assign-conversation/assign-conversation.mjs +++ b/components/frontapp/actions/assign-conversation/assign-conversation.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-assign-conversation", name: "Assign Conversation", description: "Assign or unassign a conversation. [See the documentation](https://dev.frontapp.com/reference/update-conversation-assignee)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/create-draft-reply/create-draft-reply.mjs b/components/frontapp/actions/create-draft-reply/create-draft-reply.mjs index 5a1da95bcb01e..7c96acf7e628b 100644 --- a/components/frontapp/actions/create-draft-reply/create-draft-reply.mjs +++ b/components/frontapp/actions/create-draft-reply/create-draft-reply.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-create-draft-reply", name: "Create Draft Reply", description: "Create a new draft as a reply to the last message in the conversation. [See the documentation](https://dev.frontapp.com/reference/create-draft-reply)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/create-draft/create-draft.mjs b/components/frontapp/actions/create-draft/create-draft.mjs index 38b22e07992eb..466b3a6f4eeb1 100644 --- a/components/frontapp/actions/create-draft/create-draft.mjs +++ b/components/frontapp/actions/create-draft/create-draft.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-create-draft", name: "Create Draft", description: "Create a draft message which is the first message of a new conversation. [See the documentation](https://dev.frontapp.com/reference/create-draft)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/create-inbox/create-inbox.mjs b/components/frontapp/actions/create-inbox/create-inbox.mjs index 356f99096c389..da22c885195cb 100644 --- a/components/frontapp/actions/create-inbox/create-inbox.mjs +++ b/components/frontapp/actions/create-inbox/create-inbox.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-create-inbox", name: "Create Inbox", description: "Create an inbox in the default team (workspace). [See the documentation](https://dev.frontapp.com/reference/create-inbox).", - version: "0.0.1", + version: "0.0.2", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/create-message-template/create-message-template.mjs b/components/frontapp/actions/create-message-template/create-message-template.mjs index d22e078e3b164..3adf6cf470f07 100644 --- a/components/frontapp/actions/create-message-template/create-message-template.mjs +++ b/components/frontapp/actions/create-message-template/create-message-template.mjs @@ -6,7 +6,7 @@ export default { key: "frontapp-create-message-template", name: "Create Message Template", description: "Create a new message template. [See the documentation](https://dev.frontapp.com/reference/create-message-template).", - version: "0.0.1", + version: "0.0.2", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/create-message/create-message.mjs b/components/frontapp/actions/create-message/create-message.mjs new file mode 100644 index 0000000000000..93651c2e9790f --- /dev/null +++ b/components/frontapp/actions/create-message/create-message.mjs @@ -0,0 +1,71 @@ +import frontApp from "../../frontapp.app.mjs"; + +export default { + key: "frontapp-create-message", + name: "Create Message", + description: "Send a new message from a channel. [See the documentation](https://dev.frontapp.com/reference/create-message).", + version: "0.0.1", + type: "action", + props: { + frontApp, + channelId: { + propDefinition: [ + frontApp, + "channelId", + ], + }, + to: { + propDefinition: [ + frontApp, + "to", + ], + }, + cc: { + propDefinition: [ + frontApp, + "cc", + ], + }, + senderName: { + type: "string", + label: "Sender Name", + description: "Name used for the sender info of the message", + optional: true, + }, + subject: { + type: "string", + label: "Subject", + description: "Subject of the message for email message", + optional: true, + }, + body: { + type: "string", + label: "Body", + description: "Body of the message", + }, + }, + async run({ $ }) { + // const { + // frontApp, + // name, + // teammateIds, + // } = this; + + const data = { + to: this.to, + cc: this.cc, + sender_name: this.senderName, + subject: this.subject, + body: this.body, + }; + + const response = await this.frontApp.createMessage({ + channelId: this.channelId, + data, + $, + }); + + $.export("$summary", `Successfully created message to the recipient: "${this.to}"`); + return response; + }, +}; diff --git a/components/frontapp/actions/delete-message-template/delete-message-template.mjs b/components/frontapp/actions/delete-message-template/delete-message-template.mjs index 2c0b20477e032..6f7c97c84dd66 100644 --- a/components/frontapp/actions/delete-message-template/delete-message-template.mjs +++ b/components/frontapp/actions/delete-message-template/delete-message-template.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-delete-message-template", name: "Delete Message Template", description: "Delete a message template. [See the documentation](https://dev.frontapp.com/reference/delete-message-template).", - version: "0.0.1", + version: "0.0.2", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/get-comment/get-comment.mjs b/components/frontapp/actions/get-comment/get-comment.mjs index 6d0f12a67c0a0..9a1ba9473118b 100644 --- a/components/frontapp/actions/get-comment/get-comment.mjs +++ b/components/frontapp/actions/get-comment/get-comment.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-get-comment", name: "Get Comment", description: "Retrieve a comment from a conversation. [See the documentation](https://dev.frontapp.com/reference/get-comment)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/get-conversation/get-conversation.mjs b/components/frontapp/actions/get-conversation/get-conversation.mjs index dd8ca292f587b..9ee99c6e2775a 100644 --- a/components/frontapp/actions/get-conversation/get-conversation.mjs +++ b/components/frontapp/actions/get-conversation/get-conversation.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-get-conversation", name: "Get Conversation", description: "Retrieve a conversation by its ID from Front. [See the documentation](https://dev.frontapp.com/reference/get-conversation-by-id)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontapp, diff --git a/components/frontapp/actions/get-message/get-message.mjs b/components/frontapp/actions/get-message/get-message.mjs index 9210927a23a4a..23730d305a512 100644 --- a/components/frontapp/actions/get-message/get-message.mjs +++ b/components/frontapp/actions/get-message/get-message.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-get-message", name: "Get Message", description: "Retrieve a message by its ID. [See the documentation](https://dev.frontapp.com/reference/get-message)", - version: "0.0.1", + version: "0.0.2", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/get-teammate/get-teammate.mjs b/components/frontapp/actions/get-teammate/get-teammate.mjs index 89c0f41598908..8a692222124f6 100644 --- a/components/frontapp/actions/get-teammate/get-teammate.mjs +++ b/components/frontapp/actions/get-teammate/get-teammate.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-get-teammate", name: "Get Teammate", description: "Retrieve a teammate by ID. [See the documentation](https://dev.frontapp.com/reference/get-teammate)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/import-message/import-message.mjs b/components/frontapp/actions/import-message/import-message.mjs index 042ff683a122c..ba0bd1bc8307d 100644 --- a/components/frontapp/actions/import-message/import-message.mjs +++ b/components/frontapp/actions/import-message/import-message.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-import-message", name: "Import Message", description: "Appends a new message into an inbox. [See the documentation](https://dev.frontapp.com/reference/import-inbox-message).", - version: "0.1.8", + version: "0.1.9", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/list-comment-mentions/list-comment-mentions.mjs b/components/frontapp/actions/list-comment-mentions/list-comment-mentions.mjs index da31a3f5e230b..62a6251736d78 100644 --- a/components/frontapp/actions/list-comment-mentions/list-comment-mentions.mjs +++ b/components/frontapp/actions/list-comment-mentions/list-comment-mentions.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-list-comment-mentions", name: "List Comment Mentions", description: "List the teammates mentioned in a comment. [See the documentation](https://dev.frontapp.com/reference/list-comment-mentions)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/list-comments/list-comments.mjs b/components/frontapp/actions/list-comments/list-comments.mjs index c659f7816b392..a51e3f470df02 100644 --- a/components/frontapp/actions/list-comments/list-comments.mjs +++ b/components/frontapp/actions/list-comments/list-comments.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-list-comments", name: "List Conversation Comments", description: "List the comments in a conversation. [See the documentation](https://dev.frontapp.com/reference/list-conversation-comments)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/list-conversations/list-conversations.mjs b/components/frontapp/actions/list-conversations/list-conversations.mjs index b458621046c19..876d072b29f62 100644 --- a/components/frontapp/actions/list-conversations/list-conversations.mjs +++ b/components/frontapp/actions/list-conversations/list-conversations.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-list-conversations", name: "List Conversations", description: "List conversations in the company. [See the documentation](https://dev.frontapp.com/reference/list-conversations)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/list-message-templates/list-message-templates.mjs b/components/frontapp/actions/list-message-templates/list-message-templates.mjs index 719779b414f74..341a24553f610 100644 --- a/components/frontapp/actions/list-message-templates/list-message-templates.mjs +++ b/components/frontapp/actions/list-message-templates/list-message-templates.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-list-message-templates", name: "List Message Templates", description: "List the message templates. [See the documentation](https://dev.frontapp.com/reference/list-message-templates).", - version: "0.0.1", + version: "0.0.2", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/list-teammates/list-teammates.mjs b/components/frontapp/actions/list-teammates/list-teammates.mjs index b8867a1aa5c0e..fcc579fa160dd 100644 --- a/components/frontapp/actions/list-teammates/list-teammates.mjs +++ b/components/frontapp/actions/list-teammates/list-teammates.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-list-teammates", name: "List Teammate", description: "List teammates in the company. [See the documentation](https://dev.frontapp.com/reference/list-teammates)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs b/components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs index bf25964f07d41..0c026c2d78d5f 100644 --- a/components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs +++ b/components/frontapp/actions/receive-custom-messages/receive-custom-messages.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-receive-custom-messages", name: "Receive Custom Messages", description: "Receive a custom message in Front. [See the documentation](https://dev.frontapp.com/reference/post_channels-channel-id-incoming-messages).", - version: "0.0.5", + version: "0.0.6", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs b/components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs index 2f74ec08aea07..34d3bdc3f27b4 100644 --- a/components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs +++ b/components/frontapp/actions/reply-to-conversation/reply-to-conversation.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-reply-to-conversation", name: "Reply To Conversation", description: "Reply to a conversation by sending a message and appending it to the conversation. [See the documentation](https://dev.frontapp.com/reference/post_conversations-conversation-id-messages).", - version: "0.0.4", + version: "0.0.5", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/send-new-message/send-new-message.mjs b/components/frontapp/actions/send-new-message/send-new-message.mjs index 3cd9234f34c60..7978020c03a5a 100644 --- a/components/frontapp/actions/send-new-message/send-new-message.mjs +++ b/components/frontapp/actions/send-new-message/send-new-message.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-send-new-message", name: "Send New Message", description: "Sends a new message from a channel. It will create a new conversation. [See the documentation](https://dev.frontapp.com/reference/post_channels-channel-id-messages).", - version: "0.2.7", + version: "0.2.8", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/tag-conversation/tag-conversation.mjs b/components/frontapp/actions/tag-conversation/tag-conversation.mjs index 8ef633625ddff..70474534c238e 100644 --- a/components/frontapp/actions/tag-conversation/tag-conversation.mjs +++ b/components/frontapp/actions/tag-conversation/tag-conversation.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-tag-conversation", name: "Tag Conversation", description: "Add tags to a conversation. [See the documentation](https://dev.frontapp.com/reference/patch_conversations-conversation-id)", - version: "0.0.2", + version: "0.0.3", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/update-conversation/update-conversation.mjs b/components/frontapp/actions/update-conversation/update-conversation.mjs index 99206fca0bbf9..6ddc127528bb4 100644 --- a/components/frontapp/actions/update-conversation/update-conversation.mjs +++ b/components/frontapp/actions/update-conversation/update-conversation.mjs @@ -5,7 +5,7 @@ export default { key: "frontapp-update-conversation", name: "Update Conversation", description: "Updates a conversation. [See the documentation](https://dev.frontapp.com/reference/patch_conversations-conversation-id).", - version: "0.1.7", + version: "0.1.8", type: "action", props: { frontApp, diff --git a/components/frontapp/actions/update-teammate/update-teammate.mjs b/components/frontapp/actions/update-teammate/update-teammate.mjs index c2c7ea33bf167..e67e8e05226eb 100644 --- a/components/frontapp/actions/update-teammate/update-teammate.mjs +++ b/components/frontapp/actions/update-teammate/update-teammate.mjs @@ -4,7 +4,7 @@ export default { key: "frontapp-update-teammate", name: "Update Teammate", description: "Update a teammate. [See the documentation](https://dev.frontapp.com/reference/update-teammate).", - version: "0.0.1", + version: "0.0.2", type: "action", props: { frontApp, diff --git a/components/frontapp/frontapp.app.mjs b/components/frontapp/frontapp.app.mjs index 82b79386b7df1..cd6297547c464 100644 --- a/components/frontapp/frontapp.app.mjs +++ b/components/frontapp/frontapp.app.mjs @@ -592,6 +592,15 @@ export default { ...args, }); }, + async createMessage({ + channelId, ...args + }) { + return this.makeRequest({ + method: "post", + path: `/channels/${channelId}/messages`, + ...args, + }); + }, async paginateOptions({ prevContext, listResourcesFn, diff --git a/components/frontapp/package.json b/components/frontapp/package.json index bfffde0ab0072..46b11f68b7dd0 100644 --- a/components/frontapp/package.json +++ b/components/frontapp/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/frontapp", - "version": "0.7.2", + "version": "0.8.0", "description": "Pipedream Frontapp Components", "main": "frontapp.app.mjs", "keywords": [ diff --git a/components/frontapp/sources/new-conversation-created/new-conversation-created.mjs b/components/frontapp/sources/new-conversation-created/new-conversation-created.mjs index 32c8973f538fa..3688e94ad51df 100644 --- a/components/frontapp/sources/new-conversation-created/new-conversation-created.mjs +++ b/components/frontapp/sources/new-conversation-created/new-conversation-created.mjs @@ -6,7 +6,7 @@ export default { key: "frontapp-new-conversation-created", name: "New Conversation Created", description: "Emit new event when a conversation is created. [See the documentation](https://dev.frontapp.com/reference/list-conversations)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { diff --git a/components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs b/components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs index 549e0814361e2..78bd61903d1b5 100644 --- a/components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs +++ b/components/frontapp/sources/new-conversation-state-change/new-conversation-state-change.mjs @@ -7,7 +7,7 @@ export default { key: "frontapp-new-conversation-state-change", name: "New Conversation State Change", description: "Emit new event when a conversation reaches a specific state. [See the documentation](https://dev.frontapp.com/reference/list-conversations)", - version: "0.0.3", + version: "0.0.4", type: "source", dedupe: "unique", props: { diff --git a/components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs b/components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs index 6b25ebb92789f..3c8c2c5e43d41 100644 --- a/components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs +++ b/components/frontapp/sources/new-conversation-tag/new-conversation-tag.mjs @@ -6,7 +6,7 @@ export default { key: "frontapp-new-conversation-tag", name: "New Conversation Tag", description: "Emit new event when a conversation is tagged with a specific tag or any tag. [See the documentation](https://dev.frontapp.com/reference/events)", - version: "0.0.3", + version: "0.0.4", type: "source", dedupe: "unique", props: { diff --git a/components/frontapp/sources/new-message-template-created/new-message-template-created.mjs b/components/frontapp/sources/new-message-template-created/new-message-template-created.mjs index c28549fc98ea9..623d3c6a9edf4 100644 --- a/components/frontapp/sources/new-message-template-created/new-message-template-created.mjs +++ b/components/frontapp/sources/new-message-template-created/new-message-template-created.mjs @@ -6,7 +6,7 @@ export default { key: "frontapp-new-message-template-created", name: "New Message Template Created", description: "Emit new event when a message template is created. [See the documentation](https://dev.frontapp.com/reference/list-message-templates)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: {