(
slug: IntegrationSlug,
patch: {
readonly name?: string;
readonly description?: string;
readonly config?: IntegrationConfig;
},
)
| 1999 | ); |
| 2000 | |
| 2001 | const integrationsUpdate = ( |
| 2002 | slug: IntegrationSlug, |
| 2003 | patch: { |
| 2004 | readonly name?: string; |
| 2005 | readonly description?: string; |
| 2006 | readonly config?: IntegrationConfig; |
| 2007 | }, |
| 2008 | ): Effect.Effect<void, StorageFailure> => |
| 2009 | Effect.gen(function* () { |
| 2010 | const now = new Date(); |
| 2011 | const set: Record<string, unknown> = { updated_at: now }; |
| 2012 | if (patch.name !== undefined) set.name = patch.name; |
| 2013 | if (patch.description !== undefined) set.description = patch.description; |
| 2014 | if (patch.config !== undefined) { |
| 2015 | set.config = patch.config; |
| 2016 | // A config change can change the derived tools. The writer can only |
| 2017 | // rebuild catalogs in its own partition (owner policy), so revise |
| 2018 | // the integration: other subjects' connections compare this stamp |
| 2019 | // against their `tools_synced_at` and lazily rebuild on next read. |
| 2020 | set.config_revised_at = now.getTime(); |
| 2021 | } |
| 2022 | yield* core.updateMany("integration", { |
| 2023 | where: (b: AnyCb) => b("slug", "=", String(slug)), |
| 2024 | set, |
| 2025 | }); |
| 2026 | }); |
| 2027 | |
| 2028 | const integrationsUpdatePublic = ( |
| 2029 | slug: IntegrationSlug, |
no outgoing calls
no test coverage detected