mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-18 15:55:30 +00:00
74 lines
2.3 KiB
TypeScript
74 lines
2.3 KiB
TypeScript
import type { BaseResourceOptions } from '@gitbeaker/requester-utils';
|
|
import { ResourceDiscussions } from '../templates';
|
|
import {
|
|
type GitlabAPIResponse,
|
|
type PaginationRequestOptions,
|
|
type PaginationTypes,
|
|
RawPathSegment,
|
|
type ShowExpanded,
|
|
type Sudo,
|
|
} from '../infrastructure';
|
|
import type {
|
|
DiscussionNotePositionOptions,
|
|
DiscussionNoteSchema,
|
|
DiscussionSchema,
|
|
} from '../templates/ResourceDiscussions';
|
|
|
|
export interface CommitDiscussions<C extends boolean = false> extends ResourceDiscussions<C> {
|
|
addNote<E extends boolean = false>(
|
|
projectId: string | number,
|
|
commitId: string,
|
|
discussionId: string,
|
|
body: string,
|
|
options?: { createdAt?: string } & Sudo & ShowExpanded<E>,
|
|
): Promise<GitlabAPIResponse<DiscussionNoteSchema, C, E, void>>;
|
|
|
|
all<E extends boolean = false, P extends PaginationTypes = 'offset'>(
|
|
projectId: string | number,
|
|
commitId: string,
|
|
options?: PaginationRequestOptions<P> & Sudo & ShowExpanded<E>,
|
|
): Promise<GitlabAPIResponse<DiscussionSchema[], C, E, P>>;
|
|
|
|
create<E extends boolean = false>(
|
|
projectId: string | number,
|
|
commitId: string,
|
|
body: string,
|
|
options?: {
|
|
position?: DiscussionNotePositionOptions;
|
|
commitId?: string;
|
|
createdAt?: string;
|
|
} & Sudo &
|
|
ShowExpanded<E>,
|
|
): Promise<GitlabAPIResponse<DiscussionSchema, C, E, void>>;
|
|
|
|
editNote<E extends boolean = false>(
|
|
projectId: string | number,
|
|
commitId: string,
|
|
discussionId: string,
|
|
noteId: number,
|
|
options?: Sudo & ShowExpanded<E> & { body?: string },
|
|
): Promise<GitlabAPIResponse<DiscussionNoteSchema, C, E, void>>;
|
|
|
|
removeNote<E extends boolean = false>(
|
|
projectId: string | number,
|
|
commitId: string,
|
|
discussionId: string,
|
|
noteId: number,
|
|
options?: Sudo & ShowExpanded<E>,
|
|
): Promise<GitlabAPIResponse<void, C, E, void>>;
|
|
|
|
show<E extends boolean = false>(
|
|
projectId: string | number,
|
|
commitId: string,
|
|
discussionId: string,
|
|
options?: Sudo & ShowExpanded<E>,
|
|
): Promise<GitlabAPIResponse<DiscussionSchema, C, E, void>>;
|
|
}
|
|
|
|
export class CommitDiscussions<C extends boolean = false> extends ResourceDiscussions<C> {
|
|
constructor(options: BaseResourceOptions<C>) {
|
|
/* istanbul ignore next */
|
|
super('projects', new RawPathSegment('repository/commits'), options);
|
|
}
|
|
}
|