-
Notifications
You must be signed in to change notification settings - Fork 5.5k
18952 action expand messaging functionality for dixa #18975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
5bdc8e5
9decfc4
3f89456
ab6f35c
7bbe9d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||||
|---|---|---|---|---|---|---|
| @@ -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 paremeter to false. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/putConversationsConversationidClaim)", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo in description. The word "paremeter" should be "parameter". Apply this diff: - description: "Claims a conversation for a given agent. To avoid taking over assigned conversations, set the force paremeter to false. [See the documentation](https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversations/#tag/Conversations/operation/putConversationsConversationidClaim)",
+ 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)",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| 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; | ||||||
| }, | ||||||
| }; | ||||||
| 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 |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import dixa from "../../dixa.app.mjs"; | ||
|
|
||
| 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.2", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| dixa, | ||
| articleId: { | ||
| type: "string", | ||
| label: "Article ID", | ||
| description: "The ID of the article to get translations for", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.dixa.getArticleTranslations({ | ||
| articleId: this.articleId, | ||
| $, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved translations for article with ID ${this.articleId}`); | ||
| return response; | ||
| }, | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import dixa from "../../dixa.app.mjs"; | ||
|
|
||
| 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.2", | ||
| type: "action", | ||
| annotations: { | ||
| destructiveHint: false, | ||
| openWorldHint: true, | ||
| readOnlyHint: true, | ||
| }, | ||
| props: { | ||
| dixa, | ||
| articleId: { | ||
| type: "string", | ||
| label: "Article ID", | ||
| description: "The ID of the article to get", | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const response = await this.dixa.getArticle({ | ||
| articleId: this.articleId, | ||
| $, | ||
| }); | ||
| $.export("$summary", `Successfully retrieved article with ID ${this.articleId}`); | ||
| return response; | ||
| }, | ||
| }; |
| 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: false, | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
|
Comment on lines
+8
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set This action performs a GET operation that only retrieves data. The Apply this diff: annotations: {
destructiveHint: false,
openWorldHint: true,
- readOnlyHint: false,
+ readOnlyHint: true,
},📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| 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; | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
| 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: false, | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
|
Comment on lines
+8
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set This action performs a GET operation that only retrieves data without modifying state. The Apply this diff: annotations: {
destructiveHint: false,
openWorldHint: true,
- readOnlyHint: false,
+ readOnlyHint: true,
},📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| 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; | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
| 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: false, | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
|
Comment on lines
+8
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set This action performs a GET operation that only retrieves data without modifying state. The Apply this diff: annotations: {
destructiveHint: false,
openWorldHint: true,
- readOnlyHint: false,
+ readOnlyHint: true,
},📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| 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; | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| }; | ||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix directory name - appears to be an accidental artifact.
The file is located in a directory named "claim-conversation copy", which suggests this is an accidental copy/paste artifact. The directory should be renamed to "close-conversation" to match the action name and follow the established naming convention.
Expected path:
components/dixa/actions/close-conversation/close-conversation.mjsCurrent path:
components/dixa/actions/claim-conversation copy/close-conversation.mjsThe directory name contains a space and the word "copy", which could cause issues with:
🤖 Prompt for AI Agents