refactor(core): Remove linting exceptions in nodes-base (no-changelog) (#4944)

This commit is contained in:
Michael Kret
2023-01-13 19:11:56 +02:00
committed by GitHub
parent d7732ea150
commit 6608e69457
254 changed files with 2687 additions and 2675 deletions

View File

@@ -12,6 +12,57 @@ export interface OperationHandler {
handleOperation(ctx: Context, itemIndex: number): Promise<TodoistResponse>;
}
export interface CreateTaskRequest {
content?: string;
description?: string;
project_id?: number;
section_id?: number;
parent_id?: string;
order?: number;
labels?: string[];
priority?: number;
due_string?: string;
due_datetime?: string;
due_date?: string;
due_lang?: string;
}
export interface SyncRequest {
commands: Command[];
temp_id_mapping?: IDataObject;
}
export interface Command {
type: CommandType;
uuid: string;
temp_id?: string;
args: {
id?: number;
section_id?: number;
project_id?: number | string;
section?: string;
content?: string;
};
}
export enum CommandType {
ITEM_MOVE = 'item_move',
ITEM_ADD = 'item_add',
ITEM_UPDATE = 'item_update',
ITEM_REORDER = 'item_reorder',
ITEM_DELETE = 'item_delete',
ITEM_COMPLETE = 'item_complete',
}
async function getLabelNameFromId(ctx: Context, labelIds: number[]): Promise<string[]> {
const labelList = [];
for (const label of labelIds) {
const thisLabel = await todoistApiRequest.call(ctx, 'GET', `/labels/${label}`);
labelList.push(thisLabel.name);
}
return labelList;
}
export class CreateHandler implements OperationHandler {
async handleOperation(ctx: Context, itemIndex: number): Promise<TodoistResponse> {
//https://developer.todoist.com/rest/v2/#create-a-new-task
@@ -301,54 +352,3 @@ export class SyncHandler implements OperationHandler {
return command.type === CommandType.ITEM_ADD;
}
}
async function getLabelNameFromId(ctx: Context, labelIds: number[]): Promise<string[]> {
const labelList = [];
for (const label of labelIds) {
const thisLabel = await todoistApiRequest.call(ctx, 'GET', `/labels/${label}`);
labelList.push(thisLabel.name);
}
return labelList;
}
export interface CreateTaskRequest {
content?: string;
description?: string;
project_id?: number;
section_id?: number;
parent_id?: string;
order?: number;
labels?: string[];
priority?: number;
due_string?: string;
due_datetime?: string;
due_date?: string;
due_lang?: string;
}
export interface SyncRequest {
commands: Command[];
temp_id_mapping?: IDataObject;
}
export interface Command {
type: CommandType;
uuid: string;
temp_id?: string;
args: {
id?: number;
section_id?: number;
project_id?: number | string;
section?: string;
content?: string;
};
}
export enum CommandType {
ITEM_MOVE = 'item_move',
ITEM_ADD = 'item_add',
ITEM_UPDATE = 'item_update',
ITEM_REORDER = 'item_reorder',
ITEM_DELETE = 'item_delete',
ITEM_COMPLETE = 'item_complete',
}