UNPKG

lokalise-mcp

Version:

The Lokalise MCP Server brings Lokalise's localization power to Claude and AI assistants—manage projects, keys, and translations by chat.

79 lines (78 loc) • 4.01 kB
import type { CreateLanguageParams, Language, UpdateLanguageParams } from "@lokalise/node-api"; import type { ApiRequestOptions } from "../../shared/types/common.types.js"; /** * @namespace VendorLanguagesService * @description Service layer for interacting with Lokalise Languages API endpoints. * Uses the official Lokalise SDK for reliable API communication. */ /** * @function getSystemLanguages * @description Fetches a list of system languages from Lokalise API using the official SDK. * @memberof VendorLanguagesService * @param {ApiRequestOptions} [options={}] - Optional request options for pagination and limits. * @returns {Promise<Language[]>} A promise that resolves to an array of system language information. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function getSystemLanguages(options?: ApiRequestOptions): Promise<Language[]>; /** * @function getProjectLanguages * @description Fetches a list of languages for a specific project from Lokalise API using the official SDK. * @memberof VendorLanguagesService * @param {string} projectId - The project ID to get languages for. * @returns {Promise<Language[]>} A promise that resolves to an array of language information. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function getProjectLanguages(projectId: string): Promise<Language[]>; /** * @function addProjectLanguages * @description Adds languages to a project in Lokalise using the official SDK. * @memberof VendorLanguagesService * @param {string} projectId - The project ID to add languages to. * @param {CreateLanguageParams[]} languages - Array of language data to add. * @returns {Promise<Language[]>} A promise that resolves to an array of added languages. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function addProjectLanguages(projectId: string, languages: CreateLanguageParams[]): Promise<Language[]>; /** * @function getLanguage * @description Fetches detailed information about a specific language from Lokalise API using the official SDK. * @memberof VendorLanguagesService * @param {string} projectId - The project ID. * @param {number} languageId - The language ID to get details for. * @returns {Promise<Language>} A promise that resolves to the language details. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function getLanguage(projectId: string, languageId: number): Promise<Language>; /** * @function updateLanguage * @description Updates an existing language using the official SDK. * @memberof VendorLanguagesService * @param {string} projectId - The project ID. * @param {number} languageId - The language ID to update. * @param {UpdateLanguageParams} languageData - The language data to update. * @returns {Promise<Language>} A promise that resolves to the updated language. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function updateLanguage(projectId: string, languageId: number, languageData: UpdateLanguageParams): Promise<Language>; /** * @function removeLanguage * @description Removes a language from a project using the official SDK. * @memberof VendorLanguagesService * @param {string} projectId - The project ID. * @param {number} languageId - The language ID to remove. * @returns {Promise<{ project_id: string; language_deleted: boolean }>} A promise that resolves to confirmation of removal. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function removeLanguage(projectId: string, languageId: number): Promise<{ project_id: string; language_deleted: boolean; }>; declare const _default: { getSystemLanguages: typeof getSystemLanguages; getProjectLanguages: typeof getProjectLanguages; addProjectLanguages: typeof addProjectLanguages; getLanguage: typeof getLanguage; updateLanguage: typeof updateLanguage; removeLanguage: typeof removeLanguage; }; export default _default;