9
9
destinationID :
10
10
$ref : ' ./common.yml#/destinationID'
11
11
trigger :
12
- $ref : ' #/TaskTrigger '
12
+ $ref : ' #/Trigger '
13
13
enabled :
14
14
type : boolean
15
15
default : true
@@ -31,10 +31,11 @@ Task:
31
31
- action
32
32
- createdAt
33
33
34
- TaskTrigger :
34
+ Trigger :
35
35
oneOf :
36
- - $ref : ' #/Trigger '
36
+ - $ref : ' #/OnDemandTrigger '
37
37
- $ref : ' #/ScheduleTrigger'
38
+ - $ref : ' #/SubscriptionTrigger'
38
39
39
40
TaskCreate :
40
41
type : object
@@ -131,60 +132,105 @@ TriggerInput:
131
132
required :
132
133
- type
133
134
135
+ TriggerType :
136
+ type : string
137
+ description : >
138
+ The type of the task reflect how it can be used:
139
+ - on_demand: a task that runs manually
140
+ - schedule: a task that runs regularly, following a given cron expression
141
+ - subscription: a task that runs after a subscription event is received from an integration (e.g. Webhook).
142
+ enum : ['on_demand', 'schedule', 'subscription']
143
+
144
+ # schedule trigger
145
+
146
+ LastRun :
147
+ description : The last time the scheduled task ran.
148
+ type : string
149
+
150
+ Cron :
151
+ type : string
152
+ description : A cron expression that represent at which regularity the task should run.
153
+ example : ' * * 1 * *'
154
+
155
+ ScheduleTriggerType :
156
+ type : string
157
+ description : A task which is triggered by a schedule (cron expression).
158
+ enum : ['schedule']
159
+
134
160
ScheduleTriggerInput :
135
161
type : object
136
162
additionalProperties : false
137
163
description : The trigger input for a task of type 'schedule'.
138
164
properties :
139
165
type :
140
- $ref : ' #/TriggerType '
166
+ $ref : ' #/ScheduleTriggerType '
141
167
cron :
142
168
$ref : ' #/Cron'
143
169
required :
144
170
- type
145
171
- cron
146
172
147
- Trigger :
148
- type : object
149
- additionalProperties : false
150
- description : The trigger information of a task.
151
- properties :
152
- type :
153
- $ref : ' #/TriggerType'
154
- required :
155
- - type
156
-
157
173
ScheduleTrigger :
158
174
type : object
159
175
additionalProperties : false
160
176
description : The trigger information for a task of type 'schedule'.
161
177
properties :
162
178
type :
163
- $ref : ' #/TriggerType '
179
+ $ref : ' #/ScheduleTriggerType '
164
180
cron :
165
181
$ref : ' #/Cron'
166
182
lastRun :
167
- description : The last time the scheduled task ran.
168
- type : string
183
+ $ref : ' #/LastRun'
169
184
nextRun :
170
185
description : The next scheduled run of the task.
171
186
type : string
172
187
required :
173
188
- type
174
189
- cron
175
- - lastRun
176
190
- nextRun
177
191
178
- TriggerType :
192
+ # on demand trigger
193
+
194
+ OnDemandTriggerType :
179
195
type : string
180
- description : >
181
- The type of the task reflect how it can be used:
182
- - on_demand: a task that runs manually
183
- - schedule: a task that runs regularly, following a given cron expression
184
- - subscription: a task that runs after a subscription event is received from an integration (e.g. Webhook).
185
- enum : ['on_demand', 'schedule', 'subscription']
196
+ description : A task which is manually executed via the run task endpoint.
197
+ enum : ['on_demand']
186
198
187
- Cron :
199
+ OnDemandTriggerInput :
200
+ type : object
201
+ additionalProperties : false
202
+ description : The trigger information of a task of type `on-demand`.
203
+ properties :
204
+ type :
205
+ $ref : ' #/OnDemandTriggerType'
206
+ required :
207
+ - type
208
+
209
+ OnDemandTrigger :
210
+ type : object
211
+ additionalProperties : false
212
+ description : The trigger information of a task of type `on-demand`.
213
+ properties :
214
+ type :
215
+ $ref : ' #/OnDemandTriggerType'
216
+ lastRun :
217
+ $ref : ' #/LastRun'
218
+ required :
219
+ - type
220
+
221
+ # subscription trigger
222
+
223
+ SubscriptionTriggerType :
188
224
type : string
189
- description : A cron expression that represent at which regularity the task should run.
190
- example : ' * * 1 * *'
225
+ description : A task which is triggered by an external subscription (e.g. Webhook).
226
+ enum : ['subscription']
227
+
228
+ SubscriptionTrigger :
229
+ type : object
230
+ additionalProperties : false
231
+ description : The trigger input for a task of type 'subscription'.
232
+ properties :
233
+ type :
234
+ $ref : ' #/TriggerType'
235
+ required :
236
+ - type
0 commit comments