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

Function assertSlugAvailable

packages/plugins/toolkits/src/server.ts:265–271  ·  view source on GitHub ↗
(slug: string, ignoreToolkitId?: string)

Source from the content-addressed store, hash-verified

263 );
264
265 const assertSlugAvailable = (slug: string, ignoreToolkitId?: string) =>
266 storage.toolkits.query({ where: { slug } }).pipe(
267 Effect.flatMap((entries) => {
268 const collision = entries.find((entry) => entry.data.id !== ignoreToolkitId);
269 return collision ? fail(`Toolkit slug "${slug}" is already in use.`) : Effect.void;
270 }),
271 );
272
273 const listPoliciesForRecord = (toolkitId: string) =>
274 storage.policies

Callers 2

createFunction · 0.85
updateFunction · 0.85

Calls 1

failFunction · 0.70

Tested by

no test coverage detected