@futdevpro/nts-dynamo 1.14.29 → 1.14.32
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/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts +0 -3
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js +20 -15
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -1
- package/build/_modules/ai/_services/ai-llm.service-base.d.ts +0 -2
- package/build/_modules/ai/_services/ai-llm.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_services/ai-provider.service-base.d.ts +2 -1
- package/build/_modules/ai/_services/ai-provider.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_services/ai-provider.service-base.js +2 -1
- package/build/_modules/ai/_services/ai-provider.service-base.js.map +1 -1
- package/build/_modules/assistant/_collections/ass.util.d.ts +2 -2
- package/build/_modules/assistant/_collections/ass.util.d.ts.map +1 -1
- package/build/_modules/assistant/_services/ass-io.control-service.d.ts +5 -9
- package/build/_modules/assistant/_services/ass-io.control-service.d.ts.map +1 -1
- package/build/_modules/assistant/_services/ass-io.control-service.js +9 -10
- package/build/_modules/assistant/_services/ass-io.control-service.js.map +1 -1
- package/build/_modules/assistant/_services/ass-main.control-service.d.ts +26 -10
- package/build/_modules/assistant/_services/ass-main.control-service.d.ts.map +1 -1
- package/build/_modules/assistant/_services/ass-main.control-service.js +49 -4
- package/build/_modules/assistant/_services/ass-main.control-service.js.map +1 -1
- package/build/_modules/assistant/index.d.ts +1 -1
- package/build/_modules/assistant/index.d.ts.map +1 -1
- package/build/_modules/assistant/index.js +1 -1
- package/build/_modules/assistant/index.js.map +1 -1
- package/build/_modules/bot/_models/bot-channel-wrapper.interface.d.ts +17 -0
- package/build/_modules/bot/_models/bot-channel-wrapper.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/{bot-message.interface.js → bot-channel-wrapper.interface.js} +1 -1
- package/build/_modules/bot/_models/bot-channel-wrapper.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-command.interface.d.ts +2 -2
- package/build/_modules/bot/_models/bot-command.interface.d.ts.map +1 -1
- package/build/_modules/bot/_models/bot-global-settings.interface.d.ts +1 -1
- package/build/_modules/bot/_models/bot-global-settings.interface.d.ts.map +1 -1
- package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts +16 -13
- package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts.map +1 -1
- package/build/_modules/bot/_models/bot-user-wrapper.interface.d.ts +17 -0
- package/build/_modules/bot/_models/bot-user-wrapper.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/{bot-channel.interface.js → bot-user-wrapper.interface.js} +1 -1
- package/build/_modules/bot/_models/bot-user-wrapper.interface.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.d.ts +0 -7
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.d.ts.map +1 -1
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.js +10 -2
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.js.map +1 -1
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.d.ts +68 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.js +397 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/index.d.ts +1 -4
- package/build/_modules/bot/_modules/discord-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/discord-bot/index.js +2 -5
- package/build/_modules/bot/_modules/discord-bot/index.js.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.d.ts +3 -3
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.d.ts.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.js +2 -2
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.js.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_models/dyb-platform.types.d.ts +6 -6
- package/build/_modules/bot/_modules/dynamo-bot/_models/dyb-platform.types.d.ts.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.d.ts +60 -0
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/dynamo-bot/_services/{dyb-messaging-provider.service.js → dyb-messaging-provider.control-service.js} +134 -108
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.js.map +1 -0
- package/build/_modules/bot/_modules/dynamo-bot/index.d.ts +1 -2
- package/build/_modules/bot/_modules/dynamo-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/index.js +1 -2
- package/build/_modules/bot/_modules/dynamo-bot/index.js.map +1 -1
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.d.ts +6 -6
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.d.ts.map +1 -1
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.d.ts +56 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.js +135 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.js.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/index.d.ts +1 -2
- package/build/_modules/bot/_modules/slack-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/slack-bot/index.js +1 -3
- package/build/_modules/bot/_modules/slack-bot/index.js.map +1 -1
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.d.ts +6 -6
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.d.ts.map +1 -1
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.d.ts +56 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.js +135 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.js.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/index.d.ts +1 -2
- package/build/_modules/bot/_modules/teams-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/teams-bot/index.js +1 -3
- package/build/_modules/bot/_modules/teams-bot/index.js.map +1 -1
- package/build/_modules/bot/_services/bot-commands.control-service.d.ts +8 -11
- package/build/_modules/bot/_services/bot-commands.control-service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-commands.control-service.js +60 -15
- package/build/_modules/bot/_services/bot-commands.control-service.js.map +1 -1
- package/build/_modules/bot/_services/bot-io.control-service.d.ts +16 -17
- package/build/_modules/bot/_services/bot-io.control-service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-io.control-service.js +60 -51
- package/build/_modules/bot/_services/bot-io.control-service.js.map +1 -1
- package/build/_modules/bot/_services/bot-main.control-service.d.ts +18 -37
- package/build/_modules/bot/_services/bot-main.control-service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-main.control-service.js +127 -264
- package/build/_modules/bot/_services/bot-main.control-service.js.map +1 -1
- package/build/_modules/bot/_services/bot-messaging-provider.service-base.d.ts +71 -0
- package/build/_modules/bot/_services/bot-messaging-provider.service-base.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-messaging-provider.service-base.js +16 -0
- package/build/_modules/bot/_services/bot-messaging-provider.service-base.js.map +1 -0
- package/build/_modules/bot/_services/bot-routines.control-service.d.ts +6 -9
- package/build/_modules/bot/_services/bot-routines.control-service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-routines.control-service.js +29 -9
- package/build/_modules/bot/_services/bot-routines.control-service.js.map +1 -1
- package/build/_modules/bot/index.d.ts +3 -7
- package/build/_modules/bot/index.d.ts.map +1 -1
- package/build/_modules/bot/index.js +9 -7
- package/build/_modules/bot/index.js.map +1 -1
- package/build/_modules/messaging/_collections/msg-global-settings.const.d.ts.map +1 -1
- package/build/_modules/messaging/_collections/msg-global-settings.const.js +0 -5
- package/build/_modules/messaging/_collections/msg-global-settings.const.js.map +1 -1
- package/build/_modules/messaging/_collections/msg.util.d.ts +2 -2
- package/build/_modules/messaging/_collections/msg.util.d.ts.map +1 -1
- package/build/_modules/messaging/_collections/msg.util.js.map +1 -1
- package/build/_modules/messaging/_models/msg-global-settings.interface.d.ts +0 -9
- package/build/_modules/messaging/_models/msg-global-settings.interface.d.ts.map +1 -1
- package/build/_modules/messaging/_services/msg-integration.control-service.d.ts +0 -25
- package/build/_modules/messaging/_services/msg-integration.control-service.d.ts.map +1 -1
- package/build/_modules/messaging/_services/msg-integration.control-service.js +180 -125
- package/build/_modules/messaging/_services/msg-integration.control-service.js.map +1 -1
- package/build/_modules/messaging/index.d.ts +0 -1
- package/build/_modules/messaging/index.d.ts.map +1 -1
- package/build/_modules/messaging/index.js +1 -1
- package/build/_modules/messaging/index.js.map +1 -1
- package/package.json +1 -1
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.ts +4 -4
- package/src/_modules/ai/_services/ai-llm.service-base.ts +2 -2
- package/src/_modules/ai/_services/ai-provider.service-base.ts +2 -1
- package/src/_modules/assistant/_collections/ass.util.ts +2 -2
- package/src/_modules/assistant/_services/ass-io.control-service.ts +17 -48
- package/src/_modules/assistant/_services/ass-main.control-service.ts +82 -32
- package/src/_modules/assistant/index.ts +1 -1
- package/src/_modules/bot/_models/bot-channel-wrapper.interface.ts +24 -0
- package/src/_modules/bot/_models/bot-command.interface.ts +2 -2
- package/src/_modules/bot/_models/bot-global-settings.interface.ts +1 -1
- package/src/_modules/bot/_models/bot-message-wrapper.interface.ts +18 -18
- package/src/_modules/bot/_models/bot-user-wrapper.interface.ts +35 -0
- package/src/_modules/bot/_modules/discord-bot/_models/dib-platform.types.ts +8 -7
- package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.ts +529 -0
- package/src/_modules/bot/_modules/discord-bot/index.ts +2 -5
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.ts +8 -5
- package/src/_modules/bot/_modules/dynamo-bot/_models/dyb-platform.types.ts +6 -6
- package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.ts +436 -0
- package/src/_modules/bot/_modules/dynamo-bot/index.ts +1 -2
- package/src/_modules/bot/_modules/slack-bot/_models/slb-platform.types.ts +6 -6
- package/src/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.ts +190 -0
- package/src/_modules/bot/_modules/slack-bot/index.ts +1 -3
- package/src/_modules/bot/_modules/teams-bot/_models/teb-platform.types.ts +6 -6
- package/src/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.ts +190 -0
- package/src/_modules/bot/_modules/teams-bot/index.ts +1 -4
- package/src/_modules/bot/_services/bot-commands.control-service.ts +64 -34
- package/src/_modules/bot/_services/bot-io.control-service.ts +86 -95
- package/src/_modules/bot/_services/bot-main.control-service.ts +253 -240
- package/src/_modules/bot/_services/bot-messaging-provider.service-base.ts +153 -0
- package/src/_modules/bot/_services/bot-routines.control-service.ts +39 -44
- package/src/_modules/bot/index.ts +9 -7
- package/src/_modules/messaging/README.md +2 -7
- package/src/_modules/messaging/_collections/msg-global-settings.const.ts +0 -6
- package/src/_modules/messaging/_collections/msg.util.ts +2 -2
- package/src/_modules/messaging/_models/msg-global-settings.interface.ts +0 -12
- package/src/_modules/messaging/_services/msg-integration.control-service.ts +180 -179
- package/src/_modules/messaging/index.ts +1 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.d.ts +0 -22
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.d.ts.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.js +0 -187
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.js.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.d.ts +0 -27
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.d.ts.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.js +0 -277
- package/build/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.js.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.d.ts +0 -23
- package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.d.ts.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.js +0 -319
- package/build/_modules/ai/_modules/open-ai/_services/oai-document.data-service.js.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-vector-data.service.d.ts +0 -118
- package/build/_modules/ai/_modules/open-ai/_services/oai-vector-data.service.d.ts.map +0 -1
- package/build/_modules/ai/_modules/open-ai/_services/oai-vector-data.service.js +0 -460
- package/build/_modules/ai/_modules/open-ai/_services/oai-vector-data.service.js.map +0 -1
- package/build/_modules/assistant/_services/ass.service-base.d.ts +0 -33
- package/build/_modules/assistant/_services/ass.service-base.d.ts.map +0 -1
- package/build/_modules/assistant/_services/ass.service-base.js +0 -58
- package/build/_modules/assistant/_services/ass.service-base.js.map +0 -1
- package/build/_modules/bot/_collections/bot-operations.util.d.ts +0 -21
- package/build/_modules/bot/_collections/bot-operations.util.d.ts.map +0 -1
- package/build/_modules/bot/_collections/bot-operations.util.js +0 -74
- package/build/_modules/bot/_collections/bot-operations.util.js.map +0 -1
- package/build/_modules/bot/_models/bot-channel.interface.d.ts +0 -8
- package/build/_modules/bot/_models/bot-channel.interface.d.ts.map +0 -1
- package/build/_modules/bot/_models/bot-channel.interface.js.map +0 -1
- package/build/_modules/bot/_models/bot-message.interface.d.ts +0 -15
- package/build/_modules/bot/_models/bot-message.interface.d.ts.map +0 -1
- package/build/_modules/bot/_models/bot-message.interface.js.map +0 -1
- package/build/_modules/bot/_models/bot-messaging-provider.interface.d.ts +0 -68
- package/build/_modules/bot/_models/bot-messaging-provider.interface.d.ts.map +0 -1
- package/build/_modules/bot/_models/bot-messaging-provider.interface.js +0 -3
- package/build/_modules/bot/_models/bot-messaging-provider.interface.js.map +0 -1
- package/build/_modules/bot/_models/bot-user.interface.d.ts +0 -8
- package/build/_modules/bot/_models/bot-user.interface.d.ts.map +0 -1
- package/build/_modules/bot/_models/bot-user.interface.js +0 -3
- package/build/_modules/bot/_models/bot-user.interface.js.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts +0 -11
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.js +0 -13
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.js.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts +0 -5
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.js +0 -19
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.js.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.d.ts +0 -56
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.js +0 -379
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.js.map +0 -1
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.d.ts +0 -5
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.d.ts.map +0 -1
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.js +0 -26
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.js.map +0 -1
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.d.ts +0 -55
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.js.map +0 -1
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts +0 -11
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts.map +0 -1
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.js +0 -13
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.js.map +0 -1
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.d.ts +0 -41
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.js +0 -119
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.js.map +0 -1
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts +0 -11
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts.map +0 -1
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.js +0 -13
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.js.map +0 -1
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.d.ts +0 -41
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.d.ts.map +0 -1
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.js +0 -119
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.js.map +0 -1
- package/build/_modules/bot/_services/bot-messaging-provider-factory.service.d.ts +0 -6
- package/build/_modules/bot/_services/bot-messaging-provider-factory.service.d.ts.map +0 -1
- package/build/_modules/bot/_services/bot-messaging-provider-factory.service.js +0 -47
- package/build/_modules/bot/_services/bot-messaging-provider-factory.service.js.map +0 -1
- package/src/_modules/assistant/_services/ass.service-base.ts +0 -100
- package/src/_modules/bot/_collections/bot-operations.util.ts +0 -149
- package/src/_modules/bot/_models/bot-channel.interface.ts +0 -7
- package/src/_modules/bot/_models/bot-message.interface.ts +0 -14
- package/src/_modules/bot/_models/bot-messaging-provider.interface.ts +0 -88
- package/src/_modules/bot/_models/bot-user.interface.ts +0 -7
- package/src/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.ts +0 -18
- package/src/_modules/bot/_modules/discord-bot/_collections/dib.util.ts +0 -20
- package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.service.ts +0 -475
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.ts +0 -26
- package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.service.ts +0 -403
- package/src/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.ts +0 -18
- package/src/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.service.ts +0 -156
- package/src/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.ts +0 -18
- package/src/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.service.ts +0 -156
- package/src/_modules/bot/_services/bot-messaging-provider-factory.service.ts +0 -56
|
@@ -1,179 +1,180 @@
|
|
|
1
|
-
import { DyNTS_SingletonService } from '../../../_services/base/singleton.service';
|
|
2
|
-
import { DyFM_Error, DyFM_Log, DyFM_DBFilter } from '@futdevpro/fsm-dynamo';
|
|
3
|
-
import { DyFM_Msg_Message, DyFM_Msg_Conversation } from '@futdevpro/fsm-dynamo/messaging';
|
|
4
|
-
import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
|
|
5
|
-
import { DyNTS_Msg_Message_DataService } from './msg-message.data-service';
|
|
6
|
-
import { DyNTS_Msg_Conversation_DataService } from './msg-conversation.data-service';
|
|
7
|
-
import { DyNTS_Msg_Events_Service } from './msg-events.service';
|
|
8
|
-
import { DyNTS_Msg_Util } from '../_collections/msg.util';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* Messaging Integration Control Service
|
|
13
|
-
* Handles integration between messaging system and bot/assistant modules
|
|
14
|
-
*/
|
|
15
|
-
export class DyNTS_Msg_Integration_ControlService extends DyNTS_SingletonService {
|
|
16
|
-
|
|
17
|
-
static getInstance(): DyNTS_Msg_Integration_ControlService {
|
|
18
|
-
return DyNTS_Msg_Integration_ControlService.getSingletonInstance();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
private eventsService = DyNTS_Msg_Events_Service.getInstance();
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Sync bot message to messaging system
|
|
25
|
-
* Called from bot IO when message is received
|
|
26
|
-
*/
|
|
27
|
-
async syncBotMessage<T>(
|
|
28
|
-
botMessage:
|
|
29
|
-
conversationId: string,
|
|
30
|
-
issuer: string
|
|
31
|
-
): Promise<DyFM_Msg_Message> {
|
|
32
|
-
try {
|
|
33
|
-
if (!DyNTS_global_settings.messaging_settings?.integration?.syncBotMessages) {
|
|
34
|
-
throw new Error('Bot message sync is disabled');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Convert bot message to messaging format
|
|
38
|
-
const msgMessage = DyNTS_Msg_Util.botMessageToMsgMessage(
|
|
39
|
-
botMessage,
|
|
40
|
-
conversationId,
|
|
41
|
-
issuer
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
// Save to database
|
|
45
|
-
const messageService = new DyNTS_Msg_Message_DataService({
|
|
46
|
-
message: msgMessage,
|
|
47
|
-
issuer,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
await messageService.saveData(messageService.data, false, false);
|
|
51
|
-
|
|
52
|
-
// Update conversation last message
|
|
53
|
-
const conversationService = new DyNTS_Msg_Conversation_DataService({
|
|
54
|
-
issuer,
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
await conversationService.updateLastMessage(
|
|
58
|
-
conversationId,
|
|
59
|
-
messageService.data._id!,
|
|
60
|
-
msgMessage.content.substring(0, 100)
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
// Emit real-time event
|
|
64
|
-
this.eventsService.emitMessageSent(messageService.data, conversationId);
|
|
65
|
-
|
|
66
|
-
return messageService.data;
|
|
67
|
-
} catch (error) {
|
|
68
|
-
DyFM_Log.error('Failed to sync bot message', error);
|
|
69
|
-
throw new DyFM_Error({
|
|
70
|
-
...this.getDefaultErrorSettings('syncBotMessage', error, issuer),
|
|
71
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-MSG-SBM`,
|
|
72
|
-
userMessage: 'Failed to sync bot message to messaging system.',
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Sync assistant response to messaging system
|
|
79
|
-
* Called from assistant IO when AI responds
|
|
80
|
-
*/
|
|
81
|
-
async syncAssistantMessage(
|
|
82
|
-
content: string,
|
|
83
|
-
conversationId: string,
|
|
84
|
-
aiProvider: string,
|
|
85
|
-
aiModel: string,
|
|
86
|
-
senderId: string,
|
|
87
|
-
issuer: string
|
|
88
|
-
): Promise<DyFM_Msg_Message> {
|
|
89
|
-
try {
|
|
90
|
-
if (!DyNTS_global_settings.messaging_settings?.integration?.syncAssistantMessages) {
|
|
91
|
-
throw new Error('Assistant message sync is disabled');
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Create AI message
|
|
95
|
-
const msgMessage = DyNTS_Msg_Util.createAIMessage(
|
|
96
|
-
conversationId,
|
|
97
|
-
content,
|
|
98
|
-
aiProvider,
|
|
99
|
-
aiModel,
|
|
100
|
-
senderId,
|
|
101
|
-
issuer
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
// Save to database
|
|
105
|
-
const messageService = new DyNTS_Msg_Message_DataService({
|
|
106
|
-
message: msgMessage,
|
|
107
|
-
issuer,
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
await messageService.saveData(messageService.data, false, false);
|
|
111
|
-
|
|
112
|
-
// Update conversation last message
|
|
113
|
-
const conversationService = new DyNTS_Msg_Conversation_DataService({
|
|
114
|
-
issuer,
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
await conversationService.updateLastMessage(
|
|
118
|
-
conversationId,
|
|
119
|
-
messageService.data._id!,
|
|
120
|
-
content.substring(0, 100)
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
// Emit real-time event
|
|
124
|
-
this.eventsService.emitMessageSent(messageService.data, conversationId);
|
|
125
|
-
|
|
126
|
-
return messageService.data;
|
|
127
|
-
} catch (error) {
|
|
128
|
-
DyFM_Log.error('Failed to sync assistant message', error);
|
|
129
|
-
throw new DyFM_Error({
|
|
130
|
-
...this.getDefaultErrorSettings('syncAssistantMessage', error, issuer),
|
|
131
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-MSG-SAM`,
|
|
132
|
-
userMessage: 'Failed to sync assistant message to messaging system.',
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Find or create conversation for bot channel
|
|
139
|
-
*/
|
|
140
|
-
async findOrCreateBotConversation(
|
|
141
|
-
channelId: string,
|
|
142
|
-
platformSource: string,
|
|
143
|
-
issuer: string
|
|
144
|
-
): Promise<DyFM_Msg_Conversation> {
|
|
145
|
-
try {
|
|
146
|
-
const conversationService = new DyNTS_Msg_Conversation_DataService({
|
|
147
|
-
issuer,
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
// Try to find existing conversation
|
|
151
|
-
const existingConversation = await conversationService.dataDBService.findOne({
|
|
152
|
-
platformChannelId: channelId,
|
|
153
|
-
platformSource,
|
|
154
|
-
__deleted: { $exists: false },
|
|
155
|
-
} as DyFM_DBFilter<DyFM_Msg_Conversation>);
|
|
156
|
-
|
|
157
|
-
if (existingConversation) {
|
|
158
|
-
conversationService.data = existingConversation;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Create new if not found
|
|
162
|
-
if (!conversationService.data._id) {
|
|
163
|
-
conversationService.data.platformChannelId = channelId;
|
|
164
|
-
conversationService.data.platformSource = platformSource;
|
|
165
|
-
conversationService.data.participants = [];
|
|
166
|
-
|
|
167
|
-
await conversationService.saveData(conversationService.data, false, false);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return conversationService.data;
|
|
171
|
-
} catch (error) {
|
|
172
|
-
throw new DyFM_Error({
|
|
173
|
-
...this.getDefaultErrorSettings('findOrCreateBotConversation', error, issuer),
|
|
174
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-MSG-FCBC`,
|
|
175
|
-
userMessage: 'Failed to find or create bot conversation.',
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
1
|
+
//import { DyNTS_SingletonService } from '../../../_services/base/singleton.service';
|
|
2
|
+
//import { DyFM_Error, DyFM_Log, DyFM_DBFilter } from '@futdevpro/fsm-dynamo';
|
|
3
|
+
//import { DyFM_Msg_Message, DyFM_Msg_Conversation } from '@futdevpro/fsm-dynamo/messaging';
|
|
4
|
+
//import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
|
|
5
|
+
//import { DyNTS_Msg_Message_DataService } from './msg-message.data-service';
|
|
6
|
+
//import { DyNTS_Msg_Conversation_DataService } from './msg-conversation.data-service';
|
|
7
|
+
//import { DyNTS_Msg_Events_Service } from './msg-events.service';
|
|
8
|
+
//import { DyNTS_Msg_Util } from '../_collections/msg.util';
|
|
9
|
+
//import { DyNTS_Bot_MessageWrapper } from '../../bot/_models/bot-message.interface';
|
|
10
|
+
//
|
|
11
|
+
///**
|
|
12
|
+
// * Messaging Integration Control Service
|
|
13
|
+
// * Handles integration between messaging system and bot/assistant modules
|
|
14
|
+
// */
|
|
15
|
+
//export class DyNTS_Msg_Integration_ControlService extends DyNTS_SingletonService {
|
|
16
|
+
//
|
|
17
|
+
// static getInstance(): DyNTS_Msg_Integration_ControlService {
|
|
18
|
+
// return DyNTS_Msg_Integration_ControlService.getSingletonInstance();
|
|
19
|
+
// }
|
|
20
|
+
//
|
|
21
|
+
// private eventsService = DyNTS_Msg_Events_Service.getInstance();
|
|
22
|
+
//
|
|
23
|
+
// /**
|
|
24
|
+
// * Sync bot message to messaging system
|
|
25
|
+
// * Called from bot IO when message is received
|
|
26
|
+
// */
|
|
27
|
+
// async syncBotMessage<T>(
|
|
28
|
+
// botMessage: DyNTS_Bot_MessageWrapper<T>,
|
|
29
|
+
// conversationId: string,
|
|
30
|
+
// issuer: string
|
|
31
|
+
// ): Promise<DyFM_Msg_Message> {
|
|
32
|
+
// try {
|
|
33
|
+
// if (!DyNTS_global_settings.messaging_settings?.integration?.syncBotMessages) {
|
|
34
|
+
// throw new Error('Bot message sync is disabled');
|
|
35
|
+
// }
|
|
36
|
+
//
|
|
37
|
+
// // Convert bot message to messaging format
|
|
38
|
+
// const msgMessage = DyNTS_Msg_Util.botMessageToMsgMessage(
|
|
39
|
+
// botMessage,
|
|
40
|
+
// conversationId,
|
|
41
|
+
// issuer
|
|
42
|
+
// );
|
|
43
|
+
//
|
|
44
|
+
// // Save to database
|
|
45
|
+
// const messageService = new DyNTS_Msg_Message_DataService({
|
|
46
|
+
// message: msgMessage,
|
|
47
|
+
// issuer,
|
|
48
|
+
// });
|
|
49
|
+
//
|
|
50
|
+
// await messageService.saveData(messageService.data, false, false);
|
|
51
|
+
//
|
|
52
|
+
// // Update conversation last message
|
|
53
|
+
// const conversationService = new DyNTS_Msg_Conversation_DataService({
|
|
54
|
+
// issuer,
|
|
55
|
+
// });
|
|
56
|
+
//
|
|
57
|
+
// await conversationService.updateLastMessage(
|
|
58
|
+
// conversationId,
|
|
59
|
+
// messageService.data._id!,
|
|
60
|
+
// msgMessage.content.substring(0, 100)
|
|
61
|
+
// );
|
|
62
|
+
//
|
|
63
|
+
// // Emit real-time event
|
|
64
|
+
// this.eventsService.emitMessageSent(messageService.data, conversationId);
|
|
65
|
+
//
|
|
66
|
+
// return messageService.data;
|
|
67
|
+
// } catch (error) {
|
|
68
|
+
// DyFM_Log.error('Failed to sync bot message', error);
|
|
69
|
+
// throw new DyFM_Error({
|
|
70
|
+
// ...this.getDefaultErrorSettings('syncBotMessage', error, issuer),
|
|
71
|
+
// errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-MSG-SBM`,
|
|
72
|
+
// userMessage: 'Failed to sync bot message to messaging system.',
|
|
73
|
+
// });
|
|
74
|
+
// }
|
|
75
|
+
// }
|
|
76
|
+
//
|
|
77
|
+
// /**
|
|
78
|
+
// * Sync assistant response to messaging system
|
|
79
|
+
// * Called from assistant IO when AI responds
|
|
80
|
+
// */
|
|
81
|
+
// async syncAssistantMessage(
|
|
82
|
+
// content: string,
|
|
83
|
+
// conversationId: string,
|
|
84
|
+
// aiProvider: string,
|
|
85
|
+
// aiModel: string,
|
|
86
|
+
// senderId: string,
|
|
87
|
+
// issuer: string
|
|
88
|
+
// ): Promise<DyFM_Msg_Message> {
|
|
89
|
+
// try {
|
|
90
|
+
// if (!DyNTS_global_settings.messaging_settings?.integration?.syncAssistantMessages) {
|
|
91
|
+
// throw new Error('Assistant message sync is disabled');
|
|
92
|
+
// }
|
|
93
|
+
//
|
|
94
|
+
// // Create AI message
|
|
95
|
+
// const msgMessage = DyNTS_Msg_Util.createAIMessage(
|
|
96
|
+
// conversationId,
|
|
97
|
+
// content,
|
|
98
|
+
// aiProvider,
|
|
99
|
+
// aiModel,
|
|
100
|
+
// senderId,
|
|
101
|
+
// issuer
|
|
102
|
+
// );
|
|
103
|
+
//
|
|
104
|
+
// // Save to database
|
|
105
|
+
// const messageService = new DyNTS_Msg_Message_DataService({
|
|
106
|
+
// message: msgMessage,
|
|
107
|
+
// issuer,
|
|
108
|
+
// });
|
|
109
|
+
//
|
|
110
|
+
// await messageService.saveData(messageService.data, false, false);
|
|
111
|
+
//
|
|
112
|
+
// // Update conversation last message
|
|
113
|
+
// const conversationService = new DyNTS_Msg_Conversation_DataService({
|
|
114
|
+
// issuer,
|
|
115
|
+
// });
|
|
116
|
+
//
|
|
117
|
+
// await conversationService.updateLastMessage(
|
|
118
|
+
// conversationId,
|
|
119
|
+
// messageService.data._id!,
|
|
120
|
+
// content.substring(0, 100)
|
|
121
|
+
// );
|
|
122
|
+
//
|
|
123
|
+
// // Emit real-time event
|
|
124
|
+
// this.eventsService.emitMessageSent(messageService.data, conversationId);
|
|
125
|
+
//
|
|
126
|
+
// return messageService.data;
|
|
127
|
+
// } catch (error) {
|
|
128
|
+
// DyFM_Log.error('Failed to sync assistant message', error);
|
|
129
|
+
// throw new DyFM_Error({
|
|
130
|
+
// ...this.getDefaultErrorSettings('syncAssistantMessage', error, issuer),
|
|
131
|
+
// errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-MSG-SAM`,
|
|
132
|
+
// userMessage: 'Failed to sync assistant message to messaging system.',
|
|
133
|
+
// });
|
|
134
|
+
// }
|
|
135
|
+
// }
|
|
136
|
+
//
|
|
137
|
+
// /**
|
|
138
|
+
// * Find or create conversation for bot channel
|
|
139
|
+
// */
|
|
140
|
+
// async findOrCreateBotConversation(
|
|
141
|
+
// channelId: string,
|
|
142
|
+
// platformSource: string,
|
|
143
|
+
// issuer: string
|
|
144
|
+
// ): Promise<DyFM_Msg_Conversation> {
|
|
145
|
+
// try {
|
|
146
|
+
// const conversationService = new DyNTS_Msg_Conversation_DataService({
|
|
147
|
+
// issuer,
|
|
148
|
+
// });
|
|
149
|
+
//
|
|
150
|
+
// // Try to find existing conversation
|
|
151
|
+
// const existingConversation = await conversationService.dataDBService.findOne({
|
|
152
|
+
// platformChannelId: channelId,
|
|
153
|
+
// platformSource,
|
|
154
|
+
// __deleted: { $exists: false },
|
|
155
|
+
// } as DyFM_DBFilter<DyFM_Msg_Conversation>);
|
|
156
|
+
//
|
|
157
|
+
// if (existingConversation) {
|
|
158
|
+
// conversationService.data = existingConversation;
|
|
159
|
+
// }
|
|
160
|
+
//
|
|
161
|
+
// // Create new if not found
|
|
162
|
+
// if (!conversationService.data._id) {
|
|
163
|
+
// conversationService.data.platformChannelId = channelId;
|
|
164
|
+
// conversationService.data.platformSource = platformSource;
|
|
165
|
+
// conversationService.data.participants = [];
|
|
166
|
+
//
|
|
167
|
+
// await conversationService.saveData(conversationService.data, false, false);
|
|
168
|
+
// }
|
|
169
|
+
//
|
|
170
|
+
// return conversationService.data;
|
|
171
|
+
// } catch (error) {
|
|
172
|
+
// throw new DyFM_Error({
|
|
173
|
+
// ...this.getDefaultErrorSettings('findOrCreateBotConversation', error, issuer),
|
|
174
|
+
// errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-MSG-FCBC`,
|
|
175
|
+
// userMessage: 'Failed to find or create bot conversation.',
|
|
176
|
+
// });
|
|
177
|
+
// }
|
|
178
|
+
// }
|
|
179
|
+
//}
|
|
180
|
+
//
|
|
@@ -23,7 +23,7 @@ export * from './_collections/msg.util';
|
|
|
23
23
|
// SERVICES
|
|
24
24
|
export * from './_services/msg-conversation.data-service';
|
|
25
25
|
export * from './_services/msg-events.service';
|
|
26
|
-
export * from './_services/msg-integration.control-service';
|
|
26
|
+
/* export * from './_services/msg-integration.control-service'; */
|
|
27
27
|
export * from './_services/msg-main.control-service';
|
|
28
28
|
export * from './_services/msg-message.data-service';
|
|
29
29
|
export * from './_services/msg.controller';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { DyFM_DataModel_Params } from '@futdevpro/fsm-dynamo';
|
|
2
|
-
import { DyFM_OAI_Settings } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
3
|
-
import { DyNTS_OAI_VectorDataService } from './oai-vector-data.service';
|
|
4
|
-
import { DyNTS_DAI_DocChunk } from '../../document-ai/_models/data-models/dai-doc-chunk.data-model';
|
|
5
|
-
import { DyNTS_DAI_DocChunkCompareResult } from '../../document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface';
|
|
6
|
-
import { DyNTS_DAI_DocPage } from '../../document-ai/_models/data-models/dai-doc-page.data-model';
|
|
7
|
-
import { DyNTS_DAI_Document } from '../../document-ai/_models/data-models/dai-document.data-model';
|
|
8
|
-
import { DyNTS_OAI_DocumentDataService } from './oai-document.data-service';
|
|
9
|
-
import { DyNTS_OAI_DocPageDataService } from './oai-doc-page.data-service';
|
|
10
|
-
export declare class DyNTS_OAI_DocChunkDataService<T_Chunk extends DyNTS_DAI_DocChunk = DyNTS_DAI_DocChunk, T_Page extends DyNTS_DAI_DocPage<T_Chunk> = DyNTS_DAI_DocPage<T_Chunk>, T_ExternalDocumentId = string, T_Document extends DyNTS_DAI_Document<T_Chunk, T_Page, T_ExternalDocumentId> = DyNTS_DAI_Document<T_Chunk, T_Page, T_ExternalDocumentId>> extends DyNTS_OAI_VectorDataService<T_Chunk> {
|
|
11
|
-
constructor(issuer: string, openAiSettings: DyFM_OAI_Settings, dataParams?: DyFM_DataModel_Params<T_Chunk>);
|
|
12
|
-
getDocumentDataService(): DyNTS_OAI_DocumentDataService<T_Chunk, T_Page, T_ExternalDocumentId, T_Document>;
|
|
13
|
-
getDocPageDataService(): DyNTS_OAI_DocPageDataService<T_Chunk, T_Page, T_ExternalDocumentId, T_Document>;
|
|
14
|
-
processPage(page: T_Page): Promise<DyNTS_DAI_DocChunkCompareResult<T_Chunk>[]>;
|
|
15
|
-
processNewPage(page: T_Page): Promise<DyNTS_DAI_DocChunkCompareResult<T_Chunk>[]>;
|
|
16
|
-
compareChunk(newChunk: T_Chunk, oldChunk: T_Chunk): Promise<DyNTS_DAI_DocChunkCompareResult<T_Chunk>>;
|
|
17
|
-
private compareStringArrays;
|
|
18
|
-
chunkPage(page: T_Page): Promise<T_Chunk[]>;
|
|
19
|
-
clickupWorkspaceId: string;
|
|
20
|
-
getPageLink(page: T_Page): string;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=oai-doc-chunk-data.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oai-doc-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,OAAO,CAAC,+BAA+B,CAAC,OAAO,CAAC,EAAE,CAAC;IA8D9E,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,+BAA+B,CAAC,OAAO,CAAC,EAAE,CAAC;IA8BjF,YAAY,CAChB,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;IA+CpD,OAAO,CAAC,mBAAmB;IAOrB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAuCjD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAkDlC"}
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DyNTS_OAI_DocChunkDataService = void 0;
|
|
4
|
-
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
5
|
-
const oai_vector_data_service_1 = require("./oai-vector-data.service");
|
|
6
|
-
const dai_chunking_util_1 = require("../../document-ai/_collections/dai-chunking.util");
|
|
7
|
-
const dai_doc_chunk_data_model_1 = require("../../document-ai/_models/data-models/dai-doc-chunk.data-model");
|
|
8
|
-
const dai_compare_result_type_enum_1 = require("../../document-ai/_enums/dai-compare-result-type.enum");
|
|
9
|
-
const oai_document_data_service_1 = require("./oai-document.data-service");
|
|
10
|
-
const oai_doc_page_data_service_1 = require("./oai-doc-page.data-service");
|
|
11
|
-
const dai_document_util_1 = require("../../document-ai/_collections/dai-document.util");
|
|
12
|
-
class DyNTS_OAI_DocChunkDataService extends oai_vector_data_service_1.DyNTS_OAI_VectorDataService {
|
|
13
|
-
/* override debugLog: boolean = false; */
|
|
14
|
-
constructor(issuer, openAiSettings, dataParams = dai_doc_chunk_data_model_1.DyNTS_DAI_docChunk_dataParams) {
|
|
15
|
-
super(null, dataParams, openAiSettings, issuer);
|
|
16
|
-
}
|
|
17
|
-
getDocumentDataService() {
|
|
18
|
-
return new oai_document_data_service_1.DyNTS_OAI_DocumentDataService(this.issuer, this.openAISettings);
|
|
19
|
-
}
|
|
20
|
-
getDocPageDataService() {
|
|
21
|
-
return new oai_doc_page_data_service_1.DyNTS_OAI_DocPageDataService(this.issuer, this.openAISettings);
|
|
22
|
-
}
|
|
23
|
-
async processPage(page) {
|
|
24
|
-
try {
|
|
25
|
-
const newChunks = await this.chunkPage(page);
|
|
26
|
-
const oldChunks = await this.findDataList({
|
|
27
|
-
pageId: page._id,
|
|
28
|
-
});
|
|
29
|
-
oldChunks.sort((a, b) => a.chunkIndex - b.chunkIndex);
|
|
30
|
-
const chunkCompareResults = [];
|
|
31
|
-
for (let i = 0; i < newChunks.length; i++) {
|
|
32
|
-
const newChunk = newChunks[i];
|
|
33
|
-
newChunk.documentId = page.documentId;
|
|
34
|
-
newChunk.pageId = page._id;
|
|
35
|
-
newChunk.chunkIndex = i;
|
|
36
|
-
const oldChunk = oldChunks[i];
|
|
37
|
-
if (oldChunk) {
|
|
38
|
-
newChunk._id = oldChunk._id;
|
|
39
|
-
// Compare first to determine if we need to save
|
|
40
|
-
const chunkCompareResult = await this.compareChunk(newChunk, oldChunk);
|
|
41
|
-
if (chunkCompareResult.result === dai_compare_result_type_enum_1.DyNTS_DAI_CompareResult_Type.equal) {
|
|
42
|
-
// No changes detected, reuse existing chunk without saving
|
|
43
|
-
chunkCompareResult.newChunk = oldChunk;
|
|
44
|
-
chunkCompareResults.push(chunkCompareResult);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
// Changes detected, save the updated chunk
|
|
48
|
-
const savedChunk = await this.saveData(newChunk, true);
|
|
49
|
-
chunkCompareResult.newChunk = savedChunk;
|
|
50
|
-
chunkCompareResults.push(chunkCompareResult);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
// New chunk, save it
|
|
55
|
-
const savedChunk = await this.saveData(newChunk, true);
|
|
56
|
-
chunkCompareResults.push({
|
|
57
|
-
result: dai_compare_result_type_enum_1.DyNTS_DAI_CompareResult_Type.new,
|
|
58
|
-
newChunk: savedChunk,
|
|
59
|
-
oldChunk: null,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
for (let i = newChunks.length; i < oldChunks.length; i++) {
|
|
64
|
-
const oldChunk = oldChunks[i];
|
|
65
|
-
await this.deleteData(oldChunk._id);
|
|
66
|
-
chunkCompareResults.push({
|
|
67
|
-
result: dai_compare_result_type_enum_1.DyNTS_DAI_CompareResult_Type.deleted,
|
|
68
|
-
newChunk: null,
|
|
69
|
-
oldChunk: oldChunk,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return chunkCompareResults;
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
throw new fsm_dynamo_1.DyFM_Error({
|
|
76
|
-
...this.getDefaultErrorSettings('processPage', error),
|
|
77
|
-
errorCode: 'DCH-CSB-CCS0',
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
async processNewPage(page) {
|
|
82
|
-
try {
|
|
83
|
-
const chunks = await this.chunkPage(page);
|
|
84
|
-
const chunkCompareResults = [];
|
|
85
|
-
for (let i = 0; i < chunks.length; i++) {
|
|
86
|
-
const chunk = chunks[i];
|
|
87
|
-
chunk.documentId = page.documentId;
|
|
88
|
-
chunk.pageId = page._id;
|
|
89
|
-
chunk.chunkIndex = i;
|
|
90
|
-
const savedChunk = await this.saveData(chunk, true);
|
|
91
|
-
chunkCompareResults.push({
|
|
92
|
-
result: dai_compare_result_type_enum_1.DyNTS_DAI_CompareResult_Type.new,
|
|
93
|
-
newChunk: savedChunk,
|
|
94
|
-
oldChunk: null,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
return chunkCompareResults;
|
|
98
|
-
}
|
|
99
|
-
catch (error) {
|
|
100
|
-
throw new fsm_dynamo_1.DyFM_Error({
|
|
101
|
-
...this.getDefaultErrorSettings('processNewChunks', error),
|
|
102
|
-
errorCode: 'DCH-CSB-CCS0',
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
async compareChunk(newChunk, oldChunk) {
|
|
107
|
-
try {
|
|
108
|
-
if (!oldChunk) {
|
|
109
|
-
throw new fsm_dynamo_1.DyFM_Error({
|
|
110
|
-
...this.getDefaultErrorSettings('compareChunk', new Error('oldChunk is required')),
|
|
111
|
-
errorCode: 'DCH-CSB-CC1',
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
if (this.debugLog) {
|
|
115
|
-
fsm_dynamo_1.DyFM_Log.info(`🔍 Comparing ${this.dataParams.dataName} chunk: ${newChunk.chunkIndex}`);
|
|
116
|
-
}
|
|
117
|
-
// Compare all relevant fields for comprehensive change detection
|
|
118
|
-
const contentEqual = oldChunk.chunkContent === newChunk.chunkContent;
|
|
119
|
-
const pathEqual = oldChunk.path === newChunk.path;
|
|
120
|
-
const documentNameEqual = oldChunk.documentName === newChunk.documentName;
|
|
121
|
-
const pageNameEqual = oldChunk.pageName === newChunk.pageName;
|
|
122
|
-
const pageLinkEqual = oldChunk.pageLink === newChunk.pageLink;
|
|
123
|
-
// Compare allFlaggedParents arrays
|
|
124
|
-
const allFlaggedParentsEqual = this.compareStringArrays(oldChunk.allFlaggedParents || [], newChunk.allFlaggedParents || []);
|
|
125
|
-
if (contentEqual && pathEqual && documentNameEqual && pageNameEqual && pageLinkEqual && allFlaggedParentsEqual) {
|
|
126
|
-
return {
|
|
127
|
-
result: dai_compare_result_type_enum_1.DyNTS_DAI_CompareResult_Type.equal,
|
|
128
|
-
newChunk: newChunk,
|
|
129
|
-
oldChunk: oldChunk,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
return {
|
|
133
|
-
result: dai_compare_result_type_enum_1.DyNTS_DAI_CompareResult_Type.modified,
|
|
134
|
-
newChunk: newChunk,
|
|
135
|
-
oldChunk: oldChunk,
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
catch (error) {
|
|
139
|
-
throw new fsm_dynamo_1.DyFM_Error({
|
|
140
|
-
...this.getDefaultErrorSettings('compareChunk', error),
|
|
141
|
-
errorCode: 'DCH-CSB-CC0',
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
compareStringArrays(arr1, arr2) {
|
|
146
|
-
if (arr1.length !== arr2.length) {
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
return arr1.every((item, index) => item === arr2[index]);
|
|
150
|
-
}
|
|
151
|
-
async chunkPage(page) {
|
|
152
|
-
try {
|
|
153
|
-
page.chunks = await dai_chunking_util_1.DyNTS_DAI_DocChunking_Util.chunkMdContent(page, (page) => this.getPageLink(page), this.issuer);
|
|
154
|
-
if (this.debugLog) {
|
|
155
|
-
fsm_dynamo_1.DyFM_Log.H_info(`Processing file: ${page.name}`, {
|
|
156
|
-
'Page name': page.name,
|
|
157
|
-
'Page filePath': page.filePath,
|
|
158
|
-
'Page parentedPath': page.parentedPath,
|
|
159
|
-
'Page content': page.content,
|
|
160
|
-
'Page parentFlags': '\n' + page.allFlaggedParents.join('\n') + '\n',
|
|
161
|
-
chunks: page.chunks.map(chunk => {
|
|
162
|
-
return {
|
|
163
|
-
'Chunk name': chunk.documentName,
|
|
164
|
-
'Chunk path': chunk.path,
|
|
165
|
-
'Chunk index': chunk.chunkIndex,
|
|
166
|
-
'Chunk content': chunk.chunkContent,
|
|
167
|
-
'Chunk parentFlags': '\n' + chunk.allFlaggedParents.join('\n') + '\n',
|
|
168
|
-
};
|
|
169
|
-
})
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
return page.chunks;
|
|
173
|
-
}
|
|
174
|
-
catch (error) {
|
|
175
|
-
throw new fsm_dynamo_1.DyFM_Error({
|
|
176
|
-
...this.getDefaultErrorSettings('chunkDocPages', error),
|
|
177
|
-
errorCode: 'CCAP-CUD-CDP0',
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
clickupWorkspaceId;
|
|
182
|
-
getPageLink(page) {
|
|
183
|
-
return dai_document_util_1.DyNTS_DAI_Document_Util.getClickupPageLink(page.name, this.clickupWorkspaceId, page.documentId, page.externalPageId);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
exports.DyNTS_OAI_DocChunkDataService = DyNTS_OAI_DocChunkDataService;
|
|
187
|
-
//# sourceMappingURL=oai-doc-chunk-data.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oai-doc-chunk-data.service.js","sourceRoot":"","sources":["../../../../../../src/_modules/ai/_modules/open-ai/_services/oai-doc-chunk-data.service.ts"],"names":[],"mappings":";;;AAAA,sDAAqK;AAErK,uEAAwE;AACxE,wFAA8F;AAC9F,6GAAmI;AAEnI,wGAAqG;AAIrG,2EAA4E;AAC5E,2EAA2E;AAC3E,wFAA2F;AAG3F,MAAa,6BAKX,SAAQ,qDAAoC;IAE5C,yCAAyC;IAEzC,YACE,MAAc,EACd,cAAiC,EACjC,aAA6C,wDAA+D;QAE5G,KAAK,CACH,IAAI,EACJ,UAAU,EACV,cAAc,EACd,MAAM,CACP,CAAC;IACJ,CAAC;IAED,sBAAsB;QACpB,OAAO,IAAI,yDAA6B,CACtC,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,cAAc,CACpB,CAAC;IACJ,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,wDAA4B,CACrC,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,cAAc,CACpB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,IAAY;QAC5B,IAAI,CAAC;YACH,MAAM,SAAS,GAAc,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAExD,MAAM,SAAS,GAAc,MAAM,IAAI,CAAC,YAAY,CAAC;gBACnD,MAAM,EAAE,IAAI,CAAC,GAAG;aACe,CAAC,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AAY;QACtB,OAAO,2CAAuB,CAAC,kBAAkB,CAC/C,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,kBAAkB,EACvB,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,cAAc,CACpB,CAAC;IACJ,CAAC;CA2CF;AAnRD,sEAmRC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { DyFM_DataModel_Params } from '@futdevpro/fsm-dynamo';
|
|
2
|
-
import { DyFM_OAI_Settings } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
3
|
-
import { DyNTS_DataService } from '../../../../../_services/base/data.service';
|
|
4
|
-
import { DyNTS_DAI_DocPageCompareResult } from '../../document-ai/_models/interfaces/dai-doc-page-compare-result.interface';
|
|
5
|
-
import { DyNTS_DAI_DocChunk } from '../../document-ai/_models/data-models/dai-doc-chunk.data-model';
|
|
6
|
-
import { DyNTS_DAI_DocPage } from '../../document-ai/_models/data-models/dai-doc-page.data-model';
|
|
7
|
-
import { DyNTS_DAI_Document } from '../../document-ai/_models/data-models/dai-document.data-model';
|
|
8
|
-
import { DyNTS_OAI_DocChunkDataService } from './oai-doc-chunk-data.service';
|
|
9
|
-
import { DyNTS_OAI_DocumentDataService } from './oai-document.data-service';
|
|
10
|
-
export declare class DyNTS_OAI_DocPageDataService<T_Chunk extends DyNTS_DAI_DocChunk = DyNTS_DAI_DocChunk, T_Page extends DyNTS_DAI_DocPage<T_Chunk> = DyNTS_DAI_DocPage<T_Chunk>, T_ExternalDocumentId = string, T_Document extends DyNTS_DAI_Document<T_Chunk, T_Page, T_ExternalDocumentId> = DyNTS_DAI_Document<T_Chunk, T_Page, T_ExternalDocumentId>> extends DyNTS_DataService<T_Page> {
|
|
11
|
-
private docChunkDataServiceOpenAiSettings;
|
|
12
|
-
debugLog: boolean;
|
|
13
|
-
absoluteDeletesOnProcess: boolean;
|
|
14
|
-
constructor(issuer: string, docChunkDataServiceOpenAiSettings: DyFM_OAI_Settings, data?: T_Page, dataParams?: DyFM_DataModel_Params<T_Page>);
|
|
15
|
-
getDocumentDataService(): DyNTS_OAI_DocumentDataService<T_Chunk, T_Page, T_ExternalDocumentId, T_Document>;
|
|
16
|
-
getDocChunkDataService(): DyNTS_OAI_DocChunkDataService<T_Chunk, T_Page, T_ExternalDocumentId, T_Document>;
|
|
17
|
-
processPages(documentId: string, pages: T_Page[]): Promise<DyNTS_DAI_DocPageCompareResult<T_Chunk, T_Page>[]>;
|
|
18
|
-
processPage(page: T_Page): Promise<DyNTS_DAI_DocPageCompareResult<T_Chunk, T_Page>>;
|
|
19
|
-
processNewPages(pages: T_Page[]): Promise<DyNTS_DAI_DocPageCompareResult<T_Chunk, T_Page>[]>;
|
|
20
|
-
processNewPage(page: T_Page): Promise<DyNTS_DAI_DocPageCompareResult<T_Chunk, T_Page>>;
|
|
21
|
-
/**
|
|
22
|
-
* this is a deep compare, that will update chunks if needed
|
|
23
|
-
* */
|
|
24
|
-
comparePage(newPage: T_Page, oldPage: T_Page): Promise<DyNTS_DAI_DocPageCompareResult<T_Chunk, T_Page>>;
|
|
25
|
-
private compareStringArrays;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=oai-doc-page.data-service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oai-doc-page.data-service.d.ts","sourceRoot":"","sources":["../../../../../../src/_modules/ai/_modules/open-ai/_services/oai-doc-page.data-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,qBAAqB,EAAsF,MAAM,uBAAuB,CAAC;AAC9J,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,4EAA4E,CAAC;AAE5H,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AAEpG,OAAO,EAAE,iBAAiB,EAAgC,MAAM,+DAA+D,CAAC;AAChI,OAAO,EAAE,kB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