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

Function integrationsRemove

packages/core/sdk/src/executor.ts:1920–1939  ·  view source on GitHub ↗
(
      slug: IntegrationSlug,
    )

Source from the content-addressed store, hash-verified

1918 });
1919
1920 const integrationsRemove = (
1921 slug: IntegrationSlug,
1922 ): Effect.Effect<void, IntegrationRemovalNotAllowedError | StorageFailure> =>
1923 transaction(
1924 Effect.gen(function* () {
1925 const existing = yield* findIntegrationRow(slug);
1926 if (!existing) return;
1927 if (!existing.can_remove) {
1928 return yield* new IntegrationRemovalNotAllowedError({ slug });
1929 }
1930 // Drop owned connections / tools / definitions for this integration.
1931 const where = (b: AnyCb) => b("integration", "=", String(slug));
1932 yield* core.deleteMany("tool", { where });
1933 yield* core.deleteMany("definition", { where });
1934 yield* core.deleteMany("connection", { where });
1935 yield* core.deleteMany("integration", {
1936 where: (b: AnyCb) => b("slug", "=", String(slug)),
1937 });
1938 }),
1939 );
1940
1941 const integrationsDetect = (
1942 url: string,

Callers 1

createExecutorFunction · 0.85

Calls 2

findIntegrationRowFunction · 0.85
transactionFunction · 0.70

Tested by

no test coverage detected