(
slug: IntegrationSlug,
patch: {
readonly name?: string;
readonly description?: string;
readonly config?: IntegrationConfig;
},
)
| 2919 | ); |
| 2920 | |
| 2921 | const integrationsUpdate = ( |
| 2922 | slug: IntegrationSlug, |
| 2923 | patch: { |
| 2924 | readonly name?: string; |
| 2925 | readonly description?: string; |
| 2926 | readonly config?: IntegrationConfig; |
| 2927 | }, |
| 2928 | ): Effect.Effect<void, StorageFailure> => |
| 2929 | Effect.gen(function* () { |
| 2930 | const now = new Date(); |
| 2931 | const set: Record<string, unknown> = { updated_at: now }; |
| 2932 | if (patch.name !== undefined) set.name = patch.name; |
| 2933 | if (patch.description !== undefined) set.description = patch.description; |
| 2934 | if (patch.config !== undefined) { |
| 2935 | set.config = patch.config; |
| 2936 | // A config change can change the derived tools. The writer can only |
| 2937 | // rebuild catalogs in its own partition (owner policy), so revise |
| 2938 | // the integration: other subjects' connections compare this stamp |
| 2939 | // against their `tools_synced_at` and lazily rebuild on next read. |
| 2940 | set.config_revised_at = now.getTime(); |
| 2941 | } |
| 2942 | yield* core.updateMany("integration", { |
| 2943 | where: (b: AnyCb) => b("slug", "=", String(slug)), |
| 2944 | set, |
| 2945 | }); |
| 2946 | }); |
| 2947 | |
| 2948 | const integrationsUpdatePublic = ( |
| 2949 | slug: IntegrationSlug, |
no outgoing calls
no test coverage detected