(target: TargetShape, identity: Identity)
| 20 | |
| 21 | /** The link the dashboard would render for this identity's org, or null. */ |
| 22 | const v2ImportUrlOf = (target: TargetShape, identity: Identity): Effect.Effect<string | null> => |
| 23 | Effect.promise(async () => { |
| 24 | const response = await fetch(new URL(V2_IMPORT_API, target.baseUrl), { |
| 25 | headers: identity.headers, |
| 26 | }); |
| 27 | if (!response.ok) throw new Error(`${V2_IMPORT_API} failed (${response.status})`); |
| 28 | return ((await response.json()) as { url: string | null }).url; |
| 29 | }); |
| 30 | |
| 31 | scenario( |
| 32 | "v2 import · the only member of a free org sees the link to v2's import", |
no test coverage detected