UNPKG

modrinthjs

Version:
88 lines (87 loc) 3.86 kB
import type { CreateVersionBody } from '../models/CreateVersionBody'; import type { EditableVersion } from '../models/EditableVersion'; import type { Schedule } from '../models/Schedule'; import type { Version } from '../models/Version'; import type { CancelablePromise } from '../core/CancelablePromise'; export declare class VersionsService { /** * List project's versions * @param idSlug The ID or slug of the project * @param loaders The types of loaders to filter for * @param gameVersions The game versions to filter for * @param featured Allows to filter for featured or non-featured versions only * @returns Version Expected response to a valid request * @throws ApiError */ static getProjectVersions(idSlug: string, loaders?: string, gameVersions?: string, featured?: boolean): CancelablePromise<Array<Version>>; /** * Get a version * @param id The ID of the version * @returns Version Expected response to a valid request * @throws ApiError */ static getVersion(id: string): CancelablePromise<Version>; /** * Modify a version * @param id The ID of the version * @param requestBody Modified version fields * @returns void * @throws ApiError */ static modifyVersion(id: string, requestBody?: EditableVersion): CancelablePromise<void>; /** * Delete a version * @param id The ID of the version * @returns void * @throws ApiError */ static deleteVersion(id: string): CancelablePromise<void>; /** * Get a version given a version number or ID * Please note that, if the version number provided matches multiple versions, only the **oldest matching version** will be returned. * @param idSlug The ID or slug of the project * @param idNumber The version ID or version number * @returns Version Expected response to a valid request * @throws ApiError */ static getVersionFromIdOrNumber(idSlug: string, idNumber: string): CancelablePromise<Version>; /** * Create a version * This route creates a version on an existing project. There must be at least one file attached to each new version, unless the new version's status is `draft`. `.mrpack`, `.jar`, `.zip`, and `.litemod` files are accepted. * * The request is a [multipart request](https://www.ietf.org/rfc/rfc2388.txt) with at least two form fields: one is `data`, which includes a JSON body with the version metadata as shown below, and at least one field containing an upload file. * * You can name the file parts anything you would like, but you must list each of the parts' names in `file_parts`, and optionally, provide one to use as the primary file in `primary_file`. * * @param formData New version * @returns Version Expected response to a valid request * @throws ApiError */ static createVersion(formData?: CreateVersionBody): CancelablePromise<Version>; /** * Schedule a version * @param id The ID of the version * @param requestBody Information about date and requested status * @returns void * @throws ApiError */ static scheduleVersion(id: string, requestBody?: Schedule): CancelablePromise<void>; /** * Get multiple versions * @param ids The IDs of the versions * @returns Version Expected response to a valid request * @throws ApiError */ static getVersions(ids: string): CancelablePromise<Array<Version>>; /** * Add files to version * Project files are attached. `.mrpack` and `.jar` files are accepted. * @param id The ID of the version * @param formData New version files * @returns void * @throws ApiError */ static addFilesToVersion(id: string, formData?: { data?: Record<string, any>; }): CancelablePromise<void>; }