UNPKG

vda-5050-lib

Version:

Universal VDA 5050 library for Node.js and browsers

712 lines (710 loc) 190 kB
// ----------------------------------------------------------------------------" // This file was generated by a tool, do not modify it directly. // ---------------------------------------------------------------------------- const validateConnection = (function() { 'use strict' const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty); const format0 = (input) => { if (input.length > 10 + 1 + 9 + 12 + 6) return false const full = /^\d\d\d\d-(?:0[1-9]|1[0-2])-(?:[0-2]\d|3[01])[t\s](?:2[0-3]|[0-1]\d):[0-5]\d:(?:[0-5]\d|60)(?:\.\d+)?(?:z|[+-](?:2[0-3]|[0-1]\d)(?::?[0-5]\d)?)$/i const feb = input[5] === '0' && input[6] === '2' if ((feb && input[8] === '3') || !full.test(input)) return false if (input[17] === '6') { const p = input.slice(11).match(/([0-9.]+|[^0-9.])/g) let hm = Number(p[0]) * 60 + Number(p[2]) if (p[5] === '+') hm += 24 * 60 - Number(p[6] || 0) * 60 - Number(p[8] || 0) else if (p[5] === '-') hm += Number(p[6] || 0) * 60 + Number(p[8] || 0) if (hm % (24 * 60) !== 23 * 60 + 59) return false } if (feb) { if (/^\d\d\d\d-02-(?:[012][1-8]|[12]0|[01]9)/.test(input)) return true const matches = input.match(/^(\d\d\d\d)-02-29/) if (!matches) return false const year = matches[1] | 0 return year % 16 === 0 || (year % 4 === 0 && year % 25 !== 0) } if (input[8] === '3' && input[9] === '1') return /^\d\d\d\d-(?:0[13578]|1[02])-31/.test(input) return /^\d\d\d\d-(?:0[13-9]|1[012])-(?:[012][1-9]|[123]0)/.test(input) }; const ref1 = function validate(data) { validate.errors = null if (!(typeof data === "object" && data && !Array.isArray(data))) { validate.errors = [{ keywordLocation: "#/type", instanceLocation: "#" }] return false } if (!("headerId" in data && hasOwn(data, "headerId"))) { validate.errors = [{ keywordLocation: "#/required", instanceLocation: "#/headerId" }] return false } if (!("timestamp" in data && hasOwn(data, "timestamp"))) { validate.errors = [{ keywordLocation: "#/required", instanceLocation: "#/timestamp" }] return false } if (!("version" in data && hasOwn(data, "version"))) { validate.errors = [{ keywordLocation: "#/required", instanceLocation: "#/version" }] return false } if (!("manufacturer" in data && hasOwn(data, "manufacturer"))) { validate.errors = [{ keywordLocation: "#/required", instanceLocation: "#/manufacturer" }] return false } if (!("serialNumber" in data && hasOwn(data, "serialNumber"))) { validate.errors = [{ keywordLocation: "#/required", instanceLocation: "#/serialNumber" }] return false } if (!Number.isInteger(data.headerId)) { validate.errors = [{ keywordLocation: "#/properties/headerId/type", instanceLocation: "#/headerId" }] return false } if (!(typeof data.timestamp === "string")) { validate.errors = [{ keywordLocation: "#/properties/timestamp/type", instanceLocation: "#/timestamp" }] return false } if (!format0(data.timestamp)) { validate.errors = [{ keywordLocation: "#/properties/timestamp/format", instanceLocation: "#/timestamp" }] return false } if (!(typeof data.version === "string")) { validate.errors = [{ keywordLocation: "#/properties/version/type", instanceLocation: "#/version" }] return false } if (!(typeof data.manufacturer === "string")) { validate.errors = [{ keywordLocation: "#/properties/manufacturer/type", instanceLocation: "#/manufacturer" }] return false } if (!(typeof data.serialNumber === "string")) { validate.errors = [{ keywordLocation: "#/properties/serialNumber/type", instanceLocation: "#/serialNumber" }] return false } return true }; const errorMerge = ({ keywordLocation, instanceLocation }, schemaBase, dataBase) => ({ keywordLocation: `${schemaBase}${keywordLocation.slice(1)}`, instanceLocation: `${dataBase}${instanceLocation.slice(1)}`, }); const ref0 = function validate(data) { validate.errors = null if (!(typeof data === "object" && data && !Array.isArray(data))) { validate.errors = [{ keywordLocation: "#/type", instanceLocation: "#" }] return false } const err0 = validate.errors const res0 = ref1(data) const suberr0 = ref1.errors validate.errors = err0 if (!res0) { validate.errors = [errorMerge(suberr0[0], "#/allOf/0/$ref", "#")] return false } if (!("connectionState" in data && hasOwn(data, "connectionState"))) { validate.errors = [{ keywordLocation: "#/allOf/1/required", instanceLocation: "#/connectionState" }] return false } if (!(typeof data.connectionState === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/connectionState/type", instanceLocation: "#/connectionState" }] return false } if (!(data.connectionState === "ONLINE" || data.connectionState === "OFFLINE" || data.connectionState === "CONNECTIONBROKEN")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/connectionState/enum", instanceLocation: "#/connectionState" }] return false } return true }; return ref0})(); const validateFactsheet = (function() { 'use strict' const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty); const format0 = (input) => { if (input.length > 10 + 1 + 9 + 12 + 6) return false const full = /^\d\d\d\d-(?:0[1-9]|1[0-2])-(?:[0-2]\d|3[01])[t\s](?:2[0-3]|[0-1]\d):[0-5]\d:(?:[0-5]\d|60)(?:\.\d+)?(?:z|[+-](?:2[0-3]|[0-1]\d)(?::?[0-5]\d)?)$/i const feb = input[5] === '0' && input[6] === '2' if ((feb && input[8] === '3') || !full.test(input)) return false if (input[17] === '6') { const p = input.slice(11).match(/([0-9.]+|[^0-9.])/g) let hm = Number(p[0]) * 60 + Number(p[2]) if (p[5] === '+') hm += 24 * 60 - Number(p[6] || 0) * 60 - Number(p[8] || 0) else if (p[5] === '-') hm += Number(p[6] || 0) * 60 + Number(p[8] || 0) if (hm % (24 * 60) !== 23 * 60 + 59) return false } if (feb) { if (/^\d\d\d\d-02-(?:[012][1-8]|[12]0|[01]9)/.test(input)) return true const matches = input.match(/^(\d\d\d\d)-02-29/) if (!matches) return false const year = matches[1] | 0 return year % 16 === 0 || (year % 4 === 0 && year % 25 !== 0) } if (input[8] === '3' && input[9] === '1') return /^\d\d\d\d-(?:0[13578]|1[02])-31/.test(input) return /^\d\d\d\d-(?:0[13-9]|1[012])-(?:[012][1-9]|[123]0)/.test(input) }; const ref1 = function validate(data) { validate.errors = null if (!(typeof data === "object" && data && !Array.isArray(data))) { validate.errors = [{ keywordLocation: "#/type", instanceLocation: "#" }] return false } if (!("headerId" in data && hasOwn(data, "headerId"))) { validate.errors = [{ keywordLocation: "#/required", instanceLocation: "#/headerId" }] return false } if (!("timestamp" in data && hasOwn(data, "timestamp"))) { validate.errors = [{ keywordLocation: "#/required", instanceLocation: "#/timestamp" }] return false } if (!("version" in data && hasOwn(data, "version"))) { validate.errors = [{ keywordLocation: "#/required", instanceLocation: "#/version" }] return false } if (!("manufacturer" in data && hasOwn(data, "manufacturer"))) { validate.errors = [{ keywordLocation: "#/required", instanceLocation: "#/manufacturer" }] return false } if (!("serialNumber" in data && hasOwn(data, "serialNumber"))) { validate.errors = [{ keywordLocation: "#/required", instanceLocation: "#/serialNumber" }] return false } if (!Number.isInteger(data.headerId)) { validate.errors = [{ keywordLocation: "#/properties/headerId/type", instanceLocation: "#/headerId" }] return false } if (!(typeof data.timestamp === "string")) { validate.errors = [{ keywordLocation: "#/properties/timestamp/type", instanceLocation: "#/timestamp" }] return false } if (!format0(data.timestamp)) { validate.errors = [{ keywordLocation: "#/properties/timestamp/format", instanceLocation: "#/timestamp" }] return false } if (!(typeof data.version === "string")) { validate.errors = [{ keywordLocation: "#/properties/version/type", instanceLocation: "#/version" }] return false } if (!(typeof data.manufacturer === "string")) { validate.errors = [{ keywordLocation: "#/properties/manufacturer/type", instanceLocation: "#/manufacturer" }] return false } if (!(typeof data.serialNumber === "string")) { validate.errors = [{ keywordLocation: "#/properties/serialNumber/type", instanceLocation: "#/serialNumber" }] return false } return true }; const errorMerge = ({ keywordLocation, instanceLocation }, schemaBase, dataBase) => ({ keywordLocation: `${schemaBase}${keywordLocation.slice(1)}`, instanceLocation: `${dataBase}${instanceLocation.slice(1)}`, }); const ref0 = function validate(data) { validate.errors = null if (!(typeof data === "object" && data && !Array.isArray(data))) { validate.errors = [{ keywordLocation: "#/type", instanceLocation: "#" }] return false } const err0 = validate.errors const res0 = ref1(data) const suberr0 = ref1.errors validate.errors = err0 if (!res0) { validate.errors = [errorMerge(suberr0[0], "#/allOf/0/$ref", "#")] return false } if ("typeSpecification" in data && hasOwn(data, "typeSpecification")) { if (!(typeof data.typeSpecification === "object" && data.typeSpecification && !Array.isArray(data.typeSpecification))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/type", instanceLocation: "#/typeSpecification" }] return false } if (!("seriesName" in data.typeSpecification && hasOwn(data.typeSpecification, "seriesName"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/required", instanceLocation: "#/typeSpecification/seriesName" }] return false } if (!("agvKinematic" in data.typeSpecification && hasOwn(data.typeSpecification, "agvKinematic"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/required", instanceLocation: "#/typeSpecification/agvKinematic" }] return false } if (!("agvClass" in data.typeSpecification && hasOwn(data.typeSpecification, "agvClass"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/required", instanceLocation: "#/typeSpecification/agvClass" }] return false } if (!("maxLoadMass" in data.typeSpecification && hasOwn(data.typeSpecification, "maxLoadMass"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/required", instanceLocation: "#/typeSpecification/maxLoadMass" }] return false } if (!("localizationTypes" in data.typeSpecification && hasOwn(data.typeSpecification, "localizationTypes"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/required", instanceLocation: "#/typeSpecification/localizationTypes" }] return false } if (!("navigationTypes" in data.typeSpecification && hasOwn(data.typeSpecification, "navigationTypes"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/required", instanceLocation: "#/typeSpecification/navigationTypes" }] return false } if (!(typeof data.typeSpecification.seriesName === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/seriesName/type", instanceLocation: "#/typeSpecification/seriesName" }] return false } if ("seriesDescription" in data.typeSpecification && hasOwn(data.typeSpecification, "seriesDescription")) { if (!(typeof data.typeSpecification.seriesDescription === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/seriesDescription/type", instanceLocation: "#/typeSpecification/seriesDescription" }] return false } } if (!(typeof data.typeSpecification.agvKinematic === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/agvKinematic/type", instanceLocation: "#/typeSpecification/agvKinematic" }] return false } if (!(data.typeSpecification.agvKinematic === "DIFF" || data.typeSpecification.agvKinematic === "OMNI" || data.typeSpecification.agvKinematic === "THREEWHEEL")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/agvKinematic/enum", instanceLocation: "#/typeSpecification/agvKinematic" }] return false } if (!(typeof data.typeSpecification.agvClass === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/agvClass/type", instanceLocation: "#/typeSpecification/agvClass" }] return false } if (!(data.typeSpecification.agvClass === "FORKLIFT" || data.typeSpecification.agvClass === "CONVEYOR" || data.typeSpecification.agvClass === "TUGGER" || data.typeSpecification.agvClass === "CARRIER")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/agvClass/enum", instanceLocation: "#/typeSpecification/agvClass" }] return false } if (!(typeof data.typeSpecification.maxLoadMass === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/maxLoadMass/type", instanceLocation: "#/typeSpecification/maxLoadMass" }] return false } if (!(0 <= data.typeSpecification.maxLoadMass)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/maxLoadMass/minimum", instanceLocation: "#/typeSpecification/maxLoadMass" }] return false } if (!Array.isArray(data.typeSpecification.localizationTypes)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/localizationTypes/type", instanceLocation: "#/typeSpecification/localizationTypes" }] return false } for (let i = 0; i < data.typeSpecification.localizationTypes.length; i++) { if (i in data.typeSpecification.localizationTypes && hasOwn(data.typeSpecification.localizationTypes, i)) { if (!(typeof data.typeSpecification.localizationTypes[i] === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/localizationTypes/items/type", instanceLocation: "#/typeSpecification/localizationTypes/"+i }] return false } if (!(data.typeSpecification.localizationTypes[i] === "NATURAL" || data.typeSpecification.localizationTypes[i] === "REFLECTOR" || data.typeSpecification.localizationTypes[i] === "RFID" || data.typeSpecification.localizationTypes[i] === "DMC" || data.typeSpecification.localizationTypes[i] === "SPOT" || data.typeSpecification.localizationTypes[i] === "GRID")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/localizationTypes/items/enum", instanceLocation: "#/typeSpecification/localizationTypes/"+i }] return false } } } if (!Array.isArray(data.typeSpecification.navigationTypes)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/navigationTypes/type", instanceLocation: "#/typeSpecification/navigationTypes" }] return false } for (let j = 0; j < data.typeSpecification.navigationTypes.length; j++) { if (j in data.typeSpecification.navigationTypes && hasOwn(data.typeSpecification.navigationTypes, j)) { if (!(typeof data.typeSpecification.navigationTypes[j] === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/navigationTypes/items/type", instanceLocation: "#/typeSpecification/navigationTypes/"+j }] return false } if (!(data.typeSpecification.navigationTypes[j] === "PHYSICAL_LINDE_GUIDED" || data.typeSpecification.navigationTypes[j] === "VIRTUAL_LINE_GUIDED" || data.typeSpecification.navigationTypes[j] === "AUTONOMOUS")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/typeSpecification/properties/navigationTypes/items/enum", instanceLocation: "#/typeSpecification/navigationTypes/"+j }] return false } } } } if ("physicalParameters" in data && hasOwn(data, "physicalParameters")) { if (!(typeof data.physicalParameters === "object" && data.physicalParameters && !Array.isArray(data.physicalParameters))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/type", instanceLocation: "#/physicalParameters" }] return false } if (!("speedMin" in data.physicalParameters && hasOwn(data.physicalParameters, "speedMin"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/required", instanceLocation: "#/physicalParameters/speedMin" }] return false } if (!("speedMax" in data.physicalParameters && hasOwn(data.physicalParameters, "speedMax"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/required", instanceLocation: "#/physicalParameters/speedMax" }] return false } if (!("accelerationMax" in data.physicalParameters && hasOwn(data.physicalParameters, "accelerationMax"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/required", instanceLocation: "#/physicalParameters/accelerationMax" }] return false } if (!("decelerationMax" in data.physicalParameters && hasOwn(data.physicalParameters, "decelerationMax"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/required", instanceLocation: "#/physicalParameters/decelerationMax" }] return false } if (!("heightMax" in data.physicalParameters && hasOwn(data.physicalParameters, "heightMax"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/required", instanceLocation: "#/physicalParameters/heightMax" }] return false } if (!("width" in data.physicalParameters && hasOwn(data.physicalParameters, "width"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/required", instanceLocation: "#/physicalParameters/width" }] return false } if (!("length" in data.physicalParameters && hasOwn(data.physicalParameters, "length"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/required", instanceLocation: "#/physicalParameters/length" }] return false } if (!(typeof data.physicalParameters.speedMin === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/properties/speedMin/type", instanceLocation: "#/physicalParameters/speedMin" }] return false } if (!(typeof data.physicalParameters.speedMax === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/properties/speedMax/type", instanceLocation: "#/physicalParameters/speedMax" }] return false } if (!(typeof data.physicalParameters.accelerationMax === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/properties/accelerationMax/type", instanceLocation: "#/physicalParameters/accelerationMax" }] return false } if (!(typeof data.physicalParameters.decelerationMax === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/properties/decelerationMax/type", instanceLocation: "#/physicalParameters/decelerationMax" }] return false } if ("heightMin" in data.physicalParameters && hasOwn(data.physicalParameters, "heightMin")) { if (!(typeof data.physicalParameters.heightMin === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/properties/heightMin/type", instanceLocation: "#/physicalParameters/heightMin" }] return false } } if (!(typeof data.physicalParameters.heightMax === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/properties/heightMax/type", instanceLocation: "#/physicalParameters/heightMax" }] return false } if (!(typeof data.physicalParameters.width === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/properties/width/type", instanceLocation: "#/physicalParameters/width" }] return false } if (!(typeof data.physicalParameters.length === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/physicalParameters/properties/length/type", instanceLocation: "#/physicalParameters/length" }] return false } } if ("protocolLimits" in data && hasOwn(data, "protocolLimits")) { if (!(typeof data.protocolLimits === "object" && data.protocolLimits && !Array.isArray(data.protocolLimits))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/type", instanceLocation: "#/protocolLimits" }] return false } if (!("maxStringLens" in data.protocolLimits && hasOwn(data.protocolLimits, "maxStringLens"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/required", instanceLocation: "#/protocolLimits/maxStringLens" }] return false } if (!("maxArrayLens" in data.protocolLimits && hasOwn(data.protocolLimits, "maxArrayLens"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/required", instanceLocation: "#/protocolLimits/maxArrayLens" }] return false } if (!("timing" in data.protocolLimits && hasOwn(data.protocolLimits, "timing"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/required", instanceLocation: "#/protocolLimits/timing" }] return false } if (!(typeof data.protocolLimits.maxStringLens === "object" && data.protocolLimits.maxStringLens && !Array.isArray(data.protocolLimits.maxStringLens))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/maxStringLens/type", instanceLocation: "#/protocolLimits/maxStringLens" }] return false } if ("msgLen" in data.protocolLimits.maxStringLens && hasOwn(data.protocolLimits.maxStringLens, "msgLen")) { if (!Number.isInteger(data.protocolLimits.maxStringLens.msgLen)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/maxStringLens/properties/msgLen/type", instanceLocation: "#/protocolLimits/maxStringLens/msgLen" }] return false } } if ("topicSerialLen" in data.protocolLimits.maxStringLens && hasOwn(data.protocolLimits.maxStringLens, "topicSerialLen")) { if (!Number.isInteger(data.protocolLimits.maxStringLens.topicSerialLen)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/maxStringLens/properties/topicSerialLen/type", instanceLocation: "#/protocolLimits/maxStringLens/topicSerialLen" }] return false } } if ("topicElemLen" in data.protocolLimits.maxStringLens && hasOwn(data.protocolLimits.maxStringLens, "topicElemLen")) { if (!Number.isInteger(data.protocolLimits.maxStringLens.topicElemLen)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/maxStringLens/properties/topicElemLen/type", instanceLocation: "#/protocolLimits/maxStringLens/topicElemLen" }] return false } } if ("idLen" in data.protocolLimits.maxStringLens && hasOwn(data.protocolLimits.maxStringLens, "idLen")) { if (!Number.isInteger(data.protocolLimits.maxStringLens.idLen)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/maxStringLens/properties/idLen/type", instanceLocation: "#/protocolLimits/maxStringLens/idLen" }] return false } } if ("idNumericalOnly" in data.protocolLimits.maxStringLens && hasOwn(data.protocolLimits.maxStringLens, "idNumericalOnly")) { if (!(typeof data.protocolLimits.maxStringLens.idNumericalOnly === "boolean")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/maxStringLens/properties/idNumericalOnly/type", instanceLocation: "#/protocolLimits/maxStringLens/idNumericalOnly" }] return false } } if ("enumLen" in data.protocolLimits.maxStringLens && hasOwn(data.protocolLimits.maxStringLens, "enumLen")) { if (!Number.isInteger(data.protocolLimits.maxStringLens.enumLen)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/maxStringLens/properties/enumLen/type", instanceLocation: "#/protocolLimits/maxStringLens/enumLen" }] return false } } if ("loadIdLen" in data.protocolLimits.maxStringLens && hasOwn(data.protocolLimits.maxStringLens, "loadIdLen")) { if (!Number.isInteger(data.protocolLimits.maxStringLens.loadIdLen)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/maxStringLens/properties/loadIdLen/type", instanceLocation: "#/protocolLimits/maxStringLens/loadIdLen" }] return false } } if (!(typeof data.protocolLimits.maxArrayLens === "object" && data.protocolLimits.maxArrayLens && !Array.isArray(data.protocolLimits.maxArrayLens))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/maxArrayLens/type", instanceLocation: "#/protocolLimits/maxArrayLens" }] return false } if (!(typeof data.protocolLimits.timing === "object" && data.protocolLimits.timing && !Array.isArray(data.protocolLimits.timing))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/timing/type", instanceLocation: "#/protocolLimits/timing" }] return false } if (!("minOrderInterval" in data.protocolLimits.timing && hasOwn(data.protocolLimits.timing, "minOrderInterval"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/timing/required", instanceLocation: "#/protocolLimits/timing/minOrderInterval" }] return false } if (!("minStateInterval" in data.protocolLimits.timing && hasOwn(data.protocolLimits.timing, "minStateInterval"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/timing/required", instanceLocation: "#/protocolLimits/timing/minStateInterval" }] return false } if (!(typeof data.protocolLimits.timing.minOrderInterval === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/timing/properties/minOrderInterval/type", instanceLocation: "#/protocolLimits/timing/minOrderInterval" }] return false } if (!(typeof data.protocolLimits.timing.minStateInterval === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/timing/properties/minStateInterval/type", instanceLocation: "#/protocolLimits/timing/minStateInterval" }] return false } if ("defaultStateInterval" in data.protocolLimits.timing && hasOwn(data.protocolLimits.timing, "defaultStateInterval")) { if (!(typeof data.protocolLimits.timing.defaultStateInterval === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/timing/properties/defaultStateInterval/type", instanceLocation: "#/protocolLimits/timing/defaultStateInterval" }] return false } } if ("visualizationInterval" in data.protocolLimits.timing && hasOwn(data.protocolLimits.timing, "visualizationInterval")) { if (!(typeof data.protocolLimits.timing.visualizationInterval === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolLimits/properties/timing/properties/visualizationInterval/type", instanceLocation: "#/protocolLimits/timing/visualizationInterval" }] return false } } } if ("protocolFeatures" in data && hasOwn(data, "protocolFeatures")) { if (!(typeof data.protocolFeatures === "object" && data.protocolFeatures && !Array.isArray(data.protocolFeatures))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/type", instanceLocation: "#/protocolFeatures" }] return false } if (!("optionalParameters" in data.protocolFeatures && hasOwn(data.protocolFeatures, "optionalParameters"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/required", instanceLocation: "#/protocolFeatures/optionalParameters" }] return false } if (!("agvActions" in data.protocolFeatures && hasOwn(data.protocolFeatures, "agvActions"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/required", instanceLocation: "#/protocolFeatures/agvActions" }] return false } if (!Array.isArray(data.protocolFeatures.optionalParameters)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/optionalParameters/type", instanceLocation: "#/protocolFeatures/optionalParameters" }] return false } for (let k = 0; k < data.protocolFeatures.optionalParameters.length; k++) { if (k in data.protocolFeatures.optionalParameters && hasOwn(data.protocolFeatures.optionalParameters, k)) { if (!(typeof data.protocolFeatures.optionalParameters[k] === "object" && data.protocolFeatures.optionalParameters[k] && !Array.isArray(data.protocolFeatures.optionalParameters[k]))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/optionalParameters/items/type", instanceLocation: "#/protocolFeatures/optionalParameters/"+k }] return false } if (!("parameter" in data.protocolFeatures.optionalParameters[k] && hasOwn(data.protocolFeatures.optionalParameters[k], "parameter"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/optionalParameters/items/required", instanceLocation: "#/protocolFeatures/optionalParameters/"+k+"/parameter" }] return false } if (!("support" in data.protocolFeatures.optionalParameters[k] && hasOwn(data.protocolFeatures.optionalParameters[k], "support"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/optionalParameters/items/required", instanceLocation: "#/protocolFeatures/optionalParameters/"+k+"/support" }] return false } if (!(typeof data.protocolFeatures.optionalParameters[k].parameter === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/optionalParameters/items/properties/parameter/type", instanceLocation: "#/protocolFeatures/optionalParameters/"+k+"/parameter" }] return false } if (!(typeof data.protocolFeatures.optionalParameters[k].support === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/optionalParameters/items/properties/support/type", instanceLocation: "#/protocolFeatures/optionalParameters/"+k+"/support" }] return false } if (!(data.protocolFeatures.optionalParameters[k].support === "SUPPORTED" || data.protocolFeatures.optionalParameters[k].support === "REQUIRED")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/optionalParameters/items/properties/support/enum", instanceLocation: "#/protocolFeatures/optionalParameters/"+k+"/support" }] return false } if ("description" in data.protocolFeatures.optionalParameters[k] && hasOwn(data.protocolFeatures.optionalParameters[k], "description")) { if (!(typeof data.protocolFeatures.optionalParameters[k].description === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/optionalParameters/items/properties/description/type", instanceLocation: "#/protocolFeatures/optionalParameters/"+k+"/description" }] return false } } } } if (!Array.isArray(data.protocolFeatures.agvActions)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/type", instanceLocation: "#/protocolFeatures/agvActions" }] return false } for (let l = 0; l < data.protocolFeatures.agvActions.length; l++) { if (l in data.protocolFeatures.agvActions && hasOwn(data.protocolFeatures.agvActions, l)) { if (!(typeof data.protocolFeatures.agvActions[l] === "object" && data.protocolFeatures.agvActions[l] && !Array.isArray(data.protocolFeatures.agvActions[l]))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/type", instanceLocation: "#/protocolFeatures/agvActions/"+l }] return false } if (!("actionType" in data.protocolFeatures.agvActions[l] && hasOwn(data.protocolFeatures.agvActions[l], "actionType"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/required", instanceLocation: "#/protocolFeatures/agvActions/"+l+"/actionType" }] return false } if (!("actionScopes" in data.protocolFeatures.agvActions[l] && hasOwn(data.protocolFeatures.agvActions[l], "actionScopes"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/required", instanceLocation: "#/protocolFeatures/agvActions/"+l+"/actionScopes" }] return false } if (!(typeof data.protocolFeatures.agvActions[l].actionType === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionType/type", instanceLocation: "#/protocolFeatures/agvActions/"+l+"/actionType" }] return false } if ("actionDescription" in data.protocolFeatures.agvActions[l] && hasOwn(data.protocolFeatures.agvActions[l], "actionDescription")) { if (!(typeof data.protocolFeatures.agvActions[l].actionDescription === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionDescription/type", instanceLocation: "#/protocolFeatures/agvActions/"+l+"/actionDescription" }] return false } } if (!(Array.isArray(data.protocolFeatures.agvActions[l].actionScopes))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionScopes/type", instanceLocation: "#/protocolFeatures/agvActions/"+l+"/actionScopes" }] return false } for (let m = 0; m < data.protocolFeatures.agvActions[l].actionScopes.length; m++) { if (m in data.protocolFeatures.agvActions[l].actionScopes && hasOwn(data.protocolFeatures.agvActions[l].actionScopes, m)) { if (!(typeof data.protocolFeatures.agvActions[l].actionScopes[m] === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionScopes/items/type", instanceLocation: "#/protocolFeatures/agvActions/"+l+"actionScopes/"+m }] return false } if (!(data.protocolFeatures.agvActions[l].actionScopes[m] === "INSTANT" || data.protocolFeatures.agvActions[l].actionScopes[m] === "NODE" || data.protocolFeatures.agvActions[l].actionScopes[m] === "EDGE")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionScopes/items/enum", instanceLocation: "#/protocolFeatures/agvActions/"+l+"actionScopes/"+m }] return false } } } if ("actionParameters" in data.protocolFeatures.agvActions[l] && hasOwn(data.protocolFeatures.agvActions[l], "actionParameters")) { if (!(Array.isArray(data.protocolFeatures.agvActions[l].actionParameters))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionParameters/type", instanceLocation: "#/protocolFeatures/agvActions/"+l+"/actionParameters" }] return false } for (let n = 0; n < data.protocolFeatures.agvActions[l].actionParameters.length; n++) { if (n in data.protocolFeatures.agvActions[l].actionParameters && hasOwn(data.protocolFeatures.agvActions[l].actionParameters, n)) { if (!(typeof data.protocolFeatures.agvActions[l].actionParameters[n] === "object" && data.protocolFeatures.agvActions[l].actionParameters[n] && !Array.isArray(data.protocolFeatures.agvActions[l].actionParameters[n]))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionParameters/items/type", instanceLocation: "#/protocolFeatures/agvActions/"+l+"actionParameters/"+n }] return false } if (!("key" in data.protocolFeatures.agvActions[l].actionParameters[n] && hasOwn(data.protocolFeatures.agvActions[l].actionParameters[n], "key"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionParameters/items/required", instanceLocation: "#/protocolFeatures/agvActions/"+l+"actionParameters/"+n+"/key" }] return false } if (!("valueDataType" in data.protocolFeatures.agvActions[l].actionParameters[n] && hasOwn(data.protocolFeatures.agvActions[l].actionParameters[n], "valueDataType"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionParameters/items/required", instanceLocation: "#/protocolFeatures/agvActions/"+l+"actionParameters/"+n+"/valueDataType" }] return false } if (!(typeof data.protocolFeatures.agvActions[l].actionParameters[n].key === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionParameters/items/properties/key/type", instanceLocation: "#/protocolFeatures/agvActions/"+l+"actionParameters/"+n+"/key" }] return false } if (!(typeof data.protocolFeatures.agvActions[l].actionParameters[n].valueDataType === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionParameters/items/properties/valueDataType/type", instanceLocation: "#/protocolFeatures/agvActions/"+l+"actionParameters/"+n+"/valueDataType" }] return false } if (!(data.protocolFeatures.agvActions[l].actionParameters[n].valueDataType === "BOOL" || data.protocolFeatures.agvActions[l].actionParameters[n].valueDataType === "NUMBER" || data.protocolFeatures.agvActions[l].actionParameters[n].valueDataType === "INTEGER" || data.protocolFeatures.agvActions[l].actionParameters[n].valueDataType === "FLOAT" || data.protocolFeatures.agvActions[l].actionParameters[n].valueDataType === "STRING" || data.protocolFeatures.agvActions[l].actionParameters[n].valueDataType === "OBJECT" || data.protocolFeatures.agvActions[l].actionParameters[n].valueDataType === "ARRAY")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionParameters/items/properties/valueDataType/enum", instanceLocation: "#/protocolFeatures/agvActions/"+l+"actionParameters/"+n+"/valueDataType" }] return false } if ("description" in data.protocolFeatures.agvActions[l].actionParameters[n] && hasOwn(data.protocolFeatures.agvActions[l].actionParameters[n], "description")) { if (!(typeof data.protocolFeatures.agvActions[l].actionParameters[n].description === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionParameters/items/properties/description/type", instanceLocation: "#/protocolFeatures/agvActions/"+l+"actionParameters/"+n+"/description" }] return false } } if ("isOptional" in data.protocolFeatures.agvActions[l].actionParameters[n] && hasOwn(data.protocolFeatures.agvActions[l].actionParameters[n], "isOptional")) { if (!(typeof data.protocolFeatures.agvActions[l].actionParameters[n].isOptional === "boolean")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/actionParameters/items/properties/isOptional/type", instanceLocation: "#/protocolFeatures/agvActions/"+l+"actionParameters/"+n+"/isOptional" }] return false } } } } } if ("resultDescription" in data.protocolFeatures.agvActions[l] && hasOwn(data.protocolFeatures.agvActions[l], "resultDescription")) { if (!(typeof data.protocolFeatures.agvActions[l].resultDescription === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/protocolFeatures/properties/agvActions/items/properties/resultDescription/type", instanceLocation: "#/protocolFeatures/agvActions/"+l+"/resultDescription" }] return false } } } } } if ("agvGeometry" in data && hasOwn(data, "agvGeometry")) { if (!(typeof data.agvGeometry === "object" && data.agvGeometry && !Array.isArray(data.agvGeometry))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/type", instanceLocation: "#/agvGeometry" }] return false } if ("wheelDefinitions" in data.agvGeometry && hasOwn(data.agvGeometry, "wheelDefinitions")) { if (!Array.isArray(data.agvGeometry.wheelDefinitions)) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/type", instanceLocation: "#/agvGeometry/wheelDefinitions" }] return false } for (let o = 0; o < data.agvGeometry.wheelDefinitions.length; o++) { if (o in data.agvGeometry.wheelDefinitions && hasOwn(data.agvGeometry.wheelDefinitions, o)) { if (!(typeof data.agvGeometry.wheelDefinitions[o] === "object" && data.agvGeometry.wheelDefinitions[o] && !Array.isArray(data.agvGeometry.wheelDefinitions[o]))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/type", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o }] return false } if (!("type" in data.agvGeometry.wheelDefinitions[o] && hasOwn(data.agvGeometry.wheelDefinitions[o], "type"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/required", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/type" }] return false } if (!("isActiveDriven" in data.agvGeometry.wheelDefinitions[o] && hasOwn(data.agvGeometry.wheelDefinitions[o], "isActiveDriven"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/required", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/isActiveDriven" }] return false } if (!("isActiveSteered" in data.agvGeometry.wheelDefinitions[o] && hasOwn(data.agvGeometry.wheelDefinitions[o], "isActiveSteered"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/required", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/isActiveSteered" }] return false } if (!("position" in data.agvGeometry.wheelDefinitions[o] && hasOwn(data.agvGeometry.wheelDefinitions[o], "position"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/required", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/position" }] return false } if (!("diameter" in data.agvGeometry.wheelDefinitions[o] && hasOwn(data.agvGeometry.wheelDefinitions[o], "diameter"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/required", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/diameter" }] return false } if (!("width" in data.agvGeometry.wheelDefinitions[o] && hasOwn(data.agvGeometry.wheelDefinitions[o], "width"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/required", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/width" }] return false } if (!(typeof data.agvGeometry.wheelDefinitions[o].type === "string")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/properties/type/type", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/type" }] return false } if (!(data.agvGeometry.wheelDefinitions[o].type === "DRIVE" || data.agvGeometry.wheelDefinitions[o].type === "CASTER" || data.agvGeometry.wheelDefinitions[o].type === "FIXED" || data.agvGeometry.wheelDefinitions[o].type === "MECANUM")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/properties/type/enum", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/type" }] return false } if (!(typeof data.agvGeometry.wheelDefinitions[o].isActiveDriven === "boolean")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/properties/isActiveDriven/type", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/isActiveDriven" }] return false } if (!(typeof data.agvGeometry.wheelDefinitions[o].isActiveSteered === "boolean")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/properties/isActiveSteered/type", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/isActiveSteered" }] return false } if (!(typeof data.agvGeometry.wheelDefinitions[o].position === "object" && data.agvGeometry.wheelDefinitions[o].position && !Array.isArray(data.agvGeometry.wheelDefinitions[o].position))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/properties/position/type", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/position" }] return false } if (!("x" in data.agvGeometry.wheelDefinitions[o].position && hasOwn(data.agvGeometry.wheelDefinitions[o].position, "x"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/properties/position/required", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/position/x" }] return false } if (!("y" in data.agvGeometry.wheelDefinitions[o].position && hasOwn(data.agvGeometry.wheelDefinitions[o].position, "y"))) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/properties/position/required", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/position/y" }] return false } if (!(typeof data.agvGeometry.wheelDefinitions[o].position.x === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/properties/position/properties/x/type", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/position/x" }] return false } if (!(typeof data.agvGeometry.wheelDefinitions[o].position.y === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/properties/position/properties/y/type", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/position/y" }] return false } if ("theta" in data.agvGeometry.wheelDefinitions[o].position && hasOwn(data.agvGeometry.wheelDefinitions[o].position, "theta")) { if (!(typeof data.agvGeometry.wheelDefinitions[o].position.theta === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/properties/position/properties/theta/type", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/position/theta" }] return false } } if (!(typeof data.agvGeometry.wheelDefinitions[o].diameter === "number")) { validate.errors = [{ keywordLocation: "#/allOf/1/properties/agvGeometry/properties/wheelDefinitions/items/properties/diameter/type", instanceLocation: "#/agvGeometry/wheelDefinitions/"+o+"/diameter" }] return false } if (!(typeof data.agvGeometry.wheelDefinitions[o].width === "number")) { val