"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    exportPrintersFloorsYamlRules: function() {
        return exportPrintersFloorsYamlRules;
    },
    importPrinterPositionsRules: function() {
        return importPrinterPositionsRules;
    },
    importPrintersFloorsYamlRules: function() {
        return importPrintersFloorsYamlRules;
    }
});
const _serviceconstants = require("../../constants/service.constants");
const _printerapiinterface = require("../printer-api.interface");
const exportPrintersFloorsYamlRules = {
    exportPrinters: "required|boolean",
    exportFloorGrid: "required|boolean",
    exportFloors: "required|boolean",
    exportGroups: "boolean",
    printerComparisonStrategiesByPriority: "required|arrayUnique|minLength:1",
    "printerComparisonStrategiesByPriority.*": "required|string|in:name,url,id",
    floorComparisonStrategiesByPriority: "required|string|in:name,floor,id",
    notes: "string"
};
const importPrintersFloorsYamlRules = (importPrinters, importFloorGrid, importFloors, importGroups)=>{
    return {
        version: "required|string",
        config: "required|object",
        "config.exportPrinters": "required|boolean",
        "config.exportFloorGrid": "required|boolean",
        "config.exportFloors": "required|boolean",
        "config.exportGroups": "boolean",
        "config.printerComparisonStrategiesByPriority": "required|arrayUnique|minLength:1",
        "config.printerComparisonStrategiesByPriority.*": "required|string|in:name,url,id",
        "config.floorComparisonStrategiesByPriority": "required|string|in:name,floor,id",
        printers: `${!!importPrinters ? "array|minLength:0" : "not"}`,
        "printers.*.id": "required",
        "printers.*.apiKey": `required|length:${_serviceconstants.apiKeyLengthMaxDefault},${_serviceconstants.apiKeyLengthMinDefault}|alphaDash`,
        "printers.*.printerURL": "required|httpurl",
        "printers.*.enabled": "boolean",
        "printers.*.printerType": `integer|in:${_printerapiinterface.OctoprintType},${_printerapiinterface.MoonrakerType}`,
        "printers.*.name": "required|string",
        floors: `${!!importFloors ? "array|minLength:0" : "not"}`,
        "floors.*.id": "required",
        "floors.*.floor": "required|integer",
        "floors.*.name": "required|string",
        groups: `${!!importGroups ? "array|minLength:0" : "not"}`,
        "groups.*.id": "required",
        "groups.*.name": "required|string"
    };
};
const importPrinterPositionsRules = (isTypeormMode)=>({
        printers: "array|minLength:0",
        "printers.*.printerId": "required",
        "printers.*.x": "required|integer|min:0|max:12",
        "printers.*.y": "required|integer|min:0|max:12"
    });

//# sourceMappingURL=yaml-service.validation.js.map