(
slug: IntegrationSlug,
patch: {
readonly name?: string;
readonly description?: string;
readonly config?: IntegrationConfig;
},
)
| 2258 | ); |
| 2259 | |
| 2260 | const integrationsUpdate = ( |
| 2261 | slug: IntegrationSlug, |
| 2262 | patch: { |
| 2263 | readonly name?: string; |
| 2264 | readonly description?: string; |
| 2265 | readonly config?: IntegrationConfig; |
| 2266 | }, |
| 2267 | ): Effect.Effect<void, StorageFailure> => |
| 2268 | Effect.gen(function* () { |
| 2269 | const now = new Date(); |
| 2270 | const set: Record<string, unknown> = { updated_at: now }; |
| 2271 | if (patch.name !== undefined) set.name = patch.name; |
| 2272 | if (patch.description !== undefined) set.description = patch.description; |
| 2273 | if (patch.config !== undefined) { |
| 2274 | set.config = patch.config; |
| 2275 | // A config change can change the derived tools. The writer can only |
| 2276 | // rebuild catalogs in its own partition (owner policy), so revise |
| 2277 | // the integration: other subjects' connections compare this stamp |
| 2278 | // against their `tools_synced_at` and lazily rebuild on next read. |
| 2279 | set.config_revised_at = now.getTime(); |
| 2280 | } |
| 2281 | yield* core.updateMany("integration", { |
| 2282 | where: (b: AnyCb) => b("slug", "=", String(slug)), |
| 2283 | set, |
| 2284 | }); |
| 2285 | }); |
| 2286 | |
| 2287 | const integrationsUpdatePublic = ( |
| 2288 | slug: IntegrationSlug, |
no outgoing calls
no test coverage detected