diff --git a/components/gorgias_oauth/actions/create-customer/create-customer.mjs b/components/gorgias_oauth/actions/create-customer/create-customer.mjs index b4c8df331cd60..18cf3a63d75f9 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.4", + version: "0.0.5", type: "action", props: { gorgias_oauth, diff --git a/components/gorgias_oauth/actions/create-ticket/create-ticket.mjs b/components/gorgias_oauth/actions/create-ticket/create-ticket.mjs index d27aa8512a29e..8fbc4e63da428 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.5", + version: "0.0.6", type: "action", props: { gorgias_oauth, diff --git a/components/gorgias_oauth/actions/list-tickets/list-tickets.mjs b/components/gorgias_oauth/actions/list-tickets/list-tickets.mjs index 85120fcb1da5a..8a7b8c3980371 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.5", + version: "0.0.6", type: "action", props: { gorgias_oauth, diff --git a/components/gorgias_oauth/actions/retrieve-customer/retrieve-customer.mjs b/components/gorgias_oauth/actions/retrieve-customer/retrieve-customer.mjs index dbf0442434991..35ee3f902dd39 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.4", + version: "0.0.5", type: "action", props: { gorgias_oauth, diff --git a/components/gorgias_oauth/actions/update-customer/update-customer.mjs b/components/gorgias_oauth/actions/update-customer/update-customer.mjs index 8f31636ae62f2..dbd7836f59360 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.4", + version: "0.0.5", type: "action", props: { gorgias_oauth, diff --git a/components/gorgias_oauth/actions/update-ticket/update-ticket.mjs b/components/gorgias_oauth/actions/update-ticket/update-ticket.mjs index 57321bd785b92..0d066a794dc85 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.1", + version: "0.0.2", type: "action", props: { gorgiasOauth, diff --git a/components/gorgias_oauth/gorgias_oauth.app.mjs b/components/gorgias_oauth/gorgias_oauth.app.mjs index 62f41511c1c08..e361088a629f9 100644 --- a/components/gorgias_oauth/gorgias_oauth.app.mjs +++ b/components/gorgias_oauth/gorgias_oauth.app.mjs @@ -169,6 +169,37 @@ export default { label: "Subject", description: "The subject of the ticket", }, + tagId: { + type: "string", + label: "Tag ID", + description: "The tag id.", + optional: true, + async options({ prevContext: { cursor } }) { + if (cursor === null) { + return []; + } + const { + meta: { next_cursor: nextCursor }, + data: tags, + } = await this.listTags({ + params: { + cursor, + }, + }); + const options = tags.map(({ + id: value, name: label, + }) => ({ + label, + value, + })); + return { + options, + context: { + cursor: nextCursor, + }, + }; + }, + }, }, methods: { _defaultConfig({ @@ -356,5 +387,11 @@ export default { ...opts, }); }, + listTags(opts = {}) { + return this._makeRequest({ + path: "/tags", + ...opts, + }); + }, }, }; diff --git a/components/gorgias_oauth/package.json b/components/gorgias_oauth/package.json index a9951a364c864..1c19492bb6d2e 100644 --- a/components/gorgias_oauth/package.json +++ b/components/gorgias_oauth/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/gorgias_oauth", - "version": "0.4.0", + "version": "0.4.1", "description": "Pipedream Gorgias OAuth Components", "main": "gorgias_oauth.app.mjs", "keywords": [ diff --git a/components/gorgias_oauth/sources/ticket-created/ticket-created.mjs b/components/gorgias_oauth/sources/ticket-created/ticket-created.mjs index a3f3e97e3c9e9..eec5d0333b79f 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.5", + version: "0.1.6", type: "source", props: { ...base.props, @@ -33,6 +33,15 @@ export default { "userId", ], }, + tagIds: { + type: "string[]", + label: "Tag IDs", + description: "The tag ids to filter tickets by.", + propDefinition: [ + base.props.gorgias_oauth, + "tagId", + ], + }, }, methods: { ...base.methods, @@ -40,9 +49,11 @@ export default { return eventTypes.TICKET_CREATED; }, isRelevant(ticket) { + const tagIds = ticket.tags.map(({ id }) => id); return (!this.channel || ticket.channel === this.channel) && (!this.via || ticket.via === this.via) - && (!this.assigneeId || ticket?.assignee_user_id === this.assigneeId); + && (!this.assigneeId || ticket?.assignee_user_id === this.assigneeId) + && (!this.tagIds || this.tagIds.some((tagId) => tagIds.includes(tagId))); }, async processHistoricalEvent(event) { const ticket = await this.retrieveTicket(event.object_id); 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 a8cb23b1fa6ba..c7f4f2ffb293a 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.5", + version: "0.1.6", 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 ed8d09c952e57..34d7002246c3c 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.5", + version: "0.1.6", type: "source", props: { ...base.props,