diff --git a/components/trengo/actions/attach-label/attach-label.mjs b/components/trengo/actions/attach-label/attach-label.mjs index c9b3dbaaa46ad..ce242fd7497ed 100644 --- a/components/trengo/actions/attach-label/attach-label.mjs +++ b/components/trengo/actions/attach-label/attach-label.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-attach-label", name: "Attach Label", description: "Attach a label to a ticket. [See the documentation](https://developers.trengo.com/reference/apply-a-label)", - version: "0.0.1", + version: "0.0.2", type: "action", annotations: { destructiveHint: false, diff --git a/components/trengo/actions/create-contact/create-contact.mjs b/components/trengo/actions/create-contact/create-contact.mjs index 23ff435a3808c..37c1361eb42a0 100644 --- a/components/trengo/actions/create-contact/create-contact.mjs +++ b/components/trengo/actions/create-contact/create-contact.mjs @@ -3,7 +3,7 @@ import app from "../../trengo.app.mjs"; export default { type: "action", key: "trengo-create-contact", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/actions/find-contacts/find-contacts.mjs b/components/trengo/actions/find-contacts/find-contacts.mjs index 5934e5255b8db..d08d2713ffa89 100644 --- a/components/trengo/actions/find-contacts/find-contacts.mjs +++ b/components/trengo/actions/find-contacts/find-contacts.mjs @@ -4,7 +4,7 @@ import app from "../../trengo.app.mjs"; export default { type: "action", key: "trengo-find-contacts", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/actions/get-label/get-label.mjs b/components/trengo/actions/get-label/get-label.mjs index 0e335847d32aa..50414e4697ccd 100644 --- a/components/trengo/actions/get-label/get-label.mjs +++ b/components/trengo/actions/get-label/get-label.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-get-label", name: "Get Label", description: "Get a label by ID. [See the documentation](https://developers.trengo.com/reference/get-a-label)", - version: "0.0.1", + version: "0.0.2", type: "action", annotations: { destructiveHint: false, diff --git a/components/trengo/actions/get-message/get-message.mjs b/components/trengo/actions/get-message/get-message.mjs index 9297344d2fd86..cd7e40e3cda0d 100644 --- a/components/trengo/actions/get-message/get-message.mjs +++ b/components/trengo/actions/get-message/get-message.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-get-message", name: "Get Message", description: "Get a message by ID. [See the documentation](https://developers.trengo.com/reference/fetch-a-message)", - version: "0.0.1", + version: "0.0.2", type: "action", annotations: { destructiveHint: false, diff --git a/components/trengo/actions/list-articles/list-articles.mjs b/components/trengo/actions/list-articles/list-articles.mjs index bb52574f5bf3b..237e72b27e8aa 100644 --- a/components/trengo/actions/list-articles/list-articles.mjs +++ b/components/trengo/actions/list-articles/list-articles.mjs @@ -4,7 +4,7 @@ import app from "../../trengo.app.mjs"; export default { type: "action", key: "trengo-list-articles", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/actions/list-labels/list-labels.mjs b/components/trengo/actions/list-labels/list-labels.mjs index 1da51fc1b8777..5a7d5882f14c2 100644 --- a/components/trengo/actions/list-labels/list-labels.mjs +++ b/components/trengo/actions/list-labels/list-labels.mjs @@ -5,7 +5,7 @@ export default { key: "trengo-list-labels", name: "List Labels", description: "List all labels. [See the documentation](https://developers.trengo.com/reference/list-all-labels)", - version: "0.0.1", + version: "0.0.2", type: "action", annotations: { destructiveHint: false, diff --git a/components/trengo/actions/list-messages/list-messages.mjs b/components/trengo/actions/list-messages/list-messages.mjs index 5d35c57552e83..a87bf415c82ef 100644 --- a/components/trengo/actions/list-messages/list-messages.mjs +++ b/components/trengo/actions/list-messages/list-messages.mjs @@ -5,7 +5,7 @@ export default { key: "trengo-list-messages", name: "List Messages", description: "List messages from a ticket. [See the documentation](https://developers.trengo.com/reference/list-all-messages)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/actions/list-tickets/list-tickets.mjs b/components/trengo/actions/list-tickets/list-tickets.mjs index d027d3c71bee7..1a4f66f7d1eb8 100644 --- a/components/trengo/actions/list-tickets/list-tickets.mjs +++ b/components/trengo/actions/list-tickets/list-tickets.mjs @@ -5,7 +5,7 @@ export default { key: "trengo-list-tickets", name: "List Tickets", description: "List tickets according to the specified criteria. [See the documentation](https://developers.trengo.com/reference/list-all-tickets)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/actions/log-a-voice-call/log-a-voice-call.mjs b/components/trengo/actions/log-a-voice-call/log-a-voice-call.mjs index 7c49e5dbf5d21..3f37f6303db2c 100644 --- a/components/trengo/actions/log-a-voice-call/log-a-voice-call.mjs +++ b/components/trengo/actions/log-a-voice-call/log-a-voice-call.mjs @@ -3,7 +3,7 @@ import app from "../../trengo.app.mjs"; export default { type: "action", key: "trengo-log-a-voice-call", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/actions/send-a-message/send-a-message.mjs b/components/trengo/actions/send-a-message/send-a-message.mjs index a0d4076b235ac..dc69811219c8a 100644 --- a/components/trengo/actions/send-a-message/send-a-message.mjs +++ b/components/trengo/actions/send-a-message/send-a-message.mjs @@ -3,7 +3,7 @@ import app from "../../trengo.app.mjs"; export default { type: "action", key: "trengo-send-a-message", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/actions/send-a-team-chat-message/send-a-team-chat-message.mjs b/components/trengo/actions/send-a-team-chat-message/send-a-team-chat-message.mjs index 99e2ad8d844e2..b6ef90ea70d73 100644 --- a/components/trengo/actions/send-a-team-chat-message/send-a-team-chat-message.mjs +++ b/components/trengo/actions/send-a-team-chat-message/send-a-team-chat-message.mjs @@ -4,7 +4,7 @@ import app from "../../trengo.app.mjs"; export default { type: "action", key: "trengo-send-a-team-chat-message", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/actions/send-a-ticket-message/send-a-ticket-message.mjs b/components/trengo/actions/send-a-ticket-message/send-a-ticket-message.mjs new file mode 100644 index 0000000000000..f4e59f482f815 --- /dev/null +++ b/components/trengo/actions/send-a-ticket-message/send-a-ticket-message.mjs @@ -0,0 +1,65 @@ +import app from "../../trengo.app.mjs"; + +export default { + type: "action", + version: "0.0.1", + key: "trengo-send-a-ticket-message", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + name: "Send A Ticket Message", + description: "Send a message to a ticket. [See the documentation](https://developers.trengo.com/reference/send-a-message)", + props: { + app, + ticketId: { + propDefinition: [ + app, + "ticketId", + ], + }, + message: { + propDefinition: [ + app, + "message", + ], + }, + internalNote: { + type: "boolean", + label: "Internal Note", + description: "If true, this message will be visible only to your team", + optional: true, + default: false, + }, + subject: { + type: "string", + label: "Subject", + description: "The subject of the message. Only used when the message is an email.", + optional: true, + }, + attachmentIds: { + propDefinition: [ + app, + "attachmentIds", + ], + optional: true, + }, + }, + async run({ $ }) { + const resp = await this.app.sendTicketMessage({ + $, + ticketId: this.ticketId, + data: { + message: this.message, + internal_note: this.internalNote, + subject: this.subject, + attachment_ids: this.attachmentIds, + }, + }); + + $.export("$summary", `Message sent to ticket ${this.ticketId}`); + + return resp; + }, +}; diff --git a/components/trengo/actions/send-a-whatsapp-message-template/send-a-whatsapp-message-template.mjs b/components/trengo/actions/send-a-whatsapp-message-template/send-a-whatsapp-message-template.mjs index 4982e5eb9ada6..0927c6b76a7b9 100644 --- a/components/trengo/actions/send-a-whatsapp-message-template/send-a-whatsapp-message-template.mjs +++ b/components/trengo/actions/send-a-whatsapp-message-template/send-a-whatsapp-message-template.mjs @@ -4,7 +4,7 @@ import app from "../../trengo.app.mjs"; export default { type: "action", key: "trengo-send-a-whatsapp-message-template", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/package.json b/components/trengo/package.json index 76e39afb71ab1..7caf280627160 100644 --- a/components/trengo/package.json +++ b/components/trengo/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/trengo", - "version": "0.4.0", + "version": "0.5.0", "description": "Pipedream Trengo Components", "main": "trengo.app.mjs", "keywords": [ diff --git a/components/trengo/sources/new-inbound-message/new-inbound-message.mjs b/components/trengo/sources/new-inbound-message/new-inbound-message.mjs index d6571b89ff5b6..88afdeb53ed19 100644 --- a/components/trengo/sources/new-inbound-message/new-inbound-message.mjs +++ b/components/trengo/sources/new-inbound-message/new-inbound-message.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-new-inbound-message", name: "New Inbound Message Event (Instant)", description: "Emit new event when an inbound message is received. [See the documentation](https://developers.trengo.com/docs/webhooks)", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", ...common, diff --git a/components/trengo/sources/new-internal-note/new-internal-note.mjs b/components/trengo/sources/new-internal-note/new-internal-note.mjs index 970b38ddd678a..1aa636d964f91 100644 --- a/components/trengo/sources/new-internal-note/new-internal-note.mjs +++ b/components/trengo/sources/new-internal-note/new-internal-note.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-new-internal-note", name: "New Internal Note Event (Instant)", description: "Emit new event when an internal note is added. [See the documentation](https://developers.trengo.com/docs/webhooks)", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", ...common, diff --git a/components/trengo/sources/new-outbound-message/new-outbound-message.mjs b/components/trengo/sources/new-outbound-message/new-outbound-message.mjs index 9daffd1d8c971..42d2b613594f6 100644 --- a/components/trengo/sources/new-outbound-message/new-outbound-message.mjs +++ b/components/trengo/sources/new-outbound-message/new-outbound-message.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-new-outbound-message", name: "New Outbound Message Event (Instant)", description: "Emit new event when an outbound message sent. [See the documentation](https://developers.trengo.com/docs/webhooks)", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", ...common, diff --git a/components/trengo/sources/phone-call-ended/phone-call-ended.mjs b/components/trengo/sources/phone-call-ended/phone-call-ended.mjs index 42f5a40e2ff4b..6938232c9cf22 100644 --- a/components/trengo/sources/phone-call-ended/phone-call-ended.mjs +++ b/components/trengo/sources/phone-call-ended/phone-call-ended.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-phone-call-ended", name: "New Phone Call Ended Event (Instant)", description: "Emit new event when a phone call ends. [See the documentation](https://developers.trengo.com/docs/webhooks)", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", ...common, diff --git a/components/trengo/sources/phone-call-missed/phone-call-missed.mjs b/components/trengo/sources/phone-call-missed/phone-call-missed.mjs index c0b711121c926..2ea04c40926b0 100644 --- a/components/trengo/sources/phone-call-missed/phone-call-missed.mjs +++ b/components/trengo/sources/phone-call-missed/phone-call-missed.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-phone-call-missed", name: "New Phone Call Missed Event (Instant)", description: "Emit new event when an phone call missed. [See the documentation](https://developers.trengo.com/docs/webhooks)", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", ...common, diff --git a/components/trengo/sources/phone-call-started/phone-call-started.mjs b/components/trengo/sources/phone-call-started/phone-call-started.mjs index 9a212849610be..4f740cdcf9db4 100644 --- a/components/trengo/sources/phone-call-started/phone-call-started.mjs +++ b/components/trengo/sources/phone-call-started/phone-call-started.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-phone-call-started", name: "New Phone Call Started Event (Instant)", description: "Emit new event when a phone call starts. [See the documentation](https://developers.trengo.com/docs/webhooks)", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", ...common, diff --git a/components/trengo/sources/ticket-closed/ticket-closed.mjs b/components/trengo/sources/ticket-closed/ticket-closed.mjs index 25092b2e71b3b..8a23f20b97ea3 100644 --- a/components/trengo/sources/ticket-closed/ticket-closed.mjs +++ b/components/trengo/sources/ticket-closed/ticket-closed.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-ticket-closed", name: "Ticket Closed (Instant)", description: "Emit new event when a ticket is closed. [See the documentation](https://developers.trengo.com/docs/webhooks)", - version: "0.0.3", + version: "0.0.4", type: "source", dedupe: "unique", ...common, diff --git a/components/trengo/sources/ticket-label-added/ticket-label-added.mjs b/components/trengo/sources/ticket-label-added/ticket-label-added.mjs index 0cc6abbaaf4e4..8dc4ca9175761 100644 --- a/components/trengo/sources/ticket-label-added/ticket-label-added.mjs +++ b/components/trengo/sources/ticket-label-added/ticket-label-added.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-ticket-label-added", name: "New Ticket Label Added Event (Instant)", description: "Emit new event when a ticket label is added. [See the documentation](https://developers.trengo.com/docs/webhooks)", - version: "0.0.5", + version: "0.0.6", type: "source", dedupe: "unique", ...common, diff --git a/components/trengo/sources/ticket-reopened/ticket-reopened.mjs b/components/trengo/sources/ticket-reopened/ticket-reopened.mjs index 437eecc12432b..1960e1663aba3 100644 --- a/components/trengo/sources/ticket-reopened/ticket-reopened.mjs +++ b/components/trengo/sources/ticket-reopened/ticket-reopened.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-ticket-reopened", name: "Ticket Reopened (Instant)", description: "Emit new event when a ticket is reopened. [See the documentation](https://developers.trengo.com/docs/webhooks)", - version: "0.0.3", + version: "0.0.4", type: "source", dedupe: "unique", ...common, diff --git a/components/trengo/sources/voice-call-recorded/voice-call-recorded.mjs b/components/trengo/sources/voice-call-recorded/voice-call-recorded.mjs index 08552dacc8955..6b9fa63032ec5 100644 --- a/components/trengo/sources/voice-call-recorded/voice-call-recorded.mjs +++ b/components/trengo/sources/voice-call-recorded/voice-call-recorded.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-voice-call-recorded", name: "New Voice Call Recorded Event (Instant)", description: "Emit new event when a voice call is recorded. [See the documentation](https://developers.trengo.com/docs/webhooks)", - version: "0.0.4", + version: "0.0.5", type: "source", dedupe: "unique", ...common, diff --git a/components/trengo/trengo.app.mjs b/components/trengo/trengo.app.mjs index 0562f9a1024f4..eec420261c7f1 100644 --- a/components/trengo/trengo.app.mjs +++ b/components/trengo/trengo.app.mjs @@ -303,6 +303,15 @@ export default { ...args, }); }, + async sendTicketMessage({ + ticketId, ...args + }) { + return this._makeRequest({ + method: "POST", + path: `/tickets/${ticketId}/messages`, + ...args, + }); + }, async getHelpCenters(args = {}) { return this._makeRequest({ path: "/help_center",