(
slug: IntegrationSlug,
patch: {
readonly name?: string;
readonly description?: string;
readonly config?: IntegrationConfig;
},
)
| 2339 | ); |
| 2340 | |
| 2341 | const integrationsUpdate = ( |
| 2342 | slug: IntegrationSlug, |
| 2343 | patch: { |
| 2344 | readonly name?: string; |
| 2345 | readonly description?: string; |
| 2346 | readonly config?: IntegrationConfig; |
| 2347 | }, |
| 2348 | ): Effect.Effect<void, StorageFailure> => |
| 2349 | Effect.gen(function* () { |
| 2350 | const now = new Date(); |
| 2351 | const set: Record<string, unknown> = { updated_at: now }; |
| 2352 | if (patch.name !== undefined) set.name = patch.name; |
| 2353 | if (patch.description !== undefined) set.description = patch.description; |
| 2354 | if (patch.config !== undefined) { |
| 2355 | set.config = patch.config; |
| 2356 | // A config change can change the derived tools. The writer can only |
| 2357 | // rebuild catalogs in its own partition (owner policy), so revise |
| 2358 | // the integration: other subjects' connections compare this stamp |
| 2359 | // against their `tools_synced_at` and lazily rebuild on next read. |
| 2360 | set.config_revised_at = now.getTime(); |
| 2361 | } |
| 2362 | yield* core.updateMany("integration", { |
| 2363 | where: (b: AnyCb) => b("slug", "=", String(slug)), |
| 2364 | set, |
| 2365 | }); |
| 2366 | }); |
| 2367 | |
| 2368 | const integrationsUpdatePublic = ( |
| 2369 | slug: IntegrationSlug, |
no outgoing calls
no test coverage detected