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.
- package/CHANGELOG.md +33 -0
- package/README.md +1 -1
- package/dist/clients/llm/llm-client.mjs +0 -1
- package/dist/clients/llm/llm-error.mjs +0 -1
- package/dist/clients/llm/llm-types.mjs +0 -1
- package/dist/clients/llm/model-resolution.mjs +0 -1
- package/dist/clients/llm/pi-ai-adapter.mjs +0 -1
- package/dist/clients/llm/sampling-rules.mjs +0 -1
- package/dist/clients/serper/serper-client.mjs +0 -1
- package/dist/clients/slack/slack-client.mjs +0 -1
- package/dist/common/base/base.app.d.ts +3 -3
- package/dist/common/base/base.app.mjs +0 -1
- package/dist/common/base/base.entity.d.ts +4 -16
- package/dist/common/base/base.entity.js +11 -39
- package/dist/common/base/base.entity.mjs +11 -40
- package/dist/common/base/base.use-case.d.ts +1 -7
- package/dist/common/base/base.use-case.mjs +0 -1
- package/dist/common/base/current-session.mjs +0 -1
- package/dist/common/base/current-user.mjs +0 -1
- package/dist/common/base/share.mjs +0 -1
- package/dist/common/base/utils/index.d.ts +1 -2
- package/dist/common/base/utils/index.js +2 -4
- package/dist/common/base/utils/index.mjs +1 -2
- package/dist/common/base/utils/is-plain-object.mjs +0 -1
- package/dist/common/base/utils/to-patch.d.ts +9 -0
- package/dist/common/base/utils/to-patch.js +46 -0
- package/dist/common/base/utils/to-patch.mjs +21 -0
- package/dist/common/constants/harness.mjs +0 -1
- package/dist/common/error/http-error.mjs +0 -1
- package/dist/common/error/reportError.mjs +0 -1
- package/dist/common/error/sentry-client.mjs +0 -1
- package/dist/common/helpers/escape-regex.mjs +0 -1
- package/dist/common/helpers/extract-json-from-text.mjs +0 -1
- package/dist/common/helpers/sanitize-string.mjs +0 -1
- package/dist/common/logger/pino.mjs +0 -1
- package/dist/common/repositories/mongo-db.client.mjs +0 -1
- package/dist/common/repositories/mongo-db.repository.d.ts +15 -4
- package/dist/common/repositories/mongo-db.repository.js +44 -15
- package/dist/common/repositories/mongo-db.repository.mjs +44 -16
- package/dist/common/repositories/scope.mjs +0 -1
- package/dist/common/utils/database-name.mjs +0 -1
- package/dist/common/utils/number-setting.mjs +0 -1
- package/dist/common/utils/secret-manager.mjs +0 -1
- package/dist/db/indexes/agent-actions.mjs +0 -1
- package/dist/db/indexes/agent-tasks.mjs +0 -1
- package/dist/db/indexes/agent-traces.mjs +0 -1
- package/dist/db/indexes/automation-runs.mjs +0 -1
- package/dist/db/indexes/automations.mjs +0 -1
- package/dist/db/indexes/chats.mjs +0 -1
- package/dist/db/indexes/index.js +3 -1
- package/dist/db/indexes/index.mjs +3 -2
- package/dist/db/indexes/llm-calls.mjs +0 -1
- package/dist/db/indexes/mcp-servers.mjs +0 -1
- package/dist/db/indexes/refresh-tokens.d.ts +2 -0
- package/dist/{common/decorators/mask-in-logs/index.js → db/indexes/refresh-tokens.js} +16 -5
- package/dist/db/indexes/refresh-tokens.mjs +9 -0
- package/dist/db/indexes/revoked-tokens.mjs +0 -1
- package/dist/db/indexes/workspace-items.mjs +0 -1
- package/dist/db/migrations/automations.mjs +0 -1
- package/dist/guardrails/guard.mjs +0 -1
- package/dist/guardrails/index.mjs +0 -1
- package/dist/guardrails/input/block-card.mjs +0 -1
- package/dist/guardrails/input/block-code.mjs +0 -1
- package/dist/guardrails/input/block-email.mjs +0 -1
- package/dist/guardrails/input/create-block-input-oversize.mjs +0 -1
- package/dist/guardrails/input/diagnostic-sanity.mjs +0 -1
- package/dist/guardrails/input/input-check.mjs +0 -1
- package/dist/harness/agent-loop.mjs +0 -1
- package/dist/harness/agent-state.mjs +0 -1
- package/dist/harness/agent.d.ts +0 -1
- package/dist/harness/agent.js +14 -14
- package/dist/harness/agent.mjs +14 -15
- package/dist/harness/native-tools.mjs +0 -1
- package/dist/harness/skills/approval-request.mjs +0 -1
- package/dist/harness/skills/autonomous-answer.mjs +0 -1
- package/dist/harness/skills/confirmation-gate.mjs +0 -1
- package/dist/harness/skills/mcp-change-review.mjs +0 -1
- package/dist/harness/tool-catalog.mjs +0 -1
- package/dist/harness/tool-pipeline.mjs +0 -1
- package/dist/harness/utils/activity.mjs +0 -1
- package/dist/harness/utils/describe-shape.mjs +0 -1
- package/dist/harness/utils/grounding.mjs +0 -1
- package/dist/harness/utils/rank-tools-by-keywords.mjs +0 -1
- package/dist/harness/workspace.js +7 -7
- package/dist/harness/workspace.mjs +7 -8
- package/dist/loops/agi/loop.mjs +0 -1
- package/dist/loops/agi/skills/reasoning-engine.mjs +0 -1
- package/dist/loops/shared/skills/fast-responder.mjs +0 -1
- package/dist/services/authentication/entities/index.d.ts +1 -0
- package/dist/services/authentication/entities/index.js +3 -1
- package/dist/services/authentication/entities/index.mjs +1 -0
- package/dist/services/authentication/entities/refresh-token.entity.d.ts +25 -0
- package/dist/services/authentication/entities/refresh-token.entity.js +75 -0
- package/dist/services/authentication/entities/refresh-token.entity.mjs +51 -0
- package/dist/services/authentication/entities/revoked-token.entity.mjs +0 -1
- package/dist/services/authentication/helpers/auth-config.d.ts +9 -0
- package/dist/{common/decorators/index.js → services/authentication/helpers/auth-config.js} +19 -5
- package/dist/services/authentication/helpers/auth-config.mjs +12 -0
- package/dist/services/authentication/helpers/session-tokens.d.ts +16 -0
- package/dist/services/authentication/helpers/session-tokens.js +60 -0
- package/dist/services/authentication/helpers/session-tokens.mjs +35 -0
- package/dist/services/authentication/helpers/tokens.d.ts +43 -0
- package/dist/services/authentication/helpers/tokens.js +113 -0
- package/dist/services/authentication/helpers/tokens.mjs +71 -0
- package/dist/services/authentication/index.d.ts +3 -0
- package/dist/services/authentication/index.js +23 -0
- package/dist/services/authentication/index.mjs +11 -0
- package/dist/services/authentication/module.d.ts +12 -3
- package/dist/services/authentication/module.js +40 -7
- package/dist/services/authentication/module.mjs +34 -7
- package/dist/services/authentication/repositories/index.d.ts +1 -0
- package/dist/services/authentication/repositories/index.js +3 -1
- package/dist/services/authentication/repositories/index.mjs +1 -0
- package/dist/services/authentication/repositories/refresh-token.repository.d.ts +10 -0
- package/dist/services/authentication/repositories/refresh-token.repository.js +60 -0
- package/dist/services/authentication/repositories/refresh-token.repository.mjs +36 -0
- package/dist/services/authentication/repositories/revoked-token.repository.js +3 -15
- package/dist/services/authentication/repositories/revoked-token.repository.mjs +3 -10
- package/dist/services/authentication/use-cases/claim-refresh-token.use-case.d.ts +12 -0
- package/dist/services/authentication/use-cases/claim-refresh-token.use-case.js +40 -0
- package/dist/services/authentication/use-cases/claim-refresh-token.use-case.mjs +16 -0
- package/dist/services/authentication/use-cases/create-refresh-token.use-case.d.ts +11 -0
- package/dist/services/authentication/use-cases/create-refresh-token.use-case.js +43 -0
- package/dist/services/authentication/use-cases/create-refresh-token.use-case.mjs +19 -0
- package/dist/services/authentication/use-cases/find-refresh-token-by-hash.use-case.d.ts +11 -0
- package/dist/services/authentication/use-cases/find-refresh-token-by-hash.use-case.js +40 -0
- package/dist/services/authentication/use-cases/find-refresh-token-by-hash.use-case.mjs +16 -0
- package/dist/services/authentication/use-cases/is-token-revoked.use-case.d.ts +6 -8
- package/dist/services/authentication/use-cases/is-token-revoked.use-case.js +4 -18
- package/dist/services/authentication/use-cases/is-token-revoked.use-case.mjs +4 -13
- package/dist/services/authentication/use-cases/issue-password-reset-token.use-case.d.ts +18 -0
- package/dist/services/authentication/use-cases/issue-password-reset-token.use-case.js +49 -0
- package/dist/services/authentication/use-cases/issue-password-reset-token.use-case.mjs +25 -0
- package/dist/services/authentication/use-cases/issue-session.use-case.d.ts +13 -0
- package/dist/services/authentication/use-cases/issue-session.use-case.js +48 -0
- package/dist/services/authentication/use-cases/issue-session.use-case.mjs +24 -0
- package/dist/services/authentication/use-cases/login.use-case.d.ts +11 -11
- package/dist/services/authentication/use-cases/login.use-case.js +18 -54
- package/dist/services/authentication/use-cases/login.use-case.mjs +17 -38
- package/dist/services/authentication/use-cases/logout.use-case.d.ts +14 -0
- package/dist/services/authentication/use-cases/logout.use-case.js +48 -0
- package/dist/services/authentication/use-cases/logout.use-case.mjs +24 -0
- package/dist/services/authentication/use-cases/refresh.use-case.d.ts +23 -0
- package/dist/services/authentication/use-cases/refresh.use-case.js +84 -0
- package/dist/services/authentication/use-cases/refresh.use-case.mjs +60 -0
- package/dist/services/authentication/use-cases/reset-password.use-case.d.ts +15 -0
- package/dist/services/authentication/use-cases/reset-password.use-case.js +61 -0
- package/dist/services/authentication/use-cases/reset-password.use-case.mjs +37 -0
- package/dist/services/authentication/use-cases/revoke-refresh-token-family.use-case.d.ts +11 -0
- package/dist/services/authentication/use-cases/revoke-refresh-token-family.use-case.js +40 -0
- package/dist/services/authentication/use-cases/revoke-refresh-token-family.use-case.mjs +16 -0
- package/dist/services/authentication/use-cases/revoke-token.use-case.d.ts +4 -6
- package/dist/services/authentication/use-cases/revoke-token.use-case.js +12 -26
- package/dist/services/authentication/use-cases/revoke-token.use-case.mjs +10 -19
- package/dist/services/authentication/use-cases/revoke-user-refresh-tokens.use-case.d.ts +13 -0
- package/dist/services/authentication/use-cases/revoke-user-refresh-tokens.use-case.js +40 -0
- package/dist/services/authentication/use-cases/revoke-user-refresh-tokens.use-case.mjs +16 -0
- package/dist/services/automations/entities/automation-run.entity.mjs +0 -1
- package/dist/services/automations/entities/automation.entity.d.ts +1 -0
- package/dist/services/automations/entities/automation.entity.js +2 -1
- package/dist/services/automations/entities/automation.entity.mjs +2 -2
- package/dist/services/automations/entities/recurrence.mjs +0 -1
- package/dist/services/automations/entities/trigger.mjs +0 -1
- package/dist/services/automations/module.d.ts +0 -1
- package/dist/services/automations/module.js +20 -22
- package/dist/services/automations/module.mjs +20 -23
- package/dist/services/automations/repositories/automation-run.repository.js +7 -22
- package/dist/services/automations/repositories/automation-run.repository.mjs +7 -17
- package/dist/services/automations/repositories/automation.repository.js +25 -39
- package/dist/services/automations/repositories/automation.repository.mjs +25 -34
- package/dist/services/automations/runner/automation-runner.js +8 -9
- package/dist/services/automations/runner/automation-runner.mjs +8 -10
- package/dist/services/automations/use-cases/attach-automation-run-chat.use-case.d.ts +4 -6
- package/dist/services/automations/use-cases/attach-automation-run-chat.use-case.js +5 -19
- package/dist/services/automations/use-cases/attach-automation-run-chat.use-case.mjs +5 -14
- package/dist/services/automations/use-cases/claim-due-automations.use-case.d.ts +9 -11
- package/dist/services/automations/use-cases/claim-due-automations.use-case.js +4 -20
- package/dist/services/automations/use-cases/claim-due-automations.use-case.mjs +4 -15
- package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.d.ts +9 -11
- package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.js +4 -20
- package/dist/services/automations/use-cases/claim-queued-automation-runs.use-case.mjs +4 -15
- package/dist/services/automations/use-cases/create-automation.use-case.d.ts +4 -6
- package/dist/services/automations/use-cases/create-automation.use-case.js +5 -19
- package/dist/services/automations/use-cases/create-automation.use-case.mjs +5 -14
- package/dist/services/automations/use-cases/delete-automation.use-case.d.ts +6 -6
- package/dist/services/automations/use-cases/delete-automation.use-case.js +8 -22
- package/dist/services/automations/use-cases/delete-automation.use-case.mjs +8 -17
- package/dist/services/automations/use-cases/finish-automation-run.use-case.d.ts +5 -7
- package/dist/services/automations/use-cases/finish-automation-run.use-case.js +5 -20
- package/dist/services/automations/use-cases/finish-automation-run.use-case.mjs +5 -15
- package/dist/services/automations/use-cases/get-automation-by-id.use-case.d.ts +4 -6
- package/dist/services/automations/use-cases/get-automation-by-id.use-case.js +5 -19
- package/dist/services/automations/use-cases/get-automation-by-id.use-case.mjs +5 -14
- package/dist/services/automations/use-cases/issue-automation-event-token.use-case.d.ts +7 -9
- package/dist/services/automations/use-cases/issue-automation-event-token.use-case.js +6 -20
- package/dist/services/automations/use-cases/issue-automation-event-token.use-case.mjs +6 -15
- package/dist/services/automations/use-cases/list-automation-runs-by-automation.use-case.d.ts +6 -6
- package/dist/services/automations/use-cases/list-automation-runs-by-automation.use-case.js +5 -19
- package/dist/services/automations/use-cases/list-automation-runs-by-automation.use-case.mjs +5 -14
- package/dist/services/automations/use-cases/list-automation-runs-by-user.use-case.d.ts +6 -6
- package/dist/services/automations/use-cases/list-automation-runs-by-user.use-case.js +5 -19
- package/dist/services/automations/use-cases/list-automation-runs-by-user.use-case.mjs +5 -14
- package/dist/services/automations/use-cases/list-automations-by-user.use-case.d.ts +6 -6
- package/dist/services/automations/use-cases/list-automations-by-user.use-case.js +5 -19
- package/dist/services/automations/use-cases/list-automations-by-user.use-case.mjs +5 -14
- package/dist/services/automations/use-cases/preview-automation-runs.use-case.d.ts +4 -6
- package/dist/services/automations/use-cases/preview-automation-runs.use-case.js +3 -15
- package/dist/services/automations/use-cases/preview-automation-runs.use-case.mjs +3 -10
- package/dist/services/automations/use-cases/receive-automation-event.use-case.d.ts +8 -10
- package/dist/services/automations/use-cases/receive-automation-event.use-case.js +8 -23
- package/dist/services/automations/use-cases/receive-automation-event.use-case.mjs +8 -18
- package/dist/services/automations/use-cases/renew-automation-lease.use-case.d.ts +6 -8
- package/dist/services/automations/use-cases/renew-automation-lease.use-case.js +4 -18
- package/dist/services/automations/use-cases/renew-automation-lease.use-case.mjs +4 -13
- package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.d.ts +6 -8
- package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.js +8 -21
- package/dist/services/automations/use-cases/revoke-automation-event-token.use-case.mjs +9 -17
- package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.d.ts +4 -6
- package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.js +8 -22
- package/dist/services/automations/use-cases/rotate-automation-event-tokens.use-case.mjs +8 -17
- package/dist/services/automations/use-cases/start-automation-run.use-case.d.ts +8 -10
- package/dist/services/automations/use-cases/start-automation-run.use-case.js +5 -20
- package/dist/services/automations/use-cases/start-automation-run.use-case.mjs +5 -15
- package/dist/services/automations/use-cases/sync-automation-run.use-case.d.ts +5 -7
- package/dist/services/automations/use-cases/sync-automation-run.use-case.js +12 -27
- package/dist/services/automations/use-cases/sync-automation-run.use-case.mjs +12 -22
- package/dist/services/automations/use-cases/sync-automation-runs.use-case.d.ts +8 -10
- package/dist/services/automations/use-cases/sync-automation-runs.use-case.js +7 -22
- package/dist/services/automations/use-cases/sync-automation-runs.use-case.mjs +7 -17
- package/dist/services/automations/use-cases/update-automation.use-case.d.ts +4 -6
- package/dist/services/automations/use-cases/update-automation.use-case.js +10 -24
- package/dist/services/automations/use-cases/update-automation.use-case.mjs +10 -19
- package/dist/services/automations/utils/automation-event-error.mjs +0 -1
- package/dist/services/automations/utils/automation-fields.mjs +0 -1
- package/dist/services/automations/utils/event-message.mjs +0 -1
- package/dist/services/automations/utils/event-token.d.ts +1 -2
- package/dist/services/automations/utils/event-token.js +9 -35
- package/dist/services/automations/utils/event-token.mjs +9 -25
- package/dist/services/automations/utils/next-run.mjs +0 -1
- package/dist/services/automations/utils/open-run.mjs +0 -1
- package/dist/services/automations/utils/previous-run.js +1 -1
- package/dist/services/automations/utils/previous-run.mjs +1 -2
- package/dist/services/automations/utils/runner-scope.mjs +0 -1
- package/dist/services/automations/utils/settings.mjs +0 -1
- package/dist/services/chats/entities/chat-message.entity.mjs +0 -1
- package/dist/services/chats/entities/chat-settings.entity.mjs +0 -1
- package/dist/services/chats/entities/chat.entity.d.ts +1 -0
- package/dist/services/chats/entities/chat.entity.js +3 -2
- package/dist/services/chats/entities/chat.entity.mjs +3 -3
- package/dist/services/chats/module.d.ts +0 -1
- package/dist/services/chats/module.js +5 -7
- package/dist/services/chats/module.mjs +5 -8
- package/dist/services/chats/repositories/chat.repository.js +5 -20
- package/dist/services/chats/repositories/chat.repository.mjs +5 -15
- package/dist/services/chats/use-cases/create-chat.use-case.d.ts +4 -6
- package/dist/services/chats/use-cases/create-chat.use-case.js +5 -19
- package/dist/services/chats/use-cases/create-chat.use-case.mjs +5 -14
- package/dist/services/chats/use-cases/delete-chat.use-case.d.ts +6 -6
- package/dist/services/chats/use-cases/delete-chat.use-case.js +8 -22
- package/dist/services/chats/use-cases/delete-chat.use-case.mjs +8 -17
- package/dist/services/chats/use-cases/get-chat-by-id.use-case.d.ts +4 -6
- package/dist/services/chats/use-cases/get-chat-by-id.use-case.js +6 -20
- package/dist/services/chats/use-cases/get-chat-by-id.use-case.mjs +6 -15
- package/dist/services/chats/use-cases/interrupt-execution.use-case.d.ts +4 -6
- package/dist/services/chats/use-cases/interrupt-execution.use-case.js +6 -20
- package/dist/services/chats/use-cases/interrupt-execution.use-case.mjs +6 -15
- package/dist/services/chats/use-cases/list-chats-by-props.use-case.d.ts +6 -6
- package/dist/services/chats/use-cases/list-chats-by-props.use-case.js +5 -19
- package/dist/services/chats/use-cases/list-chats-by-props.use-case.mjs +5 -14
- package/dist/services/chats/use-cases/list-chats-by-user.use-case.d.ts +6 -6
- package/dist/services/chats/use-cases/list-chats-by-user.use-case.js +5 -19
- package/dist/services/chats/use-cases/list-chats-by-user.use-case.mjs +5 -14
- package/dist/services/chats/use-cases/update-chat.use-case.d.ts +5 -6
- package/dist/services/chats/use-cases/update-chat.use-case.js +8 -26
- package/dist/services/chats/use-cases/update-chat.use-case.mjs +8 -21
- package/dist/services/chats/utils/deprecated-activity.mjs +0 -1
- package/dist/services/llmcalls/entities/llmcall.entity.mjs +0 -1
- package/dist/services/llmcalls/module.d.ts +0 -1
- package/dist/services/llmcalls/module.js +4 -6
- package/dist/services/llmcalls/module.mjs +4 -7
- package/dist/services/llmcalls/repositories/llmcall.repository.js +5 -20
- package/dist/services/llmcalls/repositories/llmcall.repository.mjs +5 -15
- package/dist/services/llmcalls/use-cases/create-llmcall.use-case.d.ts +4 -6
- package/dist/services/llmcalls/use-cases/create-llmcall.use-case.js +5 -19
- package/dist/services/llmcalls/use-cases/create-llmcall.use-case.mjs +5 -14
- package/dist/services/llmcalls/use-cases/delete-llmcall.use-case.d.ts +6 -6
- package/dist/services/llmcalls/use-cases/delete-llmcall.use-case.js +8 -22
- package/dist/services/llmcalls/use-cases/delete-llmcall.use-case.mjs +8 -17
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.d.ts +4 -6
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.js +5 -19
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-chat.use-case.mjs +5 -14
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-message.use-case.d.ts +4 -6
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-message.use-case.js +5 -19
- package/dist/services/llmcalls/use-cases/get-llm-usage-by-message.use-case.mjs +5 -14
- package/dist/services/llmcalls/use-cases/get-llm-usage-stats.use-case.d.ts +4 -6
- package/dist/services/llmcalls/use-cases/get-llm-usage-stats.use-case.js +5 -19
- package/dist/services/llmcalls/use-cases/get-llm-usage-stats.use-case.mjs +5 -14
- package/dist/services/llmcalls/use-cases/get-llmcall-by-id.use-case.d.ts +4 -6
- package/dist/services/llmcalls/use-cases/get-llmcall-by-id.use-case.js +6 -20
- package/dist/services/llmcalls/use-cases/get-llmcall-by-id.use-case.mjs +6 -15
- package/dist/services/llmcalls/use-cases/list-llmcalls-by-props.use-case.d.ts +6 -6
- package/dist/services/llmcalls/use-cases/list-llmcalls-by-props.use-case.js +5 -19
- package/dist/services/llmcalls/use-cases/list-llmcalls-by-props.use-case.mjs +5 -14
- package/dist/services/llmcalls/use-cases/update-llmcall.use-case.d.ts +4 -6
- package/dist/services/llmcalls/use-cases/update-llmcall.use-case.js +7 -21
- package/dist/services/llmcalls/use-cases/update-llmcall.use-case.mjs +7 -16
- package/dist/services/llmcalls/utils/usage-periods.mjs +0 -1
- package/dist/services/llmcalls/utils/usage-totals.mjs +0 -1
- package/dist/services/mcp-servers/entities/mcp-manifest.mjs +0 -1
- package/dist/services/mcp-servers/entities/mcpserver.entity.mjs +0 -1
- package/dist/services/mcp-servers/module.d.ts +0 -1
- package/dist/services/mcp-servers/module.js +8 -10
- package/dist/services/mcp-servers/module.mjs +8 -11
- package/dist/services/mcp-servers/repositories/mcpserver.repository.js +5 -21
- package/dist/services/mcp-servers/repositories/mcpserver.repository.mjs +5 -16
- package/dist/services/mcp-servers/use-cases/create-mcpserver.use-case.d.ts +5 -7
- package/dist/services/mcp-servers/use-cases/create-mcpserver.use-case.js +5 -21
- package/dist/services/mcp-servers/use-cases/create-mcpserver.use-case.mjs +5 -16
- package/dist/services/mcp-servers/use-cases/decide-mcpserver-trust.use-case.d.ts +4 -6
- package/dist/services/mcp-servers/use-cases/decide-mcpserver-trust.use-case.js +7 -21
- package/dist/services/mcp-servers/use-cases/decide-mcpserver-trust.use-case.mjs +7 -16
- package/dist/services/mcp-servers/use-cases/delete-mcpserver.use-case.d.ts +6 -6
- package/dist/services/mcp-servers/use-cases/delete-mcpserver.use-case.js +8 -22
- package/dist/services/mcp-servers/use-cases/delete-mcpserver.use-case.mjs +8 -17
- package/dist/services/mcp-servers/use-cases/get-mcpserver-by-id.use-case.d.ts +4 -6
- package/dist/services/mcp-servers/use-cases/get-mcpserver-by-id.use-case.js +5 -19
- package/dist/services/mcp-servers/use-cases/get-mcpserver-by-id.use-case.mjs +5 -14
- package/dist/services/mcp-servers/use-cases/list-all-mcpservers-by-user.use-case.d.ts +6 -6
- package/dist/services/mcp-servers/use-cases/list-all-mcpservers-by-user.use-case.js +5 -19
- package/dist/services/mcp-servers/use-cases/list-all-mcpservers-by-user.use-case.mjs +5 -14
- package/dist/services/mcp-servers/use-cases/list-mcpservers-by-user.use-case.d.ts +6 -6
- package/dist/services/mcp-servers/use-cases/list-mcpservers-by-user.use-case.js +5 -19
- package/dist/services/mcp-servers/use-cases/list-mcpservers-by-user.use-case.mjs +5 -14
- package/dist/services/mcp-servers/use-cases/update-mcpserver.use-case.d.ts +5 -7
- package/dist/services/mcp-servers/use-cases/update-mcpserver.use-case.js +9 -25
- package/dist/services/mcp-servers/use-cases/update-mcpserver.use-case.mjs +9 -20
- package/dist/services/mcp-servers/use-cases/verify-mcpserver-connection.use-case.d.ts +4 -6
- package/dist/services/mcp-servers/use-cases/verify-mcpserver-connection.use-case.js +9 -23
- package/dist/services/mcp-servers/use-cases/verify-mcpserver-connection.use-case.mjs +9 -18
- package/dist/services/tasks/entities/agent-action.entity.mjs +0 -1
- package/dist/services/tasks/entities/agent-task.entity.mjs +0 -1
- package/dist/services/tasks/module.d.ts +0 -1
- package/dist/services/tasks/module.js +7 -9
- package/dist/services/tasks/module.mjs +7 -10
- package/dist/services/tasks/repositories/agent-action.repository.js +5 -21
- package/dist/services/tasks/repositories/agent-action.repository.mjs +5 -16
- package/dist/services/tasks/repositories/agent-task.repository.js +5 -21
- package/dist/services/tasks/repositories/agent-task.repository.mjs +5 -16
- package/dist/services/tasks/use-cases/create-agent-action.use-case.d.ts +4 -6
- package/dist/services/tasks/use-cases/create-agent-action.use-case.js +5 -19
- package/dist/services/tasks/use-cases/create-agent-action.use-case.mjs +5 -14
- package/dist/services/tasks/use-cases/create-agent-task.use-case.d.ts +4 -6
- package/dist/services/tasks/use-cases/create-agent-task.use-case.js +5 -19
- package/dist/services/tasks/use-cases/create-agent-task.use-case.mjs +5 -14
- package/dist/services/tasks/use-cases/get-agent-task-by-id.use-case.d.ts +4 -6
- package/dist/services/tasks/use-cases/get-agent-task-by-id.use-case.js +5 -19
- package/dist/services/tasks/use-cases/get-agent-task-by-id.use-case.mjs +5 -14
- package/dist/services/tasks/use-cases/list-agent-actions-by-task.use-case.d.ts +6 -6
- package/dist/services/tasks/use-cases/list-agent-actions-by-task.use-case.js +5 -19
- package/dist/services/tasks/use-cases/list-agent-actions-by-task.use-case.mjs +5 -14
- package/dist/services/tasks/use-cases/list-agent-tasks-by-chat.use-case.d.ts +6 -6
- package/dist/services/tasks/use-cases/list-agent-tasks-by-chat.use-case.js +5 -19
- package/dist/services/tasks/use-cases/list-agent-tasks-by-chat.use-case.mjs +5 -14
- package/dist/services/tasks/use-cases/update-agent-action.use-case.d.ts +4 -6
- package/dist/services/tasks/use-cases/update-agent-action.use-case.js +6 -20
- package/dist/services/tasks/use-cases/update-agent-action.use-case.mjs +6 -15
- package/dist/services/tasks/use-cases/update-agent-task.use-case.d.ts +4 -6
- package/dist/services/tasks/use-cases/update-agent-task.use-case.js +6 -20
- package/dist/services/tasks/use-cases/update-agent-task.use-case.mjs +6 -15
- package/dist/services/traces/entities/agent-trace-entry.entity.mjs +0 -1
- package/dist/services/traces/module.d.ts +0 -1
- package/dist/services/traces/module.js +2 -4
- package/dist/services/traces/module.mjs +2 -5
- package/dist/services/traces/repositories/agent-trace.repository.js +3 -15
- package/dist/services/traces/repositories/agent-trace.repository.mjs +3 -10
- package/dist/services/traces/use-cases/create-agent-traces.use-case.d.ts +6 -8
- package/dist/services/traces/use-cases/create-agent-traces.use-case.js +5 -19
- package/dist/services/traces/use-cases/create-agent-traces.use-case.mjs +5 -14
- package/dist/services/traces/use-cases/list-agent-traces-by-chat.use-case.d.ts +6 -6
- package/dist/services/traces/use-cases/list-agent-traces-by-chat.use-case.js +5 -19
- package/dist/services/traces/use-cases/list-agent-traces-by-chat.use-case.mjs +5 -14
- package/dist/services/users/entities/user-acquisition.js +2 -2
- package/dist/services/users/entities/user-acquisition.mjs +2 -3
- package/dist/services/users/entities/user-country.js +2 -2
- package/dist/services/users/entities/user-country.mjs +2 -3
- package/dist/services/users/entities/user-currency.js +2 -2
- package/dist/services/users/entities/user-currency.mjs +2 -3
- package/dist/services/users/entities/user-default-model.js +2 -2
- package/dist/services/users/entities/user-default-model.mjs +2 -3
- package/dist/services/users/entities/user-email.value-object.mjs +0 -1
- package/dist/services/users/entities/user-language.js +2 -2
- package/dist/services/users/entities/user-language.mjs +2 -3
- package/dist/services/users/entities/user-marketing.js +2 -2
- package/dist/services/users/entities/user-marketing.mjs +2 -3
- package/dist/services/users/entities/user-notification-preferences.mjs +0 -1
- package/dist/services/users/entities/user-password.value-object.mjs +0 -1
- package/dist/services/users/entities/user-permissions.mjs +0 -1
- package/dist/services/users/entities/user-preferences.mjs +0 -1
- package/dist/services/users/entities/user-report-preferences.mjs +0 -1
- package/dist/services/users/entities/user-report-schedule.mjs +0 -1
- package/dist/services/users/entities/user-timezone.js +2 -2
- package/dist/services/users/entities/user-timezone.mjs +2 -3
- package/dist/services/users/entities/user.entity.d.ts +1 -0
- package/dist/services/users/entities/user.entity.js +9 -22
- package/dist/services/users/entities/user.entity.mjs +9 -17
- package/dist/services/users/module.d.ts +2 -1
- package/dist/services/users/module.js +12 -7
- package/dist/services/users/module.mjs +11 -8
- package/dist/services/users/repositories/user.repository.d.ts +2 -0
- package/dist/services/users/repositories/user.repository.js +11 -20
- package/dist/services/users/repositories/user.repository.mjs +11 -15
- package/dist/services/users/use-cases/change-password.use-case.d.ts +15 -0
- package/dist/services/users/use-cases/change-password.use-case.js +52 -0
- package/dist/services/users/use-cases/change-password.use-case.mjs +28 -0
- package/dist/services/users/use-cases/create-user.use-case.d.ts +4 -6
- package/dist/services/users/use-cases/create-user.use-case.js +5 -19
- package/dist/services/users/use-cases/create-user.use-case.mjs +5 -14
- package/dist/services/users/use-cases/delete-user.use-case.d.ts +6 -6
- package/dist/services/users/use-cases/delete-user.use-case.js +8 -22
- package/dist/services/users/use-cases/delete-user.use-case.mjs +8 -17
- package/dist/services/users/use-cases/get-user-by-id.use-case.d.ts +4 -6
- package/dist/services/users/use-cases/get-user-by-id.use-case.js +6 -20
- package/dist/services/users/use-cases/get-user-by-id.use-case.mjs +6 -15
- package/dist/services/users/use-cases/list-users-by-props.use-case.d.ts +6 -6
- package/dist/services/users/use-cases/list-users-by-props.use-case.js +5 -19
- package/dist/services/users/use-cases/list-users-by-props.use-case.mjs +5 -14
- package/dist/services/users/use-cases/update-user.use-case.d.ts +4 -6
- package/dist/services/users/use-cases/update-user.use-case.js +9 -22
- package/dist/services/users/use-cases/update-user.use-case.mjs +9 -17
- package/dist/services/users/utils/default-model.mjs +0 -1
- package/dist/services/workspaces/entities/workspace-item.entity.mjs +0 -1
- package/dist/services/workspaces/module.d.ts +0 -1
- package/dist/services/workspaces/module.js +5 -7
- package/dist/services/workspaces/module.mjs +5 -8
- package/dist/services/workspaces/repositories/workspace-item.repository.js +5 -20
- package/dist/services/workspaces/repositories/workspace-item.repository.mjs +5 -15
- package/dist/services/workspaces/use-cases/delete-workspace-item.use-case.d.ts +6 -8
- package/dist/services/workspaces/use-cases/delete-workspace-item.use-case.js +7 -21
- package/dist/services/workspaces/use-cases/delete-workspace-item.use-case.mjs +7 -16
- package/dist/services/workspaces/use-cases/get-workspace-item.use-case.d.ts +4 -6
- package/dist/services/workspaces/use-cases/get-workspace-item.use-case.js +6 -20
- package/dist/services/workspaces/use-cases/get-workspace-item.use-case.mjs +6 -15
- package/dist/services/workspaces/use-cases/list-workspace-items.use-case.d.ts +6 -6
- package/dist/services/workspaces/use-cases/list-workspace-items.use-case.js +5 -19
- package/dist/services/workspaces/use-cases/list-workspace-items.use-case.mjs +5 -14
- package/dist/services/workspaces/use-cases/save-workspace-item.use-case.d.ts +4 -6
- package/dist/services/workspaces/use-cases/save-workspace-item.use-case.js +10 -24
- package/dist/services/workspaces/use-cases/save-workspace-item.use-case.mjs +10 -19
- package/dist/services/workspaces/use-cases/search-workspace-items.use-case.d.ts +6 -6
- package/dist/services/workspaces/use-cases/search-workspace-items.use-case.js +5 -19
- package/dist/services/workspaces/use-cases/search-workspace-items.use-case.mjs +5 -14
- package/dist/skills/call-modes.mjs +0 -1
- package/dist/skills/runtime-context.mjs +0 -1
- package/dist/skills/shared/shared-rules.mjs +0 -1
- package/dist/skills/skill.js +1 -2
- package/dist/skills/skill.mjs +1 -3
- package/dist/tools/core/call-ai/call-ai.skill.mjs +0 -1
- package/dist/tools/core/call-ai/call-ai.tool.mjs +0 -1
- package/dist/tools/core/slack/send-slack-message.tool.mjs +0 -1
- package/dist/tools/core/web-search/web-search.tool.mjs +0 -1
- package/dist/tools/tool.mjs +0 -1
- package/docs/authentication.md +95 -16
- package/docs/authorization.md +1 -1
- package/docs/automations.md +6 -5
- package/docs/chats.md +1 -1
- package/docs/configuration.md +1 -1
- package/docs/integration-guide.md +2 -2
- package/docs/mcp-servers.md +1 -1
- package/docs/usage.md +5 -5
- package/docs/users.md +1 -1
- package/examples/authentication/login.ts +1 -1
- package/examples/automations/create-automation.ts +1 -1
- package/examples/automations/create-event-automation.ts +2 -2
- package/examples/automations/list-automation-runs.ts +2 -2
- package/examples/automations/list-automations.ts +1 -1
- package/examples/automations/preview-automation-runs.ts +1 -1
- package/examples/automations/receive-automation-event.ts +1 -1
- package/examples/automations/revoke-automation-event-token.ts +2 -2
- package/examples/automations/update-automation.ts +2 -2
- package/examples/chats/get-chat-by-id.ts +2 -2
- package/examples/chats/list-autonomous-chats.ts +1 -1
- package/examples/chats/list-chats.ts +1 -1
- package/examples/mcps/decide-mcp.ts +3 -3
- package/examples/mcps/list-all-mcps.ts +1 -1
- package/examples/mcps/verify-mcp.ts +1 -1
- package/examples/usage/get-chat-usage.ts +2 -2
- package/examples/usage/get-message-usage.ts +2 -2
- package/examples/usage/get-usage-stats-by-range.ts +1 -1
- package/examples/usage/get-usage-stats.ts +3 -3
- package/examples/users/set-default-model.ts +1 -1
- package/package.json +2 -4
- package/dist/chunk-CF3WOMB3.mjs +0 -16
- package/dist/common/base/utils/delete-empty-fields.d.ts +0 -1
- package/dist/common/base/utils/delete-empty-fields.js +0 -66
- package/dist/common/base/utils/delete-empty-fields.mjs +0 -43
- package/dist/common/base/utils/flatten-object.d.ts +0 -1
- package/dist/common/base/utils/flatten-object.js +0 -45
- package/dist/common/base/utils/flatten-object.mjs +0 -22
- package/dist/common/decorators/index.d.ts +0 -1
- package/dist/common/decorators/index.mjs +0 -1
- package/dist/common/decorators/mask-in-logs/index.d.ts +0 -1
- package/dist/common/decorators/mask-in-logs/index.mjs +0 -1
- package/dist/common/decorators/mask-in-logs/mask-in-logs.d.ts +0 -2
- package/dist/common/decorators/mask-in-logs/mask-in-logs.js +0 -53
- package/dist/common/decorators/mask-in-logs/mask-in-logs.mjs +0 -29
|
@@ -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 sync_automation_runs_use_case_exports = {};
|
|
29
20
|
__export(sync_automation_runs_use_case_exports, {
|
|
30
21
|
SyncAutomationRunsUseCase: () => SyncAutomationRunsUseCase
|
|
31
22
|
});
|
|
32
23
|
module.exports = __toCommonJS(sync_automation_runs_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("../repositories");
|
|
36
26
|
var import_sync_automation_run = require("./sync-automation-run.use-case");
|
|
37
27
|
var import_runner_scope = require("../utils/runner-scope");
|
|
38
28
|
const DEFAULT_LIMIT = 100;
|
|
39
|
-
|
|
40
|
-
constructor(automationRunRepository, syncRun) {
|
|
29
|
+
class SyncAutomationRunsUseCase extends import_base.BaseUseCase {
|
|
30
|
+
constructor(automationRunRepository = new import_repositories.AutomationRunRepository(), syncRun = new import_sync_automation_run.SyncAutomationRunUseCase()) {
|
|
41
31
|
super();
|
|
42
32
|
this.automationRunRepository = automationRunRepository;
|
|
43
33
|
this.syncRun = syncRun;
|
|
@@ -47,22 +37,17 @@ let SyncAutomationRunsUseCase = class extends import_base.BaseUseCase {
|
|
|
47
37
|
async execute(params) {
|
|
48
38
|
const limit = params.limit ?? DEFAULT_LIMIT;
|
|
49
39
|
const open = [
|
|
50
|
-
...await this.automationRunRepository
|
|
51
|
-
...await this.automationRunRepository
|
|
40
|
+
...await this.automationRunRepository.findByStatus("paused", limit, import_runner_scope.runnerScope) ?? [],
|
|
41
|
+
...await this.automationRunRepository.findByStatus("running", limit, import_runner_scope.runnerScope) ?? []
|
|
52
42
|
];
|
|
53
43
|
let settled = 0;
|
|
54
44
|
for (const run of open) {
|
|
55
|
-
const
|
|
45
|
+
const data = await this.syncRun.execute({ runId: String(run._id), now: params.now });
|
|
56
46
|
if (data && data.status !== run.status) settled++;
|
|
57
47
|
}
|
|
58
|
-
return {
|
|
48
|
+
return { checked: open.length, settled };
|
|
59
49
|
}
|
|
60
|
-
}
|
|
61
|
-
SyncAutomationRunsUseCase = __decorateClass([
|
|
62
|
-
(0, import_tsyringe.autoInjectable)(),
|
|
63
|
-
__decorateParam(0, (0, import_tsyringe.inject)(import_repositories.AutomationRunRepository)),
|
|
64
|
-
__decorateParam(1, (0, import_tsyringe.inject)(import_sync_automation_run.SyncAutomationRunUseCase))
|
|
65
|
-
], SyncAutomationRunsUseCase);
|
|
50
|
+
}
|
|
66
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
67
52
|
0 && (module.exports = {
|
|
68
53
|
SyncAutomationRunsUseCase
|
|
@@ -1,15 +1,10 @@
|
|
|
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 { AutomationRunRepository } from "../repositories";
|
|
8
3
|
import { SyncAutomationRunUseCase } from "./sync-automation-run.use-case";
|
|
9
4
|
import { runnerScope } from "../utils/runner-scope";
|
|
10
5
|
const DEFAULT_LIMIT = 100;
|
|
11
|
-
|
|
12
|
-
constructor(automationRunRepository, syncRun) {
|
|
6
|
+
class SyncAutomationRunsUseCase extends BaseUseCase {
|
|
7
|
+
constructor(automationRunRepository = new AutomationRunRepository(), syncRun = new SyncAutomationRunUseCase()) {
|
|
13
8
|
super();
|
|
14
9
|
this.automationRunRepository = automationRunRepository;
|
|
15
10
|
this.syncRun = syncRun;
|
|
@@ -19,22 +14,17 @@ let SyncAutomationRunsUseCase = class extends BaseUseCase {
|
|
|
19
14
|
async execute(params) {
|
|
20
15
|
const limit = params.limit ?? DEFAULT_LIMIT;
|
|
21
16
|
const open = [
|
|
22
|
-
...await this.automationRunRepository
|
|
23
|
-
...await this.automationRunRepository
|
|
17
|
+
...await this.automationRunRepository.findByStatus("paused", limit, runnerScope) ?? [],
|
|
18
|
+
...await this.automationRunRepository.findByStatus("running", limit, runnerScope) ?? []
|
|
24
19
|
];
|
|
25
20
|
let settled = 0;
|
|
26
21
|
for (const run of open) {
|
|
27
|
-
const
|
|
22
|
+
const data = await this.syncRun.execute({ runId: String(run._id), now: params.now });
|
|
28
23
|
if (data && data.status !== run.status) settled++;
|
|
29
24
|
}
|
|
30
|
-
return {
|
|
25
|
+
return { checked: open.length, settled };
|
|
31
26
|
}
|
|
32
|
-
}
|
|
33
|
-
SyncAutomationRunsUseCase = __decorateClass([
|
|
34
|
-
autoInjectable(),
|
|
35
|
-
__decorateParam(0, inject(AutomationRunRepository)),
|
|
36
|
-
__decorateParam(1, inject(SyncAutomationRunUseCase))
|
|
37
|
-
], SyncAutomationRunsUseCase);
|
|
27
|
+
}
|
|
38
28
|
export {
|
|
39
29
|
SyncAutomationRunsUseCase
|
|
40
30
|
};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { BaseUseCase, BaseUseCaseParams
|
|
1
|
+
import { BaseUseCase, BaseUseCaseParams } from '../../../common/base/base.use-case.js';
|
|
2
2
|
import { AutomationPayload, AutomationProps } from '../entities';
|
|
3
3
|
import { AutomationRepository } from '../repositories';
|
|
4
4
|
export interface Params extends BaseUseCaseParams {
|
|
5
5
|
id: string;
|
|
6
6
|
payload?: AutomationPayload;
|
|
7
7
|
}
|
|
8
|
-
export
|
|
9
|
-
data: AutomationProps;
|
|
10
|
-
}
|
|
8
|
+
export type Output = AutomationProps;
|
|
11
9
|
export declare class UpdateAutomationUseCase extends BaseUseCase<Params, Output> {
|
|
12
|
-
private readonly automationRepository
|
|
13
|
-
constructor(automationRepository?: AutomationRepository
|
|
10
|
+
private readonly automationRepository;
|
|
11
|
+
constructor(automationRepository?: AutomationRepository);
|
|
14
12
|
execute(params: Params): Promise<Output>;
|
|
15
13
|
}
|
|
@@ -16,29 +16,19 @@ 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_automation_use_case_exports = {};
|
|
29
20
|
__export(update_automation_use_case_exports, {
|
|
30
21
|
UpdateAutomationUseCase: () => UpdateAutomationUseCase
|
|
31
22
|
});
|
|
32
23
|
module.exports = __toCommonJS(update_automation_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_mongo_db = require("../../../common/repositories/mongo-db.repository.js");
|
|
37
27
|
var import_entities = require("../entities");
|
|
38
28
|
var import_repositories2 = require("../repositories");
|
|
39
29
|
var import_automation_fields = require("../utils/automation-fields");
|
|
40
|
-
|
|
41
|
-
constructor(automationRepository) {
|
|
30
|
+
class UpdateAutomationUseCase extends import_base.BaseUseCase {
|
|
31
|
+
constructor(automationRepository = new import_repositories2.AutomationRepository()) {
|
|
42
32
|
super();
|
|
43
33
|
this.automationRepository = automationRepository;
|
|
44
34
|
}
|
|
@@ -47,8 +37,8 @@ let UpdateAutomationUseCase = class extends import_base.BaseUseCase {
|
|
|
47
37
|
const { id, payload, currentUser } = params;
|
|
48
38
|
if (!payload || Object.keys(payload).length === 0) throw new Error("Payload is required for updating an automation");
|
|
49
39
|
const scope = params.scope ?? import_repositories.Scope.canEdit(currentUser);
|
|
50
|
-
const existing = await this.automationRepository
|
|
51
|
-
if (!existing)
|
|
40
|
+
const existing = await this.automationRepository.findById(id, scope);
|
|
41
|
+
if (!existing) this.throwHttpError({ statusCode: 404, errorMessage: "{{resource_not_found}}" });
|
|
52
42
|
if (payload.__v !== void 0 && payload.__v !== existing.__v) throw new import_mongo_db.VersionConflictError();
|
|
53
43
|
const changes = (0, import_automation_fields.readAutomationFields)(payload, { complete: false, triggers: existing.triggers });
|
|
54
44
|
const { modelProvider, modelName, ...rest } = changes;
|
|
@@ -62,9 +52,9 @@ let UpdateAutomationUseCase = class extends import_base.BaseUseCase {
|
|
|
62
52
|
modelName: name ?? void 0,
|
|
63
53
|
_id: id
|
|
64
54
|
});
|
|
65
|
-
if (!provider) automation.
|
|
55
|
+
if (!provider) Object.assign(automation.clearedFields, { modelProvider: "", modelName: "" });
|
|
66
56
|
const removed = ["schedule", "event"].filter((key) => existing.triggers?.[key] && !automation.triggers?.[key]);
|
|
67
|
-
if (removed.length) automation.
|
|
57
|
+
if (removed.length) Object.assign(automation.clearedFields, Object.fromEntries(removed.map((key) => [`triggers.${key}`, ""])));
|
|
68
58
|
if (removed.includes("event")) automation.eventTokenVersion = existing.eventTokenVersion + 1;
|
|
69
59
|
const schedule = automation.triggers?.schedule;
|
|
70
60
|
const scheduleChanged = payload.triggers?.schedule !== void 0;
|
|
@@ -72,15 +62,11 @@ let UpdateAutomationUseCase = class extends import_base.BaseUseCase {
|
|
|
72
62
|
automation.scheduleNextRun();
|
|
73
63
|
if (schedule.enabled && !schedule.nextRunAt) throw new Error("The date of the recurrence has already passed");
|
|
74
64
|
}
|
|
75
|
-
const result = await this.automationRepository
|
|
76
|
-
if (!result)
|
|
77
|
-
return
|
|
65
|
+
const result = await this.automationRepository.update(automation, scope, { expectedVersion: existing.__v });
|
|
66
|
+
if (!result) this.throwHttpError({ statusCode: 404, errorMessage: "{{resource_not_found}}" });
|
|
67
|
+
return result;
|
|
78
68
|
}
|
|
79
|
-
}
|
|
80
|
-
UpdateAutomationUseCase = __decorateClass([
|
|
81
|
-
(0, import_tsyringe.autoInjectable)(),
|
|
82
|
-
__decorateParam(0, (0, import_tsyringe.inject)(import_repositories2.AutomationRepository))
|
|
83
|
-
], UpdateAutomationUseCase);
|
|
69
|
+
}
|
|
84
70
|
// Annotate the CommonJS export names for ESM import in node:
|
|
85
71
|
0 && (module.exports = {
|
|
86
72
|
UpdateAutomationUseCase
|
|
@@ -1,16 +1,11 @@
|
|
|
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 { VersionConflictError } from "../../../common/repositories/mongo-db.repository.js";
|
|
9
4
|
import { Automation } from "../entities";
|
|
10
5
|
import { AutomationRepository } from "../repositories";
|
|
11
6
|
import { readAutomationFields, assertModel } from "../utils/automation-fields";
|
|
12
|
-
|
|
13
|
-
constructor(automationRepository) {
|
|
7
|
+
class UpdateAutomationUseCase extends BaseUseCase {
|
|
8
|
+
constructor(automationRepository = new AutomationRepository()) {
|
|
14
9
|
super();
|
|
15
10
|
this.automationRepository = automationRepository;
|
|
16
11
|
}
|
|
@@ -19,8 +14,8 @@ let UpdateAutomationUseCase = class extends BaseUseCase {
|
|
|
19
14
|
const { id, payload, currentUser } = params;
|
|
20
15
|
if (!payload || Object.keys(payload).length === 0) throw new Error("Payload is required for updating an automation");
|
|
21
16
|
const scope = params.scope ?? Scope.canEdit(currentUser);
|
|
22
|
-
const existing = await this.automationRepository
|
|
23
|
-
if (!existing)
|
|
17
|
+
const existing = await this.automationRepository.findById(id, scope);
|
|
18
|
+
if (!existing) this.throwHttpError({ statusCode: 404, errorMessage: "{{resource_not_found}}" });
|
|
24
19
|
if (payload.__v !== void 0 && payload.__v !== existing.__v) throw new VersionConflictError();
|
|
25
20
|
const changes = readAutomationFields(payload, { complete: false, triggers: existing.triggers });
|
|
26
21
|
const { modelProvider, modelName, ...rest } = changes;
|
|
@@ -34,9 +29,9 @@ let UpdateAutomationUseCase = class extends BaseUseCase {
|
|
|
34
29
|
modelName: name ?? void 0,
|
|
35
30
|
_id: id
|
|
36
31
|
});
|
|
37
|
-
if (!provider) automation.
|
|
32
|
+
if (!provider) Object.assign(automation.clearedFields, { modelProvider: "", modelName: "" });
|
|
38
33
|
const removed = ["schedule", "event"].filter((key) => existing.triggers?.[key] && !automation.triggers?.[key]);
|
|
39
|
-
if (removed.length) automation.
|
|
34
|
+
if (removed.length) Object.assign(automation.clearedFields, Object.fromEntries(removed.map((key) => [`triggers.${key}`, ""])));
|
|
40
35
|
if (removed.includes("event")) automation.eventTokenVersion = existing.eventTokenVersion + 1;
|
|
41
36
|
const schedule = automation.triggers?.schedule;
|
|
42
37
|
const scheduleChanged = payload.triggers?.schedule !== void 0;
|
|
@@ -44,15 +39,11 @@ let UpdateAutomationUseCase = class extends BaseUseCase {
|
|
|
44
39
|
automation.scheduleNextRun();
|
|
45
40
|
if (schedule.enabled && !schedule.nextRunAt) throw new Error("The date of the recurrence has already passed");
|
|
46
41
|
}
|
|
47
|
-
const result = await this.automationRepository
|
|
48
|
-
if (!result)
|
|
49
|
-
return
|
|
42
|
+
const result = await this.automationRepository.update(automation, scope, { expectedVersion: existing.__v });
|
|
43
|
+
if (!result) this.throwHttpError({ statusCode: 404, errorMessage: "{{resource_not_found}}" });
|
|
44
|
+
return result;
|
|
50
45
|
}
|
|
51
|
-
}
|
|
52
|
-
UpdateAutomationUseCase = __decorateClass([
|
|
53
|
-
autoInjectable(),
|
|
54
|
-
__decorateParam(0, inject(AutomationRepository))
|
|
55
|
-
], UpdateAutomationUseCase);
|
|
46
|
+
}
|
|
56
47
|
export {
|
|
57
48
|
UpdateAutomationUseCase
|
|
58
49
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,62 +15,38 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var event_token_exports = {};
|
|
30
20
|
__export(event_token_exports, {
|
|
31
|
-
EVENT_TOKEN_AUDIENCE: () => EVENT_TOKEN_AUDIENCE,
|
|
32
21
|
readEventToken: () => readEventToken,
|
|
33
22
|
signEventToken: () => signEventToken
|
|
34
23
|
});
|
|
35
24
|
module.exports = __toCommonJS(event_token_exports);
|
|
36
25
|
var import_node_crypto = require("node:crypto");
|
|
37
|
-
var
|
|
38
|
-
var import_secret_manager = require("../../../common/utils/secret-manager.js");
|
|
26
|
+
var import_tokens = require("../../authentication/helpers/tokens.js");
|
|
39
27
|
var import_automation_event_error = require("./automation-event-error");
|
|
40
|
-
const EVENT_TOKEN_AUDIENCE = "automation-event";
|
|
41
|
-
const DURATION = /^[1-9]\d*[smhdw]$/;
|
|
42
|
-
const secret = () => {
|
|
43
|
-
const value = import_secret_manager.secretManager.get("JWT_SECRET");
|
|
44
|
-
if (!value) throw new Error("{{jwt_secret_not_found}}");
|
|
45
|
-
return value;
|
|
46
|
-
};
|
|
47
28
|
function signEventToken(params) {
|
|
48
29
|
const { automationId, tokenVersion, expiresIn } = params;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
algorithm: "HS256",
|
|
52
|
-
audience: EVENT_TOKEN_AUDIENCE,
|
|
30
|
+
return (0, import_tokens.signToken)({
|
|
31
|
+
audience: import_tokens.AUTOMATION_EVENT_AUDIENCE,
|
|
53
32
|
subject: automationId,
|
|
54
|
-
|
|
33
|
+
jti: (0, import_node_crypto.randomUUID)(),
|
|
34
|
+
claims: { v: tokenVersion },
|
|
55
35
|
...expiresIn ? { expiresIn } : {}
|
|
56
36
|
});
|
|
57
|
-
const { exp } = import_jsonwebtoken.default.decode(token);
|
|
58
|
-
return { token, expiresAt: exp ? new Date(exp * 1e3) : void 0 };
|
|
59
37
|
}
|
|
60
38
|
function readEventToken(token, options = {}) {
|
|
61
|
-
if (typeof token !== "string" || !token) throw new import_automation_event_error.AutomationEventError("invalid");
|
|
62
39
|
try {
|
|
63
|
-
const claims =
|
|
64
|
-
if (typeof claims.jti !== "string" || typeof claims.
|
|
65
|
-
return { jti: claims.jti, sub: claims.sub, v: claims.v,
|
|
40
|
+
const claims = (0, import_tokens.verifyToken)(token, import_tokens.AUTOMATION_EVENT_AUDIENCE, options);
|
|
41
|
+
if (typeof claims.jti !== "string" || typeof claims.v !== "number") throw new import_tokens.TokenError("invalid");
|
|
42
|
+
return { jti: claims.jti, sub: claims.sub, v: claims.v, expiresAt: claims.expiresAt };
|
|
66
43
|
} catch (error) {
|
|
67
|
-
if (error instanceof
|
|
68
|
-
if (error?.name === "TokenExpiredError") throw new import_automation_event_error.AutomationEventError("expired");
|
|
69
|
-
if (error?.name === "JsonWebTokenError" || error?.name === "NotBeforeError") throw new import_automation_event_error.AutomationEventError("invalid");
|
|
44
|
+
if (error instanceof import_tokens.TokenError) throw new import_automation_event_error.AutomationEventError(error.reason);
|
|
70
45
|
throw error;
|
|
71
46
|
}
|
|
72
47
|
}
|
|
73
48
|
// Annotate the CommonJS export names for ESM import in node:
|
|
74
49
|
0 && (module.exports = {
|
|
75
|
-
EVENT_TOKEN_AUDIENCE,
|
|
76
50
|
readEventToken,
|
|
77
51
|
signEventToken
|
|
78
52
|
});
|
|
@@ -1,43 +1,27 @@
|
|
|
1
|
-
import "../../../chunk-CF3WOMB3.mjs";
|
|
2
1
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
import
|
|
4
|
-
import { secretManager } from "../../../common/utils/secret-manager.js";
|
|
2
|
+
import { AUTOMATION_EVENT_AUDIENCE, TokenError, signToken, verifyToken } from "../../authentication/helpers/tokens.js";
|
|
5
3
|
import { AutomationEventError } from "./automation-event-error";
|
|
6
|
-
const EVENT_TOKEN_AUDIENCE = "automation-event";
|
|
7
|
-
const DURATION = /^[1-9]\d*[smhdw]$/;
|
|
8
|
-
const secret = () => {
|
|
9
|
-
const value = secretManager.get("JWT_SECRET");
|
|
10
|
-
if (!value) throw new Error("{{jwt_secret_not_found}}");
|
|
11
|
-
return value;
|
|
12
|
-
};
|
|
13
4
|
function signEventToken(params) {
|
|
14
5
|
const { automationId, tokenVersion, expiresIn } = params;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
algorithm: "HS256",
|
|
18
|
-
audience: EVENT_TOKEN_AUDIENCE,
|
|
6
|
+
return signToken({
|
|
7
|
+
audience: AUTOMATION_EVENT_AUDIENCE,
|
|
19
8
|
subject: automationId,
|
|
20
|
-
|
|
9
|
+
jti: randomUUID(),
|
|
10
|
+
claims: { v: tokenVersion },
|
|
21
11
|
...expiresIn ? { expiresIn } : {}
|
|
22
12
|
});
|
|
23
|
-
const { exp } = jwt.decode(token);
|
|
24
|
-
return { token, expiresAt: exp ? new Date(exp * 1e3) : void 0 };
|
|
25
13
|
}
|
|
26
14
|
function readEventToken(token, options = {}) {
|
|
27
|
-
if (typeof token !== "string" || !token) throw new AutomationEventError("invalid");
|
|
28
15
|
try {
|
|
29
|
-
const claims =
|
|
30
|
-
if (typeof claims.jti !== "string" || typeof claims.
|
|
31
|
-
return { jti: claims.jti, sub: claims.sub, v: claims.v,
|
|
16
|
+
const claims = verifyToken(token, AUTOMATION_EVENT_AUDIENCE, options);
|
|
17
|
+
if (typeof claims.jti !== "string" || typeof claims.v !== "number") throw new TokenError("invalid");
|
|
18
|
+
return { jti: claims.jti, sub: claims.sub, v: claims.v, expiresAt: claims.expiresAt };
|
|
32
19
|
} catch (error) {
|
|
33
|
-
if (error instanceof
|
|
34
|
-
if (error?.name === "TokenExpiredError") throw new AutomationEventError("expired");
|
|
35
|
-
if (error?.name === "JsonWebTokenError" || error?.name === "NotBeforeError") throw new AutomationEventError("invalid");
|
|
20
|
+
if (error instanceof TokenError) throw new AutomationEventError(error.reason);
|
|
36
21
|
throw error;
|
|
37
22
|
}
|
|
38
23
|
}
|
|
39
24
|
export {
|
|
40
|
-
EVENT_TOKEN_AUDIENCE,
|
|
41
25
|
readEventToken,
|
|
42
26
|
signEventToken
|
|
43
27
|
};
|
|
@@ -34,7 +34,7 @@ async function findPausedRun(runs, syncRun, automation, now) {
|
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
36
|
if (previous.status !== "paused") return null;
|
|
37
|
-
const
|
|
37
|
+
const data = await syncRun.execute({ runId: String(previous._id), now });
|
|
38
38
|
return data?.status === "paused" ? data : null;
|
|
39
39
|
}
|
|
40
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "../../../chunk-CF3WOMB3.mjs";
|
|
2
1
|
import { AutomationRun } from "../entities";
|
|
3
2
|
import { LOST_WORKER_MESSAGE } from "../use-cases/sync-automation-run.use-case";
|
|
4
3
|
import { runnerScope } from "./runner-scope";
|
|
@@ -12,7 +11,7 @@ async function findPausedRun(runs, syncRun, automation, now) {
|
|
|
12
11
|
return null;
|
|
13
12
|
}
|
|
14
13
|
if (previous.status !== "paused") return null;
|
|
15
|
-
const
|
|
14
|
+
const data = await syncRun.execute({ runId: String(previous._id), now });
|
|
16
15
|
return data?.status === "paused" ? data : null;
|
|
17
16
|
}
|
|
18
17
|
export {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "../../../chunk-CF3WOMB3.mjs";
|
|
2
1
|
import { Scope } from "../../../common/repositories/index.js";
|
|
3
2
|
const runnerScope = Scope.system("automations runner: the locks and the runs of the automations of all the users");
|
|
4
3
|
const eventScope = Scope.system("automation event: the token authorizes the request, there is no user");
|
|
@@ -25,6 +25,7 @@ export declare class Chat extends BaseEntity {
|
|
|
25
25
|
static withDefaults(loopName?: string): Chat;
|
|
26
26
|
static fromJSON(props: ChatProps): Chat;
|
|
27
27
|
tasks: AgentTask[];
|
|
28
|
+
clearedFields: Record<string, ''>;
|
|
28
29
|
private pendingTraces;
|
|
29
30
|
constructor(props: ChatProps, state?: AgentState | undefined, settings?: ChatSettings | undefined, messages?: ChatMessage[] | undefined);
|
|
30
31
|
get lastAnswer(): string | undefined;
|
|
@@ -55,6 +55,7 @@ class Chat extends import_base.BaseEntity {
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
tasks = [];
|
|
58
|
+
clearedFields = {};
|
|
58
59
|
pendingTraces = [];
|
|
59
60
|
get lastAnswer() {
|
|
60
61
|
return this.messages?.slice().reverse().find((message) => message.role === "assistant" && !message.excludeFromContext)?.content;
|
|
@@ -136,14 +137,14 @@ class Chat extends import_base.BaseEntity {
|
|
|
136
137
|
clearActiveTaskIdIfMatches(task) {
|
|
137
138
|
if (task?.id === this.state?.activeTaskId) {
|
|
138
139
|
this.state?.setActiveTaskId(void 0);
|
|
139
|
-
this.
|
|
140
|
+
this.clearedFields["state.activeTaskId"] = "";
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
switchLoop(loopName) {
|
|
143
144
|
if (this.settings?.loopName && this.settings.loopName !== loopName) {
|
|
144
145
|
this.activeTask?.pause();
|
|
145
146
|
this.state?.setActiveTaskId(void 0);
|
|
146
|
-
this.
|
|
147
|
+
this.clearedFields["state.activeTaskId"] = "";
|
|
147
148
|
}
|
|
148
149
|
this.settings?.setLoopName(loopName);
|
|
149
150
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "../../../chunk-CF3WOMB3.mjs";
|
|
2
1
|
import { BaseEntity } from "../../../common/base/base.entity.js";
|
|
3
2
|
import { AgentState } from "../../../harness/agent-state.js";
|
|
4
3
|
import { AgentTask, TaskStatus } from "../../tasks/entities/agent-task.entity.js";
|
|
@@ -33,6 +32,7 @@ class Chat extends BaseEntity {
|
|
|
33
32
|
);
|
|
34
33
|
}
|
|
35
34
|
tasks = [];
|
|
35
|
+
clearedFields = {};
|
|
36
36
|
pendingTraces = [];
|
|
37
37
|
get lastAnswer() {
|
|
38
38
|
return this.messages?.slice().reverse().find((message) => message.role === "assistant" && !message.excludeFromContext)?.content;
|
|
@@ -114,14 +114,14 @@ class Chat extends BaseEntity {
|
|
|
114
114
|
clearActiveTaskIdIfMatches(task) {
|
|
115
115
|
if (task?.id === this.state?.activeTaskId) {
|
|
116
116
|
this.state?.setActiveTaskId(void 0);
|
|
117
|
-
this.
|
|
117
|
+
this.clearedFields["state.activeTaskId"] = "";
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
switchLoop(loopName) {
|
|
121
121
|
if (this.settings?.loopName && this.settings.loopName !== loopName) {
|
|
122
122
|
this.activeTask?.pause();
|
|
123
123
|
this.state?.setActiveTaskId(void 0);
|
|
124
|
-
this.
|
|
124
|
+
this.clearedFields["state.activeTaskId"] = "";
|
|
125
125
|
}
|
|
126
126
|
this.settings?.setLoopName(loopName);
|
|
127
127
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
1
|
import { Params as CParams, Output as COutput } from './use-cases/create-chat.use-case';
|
|
3
2
|
import { Params as UParams, Output as UOutput } from './use-cases/update-chat.use-case';
|
|
4
3
|
import { Params as GParams, Output as GOutput } from './use-cases/get-chat-by-id.use-case';
|
|
@@ -25,31 +25,29 @@ __export(module_exports, {
|
|
|
25
25
|
updateChat: () => updateChat
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(module_exports);
|
|
28
|
-
var import_reflect_metadata = require("reflect-metadata");
|
|
29
|
-
var import_tsyringe = require("tsyringe");
|
|
30
28
|
var import_create_chat = require("./use-cases/create-chat.use-case");
|
|
31
29
|
var import_update_chat = require("./use-cases/update-chat.use-case");
|
|
32
30
|
var import_get_chat_by_id = require("./use-cases/get-chat-by-id.use-case");
|
|
33
31
|
var import_list_chats_by_user = require("./use-cases/list-chats-by-user.use-case");
|
|
34
32
|
var import_delete_chat = require("./use-cases/delete-chat.use-case");
|
|
35
33
|
async function createChat(props) {
|
|
36
|
-
const createChatUseCase =
|
|
34
|
+
const createChatUseCase = new import_create_chat.CreateChatUseCase();
|
|
37
35
|
return createChatUseCase.execute(props);
|
|
38
36
|
}
|
|
39
37
|
async function updateChat(props) {
|
|
40
|
-
const updateChatUseCase =
|
|
38
|
+
const updateChatUseCase = new import_update_chat.UpdateChatUseCase();
|
|
41
39
|
return updateChatUseCase.execute(props);
|
|
42
40
|
}
|
|
43
41
|
async function getChatById(props) {
|
|
44
|
-
const getChatByIdUseCase =
|
|
42
|
+
const getChatByIdUseCase = new import_get_chat_by_id.GetChatByIdUseCase();
|
|
45
43
|
return getChatByIdUseCase.execute(props);
|
|
46
44
|
}
|
|
47
45
|
async function listChatsByUser(props) {
|
|
48
|
-
const listChatsByUserUseCase =
|
|
46
|
+
const listChatsByUserUseCase = new import_list_chats_by_user.ListChatsByUserUseCase();
|
|
49
47
|
return listChatsByUserUseCase.execute(props);
|
|
50
48
|
}
|
|
51
49
|
async function deleteChat(props) {
|
|
52
|
-
const deleteChatUseCase =
|
|
50
|
+
const deleteChatUseCase = new import_delete_chat.DeleteChatUseCase();
|
|
53
51
|
return deleteChatUseCase.execute(props);
|
|
54
52
|
}
|
|
55
53
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import "../../chunk-CF3WOMB3.mjs";
|
|
2
|
-
import "reflect-metadata";
|
|
3
|
-
import { container } from "tsyringe";
|
|
4
1
|
import { CreateChatUseCase } from "./use-cases/create-chat.use-case";
|
|
5
2
|
import { UpdateChatUseCase } from "./use-cases/update-chat.use-case";
|
|
6
3
|
import { GetChatByIdUseCase } from "./use-cases/get-chat-by-id.use-case";
|
|
7
4
|
import { ListChatsByUserUseCase } from "./use-cases/list-chats-by-user.use-case";
|
|
8
5
|
import { DeleteChatUseCase } from "./use-cases/delete-chat.use-case";
|
|
9
6
|
async function createChat(props) {
|
|
10
|
-
const createChatUseCase =
|
|
7
|
+
const createChatUseCase = new CreateChatUseCase();
|
|
11
8
|
return createChatUseCase.execute(props);
|
|
12
9
|
}
|
|
13
10
|
async function updateChat(props) {
|
|
14
|
-
const updateChatUseCase =
|
|
11
|
+
const updateChatUseCase = new UpdateChatUseCase();
|
|
15
12
|
return updateChatUseCase.execute(props);
|
|
16
13
|
}
|
|
17
14
|
async function getChatById(props) {
|
|
18
|
-
const getChatByIdUseCase =
|
|
15
|
+
const getChatByIdUseCase = new GetChatByIdUseCase();
|
|
19
16
|
return getChatByIdUseCase.execute(props);
|
|
20
17
|
}
|
|
21
18
|
async function listChatsByUser(props) {
|
|
22
|
-
const listChatsByUserUseCase =
|
|
19
|
+
const listChatsByUserUseCase = new ListChatsByUserUseCase();
|
|
23
20
|
return listChatsByUserUseCase.execute(props);
|
|
24
21
|
}
|
|
25
22
|
async function deleteChat(props) {
|
|
26
|
-
const deleteChatUseCase =
|
|
23
|
+
const deleteChatUseCase = new DeleteChatUseCase();
|
|
27
24
|
return deleteChatUseCase.execute(props);
|
|
28
25
|
}
|
|
29
26
|
export {
|