@pipedream/freshdesk 0.3.1 → 0.5.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 (40) hide show
  1. package/actions/add-note-to-ticket/add-note-to-ticket.mjs +1 -1
  2. package/actions/add-ticket-tags/add-ticket-tags.mjs +1 -1
  3. package/actions/assign-ticket-to-agent/assign-ticket-to-agent.mjs +1 -1
  4. package/actions/assign-ticket-to-group/assign-ticket-to-group.mjs +1 -1
  5. package/actions/close-ticket/close-ticket.mjs +1 -1
  6. package/actions/create-agent/create-agent.mjs +103 -0
  7. package/actions/create-company/create-company.mjs +1 -1
  8. package/actions/create-contact/create-contact.mjs +1 -1
  9. package/actions/create-solution-article/create-solution-article.mjs +72 -0
  10. package/actions/create-ticket/create-ticket.mjs +1 -1
  11. package/actions/create-ticket-field/create-ticket-field.mjs +109 -0
  12. package/actions/delete-solution-article/delete-solution-article.mjs +44 -0
  13. package/actions/download-attachment/download-attachment.mjs +73 -0
  14. package/actions/get-contact/get-contact.mjs +26 -0
  15. package/actions/get-solution-article/get-solution-article.mjs +44 -0
  16. package/actions/get-ticket/get-ticket.mjs +1 -1
  17. package/actions/list-agents/list-agents.mjs +66 -0
  18. package/actions/list-all-tickets/list-all-tickets.mjs +1 -1
  19. package/actions/list-category-folders/list-category-folders.mjs +28 -0
  20. package/actions/list-folder-articles/list-folder-articles.mjs +47 -0
  21. package/actions/list-solution-categories/list-solution-categories.mjs +21 -0
  22. package/actions/list-ticket-fields/list-ticket-fields.mjs +32 -0
  23. package/actions/remove-ticket-tags/remove-ticket-tags.mjs +1 -1
  24. package/actions/set-ticket-priority/set-ticket-priority.mjs +1 -1
  25. package/actions/set-ticket-status/set-ticket-status.mjs +1 -1
  26. package/actions/set-ticket-tags/set-ticket-tags.mjs +1 -1
  27. package/actions/update-agent/update-agent.mjs +112 -0
  28. package/actions/update-contact/update-contact.mjs +64 -0
  29. package/actions/update-solution-article/update-solution-article.mjs +84 -0
  30. package/actions/update-ticket/update-ticket.mjs +1 -1
  31. package/actions/update-ticket-field/update-ticket-field.mjs +106 -0
  32. package/common/constants.mjs +38 -0
  33. package/common/utils.mjs +27 -0
  34. package/freshdesk.app.mjs +296 -2
  35. package/package.json +1 -1
  36. package/sources/common/polling.mjs +63 -0
  37. package/sources/contact-updated/contact-updated.mjs +28 -0
  38. package/sources/new-contact/new-contact.mjs +18 -40
  39. package/sources/new-ticket/new-ticket.mjs +18 -43
  40. package/sources/ticket-updated/ticket-updated.mjs +28 -0
@@ -5,7 +5,7 @@ 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.1",
8
+ version: "0.0.2",
9
9
  type: "action",
