UNPKG

@crowdin/crowdin-api-client

Version:
93 lines (92 loc) 4.04 kB
import { CrowdinApi, PaginationOptions, PatchRequest, ResponseList, ResponseObject } from '../core'; export declare class Distributions extends CrowdinApi { /** * @param projectId project identifier * @param options optional pagination parameters for the request * @see https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.getMany */ listDistributions(projectId: number, options?: PaginationOptions): Promise<ResponseList<DistributionsModel.Distribution>>; /** * @param projectId project identifier * @param limit maximum number of items to retrieve (default 25) * @param offset starting offset in the collection (default 0) * @deprecated optional parameters should be passed through an object * @see https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.getMany */ listDistributions(projectId: number, limit?: number, offset?: number): Promise<ResponseList<DistributionsModel.Distribution>>; /** * @param projectId project identifier * @param request request body * @see https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.post */ createDistribution(projectId: number, request: DistributionsModel.CreateDistributionRequest | DistributionsModel.CreateDistributionStringsBasedRequest): Promise<ResponseObject<DistributionsModel.Distribution>>; /** * @param projectId project identifier * @param hash hash * @see https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.get */ getDistribution(projectId: number, hash: string): Promise<ResponseObject<DistributionsModel.Distribution>>; /** * @param projectId project identifier * @param hash hash * @see https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.delete */ deleteDistribution(projectId: number, hash: string): Promise<void>; /** * @param projectId project identifier * @param hash hash * @param request request body * @see https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.patch */ editDistribution(projectId: number, hash: string, request: PatchRequest[]): Promise<ResponseObject<DistributionsModel.Distribution>>; /** * @param projectId project identifier * @param hash hash * @see https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.release.get */ getDistributionRelease(projectId: number, hash: string): Promise<ResponseObject<DistributionsModel.DistributionRelease | DistributionsModel.DistributionStringsBasedRelease>>; /** * @param projectId project identifier * @param hash hash * @param request request body * @see https://developer.crowdin.com/api/v2/#operation/api.projects.distributions.release.post */ createDistributionRelease(projectId: number, hash: string): Promise<ResponseObject<DistributionsModel.DistributionRelease | DistributionsModel.DistributionStringsBasedRelease>>; } export declare namespace DistributionsModel { interface Distribution { hash: string; manifestUrl: string; name: string; bundleIds: number[]; createdAt: string; updatedAt: string; exportMode: ExportMode; fileIds: number[]; } interface CreateDistributionRequest { exportMode?: ExportMode; name: string; fileIds?: number[]; bundleIds?: number[]; } interface CreateDistributionStringsBasedRequest { name: string; bundleIds: number[]; } interface DistributionRelease { status: string; progress: number; currentLanguageId: string; currentFileId: number; date: string; } interface DistributionStringsBasedRelease { status: string; progress: number; currentLanguageId: string; currentBranchId: number; date: string; } type ExportMode = 'default' | 'bundle'; }