@futdevpro/nts-dynamo 1.14.29 → 1.14.31
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 +67 -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 +391 -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 +59 -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} +130 -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 +55 -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 +132 -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 +55 -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 +132 -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 +17 -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 +107 -263
- 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 +70 -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 +83 -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 +521 -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 +431 -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 +186 -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 +186 -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 +249 -240
- package/src/_modules/bot/_services/bot-messaging-provider.service-base.ts +152 -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,403 +0,0 @@
|
|
|
1
|
-
import { DyFM_Error, DyFM_Log, week } from '@futdevpro/fsm-dynamo';
|
|
2
|
-
import { DyNTS_Bot_MessagingProvider, DyNTS_Bot_MessagingProvider_Config } from '../../../_models/bot-messaging-provider.interface';
|
|
3
|
-
import { DyNTS_Bot_LastMessageDate } from '../../../_models/bot-last-message-date.interface';
|
|
4
|
-
import { DyNTS_Bot_LastMentionDate } from '../../../_models/bot-last-mention-date.interface';
|
|
5
|
-
import { DyNTS_Bot_MessagingProvider_Type } from '../../../_enums/bot-message-provider.enum';
|
|
6
|
-
import { DyNTS_DyB_Message, DyNTS_DyB_Channel, DyNTS_DyB_User } from '../_models/dyb-platform.types';
|
|
7
|
-
import { DyNTS_global_settings } from '../../../../../_collections/global-settings.const';
|
|
8
|
-
import { DyNTS_Msg_Main_ControlService } from '../../../../messaging/_services/msg-main.control-service';
|
|
9
|
-
import { DyNTS_Msg_Message_DataService } from '../../../../messaging/_services/msg-message.data-service';
|
|
10
|
-
import { DyNTS_Msg_Conversation_DataService } from '../../../../messaging/_services/msg-conversation.data-service';
|
|
11
|
-
import { DyNTS_Msg_Events_Service } from '../../../../messaging/_services/msg-events.service';
|
|
12
|
-
import { DyFM_Msg_Conversation, DyFM_Msg_EventKey, DyFM_Msg_Message, DyFM_Msg_Participant } from '@futdevpro/fsm-dynamo/messaging';
|
|
13
|
-
|
|
14
|
-
export class DyNTS_DyB_MessagingProvider implements DyNTS_Bot_MessagingProvider<
|
|
15
|
-
DyNTS_DyB_Channel,
|
|
16
|
-
DyNTS_DyB_Message,
|
|
17
|
-
DyNTS_DyB_User
|
|
18
|
-
> {
|
|
19
|
-
private isInitialized: boolean = false;
|
|
20
|
-
private config: DyNTS_Bot_MessagingProvider_Config;
|
|
21
|
-
private conversationCache: Map<string, DyNTS_DyB_Channel>;
|
|
22
|
-
private userCache: Map<string, DyNTS_DyB_User>;
|
|
23
|
-
|
|
24
|
-
// Event handlers
|
|
25
|
-
private messageHandlers: Array<(message: DyNTS_DyB_Message, issuer: string) => void> = [];
|
|
26
|
-
private readyHandlers: Array<() => void> = [];
|
|
27
|
-
private errorHandlers: Array<(error: Error) => void> = [];
|
|
28
|
-
|
|
29
|
-
// Services
|
|
30
|
-
private messagingService: DyNTS_Msg_Main_ControlService;
|
|
31
|
-
private eventsService: DyNTS_Msg_Events_Service;
|
|
32
|
-
|
|
33
|
-
constructor() {
|
|
34
|
-
this.conversationCache = new Map();
|
|
35
|
-
this.userCache = new Map();
|
|
36
|
-
this.messagingService = DyNTS_Msg_Main_ControlService.getInstance();
|
|
37
|
-
this.eventsService = DyNTS_Msg_Events_Service.getInstance();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async initialize(config: DyNTS_Bot_MessagingProvider_Config): Promise<void> {
|
|
41
|
-
this.config = config;
|
|
42
|
-
|
|
43
|
-
if (config.messageProvider !== DyNTS_Bot_MessagingProvider_Type.dynamo) {
|
|
44
|
-
throw new Error(`Invalid provider type: ${config.messageProvider}. Expected 'dynamo'`);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
this.isInitialized = true;
|
|
48
|
-
DyFM_Log.success('Dynamo bot provider initialized');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async login(token?: string): Promise<void> {
|
|
52
|
-
if (!this.isInitialized) {
|
|
53
|
-
throw new Error('Provider not initialized. Call initialize() first.');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Setup event listeners for messaging events
|
|
57
|
-
this.setupEventListeners();
|
|
58
|
-
|
|
59
|
-
// Trigger ready handlers
|
|
60
|
-
this.readyHandlers.forEach(handler => handler());
|
|
61
|
-
|
|
62
|
-
DyFM_Log.success('Dynamo bot provider logged in');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
private setupEventListeners(): void {
|
|
66
|
-
// Listen to messaging events and convert them to bot events
|
|
67
|
-
// Note: This would require extending the events service to support custom listeners
|
|
68
|
-
// For now, we'll implement a basic approach
|
|
69
|
-
DyFM_Log.info('Dynamo bot event listeners setup (messaging integration)');
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Channel operations
|
|
73
|
-
async getChannelByName(name: string): Promise<DyNTS_DyB_Channel> {
|
|
74
|
-
if (this.conversationCache.has(name)) {
|
|
75
|
-
return this.conversationCache.get(name);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const conversationService: DyNTS_Msg_Conversation_DataService = new DyNTS_Msg_Conversation_DataService({
|
|
79
|
-
issuer: 'dynamo-bot',
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// Try to find conversation by name or platformChannelId
|
|
83
|
-
const conversation: DyFM_Msg_Conversation = await conversationService.dataDBService.findOne({
|
|
84
|
-
$or: [
|
|
85
|
-
{ name: name },
|
|
86
|
-
{ platformChannelId: name }
|
|
87
|
-
],
|
|
88
|
-
__deleted: { $exists: false }
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
if (!conversation) {
|
|
92
|
-
throw new Error(`No conversation found with name "${name}"`);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const channel: DyNTS_DyB_Channel = this.translateChannel(conversation);
|
|
96
|
-
this.conversationCache.set(name, channel);
|
|
97
|
-
return channel;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
async getChannelById(conversationId: string): Promise<DyNTS_DyB_Channel> {
|
|
101
|
-
const conversationService: DyNTS_Msg_Conversation_DataService = new DyNTS_Msg_Conversation_DataService({
|
|
102
|
-
issuer: 'dynamo-bot',
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
const conversation: DyFM_Msg_Conversation = await conversationService.getDataById(conversationId);
|
|
106
|
-
if (!conversation) {
|
|
107
|
-
throw new Error(`No conversation found with ID "${conversationId}"`);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return this.translateChannel(conversation);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
async sendMessageToChannelByName(channelName: string, message: string): Promise<DyNTS_DyB_Message> {
|
|
114
|
-
const channel: DyNTS_DyB_Channel = await this.getChannelByName(channelName);
|
|
115
|
-
return this.sendMessage(channel.id, message);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
async getMessagesFromChannelByChannelName(channelName: string, limit: number = 100): Promise<DyNTS_DyB_Message[]> {
|
|
119
|
-
const channel: DyNTS_DyB_Channel = await this.getChannelByName(channelName);
|
|
120
|
-
return this.fetchMessages(channel.id, limit);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
async getLastMessageInChannel(channelName: string): Promise<DyNTS_DyB_Message> {
|
|
124
|
-
const messages: DyNTS_DyB_Message[] = await this.getMessagesFromChannelByChannelName(channelName, 1);
|
|
125
|
-
return messages.length > 0 ? messages[0] : null;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
async clearChannel(channelId: string): Promise<void> {
|
|
129
|
-
// For messaging system, we don't actually delete messages
|
|
130
|
-
// This could be implemented to mark messages as deleted or archived
|
|
131
|
-
DyFM_Log.warn('Clear channel not implemented for messaging system');
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Message operations
|
|
135
|
-
async sendMessage(channelId: string, content: string): Promise<DyNTS_DyB_Message> {
|
|
136
|
-
const botUserId: string = this.config.dynamo?.botUserId || 'dynamo-bot';
|
|
137
|
-
|
|
138
|
-
const message: DyFM_Msg_Message = await this.messagingService.sendMessage(
|
|
139
|
-
channelId,
|
|
140
|
-
{
|
|
141
|
-
content,
|
|
142
|
-
type: 'text' as any,
|
|
143
|
-
},
|
|
144
|
-
botUserId,
|
|
145
|
-
'dynamo-bot'
|
|
146
|
-
);
|
|
147
|
-
|
|
148
|
-
return this.translateMessage(message);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
async replyToMessage(messageId: string, channelId: string, content: string): Promise<DyNTS_DyB_Message> {
|
|
152
|
-
// In messaging system, we can't directly reply to a message
|
|
153
|
-
// Instead, we'll send a new message with reference to the original
|
|
154
|
-
const replyContent: string = `[Reply to message ${messageId}] ${content}`;
|
|
155
|
-
return this.sendMessage(channelId, replyContent);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
async sendTyping(channelId: string): Promise<void> {
|
|
159
|
-
// Typing indicators not implemented for messaging system
|
|
160
|
-
DyFM_Log.info('Typing indicator not supported in messaging system');
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
async fetchMessages(channelId: string, limit: number): Promise<DyNTS_DyB_Message[]> {
|
|
164
|
-
const messageService: DyNTS_Msg_Message_DataService = new DyNTS_Msg_Message_DataService({
|
|
165
|
-
issuer: 'dynamo-bot',
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
const messages: DyFM_Msg_Message[] = await messageService.dataDBService.find({
|
|
169
|
-
conversationId: channelId,
|
|
170
|
-
__deleted: { $exists: false },
|
|
171
|
-
$sort: { sentAt: -1 },
|
|
172
|
-
$limit: limit
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
return messages.map((msg: DyFM_Msg_Message) => this.translateMessage(msg));
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
async fetchAllMessagesWithPaging(channelId: string, maxFetch: number = 1000): Promise<DyNTS_DyB_Message[]> {
|
|
179
|
-
return this.fetchMessages(channelId, maxFetch);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
async deleteMessage(messageId: string, channelId: string): Promise<void> {
|
|
183
|
-
await this.messagingService.deleteMessage(messageId, 'dynamo-bot', 'dynamo-bot');
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// User operations
|
|
187
|
-
async getUserByName(username: string): Promise<DyNTS_DyB_User> {
|
|
188
|
-
if (this.userCache.has(username)) {
|
|
189
|
-
return this.userCache.get(username);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// In messaging system, we don't have a direct user lookup by name
|
|
193
|
-
// This would need to be implemented based on your user management system
|
|
194
|
-
const user: DyNTS_DyB_User = {
|
|
195
|
-
id: username,
|
|
196
|
-
username: username,
|
|
197
|
-
displayName: username,
|
|
198
|
-
isBot: false,
|
|
199
|
-
rawPlatformUser: null
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
this.userCache.set(username, user);
|
|
203
|
-
return user;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
getUserMention(userId: string): string {
|
|
207
|
-
return `@${userId}`;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
async readMembersInChannel(channelName: string): Promise<DyNTS_DyB_User[]> {
|
|
211
|
-
const channel: DyNTS_DyB_Channel = await this.getChannelByName(channelName);
|
|
212
|
-
const participants: DyFM_Msg_Participant[] = channel.rawPlatformChannel.participants;
|
|
213
|
-
|
|
214
|
-
return participants.map(participant => this.translateUser(participant));
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
async readMemberNamesInChannel(channelName: string): Promise<string[]> {
|
|
218
|
-
const members: DyNTS_DyB_User[] = await this.readMembersInChannel(channelName);
|
|
219
|
-
return members.map(member => member.username);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// Advanced message queries
|
|
223
|
-
async getLastMessageSentBy(channelName: string, username: string): Promise<DyNTS_DyB_Message> {
|
|
224
|
-
const messages: DyNTS_DyB_Message[] = await this.fetchAllMessagesWithPaging(
|
|
225
|
-
(await this.getChannelByName(channelName)).id,
|
|
226
|
-
1000
|
|
227
|
-
);
|
|
228
|
-
|
|
229
|
-
return messages.find(msg => msg.authorName === username) || null;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
async getLastMentionOf(channelName: string, username: string): Promise<DyNTS_DyB_Message> {
|
|
233
|
-
const messages: DyNTS_DyB_Message[] = await this.fetchAllMessagesWithPaging(
|
|
234
|
-
(await this.getChannelByName(channelName)).id,
|
|
235
|
-
1000
|
|
236
|
-
);
|
|
237
|
-
|
|
238
|
-
return messages.find(msg =>
|
|
239
|
-
msg.content.includes(`@${username}`) ||
|
|
240
|
-
msg.content.includes(username)
|
|
241
|
-
) || null;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
async readLastMessageDatesByMembers(channelName: string, memberNames: string[]): Promise<DyNTS_Bot_LastMessageDate[]> {
|
|
245
|
-
const channel: DyNTS_DyB_Channel = await this.getChannelByName(channelName);
|
|
246
|
-
const messages: DyNTS_DyB_Message[] = await this.fetchAllMessagesWithPaging(channel.id, 1000);
|
|
247
|
-
|
|
248
|
-
const memberStatus: Record<string, { lastMessageDate: Date | null, allMessages: number }> = {};
|
|
249
|
-
memberNames.forEach((name: string) => {
|
|
250
|
-
memberStatus[name] = { lastMessageDate: null, allMessages: 0 };
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
const cutoffTime: number = Date.now() - (3 * week); // 3 weeks
|
|
254
|
-
|
|
255
|
-
messages.forEach((message: DyNTS_DyB_Message) => {
|
|
256
|
-
if (message.timestamp < cutoffTime) return;
|
|
257
|
-
|
|
258
|
-
const author = message.authorName;
|
|
259
|
-
if (memberStatus[author] !== undefined) {
|
|
260
|
-
memberStatus[author].allMessages++;
|
|
261
|
-
if (!memberStatus[author].lastMessageDate) {
|
|
262
|
-
memberStatus[author].lastMessageDate = new Date(message.timestamp);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
return memberNames.map((memberName: string) => {
|
|
268
|
-
const status: { lastMessageDate: Date | null, allMessages: number } = memberStatus[memberName];
|
|
269
|
-
return {
|
|
270
|
-
memberName: memberName,
|
|
271
|
-
allMessages: status.allMessages,
|
|
272
|
-
lastMessageDate: status.lastMessageDate
|
|
273
|
-
};
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
async readLastMessageWithMemberNamePingInIt(channelName: string, users: DyNTS_DyB_User[]): Promise<DyNTS_Bot_LastMentionDate[]> {
|
|
278
|
-
const channel: DyNTS_DyB_Channel = await this.getChannelByName(channelName);
|
|
279
|
-
const messages: DyNTS_DyB_Message[] = await this.fetchAllMessagesWithPaging(channel.id, 1000);
|
|
280
|
-
|
|
281
|
-
const memberStatus: Record<string, { lastMentionDate: Date | null; allMentions: number }> = {};
|
|
282
|
-
users.forEach((user: DyNTS_DyB_User) => {
|
|
283
|
-
memberStatus[user.username] = { lastMentionDate: null, allMentions: 0 };
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
const cutoffTime: number = Date.now() - (3 * week); // 3 weeks
|
|
287
|
-
|
|
288
|
-
messages.forEach((message: DyNTS_DyB_Message) => {
|
|
289
|
-
if (message.timestamp < cutoffTime) return;
|
|
290
|
-
|
|
291
|
-
users.forEach((user: DyNTS_DyB_User) => {
|
|
292
|
-
if (
|
|
293
|
-
message.content.includes(`@${user.id}`) &&
|
|
294
|
-
!memberStatus[user.username].lastMentionDate
|
|
295
|
-
) {
|
|
296
|
-
memberStatus[user.username].lastMentionDate = new Date(message.timestamp);
|
|
297
|
-
memberStatus[user.username].allMentions++;
|
|
298
|
-
}
|
|
299
|
-
});
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
return users.map((user: DyNTS_DyB_User) => {
|
|
303
|
-
const status: { lastMentionDate: Date | null; allMentions: number } = memberStatus[user.username];
|
|
304
|
-
return {
|
|
305
|
-
memberId: user.id,
|
|
306
|
-
memberName: user.username,
|
|
307
|
-
allMentions: status.allMentions,
|
|
308
|
-
lastMentionDate: status.lastMentionDate
|
|
309
|
-
};
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// Platform-specific features (not applicable for messaging system)
|
|
314
|
-
getRoleByName?(roleName: string): any {
|
|
315
|
-
return null; // Not applicable for messaging system
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
getRolePingByName?(roleName: string): Promise<string> {
|
|
319
|
-
return Promise.resolve(''); // Not applicable for messaging system
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
getRolePingsByName?(roleNames: string[]): Promise<string> {
|
|
323
|
-
return Promise.resolve(''); // Not applicable for messaging system
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// Event binding
|
|
327
|
-
onMessage(handler: (message: DyNTS_DyB_Message, issuer: string) => void): void {
|
|
328
|
-
this.messageHandlers.push(handler);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
onReady(handler: () => void): void {
|
|
332
|
-
this.readyHandlers.push(handler);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
onError(handler: (error: Error) => void): void {
|
|
336
|
-
this.errorHandlers.push(handler);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Metadata
|
|
340
|
-
getBotId(): string {
|
|
341
|
-
return this.config.dynamo?.botUserId || 'dynamo-bot';
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
getBotDisplayName(): string {
|
|
345
|
-
return this.config.dynamo?.botDisplayName || 'Dynamo Bot';
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
getProviderName(): string {
|
|
349
|
-
return 'dynamo';
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
getProviderId(): string {
|
|
353
|
-
return this.config.providerId || this.getProviderName();
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
isReady(): boolean {
|
|
357
|
-
return this.isInitialized;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
// Helper method to get config
|
|
361
|
-
getConfig(): DyNTS_Bot_MessagingProvider_Config {
|
|
362
|
-
return this.config;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// Translation methods
|
|
366
|
-
private translateMessage(msgMessage: any): DyNTS_DyB_Message {
|
|
367
|
-
return {
|
|
368
|
-
id: msgMessage._id || msgMessage.id,
|
|
369
|
-
content: msgMessage.content || '',
|
|
370
|
-
authorId: msgMessage.senderId || msgMessage.authorId,
|
|
371
|
-
authorName: msgMessage.senderName || msgMessage.authorName,
|
|
372
|
-
authorDisplayName: msgMessage.senderDisplayName || msgMessage.authorDisplayName,
|
|
373
|
-
channelId: msgMessage.conversationId || msgMessage.channelId,
|
|
374
|
-
channelName: msgMessage.conversationName || msgMessage.channelName || 'unknown',
|
|
375
|
-
timestamp: msgMessage.sentAt ? new Date(msgMessage.sentAt).getTime() : Date.now(),
|
|
376
|
-
isBot: msgMessage.isAIGenerated || false,
|
|
377
|
-
replyToMessageId: msgMessage.replyToMessageId,
|
|
378
|
-
mentions: msgMessage.mentions || [],
|
|
379
|
-
rawPlatformMessage: msgMessage
|
|
380
|
-
};
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
private translateChannel(conversation: any): DyNTS_DyB_Channel {
|
|
384
|
-
return {
|
|
385
|
-
id: conversation._id || conversation.id,
|
|
386
|
-
name: conversation.name || conversation.platformChannelId || 'unknown',
|
|
387
|
-
isTextBased: true,
|
|
388
|
-
isDM: conversation.type === 'direct',
|
|
389
|
-
participants: conversation.participants || [],
|
|
390
|
-
rawPlatformChannel: conversation
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
private translateUser(user: any): DyNTS_DyB_User {
|
|
395
|
-
return {
|
|
396
|
-
id: user.userId || user.id,
|
|
397
|
-
username: user.username || user.userId || user.id,
|
|
398
|
-
displayName: user.displayName || user.username || user.userId,
|
|
399
|
-
isBot: user.isBot || false,
|
|
400
|
-
rawPlatformUser: user
|
|
401
|
-
};
|
|
402
|
-
}
|
|
403
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DyNTS_Bot_Operations_Util } from '../../../_collections/bot-operations.util';
|
|
2
|
-
import { DyNTS_SlB_Message, DyNTS_SlB_Channel, DyNTS_SlB_User } from '../_models/slb-platform.types';
|
|
3
|
-
import { DyNTS_SlB_MessagingProvider } from '../_services/slb-messaging-provider.service';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Slack Bot Operations Utility
|
|
7
|
-
*
|
|
8
|
-
* Platform-specific implementation of bot operations for Slack
|
|
9
|
-
*/
|
|
10
|
-
export class DyNTS_SlB_Operations_Util extends DyNTS_Bot_Operations_Util<
|
|
11
|
-
DyNTS_SlB_Channel,
|
|
12
|
-
DyNTS_SlB_Message,
|
|
13
|
-
DyNTS_SlB_User,
|
|
14
|
-
DyNTS_SlB_MessagingProvider
|
|
15
|
-
> {
|
|
16
|
-
// Slack-specific operations can be added here
|
|
17
|
-
// All base operations are inherited from the generic class
|
|
18
|
-
}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { DyNTS_Bot_MessagingProvider, DyNTS_Bot_MessagingProvider_Config } from '../../../_models/bot-messaging-provider.interface';
|
|
2
|
-
import { DyNTS_Bot_LastMessageDate } from '../../../_models/bot-last-message-date.interface';
|
|
3
|
-
import { DyNTS_Bot_LastMentionDate } from '../../../_models/bot-last-mention-date.interface';
|
|
4
|
-
import { DyNTS_Bot_MessagingProvider_Type } from '../../../_enums/bot-message-provider.enum';
|
|
5
|
-
import { DyNTS_SlB_Message, DyNTS_SlB_Channel, DyNTS_SlB_User } from '../_models/slb-platform.types';
|
|
6
|
-
|
|
7
|
-
export class DyNTS_SlB_MessagingProvider implements DyNTS_Bot_MessagingProvider<
|
|
8
|
-
DyNTS_SlB_Channel,
|
|
9
|
-
DyNTS_SlB_Message,
|
|
10
|
-
DyNTS_SlB_User
|
|
11
|
-
> {
|
|
12
|
-
private isInitialized: boolean = false;
|
|
13
|
-
private config: DyNTS_Bot_MessagingProvider_Config;
|
|
14
|
-
|
|
15
|
-
// Event handlers
|
|
16
|
-
private messageHandlers: Array<(message: DyNTS_SlB_Message, issuer: string) => void> = [];
|
|
17
|
-
private readyHandlers: Array<() => void> = [];
|
|
18
|
-
private errorHandlers: Array<(error: Error) => void> = [];
|
|
19
|
-
|
|
20
|
-
async initialize(config: DyNTS_Bot_MessagingProvider_Config): Promise<void> {
|
|
21
|
-
this.config = config;
|
|
22
|
-
|
|
23
|
-
if (config.messageProvider !== DyNTS_Bot_MessagingProvider_Type.slack) {
|
|
24
|
-
throw new Error(`Invalid provider type: ${config.messageProvider}. Expected 'slack'`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (!config.slack) {
|
|
28
|
-
throw new Error('Slack configuration is required');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
this.isInitialized = true;
|
|
32
|
-
// TODO: Initialize Slack client
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async login(token: string): Promise<void> {
|
|
36
|
-
if (!this.isInitialized) {
|
|
37
|
-
throw new Error('Provider not initialized. Call initialize() first.');
|
|
38
|
-
}
|
|
39
|
-
// TODO: Implement Slack login
|
|
40
|
-
throw new Error('Slack provider not yet implemented');
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Channel operations
|
|
44
|
-
async getChannelByName(name: string): Promise<DyNTS_SlB_Channel> {
|
|
45
|
-
throw new Error('Slack provider not yet implemented');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async sendMessageToChannelByName(channelName: string, message: string): Promise<DyNTS_SlB_Message> {
|
|
49
|
-
throw new Error('Slack provider not yet implemented');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async getMessagesFromChannelByChannelName(channelName: string, limit?: number): Promise<DyNTS_SlB_Message[]> {
|
|
53
|
-
throw new Error('Slack provider not yet implemented');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async getLastMessageInChannel(channelName: string): Promise<DyNTS_SlB_Message> {
|
|
57
|
-
throw new Error('Slack provider not yet implemented');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
async clearChannel(channelId: string): Promise<void> {
|
|
61
|
-
throw new Error('Slack provider not yet implemented');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Message operations
|
|
65
|
-
async sendMessage(channelId: string, content: string): Promise<DyNTS_SlB_Message> {
|
|
66
|
-
throw new Error('Slack provider not yet implemented');
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
async replyToMessage(messageId: string, channelId: string, content: string): Promise<DyNTS_SlB_Message> {
|
|
70
|
-
throw new Error('Slack provider not yet implemented');
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
async sendTyping(channelId: string): Promise<void> {
|
|
74
|
-
throw new Error('Slack provider not yet implemented');
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async fetchMessages(channelId: string, limit: number): Promise<DyNTS_SlB_Message[]> {
|
|
78
|
-
throw new Error('Slack provider not yet implemented');
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
async fetchAllMessagesWithPaging(channelId: string, maxFetch?: number): Promise<DyNTS_SlB_Message[]> {
|
|
82
|
-
throw new Error('Slack provider not yet implemented');
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
async deleteMessage(messageId: string, channelId: string): Promise<void> {
|
|
86
|
-
throw new Error('Slack provider not yet implemented');
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// User operations
|
|
90
|
-
async getUserByName(username: string): Promise<DyNTS_SlB_User> {
|
|
91
|
-
throw new Error('Slack provider not yet implemented');
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
getUserMention(userId: string): string {
|
|
95
|
-
return `<@${userId}>`;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
async readMembersInChannel(channelName: string): Promise<DyNTS_SlB_User[]> {
|
|
99
|
-
throw new Error('Slack provider not yet implemented');
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
async readMemberNamesInChannel(channelName: string): Promise<string[]> {
|
|
103
|
-
throw new Error('Slack provider not yet implemented');
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Advanced message queries
|
|
107
|
-
async getLastMessageSentBy(channelName: string, username: string): Promise<DyNTS_SlB_Message> {
|
|
108
|
-
throw new Error('Slack provider not yet implemented');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
async getLastMentionOf(channelName: string, username: string): Promise<DyNTS_SlB_Message> {
|
|
112
|
-
throw new Error('Slack provider not yet implemented');
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
async readLastMessageDatesByMembers(channelName: string, memberNames: string[]): Promise<DyNTS_Bot_LastMessageDate[]> {
|
|
116
|
-
throw new Error('Slack provider not yet implemented');
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
async readLastMessageWithMemberNamePingInIt(channelName: string, users: DyNTS_SlB_User[]): Promise<DyNTS_Bot_LastMentionDate[]> {
|
|
120
|
-
throw new Error('Slack provider not yet implemented');
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Event binding
|
|
124
|
-
onMessage(handler: (message: DyNTS_SlB_Message, issuer: string) => void): void {
|
|
125
|
-
this.messageHandlers.push(handler);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
onReady(handler: () => void): void {
|
|
129
|
-
this.readyHandlers.push(handler);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
onError(handler: (error: Error) => void): void {
|
|
133
|
-
this.errorHandlers.push(handler);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Metadata
|
|
137
|
-
getBotId(): string {
|
|
138
|
-
return 'slack-bot-stub';
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
getBotDisplayName(): string {
|
|
142
|
-
return 'Slack Bot (Stub)';
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
getProviderName(): string {
|
|
146
|
-
return 'slack';
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
getProviderId(): string {
|
|
150
|
-
return this.config?.providerId || this.getProviderName();
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
isReady(): boolean {
|
|
154
|
-
return this.isInitialized;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DyNTS_Bot_Operations_Util } from '../../../_collections/bot-operations.util';
|
|
2
|
-
import { DyNTS_TeB_Message, DyNTS_TeB_Channel, DyNTS_TeB_User } from '../_models/teb-platform.types';
|
|
3
|
-
import { DyNTS_TeB_MessagingProvider } from '../_services/teb-messaging-provider.service';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Teams Bot Operations Utility
|
|
7
|
-
*
|
|
8
|
-
* Platform-specific implementation of bot operations for Teams
|
|
9
|
-
*/
|
|
10
|
-
export class DyNTS_TeB_Operations_Util extends DyNTS_Bot_Operations_Util<
|
|
11
|
-
DyNTS_TeB_Channel,
|
|
12
|
-
DyNTS_TeB_Message,
|
|
13
|
-
DyNTS_TeB_User,
|
|
14
|
-
DyNTS_TeB_MessagingProvider
|
|
15
|
-
> {
|
|
16
|
-
// Teams-specific operations can be added here
|
|
17
|
-
// All base operations are inherited from the generic class
|
|
18
|
-
}
|