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.15 kB
import type { ControllerResponse } from "../../shared/types/common.types.js"; import type { CreateKeysToolArgsType, DeleteKeyToolArgsType, GetKeyToolArgsType, ListKeysToolArgsType, UpdateKeyToolArgsType, BulkUpdateKeysToolArgsType, BulkDeleteKeysToolArgsType } from "./keys.types.js"; /** * @namespace KeysController * @description Controller responsible for handling Lokalise Keys API operations. * It orchestrates calls to the keys service, applies defaults, * maps options, and formats the response using the formatter. */ /** * @function listKeys * @description Fetches a list of keys from a Lokalise project with optional filtering and pagination. * @memberof KeysController * @param {ListKeysToolArgsType} args - Arguments containing project ID, filters, and pagination options * @returns {Promise<ControllerResponse>} A promise that resolves to the standard controller response containing the formatted keys list in Markdown. * @throws {McpError} Throws an McpError (handled by `handleControllerError`) if the service call fails or returns an error. */ declare function listKeys(args: ListKeysToolArgsType): Promise<ControllerResponse>; /** * @function createKeys * @description Creates multiple keys in a Lokalise project * @memberof KeysController * @param {CreateKeysToolArgsType} args - Arguments containing project ID and keys data * @returns {Promise<ControllerResponse>} A promise that resolves to the standard controller response containing the creation results. */ declare function createKeys(args: CreateKeysToolArgsType): Promise<ControllerResponse>; /** * @function getKey * @description Fetches a single key from a Lokalise project * @memberof KeysController * @param {GetKeyToolArgsType} args - Arguments containing project ID and key ID * @returns {Promise<ControllerResponse>} A promise that resolves to the standard controller response containing the key details. */ declare function getKey(args: GetKeyToolArgsType): Promise<ControllerResponse>; /** * @function updateKey * @description Updates a single key in a Lokalise project * @memberof KeysController * @param {UpdateKeyToolArgsType} args - Arguments containing project ID, key ID and update data * @returns {Promise<ControllerResponse>} A promise that resolves to the standard controller response containing the updated key details. */ declare function updateKey(args: UpdateKeyToolArgsType): Promise<ControllerResponse>; /** * @function deleteKey * @description Deletes a single key from a Lokalise project * @memberof KeysController * @param {DeleteKeyToolArgsType} args - Arguments containing project ID and key ID * @returns {Promise<ControllerResponse>} A promise that resolves to the standard controller response containing the deletion confirmation. */ declare function deleteKey(args: DeleteKeyToolArgsType): Promise<ControllerResponse>; /** * @function bulkUpdateKeys * @description Updates multiple keys in a Lokalise project * @memberof KeysController * @param {BulkUpdateKeysToolArgsType} args - Arguments containing project ID and keys update data * @returns {Promise<ControllerResponse>} A promise that resolves to the standard controller response containing the bulk update results. */ declare function bulkUpdateKeys(args: BulkUpdateKeysToolArgsType): Promise<ControllerResponse>; /** * @function bulkDeleteKeys * @description Deletes multiple keys from a Lokalise project * @memberof KeysController * @param {BulkDeleteKeysToolArgsType} args - Arguments containing project ID and key IDs * @returns {Promise<ControllerResponse>} A promise that resolves to the standard controller response containing the bulk deletion results. */ declare function bulkDeleteKeys(args: BulkDeleteKeysToolArgsType): Promise<ControllerResponse>; /** * Export the controller functions */ declare const keysController: { listKeys: typeof listKeys; createKeys: typeof createKeys; getKey: typeof getKey; updateKey: typeof updateKey; deleteKey: typeof deleteKey; bulkUpdateKeys: typeof bulkUpdateKeys; bulkDeleteKeys: typeof bulkDeleteKeys; }; export default keysController;