@crowdin/crowdin-api-client
Advanced tools
Comparing version 1.35.0 to 1.36.0
@@ -1,2 +0,2 @@ | ||
import { CrowdinApi, PaginationOptions, PatchRequest, ResponseList, ResponseObject } from '../core'; | ||
import { CrowdinApi, DownloadLink, PaginationOptions, PatchRequest, PlainObject, ResponseList, ResponseObject, Status } from '../core'; | ||
export declare class Ai extends CrowdinApi { | ||
@@ -6,2 +6,32 @@ /** | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.datasets.post | ||
*/ | ||
generateAiOrganizationPromptFineTuningDataset(aiPromptId: number, request: AiModel.GenerateFineTuningDataset): Promise<ResponseObject<Status<AiModel.FineTuningDataset>>>; | ||
/** | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.datasets.get | ||
*/ | ||
getAiOrganizationPromptFineTuningDatasetStatus(aiPromptId: number, jobIdentifier: string): Promise<ResponseObject<Status<AiModel.FineTuningDataset>>>; | ||
/** | ||
* @param aiPromptId ai prompt identifier | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.post | ||
*/ | ||
createAiOrganizationPromptFineTuningJob(aiPromptId: number, request: AiModel.GenerateFineTuningJob): Promise<ResponseObject<Status<AiModel.FineTuningJob>>>; | ||
/** | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.get | ||
*/ | ||
getAiOrganizationPromptFineTuningJobStatus(aiPromptId: number, jobIdentifier: string): Promise<ResponseObject<Status<AiModel.FineTuningJob>>>; | ||
/** | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.get | ||
*/ | ||
downloadAiOrganizationPromptFineTuningDataset(aiPromptId: number, jobIdentifier: string): Promise<ResponseObject<DownloadLink>>; | ||
/** | ||
* @param aiPromptId ai prompt identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.clones.post | ||
@@ -23,2 +53,26 @@ */ | ||
/** | ||
* @param aiPromptId ai Prompt identifier | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.completions.post | ||
*/ | ||
generateAiOrganizationPromptCompletion(aiPromptId: number, request: AiModel.GenerateAiPromptCompletionRequest): Promise<ResponseObject<Status<AiModel.AiPromptCompletionAttribute>>>; | ||
/** | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.completions.get | ||
*/ | ||
getAiOrganizationPromptCompletionStatus(aiPromptId: number, completionId: string): Promise<ResponseObject<Status<AiModel.AiPromptCompletionAttribute>>>; | ||
/** | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.completions.delete | ||
*/ | ||
cancelAiOrganizationPromptCompletion(aiPromptId: number, completionId: string): Promise<void>; | ||
/** | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.completions.download.download | ||
*/ | ||
downloadAiOrganizationPromptCompletion(aiPromptId: number, completionId: string): Promise<ResponseObject<DownloadLink>>; | ||
/** | ||
* @param aiPromptId ai Prompt identifier. | ||
@@ -29,3 +83,3 @@ * @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.get | ||
/** | ||
* @param aiPromptId ai Prompt identifier. | ||
* @param aiPromptId ai Prompt identifier | ||
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.delete | ||
@@ -79,2 +133,17 @@ */ | ||
/** | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.reports.post | ||
*/ | ||
generateAiOrganizationReport(request: AiModel.AiReport): Promise<ResponseObject<Status<AiModel.AiReport>>>; | ||
/** | ||
* @param aiReportId report identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.reports.get | ||
*/ | ||
checkAiOrganizationReportStatus(aiReportId: string): Promise<ResponseObject<Status<AiModel.AiReport>>>; | ||
/** | ||
* @param aiReportId report identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.reports.download.download | ||
*/ | ||
downloadAiOrganizationReport(aiReportId: string): Promise<ResponseObject<DownloadLink>>; | ||
/** | ||
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.settings.get | ||
@@ -92,2 +161,37 @@ */ | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.datasets.post | ||
*/ | ||
generateAiUserPromptFineTuningDataset(userId: number, aiPromptId: number, request: AiModel.GenerateFineTuningDataset): Promise<ResponseObject<Status<AiModel.FineTuningDataset>>>; | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.fine-tuning.datasets.get | ||
*/ | ||
getAiUserPromptFineTuningDatasetStatus(userId: number, aiPromptId: number, jobIdentifier: string): Promise<ResponseObject<Status<AiModel.FineTuningDataset>>>; | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai prompt identifier | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.post | ||
*/ | ||
createAiUserPromptFineTuningJob(userId: number, aiPromptId: number, request: AiModel.GenerateFineTuningJob): Promise<ResponseObject<Status<AiModel.FineTuningJob>>>; | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.fine-tuning.jobs.get | ||
*/ | ||
getAiUserPromptFineTuningJobStatus(userId: number, aiPromptId: number, jobIdentifier: string): Promise<ResponseObject<Status<AiModel.FineTuningJob>>>; | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.fine-tuning.datasets.download.get | ||
*/ | ||
downloadAiUserPromptFineTuningDataset(userId: number, aiPromptId: number, jobIdentifier: string): Promise<ResponseObject<DownloadLink>>; | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai prompt identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.clones.post | ||
@@ -112,2 +216,30 @@ */ | ||
* @param userId user identifier | ||
* @param aiPromptId ai Prompt identifier | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.completions.post | ||
*/ | ||
generateAiUserPromptCompletion(userId: number, aiPromptId: number, request: AiModel.GenerateAiPromptCompletionRequest): Promise<ResponseObject<Status<AiModel.AiPromptCompletionAttribute>>>; | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.completions.get | ||
*/ | ||
getAiUserPromptCompletionStatus(userId: number, aiPromptId: number, completionId: string): Promise<ResponseObject<Status<AiModel.AiPromptCompletionAttribute>>>; | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.completions.delete | ||
*/ | ||
cancelAiUserPromptCompletion(userId: number, aiPromptId: number, completionId: string): Promise<void>; | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.completions.download.download | ||
*/ | ||
downloadAiUserPromptCompletion(userId: number, aiPromptId: number, completionId: string): Promise<ResponseObject<DownloadLink>>; | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai Prompt identifier. | ||
@@ -176,2 +308,20 @@ * @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.get | ||
/** | ||
* @param userId user identifier | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.reports.post | ||
*/ | ||
generateAiUserReport(userId: number, request: AiModel.AiReport): Promise<ResponseObject<Status<AiModel.AiReport>>>; | ||
/** | ||
* @param userId user identifier | ||
* @param aiReportId report identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.reports.get | ||
*/ | ||
checkAiUserReportStatus(userId: number, aiReportId: string): Promise<ResponseObject<Status<AiModel.AiReport>>>; | ||
/** | ||
* @param userId user identifier | ||
* @param aiReportId report identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.reports.download.download | ||
*/ | ||
downloadAiUserReport(userId: number, aiReportId: string): Promise<ResponseObject<DownloadLink>>; | ||
/** | ||
* @param userId user Identifier | ||
@@ -189,5 +339,46 @@ * @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.settings.get | ||
export declare namespace AiModel { | ||
interface FineTuningDataset { | ||
projectIds: number[]; | ||
purpose: 'training' | 'validation'; | ||
dateFrom: string; | ||
dateTo: string; | ||
maxFileSize: number; | ||
minExamplesCount: number; | ||
maxExamplesCount: number; | ||
} | ||
interface GenerateFineTuningDataset { | ||
projectIds: number[]; | ||
purpose?: 'training' | 'validation'; | ||
dateFrom?: string; | ||
dateTo?: string; | ||
maxFileSize?: number; | ||
minExamplesCount?: number; | ||
maxExamplesCount?: number; | ||
} | ||
interface GenerateFineTuningJob { | ||
dryRun?: boolean; | ||
hyperparameters?: { | ||
batchSize: number; | ||
learningRateMultiplier: number; | ||
nEpochs: number; | ||
}; | ||
trainingOptions: Omit<GenerateFineTuningDataset, 'purpose'>; | ||
validationOptions?: Omit<GenerateFineTuningDataset, 'purpose'>; | ||
} | ||
interface FineTuningJob { | ||
dryRun: boolean; | ||
hyperparameters: { | ||
batchSize: number; | ||
learningRateMultiplier: number; | ||
nEpochs: number; | ||
}; | ||
trainingOptions: Omit<GenerateFineTuningDataset, 'purpose'>; | ||
validationOptions: Omit<GenerateFineTuningDataset, 'purpose'>; | ||
fineTunedModel: string; | ||
trainedTokensCount: number; | ||
metadata: PlainObject; | ||
} | ||
interface ListAiPromptsOptions extends PaginationOptions { | ||
projectId?: number; | ||
action?: string; | ||
action?: Action; | ||
} | ||
@@ -197,3 +388,3 @@ interface AiPromptResponse { | ||
name: string; | ||
action: string; | ||
action: Action; | ||
aiProviderId: number; | ||
@@ -203,4 +394,5 @@ aiModelId: string; | ||
enabledProjectIds: number[]; | ||
config: AiModel.AiPromptConfigBasic | AiModel.AiPromptConfigAdvanced | AiModel.AiPromptConfigExternal; | ||
config: AiModel.AiPromptConfigBasicPreTranslate | AiModel.AiPromptConfigBasicAssistAction | AiModel.AiPromptConfigAdvanced | AiModel.AiPromptConfigExternal; | ||
promptPreview: string; | ||
isFineTuningAvailable: boolean; | ||
createdAt: string; | ||
@@ -213,3 +405,3 @@ updatedAt: string; | ||
} | ||
interface AiPromptConfigBasic { | ||
interface AiPromptConfigBasicPreTranslate { | ||
mode: 'basic'; | ||
@@ -223,4 +415,17 @@ companyDescription?: string; | ||
fileContent?: boolean; | ||
fileContext?: boolean; | ||
screenshots?: boolean; | ||
publicProjectDescription?: boolean; | ||
} | ||
interface AiPromptConfigBasicAssistAction { | ||
mode: 'basic'; | ||
companyDescription?: string; | ||
projectDescription?: string; | ||
audienceDescription?: string; | ||
otherLanguageTranslations?: AiModel.AiPromptConfigBasicOtherLanguageTranslations; | ||
glossaryTerms?: boolean; | ||
tmSuggestions?: boolean; | ||
fileContext?: boolean; | ||
screenshots?: boolean; | ||
publicProjectDescription?: boolean; | ||
siblingsStrings?: boolean; | ||
@@ -231,8 +436,9 @@ filteredStrings?: boolean; | ||
mode: 'advanced'; | ||
screenshots?: boolean; | ||
prompt: string; | ||
screenshots?: boolean; | ||
otherLanguageTranslations?: AiModel.AiPromptConfigBasicOtherLanguageTranslations; | ||
} | ||
interface AiPromptConfigExternal { | ||
mode: 'external'; | ||
external: string; | ||
identifier: string; | ||
key: string; | ||
@@ -243,3 +449,3 @@ options?: any; | ||
name: string; | ||
action: string; | ||
action: Action; | ||
aiProviderId?: number; | ||
@@ -249,8 +455,41 @@ aiModelId?: string; | ||
enabledProjectIds?: number[]; | ||
config: AiModel.AiPromptConfigBasic | AiModel.AiPromptConfigAdvanced | AiPromptConfigExternal; | ||
config: AiModel.AiPromptConfigBasicPreTranslate | AiModel.AiPromptConfigBasicAssistAction | AiModel.AiPromptConfigAdvanced | AiPromptConfigExternal; | ||
} | ||
interface GenerateAiPromptCompletionRequest { | ||
resources: AiModel.AiPromptResourceWithPreTranslate | AiModel.AiPromptResourceWithPreTranslate | AiModel.AiPromptResourceWithCustom; | ||
tools?: { | ||
tool: { | ||
type: 'function'; | ||
function: { | ||
description?: string; | ||
name: string; | ||
parameters?: PlainObject; | ||
}; | ||
}; | ||
}[]; | ||
tool_choice?: string | PlainObject; | ||
} | ||
interface AiPromptCompletionAttribute { | ||
aiPromptId: number; | ||
} | ||
interface AiPromptResourceWithPreTranslate { | ||
projectId: number; | ||
targetLanguageId: string; | ||
stringIds: number[]; | ||
} | ||
interface AiPromptResourceWithAssist { | ||
projectId: number; | ||
targetLanguageId: string; | ||
stringIds: number[]; | ||
filteredStringsIds?: number[]; | ||
} | ||
interface AiPromptResourceWithCustom { | ||
projectId: number; | ||
targetLanguageId: string; | ||
stringIds: number[]; | ||
} | ||
interface AiProviderResponse { | ||
id: number; | ||
name: string; | ||
type: string; | ||
type: ProviderType; | ||
credentials: AiModel.AiProviderCredentialsBasic | AiModel.AiProviderCredentialsAzureOpenAi | AiProviderCredentialsGoogleGemini | AiProviderCredentialsCustom; | ||
@@ -290,3 +529,3 @@ config: AiModel.AiProviderConfig; | ||
name: string; | ||
type: string; | ||
type: ProviderType; | ||
credentials?: AiModel.AiProviderCredentialsBasic | AiModel.AiProviderCredentialsAzureOpenAi | AiProviderCredentialsGoogleGemini | AiProviderCredentialsCustom; | ||
@@ -303,5 +542,2 @@ config?: AiModel.AiProviderConfig; | ||
} | ||
interface AiSettings { | ||
assistActionAiPromptId: number; | ||
} | ||
interface OtherChatCompletionRequest { | ||
@@ -314,2 +550,26 @@ stream?: boolean; | ||
} | ||
type AiReport = AiReportTokenUsage; | ||
interface AiReportTokenUsage { | ||
type: 'tokens-usage-raw-data'; | ||
schema: AiReportGeneralSchema; | ||
} | ||
interface AiReportGeneralSchema { | ||
dateFrom: string; | ||
dateTo: string; | ||
format?: 'json' | 'csv'; | ||
projectIds?: number[]; | ||
promptIds?: number[]; | ||
userIds?: number[]; | ||
} | ||
interface AiSettings { | ||
assistActionAiPromptId: number; | ||
showSuggestion: boolean; | ||
shortcuts: { | ||
name: string; | ||
prompt: string; | ||
enabled: boolean; | ||
}[]; | ||
} | ||
type Action = 'pre_translate' | 'assist'; | ||
type ProviderType = 'open_ai' | 'azure_open_ai' | 'google_gemini' | 'mistral_ai' | 'anthropic' | 'custom_ai'; | ||
} |
@@ -9,2 +9,47 @@ "use strict"; | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.datasets.post | ||
*/ | ||
generateAiOrganizationPromptFineTuningDataset(aiPromptId, request) { | ||
const url = `${this.url}/ai/prompts/${aiPromptId}/fine-tuning/datasets`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.datasets.get | ||
*/ | ||
getAiOrganizationPromptFineTuningDatasetStatus(aiPromptId, jobIdentifier) { | ||
const url = `${this.url}/ai/prompts/${aiPromptId}/fine-tuning/datasets/${jobIdentifier}`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param aiPromptId ai prompt identifier | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.post | ||
*/ | ||
createAiOrganizationPromptFineTuningJob(aiPromptId, request) { | ||
const url = `${this.url}/ai/prompts/${aiPromptId}/fine-tuning/jobs`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.get | ||
*/ | ||
getAiOrganizationPromptFineTuningJobStatus(aiPromptId, jobIdentifier) { | ||
const url = `${this.url}/ai/prompts/${aiPromptId}/fine-tuning/jobs/${jobIdentifier}`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.get | ||
*/ | ||
downloadAiOrganizationPromptFineTuningDataset(aiPromptId, jobIdentifier) { | ||
const url = `${this.url}/ai/prompts/${aiPromptId}/fine-tuning/datasets/${jobIdentifier}/download`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param aiPromptId ai prompt identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.clones.post | ||
@@ -35,2 +80,38 @@ */ | ||
/** | ||
* @param aiPromptId ai Prompt identifier | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.completions.post | ||
*/ | ||
generateAiOrganizationPromptCompletion(aiPromptId, request) { | ||
const url = `${this.url}/ai/prompts/${aiPromptId}/completions`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.completions.get | ||
*/ | ||
getAiOrganizationPromptCompletionStatus(aiPromptId, completionId) { | ||
const url = `${this.url}/ai/prompts/${aiPromptId}/completions/${completionId}`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.completions.delete | ||
*/ | ||
cancelAiOrganizationPromptCompletion(aiPromptId, completionId) { | ||
const url = `${this.url}/ai/prompts/${aiPromptId}/completions/${completionId}`; | ||
return this.delete(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.completions.download.download | ||
*/ | ||
downloadAiOrganizationPromptCompletion(aiPromptId, completionId) { | ||
const url = `${this.url}/ai/prompts/${aiPromptId}/completions/${completionId}/download`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param aiPromptId ai Prompt identifier. | ||
@@ -44,3 +125,3 @@ * @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.get | ||
/** | ||
* @param aiPromptId ai Prompt identifier. | ||
* @param aiPromptId ai Prompt identifier | ||
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.delete | ||
@@ -123,2 +204,26 @@ */ | ||
/** | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.reports.post | ||
*/ | ||
generateAiOrganizationReport(request) { | ||
const url = `${this.url}/ai/reports`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param aiReportId report identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.reports.get | ||
*/ | ||
checkAiOrganizationReportStatus(aiReportId) { | ||
const url = `${this.url}/ai/reports/${aiReportId}`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param aiReportId report identifier | ||
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.reports.download.download | ||
*/ | ||
downloadAiOrganizationReport(aiReportId) { | ||
const url = `${this.url}/ai/reports/${aiReportId}/download`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.settings.get | ||
@@ -143,2 +248,52 @@ */ | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.datasets.post | ||
*/ | ||
generateAiUserPromptFineTuningDataset(userId, aiPromptId, request) { | ||
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}/fine-tuning/datasets`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.fine-tuning.datasets.get | ||
*/ | ||
getAiUserPromptFineTuningDatasetStatus(userId, aiPromptId, jobIdentifier) { | ||
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}/fine-tuning/datasets/${jobIdentifier}`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai prompt identifier | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.post | ||
*/ | ||
createAiUserPromptFineTuningJob(userId, aiPromptId, request) { | ||
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}/fine-tuning/jobs`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.fine-tuning.jobs.get | ||
*/ | ||
getAiUserPromptFineTuningJobStatus(userId, aiPromptId, jobIdentifier) { | ||
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}/fine-tuning/jobs/${jobIdentifier}`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai prompt identifier | ||
* @param jobIdentifier job identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.fine-tuning.datasets.download.get | ||
*/ | ||
downloadAiUserPromptFineTuningDataset(userId, aiPromptId, jobIdentifier) { | ||
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}/fine-tuning/datasets/${jobIdentifier}/download`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai prompt identifier | ||
* @param request request body | ||
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.clones.post | ||
@@ -172,2 +327,42 @@ */ | ||
* @param userId user identifier | ||
* @param aiPromptId ai Prompt identifier | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.completions.post | ||
*/ | ||
generateAiUserPromptCompletion(userId, aiPromptId, request) { | ||
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}/completions`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.completions.get | ||
*/ | ||
getAiUserPromptCompletionStatus(userId, aiPromptId, completionId) { | ||
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}/completions/${completionId}`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.completions.delete | ||
*/ | ||
cancelAiUserPromptCompletion(userId, aiPromptId, completionId) { | ||
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}/completions/${completionId}`; | ||
return this.delete(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai Prompt identifier | ||
* @param completionId completion identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.prompts.completions.download.download | ||
*/ | ||
downloadAiUserPromptCompletion(userId, aiPromptId, completionId) { | ||
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}/completions/${completionId}/download`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user identifier | ||
* @param aiPromptId ai Prompt identifier. | ||
@@ -268,2 +463,29 @@ * @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.get | ||
/** | ||
* @param userId user identifier | ||
* @param request request body | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.reports.post | ||
*/ | ||
generateAiUserReport(userId, request) { | ||
const url = `${this.url}/users/${userId}/ai/reports`; | ||
return this.post(url, request, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user identifier | ||
* @param aiReportId report identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.reports.get | ||
*/ | ||
checkAiUserReportStatus(userId, aiReportId) { | ||
const url = `${this.url}/users/${userId}/ai/reports/${aiReportId}`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user identifier | ||
* @param aiReportId report identifier | ||
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.reports.download.download | ||
*/ | ||
downloadAiUserReport(userId, aiReportId) { | ||
const url = `${this.url}/users/${userId}/ai/reports/${aiReportId}/download`; | ||
return this.get(url, this.defaultConfig()); | ||
} | ||
/** | ||
* @param userId user Identifier | ||
@@ -270,0 +492,0 @@ * @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.settings.get |
@@ -104,2 +104,3 @@ import { HttpClientError } from './http-client-error'; | ||
} | ||
export type PlainObject = Record<string, any>; | ||
/** | ||
@@ -106,0 +107,0 @@ * @internal |
@@ -196,2 +196,4 @@ import { BooleanInt, CrowdinApi, DownloadLink, PaginationOptions, PatchRequest, ResponseList, ResponseObject } from '../core'; | ||
savingsReportSettingsTemplateId: number; | ||
defaultTmId?: number; | ||
defaultGlossaryId?: number; | ||
cname: string; | ||
@@ -237,2 +239,4 @@ groupId: number; | ||
savingsReportSettingsTemplateId?: number; | ||
defaultTmId?: number; | ||
defaultGlossaryId?: number; | ||
saveMetaInfoInSource?: boolean; | ||
@@ -279,2 +283,4 @@ type?: BooleanInt; | ||
savingsReportSettingsTemplateId?: number; | ||
defaultTmId?: number; | ||
defaultGlossaryId?: number; | ||
languages?: string[]; | ||
@@ -281,0 +287,0 @@ mtId?: number; |
@@ -264,5 +264,5 @@ import { CrowdinApi, DownloadLink, PaginationOptions, PatchRequest, ResponseList, ResponseObject, Status } from '../core'; | ||
} | ||
type ReportSchema = CostEstimationPostEndingSchema | CostEstimationPostEndingSchemaByTask | TranslationCostsPostEndingSchema | TranslationCostsPostEndingSchemaByTask | TopMembersSchema | ContributionRawDataSchema; | ||
type ReportSchema = CostEstimationPostEndingSchema | CostEstimationPostEndingSchemaByTask | TranslationCostsPostEndingSchema | TranslationCostsPostEndingSchemaByTask | TopMembersSchema | ContributionRawDataSchema | PreTranslateEfficiencySchema; | ||
interface GenerateReportRequest { | ||
name: 'costs-estimation' | 'translation-costs' | 'top-members' | 'contribution-raw-data' | 'costs-estimation-pe' | 'translation-costs-pe'; | ||
name: 'top-members' | 'contribution-raw-data' | 'costs-estimation-pe' | 'translation-costs-pe' | 'pre-translate-efficiency'; | ||
schema: ReportSchema; | ||
@@ -324,2 +324,3 @@ } | ||
excludeApprovalsForEditedTranslations?: boolean; | ||
preTranslatedStringsCategorizationAdjustment?: boolean; | ||
groupBy?: GroupBy; | ||
@@ -370,2 +371,10 @@ dateFrom?: string; | ||
} | ||
interface PreTranslateEfficiencySchema { | ||
unit?: Unit; | ||
format?: Format; | ||
postEditingCategories?: string[]; | ||
languageId?: string; | ||
dateFrom?: string; | ||
dateTo?: string; | ||
} | ||
interface ReportSettings { | ||
@@ -372,0 +381,0 @@ id: number; |
@@ -91,2 +91,3 @@ import { BooleanInt, CrowdinApi, PaginationOptions, PatchRequest, ResponseList, ResponseObject, Status } from '../core'; | ||
cleanupMode: boolean; | ||
updateOption: UpdateOption; | ||
} | ||
@@ -106,2 +107,3 @@ interface UploadStringsRequest { | ||
}; | ||
updateOption?: UpdateOption; | ||
} | ||
@@ -173,2 +175,3 @@ interface ListProjectStringsOptions extends PaginationOptions { | ||
type Scope = 'identifier' | 'text' | 'context'; | ||
type UpdateOption = 'clear_translations_and_approvals' | 'keep_translations' | 'keep_translations_and_approvals'; | ||
} |
{ | ||
"name": "@crowdin/crowdin-api-client", | ||
"version": "1.35.0", | ||
"version": "1.36.0", | ||
"description": "JavaScript library for Crowdin API", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
506620
11450