@crowdin/crowdin-api-client
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -20,2 +20,3 @@ import { ClientConfig, Credentials } from './core'; | ||
import { Vendors } from './vendors'; | ||
import { Issues } from './issues'; | ||
export * from './core'; | ||
@@ -40,2 +41,3 @@ export * from './sourceFiles'; | ||
export * from './vendors'; | ||
export * from './issues'; | ||
export default class Client { | ||
@@ -60,3 +62,4 @@ readonly sourceFilesApi: SourceFiles; | ||
readonly vendorsApi: Vendors; | ||
readonly issuesApi: Issues; | ||
constructor(credentials: Credentials, config?: ClientConfig); | ||
} |
@@ -24,2 +24,3 @@ "use strict"; | ||
const vendors_1 = require("./vendors"); | ||
const issues_1 = require("./issues"); | ||
__export(require("./core")); | ||
@@ -44,2 +45,3 @@ __export(require("./sourceFiles")); | ||
__export(require("./vendors")); | ||
__export(require("./issues")); | ||
class Client { | ||
@@ -65,4 +67,5 @@ constructor(credentials, config) { | ||
this.vendorsApi = new vendors_1.Vendors(credentials, config); | ||
this.issuesApi = new issues_1.Issues(credentials, config); | ||
} | ||
} | ||
exports.default = Client; |
@@ -5,28 +5,35 @@ import { CrowdinApi, ResponseList } from '../core'; | ||
* @param projectId project identifier | ||
* @param branchId branch identifier | ||
* @param limit maximum number of items to retrieve (default 25) | ||
* @param offset starting offset in the collection (default 0) | ||
* @param type defines the issue type | ||
* @param status defines the issue resolution status | ||
*/ | ||
listReportedIssues(projectId: number, limit?: number, offset?: number, type?: TranslationStatusModel.Type, status?: TranslationStatusModel.Status): Promise<ResponseList<TranslationStatusModel.Issue>>; | ||
getBranchProgress(projectId: number, branchId: number, limit?: number, offset?: number): Promise<ResponseList<TranslationStatusModel.LanguageProgress>>; | ||
/** | ||
* @param projectId project identifier | ||
* @param branchId branch identifier | ||
* @param directoryId directory identifier | ||
* @param limit maximum number of items to retrieve (default 25) | ||
* @param offset starting offset in the collection (default 0) | ||
*/ | ||
getBranchProgress(projectId: number, branchId: number): Promise<ResponseList<TranslationStatusModel.Progress>>; | ||
getDirectoryProgress(projectId: number, directoryId: number, limit?: number, offset?: number): Promise<ResponseList<TranslationStatusModel.LanguageProgress>>; | ||
/** | ||
* @param projectId project identifier | ||
* @param directoryId directory identifier | ||
* @param languageId language identifier | ||
* @param limit maximum number of items to retrieve (default 25) | ||
* @param offset starting offset in the collection (default 0) | ||
*/ | ||
getDirectoryProgress(projectId: number, directoryId: number): Promise<ResponseList<TranslationStatusModel.Progress>>; | ||
getLanguageProgress(projectId: number, languageId: string, limit?: number, offset?: number): Promise<ResponseList<TranslationStatusModel.FileProgress>>; | ||
/** | ||
* @param projectId project identifier | ||
* @param limit maximum number of items to retrieve (default 25) | ||
* @param offset starting offset in the collection (default 0) | ||
* @param languageIds language identifier for filter | ||
*/ | ||
getProjectProgress(projectId: number, languageIds?: string): Promise<ResponseList<TranslationStatusModel.Progress>>; | ||
getProjectProgress(projectId: number, limit?: number, offset?: number, languageIds?: string): Promise<ResponseList<TranslationStatusModel.LanguageProgress>>; | ||
/** | ||
* @param projectId project identifier | ||
* @param fileId file identifier | ||
* @param limit maximum number of items to retrieve (default 25) | ||
* @param offset starting offset in the collection (default 0) | ||
*/ | ||
getFileProgress(projectId: number, fileId: number): Promise<ResponseList<TranslationStatusModel.Progress>>; | ||
getFileProgress(projectId: number, fileId: number, limit?: number, offset?: number): Promise<ResponseList<TranslationStatusModel.LanguageProgress>>; | ||
/** | ||
@@ -43,26 +50,12 @@ * @param projectId project identifier | ||
export declare namespace TranslationStatusModel { | ||
enum Type { | ||
ALL = "all", | ||
GENERAL_QUESTION = "general_question", | ||
TRANSLATION_MISTAKE = "translation_mistake", | ||
CONTEXT_REQUEST = "context_request", | ||
SOURCE_MISTAKE = "source_mistake" | ||
} | ||
enum Status { | ||
ALL = "all", | ||
RESOLVED = "resolved", | ||
UNRESOLVED = "unresolved" | ||
} | ||
interface Issue { | ||
id: number; | ||
text: string; | ||
userId: number; | ||
stringId: number; | ||
interface LanguageProgress { | ||
languageId: string; | ||
type: string; | ||
status: string; | ||
createdAt: string; | ||
words: Words; | ||
phrases: Words; | ||
translationProgress: number; | ||
approvalProgress: number; | ||
eTag: string; | ||
} | ||
interface Progress { | ||
languageId: string; | ||
interface FileProgress { | ||
fileId: string; | ||
words: Words; | ||
@@ -72,2 +65,3 @@ phrases: Words; | ||
approvalProgress: number; | ||
eTag: string; | ||
} | ||
@@ -139,4 +133,4 @@ interface Words { | ||
pluralId: number; | ||
text: number; | ||
text: string; | ||
} | ||
} |
@@ -7,13 +7,10 @@ "use strict"; | ||
* @param projectId project identifier | ||
* @param branchId branch identifier | ||
* @param limit maximum number of items to retrieve (default 25) | ||
* @param offset starting offset in the collection (default 0) | ||
* @param type defines the issue type | ||
* @param status defines the issue resolution status | ||
*/ | ||
listReportedIssues(projectId, limit, offset, type, status) { | ||
let url = `${this.url}/projects/${projectId}/issues`; | ||
getBranchProgress(projectId, branchId, limit, offset) { | ||
let url = `${this.url}/projects/${projectId}/branches/${branchId}/languages/progress`; | ||
url = this.addQueryParam(url, 'limit', limit); | ||
url = this.addQueryParam(url, 'offset', offset); | ||
url = this.addQueryParam(url, 'type', type); | ||
url = this.addQueryParam(url, 'status', status); | ||
return this.get(url, this.defaultConfig()); | ||
@@ -23,6 +20,10 @@ } | ||
* @param projectId project identifier | ||
* @param branchId branch identifier | ||
* @param directoryId directory identifier | ||
* @param limit maximum number of items to retrieve (default 25) | ||
* @param offset starting offset in the collection (default 0) | ||
*/ | ||
getBranchProgress(projectId, branchId) { | ||
const url = `${this.url}/projects/${projectId}/branches/${branchId}/languages/progress`; | ||
getDirectoryProgress(projectId, directoryId, limit, offset) { | ||
let url = `${this.url}/projects/${projectId}/directories/${directoryId}/languages/progress`; | ||
url = this.addQueryParam(url, 'limit', limit); | ||
url = this.addQueryParam(url, 'offset', offset); | ||
return this.get(url, this.defaultConfig()); | ||
@@ -32,6 +33,10 @@ } | ||
* @param projectId project identifier | ||
* @param directoryId directory identifier | ||
* @param languageId language identifier | ||
* @param limit maximum number of items to retrieve (default 25) | ||
* @param offset starting offset in the collection (default 0) | ||
*/ | ||
getDirectoryProgress(projectId, directoryId) { | ||
const url = `${this.url}/projects/${projectId}/directories/${directoryId}/languages/progress`; | ||
getLanguageProgress(projectId, languageId, limit, offset) { | ||
let url = `${this.url}/projects/${projectId}/languages/${languageId}/progress`; | ||
url = this.addQueryParam(url, 'limit', limit); | ||
url = this.addQueryParam(url, 'offset', offset); | ||
return this.get(url, this.defaultConfig()); | ||
@@ -41,6 +46,10 @@ } | ||
* @param projectId project identifier | ||
* @param limit maximum number of items to retrieve (default 25) | ||
* @param offset starting offset in the collection (default 0) | ||
* @param languageIds language identifier for filter | ||
*/ | ||
getProjectProgress(projectId, languageIds) { | ||
getProjectProgress(projectId, limit, offset, languageIds) { | ||
let url = `${this.url}/projects/${projectId}/languages/progress`; | ||
url = this.addQueryParam(url, 'limit', limit); | ||
url = this.addQueryParam(url, 'offset', offset); | ||
url = this.addQueryParam(url, 'languageIds', languageIds); | ||
@@ -52,5 +61,9 @@ return this.get(url, this.defaultConfig()); | ||
* @param fileId file identifier | ||
* @param limit maximum number of items to retrieve (default 25) | ||
* @param offset starting offset in the collection (default 0) | ||
*/ | ||
getFileProgress(projectId, fileId) { | ||
const url = `${this.url}/projects/${projectId}/files/${fileId}/languages/progress`; | ||
getFileProgress(projectId, fileId, limit, offset) { | ||
let url = `${this.url}/projects/${projectId}/files/${fileId}/languages/progress`; | ||
url = this.addQueryParam(url, 'limit', limit); | ||
url = this.addQueryParam(url, 'offset', offset); | ||
return this.get(url, this.defaultConfig()); | ||
@@ -79,16 +92,2 @@ } | ||
(function (TranslationStatusModel) { | ||
let Type; | ||
(function (Type) { | ||
Type["ALL"] = "all"; | ||
Type["GENERAL_QUESTION"] = "general_question"; | ||
Type["TRANSLATION_MISTAKE"] = "translation_mistake"; | ||
Type["CONTEXT_REQUEST"] = "context_request"; | ||
Type["SOURCE_MISTAKE"] = "source_mistake"; | ||
})(Type = TranslationStatusModel.Type || (TranslationStatusModel.Type = {})); | ||
let Status; | ||
(function (Status) { | ||
Status["ALL"] = "all"; | ||
Status["RESOLVED"] = "resolved"; | ||
Status["UNRESOLVED"] = "unresolved"; | ||
})(Status = TranslationStatusModel.Status || (TranslationStatusModel.Status = {})); | ||
let Category; | ||
@@ -95,0 +94,0 @@ (function (Category) { |
{ | ||
"name": "@crowdin/crowdin-api-client", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "JavaScript library for Crowdin API v2.", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
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
169638
52
4179