@acorex-platform/module-conversation-client 0.0.33 → 0.0.38
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.
- package/fesm2022/{acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-CDlDFzbl.mjs → acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-XTzQQhii.mjs} +745 -215
- package/fesm2022/acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-XTzQQhii.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-conversation-client-after-message-sent.command-yzW01skh.mjs → acorex-platform-module-conversation-client-after-message-sent.command-BMGagKtP.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-after-message-sent.command-yzW01skh.mjs.map → acorex-platform-module-conversation-client-after-message-sent.command-BMGagKtP.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-DhRvuCex.mjs → acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-D1SDsHvl.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-DhRvuCex.mjs.map → acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-D1SDsHvl.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-assist-tool-detail-popup.component-BRW1cHN6.mjs → acorex-platform-module-conversation-client-assist-tool-detail-popup.component-BV1YH96m.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-assist-tool-detail-popup.component-BRW1cHN6.mjs.map → acorex-platform-module-conversation-client-assist-tool-detail-popup.component-BV1YH96m.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-session-page.component-nE7xP4bF.mjs +1607 -0
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-session-page.component-nE7xP4bF.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-start-popup.component-DXkqkS50.mjs +92 -0
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-start-popup.component-DXkqkS50.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-conversation-client-chat-conversation-info-media-view.component-CppNPfqe.mjs → acorex-platform-module-conversation-client-chat-conversation-info-media-view.component-SYCtAqcV.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-chat-conversation-info-media-view.component-CppNPfqe.mjs.map → acorex-platform-module-conversation-client-chat-conversation-info-media-view.component-SYCtAqcV.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-chat-conversation-info-panel.component-BBL8iEqc.mjs → acorex-platform-module-conversation-client-chat-conversation-info-panel.component-51PtojIM.mjs} +14 -4
- package/fesm2022/acorex-platform-module-conversation-client-chat-conversation-info-panel.component-51PtojIM.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-conversation-client-comments-page.component-Djn8EikR.mjs → acorex-platform-module-conversation-client-comments-page.component-Dv_x3ztZ.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-comments-page.component-Djn8EikR.mjs.map → acorex-platform-module-conversation-client-comments-page.component-Dv_x3ztZ.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-contracts-entities-message.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-contracts-entities-room.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-contracts-entity-catalog-acorex-platform-module-conversation-client-contracts-entity-catalog-Cy3LwYMZ.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-contracts-entity-catalog-message.entity-Dz7cO1P4.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-contracts-entity-catalog-room.entity-B9txvc3y.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-contracts.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-emit-typing-indicator.command-BzsN1_ns.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-local-entities.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-mark-conversation-unread.command-BoTNaBxS.mjs → acorex-platform-module-conversation-client-mark-conversation-unread.command-8NoSuUwe.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-mark-conversation-unread.command-BoTNaBxS.mjs.map → acorex-platform-module-conversation-client-mark-conversation-unread.command-8NoSuUwe.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-open-chat.command-VgeGqj-z.mjs → acorex-platform-module-conversation-client-open-chat.command-BgJ0Z36e.mjs} +5 -5
- package/fesm2022/acorex-platform-module-conversation-client-open-chat.command-BgJ0Z36e.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-conversation-client-retry-assist-response.command-DYIpLKDB.mjs → acorex-platform-module-conversation-client-retry-assist-response.command-lcNz4Hpu.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-retry-assist-response.command-DYIpLKDB.mjs.map → acorex-platform-module-conversation-client-retry-assist-response.command-lcNz4Hpu.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-start-direct-chat.command-CfSIVHDu.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-sync-read-state.command-D97E8VvL.mjs → acorex-platform-module-conversation-client-sync-read-state.command-DxccFsD9.mjs} +26 -13
- package/fesm2022/acorex-platform-module-conversation-client-sync-read-state.command-DxccFsD9.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-conversation-client.mjs +1 -1
- package/package.json +2 -2
- package/types/acorex-platform-module-conversation-client.d.ts +28 -1
- package/fesm2022/acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-CDlDFzbl.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-session-page.component-C47tt1me.mjs +0 -1386
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-session-page.component-C47tt1me.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-start-popup.component-EZjVSlhm.mjs +0 -89
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-start-popup.component-EZjVSlhm.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-conversation-client-chat-conversation-info-panel.component-BBL8iEqc.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-conversation-client-open-chat.command-VgeGqj-z.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-conversation-client-sync-read-state.command-D97E8VvL.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-conversation-client-local-entities.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/provide-local-entities.ts","../../../../libs/modules/conversation/client/src/lib/acorex-platform-module-conversation-client-local-entities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { provideLocalEntityCatalog } from '@acorex-platform/framework-client/layout/entity';\nimport { RootConfig } from '@acorex-platform/module-conversation-client/contracts';\n\n//#endregion\n\n//#region ----- Provide local entities -----\n\n/**\n * Registers conversation layouts on the client from packaged factories.\n * Each `import()` targets a secondary entry so unused entities stay out of the\n * bundle. Do not add this to the demo app; demo continues to load layouts via\n * `Domain:GetEntityLayout`.\n */\nexport function provideConversationLocalEntities() {\n return provideLocalEntityCatalog({\n moduleName: RootConfig.module.name,\n loaders: {\n [RootConfig.entities.message.name]: () =>\n import('@acorex-platform/module-conversation-client/contracts/entities/message').then((m) => m.messageFactory()),\n [RootConfig.entities.room.name]: () =>\n import('@acorex-platform/module-conversation-client/contracts/entities/room').then((m) => m.roomFactory()),\n },\n });\n}\n\nexport { conversationLocalEntityCatalog } from '@acorex-platform/module-conversation-client/contracts/entity-catalog';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './provide-local-entities';\n"],"names":[],"mappings":";;;;AAAA;AAKA;AAEA;AAEA;;;;;AAKG;SACa,gCAAgC,GAAA;AAC9C,IAAA,OAAO,yBAAyB,CAAC;AAC/B,QAAA,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAClC,QAAA,OAAO,EAAE;AACP,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,MAClC,OAAO,wEAAwE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC;AAClH,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,MAC/B,OAAO,qEAAqE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7G,SAAA;AACF,KAAA,CAAC;AACJ;AAIA;;AC7BA;;AAEG
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-conversation-client-local-entities.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/provide-local-entities.ts","../../../../libs/modules/conversation/client/src/lib/acorex-platform-module-conversation-client-local-entities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { provideLocalEntityCatalog } from '@acorex-platform/framework-client/layout/entity';\nimport { RootConfig } from '@acorex-platform/module-conversation-client/contracts';\n\n//#endregion\n\n//#region ----- Provide local entities -----\n\n/**\n * Registers conversation layouts on the client from packaged factories.\n * Each `import()` targets a secondary entry so unused entities stay out of the\n * bundle. Do not add this to the demo app; demo continues to load layouts via\n * `Domain:GetEntityLayout`.\n */\nexport function provideConversationLocalEntities() {\n return provideLocalEntityCatalog({\n moduleName: RootConfig.module.name,\n loaders: {\n [RootConfig.entities.message.name]: () =>\n import('@acorex-platform/module-conversation-client/contracts/entities/message').then((m) => m.messageFactory()),\n [RootConfig.entities.room.name]: () =>\n import('@acorex-platform/module-conversation-client/contracts/entities/room').then((m) => m.roomFactory()),\n },\n });\n}\n\nexport { conversationLocalEntityCatalog } from '@acorex-platform/module-conversation-client/contracts/entity-catalog';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './provide-local-entities';\n"],"names":[],"mappings":";;;;AAAA;AAKA;AAEA;AAEA;;;;;AAKG;SACa,gCAAgC,GAAA;AAC9C,IAAA,OAAO,yBAAyB,CAAC;AAC/B,QAAA,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAClC,QAAA,OAAO,EAAE;AACP,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,MAClC,OAAO,wEAAwE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC;AAClH,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,MAC/B,OAAO,qEAAqE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7G,SAAA;AACF,KAAA,CAAC;AACJ;AAIA;;AC7BA;;AAEG;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { A as AXMConversationEntityStoreService } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-
|
|
3
|
+
import { A as AXMConversationEntityStoreService } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-XTzQQhii.mjs';
|
|
4
4
|
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region ---- Command ----
|
|
@@ -27,4 +27,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
27
27
|
}] });
|
|
28
28
|
|
|
29
29
|
export { AXMConversationMarkConversationUnreadCommand };
|
|
30
|
-
//# sourceMappingURL=acorex-platform-module-conversation-client-mark-conversation-unread.command-
|
|
30
|
+
//# sourceMappingURL=acorex-platform-module-conversation-client-mark-conversation-unread.command-8NoSuUwe.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-conversation-client-mark-conversation-unread.command-
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-conversation-client-mark-conversation-unread.command-8NoSuUwe.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/commands/mark-conversation-unread.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\n\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXMConversationEntityStoreService } from '../chat/services/conversation-entity-store.service';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXMMarkConversationUnreadOptions {\n conversationId: string;\n}\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationMarkConversationUnreadCommand implements AXPCommand<AXMMarkConversationUnreadOptions, void> {\n private readonly store = inject(AXMConversationEntityStoreService);\n\n async execute(input: AXMMarkConversationUnreadOptions | unknown): AXPCommandExecuteResultPromise<void> {\n const options = input as AXMMarkConversationUnreadOptions;\n const conversation = await this.store.getConversation(options.conversationId);\n if (!conversation) {\n return { success: false };\n }\n const unreadCount = Math.max(1, conversation.unreadCount ?? 0);\n await this.store.setUnreadCount(options.conversationId, unreadCount);\n return { success: true, kind: 'object', data: undefined };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAiBA;AAEA;MAGa,4CAA4C,CAAA;AADzD,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,iCAAiC,CAAC;AAYnE,IAAA;IAVC,MAAM,OAAO,CAAC,KAAiD,EAAA;QAC7D,MAAM,OAAO,GAAG,KAAyC;AACzD,QAAA,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC;QAC7E,IAAI,CAAC,YAAY,EAAE;AACjB,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3B;AACA,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,CAAC,WAAW,IAAI,CAAC,CAAC;AAC9D,QAAA,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,cAAc,EAAE,WAAW,CAAC;AACpE,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;IAC3D;8GAZW,4CAA4C,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA5C,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,4CAA4C,cAD/B,MAAM,EAAA,CAAA,CAAA;;2FACnB,4CAA4C,EAAA,UAAA,EAAA,CAAA;kBADxD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -4,7 +4,7 @@ import { AXPInAppInboxConnectorService } from '@acorex-platform/module-communica
|
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { inject, Injectable } from '@angular/core';
|
|
6
6
|
import { Router } from '@angular/router';
|
|
7
|
-
import {
|
|
7
|
+
import { g as buildConversationChatInAppCorrelationPrefix } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-XTzQQhii.mjs';
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region ----- Command -----
|
|
@@ -25,18 +25,18 @@ class AXMConversationOpenChatCommand {
|
|
|
25
25
|
if (!conversationId) {
|
|
26
26
|
return { success: false, message: { text: '@conversation:chat.route.conversation-not-found' } };
|
|
27
27
|
}
|
|
28
|
-
await this.
|
|
28
|
+
await this.markConversationInAppNotificationRead(conversationId);
|
|
29
29
|
await this.conversationService.selectConversation(conversationId);
|
|
30
30
|
await this.router.navigate([this.applicationRouteSegment(), 'chat', conversationId]);
|
|
31
31
|
return { success: true, kind: 'object', data: { conversationId } };
|
|
32
32
|
}
|
|
33
33
|
//#region ----- Private -----
|
|
34
|
-
async
|
|
34
|
+
async markConversationInAppNotificationRead(conversationId) {
|
|
35
35
|
if (!this.inboxConnector) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
try {
|
|
39
|
-
await this.inboxConnector.
|
|
39
|
+
await this.inboxConnector.markReadByCorrelationIdPrefix(buildConversationChatInAppCorrelationPrefix(conversationId));
|
|
40
40
|
}
|
|
41
41
|
catch {
|
|
42
42
|
// Best-effort — navigation should still proceed.
|
|
@@ -54,4 +54,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
54
54
|
}] });
|
|
55
55
|
|
|
56
56
|
export { AXMConversationOpenChatCommand };
|
|
57
|
-
//# sourceMappingURL=acorex-platform-module-conversation-client-open-chat.command-
|
|
57
|
+
//# sourceMappingURL=acorex-platform-module-conversation-client-open-chat.command-BgJ0Z36e.mjs.map
|
package/fesm2022/acorex-platform-module-conversation-client-open-chat.command-BgJ0Z36e.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-conversation-client-open-chat.command-BgJ0Z36e.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/commands/open-chat.command.ts"],"sourcesContent":["import { AXConversationService } from '@acorex/components/conversation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPInAppInboxConnectorService } from '@acorex-platform/module-communication-management-client';\nimport { inject, Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { buildConversationChatInAppCorrelationPrefix } from '../chat/services/conversation-chat-notification.util';\n\n//#region ----- Types -----\n\nexport interface AXMOpenChatOptions {\n conversationId?: string;\n}\n\n//#endregion\n\n//#region ----- Command -----\n\n/** Opens an existing conversation in the chat app. */\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationOpenChatCommand implements AXPCommand<AXMOpenChatOptions, { conversationId: string }> {\n //#region ----- Services & Dependencies -----\n\n private readonly conversationService = inject(AXConversationService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly router = inject(Router);\n private readonly inboxConnector = inject(AXPInAppInboxConnectorService, { optional: true });\n\n //#endregion\n\n async execute(input: AXMOpenChatOptions | unknown): AXPCommandExecuteResultPromise<{ conversationId: string }> {\n const conversationId =\n typeof (input as AXMOpenChatOptions)?.conversationId === 'string'\n ? (input as AXMOpenChatOptions).conversationId!.trim()\n : '';\n\n if (!conversationId) {\n return { success: false, message: { text: '@conversation:chat.route.conversation-not-found' } };\n }\n\n await this.markConversationInAppNotificationRead(conversationId);\n\n await this.conversationService.selectConversation(conversationId);\n await this.router.navigate([this.applicationRouteSegment(), 'chat', conversationId]);\n return { success: true, kind: 'object', data: { conversationId } };\n }\n\n //#region ----- Private -----\n\n private async markConversationInAppNotificationRead(conversationId: string): Promise<void> {\n if (!this.inboxConnector) {\n return;\n }\n try {\n await this.inboxConnector.markReadByCorrelationIdPrefix(\n buildConversationChatInAppCorrelationPrefix(conversationId),\n );\n } catch {\n // Best-effort — navigation should still proceed.\n }\n }\n\n private applicationRouteSegment(): string {\n return this.sessionService.application?.name?.trim() || 'platform';\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AAcA;AAEA;AAEA;MAEa,8BAA8B,CAAA;AAD3C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACnD,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACvB,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,6BAA6B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAyC5F,IAAA;;IArCC,M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A,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,cADjB,MAAM,EAAA,CAAA,CAAA;;2FACnB,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAD1C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { a as AXM_CONVERSATION_ASSIST_RESPONSE_PORT } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-
|
|
3
|
+
import { a as AXM_CONVERSATION_ASSIST_RESPONSE_PORT } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-XTzQQhii.mjs';
|
|
4
4
|
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region ---- Command ----
|
|
@@ -31,4 +31,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
31
31
|
}] });
|
|
32
32
|
|
|
33
33
|
export { AXMConversationRetryAssistResponseCommand };
|
|
34
|
-
//# sourceMappingURL=acorex-platform-module-conversation-client-retry-assist-response.command-
|
|
34
|
+
//# sourceMappingURL=acorex-platform-module-conversation-client-retry-assist-response.command-lcNz4Hpu.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-conversation-client-retry-assist-response.command-
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-conversation-client-retry-assist-response.command-lcNz4Hpu.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/commands/retry-assist-response.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport type { AXConversationMessage } 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';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXMRetryAssistResponseOptions {\n conversationId: string;\n messageId: string;\n}\n\nexport interface AXMRetryAssistResponseResult {\n message: AXConversationMessage;\n}\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationRetryAssistResponseCommand\n implements AXPCommand<AXMRetryAssistResponseOptions, AXMRetryAssistResponseResult>\n{\n private readonly assistResponse = inject(AXM_CONVERSATION_ASSIST_RESPONSE_PORT, { optional: true });\n\n async execute(input: AXMRetryAssistResponseOptions | unknown): AXPCommandExecuteResultPromise<AXMRetryAssistResponseResult> {\n const options = input as AXMRetryAssistResponseOptions;\n if (!this.assistResponse) {\n return { success: false, message: { text: 'Assist response service is not available.' } };\n }\n\n try {\n const message = await this.assistResponse.retryAssistResponse(options.conversationId, options.messageId);\n return { success: true, kind: 'object', data: { message } };\n } catch (error: unknown) {\n console.error('[Conversation:RetryAssistResponse] Failed:', error);\n return { success: false };\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAuBA;AAEA;MAGa,yCAAyC,CAAA;AADtD,IAAA,WAAA,GAAA;QAImB,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,qCAAqC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAgBpG,IAAA;IAdC,MAAM,OAAO,CAAC,KAA8C,EAAA;QAC1D,MAAM,OAAO,GAAG,KAAsC;AACtD,QAAA,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE;AACxB,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,2CAA2C,EAAE,EAAE;QAC3F;AAEA,QAAA,IAAI;AACF,YAAA,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,SAAS,CAAC;AACxG,YAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE;QAC7D;QAAE,OAAO,KAAc,EAAE;AACvB,YAAA,OAAO,CAAC,KAAK,CAAC,4CAA4C,EAAE,KAAK,CAAC;AAClE,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3B;IACF;8GAlBW,yCAAyC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzC,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,yCAAyC,cAD5B,MAAM,EAAA,CAAA,CAAA;;2FACnB,yCAAyC,EAAA,UAAA,EAAA,CAAA;kBADrD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-conversation-client-start-direct-chat.command-CfSIVHDu.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/commands/start-direct-chat.command.ts"],"sourcesContent":["import { AXDialogService } from '@acorex/components/dialog';\nimport { AXConversationService } from '@acorex/components/conversation';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPUserAvatarService } from '@acorex-platform/framework-client/layout/components';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { firstValueFrom, take } from 'rxjs';\n\n//#region ----- Types -----\n\nexport interface AXMStartDirectChatOptions {\n userId?: string;\n}\n\n//#endregion\n\n//#region ----- Command -----\n\n/** Creates or reuses a private conversation with {@link AXMStartDirectChatOptions.userId} and opens chat. */\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationStartDirectChatCommand implements AXPCommand<AXMStartDirectChatOptions, { conversationId: string }> {\n //#region ----- Services & Dependencies -----\n\n private readonly conversationService = inject(AXConversationService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly avatarService = inject(AXPUserAvatarService);\n private readonly router = inject(Router);\n private readonly dialogService = inject(AXDialogService);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n async execute(input: AXMStartDirectChatOptions | unknown): AXPCommandExecuteResultPromise<{ conversationId: string }> {\n const userId = typeof (input as AXMStartDirectChatOptions)?.userId === 'string'\n ? (input as AXMStartDirectChatOptions).userId!.trim()\n : '';\n\n if (!userId) {\n await this.showError('missing-user');\n return { success: false, message: { text: '@conversation:chat.user-card.errors.missing-user' } };\n }\n\n const currentUserId = this.sessionService.user?.id;\n if (currentUserId != null && userId === currentUserId) {\n await this.showError('self-chat');\n return { success: false, message: { text: '@conversation:chat.user-card.errors.self-chat' } };\n }\n\n const title = await this.resolveChatTitle(userId);\n try {\n const conversation = await this.conversationService.createConversation([userId], 'private', { title });\n await this.router.navigate([this.applicationRouteSegment(), 'chat', conversation.id]);\n return { success: true, kind: 'object', data: { conversationId: conversation.id } };\n } catch {\n await this.showError('create-room');\n return { success: false, message: { text: '@conversation:chat.user-card.errors.create-room' } };\n }\n }\n\n //#region ----- Private -----\n\n private applicationRouteSegment(): string {\n return this.sessionService.application?.name?.trim() || 'platform';\n }\n\n private async resolveChatTitle(userId: string): Promise<string> {\n try {\n const info = await firstValueFrom(this.avatarService.getUserInfo$(userId).pipe(take(1)));\n const parts = [info?.firstName, info?.lastName].map((part) => part?.trim()).filter(Boolean) as string[];\n if (parts.length > 0) {\n return parts.join(' ');\n }\n return info?.username?.trim() || '';\n } catch {\n return '';\n }\n }\n\n private async showError(key: string): Promise<void> {\n const title = await this.translation.translateAsync('@conversation:chat.user-card.error-title');\n const message = await this.translation.translateAsync(`@conversation:chat.user-card.errors.${key}`);\n await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YACA,OAAO,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE;QACrC;AAAE,QAAA,MAAM;AACN,YAAA,OAAO,EAAE;QACX;IACF;IAEQ,MAAM,SAAS,CAAC,GAAW,EAAA;QACjC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,0CAA0C,CAAC;AAC/F,QAAA,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAA,oCAAA,EAAuC,GAAG,CAAA,CAAE,CAAC;AACnG,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC1D;8GA9DW,qCAAqC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArC,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,qCAAqC,cADxB,MAAM,EAAA,CAAA,CAAA;;2FACnB,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBADjD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-conversation-client-start-direct-chat.command-CfSIVHDu.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/commands/start-direct-chat.command.ts"],"sourcesContent":["import { AXDialogService } from '@acorex/components/dialog';\nimport { AXConversationService } from '@acorex/components/conversation';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPUserAvatarService } from '@acorex-platform/framework-client/layout/components';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { firstValueFrom, take } from 'rxjs';\n\n//#region ----- Types -----\n\nexport interface AXMStartDirectChatOptions {\n userId?: string;\n}\n\n//#endregion\n\n//#region ----- Command -----\n\n/** Creates or reuses a private conversation with {@link AXMStartDirectChatOptions.userId} and opens chat. */\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationStartDirectChatCommand implements AXPCommand<AXMStartDirectChatOptions, { conversationId: string }> {\n //#region ----- Services & Dependencies -----\n\n private readonly conversationService = inject(AXConversationService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly avatarService = inject(AXPUserAvatarService);\n private readonly router = inject(Router);\n private readonly dialogService = inject(AXDialogService);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n async execute(input: AXMStartDirectChatOptions | unknown): AXPCommandExecuteResultPromise<{ conversationId: string }> {\n const userId = typeof (input as AXMStartDirectChatOptions)?.userId === 'string'\n ? (input as AXMStartDirectChatOptions).userId!.trim()\n : '';\n\n if (!userId) {\n await this.showError('missing-user');\n return { success: false, message: { text: '@conversation:chat.user-card.errors.missing-user' } };\n }\n\n const currentUserId = this.sessionService.user?.id;\n if (currentUserId != null && userId === currentUserId) {\n await this.showError('self-chat');\n return { success: false, message: { text: '@conversation:chat.user-card.errors.self-chat' } };\n }\n\n const title = await this.resolveChatTitle(userId);\n try {\n const conversation = await this.conversationService.createConversation([userId], 'private', { title });\n await this.router.navigate([this.applicationRouteSegment(), 'chat', conversation.id]);\n return { success: true, kind: 'object', data: { conversationId: conversation.id } };\n } catch {\n await this.showError('create-room');\n return { success: false, message: { text: '@conversation:chat.user-card.errors.create-room' } };\n }\n }\n\n //#region ----- Private -----\n\n private applicationRouteSegment(): string {\n return this.sessionService.application?.name?.trim() || 'platform';\n }\n\n private async resolveChatTitle(userId: string): Promise<string> {\n try {\n const info = await firstValueFrom(this.avatarService.getUserInfo$(userId).pipe(take(1)));\n const parts = [info?.firstName, info?.lastName].map((part) => part?.trim()).filter(Boolean) as string[];\n if (parts.length > 0) {\n return parts.join(' ');\n }\n return info?.username?.trim() || '';\n } catch {\n return '';\n }\n }\n\n private async showError(key: string): Promise<void> {\n const title = await this.translation.translateAsync('@conversation:chat.user-card.error-title');\n const message = await this.translation.translateAsync(`@conversation:chat.user-card.errors.${key}`);\n await this.dialogService.alert(title, message, 'danger');\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAgBA;AAEA;AAEA;MAEa,qCAAqC,CAAA;AADlD,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACnD,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAC5C,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AACvC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAyD5D,IAAA;;IArDC,MAAM,OAAO,CAAC,KAA0C,EAAA;AACtD,QAAA,MAAM,MAAM,GAAG,OAAQ,KAAmC,EAAE,MAAM,KAAK;AACrE,cAAG,KAAmC,CAAC,MAAO,CAAC,IAAI;cACjD,EAAE;QAEN,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,MAAM,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;AACpC,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,kDAAkD,EAAE,EAAE;QAClG;QAEA,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE;QAClD,IAAI,aAAa,IAAI,IAAI,IAAI,MAAM,KAAK,aAAa,EAAE;AACrD,YAAA,MAAM,IAAI,CAAC,SAAS,CAAC,WAAW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AK,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAa;AACvG,YAAA,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AACpB,gBAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;YACxB;YACA,OAAO,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE;QACrC;AAAE,QAAA,MAAM;AACN,YAAA,OAAO,EAAE;QACX;IACF;IAEQ,MAAM,SAAS,CAAC,GAAW,EAAA;QACjC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,0CAA0C,CAAC;AAC/F,QAAA,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAA,oCAAA,EAAuC,GAAG,CAAA,CAAE,CAAC;AACnG,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC1D;8GA9DW,qCAAqC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArC,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,qCAAqC,cADxB,MAAM,EAAA,CAAA,CAAA;;2FACnB,qCAAqC,EAAA,UAAA,EAAA,CAAA;kBADjD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { A as AXMConversationEntityStoreService, d as AXMConversationFocusService, e as AXMConversationInAppNotificationSyncService } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-
|
|
3
|
+
import { A as AXMConversationEntityStoreService, d as AXMConversationFocusService, e as AXMConversationInAppNotificationSyncService, f as axmMessageCountsTowardUnread } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-XTzQQhii.mjs';
|
|
4
4
|
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region ---- Command ----
|
|
@@ -16,28 +16,41 @@ class AXMConversationSyncReadStateCommand {
|
|
|
16
16
|
if (!conversationId) {
|
|
17
17
|
return { success: true, kind: 'object', data: undefined };
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (!options.force && !this.focus.isFocused(conversationId)) {
|
|
19
|
+
const allowWithoutFocus = Boolean(options.force || options.fromInbox);
|
|
20
|
+
if (!allowWithoutFocus && !this.focus.isFocused(conversationId)) {
|
|
22
21
|
return { success: true, kind: 'object', data: undefined };
|
|
23
22
|
}
|
|
24
|
-
|
|
23
|
+
const currentUserId = options.currentUserId?.trim();
|
|
24
|
+
const messageIds = options.messageIds?.filter((id) => id?.trim()) ?? [];
|
|
25
|
+
const idsToMark = messageIds.length > 0
|
|
26
|
+
? messageIds
|
|
27
|
+
: currentUserId
|
|
28
|
+
? await this.collectUnreadMessageIds(conversationId, currentUserId)
|
|
29
|
+
: [];
|
|
30
|
+
if (idsToMark.length > 0 && currentUserId) {
|
|
31
|
+
await this.focus.markMessagesRead(conversationId, idsToMark, currentUserId);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
25
34
|
const cachedConversation = this.store.getCachedConversation(conversationId);
|
|
26
35
|
if ((cachedConversation?.unreadCount ?? 0) !== 0) {
|
|
27
36
|
await this.store.setUnreadCount(conversationId, 0);
|
|
28
37
|
}
|
|
29
|
-
|
|
38
|
+
}
|
|
39
|
+
if (currentUserId) {
|
|
40
|
+
await this.inAppSync.markConversationInAppNotificationRead(conversationId, currentUserId, {
|
|
30
41
|
force: true,
|
|
31
42
|
});
|
|
32
|
-
return { success: true, kind: 'object', data: undefined };
|
|
33
43
|
}
|
|
34
|
-
const marked = await this.focus.markMessagesRead(conversationId, options.messageIds, options.currentUserId);
|
|
35
|
-
await this.inAppSync.dismissConversationInAppNotification(conversationId, options.currentUserId, {
|
|
36
|
-
force: true,
|
|
37
|
-
});
|
|
38
|
-
void marked;
|
|
39
44
|
return { success: true, kind: 'object', data: undefined };
|
|
40
45
|
}
|
|
46
|
+
async collectUnreadMessageIds(conversationId, currentUserId) {
|
|
47
|
+
const cached = this.store.getCachedMessageList(conversationId);
|
|
48
|
+
const messages = cached ?? (await this.store.loadConversationMessages(conversationId));
|
|
49
|
+
return messages
|
|
50
|
+
.filter((message) => axmMessageCountsTowardUnread(message, currentUserId))
|
|
51
|
+
.map((message) => message.id)
|
|
52
|
+
.filter((id) => Boolean(id?.trim()));
|
|
53
|
+
}
|
|
41
54
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMConversationSyncReadStateCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
42
55
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMConversationSyncReadStateCommand, providedIn: 'root' }); }
|
|
43
56
|
}
|
|
@@ -47,4 +60,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
47
60
|
}] });
|
|
48
61
|
|
|
49
62
|
export { AXMConversationSyncReadStateCommand };
|
|
50
|
-
//# sourceMappingURL=acorex-platform-module-conversation-client-sync-read-state.command-
|
|
63
|
+
//# sourceMappingURL=acorex-platform-module-conversation-client-sync-read-state.command-DxccFsD9.mjs.map
|
package/fesm2022/acorex-platform-module-conversation-client-sync-read-state.command-DxccFsD9.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-conversation-client-sync-read-state.command-DxccFsD9.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/commands/sync-read-state.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\n\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXMConversationInAppNotificationSyncService } from '../chat/services/conversation-in-app-notification-sync.service';\nimport { AXMConversationEntityStoreService } from '../chat/services/conversation-entity-store.service';\nimport { AXMConversationFocusService } from '../chat/services/conversation-focus.service';\nimport { axmMessageCountsTowardUnread } from '../chat/plugins/utils/conversation-unread.util';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXMSyncReadStateOptions {\n conversationId: string;\n messageIds?: string[];\n currentUserId: string;\n /** Explicit user action (sidebar Mark as Read). Skips the “must be viewing” guard. */\n force?: boolean;\n /** Inbox row was marked read — do not treat as a chat-page focus requirement. */\n fromInbox?: boolean;\n}\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationSyncReadStateCommand implements AXPCommand<AXMSyncReadStateOptions, void> {\n private readonly store = inject(AXMConversationEntityStoreService);\n private readonly focus = inject(AXMConversationFocusService);\n private readonly inAppSync = inject(AXMConversationInAppNotificationSyncService);\n\n async execute(input: AXMSyncReadStateOptions | unknown): AXPCommandExecuteResultPromise<void> {\n const options = input as AXMSyncReadStateOptions;\n const conversationId = options.conversationId?.trim();\n if (!conversationId) {\n return { success: true, kind: 'object', data: undefined };\n }\n\n const allowWithoutFocus = Boolean(options.force || options.fromInbox);\n if (!allowWithoutFocus && !this.focus.isFocused(conversationId)) {\n return { success: true, kind: 'object', data: undefined };\n }\n\n const currentUserId = options.currentUserId?.trim();\n const messageIds = options.messageIds?.filter((id) => id?.trim()) ?? [];\n const idsToMark =\n messageIds.length > 0\n ? messageIds\n : currentUserId\n ? await this.collectUnreadMessageIds(conversationId, currentUserId)\n : [];\n\n if (idsToMark.length > 0 && currentUserId) {\n await this.focus.markMessagesRead(conversationId, idsToMark, currentUserId);\n } else {\n const cachedConversation = this.store.getCachedConversation(conversationId);\n if ((cachedConversation?.unreadCount ?? 0) !== 0) {\n await this.store.setUnreadCount(conversationId, 0);\n }\n }\n\n if (currentUserId) {\n await this.inAppSync.markConversationInAppNotificationRead(conversationId, currentUserId, {\n force: true,\n });\n }\n return { success: true, kind: 'object', data: undefined };\n }\n\n private async collectUnreadMessageIds(conversationId: string, currentUserId: string): Promise<string[]> {\n const cached = this.store.getCachedMessageList(conversationId);\n const messages = cached ?? (await this.store.loadConversationMessages(conversationId));\n return messages\n .filter((message) => axmMessageCountsTowardUnread(message, currentUserId))\n .map((message) => message.id)\n .filter((id): id is string => Boolean(id?.trim()));\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAyBA;AAEA;MAGa,mCAAmC,CAAA;AADhD,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,iCAAiC,CAAC;AACjD,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAC3C,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,2CAA2C,CAAC;AAgDjF,IAAA;IA9CC,MAAM,OAAO,CAAC,KAAwC,EAAA;QACpD,MAAM,OAAO,GAAG,KAAgC;QAChD,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,IAAI,EAAE;QACrD,IAAI,CAAC,cAAc,EAAE;AACnB,YAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3D;AAEA,QAAA,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC;AACrE,QAAA,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE;AAC/D,YAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI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Ac,CAAC,CAAC;AACtF,QAAA,OAAO;AACJ,aAAA,MAAM,CAAC,CAAC,OAAO,KAAK,4BAA4B,CAAC,OAAO,EAAE,aAAa,CAAC;aACxE,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE;AAC3B,aAAA,MAAM,CAAC,CAAC,EAAE,KAAmB,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD;8GAlDW,mCAAmC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnC,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,mCAAmC,cADtB,MAAM,EAAA,CAAA,CAAA;;2FACnB,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAD/C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { M as AXMAddReactionCommand, L as AXMAssistSuggestionChipsComponent, N as AXMChatComponent, p as AXMChatConversationApi, o as AXMChatEntityConversationApi, O as AXMChatEntityConversationFocusHandler, P as AXMChatEntityConversationRoomQueryService, Q as AXMChatEntityMessageApi, R as AXMChatEntityRealtimeApi, S as AXMChatEntityUserApi, T as AXMChatMessageApi, U as AXMChatRealtimeApi, n as AXMChatUserApi, h as AXMCommentComponent, V as AXMCommentManagementService, W as AXMCommentPopupComponent, X as AXMCommentRealtimeService, Y as AXMCommentRealtimeServiceImpl, Z as AXMCommentService, _ as AXMCommentServiceImpl, $ as AXMCommentWidgetViewComponent, a0 as AXMConversationAssistBackgroundOperationHandler, A as AXMConversationEntityStoreService, d as AXMConversationFocusService, a1 as AXMConversationModule, t as AXMConversationRealtimeBus, a2 as AXMEntityChatService, a3 as AXMMiniChatComponent, a4 as AXMMiniChatHeaderSlotComponent, a5 as AXMMiniChatHistoryComponent, a6 as AXMMiniChatInboxHistoryComponent, a7 as AXMMiniChatInboxPanelHostComponent, a8 as AXMMiniChatLauncherComponent, a9 as AXMMiniChatPanelComponent, aa as AXMMiniChatPanelService, ab as AXMShowCommentPopupCommand, ac as AXM_AI_MANAGEMENT_AGENT_ENTITY_NAME, ad as AXM_AI_MANAGEMENT_ASSIST_ENTITY_NAME, ae as AXM_AI_MANAGEMENT_MODULE_NAME, af as AXM_ASSIST_DEFAULT_RESOLVER_PORT, ag as AXM_ASSIST_TRANSCRIPT_LINE_PAYLOAD_TYPE, ah as AXM_CHAT_ASSIST_CATALOG_PORT, ai as AXM_CHAT_EMPTY_STATE_COMPONENT, aj as AXM_CHAT_SIDEBAR_ACTION_PROVIDER, ak as AXM_CONVERSATION_ASSIST_BACKGROUND_OPERATION_HANDLERS, al as AXM_CONVERSATION_ASSIST_BACKGROUND_OPERATION_KEY, a as AXM_CONVERSATION_ASSIST_RESPONSE_PORT, am as AXM_CONVERSATION_CHAT_ATTACHMENT_CATEGORY, an as AXM_CONVERSATION_CHAT_ATTACHMENT_REF_TYPE, b as AXM_CONVERSATION_REGULAR_AUTO_REPLY_PORT, ao as AXM_CONVERSATION_TAB_BOT, ap as AXM_MINI_CHAT_INBOX_CONVERSATION_FILTER, aq as AXM_MINI_CHAT_INBOX_SESSION_KEY, ar as AXPCommentWidget, as as COMMENTS_PAGE_COMPONENT_KEY, at as CONVERSATION_AFTER_MESSAGE_SENT_COMMAND, au as CONVERSATION_EMIT_TYPING_INDICATOR_COMMAND, av as CONVERSATION_MARK_CONVERSATION_UNREAD_COMMAND, aw as CONVERSATION_OPEN_CHAT_COMMAND, ax as CONVERSATION_RETRY_ASSIST_RESPONSE_COMMAND, ay as CONVERSATION_SEND_ASSIST_CHAT_MESSAGE_COMMAND, az as CONVERSATION_START_ASSIST_CHAT_COMMAND, aA as CONVERSATION_START_DIRECT_CHAT_COMMAND, aB as CONVERSATION_SYNC_READ_STATE_COMMAND, aC as axmApplyAnswerTextToAssistPayloadLine, aD as axmAssistFollowUpItemsFromUnknown, aE as axmAssistHasFinalizeMetadata, aF as axmAssistLastTranscriptLine, aG as axmAssistNormalizeFollowUpItemForConversation, aH as axmAssistNormalizeFollowUpItemsForConversation, aI as axmAssistPersistedMessageLooksComplete, aJ as axmAssistResolveFollowUpCommandName, aK as axmAssistStarterPromptChipItems, aL as axmAssistUserFacingPayloadLine, aM as axmAssistUserVisibleItemsForLine, aN as axmAssistWidgetNodeDedupeKey, G as axmAssistWidgetNodeFromUnknown, aO as axmBuildAiChatConversationMetadata, aP as axmBuildAssistPeerParticipantFromCreateData, aQ as axmBuildAssistPeerParticipantFromId, aR as axmBuildAssistTranscriptLinePayload, aS as axmBuildAutoTitleFromUserText, aT as axmBuildEntityChatConversationMetadata, aU as axmChatAiPeerParticipantId, aV as axmChatAiTargetAvatarUrl, aW as axmChatAiTargetDisplayDescription, aX as axmChatAiTargetDisplayName, aY as axmChatAiTargetShortcutDescriptionKey, aZ as axmCoerceDate, a_ as axmCoerceTimestampMs, a$ as axmComputeConversationUnreadCount, c as axmConversationHasAiChat, b0 as axmConversationIsEntityChat, b1 as axmConversationMatchesEntity, b2 as axmExtractAssistIdFromMetadata, b3 as axmExtractAssistSnapshotFromMetadata, b4 as axmExtractDirectAgentIdFromMetadata, b5 as axmExtractEntityRefFromMetadata, b6 as axmExtractModelEntityIdFromMetadata, b7 as axmExtractTextFromPayload, b8 as axmFilterChatAiTargets, b9 as axmHydrateRealtimeConversationMessage, ba as axmIsAssistBotConversation, bb as axmIsAssistPeerParticipant, bc as axmIsAssistResponseMessage, bd as axmIsAssistRetryableStatus, be as axmIsAssistStreamingMessage, bf as axmIsAssistStreamingStatus, bg as axmIsAssistTerminalStatus, bh as axmIsUnsupportedLegacyAgentAssistConversation, bi as axmLoadChatAiTargets, f as axmMessageCountsTowardUnread, bj as axmMessageEntityToMessage, bk as axmNormalizeAssistTranscriptForChatUi, bl as axmNormalizeAssistTranscriptLineResponses, bm as axmParseAssistTranscriptLinePayload, F as axmParseAssistTranscriptTextEnvelope, H as axmPartitionAssistAnswerText, bn as axmPreferLocalUnreadCount, C as axmReadAssistAiTranscript, D as axmReadAssistAiTranscriptRaw, bo as axmReadAssistResponseError, bp as axmReadAssistResponseStatus, bq as axmReadPlainTextMessagePayload, br as axmReadReplyToUserMessageId, bs as axmResolveAssistFinalAnswerText, bt as axmResolveChatAiTargetText, bu as axmRoomEntityToConversation, bv as axmRoomWithAssistPeerDisplayName, bw as axmSanitizeAssistUserAnswerText, bx as axmShouldPreferPersistedAssistOverLiveCache, by as axmShowCommentPopupCommandDefinition, bz as axmSortMessagesNewestFirst, bA as axmSyncAssistPeerDisplayName, I as axmSyntheticEmbedMessage, bB as axmUserRowToParticipant, bC as commentsPlugin, bD as createConversationServiceSessionAdapter, bE as persistChatAttachment } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-XTzQQhii.mjs';
|
|
2
2
|
//# sourceMappingURL=acorex-platform-module-conversation-client.mjs.map
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex-platform/module-conversation-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0 || ^22.0.0",
|
|
7
7
|
"@angular/core": "^21.0.0 || ^22.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@acorex-platform/extension-rtc-core-gateway": "0.0.
|
|
10
|
+
"@acorex-platform/extension-rtc-core-gateway": "0.0.38",
|
|
11
11
|
"tslib": "^2.3.0"
|
|
12
12
|
},
|
|
13
13
|
"module": "fesm2022/acorex-platform-module-conversation-client.mjs",
|
|
@@ -45,8 +45,10 @@ declare const AXM_CONVERSATION_ASSIST_BACKGROUND_OPERATION_HANDLERS: Provider[];
|
|
|
45
45
|
declare class AXMChatComponent extends AXPPageLayoutBaseComponent {
|
|
46
46
|
#private;
|
|
47
47
|
private readonly conversationService;
|
|
48
|
+
private readonly popupService;
|
|
48
49
|
private readonly chatConversationApi;
|
|
49
50
|
private readonly miniChatPanelService;
|
|
51
|
+
private readonly activeCallSessions;
|
|
50
52
|
private readonly composerService;
|
|
51
53
|
private readonly infoBarService;
|
|
52
54
|
/** Eagerly resolves tenant debug mode for assist debug download action visibility. */
|
|
@@ -138,6 +140,7 @@ declare abstract class AXMChatRealtimeApi extends AXConversationRealtimeApi {
|
|
|
138
140
|
* Entity-backed implementation of {@link AXMChatConversationApi} using Conversation.room.
|
|
139
141
|
*/
|
|
140
142
|
declare class AXMChatEntityConversationApi extends AXMChatConversationApi {
|
|
143
|
+
#private;
|
|
141
144
|
private readonly entityService;
|
|
142
145
|
private readonly filterService;
|
|
143
146
|
private readonly userApi;
|
|
@@ -166,9 +169,18 @@ declare class AXMChatEntityConversationApi extends AXMChatConversationApi {
|
|
|
166
169
|
findEntityConversations(entityType: string, entityId: string): Promise<AXConversation[]>;
|
|
167
170
|
getParticipants(conversationId: string): Promise<AXConversationParticipant[]>;
|
|
168
171
|
addParticipants(conversationId: string, userIds: string[]): Promise<AXConversation>;
|
|
172
|
+
/**
|
|
173
|
+
* Creates a new group from a private chat when a third participant accepts a call invite.
|
|
174
|
+
* The private room is left unchanged; the inviter becomes group owner.
|
|
175
|
+
*/
|
|
176
|
+
forkPrivateToGroupForCall(sourceConversationId: string, acceptedUserIds: string[], options?: {
|
|
177
|
+
callId?: string;
|
|
178
|
+
}): Promise<AXConversation>;
|
|
179
|
+
findForkedGroupFromPrivateChat(sourceConversationId: string, callId?: string): Promise<AXConversation | null>;
|
|
169
180
|
removeParticipant(conversationId: string, userId: string): Promise<AXConversation>;
|
|
170
181
|
leaveConversation(conversationId: string): Promise<void>;
|
|
171
182
|
updateParticipant(conversationId: string, update: AXConversationParticipantUpdate): Promise<AXConversation>;
|
|
183
|
+
private persistParticipants;
|
|
172
184
|
uploadConversationAvatar(_conversationId: string, _file: File): Promise<string>;
|
|
173
185
|
getConversationMedia(_conversationId: string, pagination?: AXConversationPagination): Promise<AXConversationPaginatedResult<unknown>>;
|
|
174
186
|
addConversationTags(_conversationId: string, _tags: string[]): Promise<void>;
|
|
@@ -650,6 +662,8 @@ declare function axmAssistPersistedMessageLooksComplete(message: {
|
|
|
650
662
|
metadata?: unknown;
|
|
651
663
|
}): boolean;
|
|
652
664
|
|
|
665
|
+
/** True when the bubble is an assist-response row (streaming or terminal). */
|
|
666
|
+
declare function axmIsAssistResponseMessage(message: AXConversationMessage): boolean;
|
|
653
667
|
/**
|
|
654
668
|
* True while an assist placeholder is still generating (not yet a deliverable reply).
|
|
655
669
|
*/
|
|
@@ -660,6 +674,12 @@ declare function axmIsAssistStreamingMessage(message: AXConversationMessage): bo
|
|
|
660
674
|
declare function axmMessageCountsTowardUnread(message: AXConversationMessage, currentUserId: string): boolean;
|
|
661
675
|
/** Recomputes unread badge count from persisted messages. */
|
|
662
676
|
declare function axmComputeConversationUnreadCount(messages: AXConversationMessage[], currentUserId: string): number;
|
|
677
|
+
/**
|
|
678
|
+
* `room.unreadCount` is a shared document field, not per-user.
|
|
679
|
+
* A sender's last-message touch refetch often carries 0 and must not replace
|
|
680
|
+
* a higher in-memory unread on the recipient.
|
|
681
|
+
*/
|
|
682
|
+
declare function axmPreferLocalUnreadCount(localUnread: number | undefined, incomingUnread: number | undefined): number;
|
|
663
683
|
|
|
664
684
|
declare function axmCoerceTimestampMs(value: unknown): number;
|
|
665
685
|
/** Coerces entity / IndexedDB values to {@link Date} for conversation UI sorting. */
|
|
@@ -734,6 +754,8 @@ declare class AXMConversationEntityStoreService {
|
|
|
734
754
|
private readonly persistChains;
|
|
735
755
|
/** Avoids GET-by-id existence probes for assist rows already written in this session. */
|
|
736
756
|
private readonly persistedMessageIds;
|
|
757
|
+
/** Bumped on session reset so in-flight assist persists do not write into the next user. */
|
|
758
|
+
private persistGeneration;
|
|
737
759
|
/** In-memory snapshots to avoid redundant GetById after local writes. */
|
|
738
760
|
private readonly conversationCache;
|
|
739
761
|
private readonly messageCache;
|
|
@@ -764,6 +786,7 @@ declare class AXMConversationEntityStoreService {
|
|
|
764
786
|
cacheEmptyMessageList(conversationId: string): void;
|
|
765
787
|
private patchMessageListCache;
|
|
766
788
|
private appendToMessageListCache;
|
|
789
|
+
private mergeRealtimeMessagesIntoList;
|
|
767
790
|
loadConversationMessages(conversationId: string, options?: {
|
|
768
791
|
skip?: number;
|
|
769
792
|
take?: number;
|
|
@@ -1555,6 +1578,7 @@ declare class AXMMiniChatPanelService {
|
|
|
1555
1578
|
private buildEntityKey;
|
|
1556
1579
|
private disposeOverlayOnly;
|
|
1557
1580
|
private handleOverlayDisposed;
|
|
1581
|
+
private finishOverlayClose;
|
|
1558
1582
|
private bindDismissHandlers;
|
|
1559
1583
|
/** Ignore clicks on the anchor, overlay panel, or nested dropdown menus. */
|
|
1560
1584
|
private isInsideInteractiveSurface;
|
|
@@ -1644,6 +1668,7 @@ declare class AXMMiniChatPanelComponent implements OnInit, OnDestroy {
|
|
|
1644
1668
|
declare class AXMMiniChatComponent {
|
|
1645
1669
|
#private;
|
|
1646
1670
|
private readonly conversationService;
|
|
1671
|
+
private readonly popupService;
|
|
1647
1672
|
private readonly conversationApi;
|
|
1648
1673
|
private readonly destroyRef;
|
|
1649
1674
|
/** Existing conversation id to open. When omitted (and no conversation is active), the new-chat composer is shown. */
|
|
@@ -1659,6 +1684,8 @@ declare class AXMMiniChatComponent {
|
|
|
1659
1684
|
readonly conversationOpened: _angular_core.OutputEmitterRef<string>;
|
|
1660
1685
|
readonly hasActiveConversation: _angular_core.Signal<boolean>;
|
|
1661
1686
|
constructor();
|
|
1687
|
+
/** Opens the conversation info panel when the info-bar title/avatar area is clicked. */
|
|
1688
|
+
onInfoBarClick(): void;
|
|
1662
1689
|
/** New-chat composer created and selected a conversation; surface it to the host. */
|
|
1663
1690
|
onConversationCreated(conversationId: string): void;
|
|
1664
1691
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXMMiniChatComponent, never>;
|
|
@@ -1684,5 +1711,5 @@ declare const CONVERSATION_START_DIRECT_CHAT_COMMAND = "Conversation:StartDirect
|
|
|
1684
1711
|
/** Opens an existing conversation in the chat app. */
|
|
1685
1712
|
declare const CONVERSATION_OPEN_CHAT_COMMAND = "Conversation:OpenChat";
|
|
1686
1713
|
|
|
1687
|
-
export { AXMAddReactionCommand, AXMAssistSuggestionChipsComponent, AXMChatComponent, AXMChatConversationApi, AXMChatEntityConversationApi, AXMChatEntityConversationFocusHandler, AXMChatEntityConversationRoomQueryService, AXMChatEntityMessageApi, AXMChatEntityRealtimeApi, AXMChatEntityUserApi, AXMChatMessageApi, AXMChatRealtimeApi, AXMChatUserApi, AXMCommentComponent, AXMCommentManagementService, AXMCommentPopupComponent, AXMCommentRealtimeService, AXMCommentRealtimeServiceImpl, AXMCommentService, AXMCommentServiceImpl, AXMCommentWidgetViewComponent, AXMConversationAssistBackgroundOperationHandler, AXMConversationEntityStoreService, AXMConversationFocusService, AXMConversationModule, AXMConversationRealtimeBus, AXMEntityChatService, AXMMiniChatComponent, AXMMiniChatHeaderSlotComponent, AXMMiniChatHistoryComponent, AXMMiniChatInboxHistoryComponent, AXMMiniChatInboxPanelHostComponent, AXMMiniChatLauncherComponent, AXMMiniChatPanelComponent, AXMMiniChatPanelService, AXMShowCommentPopupCommand, AXM_AI_MANAGEMENT_AGENT_ENTITY_NAME, AXM_AI_MANAGEMENT_ASSIST_ENTITY_NAME, AXM_AI_MANAGEMENT_MODULE_NAME, AXM_ASSIST_DEFAULT_RESOLVER_PORT, AXM_ASSIST_TRANSCRIPT_LINE_PAYLOAD_TYPE, AXM_CHAT_ASSIST_CATALOG_PORT, AXM_CHAT_EMPTY_STATE_COMPONENT, AXM_CHAT_SIDEBAR_ACTION_PROVIDER, AXM_CONVERSATION_ASSIST_BACKGROUND_OPERATION_HANDLERS, AXM_CONVERSATION_ASSIST_BACKGROUND_OPERATION_KEY, AXM_CONVERSATION_ASSIST_RESPONSE_PORT, AXM_CONVERSATION_CHAT_ATTACHMENT_CATEGORY, AXM_CONVERSATION_CHAT_ATTACHMENT_REF_TYPE, AXM_CONVERSATION_REGULAR_AUTO_REPLY_PORT, AXM_CONVERSATION_TAB_BOT, AXM_MINI_CHAT_INBOX_CONVERSATION_FILTER, AXM_MINI_CHAT_INBOX_SESSION_KEY, AXPCommentWidget, COMMENTS_PAGE_COMPONENT_KEY, CONVERSATION_AFTER_MESSAGE_SENT_COMMAND, CONVERSATION_EMIT_TYPING_INDICATOR_COMMAND, CONVERSATION_MARK_CONVERSATION_UNREAD_COMMAND, CONVERSATION_OPEN_CHAT_COMMAND, CONVERSATION_RETRY_ASSIST_RESPONSE_COMMAND, CONVERSATION_SEND_ASSIST_CHAT_MESSAGE_COMMAND, CONVERSATION_START_ASSIST_CHAT_COMMAND, CONVERSATION_START_DIRECT_CHAT_COMMAND, CONVERSATION_SYNC_READ_STATE_COMMAND, axmApplyAnswerTextToAssistPayloadLine, axmAssistFollowUpItemsFromUnknown, axmAssistHasFinalizeMetadata, axmAssistLastTranscriptLine, axmAssistNormalizeFollowUpItemForConversation, axmAssistNormalizeFollowUpItemsForConversation, axmAssistPersistedMessageLooksComplete, axmAssistResolveFollowUpCommandName, axmAssistStarterPromptChipItems, axmAssistUserFacingPayloadLine, axmAssistUserVisibleItemsForLine, axmAssistWidgetNodeDedupeKey, axmAssistWidgetNodeFromUnknown, axmBuildAiChatConversationMetadata, axmBuildAssistPeerParticipantFromCreateData, axmBuildAssistPeerParticipantFromId, axmBuildAssistTranscriptLinePayload, axmBuildAutoTitleFromUserText, axmBuildEntityChatConversationMetadata, axmChatAiPeerParticipantId, axmChatAiTargetAvatarUrl, axmChatAiTargetDisplayDescription, axmChatAiTargetDisplayName, axmChatAiTargetShortcutDescriptionKey, axmCoerceDate, axmCoerceTimestampMs, axmComputeConversationUnreadCount, axmConversationHasAiChat, axmConversationIsEntityChat, axmConversationMatchesEntity, axmExtractAssistIdFromMetadata, axmExtractAssistSnapshotFromMetadata, axmExtractDirectAgentIdFromMetadata, axmExtractEntityRefFromMetadata, axmExtractModelEntityIdFromMetadata, axmExtractTextFromPayload, axmFilterChatAiTargets, axmHydrateRealtimeConversationMessage, axmIsAssistBotConversation, axmIsAssistPeerParticipant, axmIsAssistRetryableStatus, axmIsAssistStreamingMessage, axmIsAssistStreamingStatus, axmIsAssistTerminalStatus, axmIsUnsupportedLegacyAgentAssistConversation, axmLoadChatAiTargets, axmMessageCountsTowardUnread, axmMessageEntityToMessage, axmNormalizeAssistTranscriptForChatUi, axmNormalizeAssistTranscriptLineResponses, axmParseAssistTranscriptLinePayload, axmParseAssistTranscriptTextEnvelope, axmPartitionAssistAnswerText, axmReadAssistAiTranscript, axmReadAssistAiTranscriptRaw, axmReadAssistResponseError, axmReadAssistResponseStatus, axmReadPlainTextMessagePayload, axmReadReplyToUserMessageId, axmResolveAssistFinalAnswerText, axmResolveChatAiTargetText, axmRoomEntityToConversation, axmRoomWithAssistPeerDisplayName, axmSanitizeAssistUserAnswerText, axmShouldPreferPersistedAssistOverLiveCache, axmShowCommentPopupCommandDefinition, axmSortMessagesNewestFirst, axmSyncAssistPeerDisplayName, axmSyntheticEmbedMessage, axmUserRowToParticipant, commentsPlugin, createConversationServiceSessionAdapter, persistChatAttachment };
|
|
1714
|
+
export { AXMAddReactionCommand, AXMAssistSuggestionChipsComponent, AXMChatComponent, AXMChatConversationApi, AXMChatEntityConversationApi, AXMChatEntityConversationFocusHandler, AXMChatEntityConversationRoomQueryService, AXMChatEntityMessageApi, AXMChatEntityRealtimeApi, AXMChatEntityUserApi, AXMChatMessageApi, AXMChatRealtimeApi, AXMChatUserApi, AXMCommentComponent, AXMCommentManagementService, AXMCommentPopupComponent, AXMCommentRealtimeService, AXMCommentRealtimeServiceImpl, AXMCommentService, AXMCommentServiceImpl, AXMCommentWidgetViewComponent, AXMConversationAssistBackgroundOperationHandler, AXMConversationEntityStoreService, AXMConversationFocusService, AXMConversationModule, AXMConversationRealtimeBus, AXMEntityChatService, AXMMiniChatComponent, AXMMiniChatHeaderSlotComponent, AXMMiniChatHistoryComponent, AXMMiniChatInboxHistoryComponent, AXMMiniChatInboxPanelHostComponent, AXMMiniChatLauncherComponent, AXMMiniChatPanelComponent, AXMMiniChatPanelService, AXMShowCommentPopupCommand, AXM_AI_MANAGEMENT_AGENT_ENTITY_NAME, AXM_AI_MANAGEMENT_ASSIST_ENTITY_NAME, AXM_AI_MANAGEMENT_MODULE_NAME, AXM_ASSIST_DEFAULT_RESOLVER_PORT, AXM_ASSIST_TRANSCRIPT_LINE_PAYLOAD_TYPE, AXM_CHAT_ASSIST_CATALOG_PORT, AXM_CHAT_EMPTY_STATE_COMPONENT, AXM_CHAT_SIDEBAR_ACTION_PROVIDER, AXM_CONVERSATION_ASSIST_BACKGROUND_OPERATION_HANDLERS, AXM_CONVERSATION_ASSIST_BACKGROUND_OPERATION_KEY, AXM_CONVERSATION_ASSIST_RESPONSE_PORT, AXM_CONVERSATION_CHAT_ATTACHMENT_CATEGORY, AXM_CONVERSATION_CHAT_ATTACHMENT_REF_TYPE, AXM_CONVERSATION_REGULAR_AUTO_REPLY_PORT, AXM_CONVERSATION_TAB_BOT, AXM_MINI_CHAT_INBOX_CONVERSATION_FILTER, AXM_MINI_CHAT_INBOX_SESSION_KEY, AXPCommentWidget, COMMENTS_PAGE_COMPONENT_KEY, CONVERSATION_AFTER_MESSAGE_SENT_COMMAND, CONVERSATION_EMIT_TYPING_INDICATOR_COMMAND, CONVERSATION_MARK_CONVERSATION_UNREAD_COMMAND, CONVERSATION_OPEN_CHAT_COMMAND, CONVERSATION_RETRY_ASSIST_RESPONSE_COMMAND, CONVERSATION_SEND_ASSIST_CHAT_MESSAGE_COMMAND, CONVERSATION_START_ASSIST_CHAT_COMMAND, CONVERSATION_START_DIRECT_CHAT_COMMAND, CONVERSATION_SYNC_READ_STATE_COMMAND, axmApplyAnswerTextToAssistPayloadLine, axmAssistFollowUpItemsFromUnknown, axmAssistHasFinalizeMetadata, axmAssistLastTranscriptLine, axmAssistNormalizeFollowUpItemForConversation, axmAssistNormalizeFollowUpItemsForConversation, axmAssistPersistedMessageLooksComplete, axmAssistResolveFollowUpCommandName, axmAssistStarterPromptChipItems, axmAssistUserFacingPayloadLine, axmAssistUserVisibleItemsForLine, axmAssistWidgetNodeDedupeKey, axmAssistWidgetNodeFromUnknown, axmBuildAiChatConversationMetadata, axmBuildAssistPeerParticipantFromCreateData, axmBuildAssistPeerParticipantFromId, axmBuildAssistTranscriptLinePayload, axmBuildAutoTitleFromUserText, axmBuildEntityChatConversationMetadata, axmChatAiPeerParticipantId, axmChatAiTargetAvatarUrl, axmChatAiTargetDisplayDescription, axmChatAiTargetDisplayName, axmChatAiTargetShortcutDescriptionKey, axmCoerceDate, axmCoerceTimestampMs, axmComputeConversationUnreadCount, axmConversationHasAiChat, axmConversationIsEntityChat, axmConversationMatchesEntity, axmExtractAssistIdFromMetadata, axmExtractAssistSnapshotFromMetadata, axmExtractDirectAgentIdFromMetadata, axmExtractEntityRefFromMetadata, axmExtractModelEntityIdFromMetadata, axmExtractTextFromPayload, axmFilterChatAiTargets, axmHydrateRealtimeConversationMessage, axmIsAssistBotConversation, axmIsAssistPeerParticipant, axmIsAssistResponseMessage, axmIsAssistRetryableStatus, axmIsAssistStreamingMessage, axmIsAssistStreamingStatus, axmIsAssistTerminalStatus, axmIsUnsupportedLegacyAgentAssistConversation, axmLoadChatAiTargets, axmMessageCountsTowardUnread, axmMessageEntityToMessage, axmNormalizeAssistTranscriptForChatUi, axmNormalizeAssistTranscriptLineResponses, axmParseAssistTranscriptLinePayload, axmParseAssistTranscriptTextEnvelope, axmPartitionAssistAnswerText, axmPreferLocalUnreadCount, axmReadAssistAiTranscript, axmReadAssistAiTranscriptRaw, axmReadAssistResponseError, axmReadAssistResponseStatus, axmReadPlainTextMessagePayload, axmReadReplyToUserMessageId, axmResolveAssistFinalAnswerText, axmResolveChatAiTargetText, axmRoomEntityToConversation, axmRoomWithAssistPeerDisplayName, axmSanitizeAssistUserAnswerText, axmShouldPreferPersistedAssistOverLiveCache, axmShowCommentPopupCommandDefinition, axmSortMessagesNewestFirst, axmSyncAssistPeerDisplayName, axmSyntheticEmbedMessage, axmUserRowToParticipant, commentsPlugin, createConversationServiceSessionAdapter, persistChatAttachment };
|
|
1688
1715
|
export type { AXMAddReactionCommandInput, AXMAssistConversationSnapshotLite, AXMAssistDefaultResolverPort, AXMAssistStarterPromptChipOptions, AXMChatAiTargetRow, AXMChatAssistCatalogPort, AXMChatSidebarAction, AXMComment, AXMCommentEvent, AXMCommentEventType, AXMCommentThread, AXMConversationAssistResponsePort, AXMConversationRegularAutoReplyPort, AXMConversationServiceSessionAdapter, AXMEntityChatCreateData, AXMEntityChatRef, AXMMiniChatInboxConversationFilter, AXMMiniChatPanelAnchor, AXMMiniChatPanelOpenOptions, AXMMiniChatPanelPosition, AXMMiniChatPanelScope, AXMMiniChatPanelSessionState, AXMMiniChatPanelSide, AXMSendAssistChatMessageOptions, AXMShowCommentPopupCommandInput, AXMThreadEvent, AXMThreadEventType, AXPAiChatFollowUpCommandLite, AXPAiChatFollowUpItemLite, AXPAiChatMessageLite, AXPAiChatNodeOrFollowUpResponseLite, AXPAiChatTextResponseLite, AXPAiEffectiveAssistRowLite, AxmAssistPartitionedAnswerText, AxmAssistResponseStatus, AxmAssistTranscriptLinePayload, AxmAssistUserVisibleItem, CommentsDisplayMode, CommentsPluginOptions };
|