(workflowId: string)
| 45 | } |
| 46 | |
| 47 | export 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 |
no test coverage detected