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

Function update

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

Source from the content-addressed store, hash-verified

323 });
324
325 const update = (toolkitId: string, input: { readonly name?: string; readonly slug?: string }) =>
326 Effect.gen(function* () {
327 const existing = yield* requireToolkit(toolkitId);
328 const name = input.name === undefined ? existing.data.name : input.name.trim();
329 if (!name) return yield* fail("Toolkit name is required.");
330 const slug =
331 input.slug === undefined
332 ? existing.data.slug
333 : yield* normalizeSlugEffect({ name, slug: input.slug });
334 yield* assertSlugAvailable(slug, toolkitId);
335 const entry = yield* storage.toolkits.put({
336 owner: existing.owner,
337 key: toolkitId,
338 data: { ...existing.data, name, slug, updatedAt: Date.now() },
339 });
340 return toolkitToResponse(entry);
341 });
342
343 const remove = (toolkitId: string) =>
344 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