import { BaseResource } from '@gitbeaker/requester-utils'; import { RequestHelper, endpoint } from '../infrastructure'; import type { GitlabAPIResponse, ShowExpanded, Sudo } from '../infrastructure'; export interface LintSchema extends Record { valid: boolean; merged_yaml?: string; errors?: string[]; warnings?: string[]; } export class Lint extends BaseResource { check( projectId: string | number, options: { ref?: string; includeJobs?: boolean; dryRun?: boolean } & Sudo & ShowExpanded, ): Promise> { return RequestHelper.get()(this, endpoint`projects/${projectId}/ci/lint`, options); } lint( projectId: string | number, content: string, options?: { ref?: string; includeJobs?: boolean; dryRun?: boolean; } & Sudo & ShowExpanded, ): Promise> { return RequestHelper.post()(this, endpoint`projects/${projectId}/ci/lint`, { ...options, content, }); } }