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

Function requirePolicy

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

Source from the content-addressed store, hash-verified

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

Callers 2

updatePolicyFunction · 0.85
removePolicyFunction · 0.85

Calls 1

failFunction · 0.70

Tested by

no test coverage detected