diff --git a/components/gorgias_oauth/actions/create-customer/create-customer.mjs b/components/gorgias_oauth/actions/create-customer/create-customer.mjs index 15d112a85591d..24eb519c812bf 100644 --- a/components/gorgias_oauth/actions/create-customer/create-customer.mjs +++ b/components/gorgias_oauth/actions/create-customer/create-customer.mjs @@ -5,7 +5,7 @@ export default { key: "gorgias_oauth-create-customer", name: "Create Customer", description: "Create a new customer. [See the docs](https://developers.gorgias.com/reference/post_api-customers)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gorgias_oauth/actions/create-macro/create-macro.mjs b/components/gorgias_oauth/actions/create-macro/create-macro.mjs index 945703190acb1..2796f9dbbd72f 100644 --- a/components/gorgias_oauth/actions/create-macro/create-macro.mjs +++ b/components/gorgias_oauth/actions/create-macro/create-macro.mjs @@ -6,7 +6,7 @@ export default { key: "gorgias_oauth-create-macro", name: "Create Macro", description: "Create a macro. [See the documentation](https://developers.gorgias.com/reference/create-macro)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gorgias_oauth/actions/create-ticket-message/create-ticket-message.mjs b/components/gorgias_oauth/actions/create-ticket-message/create-ticket-message.mjs index f735e038fe636..08585a39aa810 100644 --- a/components/gorgias_oauth/actions/create-ticket-message/create-ticket-message.mjs +++ b/components/gorgias_oauth/actions/create-ticket-message/create-ticket-message.mjs @@ -7,7 +7,7 @@ export default { key: "gorgias_oauth-create-ticket-message", name: "Create Ticket Message", description: "Create a message for a ticket in the Gorgias system. [See the documentation](https://developers.gorgias.com/reference/create-ticket-message)", - version: "0.0.5", + version: "0.0.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gorgias_oauth/actions/create-ticket/create-ticket.mjs b/components/gorgias_oauth/actions/create-ticket/create-ticket.mjs index a836d7dc54fe6..e5175c84acb84 100644 --- a/components/gorgias_oauth/actions/create-ticket/create-ticket.mjs +++ b/components/gorgias_oauth/actions/create-ticket/create-ticket.mjs @@ -4,7 +4,7 @@ export default { key: "gorgias_oauth-create-ticket", name: "Create Ticket", description: "Create a new ticket. [See the docs](https://developers.gorgias.com/reference/post_api-tickets)", - version: "0.0.9", + version: "0.0.10", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gorgias_oauth/actions/delete-macro/delete-macro.mjs b/components/gorgias_oauth/actions/delete-macro/delete-macro.mjs index aafb33b18f650..038d9c4e7799b 100644 --- a/components/gorgias_oauth/actions/delete-macro/delete-macro.mjs +++ b/components/gorgias_oauth/actions/delete-macro/delete-macro.mjs @@ -4,7 +4,7 @@ export default { key: "gorgias_oauth-delete-macro", name: "Delete Macro", description: "Delete a macro. [See the documentation](https://developers.gorgias.com/reference/delete-macro)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs b/components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs new file mode 100644 index 0000000000000..109ba6d75229a --- /dev/null +++ b/components/gorgias_oauth/actions/get-ticket-message/get-ticket-message.mjs @@ -0,0 +1,61 @@ +import gorgiasOAuth from "../../gorgias_oauth.app.mjs"; + +export default { + name: "Get Ticket Message", + description: "Get a specific message from a ticket. [See the documentation](https://developers.gorgias.com/reference/get-ticket-message)", + key: "gorgias_oauth-get-ticket-message", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + gorgiasOAuth, + ticketId: { + propDefinition: [ + gorgiasOAuth, + "ticketId", + ], + }, + messageId: { + type: "integer", + label: "Message ID", + description: "The ID of the message to retrieve", + async options({ prevContext }) { + const { + data: messages, + meta, + } = await this.gorgiasOAuth.listTicketMessages({ + ticketId: this.ticketId, + params: { + cursor: prevContext.nextCursor, + }, + }); + return { + options: messages.map(({ + id: value, subject: label, + }) => ({ + label, + value: +value, + })), + context: { + nextCursor: meta.next_cursor, + }, + }; + }, + }, + }, + async run({ $ }) { + const response = await this.gorgiasOAuth.getTicketMessage({ + $, + ticketId: this.ticketId, + messageId: this.messageId, + }); + + $.export("$summary", `Successfully retrieved message ${this.messageId} from ticket ${this.ticketId}`); + + return response; + }, +}; diff --git a/components/gorgias_oauth/actions/get-ticket/get-ticket.mjs b/components/gorgias_oauth/actions/get-ticket/get-ticket.mjs index f2c2469e816c5..54e97e2dce8d7 100644 --- a/components/gorgias_oauth/actions/get-ticket/get-ticket.mjs +++ b/components/gorgias_oauth/actions/get-ticket/get-ticket.mjs @@ -4,7 +4,7 @@ export default { key: "gorgias_oauth-get-ticket", name: "Get Ticket", description: "Get a ticket. [See the documentation](https://developers.gorgias.com/reference/get-ticket)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gorgias_oauth/actions/list-macros/list-macros.mjs b/components/gorgias_oauth/actions/list-macros/list-macros.mjs index 75e484c26c450..eda9c5c244654 100644 --- a/components/gorgias_oauth/actions/list-macros/list-macros.mjs +++ b/components/gorgias_oauth/actions/list-macros/list-macros.mjs @@ -4,7 +4,7 @@ export default { key: "gorgias_oauth-list-macros", name: "List Macros", description: "List all macros. [See the documentation](https://developers.gorgias.com/reference/list-macros)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gorgias_oauth/actions/list-messages/list-messages.mjs b/components/gorgias_oauth/actions/list-messages/list-messages.mjs new file mode 100644 index 0000000000000..44d932d47e5d3 --- /dev/null +++ b/components/gorgias_oauth/actions/list-messages/list-messages.mjs @@ -0,0 +1,55 @@ +import gorgiasOAuth from "../../gorgias_oauth.app.mjs"; + +export default { + name: "List Messages", + description: "List all messages. [See the documentation](https://developers.gorgias.com/reference/list-messages)", + key: "gorgias_oauth-list-messages", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + gorgiasOAuth, + limit: { + type: "integer", + label: "Limit", + description: "Maximum number of messages to return (1-100)", + min: 1, + max: 100, + default: 50, + }, + cursor: { + type: "string", + label: "Cursor", + description: "Cursor for pagination (get from the meta.next_cursor of the previous response)", + optional: true, + }, + }, + async run({ $ }) { + const params = { + limit: this.limit, + }; + + if (this.cursor) { + params.cursor = this.cursor; + } + + const response = await this.gorgiasOAuth.listMessages({ + $, + params, + }); + + $.export("$summary", `Successfully retrieved ${response.data.length} message${response.data.length === 1 + ? "" + : "s"}`); + + // Return the data and pagination info + return { + data: response.data, + meta: response.meta, + }; + }, +}; diff --git a/components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs b/components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs new file mode 100644 index 0000000000000..39b96349e1900 --- /dev/null +++ b/components/gorgias_oauth/actions/list-ticket-messages/list-ticket-messages.mjs @@ -0,0 +1,62 @@ +import gorgiasOAuth from "../../gorgias_oauth.app.mjs"; + +export default { + name: "List Ticket Messages", + description: "List all messages for a specific ticket. [See the documentation](https://developers.gorgias.com/reference/list-ticket-messages)", + key: "gorgias_oauth-list-ticket-messages", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + gorgiasOAuth, + ticketId: { + propDefinition: [ + gorgiasOAuth, + "ticketId", + ], + }, + limit: { + type: "integer", + label: "Limit", + description: "Maximum number of messages to return (1-100)", + min: 1, + max: 100, + default: 50, + }, + cursor: { + type: "string", + label: "Cursor", + description: "Cursor for pagination (get from the meta.next_cursor of the previous response)", + optional: true, + }, + }, + async run({ $ }) { + const params = { + limit: this.limit, + }; + + if (this.cursor) { + params.cursor = this.cursor; + } + + const response = await this.gorgiasOAuth.listTicketMessages({ + $, + ticketId: this.ticketId, + params, + }); + + $.export("$summary", `Successfully retrieved ${response.data.length} message${response.data.length === 1 + ? "" + : "s"}`); + + // Return the data and pagination info + return { + data: response.data, + meta: response.meta, + }; + }, +}; diff --git a/components/gorgias_oauth/actions/list-tickets/list-tickets.mjs b/components/gorgias_oauth/actions/list-tickets/list-tickets.mjs index a7dfe2981d9d4..8f5b03ddd561c 100644 --- a/components/gorgias_oauth/actions/list-tickets/list-tickets.mjs +++ b/components/gorgias_oauth/actions/list-tickets/list-tickets.mjs @@ -4,7 +4,7 @@ export default { key: "gorgias_oauth-list-tickets", name: "List Tickets", description: "List all tickets. [See the docs](https://developers.gorgias.com/reference/get_api-tickets)", - version: "0.0.9", + version: "0.0.10", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gorgias_oauth/actions/retrieve-customer/retrieve-customer.mjs b/components/gorgias_oauth/actions/retrieve-customer/retrieve-customer.mjs index 05353ed8f6521..6df8786eaadbf 100644 --- a/components/gorgias_oauth/actions/retrieve-customer/retrieve-customer.mjs +++ b/components/gorgias_oauth/actions/retrieve-customer/retrieve-customer.mjs @@ -4,7 +4,7 @@ export default { key: "gorgias_oauth-retrieve-customer", name: "Retrieve a Customer", description: "Retrieve a customer. [See the docs](https://developers.gorgias.com/reference/get_api-customers-id-)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/gorgias_oauth/actions/update-customer/update-customer.mjs b/components/gorgias_oauth/actions/update-customer/update-customer.mjs index f4458dd3f8c98..18d8deade0a67 100644 --- a/components/gorgias_oauth/actions/update-customer/update-customer.mjs +++ b/components/gorgias_oauth/actions/update-customer/update-customer.mjs @@ -10,7 +10,7 @@ export default { key: "gorgias_oauth-update-customer", name: "Update Customer", description: "Update a customer. [See the docs](https://developers.gorgias.com/reference/put_api-customers-id-)", - version: "0.0.8", + version: "0.0.9", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/gorgias_oauth/actions/update-macro/update-macro.mjs b/components/gorgias_oauth/actions/update-macro/update-macro.mjs index 7214080e3ccfa..39e285526c987 100644 --- a/components/gorgias_oauth/actions/update-macro/update-macro.mjs +++ b/components/gorgias_oauth/actions/update-macro/update-macro.mjs @@ -6,7 +6,7 @@ export default { key: "gorgias_oauth-update-macro", name: "Update Macro", description: "Update a macro. [See the documentation](https://developers.gorgias.com/reference/update-macro)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/gorgias_oauth/actions/update-ticket/update-ticket.mjs b/components/gorgias_oauth/actions/update-ticket/update-ticket.mjs index a480e840f1bab..a1727ac2d8248 100644 --- a/components/gorgias_oauth/actions/update-ticket/update-ticket.mjs +++ b/components/gorgias_oauth/actions/update-ticket/update-ticket.mjs @@ -5,7 +5,7 @@ export default { key: "gorgias_oauth-update-ticket", name: "Update Ticket", description: "Updates a predefined ticket in the Gorgias system. [See the documentation](https://developers.gorgias.com/reference/update-ticket)", - version: "0.0.5", + version: "0.0.6", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/gorgias_oauth/gorgias_oauth.app.mjs b/components/gorgias_oauth/gorgias_oauth.app.mjs index d5b36b22a9d32..9f6734ea54cab 100644 --- a/components/gorgias_oauth/gorgias_oauth.app.mjs +++ b/components/gorgias_oauth/gorgias_oauth.app.mjs @@ -226,6 +226,52 @@ export default { }, }, methods: { + /** + * List all messages for a specific ticket + * @param {Object} params - Parameters for the request + * @param {number} params.ticketId - The ID of the ticket + * @param {Object} params.params - Optional query parameters (cursor, limit, etc.) + * @returns {Promise} - Returns the list of messages and pagination info + */ + listTicketMessages({ + $, ticketId, params = {}, + }) { + return this._makeRequest({ + $, + path: `/tickets/${ticketId}/messages`, + params, + }); + }, + /** + * Get a specific message by ID + * @param {Object} params - Parameters for the request + * @param {number} params.ticketId - The ID of the ticket + * @param {number} params.messageId - The ID of the message to retrieve + * @returns {Promise} - Returns the message details + */ + getTicketMessage({ + $, ticketId, messageId, + }) { + return this._makeRequest({ + $, + path: `/tickets/${ticketId}/messages/${messageId}`, + }); + }, + /** + * List all messages + * @param {Object} params - Parameters for the request + * @param {Object} params.params - Optional query parameters (cursor, limit, etc.) + * @returns {Promise} - Returns the list of messages and pagination info + */ + listMessages({ + $, params = {}, + }) { + return this._makeRequest({ + $, + path: "/messages", + params, + }); + }, _defaultConfig({ path, method = "get", params = {}, data, }) { diff --git a/components/gorgias_oauth/package.json b/components/gorgias_oauth/package.json index 186197f6e74de..3fb26c4b162e0 100644 --- a/components/gorgias_oauth/package.json +++ b/components/gorgias_oauth/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/gorgias_oauth", - "version": "0.6.2", + "version": "0.7.0", "description": "Pipedream Gorgias OAuth Components", "main": "gorgias_oauth.app.mjs", "keywords": [ diff --git a/components/gorgias_oauth/sources/internal-note-created/internal-note-created.mjs b/components/gorgias_oauth/sources/internal-note-created/internal-note-created.mjs index 8d7bd7c9e832b..0c0b61cbfcfcb 100644 --- a/components/gorgias_oauth/sources/internal-note-created/internal-note-created.mjs +++ b/components/gorgias_oauth/sources/internal-note-created/internal-note-created.mjs @@ -7,7 +7,7 @@ export default { key: "gorgias_oauth-internal-note-created", name: "New Internal Note", description: "Emit new event when an internal note is created on a ticket. [See the documentation](https://developers.gorgias.com/reference/the-event-object)", - version: "0.0.2", + version: "0.0.3", type: "source", props: { ...base.props, diff --git a/components/gorgias_oauth/sources/macro-updated/macro-updated.mjs b/components/gorgias_oauth/sources/macro-updated/macro-updated.mjs index 1b66c9268ff62..7b60f07e9c25b 100644 --- a/components/gorgias_oauth/sources/macro-updated/macro-updated.mjs +++ b/components/gorgias_oauth/sources/macro-updated/macro-updated.mjs @@ -6,7 +6,7 @@ export default { key: "gorgias_oauth-macro-updated", name: "Macro Updated", description: "Emit new event when a macro is updated. [See the documentation](https://developers.gorgias.com/reference/the-event-object)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { diff --git a/components/gorgias_oauth/sources/new-macro-created/new-macro-created.mjs b/components/gorgias_oauth/sources/new-macro-created/new-macro-created.mjs index ac8678dc79a8b..9ace61cf08200 100644 --- a/components/gorgias_oauth/sources/new-macro-created/new-macro-created.mjs +++ b/components/gorgias_oauth/sources/new-macro-created/new-macro-created.mjs @@ -6,7 +6,7 @@ export default { key: "gorgias_oauth-new-macro-created", name: "New Macro Created", description: "Emit new event when a macro is created. [See the documentation](https://developers.gorgias.com/reference/the-event-object)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { diff --git a/components/gorgias_oauth/sources/ticket-created/ticket-created.mjs b/components/gorgias_oauth/sources/ticket-created/ticket-created.mjs index 8cd2bce3ee69c..7cd0c4e8d7cec 100644 --- a/components/gorgias_oauth/sources/ticket-created/ticket-created.mjs +++ b/components/gorgias_oauth/sources/ticket-created/ticket-created.mjs @@ -7,7 +7,7 @@ export default { key: "gorgias_oauth-ticket-created", name: "New Ticket", description: "Emit new event when a ticket is created. [See the documentation](https://developers.gorgias.com/reference/the-event-object)", - version: "0.1.8", + version: "0.1.9", type: "source", props: { ...base.props, diff --git a/components/gorgias_oauth/sources/ticket-message-created/ticket-message-created.mjs b/components/gorgias_oauth/sources/ticket-message-created/ticket-message-created.mjs index 504daa74a67ea..3c44a377bb3fd 100644 --- a/components/gorgias_oauth/sources/ticket-message-created/ticket-message-created.mjs +++ b/components/gorgias_oauth/sources/ticket-message-created/ticket-message-created.mjs @@ -8,7 +8,7 @@ export default { key: "gorgias_oauth-ticket-message-created", name: "New Ticket Message", description: "Emit new event when a ticket message is created. [See the documentation](https://developers.gorgias.com/reference/the-event-object)", - version: "0.1.8", + version: "0.1.9", type: "source", props: { ...base.props, diff --git a/components/gorgias_oauth/sources/ticket-updated/ticket-updated.mjs b/components/gorgias_oauth/sources/ticket-updated/ticket-updated.mjs index 3259ed9e02c37..1e19116db59b9 100644 --- a/components/gorgias_oauth/sources/ticket-updated/ticket-updated.mjs +++ b/components/gorgias_oauth/sources/ticket-updated/ticket-updated.mjs @@ -7,7 +7,7 @@ export default { key: "gorgias_oauth-ticket-updated", name: "New Updated Ticket", description: "Emit new event when a ticket is updated. [See the documentation](https://developers.gorgias.com/reference/the-event-object)", - version: "0.1.8", + version: "0.1.9", type: "source", props: { ...base.props,