Skip to content

Commit 6a50acb

Browse files
authored
Merge branch 'master' into issue-12525
2 parents 482f877 + 65e79d1 commit 6a50acb

File tree

247 files changed

+2539
-644
lines changed

Some content is hidden

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

247 files changed

+2539
-644
lines changed
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: "ai_chatbot_hub",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/ai_chatbot_hub",
3+
"version": "0.0.1",
4+
"description": "Pipedream AI Chatbot Hub Components",
5+
"main": "ai_chatbot_hub.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"ai_chatbot_hub"
9+
],
10+
"homepage": "https://pipedream.com/apps/ai_chatbot_hub",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import cogmento from "../../cogmento.app.mjs";
2+
3+
export default {
4+
key: "cogmento-create-contact",
5+
name: "Create Contact",
6+
description: "Create a new contact in Cogmento CRM. [See the documentation](https://api.cogmento.com/static/swagger/index.html#/Contacts/post_contacts_)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
cogmento,
11+
firstName: {
12+
type: "string",
13+
label: "First Name",
14+
description: "First name of the contact",
15+
},
16+
lastName: {
17+
type: "string",
18+
label: "Last Name",
19+
description: "Last name of the contact",
20+
},
21+
email: {
22+
type: "string",
23+
label: "Email",
24+
description: "Email address of the contact",
25+
optional: true,
26+
},
27+
phone: {
28+
type: "string",
29+
label: "Phone",
30+
description: "Phone number of the contact",
31+
optional: true,
32+
},
33+
description: {
34+
type: "string",
35+
label: "Description",
36+
description: "Description of the contact",
37+
optional: true,
38+
},
39+
tags: {
40+
type: "string[]",
41+
label: "Tags",
42+
description: "Array of tags associated with the contact",
43+
optional: true,
44+
},
45+
doNotCall: {
46+
type: "boolean",
47+
label: "Do Not Call",
48+
description: "Set to `true` to mark the contact as Do Not Call",
49+
optional: true,
50+
},
51+
doNotText: {
52+
type: "boolean",
53+
label: "Do Not Text",
54+
description: "Set to `true` to mark the contact as Do Not Text",
55+
optional: true,
56+
},
57+
doNotEmail: {
58+
type: "boolean",
59+
label: "Do Not Email",
60+
description: "Set to `true` to mark the contact as Do Not Email",
61+
optional: true,
62+
},
63+
},
64+
async run({ $ }) {
65+
const channels = [];
66+
if (this.email) {
67+
channels.push({
68+
channel_type: "Email",
69+
value: this.email,
70+
});
71+
}
72+
if (this.phone) {
73+
channels.push({
74+
channel_type: "Phone",
75+
value: this.phone,
76+
});
77+
}
78+
79+
const response = await this.cogmento.createContact({
80+
$,
81+
data: {
82+
first_name: this.firstName,
83+
last_name: this.lastName,
84+
channels,
85+
description: this.description,
86+
tags: this.tags,
87+
do_not_call: this.doNotCall,
88+
do_not_text: this.doNotText,
89+
do_not_email: this.doNotEmail,
90+
},
91+
});
92+
$.export("$summary", `Successfully created contact: ${this.firstName} ${this.lastName}`);
93+
return response;
94+
},
95+
};
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import cogmento from "../../cogmento.app.mjs";
2+
3+
export default {
4+
key: "cogmento-create-deal",
5+
name: "Create Deal",
6+
description: "Create a new deal in Cogmento CRM. [See the documentation](https://api.cogmento.com/static/swagger/index.html#/Deals/post_deals_)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
cogmento,
11+
title: {
12+
type: "string",
13+
label: "Title",
14+
description: "The title of the deal",
15+
},
16+
description: {
17+
type: "string",
18+
label: "Description",
19+
description: "A description of the deal",
20+
optional: true,
21+
},
22+
assigneeIds: {
23+
propDefinition: [
24+
cogmento,
25+
"userIds",
26+
],
27+
optional: true,
28+
},
29+
tags: {
30+
type: "string[]",
31+
label: "Tags",
32+
description: "Array of tags associated with the deal",
33+
optional: true,
34+
},
35+
closeDate: {
36+
type: "string",
37+
label: "Close Date",
38+
description: "The date the deal was completed (format: YYYY-MM-DD)",
39+
optional: true,
40+
},
41+
productIds: {
42+
propDefinition: [
43+
cogmento,
44+
"productIds",
45+
],
46+
optional: true,
47+
},
48+
amount: {
49+
type: "string",
50+
label: "Amount",
51+
description: "The final deal value",
52+
optional: true,
53+
},
54+
},
55+
async run({ $ }) {
56+
const response = await this.cogmento.createDeal({
57+
$,
58+
data: {
59+
title: this.title,
60+
description: this.description,
61+
assigned_to: this.assigneeIds?.map((id) => ({
62+
id,
63+
})) || undefined,
64+
tags: this.tags,
65+
close_date: this.closeDate,
66+
products: this.productIds?.map((id) => ({
67+
id,
68+
})) || undefined,
69+
amount: this.amount && +this.amount,
70+
},
71+
});
72+
$.export("$summary", `Successfully created deal: ${this.title}`);
73+
return response;
74+
},
75+
};
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import cogmento from "../../cogmento.app.mjs";
2+
3+
export default {
4+
key: "cogmento-create-task",
5+
name: "Create Task",
6+
description: "Create a new task in Cogmento CRM. [See the documentation](https://api.cogmento.com/static/swagger/index.html#/Tasks/post_tasks_)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
cogmento,
11+
title: {
12+
type: "string",
13+
label: "Title",
14+
description: "The title of the task",
15+
},
16+
description: {
17+
type: "string",
18+
label: "Description",
19+
description: "A description of the task",
20+
optional: true,
21+
},
22+
dueDate: {
23+
type: "string",
24+
label: "Due Date",
25+
description: "The task's deadline(format: YYYY-MM-DD)",
26+
optional: true,
27+
},
28+
assigneeIds: {
29+
propDefinition: [
30+
cogmento,
31+
"userIds",
32+
],
33+
description: "An array of user IDs to assign to the task",
34+
optional: true,
35+
},
36+
dealId: {
37+
propDefinition: [
38+
cogmento,
39+
"dealId",
40+
],
41+
optional: true,
42+
},
43+
contactId: {
44+
propDefinition: [
45+
cogmento,
46+
"contactId",
47+
],
48+
optional: true,
49+
},
50+
},
51+
async run({ $ }) {
52+
const response = await this.cogmento.createTask({
53+
$,
54+
data: {
55+
title: this.title,
56+
description: this.description,
57+
due_date: this.dueDate,
58+
assigned_to: this.assigneeIds?.map((id) => ({
59+
id,
60+
})) || undefined,
61+
deal: this.dealId && {
62+
id: this.dealId,
63+
},
64+
contact: this.contactId && {
65+
id: this.contactId,
66+
},
67+
},
68+
});
69+
$.export("$summary", `Successfully created task: ${this.title}`);
70+
return response;
71+
},
72+
};

0 commit comments

Comments
 (0)