UNPKG

@crowdin/crowdin-api-client

Version:
101 lines (100 loc) 4.37 kB
import { CrowdinApi, DownloadLink, PaginationOptions, PatchRequest, ResponseList, ResponseObject, Status } from '../core'; import { SourceFilesModel } from '../sourceFiles'; export declare class Bundles extends CrowdinApi { /** * @param projectId project identifier * @param options optional parameters for the request * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.getMany */ listBundles(projectId: number, options?: PaginationOptions): Promise<ResponseList<BundlesModel.Bundle>>; /** * @param projectId project identifier * @param request request body * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.post */ addBundle(projectId: number, request: BundlesModel.CreateBundleRequest): Promise<ResponseObject<BundlesModel.Bundle>>; /** * @param projectId project identifier * @param bundleId bundle identifier * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.get */ getBundle(projectId: number, bundleId: number): Promise<ResponseObject<BundlesModel.Bundle>>; /** * @param projectId project identifier * @param bundleId bundle identifier * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.delete */ deleteBundle(projectId: number, bundleId: number): Promise<void>; /** * @param projectId project identifier * @param bundleId bundle identifier * @param request request body * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.patch */ editBundle(projectId: number, bundleId: number, request: PatchRequest[]): Promise<ResponseObject<BundlesModel.Bundle>>; /** * @param projectId project identifier * @param bundleId bundle identifier * @param exportId export identifier * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.exports.download.get */ downloadBundle(projectId: number, bundleId: number, exportId: string): Promise<ResponseObject<DownloadLink>>; /** * @param projectId project identifier * @param bundleId bundle identifier * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.exports.post */ exportBundle(projectId: number, bundleId: number): Promise<ResponseObject<Status<BundlesModel.ExportAttributes>>>; /** * @param projectId project identifier * @param bundleId bundle identifier * @param exportId export identifier * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.exports.get */ checkBundleExportStatus(projectId: number, bundleId: number, exportId: string): Promise<ResponseObject<Status<BundlesModel.ExportAttributes>>>; /** * @param projectId project identifier * @param bundleId bundle identifier * @param options optional parameters for the request * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.files.getMany */ listBundleFiles(projectId: number, bundleId: number, options?: PaginationOptions): Promise<ResponseList<SourceFilesModel.File>>; /** * @param projectId project identifier * @param bundleId bundle identifier * @param options optional parameters for the request */ listBundleBranches(projectId: number, bundleId: number, options?: PaginationOptions): Promise<ResponseList<SourceFilesModel.Branch>>; } export declare namespace BundlesModel { interface Bundle { id: number; name: string; format: string; sourcePatterns: string[]; ignorePatterns: string[]; exportPattern: string; isMultilingual: boolean; includeProjectSourceLanguage: boolean; labelIds: number[]; excludeLabelIds: number[]; createdAt: string; webUrl: string; updatedAt: string; } interface CreateBundleRequest { name: string; format: string; sourcePatterns: string[]; ignorePatterns?: string[]; exportPattern: string; isMultilingual?: boolean; includeProjectSourceLanguage?: boolean; includeInContextPseudoLanguage?: boolean; labelIds?: number[]; excludeLabelIds?: number[]; } interface ExportAttributes { bundleId: number; } }