| 99 | |
| 100 | /** A metadata read answering `metadata`, or failing; records each read. */ |
| 101 | const movedSourceOf = (metadata: Record<string, unknown> | "unavailable") => { |
| 102 | const reads: string[] = []; |
| 103 | const source: V2MovedSource = { |
| 104 | organizationMetadata: (organizationId) => |
| 105 | Effect.suspend(() => { |
| 106 | reads.push(organizationId); |
| 107 | return metadata === "unavailable" ? Effect.fail("unavailable") : Effect.succeed(metadata); |
| 108 | }), |
| 109 | }; |
| 110 | return { source, reads }; |
| 111 | }; |
| 112 | |
| 113 | /** An import source that admits the user, recording whether it was asked. */ |
| 114 | const importSourceOf = (eligible: boolean) => { |