@bpinhosilva/agent-orchestrator 1.0.0-alpha.22 → 1.0.0-alpha.24
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 +16 -0
- package/README.md +204 -28
- package/dist/agents/agents.controller.js +5 -0
- package/dist/agents/dto/agent-request.dto.js +2 -1
- package/dist/agents/dto/create-agent.dto.js +6 -1
- package/dist/app.module.js +5 -0
- package/dist/auth/auth.controller.d.ts +6 -1
- package/dist/auth/auth.controller.js +23 -7
- package/dist/auth/auth.service.d.ts +1 -0
- package/dist/auth/decorators/current-user.decorator.d.ts +1 -0
- package/dist/auth/decorators/current-user.decorator.js +9 -0
- package/dist/auth/decorators/roles.decorator.d.ts +3 -0
- package/dist/auth/decorators/roles.decorator.js +8 -0
- package/dist/auth/entities/refresh-token.entity.js +2 -1
- package/dist/auth/guards/roles.guard.d.ts +7 -0
- package/dist/auth/guards/roles.guard.js +52 -0
- package/dist/common/storage.service.d.ts +2 -0
- package/dist/common/storage.service.js +27 -0
- package/dist/config/env.validation.js +2 -0
- package/dist/config/typeorm.js +1 -1
- package/dist/main.js +16 -13
- package/dist/migrations/1775103764402-AddRbacAndProjectMembership.d.ts +6 -0
- package/dist/migrations/1775103764402-AddRbacAndProjectMembership.js +124 -0
- package/dist/models/models.controller.js +5 -0
- package/dist/projects/dto/add-member.dto.d.ts +5 -0
- package/dist/projects/dto/add-member.dto.js +33 -0
- package/dist/projects/entities/project-member.entity.d.ts +13 -0
- package/dist/projects/entities/project-member.entity.js +61 -0
- package/dist/projects/entities/project.entity.d.ts +2 -0
- package/dist/projects/entities/project.entity.js +9 -2
- package/dist/projects/projects.controller.d.ts +10 -5
- package/dist/projects/projects.controller.js +64 -15
- package/dist/projects/projects.module.js +5 -1
- package/dist/projects/projects.service.d.ts +14 -6
- package/dist/projects/projects.service.js +125 -12
- package/dist/providers/providers.controller.js +5 -0
- package/dist/tasks/entities/recurrent-task-exec.entity.js +1 -0
- package/dist/tasks/entities/recurrent-task.entity.d.ts +2 -0
- package/dist/tasks/entities/recurrent-task.entity.js +14 -2
- package/dist/tasks/recurrent-tasks.controller.d.ts +9 -6
- package/dist/tasks/recurrent-tasks.controller.js +51 -30
- package/dist/tasks/recurrent-tasks.service.d.ts +5 -5
- package/dist/tasks/recurrent-tasks.service.js +24 -11
- package/dist/tasks/task-scheduler.service.d.ts +4 -1
- package/dist/tasks/task-scheduler.service.js +15 -2
- package/dist/tasks/tasks.controller.d.ts +11 -8
- package/dist/tasks/tasks.controller.js +43 -23
- package/dist/users/entities/user.entity.d.ts +5 -0
- package/dist/users/entities/user.entity.js +10 -1
- package/dist/users/users.controller.d.ts +0 -2
- package/dist/users/users.controller.js +3 -12
- package/dist/users/users.service.js +9 -1
- package/package.json +6 -2
- package/dist/agents/agents.controller.js.map +0 -1
- package/dist/agents/agents.module.js.map +0 -1
- package/dist/agents/agents.service.js.map +0 -1
- package/dist/agents/dto/agent-request.dto.js.map +0 -1
- package/dist/agents/dto/create-agent.dto.js.map +0 -1
- package/dist/agents/dto/update-agent.dto.js.map +0 -1
- package/dist/agents/entities/agent.entity.js.map +0 -1
- package/dist/agents/enums/provider.enum.js.map +0 -1
- package/dist/agents/implementations/claude.agent.js.map +0 -1
- package/dist/agents/implementations/gemini.agent.js.map +0 -1
- package/dist/agents/interfaces/agent.interface.js.map +0 -1
- package/dist/agents/registry/agent.registry.js.map +0 -1
- package/dist/app.controller.js.map +0 -1
- package/dist/app.module.js.map +0 -1
- package/dist/app.service.js.map +0 -1
- package/dist/auth/auth.controller.js.map +0 -1
- package/dist/auth/auth.module.js.map +0 -1
- package/dist/auth/auth.service.js.map +0 -1
- package/dist/auth/decorators/public.decorator.js.map +0 -1
- package/dist/auth/dto/login.dto.js.map +0 -1
- package/dist/auth/dto/register.dto.js.map +0 -1
- package/dist/auth/entities/refresh-token.entity.js.map +0 -1
- package/dist/auth/guards/jwt-auth.guard.js.map +0 -1
- package/dist/auth/strategies/jwt.strategy.js.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/common/common.module.js.map +0 -1
- package/dist/common/entities/artifact.entity.js.map +0 -1
- package/dist/common/filters/http-exception.filter.js.map +0 -1
- package/dist/common/storage.service.js.map +0 -1
- package/dist/config/env.validation.js.map +0 -1
- package/dist/config/typeorm.js.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/migrations/1774746981348-InitialSchemaAndSeed.js.map +0 -1
- package/dist/migrations/1774850116434-CreateRefreshTokens.js.map +0 -1
- package/dist/models/dto/create-model.dto.js.map +0 -1
- package/dist/models/dto/update-model.dto.js.map +0 -1
- package/dist/models/entities/model.entity.js.map +0 -1
- package/dist/models/models.controller.js.map +0 -1
- package/dist/models/models.module.js.map +0 -1
- package/dist/models/models.service.js.map +0 -1
- package/dist/projects/dto/create-project.dto.js.map +0 -1
- package/dist/projects/dto/update-project.dto.js.map +0 -1
- package/dist/projects/entities/project.entity.js.map +0 -1
- package/dist/projects/projects.controller.js.map +0 -1
- package/dist/projects/projects.module.js.map +0 -1
- package/dist/projects/projects.service.js.map +0 -1
- package/dist/providers/dto/create-provider.dto.js.map +0 -1
- package/dist/providers/dto/update-provider.dto.js.map +0 -1
- package/dist/providers/entities/provider.entity.js.map +0 -1
- package/dist/providers/providers.controller.js.map +0 -1
- package/dist/providers/providers.module.js.map +0 -1
- package/dist/providers/providers.service.js.map +0 -1
- package/dist/tasks/comments.controller.js.map +0 -1
- package/dist/tasks/comments.service.js.map +0 -1
- package/dist/tasks/dto/create-comment.dto.js.map +0 -1
- package/dist/tasks/dto/create-recurrent-task.dto.js.map +0 -1
- package/dist/tasks/dto/create-task.dto.js.map +0 -1
- package/dist/tasks/dto/update-comment.dto.js.map +0 -1
- package/dist/tasks/dto/update-recurrent-task.dto.js.map +0 -1
- package/dist/tasks/dto/update-task.dto.js.map +0 -1
- package/dist/tasks/entities/comment.entity.js.map +0 -1
- package/dist/tasks/entities/recurrent-task-exec.entity.js.map +0 -1
- package/dist/tasks/entities/recurrent-task.entity.js.map +0 -1
- package/dist/tasks/entities/task.entity.js.map +0 -1
- package/dist/tasks/recurrent-task-scheduler.service.js.map +0 -1
- package/dist/tasks/recurrent-tasks.controller.js.map +0 -1
- package/dist/tasks/recurrent-tasks.service.js.map +0 -1
- package/dist/tasks/task-scheduler.service.js.map +0 -1
- package/dist/tasks/tasks.controller.js.map +0 -1
- package/dist/tasks/tasks.module.js.map +0 -1
- package/dist/tasks/tasks.service.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/ui/assets/AgentFleet-CC0h_Ar0.js +0 -1
- package/dist/ui/assets/AgentFleet-CC0h_Ar0.js.map +0 -1
- package/dist/ui/assets/ConfirmDialog-mRH8i_xK.js +0 -10
- package/dist/ui/assets/ConfirmDialog-mRH8i_xK.js.map +0 -1
- package/dist/ui/assets/InitialsAvatar-0mIRaTK8.js +0 -1
- package/dist/ui/assets/InitialsAvatar-0mIRaTK8.js.map +0 -1
- package/dist/ui/assets/MarkdownField-flCuU7w3.js +0 -1
- package/dist/ui/assets/MarkdownField-flCuU7w3.js.map +0 -1
- package/dist/ui/assets/ProjectDetail-CY-VSV2D.js +0 -1
- package/dist/ui/assets/ProjectDetail-CY-VSV2D.js.map +0 -1
- package/dist/ui/assets/Providers-C9_lxOG1.js +0 -1
- package/dist/ui/assets/Providers-C9_lxOG1.js.map +0 -1
- package/dist/ui/assets/Scheduler-Du2cIGfB.js +0 -1
- package/dist/ui/assets/Scheduler-Du2cIGfB.js.map +0 -1
- package/dist/ui/assets/TaskDetail-BdQJCVo3.js +0 -1
- package/dist/ui/assets/TaskDetail-BdQJCVo3.js.map +0 -1
- package/dist/ui/assets/TaskManager-CWDh69pf.js +0 -8
- package/dist/ui/assets/TaskManager-CWDh69pf.js.map +0 -1
- package/dist/ui/assets/activity-CIlCK2jL.js +0 -1
- package/dist/ui/assets/activity-CIlCK2jL.js.map +0 -1
- package/dist/ui/assets/brain-_N041Xks.js +0 -1
- package/dist/ui/assets/brain-_N041Xks.js.map +0 -1
- package/dist/ui/assets/check-DgCfni6J.js +0 -1
- package/dist/ui/assets/check-DgCfni6J.js.map +0 -1
- package/dist/ui/assets/clock-C0d1RzP_.js +0 -1
- package/dist/ui/assets/clock-C0d1RzP_.js.map +0 -1
- package/dist/ui/assets/cn-i-5ItZGU.js +0 -1
- package/dist/ui/assets/cn-i-5ItZGU.js.map +0 -1
- package/dist/ui/assets/eye-RB18-re_.js +0 -1
- package/dist/ui/assets/eye-RB18-re_.js.map +0 -1
- package/dist/ui/assets/index-CCsHBe__.css +0 -1
- package/dist/ui/assets/index-yzhzS93F.js +0 -2
- package/dist/ui/assets/index-yzhzS93F.js.map +0 -1
- package/dist/ui/assets/inter-cyrillic-300-normal-BnqRxXuy.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-300-normal-LR1W_oT8.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-600-normal-4D_pXhcN.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-600-normal-CWCymEST.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-300-normal-CgCALhwJ.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-300-normal-RId2JxDB.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-600-normal-Bcila6Z-.woff +0 -0
- package/dist/ui/assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2 +0 -0
- package/dist/ui/assets/inter-greek-300-normal-BrhSP0vQ.woff +0 -0
- package/dist/ui/assets/inter-greek-300-normal-DmGD3g_f.woff2 +0 -0
- package/dist/ui/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
- package/dist/ui/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
- package/dist/ui/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
- package/dist/ui/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
- package/dist/ui/assets/inter-greek-600-normal-BZpKdvQh.woff +0 -0
- package/dist/ui/assets/inter-greek-600-normal-plRanbMR.woff2 +0 -0
- package/dist/ui/assets/inter-greek-ext-300-normal-DLbbeei1.woff +0 -0
- package/dist/ui/assets/inter-greek-ext-300-normal-l2DDyC6M.woff2 +0 -0
- package/dist/ui/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
- package/dist/ui/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
- package/dist/ui/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
- package/dist/ui/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
- package/dist/ui/assets/inter-greek-ext-600-normal-B8X0CLgF.woff +0 -0
- package/dist/ui/assets/inter-greek-ext-600-normal-DRtmH8MT.woff2 +0 -0
- package/dist/ui/assets/inter-latin-300-normal-BVlfKGgI.woff2 +0 -0
- package/dist/ui/assets/inter-latin-300-normal-i8F0SvXL.woff +0 -0
- package/dist/ui/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- package/dist/ui/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
- package/dist/ui/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- package/dist/ui/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- package/dist/ui/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
- package/dist/ui/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
- package/dist/ui/assets/inter-latin-ext-300-normal-CPgO9Ksf.woff2 +0 -0
- package/dist/ui/assets/inter-latin-ext-300-normal-Dp1L8vcn.woff +0 -0
- package/dist/ui/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
- package/dist/ui/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
- package/dist/ui/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
- package/dist/ui/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
- package/dist/ui/assets/inter-latin-ext-600-normal-CIVaiw4L.woff +0 -0
- package/dist/ui/assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2 +0 -0
- package/dist/ui/assets/inter-vietnamese-300-normal-Bdr24Bqb.woff2 +0 -0
- package/dist/ui/assets/inter-vietnamese-300-normal-DDGmYYdT.woff +0 -0
- package/dist/ui/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
- package/dist/ui/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
- package/dist/ui/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
- package/dist/ui/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
- package/dist/ui/assets/inter-vietnamese-600-normal-BuLX-rYi.woff +0 -0
- package/dist/ui/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
- package/dist/ui/assets/layers-D5ECV506.js +0 -1
- package/dist/ui/assets/layers-D5ECV506.js.map +0 -1
- package/dist/ui/assets/manrope-cyrillic-400-normal-BMzJvInZ.woff2 +0 -0
- package/dist/ui/assets/manrope-cyrillic-400-normal-Dvx59UGC.woff +0 -0
- package/dist/ui/assets/manrope-cyrillic-600-normal-DvRl3Mj-.woff2 +0 -0
- package/dist/ui/assets/manrope-cyrillic-600-normal-It4mZcQk.woff +0 -0
- package/dist/ui/assets/manrope-cyrillic-700-normal-7JNVKxyl.woff +0 -0
- package/dist/ui/assets/manrope-cyrillic-700-normal-Dw_fZAg2.woff2 +0 -0
- package/dist/ui/assets/manrope-cyrillic-800-normal-AvdZ5mAV.woff2 +0 -0
- package/dist/ui/assets/manrope-cyrillic-800-normal-BuEMjQU-.woff +0 -0
- package/dist/ui/assets/manrope-greek-400-normal-CM4qok81.woff2 +0 -0
- package/dist/ui/assets/manrope-greek-400-normal-DuX9RsAR.woff +0 -0
- package/dist/ui/assets/manrope-greek-600-normal-BoRV6lzK.woff2 +0 -0
- package/dist/ui/assets/manrope-greek-600-normal-CF2i9ZRY.woff +0 -0
- package/dist/ui/assets/manrope-greek-700-normal-CHUG9PD8.woff2 +0 -0
- package/dist/ui/assets/manrope-greek-700-normal-DyfsrCpP.woff +0 -0
- package/dist/ui/assets/manrope-greek-800-normal-Bw-67qu9.woff +0 -0
- package/dist/ui/assets/manrope-greek-800-normal-CDvU698_.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-400-normal-8tf8FM3T.woff +0 -0
- package/dist/ui/assets/manrope-latin-400-normal-PaqtzbVb.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-600-normal-4f0koTD-.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-600-normal-BqgrALkZ.woff +0 -0
- package/dist/ui/assets/manrope-latin-700-normal-BZp_XxE4.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-700-normal-DGRFkw-m.woff +0 -0
- package/dist/ui/assets/manrope-latin-800-normal-BfWYOv1c.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-800-normal-uHUdIJgA.woff +0 -0
- package/dist/ui/assets/manrope-latin-ext-400-normal-C-X6QNXX.woff +0 -0
- package/dist/ui/assets/manrope-latin-ext-400-normal-CMDvPJRp.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-ext-600-normal-_gBojHdJ.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-ext-600-normal-u5Pl7hTU.woff +0 -0
- package/dist/ui/assets/manrope-latin-ext-700-normal-DYOwVNan.woff2 +0 -0
- package/dist/ui/assets/manrope-latin-ext-700-normal-eVCcYqtJ.woff +0 -0
- package/dist/ui/assets/manrope-latin-ext-800-normal-BQAQsuQc.woff +0 -0
- package/dist/ui/assets/manrope-latin-ext-800-normal-DdFx7KEb.woff2 +0 -0
- package/dist/ui/assets/manrope-vietnamese-400-normal-D7E_mLGF.woff +0 -0
- package/dist/ui/assets/manrope-vietnamese-400-normal-DHb3EETF.woff2 +0 -0
- package/dist/ui/assets/manrope-vietnamese-600-normal-C1J5PCl_.woff2 +0 -0
- package/dist/ui/assets/manrope-vietnamese-600-normal-lA7a_7Ok.woff +0 -0
- package/dist/ui/assets/manrope-vietnamese-700-normal-CUqMx5-1.woff2 +0 -0
- package/dist/ui/assets/manrope-vietnamese-700-normal-pt65Fn2Z.woff +0 -0
- package/dist/ui/assets/manrope-vietnamese-800-normal-ClPWri-A.woff2 +0 -0
- package/dist/ui/assets/manrope-vietnamese-800-normal-bvg7iBCV.woff +0 -0
- package/dist/ui/assets/providers-BMRq_pkm.js +0 -1
- package/dist/ui/assets/providers-BMRq_pkm.js.map +0 -1
- package/dist/ui/assets/rolldown-runtime-COnpUsM8.js +0 -1
- package/dist/ui/assets/send-BA7-sXzg.js +0 -1
- package/dist/ui/assets/send-BA7-sXzg.js.map +0 -1
- package/dist/ui/assets/shield-check-D7JIluse.js +0 -1
- package/dist/ui/assets/shield-check-D7JIluse.js.map +0 -1
- package/dist/ui/assets/sparkles-CCXaTT3H.js +0 -1
- package/dist/ui/assets/sparkles-CCXaTT3H.js.map +0 -1
- package/dist/ui/assets/tasks-DEHCZk48.js +0 -1
- package/dist/ui/assets/tasks-DEHCZk48.js.map +0 -1
- package/dist/ui/assets/trash-2-BNP4kC5c.js +0 -1
- package/dist/ui/assets/trash-2-BNP4kC5c.js.map +0 -1
- package/dist/ui/assets/trending-up-DBTQIgW8.js +0 -1
- package/dist/ui/assets/trending-up-DBTQIgW8.js.map +0 -1
- package/dist/ui/assets/useNotification-DK-pV16c.js +0 -6
- package/dist/ui/assets/useNotification-DK-pV16c.js.map +0 -1
- package/dist/ui/assets/user-Cp55HCCi.js +0 -1
- package/dist/ui/assets/user-Cp55HCCi.js.map +0 -1
- package/dist/ui/assets/vendor-dnd-CxfOy4-Z.js +0 -5
- package/dist/ui/assets/vendor-dnd-CxfOy4-Z.js.map +0 -1
- package/dist/ui/assets/vendor-forms-HC2wK6B9.js +0 -39
- package/dist/ui/assets/vendor-forms-HC2wK6B9.js.map +0 -1
- package/dist/ui/assets/vendor-markdown-Dl_1qnne.js +0 -29
- package/dist/ui/assets/vendor-markdown-Dl_1qnne.js.map +0 -1
- package/dist/ui/assets/vendor-motion-CkXYvnuI.js +0 -9
- package/dist/ui/assets/vendor-motion-CkXYvnuI.js.map +0 -1
- package/dist/ui/assets/vendor-query-DQlZ8h7P.js +0 -1
- package/dist/ui/assets/vendor-query-DQlZ8h7P.js.map +0 -1
- package/dist/ui/assets/vendor-react-CiDbU5Ns.js +0 -11
- package/dist/ui/assets/vendor-react-CiDbU5Ns.js.map +0 -1
- package/dist/ui/assets/zap-D1sST66b.js +0 -1
- package/dist/ui/assets/zap-D1sST66b.js.map +0 -1
- package/dist/ui/favicon.svg +0 -1
- package/dist/ui/icons.svg +0 -24
- package/dist/ui/index.html +0 -22
- package/dist/uploads/uploads.controller.js.map +0 -1
- package/dist/uploads/uploads.module.js.map +0 -1
- package/dist/users/dto/create-user.dto.js.map +0 -1
- package/dist/users/dto/update-user.dto.js.map +0 -1
- package/dist/users/entities/user.entity.js.map +0 -1
- package/dist/users/users.controller.js.map +0 -1
- package/dist/users/users.module.js.map +0 -1
- package/dist/users/users.service.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# [1.0.0-alpha.24](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2026-04-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* update README and documentation files with additional references and streamlined content ([ae7b1ac](https://github.com/bpinhosilva/agent-orchestrator/commit/ae7b1acbd47eebbc91b154f2b54da83eb8da0be8))
|
|
7
|
+
|
|
8
|
+
# [1.0.0-alpha.23](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.22...v1.0.0-alpha.23) (2026-04-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* enhance project management with user roles and member management ([877832f](https://github.com/bpinhosilva/agent-orchestrator/commit/877832fc4ad8d77499124a4da23c14a1270622a4))
|
|
14
|
+
* implement release workflow with semantic release and build steps; remove old release.yml ([f17eb48](https://github.com/bpinhosilva/agent-orchestrator/commit/f17eb48c64b165c8fd05e142d175716f7990f670))
|
|
15
|
+
* update CI workflow to include E2E and UI tests; bump lodash version ([b8ceee6](https://github.com/bpinhosilva/agent-orchestrator/commit/b8ceee6adf0855b54d4a45d959e87ec338c55887))
|
|
16
|
+
|
|
1
17
|
# [1.0.0-alpha.22](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.21...v1.0.0-alpha.22) (2026-04-02)
|
|
2
18
|
|
|
3
19
|
|
package/README.md
CHANGED
|
@@ -3,68 +3,230 @@
|
|
|
3
3
|
[](https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/ci.yml)
|
|
4
4
|
[](https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/release.yml)
|
|
5
5
|
[](https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/gitleaks.yml)
|
|
6
|
+
[](https://socket.dev/npm/package/@bpinhosilva/agent-orchestrator)
|
|
6
7
|
|
|
7
8
|
Agent Orchestrator is an open-source project designed to manage and orchestrate AI agents using both back-end services and front-end applications. It provides an automated agentic execution environment where you can create multiple agent profiles (e.g., Head Agent, Researcher, CMO) and delegate tasks to them through automated workflows.
|
|
8
9
|
|
|
9
10
|
## Features (In Progress & Planned)
|
|
10
11
|
- **Agent Delegation**: Delegate tasks to specialized AI agents.
|
|
12
|
+
- **Multi-Provider Support**: Google Gemini and Anthropic Claude providers.
|
|
11
13
|
- **Job Scheduler**: Create and schedule recurring agentic tasks.
|
|
12
14
|
- **Workflow Engine**: Drag-and-drop workflow builder supporting triggers, agent chaining, and outputs.
|
|
13
|
-
- **Agent Capabilities**: File reading/writing, web search, email capabilities, and image generation
|
|
15
|
+
- **Agent Capabilities**: File reading/writing, web search, email capabilities, and image generation.
|
|
16
|
+
- **Role-Based Access Control**: Admin and member roles with project-level membership.
|
|
14
17
|
- **TUI/CLI Tooling**: CLI executables to manage the installation and local agent configuration.
|
|
15
18
|
|
|
16
|
-
##
|
|
17
|
-
- **Backend Framework**: NestJS + TypeScript
|
|
18
|
-
- **Frontend SPA**: React (
|
|
19
|
-
- **Database**: PostgreSQL (
|
|
19
|
+
## Architecture
|
|
20
|
+
- **Backend Framework**: NestJS 11 + TypeScript 5
|
|
21
|
+
- **Frontend SPA**: React (built separately, served as static files)
|
|
22
|
+
- **Database**: PostgreSQL (production) / SQLite (development)
|
|
20
23
|
- **Testing**: Jest (TDD Approach with Unit & E2E)
|
|
21
|
-
- **Architecture**: 3-Tier (Controller
|
|
24
|
+
- **Architecture**: 3-Tier (Controller → Service → Repository)
|
|
22
25
|
|
|
23
26
|
## Prerequisites
|
|
24
27
|
- [Node.js](https://nodejs.org/) (v18+)
|
|
25
|
-
- [Docker](https://www.docker.com/) and Docker Compose (
|
|
26
|
-
- A [Google Gemini API Key](https://aistudio.google.com/)
|
|
28
|
+
- [Docker](https://www.docker.com/) and Docker Compose (optional, for PostgreSQL)
|
|
29
|
+
- A [Google Gemini API Key](https://aistudio.google.com/) or [Anthropic API Key](https://console.anthropic.com/)
|
|
27
30
|
|
|
28
|
-
##
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
### 1. Install Dependencies
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
> **Note**: The project uses `ignore-scripts=true` in `.npmrc` for supply chain security. After installing, run `npm rebuild` to compile native modules (bcrypt, sqlite3).
|
|
40
|
+
|
|
41
|
+
### 2. Configure Environment
|
|
42
|
+
|
|
43
|
+
Create a `.env` file in the project root (or set `AGENT_ORCHESTRATOR_HOME` to point to a directory containing `.env`):
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Required
|
|
47
|
+
JWT_SECRET="at-least-32-characters-long-secret-key"
|
|
48
|
+
|
|
49
|
+
# AI Providers (at least one required for agent functionality)
|
|
50
|
+
GEMINI_API_KEY="your-gemini-api-key"
|
|
51
|
+
ANTHROPIC_API_KEY="your-anthropic-api-key"
|
|
52
|
+
|
|
53
|
+
# Optional
|
|
54
|
+
PORT=3000 # Server port (default: 3000)
|
|
55
|
+
NODE_ENV=development # development | production | test
|
|
56
|
+
DATABASE_URL= # PostgreSQL connection string (omit for SQLite)
|
|
57
|
+
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
|
|
58
|
+
SCHEDULER_ENABLED=true # Enable/disable task scheduler CRON
|
|
59
|
+
DB_LOGGING=false # Enable TypeORM query logging
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 3. Set Up the Database
|
|
63
|
+
|
|
64
|
+
**Option A: SQLite (Development — zero config)**
|
|
65
|
+
|
|
66
|
+
SQLite is used automatically when `DATABASE_URL` is not set. The database file is created at `local.sqlite` in the project root (or `$AGENT_ORCHESTRATOR_HOME/local.sqlite`).
|
|
67
|
+
|
|
68
|
+
**Option B: PostgreSQL (Production)**
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Start PostgreSQL via Docker Compose
|
|
72
|
+
docker compose up -d
|
|
73
|
+
|
|
74
|
+
# Set the connection string
|
|
75
|
+
export DATABASE_URL="postgresql://orchestrator:orchestrator_password@localhost:5433/agent_orchestrator"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Then run migrations and seed the admin user:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Apply database migrations
|
|
82
|
+
npm run migration:run
|
|
83
|
+
|
|
84
|
+
# Create the initial admin user (interactive prompt)
|
|
85
|
+
npm run seed:admin
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 4. Run the Application
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Development (API + UI with hot reload)
|
|
92
|
+
npm run dev
|
|
93
|
+
|
|
94
|
+
# Or API only in watch mode
|
|
95
|
+
npm run start:dev
|
|
96
|
+
|
|
97
|
+
# Production build
|
|
98
|
+
npm run build
|
|
99
|
+
npm run start:prod
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The dashboard is available at `http://localhost:3000` and the API at `http://localhost:3000/api/v1/`.
|
|
103
|
+
|
|
104
|
+
## Database Management
|
|
105
|
+
|
|
106
|
+
The project uses [TypeORM](https://typeorm.io/) migrations to manage schema changes. **Never rely on `synchronize: true`** — it is disabled in all environments.
|
|
107
|
+
|
|
108
|
+
### Migration Commands
|
|
29
109
|
|
|
30
110
|
```bash
|
|
31
|
-
|
|
111
|
+
# Generate a new migration from entity changes
|
|
112
|
+
npm run typeorm -- migration:generate src/migrations/DescriptiveName
|
|
113
|
+
|
|
114
|
+
# Apply all pending migrations
|
|
115
|
+
npm run migration:run
|
|
116
|
+
|
|
117
|
+
# Revert the last applied migration
|
|
118
|
+
npm run migration:revert
|
|
119
|
+
|
|
120
|
+
# Drop the entire database schema (use with caution!)
|
|
121
|
+
npm run schema:drop
|
|
32
122
|
```
|
|
33
123
|
|
|
34
|
-
|
|
124
|
+
### Migration Workflow
|
|
125
|
+
|
|
126
|
+
1. Modify your entity files in `src/`
|
|
127
|
+
2. Generate a migration: `npm run typeorm -- migration:generate src/migrations/YourMigrationName`
|
|
128
|
+
3. Review the generated file in `src/migrations/`
|
|
129
|
+
4. Apply it: `npm run migration:run`
|
|
130
|
+
5. Verify with tests: `npm run test:all`
|
|
35
131
|
|
|
36
|
-
|
|
132
|
+
### Seeding
|
|
37
133
|
|
|
38
134
|
```bash
|
|
39
|
-
#
|
|
40
|
-
|
|
135
|
+
# Create the initial admin user
|
|
136
|
+
npm run seed:admin
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
This creates a user with the `admin` role. All subsequent users registered via `POST /auth/register` (admin-only endpoint) default to `member` role.
|
|
41
140
|
|
|
42
|
-
|
|
43
|
-
$ GEMINI_API_KEY="your-api-key" npm run start
|
|
141
|
+
## Deployment
|
|
44
142
|
|
|
45
|
-
|
|
46
|
-
$ GEMINI_API_KEY="your-api-key" npm run start:dev
|
|
143
|
+
### Production Checklist
|
|
47
144
|
|
|
48
|
-
|
|
49
|
-
|
|
145
|
+
1. **Database**: Use PostgreSQL — set `DATABASE_URL` environment variable
|
|
146
|
+
2. **Migrations**: Run `npm run migration:run` before starting the app
|
|
147
|
+
3. **Environment**:
|
|
148
|
+
- `NODE_ENV=production` — disables Swagger UI and enables secure cookies
|
|
149
|
+
- `JWT_SECRET` — strong secret, minimum 32 characters
|
|
150
|
+
- `ALLOWED_ORIGINS` — comma-separated list of allowed CORS origins (required in production)
|
|
151
|
+
4. **Build**: Run `npm run build` to compile TypeScript and bundle the UI
|
|
152
|
+
5. **Start**: `npm run start:prod` (or `node dist/main.js`)
|
|
153
|
+
|
|
154
|
+
### Docker
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Build and run with Docker Compose (includes PostgreSQL)
|
|
158
|
+
docker compose up -d
|
|
159
|
+
|
|
160
|
+
# Apply migrations
|
|
161
|
+
DATABASE_URL="postgresql://orchestrator:orchestrator_password@localhost:5433/agent_orchestrator" \
|
|
162
|
+
npm run migration:run
|
|
163
|
+
|
|
164
|
+
# Seed admin
|
|
165
|
+
DATABASE_URL="postgresql://orchestrator:orchestrator_password@localhost:5433/agent_orchestrator" \
|
|
166
|
+
npm run seed:admin
|
|
50
167
|
```
|
|
51
168
|
|
|
52
|
-
|
|
169
|
+
### Updating an Existing Deployment
|
|
170
|
+
|
|
171
|
+
1. Pull the latest code
|
|
172
|
+
2. Install dependencies: `npm ci && npm rebuild`
|
|
173
|
+
3. Build: `npm run build`
|
|
174
|
+
4. Run new migrations: `npm run migration:run`
|
|
175
|
+
5. Restart the application
|
|
53
176
|
|
|
54
177
|
## Testing
|
|
55
178
|
|
|
56
179
|
```bash
|
|
57
|
-
#
|
|
58
|
-
|
|
180
|
+
# Unit tests
|
|
181
|
+
npm test
|
|
182
|
+
|
|
183
|
+
# Unit tests in watch mode
|
|
184
|
+
npm run test:watch
|
|
185
|
+
|
|
186
|
+
# E2E tests
|
|
187
|
+
npm run test:e2e
|
|
59
188
|
|
|
60
|
-
#
|
|
61
|
-
|
|
189
|
+
# All tests (unit + UI + E2E)
|
|
190
|
+
npm run test:all
|
|
62
191
|
|
|
63
|
-
#
|
|
64
|
-
|
|
192
|
+
# Test coverage
|
|
193
|
+
npm run test:cov
|
|
194
|
+
|
|
195
|
+
# Run a single test file
|
|
196
|
+
npm test -- src/auth/auth.service.spec.ts
|
|
197
|
+
|
|
198
|
+
# Run tests matching a name pattern
|
|
199
|
+
npm test -- --testNamePattern="should validate email"
|
|
65
200
|
```
|
|
66
201
|
|
|
67
|
-
##
|
|
202
|
+
## Security
|
|
203
|
+
|
|
204
|
+
### Authentication & Authorization
|
|
205
|
+
|
|
206
|
+
- **JWT-based authentication** with httpOnly cookie transport (no tokens in response bodies)
|
|
207
|
+
- **Role-Based Access Control (RBAC)**: `admin` and `member` roles
|
|
208
|
+
- **Admin**: Full access to all resources
|
|
209
|
+
- **Member**: Access scoped to projects they own or are members of
|
|
210
|
+
- **Project membership**: Many-to-many model with `owner` and `member` roles per project
|
|
211
|
+
- **Rate limiting**: 60 req/min globally, 5 req/min on auth endpoints
|
|
212
|
+
- All routes protected by default — use `@Public()` decorator for public endpoints
|
|
213
|
+
|
|
214
|
+
### Supply Chain Protection
|
|
215
|
+
|
|
216
|
+
- `.npmrc` hardened: registry pinned to `registry.npmjs.org`, install scripts disabled
|
|
217
|
+
- `lockfile-lint` validates lockfile integrity in CI and pre-commit hooks
|
|
218
|
+
- `npm audit signatures` checks package provenance in CI
|
|
219
|
+
- [Socket.dev](https://socket.dev) monitors dependencies for supply chain risks
|
|
220
|
+
|
|
221
|
+
### Additional Hardening
|
|
222
|
+
|
|
223
|
+
- Helmet.js security headers with Content Security Policy
|
|
224
|
+
- CORS restricted to `ALLOWED_ORIGINS` (deny-all in production without explicit config)
|
|
225
|
+
- Swagger UI disabled in production
|
|
226
|
+
- File upload validation: MIME type allowlist + 10MB size limit
|
|
227
|
+
- Input length limits on all text fields via class-validator
|
|
228
|
+
|
|
229
|
+
## API Usage
|
|
68
230
|
|
|
69
231
|
**Endpoint**: `POST /api/v1/agents/process`
|
|
70
232
|
**Payload**:
|
|
@@ -73,3 +235,17 @@ $ npm run test:cov
|
|
|
73
235
|
"input": "Write a short poem about automation."
|
|
74
236
|
}
|
|
75
237
|
```
|
|
238
|
+
|
|
239
|
+
## Contributing
|
|
240
|
+
|
|
241
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
242
|
+
|
|
243
|
+
## Additional Documentation
|
|
244
|
+
|
|
245
|
+
- [CLI reference](docs/CLI.md)
|
|
246
|
+
- [CI/CD pipeline](docs/CI_CD.md)
|
|
247
|
+
- [Release process](docs/RELEASE.md)
|
|
248
|
+
|
|
249
|
+
## License
|
|
250
|
+
|
|
251
|
+
See [LICENSE](LICENSE) for details.
|
|
@@ -19,6 +19,8 @@ const agents_service_1 = require("./agents.service");
|
|
|
19
19
|
const agent_request_dto_1 = require("./dto/agent-request.dto");
|
|
20
20
|
const create_agent_dto_1 = require("./dto/create-agent.dto");
|
|
21
21
|
const update_agent_dto_1 = require("./dto/update-agent.dto");
|
|
22
|
+
const roles_decorator_1 = require("../auth/decorators/roles.decorator");
|
|
23
|
+
const user_entity_1 = require("../users/entities/user.entity");
|
|
22
24
|
let AgentsController = class AgentsController {
|
|
23
25
|
agentsService;
|
|
24
26
|
constructor(agentsService) {
|
|
@@ -48,6 +50,7 @@ let AgentsController = class AgentsController {
|
|
|
48
50
|
};
|
|
49
51
|
exports.AgentsController = AgentsController;
|
|
50
52
|
__decorate([
|
|
53
|
+
(0, roles_decorator_1.Roles)(user_entity_1.UserRole.ADMIN),
|
|
51
54
|
(0, common_1.Post)(),
|
|
52
55
|
openapi.ApiResponse({ status: 201, type: require("./entities/agent.entity").AgentEntity }),
|
|
53
56
|
__param(0, (0, common_1.Body)()),
|
|
@@ -71,6 +74,7 @@ __decorate([
|
|
|
71
74
|
__metadata("design:returntype", void 0)
|
|
72
75
|
], AgentsController.prototype, "findOne", null);
|
|
73
76
|
__decorate([
|
|
77
|
+
(0, roles_decorator_1.Roles)(user_entity_1.UserRole.ADMIN),
|
|
74
78
|
(0, common_1.Patch)(':id'),
|
|
75
79
|
openapi.ApiResponse({ status: 200, type: require("./entities/agent.entity").AgentEntity }),
|
|
76
80
|
__param(0, (0, common_1.Param)('id')),
|
|
@@ -80,6 +84,7 @@ __decorate([
|
|
|
80
84
|
__metadata("design:returntype", void 0)
|
|
81
85
|
], AgentsController.prototype, "update", null);
|
|
82
86
|
__decorate([
|
|
87
|
+
(0, roles_decorator_1.Roles)(user_entity_1.UserRole.ADMIN),
|
|
83
88
|
(0, common_1.Delete)(':id'),
|
|
84
89
|
openapi.ApiResponse({ status: 200 }),
|
|
85
90
|
__param(0, (0, common_1.Param)('id')),
|
|
@@ -16,7 +16,7 @@ class AgentRequestDto {
|
|
|
16
16
|
agentId;
|
|
17
17
|
input;
|
|
18
18
|
static _OPENAPI_METADATA_FACTORY() {
|
|
19
|
-
return { agentId: { required: true, type: () => String }, input: { required: true, type: () => String } };
|
|
19
|
+
return { agentId: { required: true, type: () => String }, input: { required: true, type: () => String, maxLength: 50000 } };
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.AgentRequestDto = AgentRequestDto;
|
|
@@ -28,6 +28,7 @@ __decorate([
|
|
|
28
28
|
__decorate([
|
|
29
29
|
(0, class_validator_1.IsString)(),
|
|
30
30
|
(0, class_validator_1.IsNotEmpty)(),
|
|
31
|
+
(0, class_validator_1.MaxLength)(50000),
|
|
31
32
|
__metadata("design:type", String)
|
|
32
33
|
], AgentRequestDto.prototype, "input", void 0);
|
|
33
34
|
//# sourceMappingURL=agent-request.dto.js.map
|
|
@@ -21,28 +21,32 @@ class CreateAgentDto {
|
|
|
21
21
|
status;
|
|
22
22
|
providerId;
|
|
23
23
|
static _OPENAPI_METADATA_FACTORY() {
|
|
24
|
-
return { name: { required: true, type: () => String }, description: { required: false, type: () => String }, role: { required: false, type: () => String }, systemInstructions: { required: false, type: () => String }, modelId: { required: true, type: () => String }, status: { required: false, type: () => String }, providerId: { required: true, type: () => String, format: "uuid" } };
|
|
24
|
+
return { name: { required: true, type: () => String, maxLength: 200 }, description: { required: false, type: () => String, maxLength: 2000 }, role: { required: false, type: () => String, maxLength: 200 }, systemInstructions: { required: false, type: () => String, maxLength: 10000 }, modelId: { required: true, type: () => String }, status: { required: false, type: () => String, enum: ['active', 'inactive'] }, providerId: { required: true, type: () => String, format: "uuid" } };
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
exports.CreateAgentDto = CreateAgentDto;
|
|
28
28
|
__decorate([
|
|
29
29
|
(0, class_validator_1.IsString)(),
|
|
30
30
|
(0, class_validator_1.IsNotEmpty)(),
|
|
31
|
+
(0, class_validator_1.MaxLength)(200),
|
|
31
32
|
__metadata("design:type", String)
|
|
32
33
|
], CreateAgentDto.prototype, "name", void 0);
|
|
33
34
|
__decorate([
|
|
34
35
|
(0, class_validator_1.IsString)(),
|
|
35
36
|
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
(0, class_validator_1.MaxLength)(2000),
|
|
36
38
|
__metadata("design:type", String)
|
|
37
39
|
], CreateAgentDto.prototype, "description", void 0);
|
|
38
40
|
__decorate([
|
|
39
41
|
(0, class_validator_1.IsString)(),
|
|
40
42
|
(0, class_validator_1.IsOptional)(),
|
|
43
|
+
(0, class_validator_1.MaxLength)(200),
|
|
41
44
|
__metadata("design:type", String)
|
|
42
45
|
], CreateAgentDto.prototype, "role", void 0);
|
|
43
46
|
__decorate([
|
|
44
47
|
(0, class_validator_1.IsString)(),
|
|
45
48
|
(0, class_validator_1.IsOptional)(),
|
|
49
|
+
(0, class_validator_1.MaxLength)(10000),
|
|
46
50
|
__metadata("design:type", String)
|
|
47
51
|
], CreateAgentDto.prototype, "systemInstructions", void 0);
|
|
48
52
|
__decorate([
|
|
@@ -53,6 +57,7 @@ __decorate([
|
|
|
53
57
|
__decorate([
|
|
54
58
|
(0, class_validator_1.IsString)(),
|
|
55
59
|
(0, class_validator_1.IsOptional)(),
|
|
60
|
+
(0, class_validator_1.IsIn)(['active', 'inactive']),
|
|
56
61
|
__metadata("design:type", String)
|
|
57
62
|
], CreateAgentDto.prototype, "status", void 0);
|
|
58
63
|
__decorate([
|
package/dist/app.module.js
CHANGED
|
@@ -28,6 +28,7 @@ const throttler_1 = require("@nestjs/throttler");
|
|
|
28
28
|
const core_1 = require("@nestjs/core");
|
|
29
29
|
const auth_module_1 = require("./auth/auth.module");
|
|
30
30
|
const jwt_auth_guard_1 = require("./auth/guards/jwt-auth.guard");
|
|
31
|
+
const roles_guard_1 = require("./auth/guards/roles.guard");
|
|
31
32
|
const typeorm_2 = require("./config/typeorm");
|
|
32
33
|
const APP_HOME = process.env.AGENT_ORCHESTRATOR_HOME;
|
|
33
34
|
const ENV_PATH = APP_HOME ? (0, path_1.join)(APP_HOME, '.env') : '.env';
|
|
@@ -93,6 +94,10 @@ exports.AppModule = AppModule = __decorate([
|
|
|
93
94
|
provide: core_1.APP_GUARD,
|
|
94
95
|
useClass: jwt_auth_guard_1.JwtAuthGuard,
|
|
95
96
|
},
|
|
97
|
+
{
|
|
98
|
+
provide: core_1.APP_GUARD,
|
|
99
|
+
useClass: roles_guard_1.RolesGuard,
|
|
100
|
+
},
|
|
96
101
|
],
|
|
97
102
|
})
|
|
98
103
|
], AppModule);
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
1
2
|
import { AuthService } from './auth.service';
|
|
2
3
|
import { RegisterDto } from './dto/register.dto';
|
|
3
4
|
import { LoginDto } from './dto/login.dto';
|
|
5
|
+
import { UserRole } from '../users/entities/user.entity';
|
|
4
6
|
import type { Response as ExpressResponse, Request as ExpressRequest } from 'express';
|
|
5
7
|
export declare class AuthController {
|
|
6
8
|
private readonly authService;
|
|
7
|
-
|
|
9
|
+
private readonly configService;
|
|
10
|
+
private readonly isProduction;
|
|
11
|
+
constructor(authService: AuthService, configService: ConfigService);
|
|
8
12
|
register(registerDto: RegisterDto): Promise<{
|
|
9
13
|
id: string;
|
|
10
14
|
name: string;
|
|
11
15
|
email: string;
|
|
16
|
+
role: UserRole;
|
|
12
17
|
createdAt: Date;
|
|
13
18
|
updatedAt: Date;
|
|
14
19
|
}>;
|
|
@@ -16,15 +16,23 @@ exports.AuthController = void 0;
|
|
|
16
16
|
const openapi = require("@nestjs/swagger");
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
|
18
18
|
const throttler_1 = require("@nestjs/throttler");
|
|
19
|
+
const config_1 = require("@nestjs/config");
|
|
19
20
|
const auth_service_1 = require("./auth.service");
|
|
20
21
|
const register_dto_1 = require("./dto/register.dto");
|
|
21
22
|
const login_dto_1 = require("./dto/login.dto");
|
|
22
23
|
const public_decorator_1 = require("./decorators/public.decorator");
|
|
24
|
+
const roles_decorator_1 = require("./decorators/roles.decorator");
|
|
25
|
+
const user_entity_1 = require("../users/entities/user.entity");
|
|
23
26
|
const swagger_1 = require("@nestjs/swagger");
|
|
24
27
|
let AuthController = class AuthController {
|
|
25
28
|
authService;
|
|
26
|
-
|
|
29
|
+
configService;
|
|
30
|
+
isProduction;
|
|
31
|
+
constructor(authService, configService) {
|
|
27
32
|
this.authService = authService;
|
|
33
|
+
this.configService = configService;
|
|
34
|
+
this.isProduction =
|
|
35
|
+
this.configService.get('NODE_ENV') === 'production';
|
|
28
36
|
}
|
|
29
37
|
register(registerDto) {
|
|
30
38
|
return this.authService.register(registerDto);
|
|
@@ -33,14 +41,14 @@ let AuthController = class AuthController {
|
|
|
33
41
|
const data = await this.authService.login(loginDto);
|
|
34
42
|
res.cookie('auth_token', data.access_token, {
|
|
35
43
|
httpOnly: true,
|
|
36
|
-
secure:
|
|
44
|
+
secure: this.isProduction,
|
|
37
45
|
sameSite: 'strict',
|
|
38
46
|
maxAge: data.expires_in * 1000,
|
|
39
47
|
path: '/',
|
|
40
48
|
});
|
|
41
49
|
res.cookie('refresh_token', data.refresh_token, {
|
|
42
50
|
httpOnly: true,
|
|
43
|
-
secure:
|
|
51
|
+
secure: this.isProduction,
|
|
44
52
|
sameSite: 'strict',
|
|
45
53
|
maxAge: data.refresh_expires_in * 1000,
|
|
46
54
|
path: '/',
|
|
@@ -56,15 +64,22 @@ let AuthController = class AuthController {
|
|
|
56
64
|
}
|
|
57
65
|
try {
|
|
58
66
|
const data = await this.authService.refresh(refreshToken);
|
|
67
|
+
res.cookie('auth_token', data.access_token, {
|
|
68
|
+
httpOnly: true,
|
|
69
|
+
secure: this.isProduction,
|
|
70
|
+
sameSite: 'strict',
|
|
71
|
+
maxAge: data.expires_in * 1000,
|
|
72
|
+
path: '/',
|
|
73
|
+
});
|
|
59
74
|
res.cookie('refresh_token', data.refresh_token, {
|
|
60
75
|
httpOnly: true,
|
|
61
|
-
secure:
|
|
76
|
+
secure: this.isProduction,
|
|
62
77
|
sameSite: 'strict',
|
|
63
78
|
maxAge: data.refresh_expires_in * 1000,
|
|
64
79
|
path: '/',
|
|
65
80
|
});
|
|
66
81
|
return res.json({
|
|
67
|
-
|
|
82
|
+
message: 'Token refreshed successfully',
|
|
68
83
|
expires_in: data.expires_in,
|
|
69
84
|
token_type: data.token_type,
|
|
70
85
|
});
|
|
@@ -92,7 +107,7 @@ let AuthController = class AuthController {
|
|
|
92
107
|
};
|
|
93
108
|
exports.AuthController = AuthController;
|
|
94
109
|
__decorate([
|
|
95
|
-
(0,
|
|
110
|
+
(0, roles_decorator_1.Roles)(user_entity_1.UserRole.ADMIN),
|
|
96
111
|
(0, throttler_1.Throttle)({ default: { limit: 5, ttl: 60000 } }),
|
|
97
112
|
(0, common_1.Post)('register'),
|
|
98
113
|
openapi.ApiResponse({ status: 201 }),
|
|
@@ -145,6 +160,7 @@ __decorate([
|
|
|
145
160
|
exports.AuthController = AuthController = __decorate([
|
|
146
161
|
(0, swagger_1.ApiTags)('auth'),
|
|
147
162
|
(0, common_1.Controller)('auth'),
|
|
148
|
-
__metadata("design:paramtypes", [auth_service_1.AuthService
|
|
163
|
+
__metadata("design:paramtypes", [auth_service_1.AuthService,
|
|
164
|
+
config_1.ConfigService])
|
|
149
165
|
], AuthController);
|
|
150
166
|
//# sourceMappingURL=auth.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CurrentUser: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CurrentUser = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
exports.CurrentUser = (0, common_1.createParamDecorator)((data, ctx) => {
|
|
6
|
+
const request = ctx.switchToHttp().getRequest();
|
|
7
|
+
return request.user;
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=current-user.decorator.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Roles = exports.ROLES_KEY = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
exports.ROLES_KEY = 'roles';
|
|
6
|
+
const Roles = (...roles) => (0, common_1.SetMetadata)(exports.ROLES_KEY, roles);
|
|
7
|
+
exports.Roles = Roles;
|
|
8
|
+
//# sourceMappingURL=roles.decorator.js.map
|
|
@@ -67,6 +67,7 @@ __decorate([
|
|
|
67
67
|
], RefreshToken.prototype, "revokedAt", void 0);
|
|
68
68
|
exports.RefreshToken = RefreshToken = __decorate([
|
|
69
69
|
(0, typeorm_1.Entity)('refresh_tokens'),
|
|
70
|
-
(0, typeorm_1.Index)(['userId', 'expiresAt'])
|
|
70
|
+
(0, typeorm_1.Index)(['userId', 'expiresAt']),
|
|
71
|
+
(0, typeorm_1.Index)(['userId', 'revokedAt'])
|
|
71
72
|
], RefreshToken);
|
|
72
73
|
//# sourceMappingURL=refresh-token.entity.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import { Reflector } from '@nestjs/core';
|
|
3
|
+
export declare class RolesGuard implements CanActivate {
|
|
4
|
+
private reflector;
|
|
5
|
+
constructor(reflector: Reflector);
|
|
6
|
+
canActivate(context: ExecutionContext): boolean;
|
|
7
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RolesGuard = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_1 = require("@nestjs/core");
|
|
15
|
+
const roles_decorator_1 = require("../decorators/roles.decorator");
|
|
16
|
+
const public_decorator_1 = require("../decorators/public.decorator");
|
|
17
|
+
let RolesGuard = class RolesGuard {
|
|
18
|
+
reflector;
|
|
19
|
+
constructor(reflector) {
|
|
20
|
+
this.reflector = reflector;
|
|
21
|
+
}
|
|
22
|
+
canActivate(context) {
|
|
23
|
+
const isPublic = this.reflector.getAllAndOverride(public_decorator_1.IS_PUBLIC_KEY, [
|
|
24
|
+
context.getHandler(),
|
|
25
|
+
context.getClass(),
|
|
26
|
+
]);
|
|
27
|
+
if (isPublic) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
const requiredRoles = this.reflector.getAllAndOverride(roles_decorator_1.ROLES_KEY, [context.getHandler(), context.getClass()]);
|
|
31
|
+
if (!requiredRoles || requiredRoles.length === 0) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
const request = context
|
|
35
|
+
.switchToHttp()
|
|
36
|
+
.getRequest();
|
|
37
|
+
const user = request.user;
|
|
38
|
+
if (!user || !user.role) {
|
|
39
|
+
throw new common_1.ForbiddenException('Insufficient permissions');
|
|
40
|
+
}
|
|
41
|
+
if (!requiredRoles.includes(user.role)) {
|
|
42
|
+
throw new common_1.ForbiddenException('Insufficient permissions');
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
exports.RolesGuard = RolesGuard;
|
|
48
|
+
exports.RolesGuard = RolesGuard = __decorate([
|
|
49
|
+
(0, common_1.Injectable)(),
|
|
50
|
+
__metadata("design:paramtypes", [core_1.Reflector])
|
|
51
|
+
], RolesGuard);
|
|
52
|
+
//# sourceMappingURL=roles.guard.js.map
|