(pattern: string, action: ToolPolicyAction)
| 1301 | const connectionRows = AsyncResult.isSuccess(connections) ? connections.value.connections : []; |
| 1302 | |
| 1303 | const setPolicyHandler = async (pattern: string, action: ToolPolicyAction) => { |
| 1304 | const existing = policyRows.find((policy) => policy.pattern === pattern); |
| 1305 | if (existing) { |
| 1306 | await doUpdatePolicy({ |
| 1307 | params: { toolkitId: props.toolkit.id, policyId: existing.id }, |
| 1308 | payload: { action }, |
| 1309 | reactivityKeys: toolkitWriteKeys, |
| 1310 | }); |
| 1311 | return; |
| 1312 | } |
| 1313 | await doCreatePolicy({ |
| 1314 | params: { toolkitId: props.toolkit.id }, |
| 1315 | payload: { pattern, action }, |
| 1316 | reactivityKeys: toolkitWriteKeys, |
| 1317 | }); |
| 1318 | }; |
| 1319 | |
| 1320 | const addConnectionHandler = async (pattern: string) => { |
| 1321 | await doCreateConnection({ |
nothing calls this directly
no outgoing calls
no test coverage detected