fix(scheduler): return TriggerDataItem

This commit is contained in:
Ali BARIN
2022-10-15 20:26:25 +02:00
parent 0849801ae9
commit 6f0a763589
4 changed files with 44 additions and 48 deletions

View File

@@ -154,23 +154,22 @@ export default {
return cronTimes.everyDayExcludingWeekendsAt(parameters.hour as number);
},
async run($: IGlobalVariable, startDateTime: Date) {
const dateTime = DateTime.fromJSDate(startDateTime);
const dateTimeObjectRepresentation = getDateTimeObjectRepresentation(
dateTime
) as IJSONValue;
return { data: [dateTimeObjectRepresentation] };
},
async testRun($: IGlobalVariable) {
async run($: IGlobalVariable) {
const nextCronDateTime = getNextCronDateTime(
this.getInterval($.step.parameters)
);
const dateTime = DateTime.now();
const dateTimeObjectRepresentation = getDateTimeObjectRepresentation(
nextCronDateTime
$.execution.testRun ? nextCronDateTime : dateTime
) as IJSONValue;
return { data: [dateTimeObjectRepresentation] };
const dataItem = {
raw: dateTimeObjectRepresentation,
meta: {
internalId: dateTime.toMillis().toString(),
},
};
return { data: [dataItem] };
},
};

View File

@@ -48,23 +48,22 @@ export default {
return cronTimes.everyHourExcludingWeekends;
},
async run($: IGlobalVariable, startDateTime: Date) {
const dateTime = DateTime.fromJSDate(startDateTime);
const dateTimeObjectRepresentation = getDateTimeObjectRepresentation(
dateTime
) as IJSONValue;
return { data: [dateTimeObjectRepresentation] };
},
async testRun($: IGlobalVariable) {
async run($: IGlobalVariable) {
const nextCronDateTime = getNextCronDateTime(
this.getInterval($.step.parameters)
);
const dateTime = DateTime.now();
const dateTimeObjectRepresentation = getDateTimeObjectRepresentation(
nextCronDateTime
$.execution.testRun ? nextCronDateTime : dateTime
) as IJSONValue;
return { data: [dateTimeObjectRepresentation] };
const dataItem = {
raw: dateTimeObjectRepresentation,
meta: {
internalId: dateTime.toMillis().toString(),
},
};
return { data: [dataItem] };
},
};

View File

@@ -270,23 +270,22 @@ export default {
return interval;
},
async run($: IGlobalVariable, startDateTime: Date) {
const dateTime = DateTime.fromJSDate(startDateTime);
const dateTimeObjectRepresentation = getDateTimeObjectRepresentation(
dateTime
) as IJSONValue;
return { data: [dateTimeObjectRepresentation] };
},
async testRun($: IGlobalVariable) {
async run($: IGlobalVariable) {
const nextCronDateTime = getNextCronDateTime(
this.getInterval($.step.parameters)
);
const dateTime = DateTime.now();
const dateTimeObjectRepresentation = getDateTimeObjectRepresentation(
nextCronDateTime
$.execution.testRun ? nextCronDateTime : dateTime
) as IJSONValue;
return { data: [dateTimeObjectRepresentation] };
const dataItem = {
raw: dateTimeObjectRepresentation,
meta: {
internalId: dateTime.toMillis().toString(),
},
};
return { data: [dataItem] };
},
};

View File

@@ -174,23 +174,22 @@ export default {
return interval;
},
async run($: IGlobalVariable, startDateTime: Date) {
const dateTime = DateTime.fromJSDate(startDateTime);
const dateTimeObjectRepresentation = getDateTimeObjectRepresentation(
dateTime
) as IJSONValue;
return { data: [dateTimeObjectRepresentation] };
},
async testRun($: IGlobalVariable) {
async run($: IGlobalVariable) {
const nextCronDateTime = getNextCronDateTime(
this.getInterval($.step.parameters)
);
const dateTime = DateTime.now();
const dateTimeObjectRepresentation = getDateTimeObjectRepresentation(
nextCronDateTime
$.execution.testRun ? nextCronDateTime : dateTime
) as IJSONValue;
return { data: [dateTimeObjectRepresentation] };
const dataItem = {
raw: dateTimeObjectRepresentation,
meta: {
internalId: dateTime.toMillis().toString(),
},
};
return { data: [dataItem] };
},
};