How to use the datax-common.CommonHelpers.isValidNumberAboveZero function in datax-common

To help you get started, we’ve selected a few datax-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / data-accelerator / Website / Packages / datax-pipeline / src / modules / flowDefinition / flowSelectors.js View on Github external
function validateScale(scale) {
    return (
        scale &&
        CommonHelpers.isValidNumberAboveZero(scale.jobNumExecutors) &&
        CommonHelpers.isValidNumberAboveZero(scale.jobExecutorMemory)
    );
}
github microsoft / data-accelerator / Website / Packages / datax-pipeline / src / modules / flowDefinition / flowSelectors.js View on Github external
);
            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) {
github microsoft / data-accelerator / Website / Packages / datax-pipeline / src / modules / flowDefinition / components / input / inputSettingsContent.jsx View on Github external
validateNumber(value) {
        return !CommonHelpers.isValidNumberAboveZero(value) ? 'Numbers only and must be greater than zero' : '';
    }
github microsoft / data-accelerator / Website / Packages / datax-pipeline / src / modules / flowDefinition / flowSelectors.js View on Github external
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);
    }
github microsoft / data-accelerator / Website / Packages / datax-pipeline / src / modules / flowDefinition / flowSelectors.js View on Github external
function validateScale(scale) {
    return (
        scale &&
        CommonHelpers.isValidNumberAboveZero(scale.jobNumExecutors) &&
        CommonHelpers.isValidNumberAboveZero(scale.jobExecutorMemory)
    );
}
github microsoft / data-accelerator / Website / Packages / datax-pipeline / src / modules / flowDefinition / flowSelectors.js View on Github external
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() !== '');
github microsoft / data-accelerator / Website / Packages / datax-pipeline / src / modules / flowDefinition / flowSelectors.js View on Github external
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)