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.

77 lines (76 loc) • 3.61 kB
import { type CreateProjectParams, type Project, type UpdateProjectParams } from "@lokalise/node-api"; import type { ApiRequestOptions } from "../../shared/types/common.types.js"; /** * @namespace VendorProjectsService * @description Service layer for interacting with Lokalise Projects API endpoints. * Uses the official Lokalise SDK for reliable API communication. */ /** * @function getProjects * @description Fetches a list of projects from Lokalise API using the official SDK. * @memberof VendorProjectsService * @param {ApiRequestOptions} [options={}] - Optional request options for pagination and limits. * @returns {Promise<Project[]>} A promise that resolves to an array of project information. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function getProjects(options?: ApiRequestOptions): Promise<Project[]>; /** * @function getProjectDetails * @description Fetches detailed information about a specific project from Lokalise API using the official SDK. * @memberof VendorProjectsService * @param {string} projectId - The project ID to get details for. * @returns {Promise<Project>} A promise that resolves to the project details. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function getProjectDetails(projectId: string): Promise<Project>; /** * @function createProject * @description Creates a new project in Lokalise using the official SDK. * @memberof VendorProjectsService * @param {CreateProjectParams} projectData - The project data to create. * @returns {Promise<Project>} A promise that resolves to the created project. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function createProject(projectData: CreateProjectParams): Promise<Project>; /** * @function updateProject * @description Updates an existing project in Lokalise using the official SDK. * @memberof VendorProjectsService * @param {string} projectId - The project ID to update. * @param {UpdateProjectData} projectData - The project data to update. * @returns {Promise<Project>} A promise that resolves to the updated project. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function updateProject(projectId: string, projectData: UpdateProjectParams): Promise<Project>; /** * @function deleteProject * @description Deletes a project from Lokalise using the official SDK. * @memberof VendorProjectsService * @param {string} projectId - The project ID to delete. * @returns {Promise<{ project_id: string }>} A promise that resolves to confirmation of deletion. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function deleteProject(projectId: string): Promise<{ project_id: string; }>; /** * @function emptyProject * @description Empties a project (removes all keys and translations) from Lokalise using the official SDK. * @memberof VendorProjectsService * @param {string} projectId - The project ID to empty. * @returns {Promise<{ project_id: string; keys_deleted: boolean }>} A promise that resolves to confirmation of emptying. * @throws {McpError} Throws an `McpError` if the API call fails. */ declare function emptyProject(projectId: string): Promise<{ project_id: string; keys_deleted: boolean; }>; declare const _default: { getProjects: typeof getProjects; getProjectDetails: typeof getProjectDetails; createProject: typeof createProject; updateProject: typeof updateProject; deleteProject: typeof deleteProject; emptyProject: typeof emptyProject; }; export default _default;