MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / integrationsUpdate

Function integrationsUpdate

packages/core/sdk/src/executor.ts:1883–1908  ·  view source on GitHub ↗
(
      slug: IntegrationSlug,
      patch: {
        readonly name?: string;
        readonly description?: string;
        readonly config?: IntegrationConfig;
      },
    )

Source from the content-addressed store, hash-verified

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,

Callers 2

integrationsUpdatePublicFunction · 0.85
createExecutorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected