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

Function v2ImportUrlOf

e2e/cloud/v2-import-link.test.ts:22–29  ·  view source on GitHub ↗
(target: TargetShape, identity: Identity)

Source from the content-addressed store, hash-verified

20
21/** The link the dashboard would render for this identity's org, or null. */
22const 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
31scenario(
32 "v2 import · the only member of a free org sees the link to v2's import",

Callers 1

Calls 2

jsonMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected