Skip to content

Commit 9dbb4f1

Browse files
committed
dixa init
1 parent 3f3047f commit 9dbb4f1

File tree

11 files changed

+1015
-4
lines changed

11 files changed

+1015
-4
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import dixa from "../../dixa.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "dixa-add-message",
6+
name: "Add Message to Conversation",
7+
description: "Adds a message to an existing conversation. [See the documentation]().",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
dixa,
12+
conversationId: {
13+
propDefinition: [
14+
dixa,
15+
"conversationId",
16+
],
17+
},
18+
attachments: {
19+
propDefinition: [
20+
dixa,
21+
"attachments",
22+
],
23+
optional: true,
24+
},
25+
content: {
26+
propDefinition: [
27+
dixa,
28+
"content",
29+
],
30+
optional: true,
31+
},
32+
externalId: {
33+
propDefinition: [
34+
dixa,
35+
"externalId",
36+
],
37+
optional: true,
38+
},
39+
integrationEmail: {
40+
propDefinition: [
41+
dixa,
42+
"integrationEmail",
43+
],
44+
optional: true,
45+
},
46+
},
47+
async run({ $ }) {
48+
const response = await this.dixa.addMessage({
49+
conversationId: this.conversationId,
50+
attachments: this.attachments,
51+
content: this.content,
52+
externalId: this.externalId,
53+
integrationEmail: this.integrationEmail,
54+
});
55+
$.export("$summary", `Added message to conversation ${this.conversationId}`);
56+
return response;
57+
},
58+
};
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import dixa from "../../dixa.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "dixa-create-conversation",
6+
name: "Create Conversation",
7+
description: "Creates a new email or contact form-based conversation. [See the documentation](https://docs.dixa.io/openapi).",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
dixa: {
12+
type: "app",
13+
app: "dixa",
14+
},
15+
subject: {
16+
propDefinition: [
17+
"dixa",
18+
"subject",
19+
],
20+
},
21+
emailIntegrationId: {
22+
propDefinition: [
23+
"dixa",
24+
"emailIntegrationId",
25+
],
26+
},
27+
messageType: {
28+
propDefinition: [
29+
"dixa",
30+
"messageType",
31+
],
32+
},
33+
language: {
34+
propDefinition: [
35+
"dixa",
36+
"language",
37+
],
38+
optional: true,
39+
},
40+
},
41+
async run({ $ }) {
42+
const response = await this.dixa.createConversation({
43+
subject: this.subject,
44+
emailIntegrationId: this.emailIntegrationId,
45+
messageType: this.messageType,
46+
language: this.language,
47+
});
48+
$.export("$summary", `Created conversation with subject: ${response.subject} and ID: ${response.id}`);
49+
return response;
50+
},
51+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import dixa from "../../dixa.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "dixa-set-custom-contact-attributes",
6+
name: "Set Custom Contact Attributes",
7+
description: "Updates custom attributes for a specified user. [See the documentation]()",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
dixa,
12+
userId: {
13+
propDefinition: [
14+
dixa,
15+
"userId",
16+
],
17+
},
18+
attributes: {
19+
propDefinition: [
20+
dixa,
21+
"attributes",
22+
],
23+
optional: true,
24+
},
25+
},
26+
async run({ $ }) {
27+
const response = await this.dixa.updateCustomAttributes({
28+
userId: this.userId,
29+
attributes: this.attributes,
30+
});
31+
$.export("$summary", `Updated custom attributes for user ${this.userId}`);
32+
return response;
33+
},
34+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import dixa from "../../dixa.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "dixa-tag-conversation",
6+
name: "Add Tag to Conversation",
7+
description: "Adds a tag to a conversation. [See the documentation]()",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
dixa: {
12+
type: "app",
13+
app: "dixa",
14+
},
15+
conversationId: {
16+
propDefinition: [
17+
dixa,
18+
"conversationId",
19+
],
20+
},
21+
tagId: {
22+
propDefinition: [
23+
dixa,
24+
"tagId",
25+
],
26+
},
27+
},
28+
async run({ $ }) {
29+
const response = await this.dixa.addTag({
30+
conversationId: this.conversationId,
31+
tagId: this.tagId,
32+
});
33+
$.export("$summary", `Added tag ${this.tagId} to conversation ${this.conversationId}`);
34+
return response;
35+
},
36+
};

0 commit comments

Comments
 (0)