@futdevpro/nts-dynamo 1.14.24 → 1.14.26
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/_services/ai-provider.service-base.d.ts +1 -1
- package/build/_modules/ai/_services/ai-provider.service-base.d.ts.map +1 -1
- package/build/_modules/ai/_services/oai-to-ai-adapter.service.d.ts +39 -0
- package/build/_modules/ai/_services/oai-to-ai-adapter.service.d.ts.map +1 -0
- package/build/_modules/ai/_services/oai-to-ai-adapter.service.js +218 -0
- package/build/_modules/ai/_services/oai-to-ai-adapter.service.js.map +1 -0
- package/build/_modules/assistant/_services/ass-io.control-service.d.ts +4 -3
- package/build/_modules/assistant/_services/ass-io.control-service.d.ts.map +1 -1
- package/build/_modules/assistant/_services/ass-io.control-service.js +6 -6
- package/build/_modules/assistant/_services/ass-io.control-service.js.map +1 -1
- package/build/_modules/assistant/_services/ass-main.control-service.d.ts +2 -2
- package/build/_modules/assistant/_services/ass-main.control-service.d.ts.map +1 -1
- package/build/_modules/assistant/_services/ass.service-base.d.ts +6 -4
- package/build/_modules/assistant/_services/ass.service-base.d.ts.map +1 -1
- package/build/_modules/assistant/_services/ass.service-base.js +6 -4
- package/build/_modules/assistant/_services/ass.service-base.js.map +1 -1
- package/build/_modules/bot/_collections/bot-operations.util.d.ts +13 -13
- package/build/_modules/bot/_collections/bot-operations.util.d.ts.map +1 -1
- package/build/_modules/bot/_collections/bot-operations.util.js.map +1 -1
- package/build/_modules/bot/_enums/bot-message-provider.enum.d.ts +8 -0
- package/build/_modules/bot/_enums/bot-message-provider.enum.d.ts.map +1 -0
- package/build/_modules/bot/_enums/bot-message-provider.enum.js +12 -0
- package/build/_modules/bot/_enums/bot-message-provider.enum.js.map +1 -0
- package/build/_modules/bot/_models/bot-global-settings.interface.d.ts +7 -0
- package/build/_modules/bot/_models/bot-global-settings.interface.d.ts.map +1 -1
- package/build/_modules/bot/_models/bot-message-provider.interface.d.ts +68 -0
- package/build/_modules/bot/_models/bot-message-provider.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-message-provider.interface.js +3 -0
- package/build/_modules/bot/_models/bot-message-provider.interface.js.map +1 -0
- package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts +21 -0
- package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts.map +1 -0
- package/build/_modules/bot/_models/bot-message-wrapper.interface.js +3 -0
- package/build/_modules/bot/_models/bot-message-wrapper.interface.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts +2 -2
- package/build/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.d.ts.map +1 -1
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts +2 -2
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.d.ts.map +1 -1
- package/build/_modules/bot/_modules/discord-bot/_collections/dib.util.js.map +1 -1
- package/build/_modules/bot/_modules/discord-bot/_services/dib-message-provider.service.d.ts +56 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-message-provider.service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-message-provider.service.js +379 -0
- package/build/_modules/bot/_modules/discord-bot/_services/dib-message-provider.service.js.map +1 -0
- package/build/_modules/bot/_modules/discord-bot/index.d.ts +1 -1
- package/build/_modules/bot/_modules/discord-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/discord-bot/index.js +1 -1
- 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.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.d.ts +2 -2
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.d.ts.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.js.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-message-provider.service.d.ts +55 -0
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-message-provider.service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-message-provider.service.js +313 -0
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-message-provider.service.js.map +1 -0
- package/build/_modules/bot/_modules/dynamo-bot/index.d.ts +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/index.js +1 -1
- package/build/_modules/bot/_modules/dynamo-bot/index.js.map +1 -1
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts +2 -2
- package/build/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.d.ts.map +1 -1
- package/build/_modules/bot/_modules/slack-bot/_services/slb-message-provider.service.d.ts +41 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-message-provider.service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-message-provider.service.js +119 -0
- package/build/_modules/bot/_modules/slack-bot/_services/slb-message-provider.service.js.map +1 -0
- package/build/_modules/bot/_modules/slack-bot/index.d.ts +1 -1
- package/build/_modules/bot/_modules/slack-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/slack-bot/index.js +1 -1
- package/build/_modules/bot/_modules/slack-bot/index.js.map +1 -1
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts +2 -2
- package/build/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.d.ts.map +1 -1
- package/build/_modules/bot/_modules/teams-bot/_services/teb-message-provider.service.d.ts +41 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-message-provider.service.d.ts.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-message-provider.service.js +119 -0
- package/build/_modules/bot/_modules/teams-bot/_services/teb-message-provider.service.js.map +1 -0
- package/build/_modules/bot/_modules/teams-bot/index.d.ts +1 -1
- package/build/_modules/bot/_modules/teams-bot/index.d.ts.map +1 -1
- package/build/_modules/bot/_modules/teams-bot/index.js +1 -1
- package/build/_modules/bot/_modules/teams-bot/index.js.map +1 -1
- package/build/_modules/bot/_services/bot-commands.control-service.d.ts +4 -3
- package/build/_modules/bot/_services/bot-commands.control-service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-commands.control-service.js +3 -2
- package/build/_modules/bot/_services/bot-commands.control-service.js.map +1 -1
- package/build/_modules/bot/_services/bot-io.control-service.d.ts +7 -6
- package/build/_modules/bot/_services/bot-io.control-service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-io.control-service.js +38 -17
- package/build/_modules/bot/_services/bot-io.control-service.js.map +1 -1
- package/build/_modules/bot/_services/bot-main.control-service.d.ts +15 -2
- package/build/_modules/bot/_services/bot-main.control-service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-main.control-service.js +105 -1
- package/build/_modules/bot/_services/bot-main.control-service.js.map +1 -1
- package/build/_modules/bot/_services/bot-provider-factory.service.d.ts +3 -2
- package/build/_modules/bot/_services/bot-provider-factory.service.d.ts.map +1 -1
- package/build/_modules/bot/_services/bot-provider-factory.service.js +34 -18
- package/build/_modules/bot/_services/bot-provider-factory.service.js.map +1 -1
- package/build/_modules/bot/_services/bot-routines.control-service.d.ts +2 -2
- package/build/_modules/bot/_services/bot-routines.control-service.d.ts.map +1 -1
- package/build/_modules/bot/index.d.ts +3 -2
- package/build/_modules/bot/index.d.ts.map +1 -1
- package/build/_modules/bot/index.js +3 -2
- package/build/_modules/bot/index.js.map +1 -1
- package/package.json +1 -1
- package/src/_modules/ai/_services/ai-provider.service-base.ts +1 -1
- package/src/_modules/assistant/_services/ass-io.control-service.ts +14 -9
- package/src/_modules/assistant/_services/ass-main.control-service.ts +3 -3
- package/src/_modules/assistant/_services/ass.service-base.ts +13 -5
- package/src/_modules/bot/_collections/bot-operations.util.ts +14 -14
- package/src/_modules/bot/_enums/{bot-provider.enum.ts → bot-message-provider.enum.ts} +1 -1
- package/src/_modules/bot/_models/bot-global-settings.interface.ts +9 -0
- package/src/_modules/bot/_models/{bot-provider.interface.ts → bot-message-provider.interface.ts} +10 -7
- package/src/_modules/bot/_models/bot-message-wrapper.interface.ts +31 -0
- package/src/_modules/bot/_modules/discord-bot/_collections/dib-operations.util.ts +2 -2
- package/src/_modules/bot/_modules/discord-bot/_collections/dib.util.ts +2 -2
- package/src/_modules/bot/_modules/discord-bot/_services/{dib-provider.service.ts → dib-message-provider.service.ts} +20 -7
- package/src/_modules/bot/_modules/discord-bot/index.ts +1 -1
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.ts +3 -3
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb.util.ts +2 -2
- package/src/_modules/bot/_modules/dynamo-bot/_services/{dyb-provider.service.ts → dyb-message-provider.service.ts} +12 -8
- package/src/_modules/bot/_modules/dynamo-bot/index.ts +1 -1
- package/src/_modules/bot/_modules/slack-bot/_collections/slb-operations.util.ts +2 -2
- package/src/_modules/bot/_modules/slack-bot/_services/{slb-provider.service.ts → slb-message-provider.service.ts} +11 -7
- package/src/_modules/bot/_modules/slack-bot/index.ts +1 -1
- package/src/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.ts +2 -2
- package/src/_modules/bot/_modules/teams-bot/_services/{teb-provider.service.ts → teb-message-provider.service.ts} +11 -7
- package/src/_modules/bot/_modules/teams-bot/index.ts +1 -1
- package/src/_modules/bot/_services/bot-commands.control-service.ts +8 -6
- package/src/_modules/bot/_services/bot-io.control-service.ts +49 -23
- package/src/_modules/bot/_services/bot-main.control-service.ts +130 -5
- package/src/_modules/bot/_services/bot-provider-factory.service.ts +42 -20
- package/src/_modules/bot/_services/bot-routines.control-service.ts +3 -3
- package/src/_modules/bot/index.ts +3 -2
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_SlB_MessageProvider = void 0;
|
|
4
|
+
const bot_message_provider_enum_1 = require("../../../_enums/bot-message-provider.enum");
|
|
5
|
+
class DyNTS_SlB_MessageProvider {
|
|
6
|
+
isInitialized = false;
|
|
7
|
+
config;
|
|
8
|
+
// Event handlers
|
|
9
|
+
messageHandlers = [];
|
|
10
|
+
readyHandlers = [];
|
|
11
|
+
errorHandlers = [];
|
|
12
|
+
async initialize(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
if (config.messageProvider !== bot_message_provider_enum_1.DyNTS_Bot_MessageProvider_Type.slack) {
|
|
15
|
+
throw new Error(`Invalid provider type: ${config.messageProvider}. Expected 'slack'`);
|
|
16
|
+
}
|
|
17
|
+
if (!config.slack) {
|
|
18
|
+
throw new Error('Slack configuration is required');
|
|
19
|
+
}
|
|
20
|
+
this.isInitialized = true;
|
|
21
|
+
// TODO: Initialize Slack client
|
|
22
|
+
}
|
|
23
|
+
async login(token) {
|
|
24
|
+
if (!this.isInitialized) {
|
|
25
|
+
throw new Error('Provider not initialized. Call initialize() first.');
|
|
26
|
+
}
|
|
27
|
+
// TODO: Implement Slack login
|
|
28
|
+
throw new Error('Slack provider not yet implemented');
|
|
29
|
+
}
|
|
30
|
+
// Channel operations
|
|
31
|
+
async getChannelByName(name) {
|
|
32
|
+
throw new Error('Slack provider not yet implemented');
|
|
33
|
+
}
|
|
34
|
+
async sendMessageToChannelByName(channelName, message) {
|
|
35
|
+
throw new Error('Slack provider not yet implemented');
|
|
36
|
+
}
|
|
37
|
+
async getMessagesFromChannelByChannelName(channelName, limit) {
|
|
38
|
+
throw new Error('Slack provider not yet implemented');
|
|
39
|
+
}
|
|
40
|
+
async getLastMessageInChannel(channelName) {
|
|
41
|
+
throw new Error('Slack provider not yet implemented');
|
|
42
|
+
}
|
|
43
|
+
async clearChannel(channelId) {
|
|
44
|
+
throw new Error('Slack provider not yet implemented');
|
|
45
|
+
}
|
|
46
|
+
// Message operations
|
|
47
|
+
async sendMessage(channelId, content) {
|
|
48
|
+
throw new Error('Slack provider not yet implemented');
|
|
49
|
+
}
|
|
50
|
+
async replyToMessage(messageId, channelId, content) {
|
|
51
|
+
throw new Error('Slack provider not yet implemented');
|
|
52
|
+
}
|
|
53
|
+
async sendTyping(channelId) {
|
|
54
|
+
throw new Error('Slack provider not yet implemented');
|
|
55
|
+
}
|
|
56
|
+
async fetchMessages(channelId, limit) {
|
|
57
|
+
throw new Error('Slack provider not yet implemented');
|
|
58
|
+
}
|
|
59
|
+
async fetchAllMessagesWithPaging(channelId, maxFetch) {
|
|
60
|
+
throw new Error('Slack provider not yet implemented');
|
|
61
|
+
}
|
|
62
|
+
async deleteMessage(messageId, channelId) {
|
|
63
|
+
throw new Error('Slack provider not yet implemented');
|
|
64
|
+
}
|
|
65
|
+
// User operations
|
|
66
|
+
async getUserByName(username) {
|
|
67
|
+
throw new Error('Slack provider not yet implemented');
|
|
68
|
+
}
|
|
69
|
+
getUserMention(userId) {
|
|
70
|
+
return `<@${userId}>`;
|
|
71
|
+
}
|
|
72
|
+
async readMembersInChannel(channelName) {
|
|
73
|
+
throw new Error('Slack provider not yet implemented');
|
|
74
|
+
}
|
|
75
|
+
async readMemberNamesInChannel(channelName) {
|
|
76
|
+
throw new Error('Slack provider not yet implemented');
|
|
77
|
+
}
|
|
78
|
+
// Advanced message queries
|
|
79
|
+
async getLastMessageSentBy(channelName, username) {
|
|
80
|
+
throw new Error('Slack provider not yet implemented');
|
|
81
|
+
}
|
|
82
|
+
async getLastMentionOf(channelName, username) {
|
|
83
|
+
throw new Error('Slack provider not yet implemented');
|
|
84
|
+
}
|
|
85
|
+
async readLastMessageDatesByMembers(channelName, memberNames) {
|
|
86
|
+
throw new Error('Slack provider not yet implemented');
|
|
87
|
+
}
|
|
88
|
+
async readLastMessageWithMemberNamePingInIt(channelName, users) {
|
|
89
|
+
throw new Error('Slack provider not yet implemented');
|
|
90
|
+
}
|
|
91
|
+
// Event binding
|
|
92
|
+
onMessage(handler) {
|
|
93
|
+
this.messageHandlers.push(handler);
|
|
94
|
+
}
|
|
95
|
+
onReady(handler) {
|
|
96
|
+
this.readyHandlers.push(handler);
|
|
97
|
+
}
|
|
98
|
+
onError(handler) {
|
|
99
|
+
this.errorHandlers.push(handler);
|
|
100
|
+
}
|
|
101
|
+
// Metadata
|
|
102
|
+
getBotId() {
|
|
103
|
+
return 'slack-bot-stub';
|
|
104
|
+
}
|
|
105
|
+
getBotDisplayName() {
|
|
106
|
+
return 'Slack Bot (Stub)';
|
|
107
|
+
}
|
|
108
|
+
getProviderName() {
|
|
109
|
+
return 'slack';
|
|
110
|
+
}
|
|
111
|
+
getProviderId() {
|
|
112
|
+
return this.config?.providerId || this.getProviderName();
|
|
113
|
+
}
|
|
114
|
+
isReady() {
|
|
115
|
+
return this.isInitialized;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.DyNTS_SlB_MessageProvider = DyNTS_SlB_MessageProvider;
|
|
119
|
+
//# sourceMappingURL=slb-message-provider.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slb-message-provider.service.js","sourceRoot":"","sources":["../../../../../../src/_modules/bot/_modules/slack-bot/_services/slb-message-provider.service.ts"],"names":[],"mappings":";;;AAGA,yFAA2F;AAG3F,MAAa,yBAAyB;IAK5B,aAAa,GAAY,KAAK,CAAC;IAC/B,MAAM,CAAmC;IAEjD,iBAAiB;IACT,eAAe,GAAgE,EAAE,CAAC;IAClF,aAAa,GAAsB,EAAE,CAAC;IACtC,aAAa,GAAkC,EAAE,CAAC;IAE1D,KAAK,CAAC,UAAU,CAAC,MAAwC;QACvD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,MAAM,CAAC,eAAe,KAAK,0DAA8B,CAAC,KAAK,EAAE,CAAC;YACpE,MAAM,IAAI,KAAK,CAAC,0BAA0B,MAAM,CAAC,eAAe,oBAAoB,CAAC,CAAC;QACxF,CA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oCAAoC,CAAC,CAAC;IACxD,CAAC;IAED,gBAAgB;IAChB,SAAS,CAAC,OAA6D;QACrE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,CAAC,OAAmB;QACzB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,CAAC,OAA+B;QACrC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,WAAW;IACX,QAAQ;QACN,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED,iBAAiB;QACf,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAED,eAAe;QACb,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,MAAM,EAAE,UAAU,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;IAC3D,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;CACF;AArJD,8DAqJC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/bot/_modules/slack-bot/index.ts"],"names":[],"mappings":"AAOA,cAAc,8BAA8B,CAAC;AAG7C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/bot/_modules/slack-bot/index.ts"],"names":[],"mappings":"AAOA,cAAc,8BAA8B,CAAC;AAG7C,cAAc,0CAA0C,CAAC;AAGzD,cAAc,oCAAoC,CAAC"}
|
|
@@ -9,7 +9,7 @@ const tslib_1 = require("tslib");
|
|
|
9
9
|
// TYPES
|
|
10
10
|
tslib_1.__exportStar(require("./_models/slb-platform.types"), exports);
|
|
11
11
|
// SERVICES
|
|
12
|
-
tslib_1.__exportStar(require("./_services/slb-provider.service"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./_services/slb-message-provider.service"), exports);
|
|
13
13
|
// COLLECTIONS
|
|
14
14
|
tslib_1.__exportStar(require("./_collections/slb-operations.util"), exports);
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/_modules/bot/_modules/slack-bot/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,qBAAqB;AACrB,EAAE;AACF,mFAAmF;AACnF,EAAE;;;AAEF,QAAQ;AACR,uEAA6C;AAE7C,WAAW;AACX,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/_modules/bot/_modules/slack-bot/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,qBAAqB;AACrB,EAAE;AACF,mFAAmF;AACnF,EAAE;;;AAEF,QAAQ;AACR,uEAA6C;AAE7C,WAAW;AACX,mFAAyD;AAEzD,cAAc;AACd,6EAAmD"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DyNTS_Bot_Operations_Util } from '../../../_collections/bot-operations.util';
|
|
2
2
|
import { DyNTS_TeB_Message, DyNTS_TeB_Channel, DyNTS_TeB_User } from '../_models/teb-platform.types';
|
|
3
|
-
import {
|
|
3
|
+
import { DyNTS_TeB_MessageProvider } from '../_services/teb-message-provider.service';
|
|
4
4
|
/**
|
|
5
5
|
* Teams Bot Operations Utility
|
|
6
6
|
*
|
|
7
7
|
* Platform-specific implementation of bot operations for Teams
|
|
8
8
|
*/
|
|
9
|
-
export declare class DyNTS_TeB_Operations_Util extends DyNTS_Bot_Operations_Util<DyNTS_TeB_Channel, DyNTS_TeB_Message, DyNTS_TeB_User,
|
|
9
|
+
export declare class DyNTS_TeB_Operations_Util extends DyNTS_Bot_Operations_Util<DyNTS_TeB_Channel, DyNTS_TeB_Message, DyNTS_TeB_User, DyNTS_TeB_MessageProvider> {
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=teb-operations.util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teb-operations.util.d.ts","sourceRoot":"","sources":["../../../../../../src/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"teb-operations.util.d.ts","sourceRoot":"","sources":["../../../../../../src/_modules/bot/_modules/teams-bot/_collections/teb-operations.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAEtF;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,yBAAyB,CACtE,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,yBAAyB,CAC1B;CAGA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DyNTS_Bot_MessageProvider, DyNTS_Bot_MessageProvider_Config } from '../../../_models/bot-message-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_TeB_Message, DyNTS_TeB_Channel, DyNTS_TeB_User } from '../_models/teb-platform.types';
|
|
5
|
+
export declare class DyNTS_TeB_MessageProvider implements DyNTS_Bot_MessageProvider<DyNTS_TeB_Channel, DyNTS_TeB_Message, DyNTS_TeB_User> {
|
|
6
|
+
private isInitialized;
|
|
7
|
+
private config;
|
|
8
|
+
private messageHandlers;
|
|
9
|
+
private readyHandlers;
|
|
10
|
+
private errorHandlers;
|
|
11
|
+
initialize(config: DyNTS_Bot_MessageProvider_Config): Promise<void>;
|
|
12
|
+
login(token: string): Promise<void>;
|
|
13
|
+
getChannelByName(name: string): Promise<DyNTS_TeB_Channel>;
|
|
14
|
+
sendMessageToChannelByName(channelName: string, message: string): Promise<DyNTS_TeB_Message>;
|
|
15
|
+
getMessagesFromChannelByChannelName(channelName: string, limit?: number): Promise<DyNTS_TeB_Message[]>;
|
|
16
|
+
getLastMessageInChannel(channelName: string): Promise<DyNTS_TeB_Message>;
|
|
17
|
+
clearChannel(channelId: string): Promise<void>;
|
|
18
|
+
sendMessage(channelId: string, content: string): Promise<DyNTS_TeB_Message>;
|
|
19
|
+
replyToMessage(messageId: string, channelId: string, content: string): Promise<DyNTS_TeB_Message>;
|
|
20
|
+
sendTyping(channelId: string): Promise<void>;
|
|
21
|
+
fetchMessages(channelId: string, limit: number): Promise<DyNTS_TeB_Message[]>;
|
|
22
|
+
fetchAllMessagesWithPaging(channelId: string, maxFetch?: number): Promise<DyNTS_TeB_Message[]>;
|
|
23
|
+
deleteMessage(messageId: string, channelId: string): Promise<void>;
|
|
24
|
+
getUserByName(username: string): Promise<DyNTS_TeB_User>;
|
|
25
|
+
getUserMention(userId: string): string;
|
|
26
|
+
readMembersInChannel(channelName: string): Promise<DyNTS_TeB_User[]>;
|
|
27
|
+
readMemberNamesInChannel(channelName: string): Promise<string[]>;
|
|
28
|
+
getLastMessageSentBy(channelName: string, username: string): Promise<DyNTS_TeB_Message>;
|
|
29
|
+
getLastMentionOf(channelName: string, username: string): Promise<DyNTS_TeB_Message>;
|
|
30
|
+
readLastMessageDatesByMembers(channelName: string, memberNames: string[]): Promise<DyNTS_Bot_LastMessageDate[]>;
|
|
31
|
+
readLastMessageWithMemberNamePingInIt(channelName: string, users: DyNTS_TeB_User[]): Promise<DyNTS_Bot_LastMentionDate[]>;
|
|
32
|
+
onMessage(handler: (message: DyNTS_TeB_Message, issuer: string) => void): void;
|
|
33
|
+
onReady(handler: () => void): void;
|
|
34
|
+
onError(handler: (error: Error) => void): void;
|
|
35
|
+
getBotId(): string;
|
|
36
|
+
getBotDisplayName(): string;
|
|
37
|
+
getProviderName(): string;
|
|
38
|
+
getProviderId(): string;
|
|
39
|
+
isReady(): boolean;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=teb-message-provider.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teb-message-provider.service.d.ts","sourceRoot":"","sources":["../../../../../../src/_modules/bot/_modules/teams-bot/_services/teb-message-provider.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,gCAAgC,EAAE,MAAM,iDAAiD,CAAC;AAC9H,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAE7F,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAErG,qBAAa,yBAA0B,YAAW,yBAAyB,CACzE,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,CACf;IACC,OAAO,CAAC,aAAa,CAAkB;IACvC,OAAO,CAAC,MAAM,CAAmC;IAGjD,OAAO,CAAC,eAAe,CAAmE;IAC1F,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,aAAa,CAAqC;IAEpD,UAAU,CAAC,MAAM,EAAE,gCAAgC,GAAG,OAAO,CAAC,IAAI,CAAC;IAenE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASnC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAI1D,0BAA0B,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAI5F,mCAAmC,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC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C;IAInF,6BAA6B,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAI/G,qCAAqC,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,yBAAyB,EAAE,CAAC;IAK/H,SAAS,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAI9E,OAAO,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI;IAIlC,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI;IAK9C,QAAQ,IAAI,MAAM;IAIlB,iBAAiB,IAAI,MAAM;IAI3B,eAAe,IAAI,MAAM;IAIzB,aAAa,IAAI,MAAM;IAIvB,OAAO,IAAI,OAAO;CAGnB"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_TeB_MessageProvider = void 0;
|
|
4
|
+
const bot_message_provider_enum_1 = require("../../../_enums/bot-message-provider.enum");
|
|
5
|
+
class DyNTS_TeB_MessageProvider {
|
|
6
|
+
isInitialized = false;
|
|
7
|
+
config;
|
|
8
|
+
// Event handlers
|
|
9
|
+
messageHandlers = [];
|
|
10
|
+
readyHandlers = [];
|
|
11
|
+
errorHandlers = [];
|
|
12
|
+
async initialize(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
if (config.messageProvider !== bot_message_provider_enum_1.DyNTS_Bot_MessageProvider_Type.teams) {
|
|
15
|
+
throw new Error(`Invalid provider type: ${config.messageProvider}. Expected 'teams'`);
|
|
16
|
+
}
|
|
17
|
+
if (!config.teams) {
|
|
18
|
+
throw new Error('Teams configuration is required');
|
|
19
|
+
}
|
|
20
|
+
this.isInitialized = true;
|
|
21
|
+
// TODO: Initialize Teams client
|
|
22
|
+
}
|
|
23
|
+
async login(token) {
|
|
24
|
+
if (!this.isInitialized) {
|
|
25
|
+
throw new Error('Provider not initialized. Call initialize() first.');
|
|
26
|
+
}
|
|
27
|
+
// TODO: Implement Teams login
|
|
28
|
+
throw new Error('Teams provider not yet implemented');
|
|
29
|
+
}
|
|
30
|
+
// Channel operations
|
|
31
|
+
async getChannelByName(name) {
|
|
32
|
+
throw new Error('Teams provider not yet implemented');
|
|
33
|
+
}
|
|
34
|
+
async sendMessageToChannelByName(channelName, message) {
|
|
35
|
+
throw new Error('Teams provider not yet implemented');
|
|
36
|
+
}
|
|
37
|
+
async getMessagesFromChannelByChannelName(channelName, limit) {
|
|
38
|
+
throw new Error('Teams provider not yet implemented');
|
|
39
|
+
}
|
|
40
|
+
async getLastMessageInChannel(channelName) {
|
|
41
|
+
throw new Error('Teams provider not yet implemented');
|
|
42
|
+
}
|
|
43
|
+
async clearChannel(channelId) {
|
|
44
|
+
throw new Error('Teams provider not yet implemented');
|
|
45
|
+
}
|
|
46
|
+
// Message operations
|
|
47
|
+
async sendMessage(channelId, content) {
|
|
48
|
+
throw new Error('Teams provider not yet implemented');
|
|
49
|
+
}
|
|
50
|
+
async replyToMessage(messageId, channelId, content) {
|
|
51
|
+
throw new Error('Teams provider not yet implemented');
|
|
52
|
+
}
|
|
53
|
+
async sendTyping(channelId) {
|
|
54
|
+
throw new Error('Teams provider not yet implemented');
|
|
55
|
+
}
|
|
56
|
+
async fetchMessages(channelId, limit) {
|
|
57
|
+
throw new Error('Teams provider not yet implemented');
|
|
58
|
+
}
|
|
59
|
+
async fetchAllMessagesWithPaging(channelId, maxFetch) {
|
|
60
|
+
throw new Error('Teams provider not yet implemented');
|
|
61
|
+
}
|
|
62
|
+
async deleteMessage(messageId, channelId) {
|
|
63
|
+
throw new Error('Teams provider not yet implemented');
|
|
64
|
+
}
|
|
65
|
+
// User operations
|
|
66
|
+
async getUserByName(username) {
|
|
67
|
+
throw new Error('Teams provider not yet implemented');
|
|
68
|
+
}
|
|
69
|
+
getUserMention(userId) {
|
|
70
|
+
return `<@${userId}>`;
|
|
71
|
+
}
|
|
72
|
+
async readMembersInChannel(channelName) {
|
|
73
|
+
throw new Error('Teams provider not yet implemented');
|
|
74
|
+
}
|
|
75
|
+
async readMemberNamesInChannel(channelName) {
|
|
76
|
+
throw new Error('Teams provider not yet implemented');
|
|
77
|
+
}
|
|
78
|
+
// Advanced message queries
|
|
79
|
+
async getLastMessageSentBy(channelName, username) {
|
|
80
|
+
throw new Error('Teams provider not yet implemented');
|
|
81
|
+
}
|
|
82
|
+
async getLastMentionOf(channelName, username) {
|
|
83
|
+
throw new Error('Teams provider not yet implemented');
|
|
84
|
+
}
|
|
85
|
+
async readLastMessageDatesByMembers(channelName, memberNames) {
|
|
86
|
+
throw new Error('Teams provider not yet implemented');
|
|
87
|
+
}
|
|
88
|
+
async readLastMessageWithMemberNamePingInIt(channelName, users) {
|
|
89
|
+
throw new Error('Teams provider not yet implemented');
|
|
90
|
+
}
|
|
91
|
+
// Event binding
|
|
92
|
+
onMessage(handler) {
|
|
93
|
+
this.messageHandlers.push(handler);
|
|
94
|
+
}
|
|
95
|
+
onReady(handler) {
|
|
96
|
+
this.readyHandlers.push(handler);
|
|
97
|
+
}
|
|
98
|
+
onError(handler) {
|
|
99
|
+
this.errorHandlers.push(handler);
|
|
100
|
+
}
|
|
101
|
+
// Metadata
|
|
102
|
+
getBotId() {
|
|
103
|
+
return 'teams-bot-stub';
|
|
104
|
+
}
|
|
105
|
+
getBotDisplayName() {
|
|
106
|
+
return 'Teams Bot (Stub)';
|
|
107
|
+
}
|
|
108
|
+
getProviderName() {
|
|
109
|
+
return 'teams';
|
|
110
|
+
}
|
|
111
|
+
getProviderId() {
|
|
112
|
+
return this.config?.providerId || this.getProviderName();
|
|
113
|
+
}
|
|
114
|
+
isReady() {
|
|
115
|
+
return this.isInitialized;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.DyNTS_TeB_MessageProvider = DyNTS_TeB_MessageProvider;
|
|
119
|
+
//# sourceMappingURL=teb-message-provider.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teb-message-provider.service.js","sourceRoot":"","sources":["../../../../../../src/_modules/bot/_modules/teams-bot/_services/teb-message-provider.service.ts"],"names":[],"mappings":";;;AAGA,yFAA2F;AAG3F,MAAa,yBAAyB;IAK5B,aAAa,GAAY,KAAK,CAAC;IAC/B,MAAM,CAAmC;IAEjD,iBAAiB;IACT,eAAe,GAAgE,EAAE,CAAC;IAClF,aAAa,GAAsB,EAAE,CAAC;IACtC,aAAa,GAAkC,EAAE,CAAC;IAE1D,KAAK,CAAC,UAAU,CAAC,MAAwC;QACvD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,MAAM,CAAC,eAAe,KAAK,0DAA8B,CAAC,KAAK,EAAE,CAAC;YACpE,MAAM,IAAI,KAAK,CAAC,0BAA0B,MAAM,CAAC,eAAe,oBAAoB,CAAC,CAAC;QACxF,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,gCAAgC;IAClC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,KAAa;QACvB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACxE,CAAC;QACD,8BAA8B;QAC9B,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;IAED,qBAAqB;IACrB,KAAK,CAAC,gBAAgB,CAAC,IAAY;QACjC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,0BAA0B,CAAC,WAAmB,EAAE,OAAe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e,EAAE,CAAC;IAC3D,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;CACF;AArJD,8DAqJC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/bot/_modules/teams-bot/index.ts"],"names":[],"mappings":"AAOA,cAAc,8BAA8B,CAAC;AAG7C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_modules/bot/_modules/teams-bot/index.ts"],"names":[],"mappings":"AAOA,cAAc,8BAA8B,CAAC;AAG7C,cAAc,0CAA0C,CAAC;AAGzD,cAAc,oCAAoC,CAAC"}
|
|
@@ -9,7 +9,7 @@ const tslib_1 = require("tslib");
|
|
|
9
9
|
// TYPES
|
|
10
10
|
tslib_1.__exportStar(require("./_models/teb-platform.types"), exports);
|
|
11
11
|
// SERVICES
|
|
12
|
-
tslib_1.__exportStar(require("./_services/teb-provider.service"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./_services/teb-message-provider.service"), exports);
|
|
13
13
|
// COLLECTIONS
|
|
14
14
|
tslib_1.__exportStar(require("./_collections/teb-operations.util"), exports);
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/_modules/bot/_modules/teams-bot/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,qBAAqB;AACrB,EAAE;AACF,mFAAmF;AACnF,EAAE;;;AAEF,QAAQ;AACR,uEAA6C;AAE7C,WAAW;AACX,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/_modules/bot/_modules/teams-bot/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,qBAAqB;AACrB,EAAE;AACF,mFAAmF;AACnF,EAAE;;;AAEF,QAAQ;AACR,uEAA6C;AAE7C,WAAW;AACX,mFAAyD;AAEzD,cAAc;AACd,6EAAmD"}
|
|
@@ -3,13 +3,14 @@ import { DyNTS_Bot_Main_ControlService } from './bot-main.control-service';
|
|
|
3
3
|
import { DyNTS_Bot_Message } from '../_models/bot-message.interface';
|
|
4
4
|
import { DyNTS_Bot_User } from '../_models/bot-user.interface';
|
|
5
5
|
import { DyNTS_Bot_Channel } from '../_models/bot-channel.interface';
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { DyNTS_Bot_MessageProvider } from '../_models/bot-message-provider.interface';
|
|
7
|
+
import { DyNTS_Bot_MessageWrapper } from '../_models/bot-message-wrapper.interface';
|
|
8
|
+
export declare abstract class DyNTS_Bot_Commands_ControlService<T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>, T_PlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>, T_PlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>, T_PlatformProvider extends DyNTS_Bot_MessageProvider<T_PlatformChannel, T_PlatformMessage, T_PlatformUser> = DyNTS_Bot_MessageProvider<T_PlatformChannel, T_PlatformMessage, T_PlatformUser>> extends DyNTS_SingletonService {
|
|
8
9
|
static getInstance<T_PlatformMessage extends DyNTS_Bot_Message<any>>(): DyNTS_Bot_Commands_ControlService<T_PlatformMessage>;
|
|
9
10
|
protected abstract getMainBotControlService(): DyNTS_Bot_Main_ControlService<T_PlatformChannel, T_PlatformMessage, T_PlatformUser, T_PlatformProvider>;
|
|
10
11
|
protected readonly mainBot_CS: DyNTS_Bot_Main_ControlService<T_PlatformChannel, T_PlatformMessage, T_PlatformUser, T_PlatformProvider>;
|
|
11
12
|
get provider(): T_PlatformProvider;
|
|
12
13
|
protected constructor();
|
|
13
|
-
handleCommand(message: T_PlatformMessage, issuer: string): Promise<void>;
|
|
14
|
+
handleCommand(message: T_PlatformMessage, wrapper: DyNTS_Bot_MessageWrapper<T_PlatformMessage>, issuer: string): Promise<void>;
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=bot-commands.control-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-commands.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/bot/_services/bot-commands.control-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bot-commands.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/bot/_services/bot-commands.control-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAoC,MAAM,2CAA2C,CAAC;AACxH,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,8BAAsB,iCAAiC,CACrD,iBAAiB,SAAS,iBAAiB,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,GAAG,CAAC,EACzE,iBAAiB,SAAS,iBAAiB,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,GAAG,CAAC,EACzE,cAAc,SAAS,cAAc,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,EAChE,kBAAkB,SAAS,yBAAyB,CAClD,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,CACf,GAAG,yBAAyB,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,CAAC,CACnF,SAAQ,sBAAsB;IAE9B,MAAM,CAAC,WAAW,CAAC,iBAAiB,SAAS,iBAAiB,CAAC,GAAG,CAAC,KAAK,iCAAiC,CAAC,iBAAiB,CAAC;IAI5H,SAAS,CAAC,QAAQ,CAAC,wBAAwB,IAAI,6BAA6B,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,CAAC;IACtJ,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,6BAA6B,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,CAAC,CACpG;IAElC,IAAI,QAAQ,IAAI,kBAAkB,CAEjC;IAED,SAAS;IAkBH,aAAa,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,wBAAwB,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CA0ErI"}
|
|
@@ -22,7 +22,7 @@ class DyNTS_Bot_Commands_ControlService extends singleton_service_1.DyNTS_Single
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
async handleCommand(message, issuer) {
|
|
25
|
+
async handleCommand(message, wrapper, issuer) {
|
|
26
26
|
try {
|
|
27
27
|
const botSettings = global_settings_const_1.DyNTS_global_settings.bot_settings;
|
|
28
28
|
let haveCommandOperator = false;
|
|
@@ -59,7 +59,8 @@ class DyNTS_Bot_Commands_ControlService extends singleton_service_1.DyNTS_Single
|
|
|
59
59
|
await commandExists.commandHandler(message);
|
|
60
60
|
}
|
|
61
61
|
catch (error) {
|
|
62
|
-
|
|
62
|
+
const provider = wrapper?.provider || this.provider;
|
|
63
|
+
provider.replyToMessage(message.id, message.channelId, `Error occurred while handling the command:\n` +
|
|
63
64
|
fsm_dynamo_1.DyFM_Error.getAnyMessage(error));
|
|
64
65
|
throw new fsm_dynamo_1.DyFM_Error({
|
|
65
66
|
...this.getDefaultErrorSettings('handleCommand', error, issuer),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-commands.control-service.js","sourceRoot":"","sources":["../../../../src/_modules/bot/_services/bot-commands.control-service.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AAEnD,iFAAmF;AAEnF,uFAAoF;
|
|
1
|
+
{"version":3,"file":"bot-commands.control-service.js","sourceRoot":"","sources":["../../../../src/_modules/bot/_services/bot-commands.control-service.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AAEnD,iFAAmF;AAEnF,uFAAoF;AAQpF,MAAsB,iCASpB,SAAQ,0CAAsB;IAE9B,MAAM,CAAC,WAAW;QAChB,OAAO,iCAAiC,CAAC,oBAAoB,EAAE,CAAC;IAClE,CAAC;IAGkB,UAAU,GAC3B,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAElC,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;IACnC,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,IAAI,uBAAU,CAAC;gBACnB,GAAG,IAAI,CAAC,uBAAuB,CAC7B,aAAa,EACb,IAAI,KAAK,CACP,oCAAoC;oBACpC,iEAAiE,CAClE,EACD,aAAa,CACd;gBACD,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,oBAAoB;aAC5E,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,OAA0B,EAAE,OAAoD,EAAE,MAAc;QAClH,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,6CAAqB,CAAC,YAAgD,CAAC;YAC3F,IAAI,mBAAmB,GAAG,KAAK,CAAC;YAChC,IAAI,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAC/B,KAAK,IAAI,CAAC,UAAU,CAA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C,OAAO,CAAC,CAAC;gBAEvE,IAAI,CAAC,gBAAgB,EAAE,CAAC;oBACtB,MAAM,IAAI,uBAAU,CAAC;wBACnB,GAAG,IAAI,CAAC,uBAAuB,CAC7B,eAAe,EACf,IAAI,KAAK,CAAC,mBAAmB,CAAC,EAC9B,MAAM,CACP;wBACD,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,oBAAoB;qBAC5E,CAAC,CAAA;gBACJ,CAAC;YACH,CAAC;YAED,MAAM,aAAa,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC;YACpD,QAAQ,CAAC,cAAc,CACrB,OAAO,CAAC,EAAE,EACV,OAAO,CAAC,SAAS,EACjB,8CAA8C;gBAC9C,uBAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAChC,CAAA;YAED,MAAM,IAAI,uBAAU,CAAC;gBACnB,GAAG,IAAI,CAAC,uBAAuB,CAAC,eAAe,EAAE,KAAK,EAAE,MAAM,CAAC;gBAC/D,SAAS,EAAE,GAAG,6CAAqB,CAAC,mBAAmB,oBAAoB;aAC5E,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF;AAnHD,8EAmHC"}
|
|
@@ -4,8 +4,9 @@ import { DyNTS_Bot_Main_ControlService } from './bot-main.control-service';
|
|
|
4
4
|
import { DyNTS_Bot_Message } from '../_models/bot-message.interface';
|
|
5
5
|
import { DyNTS_Bot_Channel } from '../_models/bot-channel.interface';
|
|
6
6
|
import { DyNTS_Bot_User } from '../_models/bot-user.interface';
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import { DyNTS_Bot_MessageProvider } from '../_models/bot-message-provider.interface';
|
|
8
|
+
import { DyNTS_Bot_MessageWrapper } from '../_models/bot-message-wrapper.interface';
|
|
9
|
+
export declare abstract class DyNTS_Bot_IO_ControlService<T_PlatformChannel extends DyNTS_Bot_Channel<any> = DyNTS_Bot_Channel<any>, T_PlatformMessage extends DyNTS_Bot_Message<any> = DyNTS_Bot_Message<any>, T_PlatformUser extends DyNTS_Bot_User<any> = DyNTS_Bot_User<any>, T_PlatformProvider extends DyNTS_Bot_MessageProvider<T_PlatformChannel, T_PlatformMessage, T_PlatformUser> = DyNTS_Bot_MessageProvider<T_PlatformChannel, T_PlatformMessage, T_PlatformUser>> extends DyNTS_SingletonService {
|
|
9
10
|
protected abstract getMainBotControlService(): DyNTS_Bot_Main_ControlService<T_PlatformChannel, T_PlatformMessage, T_PlatformUser, T_PlatformProvider>;
|
|
10
11
|
protected abstract mainBot_CS: DyNTS_Bot_Main_ControlService<T_PlatformChannel, T_PlatformMessage, T_PlatformUser, T_PlatformProvider>;
|
|
11
12
|
get provider(): T_PlatformProvider;
|
|
@@ -15,10 +16,10 @@ export declare abstract class DyNTS_Bot_IO_ControlService<T_PlatformChannel exte
|
|
|
15
16
|
protected commands_CS: DyNTS_Bot_Commands_ControlService<T_PlatformMessage>;
|
|
16
17
|
dontSendErrorReply?: boolean;
|
|
17
18
|
start(issuer: string): Promise<void>;
|
|
18
|
-
handleNewMessage(
|
|
19
|
-
abstract handleMessage(message: T_PlatformMessage, issuer: string): Promise<T_PlatformMessage>;
|
|
20
|
-
getMessageIsForBotToHandle(message: T_PlatformMessage, issuer: string, dontRemovePing?: boolean): Promise<boolean>;
|
|
21
|
-
handleIfCommand(message: T_PlatformMessage, issuer: string): Promise<boolean>;
|
|
19
|
+
handleNewMessage(wrapperOrMessage: DyNTS_Bot_MessageWrapper<T_PlatformMessage> | T_PlatformMessage, issuer: string): Promise<void>;
|
|
20
|
+
abstract handleMessage(message: T_PlatformMessage, wrapper: DyNTS_Bot_MessageWrapper<T_PlatformMessage>, issuer: string): Promise<T_PlatformMessage>;
|
|
21
|
+
getMessageIsForBotToHandle(message: T_PlatformMessage, wrapper: DyNTS_Bot_MessageWrapper<T_PlatformMessage>, issuer: string, dontRemovePing?: boolean): Promise<boolean>;
|
|
22
|
+
handleIfCommand(message: T_PlatformMessage, wrapper: DyNTS_Bot_MessageWrapper<T_PlatformMessage>, issuer: string): Promise<boolean>;
|
|
22
23
|
isCommand(message: T_PlatformMessage, issuer: string): Promise<boolean>;
|
|
23
24
|
}
|
|
24
25
|
//# sourceMappingURL=bot-io.control-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-io.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/bot/_services/bot-io.control-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAA;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAA;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bot-io.control-service.d.ts","sourceRoot":"","sources":["../../../../src/_modules/bot/_services/bot-io.control-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAA;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAA;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAA;AAErF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAA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AC,iBAAiB,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAE9I,0BAA0B,CAC9B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,wBAAwB,CAAC,iBAAiB,CAAC,EACpD,MAAM,EAAE,MAAM,EACd,cAAc,CAAC,EAAE,OAAO,GACvB,OAAO,CAAC,OAAO,CAAC;IA4Ib,eAAe,CAAC,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,wBAAwB,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAiBnI,SAAS,CAAC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CA+B9E"}
|
|
@@ -36,27 +36,39 @@ class DyNTS_Bot_IO_ControlService extends singleton_service_1.DyNTS_SingletonSer
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
async handleNewMessage(
|
|
39
|
+
async handleNewMessage(wrapperOrMessage, issuer) {
|
|
40
|
+
// Declare variables outside try-catch for error handling
|
|
41
|
+
let wrapper;
|
|
42
|
+
let message;
|
|
40
43
|
try {
|
|
44
|
+
// Support both wrapped messages (multi-provider) and unwrapped (backward compatibility)
|
|
45
|
+
const isWrapper = 'message' in wrapperOrMessage && 'providerId' in wrapperOrMessage;
|
|
46
|
+
wrapper = isWrapper ? wrapperOrMessage : {
|
|
47
|
+
message: wrapperOrMessage,
|
|
48
|
+
providerId: 'default',
|
|
49
|
+
providerType: this.provider.getProviderName(),
|
|
50
|
+
provider: this.provider
|
|
51
|
+
};
|
|
52
|
+
message = wrapper.message;
|
|
41
53
|
const botSettings = global_settings_const_1.DyNTS_global_settings.bot_settings;
|
|
42
54
|
if (botSettings?.debugLevel >= 1) {
|
|
43
|
-
fsm_dynamo_1.DyFM_Log.H_log(`incoming message (${message.authorDisplayName}):\n${message.content}`);
|
|
55
|
+
fsm_dynamo_1.DyFM_Log.H_log(`incoming message (${message.authorDisplayName}) [${wrapper.providerId}]:\n${message.content}`);
|
|
44
56
|
}
|
|
45
|
-
const isForYou = await this.getMessageIsForBotToHandle(message, issuer);
|
|
57
|
+
const isForYou = await this.getMessageIsForBotToHandle(message, wrapper, issuer);
|
|
46
58
|
if (!isForYou) {
|
|
47
59
|
return;
|
|
48
60
|
}
|
|
49
|
-
const isHandledAsCommand = await this.handleIfCommand(message, issuer);
|
|
61
|
+
const isHandledAsCommand = await this.handleIfCommand(message, wrapper, issuer);
|
|
50
62
|
if (isHandledAsCommand) {
|
|
51
63
|
return;
|
|
52
64
|
}
|
|
53
|
-
await this.handleMessage(message, issuer);
|
|
65
|
+
await this.handleMessage(message, wrapper, issuer);
|
|
54
66
|
// Sync message to messaging system if enabled
|
|
55
67
|
try {
|
|
56
68
|
if (global_settings_const_1.DyNTS_global_settings.messaging_settings?.integration?.syncBotMessages) {
|
|
57
69
|
const messagingIntegration = msg_integration_control_service_1.DyNTS_Msg_Integration_ControlService.getInstance();
|
|
58
70
|
// Find or create conversation for this channel
|
|
59
|
-
const conversation = await messagingIntegration.findOrCreateBotConversation(message.channelId,
|
|
71
|
+
const conversation = await messagingIntegration.findOrCreateBotConversation(message.channelId, wrapper.providerType, issuer);
|
|
60
72
|
// Sync the message
|
|
61
73
|
await messagingIntegration.syncBotMessage(message, conversation._id, issuer);
|
|
62
74
|
}
|
|
@@ -70,10 +82,15 @@ class DyNTS_Bot_IO_ControlService extends singleton_service_1.DyNTS_SingletonSer
|
|
|
70
82
|
fsm_dynamo_1.DyFM_Error.logSimple('❌❌ Error handleNewMessage:', error);
|
|
71
83
|
const botSettings = global_settings_const_1.DyNTS_global_settings.bot_settings;
|
|
72
84
|
if (!this.dontSendErrorReply && botSettings?.debugLevel >= 1) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
// Use wrapper if available, fallback to default provider
|
|
86
|
+
const errorProvider = wrapper?.provider || this.provider;
|
|
87
|
+
const errorMessage = wrapper?.message || message;
|
|
88
|
+
if (errorProvider && errorMessage) {
|
|
89
|
+
await errorProvider.replyToMessage(errorMessage.id, errorMessage.channelId, `[SYSTEM|ERROR|${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-Bot-IO-H0] Error occurred while handling the message:\n` +
|
|
90
|
+
fsm_dynamo_1.DyFM_Error.getAnyMessage(error)).catch(err => {
|
|
91
|
+
fsm_dynamo_1.DyFM_Error.logSimple('❌❌ Error sending message to report channel:', err);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
77
94
|
}
|
|
78
95
|
throw new fsm_dynamo_1.DyFM_Error({
|
|
79
96
|
...this.getDefaultErrorSettings('handleNewMessage', error, issuer),
|
|
@@ -81,10 +98,11 @@ class DyNTS_Bot_IO_ControlService extends singleton_service_1.DyNTS_SingletonSer
|
|
|
81
98
|
});
|
|
82
99
|
}
|
|
83
100
|
}
|
|
84
|
-
async getMessageIsForBotToHandle(message, issuer, dontRemovePing) {
|
|
101
|
+
async getMessageIsForBotToHandle(message, wrapper, issuer, dontRemovePing) {
|
|
85
102
|
try {
|
|
86
103
|
const botSettings = global_settings_const_1.DyNTS_global_settings.bot_settings;
|
|
87
|
-
|
|
104
|
+
const provider = wrapper.provider || this.provider;
|
|
105
|
+
if (!provider || !this.mainBot_CS || !this.botClientId) {
|
|
88
106
|
fsm_dynamo_1.DyFM_Log.H_error('🚫❌ Bot not initialized yet. END wont respond to message:', message.content, new Error('Bot not initialized yet').stack);
|
|
89
107
|
await this.start(issuer);
|
|
90
108
|
if (!this.provider || !this.mainBot_CS || !this.botClientId) {
|
|
@@ -108,7 +126,8 @@ class DyNTS_Bot_IO_ControlService extends singleton_service_1.DyNTS_SingletonSer
|
|
|
108
126
|
fsm_dynamo_1.DyFM_Log.warn('🚫❌ not allowed channel. END');
|
|
109
127
|
}
|
|
110
128
|
if (!isOwnMessage && isPinged) {
|
|
111
|
-
|
|
129
|
+
const provider = wrapper.provider || this.provider;
|
|
130
|
+
provider.replyToMessage(message.id, message.channelId, `[SYSTEM|REFUSE|CHANNEL] I'm sorry, but I'm not allowed to answer you in this channel!`);
|
|
112
131
|
}
|
|
113
132
|
return false;
|
|
114
133
|
}
|
|
@@ -128,7 +147,8 @@ class DyNTS_Bot_IO_ControlService extends singleton_service_1.DyNTS_SingletonSer
|
|
|
128
147
|
!botSettings?.allowBotsInteractEachOther) {
|
|
129
148
|
if (isPinged && botSettings?.debugLevel >= 2) {
|
|
130
149
|
fsm_dynamo_1.DyFM_Log.warn('🚫🤖❌ not for me; this message is from a bot');
|
|
131
|
-
|
|
150
|
+
const provider = wrapper.provider || this.provider;
|
|
151
|
+
provider.replyToMessage(message.id, message.channelId, '[SYSTEM|REFUSE|BOT] You should not ping me!');
|
|
132
152
|
}
|
|
133
153
|
return false;
|
|
134
154
|
}
|
|
@@ -145,7 +165,8 @@ class DyNTS_Bot_IO_ControlService extends singleton_service_1.DyNTS_SingletonSer
|
|
|
145
165
|
if (!isAllowedUser) {
|
|
146
166
|
if (botSettings?.debugLevel >= 2) {
|
|
147
167
|
fsm_dynamo_1.DyFM_Log.warn('🚫❌ not allowed user. END', message.authorName, message.authorDisplayName);
|
|
148
|
-
|
|
168
|
+
const provider = wrapper.provider || this.provider;
|
|
169
|
+
provider.replyToMessage(message.id, message.channelId, `[SYSTEM|REFUSE|USER] I'm sorry, but I'm not allowed to answer you!`);
|
|
149
170
|
}
|
|
150
171
|
return false;
|
|
151
172
|
}
|
|
@@ -164,11 +185,11 @@ class DyNTS_Bot_IO_ControlService extends singleton_service_1.DyNTS_SingletonSer
|
|
|
164
185
|
});
|
|
165
186
|
}
|
|
166
187
|
}
|
|
167
|
-
async handleIfCommand(message, issuer) {
|
|
188
|
+
async handleIfCommand(message, wrapper, issuer) {
|
|
168
189
|
try {
|
|
169
190
|
const isCommand = await this.isCommand(message, issuer);
|
|
170
191
|
if (isCommand) {
|
|
171
|
-
await this.commands_CS.handleCommand(message, issuer);
|
|
192
|
+
await this.commands_CS.handleCommand(message, wrapper, issuer);
|
|
172
193
|
}
|
|
173
194
|
return Boolean(isCommand);
|
|
174
195
|
}
|