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

Function update

packages/plugins/toolkits/src/server.ts:371–387  ·  view source on GitHub ↗
(toolkitId: string, input: { readonly name?: string; readonly slug?: string })

Source from the content-addressed store, hash-verified

369 });
370
371 const update = (toolkitId: string, input: { readonly name?: string; readonly slug?: string }) =>
372 Effect.gen(function* () {
373 const existing = yield* requireToolkit(toolkitId);
374 const name = input.name === undefined ? existing.data.name : input.name.trim();
375 if (!name) return yield* fail("Toolkit name is required.");
376 const slug =
377 input.slug === undefined
378 ? existing.data.slug
379 : yield* normalizeSlugEffect({ name, slug: input.slug });
380 yield* assertSlugAvailable(slug, toolkitId);
381 const entry = yield* storage.toolkits.put({
382 owner: existing.owner,
383 key: toolkitId,
384 data: { ...existing.data, name, slug, updatedAt: Date.now() },
385 });
386 return toolkitToResponse(entry);
387 });
388
389 const remove = (toolkitId: string) =>
390 Effect.gen(function* () {

Callers

nothing calls this directly

Calls 6

requireToolkitFunction · 0.85
normalizeSlugEffectFunction · 0.85
assertSlugAvailableFunction · 0.85
toolkitToResponseFunction · 0.85
failFunction · 0.70
putMethod · 0.65

Tested by

no test coverage detected