(
slug: IntegrationSlug,
patch: {
readonly name?: string;
readonly description?: string;
readonly config?: IntegrationConfig;
},
)
| 1881 | ); |
| 1882 | |
| 1883 | const integrationsUpdate = ( |
| 1884 | slug: IntegrationSlug, |
| 1885 | patch: { |
| 1886 | readonly name?: string; |
| 1887 | readonly description?: string; |
| 1888 | readonly config?: IntegrationConfig; |
| 1889 | }, |
| 1890 | ): Effect.Effect<void, StorageFailure> => |
| 1891 | Effect.gen(function* () { |
| 1892 | const now = new Date(); |
| 1893 | const set: Record<string, unknown> = { updated_at: now }; |
| 1894 | if (patch.name !== undefined) set.name = patch.name; |
| 1895 | if (patch.description !== undefined) set.description = patch.description; |
| 1896 | if (patch.config !== undefined) { |
| 1897 | set.config = patch.config; |
| 1898 | // A config change can change the derived tools. The writer can only |
| 1899 | // rebuild catalogs in its own partition (owner policy), so revise |
| 1900 | // the integration: other subjects' connections compare this stamp |
| 1901 | // against their `tools_synced_at` and lazily rebuild on next read. |
| 1902 | set.config_revised_at = now.getTime(); |
| 1903 | } |
| 1904 | yield* core.updateMany("integration", { |
| 1905 | where: (b: AnyCb) => b("slug", "=", String(slug)), |
| 1906 | set, |
| 1907 | }); |
| 1908 | }); |
| 1909 | |
| 1910 | const integrationsUpdatePublic = ( |
| 1911 | slug: IntegrationSlug, |
no outgoing calls
no test coverage detected