@pipedream/freshdesk 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/actions/add-note-to-ticket/add-note-to-ticket.mjs +6 -1
  2. package/actions/add-ticket-tags/add-ticket-tags.mjs +6 -1
  3. package/actions/assign-ticket-to-agent/assign-ticket-to-agent.mjs +6 -1
  4. package/actions/assign-ticket-to-group/assign-ticket-to-group.mjs +6 -1
  5. package/actions/close-ticket/close-ticket.mjs +6 -1
  6. package/actions/create-agent/create-agent.mjs +6 -1
  7. package/actions/create-company/create-company.mjs +6 -1
  8. package/actions/create-contact/create-contact.mjs +6 -1
  9. package/actions/create-solution-article/create-solution-article.mjs +6 -1
  10. package/actions/create-ticket/create-ticket.mjs +6 -1
  11. package/actions/create-ticket-field/create-ticket-field.mjs +6 -1
  12. package/actions/delete-solution-article/delete-solution-article.mjs +6 -1
  13. package/actions/download-attachment/download-attachment.mjs +78 -0
  14. package/actions/get-contact/get-contact.mjs +6 -1
  15. package/actions/get-solution-article/get-solution-article.mjs +6 -1
  16. package/actions/get-ticket/get-ticket.mjs +24 -2
  17. package/actions/list-agents/list-agents.mjs +6 -1
  18. package/actions/list-all-tickets/list-all-tickets.mjs +6 -1
  19. package/actions/list-category-folders/list-category-folders.mjs +6 -1
  20. package/actions/list-folder-articles/list-folder-articles.mjs +6 -1
  21. package/actions/list-solution-categories/list-solution-categories.mjs +6 -1
  22. package/actions/list-ticket-conversations/list-ticket-conversations.mjs +54 -0
  23. package/actions/list-ticket-fields/list-ticket-fields.mjs +6 -1
  24. package/actions/remove-ticket-tags/remove-ticket-tags.mjs +6 -1
  25. package/actions/set-ticket-priority/set-ticket-priority.mjs +6 -1
  26. package/actions/set-ticket-status/set-ticket-status.mjs +6 -1
  27. package/actions/set-ticket-tags/set-ticket-tags.mjs +6 -1
  28. package/actions/update-agent/update-agent.mjs +6 -1
  29. package/actions/update-contact/update-contact.mjs +6 -1
  30. package/actions/update-solution-article/update-solution-article.mjs +6 -1
  31. package/actions/update-ticket/update-ticket.mjs +6 -1
  32. package/actions/update-ticket-field/update-ticket-field.mjs +6 -1
  33. package/package.json +1 -1
@@ -5,7 +5,12 @@ export default {
5
5
  key: "freshdesk-add-note-to-ticket",
6
6
  name: "Add Note to Ticket",
7
7
  description: "Add a note or conversation to an existing ticket. [See the documentation](https://developers.freshdesk.com/api/#add_note_to_a_ticket).",
8
- version: "0.0.2",
8
+ version: "0.0.3",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: false,
13
+ },
9
14
  type: "action",
10
15
  props: {
11
16
  freshdesk,
@@ -6,7 +6,12 @@ export default {
6
6
  name: "Add Ticket Tags",
7
7
  description: "Add tags to a ticket (appends to existing tags). [See the documentation](https://developers.freshdesk.com/api/#update_ticket)",
8
8
  type: "action",
9
- version: "0.0.3",
9
+ version: "0.0.4",
10
+ annotations: {
11
+ destructiveHint: true,
12
+ openWorldHint: true,
13
+ readOnlyHint: false,
14
+ },
10
15
  props: {
11
16
  freshdesk,
12
17
  ticketId: {
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-assign-ticket-to-agent",
5
5
  name: "Assign Ticket to Agent",
6
6
  description: "Assign a Freshdesk ticket to a specific agent. [See the documentation](https://developers.freshdesk.com/api/#update_ticket).",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
+ annotations: {
9
+ destructiveHint: true,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-assign-ticket-to-group",
5
5
  name: "Assign Ticket to Group",
6
6
  description: "Assign a Freshdesk ticket to a specific group [See the documentation](https://developers.freshdesk.com/api/#update_ticket).",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
+ annotations: {
9
+ destructiveHint: true,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-close-ticket",
5
5
  name: "Close Ticket",
6
6
  description: "Set a Freshdesk ticket's status to 'Closed'. [See docs](https://developers.freshdesk.com/api/#update_a_ticket)",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
+ annotations: {
9
+ destructiveHint: true,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -5,7 +5,12 @@ export default {
5
5
  key: "freshdesk-create-agent",
6
6
  name: "Create Agent",
7
7
  description: "Create an agent in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#create_agent)",
8
- version: "0.0.1",
8
+ version: "0.0.2",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: false,
13
+ },
9
14
  type: "action",
10
15
  props: {
11
16
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-create-company",
5
5
  name: "Create a Company",
6
6
  description: "Create a company. [See the documentation](https://developers.freshdesk.com/api/#create_company)",
7
- version: "0.0.7",
7
+ version: "0.0.8",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -5,7 +5,12 @@ export default {
5
5
  key: "freshdesk-create-contact",
6
6
  name: "Create a Contact",
7
7
  description: "Create a contact. [See the documentation](https://developers.freshdesk.com/api/#create_contact)",
8
- version: "0.0.7",
8
+ version: "0.0.8",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: false,
13
+ },
9
14
  type: "action",
10
15
  props: {
11
16
  freshdesk,
@@ -6,7 +6,12 @@ export default {
6
6
  key: "freshdesk-create-solution-article",
7
7
  name: "Create Solution Article",
8
8
  description: "Create a solution article in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_article_attributes)",
9
- version: "0.0.1",
9
+ version: "0.0.2",
10
+ annotations: {
11
+ destructiveHint: false,
12
+ openWorldHint: true,
13
+ readOnlyHint: false,
14
+ },
10
15
  type: "action",
11
16
  props: {
12
17
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-create-ticket",
5
5
  name: "Create a Ticket",
6
6
  description: "Create a ticket. [See the documentation](https://developers.freshdesk.com/api/#create_ticket)",
7
- version: "0.0.8",
7
+ version: "0.0.9",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -6,7 +6,12 @@ export default {
6
6
  key: "freshdesk-create-ticket-field",
7
7
  name: "Create Ticket Field",
8
8
  description: "Create a ticket field in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#create_ticket_field)",
9
- version: "0.0.1",
9
+ version: "0.0.2",
10
+ annotations: {
11
+ destructiveHint: false,
12
+ openWorldHint: true,
13
+ readOnlyHint: false,
14
+ },
10
15
  type: "action",
11
16
  props: {
12
17
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-delete-solution-article",
5
5
  name: "Delete Solution Article",
6
6
  description: "Delete a solution article in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_article_attributes)",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: true,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -0,0 +1,78 @@
1
+ import freshdesk from "../../freshdesk.app.mjs";
2
+ import { axios } from "@pipedream/platform";
3
+ import fs from "fs";
4
+
5
+ export default {
6
+ key: "freshdesk-download-attachment",
7
+ name: "Download Attachment",
8
+ description: "Download an attachment from a ticket. [See the documentation](https://developers.freshdesk.com/api/#view_a_ticket)",
9
+ version: "0.0.2",
10
+ type: "action",
11
+ annotations: {
12
+ destructiveHint: false,
13
+ openWorldHint: true,
14
+ readOnlyHint: true,
15
+ },
16
+ props: {
17
+ freshdesk,
18
+ ticketId: {
19
+ propDefinition: [
20
+ freshdesk,
21
+ "ticketId",
22
+ ],
23
+ },
24
+ attachmentId: {
25
+ type: "integer",
26
+ label: "Attachment ID",
27
+ description: "The ID of the attachment to download",
28
+ async options() {
29
+ const attachments = await this.listTicketAttachments();
30
+ return attachments.map(({
31
+ id, name,
32
+ }) => ({
33
+ value: id,
34
+ label: name,
35
+ }));
36
+ },
37
+ },
38
+ syncDir: {
39
+ type: "dir",
40
+ accessMode: "write",
41
+ sync: true,
42
+ },
43
+ },
44
+ methods: {
45
+ async listTicketAttachments(opts = {}) {
46
+ const { attachments } = await this.freshdesk.getTicket({
47
+ ticketId: this.ticketId,
48
+ ...opts,
49
+ });
50
+ return attachments;
51
+ },
52
+ },
53
+ async run({ $ }) {
54
+ const attachments = await this.listTicketAttachments({
55
+ $,
56
+ });
57
+ const attachment = attachments.find(({ id }) => id === this.attachmentId);
58
+
59
+ const response = await axios($, {
60
+ url: attachment.attachment_url,
61
+ responseType: "arraybuffer",
62
+ });
63
+
64
+ const buffer = Buffer.from(response);
65
+ const downloadedFilepath = `/tmp/${attachment.name}`;
66
+ fs.writeFileSync(downloadedFilepath, buffer);
67
+
68
+ const filedata = [
69
+ attachment.name,
70
+ downloadedFilepath,
71
+ ];
72
+
73
+ return {
74
+ filedata,
75
+ attachment,
76
+ };
77
+ },
78
+ };
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-get-contact",
5
5
  name: "Get Contact",
6
6
  description: "Get a contact from Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#view_contact)",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-get-solution-article",
5
5
  name: "Get Solution Article",
6
6
  description: "Get a solution article in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_article_attributes)",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-get-ticket",
5
5
  name: "Get Ticket Details",
6
6
  description: "Get details of a Ticket. [See the documentation](https://developers.freshdesk.com/api/#view_a_ticket)",
7
- version: "0.1.5",
7
+ version: "0.1.7",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -14,14 +19,31 @@ export default {
14
19
  "ticketId",
15
20
  ],
16
21
  },
22
+ include: {
23
+ type: "string[]",
24
+ label: "Include",
25
+ description: "Include additional data in the response",
26
+ optional: true,
27
+ options: [
28
+ "conversations",
29
+ "requester",
30
+ "company",
31
+ "stats",
32
+ ],
33
+ },
17
34
  },
18
35
  async run({ $ }) {
19
36
  const {
20
- freshdesk, ticketId,
37
+ freshdesk, ticketId, include,
21
38
  } = this;
22
39
  const response = await freshdesk.getTicket({
23
40
  $,
24
41
  ticketId,
42
+ params: include
43
+ ? {
44
+ include: include.join(","),
45
+ }
46
+ : undefined,
25
47
  });
26
48
  response && $.export("$summary", "Successfully retrieved ticket");
27
49
  return response;
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-list-agents",
5
5
  name: "List Agents",
6
6
  description: "List all agents in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#list_all_agents)",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -5,7 +5,12 @@ export default {
5
5
  name: "List Tickets",
6
6
  description:
7
7
  "Fetch up to 100 tickets according to the selected filters. [See the documentation](https://developers.freshdesk.com/api/#list_all_tickets)",
8
- version: "0.2.5",
8
+ version: "0.2.6",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
9
14
  type: "action",
10
15
  props: {
11
16
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-list-category-folders",
5
5
  name: "List Category Folders",
6
6
  description: "List category folders in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_folder_attributes)",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-list-folder-articles",
5
5
  name: "List Folder Articles",
6
6
  description: "List folder articles in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_article_attributes)",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-list-solution-categories",
5
5
  name: "List Solution Categories",
6
6
  description: "List solution categories in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_category_attributes)",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -0,0 +1,54 @@
1
+ import freshdesk from "../../freshdesk.app.mjs";
2
+
3
+ export default {
4
+ key: "freshdesk-list-ticket-conversations",
5
+ name: "List Conversations of a Ticket",
6
+ description: "List all conversations for a ticket. [See the documentation](https://developers.freshdesk.com/api/#list_all_ticket_notes)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
14
+ props: {
15
+ freshdesk,
16
+ ticketId: {
17
+ propDefinition: [
18
+ freshdesk,
19
+ "ticketId",
20
+ ],
21
+ },
22
+ maxResults: {
23
+ propDefinition: [
24
+ freshdesk,
25
+ "maxResults",
26
+ ],
27
+ },
28
+ },
29
+ methods: {
30
+ async listTicketConversations({
31
+ ticketId, ...args
32
+ }) {
33
+ return this.freshdesk._makeRequest({
34
+ url: `/tickets/${ticketId}/conversations`,
35
+ ...args,
36
+ });
37
+ },
38
+ },
39
+ async run({ $ }) {
40
+ const results = await this.freshdesk.getPaginatedResources({
41
+ fn: this.listTicketConversations,
42
+ args: {
43
+ $,
44
+ ticketId: this.ticketId,
45
+ },
46
+ max: this.maxResults,
47
+ });
48
+
49
+ $.export("$summary", `Successfully listed ${results.length} conversation${results.length === 1
50
+ ? ""
51
+ : "s"}`);
52
+ return results;
53
+ },
54
+ };
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-list-ticket-fields",
5
5
  name: "List Ticket Fields",
6
6
  description: "List all ticket fields in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#list_all_ticket_fields)",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: true,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -6,7 +6,12 @@ export default {
6
6
  name: "Remove Ticket Tags",
7
7
  description: "Remove specific tags from a ticket. [See the documentation](https://developers.freshdesk.com/api/#update_ticket)",
8
8
  type: "action",
9
- version: "0.0.3",
9
+ version: "0.0.4",
10
+ annotations: {
11
+ destructiveHint: true,
12
+ openWorldHint: true,
13
+ readOnlyHint: false,
14
+ },
10
15
  props: {
11
16
  freshdesk,
12
17
  ticketId: {
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-set-ticket-priority",
5
5
  name: "Set Ticket Priority",
6
6
  description: "Update the priority of a ticket in Freshdesk [See the documentation](https://developers.freshdesk.com/api/#update_ticket).",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
+ annotations: {
9
+ destructiveHint: true,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-set-ticket-status",
5
5
  name: "Set Ticket Status",
6
6
  description: "Update the status of a ticket in Freshdesk [See the documentation](https://developers.freshdesk.com/api/#update_ticket).",
7
- version: "0.0.4",
7
+ version: "0.0.5",
8
+ annotations: {
9
+ destructiveHint: true,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -6,7 +6,12 @@ export default {
6
6
  name: "Set Ticket Tags",
7
7
  description: "Set tags on a ticket (replaces all existing tags). [See the documentation](https://developers.freshdesk.com/api/#update_ticket)",
8
8
  type: "action",
9
- version: "0.0.3",
9
+ version: "0.0.4",
10
+ annotations: {
11
+ destructiveHint: true,
12
+ openWorldHint: true,
13
+ readOnlyHint: false,
14
+ },
10
15
  props: {
11
16
  freshdesk,
12
17
  ticketId: {
@@ -5,7 +5,12 @@ export default {
5
5
  key: "freshdesk-update-agent",
6
6
  name: "Update Agent",
7
7
  description: "Update an agent in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#update_agent)",
8
- version: "0.0.1",
8
+ version: "0.0.2",
9
+ annotations: {
10
+ destructiveHint: true,
11
+ openWorldHint: true,
12
+ readOnlyHint: false,
13
+ },
9
14
  type: "action",
10
15
  props: {
11
16
  freshdesk,
@@ -4,7 +4,12 @@ export default {
4
4
  key: "freshdesk-update-contact",
5
5
  name: "Update Contact",
6
6
  description: "Update a contact in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#update_contact)",
7
- version: "0.0.1",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: true,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
8
13
  type: "action",
9
14
  props: {
10
15
  freshdesk,
@@ -6,7 +6,12 @@ export default {
6
6
  key: "freshdesk-update-solution-article",
7
7
  name: "Update Solution Article",
8
8
  description: "Update a solution article in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_article_attributes)",
9
- version: "0.0.1",
9
+ version: "0.0.2",
10
+ annotations: {
11
+ destructiveHint: true,
12
+ openWorldHint: true,
13
+ readOnlyHint: false,
14
+ },
10
15
  type: "action",
11
16
  props: {
12
17
  freshdesk,
@@ -5,7 +5,12 @@ export default {
5
5
  key: "freshdesk-update-ticket",
6
6
  name: "Update a Ticket",
7
7
  description: "Update status, priority, subject, description, agent, group, etc. [See the documentation](https://developers.freshdesk.com/api/#update_ticket).",
8
- version: "0.0.4",
8
+ version: "0.0.5",
9
+ annotations: {
10
+ destructiveHint: true,
11
+ openWorldHint: true,
12
+ readOnlyHint: false,
13
+ },
9
14
  type: "action",
10
15
  props: {
11
16
  freshdesk,
@@ -5,7 +5,12 @@ export default {
5
5
  key: "freshdesk-update-ticket-field",
6
6
  name: "Update Ticket Field",
7
7
  description: "Update a ticket field in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#update_ticket_field)",
8
- version: "0.0.1",
8
+ version: "0.0.2",
9
+ annotations: {
10
+ destructiveHint: true,
11
+ openWorldHint: true,
12
+ readOnlyHint: false,
13
+ },
9
14
  type: "action",
10
15
  props: {
11
16
  freshdesk,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/freshdesk",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Pipedream Freshdesk Components",
5
5
  "main": "freshdesk.app.mjs",
6
6
  "keywords": [