Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/dixa/actions/add-message/add-message.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "dixa-add-message",
name: "Add Message to Conversation",
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).",
version: "0.0.3",
version: "0.0.4",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
58 changes: 58 additions & 0 deletions components/dixa/actions/claim-conversation/claim-conversation.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import dixa from "../../dixa.app.mjs";

export default {
key: "dixa-claim-conversation",
name: "Claim Conversation",
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)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
dixa,
endUserId: {
propDefinition: [
dixa,
"endUserId",
],
},
conversationId: {
propDefinition: [
dixa,
"conversationId",
({ endUserId }) => ({
endUserId,
}),
],
},
agentId: {
propDefinition: [
dixa,
"agentId",
],
hidden: false,
description: "The ID of the agent who is claiming the conversation.",
},
force: {
type: "boolean",
label: "Force",
description: "Set as false to avoid taking over the conversation if it is already assigned to an agent.",
default: false,
},
},
async run({ $ }) {
const response = await this.dixa.claimConversation({
$,
conversationId: this.conversationId,
data: {
agentId: this.agentId,
force: this.force,
},
});
$.export("$summary", `Successfully claimed conversation ${this.conversationId} for agent ${this.agentId}`);
return response;
},
};
52 changes: 52 additions & 0 deletions components/dixa/actions/close-conversation/close-conversation.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import dixa from "../../dixa.app.mjs";

export default {
key: "dixa-close-conversation",
name: "Close Conversation",
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)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
dixa,
endUserId: {
propDefinition: [
dixa,
"endUserId",
],
},
conversationId: {
propDefinition: [
dixa,
"conversationId",
({ endUserId }) => ({
endUserId,
}),
],
},
agentId: {
propDefinition: [
dixa,
"agentId",
],
hidden: false,
description: "An optional agent/admin to close the conversation.",
optional: true,
},
},
async run({ $ }) {
const response = await this.dixa.closeConversation({
$,
conversationId: this.conversationId,
data: {
agentId: this.agentId,
},
});
$.export("$summary", `Successfully closed conversation ${this.conversationId}`);
return response;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "dixa-create-conversation",
name: "Create Conversation",
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).",
version: "0.0.3",
version: "0.0.4",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
48 changes: 48 additions & 0 deletions components/dixa/actions/create-note/create-note.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import dixa from "../../dixa.app.mjs";

export default {
key: "dixa-create-note",
name: "Create Note",
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).",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
dixa,
endUserId: {
propDefinition: [
dixa,
"endUserId",
],
},
conversationId: {
propDefinition: [
dixa,
"conversationId",
({ endUserId }) => ({
endUserId,
}),
],
},
message: {
type: "string",
label: "Message",
description: "The message to create the note for.",
},
},
async run({ $ }) {
const response = await this.dixa.createNote({
$,
conversationId: this.conversationId,
data: {
message: this.message,
},
});
$.export("$summary", `Successfully created note with ID ${response.data.id}`);
return response;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "dixa-get-article-translations",
name: "Get Article Translations",
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)",
version: "0.0.1",
version: "0.0.2",
type: "action",
annotations: {
destructiveHint: false,
Expand Down
2 changes: 1 addition & 1 deletion components/dixa/actions/get-article/get-article.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "dixa-get-article",
name: "Get Article",
description: "Get an article from Dixa. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Knowledge/#tag/Knowledge/operation/getKnowledgeArticlesArticleid)",
version: "0.0.1",
version: "0.0.2",
type: "action",
annotations: {
destructiveHint: false,
Expand Down
40 changes: 40 additions & 0 deletions components/dixa/actions/get-conversation/get-conversation.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import dixa from "../../dixa.app.mjs";

export default {
key: "dixa-get-conversation",
name: "Get Conversation",
description: "Gets a conversation. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/getConversationsConversationid)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
dixa,
endUserId: {
propDefinition: [
dixa,
"endUserId",
],
},
conversationId: {
propDefinition: [
dixa,
"conversationId",
({ endUserId }) => ({
endUserId,
}),
],
},
},
async run({ $ }) {
const response = await this.dixa.getConversation({
$,
conversationId: this.conversationId,
});
$.export("$summary", `Successfully retrieved conversation ${this.conversationId}`);
return response;
},
};
40 changes: 40 additions & 0 deletions components/dixa/actions/list-messages/list-messages.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import dixa from "../../dixa.app.mjs";

export default {
key: "dixa-list-messages",
name: "List Messages",
description: "Lists messages from a conversation. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/getConversationsConversationidMessages).",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
dixa,
endUserId: {
propDefinition: [
dixa,
"endUserId",
],
},
conversationId: {
propDefinition: [
dixa,
"conversationId",
({ endUserId }) => ({
endUserId,
}),
],
},
},
async run({ $ }) {
const response = await this.dixa.listMessages({
$,
conversationId: this.conversationId,
});
$.export("$summary", `Successfully retrieved ${response.data.length} message(s) from conversation ${this.conversationId}`);
return response;
},
};
40 changes: 40 additions & 0 deletions components/dixa/actions/list-notes/list-notes.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import dixa from "../../dixa.app.mjs";

export default {
key: "dixa-list-notes",
name: "List Notes",
description: "Lists internal notes from a conversation. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/getConversationsConversationidNotes).",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
dixa,
endUserId: {
propDefinition: [
dixa,
"endUserId",
],
},
conversationId: {
propDefinition: [
dixa,
"conversationId",
({ endUserId }) => ({
endUserId,
}),
],
},
},
async run({ $ }) {
const response = await this.dixa.listNotes({
$,
conversationId: this.conversationId,
});
$.export("$summary", `Successfully retrieved ${response.data.length} note(s) from conversation ${this.conversationId}`);
return response;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "dixa-set-custom-contact-attributes",
name: "Set Custom Contact Attributes",
description: "Updates custom attributes for a specified user. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Custom-Attributes/#tag/Custom-Attributes/operation/patchEndusersUseridCustom-attributes)",
version: "0.0.3",
version: "0.0.4",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "dixa-tag-conversation",
name: "Add Tag to Conversation",
description: "Adds a tag to a conversation. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Tags/#tag/Tags/operation/putConversationsConversationidTagsTagid)",
version: "0.0.3",
version: "0.0.4",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
51 changes: 51 additions & 0 deletions components/dixa/dixa.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,56 @@ export default {
...opts,
});
},
listMessages({
conversationId, ...opts
}) {
return this._makeRequest({
path: `/conversations/${conversationId}/messages`,
...opts,
});
},
listNotes({
conversationId, ...opts
}) {
return this._makeRequest({
path: `/conversations/${conversationId}/notes`,
...opts,
});
},
createNote({
conversationId, ...opts
}) {
return this._makeRequest({
method: "POST",
path: `/conversations/${conversationId}/notes`,
...opts,
});
},
getConversation({
conversationId, ...opts
}) {
return this._makeRequest({
path: `/conversations/${conversationId}`,
...opts,
});
},
claimConversation({
conversationId, ...opts
}) {
return this._makeRequest({
method: "PUT",
path: `/conversations/${conversationId}/claim`,
...opts,
});
},
closeConversation({
conversationId, ...opts
}) {
return this._makeRequest({
method: "PUT",
path: `/conversations/${conversationId}/close`,
...opts,
});
},
},
};
Loading
Loading