MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / source

Function source

apps/cloud/src/auth/mirror-feeders.node.test.ts:1615–1623  ·  view source on GitHub ↗
(orgs: ReadonlyMap<string, readonly FakeMembership[]>, userCalls: string[])

Source from the content-addressed store, hash-verified

1613describe("backfill", () => {
1614 /** A fake WorkOS holding `orgs` → members, counting `getUser` calls. */
1615 const source = (orgs: ReadonlyMap<string, readonly FakeMembership[]>, userCalls: string[]) => ({
1616 listOrganizationIds: () => Effect.succeed([...orgs.keys()]),
1617 listOrgMembers: (organizationId: string) => Effect.succeed(orgs.get(organizationId) ?? []),
1618 getUser: (userId: string) =>
1619 Effect.sync(() => {
1620 userCalls.push(userId);
1621 return workosUser(userId);
1622 }),
1623 });
1624
1625 const withMirror = <A, E>(body: (mirror: WorkOsMirrorShape) => Effect.Effect<A, E>) =>
1626 Effect.runPromise(

Callers 2

runBackfillFunction · 0.85

Calls 4

pushMethod · 0.80
workosUserFunction · 0.70
getMethod · 0.65
syncMethod · 0.65

Tested by

no test coverage detected