import { Repo } from "./repo"; import { RepoItem } from "./repoItem"; /** * Service for interacting with remote repositories */ export interface RepoService { /** * List all repos belonging to an owner * * @returns {Promise} Repos */ listRepos: () => Promise; /** * Get a repo * * @param {string} repoName Repo name * @returns {Promise} Repo */ getRepo: (repoName: string) => Promise; /** * Create a repo * * @param {Repo} repoName Repo to create * @returns {Promise} Newly created repo */ createRepo: (repoName: string) => Promise; /** * Deletes a repo * * @param {string} repoName Repo name */ deleteRepo: (repoName: string) => Promise; /** * List items in the repo at a given path and/or branch * * @param {string} repoName Repo name * @param {string|undefined} path Path within repo * @param {string|undefined} branch Branch of repo * @returns {Promise} Repo items */ listRepoItems: (repoName: string, path?: string, includeContent?: boolean, branch?: string) => Promise; /** * Gets repo item in the repo at a given path and/or branch * * @param {string} repoName Repo name * @param {string|undefined} path Path within repo * @param {string|undefined} branch Branch of repo * @returns {Promise} Repo item */ getRepoItem: (repoName: string, path?: string, includeContent?: boolean, branch?: string) => Promise; /** * Gets the latest commit for a repo at a given branch or default branch * * @param {string} repoName Repo name * @param {string|undefined} branch Branch of repo * @returns {Promise} Commit SHA */ latestCommit: (repoName: string, branch?: string) => Promise; /** * Downloads a repo item to a local path * * @param {string} repoName Repo name * @param {string|undefined} path Path within repo * @param {string|undefined} branch Branch of repo * @param {string|undefined} outputPath Relative local path. Uses name of repo item as default */ downloadRepoItem: (repoName: string, path?: string, outputPath?: string, branch?: string) => Promise; }