Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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 }) => id),
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;
},
};
2 changes: 1 addition & 1 deletion components/gorgias_oauth/actions/get-ticket/get-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
55 changes: 55 additions & 0 deletions components/gorgias_oauth/actions/list-messages/list-messages.mjs
Original file line number Diff line number Diff line change
@@ -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,
};
},
};
Original file line number Diff line number Diff line change
@@ -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,
};
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
46 changes: 46 additions & 0 deletions components/gorgias_oauth/gorgias_oauth.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Object>} - 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<Object>} - 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<Object>} - Returns the list of messages and pagination info
*/
listMessages({
$, params = {},
}) {
return this._makeRequest({
$,
path: "/messages",
params,
});
},
_defaultConfig({
path, method = "get", params = {}, data,
}) {
Expand Down
2 changes: 1 addition & 1 deletion components/gorgias_oauth/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
export default {
...base,
key: "gorgias_oauth-macro-updated",
name: "Macro Updated",

Check warning on line 7 in components/gorgias_oauth/sources/macro-updated/macro-updated.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading