From f87954a7a344ce08618f653654b112b9ba0e042d Mon Sep 17 00:00:00 2001 From: Jorge Cortes Date: Wed, 26 Nov 2025 15:16:40 -0500 Subject: [PATCH] [ACTION] trengo - Helpcenter --- .../actions/attach-label/attach-label.mjs | 2 +- .../actions/close-ticket/close-ticket.mjs | 2 +- .../actions/create-contact/create-contact.mjs | 2 +- .../actions/find-contacts/find-contacts.mjs | 2 +- .../actions/get-article/get-article.mjs | 41 +++++++ .../trengo/actions/get-block/get-block.mjs | 41 +++++++ .../actions/get-category/get-category.mjs | 41 +++++++ .../get-help-center/get-help-center.mjs | 31 +++++ .../trengo/actions/get-label/get-label.mjs | 2 +- .../actions/get-message/get-message.mjs | 2 +- .../list-all-blocks/list-all-blocks.mjs | 50 ++++++++ .../list-all-categories.mjs | 50 ++++++++ .../actions/list-articles/list-articles.mjs | 2 +- .../list-help-centers/list-help-centers.mjs | 42 +++++++ .../actions/list-labels/list-labels.mjs | 2 +- .../actions/list-messages/list-messages.mjs | 2 +- .../actions/list-tickets/list-tickets.mjs | 2 +- .../log-a-voice-call/log-a-voice-call.mjs | 2 +- .../actions/send-a-message/send-a-message.mjs | 2 +- .../send-a-team-chat-message.mjs | 2 +- .../send-a-ticket-message.mjs | 2 +- .../send-a-whatsapp-message-template.mjs | 2 +- components/trengo/package.json | 2 +- .../new-inbound-message.mjs | 2 +- .../new-internal-note/new-internal-note.mjs | 2 +- .../new-outbound-message.mjs | 2 +- .../phone-call-ended/phone-call-ended.mjs | 2 +- .../phone-call-missed/phone-call-missed.mjs | 2 +- .../phone-call-started/phone-call-started.mjs | 2 +- .../sources/ticket-closed/ticket-closed.mjs | 2 +- .../ticket-label-added/ticket-label-added.mjs | 2 +- .../ticket-reopened/ticket-reopened.mjs | 2 +- .../voice-call-recorded.mjs | 2 +- components/trengo/trengo.app.mjs | 111 ++++++++++++++++++ 34 files changed, 433 insertions(+), 26 deletions(-) create mode 100644 components/trengo/actions/get-article/get-article.mjs create mode 100644 components/trengo/actions/get-block/get-block.mjs create mode 100644 components/trengo/actions/get-category/get-category.mjs create mode 100644 components/trengo/actions/get-help-center/get-help-center.mjs create mode 100644 components/trengo/actions/list-all-blocks/list-all-blocks.mjs create mode 100644 components/trengo/actions/list-all-categories/list-all-categories.mjs create mode 100644 components/trengo/actions/list-help-centers/list-help-centers.mjs diff --git a/components/trengo/actions/attach-label/attach-label.mjs b/components/trengo/actions/attach-label/attach-label.mjs index 242202f5af618..1a80eace345b6 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.3", + version: "0.0.4", type: "action", annotations: { destructiveHint: false, diff --git a/components/trengo/actions/close-ticket/close-ticket.mjs b/components/trengo/actions/close-ticket/close-ticket.mjs index f92eb96cc57b9..89599ac3c39d6 100644 --- a/components/trengo/actions/close-ticket/close-ticket.mjs +++ b/components/trengo/actions/close-ticket/close-ticket.mjs @@ -4,7 +4,7 @@ export default { key: "trengo-close-ticket", name: "Close Ticket", description: "Close a ticket. [See the documentation](https://developers.trengo.com/reference/close-a-ticket)", - version: "0.0.1", + version: "0.0.2", type: "action", annotations: { destructiveHint: true, diff --git a/components/trengo/actions/create-contact/create-contact.mjs b/components/trengo/actions/create-contact/create-contact.mjs index f9124cc2fbbab..6bce7195fb400 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.8", + version: "0.0.9", 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 246ab93ed9548..03759fb5196c3 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.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/actions/get-article/get-article.mjs b/components/trengo/actions/get-article/get-article.mjs new file mode 100644 index 0000000000000..2057269868e6b --- /dev/null +++ b/components/trengo/actions/get-article/get-article.mjs @@ -0,0 +1,41 @@ +import app from "../../trengo.app.mjs"; + +export default { + key: "trengo-get-article", + name: "Get Article", + description: "Get a specific article. [See the documentation](https://developers.trengo.com/reference/get-an-article)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + app, + helpCenterId: { + propDefinition: [ + app, + "helpCenterId", + ], + }, + articleId: { + propDefinition: [ + app, + "articleId", + ({ helpCenterId }) => ({ + helpCenterId, + }), + ], + }, + }, + async run({ $ }) { + const response = await this.app.getArticle({ + $, + helpCenterId: this.helpCenterId, + articleId: this.articleId, + }); + $.export("$summary", "Successfully retrieved article"); + return response; + }, +}; diff --git a/components/trengo/actions/get-block/get-block.mjs b/components/trengo/actions/get-block/get-block.mjs new file mode 100644 index 0000000000000..2f647f7f80b91 --- /dev/null +++ b/components/trengo/actions/get-block/get-block.mjs @@ -0,0 +1,41 @@ +import app from "../../trengo.app.mjs"; + +export default { + key: "trengo-get-block", + name: "Get Block", + description: "Get a specific block. [See the documentation](https://developers.trengo.com/reference/get-a-block)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + app, + helpCenterId: { + propDefinition: [ + app, + "helpCenterId", + ], + }, + blockId: { + propDefinition: [ + app, + "blockId", + ({ helpCenterId }) => ({ + helpCenterId, + }), + ], + }, + }, + async run({ $ }) { + const response = await this.app.getBlock({ + $, + helpCenterId: this.helpCenterId, + blockId: this.blockId, + }); + $.export("$summary", "Successfully retrieved block"); + return response; + }, +}; diff --git a/components/trengo/actions/get-category/get-category.mjs b/components/trengo/actions/get-category/get-category.mjs new file mode 100644 index 0000000000000..dc19c197a0512 --- /dev/null +++ b/components/trengo/actions/get-category/get-category.mjs @@ -0,0 +1,41 @@ +import app from "../../trengo.app.mjs"; + +export default { + key: "trengo-get-category", + name: "Get Category", + description: "Get a specific category. [See the documentation](https://developers.trengo.com/reference/get-a-category)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + app, + helpCenterId: { + propDefinition: [ + app, + "helpCenterId", + ], + }, + categoryId: { + propDefinition: [ + app, + "categoryId", + ({ helpCenterId }) => ({ + helpCenterId, + }), + ], + }, + }, + async run({ $ }) { + const response = await this.app.getCategory({ + $, + helpCenterId: this.helpCenterId, + categoryId: this.categoryId, + }); + $.export("$summary", "Successfully retrieved category"); + return response; + }, +}; diff --git a/components/trengo/actions/get-help-center/get-help-center.mjs b/components/trengo/actions/get-help-center/get-help-center.mjs new file mode 100644 index 0000000000000..aa320df19488c --- /dev/null +++ b/components/trengo/actions/get-help-center/get-help-center.mjs @@ -0,0 +1,31 @@ +import app from "../../trengo.app.mjs"; + +export default { + key: "trengo-get-help-center", + name: "Get Help Center", + description: "Get a specific help center. [See the documentation](https://developers.trengo.com/reference/get-a-help-center)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + app, + helpCenterId: { + propDefinition: [ + app, + "helpCenterId", + ], + }, + }, + async run({ $ }) { + const response = await this.app.getHelpCenter({ + $, + helpCenterId: this.helpCenterId, + }); + $.export("$summary", "Successfully retrieved help center"); + return response; + }, +}; diff --git a/components/trengo/actions/get-label/get-label.mjs b/components/trengo/actions/get-label/get-label.mjs index b6ce755807ac6..b047270b28769 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.3", + version: "0.0.4", 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 aa6bb7c54195b..f36450cec6db6 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.3", + version: "0.0.4", type: "action", annotations: { destructiveHint: false, diff --git a/components/trengo/actions/list-all-blocks/list-all-blocks.mjs b/components/trengo/actions/list-all-blocks/list-all-blocks.mjs new file mode 100644 index 0000000000000..703216d1368a5 --- /dev/null +++ b/components/trengo/actions/list-all-blocks/list-all-blocks.mjs @@ -0,0 +1,50 @@ +import utils from "../../common/utils.mjs"; +import app from "../../trengo.app.mjs"; + +export default { + key: "trengo-list-all-blocks", + name: "List All Blocks", + description: "List all blocks in a help center. [See the documentation](https://developers.trengo.com/reference/list-all-blocks)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + app, + helpCenterId: { + propDefinition: [ + app, + "helpCenterId", + ], + }, + maxResults: { + type: "integer", + label: "Max Results", + description: "Maximum number of blocks to return (if not specified, all results will be returned)", + optional: true, + }, + }, + async run({ $ }) { + const blocks = []; + const resourcesStream = utils.getResourcesStream({ + resourceFn: this.app.listBlocks, + resourceFnArgs: { + helpCenterId: this.helpCenterId, + }, + }); + for await (const item of resourcesStream) { + blocks.push(item); + if (this.maxResults && blocks.length >= this.maxResults) { + break; + } + } + const length = blocks.length; + $.export("$summary", `Successfully retrieved ${length} block${length === 1 + ? "" + : "s"}`); + return blocks; + }, +}; diff --git a/components/trengo/actions/list-all-categories/list-all-categories.mjs b/components/trengo/actions/list-all-categories/list-all-categories.mjs new file mode 100644 index 0000000000000..5c2696c24e3b2 --- /dev/null +++ b/components/trengo/actions/list-all-categories/list-all-categories.mjs @@ -0,0 +1,50 @@ +import utils from "../../common/utils.mjs"; +import app from "../../trengo.app.mjs"; + +export default { + key: "trengo-list-all-categories", + name: "List All Categories", + description: "List all categories in a help center. [See the documentation](https://developers.trengo.com/reference/list-all-categories)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + app, + helpCenterId: { + propDefinition: [ + app, + "helpCenterId", + ], + }, + maxResults: { + type: "integer", + label: "Max Results", + description: "Maximum number of categories to return (if not specified, all results will be returned)", + optional: true, + }, + }, + async run({ $ }) { + const categories = []; + const resourcesStream = utils.getResourcesStream({ + resourceFn: this.app.listCategories, + resourceFnArgs: { + helpCenterId: this.helpCenterId, + }, + }); + for await (const item of resourcesStream) { + categories.push(item); + if (this.maxResults && categories.length >= this.maxResults) { + break; + } + } + const length = categories.length; + $.export("$summary", `Successfully retrieved ${length} categor${length === 1 + ? "y" + : "ies"}`); + return categories; + }, +}; diff --git a/components/trengo/actions/list-articles/list-articles.mjs b/components/trengo/actions/list-articles/list-articles.mjs index 6382b0254a2ba..2b5b92ab3365e 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.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/actions/list-help-centers/list-help-centers.mjs b/components/trengo/actions/list-help-centers/list-help-centers.mjs new file mode 100644 index 0000000000000..9902135dd0172 --- /dev/null +++ b/components/trengo/actions/list-help-centers/list-help-centers.mjs @@ -0,0 +1,42 @@ +import utils from "../../common/utils.mjs"; +import app from "../../trengo.app.mjs"; + +export default { + type: "action", + key: "trengo-list-help-centers", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + name: "List Help Centers", + description: "List all help centers. [See the documentation](https://developers.trengo.com/reference/list-all-help-centers)", + props: { + app, + maxResults: { + type: "integer", + label: "Max Results", + description: "Maximum number of help centers to return (if not specified, all results will be returned)", + optional: true, + }, + }, + async run({ $ }) { + const helpCenters = []; + const resourcesStream = utils.getResourcesStream({ + resourceFn: this.app.getHelpCenters, + resourceFnArgs: {}, + }); + for await (const item of resourcesStream) { + helpCenters.push(item); + if (this.maxResults && helpCenters.length >= this.maxResults) { + break; + } + } + const length = helpCenters.length; + $.export("$summary", `Successfully retrieved ${length} help center${length === 1 + ? "" + : "s"}`); + return helpCenters; + }, +}; diff --git a/components/trengo/actions/list-labels/list-labels.mjs b/components/trengo/actions/list-labels/list-labels.mjs index 44bf54f659932..c376d97f35e20 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.3", + version: "0.0.4", 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 8b2d8554ccbef..c24a826d93fef 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.5", + version: "0.0.6", 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 30645bcaaeeea..f4c54842cb800 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.5", + version: "0.0.6", 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 710371dc397c9..9b8b317cc6d6a 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.8", + version: "0.0.9", 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 0bd193fa97691..35c06f9692f5d 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.8", + version: "0.0.9", 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 c232ffe97b147..6bd6fac45f515 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.8", + version: "0.0.9", 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 index 1ae80599cf0c8..a587675b14c6e 100644 --- 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 @@ -2,7 +2,7 @@ import app from "../../trengo.app.mjs"; export default { type: "action", - version: "0.0.2", + version: "0.0.3", key: "trengo-send-a-ticket-message", annotations: { destructiveHint: false, 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 583036bfd240a..b89e27753cf56 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.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/trengo/package.json b/components/trengo/package.json index 4558650e20e33..8b292406ed2a5 100644 --- a/components/trengo/package.json +++ b/components/trengo/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/trengo", - "version": "0.6.0", + "version": "0.7.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 353624a33b66b..c932a246944d1 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.7", + version: "0.0.8", 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 c3d9d0ae2f117..8d328186b9176 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.7", + version: "0.0.8", 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 4efa4ebaeb057..26b12a00ae2a4 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.7", + version: "0.0.8", 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 c873314c6f998..77c743332df21 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.7", + version: "0.0.8", 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 89ef3f0285ae3..9b1c26da593c9 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.7", + version: "0.0.8", 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 41d30476e30ea..4b9988c75f362 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.7", + version: "0.0.8", 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 b8d0d90a81420..47876f7a1c96d 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.5", + version: "0.0.6", 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 7b4eb70962714..453eb6e6a1a60 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.7", + version: "0.0.8", 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 58aad145e86db..a40d820e493b7 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.5", + version: "0.0.6", 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 7a88a50af6b27..ff9e5231210b6 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.6", + version: "0.0.7", type: "source", dedupe: "unique", ...common, diff --git a/components/trengo/trengo.app.mjs b/components/trengo/trengo.app.mjs index 930fc0a15cbab..d6f1e46a63d98 100644 --- a/components/trengo/trengo.app.mjs +++ b/components/trengo/trengo.app.mjs @@ -225,6 +225,63 @@ export default { })); }, }, + categoryId: { + type: "integer", + label: "Category ID", + description: "Select a category or provide an ID", + async options({ + helpCenterId, page = 0, + }) { + const response = await this.listCategories({ + helpCenterId, + params: { + page: page + 1, + }, + }); + return response.data.map((category) => ({ + label: category.name, + value: category.id, + })); + }, + }, + articleId: { + type: "integer", + label: "Article ID", + description: "Select an article or provide an ID", + async options({ + helpCenterId, page = 0, + }) { + const response = await this.getArticles({ + helpCenterId, + params: { + page: page + 1, + }, + }); + return response.data.map((article) => ({ + label: article.title, + value: article.id, + })); + }, + }, + blockId: { + type: "integer", + label: "Block ID", + description: "Select a block or provide an ID", + async options({ + helpCenterId, page = 0, + }) { + const response = await this.listBlocks({ + helpCenterId, + params: { + page: page + 1, + }, + }); + return response.data.map((block) => ({ + label: block.name, + value: block.id, + })); + }, + }, }, methods: { _getUrl(path) { @@ -403,5 +460,59 @@ export default { ...args, }); }, + listQuickReplies(args = {}) { + return this._makeRequest({ + path: "/quick_replies", + ...args, + }); + }, + getHelpCenter({ + helpCenterId, ...args + } = {}) { + return this._makeRequest({ + path: `/help_center/${helpCenterId}`, + ...args, + }); + }, + listCategories({ + helpCenterId, ...args + } = {}) { + return this._makeRequest({ + path: `/help_center/${helpCenterId}/categories`, + ...args, + }); + }, + getCategory({ + helpCenterId, categoryId, ...args + } = {}) { + return this._makeRequest({ + path: `/help_center/${helpCenterId}/categories/${categoryId}`, + ...args, + }); + }, + getArticle({ + helpCenterId, articleId, ...args + } = {}) { + return this._makeRequest({ + path: `/help_center/${helpCenterId}/articles/${articleId}`, + ...args, + }); + }, + listBlocks({ + helpCenterId, ...args + } = {}) { + return this._makeRequest({ + path: `/help_center/${helpCenterId}/blocks`, + ...args, + }); + }, + getBlock({ + helpCenterId, blockId, ...args + } = {}) { + return this._makeRequest({ + path: `/help_center/${helpCenterId}/blocks/${blockId}`, + ...args, + }); + }, }, };