| 9 | export const WORKFLOW_LIST_STALE_TIME = 60 * 1000 |
| 10 | |
| 11 | export function mapWorkflow(workflow: WorkflowApiRow): WorkflowMetadata { |
| 12 | return { |
| 13 | id: workflow.id, |
| 14 | name: workflow.name, |
| 15 | description: workflow.description ?? undefined, |
| 16 | workspaceId: workflow.workspaceId ?? undefined, |
| 17 | folderId: workflow.folderId, |
| 18 | sortOrder: workflow.sortOrder, |
| 19 | createdAt: new Date(workflow.createdAt), |
| 20 | lastModified: new Date(workflow.updatedAt), |
| 21 | archivedAt: workflow.archivedAt ? new Date(workflow.archivedAt) : null, |
| 22 | locked: workflow.locked, |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | async function fetchWorkflows( |
| 27 | workspaceId: string, |