@futdevpro/nts-dynamo 1.14.8 → 1.14.10
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/_collections/global-settings.const.d.ts.map +1 -1
- package/build/_collections/global-settings.const.js +1 -0
- package/build/_collections/global-settings.const.js.map +1 -1
- package/build/_models/interfaces/global-settings.interface.d.ts +18 -2
- package/build/_models/interfaces/global-settings.interface.d.ts.map +1 -1
- package/build/_modules/assistant/_collections/ass-global-settings.const.d.ts +3 -0
- package/build/_modules/assistant/_collections/ass-global-settings.const.d.ts.map +1 -0
- package/build/_modules/assistant/_collections/ass-global-settings.const.js +15 -0
- package/build/_modules/assistant/_collections/ass-global-settings.const.js.map +1 -0
- package/build/_modules/assistant/_collections/ass.util.d.ts +16 -0
- package/build/_modules/assistant/_collections/ass.util.d.ts.map +1 -0
- package/build/_modules/assistant/_collections/ass.util.js +43 -0
- package/build/_modules/assistant/_collections/ass.util.js.map +1 -0
- package/build/_modules/assistant/_models/ass-global-settings.interface.d.ts +14 -0
- package/build/_modules/assistant/_models/ass-global-settings.interface.d.ts.map +1 -0
- package/build/_modules/assistant/_models/ass-global-settings.interface.js +3 -0
- package/build/_modules/assistant/_models/ass-global-settings.interface.js.map +1 -0
- package/build/_modules/assistant/_services/ass-io.control-service.d.ts +23 -0
- package/build/_modules/assistant/_services/ass-io.control-service.d.ts.map +1 -0
- package/build/_modules/assistant/_services/ass-io.control-service.js +59 -0
- package/build/_modules/assistant/_services/ass-io.control-service.js.map +1 -0
- package/build/_modules/assistant/_services/ass-main.control-service.d.ts +15 -0
- package/build/_modules/assistant/_services/ass-main.control-service.d.ts.map +1 -0
- package/build/_modules/assistant/_services/ass-main.control-service.js +12 -0
- package/build/_modules/assistant/_services/ass-main.control-service.js.map +1 -0
- package/build/_modules/assistant/_services/ass.service-base.d.ts +31 -0
- package/build/_modules/assistant/_services/ass.service-base.d.ts.map +1 -0
- package/build/_modules/assistant/_services/ass.service-base.js +56 -0
- package/build/_modules/assistant/_services/ass.service-base.js.map +1 -0
- package/build/_modules/assistant/index.d.ts +7 -0
- package/build/_modules/assistant/index.d.ts.map +1 -0
- package/build/_modules/assistant/index.js +19 -0
- package/build/_modules/assistant/index.js.map +1 -0
- package/build/_modules/bot/_collections/bot-default-commands.const.d.ts +3 -0
- package/build/_modules/bot/_collections/bot-default-commands.const.d.ts.map +1 -0
- package/build/_modules/bot/_collections/bot-default-commands.const.js +14 -0
- package/build/_modules/bot/_collections/bot-default-commands.const.js.map +1 -0
- package/build/_modules/bot/_collections/bot-global-settings.const.d.ts +3 -0
- package/build/_modules/bot/_collections/bot-global-settings.const.d.ts.map +1 -0
- package/build/_modules/bot/_collections/bot-global-settings.const.js +32 -0
- package/build/_modules/bot/_collections/bot-global-settings.const.js.map +1 -0
- package/build/_modules/bot/_collections/bot-operations.util.d.ts +21 -0
- package/build/_modules/bot/_collections/bot-operations.util.d.ts.map +1 -0
- package/build/_modules/bot/_collections/bot-operations.util.js +74 -0
- package/build/_modules/bot/_collections/bot-operations.util.js.map +1 -0
- package/build/_modules/bot/_enums/bot-provider.enum.d.ts +7 -0
- package/build/_modules/bot/_enums/bot-provider.enum.d.ts.map +1 -0
- package/build/_modules/bot/_enums/bot-provider.enum.js +11 -0
- package/build/_modules/bot/_enums/bot-provider.enum.js.map +1 -0
- package/build/_modules/bot/_models/bot-channel.interface.d.ts +8 -0
- package/build/_modules/bot/_models/bot-channel.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-channel.interface.js +3 -0
- package/build/_modules/bot/_models/bot-channel.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-command.interface.d.ts +8 -0
- package/build/_modules/bot/_models/bot-command.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-command.interface.js +3 -0
- package/build/_modules/bot/_models/bot-command.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-global-settings.interface.d.ts +79 -0
- package/build/_modules/bot/_models/bot-global-settings.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-global-settings.interface.js +3 -0
- package/build/_modules/bot/_models/bot-global-settings.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-last-mention-date.interface.d.ts +7 -0
- package/build/_modules/bot/_models/bot-last-mention-date.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-last-mention-date.interface.js +3 -0
- package/build/_modules/bot/_models/bot-last-mention-date.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-last-message-date.interface.d.ts +6 -0
- package/build/_modules/bot/_models/bot-last-message-date.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-last-message-date.interface.js +3 -0
- package/build/_modules/bot/_models/bot-last-message-date.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-message.interface.d.ts +15 -0
- package/build/_modules/bot/_models/bot-message.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-message.interface.js +3 -0
- package/build/_modules/bot/_models/bot-message.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-provider.interface.d.ts +60 -0
- package/build/_modules/bot/_models/bot-provider.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-provider.interface.js +3 -0
- package/build/_modules/bot/_models/bot-provider.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-user.interface.d.ts +8 -0
- package/build/_modules/bot/_models/bot-user.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-user.interface.js +3 -0
- package/build/_modules/bot/_models/bot-user.interface.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts +11 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.js +13 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts +5 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.js +19 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.d.ts +8 -0
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.js +3 -0
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.d.ts +53 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.js +369 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-provider.service.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/index.d.ts +5 -0
- package/build/_modules/bot/_modules/discord-bot/index.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/index.js +16 -0
- package/build/_modules/bot/_modules/discord-bot/index.js.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts +11 -0
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.js +13 -0
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.js.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.d.ts +7 -0
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.d.ts.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.js +3 -0
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.js.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.d.ts +40 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.js +116 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-provider.service.js.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/index.d.ts +4 -0
- package/build/_modules/bot/_modules/slack-bot/index.d.ts.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/index.js +15 -0
- package/build/_modules/bot/_modules/slack-bot/index.js.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts +11 -0
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.js +13 -0
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.js.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.d.ts +7 -0
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.d.ts.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.js +3 -0
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.js.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.d.ts +40 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.js +116 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-provider.service.js.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/index.d.ts +4 -0
- package/build/_modules/bot/_modules/teams-bot/index.d.ts.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/index.js +15 -0
- package/build/_modules/bot/_modules/teams-bot/index.js.map +1 -0
- package/build/_modules/bot/_services/bot-commands.control-service.d.ts +15 -0
- package/build/_modules/bot/_services/bot-commands.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-commands.control-service.js +72 -0
- package/build/_modules/bot/_services/bot-commands.control-service.js.map +1 -0
- package/build/_modules/bot/_services/bot-io.control-service.d.ts +24 -0
- package/build/_modules/bot/_services/bot-io.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-io.control-service.js +207 -0
- package/build/_modules/bot/_services/bot-io.control-service.js.map +1 -0
- package/build/_modules/bot/_services/bot-main.control-service.d.ts +42 -0
- package/build/_modules/bot/_services/bot-main.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-main.control-service.js +223 -0
- package/build/_modules/bot/_services/bot-main.control-service.js.map +1 -0
- package/build/_modules/bot/_services/bot-provider-factory.service.d.ts +5 -0
- package/build/_modules/bot/_services/bot-provider-factory.service.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-provider-factory.service.js +28 -0
- package/build/_modules/bot/_services/bot-provider-factory.service.js.map +1 -0
- package/build/_modules/bot/_services/bot-routines.control-service.d.ts +17 -0
- package/build/_modules/bot/_services/bot-routines.control-service.d.ts.map +1 -0
- package/build/_modules/bot/_services/bot-routines.control-service.js +40 -0
- package/build/_modules/bot/_services/bot-routines.control-service.js.map +1 -0
- package/build/_modules/bot/index.d.ts +21 -0
- package/build/_modules/bot/index.d.ts.map +1 -0
- package/build/_modules/bot/index.js +35 -0
- package/build/_modules/bot/index.js.map +1 -0
- package/build/_modules/defaults/_models/default-user.data-model.d.ts +20 -0
- package/build/_modules/defaults/_models/default-user.data-model.d.ts.map +1 -0
- package/build/_modules/defaults/_models/default-user.data-model.js +73 -0
- package/build/_modules/defaults/_models/default-user.data-model.js.map +1 -0
- package/build/_modules/defaults/_services/default-auth.service.d.ts +51 -0
- package/build/_modules/defaults/_services/default-auth.service.d.ts.map +1 -0
- package/build/_modules/defaults/_services/default-auth.service.js +159 -0
- package/build/_modules/defaults/_services/default-auth.service.js.map +1 -0
- package/build/_modules/defaults/_services/default-socket-events.service.d.ts +24 -0
- package/build/_modules/defaults/_services/default-socket-events.service.d.ts.map +1 -0
- package/build/_modules/defaults/_services/default-socket-events.service.js +61 -0
- package/build/_modules/defaults/_services/default-socket-events.service.js.map +1 -0
- package/build/_modules/defaults/_services/default-user.data-service.d.ts +25 -0
- package/build/_modules/defaults/_services/default-user.data-service.d.ts.map +1 -0
- package/build/_modules/defaults/_services/default-user.data-service.js +88 -0
- package/build/_modules/defaults/_services/default-user.data-service.js.map +1 -0
- package/build/_modules/defaults/index.d.ts +5 -0
- package/build/_modules/defaults/index.d.ts.map +1 -0
- package/build/_modules/defaults/index.js +16 -0
- package/build/_modules/defaults/index.js.map +1 -0
- package/build/_modules/messaging/_collections/msg-global-settings.const.d.ts +6 -0
- package/build/_modules/messaging/_collections/msg-global-settings.const.d.ts.map +1 -0
- package/build/_modules/messaging/_collections/msg-global-settings.const.js +27 -0
- package/build/_modules/messaging/_collections/msg-global-settings.const.js.map +1 -0
- package/build/_modules/messaging/_collections/msg.util.d.ts +25 -0
- package/build/_modules/messaging/_collections/msg.util.d.ts.map +1 -0
- package/build/_modules/messaging/_collections/msg.util.js +63 -0
- package/build/_modules/messaging/_collections/msg.util.js.map +1 -0
- package/build/_modules/messaging/_models/msg-global-settings.interface.d.ts +38 -0
- package/build/_modules/messaging/_models/msg-global-settings.interface.d.ts.map +1 -0
- package/build/_modules/messaging/_models/msg-global-settings.interface.js +3 -0
- package/build/_modules/messaging/_models/msg-global-settings.interface.js.map +1 -0
- package/build/_modules/messaging/_services/msg-conversation.data-service.d.ts +29 -0
- package/build/_modules/messaging/_services/msg-conversation.data-service.d.ts.map +1 -0
- package/build/_modules/messaging/_services/msg-conversation.data-service.js +110 -0
- package/build/_modules/messaging/_services/msg-conversation.data-service.js.map +1 -0
- package/build/_modules/messaging/_services/msg-events.service.d.ts +62 -0
- package/build/_modules/messaging/_services/msg-events.service.d.ts.map +1 -0
- package/build/_modules/messaging/_services/msg-events.service.js +204 -0
- package/build/_modules/messaging/_services/msg-events.service.js.map +1 -0
- package/build/_modules/messaging/_services/msg-integration.control-service.d.ts +26 -0
- package/build/_modules/messaging/_services/msg-integration.control-service.d.ts.map +1 -0
- package/build/_modules/messaging/_services/msg-integration.control-service.js +126 -0
- package/build/_modules/messaging/_services/msg-integration.control-service.js.map +1 -0
- package/build/_modules/messaging/_services/msg-main.control-service.d.ts +62 -0
- package/build/_modules/messaging/_services/msg-main.control-service.d.ts.map +1 -0
- package/build/_modules/messaging/_services/msg-main.control-service.js +408 -0
- package/build/_modules/messaging/_services/msg-main.control-service.js.map +1 -0
- package/build/_modules/messaging/_services/msg-message.data-service.d.ts +29 -0
- package/build/_modules/messaging/_services/msg-message.data-service.d.ts.map +1 -0
- package/build/_modules/messaging/_services/msg-message.data-service.js +104 -0
- package/build/_modules/messaging/_services/msg-message.data-service.js.map +1 -0
- package/build/_modules/messaging/get-messaging-routing-module.util.d.ts +8 -0
- package/build/_modules/messaging/get-messaging-routing-module.util.d.ts.map +1 -0
- package/build/_modules/messaging/get-messaging-routing-module.util.js +21 -0
- package/build/_modules/messaging/get-messaging-routing-module.util.js.map +1 -0
- package/build/_modules/messaging/index.d.ts +12 -0
- package/build/_modules/messaging/index.d.ts.map +1 -0
- package/build/_modules/messaging/index.js +30 -0
- package/build/_modules/messaging/index.js.map +1 -0
- package/build/_modules/messaging/messaging.controller.d.ts +13 -0
- package/build/_modules/messaging/messaging.controller.d.ts.map +1 -0
- package/build/_modules/messaging/messaging.controller.js +257 -0
- package/build/_modules/messaging/messaging.controller.js.map +1 -0
- package/package.json +72 -4
- package/src/_collections/global-settings.const.ts +2 -0
- package/src/_models/interfaces/global-settings.interface.ts +20 -2
- package/src/_modules/assistant/_collections/ass-global-settings.const.ts +13 -0
- package/src/_modules/assistant/_collections/ass.util.ts +50 -0
- package/src/_modules/assistant/_models/ass-global-settings.interface.ts +15 -0
- package/src/_modules/assistant/_services/ass-io.control-service.ts +100 -0
- package/src/_modules/assistant/_services/ass-main.control-service.ts +38 -0
- package/src/_modules/assistant/_services/ass.service-base.ts +92 -0
- package/src/_modules/assistant/index.ts +19 -0
- package/src/_modules/bot/_collections/bot-default-commands.const.ts +12 -0
- package/src/_modules/bot/_collections/bot-global-settings.const.ts +39 -0
- package/src/_modules/bot/_collections/bot-operations.util.ts +149 -0
- package/src/_modules/bot/_enums/bot-provider.enum.ts +6 -0
- package/src/_modules/bot/_models/bot-channel.interface.ts +7 -0
- package/src/_modules/bot/_models/bot-command.interface.ts +8 -0
- package/src/_modules/bot/_models/bot-global-settings.interface.ts +87 -0
- package/src/_modules/bot/_models/bot-last-mention-date.interface.ts +6 -0
- package/src/_modules/bot/_models/bot-last-message-date.interface.ts +5 -0
- package/src/_modules/bot/_models/bot-message.interface.ts +14 -0
- package/src/_modules/bot/_models/bot-provider.interface.ts +80 -0
- package/src/_modules/bot/_models/bot-user.interface.ts +7 -0
- package/src/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.ts +18 -0
- package/src/_modules/bot/_modules/discord-bot/_collections/dib.util.ts +20 -0
- package/src/_modules/bot/_modules/discord-bot/_models/dib-platform.types.ts +9 -0
- package/src/_modules/bot/_modules/discord-bot/_services/dib-provider.service.ts +462 -0
- package/src/_modules/bot/_modules/discord-bot/index.ts +15 -0
- package/src/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.ts +18 -0
- package/src/_modules/bot/_modules/slack-bot/_models/slb-platform.types.ts +9 -0
- package/src/_modules/bot/_modules/slack-bot/_services/slb-provider.service.ts +152 -0
- package/src/_modules/bot/_modules/slack-bot/index.ts +14 -0
- package/src/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.ts +18 -0
- package/src/_modules/bot/_modules/teams-bot/_models/teb-platform.types.ts +9 -0
- package/src/_modules/bot/_modules/teams-bot/_services/teb-provider.service.ts +152 -0
- package/src/_modules/bot/_modules/teams-bot/index.ts +14 -0
- package/src/_modules/bot/_services/bot-commands.control-service.ts +126 -0
- package/src/_modules/bot/_services/bot-io.control-service.ts +325 -0
- package/src/_modules/bot/_services/bot-main.control-service.ts +344 -0
- package/src/_modules/bot/_services/bot-provider-factory.service.ts +30 -0
- package/src/_modules/bot/_services/bot-routines.control-service.ts +83 -0
- package/src/_modules/bot/index.ts +36 -0
- package/src/_modules/defaults/_models/default-user.data-model.ts +72 -0
- package/src/_modules/defaults/_services/default-auth.service.ts +177 -0
- package/src/_modules/defaults/_services/default-socket-events.service.ts +61 -0
- package/src/_modules/defaults/_services/default-user.data-service.ts +98 -0
- package/src/_modules/defaults/index.ts +14 -0
- package/src/_modules/messaging/_collections/msg-global-settings.const.ts +27 -0
- package/src/_modules/messaging/_collections/msg.util.ts +83 -0
- package/src/_modules/messaging/_models/msg-global-settings.interface.ts +49 -0
- package/src/_modules/messaging/_services/msg-conversation.data-service.ts +146 -0
- package/src/_modules/messaging/_services/msg-events.service.ts +267 -0
- package/src/_modules/messaging/_services/msg-integration.control-service.ts +179 -0
- package/src/_modules/messaging/_services/msg-main.control-service.ts +548 -0
- package/src/_modules/messaging/_services/msg-message.data-service.ts +129 -0
- package/src/_modules/messaging/get-messaging-routing-module.util.ts +26 -0
- package/src/_modules/messaging/index.ts +33 -0
- package/src/_modules/messaging/messaging.controller.ts +370 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { DyFM_Error, DyFM_Log } from '@futdevpro/fsm-dynamo';
|
|
2
|
+
import { DyNTS_Bot_Provider } from '../_models/bot-provider.interface';
|
|
3
|
+
import { DyNTS_Bot_Message } from '../_models/bot-message.interface';
|
|
4
|
+
import { DyNTS_Bot_Channel } from '../_models/bot-channel.interface';
|
|
5
|
+
import { DyNTS_Bot_User } from '../_models/bot-user.interface';
|
|
6
|
+
import { DyNTS_Bot_LastMessageDate } from '../_models/bot-last-message-date.interface';
|
|
7
|
+
import { DyNTS_Bot_LastMentionDate } from '../_models/bot-last-mention-date.interface';
|
|
8
|
+
import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
|
|
9
|
+
|
|
10
|
+
export abstract class DyNTS_Bot_Operations_Util<
|
|
11
|
+
T_PlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>,
|
|
12
|
+
T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>,
|
|
13
|
+
T_PlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>,
|
|
14
|
+
T_PlatformProvider extends DyNTS_Bot_Provider<
|
|
15
|
+
T_PlatformChannel,
|
|
16
|
+
T_PlatformMessage,
|
|
17
|
+
T_PlatformUser
|
|
18
|
+
> = DyNTS_Bot_Provider<
|
|
19
|
+
T_PlatformChannel,
|
|
20
|
+
T_PlatformMessage,
|
|
21
|
+
T_PlatformUser
|
|
22
|
+
>
|
|
23
|
+
> {
|
|
24
|
+
|
|
25
|
+
static async findChannelByName<
|
|
26
|
+
T_PlatformChannel extends DyNTS_Bot_Channel<any>,
|
|
27
|
+
T_PlatformProvider extends DyNTS_Bot_Provider<T_PlatformChannel, any, any>
|
|
28
|
+
>(
|
|
29
|
+
provider: T_PlatformProvider,
|
|
30
|
+
name: string
|
|
31
|
+
): Promise<T_PlatformChannel> {
|
|
32
|
+
const channel = await provider.getChannelByName(name);
|
|
33
|
+
|
|
34
|
+
if (!channel) {
|
|
35
|
+
DyFM_Log.error(`No text channel found with name "${name}"`)
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return channel;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static async sendMessageToChannelByName<T_PlatformChannel extends DyNTS_Bot_Channel<any>, T_PlatformProvider extends DyNTS_Bot_Provider<T_PlatformChannel, any, any>>(
|
|
43
|
+
provider: T_PlatformProvider,
|
|
44
|
+
channelName: string,
|
|
45
|
+
message: string
|
|
46
|
+
): Promise<void> {
|
|
47
|
+
const channel = await this.findChannelByName(provider, channelName);
|
|
48
|
+
|
|
49
|
+
if (channel?.isTextBased) {
|
|
50
|
+
await provider.sendMessageToChannelByName(channelName, message);
|
|
51
|
+
DyFM_Log.success('Message sent to channel', channel.name);
|
|
52
|
+
} else {
|
|
53
|
+
DyFM_Log.error(`Channel is not text based "${channelName}"`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static async readMembersInChannel<T_PlatformUser extends DyNTS_Bot_User<any>, T_PlatformProvider extends DyNTS_Bot_Provider<any, any, T_PlatformUser>>(
|
|
58
|
+
provider: T_PlatformProvider,
|
|
59
|
+
channelName: string
|
|
60
|
+
): Promise<T_PlatformUser[]> {
|
|
61
|
+
return await provider.readMembersInChannel(channelName);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static async readMemberNamesInChannel<T_PlatformProvider extends DyNTS_Bot_Provider<any, any, any>>(
|
|
65
|
+
provider: T_PlatformProvider,
|
|
66
|
+
channelName: string
|
|
67
|
+
): Promise<string[]> {
|
|
68
|
+
return await provider.readMemberNamesInChannel(channelName);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static async fetchAllMessagesWithPaging<T_PlatformMessage extends DyNTS_Bot_Message<any>, T_PlatformProvider extends DyNTS_Bot_Provider<any, T_PlatformMessage, any>>(
|
|
72
|
+
provider: T_PlatformProvider,
|
|
73
|
+
channelId: string,
|
|
74
|
+
maxFetch = 1000
|
|
75
|
+
): Promise<T_PlatformMessage[]> {
|
|
76
|
+
return await provider.fetchAllMessagesWithPaging(channelId, maxFetch);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static async readLastMessageDatesByMembers<T_PlatformProvider extends DyNTS_Bot_Provider<any, any, any>>(
|
|
80
|
+
provider: T_PlatformProvider,
|
|
81
|
+
channelName: string,
|
|
82
|
+
memberNames: string[]
|
|
83
|
+
): Promise<DyNTS_Bot_LastMessageDate[]> {
|
|
84
|
+
return await provider.readLastMessageDatesByMembers(channelName, memberNames);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static async readLastMessageWithMemberNamePingInIt<T_PlatformUser extends DyNTS_Bot_User<any>, T_PlatformProvider extends DyNTS_Bot_Provider<any, any, T_PlatformUser>>(
|
|
88
|
+
provider: T_PlatformProvider,
|
|
89
|
+
channelName: string,
|
|
90
|
+
users: T_PlatformUser[]
|
|
91
|
+
): Promise<DyNTS_Bot_LastMentionDate[]> {
|
|
92
|
+
return await provider.readLastMessageWithMemberNamePingInIt(channelName, users);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
static readMentionsInChannel = this.readLastMessageWithMemberNamePingInIt;
|
|
96
|
+
|
|
97
|
+
static async readLastMessagesInChannel<T_PlatformMessage extends DyNTS_Bot_Message<any>, T_PlatformChannel extends DyNTS_Bot_Channel<any>, T_PlatformProvider extends DyNTS_Bot_Provider<T_PlatformChannel, T_PlatformMessage, any>>(
|
|
98
|
+
provider: T_PlatformProvider,
|
|
99
|
+
channelName: string,
|
|
100
|
+
): Promise<T_PlatformMessage[]> {
|
|
101
|
+
const channel = await provider.getChannelByName(channelName);
|
|
102
|
+
return await provider.fetchMessages(channel.id, 100);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static async getLastMessageInChannel<T_PlatformMessage extends DyNTS_Bot_Message<any>, T_PlatformProvider extends DyNTS_Bot_Provider<any, T_PlatformMessage, any>>(
|
|
106
|
+
provider: T_PlatformProvider,
|
|
107
|
+
channelName: string
|
|
108
|
+
): Promise<T_PlatformMessage> {
|
|
109
|
+
return await provider.getLastMessageInChannel(channelName);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
static async deleteMessage<T_PlatformProvider extends DyNTS_Bot_Provider<any, any, any>>(
|
|
113
|
+
provider: T_PlatformProvider,
|
|
114
|
+
messageId: string,
|
|
115
|
+
channelId: string
|
|
116
|
+
): Promise<void> {
|
|
117
|
+
await provider.deleteMessage(messageId, channelId).catch((error) => {
|
|
118
|
+
DyFM_Error.logSimple('Failed to delete message', error);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
DyFM_Log.success('Message deleted');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static async reportIn<T_PlatformMessage extends DyNTS_Bot_Message<any>, T_PlatformProvider extends DyNTS_Bot_Provider<any, T_PlatformMessage, any>>(provider: T_PlatformProvider): Promise<void> {
|
|
125
|
+
try {
|
|
126
|
+
const lastReportMessage = await this.getLastMessageInChannel(
|
|
127
|
+
provider,
|
|
128
|
+
'bot-reports' // Use default since we can't access channelSettings from provider config
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
const reportMessage = `${provider.getBotDisplayName()} report for duty! ` +
|
|
132
|
+
`(v${DyNTS_global_settings.systemVersion} ${DyNTS_global_settings.env_settings?.environment})`;
|
|
133
|
+
|
|
134
|
+
if (lastReportMessage?.content === reportMessage) {
|
|
135
|
+
await this.deleteMessage(provider, lastReportMessage.id, lastReportMessage.channelId).catch((error) => {
|
|
136
|
+
DyFM_Error.logSimple('Failed to delete message', error);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
this.sendMessageToChannelByName(
|
|
141
|
+
provider,
|
|
142
|
+
'bot-reports', // Use default since we can't access channelSettings from provider config
|
|
143
|
+
reportMessage
|
|
144
|
+
);
|
|
145
|
+
} catch (error) {
|
|
146
|
+
DyFM_Error.logSimple('Failed to report in', error);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DyNTS_Bot_Message } from './bot-message.interface';
|
|
2
|
+
|
|
3
|
+
export interface DyNTS_Bot_Command<T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>> {
|
|
4
|
+
command: string;
|
|
5
|
+
description: string;
|
|
6
|
+
commandHandler: (message: T_PlatformMessage) => Promise<void>;
|
|
7
|
+
permissionNeeded?: (message: T_PlatformMessage) => Promise<boolean>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { DyNTS_Bot_Command } from './bot-command.interface';
|
|
2
|
+
|
|
3
|
+
export interface DyNTS_Bot_Global_Settings {
|
|
4
|
+
/**
|
|
5
|
+
* this setting will set the debug level for the bot
|
|
6
|
+
*
|
|
7
|
+
* 0 - no logs
|
|
8
|
+
* 1 - errors sending to report channel
|
|
9
|
+
* 2 - errors sending as response, will log events in console
|
|
10
|
+
* 3 - errors sending as response, creating reports to report channel, debug events are in console (default)
|
|
11
|
+
* 4 - errors and debug events are sending as response
|
|
12
|
+
* 5 - all events are sending as response (that are set to send)
|
|
13
|
+
* 6 - all debug logs are enabled
|
|
14
|
+
*
|
|
15
|
+
* _
|
|
16
|
+
*/
|
|
17
|
+
debugLevel: number;
|
|
18
|
+
|
|
19
|
+
allowedUsers: 'all' | string[];
|
|
20
|
+
|
|
21
|
+
messageSettings: {
|
|
22
|
+
/**
|
|
23
|
+
* this setting will set the time limit for message fetching
|
|
24
|
+
* so we will stop fetching messages sent later than this time
|
|
25
|
+
*/
|
|
26
|
+
messageFetchTimeLimit: number;
|
|
27
|
+
/**
|
|
28
|
+
* this setting will set the count limit for message fetching
|
|
29
|
+
* so we will stop fetching messages after this count
|
|
30
|
+
*/
|
|
31
|
+
messageFetchCountLimit: number;
|
|
32
|
+
/**
|
|
33
|
+
* this setting will set the delay for message sending,
|
|
34
|
+
* so we won't flood the channel too fast
|
|
35
|
+
*/
|
|
36
|
+
messageSendDelay: number;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* this setting will be used to skip answering to messages
|
|
40
|
+
* if the message contains any of these flags, the bot will not answer
|
|
41
|
+
*
|
|
42
|
+
* @default [ '[BOT-SKIP]' ]
|
|
43
|
+
*/
|
|
44
|
+
skipFlags: string[];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* this setting will set the channel settings for the bot
|
|
49
|
+
*/
|
|
50
|
+
channelSettings: {
|
|
51
|
+
/**
|
|
52
|
+
* this setting will set the name of the channel where the bot will send the reports
|
|
53
|
+
*
|
|
54
|
+
* @default 'bot-report'
|
|
55
|
+
*/
|
|
56
|
+
reportChannelName: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* this setting will set the channels where the bot will answer automatically
|
|
60
|
+
* whenever a message is sent in one of these channels, that is not from the bot
|
|
61
|
+
*
|
|
62
|
+
* it will be populated automatically from the default channels
|
|
63
|
+
*/
|
|
64
|
+
allowedChannels: string[];
|
|
65
|
+
/**
|
|
66
|
+
* this setting will set if the bot can answer in Direct Messages Channels
|
|
67
|
+
*
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
dmIsAllowed: boolean;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* this setting will set the default channels where the bot will answer automatically
|
|
74
|
+
* whenever a message is sent in one of these channels, that is not from the bot
|
|
75
|
+
*
|
|
76
|
+
* @default [ 'bot-report' ]
|
|
77
|
+
*/
|
|
78
|
+
defaultChannels: string[];
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
commandSettings: {
|
|
82
|
+
commandOperator: string;
|
|
83
|
+
commands: DyNTS_Bot_Command[];
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
allowBotsInteractEachOther: boolean;
|
|
87
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface DyNTS_Bot_Message<T_PlatformMessage = any> {
|
|
2
|
+
id: string;
|
|
3
|
+
content: string;
|
|
4
|
+
authorId: string;
|
|
5
|
+
authorName: string;
|
|
6
|
+
authorDisplayName: string;
|
|
7
|
+
channelId: string;
|
|
8
|
+
channelName: string;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
isBot: boolean;
|
|
11
|
+
replyToMessageId?: string;
|
|
12
|
+
mentions: string[]; // user IDs
|
|
13
|
+
rawPlatformMessage: T_PlatformMessage; // Original platform message for platform-specific operations
|
|
14
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { DyNTS_Bot_Message } from './bot-message.interface';
|
|
2
|
+
import { DyNTS_Bot_Channel } from './bot-channel.interface';
|
|
3
|
+
import { DyNTS_Bot_User } from './bot-user.interface';
|
|
4
|
+
import { DyNTS_Bot_LastMessageDate } from './bot-last-message-date.interface';
|
|
5
|
+
import { DyNTS_Bot_LastMentionDate } from './bot-last-mention-date.interface';
|
|
6
|
+
import { DyNTS_Bot_Provider_Type } from '../_enums/bot-provider.enum';
|
|
7
|
+
import { DyNTS_Bot_Global_Settings } from './bot-global-settings.interface';
|
|
8
|
+
|
|
9
|
+
export interface DyNTS_Bot_Provider_Config extends DyNTS_Bot_Global_Settings {
|
|
10
|
+
provider: DyNTS_Bot_Provider_Type;
|
|
11
|
+
providerInstance?: DyNTS_Bot_Provider;
|
|
12
|
+
discord?: {
|
|
13
|
+
token: string;
|
|
14
|
+
guildId: string;
|
|
15
|
+
clientId: string;
|
|
16
|
+
oauth2Url: string;
|
|
17
|
+
};
|
|
18
|
+
slack?: {
|
|
19
|
+
token: string;
|
|
20
|
+
workspace: string;
|
|
21
|
+
};
|
|
22
|
+
teams?: {
|
|
23
|
+
appId: string;
|
|
24
|
+
appPassword: string;
|
|
25
|
+
tenantId: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface DyNTS_Bot_Provider<
|
|
30
|
+
T_PlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>,
|
|
31
|
+
T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>,
|
|
32
|
+
T_PlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>
|
|
33
|
+
> {
|
|
34
|
+
// Initialization
|
|
35
|
+
initialize(config: DyNTS_Bot_Provider_Config): Promise<void>;
|
|
36
|
+
login(token: string): Promise<void>;
|
|
37
|
+
|
|
38
|
+
// Channel operations
|
|
39
|
+
getChannelByName(name: string): Promise<T_PlatformChannel>;
|
|
40
|
+
sendMessageToChannelByName(channelName: string, message: string): Promise<T_PlatformMessage>;
|
|
41
|
+
getMessagesFromChannelByChannelName(channelName: string, limit?: number): Promise<T_PlatformMessage[]>;
|
|
42
|
+
getLastMessageInChannel(channelName: string): Promise<T_PlatformMessage>;
|
|
43
|
+
clearChannel(channelId: string): Promise<void>;
|
|
44
|
+
|
|
45
|
+
// Message operations
|
|
46
|
+
sendMessage(channelId: string, content: string): Promise<T_PlatformMessage>;
|
|
47
|
+
replyToMessage(messageId: string, channelId: string, content: string): Promise<T_PlatformMessage>;
|
|
48
|
+
sendTyping(channelId: string): Promise<void>;
|
|
49
|
+
fetchMessages(channelId: string, limit: number): Promise<T_PlatformMessage[]>;
|
|
50
|
+
fetchAllMessagesWithPaging(channelId: string, maxFetch?: number): Promise<T_PlatformMessage[]>;
|
|
51
|
+
deleteMessage(messageId: string, channelId: string): Promise<void>;
|
|
52
|
+
|
|
53
|
+
// User operations
|
|
54
|
+
getUserByName(username: string): Promise<T_PlatformUser>;
|
|
55
|
+
getUserMention(userId: string): string;
|
|
56
|
+
readMembersInChannel(channelName: string): Promise<T_PlatformUser[]>;
|
|
57
|
+
readMemberNamesInChannel(channelName: string): Promise<string[]>;
|
|
58
|
+
|
|
59
|
+
// Advanced message queries
|
|
60
|
+
getLastMessageSentBy(channelName: string, username: string): Promise<T_PlatformMessage>;
|
|
61
|
+
getLastMentionOf(channelName: string, username: string): Promise<T_PlatformMessage>;
|
|
62
|
+
readLastMessageDatesByMembers(channelName: string, memberNames: string[]): Promise<DyNTS_Bot_LastMessageDate[]>;
|
|
63
|
+
readLastMessageWithMemberNamePingInIt(channelName: string, users: T_PlatformUser[]): Promise<DyNTS_Bot_LastMentionDate[]>;
|
|
64
|
+
|
|
65
|
+
// Platform-specific features (optional, may return null/undefined for unsupported platforms)
|
|
66
|
+
getRoleByName?(roleName: string): any;
|
|
67
|
+
getRolePingByName?(roleName: string): Promise<string>;
|
|
68
|
+
getRolePingsByName?(roleNames: string[]): Promise<string>;
|
|
69
|
+
|
|
70
|
+
// Event binding
|
|
71
|
+
onMessage(handler: (message: T_PlatformMessage, issuer: string) => void): void;
|
|
72
|
+
onReady(handler: () => void): void;
|
|
73
|
+
onError(handler: (error: Error) => void): void;
|
|
74
|
+
|
|
75
|
+
// Metadata
|
|
76
|
+
getBotId(): string;
|
|
77
|
+
getBotDisplayName(): string;
|
|
78
|
+
getProviderName(): string;
|
|
79
|
+
isReady(): boolean;
|
|
80
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DyNTS_Bot_Operations_Util } from '../../../_collections/bot-operations.util';
|
|
2
|
+
import { DyNTS_DiB_Message, DyNTS_DiB_Channel, DyNTS_DiB_User } from '../_models/dib-platform.types';
|
|
3
|
+
import { DyNTS_DiB_Provider } from '../_services/dib-provider.service';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Discord Bot Operations Utility
|
|
7
|
+
*
|
|
8
|
+
* Platform-specific implementation of bot operations for Discord
|
|
9
|
+
*/
|
|
10
|
+
export class DyNTS_DiB_Operations_Util extends DyNTS_Bot_Operations_Util<
|
|
11
|
+
DyNTS_DiB_Channel,
|
|
12
|
+
DyNTS_DiB_Message,
|
|
13
|
+
DyNTS_DiB_User,
|
|
14
|
+
DyNTS_DiB_Provider
|
|
15
|
+
> {
|
|
16
|
+
// Discord-specific operations can be added here
|
|
17
|
+
// All base operations are inherited from the generic class
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DyFM_Error, DyFM_Log } from '@futdevpro/fsm-dynamo';
|
|
2
|
+
import { DyNTS_DiB_Provider } from '../_services/dib-provider.service';
|
|
3
|
+
import { DyNTS_global_settings } from '../../../../../_collections/global-settings.const';
|
|
4
|
+
|
|
5
|
+
export class DyNTS_DiB_Util {
|
|
6
|
+
|
|
7
|
+
static async reportIn(provider: DyNTS_DiB_Provider): Promise<void> {
|
|
8
|
+
try {
|
|
9
|
+
const reportMessage = `${provider.getBotDisplayName()} report for duty! ` +
|
|
10
|
+
`(v${DyNTS_global_settings.systemVersion} ${DyNTS_global_settings.env_settings?.environment})`;
|
|
11
|
+
|
|
12
|
+
await provider.sendMessageToChannelByName(
|
|
13
|
+
DyNTS_global_settings.bot_settings?.channelSettings?.reportChannelName || 'bot-reports',
|
|
14
|
+
reportMessage
|
|
15
|
+
);
|
|
16
|
+
} catch (error) {
|
|
17
|
+
DyFM_Error.logSimple('Failed to report in', error);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Message, TextChannel, GuildMember } from 'discord.js';
|
|
2
|
+
import { DyNTS_Bot_Message } from '../../../_models/bot-message.interface';
|
|
3
|
+
import { DyNTS_Bot_Channel } from '../../../_models/bot-channel.interface';
|
|
4
|
+
import { DyNTS_Bot_User } from '../../../_models/bot-user.interface';
|
|
5
|
+
|
|
6
|
+
// Discord Bot Platform-Specific Types
|
|
7
|
+
export type DyNTS_DiB_Message = DyNTS_Bot_Message<Message>;
|
|
8
|
+
export type DyNTS_DiB_Channel = DyNTS_Bot_Channel<TextChannel>;
|
|
9
|
+
export type DyNTS_DiB_User = DyNTS_Bot_User<GuildMember>;
|