(
slug: string,
toolId: string,
defaultRequiresApproval?: boolean,
)
| 542 | }); |
| 543 | |
| 544 | const resolvePolicyForSlug = ( |
| 545 | slug: string, |
| 546 | toolId: string, |
| 547 | defaultRequiresApproval?: boolean, |
| 548 | ): Effect.Effect<EffectivePolicy, StorageFailure> => |
| 549 | Effect.gen(function* () { |
| 550 | const toolkit = yield* getBySlugEntry(slug); |
| 551 | if (!toolkit) return blockedPolicy(); |
| 552 | if (toolkit.owner === "org" && isPersonalDynamicToolId(toolId)) return blockedPolicy(); |
| 553 | const policies = yield* listPoliciesForRecord(toolkit.data.id); |
| 554 | const connections = yield* listConnectionsForRecord(toolkit.data.id); |
| 555 | return resolveToolkitPolicy( |
| 556 | toolId, |
| 557 | digestToolkitRules(connections, policies), |
| 558 | defaultRequiresApproval, |
| 559 | ); |
| 560 | }); |
| 561 | |
| 562 | // Batched form of `resolvePolicyForSlug`: fetch the toolkit, its policies, and |
| 563 | // its connections ONCE, then hand back a pure resolver core can run for every |
nothing calls this directly
no test coverage detected