Skip to main content

resolveDryRun

@webda/core


Function: resolveDryRun()

resolveDryRun(context, operationId): boolean

Defined in: packages/core/src/core/operations.ts:956

Decide whether an operation call should run in dry-run mode.

Resolution order:

  1. Already dry: if context.getExtension("dryRun") === true, nested operations stay dry.
  2. Enforce: if operation matches parameters.dryRun.enforce, always dry (wins over exclude).
  3. Exclude: if operation matches parameters.dryRun.exclude, turns off sources 4 & 5 (never overrides enforce).
  4. Global switch: parameters.dryRun.enabled === true.
  5. Per-call request:
    • context.getExtension("requestedDryRun") === true
    • REST header X-Webda-Dry-Run: true when parameters.dryRun.allowRequest === true

Parameters​

context​

OperationContext

execution context

operationId​

string

operation id

Returns​

boolean

true if the call should run in dry mode