Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function validateScale(scale) {
return (
scale &&
CommonHelpers.isValidNumberAboveZero(scale.jobNumExecutors) &&
CommonHelpers.isValidNumberAboveZero(scale.jobExecutorMemory)
);
}
);
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.maxRate));
validations.push(Helpers.isValidJson(input.properties.inputSchemaFile));
} else if (input.type === Models.inputTypeEnum.iothub) {
validations.push(input.properties.inputEventhubName.trim() !== '');
validations.push(input.properties.inputEventhubConnection.trim() !== '');
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.windowDuration));
validations.push(
input.properties.watermarkValue.trim() !== '' && Helpers.isValidNumberAboveOrEqualZero(input.properties.watermarkValue)
);
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.maxRate));
validations.push(Helpers.isValidJson(input.properties.inputSchemaFile));
} else if (input.type === Models.inputTypeEnum.kafkaeventhub || input.type === Models.inputTypeEnum.kafka) {
validations.push(input.properties.inputEventhubName.trim() !== '');
validations.push(input.properties.inputEventhubConnection.trim() !== '');
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.windowDuration));
validations.push(
input.properties.watermarkValue.trim() !== '' && Helpers.isValidNumberAboveOrEqualZero(input.properties.watermarkValue)
);
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.maxRate));
validations.push(Helpers.isValidJson(input.properties.inputSchemaFile));
} else if (input.type === Models.inputTypeEnum.local) {
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.windowDuration));
validations.push(
input.properties.watermarkValue.trim() !== '' && Helpers.isValidNumberAboveOrEqualZero(input.properties.watermarkValue)
);
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.maxRate));
validations.push(Helpers.isValidJson(input.properties.inputSchemaFile));
} else {
validation.push(false);
}
} else if (input.mode === Models.inputModeEnum.batching) {
validateNumber(value) {
return !CommonHelpers.isValidNumberAboveZero(value) ? 'Numbers only and must be greater than zero' : '';
}
validations.push(input.properties.inputEventhubName.trim() !== '');
validations.push(input.properties.inputEventhubConnection.trim() !== '');
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.windowDuration));
validations.push(
input.properties.watermarkValue.trim() !== '' && Helpers.isValidNumberAboveOrEqualZero(input.properties.watermarkValue)
);
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.maxRate));
validations.push(Helpers.isValidJson(input.properties.inputSchemaFile));
} else if (input.type === Models.inputTypeEnum.kafkaeventhub || input.type === Models.inputTypeEnum.kafka) {
validations.push(input.properties.inputEventhubName.trim() !== '');
validations.push(input.properties.inputEventhubConnection.trim() !== '');
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.windowDuration));
validations.push(
input.properties.watermarkValue.trim() !== '' && Helpers.isValidNumberAboveOrEqualZero(input.properties.watermarkValue)
);
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.maxRate));
validations.push(Helpers.isValidJson(input.properties.inputSchemaFile));
} else if (input.type === Models.inputTypeEnum.local) {
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.windowDuration));
validations.push(
input.properties.watermarkValue.trim() !== '' && Helpers.isValidNumberAboveOrEqualZero(input.properties.watermarkValue)
);
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.maxRate));
validations.push(Helpers.isValidJson(input.properties.inputSchemaFile));
} else {
validation.push(false);
}
} else if (input.mode === Models.inputModeEnum.batching) {
} else {
validations.push(false);
}
function validateScale(scale) {
return (
scale &&
CommonHelpers.isValidNumberAboveZero(scale.jobNumExecutors) &&
CommonHelpers.isValidNumberAboveZero(scale.jobExecutorMemory)
);
}
function validateInputStreaming(input) {
let validations = [];
validations.push(input && input.properties);
if (input.mode === Models.inputModeEnum.streaming) {
if (input.type === Models.inputTypeEnum.events) {
validations.push(input.properties.inputEventhubConnection.trim() !== '');
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.windowDuration));
validations.push(
input.properties.watermarkValue.trim() !== '' && Helpers.isValidNumberAboveOrEqualZero(input.properties.watermarkValue)
);
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.maxRate));
validations.push(Helpers.isValidJson(input.properties.inputSchemaFile));
} else if (input.type === Models.inputTypeEnum.iothub) {
validations.push(input.properties.inputEventhubName.trim() !== '');
validations.push(input.properties.inputEventhubConnection.trim() !== '');
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.windowDuration));
validations.push(
input.properties.watermarkValue.trim() !== '' && Helpers.isValidNumberAboveOrEqualZero(input.properties.watermarkValue)
);
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.maxRate));
validations.push(Helpers.isValidJson(input.properties.inputSchemaFile));
} else if (input.type === Models.inputTypeEnum.kafkaeventhub || input.type === Models.inputTypeEnum.kafka) {
validations.push(input.properties.inputEventhubName.trim() !== '');
function validateInputStreaming(input) {
let validations = [];
validations.push(input && input.properties);
if (input.mode === Models.inputModeEnum.streaming) {
if (input.type === Models.inputTypeEnum.events) {
validations.push(input.properties.inputEventhubConnection.trim() !== '');
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.windowDuration));
validations.push(
input.properties.watermarkValue.trim() !== '' && Helpers.isValidNumberAboveOrEqualZero(input.properties.watermarkValue)
);
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.maxRate));
validations.push(Helpers.isValidJson(input.properties.inputSchemaFile));
} else if (input.type === Models.inputTypeEnum.iothub) {
validations.push(input.properties.inputEventhubName.trim() !== '');
validations.push(input.properties.inputEventhubConnection.trim() !== '');
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.windowDuration));
validations.push(
input.properties.watermarkValue.trim() !== '' && Helpers.isValidNumberAboveOrEqualZero(input.properties.watermarkValue)
);
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.maxRate));
validations.push(Helpers.isValidJson(input.properties.inputSchemaFile));
} else if (input.type === Models.inputTypeEnum.kafkaeventhub || input.type === Models.inputTypeEnum.kafka) {
validations.push(input.properties.inputEventhubName.trim() !== '');
validations.push(input.properties.inputEventhubConnection.trim() !== '');
validations.push(CommonHelpers.isValidNumberAboveZero(input.properties.windowDuration));
validations.push(
input.properties.watermarkValue.trim() !== '' && Helpers.isValidNumberAboveOrEqualZero(input.properties.watermarkValue)