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

Function requirePolicy

packages/plugins/toolkits/src/server.ts:329–338  ·  view source on GitHub ↗
(toolkitId: string, policyId: string, owner: Owner)

Source from the content-addressed store, hash-verified

327 .pipe(Effect.map((entries) => entries.map((entry) => entry.data).sort(comparePositioned)));
328
329 const requirePolicy = (toolkitId: string, policyId: string, owner: Owner) =>
330 storage.policies
331 .getForOwner({ owner, key: policyId })
332 .pipe(
333 Effect.flatMap((entry) =>
334 entry && entry.data.toolkitId === toolkitId
335 ? Effect.succeed(entry)
336 : fail("Toolkit policy not found."),
337 ),
338 );
339
340 const requireConnection = (toolkitId: string, connectionId: string, owner: Owner) =>
341 storage.connections

Callers 2

updatePolicyFunction · 0.85
removePolicyFunction · 0.85

Calls 1

failFunction · 0.70

Tested by

no test coverage detected