MCPcopy Index your code
hub / github.com/simstudioai/sim / clearInWorkflowCheckpoints

Function clearInWorkflowCheckpoints

apps/sim/lib/credentials/deletion.ts:195–223  ·  view source on GitHub ↗
(
  credentialId: string,
  workspaceId: string,
  needle: string
)

Source from the content-addressed store, hash-verified

193}
194
195async function clearInWorkflowCheckpoints(
196 credentialId: string,
197 workspaceId: string,
198 needle: string
199): Promise<void> {
200 const rows = await db
201 .select({
202 id: schema.workflowCheckpoints.id,
203 workflowState: schema.workflowCheckpoints.workflowState,
204 })
205 .from(schema.workflowCheckpoints)
206 .innerJoin(schema.workflow, eq(schema.workflow.id, schema.workflowCheckpoints.workflowId))
207 .where(
208 and(
209 eq(schema.workflow.workspaceId, workspaceId),
210 sql`${schema.workflowCheckpoints.workflowState}::text LIKE ${needle}`
211 )
212 )
213
214 for (const row of rows) {
215 const next = clearCredentialInValue(row.workflowState, credentialId)
216 if (next.changed) {
217 await db
218 .update(schema.workflowCheckpoints)
219 .set({ workflowState: next.value, updatedAt: new Date() })
220 .where(eq(schema.workflowCheckpoints.id, row.id))
221 }
222 }
223}
224
225async function clearInKnowledgeConnectors(credentialId: string): Promise<void> {
226 await db

Callers 1

clearCredentialRefsFunction · 0.85

Calls 3

clearCredentialInValueFunction · 0.85
setMethod · 0.65
eqFunction · 0.50

Tested by

no test coverage detected