Skip to content

0.7.2

Compare
Choose a tag to compare
@b4rtaz b4rtaz released this 19 Jul 20:39
· 33 commits to main since this release
770df05

We added a new type of a validator: step validator. It allows to restrict a placement of a step in a definition. For example, you can enforce that a step can be placed only inside a specific step.

createStepModel<WriteSocketStep>('writeSocket', 'task', step => {
  step.validator({
    validate(context: StepValidatorContext) {
      const parentTypes = context.getParentStepTypes();
      return parentTypes.includes('socket');
        ? null // No errors
        : 'The write socket step must be inside a socket.';
    }
  });
});

Additionally we've renamed:

  • the CustomValidatorContext class to PropertyValidatorContext,
  • the customValidator method of the PropertyModelBuilder class to validator.