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

Function clearInPausedExecutions

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

Source from the content-addressed store, hash-verified

163}
164
165async function clearInPausedExecutions(
166 credentialId: string,
167 workspaceId: string,
168 needle: string
169): Promise<void> {
170 const rows = await db
171 .select({
172 id: schema.pausedExecutions.id,
173 executionSnapshot: schema.pausedExecutions.executionSnapshot,
174 })
175 .from(schema.pausedExecutions)
176 .innerJoin(schema.workflow, eq(schema.workflow.id, schema.pausedExecutions.workflowId))
177 .where(
178 and(
179 eq(schema.workflow.workspaceId, workspaceId),
180 sql`${schema.pausedExecutions.executionSnapshot}::text LIKE ${needle}`
181 )
182 )
183
184 for (const row of rows) {
185 const next = clearCredentialInValue(row.executionSnapshot, credentialId)
186 if (next.changed) {
187 await db
188 .update(schema.pausedExecutions)
189 .set({ executionSnapshot: next.value, updatedAt: new Date() })
190 .where(eq(schema.pausedExecutions.id, row.id))
191 }
192 }
193}
194
195async function clearInWorkflowCheckpoints(
196 credentialId: string,

Callers 1

clearCredentialRefsFunction · 0.85

Calls 3

clearCredentialInValueFunction · 0.85
setMethod · 0.65
eqFunction · 0.50

Tested by

no test coverage detected