openloops 0.6.0 → 0.7.0

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 (505) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/dist/clients/llm/llm-client.mjs +0 -1
  4. package/dist/clients/llm/llm-error.mjs +0 -1
  5. package/dist/clients/llm/llm-types.mjs +0 -1
  6. package/dist/clients/llm/model-resolution.mjs +0 -1
  7. package/dist/clients/llm/pi-ai-adapter.mjs +0 -1
  8. package/dist/clients/llm/sampling-rules.mjs +0 -1
  9. package/dist/clients/serper/serper-client.mjs +0 -1
  10. package/dist/clients/slack/slack-client.mjs +0 -1
  11. package/dist/common/base/base.app.d.ts +3 -3
  12. package/dist/common/base/base.app.mjs +0 -1
  13. package/dist/common/base/base.entity.d.ts +4 -16
  14. package/dist/common/base/base.entity.js +11 -39
  15. package/dist/common/base/base.entity.mjs +11 -40
  16. package/dist/common/base/base.use-case.d.ts +1 -7
  17. package/dist/common/base/base.use-case.mjs +0 -1
  18. package/dist/common/base/current-session.mjs +0 -1
  19. package/dist/common/base/current-user.mjs +0 -1
  20. package/dist/common/base/share.mjs +0 -1
  21. package/dist/common/base/utils/index.d.ts +1 -2
  22. package/dist/common/base/utils/index.js +2 -4
  23. package/dist/common/base/utils/index.mjs +1 -2
  24. package/dist/common/base/utils/is-plain-object.mjs +0 -1
  25. package/dist/common/base/utils/to-patch.d.ts +9 -0
  26. package/dist/common/base/utils/to-patch.js +46 -0
  27. package/dist/common/base/utils/to-patch.mjs +21 -0
  28. package/dist/common/constants/harness.mjs +0 -1
  29. package/dist/common/error/http-error.mjs +0 -1
  30. package/dist/common/error/reportError.mjs +0 -1
  31. package/dist/common/error/sentry-client.mjs +0 -1
  32. package/dist/common/helpers/escape-regex.mjs +0 -1
  33. package/dist/common/helpers/extract-json-from-text.mjs +0 -1
  34. package/dist/common/helpers/sanitize-string.mjs +0 -1
  35. package/dist/common/logger/pino.mjs +0 -1
  36. package/dist/common/repositories/mongo-db.client.mjs +0 -1
  37. package/dist/common/repositories/mongo-db.repository.d.ts +15 -4
  38. package/dist/common/repositories/mongo-db.repository.js +44 -15
  39. package/dist/common/repositories/mongo-db.repository.mjs +44 -16
  40. package/dist/common/repositories/scope.mjs +0 -1
  41. package/dist/common/utils/database-name.mjs +0 -1
  42. package/dist/common/utils/number-setting.mjs +0 -1
  43. package/dist/common/utils/secret-manager.mjs +0 -1
  44. package/dist/db/indexes/agent-actions.mjs +0 -1
  45. package/dist/db/indexes/agent-tasks.mjs +0 -1
  46. package/dist/db/indexes/agent-traces.mjs +0 -1
  47. package/dist/db/indexes/automation-runs.mjs +0 -1
  48. package/dist/db/indexes/automations.mjs +0 -1
  49. package/dist/db/indexes/chats.mjs +0 -1
  50. package/dist/db/indexes/index.js +3 -1
  51. package/dist/db/indexes/index.mjs +3 -2
  52. package/dist/db/indexes/llm-calls.mjs +0 -1
  53. package/dist/db/indexes/mcp-servers.mjs +0 -1
  54. package/dist/db/indexes/refresh-tokens.d.ts +2 -0
  55. package/dist/{common/decorators/mask-in-logs/index.js → db/indexes/refresh-tokens.js} +16 -5
  56. package/dist/db/indexes/refresh-tokens.mjs +9 -0
  57. package/dist/db/indexes/revoked-tokens.mjs +0 -1
  58. package/dist/db/indexes/workspace-items.mjs +0 -1
  59. package/dist/db/migrations/automations.mjs +0 -1
  60. package/dist/guardrails/guard.mjs +0 -1
  61. package/dist/guardrails/index.mjs +0 -1
  62. package/dist/guardrails/input/block-card.mjs +0 -1
  63. package/dist/guardrails/input/block-code.mjs +0 -1
  64. package/dist/guardrails/input/block-email.mjs +0 -1
  65. package/dist/guardrails/input/create-block-input-oversize.mjs +0 -1
  66. package/dist/guardrails/input/diagnostic-sanity.mjs +0 -1
  67. package/dist/guardrails/input/input-check.mjs +0 -1
  68. package/dist/harness/agent-loop.mjs +0 -1
  69. package/dist/harness/agent-state.mjs +0 -1
  70. package/dist/harness/agent.d.ts +0 -1
  71. package/dist/harness/agent.js +14 -14
  72. package/dist/harness/agent.mjs +14 -15
  73. package/dist/harness/native-tools.mjs +0 -1
  74. package/dist/harness/skills/approval-request.mjs +0 -1
  75. package/dist/harness/skills/autonomous-answer.mjs +0 -1
  76. package/dist/harness/skills/confirmation-gate.mjs +0 -1
  77. package/dist/harness/skills/mcp-change-review.mjs +0 -1
  78. package/dist/harness/tool-catalog.mjs +0 -1
  79. package/dist/harness/tool-pipeline.mjs +0 -1
  80. package/dist/harness/utils/activity.mjs +0 -1
  81. package/dist/harness/utils/describe-shape.mjs +0 -1
  82. package/dist/harness/utils/grounding.mjs +0 -1
  83. package/dist/harness/utils/rank-tools-by-keywords.mjs +0 -1
  84. package/dist/harness/workspace.js +7 -7
  85. package/dist/harness/workspace.mjs +7 -8
  86. package/dist/loops/agi/loop.mjs +0 -1
  87. package/dist/loops/agi/skills/reasoning-engine.mjs +0 -1
  88. package/dist/loops/shared/skills/fast-responder.mjs +0 -1
  89. package/dist/services/authentication/entities/index.d.ts +1 -0
  90. package/dist/services/authentication/entities/index.js +3 -1
  91. package/dist/services/authentication/entities/index.mjs +1 -0
  92. package/dist/services/authentication/entities/refresh-token.entity.d.ts +25 -0
  93. package/dist/services/authentication/entities/refresh-token.entity.js +75 -0
  94. package/dist/services/authentication/entities/refresh-token.entity.mjs +51 -0
  95. package/dist/services/authentication/entities/revoked-token.entity.mjs +0 -1
  96. package/dist/services/authentication/helpers/auth-config.d.ts +9 -0
  97. package/dist/{common/decorators/index.js → services/authentication/helpers/auth-config.js} +19 -5
  98. package/dist/services/authentication/helpers/auth-config.mjs +12 -0
  99. package/dist/services/authentication/helpers/session-tokens.d.ts +16 -0
  100. package/dist/services/authentication/helpers/session-tokens.js +60 -0
  101. package/dist/services/authentication/helpers/session-tokens.mjs +35 -0
  102. package/dist/services/authentication/helpers/tokens.d.ts +43 -0
  103. package/dist/services/authentication/helpers/tokens.js +113 -0
  104. package/dist/services/authentication/helpers/tokens.mjs +71 -0
  105. package/dist/services/authentication/index.d.ts +3 -0
  106. package/dist/services/authentication/index.js +23 -0
  107. package/dist/services/authentication/index.mjs +11 -0
  108. package/dist/services/authentication/module.d.ts +12 -3
  109. package/dist/services/authentication/module.js +40 -7
  110. package/dist/services/authentication/module.mjs +34 -7
  111. package/dist/services/authentication/repositories/index.d.ts +1 -0
  112. package/dist/services/authentication/repositories/index.js +3 -1
  113. package/dist/services/authentication/repositories/index.mjs +1 -0
  114. package/dist/services/authentication/repositories/refresh-token.repository.d.ts +10 -0
  115. package/dist/services/authentication/repositories/refresh-token.repository.js +60 -0
  116. package/dist/services/authentication/repositories/refresh-token.repository.mjs +36 -0
  117. package/dist/services/authentication/repositories/revoked-token.repository.js +3 -15
  118. package/dist/services/authentication/repositories/revoked-token.repository.mjs +3 -10
  119. package/dist/services/authentication/use-cases/claim-refresh-token.use-case.d.ts +12 -0
  120. package/dist/services/authentication/use-cases/claim-refresh-token.use-case.js +40 -0
  121. package/dist/services/authentication/use-cases/claim-refresh-token.use-case.mjs +16 -0
  122. package/dist/services/authentication/use-cases/create-refresh-token.use-case.d.ts +11 -0
  123. package/dist/services/authentication/use-cases/create-refresh-token.use-case.js +43 -0
  124. package/dist/services/authentication/use-cases/create-refresh-token.use-case.mjs +19 -0
  125. package/dist/services/authentication/use-cases/find-refresh-token-by-hash.use-case.d.ts +11 -0
  126. package/dist/services/authentication/use-cases/find-refresh-token-by-hash.use-case.js +40 -0
  127. package/dist/services/authentication/use-cases/find-refresh-token-by-hash.use-case.mjs +16 -0
  128. package/dist/services/authentication/use-cases/is-token-revoked.use-case.d.ts +6 -8
  129. package/dist/services/authentication/use-cases/is-token-revoked.use-case.js +4 -18
  130. package/dist/services/authentication/use-cases/is-token-revoked.use-case.mjs +4 -13
  131. package/dist/services/authentication/use-cases/issue-password-reset-token.use-case.d.ts +18 -0
  132. package/dist/services/authentication/use-cases/issue-password-reset-token.use-case.js +49 -0
  133. package/dist/services/authentication/use-cases/issue-password-reset-token.use-case.mjs +25 -0
  134. package/dist/services/authentication/use-cases/issue-session.use-case.d.ts +13 -0
  135. package/dist/services/authentication/use-cases/issue-session.use-case.js +48 -0
  136. package/dist/services/authentication/use-cases/issue-session.use-case.mjs +24 -0
  137. package/dist/services/authentication/use-cases/login.use-case.d.ts +11 -11
  138. package/dist/services/authentication/use-cases/login.use-case.js +18 -54
  139. package/dist/services/authentication/use-cases/login.use-case.mjs +17 -38
  140. package/dist/services/authentication/use-cases/logout.use-case.d.ts +14 -0
  141. package/dist/services/authentication/use-cases/logout.use-case.js +48 -0
  142. package/dist/services/authentication/use-cases/logout.use-case.mjs +24 -0
  143. package/dist/services/authentication/use-cases/refresh.use-case.d.ts +23 -0
  144. package/dist/services/authentication/use-cases/refresh.use-case.js +84 -0
  145. package/dist/services/authentication/use-cases/refresh.use-case.mjs +60 -0
  146. package/dist/services/authentication/use-cases/reset-password.use-case.d.ts +15 -0
  147. package/dist/services/authentication/use-cases/reset-password.use-case.js +61 -0
  148. package/dist/services/authentication/use-cases/reset-password.use-case.mjs +37 -0
  149. package/dist/services/authentication/use-cases/revoke-refresh-token-family.use-case.d.ts +11 -0
  150. package/dist/services/authentication/use-cases/revoke-refresh-token-family.use-case.js +40 -0
  151. package/dist/services/authentication/use-cases/revoke-refresh-token-family.use-case.mjs +16 -0
  152. package/dist/services/authentication/use-cases/revoke-token.use-case.d.ts +4 -6
  153. package/dist/services/authentication/use-cases/revoke-token.use-case.js +12 -26
  154. package/dist/services/authentication/use-cases/revoke-token.use-case.mjs +10 -19
  155. package/dist/services/authentication/use-cases/revoke-user-refresh-tokens.use-case.d.ts +13 -0
  156. package/dist/services/authentication/use-cases/revoke-user-refresh-tokens.use-case.js +40 -0
  157. package/dist/services/authentication/use-cases/revoke-user-refresh-tokens.use-case.mjs +16 -0
  158. package/dist/services/automations/entities/automation-run.entity.mjs +0 -1
  159. package/dist/services/automations/entities/automation.entity.d.ts +1 -0
  160. package/dist/services/automations/entities/automation.entity.js +2 -1
  161. package/dist/services/automations/entities/automation.entity.mjs +2 -2
  162. package/dist/services/automations/entities/recurrence.mjs +0 -1
  163. package/dist/services/automations/entities/trigger.mjs +0 -1
  164. package/dist/services/automations/module.d.ts +0 -1
  165. package/dist/services/automations/module.js +20 -22
  166. package/dist/services/automations/module.mjs +20 -23
  167. package/dist/services/automations/repositories/automation-run.repository.js +7 -22
  168. package/dist/services/automations/repositories/automation-run.repository.mjs +7 -17
  169. package/dist/services/automations/repositories/automation.repository.js +25 -39
  170. package/dist/services/automations/repositories/automation.repository.mjs +25 -34
  171. package/dist/services/automations/runner/automation-runner.js +8 -9
  172. package/dist/services/automations/runner/automation-runner.mjs +8 -10
  173. package/dist/services/automations/use-cases/attach-automation-run-chat.use-case.d.ts +4 -6
  174. package/dist/services/automations/use-cases/attach-automation-run-chat.use-case.js +5 -19
  175. package/dist/services/automations/use-cases/attach-automation-run-chat.use-case.mjs +5 -14
  176. package/dist/services/automations/use-cases/claim-due-automations.use-case.d.ts +9 -11
  177. package/dist/services/automations/use-cases/claim-due-automations.use-case.js +4 -20
  178. package/dist/services/automations/use-cases/claim-due-automations.use-case.mjs +4 -15
  179. package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.d.ts +9 -11
  180. package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.js +4 -20
  181. package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.mjs +4 -15
  182. package/dist/services/automations/use-cases/create-automation.use-case.d.ts +4 -6
  183. package/dist/services/automations/use-cases/create-automation.use-case.js +5 -19
  184. package/dist/services/automations/use-cases/create-automation.use-case.mjs +5 -14
  185. package/dist/services/automations/use-cases/delete-automation.use-case.d.ts +6 -6
  186. package/dist/services/automations/use-cases/delete-automation.use-case.js +8 -22
  187. package/dist/services/automations/use-cases/delete-automation.use-case.mjs +8 -17
  188. package/dist/services/automations/use-cases/finish-automation-run.use-case.d.ts +5 -7
  189. package/dist/services/automations/use-cases/finish-automation-run.use-case.js +5 -20
  190. package/dist/services/automations/use-cases/finish-automation-run.use-case.mjs +5 -15
  191. package/dist/services/automations/use-cases/get-automation-by-id.use-case.d.ts +4 -6
  192. package/dist/services/automations/use-cases/get-automation-by-id.use-case.js +5 -19
  193. package/dist/services/automations/use-cases/get-automation-by-id.use-case.mjs +5 -14
  194. package/dist/services/automations/use-cases/issue-automation-event-token.use-case.d.ts +7 -9
  195. package/dist/services/automations/use-cases/issue-automation-event-token.use-case.js +6 -20
  196. package/dist/services/automations/use-cases/issue-automation-event-token.use-case.mjs +6 -15
  197. package/dist/services/automations/use-cases/list-automation-runs-by-automation.use-case.d.ts +6 -6
  198. package/dist/services/automations/use-cases/list-automation-runs-by-automation.use-case.js +5 -19
  199. package/dist/services/automations/use-cases/list-automation-runs-by-automation.use-case.mjs +5 -14
  200. package/dist/services/automations/use-cases/list-automation-runs-by-user.use-case.d.ts +6 -6
  201. package/dist/services/automations/use-cases/list-automation-runs-by-user.use-case.js +5 -19
  202. package/dist/services/automations/use-cases/list-automation-runs-by-user.use-case.mjs +5 -14
  203. package/dist/services/automations/use-cases/list-automations-by-user.use-case.d.ts +6 -6
  204. package/dist/services/automations/use-cases/list-automations-by-user.use-case.js +5 -19
  205. package/dist/services/automations/use-cases/list-automations-by-user.use-case.mjs +5 -14
  206. package/dist/services/automations/use-cases/preview-automation-runs.use-case.d.ts +4 -6
  207. package/dist/services/automations/use-cases/preview-automation-runs.use-case.js +3 -15
  208. package/dist/services/automations/use-cases/preview-automation-runs.use-case.mjs +3 -10
  209. package/dist/services/automations/use-cases/receive-automation-event.use-case.d.ts +8 -10
  210. package/dist/services/automations/use-cases/receive-automation-event.use-case.js +8 -23
  211. package/dist/services/automations/use-cases/receive-automation-event.use-case.mjs +8 -18
  212. package/dist/services/automations/use-cases/renew-automation-lease.use-case.d.ts +6 -8
  213. package/dist/services/automations/use-cases/renew-automation-lease.use-case.js +4 -18
  214. package/dist/services/automations/use-cases/renew-automation-lease.use-case.mjs +4 -13
  215. package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.d.ts +6 -8
  216. package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.js +8 -21
  217. package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.mjs +9 -17
  218. package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.d.ts +4 -6
  219. package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.js +8 -22
  220. package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.mjs +8 -17
  221. package/dist/services/automations/use-cases/start-automation-run.use-case.d.ts +8 -10
  222. package/dist/services/automations/use-cases/start-automation-run.use-case.js +5 -20
  223. package/dist/services/automations/use-cases/start-automation-run.use-case.mjs +5 -15
  224. package/dist/services/automations/use-cases/sync-automation-run.use-case.d.ts +5 -7
  225. package/dist/services/automations/use-cases/sync-automation-run.use-case.js +12 -27
  226. package/dist/services/automations/use-cases/sync-automation-run.use-case.mjs +12 -22
  227. package/dist/services/automations/use-cases/sync-automation-runs.use-case.d.ts +8 -10
  228. package/dist/services/automations/use-cases/sync-automation-runs.use-case.js +7 -22
  229. package/dist/services/automations/use-cases/sync-automation-runs.use-case.mjs +7 -17
  230. package/dist/services/automations/use-cases/update-automation.use-case.d.ts +4 -6
  231. package/dist/services/automations/use-cases/update-automation.use-case.js +10 -24
  232. package/dist/services/automations/use-cases/update-automation.use-case.mjs +10 -19
  233. package/dist/services/automations/utils/automation-event-error.mjs +0 -1
  234. package/dist/services/automations/utils/automation-fields.mjs +0 -1
  235. package/dist/services/automations/utils/event-message.mjs +0 -1
  236. package/dist/services/automations/utils/event-token.d.ts +1 -2
  237. package/dist/services/automations/utils/event-token.js +9 -35
  238. package/dist/services/automations/utils/event-token.mjs +9 -25
  239. package/dist/services/automations/utils/next-run.mjs +0 -1
  240. package/dist/services/automations/utils/open-run.mjs +0 -1
  241. package/dist/services/automations/utils/previous-run.js +1 -1
  242. package/dist/services/automations/utils/previous-run.mjs +1 -2
  243. package/dist/services/automations/utils/runner-scope.mjs +0 -1
  244. package/dist/services/automations/utils/settings.mjs +0 -1
  245. package/dist/services/chats/entities/chat-message.entity.mjs +0 -1
  246. package/dist/services/chats/entities/chat-settings.entity.mjs +0 -1
  247. package/dist/services/chats/entities/chat.entity.d.ts +1 -0
  248. package/dist/services/chats/entities/chat.entity.js +3 -2
  249. package/dist/services/chats/entities/chat.entity.mjs +3 -3
  250. package/dist/services/chats/module.d.ts +0 -1
  251. package/dist/services/chats/module.js +5 -7
  252. package/dist/services/chats/module.mjs +5 -8
  253. package/dist/services/chats/repositories/chat.repository.js +5 -20
  254. package/dist/services/chats/repositories/chat.repository.mjs +5 -15
  255. package/dist/services/chats/use-cases/create-chat.use-case.d.ts +4 -6
  256. package/dist/services/chats/use-cases/create-chat.use-case.js +5 -19
  257. package/dist/services/chats/use-cases/create-chat.use-case.mjs +5 -14
  258. package/dist/services/chats/use-cases/delete-chat.use-case.d.ts +6 -6
  259. package/dist/services/chats/use-cases/delete-chat.use-case.js +8 -22
  260. package/dist/services/chats/use-cases/delete-chat.use-case.mjs +8 -17
  261. package/dist/services/chats/use-cases/get-chat-by-id.use-case.d.ts +4 -6
  262. package/dist/services/chats/use-cases/get-chat-by-id.use-case.js +6 -20
  263. package/dist/services/chats/use-cases/get-chat-by-id.use-case.mjs +6 -15
  264. package/dist/services/chats/use-cases/interrupt-execution.use-case.d.ts +4 -6
  265. package/dist/services/chats/use-cases/interrupt-execution.use-case.js +6 -20
  266. package/dist/services/chats/use-cases/interrupt-execution.use-case.mjs +6 -15
  267. package/dist/services/chats/use-cases/list-chats-by-props.use-case.d.ts +6 -6
  268. package/dist/services/chats/use-cases/list-chats-by-props.use-case.js +5 -19
  269. package/dist/services/chats/use-cases/list-chats-by-props.use-case.mjs +5 -14
  270. package/dist/services/chats/use-cases/list-chats-by-user.use-case.d.ts +6 -6
  271. package/dist/services/chats/use-cases/list-chats-by-user.use-case.js +5 -19
  272. package/dist/services/chats/use-cases/list-chats-by-user.use-case.mjs +5 -14
  273. package/dist/services/chats/use-cases/update-chat.use-case.d.ts +5 -6
  274. package/dist/services/chats/use-cases/update-chat.use-case.js +8 -26
  275. package/dist/services/chats/use-cases/update-chat.use-case.mjs +8 -21
  276. package/dist/services/chats/utils/deprecated-activity.mjs +0 -1
  277. package/dist/services/llmcalls/entities/llmcall.entity.mjs +0 -1
  278. package/dist/services/llmcalls/module.d.ts +0 -1
  279. package/dist/services/llmcalls/module.js +4 -6
  280. package/dist/services/llmcalls/module.mjs +4 -7
  281. package/dist/services/llmcalls/repositories/llmcall.repository.js +5 -20
  282. package/dist/services/llmcalls/repositories/llmcall.repository.mjs +5 -15
  283. package/dist/services/llmcalls/use-cases/create-llmcall.use-case.d.ts +4 -6
  284. package/dist/services/llmcalls/use-cases/create-llmcall.use-case.js +5 -19
  285. package/dist/services/llmcalls/use-cases/create-llmcall.use-case.mjs +5 -14
  286. package/dist/services/llmcalls/use-cases/delete-llmcall.use-case.d.ts +6 -6
  287. package/dist/services/llmcalls/use-cases/delete-llmcall.use-case.js +8 -22
  288. package/dist/services/llmcalls/use-cases/delete-llmcall.use-case.mjs +8 -17
  289. package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.d.ts +4 -6
  290. package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.js +5 -19
  291. package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.mjs +5 -14
  292. package/dist/services/llmcalls/use-cases/get-llm-usage-by-message.use-case.d.ts +4 -6
  293. package/dist/services/llmcalls/use-cases/get-llm-usage-by-message.use-case.js +5 -19
  294. package/dist/services/llmcalls/use-cases/get-llm-usage-by-message.use-case.mjs +5 -14
  295. package/dist/services/llmcalls/use-cases/get-llm-usage-stats.use-case.d.ts +4 -6
  296. package/dist/services/llmcalls/use-cases/get-llm-usage-stats.use-case.js +5 -19
  297. package/dist/services/llmcalls/use-cases/get-llm-usage-stats.use-case.mjs +5 -14
  298. package/dist/services/llmcalls/use-cases/get-llmcall-by-id.use-case.d.ts +4 -6
  299. package/dist/services/llmcalls/use-cases/get-llmcall-by-id.use-case.js +6 -20
  300. package/dist/services/llmcalls/use-cases/get-llmcall-by-id.use-case.mjs +6 -15
  301. package/dist/services/llmcalls/use-cases/list-llmcalls-by-props.use-case.d.ts +6 -6
  302. package/dist/services/llmcalls/use-cases/list-llmcalls-by-props.use-case.js +5 -19
  303. package/dist/services/llmcalls/use-cases/list-llmcalls-by-props.use-case.mjs +5 -14
  304. package/dist/services/llmcalls/use-cases/update-llmcall.use-case.d.ts +4 -6
  305. package/dist/services/llmcalls/use-cases/update-llmcall.use-case.js +7 -21
  306. package/dist/services/llmcalls/use-cases/update-llmcall.use-case.mjs +7 -16
  307. package/dist/services/llmcalls/utils/usage-periods.mjs +0 -1
  308. package/dist/services/llmcalls/utils/usage-totals.mjs +0 -1
  309. package/dist/services/mcp-servers/entities/mcp-manifest.mjs +0 -1
  310. package/dist/services/mcp-servers/entities/mcpserver.entity.mjs +0 -1
  311. package/dist/services/mcp-servers/module.d.ts +0 -1
  312. package/dist/services/mcp-servers/module.js +8 -10
  313. package/dist/services/mcp-servers/module.mjs +8 -11
  314. package/dist/services/mcp-servers/repositories/mcpserver.repository.js +5 -21
  315. package/dist/services/mcp-servers/repositories/mcpserver.repository.mjs +5 -16
  316. package/dist/services/mcp-servers/use-cases/create-mcpserver.use-case.d.ts +5 -7
  317. package/dist/services/mcp-servers/use-cases/create-mcpserver.use-case.js +5 -21
  318. package/dist/services/mcp-servers/use-cases/create-mcpserver.use-case.mjs +5 -16
  319. package/dist/services/mcp-servers/use-cases/decide-mcpserver-trust.use-case.d.ts +4 -6
  320. package/dist/services/mcp-servers/use-cases/decide-mcpserver-trust.use-case.js +7 -21
  321. package/dist/services/mcp-servers/use-cases/decide-mcpserver-trust.use-case.mjs +7 -16
  322. package/dist/services/mcp-servers/use-cases/delete-mcpserver.use-case.d.ts +6 -6
  323. package/dist/services/mcp-servers/use-cases/delete-mcpserver.use-case.js +8 -22
  324. package/dist/services/mcp-servers/use-cases/delete-mcpserver.use-case.mjs +8 -17
  325. package/dist/services/mcp-servers/use-cases/get-mcpserver-by-id.use-case.d.ts +4 -6
  326. package/dist/services/mcp-servers/use-cases/get-mcpserver-by-id.use-case.js +5 -19
  327. package/dist/services/mcp-servers/use-cases/get-mcpserver-by-id.use-case.mjs +5 -14
  328. package/dist/services/mcp-servers/use-cases/list-all-mcpservers-by-user.use-case.d.ts +6 -6
  329. package/dist/services/mcp-servers/use-cases/list-all-mcpservers-by-user.use-case.js +5 -19
  330. package/dist/services/mcp-servers/use-cases/list-all-mcpservers-by-user.use-case.mjs +5 -14
  331. package/dist/services/mcp-servers/use-cases/list-mcpservers-by-user.use-case.d.ts +6 -6
  332. package/dist/services/mcp-servers/use-cases/list-mcpservers-by-user.use-case.js +5 -19
  333. package/dist/services/mcp-servers/use-cases/list-mcpservers-by-user.use-case.mjs +5 -14
  334. package/dist/services/mcp-servers/use-cases/update-mcpserver.use-case.d.ts +5 -7
  335. package/dist/services/mcp-servers/use-cases/update-mcpserver.use-case.js +9 -25
  336. package/dist/services/mcp-servers/use-cases/update-mcpserver.use-case.mjs +9 -20
  337. package/dist/services/mcp-servers/use-cases/verify-mcpserver-connection.use-case.d.ts +4 -6
  338. package/dist/services/mcp-servers/use-cases/verify-mcpserver-connection.use-case.js +9 -23
  339. package/dist/services/mcp-servers/use-cases/verify-mcpserver-connection.use-case.mjs +9 -18
  340. package/dist/services/tasks/entities/agent-action.entity.mjs +0 -1
  341. package/dist/services/tasks/entities/agent-task.entity.mjs +0 -1
  342. package/dist/services/tasks/module.d.ts +0 -1
  343. package/dist/services/tasks/module.js +7 -9
  344. package/dist/services/tasks/module.mjs +7 -10
  345. package/dist/services/tasks/repositories/agent-action.repository.js +5 -21
  346. package/dist/services/tasks/repositories/agent-action.repository.mjs +5 -16
  347. package/dist/services/tasks/repositories/agent-task.repository.js +5 -21
  348. package/dist/services/tasks/repositories/agent-task.repository.mjs +5 -16
  349. package/dist/services/tasks/use-cases/create-agent-action.use-case.d.ts +4 -6
  350. package/dist/services/tasks/use-cases/create-agent-action.use-case.js +5 -19
  351. package/dist/services/tasks/use-cases/create-agent-action.use-case.mjs +5 -14
  352. package/dist/services/tasks/use-cases/create-agent-task.use-case.d.ts +4 -6
  353. package/dist/services/tasks/use-cases/create-agent-task.use-case.js +5 -19
  354. package/dist/services/tasks/use-cases/create-agent-task.use-case.mjs +5 -14
  355. package/dist/services/tasks/use-cases/get-agent-task-by-id.use-case.d.ts +4 -6
  356. package/dist/services/tasks/use-cases/get-agent-task-by-id.use-case.js +5 -19
  357. package/dist/services/tasks/use-cases/get-agent-task-by-id.use-case.mjs +5 -14
  358. package/dist/services/tasks/use-cases/list-agent-actions-by-task.use-case.d.ts +6 -6
  359. package/dist/services/tasks/use-cases/list-agent-actions-by-task.use-case.js +5 -19
  360. package/dist/services/tasks/use-cases/list-agent-actions-by-task.use-case.mjs +5 -14
  361. package/dist/services/tasks/use-cases/list-agent-tasks-by-chat.use-case.d.ts +6 -6
  362. package/dist/services/tasks/use-cases/list-agent-tasks-by-chat.use-case.js +5 -19
  363. package/dist/services/tasks/use-cases/list-agent-tasks-by-chat.use-case.mjs +5 -14
  364. package/dist/services/tasks/use-cases/update-agent-action.use-case.d.ts +4 -6
  365. package/dist/services/tasks/use-cases/update-agent-action.use-case.js +6 -20
  366. package/dist/services/tasks/use-cases/update-agent-action.use-case.mjs +6 -15
  367. package/dist/services/tasks/use-cases/update-agent-task.use-case.d.ts +4 -6
  368. package/dist/services/tasks/use-cases/update-agent-task.use-case.js +6 -20
  369. package/dist/services/tasks/use-cases/update-agent-task.use-case.mjs +6 -15
  370. package/dist/services/traces/entities/agent-trace-entry.entity.mjs +0 -1
  371. package/dist/services/traces/module.d.ts +0 -1
  372. package/dist/services/traces/module.js +2 -4
  373. package/dist/services/traces/module.mjs +2 -5
  374. package/dist/services/traces/repositories/agent-trace.repository.js +3 -15
  375. package/dist/services/traces/repositories/agent-trace.repository.mjs +3 -10
  376. package/dist/services/traces/use-cases/create-agent-traces.use-case.d.ts +6 -8
  377. package/dist/services/traces/use-cases/create-agent-traces.use-case.js +5 -19
  378. package/dist/services/traces/use-cases/create-agent-traces.use-case.mjs +5 -14
  379. package/dist/services/traces/use-cases/list-agent-traces-by-chat.use-case.d.ts +6 -6
  380. package/dist/services/traces/use-cases/list-agent-traces-by-chat.use-case.js +5 -19
  381. package/dist/services/traces/use-cases/list-agent-traces-by-chat.use-case.mjs +5 -14
  382. package/dist/services/users/entities/user-acquisition.js +2 -2
  383. package/dist/services/users/entities/user-acquisition.mjs +2 -3
  384. package/dist/services/users/entities/user-country.js +2 -2
  385. package/dist/services/users/entities/user-country.mjs +2 -3
  386. package/dist/services/users/entities/user-currency.js +2 -2
  387. package/dist/services/users/entities/user-currency.mjs +2 -3
  388. package/dist/services/users/entities/user-default-model.js +2 -2
  389. package/dist/services/users/entities/user-default-model.mjs +2 -3
  390. package/dist/services/users/entities/user-email.value-object.mjs +0 -1
  391. package/dist/services/users/entities/user-language.js +2 -2
  392. package/dist/services/users/entities/user-language.mjs +2 -3
  393. package/dist/services/users/entities/user-marketing.js +2 -2
  394. package/dist/services/users/entities/user-marketing.mjs +2 -3
  395. package/dist/services/users/entities/user-notification-preferences.mjs +0 -1
  396. package/dist/services/users/entities/user-password.value-object.mjs +0 -1
  397. package/dist/services/users/entities/user-permissions.mjs +0 -1
  398. package/dist/services/users/entities/user-preferences.mjs +0 -1
  399. package/dist/services/users/entities/user-report-preferences.mjs +0 -1
  400. package/dist/services/users/entities/user-report-schedule.mjs +0 -1
  401. package/dist/services/users/entities/user-timezone.js +2 -2
  402. package/dist/services/users/entities/user-timezone.mjs +2 -3
  403. package/dist/services/users/entities/user.entity.d.ts +1 -0
  404. package/dist/services/users/entities/user.entity.js +9 -22
  405. package/dist/services/users/entities/user.entity.mjs +9 -17
  406. package/dist/services/users/module.d.ts +2 -1
  407. package/dist/services/users/module.js +12 -7
  408. package/dist/services/users/module.mjs +11 -8
  409. package/dist/services/users/repositories/user.repository.d.ts +2 -0
  410. package/dist/services/users/repositories/user.repository.js +11 -20
  411. package/dist/services/users/repositories/user.repository.mjs +11 -15
  412. package/dist/services/users/use-cases/change-password.use-case.d.ts +15 -0
  413. package/dist/services/users/use-cases/change-password.use-case.js +52 -0
  414. package/dist/services/users/use-cases/change-password.use-case.mjs +28 -0
  415. package/dist/services/users/use-cases/create-user.use-case.d.ts +4 -6
  416. package/dist/services/users/use-cases/create-user.use-case.js +5 -19
  417. package/dist/services/users/use-cases/create-user.use-case.mjs +5 -14
  418. package/dist/services/users/use-cases/delete-user.use-case.d.ts +6 -6
  419. package/dist/services/users/use-cases/delete-user.use-case.js +8 -22
  420. package/dist/services/users/use-cases/delete-user.use-case.mjs +8 -17
  421. package/dist/services/users/use-cases/get-user-by-id.use-case.d.ts +4 -6
  422. package/dist/services/users/use-cases/get-user-by-id.use-case.js +6 -20
  423. package/dist/services/users/use-cases/get-user-by-id.use-case.mjs +6 -15
  424. package/dist/services/users/use-cases/list-users-by-props.use-case.d.ts +6 -6
  425. package/dist/services/users/use-cases/list-users-by-props.use-case.js +5 -19
  426. package/dist/services/users/use-cases/list-users-by-props.use-case.mjs +5 -14
  427. package/dist/services/users/use-cases/update-user.use-case.d.ts +4 -6
  428. package/dist/services/users/use-cases/update-user.use-case.js +9 -22
  429. package/dist/services/users/use-cases/update-user.use-case.mjs +9 -17
  430. package/dist/services/users/utils/default-model.mjs +0 -1
  431. package/dist/services/workspaces/entities/workspace-item.entity.mjs +0 -1
  432. package/dist/services/workspaces/module.d.ts +0 -1
  433. package/dist/services/workspaces/module.js +5 -7
  434. package/dist/services/workspaces/module.mjs +5 -8
  435. package/dist/services/workspaces/repositories/workspace-item.repository.js +5 -20
  436. package/dist/services/workspaces/repositories/workspace-item.repository.mjs +5 -15
  437. package/dist/services/workspaces/use-cases/delete-workspace-item.use-case.d.ts +6 -8
  438. package/dist/services/workspaces/use-cases/delete-workspace-item.use-case.js +7 -21
  439. package/dist/services/workspaces/use-cases/delete-workspace-item.use-case.mjs +7 -16
  440. package/dist/services/workspaces/use-cases/get-workspace-item.use-case.d.ts +4 -6
  441. package/dist/services/workspaces/use-cases/get-workspace-item.use-case.js +6 -20
  442. package/dist/services/workspaces/use-cases/get-workspace-item.use-case.mjs +6 -15
  443. package/dist/services/workspaces/use-cases/list-workspace-items.use-case.d.ts +6 -6
  444. package/dist/services/workspaces/use-cases/list-workspace-items.use-case.js +5 -19
  445. package/dist/services/workspaces/use-cases/list-workspace-items.use-case.mjs +5 -14
  446. package/dist/services/workspaces/use-cases/save-workspace-item.use-case.d.ts +4 -6
  447. package/dist/services/workspaces/use-cases/save-workspace-item.use-case.js +10 -24
  448. package/dist/services/workspaces/use-cases/save-workspace-item.use-case.mjs +10 -19
  449. package/dist/services/workspaces/use-cases/search-workspace-items.use-case.d.ts +6 -6
  450. package/dist/services/workspaces/use-cases/search-workspace-items.use-case.js +5 -19
  451. package/dist/services/workspaces/use-cases/search-workspace-items.use-case.mjs +5 -14
  452. package/dist/skills/call-modes.mjs +0 -1
  453. package/dist/skills/runtime-context.mjs +0 -1
  454. package/dist/skills/shared/shared-rules.mjs +0 -1
  455. package/dist/skills/skill.js +1 -2
  456. package/dist/skills/skill.mjs +1 -3
  457. package/dist/tools/core/call-ai/call-ai.skill.mjs +0 -1
  458. package/dist/tools/core/call-ai/call-ai.tool.mjs +0 -1
  459. package/dist/tools/core/slack/send-slack-message.tool.mjs +0 -1
  460. package/dist/tools/core/web-search/web-search.tool.mjs +0 -1
  461. package/dist/tools/tool.mjs +0 -1
  462. package/docs/authentication.md +95 -16
  463. package/docs/authorization.md +1 -1
  464. package/docs/automations.md +6 -5
  465. package/docs/chats.md +1 -1
  466. package/docs/configuration.md +1 -1
  467. package/docs/integration-guide.md +2 -2
  468. package/docs/mcp-servers.md +1 -1
  469. package/docs/usage.md +5 -5
  470. package/docs/users.md +1 -1
  471. package/examples/authentication/login.ts +1 -1
  472. package/examples/automations/create-automation.ts +1 -1
  473. package/examples/automations/create-event-automation.ts +2 -2
  474. package/examples/automations/list-automation-runs.ts +2 -2
  475. package/examples/automations/list-automations.ts +1 -1
  476. package/examples/automations/preview-automation-runs.ts +1 -1
  477. package/examples/automations/receive-automation-event.ts +1 -1
  478. package/examples/automations/revoke-automation-event-token.ts +2 -2
  479. package/examples/automations/update-automation.ts +2 -2
  480. package/examples/chats/get-chat-by-id.ts +2 -2
  481. package/examples/chats/list-autonomous-chats.ts +1 -1
  482. package/examples/chats/list-chats.ts +1 -1
  483. package/examples/mcps/decide-mcp.ts +3 -3
  484. package/examples/mcps/list-all-mcps.ts +1 -1
  485. package/examples/mcps/verify-mcp.ts +1 -1
  486. package/examples/usage/get-chat-usage.ts +2 -2
  487. package/examples/usage/get-message-usage.ts +2 -2
  488. package/examples/usage/get-usage-stats-by-range.ts +1 -1
  489. package/examples/usage/get-usage-stats.ts +3 -3
  490. package/examples/users/set-default-model.ts +1 -1
  491. package/package.json +2 -4
  492. package/dist/chunk-CF3WOMB3.mjs +0 -16
  493. package/dist/common/base/utils/delete-empty-fields.d.ts +0 -1
  494. package/dist/common/base/utils/delete-empty-fields.js +0 -66
  495. package/dist/common/base/utils/delete-empty-fields.mjs +0 -43
  496. package/dist/common/base/utils/flatten-object.d.ts +0 -1
  497. package/dist/common/base/utils/flatten-object.js +0 -45
  498. package/dist/common/base/utils/flatten-object.mjs +0 -22
  499. package/dist/common/decorators/index.d.ts +0 -1
  500. package/dist/common/decorators/index.mjs +0 -1
  501. package/dist/common/decorators/mask-in-logs/index.d.ts +0 -1
  502. package/dist/common/decorators/mask-in-logs/index.mjs +0 -1
  503. package/dist/common/decorators/mask-in-logs/mask-in-logs.d.ts +0 -2
  504. package/dist/common/decorators/mask-in-logs/mask-in-logs.js +0 -53
  505. package/dist/common/decorators/mask-in-logs/mask-in-logs.mjs +0 -29
