TaskTrellisService.ts•2.86 kB
import { ServerConfig } from "../configuration";
import {
TrellisObjectPriority,
TrellisObjectStatus,
TrellisObjectType,
} from "../models";
import { Repository } from "../repositories";
export interface TaskTrellisService {
/**
* Creates a new object in the task trellis system
*/
createObject(
repository: Repository,
type: TrellisObjectType,
title: string,
parent?: string,
priority?: TrellisObjectPriority,
status?: TrellisObjectStatus,
prerequisites?: string[],
description?: string,
): Promise<{ content: Array<{ type: string; text: string }> }>;
/**
* Updates an existing object in the task trellis system
*/
updateObject(
repository: Repository,
serverConfig: ServerConfig,
id: string,
title?: string,
priority?: TrellisObjectPriority,
prerequisites?: string[],
body?: string,
status?: TrellisObjectStatus,
force?: boolean,
): Promise<{ content: Array<{ type: string; text: string }> }>;
/**
* Claims a task in the task trellis system
*/
claimTask(
repository: Repository,
scope?: string,
taskId?: string,
force?: boolean,
): Promise<{ content: Array<{ type: string; text: string }> }>;
/**
* Gets the next available issue without claiming it
*/
getNextAvailableIssue(
repository: Repository,
scope?: string,
issueType?: TrellisObjectType | TrellisObjectType[],
): Promise<{ content: Array<{ type: string; text: string }> }>;
/**
* Completes a task in the task trellis system
*/
completeTask(
repository: Repository,
serverConfig: ServerConfig,
taskId: string,
summary: string,
filesChanged: Record<string, string>,
): Promise<{ content: Array<{ type: string; text: string }> }>;
/**
* Lists objects from the task trellis system
*/
listObjects(
repository: Repository,
type?: TrellisObjectType | TrellisObjectType[],
scope?: string,
status?: TrellisObjectStatus | TrellisObjectStatus[],
priority?: TrellisObjectPriority | TrellisObjectPriority[],
includeClosed?: boolean,
): Promise<{ content: Array<{ type: string; text: string }> }>;
/**
* Appends content to an object's log in the task trellis system
*/
appendObjectLog(
repository: Repository,
id: string,
contents: string,
): Promise<{ content: Array<{ type: string; text: string }> }>;
/**
* Prunes closed objects from the task trellis system
*/
pruneClosed(
repository: Repository,
age: number,
scope?: string,
): Promise<{ content: Array<{ type: string; text: string }> }>;
/**
* Appends modified files information to a trellis object
*/
appendModifiedFiles(
repository: Repository,
id: string,
filesChanged: Record<string, string>,
): Promise<{ content: Array<{ type: string; text: string }> }>;
}