Skip to content

Commit 550d464

Browse files
authored
New Components - freshdesk (#17764)
* new components * pnpm-lock.yaml * versions * pnpm-lock.yaml * pnpm-lock.yaml * pnpm-lock.yaml * pnpm-lock.yaml * updates * update type field
1 parent 08133ea commit 550d464

File tree

39 files changed

+1490
-101
lines changed

39 files changed

+1490
-101
lines changed

components/freshdesk/actions/add-note-to-ticket/add-note-to-ticket.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "freshdesk-add-note-to-ticket",
66
name: "Add Note to Ticket",
77
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",
99
type: "action",
1010
props: {
1111
freshdesk,

components/freshdesk/actions/add-ticket-tags/add-ticket-tags.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "Add Ticket Tags",
77
description: "Add tags to a ticket (appends to existing tags). [See the documentation](https://developers.freshdesk.com/api/#update_ticket)",
88
type: "action",
9-
version: "0.0.2",
9+
version: "0.0.3",
1010
props: {
1111
freshdesk,
1212
ticketId: {

components/freshdesk/actions/assign-ticket-to-agent/assign-ticket-to-agent.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshdesk-assign-ticket-to-agent",
55
name: "Assign Ticket to Agent",
66
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",
88
type: "action",
99
props: {
1010
freshdesk,

components/freshdesk/actions/assign-ticket-to-group/assign-ticket-to-group.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshdesk-assign-ticket-to-group",
55
name: "Assign Ticket to Group",
66
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",
88
type: "action",
99
props: {
1010
freshdesk,

components/freshdesk/actions/close-ticket/close-ticket.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshdesk-close-ticket",
55
name: "Close Ticket",
66
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",
88
type: "action",
99
props: {
1010
freshdesk,
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
};

components/freshdesk/actions/create-company/create-company.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshdesk-create-company",
55
name: "Create a Company",
66
description: "Create a company. [See the documentation](https://developers.freshdesk.com/api/#create_company)",
7-
version: "0.0.6",
7+
version: "0.0.7",
88
type: "action",
99
props: {
1010
freshdesk,

components/freshdesk/actions/create-contact/create-contact.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "freshdesk-create-contact",
66
name: "Create a Contact",
77
description: "Create a contact. [See the documentation](https://developers.freshdesk.com/api/#create_contact)",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
type: "action",
1010
props: {
1111
freshdesk,
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
};
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 commit comments

Comments
 (0)