UNPKG

@crowdin/crowdin-api-client

Version:
31 lines (30 loc) 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Dictionaries = void 0; const core_1 = require("../core"); /** * Dictionaries allow you to create a storage of words that should be skipped by the spell checker. * * Use API to get the list of organization dictionaries and to edit a specific dictionary. */ class Dictionaries extends core_1.CrowdinApi { listDictionaries(projectId, options) { if ((0, core_1.isOptionalString)(options, '1' in arguments)) { options = { languageIds: options }; } let url = `${this.url}/projects/${projectId}/dictionaries`; url = this.addQueryParam(url, 'languageIds', options.languageIds); return this.get(url, this.defaultConfig()); } /** * @param projectId project identifier * @param languageId language identifier * @param request request body * @see https://developer.crowdin.com/api/v2/#operation/api.projects.dictionaries.patch */ editDictionary(projectId, languageId, request) { const url = `${this.url}/projects/${projectId}/dictionaries/${languageId}`; return this.patch(url, request, this.defaultConfig()); } } exports.Dictionaries = Dictionaries;