(
slug: IntegrationSlug,
patch: {
readonly name?: string;
readonly description?: string;
readonly config?: IntegrationConfig;
},
)
| 3089 | ); |
| 3090 | |
| 3091 | const integrationsUpdate = ( |
| 3092 | slug: IntegrationSlug, |
| 3093 | patch: { |
| 3094 | readonly name?: string; |
| 3095 | readonly description?: string; |
| 3096 | readonly config?: IntegrationConfig; |
| 3097 | }, |
| 3098 | ): Effect.Effect<void, StorageFailure> => |
| 3099 | Effect.gen(function* () { |
| 3100 | const now = new Date(); |
| 3101 | const set: Record<string, unknown> = { updated_at: now }; |
| 3102 | if (patch.name !== undefined) set.name = patch.name; |
| 3103 | if (patch.description !== undefined) set.description = patch.description; |
| 3104 | if (patch.config !== undefined) { |
| 3105 | set.config = patch.config; |
| 3106 | // A config change can change the derived tools. The writer can only |
| 3107 | // rebuild catalogs in its own partition (owner policy), so revise |
| 3108 | // the integration: other subjects' connections compare this stamp |
| 3109 | // against their `tools_synced_at` and lazily rebuild on next read. |
| 3110 | set.config_revised_at = now.getTime(); |
| 3111 | } |
| 3112 | yield* core.updateMany("integration", { |
| 3113 | where: (b: AnyCb) => b("slug", "=", String(slug)), |
| 3114 | set, |
| 3115 | }); |
| 3116 | }); |
| 3117 | |
| 3118 | const integrationsUpdatePublic = ( |
| 3119 | slug: IntegrationSlug, |
no outgoing calls
no test coverage detected