fix: provide step.parameters to Scheduler triggers
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { DateTime } from 'luxon';
|
||||
import type { IJSONObject, IJSONValue, ITrigger } from '@automatisch/types';
|
||||
import type { IStep, IJSONValue, ITrigger } from '@automatisch/types';
|
||||
import { cronTimes, getNextCronDateTime, getDateTimeObjectRepresentation } from '../utils';
|
||||
|
||||
export default class EveryDay implements ITrigger {
|
||||
triggersOnWeekend?: boolean;
|
||||
hour?: number;
|
||||
|
||||
constructor(parameters: IJSONObject) {
|
||||
constructor(parameters: IStep["parameters"]) {
|
||||
if (parameters.triggersOnWeekend) {
|
||||
this.triggersOnWeekend = parameters.triggersOnWeekend as boolean;
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import { DateTime } from 'luxon';
|
||||
import type { IJSONObject, IJSONValue, ITrigger } from '@automatisch/types';
|
||||
import type { IStep, IJSONValue, ITrigger } from '@automatisch/types';
|
||||
import { cronTimes, getNextCronDateTime, getDateTimeObjectRepresentation } from '../utils';
|
||||
|
||||
export default class EveryHour implements ITrigger {
|
||||
triggersOnWeekend?: boolean | string;
|
||||
|
||||
constructor(parameters: IJSONObject) {
|
||||
constructor(parameters: IStep["parameters"]) {
|
||||
if (parameters.triggersOnWeekend) {
|
||||
this.triggersOnWeekend = parameters.triggersOnWeekend as string;
|
||||
}
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { DateTime } from 'luxon';
|
||||
import type { IJSONObject, IJSONValue, ITrigger } from '@automatisch/types';
|
||||
import type { IStep, IJSONValue, ITrigger } from '@automatisch/types';
|
||||
import { cronTimes, getNextCronDateTime, getDateTimeObjectRepresentation } from '../utils';
|
||||
|
||||
export default class EveryMonth implements ITrigger {
|
||||
day?: number;
|
||||
hour?: number;
|
||||
|
||||
constructor(parameters: IJSONObject) {
|
||||
constructor(parameters: IStep["parameters"]) {
|
||||
if (parameters.day) {
|
||||
this.day = parameters.day as number;
|
||||
}
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { DateTime } from 'luxon';
|
||||
import type { IJSONObject, IJSONValue, ITrigger } from '@automatisch/types';
|
||||
import type { IStep, IJSONValue, ITrigger } from '@automatisch/types';
|
||||
import { cronTimes, getNextCronDateTime, getDateTimeObjectRepresentation } from '../utils';
|
||||
|
||||
export default class EveryWeek implements ITrigger {
|
||||
weekday?: number;
|
||||
hour?: number;
|
||||
|
||||
constructor(parameters: IJSONObject) {
|
||||
constructor(parameters: IStep["parameters"]) {
|
||||
if (parameters.weekday) {
|
||||
this.weekday = parameters.weekday as number;
|
||||
}
|
||||
|
Reference in New Issue
Block a user