Skip to content

Commit e7b4610

Browse files
18952 action expand messaging functionality for dixa (#18975)
* Enhance Dixa component with new actions and version updates - Added `getArticle` and `getArticleTranslations` actions to retrieve articles and their translations from Dixa. - Updated version numbers for existing actions to 0.0.3. - Incremented package version to 0.2.0 and updated dependency for `@pipedream/platform` to ^3.1.0. - Updated source components' versions to 0.0.2 for consistency. * pnpm update * Enhance Dixa component with new messaging functionalities and version updates - Added new actions: listMessages, listNotes, createNote, getConversation, claimConversation, and closeConversation to manage conversations effectively. - Introduced new action files for claimConversation and closeConversation. - Updated existing action versions for add-message, create-conversation, and set-custom-contact-attributes. - Bumped package version to 0.3.0 for the Dixa component. * pnpm update * Add close conversation action for Dixa - Introduced a new action `dixa-close-conversation` to mark conversations as closed by providing the conversation ID. - Added props for `endUserId`, `conversationId`, and an optional `agentId` to facilitate the action. - Included documentation link for reference. * Update components/dixa/actions/claim-conversation/claim-conversation.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/dixa/actions/get-conversation/get-conversation.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/dixa/actions/list-messages/list-messages.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update components/dixa/actions/list-notes/list-notes.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 13c885a commit e7b4610

File tree

33 files changed

+836
-506
lines changed

33 files changed

+836
-506
lines changed

components/dixa/actions/add-message/add-message.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "dixa-add-message",
55
name: "Add Message to Conversation",
66
description: "Adds a message to an existing conversation. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/postConversationsConversationidMessages).",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,
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+
3+
export default {
4+
key: "dixa-claim-conversation",
5+
name: "Claim Conversation",
6+
description: "Claims a conversation for a given agent. To avoid taking over assigned conversations, set the force parameter to false. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/putConversationsConversationidClaim)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: false,
12+
},
13+
type: "action",
14+
props: {
15+
dixa,
16+
endUserId: {
17+
propDefinition: [
18+
dixa,
19+
"endUserId",
20+
],
21+
},
22+
conversationId: {
23+
propDefinition: [
24+
dixa,
25+
"conversationId",
26+
({ endUserId }) => ({
27+
endUserId,
28+
}),
29+
],
30+
},
31+
agentId: {
32+
propDefinition: [
33+
dixa,
34+
"agentId",
35+
],
36+
hidden: false,
37+
description: "The ID of the agent who is claiming the conversation.",
38+
},
39+
force: {
40+
type: "boolean",
41+
label: "Force",
42+
description: "Set as false to avoid taking over the conversation if it is already assigned to an agent.",
43+
default: false,
44+
},
45+
},
46+
async run({ $ }) {
47+
const response = await this.dixa.claimConversation({
48+
$,
49+
conversationId: this.conversationId,
50+
data: {
51+
agentId: this.agentId,
52+
force: this.force,
53+
},
54+
});
55+
$.export("$summary", `Successfully claimed conversation ${this.conversationId} for agent ${this.agentId}`);
56+
return response;
57+
},
58+
};
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import dixa from "../../dixa.app.mjs";
2+
3+
export default {
4+
key: "dixa-close-conversation",
5+
name: "Close Conversation",
6+
description: "Mark a conversation as closed by providing its id. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/putConversationsConversationidClose)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: false,
12+
},
13+
type: "action",
14+
props: {
15+
dixa,
16+
endUserId: {
17+
propDefinition: [
18+
dixa,
19+
"endUserId",
20+
],
21+
},
22+
conversationId: {
23+
propDefinition: [
24+
dixa,
25+
"conversationId",
26+
({ endUserId }) => ({
27+
endUserId,
28+
}),
29+
],
30+
},
31+
agentId: {
32+
propDefinition: [
33+
dixa,
34+
"agentId",
35+
],
36+
hidden: false,
37+
description: "An optional agent/admin to close the conversation.",
38+
optional: true,
39+
},
40+
},
41+
async run({ $ }) {
42+
const response = await this.dixa.closeConversation({
43+
$,
44+
conversationId: this.conversationId,
45+
data: {
46+
agentId: this.agentId,
47+
},
48+
});
49+
$.export("$summary", `Successfully closed conversation ${this.conversationId}`);
50+
return response;
51+
},
52+
};

components/dixa/actions/create-conversation/create-conversation.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "dixa-create-conversation",
55
name: "Create Conversation",
66
description: "Creates a new email or contact form-based conversation. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/postConversations).",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import dixa from "../../dixa.app.mjs";
2+
3+
export default {
4+
key: "dixa-create-note",
5+
name: "Create Note",
6+
description: "Creates an internal note for a conversation. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/postConversationsConversationidNotes).",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: false,
12+
},
13+
type: "action",
14+
props: {
15+
dixa,
16+
endUserId: {
17+
propDefinition: [
18+
dixa,
19+
"endUserId",
20+
],
21+
},
22+
conversationId: {
23+
propDefinition: [
24+
dixa,
25+
"conversationId",
26+
({ endUserId }) => ({
27+
endUserId,
28+
}),
29+
],
30+
},
31+
message: {
32+
type: "string",
33+
label: "Message",
34+
description: "The message to create the note for.",
35+
},
36+
},
37+
async run({ $ }) {
38+
const response = await this.dixa.createNote({
39+
$,
40+
conversationId: this.conversationId,
41+
data: {
42+
message: this.message,
43+
},
44+
});
45+
$.export("$summary", `Successfully created note with ID ${response.data.id}`);
46+
return response;
47+
},
48+
};

components/dixa/actions/get-article-translations/get-article-translations.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "dixa-get-article-translations",
55
name: "Get Article Translations",
66
description: "Get the translations of an article from Dixa. [See the documentation](https://docs.dixa.io/openapi/dixa-api/beta/tag/Knowledge/#tag/Knowledge/operation/getKnowledgeArticlesArticleidTranslations)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
annotations: {
1010
destructiveHint: false,

components/dixa/actions/get-article/get-article.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "dixa-get-article",
55
name: "Get Article",
66
description: "Get an article from Dixa. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Knowledge/#tag/Knowledge/operation/getKnowledgeArticlesArticleid)",
7-
version: "0.0.1",
7+
version: "0.0.2",
88
type: "action",
99
annotations: {
1010
destructiveHint: false,
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import dixa from "../../dixa.app.mjs";
2+
3+
export default {
4+
key: "dixa-get-conversation",
5+
name: "Get Conversation",
6+
description: "Gets a conversation. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/getConversationsConversationid)",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
dixa,
16+
endUserId: {
17+
propDefinition: [
18+
dixa,
19+
"endUserId",
20+
],
21+
},
22+
conversationId: {
23+
propDefinition: [
24+
dixa,
25+
"conversationId",
26+
({ endUserId }) => ({
27+
endUserId,
28+
}),
29+
],
30+
},
31+
},
32+
async run({ $ }) {
33+
const response = await this.dixa.getConversation({
34+
$,
35+
conversationId: this.conversationId,
36+
});
37+
$.export("$summary", `Successfully retrieved conversation ${this.conversationId}`);
38+
return response;
39+
},
40+
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import dixa from "../../dixa.app.mjs";
2+
3+
export default {
4+
key: "dixa-list-messages",
5+
name: "List Messages",
6+
description: "Lists messages from a conversation. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/getConversationsConversationidMessages).",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
dixa,
16+
endUserId: {
17+
propDefinition: [
18+
dixa,
19+
"endUserId",
20+
],
21+
},
22+
conversationId: {
23+
propDefinition: [
24+
dixa,
25+
"conversationId",
26+
({ endUserId }) => ({
27+
endUserId,
28+
}),
29+
],
30+
},
31+
},
32+
async run({ $ }) {
33+
const response = await this.dixa.listMessages({
34+
$,
35+
conversationId: this.conversationId,
36+
});
37+
$.export("$summary", `Successfully retrieved ${response.data.length} message(s) from conversation ${this.conversationId}`);
38+
return response;
39+
},
40+
};
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import dixa from "../../dixa.app.mjs";
2+
3+
export default {
4+
key: "dixa-list-notes",
5+
name: "List Notes",
6+
description: "Lists internal notes from a conversation. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/getConversationsConversationidNotes).",
7+
version: "0.0.1",
8+
annotations: {
9+
destructiveHint: false,
10+
openWorldHint: true,
11+
readOnlyHint: true,
12+
},
13+
type: "action",
14+
props: {
15+
dixa,
16+
endUserId: {
17+
propDefinition: [
18+
dixa,
19+
"endUserId",
20+
],
21+
},
22+
conversationId: {
23+
propDefinition: [
24+
dixa,
25+
"conversationId",
26+
({ endUserId }) => ({
27+
endUserId,
28+
}),
29+
],
30+
},
31+
},
32+
async run({ $ }) {
33+
const response = await this.dixa.listNotes({
34+
$,
35+
conversationId: this.conversationId,
36+
});
37+
$.export("$summary", `Successfully retrieved ${response.data.length} note(s) from conversation ${this.conversationId}`);
38+
return response;
39+
},
40+
};

0 commit comments

Comments
 (0)