@crowdin/crowdin-api-client
Advanced tools
Comparing version 1.22.2 to 1.23.0
@@ -1,2 +0,2 @@ | ||
import { CrowdinApi, PaginationOptions, PatchRequest, ResponseList, ResponseObject } from '../core'; | ||
import { CrowdinApi, DownloadLink, PaginationOptions, PatchRequest, ResponseList, ResponseObject, Status } from '../core'; | ||
import { SourceFilesModel } from '../sourceFiles'; | ||
@@ -38,2 +38,22 @@ export declare class Bundles extends CrowdinApi { | ||
* @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 | ||
@@ -51,2 +71,3 @@ * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.files.getMany | ||
exportPattern: string; | ||
isMultilingual: boolean; | ||
labelIds: number[]; | ||
@@ -62,2 +83,3 @@ createdAt: string; | ||
exportPattern: string; | ||
isMultilingual?: boolean; | ||
labelIds?: number[]; | ||
@@ -76,2 +98,5 @@ } | ||
} | ||
interface ExportAttributes { | ||
bundleId: number; | ||
} | ||
} |
@@ -55,2 +55,31 @@ "use strict"; | ||
* @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 | ||
@@ -57,0 +86,0 @@ * @see https://developer.crowdin.com/api/v2/#operation/api.projects.bundles.files.getMany |
@@ -97,2 +97,3 @@ import { HttpClientError } from './http-client-error'; | ||
finishedAt: string; | ||
eta: string; | ||
} | ||
@@ -99,0 +100,0 @@ export interface Attribute { |
@@ -10,2 +10,3 @@ import { Bundles } from './bundles'; | ||
import { MachineTranslation } from './machineTranslation'; | ||
import { OrganizationWebhooks } from './organizationWebhooks'; | ||
import { ProjectsGroups } from './projectsGroups'; | ||
@@ -21,4 +22,4 @@ import { Reports } from './reports'; | ||
import { TranslationMemory } from './translationMemory'; | ||
import { TranslationStatus } from './translationStatus'; | ||
import { Translations } from './translations'; | ||
import { TranslationStatus } from './translationStatus'; | ||
import { UploadStorage } from './uploadStorage'; | ||
@@ -38,2 +39,3 @@ import { Users } from './users'; | ||
export * from './machineTranslation'; | ||
export * from './organizationWebhooks'; | ||
export * from './projectsGroups'; | ||
@@ -49,4 +51,4 @@ export * from './reports'; | ||
export * from './translationMemory'; | ||
export * from './translationStatus'; | ||
export * from './translations'; | ||
export * from './translationStatus'; | ||
export * from './uploadStorage'; | ||
@@ -74,2 +76,3 @@ export * from './users'; | ||
readonly webhooksApi: Webhooks; | ||
readonly organizationWebhooksApi: OrganizationWebhooks; | ||
readonly machineTranslationApi: MachineTranslation; | ||
@@ -76,0 +79,0 @@ readonly stringTranslationsApi: StringTranslations; |
@@ -26,2 +26,3 @@ "use strict"; | ||
const machineTranslation_1 = require("./machineTranslation"); | ||
const organizationWebhooks_1 = require("./organizationWebhooks"); | ||
const projectsGroups_1 = require("./projectsGroups"); | ||
@@ -37,4 +38,4 @@ const reports_1 = require("./reports"); | ||
const translationMemory_1 = require("./translationMemory"); | ||
const translationStatus_1 = require("./translationStatus"); | ||
const translations_1 = require("./translations"); | ||
const translationStatus_1 = require("./translationStatus"); | ||
const uploadStorage_1 = require("./uploadStorage"); | ||
@@ -54,2 +55,3 @@ const users_1 = require("./users"); | ||
__exportStar(require("./machineTranslation"), exports); | ||
__exportStar(require("./organizationWebhooks"), exports); | ||
__exportStar(require("./projectsGroups"), exports); | ||
@@ -65,4 +67,4 @@ __exportStar(require("./reports"), exports); | ||
__exportStar(require("./translationMemory"), exports); | ||
__exportStar(require("./translationStatus"), exports); | ||
__exportStar(require("./translations"), exports); | ||
__exportStar(require("./translationStatus"), exports); | ||
__exportStar(require("./uploadStorage"), exports); | ||
@@ -92,2 +94,3 @@ __exportStar(require("./users"), exports); | ||
this.webhooksApi = new webhooks_1.Webhooks(credentials, config); | ||
this.organizationWebhooksApi = new organizationWebhooks_1.OrganizationWebhooks(credentials, config); | ||
this.machineTranslationApi = new machineTranslation_1.MachineTranslation(credentials, config); | ||
@@ -94,0 +97,0 @@ this.stringTranslationsApi = new stringTranslations_1.StringTranslations(credentials, config); |
import { CrowdinApi, PaginationOptions, PatchRequest, ResponseList, ResponseObject } from '../core'; | ||
import { ScreenshotsModel } from '../screenshots'; | ||
import { SourceStringsModel } from '../sourceStrings'; | ||
@@ -47,5 +48,19 @@ export declare class Labels extends CrowdinApi { | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.labels.screenshots.post | ||
*/ | ||
assignLabelToScreenshots(projectId: number, labelId: number, request: LabelsModel.AssignLabelToScreenshotsRequet): Promise<ResponseList<ScreenshotsModel.Screenshot>>; | ||
/** | ||
* @param projectId project identifier | ||
* @param labelId label identifier | ||
* @param screenshotIds screenshot identifiers | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.labels.screenshots.deleteMany | ||
*/ | ||
unassignLabelFromScreenshots(projectId: number, labelId: number, screenshotIds: string): Promise<ResponseList<ScreenshotsModel.Screenshot>>; | ||
/** | ||
* @param projectId project identifier | ||
* @param labelId label identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.labels.strings.post | ||
*/ | ||
assignLabelToString(projectId: number, labelId: number, request: LabelsModel.AssignLabelToStringRequet): Promise<ResponseList<SourceStringsModel.String>>; | ||
assignLabelToString(projectId: number, labelId: number, request: LabelsModel.AssignLabelToStringsRequet): Promise<ResponseList<SourceStringsModel.String>>; | ||
/** | ||
@@ -67,5 +82,8 @@ * @param projectId project identifier | ||
} | ||
interface AssignLabelToStringRequet { | ||
interface AssignLabelToStringsRequet { | ||
stringIds: number[]; | ||
} | ||
interface AssignLabelToScreenshotsRequet { | ||
screenshotIds: number[]; | ||
} | ||
} |
@@ -54,2 +54,23 @@ "use strict"; | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.labels.screenshots.post | ||
*/ | ||
assignLabelToScreenshots(projectId, labelId, request) { | ||
const url = `${this.url}/projects/${projectId}/labels/${labelId}/screenshots`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param projectId project identifier | ||
* @param labelId label identifier | ||
* @param screenshotIds screenshot identifiers | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.labels.screenshots.deleteMany | ||
*/ | ||
unassignLabelFromScreenshots(projectId, labelId, screenshotIds) { | ||
let url = `${this.url}/projects/${projectId}/labels/${labelId}/screenshots`; | ||
url = this.addQueryParam(url, 'screenshotIds', screenshotIds); | ||
return this.delete(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param projectId project identifier | ||
* @param labelId label identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.labels.strings.post | ||
@@ -56,0 +77,0 @@ */ |
@@ -169,8 +169,5 @@ import { BooleanInt, CrowdinApi, DownloadLink, PaginationOptions, PatchRequest, ResponseList, ResponseObject } from '../core'; | ||
interface FilesBasedCreateProjectRequest { | ||
type?: Type; | ||
normalizePlaceholder?: boolean; | ||
saveMetaInfoInSource?: boolean; | ||
notificationSettings?: NotificationSettings; | ||
name: string; | ||
identifier: string; | ||
type?: Type; | ||
sourceLanguageId: string; | ||
@@ -183,2 +180,3 @@ targetLanguageIds?: string[]; | ||
translateDuplicates?: TranslateDuplicates; | ||
tagDetection?: TagDetection; | ||
isMtAllowed?: boolean; | ||
@@ -190,2 +188,3 @@ autoSubstitution?: boolean; | ||
useGlobalTm?: boolean; | ||
showTmSuggestionsDialects?: boolean; | ||
skipUntranslatedStrings?: boolean; | ||
@@ -199,4 +198,8 @@ skipUntranslatedFiles?: boolean; | ||
qaCheckCategories?: CheckCategories; | ||
qaChecksIgnorableCategories?: CheckCategories; | ||
languageMapping?: LanguageMapping; | ||
glossaryAccess?: boolean; | ||
notificationSettings?: NotificationSettings; | ||
normalizePlaceholder?: boolean; | ||
saveMetaInfoInSource?: boolean; | ||
} | ||
@@ -214,2 +217,3 @@ interface StringsBasedCreateProjectRequest { | ||
translateDuplicates?: TranslateDuplicates; | ||
tagsDetection?: TagDetection; | ||
isMtAllowed?: boolean; | ||
@@ -221,2 +225,3 @@ autoSubstitution?: boolean; | ||
useGlobalTm?: boolean; | ||
showTmSuggestionsDialects?: boolean; | ||
skipUntranslatedStrings?: boolean; | ||
@@ -230,5 +235,6 @@ skipUntranslatedFiles?: boolean; | ||
qaCheckCategories?: CheckCategories; | ||
qaChecksIgnorableCategories?: CheckCategories; | ||
languageMapping?: LanguageMapping; | ||
glossaryAccess?: boolean; | ||
notificationSettings?: NotificationSettings; | ||
glossaryAccess?: boolean; | ||
} | ||
@@ -245,8 +251,9 @@ interface CreateProjectEnterpriseRequest { | ||
translateDuplicates?: TranslateDuplicates; | ||
tagsDetection?: TagDetection; | ||
isMtAllowed?: boolean; | ||
autoSubstitution?: boolean; | ||
showTmSuggestionsDialects?: boolean; | ||
autoTranslateDialects?: boolean; | ||
publicDownloads?: boolean; | ||
hiddenStringsProofreadersAccess?: boolean; | ||
useGlobalTm?: boolean; | ||
delayedWorkflowStart?: boolean; | ||
@@ -256,2 +263,3 @@ skipUntranslatedStrings?: boolean; | ||
exportWithMinApprovalsCount?: number; | ||
exportStringsThatPassedWorkflow?: number; | ||
normalizePlaceholder?: boolean; | ||
@@ -264,2 +272,3 @@ saveMetaInfoInSource?: boolean; | ||
qaCheckCategories?: CheckCategories; | ||
qaChecksIgnorableCategories?: CheckCategories; | ||
customQaCheckIds?: number[]; | ||
@@ -272,2 +281,3 @@ languageMapping?: LanguageMapping; | ||
translateDuplicates: TranslateDuplicates; | ||
tagsDetection: TagDetection; | ||
glossaryAccess: boolean; | ||
@@ -282,3 +292,5 @@ isMtAllowed: boolean; | ||
exportWithMinApprovalsCount: number; | ||
exportStringsThatPassedWorkflow: boolean; | ||
autoTranslateDialects: boolean; | ||
showTmSuggestionsDialects: boolean; | ||
useGlobalTm: boolean; | ||
@@ -294,2 +306,3 @@ normalizePlaceholder: boolean; | ||
qaCheckCategories: CheckCategories; | ||
qaChecksIgnorableCategories: CheckCategories; | ||
customQaCheckIds: number[]; | ||
@@ -299,2 +312,10 @@ languageMapping: LanguageMapping; | ||
notificationSettings: NotificationSettings; | ||
defaultTmId: number; | ||
defaultGlossaryId: number; | ||
assignedGlossaries: number[]; | ||
assignedTms: { | ||
[id: string]: { | ||
priority: number; | ||
}; | ||
}; | ||
} | ||
@@ -305,2 +326,7 @@ enum Type { | ||
} | ||
enum TagDetection { | ||
AUTO = 0, | ||
COUNT_TAGS = 1, | ||
SKIP_TAGS = 2 | ||
} | ||
type JoinPolicy = 'open' | 'private'; | ||
@@ -322,2 +348,4 @@ type LanguageAccessPolicy = 'open' | 'moderate'; | ||
duplicate: boolean; | ||
ftl: boolean; | ||
android: boolean; | ||
} | ||
@@ -324,0 +352,0 @@ interface LanguageMapping { |
@@ -181,2 +181,8 @@ "use strict"; | ||
})(Type = ProjectsGroupsModel.Type || (ProjectsGroupsModel.Type = {})); | ||
let TagDetection; | ||
(function (TagDetection) { | ||
TagDetection[TagDetection["AUTO"] = 0] = "AUTO"; | ||
TagDetection[TagDetection["COUNT_TAGS"] = 1] = "COUNT_TAGS"; | ||
TagDetection[TagDetection["SKIP_TAGS"] = 2] = "SKIP_TAGS"; | ||
})(TagDetection = ProjectsGroupsModel.TagDetection || (ProjectsGroupsModel.TagDetection = {})); | ||
let TranslateDuplicates; | ||
@@ -183,0 +189,0 @@ (function (TranslateDuplicates) { |
@@ -123,2 +123,3 @@ import { CrowdinApi, PaginationOptions, PatchRequest, ResponseList, ResponseObject } from '../core'; | ||
tags: Tag[]; | ||
labels: number[]; | ||
createdAt: string; | ||
@@ -125,0 +126,0 @@ updatedAt: string; |
@@ -145,2 +145,8 @@ import { CrowdinApi, DownloadLink, PaginationOptions, PatchRequest, ResponseList, ResponseObject } from '../core'; | ||
* @param fileId file identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.files.preview.get | ||
*/ | ||
downloadFilePreview(projectId: number, fileId: number): Promise<ResponseObject<DownloadLink>>; | ||
/** | ||
* @param projectId project identifier | ||
* @param fileId file identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.files.download.get | ||
@@ -264,11 +270,12 @@ */ | ||
type: string; | ||
path: string; | ||
status: string; | ||
revisionId: number; | ||
status: string; | ||
priority: Priority; | ||
path: string; | ||
importOptions: SpreadsheetImportOptions | XmlImportOptions | OtherImportOptions | DocxFileImportOptions; | ||
importOptions: ImportOptions; | ||
exportOptions: GeneralExportOptions | PropertyExportOptions; | ||
excludedTargetLanguages: string[]; | ||
parserVersion: number; | ||
createdAt: string; | ||
updatedAt: string; | ||
excludedTargetLanguages: string[]; | ||
} | ||
@@ -282,3 +289,3 @@ interface CreateFileRequest { | ||
type?: FileType; | ||
importOptions?: SpreadsheetImportOptions | XmlImportOptions | OtherImportOptions | DocxFileImportOptions; | ||
importOptions?: ImportOptions; | ||
exportOptions?: GeneralExportOptions | PropertyExportOptions; | ||
@@ -291,3 +298,3 @@ attachLabelIds?: number[]; | ||
updateOption?: UpdateOption; | ||
importOptions?: SpreadsheetImportOptions | XmlImportOptions | OtherImportOptions | DocxFileImportOptions; | ||
importOptions?: ImportOptions; | ||
exportOptions?: GeneralExportOptions | PropertyExportOptions; | ||
@@ -297,2 +304,3 @@ attachLabelIds?: number[]; | ||
} | ||
type ImportOptions = SpreadsheetImportOptions | XmlImportOptions | OtherImportOptions | DocxFileImportOptions | HtmlFileImportOptions | HtmlFrontMatterFileImportOptions | MdxV1FileImportOptions; | ||
interface RestoreFile { | ||
@@ -346,2 +354,16 @@ revisionId: number; | ||
} | ||
interface HtmlFileImportOptions { | ||
excludedElements: string[]; | ||
contentSegmentation: boolean; | ||
srxStorageId: number; | ||
} | ||
interface HtmlFrontMatterFileImportOptions extends HtmlFileImportOptions { | ||
excludedFrontMatterElements: string[]; | ||
} | ||
interface MdxV1FileImportOptions { | ||
excludedFrontMatterElements: string[]; | ||
excludeCodeBlocks: boolean; | ||
contentSegmentation: boolean; | ||
srxStorageId: number; | ||
} | ||
interface OtherImportOptions { | ||
@@ -348,0 +370,0 @@ contentSegmentation: boolean; |
@@ -180,2 +180,11 @@ "use strict"; | ||
* @param fileId file identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.files.preview.get | ||
*/ | ||
downloadFilePreview(projectId, fileId) { | ||
const url = `${this.url}/projects/${projectId}/files/${fileId}/preview`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param projectId project identifier | ||
* @param fileId file identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.files.download.get | ||
@@ -182,0 +191,0 @@ */ |
@@ -38,2 +38,8 @@ import { BooleanInt, CrowdinApi, PaginationOptions, PatchRequest, ResponseList, ResponseObject } from '../core'; | ||
* @param projectId project identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.strings.batchPatch | ||
*/ | ||
stringBatchOperations(projectId: number, request: PatchRequest[]): Promise<ResponseList<SourceStringsModel.String>>; | ||
/** | ||
* @param projectId project identifier | ||
* @param stringId string identifier | ||
@@ -40,0 +46,0 @@ * @see https://developer.crowdin.com/api/v2/#operation/api.projects.strings.get |
@@ -48,2 +48,11 @@ "use strict"; | ||
* @param projectId project identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.projects.strings.batchPatch | ||
*/ | ||
stringBatchOperations(projectId, request) { | ||
const url = `${this.url}/projects/${projectId}/strings`; | ||
return this.patch(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param projectId project identifier | ||
* @param stringId string identifier | ||
@@ -50,0 +59,0 @@ * @see https://developer.crowdin.com/api/v2/#operation/api.projects.strings.get |
@@ -47,2 +47,14 @@ import { CrowdinApi, DownloadLink, PaginationOptions, PatchRequest, ResponseList, ResponseObject, Status } from '../core'; | ||
* @param tmId tm identifier | ||
* @param options optional paramerers for the request | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.getMany | ||
*/ | ||
listTmSegments(tmId: number, options?: PaginationOptions): Promise<ResponseList<TranslationMemoryModel.TMSegment>>; | ||
/** | ||
* @param tmId tm identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.post | ||
*/ | ||
addTmSegment(tmId: number, request: TranslationMemoryModel.AddTMSegment): Promise<ResponseObject<TranslationMemoryModel.TMSegment>>; | ||
/** | ||
* @param tmId tm identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.clear | ||
@@ -87,2 +99,36 @@ */ | ||
checkImportStatus(tmId: number, importId: string): Promise<ResponseObject<Status<TranslationMemoryModel.ImportTranslationMemoryAttribute>>>; | ||
/** | ||
* @param tmId tm identifier | ||
* @param segmentId segment identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.get | ||
*/ | ||
getTmSegment(tmId: number, segmentId: number): Promise<ResponseObject<TranslationMemoryModel.TMSegment>>; | ||
/** | ||
* @param tmId tm identifier | ||
* @param segmentId segment identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.delete | ||
*/ | ||
deleteTmSegment(tmId: number, segmentId: number): Promise<void>; | ||
/** | ||
* @param tmId tm identifier | ||
* @param segmentId segment identifier | ||
* @param recordId record identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.records.delete | ||
*/ | ||
deleteTmSegmentRecord(tmId: number, segmentId: number, recordId: number): Promise<void>; | ||
/** | ||
* @param tmId tm identifier | ||
* @param segmentId segment identifier | ||
* @param recordId record identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.records.patch | ||
*/ | ||
editTmSegmentRecord(tmId: number, segmentId: number, recordId: number, request: PatchRequest[]): Promise<ResponseObject<TranslationMemoryModel.TMSegment>>; | ||
/** | ||
* @param tmId tm identifier | ||
* @param segmentId segment identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.records.post | ||
*/ | ||
addTmSegmentRecords(tmId: number, segmentId: number, request: TranslationMemoryModel.AddTMSegment): Promise<ResponseObject<TranslationMemoryModel.TMSegment>>; | ||
} | ||
@@ -152,2 +198,23 @@ export declare namespace TranslationMemoryModel { | ||
} | ||
interface TMSegment { | ||
id: number; | ||
records: TMSegmentRecord[]; | ||
} | ||
interface TMSegmentRecord { | ||
id: number; | ||
languageId: string; | ||
text: string; | ||
usageCount: number; | ||
createdBy: number; | ||
updatedBy: number; | ||
createdAt: string; | ||
updatedAt: string; | ||
} | ||
interface AddTMSegment { | ||
records: AddTMSegmentRecord[]; | ||
} | ||
interface AddTMSegmentRecord { | ||
languageId: string; | ||
text: string; | ||
} | ||
} |
@@ -57,2 +57,20 @@ "use strict"; | ||
* @param tmId tm identifier | ||
* @param options optional paramerers for the request | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.getMany | ||
*/ | ||
listTmSegments(tmId, options) { | ||
const url = `${this.url}/tms/${tmId}/segments`; | ||
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset); | ||
} | ||
/** | ||
* @param tmId tm identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.post | ||
*/ | ||
addTmSegment(tmId, request) { | ||
const url = `${this.url}/tms/${tmId}/segments`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param tmId tm identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.clear | ||
@@ -118,3 +136,52 @@ */ | ||
} | ||
/** | ||
* @param tmId tm identifier | ||
* @param segmentId segment identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.get | ||
*/ | ||
getTmSegment(tmId, segmentId) { | ||
const url = `${this.url}/tms/${tmId}/segments/${segmentId}`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param tmId tm identifier | ||
* @param segmentId segment identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.delete | ||
*/ | ||
deleteTmSegment(tmId, segmentId) { | ||
const url = `${this.url}/tms/${tmId}/segments/${segmentId}`; | ||
return this.delete(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param tmId tm identifier | ||
* @param segmentId segment identifier | ||
* @param recordId record identifier | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.records.delete | ||
*/ | ||
deleteTmSegmentRecord(tmId, segmentId, recordId) { | ||
const url = `${this.url}/tms/${tmId}/segments/${segmentId}/records/${recordId}`; | ||
return this.delete(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param tmId tm identifier | ||
* @param segmentId segment identifier | ||
* @param recordId record identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.records.patch | ||
*/ | ||
editTmSegmentRecord(tmId, segmentId, recordId, request) { | ||
const url = `${this.url}/tms/${tmId}/segments/${segmentId}/records/${recordId}`; | ||
return this.patch(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param tmId tm identifier | ||
* @param segmentId segment identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.tms.segments.records.post | ||
*/ | ||
addTmSegmentRecords(tmId, segmentId, request) { | ||
const url = `${this.url}/tms/${tmId}/segments/${segmentId}/records`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
} | ||
exports.TranslationMemory = TranslationMemory; |
{ | ||
"name": "@crowdin/crowdin-api-client", | ||
"version": "1.22.2", | ||
"description": "JavaScript library for Crowdin API v2.", | ||
"version": "1.23.0", | ||
"description": "JavaScript library for Crowdin API", | ||
"main": "out/index.js", | ||
@@ -25,3 +25,16 @@ "types": "out/index.d.ts", | ||
"keywords": [ | ||
"Crowdin" | ||
"Crowdin", | ||
"API", | ||
"client", | ||
"JavaScript", | ||
"TypeScript", | ||
"localization", | ||
"translation", | ||
"i18n", | ||
"l10n", | ||
"crowdin-api-client", | ||
"crowdin-api", | ||
"crowdin-client", | ||
"crowdin-js", | ||
"crowdin-js-client" | ||
], | ||
@@ -28,0 +41,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
375651
69
8563