mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-14 00:15:09 -05:00
fix(auth): swap out hybrid auth in relevant callsites (#3160)
* fix(logs): execution files should always use our internal route * correct degree of access control * fix tests * fix tag defs flag * fix type check * fix mcp tools * make webhooks consistent * fix ollama and vllm visibility * remove dup test
This commit is contained in:
committed by
GitHub
parent
0ca25bbab6
commit
193b95cfec
@@ -156,6 +156,15 @@ describe('evaluateSubBlockCondition', () => {
|
||||
expect(evaluateSubBlockCondition(condition, values)).toBe(true)
|
||||
})
|
||||
|
||||
it.concurrent('passes current values into function conditions', () => {
|
||||
const condition = (values?: Record<string, unknown>) => ({
|
||||
field: 'model',
|
||||
value: typeof values?.model === 'string' ? values.model : '__no_model_selected__',
|
||||
})
|
||||
const values = { model: 'ollama/gemma3:4b' }
|
||||
expect(evaluateSubBlockCondition(condition, values)).toBe(true)
|
||||
})
|
||||
|
||||
it.concurrent('handles boolean values', () => {
|
||||
const condition = { field: 'enabled', value: true }
|
||||
const values = { enabled: true }
|
||||
|
||||
@@ -100,11 +100,14 @@ export function resolveCanonicalMode(
|
||||
* Evaluate a subblock condition against a map of raw values.
|
||||
*/
|
||||
export function evaluateSubBlockCondition(
|
||||
condition: SubBlockCondition | (() => SubBlockCondition) | undefined,
|
||||
condition:
|
||||
| SubBlockCondition
|
||||
| ((values?: Record<string, unknown>) => SubBlockCondition)
|
||||
| undefined,
|
||||
values: Record<string, unknown>
|
||||
): boolean {
|
||||
if (!condition) return true
|
||||
const actual = typeof condition === 'function' ? condition() : condition
|
||||
const actual = typeof condition === 'function' ? condition(values) : condition
|
||||
const fieldValue = values[actual.field]
|
||||
const valueMatch = Array.isArray(actual.value)
|
||||
? fieldValue != null &&
|
||||
|
||||
Reference in New Issue
Block a user