Skip to content

Commit 97cad93

Browse files
authored
Merge branch 'master' into issue-13445
2 parents 0c9339d + f62a55f commit 97cad93

File tree

55 files changed

+3357
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3357
-235
lines changed

components/basecamp/sources/new-to-do-item-created/new-to-do-item-created.mjs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "basecamp-new-to-do-item-created",
66
name: "New To-Do Item Created (Instant)",
77
description: "Emit new event when a to-do item is created. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/webhooks.md#webhooks)",
8-
version: "0.0.8",
8+
version: "0.1.0",
99
dedupe: "unique",
1010
type: "source",
1111
methods: {
@@ -20,5 +20,20 @@ export default {
2020
"todo_created",
2121
];
2222
},
23+
async getEventData(data) {
24+
return data;
25+
},
26+
},
27+
async run({ body }) {
28+
if (this.filterEvent(body)) {
29+
const {
30+
accountId, projectId,
31+
} = this;
32+
body.recording = await this.app.makeRequest({
33+
accountId,
34+
path: `/buckets/${projectId}/todos/${body.recording.id}.json`,
35+
});
36+
this.emitEvent(body);
37+
}
2338
},
2439
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "botsonic",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/botsonic/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/botsonic",
3+
"version": "0.0.1",
4+
"description": "Pipedream Botsonic Components",
5+
"main": "botsonic.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"botsonic"
9+
],
10+
"homepage": "https://pipedream.com/apps/botsonic",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}
Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,34 @@
1-
import { removeNullEntries } from "../../common/utils.mjs";
21
import freshdesk from "../../freshdesk.app.mjs";
32

