UNPKG

altair-graphql-core

Version:

Several of the core logic for altair graphql client

1 lines 8.19 kB
"use strict";module.exports = validate20;module.exports.default = validate20;const schema22 = {"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"definitions":{"APSPluginDefinition":{"additionalProperties":false,"description":"Altair Plugin Server - Plugin definition","properties":{"author":{"description":"The author of the plugin","type":"string"},"description":{"description":"The description of the plugin","type":"string"},"homepage":{"description":"The homepage of the plugin","type":"string"},"id":{"description":"The plugin ID (used to install the plugin)","type":"string"},"name":{"description":"The display name of the plugin","type":"string"},"repository":{"description":"The GitHub repository of the plugin","type":"string"}},"required":["author","description","id","name","repository"],"type":"object"}},"properties":{"plugins":{"additionalProperties":{"$ref":"#/definitions/APSPluginDefinition"},"type":"object"}},"required":["plugins"],"type":"object"};const schema23 = {"additionalProperties":false,"description":"Altair Plugin Server - Plugin definition","properties":{"author":{"description":"The author of the plugin","type":"string"},"description":{"description":"The description of the plugin","type":"string"},"homepage":{"description":"The homepage of the plugin","type":"string"},"id":{"description":"The plugin ID (used to install the plugin)","type":"string"},"name":{"description":"The display name of the plugin","type":"string"},"repository":{"description":"The GitHub repository of the plugin","type":"string"}},"required":["author","description","id","name","repository"],"type":"object"};function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.plugins === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "plugins"},message:"must have required property '"+"plugins"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === "plugins")){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.plugins !== undefined){let data0 = data.plugins;if(data0 && typeof data0 == "object" && !Array.isArray(data0)){for(const key1 in data0){let data1 = data0[key1];if(data1 && typeof data1 == "object" && !Array.isArray(data1)){if(data1.author === undefined){const err2 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/APSPluginDefinition/required",keyword:"required",params:{missingProperty: "author"},message:"must have required property '"+"author"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data1.description === undefined){const err3 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/APSPluginDefinition/required",keyword:"required",params:{missingProperty: "description"},message:"must have required property '"+"description"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data1.id === undefined){const err4 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/APSPluginDefinition/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data1.name === undefined){const err5 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/APSPluginDefinition/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data1.repository === undefined){const err6 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/APSPluginDefinition/required",keyword:"required",params:{missingProperty: "repository"},message:"must have required property '"+"repository"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}for(const key2 in data1){if(!((((((key2 === "author") || (key2 === "description")) || (key2 === "homepage")) || (key2 === "id")) || (key2 === "name")) || (key2 === "repository"))){const err7 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/APSPluginDefinition/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data1.author !== undefined){if(typeof data1.author !== "string"){const err8 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/author",schemaPath:"#/definitions/APSPluginDefinition/properties/author/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data1.description !== undefined){if(typeof data1.description !== "string"){const err9 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/description",schemaPath:"#/definitions/APSPluginDefinition/properties/description/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data1.homepage !== undefined){if(typeof data1.homepage !== "string"){const err10 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/homepage",schemaPath:"#/definitions/APSPluginDefinition/properties/homepage/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data1.id !== undefined){if(typeof data1.id !== "string"){const err11 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/id",schemaPath:"#/definitions/APSPluginDefinition/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data1.name !== undefined){if(typeof data1.name !== "string"){const err12 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/name",schemaPath:"#/definitions/APSPluginDefinition/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data1.repository !== undefined){if(typeof data1.repository !== "string"){const err13 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1")+"/repository",schemaPath:"#/definitions/APSPluginDefinition/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath:instancePath+"/plugins/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/APSPluginDefinition/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}}else {const err15 = {instancePath:instancePath+"/plugins",schemaPath:"#/properties/plugins/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}validate20.errors = vErrors;return errors === 0;}