UNPKG

@atomist/automation-client

Version:

Atomist API for software low-level client

87 lines 3.13 kB
import { ActionResult } from "../../action/ActionResult"; import { Configurable } from "../../project/git/Configurable"; import { ProjectOperationCredentials } from "./ProjectOperationCredentials"; /** * Identifies a git repo */ export interface RepoId { owner: string; repo: string; /** * Entire url of the repo. Can be a file URL if this is local. */ url: string; } export declare class SimpleRepoId implements RepoId { readonly owner: string; readonly repo: string; readonly url: string; constructor(owner: string, repo: string, url?: string); } /** * Identifies a version of a git repo containing a potential project */ export interface RepoRef extends RepoId { sha?: string; /** * Path from root, using / syntax. If undefined or the empty string, use the root of the repo. */ path?: string; branch?: string; } /** * Supported SCM providers. */ export declare enum ProviderType { /** BitBucket server instances, maps to [[BitBucketServerRepoRef]] */ bitbucket = 0, /** Atlassian-hosted BitBucket cloud, maps to [[BitBucketRepoRef]] */ bitbucket_cloud = 1, /** GitHub.com, maps to [[GitHubRepoRef]] */ github_com = 2, /** GitHub Enterprise, maps to [[GitHubRepoRef]] */ ghe = 3, /** Gitlab.com, maps to [[GitlabRepoRef]] */ gitlab_com = 4, /** Gitlab Enterprise, maps to [[GitlabRepoRef]] */ gitlab_enterprise = 5 } /** * Identifies a git repo with a remote. * Also defines behavior for working with remote, such as * raising a pull request or equivalent */ export interface RemoteRepoRef extends RepoRef { /** @deprecated use providerType */ readonly kind: string; /** Base root remote clone */ readonly remoteBase: string; /** SCM provider of remote repo */ readonly providerType: ProviderType; /** * Return the clone URL for this to pass to git clone * @param {ProjectOperationCredentials} creds * @return {string} */ cloneUrl(creds: ProjectOperationCredentials): string; createRemote(creds: ProjectOperationCredentials, description: string, visibility: "private" | "public"): Promise<ActionResult<this>>; /** * Configure the local remote based on information from remote * @param {ProjectOperationCredentials} credentials * @param {Configurable} configurable * @return {Promise<ActionResult<any>>} */ setUserConfig(credentials: ProjectOperationCredentials, configurable: Configurable): Promise<ActionResult<any>>; raisePullRequest(credentials: ProjectOperationCredentials, title: string, body: string, head: string, base: string): Promise<ActionResult<this>>; deleteRemote(creds: ProjectOperationCredentials): Promise<ActionResult<this>>; } export declare function isRemoteRepoRef(r: RepoRef): r is RemoteRepoRef; /** * Identifies a git repo checked out in a local directory. * A RepoRef can be both Remote and Local */ export interface LocalRepoRef extends RepoRef { baseDir: string; } export declare function isLocalRepoRef(r: RepoRef): r is LocalRepoRef; //# sourceMappingURL=RepoId.d.ts.map