UNPKG

2.47 kBTypeScriptView Raw
1import { BaseRequestOptions, BaseService, PaginatedRequestOptions, Sudo } from '../infrastructure';
2export interface CommitSchema {
3 id: string;
4 short_id: string;
5 created_at: Date;
6 parent_ids?: string[];
7 title: string;
8 message: string;
9 author_name: string;
10 author_email: string;
11 authored_date?: Date;
12 committer_name?: string;
13 committer_email?: string;
14 committed_date?: Date;
15}
16interface CommitAction {
17 /** The action to perform */
18 action: 'create' | 'delete' | 'move' | 'update';
19 /** Full path to the file. Ex. lib/class.rb */
20 filePath: string;
21 /** Original full path to the file being moved.Ex.lib / class1.rb */
22 previousPath?: string;
23 /** File content, required for all except delete. Optional for move */
24 content?: string;
25 /** text or base64. text is default. */
26 encoding?: string;
27 /** Last known file commit id. Will be only considered in update, move and delete actions. */
28 lastCommitId?: string;
29}
30export declare class Commits extends BaseService {
31 all(projectId: string | number, options?: PaginatedRequestOptions): Promise<import("../infrastructure").GetResponse>;
32 cherryPick(projectId: string | number, sha: string, branch: string, options?: Sudo): Promise<object>;
33 comments(projectId: string | number, sha: string, options?: Sudo): Promise<import("../infrastructure").GetResponse>;
34 create(projectId: string | number, branch: string, message: string, actions?: CommitAction[], options?: BaseRequestOptions): Promise<object>;
35 createComment(projectId: string | number, sha: string, note: string, options?: BaseRequestOptions): Promise<object>;
36 diff(projectId: string | number, sha: string, options?: Sudo): Promise<import("../infrastructure").GetResponse>;
37 editStatus(projectId: string | number, sha: string, options?: BaseRequestOptions): Promise<object>;
38 references(projectId: string | number, sha: string, options?: Sudo): Promise<import("../infrastructure").GetResponse>;
39 show(projectId: string | number, sha: string, options?: BaseRequestOptions): Promise<import("../infrastructure").GetResponse>;
40 status(projectId: string | number, sha: string, options?: BaseRequestOptions): Promise<import("../infrastructure").GetResponse>;
41 mergeRequests(projectId: string | number, sha: string, options?: BaseRequestOptions): Promise<import("../infrastructure").GetResponse>;
42}
43export {};