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

Function getShareForResource

apps/sim/lib/public-shares/share-manager.ts:48–59  ·  view source on GitHub ↗
(
  resourceType: ShareResourceType,
  resourceId: string
)

Source from the content-addressed store, hash-verified

46}
47
48export async function getShareForResource(
49 resourceType: ShareResourceType,
50 resourceId: string
51): Promise<ShareRecord | null> {
52 const [row] = await db
53 .select()
54 .from(publicShare)
55 .where(and(eq(publicShare.resourceType, resourceType), eq(publicShare.resourceId, resourceId)))
56 .limit(1)
57
58 return row ? mapShareRecord(row) : null
59}
60
61/**
62 * Batch-fetch shares for many resources of the same type, keyed by `resourceId`.

Callers 2

route.tsFile · 0.90
route.tsFile · 0.90

Calls 2

mapShareRecordFunction · 0.85
eqFunction · 0.50

Tested by

no test coverage detected