(
slug: IntegrationSlug,
patch: {
readonly name?: string;
readonly description?: string;
readonly config?: IntegrationConfig;
},
)
| 3321 | ); |
| 3322 | |
| 3323 | const integrationsUpdate = ( |
| 3324 | slug: IntegrationSlug, |
| 3325 | patch: { |
| 3326 | readonly name?: string; |
| 3327 | readonly description?: string; |
| 3328 | readonly config?: IntegrationConfig; |
| 3329 | }, |
| 3330 | ): Effect.Effect<void, OrgWriteDeniedError | StorageFailure> => |
| 3331 | transaction( |
| 3332 | Effect.gen(function* () { |
| 3333 | yield* guardOrgWrite(); |
| 3334 | const now = new Date(); |
| 3335 | const set: Record<string, unknown> = { updated_at: now }; |
| 3336 | if (patch.name !== undefined) set.name = patch.name; |
| 3337 | if (patch.description !== undefined) set.description = patch.description; |
| 3338 | if (patch.config !== undefined) { |
| 3339 | set.config = patch.config; |
| 3340 | // A config change can change the derived tools. The writer can only |
| 3341 | // rebuild catalogs in its own partition (owner policy), so revise |
| 3342 | // the integration: other subjects' connections compare this stamp |
| 3343 | // against their `tools_synced_at` and lazily rebuild on next read. |
| 3344 | set.config_revised_at = now.getTime(); |
| 3345 | } |
| 3346 | yield* core.updateMany("integration", { |
| 3347 | where: (b: AnyCb) => b("slug", "=", String(slug)), |
| 3348 | set, |
| 3349 | }); |
| 3350 | }), |
| 3351 | ); |
| 3352 | |
| 3353 | const integrationsUpdatePublic = ( |
| 3354 | slug: IntegrationSlug, |
no test coverage detected