lokalise-mcp
Version:
The Lokalise MCP Server brings Lokalise's localization power to Claude and AI assistants—manage projects, keys, and translations by chat.
122 lines (121 loc) • 4.44 kB
TypeScript
import type { CreateTaskParams, PaginatedResult, Task, TaskDeleted } from "@lokalise/node-api";
import type { ApiRequestOptions } from "../../shared/types/common.types.js";
/**
* @namespace VendorLokaliseTasksService
* @description Service layer for interacting with Lokalise Tasks API endpoints.
* Uses the official Lokalise SDK for reliable API communication.
*/
/**
* Parameters for listing tasks in a project
*/
export interface TaskListParams extends ApiRequestOptions {
project_id: string;
filter_title?: string;
filter_statuses?: string;
}
/**
* Parameters for creating a task in a project
*/
export interface CreateTaskServiceParams {
project_id: string;
title: string;
description?: string;
keys?: number[];
languages?: Array<{
language_iso: string;
users?: number[];
groups?: number[];
}>;
assignees?: number[];
due_date?: string;
source_language_iso?: string;
auto_close_languages?: boolean;
auto_close_task?: boolean;
auto_close_items?: boolean;
task_type?: CreateTaskParams["task_type"];
parent_task_id?: number;
closing_tags?: string[];
do_lock_translations?: boolean;
custom_translation_status_ids?: number[];
}
/**
* Parameters for getting a single task
*/
export interface GetTaskParams {
project_id: string;
task_id: number;
}
/**
* Parameters for updating a task
*/
export interface UpdateTaskServiceParams {
project_id: string;
task_id: number;
title?: string;
description?: string;
due_date?: string;
languages?: Array<{
language_iso: string;
users?: number[];
groups?: number[];
close_language?: boolean;
}>;
auto_close_languages?: boolean;
auto_close_task?: boolean;
auto_close_items?: boolean;
closing_tags?: string[];
do_lock_translations?: boolean;
close_task?: boolean;
}
/**
* Parameters for deleting a task
*/
export interface DeleteTaskParams {
project_id: string;
task_id: number;
}
/**
* @function getTasks
* @description Fetches a list of tasks from a Lokalise project with optional filtering and pagination.
* @memberof VendorLokaliseTasksService
* @param {TaskListParams} options - Parameters including project ID, filters, and pagination options
* @returns {Promise<PaginatedResult<Task>>} A promise that resolves to the API response containing the tasks list
* @throws {McpError} Throws an McpError with details if the API call fails
*/
export declare function getTasks(options: TaskListParams): Promise<PaginatedResult<Task>>;
/**
* @function createTask
* @description Creates a task in a Lokalise project
* @memberof VendorLokaliseTasksService
* @param {CreateTaskServiceParams} options - Parameters including project ID and task data
* @returns {Promise<Task>} A promise that resolves to the API response containing created task
* @throws {McpError} Throws an McpError with details if the API call fails
*/
export declare function createTask(options: CreateTaskServiceParams): Promise<Task>;
/**
* @function getTask
* @description Fetches a single task from a Lokalise project
* @memberof VendorLokaliseTasksService
* @param {GetTaskParams} options - Parameters including project ID and task ID
* @returns {Promise<Task>} A promise that resolves to the task data
* @throws {McpError} Throws an McpError with details if the API call fails
*/
export declare function getTask(options: GetTaskParams): Promise<Task>;
/**
* @function updateTask
* @description Updates a single task in a Lokalise project
* @memberof VendorLokaliseTasksService
* @param {UpdateTaskServiceParams} options - Parameters including project ID, task ID and update data
* @returns {Promise<Task>} A promise that resolves to the updated task data
* @throws {McpError} Throws an McpError with details if the API call fails
*/
export declare function updateTask(options: UpdateTaskServiceParams): Promise<Task>;
/**
* @function deleteTask
* @description Deletes a single task from a Lokalise project
* @memberof VendorLokaliseTasksService
* @param {DeleteTaskParams} options - Parameters including project ID and task ID
* @returns {Promise<TaskDeleted>} A promise that resolves to the deletion confirmation
* @throws {McpError} Throws an McpError with details if the API call fails
*/
export declare function deleteTask(options: DeleteTaskParams): Promise<TaskDeleted>;