43
export default {
54
key: "freshdesk-create-company",
65
name: "Create a Company",
7-
description: "Create a company. [See docs here](https://developers.freshdesk.com/api/#companies)",
8-
version: "0.0.1",
6+
description: "Create a company. [See the documentation](https://developers.freshdesk.com/api/#create_company)",
7+
version: "0.0.2",
98
type: "action",
109
props: {
1110
freshdesk,
1211
name: {
1312
type: "string",
1413
label: "Name",
15-
description: "Name of the company.",
14+
description: "Name of the company",
1615
},
1716
description: {
1817
type: "string",
1918
label: "Description",
20-
description: "Description of the company.",
19+
description: "Description of the company",
2120
optional: true,
2221
},
2322
note: {
2423
type: "string",
2524
label: "Note",
26-
description: "Any specific note about the company.",
25+
description: "Any specific note about the company",
2726
optional: true,
2827
},
2928
industry: {
3029
type: "string",
3130
label: "Industry",
32-
description: "The industry the company serves in.",
31+
description: "The industry the company serves in",
3332
optional: true,
3433
},
3534
domains: {
@@ -40,18 +39,14 @@ export default {
4039
},
4140
},
4241
async run({ $ }) {
43-
const payload = removeNullEntries({
44-
name: this.name,
45-
domains: this.domains,
46-
note: this.note,
47-
industry: this.industry,
48-
description: this.description,
49-
});
50-
const response = await this.freshdesk.createCompany({
42+
const {
43+
freshdesk, ...data
44+
} = this;
45+
const response = await freshdesk.createCompany({
5146
$,
52-
payload,
47+
data,
5348
});
54-
response && $.export("$summary", "Company sucessfully created");
49+
response && $.export("$summary", "Company successfully created");
5550
return response;
5651
},
5752
};

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

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { removeNullEntries } from "../../common/utils.mjs";
21
import freshdesk from "../../freshdesk.app.mjs";
32

43
export default {
54
key: "freshdesk-create-contact",
65
name: "Create a Contact",
7-
description: "Create a contact. [See docs here](https://developers.freshdesk.com/api/#create_contact)",
8-
version: "0.0.1",
6+
description: "Create a contact. [See the documentation](https://developers.freshdesk.com/api/#create_contact)",
7+
version: "0.0.2",
98
type: "action",
109
props: {
1110
freshdesk,
@@ -16,20 +15,20 @@ export default {
1615
},
1716
email: {
1817
type: "string",
19-
label: "Email",
20-
description: "Primary email address of the contact. If you want to associate additional email(s) with this contact, use the other_emails attribute.",
18+
label: "Email Address",
19+
description: "Primary email address of the contact",
2120
optional: true,
2221
},
2322
otherEmails: {
2423
type: "string[]",
25-
label: "Additional email addresses",
26-
description: "String array of additional email addresses.",
24+
label: "Additional Email Addresses",
25+
description: "One or more additional email addresses for the contact",
2726
optional: true,
2827
},
2928
phone: {
3029
type: "string",
31-
label: "Phone number",
32-
description: "Telephone number of the contact.",
30+
label: "Phone Number",
31+
description: "Phone number of the contact",
3332
optional: true,
3433
},
3534
companyId: {
@@ -41,16 +40,16 @@ export default {
4140
},
4241
},
4342
async run({ $ }) {
44-
const data = removeNullEntries({
45-
name: this.name,
46-
email: this.email,
47-
other_emails: this.otherEmails,
48-
phone: this.phone,
49-
company_id: this.companyId && Number(this.companyId),
50-
});
43+
const {
44+
companyId, otherEmails, ...data
45+
} = this;
5146
const response = await this.freshdesk.createContact({
5247
$,
53-
data,
48+
data: {
49+
other_emails: otherEmails,
50+
company_id: companyId && Number(companyId),
51+
...data,
52+
},
5453
});
5554
response && $.export("$summary", "Contact successfully created");
5655
return response;

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

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import freshdesk from "../../freshdesk.app.mjs";
2-
import { removeNullEntries } from "../../common/utils.mjs";
32

43
export default {
54
key: "freshdesk-create-ticket",
65
name: "Create a Ticket",
7-
description: "Create a ticket. [See docs here](https://developers.freshdesk.com/api/#tickets)",
8-
version: "0.0.2",
6+
description: "Create a ticket. [See the documentation](https://developers.freshdesk.com/api/#create_ticket)",
7+
version: "0.0.3",
98
type: "action",
109
props: {
1110
freshdesk,
@@ -14,7 +13,6 @@ export default {
1413
freshdesk,
1514
"companyId",
1615
],
17-
description: "ID of the company to which this ticket belongs",
1816
},
1917
email: {
2018
propDefinition: [
@@ -24,7 +22,6 @@ export default {
2422
companyId,
2523
}),
2624
],
27-
description: "Email address of the requester.",
2825
optional: true,
2926
},
3027
priority: {
@@ -34,28 +31,28 @@ export default {
3431
],
3532
default: 1,
3633
},
34+
subject: {
35+
type: "string",
36+
label: "Subject",
37+
description: "Subject of the ticket",
38+
optional: true,
39+
},
3740
description: {
3841
type: "string",
3942
label: "Description",
40-
description: "HTML content of the ticket.",
43+
description: "HTML content of the ticket",
4144
optional: true,
4245
},
4346
descriptionText: {
4447
type: "string",
4548
label: "Description text",
46-
description: "Content of the ticket in plain text.",
49+
description: "Content of the ticket in plain text",
4750
optional: true,
4851
},
4952
phone: {
5053
type: "string",
5154
label: "Phone number",
52-
description: "Telephone number of the contact.",
53-
optional: true,
54-
},
55-
subject: {
56-
type: "string",
57-
label: "Subject",
58-
description: "Subject of the ticket.",
55+
description: "Phone number of the requester. If no contact exists with this phone number on Freshdesk, it will be added as a new contact",
5956
optional: true,
6057
},
6158
status: {
@@ -68,19 +65,16 @@ export default {
6865
},
6966
},
7067
async run({ $ }) {
71-
const data = removeNullEntries({
72-
company_id: this.companyId && Number(this.companyId),
73-
description: this.description,
74-
description_text: this.descriptionText,
75-
email: this.email,
76-
phone: this.phone,
77-
subject: this.subject,
78-
status: this.status && Number(this.status),
79-
priority: this.priority && Number(this.priority),
80-
});
81-
const response = await this.freshdesk.createTicket({
68+
const {
69+
freshdesk, companyId, descriptionText, ...data
70+
} = this;
71+
const response = await freshdesk.createTicket({
8272
$,
83-
data,
73+
data: {
74+
company_id: Number(companyId),
75+
description_text: descriptionText,
76+
...data,
77+
},
8478
});
8579
response && $.export("$summary", "Ticket successfully created");
8680
return response;

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,27 @@ import freshdesk from "../../freshdesk.app.mjs";
33
export default {
44
key: "freshdesk-get-ticket",
55
name: "Get Ticket Details",
6-
description: "Get a Ticket. [See docs here](https://developers.freshdesk.com/api/#tickets)",
7-
version: "0.0.1",
6+
description: "Get details of a Ticket. [See the documentation](https://developers.freshdesk.com/api/#view_a_ticket)",
7+
version: "0.1.0",
88
type: "action",
99
props: {
1010
freshdesk,
11-
id: {
12-
type: "string",
13-
label: "Ticket ID",
14-
description: "Ticket ID.",
11+
ticketId: {
12+
propDefinition: [
13+
freshdesk,
14+
"ticketId",
15+
],
1516
},
1617
},
1718
async run({ $ }) {
18-
const response = await this.freshdesk.getTicket({
19+
const {
20+
freshdesk, ticketId,
21+
} = this;
22+
const response = await freshdesk.getTicket({
1923
$,
20-
id: this.id,
24+
ticketId,
2125
});
22-
response && $.export("$summary", "Successfully found ticket");
26+
response && $.export("$summary", "Successfully retrieved ticket");
2327
return response;
2428
},
2529
};

0 commit comments

Comments
 (0)