Skip to content

Commit e2016db

Browse files
committed
freshdesk updates
1 parent 9a29e56 commit e2016db

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import freshdesk from "../../freshdesk.app.mjs";
2+
import { ConfigurationError } from "@pipedream/platform";
23

34
export default {
45
key: "freshdesk-create-contact",
56
name: "Create a Contact",
67
description: "Create a contact. [See the documentation](https://developers.freshdesk.com/api/#create_contact)",
7-
version: "0.0.2",
8+
version: "0.0.3",
89
type: "action",
910
props: {
1011
freshdesk,
@@ -41,9 +42,14 @@ export default {
4142
},
4243
async run({ $ }) {
4344
const {
44-
companyId, otherEmails, ...data
45+
freshdesk, companyId, otherEmails, ...data
4546
} = this;
46-
const response = await this.freshdesk.createContact({
47+
48+
if (!this.email && !this.phone) {
49+
throw new ConfigurationError("Must specify `email` and/or `phone`");
50+
}
51+
52+
const response = await freshdesk.createContact({
4753
$,
4854
data: {
4955
other_emails: otherEmails,

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshdesk-create-ticket",
55
name: "Create a Ticket",
66
description: "Create a ticket. [See the documentation](https://developers.freshdesk.com/api/#create_ticket)",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
type: "action",
99
props: {
1010
freshdesk,
@@ -22,32 +22,24 @@ export default {
2222
companyId,
2323
}),
2424
],
25-
optional: true,
2625
},
2726
priority: {
2827
propDefinition: [
2928
freshdesk,
3029
"ticketPriority",
3130
],
3231
default: 1,
32+
optional: true,
3333
},
3434
subject: {
3535
type: "string",
3636
label: "Subject",
3737
description: "Subject of the ticket",
38-
optional: true,
3938
},
4039
description: {
4140
type: "string",
4241
label: "Description",
4342
description: "HTML content of the ticket",
44-
optional: true,
45-
},
46-
descriptionText: {
47-
type: "string",
48-
label: "Description text",
49-
description: "Content of the ticket in plain text",
50-
optional: true,
5143
},
5244
phone: {
5345
type: "string",
@@ -66,13 +58,12 @@ export default {
6658
},
6759
async run({ $ }) {
6860
const {
69-
freshdesk, companyId, descriptionText, ...data
61+
freshdesk, companyId, ...data
7062
} = this;
7163
const response = await freshdesk.createTicket({
7264
$,
7365
data: {
7466
company_id: Number(companyId),
75-
description_text: descriptionText,
7667
...data,
7768
},
7869
});

components/freshdesk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/freshdesk",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Pipedream Freshdesk Components",
55
"main": "freshdesk.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)