9ff4c0dbd5
* Setup project-wide prettier * Remove old workspace file * Remove old debugging directives * New top-level .prettierignore * Updated Prettier config settings * Contrubuting guide: Fix for some bad code blocks * Added more ignores * Improved the format script command * printWidth set to 100 * Formatted entire repo (pnpm run format)
28 lines
815 B
TypeScript
28 lines
815 B
TypeScript
import type { Task, TaskAttempt } from "@trigger.dev/database";
|
|
import { ServerTask } from "@trigger.dev/core";
|
|
|
|
export type TaskWithAttempts = Task & { attempts: TaskAttempt[] };
|
|
|
|
export function taskWithAttemptsToServerTask(task: TaskWithAttempts): ServerTask {
|
|
return {
|
|
id: task.id,
|
|
name: task.name,
|
|
icon: task.icon,
|
|
noop: task.noop,
|
|
startedAt: task.startedAt,
|
|
completedAt: task.completedAt,
|
|
delayUntil: task.delayUntil,
|
|
status: task.status,
|
|
description: task.description,
|
|
params: task.params as any,
|
|
output: task.output as any,
|
|
properties: task.properties as any,
|
|
style: task.style as any,
|
|
error: task.error,
|
|
parentId: task.parentId,
|
|
attempts: task.attempts.length,
|
|
idempotencyKey: task.idempotencyKey,
|
|
operation: task.operation,
|
|
};
|
|
}
|