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

Function v2Moved

apps/cloud/src/auth/v2-moved.ts:66–75  ·  view source on GitHub ↗
(
  source: V2MovedSource,
  organizationId: string,
  v2Origin: URL,
)

Source from the content-addressed store, hash-verified

64/** Whether the organization has moved to v2. Never fails: an unavailable
65 * read answers `null`, so a WorkOS outage shows no notice. */
66export const v2Moved = (
67 source: V2MovedSource,
68 organizationId: string,
69 v2Origin: URL,
70): Effect.Effect<V2Moved | null> =>
71 source.organizationMetadata(organizationId).pipe(
72 Effect.map((metadata) => parseV2Moved(metadata, v2Origin)),
73 Effect.orElseSucceed(() => null),
74 Effect.withSpan("v2Moved.read"),
75 );
76
77/** The organization's metadata, read live from WorkOS (where v2 writes it). */
78export const liveV2MovedSource = Effect.gen(function* () {

Callers 3

v2-moved.test.tsFile · 0.90
movedLiveFunction · 0.90
v2ImportAnswerFunction · 0.90

Calls 1

parseV2MovedFunction · 0.85

Tested by 1

movedLiveFunction · 0.72