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

Function registerIntegration

e2e/cloud/admin-users-console.test.ts:62–80  ·  view source on GitHub ↗
(client: Client, label: string, spec = pingSpec)

Source from the content-addressed store, hash-verified

60
61/** Registers a fresh apiKey-authenticated integration for connections to bind to. */
62const registerIntegration = (client: Client, label: string, spec = pingSpec) =>
63 Effect.gen(function* () {
64 const slug = IntegrationSlug.make(`${label}-${randomBytes(4).toString("hex")}`);
65 yield* client.openapi.addSpec({
66 payload: {
67 spec: { kind: "blob", value: spec },
68 slug,
69 baseUrl: "http://127.0.0.1:59999", // never contacted during registration
70 authenticationTemplate: [
71 {
72 slug: "apiKey",
73 type: "apiKey",
74 headers: { authorization: ["Bearer ", { type: "variable", name: "token" }] },
75 },
76 ],
77 },
78 });
79 return slug;
80 });
81
82const freshConnectionName = () => ConnectionName.make(`conn${randomBytes(4).toString("hex")}`);
83

Callers 1

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected