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

Function getForkParentId

apps/sim/lib/workspaces/fork/lineage/lineage.ts:21–28  ·  view source on GitHub ↗
(workspaceId: string)

Source from the content-addressed store, hash-verified

19 * is not a fork (or has been archived).
20 */
21export async function getForkParentId(workspaceId: string): Promise<string | null> {
22 const [row] = await db
23 .select({ parentId: workspace.forkedFromWorkspaceId })
24 .from(workspace)
25 .where(and(eq(workspace.id, workspaceId), isNull(workspace.archivedAt)))
26 .limit(1)
27 return row?.parentId ?? null
28}
29
30/** The parent lineage node for a fork, or null when it has no live parent. */
31export async function getForkParent(workspaceId: string): Promise<ForkLineageNode | null> {

Callers 2

getForkParentFunction · 0.85
resolveForkEdgeFunction · 0.85

Calls 1

eqFunction · 0.50

Tested by

no test coverage detected