@acorex-platform/module-conversation-client 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/fesm2022/acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-DsjrXRZ6.mjs +12766 -0
  2. package/fesm2022/acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-DsjrXRZ6.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-conversation-client-after-message-sent.command-D-DZ9ylV.mjs +35 -0
  4. package/fesm2022/acorex-platform-module-conversation-client-after-message-sent.command-D-DZ9ylV.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-BfjJCQ-e.mjs +492 -0
  6. package/fesm2022/acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-BfjJCQ-e.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-conversation-client-assist-tool-detail-popup.component-GC58B_n0.mjs +120 -0
  8. package/fesm2022/acorex-platform-module-conversation-client-assist-tool-detail-popup.component-GC58B_n0.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-module-conversation-client-chat-call-session-page.component-DkX4JSbN.mjs +871 -0
  10. package/fesm2022/acorex-platform-module-conversation-client-chat-call-session-page.component-DkX4JSbN.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-module-conversation-client-chat-call-start-popup.component-D4go5xbr.mjs +89 -0
  12. package/fesm2022/acorex-platform-module-conversation-client-chat-call-start-popup.component-D4go5xbr.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-module-conversation-client-chat-conversation-info-media-view.component-BVJdVPke.mjs +108 -0
  14. package/fesm2022/acorex-platform-module-conversation-client-chat-conversation-info-media-view.component-BVJdVPke.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-module-conversation-client-comments-page.component-Bq4SdK0_.mjs +83 -0
  16. package/fesm2022/acorex-platform-module-conversation-client-comments-page.component-Bq4SdK0_.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-module-conversation-client-contracts.mjs +225 -0
  18. package/fesm2022/acorex-platform-module-conversation-client-contracts.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-module-conversation-client-emit-typing-indicator.command-BzsN1_ns.mjs +29 -0
  20. package/fesm2022/acorex-platform-module-conversation-client-emit-typing-indicator.command-BzsN1_ns.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-module-conversation-client-mark-conversation-unread.command-BlYDwGVe.mjs +30 -0
  22. package/fesm2022/acorex-platform-module-conversation-client-mark-conversation-unread.command-BlYDwGVe.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-module-conversation-client-open-chat.command-B03q60Qx.mjs +42 -0
  24. package/fesm2022/acorex-platform-module-conversation-client-open-chat.command-B03q60Qx.mjs.map +1 -0
  25. package/fesm2022/acorex-platform-module-conversation-client-retry-assist-response.command-BQLK6F69.mjs +34 -0
  26. package/fesm2022/acorex-platform-module-conversation-client-retry-assist-response.command-BQLK6F69.mjs.map +1 -0
  27. package/fesm2022/acorex-platform-module-conversation-client-start-direct-chat.command-CfSIVHDu.mjs +80 -0
  28. package/fesm2022/acorex-platform-module-conversation-client-start-direct-chat.command-CfSIVHDu.mjs.map +1 -0
  29. package/fesm2022/acorex-platform-module-conversation-client-sync-read-state.command-B1Z_gZ6O.mjs +142 -0
  30. package/fesm2022/acorex-platform-module-conversation-client-sync-read-state.command-B1Z_gZ6O.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-module-conversation-client.mjs +2 -0
  32. package/fesm2022/acorex-platform-module-conversation-client.mjs.map +1 -0
  33. package/package.json +28 -0
  34. package/types/acorex-platform-module-conversation-client-contracts.d.ts +497 -0
  35. package/types/acorex-platform-module-conversation-client.d.ts +1614 -0
