Skip to content
Svartz v2.6.0

@svartz/plugin-submissions/commits

14 exported symbols.

Classes

c CommitsUnavailableGitHub can't be asked right now: the shared pause holds, this reader's requests are spent, or GitHub failed.

Interfaces

i CommitA commit on the content branch.
i CommitReaderReads one request's worth of commits. Make one per request with `commitReader`.
i CommitSourceWhat reading a vault's commits takes: JSON, for the reader's server data. Holds no secret, only where they are.

Types

t FileAtThe content at a commit, or why there is none to show.

Functions

f commitReaderReads 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 commitSourceWhat 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 mirrorsCommitsWhether one of a vault's `plugins` is a submissions plugin keeping the GitHub mirror. For a plugin's `forVault`.
f routeClaimsOfThe 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 sourceTokenThe token `source`'s credentials authenticate with: the configured one, or the App's installation token, kept.

Variables

v GITHUB_PAGE_SIZECommits per page of GitHub's list, its most.
v MAX_FILE_BYTESFile content larger than this isn't read; a note the editor accepts is far smaller.
v MAX_GITHUB_READSGitHub 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_SIZECommits per page of `CommitReader.recent`.