@crowdin/crowdin-api-client
Version:
JavaScript library for Crowdin API
899 lines (898 loc) • 44.2 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Ai = void 0;
const core_1 = require("../core");
class Ai extends core_1.CrowdinApi {
/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param options request options
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.custom.placeholders.getMany
*/
listAiOrganizationCustomPlaceholders(options) {
const url = `${this.url}/ai/settings/custom-placeholders`;
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param request request body
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.post
*/
addAiOrganizationCustomPlaceholder(request) {
const url = `${this.url}/ai/settings/custom-placeholders`;
return this.post(url, request, this.defaultConfig());
}
/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.get
*/
getAiOrganizationCustomPlaceholder(aiCustomPlaceholderId) {
const url = `${this.url}/ai/settings/custom-placeholders/${aiCustomPlaceholderId}`;
return this.get(url, this.defaultConfig());
}
/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.delete
*/
deleteAiOrganizationCustomPlaceholder(aiCustomPlaceholderId) {
const url = `${this.url}/ai/settings/custom-placeholders/${aiCustomPlaceholderId}`;
return this.delete(url, this.defaultConfig());
}
/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @param request request body
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.settings.custom-placeholders.patch
*/
editAiOrganizationCustomPlaceholder(aiCustomPlaceholderId, request) {
const url = `${this.url}/ai/settings/custom-placeholders/${aiCustomPlaceholderId}`;
return this.patch(url, request, this.defaultConfig());
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @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.datasets.post
*/
generateAiOrganizationPromptFineTuningDataset(aiPromptId, request) {
const url = `${this.url}/ai/prompts/${aiPromptId}/fine-tuning/datasets`;
return this.post(url, request, this.defaultConfig());
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @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());
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @param aiPromptId ai prompt identifier
* @param jobIdentifier job identifier
* @param options request options
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.events.getMany
*/
listAiOrganizationPromptFineTuningEvents(aiPromptId, jobIdentifier, options) {
const url = `${this.url}/ai/prompts/${aiPromptId}/fine-tuning/jobs/${jobIdentifier}/events`;
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @param options request options
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.getMany
*/
listAiOrganizationPromptFineTuningJobs(options) {
let url = `${this.url}/ai/prompts/fine-tuning/jobs`;
url = this.addQueryParam(url, 'statuses', options === null || options === void 0 ? void 0 : options.statuses);
url = this.addQueryParam(url, 'orderBy', options === null || options === void 0 ? void 0 : options.orderBy);
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @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());
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @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());
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @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
*/
cloneAiOrganizationPrompt(aiPromptId, request = {}) {
const url = `${this.url}/ai/prompts/${aiPromptId}/clones`;
return this.post(url, request, this.defaultConfig());
}
/**
* @param options optional parameters for the request
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.getMany
*/
listAiOrganizationPrompts(options) {
let url = `${this.url}/ai/prompts`;
url = this.addQueryParam(url, 'projectId', options === null || options === void 0 ? void 0 : options.projectId);
url = this.addQueryParam(url, 'action', options === null || options === void 0 ? void 0 : options.action);
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @param request request body
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.post
*/
addAiOrganizationPrompt(request) {
const url = `${this.url}/ai/prompts`;
return this.post(url, request, 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.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.
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.get
*/
getAiOrganizationPrompt(aiPromptId) {
const url = `${this.url}/ai/prompts/${aiPromptId}`;
return this.get(url, this.defaultConfig());
}
/**
* @param aiPromptId ai Prompt identifier
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.delete
*/
deleteAiOrganizationPrompt(aiPromptId) {
const url = `${this.url}/ai/prompts/${aiPromptId}`;
return this.delete(url, this.defaultConfig());
}
/**
* @param aiPromptId ai Prompt identifier
* @param request request body
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.prompts.patch
*/
editAiOrganizationPrompt(aiPromptId, request) {
const url = `${this.url}/ai/prompts/${aiPromptId}`;
return this.patch(url, request, this.defaultConfig());
}
/**
* @param options optional parameters for the request
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.providers.getMany
*/
listAiOrganizationProviders(options) {
const url = `${this.url}/ai/providers`;
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @param request request body
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.providers.post
*/
addAiOrganizationProvider(request) {
const url = `${this.url}/ai/providers`;
return this.post(url, request, this.defaultConfig());
}
/**
* @param aiProviderId ai Provider identifier.
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.providers.get
*/
getAiOrganizationProvider(aiProviderId) {
const url = `${this.url}/ai/providers/${aiProviderId}`;
return this.get(url, this.defaultConfig());
}
/**
* @param aiProviderId ai Provider identifier.
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.providers.delete
*/
deleteAiOrganizationProvider(aiProviderId) {
const url = `${this.url}/ai/providers/${aiProviderId}`;
return this.delete(url, this.defaultConfig());
}
/**
* @param aiProviderId ai Provider identifier
* @param request request body
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.providers.patch
*/
editAiOrganizationProvider(aiProviderId, request) {
const url = `${this.url}/ai/providers/${aiProviderId}`;
return this.patch(url, request, this.defaultConfig());
}
/**
* @param aiProviderId ai Provider identifier
* @param options optional parameters for the request
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.providers.models.getMany
*/
listAiOrganizationProviderModels(aiProviderId, options) {
const url = `${this.url}/ai/providers/${aiProviderId}/models`;
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @param options optional parameters for the request
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.providers.models.enterprise.getMany
*/
listAiOrganizationAllProviderModels(options) {
const url = `${this.url}/ai/providers/models`;
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @param options optional parameters for the request
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.providers.supported-models.enterprise.getMany
*/
listAiOrganizationSupportedProviderModels(options) {
var _a;
let url = `${this.url}/ai/providers/supported-models`;
url = this.addQueryParam(url, 'providerType', options === null || options === void 0 ? void 0 : options.providerType);
url = this.addQueryParam(url, 'enabled', (_a = options === null || options === void 0 ? void 0 : options.enabled) === null || _a === void 0 ? void 0 : _a.toString());
url = this.addQueryParam(url, 'orderBy', options === null || options === void 0 ? void 0 : options.orderBy);
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @param aiProviderId ai Provider identifier
* @param request request body
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.providers.chat.completions.post
*/
createAiOrganizationProxyChatCompletion(aiProviderId, request) {
const url = `${this.url}/ai/providers/${aiProviderId}/chat/completions`;
return this.post(url, request, this.defaultConfig());
}
/**
* @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
*/
getAiOrganizationSettings() {
const url = `${this.url}/ai/settings`;
return this.get(url, this.defaultConfig());
}
/**
* @param request request body
* @see https://developer.crowdin.com/enterprise/api/v2/#operation/api.ai.settings.patch
*/
editAiOrganizationSettings(request) {
const url = `${this.url}/ai/settings`;
return this.patch(url, request, this.defaultConfig());
}
/**
* @param request request body
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.translate.strings.post
*/
translateAiOrganizationStrings(request) {
const url = `${this.url}/ai/translate`;
return this.post(url, request, this.defaultConfig());
}
/**
* @param request request body
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.file-translations.post
*/
startAiOrganizationFileTranslation(request) {
const url = `${this.url}/ai/file-translations`;
return this.post(url, request, this.defaultConfig());
}
/**
* @param jobIdentifier job identifier
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.file-translations.get
*/
getAiOrganizationFileTranslationStatus(jobIdentifier) {
const url = `${this.url}/ai/file-translations/${jobIdentifier}`;
return this.get(url, this.defaultConfig());
}
/**
* @param jobIdentifier job identifier
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.file-translations.delete
*/
cancelAiOrganizationFileTranslation(jobIdentifier) {
const url = `${this.url}/ai/file-translations/${jobIdentifier}`;
return this.delete(url, this.defaultConfig());
}
/**
* @param jobIdentifier job identifier
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.file-translations.download
*/
downloadAiOrganizationFileTranslation(jobIdentifier) {
const url = `${this.url}/ai/file-translations/${jobIdentifier}/download`;
return this.get(url, this.defaultConfig());
}
/**
* @param jobIdentifier job identifier
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI/operation/api.ai.file-translations.download-strings
*/
downloadAiOrganizationFileTranslationStrings(jobIdentifier) {
const url = `${this.url}/ai/file-translations/${jobIdentifier}/translations`;
return this.get(url, this.defaultConfig());
}
/**
* @param aiProviderId ai Provider identifier
* @param path raw provider API path after `/gateway/`
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.enterprise.get
*/
organizationAiGatewayGet(aiProviderId, path) {
const url = `${this.url}/ai/providers/${aiProviderId}/gateway/${path}`;
return this.get(url, this.defaultConfig());
}
/**
* @param aiProviderId ai Provider identifier
* @param path raw provider API path after `/gateway/`
* @param request request body
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.enterprise.post
*/
organizationAiGatewayPost(aiProviderId, path, request) {
const url = `${this.url}/ai/providers/${aiProviderId}/gateway/${path}`;
return this.post(url, request, this.defaultConfig());
}
/**
* @param aiProviderId ai Provider identifier
* @param path raw provider API path after `/gateway/`
* @param request request body
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.enterprise.put
*/
organizationAiGatewayPut(aiProviderId, path, request) {
const url = `${this.url}/ai/providers/${aiProviderId}/gateway/${path}`;
return this.put(url, request, this.defaultConfig());
}
/**
* @param aiProviderId ai Provider identifier
* @param path raw provider API path after `/gateway/`
* @param request request body
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.enterprise.patch
*/
organizationAiGatewayPatch(aiProviderId, path, request) {
const url = `${this.url}/ai/providers/${aiProviderId}/gateway/${path}`;
return this.patch(url, request, this.defaultConfig());
}
/**
* @param aiProviderId ai Provider identifier
* @param path raw provider API path after `/gateway/`
* @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.enterprise.delete
*/
organizationAiGatewayDelete(aiProviderId, path) {
const url = `${this.url}/ai/providers/${aiProviderId}/gateway/${path}`;
return this.delete(url, this.defaultConfig());
}
// Community
/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param userId user identifier
* @param options request options
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompt.custom.placeholders.getMany
*/
listAiUserCustomPlaceholders(userId, options) {
const url = `${this.url}/users/${userId}/ai/settings/custom-placeholders`;
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param userId user identifier
* @param request request body
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.settings.custom-placeholders.post
*/
addAiUserCustomPlaceholder(userId, request) {
const url = `${this.url}/users/${userId}/ai/settings/custom-placeholders`;
return this.post(url, request, this.defaultConfig());
}
/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param userId user identifier
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.settings.custom-placeholders.get
*/
getAiUserCustomPlaceholder(userId, aiCustomPlaceholderId) {
const url = `${this.url}/users/${userId}/ai/settings/custom-placeholders/${aiCustomPlaceholderId}`;
return this.get(url, this.defaultConfig());
}
/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param userId user identifier
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.settings.custom-placeholders.delete
*/
deleteAiUserCustomPlaceholder(userId, aiCustomPlaceholderId) {
const url = `${this.url}/users/${userId}/ai/settings/custom-placeholders/${aiCustomPlaceholderId}`;
return this.delete(url, this.defaultConfig());
}
/**
* @deprecated AI Custom Placeholders APIs are deprecated.
* @param userId user identifier
* @param aiCustomPlaceholderId ai custom placeholder identifier
* @param request request body
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.settings.custom-placeholders.patch
*/
editAiUserCustomPlaceholder(userId, aiCustomPlaceholderId, request) {
const url = `${this.url}/users/${userId}/ai/settings/custom-placeholders/${aiCustomPlaceholderId}`;
return this.patch(url, request, this.defaultConfig());
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @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.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());
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @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());
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @param userId user identifier
* @param aiPromptId ai prompt identifier
* @param jobIdentifier job identifier
* @param options request options
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.events.getMany
*/
listAiUserPromptFineTuningEvents(userId, aiPromptId, jobIdentifier, options) {
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}/fine-tuning/jobs/${jobIdentifier}/events`;
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @param userId user identifier
* @param options request options
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.prompts.fine-tuning.jobs.getMany
*/
listAiUserPromptFineTuningJobs(userId, options) {
let url = `${this.url}/users/${userId}/ai/prompts/fine-tuning/jobs`;
url = this.addQueryParam(url, 'statuses', options === null || options === void 0 ? void 0 : options.statuses);
url = this.addQueryParam(url, 'orderBy', options === null || options === void 0 ? void 0 : options.orderBy);
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @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());
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @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());
}
/**
* @deprecated Fine-tuning APIs are deprecated.
* @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
*/
cloneAiUserPrompt(userId, aiPromptId, request = {}) {
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}/clones`;
return this.post(url, request, this.defaultConfig());
}
/**
* @param userId user identifier
* @param options optional parameters for the request
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.post
*/
listAiUserPrompts(userId, options) {
let url = `${this.url}/users/${userId}/ai/prompts`;
url = this.addQueryParam(url, 'projectId', options === null || options === void 0 ? void 0 : options.projectId);
url = this.addQueryParam(url, 'action', options === null || options === void 0 ? void 0 : options.action);
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @param userId user identifier
* @param request request body
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.post
*/
addAiUserPrompt(userId, request) {
const url = `${this.url}/users/${userId}/ai/prompts`;
return this.post(url, request, 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.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.
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.get
*/
getAiUserPrompt(userId, aiPromptId) {
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}`;
return this.get(url, this.defaultConfig());
}
/**
* @param userId user identifier
* @param aiPromptId ai Prompt identifier.
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.prompts.delete
*/
deleteAiUserPrompt(userId, aiPromptId) {
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}`;
return this.delete(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.patch
*/
editAiUserPrompt(userId, aiPromptId, request) {
const url = `${this.url}/users/${userId}/ai/prompts/${aiPromptId}`;
return this.patch(url, request, this.defaultConfig());
}
/**
* @param userId user identifier
* @param options optional parameters for the request
* @see https://developer.crowdin.com/api/v2/#operation/api.ai.providers.getMany
*/
listAiUserProviders(userId, options) {
const url = `${this.url}/users/${userId}/ai/providers`;
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @param userId user identifier
* @param request request body
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.providers.post
*/
addAiUserProvider(userId, request) {
const url = `${this.url}/users/${userId}/ai/providers`;
return this.post(url, request, this.defaultConfig());
}
/**
* @param userId user identifier
* @param aiProviderId ai Provider identifier.
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.providers.get
*/
getAiUserProvider(userId, aiProviderId) {
const url = `${this.url}/users/${userId}/ai/providers/${aiProviderId}`;
return this.get(url, this.defaultConfig());
}
/**
* @param userId user identifier
* @param aiProviderId ai Provider identifier.
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.providers.delete
*/
deleteAiUserProvider(userId, aiProviderId) {
const url = `${this.url}/users/${userId}/ai/providers/${aiProviderId}`;
return this.delete(url, this.defaultConfig());
}
/**
* @param userId user identifier
* @param aiProviderId ai Provider identifier
* @param request request body
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.providers.patch
*/
editAiUserProvider(userId, aiProviderId, request) {
const url = `${this.url}/users/${userId}/ai/providers/${aiProviderId}`;
return this.patch(url, request, this.defaultConfig());
}
/**
* @param userId user identifier
* @param aiProviderId ai Provider identifier
* @param options optional parameters for the request
* @see https://developer.crowdin.com/api/v2/#operation/api.ai.providers.models.getMany
*/
listAiUserProviderModels(userId, aiProviderId, options) {
let url = `${this.url}/users/${userId}/ai/providers/${aiProviderId}/models`;
url = this.addQueryParam(url, 'limit', options === null || options === void 0 ? void 0 : options.limit);
url = this.addQueryParam(url, 'offset', options === null || options === void 0 ? void 0 : options.offset);
return this.getList(url);
}
/**
* @param userId user identifier
* @param options optional parameters for the request
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.providers.models.crowdin.getMany
*
*/
listAiUserAllProviderModels(userId, options) {
const url = `${this.url}/users/${userId}/ai/providers/models`;
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @param userId user identifier
* @param options optional parameters for the request
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.ai.providers.supported-models.crowdin.getMany
*/
listAiUserSupportedProviderModels(userId, options) {
var _a;
let url = `${this.url}/users/${userId}/ai/providers/supported-models`;
url = this.addQueryParam(url, 'providerType', options === null || options === void 0 ? void 0 : options.providerType);
url = this.addQueryParam(url, 'enabled', (_a = options === null || options === void 0 ? void 0 : options.enabled) === null || _a === void 0 ? void 0 : _a.toString());
url = this.addQueryParam(url, 'orderBy', options === null || options === void 0 ? void 0 : options.orderBy);
return this.getList(url, options === null || options === void 0 ? void 0 : options.limit, options === null || options === void 0 ? void 0 : options.offset);
}
/**
* @param userId user Identifier
* @param aiProviderId ai Provider identifier
* @param request request body
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.providers.chat.completions.post
*/
createAiUserProxyChatCompletion(userId, aiProviderId, request) {
const url = `${this.url}/users/${userId}/ai/providers/${aiProviderId}/chat/completions`;
return this.post(url, request, this.defaultConfig());
}
/**
* @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
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.settings.get
*/
getAiUserSettings(userId) {
const url = `${this.url}/users/${userId}/ai/settings`;
return this.get(url, this.defaultConfig());
}
/**
* @param userId user Identifier
* @param request request body
* @see https://developer.crowdin.com/api/v2/#operation/api.users.ai.settings.patch
*/
editAiUserSettings(userId, request) {
const url = `${this.url}/users/${userId}/ai/settings`;
return this.patch(url, request, this.defaultConfig());
}
/**
* @param userId user identifier
* @param request request body
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.translate.strings.post
*/
translateAiUserStrings(userId, request) {
const url = `${this.url}/users/${userId}/ai/translate`;
return this.post(url, request, this.defaultConfig());
}
/**
* @param userId user identifier
* @param request request body
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.file-translations.post
*/
startAiUserFileTranslation(userId, request) {
const url = `${this.url}/users/${userId}/ai/file-translations`;
return this.post(url, request, this.defaultConfig());
}
/**
* @param userId user identifier
* @param jobIdentifier job identifier
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.file-translations.get
*/
getAiUserFileTranslationStatus(userId, jobIdentifier) {
const url = `${this.url}/users/${userId}/ai/file-translations/${jobIdentifier}`;
return this.get(url, this.defaultConfig());
}
/**
* @param userId user identifier
* @param jobIdentifier job identifier
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.file-translations.delete
*/
cancelAiUserFileTranslation(userId, jobIdentifier) {
const url = `${this.url}/users/${userId}/ai/file-translations/${jobIdentifier}`;
return this.delete(url, this.defaultConfig());
}
/**
* @param userId user identifier
* @param jobIdentifier job identifier
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.file-translations.download
*/
downloadAiUserFileTranslation(userId, jobIdentifier) {
const url = `${this.url}/users/${userId}/ai/file-translations/${jobIdentifier}/download`;
return this.get(url, this.defaultConfig());
}
/**
* @param userId user identifier
* @param jobIdentifier job identifier
* @see https://support.crowdin.com/developer/api/v2/#tag/AI/operation/api.users.ai.file-translations.download-strings
*/
downloadAiUserFileTranslationStrings(userId, jobIdentifier) {
const url = `${this.url}/users/${userId}/ai/file-translations/${jobIdentifier}/translations`;
return this.get(url, this.defaultConfig());
}
/**
* @param userId user identifier
* @param aiProviderId ai Provider identifier
* @param path raw provider API path after `/gateway/`
* @see https://support.crowdin.com/developer/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.crowdin.get
*/
userAiGatewayGet(userId, aiProviderId, path) {
const url = `${this.url}/users/${userId}/ai/providers/${aiProviderId}/gateway/${path}`;
return this.get(url, this.defaultConfig());
}
/**
* @param userId user identifier
* @param aiProviderId ai Provider identifier
* @param path raw provider API path after `/gateway/`
* @param request request body
* @see https://support.crowdin.com/developer/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.crowdin.post
*/
userAiGatewayPost(userId, aiProviderId, path, request) {
const url = `${this.url}/users/${userId}/ai/providers/${aiProviderId}/gateway/${path}`;
return this.post(url, request, this.defaultConfig());
}
/**
* @param userId user identifier
* @param aiProviderId ai Provider identifier
* @param path raw provider API path after `/gateway/`
* @param request request body
* @see https://support.crowdin.com/developer/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.crowdin.put
*/
userAiGatewayPut(userId, aiProviderId, path, request) {
const url = `${this.url}/users/${userId}/ai/providers/${aiProviderId}/gateway/${path}`;
return this.put(url, request, this.defaultConfig());
}
/**
* @param userId user identifier
* @param aiProviderId ai Provider identifier
* @param path raw provider API path after `/gateway/`
* @param request request body
* @see https://support.crowdin.com/developer/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.crowdin.patch
*/
userAiGatewayPatch(userId, aiProviderId, path, request) {
const url = `${this.url}/users/${userId}/ai/providers/${aiProviderId}/gateway/${path}`;
return this.patch(url, request, this.defaultConfig());
}
/**
* @param userId user identifier
* @param aiProviderId ai Provider identifier
* @param path raw provider API path after `/gateway/`
* @see https://support.crowdin.com/developer/api/v2/#tag/AI-Gateway/operation/api.ai.providers.gateway.crowdin.delete
*/
userAiGatewayDelete(userId, aiProviderId, path) {
const url = `${this.url}/users/${userId}/ai/providers/${aiProviderId}/gateway/${path}`;
return this.delete(url, this.defaultConfig());
}
}
exports.Ai = Ai;