@@ -1,5 +1,5 @@
1
1
  import { QueryOptions } from '../../../common/repositories/index.js';
2
- import { BaseUseCase, BaseUseCaseParams, BaseUseCaseOutput } from '../../../common/base/base.use-case.js';
2
+ import { BaseUseCase, BaseUseCaseParams } from '../../../common/base/base.use-case.js';
3
3
  import { ChatRepository } from '../repositories';
4
4
  import { ChatProps, ExecutionMode } from '../entities';
5
5
  export interface Params extends BaseUseCaseParams {
@@ -8,12 +8,12 @@ export interface Params extends BaseUseCaseParams {
8
8
  search?: string;
9
9
  options?: QueryOptions;
10
10
  }
11
- export interface Output extends BaseUseCaseOutput {
12
- data: ChatProps[] | null | undefined;
13
- hasMore?: boolean;
11
+ export interface Output {
12
+ items: ChatProps[];
13
+ hasMore: boolean;
14
14
  }
15
15
  export declare class ListChatsByUserUseCase extends BaseUseCase<Params, Output> {
16
- private readonly chatRepository?;
17
- constructor(chatRepository?: ChatRepository | undefined);
16
+ private readonly chatRepository;
17
+ constructor(chatRepository?: ChatRepository);
18
18
  execute(params: Params): Promise<Output>;
19
19
  }
@@ -16,28 +16,18 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var __decorateClass = (decorators, target, key, kind) => {
20
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
21
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
22
- if (decorator = decorators[i])
23
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
24
- if (kind && result) __defProp(target, key, result);
25
- return result;
26
- };
27
- var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
28
19
  var list_chats_by_user_use_case_exports = {};
29
20
  __export(list_chats_by_user_use_case_exports, {
30
21
  ListChatsByUserUseCase: () => ListChatsByUserUseCase
31
22
  });
32
23
  module.exports = __toCommonJS(list_chats_by_user_use_case_exports);
33
- var import_tsyringe = require("tsyringe");
34
24
  var import_mongodb = require("mongodb");
35
25
  var import_repositories = require("../../../common/repositories/index.js");
36
26
  var import_helpers = require("../../../common/helpers/index.js");
37
27
  var import_base = require("../../../common/base/base.use-case.js");
38
28
  var import_repositories2 = require("../repositories");
39
- let ListChatsByUserUseCase = class extends import_base.BaseUseCase {
40
- constructor(chatRepository) {
29
+ class ListChatsByUserUseCase extends import_base.BaseUseCase {
30
+ constructor(chatRepository = new import_repositories2.ChatRepository()) {
41
31
  super();
42
32
  this.chatRepository = chatRepository;
43
33
  }
@@ -46,7 +36,7 @@ let ListChatsByUserUseCase = class extends import_base.BaseUseCase {
46
36
  const { options, executionMode, search, currentUser } = params;
47
37
  const { page = 1, limit: pageSize = 10 } = options || {};
48
38
  const term = (0, import_helpers.escapeRegex)(search?.trim());
49
- const result = await this.chatRepository?._.findManyPaginated({
39
+ const result = await this.chatRepository._.findManyPaginated({
50
40
  scope: params.scope ?? import_repositories.Scope.canView(currentUser),
51
41
  where: {
52
42
  ownerId: new import_mongodb.ObjectId(currentUser?.userId),
@@ -56,13 +46,9 @@ let ListChatsByUserUseCase = class extends import_base.BaseUseCase {
56
46
  },
57
47
  options: { page, limit: pageSize, sortBy: { updatedAt: -1 } }
58
48
  });
59
- return { data: result?.items, hasMore: result?.hasMore };
49
+ return { items: result?.items ?? [], hasMore: result?.hasMore ?? false };
60
50
  }
61
- };
62
- ListChatsByUserUseCase = __decorateClass([
63
- (0, import_tsyringe.autoInjectable)(),
64
- __decorateParam(0, (0, import_tsyringe.inject)(import_repositories2.ChatRepository))
65
- ], ListChatsByUserUseCase);
51
+ }
66
52
  // Annotate the CommonJS export names for ESM import in node:
67
53
  0 && (module.exports = {
68
54
  ListChatsByUserUseCase
@@ -1,15 +1,10 @@
1
- import {
2
- __decorateClass,
3
- __decorateParam
4
- } from "../../../chunk-CF3WOMB3.mjs";
5
- import { autoInjectable, inject } from "tsyringe";
6
1
  import { ObjectId } from "mongodb";
7
2
  import { Scope } from "../../../common/repositories/index.js";
8
3
  import { escapeRegex } from "../../../common/helpers/index.js";
9
4
  import { BaseUseCase } from "../../../common/base/base.use-case.js";
10
5
  import { ChatRepository } from "../repositories";
11
- let ListChatsByUserUseCase = class extends BaseUseCase {
12
- constructor(chatRepository) {
6
+ class ListChatsByUserUseCase extends BaseUseCase {
7
+ constructor(chatRepository = new ChatRepository()) {
13
8
  super();
14
9
  this.chatRepository = chatRepository;
15
10
  }
@@ -18,7 +13,7 @@ let ListChatsByUserUseCase = class extends BaseUseCase {
18
13
  const { options, executionMode, search, currentUser } = params;
19
14
  const { page = 1, limit: pageSize = 10 } = options || {};
20
15
  const term = escapeRegex(search?.trim());
21
- const result = await this.chatRepository?._.findManyPaginated({
16
+ const result = await this.chatRepository._.findManyPaginated({
22
17
  scope: params.scope ?? Scope.canView(currentUser),
23
18
  where: {
24
19
  ownerId: new ObjectId(currentUser?.userId),
@@ -28,13 +23,9 @@ let ListChatsByUserUseCase = class extends BaseUseCase {
28
23
  },
29
24
  options: { page, limit: pageSize, sortBy: { updatedAt: -1 } }
30
25
  });
31
- return { data: result?.items, hasMore: result?.hasMore };
26
+ return { items: result?.items ?? [], hasMore: result?.hasMore ?? false };
32
27
  }
33
- };
34
- ListChatsByUserUseCase = __decorateClass([
35
- autoInjectable(),
36
- __decorateParam(0, inject(ChatRepository))
37
- ], ListChatsByUserUseCase);
28
+ }
38
29
  export {
39
30
  ListChatsByUserUseCase
40
31
  };
@@ -1,15 +1,14 @@
1
- import { BaseUseCase, BaseUseCaseParams, BaseUseCaseOutput } from '../../../common/base/base.use-case.js';
1
+ import { BaseUseCase, BaseUseCaseParams } from '../../../common/base/base.use-case.js';
2
2
  import { ChatRepository } from '../repositories';
3
3
  import { ChatProps } from '../entities';
4
4
  export interface Params extends BaseUseCaseParams {
5
5
  id: string;
6
6
  payload?: ChatProps;
7
+ unset?: Record<string, ''>;
7
8
  }
8
- export interface Output extends BaseUseCaseOutput {
9
- data: ChatProps;
10
- }
9
+ export type Output = ChatProps;
11
10
  export declare class UpdateChatUseCase extends BaseUseCase<Params, Output> {
12
- private readonly chatRepository?;
13
- constructor(chatRepository?: ChatRepository | undefined);
11
+ private readonly chatRepository;
12
+ constructor(chatRepository?: ChatRepository);
14
13
  execute(params: Params): Promise<Output>;
15
14
  }
@@ -16,33 +16,23 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var __decorateClass = (decorators, target, key, kind) => {
20
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
21
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
22
- if (decorator = decorators[i])
23
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
24
- if (kind && result) __defProp(target, key, result);
25
- return result;
26
- };
27
- var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
28
19
  var update_chat_use_case_exports = {};
29
20
  __export(update_chat_use_case_exports, {
30
21
  UpdateChatUseCase: () => UpdateChatUseCase
31
22
  });
32
23
  module.exports = __toCommonJS(update_chat_use_case_exports);
33
- var import_tsyringe = require("tsyringe");
34
24
  var import_base = require("../../../common/base/base.use-case.js");
35
25
  var import_repositories = require("../../../common/repositories/index.js");
36
26
  var import_repositories2 = require("../repositories");
37
27
  var import_entities = require("../entities");
38
- let UpdateChatUseCase = class extends import_base.BaseUseCase {
39
- constructor(chatRepository) {
28
+ class UpdateChatUseCase extends import_base.BaseUseCase {
29
+ constructor(chatRepository = new import_repositories2.ChatRepository()) {
40
30
  super();
41
31
  this.chatRepository = chatRepository;
42
32
  }
43
33
  chatRepository;
44
34
  async execute(params) {
45
- const { payload, id, currentUser } = params;
35
+ const { payload, unset, id, currentUser } = params;
46
36
  if (!id) {
47
37
  throw new Error("Id is required for updating Chat");
48
38
  }
@@ -50,20 +40,12 @@ let UpdateChatUseCase = class extends import_base.BaseUseCase {
50
40
  throw new Error("Payload is required for updating Chat");
51
41
  }
52
42
  const chat = import_entities.Chat.fromJSON({ ...payload, _id: id });
53
- if (payload.toUnset) {
54
- const flat = chat.toFlatDocument();
55
- const fields = Object.keys(payload.toUnset).filter((field) => flat[field] === void 0);
56
- if (fields.length) chat.unset(fields);
57
- }
58
- const result = await this.chatRepository?.update(chat, params.scope ?? import_repositories.Scope.canEdit(currentUser));
59
- if (!result) return this.throwHttpError({ statusCode: 404, errorMessage: "{{resource_not_found}}" });
60
- return { data: result };
43
+ Object.assign(chat.clearedFields, unset);
44
+ const result = await this.chatRepository.update(chat, params.scope ?? import_repositories.Scope.canEdit(currentUser));
45
+ if (!result) this.throwHttpError({ statusCode: 404, errorMessage: "{{resource_not_found}}" });
46
+ return result;
61
47
  }
62
- };
63
- UpdateChatUseCase = __decorateClass([
64
- (0, import_tsyringe.autoInjectable)(),
65
- __decorateParam(0, (0, import_tsyringe.inject)(import_repositories2.ChatRepository))
66
- ], UpdateChatUseCase);
48
+ }
67
49
  // Annotate the CommonJS export names for ESM import in node:
68
50
  0 && (module.exports = {
69
51
  UpdateChatUseCase
@@ -1,20 +1,15 @@
1
- import {
2
- __decorateClass,
3
- __decorateParam
4
- } from "../../../chunk-CF3WOMB3.mjs";
5
- import { autoInjectable, inject } from "tsyringe";
6
1
  import { BaseUseCase } from "../../../common/base/base.use-case.js";
7
2
  import { Scope } from "../../../common/repositories/index.js";
8
3
  import { ChatRepository } from "../repositories";
9
4
  import { Chat } from "../entities";
10
- let UpdateChatUseCase = class extends BaseUseCase {
11
- constructor(chatRepository) {
5
+ class UpdateChatUseCase extends BaseUseCase {
6
+ constructor(chatRepository = new ChatRepository()) {
12
7
  super();
13
8
  this.chatRepository = chatRepository;
14
9
  }
15
10
  chatRepository;
16
11
  async execute(params) {
17
- const { payload, id, currentUser } = params;
12
+ const { payload, unset, id, currentUser } = params;
18
13
  if (!id) {
19
14
  throw new Error("Id is required for updating Chat");
20
15
  }
@@ -22,20 +17,12 @@ let UpdateChatUseCase = class extends BaseUseCase {
22
17
  throw new Error("Payload is required for updating Chat");
23
18
  }
24
19
  const chat = Chat.fromJSON({ ...payload, _id: id });
25
- if (payload.toUnset) {
26
- const flat = chat.toFlatDocument();
27
- const fields = Object.keys(payload.toUnset).filter((field) => flat[field] === void 0);
28
- if (fields.length) chat.unset(fields);
29
- }
30
- const result = await this.chatRepository?.update(chat, params.scope ?? Scope.canEdit(currentUser));
31
- if (!result) return this.throwHttpError({ statusCode: 404, errorMessage: "{{resource_not_found}}" });
32
- return { data: result };
20
+ Object.assign(chat.clearedFields, unset);
21
+ const result = await this.chatRepository.update(chat, params.scope ?? Scope.canEdit(currentUser));
22
+ if (!result) this.throwHttpError({ statusCode: 404, errorMessage: "{{resource_not_found}}" });
23
+ return result;
33
24
  }
34
- };
35
- UpdateChatUseCase = __decorateClass([
36
- autoInjectable(),
37
- __decorateParam(0, inject(ChatRepository))
38
- ], UpdateChatUseCase);
25
+ }
39
26
  export {
40
27
  UpdateChatUseCase
41
28
  };
@@ -1,4 +1,3 @@
1
- import "../../../chunk-CF3WOMB3.mjs";
2
1
  const WORDS = [
3
2
  "Thinking",
4
3
  "Computing",
@@ -1,4 +1,3 @@
1
- import "../../../chunk-CF3WOMB3.mjs";
2
1
  import { BaseEntity } from "../../../common/base/base.entity.js";
3
2
  class LLMCall extends BaseEntity {
4
3
  constructor(props, origin, answerId, sessionId, costInUsd, response) {
@@ -1,4 +1,3 @@
1
- import 'reflect-metadata';
2
1
  import { Params as MParams, Output as MOutput } from './use-cases/get-llm-usage-by-message.use-case';
3
2
  import { Params as HParams, Output as HOutput } from './use-cases/get-llm-usage-by-chat.use-case';
4
3
  import { Params as SParams, Output as SOutput } from './use-cases/get-llm-usage-stats.use-case';
@@ -24,26 +24,24 @@ __export(module_exports, {
24
24
  getLLMUsageStats: () => getLLMUsageStats
25
25
  });
26
26
  module.exports = __toCommonJS(module_exports);
27
- var import_reflect_metadata = require("reflect-metadata");
28
- var import_tsyringe = require("tsyringe");
29
27
  var import_get_llm_usage_by_message = require("./use-cases/get-llm-usage-by-message.use-case");
30
28
  var import_get_llm_usage_by_chat = require("./use-cases/get-llm-usage-by-chat.use-case");
31
29
  var import_get_llm_usage_stats = require("./use-cases/get-llm-usage-stats.use-case");
32
30
  var import_create_llmcall = require("./use-cases/create-llmcall.use-case");
33
31
  async function getLLMUsageByMessage(props) {
34
- const getLLMUsageByMessageUseCase = import_tsyringe.container.resolve(import_get_llm_usage_by_message.GetLLMUsageByMessageUseCase);
32
+ const getLLMUsageByMessageUseCase = new import_get_llm_usage_by_message.GetLLMUsageByMessageUseCase();
35
33
  return getLLMUsageByMessageUseCase.execute(props);
36
34
  }
37
35
  async function getLLMUsageByChat(props) {
38
- const getLLMUsageByChatUseCase = import_tsyringe.container.resolve(import_get_llm_usage_by_chat.GetLLMUsageByChatUseCase);
36
+ const getLLMUsageByChatUseCase = new import_get_llm_usage_by_chat.GetLLMUsageByChatUseCase();
39
37
  return getLLMUsageByChatUseCase.execute(props);
40
38
  }
41
39
  async function getLLMUsageStats(props) {
42
- const getLLMUsageStatsUseCase = import_tsyringe.container.resolve(import_get_llm_usage_stats.GetLLMUsageStatsUseCase);
40
+ const getLLMUsageStatsUseCase = new import_get_llm_usage_stats.GetLLMUsageStatsUseCase();
43
41
  return getLLMUsageStatsUseCase.execute(props);
44
42
  }
45
43
  async function createLLMCall(props) {
46
- const createLLMCall2 = import_tsyringe.container.resolve(import_create_llmcall.CreateLLMCallUseCase);
44
+ const createLLMCall2 = new import_create_llmcall.CreateLLMCallUseCase();
47
45
  return createLLMCall2.execute(props);
48
46
  }
49
47
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,24 +1,21 @@
1
- import "../../chunk-CF3WOMB3.mjs";
2
- import "reflect-metadata";
3
- import { container } from "tsyringe";
4
1
  import { GetLLMUsageByMessageUseCase } from "./use-cases/get-llm-usage-by-message.use-case";
5
2
  import { GetLLMUsageByChatUseCase } from "./use-cases/get-llm-usage-by-chat.use-case";
6
3
  import { GetLLMUsageStatsUseCase } from "./use-cases/get-llm-usage-stats.use-case";
7
4
  import { CreateLLMCallUseCase } from "./use-cases/create-llmcall.use-case";
8
5
  async function getLLMUsageByMessage(props) {
9
- const getLLMUsageByMessageUseCase = container.resolve(GetLLMUsageByMessageUseCase);
6
+ const getLLMUsageByMessageUseCase = new GetLLMUsageByMessageUseCase();
10
7
  return getLLMUsageByMessageUseCase.execute(props);
11
8
  }
12
9
  async function getLLMUsageByChat(props) {
13
- const getLLMUsageByChatUseCase = container.resolve(GetLLMUsageByChatUseCase);
10
+ const getLLMUsageByChatUseCase = new GetLLMUsageByChatUseCase();
14
11
  return getLLMUsageByChatUseCase.execute(props);
15
12
  }
16
13
  async function getLLMUsageStats(props) {
17
- const getLLMUsageStatsUseCase = container.resolve(GetLLMUsageStatsUseCase);
14
+ const getLLMUsageStatsUseCase = new GetLLMUsageStatsUseCase();
18
15
  return getLLMUsageStatsUseCase.execute(props);
19
16
  }
20
17
  async function createLLMCall(props) {
21
- const createLLMCall2 = container.resolve(CreateLLMCallUseCase);
18
+ const createLLMCall2 = new CreateLLMCallUseCase();
22
19
  return createLLMCall2.execute(props);
23
20
  }
24
21
  export {
@@ -16,39 +16,27 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var __decorateClass = (decorators, target, key, kind) => {
20
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
21
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
22
- if (decorator = decorators[i])
23
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
24
- if (kind && result) __defProp(target, key, result);
25
- return result;
26
- };
27
19
  var llmcall_repository_exports = {};
28
20
  __export(llmcall_repository_exports, {
29
21
  LLMCallRepository: () => LLMCallRepository
30
22
  });
31
23
  module.exports = __toCommonJS(llmcall_repository_exports);
32
- var import_tsyringe = require("tsyringe");
24
+ var import_utils = require("../../../common/base/utils/index.js");
33
25
  var import_repositories = require("../../../common/repositories/index.js");
34
26
  var import_database_name = require("../../../common/utils/database-name.js");
35
- let LLMCallRepository = class {
27
+ class LLMCallRepository {
36
28
  _ = new import_repositories.MongoRepository({
37
29
  database: (0, import_database_name.getDatabaseName)(),
38
30
  collection: "llm_calls",
39
31
  scoped: true
40
32
  });
41
33
  async create(llmCall, scope) {
42
- const { _id, ownerId, createdAt, createdBy } = await this._.createOne({ payload: llmCall.toDocument(), scope });
34
+ const { _id, ownerId, createdAt, createdBy } = await this._.createOne({ payload: llmCall.toJSON(), scope });
43
35
  Object.assign(llmCall, { _id, ownerId, createdAt, createdBy });
44
36
  return llmCall;
45
37
  }
46
38
  async update(llmCall, scope) {
47
- return await this._.updateOne({
48
- scope,
49
- where: { _id: llmCall._id },
50
- payload: llmCall.toFlatDocument()
51
- });
39
+ return await this._.patchOne({ scope, where: { _id: llmCall._id }, ...(0, import_utils.entityPatch)(llmCall) });
52
40
  }
53
41
  async findById(id, scope) {
54
42
  return await this._.findOne({ scope, where: { _id: this._.parseId(id) } });
@@ -62,10 +50,7 @@ let LLMCallRepository = class {
62
50
  async findByProps(where, scope, options) {
63
51
  return await this._.findManyPaginated({ scope, where, options });
64
52
  }
65
- };
66
- LLMCallRepository = __decorateClass([
67
- (0, import_tsyringe.autoInjectable)()
68
- ], LLMCallRepository);
53
+ }
69
54
  // Annotate the CommonJS export names for ESM import in node:
70
55
  0 && (module.exports = {
71
56
  LLMCallRepository
@@ -1,26 +1,19 @@
1
- import {
2
- __decorateClass
3
- } from "../../../chunk-CF3WOMB3.mjs";
4
- import { autoInjectable } from "tsyringe";
1
+ import { entityPatch } from "../../../common/base/utils/index.js";
5
2
  import { MongoRepository } from "../../../common/repositories/index.js";
6
3
  import { getDatabaseName } from "../../../common/utils/database-name.js";
7
- let LLMCallRepository = class {
4
+ class LLMCallRepository {
8
5
  _ = new MongoRepository({
9
6
  database: getDatabaseName(),
10
7
  collection: "llm_calls",
11
8
  scoped: true
12
9
  });
13
10
  async create(llmCall, scope) {
14
- const { _id, ownerId, createdAt, createdBy } = await this._.createOne({ payload: llmCall.toDocument(), scope });
11
+ const { _id, ownerId, createdAt, createdBy } = await this._.createOne({ payload: llmCall.toJSON(), scope });
15
12
  Object.assign(llmCall, { _id, ownerId, createdAt, createdBy });
16
13
  return llmCall;
17
14
  }
18
15
  async update(llmCall, scope) {
19
- return await this._.updateOne({
20
- scope,
21
- where: { _id: llmCall._id },
22
- payload: llmCall.toFlatDocument()
23
- });
16
+ return await this._.patchOne({ scope, where: { _id: llmCall._id }, ...entityPatch(llmCall) });
24
17
  }
25
18
  async findById(id, scope) {
26
19
  return await this._.findOne({ scope, where: { _id: this._.parseId(id) } });
@@ -34,10 +27,7 @@ let LLMCallRepository = class {
34
27
  async findByProps(where, scope, options) {
35
28
  return await this._.findManyPaginated({ scope, where, options });
36
29
  }
37
- };
38
- LLMCallRepository = __decorateClass([
39
- autoInjectable()
40
- ], LLMCallRepository);
30
+ }
41
31
  export {
42
32
  LLMCallRepository
43
33
  };
@@ -1,14 +1,12 @@
1
- import { BaseUseCase, BaseUseCaseParams, BaseUseCaseOutput } from '../../../common/base/base.use-case.js';
1
+ import { BaseUseCase, BaseUseCaseParams } from '../../../common/base/base.use-case.js';
2
2
  import { LLMCallProps } from '../entities';
3
3
  import { LLMCallRepository } from '../repositories';
4
4
  export interface Params extends BaseUseCaseParams {
5
5
  payload?: LLMCallProps;
6
6
  }
7
- export interface Output extends BaseUseCaseOutput {
8
- data: LLMCallProps | null;
9
- }
7
+ export type Output = LLMCallProps;
10
8
  export declare class CreateLLMCallUseCase extends BaseUseCase<Params, Output> {
11
- private readonly llmCallRepository?;
12
- constructor(llmCallRepository?: LLMCallRepository | undefined);
9
+ private readonly llmCallRepository;
10
+ constructor(llmCallRepository?: LLMCallRepository);
13
11
  execute(params: Params): Promise<Output>;
14
12
  }
@@ -16,27 +16,17 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var __decorateClass = (decorators, target, key, kind) => {
20
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
21
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
22
- if (decorator = decorators[i])
23
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
24
- if (kind && result) __defProp(target, key, result);
25
- return result;
26
- };
27
- var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
28
19
  var create_llmcall_use_case_exports = {};
29
20
  __export(create_llmcall_use_case_exports, {
30
21
  CreateLLMCallUseCase: () => CreateLLMCallUseCase
31
22
  });
32
23
  module.exports = __toCommonJS(create_llmcall_use_case_exports);
33
- var import_tsyringe = require("tsyringe");
34
24
  var import_base = require("../../../common/base/base.use-case.js");
35
25
  var import_repositories = require("../../../common/repositories/index.js");
36
26
  var import_entities = require("../entities");
37
27
  var import_repositories2 = require("../repositories");
38
- let CreateLLMCallUseCase = class extends import_base.BaseUseCase {
39
- constructor(llmCallRepository) {
28
+ class CreateLLMCallUseCase extends import_base.BaseUseCase {
29
+ constructor(llmCallRepository = new import_repositories2.LLMCallRepository()) {
40
30
  super();
41
31
  this.llmCallRepository = llmCallRepository;
42
32
  }
@@ -44,14 +34,10 @@ let CreateLLMCallUseCase = class extends import_base.BaseUseCase {
44
34
  async execute(params) {
45
35
  const { payload, currentUser } = params;
46
36
  const llmCall = import_entities.LLMCall.fromJSON({ ...payload });
47
- const result = await this.llmCallRepository?.create(llmCall, params.scope ?? import_repositories.Scope.canEdit(currentUser));
48
- return { data: llmCall.toJSON() };
37
+ const result = await this.llmCallRepository.create(llmCall, params.scope ?? import_repositories.Scope.canEdit(currentUser));
38
+ return llmCall.toJSON();
49
39
  }
50
- };
51
- CreateLLMCallUseCase = __decorateClass([
52
- (0, import_tsyringe.autoInjectable)(),
53
- __decorateParam(0, (0, import_tsyringe.inject)(import_repositories2.LLMCallRepository))
54
- ], CreateLLMCallUseCase);
40
+ }
55
41
  // Annotate the CommonJS export names for ESM import in node:
56
42
  0 && (module.exports = {
57
43
  CreateLLMCallUseCase
@@ -1,14 +1,9 @@
1
- import {
2
- __decorateClass,
3
- __decorateParam
4
- } from "../../../chunk-CF3WOMB3.mjs";
5
- import { autoInjectable, inject } from "tsyringe";
6
1
  import { BaseUseCase } from "../../../common/base/base.use-case.js";
7
2
  import { Scope } from "../../../common/repositories/index.js";
8
3
  import { LLMCall } from "../entities";
9
4
  import { LLMCallRepository } from "../repositories";
10
- let CreateLLMCallUseCase = class extends BaseUseCase {
11
- constructor(llmCallRepository) {
5
+ class CreateLLMCallUseCase extends BaseUseCase {
6
+ constructor(llmCallRepository = new LLMCallRepository()) {
12
7
  super();
13
8
  this.llmCallRepository = llmCallRepository;
14
9
  }
@@ -16,14 +11,10 @@ let CreateLLMCallUseCase = class extends BaseUseCase {
16
11
  async execute(params) {
17
12
  const { payload, currentUser } = params;
18
13
  const llmCall = LLMCall.fromJSON({ ...payload });
19
- const result = await this.llmCallRepository?.create(llmCall, params.scope ?? Scope.canEdit(currentUser));
20
- return { data: llmCall.toJSON() };
14
+ const result = await this.llmCallRepository.create(llmCall, params.scope ?? Scope.canEdit(currentUser));
15
+ return llmCall.toJSON();
21
16
  }
22
- };
23
- CreateLLMCallUseCase = __decorateClass([
24
- autoInjectable(),
25
- __decorateParam(0, inject(LLMCallRepository))
26
- ], CreateLLMCallUseCase);
17
+ }
27
18
  export {
28
19
  CreateLLMCallUseCase
29
20
  };
@@ -1,15 +1,15 @@
1
- import { BaseUseCase, BaseUseCaseParams, BaseUseCaseOutput } from '../../../common/base/base.use-case.js';
1
+ import { BaseUseCase, BaseUseCaseParams } from '../../../common/base/base.use-case.js';
2
2
  import { LLMCallProps } from '../entities';
3
3
  import { LLMCallRepository } from '../repositories';
4
4
  export interface Params extends BaseUseCaseParams {
5
5
  id: string;
6
6
  hardDelete?: boolean;
7
7
  }
8
- export interface Output extends BaseUseCaseOutput {
9
- data: LLMCallProps | null | undefined;
10
- }
8
+ export type Output = LLMCallProps | null | {
9
+ deletedCount: number;
10
+ };
11
11
  export declare class DeleteLLMCallUseCase extends BaseUseCase<Params, Output> {
12
- private readonly llmCallRepository?;
13
- constructor(llmCallRepository?: LLMCallRepository | undefined);
12
+ private readonly llmCallRepository;
13
+ constructor(llmCallRepository?: LLMCallRepository);
14
14
  execute(params: Params): Promise<Output>;
15
15
  }
@@ -16,26 +16,16 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var __decorateClass = (decorators, target, key, kind) => {
20
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
21
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
22
- if (decorator = decorators[i])
23
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
24
- if (kind && result) __defProp(target, key, result);
25
- return result;
26
- };
27
- var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
28
19
  var delete_llmcall_use_case_exports = {};
29
20
  __export(delete_llmcall_use_case_exports, {
30
21
  DeleteLLMCallUseCase: () => DeleteLLMCallUseCase
31
22
  });
32
23
  module.exports = __toCommonJS(delete_llmcall_use_case_exports);
33
- var import_tsyringe = require("tsyringe");
34
24
  var import_base = require("../../../common/base/base.use-case.js");
35
25
  var import_repositories = require("../../../common/repositories/index.js");
36
26
  var import_repositories2 = require("../repositories");
37
- let DeleteLLMCallUseCase = class extends import_base.BaseUseCase {
38
- constructor(llmCallRepository) {
27
+ class DeleteLLMCallUseCase extends import_base.BaseUseCase {
28
+ constructor(llmCallRepository = new import_repositories2.LLMCallRepository()) {
39
29
  super();
40
30
  this.llmCallRepository = llmCallRepository;
41
31
  }
@@ -44,18 +34,14 @@ let DeleteLLMCallUseCase = class extends import_base.BaseUseCase {
44
34
  const { id, hardDelete, currentUser } = params;
45
35
  if (!id) throw new Error("Missing id");
46
36
  if (hardDelete) {
47
- const result2 = await this.llmCallRepository?.deleteById(id, params.scope ?? import_repositories.Scope.asAdmin(currentUser));
48
- return { data: { deletedCount: result2 } };
37
+ const result2 = await this.llmCallRepository.deleteById(id, params.scope ?? import_repositories.Scope.asAdmin(currentUser));
38
+ return { deletedCount: result2 };
49
39
  }
50
- const result = await this.llmCallRepository?.softDeleteById(id, params.scope ?? import_repositories.Scope.canManage(currentUser));
51
- if (!result) return this.throwHttpError({ statusCode: 404, errorMessage: "{{resource_not_found}}" });
52
- return { data: result };
40
+ const result = await this.llmCallRepository.softDeleteById(id, params.scope ?? import_repositories.Scope.canManage(currentUser));
41
+ if (!result) this.throwHttpError({ statusCode: 404, errorMessage: "{{resource_not_found}}" });
42
+ return result;
53
43
  }
54
- };
55
- DeleteLLMCallUseCase = __decorateClass([
56
- (0, import_tsyringe.autoInjectable)(),
57
- __decorateParam(0, (0, import_tsyringe.inject)(import_repositories2.LLMCallRepository))
58
- ], DeleteLLMCallUseCase);
44
+ }
59
45
  // Annotate the CommonJS export names for ESM import in node:
60
46
  0 && (module.exports = {
61
47
  DeleteLLMCallUseCase