Skip to content

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 14 Jun 00:03

Added

  • Conditional scenarios (scenarios:): custom routes can now declare multiple response variants evaluated in declaration order — the first matching when: block wins
  • when: as object → AND semantics: all entries must match (dot-notation keys: body.X, params.X, query.X, headers.X)
  • when: as array of objects → OR of ANDs: any group satisfying all its conditions triggers the scenario
  • otherwise: fallback: explicit response when scenarios: are defined but none matched — takes priority over response:
  • Field operator suffixes in conditions: _ne, _like, _start, _regex, _gte, _lte work on scenario condition keys, reusing the same operators as the query layer
  • Template variables in scenarios/otherwise: {{}} interpolation supported in scenario and otherwise response bodies
  • Per-route delay:: fixed delay (ms) applied to a specific _routes entry before any response is sent, regardless of which path resolved it (handler / scenario / otherwise / response)
  • /_about route badges: custom routes section now shows scenario count (purple), (OR) indicator, otherwise label, delay·Xms badge (orange), and {{…}} template indicator
  • OPERATORS and applyOperator exported from query.service.ts for reuse by the condition engine
  • New src/utils/conditions.ts module: findMatchingScenario with dot-notation path resolver