MCPcopy
hub / github.com/simstudioai/sim / checkNeedsRedeployment

Function checkNeedsRedeployment

apps/sim/app/api/workflows/utils.ts:47–62  ·  view source on GitHub ↗
(workflowId: string)

Source from the content-addressed store, hash-verified

45}
46
47export async function checkNeedsRedeployment(workflowId: string): Promise<boolean> {
48 const [active] = await db
49 .select({ state: workflowDeploymentVersion.state })
50 .from(workflowDeploymentVersion)
51 .where(
52 and(
53 eq(workflowDeploymentVersion.workflowId, workflowId),
54 eq(workflowDeploymentVersion.isActive, true)
55 )
56 )
57 .orderBy(desc(workflowDeploymentVersion.createdAt))
58 .limit(1)
59
60 const currentState = await loadWorkflowDeploymentSnapshot(workflowId)
61 return computeNeedsRedeployment(currentState, (active?.state as WorkflowState) ?? null)
62}
63
64/**
65 * Verifies user's workspace permissions using the permissions table

Callers 3

route.tsFile · 0.90
route.tsFile · 0.90

Calls 3

computeNeedsRedeploymentFunction · 0.85
eqFunction · 0.50

Tested by

no test coverage detected