(req: Request, res: Response)
| 76 | } |
| 77 | |
| 78 | private async indexRepo(req: Request, res: Response) { |
| 79 | const schema = z.object({ |
| 80 | repoId: z.number(), |
| 81 | }).strict(); |
| 82 | |
| 83 | const parsed = schema.safeParse(req.body); |
| 84 | if (!parsed.success) { |
| 85 | res.status(400).json({ error: parsed.error.message }); |
| 86 | return; |
| 87 | } |
| 88 | |
| 89 | const { repoId } = parsed.data; |
| 90 | const repo = await this.prisma.repo.findUnique({ |
| 91 | where: { id: repoId }, |
| 92 | }); |
| 93 | |
| 94 | if (!repo) { |
| 95 | res.status(404).json({ error: 'Repo not found' }); |
| 96 | return; |
| 97 | } |
| 98 | |
| 99 | const [jobId] = await this.repoIndexManager.createJobs([repo], RepoIndexingJobType.INDEX); |
| 100 | res.status(200).json({ jobId }); |
| 101 | } |
| 102 | |
| 103 | private async triggerAccountPermissionSync(req: Request, res: Response) { |
| 104 | if (env.PERMISSION_SYNC_ENABLED !== 'true' || !await hasEntitlement('permission-syncing')) { |
nothing calls this directly
no test coverage detected