@@ -0,0 +1,35 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
+ import { A as AXMConversationEntityStoreService, a as AXM_CONVERSATION_ASSIST_RESPONSE_PORT, b as AXM_CONVERSATION_REGULAR_AUTO_REPLY_PORT, c as axmConversationHasAiChat } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-DsjrXRZ6.mjs';
4
+
5
+ //#endregion
6
+ //#region ---- Command ----
7
+ class AXMConversationAfterMessageSentCommand {
8
+ constructor() {
9
+ this.store = inject(AXMConversationEntityStoreService);
10
+ this.assistResponse = inject(AXM_CONVERSATION_ASSIST_RESPONSE_PORT, { optional: true });
11
+ this.regularAutoReply = inject(AXM_CONVERSATION_REGULAR_AUTO_REPLY_PORT, { optional: true });
12
+ }
13
+ async execute(input) {
14
+ const options = input;
15
+ const cached = this.store.getCachedConversation(options.conversationId);
16
+ const conversation = cached ?? (await this.store.getConversation(options.conversationId));
17
+ const isAssist = axmConversationHasAiChat(conversation?.metadata);
18
+ if (isAssist && this.assistResponse) {
19
+ await this.assistResponse.handleAfterUserMessage(options.conversationId, options.messageId, options.command, options.currentUserId);
20
+ }
21
+ else if (!isAssist && this.regularAutoReply) {
22
+ await this.regularAutoReply.maybeGenerate(options.command, options.messageId, options.currentUserId);
23
+ }
24
+ return { success: true, kind: 'object', data: undefined };
25
+ }
26
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMConversationAfterMessageSentCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
27
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMConversationAfterMessageSentCommand, providedIn: 'root' }); }
28
+ }
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMConversationAfterMessageSentCommand, decorators: [{
30
+ type: Injectable,
31
+ args: [{ providedIn: 'root' }]
32
+ }] });
33
+
34
+ export { AXMConversationAfterMessageSentCommand };
35
+ //# sourceMappingURL=acorex-platform-module-conversation-client-after-message-sent.command-D-DZ9ylV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-conversation-client-after-message-sent.command-D-DZ9ylV.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/commands/after-message-sent.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport type { AXConversationSendMessageCommand } from '@acorex/components/conversation';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { Injectable, inject } from '@angular/core';\n\nimport { AXM_CONVERSATION_ASSIST_RESPONSE_PORT } from '../chat/services/conversation-assist-response.port';\nimport { AXMConversationEntityStoreService } from '../chat/services/conversation-entity-store.service';\nimport { axmConversationHasAiChat } from '../chat/plugins/utils/assist-metadata.util';\nimport { AXM_CONVERSATION_REGULAR_AUTO_REPLY_PORT } from '../chat/services/conversation-regular-auto-reply.port';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXMAfterMessageSentOptions {\n conversationId: string;\n messageId: string;\n command: AXConversationSendMessageCommand;\n currentUserId: string;\n}\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationAfterMessageSentCommand implements AXPCommand<AXMAfterMessageSentOptions, void> {\n private readonly store = inject(AXMConversationEntityStoreService);\n private readonly assistResponse = inject(AXM_CONVERSATION_ASSIST_RESPONSE_PORT, { optional: true });\n private readonly regularAutoReply = inject(AXM_CONVERSATION_REGULAR_AUTO_REPLY_PORT, { optional: true });\n\n async execute(input: AXMAfterMessageSentOptions | unknown): AXPCommandExecuteResultPromise<void> {\n const options = input as AXMAfterMessageSentOptions;\n\n const cached = this.store.getCachedConversation(options.conversationId);\n const conversation = cached ?? (await this.store.getConversation(options.conversationId));\n const isAssist = axmConversationHasAiChat(conversation?.metadata as Record<string, unknown>);\n\n if (isAssist && this.assistResponse) {\n await this.assistResponse.handleAfterUserMessage(\n options.conversationId,\n options.messageId,\n options.command,\n options.currentUserId,\n );\n } else if (!isAssist && this.regularAutoReply) {\n await this.regularAutoReply.maybeGenerate(options.command, options.messageId, options.currentUserId);\n }\n\n return { success: true, kind: 'object', data: undefined };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAwBA;AAEA;MAGa,sCAAsC,CAAA;AADnD,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,iCAAiC,CAAC;QACjD,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,qCAAqC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAClF,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,wCAAwC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAsBzG,IAAA;IApBC,MAAM,OAAO,CAAC,KAA2C,EAAA;QACvD,MAAM,OAAO,GAAG,KAAmC;AAEnD,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,cAAc,CAAC;AACvE,QAAA,MAAM,YAAY,GAAG,MAAM,KAAK,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QACzF,MAAM,QAAQ,GAAG,wBAAwB,CAAC,YAAY,EAAE,QAAmC,CAAC;AAE5F,QAAA,IAAI,QAAQ,IAAI,IAAI,CAAC,cAAc,EAAE;YACnC,MAAM,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAC9C,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,aAAa,CACtB;QACH;AAAO,aAAA,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,gBAAgB,EAAE;AAC7C,YAAA,MAAM,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC;QACtG;AAEA,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;IAC3D;8GAxBW,sCAAsC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sCAAsC,cADzB,MAAM,EAAA,CAAA,CAAA;;2FACnB,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBADlD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}