import type { BaseResourceOptions } from '@gitbeaker/requester-utils'; import { MarkdownUploadCreatedSchema, MarkdownUploadSchema, ResourceMarkdownUploads, } from '../templates'; import { type GitlabAPIResponse, type PaginationRequestOptions, type PaginationTypes, RequestHelper, type Sudo, endpoint, } from '../infrastructure'; export interface ProjectMarkdownUploads extends ResourceMarkdownUploads { create( projectId: string | number, file: { content: Blob; filename: string }, options?: Sudo, ): Promise>; all( projectId: string | number, options?: Sudo & PaginationRequestOptions

, ): Promise>; download( projectId: string | number, uploadId: string | number, options?: Sudo, ): Promise>; download( projectId: string | number, secret: string, filename: string, options?: Sudo, ): Promise>; remove( projectId: string | number, uploadId: string | number, options?: Sudo, ): Promise>; remove( projectId: string | number, secret: string, filename: string, options?: Sudo, ): Promise>; } export class ProjectMarkdownUploads extends ResourceMarkdownUploads { constructor(options: BaseResourceOptions) { /* istanbul ignore next */ super('projects', options); } create( projectId: string | number, file: { content: Blob; filename: string }, options?: Sudo, ): Promise> { return RequestHelper.post()(this, endpoint`${projectId}/uploads`, { isForm: true, ...options, file: [file.content, file.filename], }); } }