@svartz/plugin-submissions/commits
14 exported symbols.
Classes
| c CommitsUnavailable | GitHub can't be asked right now: the shared pause holds, this reader's requests are spent, or GitHub failed. |
Interfaces
| i Commit | A commit on the content branch. |
| i CommitReader | Reads one request's worth of commits. Make one per request with `commitReader`. |
| i CommitSource | What reading a vault's commits takes: JSON, for the reader's server data. Holds no secret, only where they are. |
Types
| t FileAt | The content at a commit, or why there is none to show. |
Functions
| f commitReader | Reads commits for one vault. The answer makes a `CommitReader` per request; installation tokens and file contents are kept across requests in this worker. Pass `token` to share one `sourceToken` with a writer. |
| f commitSource | What reading the vault's commits takes, or `undefined` when no submissions plugin keeps its mirror. Call it from `emitArtifacts` with `enforce: "post"`: the vault's folder in the repository is what the submissions plugin's own `emitArtifacts` read from git. |
| f mirrorsCommits | Whether one of a vault's `plugins` is a submissions plugin keeping the GitHub mirror. For a plugin's `forVault`. |
| f routeClaimsOf | The routes the vault's pages hold, hidden and protected ones included, which a page's frontmatter can claim: what `@svartz/plugin-submissions/restore` checks a restored revision against. From `emitArtifacts` with `enforce: "post"`, as `commitSource`; `undefined` without the submissions plugin. |
| f sourceToken | The token `source`'s credentials authenticate with: the configured one, or the App's installation token, kept. |
Variables
| v GITHUB_PAGE_SIZE | Commits per page of GitHub's list, its most. |
| v MAX_FILE_BYTES | File content larger than this isn't read; a note the editor accepts is far smaller. |
| v MAX_GITHUB_READS | GitHub requests one reader may make: what the costliest page, a diff of two revisions the mirror doesn't hold, needs. That is the default branch's name, when neither config nor the mirror knows it, then for each revision the check that the branch holds it, the commit, and the page's file at it. |
| v RECENT_PAGE_SIZE | Commits per page of `CommitReader.recent`. |