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

Function integrationsUpdate

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

Source from the content-addressed store, hash-verified

1924 );
1925
1926 const integrationsUpdate = (
1927 slug: IntegrationSlug,
1928 patch: {
1929 readonly name?: string;
1930 readonly description?: string;
1931 readonly config?: IntegrationConfig;
1932 },
1933 ): Effect.Effect<void, StorageFailure> =>
1934 Effect.gen(function* () {
1935 const now = new Date();
1936 const set: Record<string, unknown> = { updated_at: now };
1937 if (patch.name !== undefined) set.name = patch.name;
1938 if (patch.description !== undefined) set.description = patch.description;
1939 if (patch.config !== undefined) {
1940 set.config = patch.config;
1941 // A config change can change the derived tools. The writer can only
1942 // rebuild catalogs in its own partition (owner policy), so revise
1943 // the integration: other subjects' connections compare this stamp
1944 // against their `tools_synced_at` and lazily rebuild on next read.
1945 set.config_revised_at = now.getTime();
1946 }
1947 yield* core.updateMany("integration", {
1948 where: (b: AnyCb) => b("slug", "=", String(slug)),
1949 set,
1950 });
1951 });
1952
1953 const integrationsUpdatePublic = (
1954 slug: IntegrationSlug,

Callers 2

integrationsUpdatePublicFunction · 0.85
createExecutorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected