(client: Client, baseUrl = "http://127.0.0.1:59999")
| 81 | /** Registers a fresh apiKey-authenticated integration for connections to bind |
| 82 | * to. Identifier-safe slug: it becomes a property path in sandbox code. */ |
| 83 | const registerIntegration = (client: Client, baseUrl = "http://127.0.0.1:59999") => |
| 84 | Effect.gen(function* () { |
| 85 | const slug = IntegrationSlug.make(`connscn${randomBytes(4).toString("hex")}`); |
| 86 | yield* client.openapi.addSpec({ |
| 87 | payload: { |
| 88 | spec: { kind: "blob", value: pingSpec }, |
| 89 | slug, |
| 90 | baseUrl, // the default is never contacted during registration |
| 91 | authenticationTemplate: [ |
| 92 | { |
| 93 | slug: "apiKey", |
| 94 | type: "apiKey", |
| 95 | headers: { authorization: ["Bearer ", { type: "variable", name: "token" }] }, |
| 96 | }, |
| 97 | ], |
| 98 | }, |
| 99 | }); |
| 100 | return slug; |
| 101 | }); |
| 102 | |
| 103 | // Already in canonical identifier form, so the name round-trips unchanged. |
| 104 | const freshConnectionName = () => ConnectionName.make(`conn${randomBytes(4).toString("hex")}`); |
no test coverage detected