@futdevpro/nts-dynamo 1.10.77 → 1.11.2

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.
Files changed (316) hide show
  1. package/build/_collections/atlas-default-db-options.const.d.ts +28 -0
  2. package/build/_collections/atlas-default-db-options.const.d.ts.map +1 -0
  3. package/build/_collections/atlas-default-db-options.const.js +10 -0
  4. package/build/_collections/atlas-default-db-options.const.js.map +1 -0
  5. package/build/_collections/get-environment-settings.util.d.ts +3 -0
  6. package/build/_collections/get-environment-settings.util.d.ts.map +1 -0
  7. package/build/_collections/get-environment-settings.util.js +45 -0
  8. package/build/_collections/get-environment-settings.util.js.map +1 -0
  9. package/build/_collections/global-settings.const.d.ts.map +1 -1
  10. package/build/_collections/global-settings.const.js +9 -4
  11. package/build/_collections/global-settings.const.js.map +1 -1
  12. package/build/_models/control-models/app-params.control-model.d.ts +6 -0
  13. package/build/_models/control-models/app-params.control-model.d.ts.map +1 -1
  14. package/build/_models/control-models/app-params.control-model.js +29 -2
  15. package/build/_models/control-models/app-params.control-model.js.map +1 -1
  16. package/build/_models/control-models/app-params.control-model.spec.js +5 -4
  17. package/build/_models/control-models/app-params.control-model.spec.js.map +1 -1
  18. package/build/_models/control-models/endpoint-params.control-model.js +1 -1
  19. package/build/_models/control-models/endpoint-params.control-model.js.map +1 -1
  20. package/build/_models/interfaces/environment-settings.interface.d.ts +35 -0
  21. package/build/_models/interfaces/environment-settings.interface.d.ts.map +1 -0
  22. package/build/_models/interfaces/environment-settings.interface.js +3 -0
  23. package/build/_models/interfaces/environment-settings.interface.js.map +1 -0
  24. package/build/_models/interfaces/global-settings.interface.d.ts +34 -2
  25. package/build/_models/interfaces/global-settings.interface.d.ts.map +1 -1
  26. package/build/_modules/custom-data/index.d.ts.map +1 -1
  27. package/build/_modules/custom-data/index.js +1 -0
  28. package/build/_modules/custom-data/index.js.map +1 -1
  29. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.d.ts +3 -0
  30. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.d.ts.map +1 -0
  31. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.js +17 -0
  32. package/build/_modules/discord-assistant/_collections/dias-global-settings.const.js.map +1 -0
  33. package/build/_modules/discord-assistant/_collections/dias.util.d.ts +6 -0
  34. package/build/_modules/discord-assistant/_collections/dias.util.d.ts.map +1 -0
  35. package/build/_modules/discord-assistant/_collections/dias.util.js +36 -0
  36. package/build/_modules/discord-assistant/_collections/dias.util.js.map +1 -0
  37. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.d.ts +18 -0
  38. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.d.ts.map +1 -0
  39. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.js +3 -0
  40. package/build/_modules/discord-assistant/_models/dias-global-settings.interface.js.map +1 -0
  41. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.d.ts +10 -0
  42. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.d.ts.map +1 -0
  43. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.js +41 -0
  44. package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.js.map +1 -0
  45. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts +14 -0
  46. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts.map +1 -0
  47. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js +88 -0
  48. package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js.map +1 -0
  49. package/build/_modules/discord-assistant/_services/dias-io.control-service.d.ts +10 -0
  50. package/build/_modules/discord-assistant/_services/dias-io.control-service.d.ts.map +1 -0
  51. package/build/_modules/discord-assistant/_services/dias-io.control-service.js +40 -0
  52. package/build/_modules/discord-assistant/_services/dias-io.control-service.js.map +1 -0
  53. package/build/_modules/discord-assistant/_services/dias-main.control-service.d.ts +8 -0
  54. package/build/_modules/discord-assistant/_services/dias-main.control-service.d.ts.map +1 -0
  55. package/build/_modules/discord-assistant/_services/dias-main.control-service.js +23 -0
  56. package/build/_modules/discord-assistant/_services/dias-main.control-service.js.map +1 -0
  57. package/build/_modules/discord-assistant/_services/dias.service-base.d.ts +11 -0
  58. package/build/_modules/discord-assistant/_services/dias.service-base.d.ts.map +1 -0
  59. package/build/_modules/discord-assistant/_services/dias.service-base.js +33 -0
  60. package/build/_modules/discord-assistant/_services/dias.service-base.js.map +1 -0
  61. package/build/_modules/discord-assistant/index.d.ts +10 -0
  62. package/build/_modules/discord-assistant/index.d.ts.map +1 -0
  63. package/build/_modules/discord-assistant/index.js +23 -0
  64. package/build/_modules/discord-assistant/index.js.map +1 -0
  65. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.d.ts +4 -0
  66. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.d.ts.map +1 -0
  67. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.js +8 -0
  68. package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.js.map +1 -0
  69. package/build/_modules/discord-assistant-voiced/index.d.ts +3 -0
  70. package/build/_modules/discord-assistant-voiced/index.d.ts.map +1 -0
  71. package/build/_modules/discord-assistant-voiced/index.js +26 -0
  72. package/build/_modules/discord-assistant-voiced/index.js.map +1 -0
  73. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.d.ts +3 -0
  74. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.d.ts.map +1 -0
  75. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.js +13 -0
  76. package/build/_modules/discord-bot/_collections/dibo-default-commands.const.js.map +1 -0
  77. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.d.ts +3 -0
  78. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.d.ts.map +1 -0
  79. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.js +44 -0
  80. package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.js.map +1 -0
  81. package/build/_modules/discord-bot/_collections/dibo-operations.util.d.ts +22 -0
  82. package/build/_modules/discord-bot/_collections/dibo-operations.util.d.ts.map +1 -0
  83. package/build/_modules/discord-bot/_collections/dibo-operations.util.js +261 -0
  84. package/build/_modules/discord-bot/_collections/dibo-operations.util.js.map +1 -0
  85. package/build/_modules/discord-bot/_models/dibo-command.interface.d.ts +8 -0
  86. package/build/_modules/discord-bot/_models/dibo-command.interface.d.ts.map +1 -0
  87. package/build/_modules/discord-bot/_models/dibo-command.interface.js +3 -0
  88. package/build/_modules/discord-bot/_models/dibo-command.interface.js.map +1 -0
  89. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.d.ts +7 -0
  90. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.d.ts.map +1 -0
  91. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.js +3 -0
  92. package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.js.map +1 -0
  93. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.d.ts +6 -0
  94. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.d.ts.map +1 -0
  95. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.js +3 -0
  96. package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.js.map +1 -0
  97. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.d.ts +88 -0
  98. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.d.ts.map +1 -0
  99. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.js +3 -0
  100. package/build/_modules/discord-bot/_models/global-bot-log-settings.interface.js.map +1 -0
  101. package/build/_modules/discord-bot/_services/dibo-commands.control-service.d.ts +12 -0
  102. package/build/_modules/discord-bot/_services/dibo-commands.control-service.d.ts.map +1 -0
  103. package/build/_modules/discord-bot/_services/dibo-commands.control-service.js +72 -0
  104. package/build/_modules/discord-bot/_services/dibo-commands.control-service.js.map +1 -0
  105. package/build/_modules/discord-bot/_services/dibo-io.control-service.d.ts +19 -0
  106. package/build/_modules/discord-bot/_services/dibo-io.control-service.d.ts.map +1 -0
  107. package/build/_modules/discord-bot/_services/dibo-io.control-service.js +176 -0
  108. package/build/_modules/discord-bot/_services/dibo-io.control-service.js.map +1 -0
  109. package/build/_modules/discord-bot/_services/dibo-main.control-service.d.ts +85 -0
  110. package/build/_modules/discord-bot/_services/dibo-main.control-service.d.ts.map +1 -0
  111. package/build/_modules/discord-bot/_services/dibo-main.control-service.js +228 -0
  112. package/build/_modules/discord-bot/_services/dibo-main.control-service.js.map +1 -0
  113. package/build/_modules/discord-bot/_services/dibo-routines.control-service.d.ts +13 -0
  114. package/build/_modules/discord-bot/_services/dibo-routines.control-service.d.ts.map +1 -0
  115. package/build/_modules/discord-bot/_services/dibo-routines.control-service.js +38 -0
  116. package/build/_modules/discord-bot/_services/dibo-routines.control-service.js.map +1 -0
  117. package/build/_modules/discord-bot/index.d.ts +12 -0
  118. package/build/_modules/discord-bot/index.d.ts.map +1 -0
  119. package/build/_modules/discord-bot/index.js +30 -0
  120. package/build/_modules/discord-bot/index.js.map +1 -0
  121. package/build/_modules/oauth2/index.d.ts.map +1 -1
  122. package/build/_modules/oauth2/index.js +7 -0
  123. package/build/_modules/oauth2/index.js.map +1 -1
  124. package/build/_modules/open-ai/_collections/oai-chunking.util.d.ts +74 -0
  125. package/build/_modules/open-ai/_collections/oai-chunking.util.d.ts.map +1 -0
  126. package/build/_modules/open-ai/_collections/oai-chunking.util.js +385 -0
  127. package/build/_modules/open-ai/_collections/oai-chunking.util.js.map +1 -0
  128. package/build/_modules/open-ai/_collections/oai-document.util.d.ts +4 -0
  129. package/build/_modules/open-ai/_collections/oai-document.util.d.ts.map +1 -0
  130. package/build/_modules/open-ai/_collections/oai-document.util.js +12 -0
  131. package/build/_modules/open-ai/_collections/oai-document.util.js.map +1 -0
  132. package/build/_modules/open-ai/_collections/oai-global-settings.const.d.ts +3 -0
  133. package/build/_modules/open-ai/_collections/oai-global-settings.const.d.ts.map +1 -0
  134. package/build/_modules/open-ai/_collections/oai-global-settings.const.js +9 -0
  135. package/build/_modules/open-ai/_collections/oai-global-settings.const.js.map +1 -0
  136. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.d.ts +3 -0
  137. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.d.ts.map +1 -0
  138. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.js +75 -0
  139. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.js.map +1 -0
  140. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.d.ts +3 -0
  141. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.d.ts.map +1 -0
  142. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.js +68 -0
  143. package/build/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.js.map +1 -0
  144. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.d.ts +6 -0
  145. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.d.ts.map +1 -0
  146. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.js +10 -0
  147. package/build/_modules/open-ai/_enums/oai-compare-result-type.enum.js.map +1 -0
  148. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts +18 -0
  149. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.d.ts.map +1 -0
  150. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.js +40 -0
  151. package/build/_modules/open-ai/_enums/oai-gpt-message-role.enum.js.map +1 -0
  152. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.d.ts +7 -0
  153. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.d.ts.map +1 -0
  154. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.js +3 -0
  155. package/build/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.js.map +1 -0
  156. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.d.ts +15 -0
  157. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.d.ts.map +1 -0
  158. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.js +3 -0
  159. package/build/_modules/open-ai/_models/interfaces/oai-document-page.interface.js.map +1 -0
  160. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.d.ts +6 -0
  161. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.d.ts.map +1 -0
  162. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.js +3 -0
  163. package/build/_modules/open-ai/_models/interfaces/oai-global-settings.interface.js.map +1 -0
  164. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts +6 -0
  165. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.d.ts.map +1 -0
  166. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js +3 -0
  167. package/build/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js.map +1 -0
  168. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.d.ts +52 -0
  169. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.d.ts.map +1 -0
  170. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.js +3 -0
  171. package/build/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.js.map +1 -0
  172. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.d.ts +13 -0
  173. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.d.ts.map +1 -0
  174. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.js +3 -0
  175. package/build/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.js.map +1 -0
  176. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.d.ts +18 -0
  177. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.d.ts.map +1 -0
  178. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.js +80 -0
  179. package/build/_modules/open-ai/_models/oai-doc-chunk.data-model.js.map +1 -0
  180. package/build/_modules/open-ai/_services/oai-chunk.service-base.d.ts +13 -0
  181. package/build/_modules/open-ai/_services/oai-chunk.service-base.d.ts.map +1 -0
  182. package/build/_modules/open-ai/_services/oai-chunk.service-base.js +170 -0
  183. package/build/_modules/open-ai/_services/oai-chunk.service-base.js.map +1 -0
  184. package/build/_modules/open-ai/_services/{embedding.control-service.d.ts → oai-embedding.control-service.d.ts} +3 -3
  185. package/build/_modules/open-ai/_services/oai-embedding.control-service.d.ts.map +1 -0
  186. package/build/_modules/open-ai/_services/{embedding.control-service.js → oai-embedding.control-service.js} +5 -5
  187. package/build/_modules/open-ai/_services/oai-embedding.control-service.js.map +1 -0
  188. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts +181 -0
  189. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts.map +1 -0
  190. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.js +344 -0
  191. package/build/_modules/open-ai/_services/oai-llm-chat.service-base.js.map +1 -0
  192. package/build/_modules/open-ai/_services/oai-llm.service-base.d.ts +234 -0
  193. package/build/_modules/open-ai/_services/oai-llm.service-base.d.ts.map +1 -0
  194. package/build/_modules/open-ai/_services/oai-llm.service-base.js +441 -0
  195. package/build/_modules/open-ai/_services/oai-llm.service-base.js.map +1 -0
  196. package/build/_modules/open-ai/_services/{vector-data.service.d.ts → oai-vector-data.service.d.ts} +4 -4
  197. package/build/_modules/open-ai/_services/oai-vector-data.service.d.ts.map +1 -0
  198. package/build/_modules/open-ai/_services/{vector-data.service.js → oai-vector-data.service.js} +27 -7
  199. package/build/_modules/open-ai/_services/oai-vector-data.service.js.map +1 -0
  200. package/build/_modules/open-ai/index.d.ts +19 -4
  201. package/build/_modules/open-ai/index.d.ts.map +1 -1
  202. package/build/_modules/open-ai/index.js +36 -4
  203. package/build/_modules/open-ai/index.js.map +1 -1
  204. package/build/_modules/server/index.d.ts +1 -1
  205. package/build/_modules/server/index.d.ts.map +1 -1
  206. package/build/_modules/server/index.js +16 -2
  207. package/build/_modules/server/index.js.map +1 -1
  208. package/build/_modules/server/server-status/server-status.controller.d.ts.map +1 -1
  209. package/build/_modules/server/server-status/server-status.controller.js +10 -0
  210. package/build/_modules/server/server-status/server-status.controller.js.map +1 -1
  211. package/build/_modules/socket/index.d.ts.map +1 -1
  212. package/build/_modules/socket/index.js +18 -0
  213. package/build/_modules/socket/index.js.map +1 -1
  214. package/build/_modules/test/index.d.ts.map +1 -1
  215. package/build/_modules/test/index.js +5 -0
  216. package/build/_modules/test/index.js.map +1 -1
  217. package/build/_modules/usage/index.d.ts.map +1 -1
  218. package/build/_modules/usage/index.js +5 -0
  219. package/build/_modules/usage/index.js.map +1 -1
  220. package/build/_services/base/data.service.d.ts +6 -0
  221. package/build/_services/base/data.service.d.ts.map +1 -1
  222. package/build/_services/base/data.service.js +6 -0
  223. package/build/_services/base/data.service.js.map +1 -1
  224. package/build/_services/base/db.service.d.ts +10 -0
  225. package/build/_services/base/db.service.d.ts.map +1 -1
  226. package/build/_services/base/db.service.js +10 -0
  227. package/build/_services/base/db.service.js.map +1 -1
  228. package/build/_services/server/app.server.js +1 -2
  229. package/build/_services/server/app.server.js.map +1 -1
  230. package/build/index.d.ts +3 -1
  231. package/build/index.d.ts.map +1 -1
  232. package/build/index.js +26 -1
  233. package/build/index.js.map +1 -1
  234. package/package.json +40 -10
  235. package/src/_collections/atlas-default-db-options.const.ts +10 -0
  236. package/src/_collections/get-environment-settings.util.ts +49 -0
  237. package/src/_collections/global-settings.const.ts +15 -4
  238. package/src/_collections/sample.env +21 -0
  239. package/src/_models/control-models/app-params.control-model.spec.ts +5 -4
  240. package/src/_models/control-models/app-params.control-model.ts +31 -2
  241. package/src/_models/control-models/endpoint-params.control-model.ts +1 -1
  242. package/src/_models/interfaces/environment-settings.interface.ts +59 -0
  243. package/src/_models/interfaces/global-settings.interface.ts +41 -1
  244. package/src/_modules/custom-data/index.ts +3 -0
  245. package/src/_modules/discord-assistant/_collections/dias-global-settings.const.ts +19 -0
  246. package/src/_modules/discord-assistant/_collections/dias.util.ts +43 -0
  247. package/src/_modules/discord-assistant/_models/dias-global-settings.interface.ts +20 -0
  248. package/src/_modules/discord-assistant/_models/dias-knowledge.data-model.ts +46 -0
  249. package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +152 -0
  250. package/src/_modules/discord-assistant/_services/dias-io.control-service.ts +64 -0
  251. package/src/_modules/discord-assistant/_services/dias-main.control-service.ts +28 -0
  252. package/src/_modules/discord-assistant/_services/dias.service-base.ts +49 -0
  253. package/src/_modules/discord-assistant/index.ts +36 -0
  254. package/src/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.ts +11 -0
  255. package/src/_modules/discord-assistant-voiced/index.ts +36 -0
  256. package/src/_modules/discord-bot/_collections/dibo-default-commands.const.ts +17 -0
  257. package/src/_modules/discord-bot/_collections/dibo-global-settings.conts.ts +56 -0
  258. package/src/_modules/discord-bot/_collections/dibo-operations.util.ts +372 -0
  259. package/src/_modules/discord-bot/_models/dibo-command.interface.ts +12 -0
  260. package/src/_modules/discord-bot/_models/dibo-last-mention-date.inteface.ts +8 -0
  261. package/src/_modules/discord-bot/_models/dibo-last-message-date.interface.ts +6 -0
  262. package/src/_modules/discord-bot/_models/global-bot-log-settings.interface.ts +98 -0
  263. package/src/_modules/discord-bot/_services/dibo-commands.control-service.ts +120 -0
  264. package/src/_modules/discord-bot/_services/dibo-io.control-service.ts +245 -0
  265. package/src/_modules/discord-bot/_services/dibo-main.control-service.ts +304 -0
  266. package/src/_modules/discord-bot/_services/dibo-routines.control-service.ts +60 -0
  267. package/src/_modules/discord-bot/index.ts +36 -0
  268. package/src/_modules/oauth2/index.ts +8 -0
  269. package/src/_modules/open-ai/_collections/oai-chunking.util.ts +496 -0
  270. package/src/_modules/open-ai/_collections/oai-document.util.ts +10 -0
  271. package/src/_modules/open-ai/_collections/oai-global-settings.const.ts +9 -0
  272. package/src/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.ts +83 -0
  273. package/src/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.ts +76 -0
  274. package/src/_modules/open-ai/_enums/oai-compare-result-type.enum.ts +7 -0
  275. package/src/_modules/open-ai/_enums/oai-gpt-message-role.enum.ts +45 -0
  276. package/src/_modules/open-ai/_models/interfaces/oai-chunk-compare-result.interface.ts +10 -0
  277. package/src/_modules/open-ai/_models/interfaces/oai-document-page.interface.ts +21 -0
  278. package/src/_modules/open-ai/_models/interfaces/oai-global-settings.interface.ts +8 -0
  279. package/src/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.ts +7 -0
  280. package/src/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.ts +57 -0
  281. package/src/_modules/open-ai/_models/interfaces/oai-page-compare-result.interface.ts +18 -0
  282. package/src/_modules/open-ai/_models/oai-doc-chunk.data-model.ts +92 -0
  283. package/src/_modules/open-ai/_services/oai-chunk.service-base.ts +214 -0
  284. package/src/_modules/open-ai/_services/{embedding.control-service.ts → oai-embedding.control-service.ts} +2 -2
  285. package/src/_modules/open-ai/_services/oai-llm-chat.service-base.ts +621 -0
  286. package/src/_modules/open-ai/_services/oai-llm.service-base.ts +651 -0
  287. package/src/_modules/open-ai/_services/{vector-data.service.ts → oai-vector-data.service.ts} +32 -5
  288. package/src/_modules/open-ai/index.ts +43 -4
  289. package/src/_modules/server/index.ts +18 -2
  290. package/src/_modules/server/server-status/server-status.controller.ts +13 -0
  291. package/src/_modules/socket/index.ts +23 -0
  292. package/src/_modules/test/index.ts +8 -0
  293. package/src/_modules/usage/index.ts +8 -0
  294. package/src/_services/base/data.service.ts +6 -0
  295. package/src/_services/base/db.service.ts +10 -0
  296. package/src/_services/server/app.server.ts +1 -1
  297. package/src/index.ts +28 -1
  298. package/build/_modules/open-ai/_services/embedding.control-service.d.ts.map +0 -1
  299. package/build/_modules/open-ai/_services/embedding.control-service.js.map +0 -1
  300. package/build/_modules/open-ai/_services/gpt.service-base.d.ts +0 -98
  301. package/build/_modules/open-ai/_services/gpt.service-base.d.ts.map +0 -1
  302. package/build/_modules/open-ai/_services/gpt.service-base.js +0 -284
  303. package/build/_modules/open-ai/_services/gpt.service-base.js.map +0 -1
  304. package/build/_modules/open-ai/_services/open-ai.service-base.d.ts +0 -21
  305. package/build/_modules/open-ai/_services/open-ai.service-base.d.ts.map +0 -1
  306. package/build/_modules/open-ai/_services/open-ai.service-base.js +0 -50
  307. package/build/_modules/open-ai/_services/open-ai.service-base.js.map +0 -1
  308. package/build/_modules/open-ai/_services/vector-data.service.d.ts.map +0 -1
  309. package/build/_modules/open-ai/_services/vector-data.service.js.map +0 -1
  310. package/build/_services/server/env-set.d.ts +0 -2
  311. package/build/_services/server/env-set.d.ts.map +0 -1
  312. package/build/_services/server/env-set.js +0 -20
  313. package/build/_services/server/env-set.js.map +0 -1
  314. package/src/_modules/open-ai/_services/gpt.service-base.ts +0 -438
  315. package/src/_modules/open-ai/_services/open-ai.service-base.ts +0 -69
  316. package/src/_services/server/env-set.ts +0 -21
@@ -0,0 +1,304 @@
1
+ import { Client, GatewayIntentBits, Guild, Collection, GuildMember, Message, Partials, Role, TextChannel } from 'discord.js'
2
+ import * as dotenv from 'dotenv'
3
+ import { DyNTS_SingletonService } from '../../../_services/base/singleton.service';
4
+ import { DyFM_delay, DyFM_Error, DyFM_Log } from '@futdevpro/fsm-dynamo';
5
+ import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
6
+ import { DyNTS_DiBo_Routines_ControlService } from './dibo-routines.control-service';
7
+ import { DyNTS_DiBo_IO_ControlService } from './dibo-io.control-service';
8
+ import { DyNTS_DiBo_global_settings } from '../_collections/dibo-global-settings.conts';
9
+ import { DyNTS_GlobalService } from '../../../_services/core/global.service';
10
+ import { DyNTS_DiBo_Operations_Util } from '../_collections/dibo-operations.util';
11
+
12
+
13
+ /**
14
+ * This is the main control service for the Discord Bot.
15
+ *
16
+ *
17
+ * Setup:
18
+ * 1. creating the Bot
19
+ * - go to: https://discord.com/developers/applications
20
+ * - click: "New Application"
21
+ * - give a name → Create
22
+ *
23
+ * 2. adding the Bot to the app
24
+ * - on the left: "Bot" → "Add Bot" → Yes, do it
25
+ *
26
+ * 3. getting the token
27
+ * - on the same page: "Reset Token" → Copy
28
+ * - put the token in the .env file: DISCORD_TOKEN=...
29
+ *
30
+ * 4. Bot ID (Client ID) and Invite link
31
+ * - on the left: "OAuth2" > "URL Generator"
32
+ * - Scopes: tick the bot
33
+ * - Bot Permissions: pl. Send Messages, Read Message History
34
+ * - at the bottom: generate Invite URL → open it → add it to a server
35
+ * - the Client ID is on the same page, the "Application ID" on the "OAuth2 > General" or "Application" tab.
36
+ * - it only works if you are admin on that server or have "Manage Server" permissions.
37
+ *
38
+ * 5. Permissions
39
+ * - on the left: "Bot" tab
40
+ * - enable these:
41
+ * - MESSAGE CONTENT INTENT
42
+ * - PRESENCE INTENT (if you use it)
43
+ * - SERVER MEMBERS INTENT (if you need guild user info)
44
+ * - Save
45
+ *
46
+ */
47
+ export abstract class DyNTS_DiBo_Main_ControlService extends DyNTS_SingletonService {
48
+
49
+ /* static getInstance(): DyNTS_DiBo_Main_ControlService {
50
+ return DyNTS_DiBo_Main_ControlService.getSingletonInstance();
51
+ } */
52
+
53
+ readonly client: Client;
54
+
55
+ private _discordServer: Guild;
56
+ get discordServer(): Guild {
57
+ return this._discordServer;
58
+ }
59
+
60
+ get botClientId(): string {
61
+ return this.client.user?.id ?? DyNTS_global_settings.env_settings.discord.clientId;
62
+ }
63
+ get botDisplayName(): string {
64
+ return this.client.user?.displayName;
65
+ }
66
+
67
+ protected botIO_CS: DyNTS_DiBo_IO_ControlService;
68
+ protected abstract getBotIOControlService(): DyNTS_DiBo_IO_ControlService;
69
+
70
+ protected routines_CS: DyNTS_DiBo_Routines_ControlService;
71
+ protected abstract getRoutinesControlService(): DyNTS_DiBo_Routines_ControlService;
72
+
73
+ private _channelsByNames: {
74
+ [key: string]: TextChannel;
75
+ } = {};
76
+
77
+ private _rolesByNames: {
78
+ [key: string]: Role;
79
+ } = {};
80
+
81
+ protected debugLog = false;
82
+
83
+ protected constructor() {
84
+ super();
85
+
86
+ DyNTS_global_settings.bot_settings = DyNTS_DiBo_global_settings;
87
+
88
+ if (this.client) {
89
+ throw new DyFM_Error({
90
+ ...this.getDefaultErrorSettings(
91
+ 'start',
92
+ new Error('Discord client already initialized'),
93
+ 'system-init'
94
+ ),
95
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-MCS-C000`,
96
+ })
97
+ }
98
+
99
+ this.client = new Client({
100
+ intents: DyNTS_global_settings.bot_settings.intents,
101
+ partials: DyNTS_global_settings.bot_settings.partials,
102
+ })
103
+
104
+ this.setup('system-init');
105
+ }
106
+
107
+ async setup(issuer: string): Promise<void> {
108
+ try {
109
+ await DyFM_delay(100);
110
+
111
+ if (!DyNTS_global_settings.env_settings.discord.guildId) {
112
+ throw new Error(
113
+ `No discord server id found!` +
114
+ `\nPlease set the DISCORD_GUILD_ID in the .env file, ` +
115
+ `or directly in the DyNTS_global_settings.env_settings.discord.guildId` +
116
+ `\nYou also will need to set the DISCORD_TOKEN, DISCORD_CLIENT_ID and DISCORD_OAUTH2_URL.`
117
+ );
118
+ }
119
+
120
+ if (!DyNTS_global_settings.env_settings.discord.token) {
121
+ throw new Error(
122
+ `No discord token found!` +
123
+ `\nPlease set the DISCORD_TOKEN in the .env file, ` +
124
+ `or directly in the DyNTS_global_settings.env_settings.discord.token` +
125
+ `\nYou also will need to set the DISCORD_GUILD_ID, DISCORD_CLIENT_ID and DISCORD_OAUTH2_URL.`
126
+ );
127
+ }
128
+
129
+ if (!DyNTS_global_settings.env_settings.discord.clientId) {
130
+ throw new Error(
131
+ `No discord client id found!` +
132
+ `\nPlease set the DISCORD_CLIENT_ID in the .env file, ` +
133
+ `or directly in the DyNTS_global_settings.env_settings.discord.clientId` +
134
+ `\nYou also will need to set the DISCORD_GUILD_ID, DISCORD_TOKEN and DISCORD_OAUTH2_URL.`
135
+ );
136
+ }
137
+
138
+ if (!DyNTS_global_settings.env_settings.discord.oauth2Url) {
139
+ throw new Error(
140
+ `No discord oauth2 url found!` +
141
+ `\nPlease set the DISCORD_OAUTH2_URL in the .env file, ` +
142
+ `or directly in the DyNTS_global_settings.env_settings.discord.oauth2Url` +
143
+ `\nYou also will need to set the DISCORD_GUILD_ID, DISCORD_TOKEN and DISCORD_CLIENT_ID.`
144
+ );
145
+ }
146
+
147
+ DyNTS_DiBo_global_settings.channelSettings.defaultChannels.forEach(
148
+ channelName => {
149
+ if (!DyNTS_DiBo_global_settings.channelSettings.allowedChannels.includes(channelName)) {
150
+ DyNTS_DiBo_global_settings.channelSettings.allowedChannels.push(channelName);
151
+ }
152
+ }
153
+ );
154
+ if (!DyNTS_DiBo_global_settings.channelSettings.allowedChannels.includes(
155
+ DyNTS_DiBo_global_settings.channelSettings.reportChannelName
156
+ )) {
157
+ DyNTS_DiBo_global_settings.channelSettings.allowedChannels.push(
158
+ DyNTS_DiBo_global_settings.channelSettings.reportChannelName
159
+ );
160
+ }
161
+
162
+ return new Promise((resolve, reject) => {
163
+ this.client.on('error', (error) => {
164
+ if (DyNTS_DiBo_global_settings.debugLevel >= 1) {
165
+ DyFM_Log.error('Discord client error:', error);
166
+ }
167
+ DyNTS_GlobalService.globalErrorHandler(error);
168
+ reject(error);
169
+ });
170
+
171
+ this.client.on('ready', async () => {
172
+ if (DyNTS_DiBo_global_settings.debugLevel >= 1) {
173
+ DyFM_Log.success(`Logged in as ${this.client.user?.tag}`)
174
+ }
175
+ // szerver azonosító
176
+ this._discordServer = this.client.guilds.cache.get(
177
+ DyNTS_global_settings.env_settings.discord.guildId
178
+ )
179
+
180
+ if (!this._discordServer) {
181
+ throw new Error(`No discord server found`);
182
+ }
183
+
184
+ await this.start(issuer);
185
+
186
+ //await Operations.reportIn(this._discordServer, this.client)
187
+
188
+ resolve();
189
+ });
190
+
191
+ this.client.on('messageCreate', (message: Message) => {
192
+ try {
193
+ this.botIO_CS.handleNewMessage(message, message?.author?.id ?? 'unknown')
194
+ } catch (error) {
195
+ DyFM_Log.error('Error handling new message:', error);
196
+ }
197
+ });
198
+
199
+ process.on('exit', () => {
200
+ try {
201
+ DyFM_Log.warn('Bot is shutting down...')
202
+ DyNTS_DiBo_Operations_Util.sendMessageToChannelByName(
203
+ this._discordServer,
204
+ DyNTS_DiBo_global_settings.channelSettings.reportChannelName,
205
+ `Bot is shutting down...`
206
+ )
207
+ } catch (error) {
208
+ DyFM_Log.error('Error sending message to report channel:', error);
209
+ }
210
+ });
211
+
212
+ this.client.login(DyNTS_global_settings.env_settings.discord.token).catch((error) => {
213
+ reject(error);
214
+ });
215
+ });
216
+ } catch (error) {
217
+ if (this.discordServer) {
218
+ try {
219
+ DyNTS_DiBo_Operations_Util.sendMessageToChannelByName(
220
+ this.discordServer,
221
+ DyNTS_DiBo_global_settings.channelSettings.reportChannelName,
222
+ `#Error during bot startup:\n` +
223
+ ((error as DyFM_Error)._message ?? error.message ?? error)
224
+ )
225
+ } catch {}
226
+ }
227
+
228
+ throw new DyFM_Error({
229
+ ...this.getDefaultErrorSettings('start', error, issuer),
230
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-MCS-SE0`,
231
+ })
232
+ }
233
+ }
234
+
235
+ async start(issuer: string): Promise<void> {
236
+ try {
237
+ this.botIO_CS = this.getBotIOControlService();
238
+ this.routines_CS = this.getRoutinesControlService();
239
+
240
+ await this.routines_CS.start(issuer);
241
+
242
+ } catch (error) {
243
+ throw new DyFM_Error({
244
+ ...this.getDefaultErrorSettings('start', error, issuer),
245
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-MCS-ST0`,
246
+ })
247
+ }
248
+ }
249
+
250
+ async getRolePingByName(roleName: string): Promise<string> {
251
+ const role: Role = this.getRoleByName(roleName);
252
+
253
+ return role ? `<@&${role.id}>` : '';
254
+ }
255
+
256
+ async getRolePingsByName(roleNames: string[]): Promise<string> {
257
+ const pings: string[] = await Promise.all(
258
+ roleNames.map(roleName => this.getRolePingByName(roleName))
259
+ );
260
+
261
+ return pings.join(' ');
262
+ }
263
+
264
+ getRoleByName(roleName: string): Role {
265
+ this._rolesByNames[roleName] ??= this.discordServer.roles.cache.find(r => r.name === roleName);
266
+
267
+ return this._rolesByNames[roleName];
268
+ }
269
+
270
+ getChannelByName(channelName: string): TextChannel {
271
+ this._channelsByNames[channelName] ??= DyNTS_DiBo_Operations_Util.findTextChannelByName(
272
+ this.discordServer.channels,
273
+ channelName
274
+ );
275
+
276
+ return this._channelsByNames[channelName];
277
+ }
278
+ }
279
+
280
+ /**
281
+ * A leggyakoribb client.on(...) események a következők (TypeScript + discord.js 14+):
282
+ *
283
+ * 🔁 Alap események
284
+ * client.on('ready', () => {}) // Bot elindult
285
+ * client.on('messageCreate', (msg) => {}) // Üzenet érkezett
286
+ * client.on('interactionCreate', (i) => {}) // Slash command vagy gomb stb.
287
+ * client.on('guildCreate', (guild) => {}) // Új szerverre került
288
+ * client.on('guildDelete', (guild) => {}) // Szerverről eltávolították
289
+ * client.on('error', (err) => {}) // Hiba történt
290
+ *
291
+ * 👥 Felhasználókkal kapcsolatos események
292
+ * client.on('guildMemberAdd', (member) => {}) // Új user csatlakozott
293
+ * client.on('guildMemberRemove', (member) => {}) // User kilépett
294
+ * client.on('presenceUpdate', (oldP, newP) => {})// Status változott (pl. online → idle)
295
+ * ✏️ Üzenet események
296
+ * client.on('messageUpdate', (oldMsg, newMsg) => {}) // Üzenet módosult
297
+ * client.on('messageDelete', (msg) => {}) // Üzenetet töröltek
298
+ *
299
+ * 🔧 Moderáció/jogosultság/stb.
300
+ * client.on('roleCreate', (role) => {})
301
+ * client.on('roleDelete', (role) => {})
302
+ * client.on('channelCreate', (ch) => {})
303
+ * client.on('channelDelete', (ch) => {})
304
+ */
@@ -0,0 +1,60 @@
1
+ import { timer, of, Subscription } from 'rxjs';
2
+ import { switchMap, filter, tap } from 'rxjs/operators';
3
+ import { Guild } from 'discord.js';
4
+
5
+ import { day, DyFM_delay, DyFM_Error, hour, minute } from '@futdevpro/fsm-dynamo';
6
+ import { DyNTS_SingletonService } from '../../../_services/base/singleton.service';
7
+ import { DyNTS_DiBo_Main_ControlService } from './dibo-main.control-service';
8
+ import { DyNTS_global_settings } from '../../../_collections/global-settings.const';
9
+
10
+ export abstract class DyNTS_DiBo_Routines_ControlService extends DyNTS_SingletonService {
11
+
12
+ static getInstance(): DyNTS_DiBo_Routines_ControlService {
13
+ return DyNTS_DiBo_Routines_ControlService.getSingletonInstance();
14
+ }
15
+
16
+ protected abstract getMainDiscordBotControlService(): DyNTS_DiBo_Main_ControlService;
17
+
18
+ protected readonly mainDiscordBot_CS: DyNTS_DiBo_Main_ControlService =
19
+ this.getMainDiscordBotControlService();
20
+
21
+ get discordServer(): Guild {
22
+ return this.mainDiscordBot_CS.discordServer;
23
+ }
24
+
25
+ protected constructor() {
26
+ super();
27
+
28
+ if (!this.discordServer) {
29
+ throw new DyFM_Error({
30
+ ...this.getDefaultErrorSettings(
31
+ 'constructor',
32
+ new Error(
33
+ 'Discord server not yet initialized, ' +
34
+ 'should only be called after DiscordBot_ControlService.start'
35
+ ),
36
+ 'system-init'
37
+ ),
38
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-RCS-C000`,
39
+ })
40
+ }
41
+ }
42
+
43
+ async start(issuer: string): Promise<void> {
44
+ try {
45
+ await this.startRoutines(issuer);
46
+ } catch (error) {
47
+ throw new DyFM_Error({
48
+ ...this.getDefaultErrorSettings('start', error, issuer),
49
+ errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-DiBo-RCS-ST0`,
50
+ })
51
+ }
52
+ }
53
+
54
+ abstract startRoutines(issuer: string): Promise<void>;
55
+ }
56
+
57
+
58
+
59
+
60
+
@@ -0,0 +1,36 @@
1
+
2
+
3
+
4
+
5
+ try {
6
+ require('discord.js');
7
+ } catch (error) {
8
+ console.log(
9
+ '❌ Discord.js package not found, please install it with: pnpm add discord.js'
10
+ );
11
+ }
12
+
13
+ //
14
+ // Discord Bot module
15
+ //
16
+ // This module is created to simplify the usage of Discord Bot
17
+ // It creates universal solutions for the most common use cases
18
+ //
19
+
20
+
21
+ // COLLECTIONS
22
+ export * from './_collections/dibo-default-commands.const';
23
+ export * from './_collections/dibo-global-settings.conts';
24
+ export * from './_collections/dibo-operations.util';
25
+
26
+ // MODELS
27
+ export * from './_models/dibo-command.interface';
28
+ export * from './_models/dibo-last-mention-date.inteface';
29
+ export * from './_models/dibo-last-message-date.interface';
30
+ export * from './_models/global-bot-log-settings.interface';
31
+
32
+ // SERVICES
33
+ export * from './_services/dibo-commands.control-service';
34
+ export * from './_services/dibo-io.control-service';
35
+ export * from './_services/dibo-main.control-service';
36
+ export * from './_services/dibo-routines.control-service';
@@ -1,4 +1,12 @@
1
+ try {
2
+ require('crypto');
3
+ } catch (error) {
4
+ console.log(
5
+ '❌ CryptoJS package not found, please install it with: pnpm add crypto-js'
6
+ );
7
+ }
1
8
 
9
+ // This module is implementing solutions for OAuth2.0 protocol for the server.
2
10
 
3
11
 
4
12
  export * from './_routes/oauth2.controller';