This plugin is part of the Kuzzle Enterprise Plan. If you are interested, please contact us.
Action #
import { JSONObject, RequestPayload } from "kuzzle";
export type ActionApi = {
/**
* Action type
*/
type: "api";
/**
* Request payload to execute
*/
request: RequestPayload;
};
export type ActionTask = {
/**
* Action type
*/
type: "task";
/**
* Task name to execute
*/
name?: string;
/**
* Task custom arguments
*/
args?: JSONObject;
};
export type ActionRule = {
/**
* Action type
*/
type: "rule";
/**
* Rule ID to execute
*
*/
name: string;
/**
* Additional arguments to pass to the rule
*/
args?: JSONObject;
};
export type ActionRuleGroup = {
/**
* Action type
*/
type: "rule-group";
/**
* Group of rules to execute
*/
name: string;
};
export type ActionPredicate = {
/**
* Action type
*/
type: "predicate";
/**
* Predicate name to verify
*
*/
name: string;
/**
* Predicate custom arguments
*/
args?: JSONObject;
};
export type SwitchBranch = {
/** Optional display name used in logs and error messages */
name?: string;
/** Koncorde filter — always required */
filter: JSONObject;
/** Actions to execute when this branch matches (may be empty) */
actions: Action[];
};
export type ActionSwitch = {
type: "switch";
/** Optional display name for logging, error context, and depth-exceeded messages */
name?: string;
/** Optional human-readable description */
description?: string;
/**
* Ordered branches evaluated first-match-wins.
* If absent or empty, the block is skipped.
*/
branches?: SwitchBranch[];
/**
* Executed when no filtered branch matches.
* If absent, the block is skipped on no-match.
*/
defaultBranch?: { actions: Action[] };
};
export type Action =
| ActionApi
| ActionPredicate
| ActionTask
| ActionRule
| ActionRuleGroup
| ActionSwitch;