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

Function requirePolicy

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

Source from the content-addressed store, hash-verified

282 .pipe(Effect.map((entries) => entries.map((entry) => entry.data).sort(comparePositioned)));
283
284 const requirePolicy = (toolkitId: string, policyId: string, owner: Owner) =>
285 storage.policies
286 .getForOwner({ owner, key: policyId })
287 .pipe(
288 Effect.flatMap((entry) =>
289 entry && entry.data.toolkitId === toolkitId
290 ? Effect.succeed(entry)
291 : fail("Toolkit policy not found."),
292 ),
293 );
294
295 const requireConnection = (toolkitId: string, connectionId: string, owner: Owner) =>
296 storage.connections

Callers 2

updatePolicyFunction · 0.85
removePolicyFunction · 0.85

Calls 1

failFunction · 0.70

Tested by

no test coverage detected