(
slug: IntegrationSlug,
patch: {
readonly name?: string;
readonly description?: string;
readonly config?: IntegrationConfig;
},
)
| 2721 | ); |
| 2722 | |
| 2723 | const integrationsUpdate = ( |
| 2724 | slug: IntegrationSlug, |
| 2725 | patch: { |
| 2726 | readonly name?: string; |
| 2727 | readonly description?: string; |
| 2728 | readonly config?: IntegrationConfig; |
| 2729 | }, |
| 2730 | ): Effect.Effect<void, StorageFailure> => |
| 2731 | Effect.gen(function* () { |
| 2732 | const now = new Date(); |
| 2733 | const set: Record<string, unknown> = { updated_at: now }; |
| 2734 | if (patch.name !== undefined) set.name = patch.name; |
| 2735 | if (patch.description !== undefined) set.description = patch.description; |
| 2736 | if (patch.config !== undefined) { |
| 2737 | set.config = patch.config; |
| 2738 | // A config change can change the derived tools. The writer can only |
| 2739 | // rebuild catalogs in its own partition (owner policy), so revise |
| 2740 | // the integration: other subjects' connections compare this stamp |
| 2741 | // against their `tools_synced_at` and lazily rebuild on next read. |
| 2742 | set.config_revised_at = now.getTime(); |
| 2743 | } |
| 2744 | yield* core.updateMany("integration", { |
| 2745 | where: (b: AnyCb) => b("slug", "=", String(slug)), |
| 2746 | set, |
| 2747 | }); |
| 2748 | }); |
| 2749 | |
| 2750 | const integrationsUpdatePublic = ( |
| 2751 | slug: IntegrationSlug, |
no outgoing calls
no test coverage detected