10
10
  props: {
11
11
  freshdesk,
@@ -6,7 +6,7 @@ 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.2",
9
+ version: "0.0.3",
10
10
  props: {
11
11
  freshdesk,
12
12
  ticketId: {
@@ -4,7 +4,7 @@ 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.3",
7
+ version: "0.0.4",
8
8
  type: "action",
9
9
  props: {
10
10
  freshdesk,
@@ -4,7 +4,7 @@ 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.3",
7
+ version: "0.0.4",
8
8
  type: "action",
9
9
  props: {
10
10
  freshdesk,
@@ -4,7 +4,7 @@ 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.3",
7
+ version: "0.0.4",
8
8
  type: "action",
9
9
  props: {
10
10
  freshdesk,
@@ -0,0 +1,103 @@
1
+ import freshdesk from "../../freshdesk.app.mjs";
2
+ import constants from "../../common/constants.mjs";
3
+
4
+ export default {
5
+ key: "freshdesk-create-agent",
6
+ name: "Create Agent",
7
+ description: "Create an agent in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#create_agent)",
8
+ version: "0.0.1",
9
+ type: "action",
10
+ props: {
11
+ freshdesk,
12
+ email: {
13
+ type: "string",
14
+ label: "Email",
15
+ description: "Email address of the Agent.",
16
+ },
17
+ ticketScope: {
18
+ type: "integer",
19
+ label: "Ticket Scope",
20
+ description: "Ticket permission of the agent. Current logged in agent can't update his/her ticket_scope",
21
+ options: constants.TICKET_SCOPE,
22
+ },
23
+ occasional: {
24
+ type: "boolean",
25
+ label: "Occasional",
26
+ description: "Set to true if this is an occasional agent (true => occasional, false => full-time)",
27
+ optional: true,
28
+ },
29
+ signature: {
30
+ type: "string",
31
+ label: "Signature",
32
+ description: "Signature of the agent in HTML format",
33
+ optional: true,
34
+ },
35
+ skillIds: {
36
+ propDefinition: [
37
+ freshdesk,
38
+ "skillIds",
39
+ ],
40
+ },
41
+ groupIds: {
42
+ propDefinition: [
43
+ freshdesk,
44
+ "groupId",
45
+ ],
46
+ type: "string[]",
47
+ label: "Group IDs",
48
+ description: "Array of group IDs",
49
+ optional: true,
50
+ },
51
+ roleIds: {
52
+ propDefinition: [
53
+ freshdesk,
54
+ "roleIds",
55
+ ],
56
+ },
57
+ agentType: {
58
+ type: "integer",
59
+ label: "Agent Type",
60
+ description: "Type of the agent",
61
+ options: constants.AGENT_TYPE,
62
+ optional: true,
63
+ },
64
+ language: {
65
+ type: "string",
66
+ label: "Language",
67
+ description: " Language of the Agent. Default language is `en`",
68
+ optional: true,
69
+ },
70
+ timeZone: {
71
+ type: "string",
72
+ label: "Time Zone",
73
+ description: "Time zone of the agent. Default value is time zone of the domain.",
74
+ optional: true,
75
+ },
76
+ focusMode: {
77
+ type: "boolean",
78
+ label: "Focus Mode",
79
+ description: "Focus mode of the agent. Default value is `true`",
80
+ optional: true,
81
+ },
82
+ },
83
+ async run({ $ }) {
84
+ const response = await this.freshdesk.createAgent({
85
+ $,
86
+ data: {
87
+ email: this.email,
88
+ ticket_scope: this.ticketScope,
89
+ occasional: this.occasional,
90
+ signature: this.signature,
91
+ skill_ids: this.skillIds,
92
+ group_ids: this.groupIds,
93
+ role_ids: this.roleIds,
94
+ agent_type: this.agentType,
95
+ language: this.language,
96
+ time_zone: this.timeZone,
97
+ focus_mode: this.focusMode,
98
+ },
99
+ });
100
+ $.export("$summary", `Agent ${this.email} created successfully`);
101
+ return response;
102
+ },
103
+ };
@@ -4,7 +4,7 @@ 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.6",
7
+ version: "0.0.7",
8
8
  type: "action",
9
9
  props: {
10
10
  freshdesk,
@@ -5,7 +5,7 @@ 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.6",
8
+ version: "0.0.7",
9
9
  type: "action",
10
10
  props: {
11
11
  freshdesk,
@@ -0,0 +1,72 @@
1
+ import freshdesk from "../../freshdesk.app.mjs";
2
+ import constants from "../../common/constants.mjs";
3
+ import { parseObject } from "../../common/utils.mjs";
4
+
5
+ export default {
6
+ key: "freshdesk-create-solution-article",
7
+ name: "Create Solution Article",
8
+ description: "Create a solution article in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_article_attributes)",
9
+ version: "0.0.1",
10
+ type: "action",
11
+ props: {
12
+ freshdesk,
13
+ categoryId: {
14
+ propDefinition: [
15
+ freshdesk,
16
+ "categoryId",
17
+ ],
18
+ },
19
+ folderId: {
20
+ propDefinition: [
21
+ freshdesk,
22
+ "folderId",
23
+ (c) => ({
24
+ categoryId: c.categoryId,
25
+ }),
26
+ ],
27
+ },
28
+ title: {
29
+ type: "string",
30
+ label: "Title",
31
+ description: "Title of the article",
32
+ },
33
+ description: {
34
+ type: "string",
35
+ label: "Description",
36
+ description: "Description of the article",
37
+ },
38
+ status: {
39
+ type: "integer",
40
+ label: "Status",
41
+ description: "Status of the article",
42
+ options: constants.ARTICLE_STATUS,
43
+ },
44
+ seoData: {
45
+ type: "object",
46
+ label: "SEO Data",
47
+ description: "Meta data for search engine optimization. Allows meta_title, meta_description and meta_keywords",
48
+ optional: true,
49
+ },
50
+ tags: {
51
+ type: "string[]",
52
+ label: "Tags",
53
+ description: "Tags for the article",
54
+ optional: true,
55
+ },
56
+ },
57
+ async run({ $ }) {
58
+ const response = await this.freshdesk.createArticle({
59
+ $,
60
+ folderId: this.folderId,
61
+ data: {
62
+ title: this.title,
63
+ description: this.description,
64
+ status: this.status,
65
+ seo_data: parseObject(this.seoData),
66
+ tags: this.tags,
67
+ },
68
+ });
69
+ $.export("$summary", `Successfully created solution article ${this.title}`);
70
+ return response;
71
+ },
72
+ };
@@ -4,7 +4,7 @@ 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.7",
7
+ version: "0.0.8",
8
8
  type: "action",
9
9
  props: {
10
10
  freshdesk,
@@ -0,0 +1,109 @@
1
+ import freshdesk from "../../freshdesk.app.mjs";
2
+ import { parseObject } from "../../common/utils.mjs";
3
+ import { ConfigurationError } from "@pipedream/platform";
4
+
5
+ export default {
6
+ key: "freshdesk-create-ticket-field",
7
+ name: "Create Ticket Field",
8
+ description: "Create a ticket field in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#create_ticket_field)",
9
+ version: "0.0.1",
10
+ type: "action",
11
+ props: {
12
+ freshdesk,
13
+ label: {
14
+ type: "string",
15
+ label: "Label",
16
+ description: "Display the name of the Ticket Field",
17
+ },
18
+ labelForCustomers: {
19
+ type: "string",
20
+ label: "Label for Customers",
21
+ description: "The label for the field as seen by customers",
22
+ },
23
+ type: {
24
+ type: "string",
25
+ label: "Type",
26
+ description: "The type of the field. Can be custom_dropdown, custom_checkbox, custom_text, etc...",
27
+ default: "custom_text",
28
+ },
29
+ customersCanEdit: {
30
+ type: "boolean",
31
+ label: "Customers Can Edit",
32
+ description: "Whether customers can edit the field",
33
+ optional: true,
34
+ },
35
+ displayedToCustomers: {
36
+ type: "boolean",
37
+ label: "Displayed to Customers",
38
+ description: "Whether the field is displayed to customers",
39
+ optional: true,
40
+ },
41
+ position: {
42
+ type: "integer",
43
+ label: "Position",
44
+ description: "The position of the fieldPosition in which the ticket field is displayed in the form. If not given, it will be displayed on top",
45
+ optional: true,
46
+ },
47
+ requiredForClosure: {
48
+ type: "boolean",
49
+ label: "Required for Closure",
50
+ description: "Set to `true` if the field is mandatory for closing the ticket",
51
+ optional: true,
52
+ },
53
+ requiredForAgents: {
54
+ type: "boolean",
55
+ label: "Required for Agents",
56
+ description: "Set to `true` if the field is mandatory for agents",
57
+ optional: true,
58
+ },
59
+ requiredForCustomers: {
60
+ type: "boolean",
61
+ label: "Required for Customers",
62
+ description: "Set to `true` if the field is mandatory for customers",
63
+ optional: true,
64
+ },
65
+ choices: {
66
+ type: "string[]",
67
+ label: "Choices",
68
+ description: "Array of key, value pairs containing the value and position of dropdown choices. Example: `[{ \"value\": \"Refund\", \"position\": 1 }, { \"value\": \"FaultyProduct\", \"position\": 2 }]`",
69
+ optional: true,
70
+ },
71
+ dependentFields: {
72
+ type: "string[]",
73
+ label: "Dependent Fields",
74
+ description: "Applicable only for dependent fields, this contains details of nested fields Example: `[{ \"label\": \"District\", \"label_for_customers\": \"District\", \"level\": 2 }, { \"label\": \"Branch\", \"label_for_customers\": \"Branch\", \"level\": 3 }]`",
75
+ optional: true,
76
+ },
77
+ sectionMappings: {
78
+ type: "string[]",
79
+ label: "Section Mappings",
80
+ description: "Applicable only if the field is part of a section. This contains the details of a section (ID, position) for which it is been a part of. Example: `[{ \"position\": 3, \"section_id\": 1 }]`",
81
+ optional: true,
82
+ },
83
+ },
84
+ async run({ $ }) {
85
+ if (this.type === "custom_dropdown" && !this.choices) {
86
+ throw new ConfigurationError("Choices are required for custom_dropdown fields");
87
+ }
88
+
89
+ const response = await this.freshdesk.createTicketField({
90
+ $,
91
+ data: {
92
+ label: this.label,
93
+ customers_can_edit: this.customersCanEdit,
94
+ label_for_customers: this.labelForCustomers,
95
+ displayed_to_customers: this.displayedToCustomers,
96
+ position: this.position,
97
+ type: this.type,
98
+ required_for_closure: this.requiredForClosure,
99
+ required_for_agents: this.requiredForAgents,
100
+ required_for_customers: this.requiredForCustomers,
101
+ choices: parseObject(this.choices),
102
+ dependent_fields: parseObject(this.dependentFields),
103
+ section_mappings: parseObject(this.sectionMappings),
104
+ },
105
+ });
106
+ $.export("$summary", `Successfully created ticket field: ${response.label}`);
107
+ return response;
108
+ },
109
+ };
@@ -0,0 +1,44 @@
1
+ import freshdesk from "../../freshdesk.app.mjs";
2
+
3
+ export default {
4
+ key: "freshdesk-delete-solution-article",
5
+ name: "Delete Solution Article",
6
+ description: "Delete a solution article in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_article_attributes)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ freshdesk,
11
+ categoryId: {
12
+ propDefinition: [
13
+ freshdesk,
14
+ "categoryId",
15
+ ],
16
+ },
17
+ folderId: {
18
+ propDefinition: [
19
+ freshdesk,
20
+ "folderId",
21
+ (c) => ({
22
+ categoryId: c.categoryId,
23
+ }),
24
+ ],
25
+ },
26
+ articleId: {
27
+ propDefinition: [
28
+ freshdesk,
29
+ "articleId",
30
+ (c) => ({
31
+ folderId: c.folderId,
32
+ }),
33
+ ],
34
+ },
35
+ },
36
+ async run({ $ }) {
37
+ const response = await this.freshdesk.deleteArticle({
38
+ $,
39
+ articleId: this.articleId,
40
+ });
41
+ $.export("$summary", `Successfully deleted solution article ${this.articleId}`);
42
+ return response;
43
+ },
44
+ };
@@ -0,0 +1,73 @@
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.1",
10
+ type: "action",
11
+ props: {
12
+ freshdesk,
13
+ ticketId: {
14
+ propDefinition: [
15
+ freshdesk,
16
+ "ticketId",
17
+ ],
18
+ },
19
+ attachmentId: {
20
+ type: "integer",
21
+ label: "Attachment ID",
22
+ description: "The ID of the attachment to download",
23
+ async options() {
24
+ const attachments = await this.listTicketAttachments();
25
+ return attachments.map(({
26
+ id, name,
27
+ }) => ({
28
+ value: id,
29
+ label: name,
30
+ }));
31
+ },
32
+ },
33
+ syncDir: {
34
+ type: "dir",
35
+ accessMode: "write",
36
+ sync: true,
37
+ },
38
+ },
39
+ methods: {
40
+ async listTicketAttachments(opts = {}) {
41
+ const { attachments } = await this.freshdesk.getTicket({
42
+ ticketId: this.ticketId,
43
+ ...opts,
44
+ });
45
+ return attachments;
46
+ },
47
+ },
48
+ async run({ $ }) {
49
+ const attachments = await this.listTicketAttachments({
50
+ $,
51
+ });
52
+ const attachment = attachments.find(({ id }) => id === this.attachmentId);
53
+
54
+ const response = await axios($, {
55
+ url: attachment.attachment_url,
56
+ responseType: "arraybuffer",
57
+ });
58
+
59
+ const buffer = Buffer.from(response);
60
+ const downloadedFilepath = `/tmp/${attachment.name}`;
61
+ fs.writeFileSync(downloadedFilepath, buffer);
62
+
63
+ const filedata = [
64
+ attachment.name,
65
+ downloadedFilepath,
66
+ ];
67
+
68
+ return {
69
+ filedata,
70
+ attachment,
71
+ };
72
+ },
73
+ };
@@ -0,0 +1,26 @@
1
+ import freshdesk from "../../freshdesk.app.mjs";
2
+
3
+ export default {
4
+ key: "freshdesk-get-contact",
5
+ name: "Get Contact",
6
+ description: "Get a contact from Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#view_contact)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ freshdesk,
11
+ contactId: {
12
+ propDefinition: [
13
+ freshdesk,
14
+ "contactId",
15
+ ],
16
+ },
17
+ },
18
+ async run({ $ }) {
19
+ const contact = await this.freshdesk.getContact({
20
+ $,
21
+ contactId: this.contactId,
22
+ });
23
+ $.export("$summary", `Successfully fetched contact: ${contact.name}`);
24
+ return contact;
25
+ },
26
+ };
@@ -0,0 +1,44 @@
1
+ import freshdesk from "../../freshdesk.app.mjs";
2
+
3
+ export default {
4
+ key: "freshdesk-get-solution-article",
5
+ name: "Get Solution Article",
6
+ description: "Get a solution article in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_article_attributes)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ freshdesk,
11
+ categoryId: {
12
+ propDefinition: [
13
+ freshdesk,
14
+ "categoryId",
15
+ ],
16
+ },
17
+ folderId: {
18
+ propDefinition: [
19
+ freshdesk,
20
+ "folderId",
21
+ (c) => ({
22
+ categoryId: c.categoryId,
23
+ }),
24
+ ],
25
+ },
26
+ articleId: {
27
+ propDefinition: [
28
+ freshdesk,
29
+ "articleId",
30
+ (c) => ({
31
+ folderId: c.folderId,
32
+ }),
33
+ ],
34
+ },
35
+ },
36
+ async run({ $ }) {
37
+ const response = await this.freshdesk.getArticle({
38
+ $,
39
+ articleId: this.articleId,
40
+ });
41
+ $.export("$summary", `Successfully retrieved solution article ${this.articleId}`);
42
+ return response;
43
+ },
44
+ };
@@ -4,7 +4,7 @@ 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.4",
7
+ version: "0.1.5",
8
8
  type: "action",
9
9
  props: {
10
10
  freshdesk,
@@ -0,0 +1,66 @@
1
+ import freshdesk from "../../freshdesk.app.mjs";
2
+
3
+ export default {
4
+ key: "freshdesk-list-agents",
5
+ name: "List Agents",
6
+ description: "List all agents in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#list_all_agents)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ freshdesk,
11
+ email: {
12
+ type: "string",
13
+ label: "Email",
14
+ description: "Filter results by email address",
15
+ optional: true,
16
+ },
17
+ mobile: {
18
+ type: "string",
19
+ label: "Mobile",
20
+ description: "Filter results by mobile number",
21
+ optional: true,
22
+ },
23
+ phone: {
24
+ type: "string",
25
+ label: "Phone",
26
+ description: "Filter results by phone number",
27
+ optional: true,
28
+ },
29
+ state: {
30
+ type: "string",
31
+ label: "State",
32
+ description: "Filter results by state",
33
+ options: [
34
+ "fulltime",
35
+ "occasional",
36
+ ],
37
+ optional: true,
38
+ },
39
+ maxResults: {
40
+ propDefinition: [
41
+ freshdesk,
42
+ "maxResults",
43
+ ],
44
+ },
45
+ },
46
+ async run({ $ }) {
47
+ const results = await this.freshdesk.getPaginatedResources({
48
+ fn: this.freshdesk.listAgents,
49
+ args: {
50
+ $,
51
+ params: {
52
+ email: this.email,
53
+ mobile: this.mobile,
54
+ phone: this.phone,
55
+ state: this.state,
56
+ },
57
+ },
58
+ max: this.maxResults,
59
+ });
60
+
61
+ $.export("$summary", `Successfully listed ${results.length} agent${results.length === 1
62
+ ? ""
63
+ : "s"}`);
64
+ return results;
65
+ },
66
+ };
@@ -5,7 +5,7 @@ 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.4",
8
+ version: "0.2.5",
9
9
  type: "action",
10
10
  props: {
11
11
  freshdesk,
@@ -0,0 +1,28 @@
1
+ import freshdesk from "../../freshdesk.app.mjs";
2
+
3
+ export default {
4
+ key: "freshdesk-list-category-folders",
5
+ name: "List Category Folders",
6
+ description: "List category folders in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#solution_folder_attributes)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ freshdesk,
11
+ categoryId: {
12
+ propDefinition: [
13
+ freshdesk,
14
+ "categoryId",
15
+ ],
16
+ },
17
+ },
18
+ async run({ $ }) {
19
+ const response = await this.freshdesk.listCategoryFolders({
20
+ $,
21
+ categoryId: this.categoryId,
22
+ });
23
+ $.export("$summary", `Successfully listed ${response.length} solution folder${response.length === 1
24
+ ? ""
25
+ : "s"}`);
26
+ return response;
27
+ },
28
+ };