@crowdin/crowdin-api-client
Advanced tools
Comparing version 1.10.6 to 1.11.0
@@ -8,2 +8,8 @@ # Change Log | ||
## [1.11.0] | ||
### Updated | ||
- Reports API | ||
## [1.10.0] | ||
@@ -10,0 +16,0 @@ |
import { CrowdinApi, DownloadLink, ResponseObject, Status } from '../core'; | ||
export declare class Reports extends CrowdinApi { | ||
/** | ||
* @param groupId group identifier | ||
* @param request request body | ||
*/ | ||
generateGroupReport(groupId: number, request: ReportsModel.GenerateGroupReportRequest): Promise<ResponseObject<Status<ReportsModel.GroupReportStatusAttributes>>>; | ||
/** | ||
* @param groupId group identifier | ||
* @param reportId report identifier | ||
*/ | ||
checkGroupReportStatus(groupId: number, reportId: string): Promise<ResponseObject<Status<ReportsModel.GroupReportStatusAttributes>>>; | ||
/** | ||
* @param groupId group identifier | ||
* @param reportId report identifier | ||
*/ | ||
downloadGroupReport(groupId: number, reportId: string): Promise<ResponseObject<DownloadLink>>; | ||
/** | ||
* @param request request body | ||
*/ | ||
generateOrganizationReport(request: ReportsModel.GenerateGroupReportRequest): Promise<ResponseObject<Status<ReportsModel.GroupReportStatusAttributes>>>; | ||
/** | ||
* @param reportId report identifier | ||
*/ | ||
checkOrganizationReportStatus(reportId: string): Promise<ResponseObject<Status<ReportsModel.GroupReportStatusAttributes>>>; | ||
/** | ||
* @param reportId report identifier | ||
*/ | ||
downloadOrganizationReport(reportId: string): Promise<ResponseObject<DownloadLink>>; | ||
/** | ||
* @param projectId project identifier | ||
@@ -20,6 +47,13 @@ * @param request request body | ||
export declare namespace ReportsModel { | ||
interface GenerateGroupReportRequest { | ||
name: string; | ||
schema: GroupTranslationCostSchema | GroupTopMembersSchema; | ||
} | ||
interface GenerateReportRequest { | ||
name: string; | ||
schema: CostEstimateSchema | TranslationCostSchema | TopMembersSchema; | ||
schema: CostEstimateSchema | CostEstimateFuzzyModeSchema | TranslationCostSchema | TopMembersSchema | ContributionRawDataSchema; | ||
} | ||
interface GroupReportStatusAttributes extends ReportStatusAttributes { | ||
projectIds: number[]; | ||
} | ||
interface ReportStatusAttributes { | ||
@@ -30,21 +64,64 @@ format: Format; | ||
} | ||
interface GroupTranslationCostSchema { | ||
projectIds?: number[]; | ||
unit?: Unit; | ||
currency?: Currency; | ||
format?: Format; | ||
groupBy?: GroupBy; | ||
dateFrom?: string; | ||
dateTo?: string; | ||
} | ||
interface GroupTopMembersSchema { | ||
projectIds?: number[]; | ||
unit?: Unit; | ||
languageId?: string; | ||
format?: Format; | ||
groupBy?: GroupBy; | ||
dateFrom?: string; | ||
dateTo?: string; | ||
} | ||
interface CostEstimateSchema { | ||
unit: Unit; | ||
currency: Currency; | ||
languageId: string; | ||
format: Format; | ||
stepTypes: Array<TranslateStep | ProofreadStep>; | ||
unit?: Unit; | ||
currency?: Currency; | ||
mode?: string; | ||
languageId?: string; | ||
fileIds?: number[]; | ||
format?: Format; | ||
regularRates?: RegularRate[]; | ||
individualRates?: IndividualRate[]; | ||
dateFrom?: string; | ||
dateTo?: string; | ||
stepTypes?: Array<TranslateStep | ProofreadStep>; | ||
} | ||
interface CostEstimateFuzzyModeSchema extends CostEstimateSchema { | ||
calculateInternalFuzzyMatches?: boolean; | ||
} | ||
interface TranslationCostSchema { | ||
unit: Unit; | ||
currency: Currency; | ||
format: Format; | ||
groupBy: GroupBy; | ||
stepTypes: Array<TranslateStep | ProofreadStep>; | ||
unit?: Unit; | ||
currency?: Currency; | ||
mode?: string; | ||
format?: Format; | ||
groupBy?: GroupBy; | ||
regularRates?: RegularRate[]; | ||
individualRates?: IndividualRate[]; | ||
dateFrom?: string; | ||
dateTo?: string; | ||
stepTypes?: Array<TranslateStep | ProofreadStep>; | ||
} | ||
type TranslationCostFuzzyModeSchema = TranslationCostSchema; | ||
interface TopMembersSchema { | ||
unit: Unit; | ||
languageId: string; | ||
format: Format; | ||
unit?: Unit; | ||
languageId?: string; | ||
format?: Format; | ||
dateFrom?: string; | ||
dateTo?: string; | ||
} | ||
interface ContributionRawDataSchema { | ||
mode: ContributionMode; | ||
unit?: Unit; | ||
languageId?: string; | ||
userId?: string; | ||
dateFrom?: string; | ||
dateTo?: string; | ||
} | ||
enum Unit { | ||
@@ -82,3 +159,4 @@ STRINGS = "strings", | ||
XLSX = "xlsx", | ||
CSV = "csv" | ||
CSV = "csv", | ||
JSON = "json" | ||
} | ||
@@ -88,4 +166,4 @@ interface TranslateStep { | ||
mode: string; | ||
calculateInternalFuzzyMatches: boolean; | ||
regularRates: RegularRates[]; | ||
regularRates: RegularRate[]; | ||
individualRates: IndividualRate[]; | ||
} | ||
@@ -95,12 +173,23 @@ interface ProofreadStep { | ||
mode: string; | ||
regularRates: RegularRates[]; | ||
regularRates: RegularRate[]; | ||
individualRates: IndividualRate[]; | ||
} | ||
interface RegularRates { | ||
interface RegularRate { | ||
mode: Mode; | ||
value: number; | ||
} | ||
interface IndividualRate { | ||
languageIds: string[]; | ||
rates: RegularRate[]; | ||
} | ||
enum Mode { | ||
NO_MATCH = "no_match", | ||
TM_MATCH = "tm_match" | ||
TM_MATCH = "tm_match", | ||
APPROVAL = "approval" | ||
} | ||
enum ContributionMode { | ||
TRANSLATIONS = "translations", | ||
APPROVALS = "approvals", | ||
VOTES = "votes" | ||
} | ||
enum GroupBy { | ||
@@ -107,0 +196,0 @@ USER = "user", |
@@ -7,2 +7,47 @@ "use strict"; | ||
/** | ||
* @param groupId group identifier | ||
* @param request request body | ||
*/ | ||
generateGroupReport(groupId, request) { | ||
const url = `${this.url}/groups/${groupId}/reports`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param groupId group identifier | ||
* @param reportId report identifier | ||
*/ | ||
checkGroupReportStatus(groupId, reportId) { | ||
const url = `${this.url}/groups/${groupId}/reports/${reportId}`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param groupId group identifier | ||
* @param reportId report identifier | ||
*/ | ||
downloadGroupReport(groupId, reportId) { | ||
const url = `${this.url}/groups/${groupId}/reports/${reportId}/download`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param request request body | ||
*/ | ||
generateOrganizationReport(request) { | ||
const url = `${this.url}/reports`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param reportId report identifier | ||
*/ | ||
checkOrganizationReportStatus(reportId) { | ||
const url = `${this.url}/reports/${reportId}`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param reportId report identifier | ||
*/ | ||
downloadOrganizationReport(reportId) { | ||
const url = `${this.url}/reports/${reportId}/download`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param projectId project identifier | ||
@@ -71,2 +116,3 @@ * @param request request body | ||
Format["CSV"] = "csv"; | ||
Format["JSON"] = "json"; | ||
})(Format = ReportsModel.Format || (ReportsModel.Format = {})); | ||
@@ -77,3 +123,10 @@ let Mode; | ||
Mode["TM_MATCH"] = "tm_match"; | ||
Mode["APPROVAL"] = "approval"; | ||
})(Mode = ReportsModel.Mode || (ReportsModel.Mode = {})); | ||
let ContributionMode; | ||
(function (ContributionMode) { | ||
ContributionMode["TRANSLATIONS"] = "translations"; | ||
ContributionMode["APPROVALS"] = "approvals"; | ||
ContributionMode["VOTES"] = "votes"; | ||
})(ContributionMode = ReportsModel.ContributionMode || (ReportsModel.ContributionMode = {})); | ||
let GroupBy; | ||
@@ -80,0 +133,0 @@ (function (GroupBy) { |
{ | ||
"name": "@crowdin/crowdin-api-client", | ||
"version": "1.10.6", | ||
"version": "1.11.0", | ||
"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
267365
6693