import { HeadersOption } from '@managed-api/commons-core'; import { Comment, Discussion } from '../definitions/comment'; import { Commit, CommitExtended, CommitReference, PGPSignature, X509Signature } from '../definitions/commit'; import { Diff } from '../definitions/diff'; import { MergeRequest } from '../definitions/merge_request'; import { CommonError, ErrorStrategyOption } from '../errorStrategy'; export interface GetCommitsRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project owned by the authenticated user. */ id: string | number; /** * The name of a repository branch, tag or revision range, or if not given the default branch. */ ref_name?: string; /** * Only commits after or on this date are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ. */ since?: string; /** * Only commits before or on this date are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ. */ until?: string; /** * The file path. */ path?: string; /** * Retrieve every commit from the repository. */ all?: boolean; /** * Stats about each commit are added to the response. */ with_stats?: boolean; /** * Follow only the first parent commit upon seeing a merge commit. */ first_parent?: boolean; /** * List commits in order. Possible values: default, topo. * Defaults to default, the commits are shown in reverse chronological order. */ order?: string; /** * Parse and include Git trailers for every commit: https://git-scm.com/docs/git-interpret-trailers */ trailers?: boolean; } export interface GetCommitsResponseOK extends Array { } export interface GetCommitsResponseError extends CommonError { } export interface CreateCommitRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project. */ id: string | number; body: { /** * Name of the branch to commit into. * To create a new branch, also provide either start_branch or start_sha, and optionally start_project. */ branch: string; /** * Commit message. */ commit_message: string; /** * Name of the branch to start the new branch from. */ start_branch?: string; /** * SHA of the commit to start the new branch from. */ start_sha?: string; /** * The project ID or URL-encoded path of the project to start the new branch from. Defaults to the value of id. */ start_project?: string | number; /** * An array of action hashes to commit as a batch. */ actions: { /** * The action to perform, create, delete, move, update, chmod. */ action: 'create' | 'delete' | 'move' | 'update' | 'chmod'; /** * Full path to the file. Ex. lib/class.rb */ file_path: string; /** * Original full path to the file being moved. Ex. lib/class1.rb. Only considered for move action. */ previous_path?: string; /** * File content, required for all except delete, chmod, and move. * Move actions that do not specify content preserve the existing file content, * and any other value of content overwrites the file content. */ content?: string; /** * text or base64. text is default. */ encoding?: 'text' | 'base64'; /** * Last known file commit ID. Only considered in update, move, and delete actions. */ last_commit_id?: string; /** * When true/false enables/disables the execute flag on the file. Only considered for chmod action. */ execute_filemode?: boolean; }[]; /** * Specify the commit author’s email address. */ author_email?: string; /** * Specify the commit author’s name. */ author_name?: string; /** * Include commit stats. Default is true. */ stats?: boolean; /** * When true overwrites the target branch with a new commit based on the start_branch or start_sha. */ force?: boolean; }; } export interface CreateCommitResponseOK extends CommitExtended { } export interface CreateCommitResponseError extends CommonError { } export interface GetCommitRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project owned by the authenticated user. */ id: string | number; /** * The commit hash or name of a repository branch or tag. */ sha: string; /** * Include commit stats. Default is true. */ stats?: boolean; } export interface GetCommitResponseOK extends CommitExtended { } export interface GetCommitResponseError extends CommonError { } export interface GetCommitReferencesRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project owned by the authenticated user. */ id: string | number; /** * The commit hash. */ sha: string; /** * The scope of commits. Possible values branch, tag, all. Default is all. */ type?: 'branch' | 'tag' | 'all'; /** * The pagination parameters page and per_page can be used to restrict the list of references. */ page?: number; /** * The pagination parameters page and per_page can be used to restrict the list of references. */ per_page?: number; } export interface GetCommitReferencesResponseOK extends Array { } export interface GetCommitReferencesResponseError extends CommonError { } export interface CherryPickCommitRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project owned by the authenticated user. */ id: string | number; /** * The commit hash. */ sha: string; body: { /** * The name of the branch. */ branch: string; /** * Does not commit any changes. Default is false. */ dry_run?: boolean; /** * A custom commit message to use for the new commit. */ message?: string; }; } export interface CherryPickCommitResponseOK extends Commit { } export interface CherryPickCommitResponseError extends CommonError { } export interface RevertCommitRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project. */ id: string | number; /** * Commit SHA to revert. */ sha: string; body: { /** * Target branch name. */ branch: string; /** * Does not commit any changes. Default is false. */ dry_run?: boolean; }; } export interface RevertCommitResponseOK extends Commit { } export interface RevertCommitResponseError extends CommonError { } export interface GetCommitDiffRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project owned by the authenticated user. */ id: string | number; /** * The commit hash or name of a repository branch or tag. */ sha: string; } export interface GetCommitDiffResponseOK extends Diff { } export interface GetCommitDiffResponseError extends CommonError { } export interface GetCommentsRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project owned by the authenticated user. */ id: string | number; /** * The commit hash or name of a repository branch or tag. */ sha: string; } export interface GetCommentsResponseOK extends Array { } export interface GetCommentsResponseError extends CommonError { } export interface CreateCommentRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project owned by the authenticated user. */ id: string | number; /** * The commit SHA or name of a repository branch or tag. */ sha: string; body: { /** * The text of the comment. */ note: string; /** * The file path relative to the repository. */ path?: string; /** * The line number where the comment should be placed. */ line?: number; /** * The line type. Takes new or old as arguments. */ line_type?: string; }; } export interface CreateCommentResponseOK extends Comment { } export interface CreateCommentResponseError extends CommonError { } export interface GetDiscussionsRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project owned by the authenticated user. */ id: string | number; /** * The commit SHA or name of a repository branch or tag. */ sha: string; } export interface GetDiscussionsResponseOK extends Array { } export interface GetDiscussionsResponseError extends CommonError { } export interface GetMergeRequestsRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project owned by the authenticated user. */ id: string | number; /** * The commit SHA. */ sha: string; } export interface GetMergeRequestsResponseOK extends Array { } export interface GetMergeRequestsResponseError extends CommonError { } export interface GetGPGSignatureRequest extends HeadersOption, ErrorStrategyOption { /** * The ID or URL-encoded path of the project owned by the authenticated user. */ id: string | number; /** * The commit hash or name of a repository branch or tag. */ sha: string; } export declare type GetGPGSignatureResponseOK = PGPSignature | X509Signature; export interface GetGPGSignatureResponseError extends CommonError { } //# sourceMappingURL=commit.d.ts.map