UNPKG

@crowdin/crowdin-api-client

Version:
102 lines (101 loc) 4.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Bundles = void 0; const core_1 = require("../core"); class Bundles extends core_1.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, options) { const url = `${this.url}/projects/${projectId}/bundles`; return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset); } /** * @param projectId project identifier * @param request request body * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.post */ addBundle(projectId, request) { const url = `${this.url}/projects/${projectId}/bundles`; return this.post(url, request, this.defaultConfig()); } /** * @param projectId project identifier * @param bundleId bundle identifier * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.get */ getBundle(projectId, bundleId) { const url = `${this.url}/projects/${projectId}/bundles/${bundleId}`; return this.get(url, this.defaultConfig()); } /** * @param projectId project identifier * @param bundleId bundle identifier * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.delete */ deleteBundle(projectId, bundleId) { const url = `${this.url}/projects/${projectId}/bundles/${bundleId}`; return this.delete(url, this.defaultConfig()); } /** * @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, bundleId, request) { const url = `${this.url}/projects/${projectId}/bundles/${bundleId}`; return this.patch(url, request, this.defaultConfig()); } /** * @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, bundleId, exportId) { const url = `${this.url}/projects/${projectId}/bundles/${bundleId}/exports/${exportId}/download`; return this.get(url, this.defaultConfig()); } /** * @param projectId project identifier * @param bundleId bundle identifier * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.exports.post */ exportBundle(projectId, bundleId) { const url = `${this.url}/projects/${projectId}/bundles/${bundleId}/exports`; return this.post(url, undefined, this.defaultConfig()); } /** * @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, bundleId, exportId) { const url = `${this.url}/projects/${projectId}/bundles/${bundleId}/exports/${exportId}`; return this.get(url, this.defaultConfig()); } /** * @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, bundleId, options) { const url = `${this.url}/projects/${projectId}/bundles/${bundleId}/files`; return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset); } /** * @param projectId project identifier * @param bundleId bundle identifier * @param options optional parameters for the request */ listBundleBranches(projectId, bundleId, options) { const url = `${this.url}/projects/${projectId}/bundles/${bundleId}/branches`; return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset); } } exports.Bundles = Bundles;