feat(events,proposals,ui): identify triggers by immutable UUID (#2126)

This commit is contained in:
sam committed 2026-11-24 05:36:52 +11:00
1 parent 67ce2901a5
commit efe7069bc1
24 files changed
+473 -299

No files matched your search

+102 -65
View File
@@ -1523,9 +1523,13 @@ components:
type: string
trigger:
type: string
trigger_id:
type: string
required:
- event_id
- outcome
- trigger_id
- trigger
type: object
EventsEventDetail:
additionalProperties: false
@@ -1864,6 +1868,50 @@ components:
- signing
- capture
type: object
EventsTriggerBody:
additionalProperties: false
properties:
disabled:
type: boolean
event_type:
description: The event type that fires it; fixed when every is set
type: string
event_type_id:
description: Fire only for events identified as this event type of the source
format: uuid
type: string
every:
description: Fire on an interval instead of on events, such as 1h
examples:
- 1h
type: string
filter:
additionalProperties:
type: string
description: Event fields that must match exactly
type: object
mapping_id:
description: A mapping of the event type that reads the payload into the run's input under mapped
format: uuid
type: string
name:
description: Lowercase letters, digits and hyphens, unique among the triggers
type: string
pending:
description: Save the trigger waiting for approval; it fires once a person approves it
type: boolean
source_id:
description: The source whose events fire it; none when every is set
format: uuid
type: string
workflow_id:
description: The workflow each match runs
format: uuid
type: string
required:
- name
- workflow_id
type: object
EventsTriggerRun:
additionalProperties: false
properties:
@@ -1879,17 +1927,12 @@ components:
type: string
trigger:
type: string
required:
- trigger
- outcome
type: object
EventsTriggerSaved:
additionalProperties: false
properties:
trigger:
trigger_id:
type: string
required:
- trigger_id
- trigger
- outcome
type: object
EventsTriggerView:
additionalProperties: false
@@ -1906,6 +1949,8 @@ components:
additionalProperties:
type: string
type: object
id:
type: string
mapping_id:
type: string
name:
@@ -1927,6 +1972,7 @@ components:
workflow_id:
type: string
required:
- id
- name
- event_type
- filter
@@ -3705,46 +3751,6 @@ components:
- array
- "null"
type: object
PutTriggerInputBody:
additionalProperties: false
properties:
disabled:
type: boolean
event_type:
description: The event type that fires it; fixed when every is set
type: string
event_type_id:
description: Fire only for events identified as this event type of the source
format: uuid
type: string
every:
description: Fire on an interval instead of on events, such as 1h
examples:
- 1h
type: string
filter:
additionalProperties:
type: string
description: Event fields that must match exactly
type: object
mapping_id:
description: A mapping of the event type that reads the payload into the run's input under mapped
format: uuid
type: string
pending:
description: Save the trigger waiting for approval; it fires once a person approves it
type: boolean
source_id:
description: The source whose events fire it; none when every is set
format: uuid
type: string
workflow_id:
description: The workflow each match runs
format: uuid
type: string
required:
- workflow_id
type: object
PutWorkflowInputBody:
additionalProperties: false
properties:
@@ -4029,6 +4035,8 @@ components:
type: string
trigger:
type: string
trigger_id:
type: string
type:
type: string
required:
@@ -4038,6 +4046,7 @@ components:
- type
- fields
- received_at
- trigger_id
- trigger
- filter
type: object
@@ -9424,14 +9433,39 @@ paths:
summary: List triggers
tags:
- Events
/api/triggers/{name}:
post:
operationId: create-trigger
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EventsTriggerBody"
required: true
responses:
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/EventsTriggerView"
description: Created
default:
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ErrorModel"
description: Error
summary: Add a trigger
tags:
- Events
/api/triggers/{id}:
delete:
operationId: delete-trigger
parameters:
- in: path
name: name
name: id
required: true
schema:
format: uuid
type: string
responses:
"204":
@@ -9448,25 +9482,24 @@ paths:
put:
operationId: put-trigger
parameters:
- description: Lowercase letters, digits and hyphens
in: path
name: name
- in: path
name: id
required: true
schema:
description: Lowercase letters, digits and hyphens
format: uuid
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/PutTriggerInputBody"
$ref: "#/components/schemas/EventsTriggerBody"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/EventsTriggerSaved"
$ref: "#/components/schemas/EventsTriggerView"
description: OK
default:
content:
@@ -9474,17 +9507,18 @@ paths:
schema:
$ref: "#/components/schemas/ErrorModel"
description: Error
summary: Add or change a trigger
summary: Change a trigger, including its name; its dispatches refer to it by id and are unchanged
tags:
- Events
/api/triggers/{name}/approve:
/api/triggers/{id}/approve:
post:
operationId: approve-trigger
parameters:
- in: path
name: name
name: id
required: true
schema:
format: uuid
type: string
responses:
"200":
@@ -9502,14 +9536,15 @@ paths:
summary: Arm a trigger that waits for approval
tags:
- Events
/api/triggers/{name}/dispatches:
/api/triggers/{id}/dispatches:
get:
operationId: list-trigger-dispatches
parameters:
- in: path
name: name
name: id
required: true
schema:
format: uuid
type: string
- explode: false
in: query
@@ -9540,14 +9575,15 @@ paths:
summary: List the dispatches of a trigger
tags:
- Events
/api/triggers/{name}/pause:
/api/triggers/{id}/pause:
post:
operationId: pause-trigger
parameters:
- in: path
name: name
name: id
required: true
schema:
format: uuid
type: string
responses:
"200":
@@ -9565,14 +9601,15 @@ paths:
summary: Stop a trigger firing
tags:
- Events
/api/triggers/{name}/resume:
/api/triggers/{id}/resume:
post:
operationId: resume-trigger
parameters:
- in: path
name: name
name: id
required: true
schema:
format: uuid
type: string
responses:
"200":