(
slug: IntegrationSlug,
)
| 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, |
no test coverage detected