(
slug: IntegrationSlug,
patch: {
readonly name?: string;
readonly description?: string;
readonly config?: IntegrationConfig;
},
)
| 1908 | ); |
| 1909 | |
| 1910 | const integrationsUpdate = ( |
| 1911 | slug: IntegrationSlug, |
| 1912 | patch: { |
| 1913 | readonly name?: string; |
| 1914 | readonly description?: string; |
| 1915 | readonly config?: IntegrationConfig; |
| 1916 | }, |
| 1917 | ): Effect.Effect<void, StorageFailure> => |
| 1918 | Effect.gen(function* () { |
| 1919 | const now = new Date(); |
| 1920 | const set: Record<string, unknown> = { updated_at: now }; |
| 1921 | if (patch.name !== undefined) set.name = patch.name; |
| 1922 | if (patch.description !== undefined) set.description = patch.description; |
| 1923 | if (patch.config !== undefined) { |
| 1924 | set.config = patch.config; |
| 1925 | // A config change can change the derived tools. The writer can only |
| 1926 | // rebuild catalogs in its own partition (owner policy), so revise |
| 1927 | // the integration: other subjects' connections compare this stamp |
| 1928 | // against their `tools_synced_at` and lazily rebuild on next read. |
| 1929 | set.config_revised_at = now.getTime(); |
| 1930 | } |
| 1931 | yield* core.updateMany("integration", { |
| 1932 | where: (b: AnyCb) => b("slug", "=", String(slug)), |
| 1933 | set, |
| 1934 | }); |
| 1935 | }); |
| 1936 | |
| 1937 | const integrationsUpdatePublic = ( |
| 1938 | slug: IntegrationSlug, |
no outgoing calls
no test coverage detected