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

Function registerIntegration

e2e/cloud/connections-credentials.test.ts:83–101  ·  view source on GitHub ↗
(client: Client, baseUrl = "http://127.0.0.1:59999")

Source from the content-addressed store, hash-verified

81/** Registers a fresh apiKey-authenticated integration for connections to bind
82 * to. Identifier-safe slug: it becomes a property path in sandbox code. */
83const 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.
104const freshConnectionName = () => ConnectionName.make(`conn${randomBytes(4).toString("hex")}`);

Callers 1

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected