Skip to content

Commit 221125f

Browse files
committed
cleanup typing
1 parent dc04767 commit 221125f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • apps/sim/app/api/logs/execution/[executionId]

apps/sim/app/api/logs/execution/[executionId]/route.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { and, eq, inArray } from 'drizzle-orm'
1010
import { type NextRequest, NextResponse } from 'next/server'
1111
import { checkHybridAuth } from '@/lib/auth/hybrid'
1212
import { generateRequestId } from '@/lib/core/utils/request'
13+
import type { TraceSpan, WorkflowExecutionLog } from '@/lib/logs/types'
1314

1415
const logger = createLogger('LogsByExecutionIdAPI')
1516

@@ -79,19 +80,18 @@ export async function GET(
7980
return NextResponse.json({ error: 'Workflow state snapshot not found' }, { status: 404 })
8081
}
8182

82-
const traceSpans =
83-
(workflowLog.executionData as { traceSpans?: Array<{ [key: string]: unknown }> })
84-
?.traceSpans || []
83+
const executionData = workflowLog.executionData as WorkflowExecutionLog['executionData']
84+
const traceSpans = (executionData?.traceSpans as TraceSpan[]) || []
8585
const childSnapshotIds = new Set<string>()
86-
const collectSnapshotIds = (spans: Array<{ [key: string]: unknown }>) => {
86+
const collectSnapshotIds = (spans: TraceSpan[]) => {
8787
spans.forEach((span) => {
8888
const snapshotId = span.childWorkflowSnapshotId
8989
if (typeof snapshotId === 'string') {
9090
childSnapshotIds.add(snapshotId)
9191
}
9292
const children = span.children
9393
if (Array.isArray(children)) {
94-
collectSnapshotIds(children as Array<{ [key: string]: unknown }>)
94+
collectSnapshotIds(children)
9595
}
9696
})
9797
}

0 commit comments

Comments
 (0)