@crowdin/crowdin-api-client
Advanced tools
Comparing version 1.10.3 to 1.10.4
@@ -88,3 +88,2 @@ import { RetryConfig, RetryService } from './internal/retry'; | ||
finishedAt: string; | ||
eta: string; | ||
} | ||
@@ -91,0 +90,0 @@ export interface Attribute { |
@@ -69,4 +69,5 @@ import { CrowdinApi, DownloadLink, PatchRequest, ResponseList, ResponseObject } from '../core'; | ||
* @param recursion use to list files recursively | ||
* @param filter use to filter files by name | ||
*/ | ||
listProjectFiles(projectId: number, branchId?: number, directoryId?: number, limit?: number, offset?: number, recursion?: any): Promise<ResponseList<SourceFilesModel.File>>; | ||
listProjectFiles(projectId: number, branchId?: number, directoryId?: number, limit?: number, offset?: number, recursion?: any, filter?: string): Promise<ResponseList<SourceFilesModel.File>>; | ||
/** | ||
@@ -188,2 +189,3 @@ * @param projectId project identifier | ||
recursion?: any; | ||
filter?: string; | ||
} | ||
@@ -190,0 +192,0 @@ interface File { |
@@ -96,3 +96,3 @@ "use strict"; | ||
} | ||
listProjectFiles(projectId, branchIdOrRequest, directoryId, limit, offset, recursion) { | ||
listProjectFiles(projectId, branchIdOrRequest, directoryId, limit, offset, recursion, filter) { | ||
let url = `${this.url}/projects/${projectId}/files`; | ||
@@ -104,3 +104,3 @@ let request; | ||
else { | ||
request = { branchId: branchIdOrRequest, directoryId, limit, offset, recursion }; | ||
request = { branchId: branchIdOrRequest, directoryId, limit, offset, recursion, filter }; | ||
} | ||
@@ -110,2 +110,3 @@ url = this.addQueryParam(url, 'branchId', request.branchId); | ||
url = this.addQueryParam(url, 'recursion', request.recursion); | ||
url = this.addQueryParam(url, 'filter', request.filter); | ||
return this.getList(url, request.limit, request.offset); | ||
@@ -112,0 +113,0 @@ } |
import { CrowdinApi, PatchRequest, ResponseList, ResponseObject } from '../core'; | ||
export declare class StringComments extends CrowdinApi { | ||
listStringComments(projectId: number, stringId: number, request?: StringCommentsModel.ListStringCommentsRequest): Promise<ResponseList<StringCommentsModel.StringComment>>; | ||
listStringComments(projectId: number, request?: StringCommentsModel.ListStringCommentsRequest): Promise<ResponseList<StringCommentsModel.StringComment>>; | ||
/** | ||
@@ -12,31 +12,28 @@ * @param projectId project identifier | ||
*/ | ||
listStringComments(projectId: number, stringId: number, type?: StringCommentsModel.Type, targetLanguageId?: string, issueType?: StringCommentsModel.IssueType, issueStatus?: StringCommentsModel.IssueStatus): Promise<ResponseList<StringCommentsModel.StringComment>>; | ||
listStringComments(projectId: number, stringId?: number, type?: StringCommentsModel.Type, targetLanguageId?: string, issueType?: StringCommentsModel.IssueType, issueStatus?: StringCommentsModel.IssueStatus): Promise<ResponseList<StringCommentsModel.StringComment>>; | ||
/** | ||
* @param projectId project identifier | ||
* @param stringId string identifier | ||
* @param request request body | ||
*/ | ||
addStringComment(projectId: number, stringId: number, request: StringCommentsModel.AddStringCommentRequest): Promise<ResponseObject<StringCommentsModel.StringComment>>; | ||
addStringComment(projectId: number, request: StringCommentsModel.AddStringCommentRequest): Promise<ResponseObject<StringCommentsModel.StringComment>>; | ||
/** | ||
* @param projectId project identifier | ||
* @param stringId string identifier | ||
* @param stringCommentId string comment identifier | ||
*/ | ||
getStringComment(projectId: number, stringId: number, stringCommentId: number): Promise<ResponseObject<StringCommentsModel.StringComment>>; | ||
getStringComment(projectId: number, stringCommentId: number): Promise<ResponseObject<StringCommentsModel.StringComment>>; | ||
/** | ||
* @param projectId project identifier | ||
* @param stringId string identifier | ||
* @param stringCommentId string comment identifier | ||
*/ | ||
deleteStringComment(projectId: number, stringId: number, stringCommentId: number): Promise<void>; | ||
deleteStringComment(projectId: number, stringCommentId: number): Promise<void>; | ||
/** | ||
* @param projectId project identifier | ||
* @param stringId string identifier | ||
* @param stringCommentId string comment identifier | ||
* @param request request body | ||
*/ | ||
editStringComment(projectId: number, stringId: number, stringCommentId: number, request: PatchRequest[]): Promise<ResponseObject<StringCommentsModel.StringComment>>; | ||
editStringComment(projectId: number, stringCommentId: number, request: PatchRequest[]): Promise<ResponseObject<StringCommentsModel.StringComment>>; | ||
} | ||
export declare namespace StringCommentsModel { | ||
interface ListStringCommentsRequest { | ||
stringId?: number; | ||
limit?: number; | ||
@@ -60,2 +57,5 @@ offset?: number; | ||
issueStatus: IssueStatus; | ||
resolverId: number; | ||
resolver: User; | ||
resolvedAt: string; | ||
createdAt: string; | ||
@@ -79,2 +79,3 @@ } | ||
interface AddStringCommentRequest { | ||
stringId: number; | ||
text: string; | ||
@@ -84,3 +85,2 @@ targetLanguageId: string; | ||
issueType?: IssueType; | ||
issueStatus?: IssueStatus; | ||
} | ||
@@ -87,0 +87,0 @@ enum Type { |
@@ -6,11 +6,12 @@ "use strict"; | ||
class StringComments extends core_1.CrowdinApi { | ||
listStringComments(projectId, stringId, typeOrRequest, targetLanguageId, issueType, issueStatus) { | ||
let url = `${this.url}/projects/${projectId}/strings/${stringId}/comments`; | ||
listStringComments(projectId, stringIdOrRequest, type, targetLanguageId, issueType, issueStatus) { | ||
let url = `${this.url}/projects/${projectId}/comments`; | ||
let request; | ||
if (typeOrRequest && typeof typeOrRequest === 'object') { | ||
request = typeOrRequest; | ||
if (stringIdOrRequest && typeof stringIdOrRequest === 'object') { | ||
request = stringIdOrRequest; | ||
} | ||
else { | ||
request = { type: typeOrRequest, targetLanguageId, issueStatus, issueType }; | ||
request = { stringId: stringIdOrRequest, type, targetLanguageId, issueStatus, issueType }; | ||
} | ||
url = this.addQueryParam(url, 'stringId', request.stringId); | ||
url = this.addQueryParam(url, 'type', request.type); | ||
@@ -24,7 +25,6 @@ url = this.addQueryParam(url, 'targetLanguageId', request.targetLanguageId); | ||
* @param projectId project identifier | ||
* @param stringId string identifier | ||
* @param request request body | ||
*/ | ||
addStringComment(projectId, stringId, request) { | ||
const url = `${this.url}/projects/${projectId}/strings/${stringId}/comments`; | ||
addStringComment(projectId, request) { | ||
const url = `${this.url}/projects/${projectId}/comments`; | ||
return this.post(url, request, this.defaultConfig()); | ||
@@ -34,7 +34,6 @@ } | ||
* @param projectId project identifier | ||
* @param stringId string identifier | ||
* @param stringCommentId string comment identifier | ||
*/ | ||
getStringComment(projectId, stringId, stringCommentId) { | ||
const url = `${this.url}/projects/${projectId}/strings/${stringId}/comments/${stringCommentId}`; | ||
getStringComment(projectId, stringCommentId) { | ||
const url = `${this.url}/projects/${projectId}/comments/${stringCommentId}`; | ||
return this.get(url, this.defaultConfig()); | ||
@@ -44,7 +43,6 @@ } | ||
* @param projectId project identifier | ||
* @param stringId string identifier | ||
* @param stringCommentId string comment identifier | ||
*/ | ||
deleteStringComment(projectId, stringId, stringCommentId) { | ||
const url = `${this.url}/projects/${projectId}/strings/${stringId}/comments/${stringCommentId}`; | ||
deleteStringComment(projectId, stringCommentId) { | ||
const url = `${this.url}/projects/${projectId}/comments/${stringCommentId}`; | ||
return this.delete(url, this.defaultConfig()); | ||
@@ -54,8 +52,7 @@ } | ||
* @param projectId project identifier | ||
* @param stringId string identifier | ||
* @param stringCommentId string comment identifier | ||
* @param request request body | ||
*/ | ||
editStringComment(projectId, stringId, stringCommentId, request) { | ||
const url = `${this.url}/projects/${projectId}/strings/${stringId}/comments/${stringCommentId}`; | ||
editStringComment(projectId, stringCommentId, request) { | ||
const url = `${this.url}/projects/${projectId}/comments/${stringCommentId}`; | ||
return this.patch(url, request, this.defaultConfig()); | ||
@@ -62,0 +59,0 @@ } |
{ | ||
"name": "@crowdin/crowdin-api-client", | ||
"version": "1.10.3", | ||
"version": "1.10.4", | ||
"description": "JavaScript library for Crowdin API v2.", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
Sorry, the diff of this file is not supported yet
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
259933
6536