@pipedream/freshdesk 0.1.0 → 0.1.1
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.
- package/actions/create-company/create-company.mjs +1 -1
- package/actions/create-contact/create-contact.mjs +9 -3
- package/actions/create-ticket/create-ticket.mjs +3 -12
- package/actions/get-ticket/get-ticket.mjs +1 -1
- package/actions/list-all-tickets/list-all-tickets.mjs +1 -1
- package/freshdesk.app.mjs +6 -3
- package/package.json +1 -1
- package/sources/new-contact/new-contact.mjs +1 -1
- package/sources/new-ticket/new-ticket.mjs +1 -1
|
@@ -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.
|
|
7
|
+
version: "0.0.3",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
freshdesk,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import freshdesk from "../../freshdesk.app.mjs";
|
|
2
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
key: "freshdesk-create-contact",
|
|
5
6
|
name: "Create a Contact",
|
|
6
7
|
description: "Create a contact. [See the documentation](https://developers.freshdesk.com/api/#create_contact)",
|
|
7
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.3",
|
|
8
9
|
type: "action",
|
|
9
10
|
props: {
|
|
10
11
|
freshdesk,
|
|
@@ -41,9 +42,14 @@ export default {
|
|
|
41
42
|
},
|
|
42
43
|
async run({ $ }) {
|
|
43
44
|
const {
|
|
44
|
-
companyId, otherEmails, ...data
|
|
45
|
+
freshdesk, companyId, otherEmails, ...data
|
|
45
46
|
} = this;
|
|
46
|
-
|
|
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({
|
|
47
53
|
$,
|
|
48
54
|
data: {
|
|
49
55
|
other_emails: otherEmails,
|
|
@@ -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
|
+
version: "0.0.4",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
freshdesk,
|
|
@@ -22,7 +22,6 @@ export default {
|
|
|
22
22
|
companyId,
|
|
23
23
|
}),
|
|
24
24
|
],
|
|
25
|
-
optional: true,
|
|
26
25
|
},
|
|
27
26
|
priority: {
|
|
28
27
|
propDefinition: [
|
|
@@ -30,24 +29,17 @@ export default {
|
|
|
30
29
|
"ticketPriority",
|
|
31
30
|
],
|
|
32
31
|
default: 1,
|
|
32
|
+
optional: true,
|
|
33
33
|
},
|
|
34
34
|
subject: {
|
|
35
35
|
type: "string",
|
|
36
36
|
label: "Subject",
|
|
37
37
|
description: "Subject of the ticket",
|
|
38
|
-
optional: true,
|
|
39
38
|
},
|
|
40
39
|
description: {
|
|
41
40
|
type: "string",
|
|
42
41
|
label: "Description",
|
|
43
42
|
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,
|
|
51
43
|
},
|
|
52
44
|
phone: {
|
|
53
45
|
type: "string",
|
|
@@ -66,13 +58,12 @@ export default {
|
|
|
66
58
|
},
|
|
67
59
|
async run({ $ }) {
|
|
68
60
|
const {
|
|
69
|
-
freshdesk, companyId,
|
|
61
|
+
freshdesk, companyId, ...data
|
|
70
62
|
} = this;
|
|
71
63
|
const response = await freshdesk.createTicket({
|
|
72
64
|
$,
|
|
73
65
|
data: {
|
|
74
66
|
company_id: Number(companyId),
|
|
75
|
-
description_text: descriptionText,
|
|
76
67
|
...data,
|
|
77
68
|
},
|
|
78
69
|
});
|
|
@@ -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.
|
|
7
|
+
version: "0.1.1",
|
|
8
8
|
type: "action",
|
|
9
9
|
props: {
|
|
10
10
|
freshdesk,
|
|
@@ -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.
|
|
8
|
+
version: "0.2.1",
|
|
9
9
|
type: "action",
|
|
10
10
|
props: {
|
|
11
11
|
freshdesk,
|
package/freshdesk.app.mjs
CHANGED
|
@@ -58,10 +58,13 @@ export default {
|
|
|
58
58
|
label: "Email",
|
|
59
59
|
description: "Select a contact or provide a contact's email",
|
|
60
60
|
async options({ companyId }) {
|
|
61
|
-
const contacts = await this.getContacts(
|
|
62
|
-
|
|
61
|
+
const contacts = await this.getContacts({
|
|
62
|
+
params: {
|
|
63
|
+
company_id: companyId,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
63
66
|
return contacts
|
|
64
|
-
.filter((
|
|
67
|
+
.filter(({ email }) => email)
|
|
65
68
|
.map(({
|
|
66
69
|
email, name,
|
|
67
70
|
}) => ({
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "freshdesk-new-contact",
|
|
7
7
|
name: "New Contact Created",
|
|
8
8
|
description: "Emit new event when a contact is created. [See the documentation](https://developers.freshdesk.com/api/#filter_contacts)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.4",
|
|
10
10
|
type: "source",
|
|
11
11
|
props: {
|
|
12
12
|
freshdesk,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "freshdesk-new-ticket",
|
|
7
7
|
name: "New Ticket Created",
|
|
8
8
|
description: "Emit new event when a ticket is created. [See the documentation](https://developers.freshdesk.com/api/#filter_tickets)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.4",
|
|
10
10
|
type: "source",
|
|
11
11
|
props: {
|
|
12
12
|
freshdesk,
|