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

Function integrationsUpdate

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

Source from the content-addressed store, hash-verified

2258 );
2259
2260 const integrationsUpdate = (
2261 slug: IntegrationSlug,
2262 patch: {
2263 readonly name?: string;
2264 readonly description?: string;
2265 readonly config?: IntegrationConfig;
2266 },
2267 ): Effect.Effect<void, StorageFailure> =>
2268 Effect.gen(function* () {
2269 const now = new Date();
2270 const set: Record<string, unknown> = { updated_at: now };
2271 if (patch.name !== undefined) set.name = patch.name;
2272 if (patch.description !== undefined) set.description = patch.description;
2273 if (patch.config !== undefined) {
2274 set.config = patch.config;
2275 // A config change can change the derived tools. The writer can only
2276 // rebuild catalogs in its own partition (owner policy), so revise
2277 // the integration: other subjects' connections compare this stamp
2278 // against their `tools_synced_at` and lazily rebuild on next read.
2279 set.config_revised_at = now.getTime();
2280 }
2281 yield* core.updateMany("integration", {
2282 where: (b: AnyCb) => b("slug", "=", String(slug)),
2283 set,
2284 });
2285 });
2286
2287 const integrationsUpdatePublic = (
2288 slug: IntegrationSlug,

Callers 2

integrationsUpdatePublicFunction · 0.85
createExecutorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected