| 1 | import { RequestMethod } from '@nestjs/common'; |
| 2 | |
| 3 | /** Git's smart-HTTP endpoints. Clients append these paths to the clone URL, so they have to sit at the root rather than behind the `/api` prefix - they are the only routes excluded from it. */ |
| 4 | export const GIT_PACK_ROUTES = |
| 5 | { path: ':username/:repo/git-upload-pack', |
| 6 | { path: ':username/:repo/git-receive-pack', |
| 7 | ]; |
| 8 | |
| 9 | /** Git LFS's batch API, basic transfer and locking API, which the client finds under the clone URL. */ |
| 10 | export const LFS_ROUTES = |
| 11 | { |
| 12 | path: ':username/:repo/info/lfs/objects/batch', |
| 13 | method: RequestMethod.POST |
| 14 | }, |
| 15 | { path: ':username/:repo/info/lfs/objects/:oid', |
| 16 | { path: ':username/:repo/info/lfs/objects/:oid', |
| 17 | { path: ':username/:repo/info/lfs/locks', |
| 18 | { path: ':username/:repo/info/lfs/locks', |
| 19 | { path: ':username/:repo/info/lfs/locks/verify', |
| 20 | { |
| 21 | path: ':username/:repo/info/lfs/locks/:id/unlock', |
| 22 | method: RequestMethod.POST |
| 23 | }, |
| 24 | ]; |
| 25 | |
| 26 | export const GIT_TRANSPORT_ROUTES = |
| 27 | { path: ':username/:repo/info/refs', |
| 28 | ...GIT_PACK_ROUTES, |
| 29 | ...LFS_ROUTES, |
| 30 | ]; |