diff --git a/package.json b/package.json index 1861724c4ec2..68f0aec63fd1 100644 --- a/package.json +++ b/package.json @@ -172,7 +172,8 @@ ], "nohoist": [ "husky", - "run-node" + "run-node", + "**/ajv-cli" ] }, "private": true, diff --git a/packages/netlify-cms-core/configSchema.json b/packages/netlify-cms-core/configSchema.json new file mode 100644 index 000000000000..e073edd1b65f --- /dev/null +++ b/packages/netlify-cms-core/configSchema.json @@ -0,0 +1,341 @@ +{ + "type": "object", + "properties": { + "backend": { + "type": "object", + "properties": { + "name": { "type": "string", "examples": ["test-repo"] }, + "auth_scope": { + "type": "string", + "examples": ["repo", "public_repo"], + "enum": ["repo", "public_repo"] + }, + "cms_label_prefix": { "type": "string", "minLength": 1 }, + "open_authoring": { "type": "boolean", "examples": [true] } + }, + "required": ["name"] + }, + "local_backend": { + "oneOf": [ + { "type": "boolean" }, + { + "type": "object", + "properties": { + "url": { "type": "string", "examples": ["http://localhost:8081/api/v1"] }, + "allowed_hosts": { "type": "array", "items": { "type": "string" } } + }, + "additionalProperties": false + } + ] + }, + "locale": { "type": "string", "examples": ["en", "fr", "de"] }, + "i18n": { + "type": "object", + "properties": { + "structure": { + "type": "string", + "enum": ["multiple_folders", "multiple_files", "single_file"] + }, + "locales": { + "type": "array", + "minItems": 2, + "items": { + "type": "string", + "minLength": 2, + "maxLength": 10, + "pattern": "^[a-zA-Z-_]+$" + }, + "uniqueItems": true + }, + "default_locale": { + "type": "string", + "minLength": 2, + "maxLength": 10, + "pattern": "^[a-zA-Z-_]+$" + } + }, + "required": ["structure", "locales"] + }, + "site_url": { "type": "string", "examples": ["https://example.com"] }, + "display_url": { "type": "string", "examples": ["https://example.com"] }, + "logo_url": { "type": "string", "examples": ["https://example.com/images/logo.svg"] }, + "show_preview_links": { "type": "boolean" }, + "media_folder": { "type": "string", "examples": ["assets/uploads"] }, + "public_folder": { "type": "string", "examples": ["/uploads"] }, + "media_folder_relative": { "type": "boolean" }, + "media_library": { + "type": "object", + "properties": { + "name": { "type": "string", "examples": ["uploadcare"] }, + "config": { "type": "object" } + }, + "required": ["name"] + }, + "publish_mode": { + "type": "string", + "enum": ["simple", "editorial_workflow"], + "examples": ["editorial_workflow"] + }, + "slug": { + "type": "object", + "properties": { + "encoding": { "type": "string", "enum": ["unicode", "ascii"] }, + "clean_accents": { "type": "boolean" } + } + }, + "collections": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "label": { "type": "string" }, + "label_singular": { "type": "string" }, + "description": { "type": "string" }, + "folder": { "type": "string" }, + "files": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "label": { "type": "string" }, + "label_singular": { "type": "string" }, + "description": { "type": "string" }, + "file": { "type": "string" }, + "preview_path": { "type": "string" }, + "preview_path_date_field": { "type": "string" }, + "fields": { + "$id": "fields_478f58a3-0939-44d3-824b-42f1c0aa4f89", + "type": "array", + "minItems": 1, + "items": { + "$id": "field_478f58a3-0939-44d3-824b-42f1c0aa4f89", + "type": "object", + "properties": { + "name": { "type": "string" }, + "label": { "type": "string" }, + "widget": { "type": "string" }, + "required": { "type": "boolean" }, + "i18n": { + "oneOf": [ + { "type": "boolean" }, + { "type": "string", "enum": ["translate", "duplicate", "none"] } + ] + }, + "hint": { "type": "string" }, + "pattern": { + "type": "array", + "minItems": 2, + "items": [ + { "oneOf": [{ "type": "string" }] }, + { "type": "string" } + ] + }, + "field": { "$ref": "field_478f58a3-0939-44d3-824b-42f1c0aa4f89" }, + "fields": { "$ref": "fields_478f58a3-0939-44d3-824b-42f1c0aa4f89" }, + "types": { "$ref": "fields_478f58a3-0939-44d3-824b-42f1c0aa4f89" } + }, + "select": { "$data": "0/widget" }, + "selectCases": { + "relation": { + "properties": { + "search_fields": { "type": "array", "items": { "type": "string" } }, + "display_fields": { "type": "array", "items": { "type": "string" } } + } + } + }, + "required": ["name"] + } + } + }, + "required": ["name", "label", "file", "fields"] + } + }, + "identifier_field": { "type": "string" }, + "summary": { "type": "string" }, + "slug": { "type": "string" }, + "path": { "type": "string" }, + "preview_path": { "type": "string" }, + "preview_path_date_field": { "type": "string" }, + "create": { "type": "boolean" }, + "publish": { "type": "boolean" }, + "hide": { "type": "boolean" }, + "editor": { "type": "object", "properties": { "preview": { "type": "boolean" } } }, + "format": { + "type": "string", + "enum": [ + "yml", + "yaml", + "toml", + "json", + "frontmatter", + "json-frontmatter", + "toml-frontmatter", + "yaml-frontmatter" + ] + }, + "extension": { "type": "string" }, + "frontmatter_delimiter": { + "type": ["string", "array"], + "minItems": 2, + "maxItems": 2, + "items": { "type": "string" } + }, + "fields": { + "$id": "fields_135af09a-7035-4830-8ed7-260197843a0b", + "type": "array", + "minItems": 1, + "items": { + "$id": "field_135af09a-7035-4830-8ed7-260197843a0b", + "type": "object", + "properties": { + "name": { "type": "string" }, + "label": { "type": "string" }, + "widget": { "type": "string" }, + "required": { "type": "boolean" }, + "i18n": { + "oneOf": [ + { "type": "boolean" }, + { "type": "string", "enum": ["translate", "duplicate", "none"] } + ] + }, + "hint": { "type": "string" }, + "pattern": { + "type": "array", + "minItems": 2, + "items": [ + { "oneOf": [{ "type": "string" }] }, + { "type": "string" } + ] + }, + "field": { "$ref": "field_135af09a-7035-4830-8ed7-260197843a0b" }, + "fields": { "$ref": "fields_135af09a-7035-4830-8ed7-260197843a0b" }, + "types": { "$ref": "fields_135af09a-7035-4830-8ed7-260197843a0b" } + }, + "select": { "$data": "0/widget" }, + "selectCases": { + "relation": { + "properties": { + "search_fields": { "type": "array", "items": { "type": "string" } }, + "display_fields": { "type": "array", "items": { "type": "string" } } + } + } + }, + "required": ["name"] + } + }, + "sortable_fields": { "type": "array", "items": { "type": "string" } }, + "sortableFields": { "type": "array", "items": { "type": "string" } }, + "view_filters": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "label": { "type": "string" }, + "field": { "type": "string" }, + "pattern": { "oneOf": [{ "type": "boolean" }, { "type": "string" }] } + }, + "additionalProperties": false, + "required": ["label", "field", "pattern"] + } + }, + "view_groups": { + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "label": { "type": "string" }, + "field": { "type": "string" }, + "pattern": { "type": "string" } + }, + "additionalProperties": false, + "required": ["label", "field"] + } + }, + "nested": { + "type": "object", + "properties": { + "depth": { "type": "number", "minimum": 1, "maximum": 1000 }, + "summary": { "type": "string" } + }, + "required": ["depth"] + }, + "meta": { + "type": "object", + "properties": { + "path": { + "type": "object", + "properties": { + "label": { "type": "string" }, + "widget": { "type": "string" }, + "index_file": { "type": "string" } + }, + "required": ["label", "widget", "index_file"] + } + }, + "additionalProperties": false, + "minProperties": 1 + }, + "i18n": { + "oneOf": [ + { "type": "boolean" }, + { + "type": "object", + "properties": { + "structure": { + "type": "string", + "enum": ["multiple_folders", "multiple_files", "single_file"] + }, + "locales": { + "type": "array", + "minItems": 2, + "items": { + "type": "string", + "minLength": 2, + "maxLength": 10, + "pattern": "^[a-zA-Z-_]+$" + }, + "uniqueItems": true + }, + "default_locale": { + "type": "string", + "minLength": 2, + "maxLength": 10, + "pattern": "^[a-zA-Z-_]+$" + } + } + } + ] + } + }, + "required": ["name", "label"], + "oneOf": [{ "required": ["files"] }, { "required": ["folder", "fields"] }], + "not": { "required": ["sortable_fields", "sortableFields"] }, + "if": { "required": ["extension"] }, + "then": { + "if": { + "properties": { + "extension": { "enum": ["yml", "yaml", "toml", "json", "md", "markdown", "html"] } + } + }, + "else": { "required": ["format"] } + }, + "dependencies": { + "frontmatter_delimiter": { + "properties": { + "format": { "enum": ["yaml-frontmatter", "toml-frontmatter", "json-frontmatter"] } + }, + "required": ["format"] + } + } + } + }, + "editor": { "type": "object", "properties": { "preview": { "type": "boolean" } } } + }, + "required": ["backend", "collections"], + "anyOf": [{ "required": ["media_folder"] }, { "required": ["media_library"] }] +} diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index 35d1140fcc58..143664eac9f1 100644 --- a/packages/netlify-cms-core/package.json +++ b/packages/netlify-cms-core/package.json @@ -16,7 +16,8 @@ "develop": "yarn build:esm --watch", "webpack": "node --max_old_space_size=4096 ../../node_modules/webpack/bin/webpack.js", "build": "cross-env NODE_ENV=production run-s webpack", - "build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore \"**/__tests__\" --root-mode upward --extensions \".js,.jsx,.ts,.tsx\"" + "build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore \"**/__tests__\" --root-mode upward --extensions \".js,.jsx,.ts,.tsx\"", + "generate-validate": "ajv compile --strict=false --all-errors --data -s configSchema.json -o src/constants/validateSchema.js -c ajv-keywords -c ajv-errors" }, "keywords": [ "netlify", @@ -26,7 +27,7 @@ "license": "MIT", "dependencies": { "@iarna/toml": "2.2.5", - "ajv": "8.1.0", + "ajv": "^8.7.1", "ajv-errors": "^3.0.0", "ajv-keywords": "^5.0.0", "copy-text-to-clipboard": "^3.0.0", @@ -94,6 +95,7 @@ "@types/history": "^4.7.8", "@types/redux-mock-store": "^1.0.2", "@types/url-join": "^4.0.0", + "ajv-cli": "^5.0.0", "redux-mock-store": "^1.5.3" } } diff --git a/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js b/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js index 117e7f09e1d1..2a3251c2660f 100644 --- a/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js +++ b/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js @@ -1,6 +1,7 @@ import { merge } from 'lodash'; +import { writeFileSync } from 'fs'; -import { validateConfig } from '../configSchema'; +import { validateConfig, getConfigSchema } from '../configSchema'; jest.mock('../../lib/registry'); @@ -16,6 +17,19 @@ describe('config', () => { const { getWidgets } = require('../../lib/registry'); getWidgets.mockImplementation(() => [{}]); + // describe('serialize', () => { + // let schema = undefined; + + // beforeEach(() => { + // schema = JSON.stringify(getConfigSchema()); + // writeFileSync('config-schema.json', schema, 'utf8'); + // }); + + // it('has a string value', () => { + // expect(schema).toBeInstanceOf(String); + // }); + // }); + describe('validateConfig', () => { const validConfig = { foo: 'bar', diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index 31e3711f8745..24ca4df26830 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -11,6 +11,7 @@ import uuid from 'uuid/v4'; import { formatExtensions, frontmatterFormats, extensionFormatters } from '../formats/formats'; import { getWidgets } from '../lib/registry'; import { I18N_STRUCTURE, I18N_FIELD } from '../lib/i18n'; +import validateSchema from './validateSchema'; const localeType = { type: 'string', minLength: 2, maxLength: 10, pattern: '^[a-zA-Z-_]+$' }; @@ -354,16 +355,9 @@ class ConfigError extends Error { * the config that is passed in. */ export function validateConfig(config) { - const ajv = new AJV({ allErrors: true, $data: true, strict: false }); - uniqueItemProperties(ajv); - select(ajv); - instanceOf(ajv); - prohibited(ajv); - ajvErrors(ajv); - - const valid = ajv.validate(getConfigSchema(), config); + const valid = validateSchema(config); if (!valid) { - const errors = ajv.errors.map(e => { + const errors = validateSchema.errors.map(e => { switch (e.keyword) { // TODO: remove after https://github.com/ajv-validator/ajv-keywords/pull/123 is merged case 'uniqueItemProperties': { diff --git a/packages/netlify-cms-core/src/constants/validateSchema.js b/packages/netlify-cms-core/src/constants/validateSchema.js new file mode 100644 index 000000000000..7a868102c9d9 --- /dev/null +++ b/packages/netlify-cms-core/src/constants/validateSchema.js @@ -0,0 +1 @@ +"use strict";module.exports = validate43;module.exports.default = validate43;const schema59 = {"type":"object","properties":{"backend":{"type":"object","properties":{"name":{"type":"string","examples":["test-repo"]},"auth_scope":{"type":"string","examples":["repo","public_repo"],"enum":["repo","public_repo"]},"cms_label_prefix":{"type":"string","minLength":1},"open_authoring":{"type":"boolean","examples":[true]}},"required":["name"]},"local_backend":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"url":{"type":"string","examples":["http://localhost:8081/api/v1"]},"allowed_hosts":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}]},"locale":{"type":"string","examples":["en","fr","de"]},"i18n":{"type":"object","properties":{"structure":{"type":"string","enum":["multiple_folders","multiple_files","single_file"]},"locales":{"type":"array","minItems":2,"items":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[a-zA-Z-_]+$"},"uniqueItems":true},"default_locale":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[a-zA-Z-_]+$"}},"required":["structure","locales"]},"site_url":{"type":"string","examples":["https://example.com"]},"display_url":{"type":"string","examples":["https://example.com"]},"logo_url":{"type":"string","examples":["https://example.com/images/logo.svg"]},"show_preview_links":{"type":"boolean"},"media_folder":{"type":"string","examples":["assets/uploads"]},"public_folder":{"type":"string","examples":["/uploads"]},"media_folder_relative":{"type":"boolean"},"media_library":{"type":"object","properties":{"name":{"type":"string","examples":["uploadcare"]},"config":{"type":"object"}},"required":["name"]},"publish_mode":{"type":"string","enum":["simple","editorial_workflow"],"examples":["editorial_workflow"]},"slug":{"type":"object","properties":{"encoding":{"type":"string","enum":["unicode","ascii"]},"clean_accents":{"type":"boolean"}}},"collections":{"type":"array","minItems":1,"items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"label_singular":{"type":"string"},"description":{"type":"string"},"folder":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"label_singular":{"type":"string"},"description":{"type":"string"},"file":{"type":"string"},"preview_path":{"type":"string"},"preview_path_date_field":{"type":"string"},"fields":{"$id":"fields_478f58a3-0939-44d3-824b-42f1c0aa4f89","type":"array","minItems":1,"items":{"$id":"field_478f58a3-0939-44d3-824b-42f1c0aa4f89","type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"widget":{"type":"string"},"required":{"type":"boolean"},"i18n":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["translate","duplicate","none"]}]},"hint":{"type":"string"},"pattern":{"type":"array","minItems":2,"items":[{"oneOf":[{"type":"string"}]},{"type":"string"}]},"field":{"$ref":"field_478f58a3-0939-44d3-824b-42f1c0aa4f89"},"fields":{"$ref":"fields_478f58a3-0939-44d3-824b-42f1c0aa4f89"},"types":{"$ref":"fields_478f58a3-0939-44d3-824b-42f1c0aa4f89"}},"select":{"$data":"0/widget"},"selectCases":{"relation":{"properties":{"search_fields":{"type":"array","items":{"type":"string"}},"display_fields":{"type":"array","items":{"type":"string"}}}}},"required":["name"]}}},"required":["name","label","file","fields"]}},"identifier_field":{"type":"string"},"summary":{"type":"string"},"slug":{"type":"string"},"path":{"type":"string"},"preview_path":{"type":"string"},"preview_path_date_field":{"type":"string"},"create":{"type":"boolean"},"publish":{"type":"boolean"},"hide":{"type":"boolean"},"editor":{"type":"object","properties":{"preview":{"type":"boolean"}}},"format":{"type":"string","enum":["yml","yaml","toml","json","frontmatter","json-frontmatter","toml-frontmatter","yaml-frontmatter"]},"extension":{"type":"string"},"frontmatter_delimiter":{"type":["string","array"],"minItems":2,"maxItems":2,"items":{"type":"string"}},"fields":{"$id":"fields_135af09a-7035-4830-8ed7-260197843a0b","type":"array","minItems":1,"items":{"$id":"field_135af09a-7035-4830-8ed7-260197843a0b","type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"widget":{"type":"string"},"required":{"type":"boolean"},"i18n":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["translate","duplicate","none"]}]},"hint":{"type":"string"},"pattern":{"type":"array","minItems":2,"items":[{"oneOf":[{"type":"string"}]},{"type":"string"}]},"field":{"$ref":"field_135af09a-7035-4830-8ed7-260197843a0b"},"fields":{"$ref":"fields_135af09a-7035-4830-8ed7-260197843a0b"},"types":{"$ref":"fields_135af09a-7035-4830-8ed7-260197843a0b"}},"select":{"$data":"0/widget"},"selectCases":{"relation":{"properties":{"search_fields":{"type":"array","items":{"type":"string"}},"display_fields":{"type":"array","items":{"type":"string"}}}}},"required":["name"]}},"sortable_fields":{"type":"array","items":{"type":"string"}},"sortableFields":{"type":"array","items":{"type":"string"}},"view_filters":{"type":"array","minItems":1,"items":{"type":"object","properties":{"label":{"type":"string"},"field":{"type":"string"},"pattern":{"oneOf":[{"type":"boolean"},{"type":"string"}]}},"additionalProperties":false,"required":["label","field","pattern"]}},"view_groups":{"type":"array","minItems":1,"items":{"type":"object","properties":{"label":{"type":"string"},"field":{"type":"string"},"pattern":{"type":"string"}},"additionalProperties":false,"required":["label","field"]}},"nested":{"type":"object","properties":{"depth":{"type":"number","minimum":1,"maximum":1000},"summary":{"type":"string"}},"required":["depth"]},"meta":{"type":"object","properties":{"path":{"type":"object","properties":{"label":{"type":"string"},"widget":{"type":"string"},"index_file":{"type":"string"}},"required":["label","widget","index_file"]}},"additionalProperties":false,"minProperties":1},"i18n":{"oneOf":[{"type":"boolean"},{"type":"object","properties":{"structure":{"type":"string","enum":["multiple_folders","multiple_files","single_file"]},"locales":{"type":"array","minItems":2,"items":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[a-zA-Z-_]+$"},"uniqueItems":true},"default_locale":{"type":"string","minLength":2,"maxLength":10,"pattern":"^[a-zA-Z-_]+$"}}}]}},"required":["name","label"],"oneOf":[{"required":["files"]},{"required":["folder","fields"]}],"not":{"required":["sortable_fields","sortableFields"]},"if":{"required":["extension"]},"then":{"if":{"properties":{"extension":{"enum":["yml","yaml","toml","json","md","markdown","html"]}}},"else":{"required":["format"]}},"dependencies":{"frontmatter_delimiter":{"properties":{"format":{"enum":["yaml-frontmatter","toml-frontmatter","json-frontmatter"]}},"required":["format"]}}}},"editor":{"type":"object","properties":{"preview":{"type":"boolean"}}}},"required":["backend","collections"],"anyOf":[{"required":["media_folder"]},{"required":["media_library"]}]};const func0 = require("ajv/dist/runtime/equal").default;const func12 = require("ajv/dist/runtime/ucs2length").default;const pattern0 = new RegExp("^[a-zA-Z-_]+$", "u");const schema60 = {"$id":"field_478f58a3-0939-44d3-824b-42f1c0aa4f89","type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"widget":{"type":"string"},"required":{"type":"boolean"},"i18n":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["translate","duplicate","none"]}]},"hint":{"type":"string"},"pattern":{"type":"array","minItems":2,"items":[{"oneOf":[{"type":"string"}]},{"type":"string"}]},"field":{"$ref":"field_478f58a3-0939-44d3-824b-42f1c0aa4f89"},"fields":{"$ref":"fields_478f58a3-0939-44d3-824b-42f1c0aa4f89"},"types":{"$ref":"fields_478f58a3-0939-44d3-824b-42f1c0aa4f89"}},"select":{"$data":"0/widget"},"selectCases":{"relation":{"properties":{"search_fields":{"type":"array","items":{"type":"string"}},"display_fields":{"type":"array","items":{"type":"string"}}}}},"required":["name"]};const wrapper0 = {validate: validate44};const schema61 = {"$id":"fields_478f58a3-0939-44d3-824b-42f1c0aa4f89","type":"array","minItems":1,"items":{"$id":"field_478f58a3-0939-44d3-824b-42f1c0aa4f89","type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"widget":{"type":"string"},"required":{"type":"boolean"},"i18n":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["translate","duplicate","none"]}]},"hint":{"type":"string"},"pattern":{"type":"array","minItems":2,"items":[{"oneOf":[{"type":"string"}]},{"type":"string"}]},"field":{"$ref":"field_478f58a3-0939-44d3-824b-42f1c0aa4f89"},"fields":{"$ref":"fields_478f58a3-0939-44d3-824b-42f1c0aa4f89"},"types":{"$ref":"fields_478f58a3-0939-44d3-824b-42f1c0aa4f89"}},"select":{"$data":"0/widget"},"selectCases":{"relation":{"properties":{"search_fields":{"type":"array","items":{"type":"string"}},"display_fields":{"type":"array","items":{"type":"string"}}}}},"required":["name"]}};const wrapper2 = {validate: validate45};function validate45(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="fields_478f58a3-0939-44d3-824b-42f1c0aa4f89" */;let vErrors = null;let errors = 0;if(Array.isArray(data)){if(data.length < 1){const err0 = {instancePath,schemaPath:"#/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0 0){const _errs32 = errors;let valid11 = false;let passing1 = null;const _errs33 = errors;if(typeof data11[0] !== "string"){const err18 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}var _valid2 = _errs33 === errors;if(_valid2){valid11 = true;passing1 = 0;}if(!valid11){const err19 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing1},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}else {errors = _errs32;if(vErrors !== null){if(_errs32){vErrors.length = _errs32;}else {vErrors = null;}}}}if(len3 > 1){if(typeof data11[1] !== "string"){const err20 = {instancePath:instancePath+"/" + i0+"/pattern/1",schemaPath:"#/items/properties/pattern/items/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}}else {const err21 = {instancePath:instancePath+"/" + i0+"/pattern",schemaPath:"#/items/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data0.field !== undefined){if(!(wrapper0.validate(data0.field, {instancePath:instancePath+"/" + i0+"/field",parentData:data0,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? wrapper0.validate.errors : vErrors.concat(wrapper0.validate.errors);errors = vErrors.length;}}if(data0.fields !== undefined){if(!(wrapper2.validate(data0.fields, {instancePath:instancePath+"/" + i0+"/fields",parentData:data0,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? wrapper2.validate.errors : vErrors.concat(wrapper2.validate.errors);errors = vErrors.length;}}if(data0.types !== undefined){if(!(wrapper2.validate(data0.types, {instancePath:instancePath+"/" + i0+"/types",parentData:data0,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? wrapper2.validate.errors : vErrors.concat(wrapper2.validate.errors);errors = vErrors.length;}}}else {const err22 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}}else {const err23 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}validate45.errors = vErrors;return errors === 0;}function validate44(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="field_478f58a3-0939-44d3-824b-42f1c0aa4f89" */;let vErrors = null;let errors = 0;const vSchema0 = data && data.widget;if(!(vSchema0 === undefined)){if((((typeof vSchema0 !== "string") && (!(typeof vSchema0 == "number"))) && (typeof vSchema0 !== "boolean")) && (vSchema0 !== null)){const err0 = {instancePath,schemaPath:"#/select",keyword:"select",params:{},message:"\"select\" keyword must be string,number,boolean,null ($data)"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {let valid0 = true;const value0 = vSchema0 === null ? "null" : vSchema0;if("" + value0 == "relation"){const _errs1 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.search_fields !== undefined){let data0 = data.search_fields;if(Array.isArray(data0)){const len0 = data0.length;for(let i0=0; i0 0){const _errs30 = errors;let valid9 = false;let passing1 = null;const _errs31 = errors;if(typeof data10[0] !== "string"){const err17 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}var _valid2 = _errs31 === errors;if(_valid2){valid9 = true;passing1 = 0;}if(!valid9){const err18 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing1},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}}if(len2 > 1){if(typeof data10[1] !== "string"){const err19 = {instancePath:instancePath+"/pattern/1",schemaPath:"#/properties/pattern/items/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}}else {const err20 = {instancePath:instancePath+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.field !== undefined){if(!(wrapper0.validate(data.field, {instancePath:instancePath+"/field",parentData:data,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? wrapper0.validate.errors : vErrors.concat(wrapper0.validate.errors);errors = vErrors.length;}}if(data.fields !== undefined){if(!(validate45(data.fields, {instancePath:instancePath+"/fields",parentData:data,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);errors = vErrors.length;}}if(data.types !== undefined){if(!(validate45(data.types, {instancePath:instancePath+"/types",parentData:data,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);errors = vErrors.length;}}}else {const err21 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}validate44.errors = vErrors;return errors === 0;}const schema62 = {"$id":"field_135af09a-7035-4830-8ed7-260197843a0b","type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"widget":{"type":"string"},"required":{"type":"boolean"},"i18n":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["translate","duplicate","none"]}]},"hint":{"type":"string"},"pattern":{"type":"array","minItems":2,"items":[{"oneOf":[{"type":"string"}]},{"type":"string"}]},"field":{"$ref":"field_135af09a-7035-4830-8ed7-260197843a0b"},"fields":{"$ref":"fields_135af09a-7035-4830-8ed7-260197843a0b"},"types":{"$ref":"fields_135af09a-7035-4830-8ed7-260197843a0b"}},"select":{"$data":"0/widget"},"selectCases":{"relation":{"properties":{"search_fields":{"type":"array","items":{"type":"string"}},"display_fields":{"type":"array","items":{"type":"string"}}}}},"required":["name"]};const wrapper4 = {validate: validate51};const schema63 = {"$id":"fields_135af09a-7035-4830-8ed7-260197843a0b","type":"array","minItems":1,"items":{"$id":"field_135af09a-7035-4830-8ed7-260197843a0b","type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"widget":{"type":"string"},"required":{"type":"boolean"},"i18n":{"oneOf":[{"type":"boolean"},{"type":"string","enum":["translate","duplicate","none"]}]},"hint":{"type":"string"},"pattern":{"type":"array","minItems":2,"items":[{"oneOf":[{"type":"string"}]},{"type":"string"}]},"field":{"$ref":"field_135af09a-7035-4830-8ed7-260197843a0b"},"fields":{"$ref":"fields_135af09a-7035-4830-8ed7-260197843a0b"},"types":{"$ref":"fields_135af09a-7035-4830-8ed7-260197843a0b"}},"select":{"$data":"0/widget"},"selectCases":{"relation":{"properties":{"search_fields":{"type":"array","items":{"type":"string"}},"display_fields":{"type":"array","items":{"type":"string"}}}}},"required":["name"]}};const wrapper6 = {validate: validate52};function validate52(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="fields_135af09a-7035-4830-8ed7-260197843a0b" */;let vErrors = null;let errors = 0;if(Array.isArray(data)){if(data.length < 1){const err0 = {instancePath,schemaPath:"#/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}const len0 = data.length;for(let i0=0; i0 0){const _errs32 = errors;let valid11 = false;let passing1 = null;const _errs33 = errors;if(typeof data11[0] !== "string"){const err18 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}var _valid2 = _errs33 === errors;if(_valid2){valid11 = true;passing1 = 0;}if(!valid11){const err19 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing1},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}else {errors = _errs32;if(vErrors !== null){if(_errs32){vErrors.length = _errs32;}else {vErrors = null;}}}}if(len3 > 1){if(typeof data11[1] !== "string"){const err20 = {instancePath:instancePath+"/" + i0+"/pattern/1",schemaPath:"#/items/properties/pattern/items/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}}else {const err21 = {instancePath:instancePath+"/" + i0+"/pattern",schemaPath:"#/items/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data0.field !== undefined){if(!(wrapper4.validate(data0.field, {instancePath:instancePath+"/" + i0+"/field",parentData:data0,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? wrapper4.validate.errors : vErrors.concat(wrapper4.validate.errors);errors = vErrors.length;}}if(data0.fields !== undefined){if(!(wrapper6.validate(data0.fields, {instancePath:instancePath+"/" + i0+"/fields",parentData:data0,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? wrapper6.validate.errors : vErrors.concat(wrapper6.validate.errors);errors = vErrors.length;}}if(data0.types !== undefined){if(!(wrapper6.validate(data0.types, {instancePath:instancePath+"/" + i0+"/types",parentData:data0,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? wrapper6.validate.errors : vErrors.concat(wrapper6.validate.errors);errors = vErrors.length;}}}else {const err22 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}}else {const err23 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}validate52.errors = vErrors;return errors === 0;}function validate51(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="field_135af09a-7035-4830-8ed7-260197843a0b" */;let vErrors = null;let errors = 0;const vSchema0 = data && data.widget;if(!(vSchema0 === undefined)){if((((typeof vSchema0 !== "string") && (!(typeof vSchema0 == "number"))) && (typeof vSchema0 !== "boolean")) && (vSchema0 !== null)){const err0 = {instancePath,schemaPath:"#/select",keyword:"select",params:{},message:"\"select\" keyword must be string,number,boolean,null ($data)"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {let valid0 = true;const value0 = vSchema0 === null ? "null" : vSchema0;if("" + value0 == "relation"){const _errs1 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.search_fields !== undefined){let data0 = data.search_fields;if(Array.isArray(data0)){const len0 = data0.length;for(let i0=0; i0 0){const _errs30 = errors;let valid9 = false;let passing1 = null;const _errs31 = errors;if(typeof data10[0] !== "string"){const err17 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}var _valid2 = _errs31 === errors;if(_valid2){valid9 = true;passing1 = 0;}if(!valid9){const err18 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing1},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}else {errors = _errs30;if(vErrors !== null){if(_errs30){vErrors.length = _errs30;}else {vErrors = null;}}}}if(len2 > 1){if(typeof data10[1] !== "string"){const err19 = {instancePath:instancePath+"/pattern/1",schemaPath:"#/properties/pattern/items/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}}else {const err20 = {instancePath:instancePath+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.field !== undefined){if(!(wrapper4.validate(data.field, {instancePath:instancePath+"/field",parentData:data,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? wrapper4.validate.errors : vErrors.concat(wrapper4.validate.errors);errors = vErrors.length;}}if(data.fields !== undefined){if(!(validate52(data.fields, {instancePath:instancePath+"/fields",parentData:data,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate52.errors : vErrors.concat(validate52.errors);errors = vErrors.length;}}if(data.types !== undefined){if(!(validate52(data.types, {instancePath:instancePath+"/types",parentData:data,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate52.errors : vErrors.concat(validate52.errors);errors = vErrors.length;}}}else {const err21 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}validate51.errors = vErrors;return errors === 0;}function validate43(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;const _errs1 = errors;let valid0 = false;const _errs2 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.media_folder === undefined){const err0 = {instancePath,schemaPath:"#/anyOf/0/required",keyword:"required",params:{missingProperty: "media_folder"},message:"must have required property '"+"media_folder"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}var _valid0 = _errs2 === errors;valid0 = valid0 || _valid0;if(!valid0){const _errs3 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.media_library === undefined){const err1 = {instancePath,schemaPath:"#/anyOf/1/required",keyword:"required",params:{missingProperty: "media_library"},message:"must have required property '"+"media_library"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var _valid0 = _errs3 === errors;valid0 = valid0 || _valid0;}if(!valid0){const err2 = {instancePath,schemaPath:"#/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}}if(data && typeof data == "object" && !Array.isArray(data)){if(data.backend === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "backend"},message:"must have required property '"+"backend"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.collections === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "collections"},message:"must have required property '"+"collections"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.backend !== undefined){let data0 = data.backend;if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.name === undefined){const err5 = {instancePath:instancePath+"/backend",schemaPath:"#/properties/backend/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data0.name !== undefined){if(typeof data0.name !== "string"){const err6 = {instancePath:instancePath+"/backend/name",schemaPath:"#/properties/backend/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.auth_scope !== undefined){let data2 = data0.auth_scope;if(typeof data2 !== "string"){const err7 = {instancePath:instancePath+"/backend/auth_scope",schemaPath:"#/properties/backend/properties/auth_scope/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(!((data2 === "repo") || (data2 === "public_repo"))){const err8 = {instancePath:instancePath+"/backend/auth_scope",schemaPath:"#/properties/backend/properties/auth_scope/enum",keyword:"enum",params:{allowedValues: schema59.properties.backend.properties.auth_scope.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data0.cms_label_prefix !== undefined){let data3 = data0.cms_label_prefix;if(typeof data3 === "string"){if(func12(data3) < 1){const err9 = {instancePath:instancePath+"/backend/cms_label_prefix",schemaPath:"#/properties/backend/properties/cms_label_prefix/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/backend/cms_label_prefix",schemaPath:"#/properties/backend/properties/cms_label_prefix/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data0.open_authoring !== undefined){if(typeof data0.open_authoring !== "boolean"){const err11 = {instancePath:instancePath+"/backend/open_authoring",schemaPath:"#/properties/backend/properties/open_authoring/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {instancePath:instancePath+"/backend",schemaPath:"#/properties/backend/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.local_backend !== undefined){let data5 = data.local_backend;const _errs15 = errors;let valid3 = false;let passing0 = null;const _errs16 = errors;if(typeof data5 !== "boolean"){const err13 = {instancePath:instancePath+"/local_backend",schemaPath:"#/properties/local_backend/oneOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}var _valid1 = _errs16 === errors;if(_valid1){valid3 = true;passing0 = 0;}const _errs18 = errors;if(data5 && typeof data5 == "object" && !Array.isArray(data5)){for(const key0 in data5){if(!((key0 === "url") || (key0 === "allowed_hosts"))){const err14 = {instancePath:instancePath+"/local_backend",schemaPath:"#/properties/local_backend/oneOf/1/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data5.url !== undefined){if(typeof data5.url !== "string"){const err15 = {instancePath:instancePath+"/local_backend/url",schemaPath:"#/properties/local_backend/oneOf/1/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data5.allowed_hosts !== undefined){let data7 = data5.allowed_hosts;if(Array.isArray(data7)){const len0 = data7.length;for(let i0=0; i0 10){const err26 = {instancePath:instancePath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/maxLength",keyword:"maxLength",params:{limit: 10},message:"must NOT have more than 10 characters"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(func12(data13) < 2){const err27 = {instancePath:instancePath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/minLength",keyword:"minLength",params:{limit: 2},message:"must NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(!pattern0.test(data13)){const err28 = {instancePath:instancePath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"must match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}else {const err29 = {instancePath:instancePath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}let i2 = data12.length;let j0;if(i2 > 1){const indices0 = {};for(;i2--;){let item0 = data12[i2];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j0 = indices0[item0];const err30 = {instancePath:instancePath+"/i18n/locales",schemaPath:"#/properties/i18n/properties/locales/uniqueItems",keyword:"uniqueItems",params:{i: i2, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i2+" are identical)"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;break;}indices0[item0] = i2;}}}else {const err31 = {instancePath:instancePath+"/i18n/locales",schemaPath:"#/properties/i18n/properties/locales/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data10.default_locale !== undefined){let data14 = data10.default_locale;if(typeof data14 === "string"){if(func12(data14) > 10){const err32 = {instancePath:instancePath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/maxLength",keyword:"maxLength",params:{limit: 10},message:"must NOT have more than 10 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(func12(data14) < 2){const err33 = {instancePath:instancePath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/minLength",keyword:"minLength",params:{limit: 2},message:"must NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}if(!pattern0.test(data14)){const err34 = {instancePath:instancePath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"must match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}else {const err35 = {instancePath:instancePath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}}else {const err36 = {instancePath:instancePath+"/i18n",schemaPath:"#/properties/i18n/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}if(data.site_url !== undefined){if(typeof data.site_url !== "string"){const err37 = {instancePath:instancePath+"/site_url",schemaPath:"#/properties/site_url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.display_url !== undefined){if(typeof data.display_url !== "string"){const err38 = {instancePath:instancePath+"/display_url",schemaPath:"#/properties/display_url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data.logo_url !== undefined){if(typeof data.logo_url !== "string"){const err39 = {instancePath:instancePath+"/logo_url",schemaPath:"#/properties/logo_url/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}if(data.show_preview_links !== undefined){if(typeof data.show_preview_links !== "boolean"){const err40 = {instancePath:instancePath+"/show_preview_links",schemaPath:"#/properties/show_preview_links/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}if(data.media_folder !== undefined){if(typeof data.media_folder !== "string"){const err41 = {instancePath:instancePath+"/media_folder",schemaPath:"#/properties/media_folder/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data.public_folder !== undefined){if(typeof data.public_folder !== "string"){const err42 = {instancePath:instancePath+"/public_folder",schemaPath:"#/properties/public_folder/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data.media_folder_relative !== undefined){if(typeof data.media_folder_relative !== "boolean"){const err43 = {instancePath:instancePath+"/media_folder_relative",schemaPath:"#/properties/media_folder_relative/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}if(data.media_library !== undefined){let data22 = data.media_library;if(data22 && typeof data22 == "object" && !Array.isArray(data22)){if(data22.name === undefined){const err44 = {instancePath:instancePath+"/media_library",schemaPath:"#/properties/media_library/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}if(data22.name !== undefined){if(typeof data22.name !== "string"){const err45 = {instancePath:instancePath+"/media_library/name",schemaPath:"#/properties/media_library/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data22.config !== undefined){let data24 = data22.config;if(!(data24 && typeof data24 == "object" && !Array.isArray(data24))){const err46 = {instancePath:instancePath+"/media_library/config",schemaPath:"#/properties/media_library/properties/config/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}}else {const err47 = {instancePath:instancePath+"/media_library",schemaPath:"#/properties/media_library/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}if(data.publish_mode !== undefined){let data25 = data.publish_mode;if(typeof data25 !== "string"){const err48 = {instancePath:instancePath+"/publish_mode",schemaPath:"#/properties/publish_mode/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}if(!((data25 === "simple") || (data25 === "editorial_workflow"))){const err49 = {instancePath:instancePath+"/publish_mode",schemaPath:"#/properties/publish_mode/enum",keyword:"enum",params:{allowedValues: schema59.properties.publish_mode.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data.slug !== undefined){let data26 = data.slug;if(data26 && typeof data26 == "object" && !Array.isArray(data26)){if(data26.encoding !== undefined){let data27 = data26.encoding;if(typeof data27 !== "string"){const err50 = {instancePath:instancePath+"/slug/encoding",schemaPath:"#/properties/slug/properties/encoding/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}if(!((data27 === "unicode") || (data27 === "ascii"))){const err51 = {instancePath:instancePath+"/slug/encoding",schemaPath:"#/properties/slug/properties/encoding/enum",keyword:"enum",params:{allowedValues: schema59.properties.slug.properties.encoding.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}if(data26.clean_accents !== undefined){if(typeof data26.clean_accents !== "boolean"){const err52 = {instancePath:instancePath+"/slug/clean_accents",schemaPath:"#/properties/slug/properties/clean_accents/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}}else {const err53 = {instancePath:instancePath+"/slug",schemaPath:"#/properties/slug/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}if(data.collections !== undefined){let data29 = data.collections;if(Array.isArray(data29)){if(data29.length < 1){const err54 = {instancePath:instancePath+"/collections",schemaPath:"#/properties/collections/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}const len2 = data29.length;for(let i3=0; i3 0){const _errs146 = errors;let valid37 = false;let passing3 = null;const _errs147 = errors;if(typeof data59[0] !== "string"){const err104 = {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/pattern/0",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}var _valid7 = _errs147 === errors;if(_valid7){valid37 = true;passing3 = 0;}if(!valid37){const err105 = {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/pattern/0",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing3},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}else {errors = _errs146;if(vErrors !== null){if(_errs146){vErrors.length = _errs146;}else {vErrors = null;}}}}if(len7 > 1){if(typeof data59[1] !== "string"){const err106 = {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/pattern/1",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}}else {const err107 = {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/pattern",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}if(data48.field !== undefined){if(!(validate44(data48.field, {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/field",parentData:data48,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? validate44.errors : vErrors.concat(validate44.errors);errors = vErrors.length;}}if(data48.fields !== undefined){if(!(validate45(data48.fields, {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/fields",parentData:data48,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);errors = vErrors.length;}}if(data48.types !== undefined){if(!(validate45(data48.types, {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/types",parentData:data48,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);errors = vErrors.length;}}}else {const err108 = {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5,schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}}else {const err109 = {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}}else {const err110 = {instancePath:instancePath+"/collections/" + i3+"/files/" + i4,schemaPath:"#/properties/collections/items/properties/files/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}}else {const err111 = {instancePath:instancePath+"/collections/" + i3+"/files",schemaPath:"#/properties/collections/items/properties/files/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}if(data30.identifier_field !== undefined){if(typeof data30.identifier_field !== "string"){const err112 = {instancePath:instancePath+"/collections/" + i3+"/identifier_field",schemaPath:"#/properties/collections/items/properties/identifier_field/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}if(data30.summary !== undefined){if(typeof data30.summary !== "string"){const err113 = {instancePath:instancePath+"/collections/" + i3+"/summary",schemaPath:"#/properties/collections/items/properties/summary/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(data30.slug !== undefined){if(typeof data30.slug !== "string"){const err114 = {instancePath:instancePath+"/collections/" + i3+"/slug",schemaPath:"#/properties/collections/items/properties/slug/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}if(data30.path !== undefined){if(typeof data30.path !== "string"){const err115 = {instancePath:instancePath+"/collections/" + i3+"/path",schemaPath:"#/properties/collections/items/properties/path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}if(data30.preview_path !== undefined){if(typeof data30.preview_path !== "string"){const err116 = {instancePath:instancePath+"/collections/" + i3+"/preview_path",schemaPath:"#/properties/collections/items/properties/preview_path/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data30.preview_path_date_field !== undefined){if(typeof data30.preview_path_date_field !== "string"){const err117 = {instancePath:instancePath+"/collections/" + i3+"/preview_path_date_field",schemaPath:"#/properties/collections/items/properties/preview_path_date_field/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}if(data30.create !== undefined){if(typeof data30.create !== "boolean"){const err118 = {instancePath:instancePath+"/collections/" + i3+"/create",schemaPath:"#/properties/collections/items/properties/create/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data30.publish !== undefined){if(typeof data30.publish !== "boolean"){const err119 = {instancePath:instancePath+"/collections/" + i3+"/publish",schemaPath:"#/properties/collections/items/properties/publish/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}if(data30.hide !== undefined){if(typeof data30.hide !== "boolean"){const err120 = {instancePath:instancePath+"/collections/" + i3+"/hide",schemaPath:"#/properties/collections/items/properties/hide/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}}if(data30.editor !== undefined){let data74 = data30.editor;if(data74 && typeof data74 == "object" && !Array.isArray(data74)){if(data74.preview !== undefined){if(typeof data74.preview !== "boolean"){const err121 = {instancePath:instancePath+"/collections/" + i3+"/editor/preview",schemaPath:"#/properties/collections/items/properties/editor/properties/preview/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}}}else {const err122 = {instancePath:instancePath+"/collections/" + i3+"/editor",schemaPath:"#/properties/collections/items/properties/editor/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}}if(data30.format !== undefined){let data76 = data30.format;if(typeof data76 !== "string"){const err123 = {instancePath:instancePath+"/collections/" + i3+"/format",schemaPath:"#/properties/collections/items/properties/format/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err123];}else {vErrors.push(err123);}errors++;}if(!((((((((data76 === "yml") || (data76 === "yaml")) || (data76 === "toml")) || (data76 === "json")) || (data76 === "frontmatter")) || (data76 === "json-frontmatter")) || (data76 === "toml-frontmatter")) || (data76 === "yaml-frontmatter"))){const err124 = {instancePath:instancePath+"/collections/" + i3+"/format",schemaPath:"#/properties/collections/items/properties/format/enum",keyword:"enum",params:{allowedValues: schema59.properties.collections.items.properties.format.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err124];}else {vErrors.push(err124);}errors++;}}if(data30.extension !== undefined){if(typeof data30.extension !== "string"){const err125 = {instancePath:instancePath+"/collections/" + i3+"/extension",schemaPath:"#/properties/collections/items/properties/extension/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err125];}else {vErrors.push(err125);}errors++;}}if(data30.frontmatter_delimiter !== undefined){let data78 = data30.frontmatter_delimiter;if((typeof data78 !== "string") && (!(Array.isArray(data78)))){const err126 = {instancePath:instancePath+"/collections/" + i3+"/frontmatter_delimiter",schemaPath:"#/properties/collections/items/properties/frontmatter_delimiter/type",keyword:"type",params:{type: schema59.properties.collections.items.properties.frontmatter_delimiter.type},message:"must be string,array"};if(vErrors === null){vErrors = [err126];}else {vErrors.push(err126);}errors++;}if(Array.isArray(data78)){if(data78.length > 2){const err127 = {instancePath:instancePath+"/collections/" + i3+"/frontmatter_delimiter",schemaPath:"#/properties/collections/items/properties/frontmatter_delimiter/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err127];}else {vErrors.push(err127);}errors++;}if(data78.length < 2){const err128 = {instancePath:instancePath+"/collections/" + i3+"/frontmatter_delimiter",schemaPath:"#/properties/collections/items/properties/frontmatter_delimiter/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err128];}else {vErrors.push(err128);}errors++;}const len8 = data78.length;for(let i8=0; i8 0){const _errs217 = errors;let valid52 = false;let passing5 = null;const _errs218 = errors;if(typeof data92[0] !== "string"){const err148 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i9+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err148];}else {vErrors.push(err148);}errors++;}var _valid10 = _errs218 === errors;if(_valid10){valid52 = true;passing5 = 0;}if(!valid52){const err149 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i9+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing5},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err149];}else {vErrors.push(err149);}errors++;}else {errors = _errs217;if(vErrors !== null){if(_errs217){vErrors.length = _errs217;}else {vErrors = null;}}}}if(len12 > 1){if(typeof data92[1] !== "string"){const err150 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i9+"/pattern/1",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err150];}else {vErrors.push(err150);}errors++;}}}else {const err151 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i9+"/pattern",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err151];}else {vErrors.push(err151);}errors++;}}if(data81.field !== undefined){if(!(validate51(data81.field, {instancePath:instancePath+"/collections/" + i3+"/fields/" + i9+"/field",parentData:data81,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? validate51.errors : vErrors.concat(validate51.errors);errors = vErrors.length;}}if(data81.fields !== undefined){if(!(validate52(data81.fields, {instancePath:instancePath+"/collections/" + i3+"/fields/" + i9+"/fields",parentData:data81,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate52.errors : vErrors.concat(validate52.errors);errors = vErrors.length;}}if(data81.types !== undefined){if(!(validate52(data81.types, {instancePath:instancePath+"/collections/" + i3+"/fields/" + i9+"/types",parentData:data81,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate52.errors : vErrors.concat(validate52.errors);errors = vErrors.length;}}}else {const err152 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i9,schemaPath:"#/properties/collections/items/properties/fields/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err152];}else {vErrors.push(err152);}errors++;}}}else {const err153 = {instancePath:instancePath+"/collections/" + i3+"/fields",schemaPath:"#/properties/collections/items/properties/fields/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err153];}else {vErrors.push(err153);}errors++;}}if(data30.sortable_fields !== undefined){let data98 = data30.sortable_fields;if(Array.isArray(data98)){const len13 = data98.length;for(let i12=0; i12 1000 || isNaN(data113)){const err180 = {instancePath:instancePath+"/collections/" + i3+"/nested/depth",schemaPath:"#/properties/collections/items/properties/nested/properties/depth/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1000},message:"must be <= 1000"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}if(data113 < 1 || isNaN(data113)){const err181 = {instancePath:instancePath+"/collections/" + i3+"/nested/depth",schemaPath:"#/properties/collections/items/properties/nested/properties/depth/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}else {const err182 = {instancePath:instancePath+"/collections/" + i3+"/nested/depth",schemaPath:"#/properties/collections/items/properties/nested/properties/depth/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data112.summary !== undefined){if(typeof data112.summary !== "string"){const err183 = {instancePath:instancePath+"/collections/" + i3+"/nested/summary",schemaPath:"#/properties/collections/items/properties/nested/properties/summary/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}}}else {const err184 = {instancePath:instancePath+"/collections/" + i3+"/nested",schemaPath:"#/properties/collections/items/properties/nested/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}}if(data30.meta !== undefined){let data115 = data30.meta;if(data115 && typeof data115 == "object" && !Array.isArray(data115)){if(Object.keys(data115).length < 1){const err185 = {instancePath:instancePath+"/collections/" + i3+"/meta",schemaPath:"#/properties/collections/items/properties/meta/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}for(const key3 in data115){if(!(key3 === "path")){const err186 = {instancePath:instancePath+"/collections/" + i3+"/meta",schemaPath:"#/properties/collections/items/properties/meta/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}}if(data115.path !== undefined){let data116 = data115.path;if(data116 && typeof data116 == "object" && !Array.isArray(data116)){if(data116.label === undefined){const err187 = {instancePath:instancePath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/required",keyword:"required",params:{missingProperty: "label"},message:"must have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}if(data116.widget === undefined){const err188 = {instancePath:instancePath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/required",keyword:"required",params:{missingProperty: "widget"},message:"must have required property '"+"widget"+"'"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}if(data116.index_file === undefined){const err189 = {instancePath:instancePath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/required",keyword:"required",params:{missingProperty: "index_file"},message:"must have required property '"+"index_file"+"'"};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}if(data116.label !== undefined){if(typeof data116.label !== "string"){const err190 = {instancePath:instancePath+"/collections/" + i3+"/meta/path/label",schemaPath:"#/properties/collections/items/properties/meta/properties/path/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}if(data116.widget !== undefined){if(typeof data116.widget !== "string"){const err191 = {instancePath:instancePath+"/collections/" + i3+"/meta/path/widget",schemaPath:"#/properties/collections/items/properties/meta/properties/path/properties/widget/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;}}if(data116.index_file !== undefined){if(typeof data116.index_file !== "string"){const err192 = {instancePath:instancePath+"/collections/" + i3+"/meta/path/index_file",schemaPath:"#/properties/collections/items/properties/meta/properties/path/properties/index_file/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}}else {const err193 = {instancePath:instancePath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}}}else {const err194 = {instancePath:instancePath+"/collections/" + i3+"/meta",schemaPath:"#/properties/collections/items/properties/meta/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}}if(data30.i18n !== undefined){let data120 = data30.i18n;const _errs277 = errors;let valid67 = false;let passing7 = null;const _errs278 = errors;if(typeof data120 !== "boolean"){const err195 = {instancePath:instancePath+"/collections/" + i3+"/i18n",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}var _valid12 = _errs278 === errors;if(_valid12){valid67 = true;passing7 = 0;}const _errs280 = errors;if(data120 && typeof data120 == "object" && !Array.isArray(data120)){if(data120.structure !== undefined){let data121 = data120.structure;if(typeof data121 !== "string"){const err196 = {instancePath:instancePath+"/collections/" + i3+"/i18n/structure",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}if(!(((data121 === "multiple_folders") || (data121 === "multiple_files")) || (data121 === "single_file"))){const err197 = {instancePath:instancePath+"/collections/" + i3+"/i18n/structure",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum",keyword:"enum",params:{allowedValues: schema59.properties.collections.items.properties.i18n.oneOf[1].properties.structure.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}}if(data120.locales !== undefined){let data122 = data120.locales;if(Array.isArray(data122)){if(data122.length < 2){const err198 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}const len17 = data122.length;for(let i16=0; i16 10){const err199 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i16,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/maxLength",keyword:"maxLength",params:{limit: 10},message:"must NOT have more than 10 characters"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}if(func12(data123) < 2){const err200 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i16,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/minLength",keyword:"minLength",params:{limit: 2},message:"must NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}if(!pattern0.test(data123)){const err201 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i16,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"must match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}else {const err202 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i16,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}let i17 = data122.length;let j1;if(i17 > 1){const indices1 = {};for(;i17--;){let item1 = data122[i17];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j1 = indices1[item1];const err203 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems",keyword:"uniqueItems",params:{i: i17, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i17+" are identical)"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;break;}indices1[item1] = i17;}}}else {const err204 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}}if(data120.default_locale !== undefined){let data124 = data120.default_locale;if(typeof data124 === "string"){if(func12(data124) > 10){const err205 = {instancePath:instancePath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/maxLength",keyword:"maxLength",params:{limit: 10},message:"must NOT have more than 10 characters"};if(vErrors === null){vErrors = [err205];}else {vErrors.push(err205);}errors++;}if(func12(data124) < 2){const err206 = {instancePath:instancePath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/minLength",keyword:"minLength",params:{limit: 2},message:"must NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err206];}else {vErrors.push(err206);}errors++;}if(!pattern0.test(data124)){const err207 = {instancePath:instancePath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/pattern",keyword:"pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"must match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err207];}else {vErrors.push(err207);}errors++;}}else {const err208 = {instancePath:instancePath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err208];}else {vErrors.push(err208);}errors++;}}}else {const err209 = {instancePath:instancePath+"/collections/" + i3+"/i18n",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err209];}else {vErrors.push(err209);}errors++;}var _valid12 = _errs280 === errors;if(_valid12 && valid67){valid67 = false;passing7 = [passing7, 1];}else {if(_valid12){valid67 = true;passing7 = 1;}}if(!valid67){const err210 = {instancePath:instancePath+"/collections/" + i3+"/i18n",schemaPath:"#/properties/collections/items/properties/i18n/oneOf",keyword:"oneOf",params:{passingSchemas: passing7},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err210];}else {vErrors.push(err210);}errors++;}else {errors = _errs277;if(vErrors !== null){if(_errs277){vErrors.length = _errs277;}else {vErrors = null;}}}}}else {const err211 = {instancePath:instancePath+"/collections/" + i3,schemaPath:"#/properties/collections/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err211];}else {vErrors.push(err211);}errors++;}}}else {const err212 = {instancePath:instancePath+"/collections",schemaPath:"#/properties/collections/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err212];}else {vErrors.push(err212);}errors++;}}if(data.editor !== undefined){let data125 = data.editor;if(data125 && typeof data125 == "object" && !Array.isArray(data125)){if(data125.preview !== undefined){if(typeof data125.preview !== "boolean"){const err213 = {instancePath:instancePath+"/editor/preview",schemaPath:"#/properties/editor/properties/preview/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err213];}else {vErrors.push(err213);}errors++;}}}else {const err214 = {instancePath:instancePath+"/editor",schemaPath:"#/properties/editor/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err214];}else {vErrors.push(err214);}errors++;}}}else {const err215 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err215];}else {vErrors.push(err215);}errors++;}validate43.errors = vErrors;return errors === 0;} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a482968a1d0c..302070738869 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4167,6 +4167,19 @@ airbnb-js-shims@^2.2.1: string.prototype.padstart "^3.0.0" symbol.prototype.description "^1.0.0" +ajv-cli@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ajv-cli/-/ajv-cli-5.0.0.tgz#78956ed2934e6dde4c9e696b587be1c2998862e8" + integrity sha512-LY4m6dUv44HTyhV+u2z5uX4EhPYTM38Iv1jdgDJJJCyOOuqB8KtZEGjPZ2T+sh5ZIJrXUfgErYx/j3gLd3+PlQ== + dependencies: + ajv "^8.0.0" + fast-json-patch "^2.0.0" + glob "^7.1.0" + js-yaml "^3.14.0" + json-schema-migrate "^2.0.0" + json5 "^2.1.3" + minimist "^1.2.0" + ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" @@ -4189,16 +4202,6 @@ ajv-keywords@^5.0.0: dependencies: fast-deep-equal "^3.1.3" -ajv@8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.1.0.tgz#45d5d3d36c7cdd808930cc3e603cf6200dbeb736" - integrity sha512-B/Sk2Ix7A36fs/ZkuGLIR86EdjbgR6fsAcbx9lOP/QBSXujDNbVmIS/U4Itz5k8fPFDeVZl/zQ/gJW4Jrq6XjQ== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -4209,7 +4212,7 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.1: +ajv@^8.0.0, ajv@^8.0.1, ajv@^8.7.1: version "8.7.1" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.7.1.tgz#52be6f1736b076074798124293618f132ad07a7e" integrity sha512-gPpOObTO1QjbnN1sVMjJcp1TF9nggMfO4MBR5uQl6ZVTOaEPq5i4oq/6R9q2alMMPB3eg53wFv1RuJBLuxf3Hw== @@ -8500,6 +8503,13 @@ fast-glob@^3.1.1, fast-glob@^3.2.4, fast-glob@^3.2.5, fast-glob@^3.2.7: merge2 "^1.3.0" micromatch "^4.0.4" +fast-json-patch@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-2.2.1.tgz#18150d36c9ab65c7209e7d4eb113f4f8eaabe6d9" + integrity sha512-4j5uBaTnsYAV5ebkidvxiLUYOwjQ+JSFljeqfTxCrH9bDmlCQaOJFS84oDJ2rAXZq2yskmk3ORfoP9DCwqFNig== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -9207,7 +9217,7 @@ glob-to-regexp@^0.3.0: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= -glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.5, glob@^7.1.6: +glob@^7.0.0, glob@^7.0.3, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.5, glob@^7.1.6: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== @@ -11438,7 +11448,7 @@ js-tokens@^3.0.2: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= -js-yaml@^3.13.1: +js-yaml@^3.13.1, js-yaml@^3.14.0: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -11530,6 +11540,13 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== +json-schema-migrate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/json-schema-migrate/-/json-schema-migrate-2.0.0.tgz#335ef5218cd32fcc96c1ddce66c71ba586224496" + integrity sha512-r38SVTtojDRp4eD6WsCqiE0eNDt4v1WalBXb9cyZYw9ai5cGtBwzRNWjHzJl38w6TxFkXAIA7h+fyX3tnrAFhQ== + dependencies: + ajv "^8.0.0" + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -11560,7 +11577,7 @@ json3@^3.3.2, json3@^3.3.3: resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.3.tgz#7fc10e375fc5ae42c4705a5cc0aa6f62be305b81" integrity sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA== -json5@2.x, json5@^2.1.1, json5@^2.1.2: +json5@2.x, json5@^2.1.1, json5@^2.1.2, json5@^2.1.3: version "2.2.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==