JSON Schema

Trigger definition schema

JSON Schema for trigger events, conditions, execution limits, and retries.

Source included with this website build. Run ansight workspace init . for files matching your installed CLI. Read the guide.

ansight/schema/trigger-definition.v1.schema.json 1,943 bytes
Raw file Download
SHA-256 4b15b596ac236e1eb2c9de2dad7da709496a24cb2dd5578b1c8ea7842b0acca7
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ansight.dev/schemas/repository-trigger.v1.schema.json",
  "title": "Ansight Repository Trigger Definition",
  "type": "object",
  "properties": {
    "schemaVersion": {
      "type": "integer",
      "const": 1,
      "default": 1
    },
    "enabled": {
      "type": "boolean",
      "description": "Whether this trigger may match events and execute.",
      "default": true
    },
    "appId": {
      "type": "string",
      "minLength": 1
    },
    "eventKind": {
      "type": "string",
      "minLength": 1
    },
    "eventSchema": {
      "type": "object",
      "description": "JSON Schema for invocation.event.payload."
    },
    "functionTimeoutMs": {
      "type": "integer",
      "minimum": 10,
      "maximum": 1000
    },
    "actionTimeoutSeconds": {
      "type": "integer",
      "minimum": 1,
      "maximum": 300
    },
    "retry": {
      "type": "object",
      "properties": {
        "maxAttempts": { "type": "integer", "minimum": 1, "maximum": 5 },
        "initialDelayMs": { "type": "integer", "minimum": 10, "maximum": 60000 },
        "backoffMultiplier": { "type": "number", "minimum": 1, "maximum": 10 },
        "maxDelayMs": { "type": "integer", "minimum": 10, "maximum": 60000 }
      },
      "additionalProperties": false
    },
    "conditions": {
      "type": "array",
      "maxItems": 16,
      "items": {
        "type": "object",
        "properties": {
          "field": { "type": "string", "minLength": 1 },
          "operator": {
            "enum": ["equals", "notEquals", "contains", "startsWith", "endsWith", "exists", "notExists"]
          },
          "value": {},
          "ignoreCase": { "type": "boolean", "default": false }
        },
        "required": ["field", "operator"],
        "additionalProperties": false
      }
    }
  },
  "required": ["eventKind"],
  "additionalProperties": false
}