| 1 | /** What the Git LFS batch API speaks, in both directions. */ |
| 2 | export const LFS_MEDIA_TYPE = |
| 3 | |
| 4 | /** Where a repository's LFS objects live, or the prefix holding all of them. */ |
| 5 | export function lfsObjectKey(repositoryId |
| 6 | return `lfs/${repositoryId |
| 7 | } |
| 8 | |
| 9 | /** A SHA-256 in lowercase hex, the only hash Ghost accepts. It becomes part of an object key, so nothing else may pass. */ |
| 10 | export const LFS_OID = |
| 11 | |
| 12 | /** The LFS API of the repository at `owner/repo`, as git-lfs would derive it from the clone URL. */ |
| 13 | export function lfsEndpoint(baseUrl |
| 14 | return `${baseUrl} |
| 15 | } |
| 16 | |
| 17 | /** Where one upload's bytes wait until they are verified. `uploads` can never be an oid, so staging and stored objects share a repository's prefix without colliding. */ |
| 18 | export function lfsUploadKey(repositoryId |
| 19 | return `lfs/${repositoryId |
| 20 | } |