File tree 4 files changed +13
-8
lines changed
apps/webapp/app/v3/services
packages/core/src/v3/schemas
4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @trigger.dev/core " : patch
3
+ ---
4
+
5
+ Make optional schedule object fields nullish
Original file line number Diff line number Diff line change @@ -58,8 +58,8 @@ export class TriggerScheduledTaskService extends BaseService {
58
58
const payload = {
59
59
scheduleId : instance . taskSchedule . friendlyId ,
60
60
timestamp : instance . nextScheduledTimestamp ,
61
- lastTimestamp : instance . lastScheduledTimestamp ,
62
- externalId : instance . taskSchedule . externalId ,
61
+ lastTimestamp : instance . lastScheduledTimestamp ?? undefined ,
62
+ externalId : instance . taskSchedule . externalId ?? undefined ,
63
63
upcoming : nextScheduledTimestamps (
64
64
instance . taskSchedule . generatorExpression ,
65
65
instance . nextScheduledTimestamp ! ,
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ export class UpsertTaskScheduleService extends BaseService {
111
111
options . deduplicationKey !== undefined && options . deduplicationKey !== "" ,
112
112
generatorExpression : options . cron ,
113
113
generatorDescription : cronstrue . toString ( options . cron ) ,
114
- externalId : options . externalId ,
114
+ externalId : options . externalId ? options . externalId : undefined ,
115
115
} ,
116
116
} ) ;
117
117
@@ -160,7 +160,7 @@ export class UpsertTaskScheduleService extends BaseService {
160
160
data : {
161
161
generatorExpression : options . cron ,
162
162
generatorDescription : cronstrue . toString ( options . cron ) ,
163
- externalId : options . externalId ,
163
+ externalId : options . externalId ? options . externalId : null ,
164
164
} ,
165
165
} ) ;
166
166
Original file line number Diff line number Diff line change @@ -240,19 +240,19 @@ export const ScheduleObject = z.object({
240
240
id : z . string ( ) ,
241
241
task : z . string ( ) ,
242
242
active : z . boolean ( ) ,
243
- deduplicationKey : z . string ( ) . optional ( ) ,
244
- externalId : z . string ( ) . optional ( ) ,
243
+ deduplicationKey : z . string ( ) . nullish ( ) ,
244
+ externalId : z . string ( ) . nullish ( ) ,
245
245
generator : z . object ( {
246
246
type : z . literal ( "CRON" ) ,
247
247
expression : z . string ( ) ,
248
248
description : z . string ( ) ,
249
249
} ) ,
250
- nextRun : z . coerce . date ( ) . optional ( ) ,
250
+ nextRun : z . coerce . date ( ) . nullish ( ) ,
251
251
environments : z . array (
252
252
z . object ( {
253
253
id : z . string ( ) ,
254
254
type : z . string ( ) ,
255
- userName : z . string ( ) . optional ( ) ,
255
+ userName : z . string ( ) . nullish ( ) ,
256
256
} )
257
257
) ,
258
258
} ) ;
You can’t perform that action at this time.
0 commit comments