Skip to content

Commit 0b01d4b

Browse files
committed
Lint
1 parent a588317 commit 0b01d4b

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

apps/sim/app/api/tools/get-user-workflow/route.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { NextRequest, NextResponse } from 'next/server'
1+
import { eq } from 'drizzle-orm'
2+
import { type NextRequest, NextResponse } from 'next/server'
23
import { createLogger } from '@/lib/logs/console-logger'
4+
import { loadWorkflowFromNormalizedTables } from '@/lib/workflows/db-helpers'
5+
import { generateWorkflowYaml } from '@/lib/workflows/yaml-generator'
36
import { db } from '@/db'
47
import { workflow as workflowTable } from '@/db/schema'
5-
import { eq } from 'drizzle-orm'
6-
import { generateWorkflowYaml } from '@/lib/workflows/yaml-generator'
7-
import { loadWorkflowFromNormalizedTables } from '@/lib/workflows/db-helpers'
88

99
const logger = createLogger('GetUserWorkflowAPI')
1010

@@ -38,7 +38,7 @@ export async function POST(request: NextRequest) {
3838

3939
// Try to load from normalized tables first, fallback to JSON blob
4040
let workflowState: any = null
41-
let subBlockValues: Record<string, Record<string, any>> = {}
41+
const subBlockValues: Record<string, Record<string, any>> = {}
4242

4343
const normalizedData = await loadWorkflowFromNormalizedTables(workflowId)
4444
if (normalizedData) {
@@ -48,7 +48,7 @@ export async function POST(request: NextRequest) {
4848
loops: normalizedData.loops,
4949
parallels: normalizedData.parallels,
5050
}
51-
51+
5252
// Extract subblock values from normalized data
5353
Object.entries(normalizedData.blocks).forEach(([blockId, block]) => {
5454
subBlockValues[blockId] = {}
@@ -64,7 +64,7 @@ export async function POST(request: NextRequest) {
6464
// For JSON blob, subblock values are embedded in the block state
6565
Object.entries((workflowState.blocks as any) || {}).forEach(([blockId, block]) => {
6666
subBlockValues[blockId] = {}
67-
Object.entries(((block as any).subBlocks || {})).forEach(([subBlockId, subBlock]) => {
67+
Object.entries((block as any).subBlocks || {}).forEach(([subBlockId, subBlock]) => {
6868
if ((subBlock as any).value !== undefined) {
6969
subBlockValues[blockId][subBlockId] = (subBlock as any).value
7070
}
@@ -129,4 +129,4 @@ export async function POST(request: NextRequest) {
129129
{ status: 500 }
130130
)
131131
}
132-
}
132+
}

apps/sim/app/api/workflows/yaml/convert/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ export async function POST(request: NextRequest) {
4141
{ status: 500 }
4242
)
4343
}
44-
}
44+
}

apps/sim/lib/copilot/tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const getUserWorkflowTool: CopilotTool = {
9999
const activeWorkflowId = registry.activeWorkflowId
100100
const activeWorkflow = activeWorkflowId ? registry.workflows[activeWorkflowId] : null
101101

102-
let metadata = undefined
102+
let metadata
103103
if (activeWorkflow) {
104104
metadata = {
105105
workflowId: activeWorkflowId,

apps/sim/lib/workflows/yaml-generator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface YamlWorkflow {
2424
* This version works without client-side stores by using the provided subblock values
2525
*/
2626
function extractBlockInputs(
27-
blockState: BlockState,
27+
blockState: BlockState,
2828
blockId: string,
2929
subBlockValues?: Record<string, Record<string, any>>
3030
): Record<string, any> {
@@ -189,4 +189,4 @@ export function generateWorkflowYaml(
189189
logger.error('Failed to generate workflow YAML:', error)
190190
return `# Error generating YAML: ${error instanceof Error ? error.message : 'Unknown error'}`
191191
}
192-
}
192+
}

apps/sim/stores/workflows/yaml/store.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type WorkflowYamlStore = WorkflowYamlState & WorkflowYamlActions
2626
function getSubBlockValues() {
2727
const workflowState = useWorkflowStore.getState()
2828
const subBlockStore = useSubBlockStore.getState()
29-
29+
3030
const subBlockValues: Record<string, Record<string, any>> = {}
3131
Object.entries(workflowState.blocks).forEach(([blockId]) => {
3232
subBlockValues[blockId] = {}
@@ -38,7 +38,7 @@ function getSubBlockValues() {
3838
}
3939
})
4040
})
41-
41+
4242
return subBlockValues
4343
}
4444

@@ -98,7 +98,7 @@ export const useWorkflowYamlStore = create<WorkflowYamlStore>()(
9898
generateYaml: () => {
9999
// Initialize subscriptions on first use
100100
initializeSubscriptions()
101-
101+
102102
const workflowState = useWorkflowStore.getState()
103103
const subBlockValues = getSubBlockValues()
104104
const yaml = generateWorkflowYaml(workflowState, subBlockValues)
@@ -112,7 +112,7 @@ export const useWorkflowYamlStore = create<WorkflowYamlStore>()(
112112
getYaml: () => {
113113
// Initialize subscriptions on first use
114114
initializeSubscriptions()
115-
115+
116116
const currentTime = Date.now()
117117
const { yaml, lastGenerated } = get()
118118

0 commit comments

Comments
 (0)