@acorex-platform/module-conversation-client 0.0.28 → 0.0.30
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-DsjrXRZ6.mjs → acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-C6fmww4a.mjs} +17 -24
- package/fesm2022/{acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-DsjrXRZ6.mjs.map → acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-C6fmww4a.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-after-message-sent.command-D-DZ9ylV.mjs → acorex-platform-module-conversation-client-after-message-sent.command-CmDyRc1Y.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-after-message-sent.command-D-DZ9ylV.mjs.map → acorex-platform-module-conversation-client-after-message-sent.command-CmDyRc1Y.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-BfjJCQ-e.mjs → acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-CgXdPrQH.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-BfjJCQ-e.mjs.map → acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-CgXdPrQH.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-chat-call-session-page.component-DkX4JSbN.mjs → acorex-platform-module-conversation-client-chat-call-session-page.component-C8b3D66q.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-chat-call-session-page.component-DkX4JSbN.mjs.map → acorex-platform-module-conversation-client-chat-call-session-page.component-C8b3D66q.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-chat-call-start-popup.component-D4go5xbr.mjs → acorex-platform-module-conversation-client-chat-call-start-popup.component-CjDlRcZn.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-chat-call-start-popup.component-D4go5xbr.mjs.map → acorex-platform-module-conversation-client-chat-call-start-popup.component-CjDlRcZn.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-comments-page.component-Bq4SdK0_.mjs → acorex-platform-module-conversation-client-comments-page.component-5wGD4EjK.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-comments-page.component-Bq4SdK0_.mjs.map → acorex-platform-module-conversation-client-comments-page.component-5wGD4EjK.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-mark-conversation-unread.command-BlYDwGVe.mjs → acorex-platform-module-conversation-client-mark-conversation-unread.command-xUnxBY_Y.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-mark-conversation-unread.command-BlYDwGVe.mjs.map → acorex-platform-module-conversation-client-mark-conversation-unread.command-xUnxBY_Y.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-retry-assist-response.command-BQLK6F69.mjs → acorex-platform-module-conversation-client-retry-assist-response.command-CPpgvLKH.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-retry-assist-response.command-BQLK6F69.mjs.map → acorex-platform-module-conversation-client-retry-assist-response.command-CPpgvLKH.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-sync-read-state.command-B1Z_gZ6O.mjs → acorex-platform-module-conversation-client-sync-read-state.command-B6v_j64v.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-sync-read-state.command-B1Z_gZ6O.mjs.map → acorex-platform-module-conversation-client-sync-read-state.command-B6v_j64v.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-conversation-client.mjs +1 -1
- package/package.json +2 -2
- package/types/acorex-platform-module-conversation-client.d.ts +1 -2
|
@@ -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-xUnxBY_Y.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;;;;;"}
|
|
@@ -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-C6fmww4a.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-CPpgvLKH.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-CPpgvLKH.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;;;;;"}
|
|
@@ -3,7 +3,7 @@ import { inject, Injectable } from '@angular/core';
|
|
|
3
3
|
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
4
4
|
import { RootConfig } from '@acorex-platform/module-communication-management-client/contracts';
|
|
5
5
|
import { AXPCommunicationManagementClient } from '@acorex-platform/module-communication-management-client';
|
|
6
|
-
import { A as AXMConversationEntityStoreService, d as AXMConversationFocusService } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-
|
|
6
|
+
import { A as AXMConversationEntityStoreService, d as AXMConversationFocusService } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-C6fmww4a.mjs';
|
|
7
7
|
|
|
8
8
|
//#region ---- Conversation in-app notification sync ----
|
|
9
9
|
const IN_APP_CHANNEL = 'in-app';
|
|
@@ -139,4 +139,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
139
139
|
}] });
|
|
140
140
|
|
|
141
141
|
export { AXMConversationSyncReadStateCommand };
|
|
142
|
-
//# sourceMappingURL=acorex-platform-module-conversation-client-sync-read-state.command-
|
|
142
|
+
//# sourceMappingURL=acorex-platform-module-conversation-client-sync-read-state.command-B6v_j64v.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-conversation-client-sync-read-state.command-B1Z_gZ6O.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/chat/services/conversation-in-app-notification-sync.service.ts","../../../../libs/modules/conversation/client/src/lib/features/commands/sync-read-state.command.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n RootConfig,\n type AXMCommunicationDeliveryModel,\n type AXMCommunicationModel,\n} from '@acorex-platform/module-communication-management-client/contracts';\nimport { AXPCommunicationManagementClient } from '@acorex-platform/module-communication-management-client';\n\n//#region ---- Conversation in-app notification sync ----\n\nconst IN_APP_CHANNEL = 'in-app';\nconst SYNC_MIN_INTERVAL_MS = 2500;\n\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationInAppNotificationSyncService {\n private readonly client = inject(AXPCommunicationManagementClient, { optional: true });\n private readonly entityService = inject(AXPEntityService);\n private readonly deliveryData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.communicationDelivery.name)\n .data<string, AXMCommunicationDeliveryModel, AXMCommunicationDeliveryModel>();\n private readonly communicationData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.communication.name)\n .data<string, AXMCommunicationModel, AXMCommunicationModel>();\n\n private readonly lastSyncAt = new Map<string, number>();\n private readonly syncChains = new Map<string, Promise<void>>();\n\n async markConversationInAppRead(conversationId: string, recipientUserId: string): Promise<void> {\n if (!this.client || !conversationId.trim() || !recipientUserId.trim()) {\n return;\n }\n\n const key = `${conversationId.trim()}:${recipientUserId.trim()}`;\n const now = Date.now();\n const last = this.lastSyncAt.get(key) ?? 0;\n if (now - last < SYNC_MIN_INTERVAL_MS) {\n return;\n }\n\n const previous = this.syncChains.get(key) ?? Promise.resolve();\n const next = previous.then(() => this.markConversationInAppReadInternal(conversationId, recipientUserId));\n this.syncChains.set(\n key,\n next.finally(() => {\n if (this.syncChains.get(key) === next) {\n this.syncChains.delete(key);\n }\n }),\n );\n await next;\n this.lastSyncAt.set(key, Date.now());\n }\n\n private async markConversationInAppReadInternal(\n conversationId: string,\n recipientUserId: string,\n ): Promise<void> {\n const prefix = `conversation:${conversationId.trim()}:`;\n\n const communications = await this.communicationData.query({\n skip: 0,\n take: 100,\n filter: {\n field: 'correlationId',\n operator: { type: 'contains' },\n value: prefix,\n },\n });\n\n const communicationIds = (communications.items as AXMCommunicationModel[])\n .filter((row) => String(row.correlationId ?? '').startsWith(prefix))\n .map((row) => row.id)\n .filter(Boolean);\n\n if (communicationIds.length === 0) {\n return;\n }\n\n const deliveries = await this.deliveryData.query({\n skip: 0,\n take: Math.max(communicationIds.length, 1),\n filter: {\n logic: 'and',\n filters: [\n { field: 'channel', operator: { type: 'equal' }, value: IN_APP_CHANNEL },\n { field: 'recipientUserId', operator: { type: 'equal' }, value: recipientUserId },\n { field: 'readAt', operator: { type: 'isNull' }, value: null },\n {\n logic: 'or',\n filters: communicationIds.map((id) => ({\n field: 'communicationId',\n operator: { type: 'equal' as const },\n value: id,\n })),\n },\n ],\n },\n });\n\n const deliveryIds = (deliveries.items as AXMCommunicationDeliveryModel[])\n .map((row) => row.id)\n .filter(Boolean);\n\n if (deliveryIds.length === 0) {\n return;\n }\n\n await this.client!.markInAppRead({ deliveryIds });\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\n\nimport { inject, Injectable } from '@angular/core';\n\nimport { axmIsAssistStreamingMessage } from '../chat/plugins/utils/conversation-unread.util';\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';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXMSyncReadStateOptions {\n conversationId: string;\n messageIds?: string[];\n currentUserId: string;\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 this.focus.setFocusedConversation(conversationId);\n\n if (!options.messageIds?.length) {\n const cachedConversation = this.store.getCachedConversation(conversationId);\n const cachedMessages = this.store.getCachedMessageList(conversationId);\n const skipInAppSync =\n cachedMessages !== null &&\n cachedMessages.length === 0 &&\n (cachedConversation?.unreadCount ?? 0) === 0;\n\n if (cachedConversation?.unreadCount === 0) {\n return { success: true, kind: 'object', data: undefined };\n }\n\n await this.store.setUnreadCount(conversationId, 0);\n if (!skipInAppSync) {\n await this.inAppSync.markConversationInAppRead(conversationId, options.currentUserId);\n }\n return { success: true, kind: 'object', data: undefined };\n }\n\n const marked = await this.focus.markMessagesRead(conversationId, options.messageIds, options.currentUserId);\n await this.inAppSync.markConversationInAppRead(conversationId, options.currentUserId);\n void marked;\n return { success: true, kind: 'object', data: undefined };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AASA;AAEA,MAAM,cAAc,GAAG,QAAQ;AAC/B,MAAM,oBAAoB,GAAG,IAAI;MAGpB,2CAA2C,CAAA;AADxD,IAAA,WAAA,GAAA;QAEmB,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gCAAgC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACrE,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACxC,IAAA,CAAA,YAAY,GAAG,IAAI,CAAC;AAClC,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI;AACjF,aAAA,IAAI,EAAwE;QAC9D,IAAA,CAAA,iBAAiB,GAAG,IAAI,CAAC;AACvC,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI;AACzE,aAAA,IAAI,EAAwD;AAE9C,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,GAAG,EAAkB;AACtC,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,GAAG,EAAyB;AAoF/D,IAAA;AAlFC,IAAA,MAAM,yBAAyB,CAAC,cAAsB,EAAE,eAAuB,EAAA;AAC7E,QAAA,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC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O,CAAC,aAAa,CAAC;AACrF,QAAA,KAAK,MAAM;AACX,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;IAC3D;8GArCW,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
|
+
{"version":3,"file":"acorex-platform-module-conversation-client-sync-read-state.command-B6v_j64v.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/chat/services/conversation-in-app-notification-sync.service.ts","../../../../libs/modules/conversation/client/src/lib/features/commands/sync-read-state.command.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n RootConfig,\n type AXMCommunicationDeliveryModel,\n type AXMCommunicationModel,\n} from '@acorex-platform/module-communication-management-client/contracts';\nimport { AXPCommunicationManagementClient } from '@acorex-platform/module-communication-management-client';\n\n//#region ---- Conversation in-app notification sync ----\n\nconst IN_APP_CHANNEL = 'in-app';\nconst SYNC_MIN_INTERVAL_MS = 2500;\n\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationInAppNotificationSyncService {\n private readonly client = inject(AXPCommunicationManagementClient, { optional: true });\n private readonly entityService = inject(AXPEntityService);\n private readonly deliveryData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.communicationDelivery.name)\n .data<string, AXMCommunicationDeliveryModel, AXMCommunicationDeliveryModel>();\n private readonly communicationData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.communication.name)\n .data<string, AXMCommunicationModel, AXMCommunicationModel>();\n\n private readonly lastSyncAt = new Map<string, number>();\n private readonly syncChains = new Map<string, Promise<void>>();\n\n async markConversationInAppRead(conversationId: string, recipientUserId: string): Promise<void> {\n if (!this.client || !conversationId.trim() || !recipientUserId.trim()) {\n return;\n }\n\n const key = `${conversationId.trim()}:${recipientUserId.trim()}`;\n const now = Date.now();\n const last = this.lastSyncAt.get(key) ?? 0;\n if (now - last < SYNC_MIN_INTERVAL_MS) {\n return;\n }\n\n const previous = this.syncChains.get(key) ?? Promise.resolve();\n const next = previous.then(() => this.markConversationInAppReadInternal(conversationId, recipientUserId));\n this.syncChains.set(\n key,\n next.finally(() => {\n if (this.syncChains.get(key) === next) {\n this.syncChains.delete(key);\n }\n }),\n );\n await next;\n this.lastSyncAt.set(key, Date.now());\n }\n\n private async markConversationInAppReadInternal(\n conversationId: string,\n recipientUserId: string,\n ): Promise<void> {\n const prefix = `conversation:${conversationId.trim()}:`;\n\n const communications = await this.communicationData.query({\n skip: 0,\n take: 100,\n filter: {\n field: 'correlationId',\n operator: { type: 'contains' },\n value: prefix,\n },\n });\n\n const communicationIds = (communications.items as AXMCommunicationModel[])\n .filter((row) => String(row.correlationId ?? '').startsWith(prefix))\n .map((row) => row.id)\n .filter(Boolean);\n\n if (communicationIds.length === 0) {\n return;\n }\n\n const deliveries = await this.deliveryData.query({\n skip: 0,\n take: Math.max(communicationIds.length, 1),\n filter: {\n logic: 'and',\n filters: [\n { field: 'channel', operator: { type: 'equal' }, value: IN_APP_CHANNEL },\n { field: 'recipientUserId', operator: { type: 'equal' }, value: recipientUserId },\n { field: 'readAt', operator: { type: 'isNull' }, value: null },\n {\n logic: 'or',\n filters: communicationIds.map((id) => ({\n field: 'communicationId',\n operator: { type: 'equal' as const },\n value: id,\n })),\n },\n ],\n },\n });\n\n const deliveryIds = (deliveries.items as AXMCommunicationDeliveryModel[])\n .map((row) => row.id)\n .filter(Boolean);\n\n if (deliveryIds.length === 0) {\n return;\n }\n\n await this.client!.markInAppRead({ deliveryIds });\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\n\nimport { inject, Injectable } from '@angular/core';\n\nimport { axmIsAssistStreamingMessage } from '../chat/plugins/utils/conversation-unread.util';\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';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXMSyncReadStateOptions {\n conversationId: string;\n messageIds?: string[];\n currentUserId: string;\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 this.focus.setFocusedConversation(conversationId);\n\n if (!options.messageIds?.length) {\n const cachedConversation = this.store.getCachedConversation(conversationId);\n const cachedMessages = this.store.getCachedMessageList(conversationId);\n const skipInAppSync =\n cachedMessages !== null &&\n cachedMessages.length === 0 &&\n (cachedConversation?.unreadCount ?? 0) === 0;\n\n if (cachedConversation?.unreadCount === 0) {\n return { success: true, kind: 'object', data: undefined };\n }\n\n await this.store.setUnreadCount(conversationId, 0);\n if (!skipInAppSync) {\n await this.inAppSync.markConversationInAppRead(conversationId, options.currentUserId);\n }\n return { success: true, kind: 'object', data: undefined };\n }\n\n const marked = await this.focus.markMessagesRead(conversationId, options.messageIds, options.currentUserId);\n await this.inAppSync.markConversationInAppRead(conversationId, options.currentUserId);\n void marked;\n return { success: true, kind: 'object', data: undefined };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AASA;AAEA,MAAM,cAAc,GAAG,QAAQ;AAC/B,MAAM,oBAAoB,GAAG,IAAI;MAGpB,2CAA2C,CAAA;AADxD,IAAA,WAAA,GAAA;QAEmB,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gCAAgC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACrE,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACxC,IAAA,CAAA,YAAY,GAAG,IAAI,CAAC;AAClC,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI;AACjF,aAAA,IAAI,EAAwE;QAC9D,IAAA,CAAA,iBAAiB,GAAG,IAAI,CAAC;AACvC,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI;AACzE,aAAA,IAAI,EAAwD;AAE9C,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,GAAG,EAAkB;AACtC,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,GAAG,EAAyB;AAoF/D,IAAA;AAlFC,IAAA,MAAM,yBAAyB,CAAC,cAAsB,EAAE,eAAuB,EAAA;AAC7E,QAAA,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,EAAE;YACrE;QACF;AAEA,QAAA,MAAM,GAAG,GAAG,CAAA,EAAG,cAAc,CAAC,IAAI,EA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AAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;IAC3D;8GArCW,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 { z as AXMAddReactionCommand, y as AXMAssistSuggestionChipsComponent, B as AXMChatComponent, C as AXMChatConversationApi, D as AXMChatEntityConversationApi, E as AXMChatEntityConversationFocusHandler, F as AXMChatEntityConversationRoomQueryService, G as AXMChatEntityMessageApi, H as AXMChatEntityRealtimeApi, I as AXMChatEntityUserApi, J as AXMChatMessageApi, K as AXMChatRealtimeApi, i as AXMChatUserApi, e as AXMCommentComponent, L as AXMCommentManagementService, M as AXMCommentPopupComponent, N as AXMCommentRealtimeService, O as AXMCommentRealtimeServiceImpl, P as AXMCommentService, Q as AXMCommentServiceImpl, R as AXMCommentWidgetViewComponent, S as AXMConversationAssistBackgroundOperationHandler, A as AXMConversationEntityStoreService, d as AXMConversationFocusService, T as AXMConversationModule, m as AXMConversationRealtimeBus, U as AXMEntityChatService, V as AXMMiniChatComponent, W as AXMMiniChatHeaderSlotComponent, X as AXMMiniChatHistoryComponent, Y as AXMMiniChatInboxHistoryComponent, Z as AXMMiniChatInboxPanelHostComponent, _ as AXMMiniChatLauncherComponent, $ as AXMMiniChatPanelComponent, a0 as AXMMiniChatPanelService, a1 as AXMShowCommentPopupCommand, a2 as AXM_AI_MANAGEMENT_AGENT_ENTITY_NAME, a3 as AXM_AI_MANAGEMENT_ASSIST_ENTITY_NAME, a4 as AXM_AI_MANAGEMENT_MODULE_NAME, a5 as AXM_ASSIST_DEFAULT_RESOLVER_PORT, a6 as AXM_ASSIST_TRANSCRIPT_LINE_PAYLOAD_TYPE, a7 as AXM_CHAT_ASSIST_CATALOG_PORT, a8 as AXM_CHAT_EMPTY_STATE_COMPONENT, a9 as AXM_CHAT_SIDEBAR_ACTION_PROVIDER, aa as AXM_CONVERSATION_ASSIST_BACKGROUND_OPERATION_HANDLERS, ab as AXM_CONVERSATION_ASSIST_BACKGROUND_OPERATION_KEY, a as AXM_CONVERSATION_ASSIST_RESPONSE_PORT, ac as AXM_CONVERSATION_CHAT_ATTACHMENT_CATEGORY, ad as AXM_CONVERSATION_CHAT_ATTACHMENT_REF_TYPE, b as AXM_CONVERSATION_REGULAR_AUTO_REPLY_PORT, ae as AXM_CONVERSATION_TAB_BOT, af as AXM_MINI_CHAT_INBOX_CONVERSATION_FILTER, ag as AXM_MINI_CHAT_INBOX_SESSION_KEY, ah as AXPCommentWidget, ai as COMMENTS_PAGE_COMPONENT_KEY, aj as CONVERSATION_AFTER_MESSAGE_SENT_COMMAND, ak as CONVERSATION_EMIT_TYPING_INDICATOR_COMMAND, al as CONVERSATION_MARK_CONVERSATION_UNREAD_COMMAND, am as CONVERSATION_OPEN_CHAT_COMMAND, an as CONVERSATION_RETRY_ASSIST_RESPONSE_COMMAND, ao as CONVERSATION_SEND_ASSIST_CHAT_MESSAGE_COMMAND, ap as CONVERSATION_START_ASSIST_CHAT_COMMAND, aq as CONVERSATION_START_DIRECT_CHAT_COMMAND, ar as CONVERSATION_SYNC_READ_STATE_COMMAND, as as axmApplyAnswerTextToAssistPayloadLine, at as axmAssistFollowUpItemsFromUnknown, au as axmAssistHasFinalizeMetadata, av as axmAssistLastTranscriptLine, aw as axmAssistNormalizeFollowUpItemForConversation, ax as axmAssistNormalizeFollowUpItemsForConversation, ay as axmAssistPersistedMessageLooksComplete, az as axmAssistResolveFollowUpCommandName, aA as axmAssistStarterPromptChipItems, aB as axmAssistUserFacingPayloadLine, aC as axmAssistUserVisibleItemsForLine, aD as axmAssistWidgetNodeDedupeKey, t as axmAssistWidgetNodeFromUnknown, aE as axmBuildAiChatConversationMetadata, aF as axmBuildAssistPeerParticipantFromCreateData, aG as axmBuildAssistPeerParticipantFromId, aH as axmBuildAssistTranscriptLinePayload, aI as axmBuildAutoTitleFromUserText, aJ as axmBuildEntityChatConversationMetadata, aK as axmChatAiPeerParticipantId, aL as axmChatAiTargetAvatarUrl, aM as axmChatAiTargetDisplayDescription, aN as axmChatAiTargetDisplayName, aO as axmChatAiTargetShortcutDescriptionKey, aP as axmCoerceDate, aQ as axmCoerceTimestampMs, aR as axmComputeConversationUnreadCount, c as axmConversationHasAiChat, aS as axmConversationIsEntityChat, aT as axmConversationMatchesEntity, aU as axmExtractAssistIdFromMetadata, aV as axmExtractAssistSnapshotFromMetadata, aW as axmExtractDirectAgentIdFromMetadata, aX as axmExtractEntityRefFromMetadata, aY as axmExtractModelEntityIdFromMetadata, aZ as axmExtractTextFromPayload, a_ as axmFilterChatAiTargets, a$ as axmIsAssistBotConversation, b0 as axmIsAssistPeerParticipant, b1 as axmIsAssistRetryableStatus, b2 as axmIsAssistStreamingMessage, b3 as axmIsAssistStreamingStatus, b4 as axmIsAssistTerminalStatus, b5 as axmLoadChatAiTargets, b6 as axmMessageCountsTowardUnread, b7 as axmMessageEntityToMessage, b8 as axmNormalizeAssistTranscriptForChatUi, b9 as axmNormalizeAssistTranscriptLineResponses, ba as axmParseAssistTranscriptLinePayload, s as axmParseAssistTranscriptTextEnvelope, u as axmPartitionAssistAnswerText, p as axmReadAssistAiTranscript, q as axmReadAssistAiTranscriptRaw, bb as axmReadAssistResponseError, bc as axmReadAssistResponseStatus, bd as axmReadPlainTextMessagePayload, be as axmReadReplyToUserMessageId, bf as axmResolveAssistFinalAnswerText, bg as axmResolveChatAiTargetText, bh as axmRoomEntityToConversation, bi as axmRoomWithAssistPeerDisplayName, bj as axmSanitizeAssistUserAnswerText, bk as axmShouldPreferPersistedAssistOverLiveCache, bl as axmShowCommentPopupCommandDefinition, bm as axmSortMessagesNewestFirst, bn as axmSyncAssistPeerDisplayName, v as axmSyntheticEmbedMessage, bo as axmUserRowToParticipant, bp as commentsPlugin, bq as createConversationServiceSessionAdapter, br as persistChatAttachment } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-
|
|
1
|
+
export { z as AXMAddReactionCommand, y as AXMAssistSuggestionChipsComponent, B as AXMChatComponent, C as AXMChatConversationApi, D as AXMChatEntityConversationApi, E as AXMChatEntityConversationFocusHandler, F as AXMChatEntityConversationRoomQueryService, G as AXMChatEntityMessageApi, H as AXMChatEntityRealtimeApi, I as AXMChatEntityUserApi, J as AXMChatMessageApi, K as AXMChatRealtimeApi, i as AXMChatUserApi, e as AXMCommentComponent, L as AXMCommentManagementService, M as AXMCommentPopupComponent, N as AXMCommentRealtimeService, O as AXMCommentRealtimeServiceImpl, P as AXMCommentService, Q as AXMCommentServiceImpl, R as AXMCommentWidgetViewComponent, S as AXMConversationAssistBackgroundOperationHandler, A as AXMConversationEntityStoreService, d as AXMConversationFocusService, T as AXMConversationModule, m as AXMConversationRealtimeBus, U as AXMEntityChatService, V as AXMMiniChatComponent, W as AXMMiniChatHeaderSlotComponent, X as AXMMiniChatHistoryComponent, Y as AXMMiniChatInboxHistoryComponent, Z as AXMMiniChatInboxPanelHostComponent, _ as AXMMiniChatLauncherComponent, $ as AXMMiniChatPanelComponent, a0 as AXMMiniChatPanelService, a1 as AXMShowCommentPopupCommand, a2 as AXM_AI_MANAGEMENT_AGENT_ENTITY_NAME, a3 as AXM_AI_MANAGEMENT_ASSIST_ENTITY_NAME, a4 as AXM_AI_MANAGEMENT_MODULE_NAME, a5 as AXM_ASSIST_DEFAULT_RESOLVER_PORT, a6 as AXM_ASSIST_TRANSCRIPT_LINE_PAYLOAD_TYPE, a7 as AXM_CHAT_ASSIST_CATALOG_PORT, a8 as AXM_CHAT_EMPTY_STATE_COMPONENT, a9 as AXM_CHAT_SIDEBAR_ACTION_PROVIDER, aa as AXM_CONVERSATION_ASSIST_BACKGROUND_OPERATION_HANDLERS, ab as AXM_CONVERSATION_ASSIST_BACKGROUND_OPERATION_KEY, a as AXM_CONVERSATION_ASSIST_RESPONSE_PORT, ac as AXM_CONVERSATION_CHAT_ATTACHMENT_CATEGORY, ad as AXM_CONVERSATION_CHAT_ATTACHMENT_REF_TYPE, b as AXM_CONVERSATION_REGULAR_AUTO_REPLY_PORT, ae as AXM_CONVERSATION_TAB_BOT, af as AXM_MINI_CHAT_INBOX_CONVERSATION_FILTER, ag as AXM_MINI_CHAT_INBOX_SESSION_KEY, ah as AXPCommentWidget, ai as COMMENTS_PAGE_COMPONENT_KEY, aj as CONVERSATION_AFTER_MESSAGE_SENT_COMMAND, ak as CONVERSATION_EMIT_TYPING_INDICATOR_COMMAND, al as CONVERSATION_MARK_CONVERSATION_UNREAD_COMMAND, am as CONVERSATION_OPEN_CHAT_COMMAND, an as CONVERSATION_RETRY_ASSIST_RESPONSE_COMMAND, ao as CONVERSATION_SEND_ASSIST_CHAT_MESSAGE_COMMAND, ap as CONVERSATION_START_ASSIST_CHAT_COMMAND, aq as CONVERSATION_START_DIRECT_CHAT_COMMAND, ar as CONVERSATION_SYNC_READ_STATE_COMMAND, as as axmApplyAnswerTextToAssistPayloadLine, at as axmAssistFollowUpItemsFromUnknown, au as axmAssistHasFinalizeMetadata, av as axmAssistLastTranscriptLine, aw as axmAssistNormalizeFollowUpItemForConversation, ax as axmAssistNormalizeFollowUpItemsForConversation, ay as axmAssistPersistedMessageLooksComplete, az as axmAssistResolveFollowUpCommandName, aA as axmAssistStarterPromptChipItems, aB as axmAssistUserFacingPayloadLine, aC as axmAssistUserVisibleItemsForLine, aD as axmAssistWidgetNodeDedupeKey, t as axmAssistWidgetNodeFromUnknown, aE as axmBuildAiChatConversationMetadata, aF as axmBuildAssistPeerParticipantFromCreateData, aG as axmBuildAssistPeerParticipantFromId, aH as axmBuildAssistTranscriptLinePayload, aI as axmBuildAutoTitleFromUserText, aJ as axmBuildEntityChatConversationMetadata, aK as axmChatAiPeerParticipantId, aL as axmChatAiTargetAvatarUrl, aM as axmChatAiTargetDisplayDescription, aN as axmChatAiTargetDisplayName, aO as axmChatAiTargetShortcutDescriptionKey, aP as axmCoerceDate, aQ as axmCoerceTimestampMs, aR as axmComputeConversationUnreadCount, c as axmConversationHasAiChat, aS as axmConversationIsEntityChat, aT as axmConversationMatchesEntity, aU as axmExtractAssistIdFromMetadata, aV as axmExtractAssistSnapshotFromMetadata, aW as axmExtractDirectAgentIdFromMetadata, aX as axmExtractEntityRefFromMetadata, aY as axmExtractModelEntityIdFromMetadata, aZ as axmExtractTextFromPayload, a_ as axmFilterChatAiTargets, a$ as axmIsAssistBotConversation, b0 as axmIsAssistPeerParticipant, b1 as axmIsAssistRetryableStatus, b2 as axmIsAssistStreamingMessage, b3 as axmIsAssistStreamingStatus, b4 as axmIsAssistTerminalStatus, b5 as axmLoadChatAiTargets, b6 as axmMessageCountsTowardUnread, b7 as axmMessageEntityToMessage, b8 as axmNormalizeAssistTranscriptForChatUi, b9 as axmNormalizeAssistTranscriptLineResponses, ba as axmParseAssistTranscriptLinePayload, s as axmParseAssistTranscriptTextEnvelope, u as axmPartitionAssistAnswerText, p as axmReadAssistAiTranscript, q as axmReadAssistAiTranscriptRaw, bb as axmReadAssistResponseError, bc as axmReadAssistResponseStatus, bd as axmReadPlainTextMessagePayload, be as axmReadReplyToUserMessageId, bf as axmResolveAssistFinalAnswerText, bg as axmResolveChatAiTargetText, bh as axmRoomEntityToConversation, bi as axmRoomWithAssistPeerDisplayName, bj as axmSanitizeAssistUserAnswerText, bk as axmShouldPreferPersistedAssistOverLiveCache, bl as axmShowCommentPopupCommandDefinition, bm as axmSortMessagesNewestFirst, bn as axmSyncAssistPeerDisplayName, v as axmSyntheticEmbedMessage, bo as axmUserRowToParticipant, bp as commentsPlugin, bq as createConversationServiceSessionAdapter, br as persistChatAttachment } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-C6fmww4a.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.30",
|
|
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.30",
|
|
11
11
|
"tslib": "^2.3.0"
|
|
12
12
|
},
|
|
13
13
|
"module": "fesm2022/acorex-platform-module-conversation-client.mjs",
|
|
@@ -2,7 +2,6 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { Provider, InjectionToken, Type, Signal, OnInit, ElementRef, OnDestroy } from '@angular/core';
|
|
3
3
|
import * as i1 from '@acorex-platform/framework-client/layout/widget-core';
|
|
4
4
|
import { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
|
|
5
|
-
import * as i2 from '@angular/router';
|
|
6
5
|
import { AXPBackgroundOperationHandler, AXPBackgroundOperation, AXPFileStorageService } from '@acorex-platform/framework-client/common';
|
|
7
6
|
import * as _acorex_platform_framework_shared_core from '@acorex-platform/framework-shared/core';
|
|
8
7
|
import { AXPExecuteCommand, AXPMultiLanguageString, AXPWidgetNode, AXPUserReference, AXPEntityReference } from '@acorex-platform/framework-shared/core';
|
|
@@ -23,7 +22,7 @@ import { AXPWidgetConfig } from '@acorex-platform/framework-shared/widget-core';
|
|
|
23
22
|
|
|
24
23
|
declare class AXMConversationModule {
|
|
25
24
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXMConversationModule, never>;
|
|
26
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXMConversationModule, never, [typeof i1.AXPWidgetCoreModule],
|
|
25
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AXMConversationModule, never, [typeof i1.AXPWidgetCoreModule], never>;
|
|
27
26
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<AXMConversationModule>;
|
|
28
27
|
}
|
|
29
28
|
|