From 8d109ea505644db3b30a13e1687e8c56936808b9 Mon Sep 17 00:00:00 2001 From: Paul Cowan Date: Wed, 22 Dec 2021 11:16:40 +0000 Subject: [PATCH 01/20] fix(csp): change validateConfig to implicity opt in or out of dynamic ajv validation (#2138) --- packages/netlify-cms-core/config.schema.json | 1295 +++++++++++++++++ packages/netlify-cms-core/package.json | 1 + .../src/constants/configSchema.js | 35 +- scripts/webpack.js | 16 + yarn.lock | 18 +- 5 files changed, 1362 insertions(+), 3 deletions(-) create mode 100644 packages/netlify-cms-core/config.schema.json diff --git a/packages/netlify-cms-core/config.schema.json b/packages/netlify-cms-core/config.schema.json new file mode 100644 index 000000000000..49450ec743d2 --- /dev/null +++ b/packages/netlify-cms-core/config.schema.json @@ -0,0 +1,1295 @@ +{ + "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_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", + "type": "array", + "minItems": 1, + "items": { + "$id": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", + "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" + }, + { + "instanceof": "RegExp" + } + ] + }, + { + "type": "string" + } + ] + }, + "field": { + "$ref": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + }, + "fields": { + "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + }, + "types": { + "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + } + }, + "select": { + "$data": "0/widget" + }, + "selectCases": { + "unknown": {}, + "string": {}, + "number": { + "properties": { + "step": { + "type": "number" + }, + "value_type": { + "type": "string" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "text": {}, + "image": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "file": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "select": { + "properties": { + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "options": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "label", + "value" + ] + } + ] + } + } + }, + "required": [ + "options" + ] + }, + "markdown": { + "properties": { + "minimal": { + "type": "boolean" + }, + "buttons": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "bold", + "italic", + "code", + "link", + "heading-one", + "heading-two", + "heading-three", + "heading-four", + "heading-five", + "heading-six", + "quote", + "bulleted-list", + "numbered-list" + ] + } + }, + "editor_components": { + "type": "array", + "items": { + "type": "string" + } + }, + "modes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "raw", + "rich_text" + ] + }, + "minItems": 1 + } + } + }, + "list": { + "properties": { + "allow_add": { + "type": "boolean" + }, + "collapsed": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "minimize_collapsed": { + "type": "boolean" + }, + "label_singular": { + "type": "string" + }, + "i18n": { + "type": "boolean" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "object": { + "properties": { + "collapsed": { + "type": "boolean" + }, + "i18n": { + "type": "boolean" + } + } + }, + "relation": { + "properties": { + "collection": { + "type": "string" + }, + "value_field": { + "type": "string" + }, + "search_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "file": { + "type": "string" + }, + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "display_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "options_length": { + "type": "integer" + } + }, + "oneOf": [ + { + "required": [ + "collection", + "value_field", + "search_fields" + ] + }, + { + "required": [ + "collection", + "valueField", + "searchFields" + ] + } + ] + }, + "boolean": {}, + "map": { + "properties": { + "decimals": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": [ + "Point", + "LineString", + "Polygon" + ] + } + } + }, + "date": {}, + "datetime": { + "properties": { + "format": { + "type": "string" + }, + "date_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "time_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "picker_utc": { + "type": "boolean" + } + } + }, + "code": { + "properties": { + "default_language": { + "type": "string" + }, + "allow_language_selection": { + "type": "boolean" + }, + "output_code_only": { + "type": "boolean" + }, + "keys": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "lang": { + "type": "string" + } + } + } + } + }, + "color": {} + }, + "required": [ + "name" + ] + }, + "uniqueItemProperties": [ + "name" + ] + } + }, + "required": [ + "name", + "label", + "file", + "fields" + ] + }, + "uniqueItemProperties": [ + "name" + ] + }, + "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_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", + "type": "array", + "minItems": 1, + "items": { + "$id": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", + "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" + }, + { + "instanceof": "RegExp" + } + ] + }, + { + "type": "string" + } + ] + }, + "field": { + "$ref": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + }, + "fields": { + "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + }, + "types": { + "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + } + }, + "select": { + "$data": "0/widget" + }, + "selectCases": { + "unknown": {}, + "string": {}, + "number": { + "properties": { + "step": { + "type": "number" + }, + "value_type": { + "type": "string" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "text": {}, + "image": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "file": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "select": { + "properties": { + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "options": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + } + }, + "required": [ + "label", + "value" + ] + } + ] + } + } + }, + "required": [ + "options" + ] + }, + "markdown": { + "properties": { + "minimal": { + "type": "boolean" + }, + "buttons": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "bold", + "italic", + "code", + "link", + "heading-one", + "heading-two", + "heading-three", + "heading-four", + "heading-five", + "heading-six", + "quote", + "bulleted-list", + "numbered-list" + ] + } + }, + "editor_components": { + "type": "array", + "items": { + "type": "string" + } + }, + "modes": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "raw", + "rich_text" + ] + }, + "minItems": 1 + } + } + }, + "list": { + "properties": { + "allow_add": { + "type": "boolean" + }, + "collapsed": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "minimize_collapsed": { + "type": "boolean" + }, + "label_singular": { + "type": "string" + }, + "i18n": { + "type": "boolean" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "object": { + "properties": { + "collapsed": { + "type": "boolean" + }, + "i18n": { + "type": "boolean" + } + } + }, + "relation": { + "properties": { + "collection": { + "type": "string" + }, + "value_field": { + "type": "string" + }, + "search_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "file": { + "type": "string" + }, + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "display_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "options_length": { + "type": "integer" + } + }, + "oneOf": [ + { + "required": [ + "collection", + "value_field", + "search_fields" + ] + }, + { + "required": [ + "collection", + "valueField", + "searchFields" + ] + } + ] + }, + "boolean": {}, + "map": { + "properties": { + "decimals": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": [ + "Point", + "LineString", + "Polygon" + ] + } + } + }, + "date": {}, + "datetime": { + "properties": { + "format": { + "type": "string" + }, + "date_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "time_format": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "boolean" + } + ] + }, + "picker_utc": { + "type": "boolean" + } + } + }, + "code": { + "properties": { + "default_language": { + "type": "string" + }, + "allow_language_selection": { + "type": "boolean" + }, + "output_code_only": { + "type": "boolean" + }, + "keys": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "lang": { + "type": "string" + } + } + } + } + }, + "color": {} + }, + "required": [ + "name" + ] + }, + "uniqueItemProperties": [ + "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" + ] + } + } + }, + "uniqueItemProperties": [ + "name" + ] + }, + "editor": { + "type": "object", + "properties": { + "preview": { + "type": "boolean" + } + } + } + }, + "required": [ + "backend", + "collections" + ], + "anyOf": [ + { + "required": [ + "media_folder" + ] + }, + { + "required": [ + "media_library" + ] + } + ] +} \ No newline at end of file diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index 78a495578770..22d915d5ef1b 100644 --- a/packages/netlify-cms-core/package.json +++ b/packages/netlify-cms-core/package.json @@ -94,6 +94,7 @@ "@types/history": "^4.7.8", "@types/redux-mock-store": "^1.0.2", "@types/url-join": "^4.0.0", + "ajv-json-loader": "^0.2.0", "redux-mock-store": "^1.5.3" } } diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index 31e3711f8745..2790db0f098e 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -11,9 +11,32 @@ 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 staticValidateConfig from '../../config.schema.json'; const localeType = { type: 'string', minLength: 2, maxLength: 10, pattern: '^[a-zA-Z-_]+$' }; +// taken from config.schema.json +// config.properties.collections.items.properties.files.items.properties.fields.items.selectCases +const NativeCMSWidgets = [ + 'unknown', + 'string', + 'number', + 'text', + 'image', + 'file', + 'select', + 'markdown', + 'list', + 'object', + 'relation', + 'boolean', + 'map', + 'date', + 'datetime', + 'code', + 'color', +]; + const i18n = { type: 'object', properties: { @@ -353,7 +376,7 @@ class ConfigError extends Error { * `validateConfig` is a pure function. It does not mutate * the config that is passed in. */ -export function validateConfig(config) { +function dynamicValidateConfig(config) { const ajv = new AJV({ allErrors: true, $data: true, strict: false }); uniqueItemProperties(ajv); select(ajv); @@ -397,3 +420,13 @@ export function validateConfig(config) { throw new ConfigError(errors); } } + +export function validateConfig(config) { + if (Object.keys(getWidgetSchemas()).some(widgetKey => NativeCMSWidgets.includes(widgetKey))) { + console.debug('using dynamic ajv validation'); + return dynamicValidateConfig(config); + } else { + console.debug('using static ajv validation'); + return staticValidateConfig(config); + } +} diff --git a/scripts/webpack.js b/scripts/webpack.js index d3a1b9fca739..922d6f2cc4b3 100644 --- a/scripts/webpack.js +++ b/scripts/webpack.js @@ -39,6 +39,22 @@ function rules() { exclude: [/node_modules/], use: 'svg-inline-loader', }), + json: () => ({ + test: /\.schema\.json$/, + use: [ + { + loader: 'ajv-json-loader', + options: { + ajv: { + allErrors: true, + $data: true, + strict: false, + }, + }, + }, + ], + type: 'javascript/auto', + }), }; } diff --git a/yarn.lock b/yarn.lock index cab7135059e7..d53709539ce2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4474,6 +4474,15 @@ ajv-errors@^3.0.0: resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-3.0.0.tgz#e54f299f3a3d30fe144161e5f0d8d51196c527bc" integrity sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ== +ajv-json-loader@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/ajv-json-loader/-/ajv-json-loader-0.2.0.tgz#0b14a979ed9efc6357e4d469fb8054533c4bcf06" + integrity sha512-fzuRE07FSr5OvEZLCejOTTTl//Iraxk5bvi9xY5G1Ajfj92AsaGAwPrfijDuVJ0y/X6hpqir3NFtjXooBCMdIQ== + dependencies: + ajv "^8.8.2" + assert-ts "^0.3.4" + loader-utils "^2.0.2" + ajv-keywords@^3.1.0, ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" @@ -4506,7 +4515,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, ajv json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.1: +ajv@^8.0.1, ajv@^8.8.2: version "8.8.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb" integrity sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw== @@ -4933,6 +4942,11 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= +assert-ts@^0.3.4: + version "0.3.4" + resolved "https://registry.yarnpkg.com/assert-ts/-/assert-ts-0.3.4.tgz#a452d6c9fc88e543bffded343a32deb48573ddf2" + integrity sha512-CQtNOdOCzzZfE3TF9a1vFTcz4ZfJYM6iHoWYCkpFY3wdk6CkFvevuLwpOFVL/KMJ9vCNIbeidWH5uo/Y8sLVWg== + assert@^1.1.1: version "1.5.0" resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" @@ -12230,7 +12244,7 @@ loader-utils@^1.0.0, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4 emojis-list "^3.0.0" json5 "^1.0.1" -loader-utils@^2.0.0: +loader-utils@^2.0.0, loader-utils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129" integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A== From 1b66c6226cdcfa5e1b3d63909f43c5a25d703ade Mon Sep 17 00:00:00 2001 From: Paul Cowan Date: Mon, 3 Jan 2022 13:53:09 +0000 Subject: [PATCH 02/20] chore(csp): add writeValidate --- dev-test/config.yml | 164 +------ package.json | 13 +- packages/netlify-cms-core/config.schema.json | 1 + packages/netlify-cms-core/package.json | 10 +- .../netlify-cms-core/src/actions/config.ts | 2 + .../constants/__tests__/configSchema.spec.js | 6 +- .../src/constants/configSchema.js | 409 +++++++++--------- .../src/constants/validateSchema.js | 1 + .../netlify-cms-core/writeValidateSchema.js | 43 ++ scripts/webpack.js | 16 - website/package.json | 4 +- yarn.lock | 227 +++++----- 12 files changed, 384 insertions(+), 512 deletions(-) create mode 100644 packages/netlify-cms-core/src/constants/validateSchema.js create mode 100644 packages/netlify-cms-core/writeValidateSchema.js diff --git a/dev-test/config.yml b/dev-test/config.yml index 2ffe5041ddb5..e26ca6bd31a2 100644 --- a/dev-test/config.yml +++ b/dev-test/config.yml @@ -103,166 +103,4 @@ collections: # A list of collections the CMS should be able to edit widget: list fields: - { label: 'Name', name: 'name', widget: 'string', hint: 'First and Last' } - - { label: 'Description', name: 'description', widget: 'markdown' } - - - name: 'kitchenSink' # all the things in one entry, for documentation and quick testing - label: 'Kitchen Sink' - folder: '_sink' - create: true - fields: - - label: 'Related Post' - name: 'post' - widget: 'relationKitchenSinkPost' - collection: 'posts' - display_fields: ['title', 'date'] - search_fields: ['title', 'body'] - value_field: 'title' - - { label: 'Title', name: 'title', widget: 'string' } - - { label: 'Boolean', name: 'boolean', widget: 'boolean', default: true } - - { label: 'Map', name: 'map', widget: 'map' } - - { label: 'Text', name: 'text', widget: 'text', hint: 'Plain text, not markdown' } - - { label: 'Number', name: 'number', widget: 'number', hint: 'To infinity and beyond!' } - - { label: 'Markdown', name: 'markdown', widget: 'markdown' } - - { label: 'Datetime', name: 'datetime', widget: 'datetime' } - - { label: 'Date', name: 'date', widget: 'date' } - - { label: 'Color', name: 'color', widget: 'color' } - - { - label: 'Color string editable and alpha enabled', - name: 'colorEditable', - widget: 'color', - enableAlpha: true, - allowInput: true, - } - - { label: 'Image', name: 'image', widget: 'image' } - - { label: 'File', name: 'file', widget: 'file' } - - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } - - { - label: 'Select multiple', - name: 'select_multiple', - widget: 'select', - options: ['a', 'b', 'c'], - multiple: true, - } - - { - label: 'Select numeric', - name: 'select_numeric', - widget: 'select', - options: - [{ label: 'One', value: 1 }, { label: 'Two', value: 2 }, { label: 'Three', value: 3 }], - } - - { label: 'Hidden', name: 'hidden', widget: 'hidden', default: 'hidden' } - - label: 'Object' - name: 'object' - widget: 'object' - collapsed: true - fields: - - label: 'Related Post' - name: 'post' - widget: 'relationKitchenSinkPost' - collection: 'posts' - search_fields: ['title', 'body'] - value_field: 'title' - - { label: 'String', name: 'string', widget: 'string' } - - { label: 'Boolean', name: 'boolean', widget: 'boolean', default: false } - - { label: 'Text', name: 'text', widget: 'text' } - - { label: 'Number', name: 'number', widget: 'number' } - - { label: 'Markdown', name: 'markdown', widget: 'markdown' } - - { label: 'Datetime', name: 'datetime', widget: 'datetime' } - - { label: 'Date', name: 'date', widget: 'date' } - - { label: 'Image', name: 'image', widget: 'image' } - - { label: 'File', name: 'file', widget: 'file' } - - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } - - label: 'List' - name: 'list' - widget: 'list' - fields: - - { label: 'String', name: 'string', widget: 'string' } - - { label: 'Boolean', name: 'boolean', widget: 'boolean' } - - { label: 'Text', name: 'text', widget: 'text' } - - { label: 'Number', name: 'number', widget: 'number' } - - { label: 'Markdown', name: 'markdown', widget: 'markdown' } - - { label: 'Datetime', name: 'datetime', widget: 'datetime' } - - { label: 'Date', name: 'date', widget: 'date' } - - { label: 'Image', name: 'image', widget: 'image' } - - { label: 'File', name: 'file', widget: 'file' } - - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } - - label: 'Object' - name: 'object' - widget: 'object' - fields: - - { label: 'String', name: 'string', widget: 'string' } - - { label: 'Boolean', name: 'boolean', widget: 'boolean' } - - { label: 'Text', name: 'text', widget: 'text' } - - { label: 'Number', name: 'number', widget: 'number' } - - { label: 'Markdown', name: 'markdown', widget: 'markdown' } - - { label: 'Datetime', name: 'datetime', widget: 'datetime' } - - { label: 'Date', name: 'date', widget: 'date' } - - { label: 'Image', name: 'image', widget: 'image' } - - { label: 'File', name: 'file', widget: 'file' } - - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } - - label: 'List' - name: 'list' - widget: 'list' - fields: - - label: 'Related Post' - name: 'post' - widget: 'relationKitchenSinkPost' - collection: 'posts' - search_fields: ['title', 'body'] - value_field: 'title' - - { label: 'String', name: 'string', widget: 'string' } - - { label: 'Boolean', name: 'boolean', widget: 'boolean' } - - { label: 'Text', name: 'text', widget: 'text' } - - { label: 'Number', name: 'number', widget: 'number' } - - { label: 'Markdown', name: 'markdown', widget: 'markdown' } - - { label: 'Datetime', name: 'datetime', widget: 'datetime' } - - { label: 'Date', name: 'date', widget: 'date' } - - { label: 'Image', name: 'image', widget: 'image' } - - { label: 'File', name: 'file', widget: 'file' } - - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } - - { label: 'Hidden', name: 'hidden', widget: 'hidden', default: 'hidden' } - - label: 'Object' - name: 'object' - widget: 'object' - fields: - - { label: 'String', name: 'string', widget: 'string' } - - { label: 'Boolean', name: 'boolean', widget: 'boolean' } - - { label: 'Text', name: 'text', widget: 'text' } - - { label: 'Number', name: 'number', widget: 'number' } - - { label: 'Markdown', name: 'markdown', widget: 'markdown' } - - { label: 'Datetime', name: 'datetime', widget: 'datetime' } - - { label: 'Date', name: 'date', widget: 'date' } - - { label: 'Image', name: 'image', widget: 'image' } - - { label: 'File', name: 'file', widget: 'file' } - - { - label: 'Select', - name: 'select', - widget: 'select', - options: ['a', 'b', 'c'], - } - - label: 'Typed List' - name: 'typed_list' - widget: 'list' - types: - - label: 'Type 1 Object' - name: 'type_1_object' - widget: 'object' - fields: - - { label: 'String', name: 'string', widget: 'string' } - - { label: 'Boolean', name: 'boolean', widget: 'boolean' } - - { label: 'Text', name: 'text', widget: 'text' } - - label: 'Type 2 Object' - name: 'type_2_object' - widget: 'object' - fields: - - { label: 'Number', name: 'number', widget: 'number' } - - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } - - { label: 'Datetime', name: 'datetime', widget: 'datetime' } - - { label: 'Markdown', name: 'markdown', widget: 'markdown' } - - label: 'Type 3 Object' - name: 'type_3_object' - widget: 'object' - fields: - - { label: 'Date', name: 'date', widget: 'date' } - - { label: 'Image', name: 'image', widget: 'image' } - - { label: 'File', name: 'file', widget: 'file' } + - { label: 'Description', name: 'description', widget: 'markdown' } \ No newline at end of file diff --git a/package.json b/package.json index 36565dd22d54..0119fea96da8 100644 --- a/package.json +++ b/package.json @@ -126,11 +126,11 @@ "cypress-jest-adapter": "^0.1.1", "cypress-plugin-tab": "^1.0.0", "dotenv": "^10.0.0", - "eslint": "^7.0.0", - "eslint-plugin-cypress": "^2.6.0", - "eslint-plugin-import": "^2.18.2", + "eslint": "^8.5.0", + "eslint-plugin-cypress": "^2.12.1", + "eslint-plugin-import": "^2.25.3", "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-react": "^7.17.0", + "eslint-plugin-react": "^7.27.1", "execa": "^5.0.0", "friendly-errors-webpack-plugin": "^1.7.0", "fs-extra": "^10.0.0", @@ -179,8 +179,8 @@ "dependencies": { "@emotion/babel-preset-css-prop": "^10.0.27", "emotion": "^10.0.9", - "eslint-config-prettier": "^8.0.0", - "eslint-plugin-babel": "^5.3.0", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-babel": "^5.3.1", "globby": "^12.0.0", "lerna": "^4.0.0" }, @@ -190,6 +190,7 @@ } }, "resolutions": { + "ajv": "7.0.3", "react-redux": "^7.2.0" } } diff --git a/packages/netlify-cms-core/config.schema.json b/packages/netlify-cms-core/config.schema.json index 49450ec743d2..98acbaa8f3da 100644 --- a/packages/netlify-cms-core/config.schema.json +++ b/packages/netlify-cms-core/config.schema.json @@ -1,4 +1,5 @@ { + "$id": "https://netlify-cms/object.json", "type": "object", "properties": { "backend": { diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index 22d915d5ef1b..b461a1907b31 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\"", + "write-validate-schema": "NODE_ENV=production node ./writeValidateSchema.js" }, "keywords": [ "netlify", @@ -26,9 +27,9 @@ "license": "MIT", "dependencies": { "@iarna/toml": "2.2.5", - "ajv": "8.1.0", + "ajv": "7.0.3", "ajv-errors": "^3.0.0", - "ajv-keywords": "^5.0.0", + "ajv-keywords": "^5.1.0", "copy-text-to-clipboard": "^3.0.0", "deepmerge": "^4.2.2", "diacritics": "^1.3.0", @@ -66,6 +67,7 @@ "redux-notifications": "^4.0.1", "redux-thunk": "^2.3.0", "remark-gfm": "1.0.0", + "require-from-string": "^2.0.2", "sanitize-filename": "^1.6.1", "semaphore": "^1.0.5", "tomlify-j0.4": "^3.0.0-alpha.0", @@ -94,7 +96,7 @@ "@types/history": "^4.7.8", "@types/redux-mock-store": "^1.0.2", "@types/url-join": "^4.0.0", - "ajv-json-loader": "^0.2.0", + "ajv-cli": "^4.2.0", "redux-mock-store": "^1.5.3" } } diff --git a/packages/netlify-cms-core/src/actions/config.ts b/packages/netlify-cms-core/src/actions/config.ts index 3bb3a1cb937b..31c52c9738e5 100644 --- a/packages/netlify-cms-core/src/actions/config.ts +++ b/packages/netlify-cms-core/src/actions/config.ts @@ -511,6 +511,8 @@ export function loadConfig(manualConfig: Partial = {}, onLoad: () => ? {} : await getConfigYaml(configUrl, hasManualConfig); + console.log({configYaml}) + // Merge manual config into the config.yml one const mergedConfig = deepmerge(configYaml, manualConfig); 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..3c3b3f89834a 100644 --- a/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js +++ b/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js @@ -4,7 +4,7 @@ import { validateConfig } from '../configSchema'; jest.mock('../../lib/registry'); -describe('config', () => { +describe.only('config', () => { /** * Suppress error logging to reduce noise during testing. Jest will still * log test failures and associated errors as expected. @@ -16,7 +16,7 @@ describe('config', () => { const { getWidgets } = require('../../lib/registry'); getWidgets.mockImplementation(() => [{}]); - describe('validateConfig', () => { + describe.only('validateConfig', () => { const validConfig = { foo: 'bar', backend: { name: 'bar' }, @@ -31,7 +31,7 @@ describe('config', () => { ], }; - it('should not throw if no errors', () => { + it.only('should not throw if no errors', () => { expect(() => { validateConfig(validConfig); }).not.toThrowError(); diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index 2790db0f098e..2604e9c72166 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -11,7 +11,8 @@ 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 staticValidateConfig from '../../config.schema.json'; +import schema from '../../config.schema.json'; +import validateSchema from './validateSchema'; const localeType = { type: 'string', minLength: 2, maxLength: 10, pattern: '^[a-zA-Z-_]+$' }; @@ -146,201 +147,208 @@ const viewGroups = { * where the imports get resolved asynchronously. */ function getConfigSchema() { - return { - 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: i18nRoot, - 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: { - // ------- Each collection: ------- - type: 'object', - properties: { - name: { type: 'string' }, - label: { type: 'string' }, - label_singular: { type: 'string' }, - description: { type: 'string' }, - folder: { type: 'string' }, - files: { - type: 'array', - items: { - // ------- Each file: ------- - 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: fieldsConfig(), - }, - required: ['name', 'label', 'file', 'fields'], - }, - uniqueItemProperties: ['name'], - }, - 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: Object.keys(formatExtensions) }, - extension: { type: 'string' }, - frontmatter_delimiter: { - type: ['string', 'array'], - minItems: 2, - maxItems: 2, - items: { - type: 'string', - }, - }, - fields: fieldsConfig(), - sortable_fields: { - type: 'array', - items: { - type: 'string', - }, - }, - sortableFields: { - type: 'array', - items: { - type: 'string', - }, - }, - view_filters: viewFilters, - view_groups: viewGroups, - 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: i18nCollection, - }, - required: ['name', 'label'], - oneOf: [{ required: ['files'] }, { required: ['folder', 'fields'] }], - not: { - required: ['sortable_fields', 'sortableFields'], - }, - if: { required: ['extension'] }, - then: { - // Cannot infer format from extension. - if: { - properties: { - extension: { enum: Object.keys(extensionFormatters) }, - }, - }, - else: { required: ['format'] }, - }, - dependencies: { - frontmatter_delimiter: { - properties: { - format: { enum: frontmatterFormats }, - }, - required: ['format'], - }, - }, - }, - uniqueItemProperties: ['name'], - }, - editor: { - type: 'object', - properties: { - preview: { type: 'boolean' }, - }, - }, - }, - required: ['backend', 'collections'], - anyOf: [{ required: ['media_folder'] }, { required: ['media_library'] }], - }; + const fields = fieldsConfig(); + + schema.properties.collections.items.properties.files.items.properties.fields = fields; + schema.properties.collections.items.properties.fields = fields; + + return schema; + + // return { + // 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: i18nRoot, + // 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: { + // // ------- Each collection: ------- + // type: 'object', + // properties: { + // name: { type: 'string' }, + // label: { type: 'string' }, + // label_singular: { type: 'string' }, + // description: { type: 'string' }, + // folder: { type: 'string' }, + // files: { + // type: 'array', + // items: { + // // ------- Each file: ------- + // 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: fieldsConfig(), + // }, + // required: ['name', 'label', 'file', 'fields'], + // }, + // uniqueItemProperties: ['name'], + // }, + // 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: Object.keys(formatExtensions) }, + // extension: { type: 'string' }, + // frontmatter_delimiter: { + // type: ['string', 'array'], + // minItems: 2, + // maxItems: 2, + // items: { + // type: 'string', + // }, + // }, + // fields: fieldsConfig(), + // sortable_fields: { + // type: 'array', + // items: { + // type: 'string', + // }, + // }, + // sortableFields: { + // type: 'array', + // items: { + // type: 'string', + // }, + // }, + // view_filters: viewFilters, + // view_groups: viewGroups, + // 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: i18nCollection, + // }, + // required: ['name', 'label'], + // oneOf: [{ required: ['files'] }, { required: ['folder', 'fields'] }], + // not: { + // required: ['sortable_fields', 'sortableFields'], + // }, + // if: { required: ['extension'] }, + // then: { + // // Cannot infer format from extension. + // if: { + // properties: { + // extension: { enum: Object.keys(extensionFormatters) }, + // }, + // }, + // else: { required: ['format'] }, + // }, + // dependencies: { + // frontmatter_delimiter: { + // properties: { + // format: { enum: frontmatterFormats }, + // }, + // required: ['format'], + // }, + // }, + // }, + // uniqueItemProperties: ['name'], + // }, + // editor: { + // type: 'object', + // properties: { + // preview: { type: 'boolean' }, + // }, + // }, + // }, + // required: ['backend', 'collections'], + // anyOf: [{ required: ['media_folder'] }, { required: ['media_library'] }], + // }; } function getWidgetSchemas() { @@ -421,12 +429,17 @@ function dynamicValidateConfig(config) { } } + export function validateConfig(config) { - if (Object.keys(getWidgetSchemas()).some(widgetKey => NativeCMSWidgets.includes(widgetKey))) { + const customWidgets = Object.keys(getWidgetSchemas()).filter( + widgetKey => NativeCMSWidgets.includes(widgetKey) === false, + ); + console.debug(customWidgets); + if (customWidgets.length > 0) { console.debug('using dynamic ajv validation'); return dynamicValidateConfig(config); } else { console.debug('using static ajv validation'); - return staticValidateConfig(config); + return validateSchema(config); } } 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..3e247a3c3015 --- /dev/null +++ b/packages/netlify-cms-core/src/constants/validateSchema.js @@ -0,0 +1 @@ +"use strict";module.exports = validate20;module.exports.default = validate20;const schema22 = {"$id":"https://netlify-cms/object.json","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_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","type":"array","minItems":1,"items":{"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]}},"required":["name","label","file","fields"]},"uniqueItemProperties":["name"]},"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_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","type":"array","minItems":1,"items":{"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["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"]}}},"uniqueItemProperties":["name"]},"editor":{"type":"object","properties":{"preview":{"type":"boolean"}}}},"required":["backend","collections"],"anyOf":[{"required":["media_folder"]},{"required":["media_library"]}]};const func0 = require("ajv/dist/compile/equal");const func9 = require("ajv/dist/compile/ucs2length").default;const pattern0 = new RegExp("^[a-zA-Z-_]+$", "u");const schema23 = {"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]};const wrapper0 = {validate: validate21};const schema24 = {"$id":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","type":"array","minItems":1,"items":{"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]};const wrapper2 = {validate: validate22};function validate22(data, {dataPath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */;let vErrors = null;let errors = 0;if(Array.isArray(data)){if(data.length < 1){const err0 = {keyword:"minItems",dataPath,schemaPath:"#/minItems",params:{limit: 1},message:"should 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 _errs22 = errors;let valid5 = false;let passing1 = null;const _errs23 = errors;if(typeof data7[0] !== "string"){const err12 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/0/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid1 = _errs23 === errors;if(_valid1){valid5 = true;passing1 = 0;}var _valid1 = true;if(_valid1 && valid5){valid5 = false;passing1 = [passing1, 1];}else {if(_valid1){valid5 = true;passing1 = 1;}}if(!valid5){const err13 = {keyword:"oneOf",dataPath:dataPath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf",params:{passingSchemas: passing1},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}else {errors = _errs22;if(vErrors !== null){if(_errs22){vErrors.length = _errs22;}else {vErrors = null;}}}}if(len1 > 1){if(typeof data7[1] !== "string"){const err14 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern/1",schemaPath:"#/items/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}}else {const err15 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern",schemaPath:"#/items/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data0.field !== undefined){if(!(wrapper0.validate(data0.field, {dataPath:dataPath+"/" + 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, {dataPath:dataPath+"/" + 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, {dataPath:dataPath+"/" + i0+"/types",parentData:data0,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? wrapper2.validate.errors : vErrors.concat(wrapper2.validate.errors);errors = vErrors.length;}}}else {const err16 = {keyword:"type",dataPath:dataPath+"/" + i0,schemaPath:"#/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {keyword:"type",dataPath,schemaPath:"#/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate22.errors = vErrors;return errors === 0;}function validate21(data, {dataPath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */;let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.name === undefined){const err0 = {keyword:"required",dataPath,schemaPath:"#/required",params:{missingProperty: "name"},message:"should have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.name !== undefined){if(typeof data.name !== "string"){const err1 = {keyword:"type",dataPath:dataPath+"/name",schemaPath:"#/properties/name/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.label !== undefined){if(typeof data.label !== "string"){const err2 = {keyword:"type",dataPath:dataPath+"/label",schemaPath:"#/properties/label/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.widget !== undefined){if(typeof data.widget !== "string"){const err3 = {keyword:"type",dataPath:dataPath+"/widget",schemaPath:"#/properties/widget/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.required !== undefined){if(typeof data.required !== "boolean"){const err4 = {keyword:"type",dataPath:dataPath+"/required",schemaPath:"#/properties/required/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.i18n !== undefined){let data4 = data.i18n;const _errs10 = errors;let valid1 = false;let passing0 = null;const _errs11 = errors;if(typeof data4 !== "boolean"){const err5 = {keyword:"type",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/0/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var _valid0 = _errs11 === errors;if(_valid0){valid1 = true;passing0 = 0;}const _errs13 = errors;if(typeof data4 !== "string"){const err6 = {keyword:"type",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(!(((data4 === "translate") || (data4 === "duplicate")) || (data4 === "none"))){const err7 = {keyword:"enum",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/1/enum",params:{allowedValues: schema23.properties.i18n.oneOf[1].enum},message:"should be equal to one of the allowed values"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid0 = _errs13 === errors;if(_valid0 && valid1){valid1 = false;passing0 = [passing0, 1];}else {if(_valid0){valid1 = true;passing0 = 1;}}if(!valid1){const err8 = {keyword:"oneOf",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf",params:{passingSchemas: passing0},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}}}if(data.hint !== undefined){if(typeof data.hint !== "string"){const err9 = {keyword:"type",dataPath:dataPath+"/hint",schemaPath:"#/properties/hint/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.pattern !== undefined){let data6 = data.pattern;if(Array.isArray(data6)){if(data6.length < 2){const err10 = {keyword:"minItems",dataPath:dataPath+"/pattern",schemaPath:"#/properties/pattern/minItems",params:{limit: 2},message:"should NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len0 = data6.length;if(len0 > 0){const _errs20 = errors;let valid3 = false;let passing1 = null;const _errs21 = errors;if(typeof data6[0] !== "string"){const err11 = {keyword:"type",dataPath:dataPath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/0/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid1 = _errs21 === errors;if(_valid1){valid3 = true;passing1 = 0;}var _valid1 = true;if(_valid1 && valid3){valid3 = false;passing1 = [passing1, 1];}else {if(_valid1){valid3 = true;passing1 = 1;}}if(!valid3){const err12 = {keyword:"oneOf",dataPath:dataPath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf",params:{passingSchemas: passing1},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {errors = _errs20;if(vErrors !== null){if(_errs20){vErrors.length = _errs20;}else {vErrors = null;}}}}if(len0 > 1){if(typeof data6[1] !== "string"){const err13 = {keyword:"type",dataPath:dataPath+"/pattern/1",schemaPath:"#/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {keyword:"type",dataPath:dataPath+"/pattern",schemaPath:"#/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.field !== undefined){if(!(wrapper0.validate(data.field, {dataPath:dataPath+"/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(!(validate22(data.fields, {dataPath:dataPath+"/fields",parentData:data,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data.types !== undefined){if(!(validate22(data.types, {dataPath:dataPath+"/types",parentData:data,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}}else {const err15 = {keyword:"type",dataPath,schemaPath:"#/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}validate21.errors = vErrors;return errors === 0;}const schema25 = {"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]};const wrapper4 = {validate: validate28};const schema26 = {"$id":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","type":"array","minItems":1,"items":{"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]};const wrapper6 = {validate: validate29};function validate29(data, {dataPath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */;let vErrors = null;let errors = 0;if(Array.isArray(data)){if(data.length < 1){const err0 = {keyword:"minItems",dataPath,schemaPath:"#/minItems",params:{limit: 1},message:"should 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 _errs22 = errors;let valid5 = false;let passing1 = null;const _errs23 = errors;if(typeof data7[0] !== "string"){const err12 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/0/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid1 = _errs23 === errors;if(_valid1){valid5 = true;passing1 = 0;}var _valid1 = true;if(_valid1 && valid5){valid5 = false;passing1 = [passing1, 1];}else {if(_valid1){valid5 = true;passing1 = 1;}}if(!valid5){const err13 = {keyword:"oneOf",dataPath:dataPath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf",params:{passingSchemas: passing1},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}else {errors = _errs22;if(vErrors !== null){if(_errs22){vErrors.length = _errs22;}else {vErrors = null;}}}}if(len1 > 1){if(typeof data7[1] !== "string"){const err14 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern/1",schemaPath:"#/items/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}}else {const err15 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern",schemaPath:"#/items/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data0.field !== undefined){if(!(wrapper4.validate(data0.field, {dataPath:dataPath+"/" + 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, {dataPath:dataPath+"/" + 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, {dataPath:dataPath+"/" + i0+"/types",parentData:data0,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? wrapper6.validate.errors : vErrors.concat(wrapper6.validate.errors);errors = vErrors.length;}}}else {const err16 = {keyword:"type",dataPath:dataPath+"/" + i0,schemaPath:"#/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {keyword:"type",dataPath,schemaPath:"#/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate29.errors = vErrors;return errors === 0;}function validate28(data, {dataPath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */;let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.name === undefined){const err0 = {keyword:"required",dataPath,schemaPath:"#/required",params:{missingProperty: "name"},message:"should have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.name !== undefined){if(typeof data.name !== "string"){const err1 = {keyword:"type",dataPath:dataPath+"/name",schemaPath:"#/properties/name/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.label !== undefined){if(typeof data.label !== "string"){const err2 = {keyword:"type",dataPath:dataPath+"/label",schemaPath:"#/properties/label/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.widget !== undefined){if(typeof data.widget !== "string"){const err3 = {keyword:"type",dataPath:dataPath+"/widget",schemaPath:"#/properties/widget/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.required !== undefined){if(typeof data.required !== "boolean"){const err4 = {keyword:"type",dataPath:dataPath+"/required",schemaPath:"#/properties/required/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.i18n !== undefined){let data4 = data.i18n;const _errs10 = errors;let valid1 = false;let passing0 = null;const _errs11 = errors;if(typeof data4 !== "boolean"){const err5 = {keyword:"type",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/0/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var _valid0 = _errs11 === errors;if(_valid0){valid1 = true;passing0 = 0;}const _errs13 = errors;if(typeof data4 !== "string"){const err6 = {keyword:"type",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(!(((data4 === "translate") || (data4 === "duplicate")) || (data4 === "none"))){const err7 = {keyword:"enum",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/1/enum",params:{allowedValues: schema25.properties.i18n.oneOf[1].enum},message:"should be equal to one of the allowed values"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid0 = _errs13 === errors;if(_valid0 && valid1){valid1 = false;passing0 = [passing0, 1];}else {if(_valid0){valid1 = true;passing0 = 1;}}if(!valid1){const err8 = {keyword:"oneOf",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf",params:{passingSchemas: passing0},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}}}if(data.hint !== undefined){if(typeof data.hint !== "string"){const err9 = {keyword:"type",dataPath:dataPath+"/hint",schemaPath:"#/properties/hint/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.pattern !== undefined){let data6 = data.pattern;if(Array.isArray(data6)){if(data6.length < 2){const err10 = {keyword:"minItems",dataPath:dataPath+"/pattern",schemaPath:"#/properties/pattern/minItems",params:{limit: 2},message:"should NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len0 = data6.length;if(len0 > 0){const _errs20 = errors;let valid3 = false;let passing1 = null;const _errs21 = errors;if(typeof data6[0] !== "string"){const err11 = {keyword:"type",dataPath:dataPath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/0/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid1 = _errs21 === errors;if(_valid1){valid3 = true;passing1 = 0;}var _valid1 = true;if(_valid1 && valid3){valid3 = false;passing1 = [passing1, 1];}else {if(_valid1){valid3 = true;passing1 = 1;}}if(!valid3){const err12 = {keyword:"oneOf",dataPath:dataPath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf",params:{passingSchemas: passing1},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {errors = _errs20;if(vErrors !== null){if(_errs20){vErrors.length = _errs20;}else {vErrors = null;}}}}if(len0 > 1){if(typeof data6[1] !== "string"){const err13 = {keyword:"type",dataPath:dataPath+"/pattern/1",schemaPath:"#/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {keyword:"type",dataPath:dataPath+"/pattern",schemaPath:"#/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.field !== undefined){if(!(wrapper4.validate(data.field, {dataPath:dataPath+"/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(!(validate29(data.fields, {dataPath:dataPath+"/fields",parentData:data,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);errors = vErrors.length;}}if(data.types !== undefined){if(!(validate29(data.types, {dataPath:dataPath+"/types",parentData:data,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);errors = vErrors.length;}}}else {const err15 = {keyword:"type",dataPath,schemaPath:"#/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}validate28.errors = vErrors;return errors === 0;}function validate20(data, {dataPath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="https://netlify-cms/object.json" */;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 = {keyword:"required",dataPath,schemaPath:"#/anyOf/0/required",params:{missingProperty: "media_folder"},message:"should 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 = {keyword:"required",dataPath,schemaPath:"#/anyOf/1/required",params:{missingProperty: "media_library"},message:"should 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 = {keyword:"anyOf",dataPath,schemaPath:"#/anyOf",params:{},message:"should match some 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 = {keyword:"required",dataPath,schemaPath:"#/required",params:{missingProperty: "backend"},message:"should have required property '"+"backend"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.collections === undefined){const err4 = {keyword:"required",dataPath,schemaPath:"#/required",params:{missingProperty: "collections"},message:"should 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 = {keyword:"required",dataPath:dataPath+"/backend",schemaPath:"#/properties/backend/required",params:{missingProperty: "name"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/backend/name",schemaPath:"#/properties/backend/properties/name/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/backend/auth_scope",schemaPath:"#/properties/backend/properties/auth_scope/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(!((data2 === "repo") || (data2 === "public_repo"))){const err8 = {keyword:"enum",dataPath:dataPath+"/backend/auth_scope",schemaPath:"#/properties/backend/properties/auth_scope/enum",params:{allowedValues: schema22.properties.backend.properties.auth_scope.enum},message:"should 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(func9(data3) < 1){const err9 = {keyword:"minLength",dataPath:dataPath+"/backend/cms_label_prefix",schemaPath:"#/properties/backend/properties/cms_label_prefix/minLength",params:{limit: 1},message:"should NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {keyword:"type",dataPath:dataPath+"/backend/cms_label_prefix",schemaPath:"#/properties/backend/properties/cms_label_prefix/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/backend/open_authoring",schemaPath:"#/properties/backend/properties/open_authoring/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {keyword:"type",dataPath:dataPath+"/backend",schemaPath:"#/properties/backend/type",params:{type: "object"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/local_backend",schemaPath:"#/properties/local_backend/oneOf/0/type",params:{type: "boolean"},message:"should 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 = {keyword:"additionalProperties",dataPath:dataPath+"/local_backend",schemaPath:"#/properties/local_backend/oneOf/1/additionalProperties",params:{additionalProperty: key0},message:"should 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 = {keyword:"type",dataPath:dataPath+"/local_backend/url",schemaPath:"#/properties/local_backend/oneOf/1/properties/url/type",params:{type: "string"},message:"should 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 = {keyword:"maxLength",dataPath:dataPath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/maxLength",params:{limit: 10},message:"should NOT have more than 10 characters"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(func9(data13) < 2){const err27 = {keyword:"minLength",dataPath:dataPath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/minLength",params:{limit: 2},message:"should NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(!pattern0.test(data13)){const err28 = {keyword:"pattern",dataPath:dataPath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"should match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}else {const err29 = {keyword:"type",dataPath:dataPath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/type",params:{type: "string"},message:"should 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 = {keyword:"uniqueItems",dataPath:dataPath+"/i18n/locales",schemaPath:"#/properties/i18n/properties/locales/uniqueItems",params:{i: i2, j: j0},message:"should 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 = {keyword:"type",dataPath:dataPath+"/i18n/locales",schemaPath:"#/properties/i18n/properties/locales/type",params:{type: "array"},message:"should 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(func9(data14) > 10){const err32 = {keyword:"maxLength",dataPath:dataPath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/maxLength",params:{limit: 10},message:"should NOT have more than 10 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(func9(data14) < 2){const err33 = {keyword:"minLength",dataPath:dataPath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/minLength",params:{limit: 2},message:"should NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}if(!pattern0.test(data14)){const err34 = {keyword:"pattern",dataPath:dataPath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"should match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}else {const err35 = {keyword:"type",dataPath:dataPath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}}else {const err36 = {keyword:"type",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/type",params:{type: "object"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/site_url",schemaPath:"#/properties/site_url/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/display_url",schemaPath:"#/properties/display_url/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/logo_url",schemaPath:"#/properties/logo_url/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/show_preview_links",schemaPath:"#/properties/show_preview_links/type",params:{type: "boolean"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/media_folder",schemaPath:"#/properties/media_folder/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/public_folder",schemaPath:"#/properties/public_folder/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/media_folder_relative",schemaPath:"#/properties/media_folder_relative/type",params:{type: "boolean"},message:"should 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 = {keyword:"required",dataPath:dataPath+"/media_library",schemaPath:"#/properties/media_library/required",params:{missingProperty: "name"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/media_library/name",schemaPath:"#/properties/media_library/properties/name/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/media_library/config",schemaPath:"#/properties/media_library/properties/config/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}}else {const err47 = {keyword:"type",dataPath:dataPath+"/media_library",schemaPath:"#/properties/media_library/type",params:{type: "object"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/publish_mode",schemaPath:"#/properties/publish_mode/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}if(!((data25 === "simple") || (data25 === "editorial_workflow"))){const err49 = {keyword:"enum",dataPath:dataPath+"/publish_mode",schemaPath:"#/properties/publish_mode/enum",params:{allowedValues: schema22.properties.publish_mode.enum},message:"should 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 = {keyword:"type",dataPath:dataPath+"/slug/encoding",schemaPath:"#/properties/slug/properties/encoding/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}if(!((data27 === "unicode") || (data27 === "ascii"))){const err51 = {keyword:"enum",dataPath:dataPath+"/slug/encoding",schemaPath:"#/properties/slug/properties/encoding/enum",params:{allowedValues: schema22.properties.slug.properties.encoding.enum},message:"should 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 = {keyword:"type",dataPath:dataPath+"/slug/clean_accents",schemaPath:"#/properties/slug/properties/clean_accents/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}}else {const err53 = {keyword:"type",dataPath:dataPath+"/slug",schemaPath:"#/properties/slug/type",params:{type: "object"},message:"should 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 = {keyword:"minItems",dataPath:dataPath+"/collections",schemaPath:"#/properties/collections/minItems",params:{limit: 1},message:"should 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 _errs136 = errors;let valid31 = false;let passing3 = null;const _errs137 = errors;if(typeof data55[0] !== "string"){const err98 = {keyword:"type",dataPath:dataPath+"/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",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}var _valid6 = _errs137 === errors;if(_valid6){valid31 = true;passing3 = 0;}var _valid6 = true;if(_valid6 && valid31){valid31 = false;passing3 = [passing3, 1];}else {if(_valid6){valid31 = true;passing3 = 1;}}if(!valid31){const err99 = {keyword:"oneOf",dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/pattern/0",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf",params:{passingSchemas: passing3},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}else {errors = _errs136;if(vErrors !== null){if(_errs136){vErrors.length = _errs136;}else {vErrors = null;}}}}if(len5 > 1){if(typeof data55[1] !== "string"){const err100 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/pattern/1",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}}else {const err101 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/pattern",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}if(data48.field !== undefined){if(!(validate21(data48.field, {dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/field",parentData:data48,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);errors = vErrors.length;}}if(data48.fields !== undefined){if(!(validate22(data48.fields, {dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/fields",parentData:data48,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data48.types !== undefined){if(!(validate22(data48.types, {dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/types",parentData:data48,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}}else {const err102 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5,schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}}else {const err103 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}}else {const err104 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files/" + i4,schemaPath:"#/properties/collections/items/properties/files/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}}else {const err105 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files",schemaPath:"#/properties/collections/items/properties/files/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}if(data30.identifier_field !== undefined){if(typeof data30.identifier_field !== "string"){const err106 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/identifier_field",schemaPath:"#/properties/collections/items/properties/identifier_field/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}if(data30.summary !== undefined){if(typeof data30.summary !== "string"){const err107 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/summary",schemaPath:"#/properties/collections/items/properties/summary/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}if(data30.slug !== undefined){if(typeof data30.slug !== "string"){const err108 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/slug",schemaPath:"#/properties/collections/items/properties/slug/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}if(data30.path !== undefined){if(typeof data30.path !== "string"){const err109 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/path",schemaPath:"#/properties/collections/items/properties/path/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}if(data30.preview_path !== undefined){if(typeof data30.preview_path !== "string"){const err110 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/preview_path",schemaPath:"#/properties/collections/items/properties/preview_path/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(data30.preview_path_date_field !== undefined){if(typeof data30.preview_path_date_field !== "string"){const err111 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/preview_path_date_field",schemaPath:"#/properties/collections/items/properties/preview_path_date_field/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}if(data30.create !== undefined){if(typeof data30.create !== "boolean"){const err112 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/create",schemaPath:"#/properties/collections/items/properties/create/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}if(data30.publish !== undefined){if(typeof data30.publish !== "boolean"){const err113 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/publish",schemaPath:"#/properties/collections/items/properties/publish/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(data30.hide !== undefined){if(typeof data30.hide !== "boolean"){const err114 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/hide",schemaPath:"#/properties/collections/items/properties/hide/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}if(data30.editor !== undefined){let data70 = data30.editor;if(data70 && typeof data70 == "object" && !Array.isArray(data70)){if(data70.preview !== undefined){if(typeof data70.preview !== "boolean"){const err115 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/editor/preview",schemaPath:"#/properties/collections/items/properties/editor/properties/preview/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}}else {const err116 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/editor",schemaPath:"#/properties/collections/items/properties/editor/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data30.format !== undefined){let data72 = data30.format;if(typeof data72 !== "string"){const err117 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/format",schemaPath:"#/properties/collections/items/properties/format/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}if(!((((((((data72 === "yml") || (data72 === "yaml")) || (data72 === "toml")) || (data72 === "json")) || (data72 === "frontmatter")) || (data72 === "json-frontmatter")) || (data72 === "toml-frontmatter")) || (data72 === "yaml-frontmatter"))){const err118 = {keyword:"enum",dataPath:dataPath+"/collections/" + i3+"/format",schemaPath:"#/properties/collections/items/properties/format/enum",params:{allowedValues: schema22.properties.collections.items.properties.format.enum},message:"should be equal to one of the allowed values"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data30.extension !== undefined){if(typeof data30.extension !== "string"){const err119 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/extension",schemaPath:"#/properties/collections/items/properties/extension/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}if(data30.frontmatter_delimiter !== undefined){let data74 = data30.frontmatter_delimiter;if((typeof data74 !== "string") && (!(Array.isArray(data74)))){const err120 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/frontmatter_delimiter",schemaPath:"#/properties/collections/items/properties/frontmatter_delimiter/type",params:{type: schema22.properties.collections.items.properties.frontmatter_delimiter.type},message:"should be string,array"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}if(Array.isArray(data74)){if(data74.length > 2){const err121 = {keyword:"maxItems",dataPath:dataPath+"/collections/" + i3+"/frontmatter_delimiter",schemaPath:"#/properties/collections/items/properties/frontmatter_delimiter/maxItems",params:{limit: 2},message:"should NOT have more than 2 items"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}if(data74.length < 2){const err122 = {keyword:"minItems",dataPath:dataPath+"/collections/" + i3+"/frontmatter_delimiter",schemaPath:"#/properties/collections/items/properties/frontmatter_delimiter/minItems",params:{limit: 2},message:"should NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}const len6 = data74.length;for(let i6=0; i6 0){const _errs197 = errors;let valid40 = false;let passing5 = null;const _errs198 = errors;if(typeof data84[0] !== "string"){const err136 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}var _valid8 = _errs198 === errors;if(_valid8){valid40 = true;passing5 = 0;}var _valid8 = true;if(_valid8 && valid40){valid40 = false;passing5 = [passing5, 1];}else {if(_valid8){valid40 = true;passing5 = 1;}}if(!valid40){const err137 = {keyword:"oneOf",dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf",params:{passingSchemas: passing5},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}else {errors = _errs197;if(vErrors !== null){if(_errs197){vErrors.length = _errs197;}else {vErrors = null;}}}}if(len8 > 1){if(typeof data84[1] !== "string"){const err138 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/pattern/1",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}}else {const err139 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/pattern",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}if(data77.field !== undefined){if(!(validate28(data77.field, {dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/field",parentData:data77,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? validate28.errors : vErrors.concat(validate28.errors);errors = vErrors.length;}}if(data77.fields !== undefined){if(!(validate29(data77.fields, {dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/fields",parentData:data77,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);errors = vErrors.length;}}if(data77.types !== undefined){if(!(validate29(data77.types, {dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/types",parentData:data77,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);errors = vErrors.length;}}}else {const err140 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/fields/" + i7,schemaPath:"#/properties/collections/items/properties/fields/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}}else {const err141 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/fields",schemaPath:"#/properties/collections/items/properties/fields/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}if(data30.sortable_fields !== undefined){let data90 = data30.sortable_fields;if(Array.isArray(data90)){const len9 = data90.length;for(let i8=0; i8 1000 || isNaN(data105)){const err168 = {keyword:"maximum",dataPath:dataPath+"/collections/" + i3+"/nested/depth",schemaPath:"#/properties/collections/items/properties/nested/properties/depth/maximum",params:{comparison: "<=", limit: 1000},message:"should be <= 1000"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}if(data105 < 1 || isNaN(data105)){const err169 = {keyword:"minimum",dataPath:dataPath+"/collections/" + i3+"/nested/depth",schemaPath:"#/properties/collections/items/properties/nested/properties/depth/minimum",params:{comparison: ">=", limit: 1},message:"should be >= 1"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}else {const err170 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/nested/depth",schemaPath:"#/properties/collections/items/properties/nested/properties/depth/type",params:{type: "number"},message:"should be number"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}if(data104.summary !== undefined){if(typeof data104.summary !== "string"){const err171 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/nested/summary",schemaPath:"#/properties/collections/items/properties/nested/properties/summary/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}}else {const err172 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/nested",schemaPath:"#/properties/collections/items/properties/nested/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}if(data30.meta !== undefined){let data107 = data30.meta;if(data107 && typeof data107 == "object" && !Array.isArray(data107)){if(Object.keys(data107).length < 1){const err173 = {keyword:"minProperties",dataPath:dataPath+"/collections/" + i3+"/meta",schemaPath:"#/properties/collections/items/properties/meta/minProperties",params:{limit: 1},message:"should NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}for(const key3 in data107){if(!(key3 === "path")){const err174 = {keyword:"additionalProperties",dataPath:dataPath+"/collections/" + i3+"/meta",schemaPath:"#/properties/collections/items/properties/meta/additionalProperties",params:{additionalProperty: key3},message:"should NOT have additional properties"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}if(data107.path !== undefined){let data108 = data107.path;if(data108 && typeof data108 == "object" && !Array.isArray(data108)){if(data108.label === undefined){const err175 = {keyword:"required",dataPath:dataPath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/required",params:{missingProperty: "label"},message:"should have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}if(data108.widget === undefined){const err176 = {keyword:"required",dataPath:dataPath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/required",params:{missingProperty: "widget"},message:"should have required property '"+"widget"+"'"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}if(data108.index_file === undefined){const err177 = {keyword:"required",dataPath:dataPath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/required",params:{missingProperty: "index_file"},message:"should have required property '"+"index_file"+"'"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}if(data108.label !== undefined){if(typeof data108.label !== "string"){const err178 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/meta/path/label",schemaPath:"#/properties/collections/items/properties/meta/properties/path/properties/label/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}if(data108.widget !== undefined){if(typeof data108.widget !== "string"){const err179 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/meta/path/widget",schemaPath:"#/properties/collections/items/properties/meta/properties/path/properties/widget/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(data108.index_file !== undefined){if(typeof data108.index_file !== "string"){const err180 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/meta/path/index_file",schemaPath:"#/properties/collections/items/properties/meta/properties/path/properties/index_file/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}}else {const err181 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}}else {const err182 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/meta",schemaPath:"#/properties/collections/items/properties/meta/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data30.i18n !== undefined){let data112 = data30.i18n;const _errs257 = errors;let valid55 = false;let passing7 = null;const _errs258 = errors;if(typeof data112 !== "boolean"){const err183 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/0/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}var _valid10 = _errs258 === errors;if(_valid10){valid55 = true;passing7 = 0;}const _errs260 = errors;if(data112 && typeof data112 == "object" && !Array.isArray(data112)){if(data112.structure !== undefined){let data113 = data112.structure;if(typeof data113 !== "string"){const err184 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n/structure",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}if(!(((data113 === "multiple_folders") || (data113 === "multiple_files")) || (data113 === "single_file"))){const err185 = {keyword:"enum",dataPath:dataPath+"/collections/" + i3+"/i18n/structure",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum",params:{allowedValues: schema22.properties.collections.items.properties.i18n.oneOf[1].properties.structure.enum},message:"should be equal to one of the allowed values"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}if(data112.locales !== undefined){let data114 = data112.locales;if(Array.isArray(data114)){if(data114.length < 2){const err186 = {keyword:"minItems",dataPath:dataPath+"/collections/" + i3+"/i18n/locales",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/minItems",params:{limit: 2},message:"should NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}const len13 = data114.length;for(let i12=0; i12 10){const err187 = {keyword:"maxLength",dataPath:dataPath+"/collections/" + i3+"/i18n/locales/" + i12,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/maxLength",params:{limit: 10},message:"should NOT have more than 10 characters"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}if(func9(data115) < 2){const err188 = {keyword:"minLength",dataPath:dataPath+"/collections/" + i3+"/i18n/locales/" + i12,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/minLength",params:{limit: 2},message:"should NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}if(!pattern0.test(data115)){const err189 = {keyword:"pattern",dataPath:dataPath+"/collections/" + i3+"/i18n/locales/" + i12,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"should match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}else {const err190 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n/locales/" + i12,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}let i13 = data114.length;let j1;if(i13 > 1){const indices1 = {};for(;i13--;){let item1 = data114[i13];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j1 = indices1[item1];const err191 = {keyword:"uniqueItems",dataPath:dataPath+"/collections/" + i3+"/i18n/locales",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems",params:{i: i13, j: j1},message:"should NOT have duplicate items (items ## "+j1+" and "+i13+" are identical)"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;break;}indices1[item1] = i13;}}}else {const err192 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n/locales",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}if(data112.default_locale !== undefined){let data116 = data112.default_locale;if(typeof data116 === "string"){if(func9(data116) > 10){const err193 = {keyword:"maxLength",dataPath:dataPath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/maxLength",params:{limit: 10},message:"should NOT have more than 10 characters"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}if(func9(data116) < 2){const err194 = {keyword:"minLength",dataPath:dataPath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/minLength",params:{limit: 2},message:"should NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}if(!pattern0.test(data116)){const err195 = {keyword:"pattern",dataPath:dataPath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"should match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}else {const err196 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}}}else {const err197 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}var _valid10 = _errs260 === errors;if(_valid10 && valid55){valid55 = false;passing7 = [passing7, 1];}else {if(_valid10){valid55 = true;passing7 = 1;}}if(!valid55){const err198 = {keyword:"oneOf",dataPath:dataPath+"/collections/" + i3+"/i18n",schemaPath:"#/properties/collections/items/properties/i18n/oneOf",params:{passingSchemas: passing7},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}else {errors = _errs257;if(vErrors !== null){if(_errs257){vErrors.length = _errs257;}else {vErrors = null;}}}}}else {const err199 = {keyword:"type",dataPath:dataPath+"/collections/" + i3,schemaPath:"#/properties/collections/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}}else {const err200 = {keyword:"type",dataPath:dataPath+"/collections",schemaPath:"#/properties/collections/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}if(data.editor !== undefined){let data117 = data.editor;if(data117 && typeof data117 == "object" && !Array.isArray(data117)){if(data117.preview !== undefined){if(typeof data117.preview !== "boolean"){const err201 = {keyword:"type",dataPath:dataPath+"/editor/preview",schemaPath:"#/properties/editor/properties/preview/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}}else {const err202 = {keyword:"type",dataPath:dataPath+"/editor",schemaPath:"#/properties/editor/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}}else {const err203 = {keyword:"type",dataPath,schemaPath:"#/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}validate20.errors = vErrors;return errors === 0;} \ No newline at end of file diff --git a/packages/netlify-cms-core/writeValidateSchema.js b/packages/netlify-cms-core/writeValidateSchema.js new file mode 100644 index 000000000000..cc92938a69d6 --- /dev/null +++ b/packages/netlify-cms-core/writeValidateSchema.js @@ -0,0 +1,43 @@ +'use strict'; + +const fs = require("fs") +const path = require("path") +const AJV = require('ajv'); +const ajvErrors = require('ajv-errors'); +const ajv = new AJV({ + allErrors: true, + $data: true, + code: { source: true }, + strict: false +}); +const { + select, + uniqueItemProperties, + prohibited, +} = require('ajv-keywords/dist/keywords'); +const standaloneCode = require("ajv/dist/standalone").default + +const schema = require('./config.schema.json'); + +uniqueItemProperties(ajv); +select(ajv); +prohibited(ajv); +ajvErrors(ajv); + +// 1. generate module with a single default export (CommonJS and ESM compatible): +const validate = ajv.compile(schema) +let moduleCode = standaloneCode(ajv, validate) + +// 2. pass map of schema IDs to generate multiple exports, +// it avoids code duplication if schemas are mutually recursive or have some share elements: +moduleCode = standaloneCode(ajv, { + validateObject: "https://netlify-cms/object.json", +}) + +// 3. or generate module with all schemas added to the instance (excluding meta-schemas), +// export names would use schema IDs (or keys passed to addSchema method): +moduleCode = standaloneCode(ajv); + +console.dir({moduleCode}) + +fs.writeFileSync(path.join(__dirname, "./src/constants/validateSchema.js"), moduleCode) \ No newline at end of file diff --git a/scripts/webpack.js b/scripts/webpack.js index 922d6f2cc4b3..d3a1b9fca739 100644 --- a/scripts/webpack.js +++ b/scripts/webpack.js @@ -39,22 +39,6 @@ function rules() { exclude: [/node_modules/], use: 'svg-inline-loader', }), - json: () => ({ - test: /\.schema\.json$/, - use: [ - { - loader: 'ajv-json-loader', - options: { - ajv: { - allErrors: true, - $data: true, - strict: false, - }, - }, - }, - ], - type: 'javascript/auto', - }), }; } diff --git a/website/package.json b/website/package.json index e298d152a5af..4a52b0497359 100644 --- a/website/package.json +++ b/website/package.json @@ -47,8 +47,8 @@ "devDependencies": { "babel-plugin-prismjs": "^2.0.1", "babel-preset-gatsby": "^1.0.0", - "eslint": "^7.4.0", - "eslint-plugin-import": "^2.20.1", + "eslint": "^8.5.0", + "eslint-plugin-import": "^2.25.3", "markdownlint-cli": "^0.30.0" }, "private": true diff --git a/yarn.lock b/yarn.lock index d53709539ce2..c6e1469004c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,13 +18,6 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - "@babel/code-frame@7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" @@ -325,7 +318,7 @@ "@babel/traverse" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/highlight@^7.0.0", "@babel/highlight@^7.10.4": +"@babel/highlight@^7.0.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== @@ -1685,18 +1678,18 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46" integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA== -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== +"@eslint/eslintrc@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318" + integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ== dependencies: ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" + debug "^4.3.2" + espree "^9.2.0" globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" - js-yaml "^3.13.1" + js-yaml "^4.1.0" minimatch "^3.0.4" strip-json-comments "^3.1.1" @@ -1745,16 +1738,16 @@ dependencies: "@hapi/hoek" "^9.0.0" -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== +"@humanwhocodes/config-array@^0.9.2": + version "0.9.2" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914" + integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA== dependencies: - "@humanwhocodes/object-schema" "^1.2.0" + "@humanwhocodes/object-schema" "^1.2.1" debug "^4.1.1" minimatch "^3.0.4" -"@humanwhocodes/object-schema@^1.2.0": +"@humanwhocodes/object-schema@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== @@ -4397,15 +4390,15 @@ acorn@^6.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -acorn@^7.1.1, acorn@^7.4.0: +acorn@^7.1.1: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1: - version "8.7.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" - integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== +acorn@^8.2.4, acorn@^8.4.1, acorn@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" + integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== add-stream@^1.0.0: version "1.0.0" @@ -4464,6 +4457,19 @@ airbnb-js-shims@^2.2.1: string.prototype.padstart "^3.0.0" symbol.prototype.description "^1.0.0" +ajv-cli@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/ajv-cli/-/ajv-cli-4.2.0.tgz#f2c371edfd9c999f2a9e0afdd5675eede8e16544" + integrity sha512-3Ab8Kuh7QnyXxg+v4NFzah1LLBHgYBUVtJZC8bOaDAdl766kT6Usw5f+g8UcFN+24lYIbchaQBQ+uUntYpBEyQ== + dependencies: + ajv "^7.2.1" + fast-json-patch "^2.0.0" + glob "^7.1.0" + js-yaml "^3.14.0" + json-schema-migrate "^1.1.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" @@ -4474,51 +4480,22 @@ ajv-errors@^3.0.0: resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-3.0.0.tgz#e54f299f3a3d30fe144161e5f0d8d51196c527bc" integrity sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ== -ajv-json-loader@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/ajv-json-loader/-/ajv-json-loader-0.2.0.tgz#0b14a979ed9efc6357e4d469fb8054533c4bcf06" - integrity sha512-fzuRE07FSr5OvEZLCejOTTTl//Iraxk5bvi9xY5G1Ajfj92AsaGAwPrfijDuVJ0y/X6hpqir3NFtjXooBCMdIQ== - dependencies: - ajv "^8.8.2" - assert-ts "^0.3.4" - loader-utils "^2.0.2" - ajv-keywords@^3.1.0, ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv-keywords@^5.0.0: +ajv-keywords@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== 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, ajv@^6.12.6: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^8.0.1, ajv@^8.8.2: - version "8.8.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb" - integrity sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw== +ajv@7.0.3, ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6, ajv@^7.0.0-beta.9, ajv@^7.2.1, ajv@^8.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.0.3.tgz#13ae747eff125cafb230ac504b2406cf371eece2" + integrity sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -4942,11 +4919,6 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assert-ts@^0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/assert-ts/-/assert-ts-0.3.4.tgz#a452d6c9fc88e543bffded343a32deb48573ddf2" - integrity sha512-CQtNOdOCzzZfE3TF9a1vFTcz4ZfJYM6iHoWYCkpFY3wdk6CkFvevuLwpOFVL/KMJ9vCNIbeidWH5uo/Y8sLVWg== - assert@^1.1.1: version "1.5.0" resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" @@ -7398,7 +7370,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6. dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1, debug@^4.3.2: +debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1, debug@^4.3.2: version "4.3.3" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== @@ -8282,7 +8254,7 @@ escodegen@^2.0.0: optionalDependencies: source-map "~0.6.1" -eslint-config-prettier@^8.0.0: +eslint-config-prettier@^8.3.0: version "8.3.0" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz#f7471b20b6fe8a9a9254cc684454202886a2dd7a" integrity sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew== @@ -8303,38 +8275,38 @@ eslint-module-utils@^2.7.2: debug "^3.2.7" find-up "^2.1.0" -eslint-plugin-babel@^5.3.0: +eslint-plugin-babel@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.1.tgz#75a2413ffbf17e7be57458301c60291f2cfbf560" integrity sha512-VsQEr6NH3dj664+EyxJwO4FCYm/00JhYb3Sk3ft8o+fpKuIfQ9TaW6uVUfvwMXHcf/lsnRIoyFPsLMyiWCSL/g== dependencies: eslint-rule-composer "^0.3.0" -eslint-plugin-cypress@^2.6.0: +eslint-plugin-cypress@^2.12.1: version "2.12.1" resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.12.1.tgz#9aeee700708ca8c058e00cdafe215199918c2632" integrity sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA== dependencies: globals "^11.12.0" -eslint-plugin-import@^2.18.2: - version "2.25.4" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz#322f3f916a4e9e991ac7af32032c25ce313209f1" - integrity sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA== +eslint-plugin-import@^2.25.3: + version "2.25.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz#a554b5f66e08fb4f6dc99221866e57cfff824766" + integrity sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg== dependencies: array-includes "^3.1.4" array.prototype.flat "^1.2.5" debug "^2.6.9" doctrine "^2.1.0" eslint-import-resolver-node "^0.3.6" - eslint-module-utils "^2.7.2" + eslint-module-utils "^2.7.1" has "^1.0.3" is-core-module "^2.8.0" is-glob "^4.0.3" minimatch "^3.0.4" object.values "^1.1.5" resolve "^1.20.0" - tsconfig-paths "^3.12.0" + tsconfig-paths "^3.11.0" eslint-plugin-prettier@^4.0.0: version "4.0.0" @@ -8343,10 +8315,10 @@ eslint-plugin-prettier@^4.0.0: dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-react@^7.17.0: - version "7.28.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz#8f3ff450677571a659ce76efc6d80b6a525adbdf" - integrity sha512-IOlFIRHzWfEQQKcAD4iyYDndHwTQiCMcJVJjxempf203jnNLUnW34AXLrV33+nEXoifJE2ZEGmcjKPL8957eSw== +eslint-plugin-react@^7.27.1: + version "7.27.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.27.1.tgz#469202442506616f77a854d91babaae1ec174b45" + integrity sha512-meyunDjMMYeWr/4EBLTV1op3iSG3mjT/pz5gti38UzfM4OPpNc2m0t2xvKCOMU5D6FSdd34BIMFOvQbW+i8GAA== dependencies: array-includes "^3.1.4" array.prototype.flatmap "^1.2.5" @@ -8392,12 +8364,13 @@ eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== +eslint-scope@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" + integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg== dependencies: - eslint-visitor-keys "^1.1.0" + esrecurse "^4.3.0" + estraverse "^5.2.0" eslint-utils@^3.0.0: version "3.0.0" @@ -8406,7 +8379,7 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: +eslint-visitor-keys@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== @@ -8416,42 +8389,41 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.0.0: +eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== -eslint@^7.0.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== +eslint@^8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.5.0.tgz#ddd2c1afd8f412036f87ae2a063d2aa296d3175f" + integrity sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg== dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" + "@eslint/eslintrc" "^1.0.5" + "@humanwhocodes/config-array" "^0.9.2" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" - debug "^4.0.1" + debug "^4.3.2" doctrine "^3.0.0" enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" + eslint-scope "^7.1.0" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.1.0" + espree "^9.2.0" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" + glob-parent "^6.0.1" globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^3.13.1" + js-yaml "^4.1.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" @@ -8459,11 +8431,10 @@ eslint@^7.0.0: natural-compare "^1.4.0" optionator "^0.9.1" progress "^2.0.0" - regexpp "^3.1.0" + regexpp "^3.2.0" semver "^7.2.1" - strip-ansi "^6.0.0" + strip-ansi "^6.0.1" strip-json-comments "^3.1.0" - table "^6.0.9" text-table "^0.2.0" v8-compile-cache "^2.0.3" @@ -8472,14 +8443,14 @@ esm@^3.2.25: resolved "https://registry.yarnpkg.com/esm/-/esm-3.2.25.tgz#342c18c29d56157688ba5ce31f8431fbb795cc10" integrity sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA== -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== +espree@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.2.0.tgz#c50814e01611c2d0f8bd4daa83c369eabba80dbc" + integrity sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg== dependencies: - acorn "^7.4.0" + acorn "^8.6.0" acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" + eslint-visitor-keys "^3.1.0" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" @@ -8831,6 +8802,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" @@ -9546,12 +9524,19 @@ glob-parent@^5.1.1, glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + glob-to-regexp@^0.3.0: version "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== @@ -11786,7 +11771,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== @@ -11794,7 +11779,7 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.0.0: +js-yaml@^4.0.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== @@ -11878,10 +11863,12 @@ 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-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema-migrate@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/json-schema-migrate/-/json-schema-migrate-1.1.0.tgz#3e886c38a8efdc9fd3c831d450595c5ab7a36b17" + integrity sha512-PggRuqHB+k1OMz0N1vXCMmwwr8cAsKWVOG5jZh1I2xSyePpRoBG6xOlWG50qe2Ca3hxfWWqZHLEYqJw2/4765g== + dependencies: + ajv "^7.0.0-beta.9" json-schema-traverse@^1.0.0: version "1.0.0" @@ -11913,7 +11900,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== @@ -12244,7 +12231,7 @@ loader-utils@^1.0.0, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4 emojis-list "^3.0.0" json5 "^1.0.1" -loader-utils@^2.0.0, loader-utils@^2.0.2: +loader-utils@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129" integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A== @@ -15944,7 +15931,7 @@ regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.3.1: call-bind "^1.0.2" define-properties "^1.1.3" -regexpp@^3.1.0, regexpp@^3.2.0: +regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -17818,7 +17805,7 @@ sywac@^1.2.2: resolved "https://registry.yarnpkg.com/sywac/-/sywac-1.3.0.tgz#324789bdb8bd7d0d66625c9144fce81ab5ba6f99" integrity sha512-LDt2stNTp4bVPMgd70Jj9PWrSa4batl+bv+Ea5NLNGT7ufc4oQPtRfQ73wbddNV6RilaPqnEt6y1Wkm5FVTNEg== -table@^6.0.9, table@^6.6.0: +table@^6.6.0: version "6.7.5" resolved "https://registry.yarnpkg.com/table/-/table-6.7.5.tgz#f04478c351ef3d8c7904f0e8be90a1b62417d238" integrity sha512-LFNeryOqiQHqCVKzhkymKwt6ozeRhlm8IL1mE8rNUurkir4heF6PzMyRgaTa4tlyPTGGgXuvVOF/OLWiH09Lqw== From e54c8e1835f064f899a3560fa05e04545d511591 Mon Sep 17 00:00:00 2001 From: Paul Cowan Date: Mon, 3 Jan 2022 15:52:05 +0000 Subject: [PATCH 03/20] chore(csp): rollback ajv versions --- package.json | 9 +- packages/netlify-cms-core/package.json | 8 +- .../netlify-cms-core/src/actions/config.ts | 2 - .../src/constants/configSchema.js | 2 +- .../src/constants/validateSchema.js | 7725 ++++++++++++++++- website/package.json | 4 +- yarn.lock | 263 +- 7 files changed, 7917 insertions(+), 96 deletions(-) diff --git a/package.json b/package.json index 0119fea96da8..864ea1a98411 100644 --- a/package.json +++ b/package.json @@ -126,11 +126,11 @@ "cypress-jest-adapter": "^0.1.1", "cypress-plugin-tab": "^1.0.0", "dotenv": "^10.0.0", - "eslint": "^8.5.0", - "eslint-plugin-cypress": "^2.12.1", - "eslint-plugin-import": "^2.25.3", + "eslint": "^7.0.0", + "eslint-plugin-cypress": "^2.6.0", + "eslint-plugin-import": "^2.18.2", "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-react": "^7.27.1", + "eslint-plugin-react": "^7.17.0", "execa": "^5.0.0", "friendly-errors-webpack-plugin": "^1.7.0", "fs-extra": "^10.0.0", @@ -190,7 +190,6 @@ } }, "resolutions": { - "ajv": "7.0.3", "react-redux": "^7.2.0" } } diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index b461a1907b31..ba8e345a990a 100644 --- a/packages/netlify-cms-core/package.json +++ b/packages/netlify-cms-core/package.json @@ -17,7 +17,7 @@ "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\"", - "write-validate-schema": "NODE_ENV=production node ./writeValidateSchema.js" + "write-validate-schema": "NODE_ENV=production ajv compile --all-errors -s ./config.schema.json -o ./src/constants/validateSchema.js" }, "keywords": [ "netlify", @@ -27,9 +27,9 @@ "license": "MIT", "dependencies": { "@iarna/toml": "2.2.5", - "ajv": "7.0.3", + "ajv": "8.1.0", "ajv-errors": "^3.0.0", - "ajv-keywords": "^5.1.0", + "ajv-keywords": "^5.0.0", "copy-text-to-clipboard": "^3.0.0", "deepmerge": "^4.2.2", "diacritics": "^1.3.0", @@ -96,7 +96,7 @@ "@types/history": "^4.7.8", "@types/redux-mock-store": "^1.0.2", "@types/url-join": "^4.0.0", - "ajv-cli": "^4.2.0", + "ajv-cli": "3.1.0", "redux-mock-store": "^1.5.3" } } diff --git a/packages/netlify-cms-core/src/actions/config.ts b/packages/netlify-cms-core/src/actions/config.ts index 31c52c9738e5..3bb3a1cb937b 100644 --- a/packages/netlify-cms-core/src/actions/config.ts +++ b/packages/netlify-cms-core/src/actions/config.ts @@ -511,8 +511,6 @@ export function loadConfig(manualConfig: Partial = {}, onLoad: () => ? {} : await getConfigYaml(configUrl, hasManualConfig); - console.log({configYaml}) - // Merge manual config into the config.yml one const mergedConfig = deepmerge(configYaml, manualConfig); diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index 2604e9c72166..260bd492b121 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -434,7 +434,7 @@ export function validateConfig(config) { const customWidgets = Object.keys(getWidgetSchemas()).filter( widgetKey => NativeCMSWidgets.includes(widgetKey) === false, ); - console.debug(customWidgets); + if (customWidgets.length > 0) { console.debug('using dynamic ajv validation'); return dynamicValidateConfig(config); diff --git a/packages/netlify-cms-core/src/constants/validateSchema.js b/packages/netlify-cms-core/src/constants/validateSchema.js index 3e247a3c3015..1442b1caee59 100644 --- a/packages/netlify-cms-core/src/constants/validateSchema.js +++ b/packages/netlify-cms-core/src/constants/validateSchema.js @@ -1 +1,7724 @@ -"use strict";module.exports = validate20;module.exports.default = validate20;const schema22 = {"$id":"https://netlify-cms/object.json","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_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","type":"array","minItems":1,"items":{"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]}},"required":["name","label","file","fields"]},"uniqueItemProperties":["name"]},"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_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","type":"array","minItems":1,"items":{"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["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"]}}},"uniqueItemProperties":["name"]},"editor":{"type":"object","properties":{"preview":{"type":"boolean"}}}},"required":["backend","collections"],"anyOf":[{"required":["media_folder"]},{"required":["media_library"]}]};const func0 = require("ajv/dist/compile/equal");const func9 = require("ajv/dist/compile/ucs2length").default;const pattern0 = new RegExp("^[a-zA-Z-_]+$", "u");const schema23 = {"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]};const wrapper0 = {validate: validate21};const schema24 = {"$id":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","type":"array","minItems":1,"items":{"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]};const wrapper2 = {validate: validate22};function validate22(data, {dataPath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */;let vErrors = null;let errors = 0;if(Array.isArray(data)){if(data.length < 1){const err0 = {keyword:"minItems",dataPath,schemaPath:"#/minItems",params:{limit: 1},message:"should 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 _errs22 = errors;let valid5 = false;let passing1 = null;const _errs23 = errors;if(typeof data7[0] !== "string"){const err12 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/0/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid1 = _errs23 === errors;if(_valid1){valid5 = true;passing1 = 0;}var _valid1 = true;if(_valid1 && valid5){valid5 = false;passing1 = [passing1, 1];}else {if(_valid1){valid5 = true;passing1 = 1;}}if(!valid5){const err13 = {keyword:"oneOf",dataPath:dataPath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf",params:{passingSchemas: passing1},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}else {errors = _errs22;if(vErrors !== null){if(_errs22){vErrors.length = _errs22;}else {vErrors = null;}}}}if(len1 > 1){if(typeof data7[1] !== "string"){const err14 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern/1",schemaPath:"#/items/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}}else {const err15 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern",schemaPath:"#/items/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data0.field !== undefined){if(!(wrapper0.validate(data0.field, {dataPath:dataPath+"/" + 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, {dataPath:dataPath+"/" + 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, {dataPath:dataPath+"/" + i0+"/types",parentData:data0,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? wrapper2.validate.errors : vErrors.concat(wrapper2.validate.errors);errors = vErrors.length;}}}else {const err16 = {keyword:"type",dataPath:dataPath+"/" + i0,schemaPath:"#/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {keyword:"type",dataPath,schemaPath:"#/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate22.errors = vErrors;return errors === 0;}function validate21(data, {dataPath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */;let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.name === undefined){const err0 = {keyword:"required",dataPath,schemaPath:"#/required",params:{missingProperty: "name"},message:"should have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.name !== undefined){if(typeof data.name !== "string"){const err1 = {keyword:"type",dataPath:dataPath+"/name",schemaPath:"#/properties/name/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.label !== undefined){if(typeof data.label !== "string"){const err2 = {keyword:"type",dataPath:dataPath+"/label",schemaPath:"#/properties/label/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.widget !== undefined){if(typeof data.widget !== "string"){const err3 = {keyword:"type",dataPath:dataPath+"/widget",schemaPath:"#/properties/widget/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.required !== undefined){if(typeof data.required !== "boolean"){const err4 = {keyword:"type",dataPath:dataPath+"/required",schemaPath:"#/properties/required/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.i18n !== undefined){let data4 = data.i18n;const _errs10 = errors;let valid1 = false;let passing0 = null;const _errs11 = errors;if(typeof data4 !== "boolean"){const err5 = {keyword:"type",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/0/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var _valid0 = _errs11 === errors;if(_valid0){valid1 = true;passing0 = 0;}const _errs13 = errors;if(typeof data4 !== "string"){const err6 = {keyword:"type",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(!(((data4 === "translate") || (data4 === "duplicate")) || (data4 === "none"))){const err7 = {keyword:"enum",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/1/enum",params:{allowedValues: schema23.properties.i18n.oneOf[1].enum},message:"should be equal to one of the allowed values"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid0 = _errs13 === errors;if(_valid0 && valid1){valid1 = false;passing0 = [passing0, 1];}else {if(_valid0){valid1 = true;passing0 = 1;}}if(!valid1){const err8 = {keyword:"oneOf",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf",params:{passingSchemas: passing0},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}}}if(data.hint !== undefined){if(typeof data.hint !== "string"){const err9 = {keyword:"type",dataPath:dataPath+"/hint",schemaPath:"#/properties/hint/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.pattern !== undefined){let data6 = data.pattern;if(Array.isArray(data6)){if(data6.length < 2){const err10 = {keyword:"minItems",dataPath:dataPath+"/pattern",schemaPath:"#/properties/pattern/minItems",params:{limit: 2},message:"should NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len0 = data6.length;if(len0 > 0){const _errs20 = errors;let valid3 = false;let passing1 = null;const _errs21 = errors;if(typeof data6[0] !== "string"){const err11 = {keyword:"type",dataPath:dataPath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/0/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid1 = _errs21 === errors;if(_valid1){valid3 = true;passing1 = 0;}var _valid1 = true;if(_valid1 && valid3){valid3 = false;passing1 = [passing1, 1];}else {if(_valid1){valid3 = true;passing1 = 1;}}if(!valid3){const err12 = {keyword:"oneOf",dataPath:dataPath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf",params:{passingSchemas: passing1},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {errors = _errs20;if(vErrors !== null){if(_errs20){vErrors.length = _errs20;}else {vErrors = null;}}}}if(len0 > 1){if(typeof data6[1] !== "string"){const err13 = {keyword:"type",dataPath:dataPath+"/pattern/1",schemaPath:"#/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {keyword:"type",dataPath:dataPath+"/pattern",schemaPath:"#/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.field !== undefined){if(!(wrapper0.validate(data.field, {dataPath:dataPath+"/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(!(validate22(data.fields, {dataPath:dataPath+"/fields",parentData:data,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data.types !== undefined){if(!(validate22(data.types, {dataPath:dataPath+"/types",parentData:data,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}}else {const err15 = {keyword:"type",dataPath,schemaPath:"#/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}validate21.errors = vErrors;return errors === 0;}const schema25 = {"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]};const wrapper4 = {validate: validate28};const schema26 = {"$id":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","type":"array","minItems":1,"items":{"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]};const wrapper6 = {validate: validate29};function validate29(data, {dataPath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */;let vErrors = null;let errors = 0;if(Array.isArray(data)){if(data.length < 1){const err0 = {keyword:"minItems",dataPath,schemaPath:"#/minItems",params:{limit: 1},message:"should 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 _errs22 = errors;let valid5 = false;let passing1 = null;const _errs23 = errors;if(typeof data7[0] !== "string"){const err12 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/0/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid1 = _errs23 === errors;if(_valid1){valid5 = true;passing1 = 0;}var _valid1 = true;if(_valid1 && valid5){valid5 = false;passing1 = [passing1, 1];}else {if(_valid1){valid5 = true;passing1 = 1;}}if(!valid5){const err13 = {keyword:"oneOf",dataPath:dataPath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf",params:{passingSchemas: passing1},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}else {errors = _errs22;if(vErrors !== null){if(_errs22){vErrors.length = _errs22;}else {vErrors = null;}}}}if(len1 > 1){if(typeof data7[1] !== "string"){const err14 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern/1",schemaPath:"#/items/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}}else {const err15 = {keyword:"type",dataPath:dataPath+"/" + i0+"/pattern",schemaPath:"#/items/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data0.field !== undefined){if(!(wrapper4.validate(data0.field, {dataPath:dataPath+"/" + 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, {dataPath:dataPath+"/" + 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, {dataPath:dataPath+"/" + i0+"/types",parentData:data0,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? wrapper6.validate.errors : vErrors.concat(wrapper6.validate.errors);errors = vErrors.length;}}}else {const err16 = {keyword:"type",dataPath:dataPath+"/" + i0,schemaPath:"#/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}else {const err17 = {keyword:"type",dataPath,schemaPath:"#/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate29.errors = vErrors;return errors === 0;}function validate28(data, {dataPath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */;let vErrors = null;let errors = 0;if(data && typeof data == "object" && !Array.isArray(data)){if(data.name === undefined){const err0 = {keyword:"required",dataPath,schemaPath:"#/required",params:{missingProperty: "name"},message:"should have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.name !== undefined){if(typeof data.name !== "string"){const err1 = {keyword:"type",dataPath:dataPath+"/name",schemaPath:"#/properties/name/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.label !== undefined){if(typeof data.label !== "string"){const err2 = {keyword:"type",dataPath:dataPath+"/label",schemaPath:"#/properties/label/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.widget !== undefined){if(typeof data.widget !== "string"){const err3 = {keyword:"type",dataPath:dataPath+"/widget",schemaPath:"#/properties/widget/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.required !== undefined){if(typeof data.required !== "boolean"){const err4 = {keyword:"type",dataPath:dataPath+"/required",schemaPath:"#/properties/required/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.i18n !== undefined){let data4 = data.i18n;const _errs10 = errors;let valid1 = false;let passing0 = null;const _errs11 = errors;if(typeof data4 !== "boolean"){const err5 = {keyword:"type",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/0/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var _valid0 = _errs11 === errors;if(_valid0){valid1 = true;passing0 = 0;}const _errs13 = errors;if(typeof data4 !== "string"){const err6 = {keyword:"type",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(!(((data4 === "translate") || (data4 === "duplicate")) || (data4 === "none"))){const err7 = {keyword:"enum",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf/1/enum",params:{allowedValues: schema25.properties.i18n.oneOf[1].enum},message:"should be equal to one of the allowed values"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid0 = _errs13 === errors;if(_valid0 && valid1){valid1 = false;passing0 = [passing0, 1];}else {if(_valid0){valid1 = true;passing0 = 1;}}if(!valid1){const err8 = {keyword:"oneOf",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/oneOf",params:{passingSchemas: passing0},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}}}if(data.hint !== undefined){if(typeof data.hint !== "string"){const err9 = {keyword:"type",dataPath:dataPath+"/hint",schemaPath:"#/properties/hint/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.pattern !== undefined){let data6 = data.pattern;if(Array.isArray(data6)){if(data6.length < 2){const err10 = {keyword:"minItems",dataPath:dataPath+"/pattern",schemaPath:"#/properties/pattern/minItems",params:{limit: 2},message:"should NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}const len0 = data6.length;if(len0 > 0){const _errs20 = errors;let valid3 = false;let passing1 = null;const _errs21 = errors;if(typeof data6[0] !== "string"){const err11 = {keyword:"type",dataPath:dataPath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/0/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid1 = _errs21 === errors;if(_valid1){valid3 = true;passing1 = 0;}var _valid1 = true;if(_valid1 && valid3){valid3 = false;passing1 = [passing1, 1];}else {if(_valid1){valid3 = true;passing1 = 1;}}if(!valid3){const err12 = {keyword:"oneOf",dataPath:dataPath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf",params:{passingSchemas: passing1},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {errors = _errs20;if(vErrors !== null){if(_errs20){vErrors.length = _errs20;}else {vErrors = null;}}}}if(len0 > 1){if(typeof data6[1] !== "string"){const err13 = {keyword:"type",dataPath:dataPath+"/pattern/1",schemaPath:"#/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {keyword:"type",dataPath:dataPath+"/pattern",schemaPath:"#/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.field !== undefined){if(!(wrapper4.validate(data.field, {dataPath:dataPath+"/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(!(validate29(data.fields, {dataPath:dataPath+"/fields",parentData:data,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);errors = vErrors.length;}}if(data.types !== undefined){if(!(validate29(data.types, {dataPath:dataPath+"/types",parentData:data,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);errors = vErrors.length;}}}else {const err15 = {keyword:"type",dataPath,schemaPath:"#/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}validate28.errors = vErrors;return errors === 0;}function validate20(data, {dataPath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="https://netlify-cms/object.json" */;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 = {keyword:"required",dataPath,schemaPath:"#/anyOf/0/required",params:{missingProperty: "media_folder"},message:"should 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 = {keyword:"required",dataPath,schemaPath:"#/anyOf/1/required",params:{missingProperty: "media_library"},message:"should 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 = {keyword:"anyOf",dataPath,schemaPath:"#/anyOf",params:{},message:"should match some 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 = {keyword:"required",dataPath,schemaPath:"#/required",params:{missingProperty: "backend"},message:"should have required property '"+"backend"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.collections === undefined){const err4 = {keyword:"required",dataPath,schemaPath:"#/required",params:{missingProperty: "collections"},message:"should 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 = {keyword:"required",dataPath:dataPath+"/backend",schemaPath:"#/properties/backend/required",params:{missingProperty: "name"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/backend/name",schemaPath:"#/properties/backend/properties/name/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/backend/auth_scope",schemaPath:"#/properties/backend/properties/auth_scope/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(!((data2 === "repo") || (data2 === "public_repo"))){const err8 = {keyword:"enum",dataPath:dataPath+"/backend/auth_scope",schemaPath:"#/properties/backend/properties/auth_scope/enum",params:{allowedValues: schema22.properties.backend.properties.auth_scope.enum},message:"should 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(func9(data3) < 1){const err9 = {keyword:"minLength",dataPath:dataPath+"/backend/cms_label_prefix",schemaPath:"#/properties/backend/properties/cms_label_prefix/minLength",params:{limit: 1},message:"should NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {keyword:"type",dataPath:dataPath+"/backend/cms_label_prefix",schemaPath:"#/properties/backend/properties/cms_label_prefix/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/backend/open_authoring",schemaPath:"#/properties/backend/properties/open_authoring/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {keyword:"type",dataPath:dataPath+"/backend",schemaPath:"#/properties/backend/type",params:{type: "object"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/local_backend",schemaPath:"#/properties/local_backend/oneOf/0/type",params:{type: "boolean"},message:"should 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 = {keyword:"additionalProperties",dataPath:dataPath+"/local_backend",schemaPath:"#/properties/local_backend/oneOf/1/additionalProperties",params:{additionalProperty: key0},message:"should 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 = {keyword:"type",dataPath:dataPath+"/local_backend/url",schemaPath:"#/properties/local_backend/oneOf/1/properties/url/type",params:{type: "string"},message:"should 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 = {keyword:"maxLength",dataPath:dataPath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/maxLength",params:{limit: 10},message:"should NOT have more than 10 characters"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(func9(data13) < 2){const err27 = {keyword:"minLength",dataPath:dataPath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/minLength",params:{limit: 2},message:"should NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(!pattern0.test(data13)){const err28 = {keyword:"pattern",dataPath:dataPath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"should match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}else {const err29 = {keyword:"type",dataPath:dataPath+"/i18n/locales/" + i1,schemaPath:"#/properties/i18n/properties/locales/items/type",params:{type: "string"},message:"should 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 = {keyword:"uniqueItems",dataPath:dataPath+"/i18n/locales",schemaPath:"#/properties/i18n/properties/locales/uniqueItems",params:{i: i2, j: j0},message:"should 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 = {keyword:"type",dataPath:dataPath+"/i18n/locales",schemaPath:"#/properties/i18n/properties/locales/type",params:{type: "array"},message:"should 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(func9(data14) > 10){const err32 = {keyword:"maxLength",dataPath:dataPath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/maxLength",params:{limit: 10},message:"should NOT have more than 10 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(func9(data14) < 2){const err33 = {keyword:"minLength",dataPath:dataPath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/minLength",params:{limit: 2},message:"should NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}if(!pattern0.test(data14)){const err34 = {keyword:"pattern",dataPath:dataPath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"should match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}else {const err35 = {keyword:"type",dataPath:dataPath+"/i18n/default_locale",schemaPath:"#/properties/i18n/properties/default_locale/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}}else {const err36 = {keyword:"type",dataPath:dataPath+"/i18n",schemaPath:"#/properties/i18n/type",params:{type: "object"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/site_url",schemaPath:"#/properties/site_url/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/display_url",schemaPath:"#/properties/display_url/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/logo_url",schemaPath:"#/properties/logo_url/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/show_preview_links",schemaPath:"#/properties/show_preview_links/type",params:{type: "boolean"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/media_folder",schemaPath:"#/properties/media_folder/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/public_folder",schemaPath:"#/properties/public_folder/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/media_folder_relative",schemaPath:"#/properties/media_folder_relative/type",params:{type: "boolean"},message:"should 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 = {keyword:"required",dataPath:dataPath+"/media_library",schemaPath:"#/properties/media_library/required",params:{missingProperty: "name"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/media_library/name",schemaPath:"#/properties/media_library/properties/name/type",params:{type: "string"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/media_library/config",schemaPath:"#/properties/media_library/properties/config/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}}}else {const err47 = {keyword:"type",dataPath:dataPath+"/media_library",schemaPath:"#/properties/media_library/type",params:{type: "object"},message:"should 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 = {keyword:"type",dataPath:dataPath+"/publish_mode",schemaPath:"#/properties/publish_mode/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}if(!((data25 === "simple") || (data25 === "editorial_workflow"))){const err49 = {keyword:"enum",dataPath:dataPath+"/publish_mode",schemaPath:"#/properties/publish_mode/enum",params:{allowedValues: schema22.properties.publish_mode.enum},message:"should 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 = {keyword:"type",dataPath:dataPath+"/slug/encoding",schemaPath:"#/properties/slug/properties/encoding/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}if(!((data27 === "unicode") || (data27 === "ascii"))){const err51 = {keyword:"enum",dataPath:dataPath+"/slug/encoding",schemaPath:"#/properties/slug/properties/encoding/enum",params:{allowedValues: schema22.properties.slug.properties.encoding.enum},message:"should 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 = {keyword:"type",dataPath:dataPath+"/slug/clean_accents",schemaPath:"#/properties/slug/properties/clean_accents/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}}else {const err53 = {keyword:"type",dataPath:dataPath+"/slug",schemaPath:"#/properties/slug/type",params:{type: "object"},message:"should 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 = {keyword:"minItems",dataPath:dataPath+"/collections",schemaPath:"#/properties/collections/minItems",params:{limit: 1},message:"should 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 _errs136 = errors;let valid31 = false;let passing3 = null;const _errs137 = errors;if(typeof data55[0] !== "string"){const err98 = {keyword:"type",dataPath:dataPath+"/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",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}var _valid6 = _errs137 === errors;if(_valid6){valid31 = true;passing3 = 0;}var _valid6 = true;if(_valid6 && valid31){valid31 = false;passing3 = [passing3, 1];}else {if(_valid6){valid31 = true;passing3 = 1;}}if(!valid31){const err99 = {keyword:"oneOf",dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/pattern/0",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf",params:{passingSchemas: passing3},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}else {errors = _errs136;if(vErrors !== null){if(_errs136){vErrors.length = _errs136;}else {vErrors = null;}}}}if(len5 > 1){if(typeof data55[1] !== "string"){const err100 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/pattern/1",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}}else {const err101 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/pattern",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}}if(data48.field !== undefined){if(!(validate21(data48.field, {dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/field",parentData:data48,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);errors = vErrors.length;}}if(data48.fields !== undefined){if(!(validate22(data48.fields, {dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/fields",parentData:data48,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}if(data48.types !== undefined){if(!(validate22(data48.types, {dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/types",parentData:data48,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);errors = vErrors.length;}}}else {const err102 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5,schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}}}else {const err103 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files/" + i4+"/fields",schemaPath:"#/properties/collections/items/properties/files/items/properties/fields/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}}}else {const err104 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files/" + i4,schemaPath:"#/properties/collections/items/properties/files/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}}else {const err105 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/files",schemaPath:"#/properties/collections/items/properties/files/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}}if(data30.identifier_field !== undefined){if(typeof data30.identifier_field !== "string"){const err106 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/identifier_field",schemaPath:"#/properties/collections/items/properties/identifier_field/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}if(data30.summary !== undefined){if(typeof data30.summary !== "string"){const err107 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/summary",schemaPath:"#/properties/collections/items/properties/summary/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}if(data30.slug !== undefined){if(typeof data30.slug !== "string"){const err108 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/slug",schemaPath:"#/properties/collections/items/properties/slug/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}if(data30.path !== undefined){if(typeof data30.path !== "string"){const err109 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/path",schemaPath:"#/properties/collections/items/properties/path/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}if(data30.preview_path !== undefined){if(typeof data30.preview_path !== "string"){const err110 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/preview_path",schemaPath:"#/properties/collections/items/properties/preview_path/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(data30.preview_path_date_field !== undefined){if(typeof data30.preview_path_date_field !== "string"){const err111 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/preview_path_date_field",schemaPath:"#/properties/collections/items/properties/preview_path_date_field/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}}if(data30.create !== undefined){if(typeof data30.create !== "boolean"){const err112 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/create",schemaPath:"#/properties/collections/items/properties/create/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}}if(data30.publish !== undefined){if(typeof data30.publish !== "boolean"){const err113 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/publish",schemaPath:"#/properties/collections/items/properties/publish/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(data30.hide !== undefined){if(typeof data30.hide !== "boolean"){const err114 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/hide",schemaPath:"#/properties/collections/items/properties/hide/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}}if(data30.editor !== undefined){let data70 = data30.editor;if(data70 && typeof data70 == "object" && !Array.isArray(data70)){if(data70.preview !== undefined){if(typeof data70.preview !== "boolean"){const err115 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/editor/preview",schemaPath:"#/properties/collections/items/properties/editor/properties/preview/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}}else {const err116 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/editor",schemaPath:"#/properties/collections/items/properties/editor/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data30.format !== undefined){let data72 = data30.format;if(typeof data72 !== "string"){const err117 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/format",schemaPath:"#/properties/collections/items/properties/format/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}if(!((((((((data72 === "yml") || (data72 === "yaml")) || (data72 === "toml")) || (data72 === "json")) || (data72 === "frontmatter")) || (data72 === "json-frontmatter")) || (data72 === "toml-frontmatter")) || (data72 === "yaml-frontmatter"))){const err118 = {keyword:"enum",dataPath:dataPath+"/collections/" + i3+"/format",schemaPath:"#/properties/collections/items/properties/format/enum",params:{allowedValues: schema22.properties.collections.items.properties.format.enum},message:"should be equal to one of the allowed values"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}if(data30.extension !== undefined){if(typeof data30.extension !== "string"){const err119 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/extension",schemaPath:"#/properties/collections/items/properties/extension/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}if(data30.frontmatter_delimiter !== undefined){let data74 = data30.frontmatter_delimiter;if((typeof data74 !== "string") && (!(Array.isArray(data74)))){const err120 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/frontmatter_delimiter",schemaPath:"#/properties/collections/items/properties/frontmatter_delimiter/type",params:{type: schema22.properties.collections.items.properties.frontmatter_delimiter.type},message:"should be string,array"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}if(Array.isArray(data74)){if(data74.length > 2){const err121 = {keyword:"maxItems",dataPath:dataPath+"/collections/" + i3+"/frontmatter_delimiter",schemaPath:"#/properties/collections/items/properties/frontmatter_delimiter/maxItems",params:{limit: 2},message:"should NOT have more than 2 items"};if(vErrors === null){vErrors = [err121];}else {vErrors.push(err121);}errors++;}if(data74.length < 2){const err122 = {keyword:"minItems",dataPath:dataPath+"/collections/" + i3+"/frontmatter_delimiter",schemaPath:"#/properties/collections/items/properties/frontmatter_delimiter/minItems",params:{limit: 2},message:"should NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err122];}else {vErrors.push(err122);}errors++;}const len6 = data74.length;for(let i6=0; i6 0){const _errs197 = errors;let valid40 = false;let passing5 = null;const _errs198 = errors;if(typeof data84[0] !== "string"){const err136 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err136];}else {vErrors.push(err136);}errors++;}var _valid8 = _errs198 === errors;if(_valid8){valid40 = true;passing5 = 0;}var _valid8 = true;if(_valid8 && valid40){valid40 = false;passing5 = [passing5, 1];}else {if(_valid8){valid40 = true;passing5 = 1;}}if(!valid40){const err137 = {keyword:"oneOf",dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf",params:{passingSchemas: passing5},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err137];}else {vErrors.push(err137);}errors++;}else {errors = _errs197;if(vErrors !== null){if(_errs197){vErrors.length = _errs197;}else {vErrors = null;}}}}if(len8 > 1){if(typeof data84[1] !== "string"){const err138 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/pattern/1",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/1/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err138];}else {vErrors.push(err138);}errors++;}}}else {const err139 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/pattern",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err139];}else {vErrors.push(err139);}errors++;}}if(data77.field !== undefined){if(!(validate28(data77.field, {dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/field",parentData:data77,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? validate28.errors : vErrors.concat(validate28.errors);errors = vErrors.length;}}if(data77.fields !== undefined){if(!(validate29(data77.fields, {dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/fields",parentData:data77,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);errors = vErrors.length;}}if(data77.types !== undefined){if(!(validate29(data77.types, {dataPath:dataPath+"/collections/" + i3+"/fields/" + i7+"/types",parentData:data77,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);errors = vErrors.length;}}}else {const err140 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/fields/" + i7,schemaPath:"#/properties/collections/items/properties/fields/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err140];}else {vErrors.push(err140);}errors++;}}}else {const err141 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/fields",schemaPath:"#/properties/collections/items/properties/fields/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err141];}else {vErrors.push(err141);}errors++;}}if(data30.sortable_fields !== undefined){let data90 = data30.sortable_fields;if(Array.isArray(data90)){const len9 = data90.length;for(let i8=0; i8 1000 || isNaN(data105)){const err168 = {keyword:"maximum",dataPath:dataPath+"/collections/" + i3+"/nested/depth",schemaPath:"#/properties/collections/items/properties/nested/properties/depth/maximum",params:{comparison: "<=", limit: 1000},message:"should be <= 1000"};if(vErrors === null){vErrors = [err168];}else {vErrors.push(err168);}errors++;}if(data105 < 1 || isNaN(data105)){const err169 = {keyword:"minimum",dataPath:dataPath+"/collections/" + i3+"/nested/depth",schemaPath:"#/properties/collections/items/properties/nested/properties/depth/minimum",params:{comparison: ">=", limit: 1},message:"should be >= 1"};if(vErrors === null){vErrors = [err169];}else {vErrors.push(err169);}errors++;}}else {const err170 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/nested/depth",schemaPath:"#/properties/collections/items/properties/nested/properties/depth/type",params:{type: "number"},message:"should be number"};if(vErrors === null){vErrors = [err170];}else {vErrors.push(err170);}errors++;}}if(data104.summary !== undefined){if(typeof data104.summary !== "string"){const err171 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/nested/summary",schemaPath:"#/properties/collections/items/properties/nested/properties/summary/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err171];}else {vErrors.push(err171);}errors++;}}}else {const err172 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/nested",schemaPath:"#/properties/collections/items/properties/nested/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err172];}else {vErrors.push(err172);}errors++;}}if(data30.meta !== undefined){let data107 = data30.meta;if(data107 && typeof data107 == "object" && !Array.isArray(data107)){if(Object.keys(data107).length < 1){const err173 = {keyword:"minProperties",dataPath:dataPath+"/collections/" + i3+"/meta",schemaPath:"#/properties/collections/items/properties/meta/minProperties",params:{limit: 1},message:"should NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err173];}else {vErrors.push(err173);}errors++;}for(const key3 in data107){if(!(key3 === "path")){const err174 = {keyword:"additionalProperties",dataPath:dataPath+"/collections/" + i3+"/meta",schemaPath:"#/properties/collections/items/properties/meta/additionalProperties",params:{additionalProperty: key3},message:"should NOT have additional properties"};if(vErrors === null){vErrors = [err174];}else {vErrors.push(err174);}errors++;}}if(data107.path !== undefined){let data108 = data107.path;if(data108 && typeof data108 == "object" && !Array.isArray(data108)){if(data108.label === undefined){const err175 = {keyword:"required",dataPath:dataPath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/required",params:{missingProperty: "label"},message:"should have required property '"+"label"+"'"};if(vErrors === null){vErrors = [err175];}else {vErrors.push(err175);}errors++;}if(data108.widget === undefined){const err176 = {keyword:"required",dataPath:dataPath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/required",params:{missingProperty: "widget"},message:"should have required property '"+"widget"+"'"};if(vErrors === null){vErrors = [err176];}else {vErrors.push(err176);}errors++;}if(data108.index_file === undefined){const err177 = {keyword:"required",dataPath:dataPath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/required",params:{missingProperty: "index_file"},message:"should have required property '"+"index_file"+"'"};if(vErrors === null){vErrors = [err177];}else {vErrors.push(err177);}errors++;}if(data108.label !== undefined){if(typeof data108.label !== "string"){const err178 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/meta/path/label",schemaPath:"#/properties/collections/items/properties/meta/properties/path/properties/label/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err178];}else {vErrors.push(err178);}errors++;}}if(data108.widget !== undefined){if(typeof data108.widget !== "string"){const err179 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/meta/path/widget",schemaPath:"#/properties/collections/items/properties/meta/properties/path/properties/widget/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(data108.index_file !== undefined){if(typeof data108.index_file !== "string"){const err180 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/meta/path/index_file",schemaPath:"#/properties/collections/items/properties/meta/properties/path/properties/index_file/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}}else {const err181 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/meta/path",schemaPath:"#/properties/collections/items/properties/meta/properties/path/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}}else {const err182 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/meta",schemaPath:"#/properties/collections/items/properties/meta/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}if(data30.i18n !== undefined){let data112 = data30.i18n;const _errs257 = errors;let valid55 = false;let passing7 = null;const _errs258 = errors;if(typeof data112 !== "boolean"){const err183 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/0/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}var _valid10 = _errs258 === errors;if(_valid10){valid55 = true;passing7 = 0;}const _errs260 = errors;if(data112 && typeof data112 == "object" && !Array.isArray(data112)){if(data112.structure !== undefined){let data113 = data112.structure;if(typeof data113 !== "string"){const err184 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n/structure",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err184];}else {vErrors.push(err184);}errors++;}if(!(((data113 === "multiple_folders") || (data113 === "multiple_files")) || (data113 === "single_file"))){const err185 = {keyword:"enum",dataPath:dataPath+"/collections/" + i3+"/i18n/structure",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum",params:{allowedValues: schema22.properties.collections.items.properties.i18n.oneOf[1].properties.structure.enum},message:"should be equal to one of the allowed values"};if(vErrors === null){vErrors = [err185];}else {vErrors.push(err185);}errors++;}}if(data112.locales !== undefined){let data114 = data112.locales;if(Array.isArray(data114)){if(data114.length < 2){const err186 = {keyword:"minItems",dataPath:dataPath+"/collections/" + i3+"/i18n/locales",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/minItems",params:{limit: 2},message:"should NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err186];}else {vErrors.push(err186);}errors++;}const len13 = data114.length;for(let i12=0; i12 10){const err187 = {keyword:"maxLength",dataPath:dataPath+"/collections/" + i3+"/i18n/locales/" + i12,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/maxLength",params:{limit: 10},message:"should NOT have more than 10 characters"};if(vErrors === null){vErrors = [err187];}else {vErrors.push(err187);}errors++;}if(func9(data115) < 2){const err188 = {keyword:"minLength",dataPath:dataPath+"/collections/" + i3+"/i18n/locales/" + i12,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/minLength",params:{limit: 2},message:"should NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err188];}else {vErrors.push(err188);}errors++;}if(!pattern0.test(data115)){const err189 = {keyword:"pattern",dataPath:dataPath+"/collections/" + i3+"/i18n/locales/" + i12,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"should match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err189];}else {vErrors.push(err189);}errors++;}}else {const err190 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n/locales/" + i12,schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err190];}else {vErrors.push(err190);}errors++;}}let i13 = data114.length;let j1;if(i13 > 1){const indices1 = {};for(;i13--;){let item1 = data114[i13];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j1 = indices1[item1];const err191 = {keyword:"uniqueItems",dataPath:dataPath+"/collections/" + i3+"/i18n/locales",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems",params:{i: i13, j: j1},message:"should NOT have duplicate items (items ## "+j1+" and "+i13+" are identical)"};if(vErrors === null){vErrors = [err191];}else {vErrors.push(err191);}errors++;break;}indices1[item1] = i13;}}}else {const err192 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n/locales",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err192];}else {vErrors.push(err192);}errors++;}}if(data112.default_locale !== undefined){let data116 = data112.default_locale;if(typeof data116 === "string"){if(func9(data116) > 10){const err193 = {keyword:"maxLength",dataPath:dataPath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/maxLength",params:{limit: 10},message:"should NOT have more than 10 characters"};if(vErrors === null){vErrors = [err193];}else {vErrors.push(err193);}errors++;}if(func9(data116) < 2){const err194 = {keyword:"minLength",dataPath:dataPath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/minLength",params:{limit: 2},message:"should NOT have fewer than 2 characters"};if(vErrors === null){vErrors = [err194];}else {vErrors.push(err194);}errors++;}if(!pattern0.test(data116)){const err195 = {keyword:"pattern",dataPath:dataPath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/pattern",params:{pattern: "^[a-zA-Z-_]+$"},message:"should match pattern \""+"^[a-zA-Z-_]+$"+"\""};if(vErrors === null){vErrors = [err195];}else {vErrors.push(err195);}errors++;}}else {const err196 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n/default_locale",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/type",params:{type: "string"},message:"should be string"};if(vErrors === null){vErrors = [err196];}else {vErrors.push(err196);}errors++;}}}else {const err197 = {keyword:"type",dataPath:dataPath+"/collections/" + i3+"/i18n",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err197];}else {vErrors.push(err197);}errors++;}var _valid10 = _errs260 === errors;if(_valid10 && valid55){valid55 = false;passing7 = [passing7, 1];}else {if(_valid10){valid55 = true;passing7 = 1;}}if(!valid55){const err198 = {keyword:"oneOf",dataPath:dataPath+"/collections/" + i3+"/i18n",schemaPath:"#/properties/collections/items/properties/i18n/oneOf",params:{passingSchemas: passing7},message:"should match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err198];}else {vErrors.push(err198);}errors++;}else {errors = _errs257;if(vErrors !== null){if(_errs257){vErrors.length = _errs257;}else {vErrors = null;}}}}}else {const err199 = {keyword:"type",dataPath:dataPath+"/collections/" + i3,schemaPath:"#/properties/collections/items/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err199];}else {vErrors.push(err199);}errors++;}}}else {const err200 = {keyword:"type",dataPath:dataPath+"/collections",schemaPath:"#/properties/collections/type",params:{type: "array"},message:"should be array"};if(vErrors === null){vErrors = [err200];}else {vErrors.push(err200);}errors++;}}if(data.editor !== undefined){let data117 = data.editor;if(data117 && typeof data117 == "object" && !Array.isArray(data117)){if(data117.preview !== undefined){if(typeof data117.preview !== "boolean"){const err201 = {keyword:"type",dataPath:dataPath+"/editor/preview",schemaPath:"#/properties/editor/properties/preview/type",params:{type: "boolean"},message:"should be boolean"};if(vErrors === null){vErrors = [err201];}else {vErrors.push(err201);}errors++;}}}else {const err202 = {keyword:"type",dataPath:dataPath+"/editor",schemaPath:"#/properties/editor/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}}else {const err203 = {keyword:"type",dataPath,schemaPath:"#/type",params:{type: "object"},message:"should be object"};if(vErrors === null){vErrors = [err203];}else {vErrors.push(err203);}errors++;}validate20.errors = vErrors;return errors === 0;} \ No newline at end of file +'use strict'; +var ucs2length = require('ajv/lib/compile/ucs2length'); +var equal = require('ajv/lib/compile/equal'); +var validate = (function() { + var pattern0 = new RegExp('^[a-zA-Z-_]+$'); + var refVal = []; + var refVal1 = (function() { + var pattern0 = new RegExp('^[a-zA-Z-_]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; /*# sourceURL=field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d */ + var vErrors = null; + var errors = 0; + if (rootData === undefined) rootData = data; + if ((data && typeof data === "object" && !Array.isArray(data))) { + var errs__0 = errors; + var valid1 = true; + if (data.name === undefined) { + valid1 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + "", + schemaPath: '#/required', + params: { + missingProperty: 'name' + }, + message: 'should have required property \'name\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_1 = errors; + if (typeof data.name !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.name', + schemaPath: '#/properties/name/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.label !== undefined) { + var errs_1 = errors; + if (typeof data.label !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.label', + schemaPath: '#/properties/label/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.widget !== undefined) { + var errs_1 = errors; + if (typeof data.widget !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.widget', + schemaPath: '#/properties/widget/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.required !== undefined) { + var errs_1 = errors; + if (typeof data.required !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.required', + schemaPath: '#/properties/required/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + var data1 = data.i18n; + if (data1 !== undefined) { + var errs_1 = errors; + var errs__1 = errors, + prevValid1 = false, + valid1 = false, + passingSchemas1 = null; + var errs_2 = errors; + if (typeof data1 !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.i18n', + schemaPath: '#/properties/i18n/oneOf/0/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + if (valid2) { + valid1 = prevValid1 = true; + passingSchemas1 = 0; + } + var errs_2 = errors; + if (typeof data1 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.i18n', + schemaPath: '#/properties/i18n/oneOf/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema2 = validate.schema.properties.i18n.oneOf[1].enum; + var valid2; + valid2 = false; + for (var i2 = 0; i2 < schema2.length; i2++) + if (equal(data1, schema2[i2])) { + valid2 = true; + break; + } if (!valid2) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.i18n', + schemaPath: '#/properties/i18n/oneOf/1/enum', + params: { + allowedValues: schema2 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + if (valid2 && prevValid1) { + valid1 = false; + passingSchemas1 = [passingSchemas1, 1]; + } else { + if (valid2) { + valid1 = prevValid1 = true; + passingSchemas1 = 1; + } + } + if (!valid1) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.i18n', + schemaPath: '#/properties/i18n/oneOf', + params: { + passingSchemas: passingSchemas1 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__1; + if (vErrors !== null) { + if (errs__1) vErrors.length = errs__1; + else vErrors = null; + } + } + var valid1 = errors === errs_1; + } + if (data.hint !== undefined) { + var errs_1 = errors; + if (typeof data.hint !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.hint', + schemaPath: '#/properties/hint/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + var data1 = data.pattern; + if (data1 !== undefined) { + var errs_1 = errors; + if (Array.isArray(data1)) { + if (data1.length < 2) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.pattern', + schemaPath: '#/properties/pattern/minItems', + params: { + limit: 2 + }, + message: 'should NOT have fewer than 2 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__1 = errors; + var valid1; + valid2 = true; + if (data1.length > 0) { + var errs_2 = errors; + var errs__2 = errors, + prevValid2 = false, + valid2 = false, + passingSchemas2 = null; + var errs_3 = errors; + if (typeof data1[0] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.pattern[' + 0 + ']', + schemaPath: '#/properties/pattern/items/0/oneOf/0/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + if (valid3) { + valid2 = prevValid2 = true; + passingSchemas2 = 0; + } + var valid3 = true; + if (valid3 && prevValid2) { + valid2 = false; + passingSchemas2 = [passingSchemas2, 1]; + } else { + if (valid3) { + valid2 = prevValid2 = true; + passingSchemas2 = 1; + } + } + if (!valid2) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.pattern[' + 0 + ']', + schemaPath: '#/properties/pattern/items/0/oneOf', + params: { + passingSchemas: passingSchemas2 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__2; + if (vErrors !== null) { + if (errs__2) vErrors.length = errs__2; + else vErrors = null; + } + } + var valid2 = errors === errs_2; + } + valid2 = true; + if (data1.length > 1) { + var errs_2 = errors; + if (typeof data1[1] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.pattern[' + 1 + ']', + schemaPath: '#/properties/pattern/items/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.pattern', + schemaPath: '#/properties/pattern/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.field !== undefined) { + var errs_1 = errors; + if (!refVal[1](data.field, (dataPath || '') + '.field', data, 'field', rootData)) { + if (vErrors === null) vErrors = refVal[1].errors; + else vErrors = vErrors.concat(refVal[1].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.fields !== undefined) { + var errs_1 = errors; + if (!refVal2(data.fields, (dataPath || '') + '.fields', data, 'fields', rootData)) { + if (vErrors === null) vErrors = refVal2.errors; + else vErrors = vErrors.concat(refVal2.errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.types !== undefined) { + var errs_1 = errors; + if (!refVal[2](data.types, (dataPath || '') + '.types', data, 'types', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal1.schema = { + "$id": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", + "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" + }, { + "instanceof": "RegExp" + }] + }, { + "type": "string" + }] + }, + "field": { + "$ref": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + }, + "fields": { + "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + }, + "types": { + "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + } + }, + "select": { + "$data": "0/widget" + }, + "selectCases": { + "unknown": {}, + "string": {}, + "number": { + "properties": { + "step": { + "type": "number" + }, + "value_type": { + "type": "string" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "text": {}, + "image": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "file": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "select": { + "properties": { + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "options": { + "type": "array", + "items": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }, { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }] + } + }, + "required": ["label", "value"] + }] + } + } + }, + "required": ["options"] + }, + "markdown": { + "properties": { + "minimal": { + "type": "boolean" + }, + "buttons": { + "type": "array", + "items": { + "type": "string", + "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] + } + }, + "editor_components": { + "type": "array", + "items": { + "type": "string" + } + }, + "modes": { + "type": "array", + "items": { + "type": "string", + "enum": ["raw", "rich_text"] + }, + "minItems": 1 + } + } + }, + "list": { + "properties": { + "allow_add": { + "type": "boolean" + }, + "collapsed": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "minimize_collapsed": { + "type": "boolean" + }, + "label_singular": { + "type": "string" + }, + "i18n": { + "type": "boolean" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "object": { + "properties": { + "collapsed": { + "type": "boolean" + }, + "i18n": { + "type": "boolean" + } + } + }, + "relation": { + "properties": { + "collection": { + "type": "string" + }, + "value_field": { + "type": "string" + }, + "search_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "file": { + "type": "string" + }, + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "display_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "options_length": { + "type": "integer" + } + }, + "oneOf": [{ + "required": ["collection", "value_field", "search_fields"] + }, { + "required": ["collection", "valueField", "searchFields"] + }] + }, + "boolean": {}, + "map": { + "properties": { + "decimals": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": ["Point", "LineString", "Polygon"] + } + } + }, + "date": {}, + "datetime": { + "properties": { + "format": { + "type": "string" + }, + "date_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "time_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "picker_utc": { + "type": "boolean" + } + } + }, + "code": { + "properties": { + "default_language": { + "type": "string" + }, + "allow_language_selection": { + "type": "boolean" + }, + "output_code_only": { + "type": "boolean" + }, + "keys": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "lang": { + "type": "string" + } + } + } + } + }, + "color": {} + }, + "required": ["name"] + }; + refVal1.errors = null; + refVal[1] = refVal1; + var refVal2 = (function() { + var pattern0 = new RegExp('^[a-zA-Z-_]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; /*# sourceURL=fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d */ + var vErrors = null; + var errors = 0; + if (rootData === undefined) rootData = data; + if (Array.isArray(data)) { + if (data.length < 1) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + "", + schemaPath: '#/minItems', + params: { + limit: 1 + }, + message: 'should NOT have fewer than 1 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__0 = errors; + var valid0; + for (var i0 = 0; i0 < data.length; i0++) { + var data1 = data[i0]; + var errs_1 = errors; + if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { + var errs__1 = errors; + var valid2 = true; + if (data1.name === undefined) { + valid2 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '[' + i0 + ']', + schemaPath: '#/items/required', + params: { + missingProperty: 'name' + }, + message: 'should have required property \'name\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_2 = errors; + if (typeof data1.name !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].name', + schemaPath: '#/items/properties/name/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + if (data1.label !== undefined) { + var errs_2 = errors; + if (typeof data1.label !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].label', + schemaPath: '#/items/properties/label/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + if (data1.widget !== undefined) { + var errs_2 = errors; + if (typeof data1.widget !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].widget', + schemaPath: '#/items/properties/widget/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + if (data1.required !== undefined) { + var errs_2 = errors; + if (typeof data1.required !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].required', + schemaPath: '#/items/properties/required/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + var data2 = data1.i18n; + if (data2 !== undefined) { + var errs_2 = errors; + var errs__2 = errors, + prevValid2 = false, + valid2 = false, + passingSchemas2 = null; + var errs_3 = errors; + if (typeof data2 !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', + schemaPath: '#/items/properties/i18n/oneOf/0/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + if (valid3) { + valid2 = prevValid2 = true; + passingSchemas2 = 0; + } + var errs_3 = errors; + if (typeof data2 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema3 = validate.schema.items.properties.i18n.oneOf[1].enum; + var valid3; + valid3 = false; + for (var i3 = 0; i3 < schema3.length; i3++) + if (equal(data2, schema3[i3])) { + valid3 = true; + break; + } if (!valid3) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/enum', + params: { + allowedValues: schema3 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + if (valid3 && prevValid2) { + valid2 = false; + passingSchemas2 = [passingSchemas2, 1]; + } else { + if (valid3) { + valid2 = prevValid2 = true; + passingSchemas2 = 1; + } + } + if (!valid2) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', + schemaPath: '#/items/properties/i18n/oneOf', + params: { + passingSchemas: passingSchemas2 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__2; + if (vErrors !== null) { + if (errs__2) vErrors.length = errs__2; + else vErrors = null; + } + } + var valid2 = errors === errs_2; + } + if (data1.hint !== undefined) { + var errs_2 = errors; + if (typeof data1.hint !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].hint', + schemaPath: '#/items/properties/hint/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + var data2 = data1.pattern; + if (data2 !== undefined) { + var errs_2 = errors; + if (Array.isArray(data2)) { + if (data2.length < 2) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '[' + i0 + '].pattern', + schemaPath: '#/items/properties/pattern/minItems', + params: { + limit: 2 + }, + message: 'should NOT have fewer than 2 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__2 = errors; + var valid2; + valid3 = true; + if (data2.length > 0) { + var errs_3 = errors; + var errs__3 = errors, + prevValid3 = false, + valid3 = false, + passingSchemas3 = null; + var errs_4 = errors; + if (typeof data2[0] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', + schemaPath: '#/items/properties/pattern/items/0/oneOf/0/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + if (valid4) { + valid3 = prevValid3 = true; + passingSchemas3 = 0; + } + var valid4 = true; + if (valid4 && prevValid3) { + valid3 = false; + passingSchemas3 = [passingSchemas3, 1]; + } else { + if (valid4) { + valid3 = prevValid3 = true; + passingSchemas3 = 1; + } + } + if (!valid3) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', + schemaPath: '#/items/properties/pattern/items/0/oneOf', + params: { + passingSchemas: passingSchemas3 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__3; + if (vErrors !== null) { + if (errs__3) vErrors.length = errs__3; + else vErrors = null; + } + } + var valid3 = errors === errs_3; + } + valid3 = true; + if (data2.length > 1) { + var errs_3 = errors; + if (typeof data2[1] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 1 + ']', + schemaPath: '#/items/properties/pattern/items/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].pattern', + schemaPath: '#/items/properties/pattern/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + if (data1.field !== undefined) { + var errs_2 = errors; + if (!refVal[1](data1.field, (dataPath || '') + '[' + i0 + '].field', data1, 'field', rootData)) { + if (vErrors === null) vErrors = refVal[1].errors; + else vErrors = vErrors.concat(refVal[1].errors); + errors = vErrors.length; + } + var valid2 = errors === errs_2; + } + if (data1.fields !== undefined) { + var errs_2 = errors; + if (!refVal[2](data1.fields, (dataPath || '') + '[' + i0 + '].fields', data1, 'fields', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid2 = errors === errs_2; + } + if (data1.types !== undefined) { + var errs_2 = errors; + if (!refVal[2](data1.types, (dataPath || '') + '[' + i0 + '].types', data1, 'types', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid2 = errors === errs_2; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + ']', + schemaPath: '#/items/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal2.schema = { + "$id": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", + "type": "array", + "minItems": 1, + "items": { + "$id": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", + "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" + }, { + "instanceof": "RegExp" + }] + }, { + "type": "string" + }] + }, + "field": { + "$ref": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + }, + "fields": { + "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + }, + "types": { + "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + } + }, + "select": { + "$data": "0/widget" + }, + "selectCases": { + "unknown": {}, + "string": {}, + "number": { + "properties": { + "step": { + "type": "number" + }, + "value_type": { + "type": "string" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "text": {}, + "image": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "file": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "select": { + "properties": { + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "options": { + "type": "array", + "items": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }, { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }] + } + }, + "required": ["label", "value"] + }] + } + } + }, + "required": ["options"] + }, + "markdown": { + "properties": { + "minimal": { + "type": "boolean" + }, + "buttons": { + "type": "array", + "items": { + "type": "string", + "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] + } + }, + "editor_components": { + "type": "array", + "items": { + "type": "string" + } + }, + "modes": { + "type": "array", + "items": { + "type": "string", + "enum": ["raw", "rich_text"] + }, + "minItems": 1 + } + } + }, + "list": { + "properties": { + "allow_add": { + "type": "boolean" + }, + "collapsed": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "minimize_collapsed": { + "type": "boolean" + }, + "label_singular": { + "type": "string" + }, + "i18n": { + "type": "boolean" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "object": { + "properties": { + "collapsed": { + "type": "boolean" + }, + "i18n": { + "type": "boolean" + } + } + }, + "relation": { + "properties": { + "collection": { + "type": "string" + }, + "value_field": { + "type": "string" + }, + "search_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "file": { + "type": "string" + }, + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "display_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "options_length": { + "type": "integer" + } + }, + "oneOf": [{ + "required": ["collection", "value_field", "search_fields"] + }, { + "required": ["collection", "valueField", "searchFields"] + }] + }, + "boolean": {}, + "map": { + "properties": { + "decimals": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": ["Point", "LineString", "Polygon"] + } + } + }, + "date": {}, + "datetime": { + "properties": { + "format": { + "type": "string" + }, + "date_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "time_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "picker_utc": { + "type": "boolean" + } + } + }, + "code": { + "properties": { + "default_language": { + "type": "string" + }, + "allow_language_selection": { + "type": "boolean" + }, + "output_code_only": { + "type": "boolean" + }, + "keys": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "lang": { + "type": "string" + } + } + } + } + }, + "color": {} + }, + "required": ["name"] + }, + "uniqueItemProperties": ["name"] + }; + refVal2.errors = null; + refVal[2] = refVal2; + var refVal3 = (function() { + var pattern0 = new RegExp('^[a-zA-Z-_]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; /*# sourceURL=field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e */ + var vErrors = null; + var errors = 0; + if (rootData === undefined) rootData = data; + if ((data && typeof data === "object" && !Array.isArray(data))) { + var errs__0 = errors; + var valid1 = true; + if (data.name === undefined) { + valid1 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + "", + schemaPath: '#/required', + params: { + missingProperty: 'name' + }, + message: 'should have required property \'name\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_1 = errors; + if (typeof data.name !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.name', + schemaPath: '#/properties/name/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.label !== undefined) { + var errs_1 = errors; + if (typeof data.label !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.label', + schemaPath: '#/properties/label/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.widget !== undefined) { + var errs_1 = errors; + if (typeof data.widget !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.widget', + schemaPath: '#/properties/widget/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.required !== undefined) { + var errs_1 = errors; + if (typeof data.required !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.required', + schemaPath: '#/properties/required/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + var data1 = data.i18n; + if (data1 !== undefined) { + var errs_1 = errors; + var errs__1 = errors, + prevValid1 = false, + valid1 = false, + passingSchemas1 = null; + var errs_2 = errors; + if (typeof data1 !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.i18n', + schemaPath: '#/properties/i18n/oneOf/0/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + if (valid2) { + valid1 = prevValid1 = true; + passingSchemas1 = 0; + } + var errs_2 = errors; + if (typeof data1 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.i18n', + schemaPath: '#/properties/i18n/oneOf/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema2 = validate.schema.properties.i18n.oneOf[1].enum; + var valid2; + valid2 = false; + for (var i2 = 0; i2 < schema2.length; i2++) + if (equal(data1, schema2[i2])) { + valid2 = true; + break; + } if (!valid2) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.i18n', + schemaPath: '#/properties/i18n/oneOf/1/enum', + params: { + allowedValues: schema2 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + if (valid2 && prevValid1) { + valid1 = false; + passingSchemas1 = [passingSchemas1, 1]; + } else { + if (valid2) { + valid1 = prevValid1 = true; + passingSchemas1 = 1; + } + } + if (!valid1) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.i18n', + schemaPath: '#/properties/i18n/oneOf', + params: { + passingSchemas: passingSchemas1 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__1; + if (vErrors !== null) { + if (errs__1) vErrors.length = errs__1; + else vErrors = null; + } + } + var valid1 = errors === errs_1; + } + if (data.hint !== undefined) { + var errs_1 = errors; + if (typeof data.hint !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.hint', + schemaPath: '#/properties/hint/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + var data1 = data.pattern; + if (data1 !== undefined) { + var errs_1 = errors; + if (Array.isArray(data1)) { + if (data1.length < 2) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.pattern', + schemaPath: '#/properties/pattern/minItems', + params: { + limit: 2 + }, + message: 'should NOT have fewer than 2 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__1 = errors; + var valid1; + valid2 = true; + if (data1.length > 0) { + var errs_2 = errors; + var errs__2 = errors, + prevValid2 = false, + valid2 = false, + passingSchemas2 = null; + var errs_3 = errors; + if (typeof data1[0] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.pattern[' + 0 + ']', + schemaPath: '#/properties/pattern/items/0/oneOf/0/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + if (valid3) { + valid2 = prevValid2 = true; + passingSchemas2 = 0; + } + var valid3 = true; + if (valid3 && prevValid2) { + valid2 = false; + passingSchemas2 = [passingSchemas2, 1]; + } else { + if (valid3) { + valid2 = prevValid2 = true; + passingSchemas2 = 1; + } + } + if (!valid2) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.pattern[' + 0 + ']', + schemaPath: '#/properties/pattern/items/0/oneOf', + params: { + passingSchemas: passingSchemas2 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__2; + if (vErrors !== null) { + if (errs__2) vErrors.length = errs__2; + else vErrors = null; + } + } + var valid2 = errors === errs_2; + } + valid2 = true; + if (data1.length > 1) { + var errs_2 = errors; + if (typeof data1[1] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.pattern[' + 1 + ']', + schemaPath: '#/properties/pattern/items/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.pattern', + schemaPath: '#/properties/pattern/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.field !== undefined) { + var errs_1 = errors; + if (!refVal[3](data.field, (dataPath || '') + '.field', data, 'field', rootData)) { + if (vErrors === null) vErrors = refVal[3].errors; + else vErrors = vErrors.concat(refVal[3].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.fields !== undefined) { + var errs_1 = errors; + if (!refVal4(data.fields, (dataPath || '') + '.fields', data, 'fields', rootData)) { + if (vErrors === null) vErrors = refVal4.errors; + else vErrors = vErrors.concat(refVal4.errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + if (data.types !== undefined) { + var errs_1 = errors; + if (!refVal[4](data.types, (dataPath || '') + '.types', data, 'types', rootData)) { + if (vErrors === null) vErrors = refVal[4].errors; + else vErrors = vErrors.concat(refVal[4].errors); + errors = vErrors.length; + } + var valid1 = errors === errs_1; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal3.schema = { + "$id": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", + "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" + }, { + "instanceof": "RegExp" + }] + }, { + "type": "string" + }] + }, + "field": { + "$ref": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + }, + "fields": { + "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + }, + "types": { + "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + } + }, + "select": { + "$data": "0/widget" + }, + "selectCases": { + "unknown": {}, + "string": {}, + "number": { + "properties": { + "step": { + "type": "number" + }, + "value_type": { + "type": "string" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "text": {}, + "image": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "file": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "select": { + "properties": { + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "options": { + "type": "array", + "items": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }, { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }] + } + }, + "required": ["label", "value"] + }] + } + } + }, + "required": ["options"] + }, + "markdown": { + "properties": { + "minimal": { + "type": "boolean" + }, + "buttons": { + "type": "array", + "items": { + "type": "string", + "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] + } + }, + "editor_components": { + "type": "array", + "items": { + "type": "string" + } + }, + "modes": { + "type": "array", + "items": { + "type": "string", + "enum": ["raw", "rich_text"] + }, + "minItems": 1 + } + } + }, + "list": { + "properties": { + "allow_add": { + "type": "boolean" + }, + "collapsed": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "minimize_collapsed": { + "type": "boolean" + }, + "label_singular": { + "type": "string" + }, + "i18n": { + "type": "boolean" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "object": { + "properties": { + "collapsed": { + "type": "boolean" + }, + "i18n": { + "type": "boolean" + } + } + }, + "relation": { + "properties": { + "collection": { + "type": "string" + }, + "value_field": { + "type": "string" + }, + "search_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "file": { + "type": "string" + }, + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "display_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "options_length": { + "type": "integer" + } + }, + "oneOf": [{ + "required": ["collection", "value_field", "search_fields"] + }, { + "required": ["collection", "valueField", "searchFields"] + }] + }, + "boolean": {}, + "map": { + "properties": { + "decimals": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": ["Point", "LineString", "Polygon"] + } + } + }, + "date": {}, + "datetime": { + "properties": { + "format": { + "type": "string" + }, + "date_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "time_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "picker_utc": { + "type": "boolean" + } + } + }, + "code": { + "properties": { + "default_language": { + "type": "string" + }, + "allow_language_selection": { + "type": "boolean" + }, + "output_code_only": { + "type": "boolean" + }, + "keys": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "lang": { + "type": "string" + } + } + } + } + }, + "color": {} + }, + "required": ["name"] + }; + refVal3.errors = null; + refVal[3] = refVal3; + var refVal4 = (function() { + var pattern0 = new RegExp('^[a-zA-Z-_]+$'); + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; /*# sourceURL=fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e */ + var vErrors = null; + var errors = 0; + if (rootData === undefined) rootData = data; + if (Array.isArray(data)) { + if (data.length < 1) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + "", + schemaPath: '#/minItems', + params: { + limit: 1 + }, + message: 'should NOT have fewer than 1 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__0 = errors; + var valid0; + for (var i0 = 0; i0 < data.length; i0++) { + var data1 = data[i0]; + var errs_1 = errors; + if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { + var errs__1 = errors; + var valid2 = true; + if (data1.name === undefined) { + valid2 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '[' + i0 + ']', + schemaPath: '#/items/required', + params: { + missingProperty: 'name' + }, + message: 'should have required property \'name\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_2 = errors; + if (typeof data1.name !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].name', + schemaPath: '#/items/properties/name/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + if (data1.label !== undefined) { + var errs_2 = errors; + if (typeof data1.label !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].label', + schemaPath: '#/items/properties/label/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + if (data1.widget !== undefined) { + var errs_2 = errors; + if (typeof data1.widget !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].widget', + schemaPath: '#/items/properties/widget/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + if (data1.required !== undefined) { + var errs_2 = errors; + if (typeof data1.required !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].required', + schemaPath: '#/items/properties/required/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + var data2 = data1.i18n; + if (data2 !== undefined) { + var errs_2 = errors; + var errs__2 = errors, + prevValid2 = false, + valid2 = false, + passingSchemas2 = null; + var errs_3 = errors; + if (typeof data2 !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', + schemaPath: '#/items/properties/i18n/oneOf/0/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + if (valid3) { + valid2 = prevValid2 = true; + passingSchemas2 = 0; + } + var errs_3 = errors; + if (typeof data2 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema3 = validate.schema.items.properties.i18n.oneOf[1].enum; + var valid3; + valid3 = false; + for (var i3 = 0; i3 < schema3.length; i3++) + if (equal(data2, schema3[i3])) { + valid3 = true; + break; + } if (!valid3) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/enum', + params: { + allowedValues: schema3 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + if (valid3 && prevValid2) { + valid2 = false; + passingSchemas2 = [passingSchemas2, 1]; + } else { + if (valid3) { + valid2 = prevValid2 = true; + passingSchemas2 = 1; + } + } + if (!valid2) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', + schemaPath: '#/items/properties/i18n/oneOf', + params: { + passingSchemas: passingSchemas2 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__2; + if (vErrors !== null) { + if (errs__2) vErrors.length = errs__2; + else vErrors = null; + } + } + var valid2 = errors === errs_2; + } + if (data1.hint !== undefined) { + var errs_2 = errors; + if (typeof data1.hint !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].hint', + schemaPath: '#/items/properties/hint/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + var data2 = data1.pattern; + if (data2 !== undefined) { + var errs_2 = errors; + if (Array.isArray(data2)) { + if (data2.length < 2) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '[' + i0 + '].pattern', + schemaPath: '#/items/properties/pattern/minItems', + params: { + limit: 2 + }, + message: 'should NOT have fewer than 2 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__2 = errors; + var valid2; + valid3 = true; + if (data2.length > 0) { + var errs_3 = errors; + var errs__3 = errors, + prevValid3 = false, + valid3 = false, + passingSchemas3 = null; + var errs_4 = errors; + if (typeof data2[0] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', + schemaPath: '#/items/properties/pattern/items/0/oneOf/0/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + if (valid4) { + valid3 = prevValid3 = true; + passingSchemas3 = 0; + } + var valid4 = true; + if (valid4 && prevValid3) { + valid3 = false; + passingSchemas3 = [passingSchemas3, 1]; + } else { + if (valid4) { + valid3 = prevValid3 = true; + passingSchemas3 = 1; + } + } + if (!valid3) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', + schemaPath: '#/items/properties/pattern/items/0/oneOf', + params: { + passingSchemas: passingSchemas3 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__3; + if (vErrors !== null) { + if (errs__3) vErrors.length = errs__3; + else vErrors = null; + } + } + var valid3 = errors === errs_3; + } + valid3 = true; + if (data2.length > 1) { + var errs_3 = errors; + if (typeof data2[1] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 1 + ']', + schemaPath: '#/items/properties/pattern/items/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + '].pattern', + schemaPath: '#/items/properties/pattern/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + if (data1.field !== undefined) { + var errs_2 = errors; + if (!refVal[3](data1.field, (dataPath || '') + '[' + i0 + '].field', data1, 'field', rootData)) { + if (vErrors === null) vErrors = refVal[3].errors; + else vErrors = vErrors.concat(refVal[3].errors); + errors = vErrors.length; + } + var valid2 = errors === errs_2; + } + if (data1.fields !== undefined) { + var errs_2 = errors; + if (!refVal[4](data1.fields, (dataPath || '') + '[' + i0 + '].fields', data1, 'fields', rootData)) { + if (vErrors === null) vErrors = refVal[4].errors; + else vErrors = vErrors.concat(refVal[4].errors); + errors = vErrors.length; + } + var valid2 = errors === errs_2; + } + if (data1.types !== undefined) { + var errs_2 = errors; + if (!refVal[4](data1.types, (dataPath || '') + '[' + i0 + '].types', data1, 'types', rootData)) { + if (vErrors === null) vErrors = refVal[4].errors; + else vErrors = vErrors.concat(refVal[4].errors); + errors = vErrors.length; + } + var valid2 = errors === errs_2; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '[' + i0 + ']', + schemaPath: '#/items/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + validate.errors = vErrors; + return errors === 0; + }; + })(); + refVal4.schema = { + "$id": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", + "type": "array", + "minItems": 1, + "items": { + "$id": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", + "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" + }, { + "instanceof": "RegExp" + }] + }, { + "type": "string" + }] + }, + "field": { + "$ref": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + }, + "fields": { + "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + }, + "types": { + "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + } + }, + "select": { + "$data": "0/widget" + }, + "selectCases": { + "unknown": {}, + "string": {}, + "number": { + "properties": { + "step": { + "type": "number" + }, + "value_type": { + "type": "string" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "text": {}, + "image": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "file": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "select": { + "properties": { + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "options": { + "type": "array", + "items": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }, { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }] + } + }, + "required": ["label", "value"] + }] + } + } + }, + "required": ["options"] + }, + "markdown": { + "properties": { + "minimal": { + "type": "boolean" + }, + "buttons": { + "type": "array", + "items": { + "type": "string", + "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] + } + }, + "editor_components": { + "type": "array", + "items": { + "type": "string" + } + }, + "modes": { + "type": "array", + "items": { + "type": "string", + "enum": ["raw", "rich_text"] + }, + "minItems": 1 + } + } + }, + "list": { + "properties": { + "allow_add": { + "type": "boolean" + }, + "collapsed": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "minimize_collapsed": { + "type": "boolean" + }, + "label_singular": { + "type": "string" + }, + "i18n": { + "type": "boolean" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "object": { + "properties": { + "collapsed": { + "type": "boolean" + }, + "i18n": { + "type": "boolean" + } + } + }, + "relation": { + "properties": { + "collection": { + "type": "string" + }, + "value_field": { + "type": "string" + }, + "search_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "file": { + "type": "string" + }, + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "display_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "options_length": { + "type": "integer" + } + }, + "oneOf": [{ + "required": ["collection", "value_field", "search_fields"] + }, { + "required": ["collection", "valueField", "searchFields"] + }] + }, + "boolean": {}, + "map": { + "properties": { + "decimals": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": ["Point", "LineString", "Polygon"] + } + } + }, + "date": {}, + "datetime": { + "properties": { + "format": { + "type": "string" + }, + "date_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "time_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "picker_utc": { + "type": "boolean" + } + } + }, + "code": { + "properties": { + "default_language": { + "type": "string" + }, + "allow_language_selection": { + "type": "boolean" + }, + "output_code_only": { + "type": "boolean" + }, + "keys": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "lang": { + "type": "string" + } + } + } + } + }, + "color": {} + }, + "required": ["name"] + }, + "uniqueItemProperties": ["name"] + }; + refVal4.errors = null; + refVal[4] = refVal4; + return function validate(data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; /*# sourceURL=https://netlify-cms/object.json */ + var vErrors = null; + var errors = 0; + if (rootData === undefined) rootData = data; + if ((data && typeof data === "object" && !Array.isArray(data))) { + var errs__0 = errors; + var valid1 = true; + var data1 = data.backend; + if (data1 === undefined) { + valid1 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + "", + schemaPath: '#/required', + params: { + missingProperty: 'backend' + }, + message: 'should have required property \'backend\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_1 = errors; + if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { + var errs__1 = errors; + var valid2 = true; + if (data1.name === undefined) { + valid2 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.backend', + schemaPath: '#/properties/backend/required', + params: { + missingProperty: 'name' + }, + message: 'should have required property \'name\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_2 = errors; + if (typeof data1.name !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.backend.name', + schemaPath: '#/properties/backend/properties/name/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + var data2 = data1.auth_scope; + if (data2 !== undefined) { + var errs_2 = errors; + if (typeof data2 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.backend.auth_scope', + schemaPath: '#/properties/backend/properties/auth_scope/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema2 = validate.schema.properties.backend.properties.auth_scope.enum; + var valid2; + valid2 = false; + for (var i2 = 0; i2 < schema2.length; i2++) + if (equal(data2, schema2[i2])) { + valid2 = true; + break; + } if (!valid2) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.backend.auth_scope', + schemaPath: '#/properties/backend/properties/auth_scope/enum', + params: { + allowedValues: schema2 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + var data2 = data1.cms_label_prefix; + if (data2 !== undefined) { + var errs_2 = errors; + if (typeof data2 === "string") { + if (ucs2length(data2) < 1) { + var err = { + keyword: 'minLength', + dataPath: (dataPath || '') + '.backend.cms_label_prefix', + schemaPath: '#/properties/backend/properties/cms_label_prefix/minLength', + params: { + limit: 1 + }, + message: 'should NOT be shorter than 1 characters' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.backend.cms_label_prefix', + schemaPath: '#/properties/backend/properties/cms_label_prefix/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + if (data1.open_authoring !== undefined) { + var errs_2 = errors; + if (typeof data1.open_authoring !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.backend.open_authoring', + schemaPath: '#/properties/backend/properties/open_authoring/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.backend', + schemaPath: '#/properties/backend/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + var data1 = data.local_backend; + if (data1 !== undefined) { + var errs_1 = errors; + var errs__1 = errors, + prevValid1 = false, + valid1 = false, + passingSchemas1 = null; + var errs_2 = errors; + if (typeof data1 !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.local_backend', + schemaPath: '#/properties/local_backend/oneOf/0/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + if (valid2) { + valid1 = prevValid1 = true; + passingSchemas1 = 0; + } + var errs_2 = errors; + if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { + var errs__2 = errors; + var valid3 = true; + for (var key2 in data1) { + var isAdditional2 = !(false || key2 == 'url' || key2 == 'allowed_hosts'); + if (isAdditional2) { + valid3 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + '.local_backend', + schemaPath: '#/properties/local_backend/oneOf/1/additionalProperties', + params: { + additionalProperty: '' + key2 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + if (data1.url !== undefined) { + var errs_3 = errors; + if (typeof data1.url !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.local_backend.url', + schemaPath: '#/properties/local_backend/oneOf/1/properties/url/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data2 = data1.allowed_hosts; + if (data2 !== undefined) { + var errs_3 = errors; + if (Array.isArray(data2)) { + var errs__3 = errors; + var valid3; + for (var i3 = 0; i3 < data2.length; i3++) { + var errs_4 = errors; + if (typeof data2[i3] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.local_backend.allowed_hosts[' + i3 + ']', + schemaPath: '#/properties/local_backend/oneOf/1/properties/allowed_hosts/items/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.local_backend.allowed_hosts', + schemaPath: '#/properties/local_backend/oneOf/1/properties/allowed_hosts/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.local_backend', + schemaPath: '#/properties/local_backend/oneOf/1/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + if (valid2 && prevValid1) { + valid1 = false; + passingSchemas1 = [passingSchemas1, 1]; + } else { + if (valid2) { + valid1 = prevValid1 = true; + passingSchemas1 = 1; + } + } + if (!valid1) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.local_backend', + schemaPath: '#/properties/local_backend/oneOf', + params: { + passingSchemas: passingSchemas1 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__1; + if (vErrors !== null) { + if (errs__1) vErrors.length = errs__1; + else vErrors = null; + } + } + var valid1 = errors === errs_1; + } + if (data.locale !== undefined) { + var errs_1 = errors; + if (typeof data.locale !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.locale', + schemaPath: '#/properties/locale/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + var data1 = data.i18n; + if (data1 !== undefined) { + var errs_1 = errors; + if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { + var errs__1 = errors; + var valid2 = true; + var data2 = data1.structure; + if (data2 === undefined) { + valid2 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.i18n', + schemaPath: '#/properties/i18n/required', + params: { + missingProperty: 'structure' + }, + message: 'should have required property \'structure\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_2 = errors; + if (typeof data2 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.i18n.structure', + schemaPath: '#/properties/i18n/properties/structure/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema2 = validate.schema.properties.i18n.properties.structure.enum; + var valid2; + valid2 = false; + for (var i2 = 0; i2 < schema2.length; i2++) + if (equal(data2, schema2[i2])) { + valid2 = true; + break; + } if (!valid2) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.i18n.structure', + schemaPath: '#/properties/i18n/properties/structure/enum', + params: { + allowedValues: schema2 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + var data2 = data1.locales; + if (data2 === undefined) { + valid2 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.i18n', + schemaPath: '#/properties/i18n/required', + params: { + missingProperty: 'locales' + }, + message: 'should have required property \'locales\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_2 = errors; + if (Array.isArray(data2)) { + if (data2.length < 2) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.i18n.locales', + schemaPath: '#/properties/i18n/properties/locales/minItems', + params: { + limit: 2 + }, + message: 'should NOT have fewer than 2 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__2 = errors; + var valid2; + for (var i2 = 0; i2 < data2.length; i2++) { + var data3 = data2[i2]; + var errs_3 = errors; + if (typeof data3 === "string") { + if (ucs2length(data3) > 10) { + var err = { + keyword: 'maxLength', + dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', + schemaPath: '#/properties/i18n/properties/locales/items/maxLength', + params: { + limit: 10 + }, + message: 'should NOT be longer than 10 characters' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (ucs2length(data3) < 2) { + var err = { + keyword: 'minLength', + dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', + schemaPath: '#/properties/i18n/properties/locales/items/minLength', + params: { + limit: 2 + }, + message: 'should NOT be shorter than 2 characters' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (!pattern0.test(data3)) { + var err = { + keyword: 'pattern', + dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', + schemaPath: '#/properties/i18n/properties/locales/items/pattern', + params: { + pattern: '^[a-zA-Z-_]+$' + }, + message: 'should match pattern "^[a-zA-Z-_]+$"' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', + schemaPath: '#/properties/i18n/properties/locales/items/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var i = data2.length, + valid2 = true, + j; + if (i > 1) { + var itemIndices = {}, + item; + for (; i--;) { + var item = data2[i]; + if (typeof item !== "string") continue; + if (typeof itemIndices[item] == 'number') { + valid2 = false; + j = itemIndices[item]; + break; + } + itemIndices[item] = i; + } + } + if (!valid2) { + var err = { + keyword: 'uniqueItems', + dataPath: (dataPath || '') + '.i18n.locales', + schemaPath: '#/properties/i18n/properties/locales/uniqueItems', + params: { + i: i, + j: j + }, + message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.i18n.locales', + schemaPath: '#/properties/i18n/properties/locales/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + var data2 = data1.default_locale; + if (data2 !== undefined) { + var errs_2 = errors; + if (typeof data2 === "string") { + if (ucs2length(data2) > 10) { + var err = { + keyword: 'maxLength', + dataPath: (dataPath || '') + '.i18n.default_locale', + schemaPath: '#/properties/i18n/properties/default_locale/maxLength', + params: { + limit: 10 + }, + message: 'should NOT be longer than 10 characters' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (ucs2length(data2) < 2) { + var err = { + keyword: 'minLength', + dataPath: (dataPath || '') + '.i18n.default_locale', + schemaPath: '#/properties/i18n/properties/default_locale/minLength', + params: { + limit: 2 + }, + message: 'should NOT be shorter than 2 characters' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (!pattern0.test(data2)) { + var err = { + keyword: 'pattern', + dataPath: (dataPath || '') + '.i18n.default_locale', + schemaPath: '#/properties/i18n/properties/default_locale/pattern', + params: { + pattern: '^[a-zA-Z-_]+$' + }, + message: 'should match pattern "^[a-zA-Z-_]+$"' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.i18n.default_locale', + schemaPath: '#/properties/i18n/properties/default_locale/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.i18n', + schemaPath: '#/properties/i18n/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.site_url !== undefined) { + var errs_1 = errors; + if (typeof data.site_url !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.site_url', + schemaPath: '#/properties/site_url/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.display_url !== undefined) { + var errs_1 = errors; + if (typeof data.display_url !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.display_url', + schemaPath: '#/properties/display_url/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.logo_url !== undefined) { + var errs_1 = errors; + if (typeof data.logo_url !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.logo_url', + schemaPath: '#/properties/logo_url/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.show_preview_links !== undefined) { + var errs_1 = errors; + if (typeof data.show_preview_links !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.show_preview_links', + schemaPath: '#/properties/show_preview_links/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.media_folder !== undefined) { + var errs_1 = errors; + if (typeof data.media_folder !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.media_folder', + schemaPath: '#/properties/media_folder/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.public_folder !== undefined) { + var errs_1 = errors; + if (typeof data.public_folder !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.public_folder', + schemaPath: '#/properties/public_folder/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + if (data.media_folder_relative !== undefined) { + var errs_1 = errors; + if (typeof data.media_folder_relative !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.media_folder_relative', + schemaPath: '#/properties/media_folder_relative/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + var data1 = data.media_library; + if (data1 !== undefined) { + var errs_1 = errors; + if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { + var errs__1 = errors; + var valid2 = true; + if (data1.name === undefined) { + valid2 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.media_library', + schemaPath: '#/properties/media_library/required', + params: { + missingProperty: 'name' + }, + message: 'should have required property \'name\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_2 = errors; + if (typeof data1.name !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.media_library.name', + schemaPath: '#/properties/media_library/properties/name/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + var data2 = data1.config; + if (data2 !== undefined) { + var errs_2 = errors; + if ((!data2 || typeof data2 !== "object" || Array.isArray(data2))) { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.media_library.config', + schemaPath: '#/properties/media_library/properties/config/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.media_library', + schemaPath: '#/properties/media_library/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + var data1 = data.publish_mode; + if (data1 !== undefined) { + var errs_1 = errors; + if (typeof data1 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.publish_mode', + schemaPath: '#/properties/publish_mode/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema1 = validate.schema.properties.publish_mode.enum; + var valid1; + valid1 = false; + for (var i1 = 0; i1 < schema1.length; i1++) + if (equal(data1, schema1[i1])) { + valid1 = true; + break; + } if (!valid1) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.publish_mode', + schemaPath: '#/properties/publish_mode/enum', + params: { + allowedValues: schema1 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + var data1 = data.slug; + if (data1 !== undefined) { + var errs_1 = errors; + if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { + var errs__1 = errors; + var valid2 = true; + var data2 = data1.encoding; + if (data2 !== undefined) { + var errs_2 = errors; + if (typeof data2 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.slug.encoding', + schemaPath: '#/properties/slug/properties/encoding/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema2 = validate.schema.properties.slug.properties.encoding.enum; + var valid2; + valid2 = false; + for (var i2 = 0; i2 < schema2.length; i2++) + if (equal(data2, schema2[i2])) { + valid2 = true; + break; + } if (!valid2) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.slug.encoding', + schemaPath: '#/properties/slug/properties/encoding/enum', + params: { + allowedValues: schema2 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + if (data1.clean_accents !== undefined) { + var errs_2 = errors; + if (typeof data1.clean_accents !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.slug.clean_accents', + schemaPath: '#/properties/slug/properties/clean_accents/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.slug', + schemaPath: '#/properties/slug/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + var data1 = data.collections; + if (data1 === undefined) { + valid1 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + "", + schemaPath: '#/required', + params: { + missingProperty: 'collections' + }, + message: 'should have required property \'collections\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_1 = errors; + if (Array.isArray(data1)) { + if (data1.length < 1) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.collections', + schemaPath: '#/properties/collections/minItems', + params: { + limit: 1 + }, + message: 'should NOT have fewer than 1 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__1 = errors; + var valid1; + for (var i1 = 0; i1 < data1.length; i1++) { + var data2 = data1[i1]; + var errs_2 = errors; + if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { + var errs__2 = errors; + var missing2; + valid3 = true; + if (data2.frontmatter_delimiter !== undefined) { + var errs_3 = errors; + if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { + var errs__3 = errors; + var valid4 = true; + if (data2.format === undefined) { + valid4 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/dependencies/frontmatter_delimiter/required', + params: { + missingProperty: 'format' + }, + message: 'should have required property \'format\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_4 = errors; + var schema4 = validate.schema.properties.collections.items.dependencies.frontmatter_delimiter.properties.format.enum; + var valid4; + valid4 = false; + for (var i4 = 0; i4 < schema4.length; i4++) + if (equal(data2.format, schema4[i4])) { + valid4 = true; + break; + } if (!valid4) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.collections[' + i1 + '].format', + schemaPath: '#/properties/collections/items/dependencies/frontmatter_delimiter/properties/format/enum', + params: { + allowedValues: schema4 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } + var valid3 = errors === errs_3; + } + var errs__2 = errors; + var valid3 = true; + if (data2.name === undefined) { + valid3 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/required', + params: { + missingProperty: 'name' + }, + message: 'should have required property \'name\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_3 = errors; + if (typeof data2.name !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].name', + schemaPath: '#/properties/collections/items/properties/name/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.label === undefined) { + valid3 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/required', + params: { + missingProperty: 'label' + }, + message: 'should have required property \'label\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_3 = errors; + if (typeof data2.label !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].label', + schemaPath: '#/properties/collections/items/properties/label/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.label_singular !== undefined) { + var errs_3 = errors; + if (typeof data2.label_singular !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].label_singular', + schemaPath: '#/properties/collections/items/properties/label_singular/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.description !== undefined) { + var errs_3 = errors; + if (typeof data2.description !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].description', + schemaPath: '#/properties/collections/items/properties/description/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.folder !== undefined) { + var errs_3 = errors; + if (typeof data2.folder !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].folder', + schemaPath: '#/properties/collections/items/properties/folder/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data3 = data2.files; + if (data3 !== undefined) { + var errs_3 = errors; + if (Array.isArray(data3)) { + var errs__3 = errors; + var valid3; + for (var i3 = 0; i3 < data3.length; i3++) { + var data4 = data3[i3]; + var errs_4 = errors; + if ((data4 && typeof data4 === "object" && !Array.isArray(data4))) { + var errs__4 = errors; + var valid5 = true; + if (data4.name === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/files/items/required', + params: { + missingProperty: 'name' + }, + message: 'should have required property \'name\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (typeof data4.name !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].name', + schemaPath: '#/properties/collections/items/properties/files/items/properties/name/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.label === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/files/items/required', + params: { + missingProperty: 'label' + }, + message: 'should have required property \'label\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (typeof data4.label !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].label', + schemaPath: '#/properties/collections/items/properties/files/items/properties/label/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.label_singular !== undefined) { + var errs_5 = errors; + if (typeof data4.label_singular !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].label_singular', + schemaPath: '#/properties/collections/items/properties/files/items/properties/label_singular/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.description !== undefined) { + var errs_5 = errors; + if (typeof data4.description !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].description', + schemaPath: '#/properties/collections/items/properties/files/items/properties/description/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.file === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/files/items/required', + params: { + missingProperty: 'file' + }, + message: 'should have required property \'file\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (typeof data4.file !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].file', + schemaPath: '#/properties/collections/items/properties/files/items/properties/file/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.preview_path !== undefined) { + var errs_5 = errors; + if (typeof data4.preview_path !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].preview_path', + schemaPath: '#/properties/collections/items/properties/files/items/properties/preview_path/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.preview_path_date_field !== undefined) { + var errs_5 = errors; + if (typeof data4.preview_path_date_field !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].preview_path_date_field', + schemaPath: '#/properties/collections/items/properties/files/items/properties/preview_path_date_field/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + var data5 = data4.fields; + if (data5 === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/files/items/required', + params: { + missingProperty: 'fields' + }, + message: 'should have required property \'fields\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (Array.isArray(data5)) { + if (data5.length < 1) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/minItems', + params: { + limit: 1 + }, + message: 'should NOT have fewer than 1 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__5 = errors; + var valid5; + for (var i5 = 0; i5 < data5.length; i5++) { + var data6 = data5[i5]; + var errs_6 = errors; + if ((data6 && typeof data6 === "object" && !Array.isArray(data6))) { + var errs__6 = errors; + var valid7 = true; + if (data6.name === undefined) { + valid7 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/required', + params: { + missingProperty: 'name' + }, + message: 'should have required property \'name\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_7 = errors; + if (typeof data6.name !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].name', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/name/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid7 = errors === errs_7; + } + if (data6.label !== undefined) { + var errs_7 = errors; + if (typeof data6.label !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].label', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/label/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid7 = errors === errs_7; + } + if (data6.widget !== undefined) { + var errs_7 = errors; + if (typeof data6.widget !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].widget', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/widget/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid7 = errors === errs_7; + } + if (data6.required !== undefined) { + var errs_7 = errors; + if (typeof data6.required !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].required', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/required/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid7 = errors === errs_7; + } + var data7 = data6.i18n; + if (data7 !== undefined) { + var errs_7 = errors; + var errs__7 = errors, + prevValid7 = false, + valid7 = false, + passingSchemas7 = null; + var errs_8 = errors; + if (typeof data7 !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/0/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid8 = errors === errs_8; + if (valid8) { + valid7 = prevValid7 = true; + passingSchemas7 = 0; + } + var errs_8 = errors; + if (typeof data7 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema8 = validate.schema.properties.collections.items.properties.files.items.properties.fields.items.properties.i18n.oneOf[1].enum; + var valid8; + valid8 = false; + for (var i8 = 0; i8 < schema8.length; i8++) + if (equal(data7, schema8[i8])) { + valid8 = true; + break; + } if (!valid8) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/enum', + params: { + allowedValues: schema8 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid8 = errors === errs_8; + if (valid8 && prevValid7) { + valid7 = false; + passingSchemas7 = [passingSchemas7, 1]; + } else { + if (valid8) { + valid7 = prevValid7 = true; + passingSchemas7 = 1; + } + } + if (!valid7) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf', + params: { + passingSchemas: passingSchemas7 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__7; + if (vErrors !== null) { + if (errs__7) vErrors.length = errs__7; + else vErrors = null; + } + } + var valid7 = errors === errs_7; + } + if (data6.hint !== undefined) { + var errs_7 = errors; + if (typeof data6.hint !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].hint', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/hint/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid7 = errors === errs_7; + } + var data7 = data6.pattern; + if (data7 !== undefined) { + var errs_7 = errors; + if (Array.isArray(data7)) { + if (data7.length < 2) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/minItems', + params: { + limit: 2 + }, + message: 'should NOT have fewer than 2 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__7 = errors; + var valid7; + valid8 = true; + if (data7.length > 0) { + var errs_8 = errors; + var errs__8 = errors, + prevValid8 = false, + valid8 = false, + passingSchemas8 = null; + var errs_9 = errors; + if (typeof data7[0] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid9 = errors === errs_9; + if (valid9) { + valid8 = prevValid8 = true; + passingSchemas8 = 0; + } + var valid9 = true; + if (valid9 && prevValid8) { + valid8 = false; + passingSchemas8 = [passingSchemas8, 1]; + } else { + if (valid9) { + valid8 = prevValid8 = true; + passingSchemas8 = 1; + } + } + if (!valid8) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf', + params: { + passingSchemas: passingSchemas8 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__8; + if (vErrors !== null) { + if (errs__8) vErrors.length = errs__8; + else vErrors = null; + } + } + var valid8 = errors === errs_8; + } + valid8 = true; + if (data7.length > 1) { + var errs_8 = errors; + if (typeof data7[1] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 1 + ']', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid8 = errors === errs_8; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid7 = errors === errs_7; + } + if (data6.field !== undefined) { + var errs_7 = errors; + if (!refVal1(data6.field, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].field', data6, 'field', rootData)) { + if (vErrors === null) vErrors = refVal1.errors; + else vErrors = vErrors.concat(refVal1.errors); + errors = vErrors.length; + } + var valid7 = errors === errs_7; + } + if (data6.fields !== undefined) { + var errs_7 = errors; + if (!refVal[2](data6.fields, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].fields', data6, 'fields', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid7 = errors === errs_7; + } + if (data6.types !== undefined) { + var errs_7 = errors; + if (!refVal[2](data6.types, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].types', data6, 'types', rootData)) { + if (vErrors === null) vErrors = refVal[2].errors; + else vErrors = vErrors.concat(refVal[2].errors); + errors = vErrors.length; + } + var valid7 = errors === errs_7; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid6 = errors === errs_6; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/files/items/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files', + schemaPath: '#/properties/collections/items/properties/files/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.identifier_field !== undefined) { + var errs_3 = errors; + if (typeof data2.identifier_field !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].identifier_field', + schemaPath: '#/properties/collections/items/properties/identifier_field/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.summary !== undefined) { + var errs_3 = errors; + if (typeof data2.summary !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].summary', + schemaPath: '#/properties/collections/items/properties/summary/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.slug !== undefined) { + var errs_3 = errors; + if (typeof data2.slug !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].slug', + schemaPath: '#/properties/collections/items/properties/slug/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.path !== undefined) { + var errs_3 = errors; + if (typeof data2.path !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].path', + schemaPath: '#/properties/collections/items/properties/path/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.preview_path !== undefined) { + var errs_3 = errors; + if (typeof data2.preview_path !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].preview_path', + schemaPath: '#/properties/collections/items/properties/preview_path/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.preview_path_date_field !== undefined) { + var errs_3 = errors; + if (typeof data2.preview_path_date_field !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].preview_path_date_field', + schemaPath: '#/properties/collections/items/properties/preview_path_date_field/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.create !== undefined) { + var errs_3 = errors; + if (typeof data2.create !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].create', + schemaPath: '#/properties/collections/items/properties/create/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.publish !== undefined) { + var errs_3 = errors; + if (typeof data2.publish !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].publish', + schemaPath: '#/properties/collections/items/properties/publish/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.hide !== undefined) { + var errs_3 = errors; + if (typeof data2.hide !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].hide', + schemaPath: '#/properties/collections/items/properties/hide/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data3 = data2.editor; + if (data3 !== undefined) { + var errs_3 = errors; + if ((data3 && typeof data3 === "object" && !Array.isArray(data3))) { + var errs__3 = errors; + var valid4 = true; + if (data3.preview !== undefined) { + var errs_4 = errors; + if (typeof data3.preview !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].editor.preview', + schemaPath: '#/properties/collections/items/properties/editor/properties/preview/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].editor', + schemaPath: '#/properties/collections/items/properties/editor/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data3 = data2.format; + if (data3 !== undefined) { + var errs_3 = errors; + if (typeof data3 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].format', + schemaPath: '#/properties/collections/items/properties/format/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema3 = validate.schema.properties.collections.items.properties.format.enum; + var valid3; + valid3 = false; + for (var i3 = 0; i3 < schema3.length; i3++) + if (equal(data3, schema3[i3])) { + valid3 = true; + break; + } if (!valid3) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.collections[' + i1 + '].format', + schemaPath: '#/properties/collections/items/properties/format/enum', + params: { + allowedValues: schema3 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + if (data2.extension !== undefined) { + var errs_3 = errors; + if (typeof data2.extension !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].extension', + schemaPath: '#/properties/collections/items/properties/extension/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data3 = data2.frontmatter_delimiter; + if (data3 !== undefined) { + var errs_3 = errors; + if (typeof data3 !== "string" && !Array.isArray(data3)) { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', + schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/type', + params: { + type: 'string,array' + }, + message: 'should be string,array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (Array.isArray(data3)) { + if (data3.length > 2) { + var err = { + keyword: 'maxItems', + dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', + schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/maxItems', + params: { + limit: 2 + }, + message: 'should NOT have more than 2 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (data3.length < 2) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', + schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/minItems', + params: { + limit: 2 + }, + message: 'should NOT have fewer than 2 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__3 = errors; + var valid3; + for (var i3 = 0; i3 < data3.length; i3++) { + var errs_4 = errors; + if (typeof data3[i3] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/items/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } + var valid3 = errors === errs_3; + } + var data3 = data2.fields; + if (data3 !== undefined) { + var errs_3 = errors; + if (Array.isArray(data3)) { + if (data3.length < 1) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields', + schemaPath: '#/properties/collections/items/properties/fields/minItems', + params: { + limit: 1 + }, + message: 'should NOT have fewer than 1 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__3 = errors; + var valid3; + for (var i3 = 0; i3 < data3.length; i3++) { + var data4 = data3[i3]; + var errs_4 = errors; + if ((data4 && typeof data4 === "object" && !Array.isArray(data4))) { + var errs__4 = errors; + var valid5 = true; + if (data4.name === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/fields/items/required', + params: { + missingProperty: 'name' + }, + message: 'should have required property \'name\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (typeof data4.name !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].name', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/name/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.label !== undefined) { + var errs_5 = errors; + if (typeof data4.label !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].label', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/label/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.widget !== undefined) { + var errs_5 = errors; + if (typeof data4.widget !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].widget', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/widget/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.required !== undefined) { + var errs_5 = errors; + if (typeof data4.required !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].required', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/required/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + var data5 = data4.i18n; + if (data5 !== undefined) { + var errs_5 = errors; + var errs__5 = errors, + prevValid5 = false, + valid5 = false, + passingSchemas5 = null; + var errs_6 = errors; + if (typeof data5 !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/0/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid6 = errors === errs_6; + if (valid6) { + valid5 = prevValid5 = true; + passingSchemas5 = 0; + } + var errs_6 = errors; + if (typeof data5 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema6 = validate.schema.properties.collections.items.properties.fields.items.properties.i18n.oneOf[1].enum; + var valid6; + valid6 = false; + for (var i6 = 0; i6 < schema6.length; i6++) + if (equal(data5, schema6[i6])) { + valid6 = true; + break; + } if (!valid6) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/enum', + params: { + allowedValues: schema6 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid6 = errors === errs_6; + if (valid6 && prevValid5) { + valid5 = false; + passingSchemas5 = [passingSchemas5, 1]; + } else { + if (valid6) { + valid5 = prevValid5 = true; + passingSchemas5 = 1; + } + } + if (!valid5) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf', + params: { + passingSchemas: passingSchemas5 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__5; + if (vErrors !== null) { + if (errs__5) vErrors.length = errs__5; + else vErrors = null; + } + } + var valid5 = errors === errs_5; + } + if (data4.hint !== undefined) { + var errs_5 = errors; + if (typeof data4.hint !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].hint', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/hint/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + var data5 = data4.pattern; + if (data5 !== undefined) { + var errs_5 = errors; + if (Array.isArray(data5)) { + if (data5.length < 2) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/minItems', + params: { + limit: 2 + }, + message: 'should NOT have fewer than 2 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__5 = errors; + var valid5; + valid6 = true; + if (data5.length > 0) { + var errs_6 = errors; + var errs__6 = errors, + prevValid6 = false, + valid6 = false, + passingSchemas6 = null; + var errs_7 = errors; + if (typeof data5[0] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid7 = errors === errs_7; + if (valid7) { + valid6 = prevValid6 = true; + passingSchemas6 = 0; + } + var valid7 = true; + if (valid7 && prevValid6) { + valid6 = false; + passingSchemas6 = [passingSchemas6, 1]; + } else { + if (valid7) { + valid6 = prevValid6 = true; + passingSchemas6 = 1; + } + } + if (!valid6) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf', + params: { + passingSchemas: passingSchemas6 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__6; + if (vErrors !== null) { + if (errs__6) vErrors.length = errs__6; + else vErrors = null; + } + } + var valid6 = errors === errs_6; + } + valid6 = true; + if (data5.length > 1) { + var errs_6 = errors; + if (typeof data5[1] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 1 + ']', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid6 = errors === errs_6; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern', + schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.field !== undefined) { + var errs_5 = errors; + if (!refVal3(data4.field, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].field', data4, 'field', rootData)) { + if (vErrors === null) vErrors = refVal3.errors; + else vErrors = vErrors.concat(refVal3.errors); + errors = vErrors.length; + } + var valid5 = errors === errs_5; + } + if (data4.fields !== undefined) { + var errs_5 = errors; + if (!refVal[4](data4.fields, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].fields', data4, 'fields', rootData)) { + if (vErrors === null) vErrors = refVal[4].errors; + else vErrors = vErrors.concat(refVal[4].errors); + errors = vErrors.length; + } + var valid5 = errors === errs_5; + } + if (data4.types !== undefined) { + var errs_5 = errors; + if (!refVal[4](data4.types, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].types', data4, 'types', rootData)) { + if (vErrors === null) vErrors = refVal[4].errors; + else vErrors = vErrors.concat(refVal[4].errors); + errors = vErrors.length; + } + var valid5 = errors === errs_5; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/fields/items/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields', + schemaPath: '#/properties/collections/items/properties/fields/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data3 = data2.sortable_fields; + if (data3 !== undefined) { + var errs_3 = errors; + if (Array.isArray(data3)) { + var errs__3 = errors; + var valid3; + for (var i3 = 0; i3 < data3.length; i3++) { + var errs_4 = errors; + if (typeof data3[i3] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].sortable_fields[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/sortable_fields/items/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].sortable_fields', + schemaPath: '#/properties/collections/items/properties/sortable_fields/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data3 = data2.sortableFields; + if (data3 !== undefined) { + var errs_3 = errors; + if (Array.isArray(data3)) { + var errs__3 = errors; + var valid3; + for (var i3 = 0; i3 < data3.length; i3++) { + var errs_4 = errors; + if (typeof data3[i3] !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].sortableFields[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/sortableFields/items/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].sortableFields', + schemaPath: '#/properties/collections/items/properties/sortableFields/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data3 = data2.view_filters; + if (data3 !== undefined) { + var errs_3 = errors; + if (Array.isArray(data3)) { + if (data3.length < 1) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters', + schemaPath: '#/properties/collections/items/properties/view_filters/minItems', + params: { + limit: 1 + }, + message: 'should NOT have fewer than 1 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__3 = errors; + var valid3; + for (var i3 = 0; i3 < data3.length; i3++) { + var data4 = data3[i3]; + var errs_4 = errors; + if ((data4 && typeof data4 === "object" && !Array.isArray(data4))) { + var errs__4 = errors; + var valid5 = true; + for (var key4 in data4) { + var isAdditional4 = !(false || key4 == 'label' || key4 == 'field' || key4 == 'pattern'); + if (isAdditional4) { + valid5 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/view_filters/items/additionalProperties', + params: { + additionalProperty: '' + key4 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + if (data4.label === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/view_filters/items/required', + params: { + missingProperty: 'label' + }, + message: 'should have required property \'label\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (typeof data4.label !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].label', + schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/label/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.field === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/view_filters/items/required', + params: { + missingProperty: 'field' + }, + message: 'should have required property \'field\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (typeof data4.field !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].field', + schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/field/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + var data5 = data4.pattern; + if (data5 === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/view_filters/items/required', + params: { + missingProperty: 'pattern' + }, + message: 'should have required property \'pattern\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + var errs__5 = errors, + prevValid5 = false, + valid5 = false, + passingSchemas5 = null; + var errs_6 = errors; + if (typeof data5 !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', + schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/0/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid6 = errors === errs_6; + if (valid6) { + valid5 = prevValid5 = true; + passingSchemas5 = 0; + } + var errs_6 = errors; + if (typeof data5 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', + schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/1/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid6 = errors === errs_6; + if (valid6 && prevValid5) { + valid5 = false; + passingSchemas5 = [passingSchemas5, 1]; + } else { + if (valid6) { + valid5 = prevValid5 = true; + passingSchemas5 = 1; + } + } + if (!valid5) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', + schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf', + params: { + passingSchemas: passingSchemas5 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__5; + if (vErrors !== null) { + if (errs__5) vErrors.length = errs__5; + else vErrors = null; + } + } + var valid5 = errors === errs_5; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/view_filters/items/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters', + schemaPath: '#/properties/collections/items/properties/view_filters/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data3 = data2.view_groups; + if (data3 !== undefined) { + var errs_3 = errors; + if (Array.isArray(data3)) { + if (data3.length < 1) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups', + schemaPath: '#/properties/collections/items/properties/view_groups/minItems', + params: { + limit: 1 + }, + message: 'should NOT have fewer than 1 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__3 = errors; + var valid3; + for (var i3 = 0; i3 < data3.length; i3++) { + var data4 = data3[i3]; + var errs_4 = errors; + if ((data4 && typeof data4 === "object" && !Array.isArray(data4))) { + var errs__4 = errors; + var valid5 = true; + for (var key4 in data4) { + var isAdditional4 = !(false || key4 == 'label' || key4 == 'field' || key4 == 'pattern'); + if (isAdditional4) { + valid5 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/view_groups/items/additionalProperties', + params: { + additionalProperty: '' + key4 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + if (data4.label === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/view_groups/items/required', + params: { + missingProperty: 'label' + }, + message: 'should have required property \'label\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (typeof data4.label !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].label', + schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/label/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.field === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/view_groups/items/required', + params: { + missingProperty: 'field' + }, + message: 'should have required property \'field\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (typeof data4.field !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].field', + schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/field/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.pattern !== undefined) { + var errs_5 = errors; + if (typeof data4.pattern !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].pattern', + schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/pattern/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', + schemaPath: '#/properties/collections/items/properties/view_groups/items/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups', + schemaPath: '#/properties/collections/items/properties/view_groups/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data3 = data2.nested; + if (data3 !== undefined) { + var errs_3 = errors; + if ((data3 && typeof data3 === "object" && !Array.isArray(data3))) { + var errs__3 = errors; + var valid4 = true; + var data4 = data3.depth; + if (data4 === undefined) { + valid4 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested', + schemaPath: '#/properties/collections/items/properties/nested/required', + params: { + missingProperty: 'depth' + }, + message: 'should have required property \'depth\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_4 = errors; + if ((typeof data4 === "number")) { + if (data4 > 1000 || data4 !== data4) { + var err = { + keyword: 'maximum', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', + schemaPath: '#/properties/collections/items/properties/nested/properties/depth/maximum', + params: { + comparison: '<=', + limit: 1000, + exclusive: false + }, + message: 'should be <= 1000' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (data4 < 1 || data4 !== data4) { + var err = { + keyword: 'minimum', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', + schemaPath: '#/properties/collections/items/properties/nested/properties/depth/minimum', + params: { + comparison: '>=', + limit: 1, + exclusive: false + }, + message: 'should be >= 1' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', + schemaPath: '#/properties/collections/items/properties/nested/properties/depth/type', + params: { + type: 'number' + }, + message: 'should be number' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + if (data3.summary !== undefined) { + var errs_4 = errors; + if (typeof data3.summary !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.summary', + schemaPath: '#/properties/collections/items/properties/nested/properties/summary/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested', + schemaPath: '#/properties/collections/items/properties/nested/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data3 = data2.meta; + if (data3 !== undefined) { + var errs_3 = errors; + if ((data3 && typeof data3 === "object" && !Array.isArray(data3))) { + if (Object.keys(data3).length < 1) { + var err = { + keyword: 'minProperties', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', + schemaPath: '#/properties/collections/items/properties/meta/minProperties', + params: { + limit: 1 + }, + message: 'should NOT have fewer than 1 properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__3 = errors; + var valid4 = true; + for (var key3 in data3) { + var isAdditional3 = !(false || key3 == 'path'); + if (isAdditional3) { + valid4 = false; + var err = { + keyword: 'additionalProperties', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', + schemaPath: '#/properties/collections/items/properties/meta/additionalProperties', + params: { + additionalProperty: '' + key3 + '' + }, + message: 'should NOT have additional properties' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var data4 = data3.path; + if (data4 !== undefined) { + var errs_4 = errors; + if ((data4 && typeof data4 === "object" && !Array.isArray(data4))) { + var errs__4 = errors; + var valid5 = true; + if (data4.label === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', + schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', + params: { + missingProperty: 'label' + }, + message: 'should have required property \'label\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (typeof data4.label !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.label', + schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/label/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.widget === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', + schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', + params: { + missingProperty: 'widget' + }, + message: 'should have required property \'widget\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (typeof data4.widget !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.widget', + schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/widget/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + if (data4.index_file === undefined) { + valid5 = false; + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', + schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', + params: { + missingProperty: 'index_file' + }, + message: 'should have required property \'index_file\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + var errs_5 = errors; + if (typeof data4.index_file !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.index_file', + schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/index_file/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', + schemaPath: '#/properties/collections/items/properties/meta/properties/path/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', + schemaPath: '#/properties/collections/items/properties/meta/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + } + var data3 = data2.i18n; + if (data3 !== undefined) { + var errs_3 = errors; + var errs__3 = errors, + prevValid3 = false, + valid3 = false, + passingSchemas3 = null; + var errs_4 = errors; + if (typeof data3 !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/0/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + if (valid4) { + valid3 = prevValid3 = true; + passingSchemas3 = 0; + } + var errs_4 = errors; + if ((data3 && typeof data3 === "object" && !Array.isArray(data3))) { + var errs__4 = errors; + var valid5 = true; + var data4 = data3.structure; + if (data4 !== undefined) { + var errs_5 = errors; + if (typeof data4 !== "string") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.structure', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var schema5 = validate.schema.properties.collections.items.properties.i18n.oneOf[1].properties.structure.enum; + var valid5; + valid5 = false; + for (var i5 = 0; i5 < schema5.length; i5++) + if (equal(data4, schema5[i5])) { + valid5 = true; + break; + } if (!valid5) { + var err = { + keyword: 'enum', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.structure', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum', + params: { + allowedValues: schema5 + }, + message: 'should be equal to one of the allowed values' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + var data4 = data3.locales; + if (data4 !== undefined) { + var errs_5 = errors; + if (Array.isArray(data4)) { + if (data4.length < 2) { + var err = { + keyword: 'minItems', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/minItems', + params: { + limit: 2 + }, + message: 'should NOT have fewer than 2 items' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__5 = errors; + var valid5; + for (var i5 = 0; i5 < data4.length; i5++) { + var data5 = data4[i5]; + var errs_6 = errors; + if (typeof data5 === "string") { + if (ucs2length(data5) > 10) { + var err = { + keyword: 'maxLength', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/maxLength', + params: { + limit: 10 + }, + message: 'should NOT be longer than 10 characters' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (ucs2length(data5) < 2) { + var err = { + keyword: 'minLength', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/minLength', + params: { + limit: 2 + }, + message: 'should NOT be shorter than 2 characters' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (!pattern0.test(data5)) { + var err = { + keyword: 'pattern', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/pattern', + params: { + pattern: '^[a-zA-Z-_]+$' + }, + message: 'should match pattern "^[a-zA-Z-_]+$"' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid6 = errors === errs_6; + } + var i = data4.length, + valid5 = true, + j; + if (i > 1) { + var itemIndices = {}, + item; + for (; i--;) { + var item = data4[i]; + if (typeof item !== "string") continue; + if (typeof itemIndices[item] == 'number') { + valid5 = false; + j = itemIndices[item]; + break; + } + itemIndices[item] = i; + } + } + if (!valid5) { + var err = { + keyword: 'uniqueItems', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems', + params: { + i: i, + j: j + }, + message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + var data4 = data3.default_locale; + if (data4 !== undefined) { + var errs_5 = errors; + if (typeof data4 === "string") { + if (ucs2length(data4) > 10) { + var err = { + keyword: 'maxLength', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/maxLength', + params: { + limit: 10 + }, + message: 'should NOT be longer than 10 characters' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (ucs2length(data4) < 2) { + var err = { + keyword: 'minLength', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/minLength', + params: { + limit: 2 + }, + message: 'should NOT be shorter than 2 characters' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (!pattern0.test(data4)) { + var err = { + keyword: 'pattern', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/pattern', + params: { + pattern: '^[a-zA-Z-_]+$' + }, + message: 'should match pattern "^[a-zA-Z-_]+$"' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/type', + params: { + type: 'string' + }, + message: 'should be string' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid4 = errors === errs_4; + if (valid4 && prevValid3) { + valid3 = false; + passingSchemas3 = [passingSchemas3, 1]; + } else { + if (valid4) { + valid3 = prevValid3 = true; + passingSchemas3 = 1; + } + } + if (!valid3) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf', + params: { + passingSchemas: passingSchemas3 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__3; + if (vErrors !== null) { + if (errs__3) vErrors.length = errs__3; + else vErrors = null; + } + } + var valid3 = errors === errs_3; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__2 = errors; + var errs_3 = errors; + if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { + var missing3; + if (((data2.sortable_fields === undefined) && (missing3 = '.sortable_fields')) || ((data2.sortableFields === undefined) && (missing3 = '.sortableFields'))) { + var err = {}; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else {} + } + if (errors === errs_3) {} + var valid3 = errors === errs_3; + if (valid3) { + var err = { + keyword: 'not', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/not', + params: {}, + message: 'should NOT be valid' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__2; + if (vErrors !== null) { + if (errs__2) vErrors.length = errs__2; + else vErrors = null; + } + } + var errs__2 = errors, + prevValid2 = false, + valid2 = false, + passingSchemas2 = null; + var errs_3 = errors; + if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { + if (data2.files === undefined) { + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/oneOf/0/required', + params: { + missingProperty: 'files' + }, + message: 'should have required property \'files\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid3 = errors === errs_3; + if (valid3) { + valid2 = prevValid2 = true; + passingSchemas2 = 0; + } + var errs_3 = errors; + if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { + if (data2.folder === undefined) { + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/oneOf/1/required', + params: { + missingProperty: 'folder' + }, + message: 'should have required property \'folder\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + if (data2.fields === undefined) { + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/oneOf/1/required', + params: { + missingProperty: 'fields' + }, + message: 'should have required property \'fields\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid3 = errors === errs_3; + if (valid3 && prevValid2) { + valid2 = false; + passingSchemas2 = [passingSchemas2, 1]; + } else { + if (valid3) { + valid2 = prevValid2 = true; + passingSchemas2 = 1; + } + } + if (!valid2) { + var err = { + keyword: 'oneOf', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/oneOf', + params: { + passingSchemas: passingSchemas2 + }, + message: 'should match exactly one schema in oneOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__2; + if (vErrors !== null) { + if (errs__2) vErrors.length = errs__2; + else vErrors = null; + } + } + var errs__2 = errors; + var valid2 = true; + var errs_3 = errors; + if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { + if (data2.extension === undefined) { + var err = {}; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid3 = errors === errs_3; + errors = errs__2; + if (vErrors !== null) { + if (errs__2) vErrors.length = errs__2; + else vErrors = null; + } + if (valid3) { + var errs_3 = errors; + var errs__3 = errors; + var valid3 = true; + var errs_4 = errors; + if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { + var errs__4 = errors; + var valid5 = true; + if (data2.extension !== undefined) { + var errs_5 = errors; + var schema5 = validate.schema.properties.collections.items.then.if.properties.extension.enum; + var valid5; + valid5 = false; + for (var i5 = 0; i5 < schema5.length; i5++) + if (equal(data2.extension, schema5[i5])) { + valid5 = true; + break; + } if (!valid5) { + var err = {}; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid5 = errors === errs_5; + } + } + var valid4 = errors === errs_4; + errors = errs__3; + if (vErrors !== null) { + if (errs__3) vErrors.length = errs__3; + else vErrors = null; + } + if (!valid4) { + var errs_4 = errors; + if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { + if (data2.format === undefined) { + var err = { + keyword: 'required', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/then/else/required', + params: { + missingProperty: 'format' + }, + message: 'should have required property \'format\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid4 = errors === errs_4; + valid3 = valid4; + } + if (!valid3) { + var err = { + keyword: 'if', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/then/if', + params: { + failingKeyword: 'else' + }, + message: 'should match "' + 'else' + '" schema' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid3 = errors === errs_3; + valid2 = valid3; + } + if (!valid2) { + var err = { + keyword: 'if', + dataPath: (dataPath || '') + '.collections[' + i1 + ']', + schemaPath: '#/properties/collections/items/if', + params: { + failingKeyword: 'then' + }, + message: 'should match "' + 'then' + '" schema' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.collections', + schemaPath: '#/properties/collections/type', + params: { + type: 'array' + }, + message: 'should be array' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + var data1 = data.editor; + if (data1 !== undefined) { + var errs_1 = errors; + if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { + var errs__1 = errors; + var valid2 = true; + if (data1.preview !== undefined) { + var errs_2 = errors; + if (typeof data1.preview !== "boolean") { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.editor.preview', + schemaPath: '#/properties/editor/properties/preview/type', + params: { + type: 'boolean' + }, + message: 'should be boolean' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid2 = errors === errs_2; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + '.editor', + schemaPath: '#/properties/editor/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var valid1 = errors === errs_1; + } + } else { + var err = { + keyword: 'type', + dataPath: (dataPath || '') + "", + schemaPath: '#/type', + params: { + type: 'object' + }, + message: 'should be object' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + var errs__0 = errors; + var valid0 = false; + var errs_1 = errors; + if ((data && typeof data === "object" && !Array.isArray(data))) { + if (data.media_folder === undefined) { + var err = { + keyword: 'required', + dataPath: (dataPath || '') + "", + schemaPath: '#/anyOf/0/required', + params: { + missingProperty: 'media_folder' + }, + message: 'should have required property \'media_folder\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid1 = errors === errs_1; + valid0 = valid0 || valid1; + if (!valid0) { + var errs_1 = errors; + if ((data && typeof data === "object" && !Array.isArray(data))) { + if (data.media_library === undefined) { + var err = { + keyword: 'required', + dataPath: (dataPath || '') + "", + schemaPath: '#/anyOf/1/required', + params: { + missingProperty: 'media_library' + }, + message: 'should have required property \'media_library\'' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid1 = errors === errs_1; + valid0 = valid0 || valid1; + if (!valid0) {} + } + if (!valid0) { + var err = { + keyword: 'anyOf', + dataPath: (dataPath || '') + "", + schemaPath: '#/anyOf', + params: {}, + message: 'should match some schema in anyOf' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } else { + errors = errs__0; + if (vErrors !== null) { + if (errs__0) vErrors.length = errs__0; + else vErrors = null; + } + } + validate.errors = vErrors; + return errors === 0; + }; +})(); +validate.schema = { + "$id": "https://netlify-cms/object.json", + "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_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", + "type": "array", + "minItems": 1, + "items": { + "$id": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", + "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" + }, { + "instanceof": "RegExp" + }] + }, { + "type": "string" + }] + }, + "field": { + "$ref": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + }, + "fields": { + "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + }, + "types": { + "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + } + }, + "select": { + "$data": "0/widget" + }, + "selectCases": { + "unknown": {}, + "string": {}, + "number": { + "properties": { + "step": { + "type": "number" + }, + "value_type": { + "type": "string" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "text": {}, + "image": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "file": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "select": { + "properties": { + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "options": { + "type": "array", + "items": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }, { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }] + } + }, + "required": ["label", "value"] + }] + } + } + }, + "required": ["options"] + }, + "markdown": { + "properties": { + "minimal": { + "type": "boolean" + }, + "buttons": { + "type": "array", + "items": { + "type": "string", + "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] + } + }, + "editor_components": { + "type": "array", + "items": { + "type": "string" + } + }, + "modes": { + "type": "array", + "items": { + "type": "string", + "enum": ["raw", "rich_text"] + }, + "minItems": 1 + } + } + }, + "list": { + "properties": { + "allow_add": { + "type": "boolean" + }, + "collapsed": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "minimize_collapsed": { + "type": "boolean" + }, + "label_singular": { + "type": "string" + }, + "i18n": { + "type": "boolean" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "object": { + "properties": { + "collapsed": { + "type": "boolean" + }, + "i18n": { + "type": "boolean" + } + } + }, + "relation": { + "properties": { + "collection": { + "type": "string" + }, + "value_field": { + "type": "string" + }, + "search_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "file": { + "type": "string" + }, + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "display_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "options_length": { + "type": "integer" + } + }, + "oneOf": [{ + "required": ["collection", "value_field", "search_fields"] + }, { + "required": ["collection", "valueField", "searchFields"] + }] + }, + "boolean": {}, + "map": { + "properties": { + "decimals": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": ["Point", "LineString", "Polygon"] + } + } + }, + "date": {}, + "datetime": { + "properties": { + "format": { + "type": "string" + }, + "date_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "time_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "picker_utc": { + "type": "boolean" + } + } + }, + "code": { + "properties": { + "default_language": { + "type": "string" + }, + "allow_language_selection": { + "type": "boolean" + }, + "output_code_only": { + "type": "boolean" + }, + "keys": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "lang": { + "type": "string" + } + } + } + } + }, + "color": {} + }, + "required": ["name"] + }, + "uniqueItemProperties": ["name"] + } + }, + "required": ["name", "label", "file", "fields"] + }, + "uniqueItemProperties": ["name"] + }, + "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_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", + "type": "array", + "minItems": 1, + "items": { + "$id": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", + "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" + }, { + "instanceof": "RegExp" + }] + }, { + "type": "string" + }] + }, + "field": { + "$ref": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + }, + "fields": { + "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + }, + "types": { + "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + } + }, + "select": { + "$data": "0/widget" + }, + "selectCases": { + "unknown": {}, + "string": {}, + "number": { + "properties": { + "step": { + "type": "number" + }, + "value_type": { + "type": "string" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "text": {}, + "image": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "file": { + "properties": { + "allow_multiple": { + "type": "boolean" + } + } + }, + "select": { + "properties": { + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "options": { + "type": "array", + "items": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }, { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "oneOf": [{ + "type": "string" + }, { + "type": "number" + }] + } + }, + "required": ["label", "value"] + }] + } + } + }, + "required": ["options"] + }, + "markdown": { + "properties": { + "minimal": { + "type": "boolean" + }, + "buttons": { + "type": "array", + "items": { + "type": "string", + "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] + } + }, + "editor_components": { + "type": "array", + "items": { + "type": "string" + } + }, + "modes": { + "type": "array", + "items": { + "type": "string", + "enum": ["raw", "rich_text"] + }, + "minItems": 1 + } + } + }, + "list": { + "properties": { + "allow_add": { + "type": "boolean" + }, + "collapsed": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "minimize_collapsed": { + "type": "boolean" + }, + "label_singular": { + "type": "string" + }, + "i18n": { + "type": "boolean" + }, + "min": { + "type": "number" + }, + "max": { + "type": "number" + } + } + }, + "object": { + "properties": { + "collapsed": { + "type": "boolean" + }, + "i18n": { + "type": "boolean" + } + } + }, + "relation": { + "properties": { + "collection": { + "type": "string" + }, + "value_field": { + "type": "string" + }, + "search_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "file": { + "type": "string" + }, + "multiple": { + "type": "boolean" + }, + "min": { + "type": "integer" + }, + "max": { + "type": "integer" + }, + "display_fields": { + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "options_length": { + "type": "integer" + } + }, + "oneOf": [{ + "required": ["collection", "value_field", "search_fields"] + }, { + "required": ["collection", "valueField", "searchFields"] + }] + }, + "boolean": {}, + "map": { + "properties": { + "decimals": { + "type": "integer" + }, + "type": { + "type": "string", + "enum": ["Point", "LineString", "Polygon"] + } + } + }, + "date": {}, + "datetime": { + "properties": { + "format": { + "type": "string" + }, + "date_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "time_format": { + "oneOf": [{ + "type": "string" + }, { + "type": "boolean" + }] + }, + "picker_utc": { + "type": "boolean" + } + } + }, + "code": { + "properties": { + "default_language": { + "type": "string" + }, + "allow_language_selection": { + "type": "boolean" + }, + "output_code_only": { + "type": "boolean" + }, + "keys": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "lang": { + "type": "string" + } + } + } + } + }, + "color": {} + }, + "required": ["name"] + }, + "uniqueItemProperties": ["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"] + } + } + }, + "uniqueItemProperties": ["name"] + }, + "editor": { + "type": "object", + "properties": { + "preview": { + "type": "boolean" + } + } + } + }, + "required": ["backend", "collections"], + "anyOf": [{ + "required": ["media_folder"] + }, { + "required": ["media_library"] + }] +}; +validate.errors = null; +module.exports = validate; \ No newline at end of file diff --git a/website/package.json b/website/package.json index 4a52b0497359..e298d152a5af 100644 --- a/website/package.json +++ b/website/package.json @@ -47,8 +47,8 @@ "devDependencies": { "babel-plugin-prismjs": "^2.0.1", "babel-preset-gatsby": "^1.0.0", - "eslint": "^8.5.0", - "eslint-plugin-import": "^2.25.3", + "eslint": "^7.4.0", + "eslint-plugin-import": "^2.20.1", "markdownlint-cli": "^0.30.0" }, "private": true diff --git a/yarn.lock b/yarn.lock index c6e1469004c4..e226bb4da119 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,6 +18,13 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" +"@babel/code-frame@7.12.11": + version "7.12.11" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" + integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== + dependencies: + "@babel/highlight" "^7.10.4" + "@babel/code-frame@7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" @@ -318,7 +325,7 @@ "@babel/traverse" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/highlight@^7.0.0": +"@babel/highlight@^7.0.0", "@babel/highlight@^7.10.4": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== @@ -1678,18 +1685,18 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46" integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA== -"@eslint/eslintrc@^1.0.5": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318" - integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ== +"@eslint/eslintrc@^0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" + integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== dependencies: ajv "^6.12.4" - debug "^4.3.2" - espree "^9.2.0" + debug "^4.1.1" + espree "^7.3.0" globals "^13.9.0" ignore "^4.0.6" import-fresh "^3.2.1" - js-yaml "^4.1.0" + js-yaml "^3.13.1" minimatch "^3.0.4" strip-json-comments "^3.1.1" @@ -1738,16 +1745,16 @@ dependencies: "@hapi/hoek" "^9.0.0" -"@humanwhocodes/config-array@^0.9.2": - version "0.9.2" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914" - integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA== +"@humanwhocodes/config-array@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" + integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== dependencies: - "@humanwhocodes/object-schema" "^1.2.1" + "@humanwhocodes/object-schema" "^1.2.0" debug "^4.1.1" minimatch "^3.0.4" -"@humanwhocodes/object-schema@^1.2.1": +"@humanwhocodes/object-schema@^1.2.0": version "1.2.1" resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== @@ -4390,12 +4397,12 @@ acorn@^6.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== -acorn@^7.1.1: +acorn@^7.1.1, acorn@^7.4.0: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.2.4, acorn@^8.4.1, acorn@^8.6.0: +acorn@^8.2.4, acorn@^8.4.1: version "8.6.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.6.0.tgz#e3692ba0eb1a0c83eaa4f37f5fa7368dd7142895" integrity sha512-U1riIR+lBSNi3IbxtaHOIKdH8sLFv3NYfNv8sg7ZsNhcfl4HF2++BfqqrNAxoCLQW1iiylOj76ecnaUxz+z9yw== @@ -4457,17 +4464,16 @@ airbnb-js-shims@^2.2.1: string.prototype.padstart "^3.0.0" symbol.prototype.description "^1.0.0" -ajv-cli@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/ajv-cli/-/ajv-cli-4.2.0.tgz#f2c371edfd9c999f2a9e0afdd5675eede8e16544" - integrity sha512-3Ab8Kuh7QnyXxg+v4NFzah1LLBHgYBUVtJZC8bOaDAdl766kT6Usw5f+g8UcFN+24lYIbchaQBQ+uUntYpBEyQ== +ajv-cli@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ajv-cli/-/ajv-cli-3.1.0.tgz#00e04c436c90ccc0883d31f21879ed932a774b19" + integrity sha512-QSHstRjJin970EspY92Qr8lDGYE9C88AwW7LJYJ/MFhKDsE6I75H2b8WObCeF+2q/1fJiolm0xX7I/VyGmw/JQ== dependencies: - ajv "^7.2.1" + ajv "^6.7.0" + ajv-pack "^0.3.0" fast-json-patch "^2.0.0" glob "^7.1.0" - js-yaml "^3.14.0" - json-schema-migrate "^1.1.0" - json5 "^2.1.3" + json-schema-migrate "^0.2.0" minimist "^1.2.0" ajv-errors@^1.0.0: @@ -4485,17 +4491,55 @@ ajv-keywords@^3.1.0, ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv-keywords@^5.1.0: +ajv-keywords@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== dependencies: fast-deep-equal "^3.1.3" -ajv@7.0.3, ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6, ajv@^7.0.0-beta.9, ajv@^7.2.1, ajv@^8.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-7.0.3.tgz#13ae747eff125cafb230ac504b2406cf371eece2" - integrity sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ== +ajv-pack@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/ajv-pack/-/ajv-pack-0.3.1.tgz#b72c4d4219e3928e62842d742ded93bf50796560" + integrity sha1-tyxNQhnjko5ihC10Le2Tv1B5ZWA= + dependencies: + js-beautify "^1.6.4" + require-from-string "^1.2.0" + +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@^5.0.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6, ajv@^6.7.0: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ajv@^8.0.1: + version "8.8.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb" + integrity sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -7370,7 +7414,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.8, debug@^2.6. dependencies: ms "2.0.0" -debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1, debug@^4.3.2: +debug@4, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1, debug@^4.3.2: version "4.3.3" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== @@ -7931,6 +7975,16 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +editorconfig@^0.15.3: + version "0.15.3" + resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.15.3.tgz#bef84c4e75fb8dcb0ce5cee8efd51c15999befc5" + integrity sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g== + dependencies: + commander "^2.19.0" + lru-cache "^4.1.5" + semver "^5.6.0" + sigmund "^1.0.1" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -8267,7 +8321,7 @@ eslint-import-resolver-node@^0.3.6: debug "^3.2.7" resolve "^1.20.0" -eslint-module-utils@^2.7.2: +eslint-module-utils@^2.7.1: version "2.7.2" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.2.tgz#1d0aa455dcf41052339b63cada8ab5fd57577129" integrity sha512-zquepFnWCY2ISMFwD/DqzaM++H+7PDzOpUvotJWm/y1BAFt5R4oeULgdrTejKqLkz7MA/tgstsUMNYc7wNdTrg== @@ -8282,14 +8336,14 @@ eslint-plugin-babel@^5.3.1: dependencies: eslint-rule-composer "^0.3.0" -eslint-plugin-cypress@^2.12.1: +eslint-plugin-cypress@^2.6.0: version "2.12.1" resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.12.1.tgz#9aeee700708ca8c058e00cdafe215199918c2632" integrity sha512-c2W/uPADl5kospNDihgiLc7n87t5XhUbFDoTl6CfVkmG+kDAb5Ux10V9PoLPu9N+r7znpc+iQlcmAqT1A/89HA== dependencies: globals "^11.12.0" -eslint-plugin-import@^2.25.3: +eslint-plugin-import@^2.18.2: version "2.25.3" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz#a554b5f66e08fb4f6dc99221866e57cfff824766" integrity sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg== @@ -8315,7 +8369,7 @@ eslint-plugin-prettier@^4.0.0: dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-react@^7.27.1: +eslint-plugin-react@^7.17.0: version "7.27.1" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.27.1.tgz#469202442506616f77a854d91babaae1ec174b45" integrity sha512-meyunDjMMYeWr/4EBLTV1op3iSG3mjT/pz5gti38UzfM4OPpNc2m0t2xvKCOMU5D6FSdd34BIMFOvQbW+i8GAA== @@ -8364,13 +8418,12 @@ eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^7.1.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153" - integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg== +eslint-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" + integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== dependencies: - esrecurse "^4.3.0" - estraverse "^5.2.0" + eslint-visitor-keys "^1.1.0" eslint-utils@^3.0.0: version "3.0.0" @@ -8379,7 +8432,7 @@ eslint-utils@^3.0.0: dependencies: eslint-visitor-keys "^2.0.0" -eslint-visitor-keys@^1.1.0: +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== @@ -8389,41 +8442,42 @@ eslint-visitor-keys@^2.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== -eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0: +eslint-visitor-keys@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2" integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA== -eslint@^8.5.0: - version "8.5.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.5.0.tgz#ddd2c1afd8f412036f87ae2a063d2aa296d3175f" - integrity sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg== +eslint@^7.0.0: + version "7.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" + integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== dependencies: - "@eslint/eslintrc" "^1.0.5" - "@humanwhocodes/config-array" "^0.9.2" + "@babel/code-frame" "7.12.11" + "@eslint/eslintrc" "^0.4.3" + "@humanwhocodes/config-array" "^0.5.0" ajv "^6.10.0" chalk "^4.0.0" cross-spawn "^7.0.2" - debug "^4.3.2" + debug "^4.0.1" doctrine "^3.0.0" enquirer "^2.3.5" escape-string-regexp "^4.0.0" - eslint-scope "^7.1.0" - eslint-utils "^3.0.0" - eslint-visitor-keys "^3.1.0" - espree "^9.2.0" + eslint-scope "^5.1.1" + eslint-utils "^2.1.0" + eslint-visitor-keys "^2.0.0" + espree "^7.3.1" esquery "^1.4.0" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^6.0.1" + glob-parent "^5.1.2" globals "^13.6.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" is-glob "^4.0.0" - js-yaml "^4.1.0" + js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.4.1" lodash.merge "^4.6.2" @@ -8431,10 +8485,11 @@ eslint@^8.5.0: natural-compare "^1.4.0" optionator "^0.9.1" progress "^2.0.0" - regexpp "^3.2.0" + regexpp "^3.1.0" semver "^7.2.1" - strip-ansi "^6.0.1" + strip-ansi "^6.0.0" strip-json-comments "^3.1.0" + table "^6.0.9" text-table "^0.2.0" v8-compile-cache "^2.0.3" @@ -8443,14 +8498,14 @@ esm@^3.2.25: resolved "https://registry.yarnpkg.com/esm/-/esm-3.2.25.tgz#342c18c29d56157688ba5ce31f8431fbb795cc10" integrity sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA== -espree@^9.2.0: - version "9.2.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.2.0.tgz#c50814e01611c2d0f8bd4daa83c369eabba80dbc" - integrity sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg== +espree@^7.3.0, espree@^7.3.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" + integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== dependencies: - acorn "^8.6.0" + acorn "^7.4.0" acorn-jsx "^5.3.1" - eslint-visitor-keys "^3.1.0" + eslint-visitor-keys "^1.3.0" esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" @@ -8764,6 +8819,11 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== +fast-deep-equal@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" + integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= + fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" @@ -9524,13 +9584,6 @@ glob-parent@^5.1.1, glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob-parent@^6.0.1: - version "6.0.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" - integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== - dependencies: - is-glob "^4.0.3" - glob-to-regexp@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" @@ -11756,6 +11809,16 @@ js-base64@*, js-base64@^3.0.0: resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.2.tgz#816d11d81a8aff241603d19ce5761e13e41d7745" integrity sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ== +js-beautify@^1.6.4: + version "1.14.0" + resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.14.0.tgz#2ce790c555d53ce1e3d7363227acf5dc69024c2d" + integrity sha512-yuck9KirNSCAwyNJbqW+BxJqJ0NLJ4PwBUzQQACl5O3qHMBXVkXb/rD0ilh/Lat/tn88zSZ+CAHOlk0DsY7GuQ== + dependencies: + config-chain "^1.1.12" + editorconfig "^0.15.3" + glob "^7.1.3" + nopt "^5.0.0" + js-sha256@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" @@ -11771,7 +11834,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.14.0: +js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -11779,7 +11842,7 @@ js-yaml@^3.13.1, js-yaml@^3.14.0: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.0.0, js-yaml@^4.1.0: +js-yaml@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== @@ -11863,12 +11926,22 @@ 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@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/json-schema-migrate/-/json-schema-migrate-1.1.0.tgz#3e886c38a8efdc9fd3c831d450595c5ab7a36b17" - integrity sha512-PggRuqHB+k1OMz0N1vXCMmwwr8cAsKWVOG5jZh1I2xSyePpRoBG6xOlWG50qe2Ca3hxfWWqZHLEYqJw2/4765g== +json-schema-migrate@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/json-schema-migrate/-/json-schema-migrate-0.2.0.tgz#ba47a5b0072fc72396460e1bd60b44d52178bbc6" + integrity sha1-ukelsAcvxyOWRg4b1gtE1SF4u8Y= dependencies: - ajv "^7.0.0-beta.9" + ajv "^5.0.0" + +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= + +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" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-schema-traverse@^1.0.0: version "1.0.0" @@ -11900,7 +11973,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.1.3: +json5@2.x, json5@^2.1.1, json5@^2.1.2: 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== @@ -12440,6 +12513,14 @@ lowlight@~1.11.0: fault "^1.0.2" highlight.js "~9.13.0" +lru-cache@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -14973,6 +15054,11 @@ ps-tree@1.2.0: dependencies: event-stream "=3.3.4" +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + psl@^1.1.28, psl@^1.1.33: version "1.8.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" @@ -15931,7 +16017,7 @@ regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.3.1: call-bind "^1.0.2" define-properties "^1.1.3" -regexpp@^3.2.0: +regexpp@^3.1.0, regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== @@ -16195,6 +16281,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= +require-from-string@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" + integrity sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg= + require-from-string@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" @@ -16751,6 +16842,11 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" +sigmund@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" + integrity sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA= + signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: version "3.0.6" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af" @@ -17805,7 +17901,7 @@ sywac@^1.2.2: resolved "https://registry.yarnpkg.com/sywac/-/sywac-1.3.0.tgz#324789bdb8bd7d0d66625c9144fce81ab5ba6f99" integrity sha512-LDt2stNTp4bVPMgd70Jj9PWrSa4batl+bv+Ea5NLNGT7ufc4oQPtRfQ73wbddNV6RilaPqnEt6y1Wkm5FVTNEg== -table@^6.6.0: +table@^6.0.9, table@^6.6.0: version "6.7.5" resolved "https://registry.yarnpkg.com/table/-/table-6.7.5.tgz#f04478c351ef3d8c7904f0e8be90a1b62417d238" integrity sha512-LFNeryOqiQHqCVKzhkymKwt6ozeRhlm8IL1mE8rNUurkir4heF6PzMyRgaTa4tlyPTGGgXuvVOF/OLWiH09Lqw== @@ -18306,7 +18402,7 @@ tsconfig-paths-webpack-plugin@^3.2.0: enhanced-resolve "^5.7.0" tsconfig-paths "^3.9.0" -tsconfig-paths@^3.12.0, tsconfig-paths@^3.9.0: +tsconfig-paths@^3.11.0, tsconfig-paths@^3.9.0: version "3.12.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz#19769aca6ee8f6a1a341e38c8fa45dd9fb18899b" integrity sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg== @@ -19637,6 +19733,11 @@ yaeti@^0.0.6: resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + yallist@^3.0.0, yallist@^3.0.2, yallist@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" From d3f369a04173c8eb348b1c36608b9be9a9206176 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Mon, 3 Jan 2022 11:46:50 -0800 Subject: [PATCH 04/20] fix(csp): immutably set fields and ensure fields are unique --- .../src/constants/configSchema.js | 205 +----------------- 1 file changed, 6 insertions(+), 199 deletions(-) diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index 260bd492b121..f4e01d5bd90f 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -13,6 +13,7 @@ import { getWidgets } from '../lib/registry'; import { I18N_STRUCTURE, I18N_FIELD } from '../lib/i18n'; import schema from '../../config.schema.json'; import validateSchema from './validateSchema'; +import { set } from 'lodash/fp' const localeType = { type: 'string', minLength: 2, maxLength: 10, pattern: '^[a-zA-Z-_]+$' }; @@ -147,208 +148,14 @@ const viewGroups = { * where the imports get resolved asynchronously. */ function getConfigSchema() { - const fields = fieldsConfig(); - schema.properties.collections.items.properties.files.items.properties.fields = fields; - schema.properties.collections.items.properties.fields = fields; + // This will immutably apply fields schema to the schema properrites that need them + // TODO: it might be better to use ref here as per https://github.com/ajv-validator/ajv/issues/1707#issuecomment-890479942 - return schema; + const s1 = set('properties.collections.items.properties.files.items.properties.fields', fieldsConfig(), schema); + const s2 = set('properties.collections.items.properties.fields', fieldsConfig(), s1); - // return { - // 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: i18nRoot, - // 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: { - // // ------- Each collection: ------- - // type: 'object', - // properties: { - // name: { type: 'string' }, - // label: { type: 'string' }, - // label_singular: { type: 'string' }, - // description: { type: 'string' }, - // folder: { type: 'string' }, - // files: { - // type: 'array', - // items: { - // // ------- Each file: ------- - // 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: fieldsConfig(), - // }, - // required: ['name', 'label', 'file', 'fields'], - // }, - // uniqueItemProperties: ['name'], - // }, - // 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: Object.keys(formatExtensions) }, - // extension: { type: 'string' }, - // frontmatter_delimiter: { - // type: ['string', 'array'], - // minItems: 2, - // maxItems: 2, - // items: { - // type: 'string', - // }, - // }, - // fields: fieldsConfig(), - // sortable_fields: { - // type: 'array', - // items: { - // type: 'string', - // }, - // }, - // sortableFields: { - // type: 'array', - // items: { - // type: 'string', - // }, - // }, - // view_filters: viewFilters, - // view_groups: viewGroups, - // 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: i18nCollection, - // }, - // required: ['name', 'label'], - // oneOf: [{ required: ['files'] }, { required: ['folder', 'fields'] }], - // not: { - // required: ['sortable_fields', 'sortableFields'], - // }, - // if: { required: ['extension'] }, - // then: { - // // Cannot infer format from extension. - // if: { - // properties: { - // extension: { enum: Object.keys(extensionFormatters) }, - // }, - // }, - // else: { required: ['format'] }, - // }, - // dependencies: { - // frontmatter_delimiter: { - // properties: { - // format: { enum: frontmatterFormats }, - // }, - // required: ['format'], - // }, - // }, - // }, - // uniqueItemProperties: ['name'], - // }, - // editor: { - // type: 'object', - // properties: { - // preview: { type: 'boolean' }, - // }, - // }, - // }, - // required: ['backend', 'collections'], - // anyOf: [{ required: ['media_folder'] }, { required: ['media_library'] }], - // }; + return s2; } function getWidgetSchemas() { From f4e47bfe94f28524c8191fdd78025d9e64c70af0 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Mon, 3 Jan 2022 12:14:32 -0800 Subject: [PATCH 05/20] chore(csp): fix lint errors --- .../src/constants/configSchema.js | 67 +------------------ .../src/constants/validateSchema.js | 1 + 2 files changed, 3 insertions(+), 65 deletions(-) diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index f4e01d5bd90f..45512fc9fb13 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -7,15 +7,12 @@ import { } from 'ajv-keywords/dist/keywords'; import ajvErrors from 'ajv-errors'; import uuid from 'uuid/v4'; +import { set } from 'lodash/fp' -import { formatExtensions, frontmatterFormats, extensionFormatters } from '../formats/formats'; import { getWidgets } from '../lib/registry'; -import { I18N_STRUCTURE, I18N_FIELD } from '../lib/i18n'; +import { I18N_FIELD } from '../lib/i18n'; import schema from '../../config.schema.json'; import validateSchema from './validateSchema'; -import { set } from 'lodash/fp' - -const localeType = { type: 'string', minLength: 2, maxLength: 10, pattern: '^[a-zA-Z-_]+$' }; // taken from config.schema.json // config.properties.collections.items.properties.files.items.properties.fields.items.selectCases @@ -39,29 +36,6 @@ const NativeCMSWidgets = [ 'color', ]; -const i18n = { - type: 'object', - properties: { - structure: { type: 'string', enum: Object.values(I18N_STRUCTURE) }, - locales: { - type: 'array', - minItems: 2, - items: localeType, - uniqueItems: true, - }, - default_locale: localeType, - }, -}; - -const i18nRoot = { - ...i18n, - required: ['structure', 'locales'], -}; - -const i18nCollection = { - oneOf: [{ type: 'boolean' }, i18n], -}; - const i18nField = { oneOf: [{ type: 'boolean' }, { type: 'string', enum: Object.values(I18N_FIELD) }], }; @@ -105,43 +79,6 @@ function fieldsConfig() { }; } -const viewFilters = { - 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'], - }, -}; - -const viewGroups = { - type: 'array', - minItems: 1, - items: { - type: 'object', - properties: { - label: { type: 'string' }, - field: { type: 'string' }, - pattern: { type: 'string' }, - }, - additionalProperties: false, - required: ['label', 'field'], - }, -}; - /** * The schema had to be wrapped in a function to * fix a circular dependency problem for WebPack, diff --git a/packages/netlify-cms-core/src/constants/validateSchema.js b/packages/netlify-cms-core/src/constants/validateSchema.js index 1442b1caee59..028842497398 100644 --- a/packages/netlify-cms-core/src/constants/validateSchema.js +++ b/packages/netlify-cms-core/src/constants/validateSchema.js @@ -1,3 +1,4 @@ +/* eslint-disable */ 'use strict'; var ucs2length = require('ajv/lib/compile/ucs2length'); var equal = require('ajv/lib/compile/equal'); From fe9e6ba5da6d1d6017e7cc28b41b732bbdf22774 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Tue, 4 Jan 2022 10:45:06 -0800 Subject: [PATCH 06/20] chore(csp): include all ajv flags in compile --- packages/netlify-cms-core/package.json | 8 +- .../constants/__tests__/configSchema.spec.js | 167 +-- .../src/constants/configSchema.js | 89 +- ...idateSchema.js => staticValidateConfig.js} | 1216 +++++++++++++---- .../netlify-cms-core/writeValidateSchema.js | 43 - yarn.lock | 38 +- 6 files changed, 1077 insertions(+), 484 deletions(-) rename packages/netlify-cms-core/src/constants/{validateSchema.js => staticValidateConfig.js} (82%) delete mode 100644 packages/netlify-cms-core/writeValidateSchema.js diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index ba8e345a990a..3e8561e7fa57 100644 --- a/packages/netlify-cms-core/package.json +++ b/packages/netlify-cms-core/package.json @@ -17,7 +17,7 @@ "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\"", - "write-validate-schema": "NODE_ENV=production ajv compile --all-errors -s ./config.schema.json -o ./src/constants/validateSchema.js" + "write-validate-schema": "NODE_ENV=production ajv compile --json-pointers --all-errors --data -c ajv-keywords/keywords/select -c ajv-keywords/keywords/instanceOf -c ajv-keywords/keywords/prohibited -c ajv-keywords/keywords/uniqueItemProperties -c ajv-errors -s ./config.schema.json -o ./src/constants/staticValidateConfig.js" }, "keywords": [ "netlify", @@ -27,9 +27,9 @@ "license": "MIT", "dependencies": { "@iarna/toml": "2.2.5", - "ajv": "8.1.0", - "ajv-errors": "^3.0.0", - "ajv-keywords": "^5.0.0", + "ajv": "6.12.6", + "ajv-errors": "1.0.1", + "ajv-keywords": "3.5.2", "copy-text-to-clipboard": "^3.0.0", "deepmerge": "^4.2.2", "diacritics": "^1.3.0", 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 3c3b3f89834a..9e79d9189102 100644 --- a/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js +++ b/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js @@ -4,7 +4,7 @@ import { validateConfig } from '../configSchema'; jest.mock('../../lib/registry'); -describe.only('config', () => { +describe('static config validation', () => { /** * Suppress error logging to reduce noise during testing. Jest will still * log test failures and associated errors as expected. @@ -16,7 +16,7 @@ describe.only('config', () => { const { getWidgets } = require('../../lib/registry'); getWidgets.mockImplementation(() => [{}]); - describe.only('validateConfig', () => { + describe('validateConfig', () => { const validConfig = { foo: 'bar', backend: { name: 'bar' }, @@ -31,13 +31,13 @@ describe.only('config', () => { ], }; - it.only('should not throw if no errors', () => { + it('should not throw if no errors', () => { expect(() => { validateConfig(validConfig); }).not.toThrowError(); }); - it('should throw if backend is not defined in config', () => { + it.only('should throw if backend is not defined in config', () => { expect(() => { validateConfig({ foo: 'bar' }); }).toThrowError("config must have required property 'backend'"); @@ -293,85 +293,6 @@ describe.only('config', () => { }).not.toThrow(); }); - describe('nested validation', () => { - const { getWidgets } = require('../../lib/registry'); - getWidgets.mockImplementation(() => [ - { - name: 'relation', - schema: { - properties: { - search_fields: { type: 'array', items: { type: 'string' } }, - display_fields: { type: 'array', items: { type: 'string' } }, - }, - }, - }, - ]); - - it('should throw if nested relation display_fields and search_fields are not arrays', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - collections: [ - { - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { - name: 'object', - label: 'Object', - widget: 'object', - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { - name: 'relation', - label: 'relation', - widget: 'relation', - display_fields: 'title', - search_fields: 'title', - }, - ], - }, - ], - }, - ], - }), - ); - }).toThrowError( - "'collections[0].fields[1].fields[1].search_fields' must be array\n'collections[0].fields[1].fields[1].display_fields' must be array", - ); - }); - - it('should not throw if nested relation display_fields and search_fields are arrays', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - collections: [ - { - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { - name: 'object', - label: 'Object', - widget: 'object', - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { - name: 'relation', - label: 'relation', - widget: 'relation', - display_fields: ['title'], - search_fields: ['title'], - }, - ], - }, - ], - }, - ], - }), - ); - }).not.toThrow(); - }); - }); - it('should throw if collection meta is not a plain object', () => { expect(() => { validateConfig(merge({}, validConfig, { collections: [{ meta: [] }] })); @@ -509,3 +430,83 @@ describe.only('config', () => { }); }); }); + + +// describe('nested validation', () => { +// const { getWidgets } = require('../../lib/registry'); +// getWidgets.mockImplementation(() => [ +// { +// name: 'relation', +// schema: { +// properties: { +// search_fields: { type: 'array', items: { type: 'string' } }, +// display_fields: { type: 'array', items: { type: 'string' } }, +// }, +// }, +// }, +// ]); + +// it('should throw if nested relation display_fields and search_fields are not arrays', () => { +// expect(() => { +// validateConfig( +// merge({}, validConfig, { +// collections: [ +// { +// fields: [ +// { name: 'title', label: 'title', widget: 'string' }, +// { +// name: 'object', +// label: 'Object', +// widget: 'object', +// fields: [ +// { name: 'title', label: 'title', widget: 'string' }, +// { +// name: 'relation', +// label: 'relation', +// widget: 'relation', +// display_fields: 'title', +// search_fields: 'title', +// }, +// ], +// }, +// ], +// }, +// ], +// }), +// ); +// }).toThrowError( +// "'collections[0].fields[1].fields[1].search_fields' must be array\n'collections[0].fields[1].fields[1].display_fields' must be array", +// ); +// }); + +// it('should not throw if nested relation display_fields and search_fields are arrays', () => { +// expect(() => { +// validateConfig( +// merge({}, validConfig, { +// collections: [ +// { +// fields: [ +// { name: 'title', label: 'title', widget: 'string' }, +// { +// name: 'object', +// label: 'Object', +// widget: 'object', +// fields: [ +// { name: 'title', label: 'title', widget: 'string' }, +// { +// name: 'relation', +// label: 'relation', +// widget: 'relation', +// display_fields: ['title'], +// search_fields: ['title'], +// }, +// ], +// }, +// ], +// }, +// ], +// }), +// ); +// }).not.toThrow(); +// }); +// }); \ No newline at end of file diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index 45512fc9fb13..688e4bf15f61 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -12,7 +12,7 @@ import { set } from 'lodash/fp' import { getWidgets } from '../lib/registry'; import { I18N_FIELD } from '../lib/i18n'; import schema from '../../config.schema.json'; -import validateSchema from './validateSchema'; +import staticValidateConfig from './staticValidateConfig'; // taken from config.schema.json // config.properties.collections.items.properties.files.items.properties.fields.items.selectCases @@ -84,7 +84,7 @@ function fieldsConfig() { * fix a circular dependency problem for WebPack, * where the imports get resolved asynchronously. */ -function getConfigSchema() { +export function getConfigSchema() { // This will immutably apply fields schema to the schema properrites that need them // TODO: it might be better to use ref here as per https://github.com/ajv-validator/ajv/issues/1707#issuecomment-890479942 @@ -96,12 +96,14 @@ function getConfigSchema() { } function getWidgetSchemas() { - const schemas = getWidgets().map(widget => ({ [widget.name]: widget.schema })); - return Object.assign(...schemas); + const widgets = getWidgets(); + const schemas = widgets.filter(widget => widget.schema).map(widget => ({ [widget.name]: widget.schema })); + return Object.assign({}, ...schemas); } class ConfigError extends Error { constructor(errors, ...args) { + console.log('errors', errors) const message = errors .map(({ message, instancePath }) => { const dotPath = instancePath @@ -137,40 +139,42 @@ function dynamicValidateConfig(config) { ajvErrors(ajv); const valid = ajv.validate(getConfigSchema(), config); - if (!valid) { - const errors = ajv.errors.map(e => { - switch (e.keyword) { - // TODO: remove after https://github.com/ajv-validator/ajv-keywords/pull/123 is merged - case 'uniqueItemProperties': { - const path = e.instancePath || ''; - let newError = e; - if (path.endsWith('/fields')) { - newError = { ...e, message: 'fields names must be unique' }; - } else if (path.endsWith('/files')) { - newError = { ...e, message: 'files names must be unique' }; - } else if (path.endsWith('/collections')) { - newError = { ...e, message: 'collections names must be unique' }; - } - return newError; + dynamicValidateConfig.errors = ajv.errors; + + return valid; +} + +function extractValidationErrors(validator) { + return validator.errors.map(e => { + switch (e.keyword) { + // TODO: remove after https://github.com/ajv-validator/ajv-keywords/pull/123 is merged + case 'uniqueItemProperties': { + const path = e.instancePath || ''; + let newError = e; + if (path.endsWith('/fields')) { + newError = { ...e, message: 'fields names must be unique' }; + } else if (path.endsWith('/files')) { + newError = { ...e, message: 'files names must be unique' }; + } else if (path.endsWith('/collections')) { + newError = { ...e, message: 'collections names must be unique' }; } - case 'instanceof': { - const path = e.instancePath || ''; - let newError = e; - if (/fields\/\d+\/pattern\/\d+/.test(path)) { - newError = { - ...e, - message: 'must be a regular expression', - }; - } - return newError; + return newError; + } + case 'instanceof': { + const path = e.instancePath || ''; + let newError = e; + if (/fields\/\d+\/pattern\/\d+/.test(path)) { + newError = { + ...e, + message: 'must be a regular expression', + }; } - default: - return e; + return newError; } - }); - console.error('Config Errors', errors); - throw new ConfigError(errors); - } + default: + return e; + } + }) } @@ -179,11 +183,22 @@ export function validateConfig(config) { widgetKey => NativeCMSWidgets.includes(widgetKey) === false, ); + let validator; if (customWidgets.length > 0) { console.debug('using dynamic ajv validation'); - return dynamicValidateConfig(config); + validator = dynamicValidateConfig; } else { console.debug('using static ajv validation'); - return validateSchema(config); + validator = staticValidateConfig; + } + + const result = validator(config); + + if (result === false) { + const errors = extractValidationErrors(validator); + console.error('Config Errors', errors); + throw new ConfigError(errors); } + + return result; } diff --git a/packages/netlify-cms-core/src/constants/validateSchema.js b/packages/netlify-cms-core/src/constants/staticValidateConfig.js similarity index 82% rename from packages/netlify-cms-core/src/constants/validateSchema.js rename to packages/netlify-cms-core/src/constants/staticValidateConfig.js index 028842497398..24784520941b 100644 --- a/packages/netlify-cms-core/src/constants/validateSchema.js +++ b/packages/netlify-cms-core/src/constants/staticValidateConfig.js @@ -1,5 +1,5 @@ -/* eslint-disable */ 'use strict'; +var RULES = require('ajv/lib/compile/rules')(); var ucs2length = require('ajv/lib/compile/ucs2length'); var equal = require('ajv/lib/compile/equal'); var validate = (function() { @@ -34,7 +34,7 @@ var validate = (function() { if (typeof data.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.name', + dataPath: (dataPath || '') + '/name', schemaPath: '#/properties/name/type', params: { type: 'string' @@ -52,7 +52,7 @@ var validate = (function() { if (typeof data.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.label', + dataPath: (dataPath || '') + '/label', schemaPath: '#/properties/label/type', params: { type: 'string' @@ -70,7 +70,7 @@ var validate = (function() { if (typeof data.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.widget', + dataPath: (dataPath || '') + '/widget', schemaPath: '#/properties/widget/type', params: { type: 'string' @@ -88,7 +88,7 @@ var validate = (function() { if (typeof data.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.required', + dataPath: (dataPath || '') + '/required', schemaPath: '#/properties/required/type', params: { type: 'boolean' @@ -112,7 +112,7 @@ var validate = (function() { if (typeof data1 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.i18n', + dataPath: (dataPath || '') + '/i18n', schemaPath: '#/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -132,7 +132,7 @@ var validate = (function() { if (typeof data1 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.i18n', + dataPath: (dataPath || '') + '/i18n', schemaPath: '#/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -153,7 +153,7 @@ var validate = (function() { } if (!valid2) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '.i18n', + dataPath: (dataPath || '') + '/i18n', schemaPath: '#/properties/i18n/oneOf/1/enum', params: { allowedValues: schema2 @@ -177,7 +177,7 @@ var validate = (function() { if (!valid1) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.i18n', + dataPath: (dataPath || '') + '/i18n', schemaPath: '#/properties/i18n/oneOf', params: { passingSchemas: passingSchemas1 @@ -201,7 +201,7 @@ var validate = (function() { if (typeof data.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.hint', + dataPath: (dataPath || '') + '/hint', schemaPath: '#/properties/hint/type', params: { type: 'string' @@ -221,7 +221,7 @@ var validate = (function() { if (data1.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.pattern', + dataPath: (dataPath || '') + '/pattern', schemaPath: '#/properties/pattern/minItems', params: { limit: 2 @@ -236,16 +236,17 @@ var validate = (function() { var valid1; valid2 = true; if (data1.length > 0) { + var data2 = data1[0]; var errs_2 = errors; var errs__2 = errors, prevValid2 = false, valid2 = false, passingSchemas2 = null; var errs_3 = errors; - if (typeof data1[0] !== "string") { + if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/pattern/' + 0, schemaPath: '#/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -261,7 +262,38 @@ var validate = (function() { valid2 = prevValid2 = true; passingSchemas2 = 0; } - var valid3 = true; + var errs_3 = errors; + customRule1.errors = null; + var errs__3 = errors; + var valid3; + customRule1.errors = null; + valid3 = customRule1.call(self, data2, (dataPath || '') + '/pattern/' + 0, data1, 0, rootData); + if (!valid3) { + if (Array.isArray(customRule1.errors)) { + if (vErrors === null) vErrors = customRule1.errors; + else vErrors = vErrors.concat(customRule1.errors); + errors = vErrors.length; + for (var i3 = errs__3; i3 < errors; i3++) { + var ruleErr3 = vErrors[i3]; + if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '/pattern/' + 0; + ruleErr3.schemaPath = "#/properties/pattern/items/0/oneOf/1/instanceof"; + } + } else { + var err = { + keyword: 'instanceof', + dataPath: (dataPath || '') + '/pattern/' + 0, + schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', + params: { + keyword: 'instanceof' + }, + message: 'should pass "instanceof" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid3 = errors === errs_3; if (valid3 && prevValid2) { valid2 = false; passingSchemas2 = [passingSchemas2, 1]; @@ -274,7 +306,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/pattern/' + 0, schemaPath: '#/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas2 @@ -299,7 +331,7 @@ var validate = (function() { if (typeof data1[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.pattern[' + 1 + ']', + dataPath: (dataPath || '') + '/pattern/' + 1, schemaPath: '#/properties/pattern/items/1/type', params: { type: 'string' @@ -315,7 +347,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.pattern', + dataPath: (dataPath || '') + '/pattern', schemaPath: '#/properties/pattern/type', params: { type: 'array' @@ -330,7 +362,7 @@ var validate = (function() { } if (data.field !== undefined) { var errs_1 = errors; - if (!refVal[1](data.field, (dataPath || '') + '.field', data, 'field', rootData)) { + if (!refVal[1](data.field, (dataPath || '') + '/field', data, 'field', rootData)) { if (vErrors === null) vErrors = refVal[1].errors; else vErrors = vErrors.concat(refVal[1].errors); errors = vErrors.length; @@ -339,7 +371,7 @@ var validate = (function() { } if (data.fields !== undefined) { var errs_1 = errors; - if (!refVal2(data.fields, (dataPath || '') + '.fields', data, 'fields', rootData)) { + if (!refVal2(data.fields, (dataPath || '') + '/fields', data, 'fields', rootData)) { if (vErrors === null) vErrors = refVal2.errors; else vErrors = vErrors.concat(refVal2.errors); errors = vErrors.length; @@ -348,7 +380,7 @@ var validate = (function() { } if (data.types !== undefined) { var errs_1 = errors; - if (!refVal[2](data.types, (dataPath || '') + '.types', data, 'types', rootData)) { + if (!refVal[2](data.types, (dataPath || '') + '/types', data, 'types', rootData)) { if (vErrors === null) vErrors = refVal[2].errors; else vErrors = vErrors.concat(refVal[2].errors); errors = vErrors.length; @@ -369,6 +401,51 @@ var validate = (function() { else vErrors.push(err); errors++; } + var schema0 = data && data.widget; + var definition0 = RULES.custom['select'].definition; + var keywordValidate0 = definition0.validate; + keywordValidate0.errors = null; + var errs__0 = errors; + var valid0; + if (schema0 === undefined) { + valid0 = true; + } else { + valid0 = definition0.validateSchema(schema0); + if (valid0) { + keywordValidate0.errors = null; + valid0 = keywordValidate0.call(self, schema0, data, validate.schema, (dataPath || ''), parentData, parentDataProperty, rootData); + } + } + if (!valid0) { + if (Array.isArray(keywordValidate0.errors)) { + if (vErrors === null) vErrors = keywordValidate0.errors; + else vErrors = vErrors.concat(keywordValidate0.errors); + errors = vErrors.length; + for (var i0 = errs__0; i0 < errors; i0++) { + var ruleErr0 = vErrors[i0]; + if (ruleErr0.dataPath === undefined) ruleErr0.dataPath = (dataPath || '') + ""; + ruleErr0.schemaPath = "#/select"; + } + } else { + var err = { + keyword: 'select', + dataPath: (dataPath || '') + "", + schemaPath: '#/select', + params: { + keyword: 'select' + }, + message: 'should pass "select" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + customRule5.errors = null; + var errs__0 = errors; + var valid0; + customRule5.errors = null; + valid0 = customRule5.call(self, data, (dataPath || ''), parentData, parentDataProperty, rootData); validate.errors = vErrors; return errors === 0; }; @@ -710,7 +787,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '[' + i0 + ']', + dataPath: (dataPath || '') + '/' + i0, schemaPath: '#/items/required', params: { missingProperty: 'name' @@ -725,7 +802,7 @@ var validate = (function() { if (typeof data1.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].name', + dataPath: (dataPath || '') + '/' + i0 + '/name', schemaPath: '#/items/properties/name/type', params: { type: 'string' @@ -743,7 +820,7 @@ var validate = (function() { if (typeof data1.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].label', + dataPath: (dataPath || '') + '/' + i0 + '/label', schemaPath: '#/items/properties/label/type', params: { type: 'string' @@ -761,7 +838,7 @@ var validate = (function() { if (typeof data1.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].widget', + dataPath: (dataPath || '') + '/' + i0 + '/widget', schemaPath: '#/items/properties/widget/type', params: { type: 'string' @@ -779,7 +856,7 @@ var validate = (function() { if (typeof data1.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].required', + dataPath: (dataPath || '') + '/' + i0 + '/required', schemaPath: '#/items/properties/required/type', params: { type: 'boolean' @@ -803,7 +880,7 @@ var validate = (function() { if (typeof data2 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', + dataPath: (dataPath || '') + '/' + i0 + '/i18n', schemaPath: '#/items/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -823,7 +900,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', + dataPath: (dataPath || '') + '/' + i0 + '/i18n', schemaPath: '#/items/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -844,7 +921,7 @@ var validate = (function() { } if (!valid3) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', + dataPath: (dataPath || '') + '/' + i0 + '/i18n', schemaPath: '#/items/properties/i18n/oneOf/1/enum', params: { allowedValues: schema3 @@ -868,7 +945,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', + dataPath: (dataPath || '') + '/' + i0 + '/i18n', schemaPath: '#/items/properties/i18n/oneOf', params: { passingSchemas: passingSchemas2 @@ -892,7 +969,7 @@ var validate = (function() { if (typeof data1.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].hint', + dataPath: (dataPath || '') + '/' + i0 + '/hint', schemaPath: '#/items/properties/hint/type', params: { type: 'string' @@ -912,7 +989,7 @@ var validate = (function() { if (data2.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '[' + i0 + '].pattern', + dataPath: (dataPath || '') + '/' + i0 + '/pattern', schemaPath: '#/items/properties/pattern/minItems', params: { limit: 2 @@ -927,16 +1004,17 @@ var validate = (function() { var valid2; valid3 = true; if (data2.length > 0) { + var data3 = data2[0]; var errs_3 = errors; var errs__3 = errors, prevValid3 = false, valid3 = false, passingSchemas3 = null; var errs_4 = errors; - if (typeof data2[0] !== "string") { + if (typeof data3 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, schemaPath: '#/items/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -952,7 +1030,38 @@ var validate = (function() { valid3 = prevValid3 = true; passingSchemas3 = 0; } - var valid4 = true; + var errs_4 = errors; + customRule2.errors = null; + var errs__4 = errors; + var valid4; + customRule2.errors = null; + valid4 = customRule2.call(self, data3, (dataPath || '') + '/' + i0 + '/pattern/' + 0, data2, 0, rootData); + if (!valid4) { + if (Array.isArray(customRule2.errors)) { + if (vErrors === null) vErrors = customRule2.errors; + else vErrors = vErrors.concat(customRule2.errors); + errors = vErrors.length; + for (var i4 = errs__4; i4 < errors; i4++) { + var ruleErr4 = vErrors[i4]; + if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '/' + i0 + '/pattern/' + 0; + ruleErr4.schemaPath = "#/items/properties/pattern/items/0/oneOf/1/instanceof"; + } + } else { + var err = { + keyword: 'instanceof', + dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, + schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', + params: { + keyword: 'instanceof' + }, + message: 'should pass "instanceof" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid4 = errors === errs_4; if (valid4 && prevValid3) { valid3 = false; passingSchemas3 = [passingSchemas3, 1]; @@ -965,7 +1074,7 @@ var validate = (function() { if (!valid3) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, schemaPath: '#/items/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas3 @@ -990,7 +1099,7 @@ var validate = (function() { if (typeof data2[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 1 + ']', + dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 1, schemaPath: '#/items/properties/pattern/items/1/type', params: { type: 'string' @@ -1006,7 +1115,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern', + dataPath: (dataPath || '') + '/' + i0 + '/pattern', schemaPath: '#/items/properties/pattern/type', params: { type: 'array' @@ -1021,7 +1130,7 @@ var validate = (function() { } if (data1.field !== undefined) { var errs_2 = errors; - if (!refVal[1](data1.field, (dataPath || '') + '[' + i0 + '].field', data1, 'field', rootData)) { + if (!refVal[1](data1.field, (dataPath || '') + '/' + i0 + '/field', data1, 'field', rootData)) { if (vErrors === null) vErrors = refVal[1].errors; else vErrors = vErrors.concat(refVal[1].errors); errors = vErrors.length; @@ -1030,7 +1139,7 @@ var validate = (function() { } if (data1.fields !== undefined) { var errs_2 = errors; - if (!refVal[2](data1.fields, (dataPath || '') + '[' + i0 + '].fields', data1, 'fields', rootData)) { + if (!refVal[2](data1.fields, (dataPath || '') + '/' + i0 + '/fields', data1, 'fields', rootData)) { if (vErrors === null) vErrors = refVal[2].errors; else vErrors = vErrors.concat(refVal[2].errors); errors = vErrors.length; @@ -1039,7 +1148,7 @@ var validate = (function() { } if (data1.types !== undefined) { var errs_2 = errors; - if (!refVal[2](data1.types, (dataPath || '') + '[' + i0 + '].types', data1, 'types', rootData)) { + if (!refVal[2](data1.types, (dataPath || '') + '/' + i0 + '/types', data1, 'types', rootData)) { if (vErrors === null) vErrors = refVal[2].errors; else vErrors = vErrors.concat(refVal[2].errors); errors = vErrors.length; @@ -1049,7 +1158,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + ']', + dataPath: (dataPath || '') + '/' + i0, schemaPath: '#/items/type', params: { type: 'object' @@ -1060,8 +1169,83 @@ var validate = (function() { else vErrors.push(err); errors++; } + var schema1 = data1 && data1.widget; + var definition1 = RULES.custom['select'].definition; + var keywordValidate1 = definition1.validate; + keywordValidate1.errors = null; + var errs__1 = errors; + var valid1; + if (schema1 === undefined) { + valid1 = true; + } else { + valid1 = definition1.validateSchema(schema1); + if (valid1) { + keywordValidate1.errors = null; + valid1 = keywordValidate1.call(self, schema1, data1, validate.schema.items, (dataPath || '') + '/' + i0, data, i0, rootData); + } + } + if (!valid1) { + if (Array.isArray(keywordValidate1.errors)) { + if (vErrors === null) vErrors = keywordValidate1.errors; + else vErrors = vErrors.concat(keywordValidate1.errors); + errors = vErrors.length; + for (var i1 = errs__1; i1 < errors; i1++) { + var ruleErr1 = vErrors[i1]; + if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '/' + i0; + ruleErr1.schemaPath = "#/items/select"; + } + } else { + var err = { + keyword: 'select', + dataPath: (dataPath || '') + '/' + i0, + schemaPath: '#/items/select', + params: { + keyword: 'select' + }, + message: 'should pass "select" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + customRule3.errors = null; + var errs__1 = errors; + var valid1; + customRule3.errors = null; + valid1 = customRule3.call(self, data1, (dataPath || '') + '/' + i0, data, i0, rootData); var valid1 = errors === errs_1; } + customRule4.errors = null; + var errs__0 = errors; + var valid0; + customRule4.errors = null; + valid0 = customRule4.call(self, data, (dataPath || ''), parentData, parentDataProperty, rootData); + if (!valid0) { + if (Array.isArray(customRule4.errors)) { + if (vErrors === null) vErrors = customRule4.errors; + else vErrors = vErrors.concat(customRule4.errors); + errors = vErrors.length; + for (var i0 = errs__0; i0 < errors; i0++) { + var ruleErr0 = vErrors[i0]; + if (ruleErr0.dataPath === undefined) ruleErr0.dataPath = (dataPath || '') + ""; + ruleErr0.schemaPath = "#/uniqueItemProperties"; + } + } else { + var err = { + keyword: 'uniqueItemProperties', + dataPath: (dataPath || '') + "", + schemaPath: '#/uniqueItemProperties', + params: { + keyword: 'uniqueItemProperties' + }, + message: 'should pass "uniqueItemProperties" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } } else { var err = { keyword: 'type', @@ -1418,7 +1602,7 @@ var validate = (function() { if (typeof data.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.name', + dataPath: (dataPath || '') + '/name', schemaPath: '#/properties/name/type', params: { type: 'string' @@ -1436,7 +1620,7 @@ var validate = (function() { if (typeof data.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.label', + dataPath: (dataPath || '') + '/label', schemaPath: '#/properties/label/type', params: { type: 'string' @@ -1454,7 +1638,7 @@ var validate = (function() { if (typeof data.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.widget', + dataPath: (dataPath || '') + '/widget', schemaPath: '#/properties/widget/type', params: { type: 'string' @@ -1472,7 +1656,7 @@ var validate = (function() { if (typeof data.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.required', + dataPath: (dataPath || '') + '/required', schemaPath: '#/properties/required/type', params: { type: 'boolean' @@ -1496,7 +1680,7 @@ var validate = (function() { if (typeof data1 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.i18n', + dataPath: (dataPath || '') + '/i18n', schemaPath: '#/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -1516,7 +1700,7 @@ var validate = (function() { if (typeof data1 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.i18n', + dataPath: (dataPath || '') + '/i18n', schemaPath: '#/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -1537,7 +1721,7 @@ var validate = (function() { } if (!valid2) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '.i18n', + dataPath: (dataPath || '') + '/i18n', schemaPath: '#/properties/i18n/oneOf/1/enum', params: { allowedValues: schema2 @@ -1561,7 +1745,7 @@ var validate = (function() { if (!valid1) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.i18n', + dataPath: (dataPath || '') + '/i18n', schemaPath: '#/properties/i18n/oneOf', params: { passingSchemas: passingSchemas1 @@ -1585,7 +1769,7 @@ var validate = (function() { if (typeof data.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.hint', + dataPath: (dataPath || '') + '/hint', schemaPath: '#/properties/hint/type', params: { type: 'string' @@ -1605,7 +1789,7 @@ var validate = (function() { if (data1.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.pattern', + dataPath: (dataPath || '') + '/pattern', schemaPath: '#/properties/pattern/minItems', params: { limit: 2 @@ -1620,16 +1804,17 @@ var validate = (function() { var valid1; valid2 = true; if (data1.length > 0) { + var data2 = data1[0]; var errs_2 = errors; var errs__2 = errors, prevValid2 = false, valid2 = false, passingSchemas2 = null; var errs_3 = errors; - if (typeof data1[0] !== "string") { + if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/pattern/' + 0, schemaPath: '#/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -1645,7 +1830,38 @@ var validate = (function() { valid2 = prevValid2 = true; passingSchemas2 = 0; } - var valid3 = true; + var errs_3 = errors; + customRule10.errors = null; + var errs__3 = errors; + var valid3; + customRule10.errors = null; + valid3 = customRule10.call(self, data2, (dataPath || '') + '/pattern/' + 0, data1, 0, rootData); + if (!valid3) { + if (Array.isArray(customRule10.errors)) { + if (vErrors === null) vErrors = customRule10.errors; + else vErrors = vErrors.concat(customRule10.errors); + errors = vErrors.length; + for (var i3 = errs__3; i3 < errors; i3++) { + var ruleErr3 = vErrors[i3]; + if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '/pattern/' + 0; + ruleErr3.schemaPath = "#/properties/pattern/items/0/oneOf/1/instanceof"; + } + } else { + var err = { + keyword: 'instanceof', + dataPath: (dataPath || '') + '/pattern/' + 0, + schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', + params: { + keyword: 'instanceof' + }, + message: 'should pass "instanceof" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid3 = errors === errs_3; if (valid3 && prevValid2) { valid2 = false; passingSchemas2 = [passingSchemas2, 1]; @@ -1658,7 +1874,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/pattern/' + 0, schemaPath: '#/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas2 @@ -1683,7 +1899,7 @@ var validate = (function() { if (typeof data1[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.pattern[' + 1 + ']', + dataPath: (dataPath || '') + '/pattern/' + 1, schemaPath: '#/properties/pattern/items/1/type', params: { type: 'string' @@ -1699,7 +1915,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.pattern', + dataPath: (dataPath || '') + '/pattern', schemaPath: '#/properties/pattern/type', params: { type: 'array' @@ -1714,7 +1930,7 @@ var validate = (function() { } if (data.field !== undefined) { var errs_1 = errors; - if (!refVal[3](data.field, (dataPath || '') + '.field', data, 'field', rootData)) { + if (!refVal[3](data.field, (dataPath || '') + '/field', data, 'field', rootData)) { if (vErrors === null) vErrors = refVal[3].errors; else vErrors = vErrors.concat(refVal[3].errors); errors = vErrors.length; @@ -1723,7 +1939,7 @@ var validate = (function() { } if (data.fields !== undefined) { var errs_1 = errors; - if (!refVal4(data.fields, (dataPath || '') + '.fields', data, 'fields', rootData)) { + if (!refVal4(data.fields, (dataPath || '') + '/fields', data, 'fields', rootData)) { if (vErrors === null) vErrors = refVal4.errors; else vErrors = vErrors.concat(refVal4.errors); errors = vErrors.length; @@ -1732,7 +1948,7 @@ var validate = (function() { } if (data.types !== undefined) { var errs_1 = errors; - if (!refVal[4](data.types, (dataPath || '') + '.types', data, 'types', rootData)) { + if (!refVal[4](data.types, (dataPath || '') + '/types', data, 'types', rootData)) { if (vErrors === null) vErrors = refVal[4].errors; else vErrors = vErrors.concat(refVal[4].errors); errors = vErrors.length; @@ -1753,6 +1969,51 @@ var validate = (function() { else vErrors.push(err); errors++; } + var schema0 = data && data.widget; + var definition0 = RULES.custom['select'].definition; + var keywordValidate0 = definition0.validate; + keywordValidate0.errors = null; + var errs__0 = errors; + var valid0; + if (schema0 === undefined) { + valid0 = true; + } else { + valid0 = definition0.validateSchema(schema0); + if (valid0) { + keywordValidate0.errors = null; + valid0 = keywordValidate0.call(self, schema0, data, validate.schema, (dataPath || ''), parentData, parentDataProperty, rootData); + } + } + if (!valid0) { + if (Array.isArray(keywordValidate0.errors)) { + if (vErrors === null) vErrors = keywordValidate0.errors; + else vErrors = vErrors.concat(keywordValidate0.errors); + errors = vErrors.length; + for (var i0 = errs__0; i0 < errors; i0++) { + var ruleErr0 = vErrors[i0]; + if (ruleErr0.dataPath === undefined) ruleErr0.dataPath = (dataPath || '') + ""; + ruleErr0.schemaPath = "#/select"; + } + } else { + var err = { + keyword: 'select', + dataPath: (dataPath || '') + "", + schemaPath: '#/select', + params: { + keyword: 'select' + }, + message: 'should pass "select" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + customRule14.errors = null; + var errs__0 = errors; + var valid0; + customRule14.errors = null; + valid0 = customRule14.call(self, data, (dataPath || ''), parentData, parentDataProperty, rootData); validate.errors = vErrors; return errors === 0; }; @@ -2094,7 +2355,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '[' + i0 + ']', + dataPath: (dataPath || '') + '/' + i0, schemaPath: '#/items/required', params: { missingProperty: 'name' @@ -2109,7 +2370,7 @@ var validate = (function() { if (typeof data1.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].name', + dataPath: (dataPath || '') + '/' + i0 + '/name', schemaPath: '#/items/properties/name/type', params: { type: 'string' @@ -2127,7 +2388,7 @@ var validate = (function() { if (typeof data1.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].label', + dataPath: (dataPath || '') + '/' + i0 + '/label', schemaPath: '#/items/properties/label/type', params: { type: 'string' @@ -2145,7 +2406,7 @@ var validate = (function() { if (typeof data1.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].widget', + dataPath: (dataPath || '') + '/' + i0 + '/widget', schemaPath: '#/items/properties/widget/type', params: { type: 'string' @@ -2163,7 +2424,7 @@ var validate = (function() { if (typeof data1.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].required', + dataPath: (dataPath || '') + '/' + i0 + '/required', schemaPath: '#/items/properties/required/type', params: { type: 'boolean' @@ -2187,7 +2448,7 @@ var validate = (function() { if (typeof data2 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', + dataPath: (dataPath || '') + '/' + i0 + '/i18n', schemaPath: '#/items/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -2207,7 +2468,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', + dataPath: (dataPath || '') + '/' + i0 + '/i18n', schemaPath: '#/items/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -2228,7 +2489,7 @@ var validate = (function() { } if (!valid3) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', + dataPath: (dataPath || '') + '/' + i0 + '/i18n', schemaPath: '#/items/properties/i18n/oneOf/1/enum', params: { allowedValues: schema3 @@ -2252,7 +2513,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', + dataPath: (dataPath || '') + '/' + i0 + '/i18n', schemaPath: '#/items/properties/i18n/oneOf', params: { passingSchemas: passingSchemas2 @@ -2276,7 +2537,7 @@ var validate = (function() { if (typeof data1.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].hint', + dataPath: (dataPath || '') + '/' + i0 + '/hint', schemaPath: '#/items/properties/hint/type', params: { type: 'string' @@ -2296,7 +2557,7 @@ var validate = (function() { if (data2.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '[' + i0 + '].pattern', + dataPath: (dataPath || '') + '/' + i0 + '/pattern', schemaPath: '#/items/properties/pattern/minItems', params: { limit: 2 @@ -2311,16 +2572,17 @@ var validate = (function() { var valid2; valid3 = true; if (data2.length > 0) { + var data3 = data2[0]; var errs_3 = errors; var errs__3 = errors, prevValid3 = false, valid3 = false, passingSchemas3 = null; var errs_4 = errors; - if (typeof data2[0] !== "string") { + if (typeof data3 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, schemaPath: '#/items/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -2336,7 +2598,38 @@ var validate = (function() { valid3 = prevValid3 = true; passingSchemas3 = 0; } - var valid4 = true; + var errs_4 = errors; + customRule11.errors = null; + var errs__4 = errors; + var valid4; + customRule11.errors = null; + valid4 = customRule11.call(self, data3, (dataPath || '') + '/' + i0 + '/pattern/' + 0, data2, 0, rootData); + if (!valid4) { + if (Array.isArray(customRule11.errors)) { + if (vErrors === null) vErrors = customRule11.errors; + else vErrors = vErrors.concat(customRule11.errors); + errors = vErrors.length; + for (var i4 = errs__4; i4 < errors; i4++) { + var ruleErr4 = vErrors[i4]; + if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '/' + i0 + '/pattern/' + 0; + ruleErr4.schemaPath = "#/items/properties/pattern/items/0/oneOf/1/instanceof"; + } + } else { + var err = { + keyword: 'instanceof', + dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, + schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', + params: { + keyword: 'instanceof' + }, + message: 'should pass "instanceof" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid4 = errors === errs_4; if (valid4 && prevValid3) { valid3 = false; passingSchemas3 = [passingSchemas3, 1]; @@ -2349,7 +2642,7 @@ var validate = (function() { if (!valid3) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, schemaPath: '#/items/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas3 @@ -2374,7 +2667,7 @@ var validate = (function() { if (typeof data2[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 1 + ']', + dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 1, schemaPath: '#/items/properties/pattern/items/1/type', params: { type: 'string' @@ -2390,7 +2683,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern', + dataPath: (dataPath || '') + '/' + i0 + '/pattern', schemaPath: '#/items/properties/pattern/type', params: { type: 'array' @@ -2405,7 +2698,7 @@ var validate = (function() { } if (data1.field !== undefined) { var errs_2 = errors; - if (!refVal[3](data1.field, (dataPath || '') + '[' + i0 + '].field', data1, 'field', rootData)) { + if (!refVal[3](data1.field, (dataPath || '') + '/' + i0 + '/field', data1, 'field', rootData)) { if (vErrors === null) vErrors = refVal[3].errors; else vErrors = vErrors.concat(refVal[3].errors); errors = vErrors.length; @@ -2414,7 +2707,7 @@ var validate = (function() { } if (data1.fields !== undefined) { var errs_2 = errors; - if (!refVal[4](data1.fields, (dataPath || '') + '[' + i0 + '].fields', data1, 'fields', rootData)) { + if (!refVal[4](data1.fields, (dataPath || '') + '/' + i0 + '/fields', data1, 'fields', rootData)) { if (vErrors === null) vErrors = refVal[4].errors; else vErrors = vErrors.concat(refVal[4].errors); errors = vErrors.length; @@ -2423,7 +2716,7 @@ var validate = (function() { } if (data1.types !== undefined) { var errs_2 = errors; - if (!refVal[4](data1.types, (dataPath || '') + '[' + i0 + '].types', data1, 'types', rootData)) { + if (!refVal[4](data1.types, (dataPath || '') + '/' + i0 + '/types', data1, 'types', rootData)) { if (vErrors === null) vErrors = refVal[4].errors; else vErrors = vErrors.concat(refVal[4].errors); errors = vErrors.length; @@ -2433,7 +2726,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + ']', + dataPath: (dataPath || '') + '/' + i0, schemaPath: '#/items/type', params: { type: 'object' @@ -2444,8 +2737,83 @@ var validate = (function() { else vErrors.push(err); errors++; } + var schema1 = data1 && data1.widget; + var definition1 = RULES.custom['select'].definition; + var keywordValidate1 = definition1.validate; + keywordValidate1.errors = null; + var errs__1 = errors; + var valid1; + if (schema1 === undefined) { + valid1 = true; + } else { + valid1 = definition1.validateSchema(schema1); + if (valid1) { + keywordValidate1.errors = null; + valid1 = keywordValidate1.call(self, schema1, data1, validate.schema.items, (dataPath || '') + '/' + i0, data, i0, rootData); + } + } + if (!valid1) { + if (Array.isArray(keywordValidate1.errors)) { + if (vErrors === null) vErrors = keywordValidate1.errors; + else vErrors = vErrors.concat(keywordValidate1.errors); + errors = vErrors.length; + for (var i1 = errs__1; i1 < errors; i1++) { + var ruleErr1 = vErrors[i1]; + if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '/' + i0; + ruleErr1.schemaPath = "#/items/select"; + } + } else { + var err = { + keyword: 'select', + dataPath: (dataPath || '') + '/' + i0, + schemaPath: '#/items/select', + params: { + keyword: 'select' + }, + message: 'should pass "select" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + customRule12.errors = null; + var errs__1 = errors; + var valid1; + customRule12.errors = null; + valid1 = customRule12.call(self, data1, (dataPath || '') + '/' + i0, data, i0, rootData); var valid1 = errors === errs_1; } + customRule13.errors = null; + var errs__0 = errors; + var valid0; + customRule13.errors = null; + valid0 = customRule13.call(self, data, (dataPath || ''), parentData, parentDataProperty, rootData); + if (!valid0) { + if (Array.isArray(customRule13.errors)) { + if (vErrors === null) vErrors = customRule13.errors; + else vErrors = vErrors.concat(customRule13.errors); + errors = vErrors.length; + for (var i0 = errs__0; i0 < errors; i0++) { + var ruleErr0 = vErrors[i0]; + if (ruleErr0.dataPath === undefined) ruleErr0.dataPath = (dataPath || '') + ""; + ruleErr0.schemaPath = "#/uniqueItemProperties"; + } + } else { + var err = { + keyword: 'uniqueItemProperties', + dataPath: (dataPath || '') + "", + schemaPath: '#/uniqueItemProperties', + params: { + keyword: 'uniqueItemProperties' + }, + message: 'should pass "uniqueItemProperties" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } } else { var err = { keyword: 'type', @@ -2805,7 +3173,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.backend', + dataPath: (dataPath || '') + '/backend', schemaPath: '#/properties/backend/required', params: { missingProperty: 'name' @@ -2820,7 +3188,7 @@ var validate = (function() { if (typeof data1.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.backend.name', + dataPath: (dataPath || '') + '/backend/name', schemaPath: '#/properties/backend/properties/name/type', params: { type: 'string' @@ -2839,7 +3207,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.backend.auth_scope', + dataPath: (dataPath || '') + '/backend/auth_scope', schemaPath: '#/properties/backend/properties/auth_scope/type', params: { type: 'string' @@ -2860,7 +3228,7 @@ var validate = (function() { } if (!valid2) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '.backend.auth_scope', + dataPath: (dataPath || '') + '/backend/auth_scope', schemaPath: '#/properties/backend/properties/auth_scope/enum', params: { allowedValues: schema2 @@ -2880,7 +3248,7 @@ var validate = (function() { if (ucs2length(data2) < 1) { var err = { keyword: 'minLength', - dataPath: (dataPath || '') + '.backend.cms_label_prefix', + dataPath: (dataPath || '') + '/backend/cms_label_prefix', schemaPath: '#/properties/backend/properties/cms_label_prefix/minLength', params: { limit: 1 @@ -2894,7 +3262,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.backend.cms_label_prefix', + dataPath: (dataPath || '') + '/backend/cms_label_prefix', schemaPath: '#/properties/backend/properties/cms_label_prefix/type', params: { type: 'string' @@ -2912,7 +3280,7 @@ var validate = (function() { if (typeof data1.open_authoring !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.backend.open_authoring', + dataPath: (dataPath || '') + '/backend/open_authoring', schemaPath: '#/properties/backend/properties/open_authoring/type', params: { type: 'boolean' @@ -2928,7 +3296,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.backend', + dataPath: (dataPath || '') + '/backend', schemaPath: '#/properties/backend/type', params: { type: 'object' @@ -2952,7 +3320,7 @@ var validate = (function() { if (typeof data1 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.local_backend', + dataPath: (dataPath || '') + '/local_backend', schemaPath: '#/properties/local_backend/oneOf/0/type', params: { type: 'boolean' @@ -2978,7 +3346,7 @@ var validate = (function() { valid3 = false; var err = { keyword: 'additionalProperties', - dataPath: (dataPath || '') + '.local_backend', + dataPath: (dataPath || '') + '/local_backend', schemaPath: '#/properties/local_backend/oneOf/1/additionalProperties', params: { additionalProperty: '' + key2 + '' @@ -2995,7 +3363,7 @@ var validate = (function() { if (typeof data1.url !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.local_backend.url', + dataPath: (dataPath || '') + '/local_backend/url', schemaPath: '#/properties/local_backend/oneOf/1/properties/url/type', params: { type: 'string' @@ -3019,7 +3387,7 @@ var validate = (function() { if (typeof data2[i3] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.local_backend.allowed_hosts[' + i3 + ']', + dataPath: (dataPath || '') + '/local_backend/allowed_hosts/' + i3, schemaPath: '#/properties/local_backend/oneOf/1/properties/allowed_hosts/items/type', params: { type: 'string' @@ -3035,7 +3403,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.local_backend.allowed_hosts', + dataPath: (dataPath || '') + '/local_backend/allowed_hosts', schemaPath: '#/properties/local_backend/oneOf/1/properties/allowed_hosts/type', params: { type: 'array' @@ -3051,7 +3419,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.local_backend', + dataPath: (dataPath || '') + '/local_backend', schemaPath: '#/properties/local_backend/oneOf/1/type', params: { type: 'object' @@ -3075,7 +3443,7 @@ var validate = (function() { if (!valid1) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.local_backend', + dataPath: (dataPath || '') + '/local_backend', schemaPath: '#/properties/local_backend/oneOf', params: { passingSchemas: passingSchemas1 @@ -3099,7 +3467,7 @@ var validate = (function() { if (typeof data.locale !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.locale', + dataPath: (dataPath || '') + '/locale', schemaPath: '#/properties/locale/type', params: { type: 'string' @@ -3123,7 +3491,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.i18n', + dataPath: (dataPath || '') + '/i18n', schemaPath: '#/properties/i18n/required', params: { missingProperty: 'structure' @@ -3138,7 +3506,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.i18n.structure', + dataPath: (dataPath || '') + '/i18n/structure', schemaPath: '#/properties/i18n/properties/structure/type', params: { type: 'string' @@ -3159,7 +3527,7 @@ var validate = (function() { } if (!valid2) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '.i18n.structure', + dataPath: (dataPath || '') + '/i18n/structure', schemaPath: '#/properties/i18n/properties/structure/enum', params: { allowedValues: schema2 @@ -3177,7 +3545,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.i18n', + dataPath: (dataPath || '') + '/i18n', schemaPath: '#/properties/i18n/required', params: { missingProperty: 'locales' @@ -3193,7 +3561,7 @@ var validate = (function() { if (data2.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.i18n.locales', + dataPath: (dataPath || '') + '/i18n/locales', schemaPath: '#/properties/i18n/properties/locales/minItems', params: { limit: 2 @@ -3213,7 +3581,7 @@ var validate = (function() { if (ucs2length(data3) > 10) { var err = { keyword: 'maxLength', - dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', + dataPath: (dataPath || '') + '/i18n/locales/' + i2, schemaPath: '#/properties/i18n/properties/locales/items/maxLength', params: { limit: 10 @@ -3227,7 +3595,7 @@ var validate = (function() { if (ucs2length(data3) < 2) { var err = { keyword: 'minLength', - dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', + dataPath: (dataPath || '') + '/i18n/locales/' + i2, schemaPath: '#/properties/i18n/properties/locales/items/minLength', params: { limit: 2 @@ -3241,7 +3609,7 @@ var validate = (function() { if (!pattern0.test(data3)) { var err = { keyword: 'pattern', - dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', + dataPath: (dataPath || '') + '/i18n/locales/' + i2, schemaPath: '#/properties/i18n/properties/locales/items/pattern', params: { pattern: '^[a-zA-Z-_]+$' @@ -3255,7 +3623,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', + dataPath: (dataPath || '') + '/i18n/locales/' + i2, schemaPath: '#/properties/i18n/properties/locales/items/type', params: { type: 'string' @@ -3288,7 +3656,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'uniqueItems', - dataPath: (dataPath || '') + '.i18n.locales', + dataPath: (dataPath || '') + '/i18n/locales', schemaPath: '#/properties/i18n/properties/locales/uniqueItems', params: { i: i, @@ -3303,7 +3671,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.i18n.locales', + dataPath: (dataPath || '') + '/i18n/locales', schemaPath: '#/properties/i18n/properties/locales/type', params: { type: 'array' @@ -3323,7 +3691,7 @@ var validate = (function() { if (ucs2length(data2) > 10) { var err = { keyword: 'maxLength', - dataPath: (dataPath || '') + '.i18n.default_locale', + dataPath: (dataPath || '') + '/i18n/default_locale', schemaPath: '#/properties/i18n/properties/default_locale/maxLength', params: { limit: 10 @@ -3337,7 +3705,7 @@ var validate = (function() { if (ucs2length(data2) < 2) { var err = { keyword: 'minLength', - dataPath: (dataPath || '') + '.i18n.default_locale', + dataPath: (dataPath || '') + '/i18n/default_locale', schemaPath: '#/properties/i18n/properties/default_locale/minLength', params: { limit: 2 @@ -3351,7 +3719,7 @@ var validate = (function() { if (!pattern0.test(data2)) { var err = { keyword: 'pattern', - dataPath: (dataPath || '') + '.i18n.default_locale', + dataPath: (dataPath || '') + '/i18n/default_locale', schemaPath: '#/properties/i18n/properties/default_locale/pattern', params: { pattern: '^[a-zA-Z-_]+$' @@ -3365,7 +3733,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.i18n.default_locale', + dataPath: (dataPath || '') + '/i18n/default_locale', schemaPath: '#/properties/i18n/properties/default_locale/type', params: { type: 'string' @@ -3381,7 +3749,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.i18n', + dataPath: (dataPath || '') + '/i18n', schemaPath: '#/properties/i18n/type', params: { type: 'object' @@ -3399,7 +3767,7 @@ var validate = (function() { if (typeof data.site_url !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.site_url', + dataPath: (dataPath || '') + '/site_url', schemaPath: '#/properties/site_url/type', params: { type: 'string' @@ -3417,7 +3785,7 @@ var validate = (function() { if (typeof data.display_url !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.display_url', + dataPath: (dataPath || '') + '/display_url', schemaPath: '#/properties/display_url/type', params: { type: 'string' @@ -3435,7 +3803,7 @@ var validate = (function() { if (typeof data.logo_url !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.logo_url', + dataPath: (dataPath || '') + '/logo_url', schemaPath: '#/properties/logo_url/type', params: { type: 'string' @@ -3453,7 +3821,7 @@ var validate = (function() { if (typeof data.show_preview_links !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.show_preview_links', + dataPath: (dataPath || '') + '/show_preview_links', schemaPath: '#/properties/show_preview_links/type', params: { type: 'boolean' @@ -3471,7 +3839,7 @@ var validate = (function() { if (typeof data.media_folder !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.media_folder', + dataPath: (dataPath || '') + '/media_folder', schemaPath: '#/properties/media_folder/type', params: { type: 'string' @@ -3489,7 +3857,7 @@ var validate = (function() { if (typeof data.public_folder !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.public_folder', + dataPath: (dataPath || '') + '/public_folder', schemaPath: '#/properties/public_folder/type', params: { type: 'string' @@ -3507,7 +3875,7 @@ var validate = (function() { if (typeof data.media_folder_relative !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.media_folder_relative', + dataPath: (dataPath || '') + '/media_folder_relative', schemaPath: '#/properties/media_folder_relative/type', params: { type: 'boolean' @@ -3530,7 +3898,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.media_library', + dataPath: (dataPath || '') + '/media_library', schemaPath: '#/properties/media_library/required', params: { missingProperty: 'name' @@ -3545,7 +3913,7 @@ var validate = (function() { if (typeof data1.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.media_library.name', + dataPath: (dataPath || '') + '/media_library/name', schemaPath: '#/properties/media_library/properties/name/type', params: { type: 'string' @@ -3564,7 +3932,7 @@ var validate = (function() { if ((!data2 || typeof data2 !== "object" || Array.isArray(data2))) { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.media_library.config', + dataPath: (dataPath || '') + '/media_library/config', schemaPath: '#/properties/media_library/properties/config/type', params: { type: 'object' @@ -3580,7 +3948,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.media_library', + dataPath: (dataPath || '') + '/media_library', schemaPath: '#/properties/media_library/type', params: { type: 'object' @@ -3599,7 +3967,7 @@ var validate = (function() { if (typeof data1 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.publish_mode', + dataPath: (dataPath || '') + '/publish_mode', schemaPath: '#/properties/publish_mode/type', params: { type: 'string' @@ -3620,7 +3988,7 @@ var validate = (function() { } if (!valid1) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '.publish_mode', + dataPath: (dataPath || '') + '/publish_mode', schemaPath: '#/properties/publish_mode/enum', params: { allowedValues: schema1 @@ -3645,7 +4013,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.slug.encoding', + dataPath: (dataPath || '') + '/slug/encoding', schemaPath: '#/properties/slug/properties/encoding/type', params: { type: 'string' @@ -3666,7 +4034,7 @@ var validate = (function() { } if (!valid2) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '.slug.encoding', + dataPath: (dataPath || '') + '/slug/encoding', schemaPath: '#/properties/slug/properties/encoding/enum', params: { allowedValues: schema2 @@ -3684,7 +4052,7 @@ var validate = (function() { if (typeof data1.clean_accents !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.slug.clean_accents', + dataPath: (dataPath || '') + '/slug/clean_accents', schemaPath: '#/properties/slug/properties/clean_accents/type', params: { type: 'boolean' @@ -3700,7 +4068,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.slug', + dataPath: (dataPath || '') + '/slug', schemaPath: '#/properties/slug/type', params: { type: 'object' @@ -3734,7 +4102,7 @@ var validate = (function() { if (data1.length < 1) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.collections', + dataPath: (dataPath || '') + '/collections', schemaPath: '#/properties/collections/minItems', params: { limit: 1 @@ -3763,7 +4131,7 @@ var validate = (function() { valid4 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/dependencies/frontmatter_delimiter/required', params: { missingProperty: 'format' @@ -3785,7 +4153,7 @@ var validate = (function() { } if (!valid4) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].format', + dataPath: (dataPath || '') + '/collections/' + i1 + '/format', schemaPath: '#/properties/collections/items/dependencies/frontmatter_delimiter/properties/format/enum', params: { allowedValues: schema4 @@ -3807,7 +4175,7 @@ var validate = (function() { valid3 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/required', params: { missingProperty: 'name' @@ -3822,7 +4190,7 @@ var validate = (function() { if (typeof data2.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].name', + dataPath: (dataPath || '') + '/collections/' + i1 + '/name', schemaPath: '#/properties/collections/items/properties/name/type', params: { type: 'string' @@ -3839,7 +4207,7 @@ var validate = (function() { valid3 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/required', params: { missingProperty: 'label' @@ -3854,7 +4222,7 @@ var validate = (function() { if (typeof data2.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].label', + dataPath: (dataPath || '') + '/collections/' + i1 + '/label', schemaPath: '#/properties/collections/items/properties/label/type', params: { type: 'string' @@ -3872,7 +4240,7 @@ var validate = (function() { if (typeof data2.label_singular !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].label_singular', + dataPath: (dataPath || '') + '/collections/' + i1 + '/label_singular', schemaPath: '#/properties/collections/items/properties/label_singular/type', params: { type: 'string' @@ -3890,7 +4258,7 @@ var validate = (function() { if (typeof data2.description !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].description', + dataPath: (dataPath || '') + '/collections/' + i1 + '/description', schemaPath: '#/properties/collections/items/properties/description/type', params: { type: 'string' @@ -3908,7 +4276,7 @@ var validate = (function() { if (typeof data2.folder !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].folder', + dataPath: (dataPath || '') + '/collections/' + i1 + '/folder', schemaPath: '#/properties/collections/items/properties/folder/type', params: { type: 'string' @@ -3937,7 +4305,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3, schemaPath: '#/properties/collections/items/properties/files/items/required', params: { missingProperty: 'name' @@ -3952,7 +4320,7 @@ var validate = (function() { if (typeof data4.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].name', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/name', schemaPath: '#/properties/collections/items/properties/files/items/properties/name/type', params: { type: 'string' @@ -3969,7 +4337,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3, schemaPath: '#/properties/collections/items/properties/files/items/required', params: { missingProperty: 'label' @@ -3984,7 +4352,7 @@ var validate = (function() { if (typeof data4.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].label', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/label', schemaPath: '#/properties/collections/items/properties/files/items/properties/label/type', params: { type: 'string' @@ -4002,7 +4370,7 @@ var validate = (function() { if (typeof data4.label_singular !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].label_singular', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/label_singular', schemaPath: '#/properties/collections/items/properties/files/items/properties/label_singular/type', params: { type: 'string' @@ -4020,7 +4388,7 @@ var validate = (function() { if (typeof data4.description !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].description', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/description', schemaPath: '#/properties/collections/items/properties/files/items/properties/description/type', params: { type: 'string' @@ -4037,7 +4405,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3, schemaPath: '#/properties/collections/items/properties/files/items/required', params: { missingProperty: 'file' @@ -4052,7 +4420,7 @@ var validate = (function() { if (typeof data4.file !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].file', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/file', schemaPath: '#/properties/collections/items/properties/files/items/properties/file/type', params: { type: 'string' @@ -4070,7 +4438,7 @@ var validate = (function() { if (typeof data4.preview_path !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].preview_path', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/preview_path', schemaPath: '#/properties/collections/items/properties/files/items/properties/preview_path/type', params: { type: 'string' @@ -4088,7 +4456,7 @@ var validate = (function() { if (typeof data4.preview_path_date_field !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].preview_path_date_field', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/preview_path_date_field', schemaPath: '#/properties/collections/items/properties/files/items/properties/preview_path_date_field/type', params: { type: 'string' @@ -4106,7 +4474,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3, schemaPath: '#/properties/collections/items/properties/files/items/required', params: { missingProperty: 'fields' @@ -4122,7 +4490,7 @@ var validate = (function() { if (data5.length < 1) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/minItems', params: { limit: 1 @@ -4145,7 +4513,7 @@ var validate = (function() { valid7 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5, schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/required', params: { missingProperty: 'name' @@ -4160,7 +4528,7 @@ var validate = (function() { if (typeof data6.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].name', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/name', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/name/type', params: { type: 'string' @@ -4178,7 +4546,7 @@ var validate = (function() { if (typeof data6.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].label', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/label', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/label/type', params: { type: 'string' @@ -4196,7 +4564,7 @@ var validate = (function() { if (typeof data6.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].widget', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/widget', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/widget/type', params: { type: 'string' @@ -4214,7 +4582,7 @@ var validate = (function() { if (typeof data6.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].required', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/required', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/required/type', params: { type: 'boolean' @@ -4238,7 +4606,7 @@ var validate = (function() { if (typeof data7 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/i18n', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -4258,7 +4626,7 @@ var validate = (function() { if (typeof data7 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/i18n', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -4279,7 +4647,7 @@ var validate = (function() { } if (!valid8) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/i18n', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/enum', params: { allowedValues: schema8 @@ -4303,7 +4671,7 @@ var validate = (function() { if (!valid7) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/i18n', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf', params: { passingSchemas: passingSchemas7 @@ -4327,7 +4695,7 @@ var validate = (function() { if (typeof data6.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].hint', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/hint', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/hint/type', params: { type: 'string' @@ -4347,7 +4715,7 @@ var validate = (function() { if (data7.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/minItems', params: { limit: 2 @@ -4362,16 +4730,17 @@ var validate = (function() { var valid7; valid8 = true; if (data7.length > 0) { + var data8 = data7[0]; var errs_8 = errors; var errs__8 = errors, prevValid8 = false, valid8 = false, passingSchemas8 = null; var errs_9 = errors; - if (typeof data7[0] !== "string") { + if (typeof data8 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 0, schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -4387,7 +4756,38 @@ var validate = (function() { valid8 = prevValid8 = true; passingSchemas8 = 0; } - var valid9 = true; + var errs_9 = errors; + customRule0.errors = null; + var errs__9 = errors; + var valid9; + customRule0.errors = null; + valid9 = customRule0.call(self, data8, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 0, data7, 0, rootData); + if (!valid9) { + if (Array.isArray(customRule0.errors)) { + if (vErrors === null) vErrors = customRule0.errors; + else vErrors = vErrors.concat(customRule0.errors); + errors = vErrors.length; + for (var i9 = errs__9; i9 < errors; i9++) { + var ruleErr9 = vErrors[i9]; + if (ruleErr9.dataPath === undefined) ruleErr9.dataPath = (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 0; + ruleErr9.schemaPath = "#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof"; + } + } else { + var err = { + keyword: 'instanceof', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 0, + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof', + params: { + keyword: 'instanceof' + }, + message: 'should pass "instanceof" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid9 = errors === errs_9; if (valid9 && prevValid8) { valid8 = false; passingSchemas8 = [passingSchemas8, 1]; @@ -4400,7 +4800,7 @@ var validate = (function() { if (!valid8) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 0, schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas8 @@ -4425,7 +4825,7 @@ var validate = (function() { if (typeof data7[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 1, schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/1/type', params: { type: 'string' @@ -4441,7 +4841,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/type', params: { type: 'array' @@ -4456,7 +4856,7 @@ var validate = (function() { } if (data6.field !== undefined) { var errs_7 = errors; - if (!refVal1(data6.field, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].field', data6, 'field', rootData)) { + if (!refVal1(data6.field, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/field', data6, 'field', rootData)) { if (vErrors === null) vErrors = refVal1.errors; else vErrors = vErrors.concat(refVal1.errors); errors = vErrors.length; @@ -4465,7 +4865,7 @@ var validate = (function() { } if (data6.fields !== undefined) { var errs_7 = errors; - if (!refVal[2](data6.fields, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].fields', data6, 'fields', rootData)) { + if (!refVal[2](data6.fields, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/fields', data6, 'fields', rootData)) { if (vErrors === null) vErrors = refVal[2].errors; else vErrors = vErrors.concat(refVal[2].errors); errors = vErrors.length; @@ -4474,7 +4874,7 @@ var validate = (function() { } if (data6.types !== undefined) { var errs_7 = errors; - if (!refVal[2](data6.types, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].types', data6, 'types', rootData)) { + if (!refVal[2](data6.types, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/types', data6, 'types', rootData)) { if (vErrors === null) vErrors = refVal[2].errors; else vErrors = vErrors.concat(refVal[2].errors); errors = vErrors.length; @@ -4484,7 +4884,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5, schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/type', params: { type: 'object' @@ -4495,12 +4895,87 @@ var validate = (function() { else vErrors.push(err); errors++; } + var schema6 = data6 && data6.widget; + var definition6 = RULES.custom['select'].definition; + var keywordValidate6 = definition6.validate; + keywordValidate6.errors = null; + var errs__6 = errors; + var valid6; + if (schema6 === undefined) { + valid6 = true; + } else { + valid6 = definition6.validateSchema(schema6); + if (valid6) { + keywordValidate6.errors = null; + valid6 = keywordValidate6.call(self, schema6, data6, validate.schema.properties.collections.items.properties.files.items.properties.fields.items, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5, data5, i5, rootData); + } + } + if (!valid6) { + if (Array.isArray(keywordValidate6.errors)) { + if (vErrors === null) vErrors = keywordValidate6.errors; + else vErrors = vErrors.concat(keywordValidate6.errors); + errors = vErrors.length; + for (var i6 = errs__6; i6 < errors; i6++) { + var ruleErr6 = vErrors[i6]; + if (ruleErr6.dataPath === undefined) ruleErr6.dataPath = (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5; + ruleErr6.schemaPath = "#/properties/collections/items/properties/files/items/properties/fields/items/select"; + } + } else { + var err = { + keyword: 'select', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5, + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/select', + params: { + keyword: 'select' + }, + message: 'should pass "select" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + customRule6.errors = null; + var errs__6 = errors; + var valid6; + customRule6.errors = null; + valid6 = customRule6.call(self, data6, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5, data5, i5, rootData); var valid6 = errors === errs_6; } + customRule7.errors = null; + var errs__5 = errors; + var valid5; + customRule7.errors = null; + valid5 = customRule7.call(self, data5, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields', data4, 'fields', rootData); + if (!valid5) { + if (Array.isArray(customRule7.errors)) { + if (vErrors === null) vErrors = customRule7.errors; + else vErrors = vErrors.concat(customRule7.errors); + errors = vErrors.length; + for (var i5 = errs__5; i5 < errors; i5++) { + var ruleErr5 = vErrors[i5]; + if (ruleErr5.dataPath === undefined) ruleErr5.dataPath = (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields'; + ruleErr5.schemaPath = "#/properties/collections/items/properties/files/items/properties/fields/uniqueItemProperties"; + } + } else { + var err = { + keyword: 'uniqueItemProperties', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields', + schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/uniqueItemProperties', + params: { + keyword: 'uniqueItemProperties' + }, + message: 'should pass "uniqueItemProperties" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/type', params: { type: 'array' @@ -4516,7 +4991,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3, schemaPath: '#/properties/collections/items/properties/files/items/type', params: { type: 'object' @@ -4529,10 +5004,40 @@ var validate = (function() { } var valid4 = errors === errs_4; } + customRule8.errors = null; + var errs__3 = errors; + var valid3; + customRule8.errors = null; + valid3 = customRule8.call(self, data3, (dataPath || '') + '/collections/' + i1 + '/files', data2, 'files', rootData); + if (!valid3) { + if (Array.isArray(customRule8.errors)) { + if (vErrors === null) vErrors = customRule8.errors; + else vErrors = vErrors.concat(customRule8.errors); + errors = vErrors.length; + for (var i3 = errs__3; i3 < errors; i3++) { + var ruleErr3 = vErrors[i3]; + if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '/collections/' + i1 + '/files'; + ruleErr3.schemaPath = "#/properties/collections/items/properties/files/uniqueItemProperties"; + } + } else { + var err = { + keyword: 'uniqueItemProperties', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files', + schemaPath: '#/properties/collections/items/properties/files/uniqueItemProperties', + params: { + keyword: 'uniqueItemProperties' + }, + message: 'should pass "uniqueItemProperties" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files', + dataPath: (dataPath || '') + '/collections/' + i1 + '/files', schemaPath: '#/properties/collections/items/properties/files/type', params: { type: 'array' @@ -4550,7 +5055,7 @@ var validate = (function() { if (typeof data2.identifier_field !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].identifier_field', + dataPath: (dataPath || '') + '/collections/' + i1 + '/identifier_field', schemaPath: '#/properties/collections/items/properties/identifier_field/type', params: { type: 'string' @@ -4568,7 +5073,7 @@ var validate = (function() { if (typeof data2.summary !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].summary', + dataPath: (dataPath || '') + '/collections/' + i1 + '/summary', schemaPath: '#/properties/collections/items/properties/summary/type', params: { type: 'string' @@ -4586,7 +5091,7 @@ var validate = (function() { if (typeof data2.slug !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].slug', + dataPath: (dataPath || '') + '/collections/' + i1 + '/slug', schemaPath: '#/properties/collections/items/properties/slug/type', params: { type: 'string' @@ -4604,7 +5109,7 @@ var validate = (function() { if (typeof data2.path !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].path', + dataPath: (dataPath || '') + '/collections/' + i1 + '/path', schemaPath: '#/properties/collections/items/properties/path/type', params: { type: 'string' @@ -4622,7 +5127,7 @@ var validate = (function() { if (typeof data2.preview_path !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].preview_path', + dataPath: (dataPath || '') + '/collections/' + i1 + '/preview_path', schemaPath: '#/properties/collections/items/properties/preview_path/type', params: { type: 'string' @@ -4640,7 +5145,7 @@ var validate = (function() { if (typeof data2.preview_path_date_field !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].preview_path_date_field', + dataPath: (dataPath || '') + '/collections/' + i1 + '/preview_path_date_field', schemaPath: '#/properties/collections/items/properties/preview_path_date_field/type', params: { type: 'string' @@ -4658,7 +5163,7 @@ var validate = (function() { if (typeof data2.create !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].create', + dataPath: (dataPath || '') + '/collections/' + i1 + '/create', schemaPath: '#/properties/collections/items/properties/create/type', params: { type: 'boolean' @@ -4676,7 +5181,7 @@ var validate = (function() { if (typeof data2.publish !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].publish', + dataPath: (dataPath || '') + '/collections/' + i1 + '/publish', schemaPath: '#/properties/collections/items/properties/publish/type', params: { type: 'boolean' @@ -4694,7 +5199,7 @@ var validate = (function() { if (typeof data2.hide !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].hide', + dataPath: (dataPath || '') + '/collections/' + i1 + '/hide', schemaPath: '#/properties/collections/items/properties/hide/type', params: { type: 'boolean' @@ -4718,7 +5223,7 @@ var validate = (function() { if (typeof data3.preview !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].editor.preview', + dataPath: (dataPath || '') + '/collections/' + i1 + '/editor/preview', schemaPath: '#/properties/collections/items/properties/editor/properties/preview/type', params: { type: 'boolean' @@ -4734,7 +5239,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].editor', + dataPath: (dataPath || '') + '/collections/' + i1 + '/editor', schemaPath: '#/properties/collections/items/properties/editor/type', params: { type: 'object' @@ -4753,7 +5258,7 @@ var validate = (function() { if (typeof data3 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].format', + dataPath: (dataPath || '') + '/collections/' + i1 + '/format', schemaPath: '#/properties/collections/items/properties/format/type', params: { type: 'string' @@ -4774,7 +5279,7 @@ var validate = (function() { } if (!valid3) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].format', + dataPath: (dataPath || '') + '/collections/' + i1 + '/format', schemaPath: '#/properties/collections/items/properties/format/enum', params: { allowedValues: schema3 @@ -4792,7 +5297,7 @@ var validate = (function() { if (typeof data2.extension !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].extension', + dataPath: (dataPath || '') + '/collections/' + i1 + '/extension', schemaPath: '#/properties/collections/items/properties/extension/type', params: { type: 'string' @@ -4811,7 +5316,7 @@ var validate = (function() { if (typeof data3 !== "string" && !Array.isArray(data3)) { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', + dataPath: (dataPath || '') + '/collections/' + i1 + '/frontmatter_delimiter', schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/type', params: { type: 'string,array' @@ -4826,7 +5331,7 @@ var validate = (function() { if (data3.length > 2) { var err = { keyword: 'maxItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', + dataPath: (dataPath || '') + '/collections/' + i1 + '/frontmatter_delimiter', schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/maxItems', params: { limit: 2 @@ -4840,7 +5345,7 @@ var validate = (function() { if (data3.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', + dataPath: (dataPath || '') + '/collections/' + i1 + '/frontmatter_delimiter', schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/minItems', params: { limit: 2 @@ -4858,7 +5363,7 @@ var validate = (function() { if (typeof data3[i3] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/frontmatter_delimiter/' + i3, schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/items/type', params: { type: 'string' @@ -4881,7 +5386,7 @@ var validate = (function() { if (data3.length < 1) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields', schemaPath: '#/properties/collections/items/properties/fields/minItems', params: { limit: 1 @@ -4904,7 +5409,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3, schemaPath: '#/properties/collections/items/properties/fields/items/required', params: { missingProperty: 'name' @@ -4919,7 +5424,7 @@ var validate = (function() { if (typeof data4.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].name', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/name', schemaPath: '#/properties/collections/items/properties/fields/items/properties/name/type', params: { type: 'string' @@ -4937,7 +5442,7 @@ var validate = (function() { if (typeof data4.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].label', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/label', schemaPath: '#/properties/collections/items/properties/fields/items/properties/label/type', params: { type: 'string' @@ -4955,7 +5460,7 @@ var validate = (function() { if (typeof data4.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].widget', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/widget', schemaPath: '#/properties/collections/items/properties/fields/items/properties/widget/type', params: { type: 'string' @@ -4973,7 +5478,7 @@ var validate = (function() { if (typeof data4.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].required', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/required', schemaPath: '#/properties/collections/items/properties/fields/items/properties/required/type', params: { type: 'boolean' @@ -4997,7 +5502,7 @@ var validate = (function() { if (typeof data5 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/i18n', schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -5017,7 +5522,7 @@ var validate = (function() { if (typeof data5 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/i18n', schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -5038,7 +5543,7 @@ var validate = (function() { } if (!valid6) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/i18n', schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/enum', params: { allowedValues: schema6 @@ -5062,7 +5567,7 @@ var validate = (function() { if (!valid5) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/i18n', schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf', params: { passingSchemas: passingSchemas5 @@ -5086,7 +5591,7 @@ var validate = (function() { if (typeof data4.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].hint', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/hint', schemaPath: '#/properties/collections/items/properties/fields/items/properties/hint/type', params: { type: 'string' @@ -5106,7 +5611,7 @@ var validate = (function() { if (data5.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern', schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/minItems', params: { limit: 2 @@ -5121,16 +5626,17 @@ var validate = (function() { var valid5; valid6 = true; if (data5.length > 0) { + var data6 = data5[0]; var errs_6 = errors; var errs__6 = errors, prevValid6 = false, valid6 = false, passingSchemas6 = null; var errs_7 = errors; - if (typeof data5[0] !== "string") { + if (typeof data6 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 0, schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -5146,7 +5652,38 @@ var validate = (function() { valid6 = prevValid6 = true; passingSchemas6 = 0; } - var valid7 = true; + var errs_7 = errors; + customRule9.errors = null; + var errs__7 = errors; + var valid7; + customRule9.errors = null; + valid7 = customRule9.call(self, data6, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 0, data5, 0, rootData); + if (!valid7) { + if (Array.isArray(customRule9.errors)) { + if (vErrors === null) vErrors = customRule9.errors; + else vErrors = vErrors.concat(customRule9.errors); + errors = vErrors.length; + for (var i7 = errs__7; i7 < errors; i7++) { + var ruleErr7 = vErrors[i7]; + if (ruleErr7.dataPath === undefined) ruleErr7.dataPath = (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 0; + ruleErr7.schemaPath = "#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof"; + } + } else { + var err = { + keyword: 'instanceof', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 0, + schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof', + params: { + keyword: 'instanceof' + }, + message: 'should pass "instanceof" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + var valid7 = errors === errs_7; if (valid7 && prevValid6) { valid6 = false; passingSchemas6 = [passingSchemas6, 1]; @@ -5159,7 +5696,7 @@ var validate = (function() { if (!valid6) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 0, schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas6 @@ -5184,7 +5721,7 @@ var validate = (function() { if (typeof data5[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 1, schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/1/type', params: { type: 'string' @@ -5200,7 +5737,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern', schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/type', params: { type: 'array' @@ -5215,7 +5752,7 @@ var validate = (function() { } if (data4.field !== undefined) { var errs_5 = errors; - if (!refVal3(data4.field, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].field', data4, 'field', rootData)) { + if (!refVal3(data4.field, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/field', data4, 'field', rootData)) { if (vErrors === null) vErrors = refVal3.errors; else vErrors = vErrors.concat(refVal3.errors); errors = vErrors.length; @@ -5224,7 +5761,7 @@ var validate = (function() { } if (data4.fields !== undefined) { var errs_5 = errors; - if (!refVal[4](data4.fields, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].fields', data4, 'fields', rootData)) { + if (!refVal[4](data4.fields, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/fields', data4, 'fields', rootData)) { if (vErrors === null) vErrors = refVal[4].errors; else vErrors = vErrors.concat(refVal[4].errors); errors = vErrors.length; @@ -5233,7 +5770,7 @@ var validate = (function() { } if (data4.types !== undefined) { var errs_5 = errors; - if (!refVal[4](data4.types, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].types', data4, 'types', rootData)) { + if (!refVal[4](data4.types, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/types', data4, 'types', rootData)) { if (vErrors === null) vErrors = refVal[4].errors; else vErrors = vErrors.concat(refVal[4].errors); errors = vErrors.length; @@ -5243,7 +5780,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3, schemaPath: '#/properties/collections/items/properties/fields/items/type', params: { type: 'object' @@ -5254,12 +5791,87 @@ var validate = (function() { else vErrors.push(err); errors++; } + var schema4 = data4 && data4.widget; + var definition4 = RULES.custom['select'].definition; + var keywordValidate4 = definition4.validate; + keywordValidate4.errors = null; + var errs__4 = errors; + var valid4; + if (schema4 === undefined) { + valid4 = true; + } else { + valid4 = definition4.validateSchema(schema4); + if (valid4) { + keywordValidate4.errors = null; + valid4 = keywordValidate4.call(self, schema4, data4, validate.schema.properties.collections.items.properties.fields.items, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3, data3, i3, rootData); + } + } + if (!valid4) { + if (Array.isArray(keywordValidate4.errors)) { + if (vErrors === null) vErrors = keywordValidate4.errors; + else vErrors = vErrors.concat(keywordValidate4.errors); + errors = vErrors.length; + for (var i4 = errs__4; i4 < errors; i4++) { + var ruleErr4 = vErrors[i4]; + if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '/collections/' + i1 + '/fields/' + i3; + ruleErr4.schemaPath = "#/properties/collections/items/properties/fields/items/select"; + } + } else { + var err = { + keyword: 'select', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3, + schemaPath: '#/properties/collections/items/properties/fields/items/select', + params: { + keyword: 'select' + }, + message: 'should pass "select" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } + customRule15.errors = null; + var errs__4 = errors; + var valid4; + customRule15.errors = null; + valid4 = customRule15.call(self, data4, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3, data3, i3, rootData); var valid4 = errors === errs_4; } + customRule16.errors = null; + var errs__3 = errors; + var valid3; + customRule16.errors = null; + valid3 = customRule16.call(self, data3, (dataPath || '') + '/collections/' + i1 + '/fields', data2, 'fields', rootData); + if (!valid3) { + if (Array.isArray(customRule16.errors)) { + if (vErrors === null) vErrors = customRule16.errors; + else vErrors = vErrors.concat(customRule16.errors); + errors = vErrors.length; + for (var i3 = errs__3; i3 < errors; i3++) { + var ruleErr3 = vErrors[i3]; + if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '/collections/' + i1 + '/fields'; + ruleErr3.schemaPath = "#/properties/collections/items/properties/fields/uniqueItemProperties"; + } + } else { + var err = { + keyword: 'uniqueItemProperties', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields', + schemaPath: '#/properties/collections/items/properties/fields/uniqueItemProperties', + params: { + keyword: 'uniqueItemProperties' + }, + message: 'should pass "uniqueItemProperties" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields', + dataPath: (dataPath || '') + '/collections/' + i1 + '/fields', schemaPath: '#/properties/collections/items/properties/fields/type', params: { type: 'array' @@ -5283,7 +5895,7 @@ var validate = (function() { if (typeof data3[i3] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].sortable_fields[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/sortable_fields/' + i3, schemaPath: '#/properties/collections/items/properties/sortable_fields/items/type', params: { type: 'string' @@ -5299,7 +5911,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].sortable_fields', + dataPath: (dataPath || '') + '/collections/' + i1 + '/sortable_fields', schemaPath: '#/properties/collections/items/properties/sortable_fields/type', params: { type: 'array' @@ -5323,7 +5935,7 @@ var validate = (function() { if (typeof data3[i3] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].sortableFields[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/sortableFields/' + i3, schemaPath: '#/properties/collections/items/properties/sortableFields/items/type', params: { type: 'string' @@ -5339,7 +5951,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].sortableFields', + dataPath: (dataPath || '') + '/collections/' + i1 + '/sortableFields', schemaPath: '#/properties/collections/items/properties/sortableFields/type', params: { type: 'array' @@ -5359,7 +5971,7 @@ var validate = (function() { if (data3.length < 1) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters', schemaPath: '#/properties/collections/items/properties/view_filters/minItems', params: { limit: 1 @@ -5384,7 +5996,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'additionalProperties', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3, schemaPath: '#/properties/collections/items/properties/view_filters/items/additionalProperties', params: { additionalProperty: '' + key4 + '' @@ -5400,7 +6012,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3, schemaPath: '#/properties/collections/items/properties/view_filters/items/required', params: { missingProperty: 'label' @@ -5415,7 +6027,7 @@ var validate = (function() { if (typeof data4.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].label', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3 + '/label', schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/label/type', params: { type: 'string' @@ -5432,7 +6044,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3, schemaPath: '#/properties/collections/items/properties/view_filters/items/required', params: { missingProperty: 'field' @@ -5447,7 +6059,7 @@ var validate = (function() { if (typeof data4.field !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].field', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3 + '/field', schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/field/type', params: { type: 'string' @@ -5465,7 +6077,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3, schemaPath: '#/properties/collections/items/properties/view_filters/items/required', params: { missingProperty: 'pattern' @@ -5485,7 +6097,7 @@ var validate = (function() { if (typeof data5 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3 + '/pattern', schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/0/type', params: { type: 'boolean' @@ -5505,7 +6117,7 @@ var validate = (function() { if (typeof data5 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3 + '/pattern', schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/1/type', params: { type: 'string' @@ -5529,7 +6141,7 @@ var validate = (function() { if (!valid5) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3 + '/pattern', schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf', params: { passingSchemas: passingSchemas5 @@ -5551,7 +6163,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3, schemaPath: '#/properties/collections/items/properties/view_filters/items/type', params: { type: 'object' @@ -5567,7 +6179,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters', schemaPath: '#/properties/collections/items/properties/view_filters/type', params: { type: 'array' @@ -5587,7 +6199,7 @@ var validate = (function() { if (data3.length < 1) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups', schemaPath: '#/properties/collections/items/properties/view_groups/minItems', params: { limit: 1 @@ -5612,7 +6224,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'additionalProperties', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3, schemaPath: '#/properties/collections/items/properties/view_groups/items/additionalProperties', params: { additionalProperty: '' + key4 + '' @@ -5628,7 +6240,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3, schemaPath: '#/properties/collections/items/properties/view_groups/items/required', params: { missingProperty: 'label' @@ -5643,7 +6255,7 @@ var validate = (function() { if (typeof data4.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].label', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3 + '/label', schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/label/type', params: { type: 'string' @@ -5660,7 +6272,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3, schemaPath: '#/properties/collections/items/properties/view_groups/items/required', params: { missingProperty: 'field' @@ -5675,7 +6287,7 @@ var validate = (function() { if (typeof data4.field !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].field', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3 + '/field', schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/field/type', params: { type: 'string' @@ -5693,7 +6305,7 @@ var validate = (function() { if (typeof data4.pattern !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].pattern', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3 + '/pattern', schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/pattern/type', params: { type: 'string' @@ -5709,7 +6321,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3, schemaPath: '#/properties/collections/items/properties/view_groups/items/type', params: { type: 'object' @@ -5725,7 +6337,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups', + dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups', schemaPath: '#/properties/collections/items/properties/view_groups/type', params: { type: 'array' @@ -5749,7 +6361,7 @@ var validate = (function() { valid4 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested', + dataPath: (dataPath || '') + '/collections/' + i1 + '/nested', schemaPath: '#/properties/collections/items/properties/nested/required', params: { missingProperty: 'depth' @@ -5765,7 +6377,7 @@ var validate = (function() { if (data4 > 1000 || data4 !== data4) { var err = { keyword: 'maximum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', + dataPath: (dataPath || '') + '/collections/' + i1 + '/nested/depth', schemaPath: '#/properties/collections/items/properties/nested/properties/depth/maximum', params: { comparison: '<=', @@ -5781,7 +6393,7 @@ var validate = (function() { if (data4 < 1 || data4 !== data4) { var err = { keyword: 'minimum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', + dataPath: (dataPath || '') + '/collections/' + i1 + '/nested/depth', schemaPath: '#/properties/collections/items/properties/nested/properties/depth/minimum', params: { comparison: '>=', @@ -5797,7 +6409,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', + dataPath: (dataPath || '') + '/collections/' + i1 + '/nested/depth', schemaPath: '#/properties/collections/items/properties/nested/properties/depth/type', params: { type: 'number' @@ -5815,7 +6427,7 @@ var validate = (function() { if (typeof data3.summary !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.summary', + dataPath: (dataPath || '') + '/collections/' + i1 + '/nested/summary', schemaPath: '#/properties/collections/items/properties/nested/properties/summary/type', params: { type: 'string' @@ -5831,7 +6443,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested', + dataPath: (dataPath || '') + '/collections/' + i1 + '/nested', schemaPath: '#/properties/collections/items/properties/nested/type', params: { type: 'object' @@ -5851,7 +6463,7 @@ var validate = (function() { if (Object.keys(data3).length < 1) { var err = { keyword: 'minProperties', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', + dataPath: (dataPath || '') + '/collections/' + i1 + '/meta', schemaPath: '#/properties/collections/items/properties/meta/minProperties', params: { limit: 1 @@ -5870,7 +6482,7 @@ var validate = (function() { valid4 = false; var err = { keyword: 'additionalProperties', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', + dataPath: (dataPath || '') + '/collections/' + i1 + '/meta', schemaPath: '#/properties/collections/items/properties/meta/additionalProperties', params: { additionalProperty: '' + key3 + '' @@ -5892,7 +6504,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', + dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path', schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', params: { missingProperty: 'label' @@ -5907,7 +6519,7 @@ var validate = (function() { if (typeof data4.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.label', + dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path/label', schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/label/type', params: { type: 'string' @@ -5924,7 +6536,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', + dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path', schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', params: { missingProperty: 'widget' @@ -5939,7 +6551,7 @@ var validate = (function() { if (typeof data4.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.widget', + dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path/widget', schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/widget/type', params: { type: 'string' @@ -5956,7 +6568,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', + dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path', schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', params: { missingProperty: 'index_file' @@ -5971,7 +6583,7 @@ var validate = (function() { if (typeof data4.index_file !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.index_file', + dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path/index_file', schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/index_file/type', params: { type: 'string' @@ -5987,7 +6599,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', + dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path', schemaPath: '#/properties/collections/items/properties/meta/properties/path/type', params: { type: 'object' @@ -6003,7 +6615,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', + dataPath: (dataPath || '') + '/collections/' + i1 + '/meta', schemaPath: '#/properties/collections/items/properties/meta/type', params: { type: 'object' @@ -6027,7 +6639,7 @@ var validate = (function() { if (typeof data3 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -6053,7 +6665,7 @@ var validate = (function() { if (typeof data4 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.structure', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/structure', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/type', params: { type: 'string' @@ -6074,7 +6686,7 @@ var validate = (function() { } if (!valid5) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.structure', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/structure', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum', params: { allowedValues: schema5 @@ -6094,7 +6706,7 @@ var validate = (function() { if (data4.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/minItems', params: { limit: 2 @@ -6114,7 +6726,7 @@ var validate = (function() { if (ucs2length(data5) > 10) { var err = { keyword: 'maxLength', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales/' + i5, schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/maxLength', params: { limit: 10 @@ -6128,7 +6740,7 @@ var validate = (function() { if (ucs2length(data5) < 2) { var err = { keyword: 'minLength', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales/' + i5, schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/minLength', params: { limit: 2 @@ -6142,7 +6754,7 @@ var validate = (function() { if (!pattern0.test(data5)) { var err = { keyword: 'pattern', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales/' + i5, schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/pattern', params: { pattern: '^[a-zA-Z-_]+$' @@ -6156,7 +6768,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales/' + i5, schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/type', params: { type: 'string' @@ -6189,7 +6801,7 @@ var validate = (function() { if (!valid5) { var err = { keyword: 'uniqueItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems', params: { i: i, @@ -6204,7 +6816,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/type', params: { type: 'array' @@ -6224,7 +6836,7 @@ var validate = (function() { if (ucs2length(data4) > 10) { var err = { keyword: 'maxLength', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/default_locale', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/maxLength', params: { limit: 10 @@ -6238,7 +6850,7 @@ var validate = (function() { if (ucs2length(data4) < 2) { var err = { keyword: 'minLength', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/default_locale', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/minLength', params: { limit: 2 @@ -6252,7 +6864,7 @@ var validate = (function() { if (!pattern0.test(data4)) { var err = { keyword: 'pattern', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/default_locale', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/pattern', params: { pattern: '^[a-zA-Z-_]+$' @@ -6266,7 +6878,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/default_locale', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/type', params: { type: 'string' @@ -6282,7 +6894,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/type', params: { type: 'object' @@ -6306,7 +6918,7 @@ var validate = (function() { if (!valid3) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', + dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n', schemaPath: '#/properties/collections/items/properties/i18n/oneOf', params: { passingSchemas: passingSchemas3 @@ -6328,7 +6940,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/type', params: { type: 'object' @@ -6343,7 +6955,7 @@ var validate = (function() { var errs_3 = errors; if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { var missing3; - if (((data2.sortable_fields === undefined) && (missing3 = '.sortable_fields')) || ((data2.sortableFields === undefined) && (missing3 = '.sortableFields'))) { + if (((data2.sortable_fields === undefined) && (missing3 = 'sortable_fields')) || ((data2.sortableFields === undefined) && (missing3 = 'sortableFields'))) { var err = {}; if (vErrors === null) vErrors = [err]; else vErrors.push(err); @@ -6355,7 +6967,7 @@ var validate = (function() { if (valid3) { var err = { keyword: 'not', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/not', params: {}, message: 'should NOT be valid' @@ -6379,7 +6991,7 @@ var validate = (function() { if (data2.files === undefined) { var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/oneOf/0/required', params: { missingProperty: 'files' @@ -6401,7 +7013,7 @@ var validate = (function() { if (data2.folder === undefined) { var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/oneOf/1/required', params: { missingProperty: 'folder' @@ -6415,7 +7027,7 @@ var validate = (function() { if (data2.fields === undefined) { var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/oneOf/1/required', params: { missingProperty: 'fields' @@ -6440,7 +7052,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/oneOf', params: { passingSchemas: passingSchemas2 @@ -6512,7 +7124,7 @@ var validate = (function() { if (data2.format === undefined) { var err = { keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/then/else/required', params: { missingProperty: 'format' @@ -6530,7 +7142,7 @@ var validate = (function() { if (!valid3) { var err = { keyword: 'if', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/then/if', params: { failingKeyword: 'else' @@ -6547,7 +7159,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'if', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', + dataPath: (dataPath || '') + '/collections/' + i1, schemaPath: '#/properties/collections/items/if', params: { failingKeyword: 'then' @@ -6560,10 +7172,40 @@ var validate = (function() { } var valid2 = errors === errs_2; } + customRule17.errors = null; + var errs__1 = errors; + var valid1; + customRule17.errors = null; + valid1 = customRule17.call(self, data1, (dataPath || '') + '/collections', data, 'collections', rootData); + if (!valid1) { + if (Array.isArray(customRule17.errors)) { + if (vErrors === null) vErrors = customRule17.errors; + else vErrors = vErrors.concat(customRule17.errors); + errors = vErrors.length; + for (var i1 = errs__1; i1 < errors; i1++) { + var ruleErr1 = vErrors[i1]; + if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '/collections'; + ruleErr1.schemaPath = "#/properties/collections/uniqueItemProperties"; + } + } else { + var err = { + keyword: 'uniqueItemProperties', + dataPath: (dataPath || '') + '/collections', + schemaPath: '#/properties/collections/uniqueItemProperties', + params: { + keyword: 'uniqueItemProperties' + }, + message: 'should pass "uniqueItemProperties" keyword validation' + }; + if (vErrors === null) vErrors = [err]; + else vErrors.push(err); + errors++; + } + } } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.collections', + dataPath: (dataPath || '') + '/collections', schemaPath: '#/properties/collections/type', params: { type: 'array' @@ -6587,7 +7229,7 @@ var validate = (function() { if (typeof data1.preview !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.editor.preview', + dataPath: (dataPath || '') + '/editor/preview', schemaPath: '#/properties/editor/properties/preview/type', params: { type: 'boolean' @@ -6603,7 +7245,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '.editor', + dataPath: (dataPath || '') + '/editor', schemaPath: '#/properties/editor/type', params: { type: 'object' diff --git a/packages/netlify-cms-core/writeValidateSchema.js b/packages/netlify-cms-core/writeValidateSchema.js deleted file mode 100644 index cc92938a69d6..000000000000 --- a/packages/netlify-cms-core/writeValidateSchema.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -const fs = require("fs") -const path = require("path") -const AJV = require('ajv'); -const ajvErrors = require('ajv-errors'); -const ajv = new AJV({ - allErrors: true, - $data: true, - code: { source: true }, - strict: false -}); -const { - select, - uniqueItemProperties, - prohibited, -} = require('ajv-keywords/dist/keywords'); -const standaloneCode = require("ajv/dist/standalone").default - -const schema = require('./config.schema.json'); - -uniqueItemProperties(ajv); -select(ajv); -prohibited(ajv); -ajvErrors(ajv); - -// 1. generate module with a single default export (CommonJS and ESM compatible): -const validate = ajv.compile(schema) -let moduleCode = standaloneCode(ajv, validate) - -// 2. pass map of schema IDs to generate multiple exports, -// it avoids code duplication if schemas are mutually recursive or have some share elements: -moduleCode = standaloneCode(ajv, { - validateObject: "https://netlify-cms/object.json", -}) - -// 3. or generate module with all schemas added to the instance (excluding meta-schemas), -// export names would use schema IDs (or keys passed to addSchema method): -moduleCode = standaloneCode(ajv); - -console.dir({moduleCode}) - -fs.writeFileSync(path.join(__dirname, "./src/constants/validateSchema.js"), moduleCode) \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index e226bb4da119..f5d05175d578 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4476,28 +4476,16 @@ ajv-cli@3.1.0: json-schema-migrate "^0.2.0" minimist "^1.2.0" -ajv-errors@^1.0.0: +ajv-errors@1.0.1, ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== -ajv-errors@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-3.0.0.tgz#e54f299f3a3d30fe144161e5f0d8d51196c527bc" - integrity sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ== - -ajv-keywords@^3.1.0, ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: +ajv-keywords@3.5.2, ajv-keywords@^3.1.0, ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv-keywords@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" - integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== - dependencies: - fast-deep-equal "^3.1.3" - ajv-pack@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/ajv-pack/-/ajv-pack-0.3.1.tgz#b72c4d4219e3928e62842d742ded93bf50796560" @@ -4506,14 +4494,14 @@ ajv-pack@^0.3.0: js-beautify "^1.6.4" require-from-string "^1.2.0" -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== +ajv@6.12.6, ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6, ajv@^6.7.0: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== dependencies: fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" uri-js "^4.2.2" ajv@^5.0.0: @@ -4526,16 +4514,6 @@ ajv@^5.0.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6, ajv@^6.7.0: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - ajv@^8.0.1: version "8.8.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb" From 93d40385d28bbe4083a7ee8ddf4174670190ae61 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Tue, 4 Jan 2022 12:45:36 -0800 Subject: [PATCH 07/20] chore(csp): removed ajv-errors because it's not used --- packages/netlify-cms-core/package.json | 3 +-- packages/netlify-cms-core/src/constants/configSchema.js | 2 -- yarn.lock | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index 3e8561e7fa57..dd7000f56709 100644 --- a/packages/netlify-cms-core/package.json +++ b/packages/netlify-cms-core/package.json @@ -17,7 +17,7 @@ "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\"", - "write-validate-schema": "NODE_ENV=production ajv compile --json-pointers --all-errors --data -c ajv-keywords/keywords/select -c ajv-keywords/keywords/instanceOf -c ajv-keywords/keywords/prohibited -c ajv-keywords/keywords/uniqueItemProperties -c ajv-errors -s ./config.schema.json -o ./src/constants/staticValidateConfig.js" + "write-validate-schema": "NODE_ENV=production ajv compile --json-pointers --all-errors --data -c ajv-keywords/keywords/select -c ajv-keywords/keywords/instanceOf -c ajv-keywords/keywords/prohibited -c ajv-keywords/keywords/uniqueItemProperties -s ./config.schema.json -o ./src/constants/staticValidateConfig.js" }, "keywords": [ "netlify", @@ -28,7 +28,6 @@ "dependencies": { "@iarna/toml": "2.2.5", "ajv": "6.12.6", - "ajv-errors": "1.0.1", "ajv-keywords": "3.5.2", "copy-text-to-clipboard": "^3.0.0", "deepmerge": "^4.2.2", diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index 688e4bf15f61..e945c779add6 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -5,7 +5,6 @@ import { instanceof as instanceOf, prohibited, } from 'ajv-keywords/dist/keywords'; -import ajvErrors from 'ajv-errors'; import uuid from 'uuid/v4'; import { set } from 'lodash/fp' @@ -136,7 +135,6 @@ function dynamicValidateConfig(config) { select(ajv); instanceOf(ajv); prohibited(ajv); - ajvErrors(ajv); const valid = ajv.validate(getConfigSchema(), config); dynamicValidateConfig.errors = ajv.errors; diff --git a/yarn.lock b/yarn.lock index f5d05175d578..3726b313a329 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4476,7 +4476,7 @@ ajv-cli@3.1.0: json-schema-migrate "^0.2.0" minimist "^1.2.0" -ajv-errors@1.0.1, ajv-errors@^1.0.0: +ajv-errors@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== From 7b9063724ac2b033c145711053b40e94e9dd4df3 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Thu, 6 Jan 2022 08:05:31 -0800 Subject: [PATCH 08/20] chore(csp): efore upgraing to AJV 8 --- package.json | 6 +- packages/netlify-cms-core/package.json | 4 +- .../constants/__tests__/configSchema.spec.js | 4 +- .../src/constants/configSchema.js | 17 +- .../src/constants/staticValidateConfig.js | 640 +++++++++--------- yarn.lock | 12 +- 6 files changed, 345 insertions(+), 338 deletions(-) diff --git a/package.json b/package.json index 864ea1a98411..7be83b38d703 100644 --- a/package.json +++ b/package.json @@ -172,7 +172,11 @@ ], "nohoist": [ "husky", - "run-node" + "run-node", + "netlify-cms-core/ajv", + "netlify-cms-core/ajv-cli", + "netlify-cms-core/ajv-keywords", + "netlify-cms-core/**/ajv-pack" ] }, "private": true, diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index dd7000f56709..feb86f986883 100644 --- a/packages/netlify-cms-core/package.json +++ b/packages/netlify-cms-core/package.json @@ -17,7 +17,7 @@ "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\"", - "write-validate-schema": "NODE_ENV=production ajv compile --json-pointers --all-errors --data -c ajv-keywords/keywords/select -c ajv-keywords/keywords/instanceOf -c ajv-keywords/keywords/prohibited -c ajv-keywords/keywords/uniqueItemProperties -s ./config.schema.json -o ./src/constants/staticValidateConfig.js" + "write-validate-schema": "NODE_ENV=production ajv -c ajv-keywords compile --all-errors --data -s ./config.schema.json -o ./src/constants/staticValidateConfig.js" }, "keywords": [ "netlify", @@ -95,7 +95,7 @@ "@types/history": "^4.7.8", "@types/redux-mock-store": "^1.0.2", "@types/url-join": "^4.0.0", - "ajv-cli": "3.1.0", + "ajv-cli": "^3.3.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 9e79d9189102..0d1ddbd5dbbb 100644 --- a/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js +++ b/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js @@ -31,13 +31,13 @@ describe('static config validation', () => { ], }; - it('should not throw if no errors', () => { + it.only('should not throw if no errors', () => { expect(() => { validateConfig(validConfig); }).not.toThrowError(); }); - it.only('should throw if backend is not defined in config', () => { + it('should throw if backend is not defined in config', () => { expect(() => { validateConfig({ foo: 'bar' }); }).toThrowError("config must have required property 'backend'"); diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index e945c779add6..c7ee0dfe153e 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -1,10 +1,9 @@ import AJV from 'ajv'; -import { - select, - uniqueItemProperties, - instanceof as instanceOf, - prohibited, -} from 'ajv-keywords/dist/keywords'; +import { select } from 'ajv-keywords/keywords/select' +import { uniqueItemProperties } from 'ajv-keywords/keywords/uniqueItemProperties' +import { instanceof as instanceOf } from 'ajv-keywords/keywords/instanceof' +import { prohibited } from 'ajv-keywords/keywords/prohibited' + import uuid from 'uuid/v4'; import { set } from 'lodash/fp' @@ -104,8 +103,10 @@ class ConfigError extends Error { constructor(errors, ...args) { console.log('errors', errors) const message = errors - .map(({ message, instancePath }) => { - const dotPath = instancePath + .map(({ message, instancePath, dataPath }) => { + // taras: I'm 100% sure why instancePath is not available, but dataPath seems to have + // information about location + const dotPath = (instancePath || dataPath) .slice(1) .split('/') .map(seg => (seg.match(/^\d+$/) ? `[${seg}]` : `.${seg}`)) diff --git a/packages/netlify-cms-core/src/constants/staticValidateConfig.js b/packages/netlify-cms-core/src/constants/staticValidateConfig.js index 24784520941b..196072e298ec 100644 --- a/packages/netlify-cms-core/src/constants/staticValidateConfig.js +++ b/packages/netlify-cms-core/src/constants/staticValidateConfig.js @@ -34,7 +34,7 @@ var validate = (function() { if (typeof data.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/name', + dataPath: (dataPath || '') + '.name', schemaPath: '#/properties/name/type', params: { type: 'string' @@ -52,7 +52,7 @@ var validate = (function() { if (typeof data.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/label', + dataPath: (dataPath || '') + '.label', schemaPath: '#/properties/label/type', params: { type: 'string' @@ -70,7 +70,7 @@ var validate = (function() { if (typeof data.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/widget', + dataPath: (dataPath || '') + '.widget', schemaPath: '#/properties/widget/type', params: { type: 'string' @@ -88,7 +88,7 @@ var validate = (function() { if (typeof data.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/required', + dataPath: (dataPath || '') + '.required', schemaPath: '#/properties/required/type', params: { type: 'boolean' @@ -112,7 +112,7 @@ var validate = (function() { if (typeof data1 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/i18n', + dataPath: (dataPath || '') + '.i18n', schemaPath: '#/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -132,7 +132,7 @@ var validate = (function() { if (typeof data1 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/i18n', + dataPath: (dataPath || '') + '.i18n', schemaPath: '#/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -153,7 +153,7 @@ var validate = (function() { } if (!valid2) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/i18n', + dataPath: (dataPath || '') + '.i18n', schemaPath: '#/properties/i18n/oneOf/1/enum', params: { allowedValues: schema2 @@ -177,7 +177,7 @@ var validate = (function() { if (!valid1) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/i18n', + dataPath: (dataPath || '') + '.i18n', schemaPath: '#/properties/i18n/oneOf', params: { passingSchemas: passingSchemas1 @@ -201,7 +201,7 @@ var validate = (function() { if (typeof data.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/hint', + dataPath: (dataPath || '') + '.hint', schemaPath: '#/properties/hint/type', params: { type: 'string' @@ -221,7 +221,7 @@ var validate = (function() { if (data1.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/pattern', + dataPath: (dataPath || '') + '.pattern', schemaPath: '#/properties/pattern/minItems', params: { limit: 2 @@ -246,7 +246,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/pattern/' + 0, + dataPath: (dataPath || '') + '.pattern[' + 0 + ']', schemaPath: '#/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -267,7 +267,7 @@ var validate = (function() { var errs__3 = errors; var valid3; customRule1.errors = null; - valid3 = customRule1.call(self, data2, (dataPath || '') + '/pattern/' + 0, data1, 0, rootData); + valid3 = customRule1.call(self, data2, (dataPath || '') + '.pattern[' + 0 + ']', data1, 0, rootData); if (!valid3) { if (Array.isArray(customRule1.errors)) { if (vErrors === null) vErrors = customRule1.errors; @@ -275,13 +275,13 @@ var validate = (function() { errors = vErrors.length; for (var i3 = errs__3; i3 < errors; i3++) { var ruleErr3 = vErrors[i3]; - if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '/pattern/' + 0; + if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '.pattern[' + 0 + ']'; ruleErr3.schemaPath = "#/properties/pattern/items/0/oneOf/1/instanceof"; } } else { var err = { keyword: 'instanceof', - dataPath: (dataPath || '') + '/pattern/' + 0, + dataPath: (dataPath || '') + '.pattern[' + 0 + ']', schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', params: { keyword: 'instanceof' @@ -306,7 +306,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/pattern/' + 0, + dataPath: (dataPath || '') + '.pattern[' + 0 + ']', schemaPath: '#/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas2 @@ -331,7 +331,7 @@ var validate = (function() { if (typeof data1[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/pattern/' + 1, + dataPath: (dataPath || '') + '.pattern[' + 1 + ']', schemaPath: '#/properties/pattern/items/1/type', params: { type: 'string' @@ -347,7 +347,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/pattern', + dataPath: (dataPath || '') + '.pattern', schemaPath: '#/properties/pattern/type', params: { type: 'array' @@ -362,7 +362,7 @@ var validate = (function() { } if (data.field !== undefined) { var errs_1 = errors; - if (!refVal[1](data.field, (dataPath || '') + '/field', data, 'field', rootData)) { + if (!refVal[1](data.field, (dataPath || '') + '.field', data, 'field', rootData)) { if (vErrors === null) vErrors = refVal[1].errors; else vErrors = vErrors.concat(refVal[1].errors); errors = vErrors.length; @@ -371,7 +371,7 @@ var validate = (function() { } if (data.fields !== undefined) { var errs_1 = errors; - if (!refVal2(data.fields, (dataPath || '') + '/fields', data, 'fields', rootData)) { + if (!refVal2(data.fields, (dataPath || '') + '.fields', data, 'fields', rootData)) { if (vErrors === null) vErrors = refVal2.errors; else vErrors = vErrors.concat(refVal2.errors); errors = vErrors.length; @@ -380,7 +380,7 @@ var validate = (function() { } if (data.types !== undefined) { var errs_1 = errors; - if (!refVal[2](data.types, (dataPath || '') + '/types', data, 'types', rootData)) { + if (!refVal[2](data.types, (dataPath || '') + '.types', data, 'types', rootData)) { if (vErrors === null) vErrors = refVal[2].errors; else vErrors = vErrors.concat(refVal[2].errors); errors = vErrors.length; @@ -787,7 +787,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/' + i0, + dataPath: (dataPath || '') + '[' + i0 + ']', schemaPath: '#/items/required', params: { missingProperty: 'name' @@ -802,7 +802,7 @@ var validate = (function() { if (typeof data1.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/name', + dataPath: (dataPath || '') + '[' + i0 + '].name', schemaPath: '#/items/properties/name/type', params: { type: 'string' @@ -820,7 +820,7 @@ var validate = (function() { if (typeof data1.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/label', + dataPath: (dataPath || '') + '[' + i0 + '].label', schemaPath: '#/items/properties/label/type', params: { type: 'string' @@ -838,7 +838,7 @@ var validate = (function() { if (typeof data1.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/widget', + dataPath: (dataPath || '') + '[' + i0 + '].widget', schemaPath: '#/items/properties/widget/type', params: { type: 'string' @@ -856,7 +856,7 @@ var validate = (function() { if (typeof data1.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/required', + dataPath: (dataPath || '') + '[' + i0 + '].required', schemaPath: '#/items/properties/required/type', params: { type: 'boolean' @@ -880,7 +880,7 @@ var validate = (function() { if (typeof data2 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/i18n', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', schemaPath: '#/items/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -900,7 +900,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/i18n', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', schemaPath: '#/items/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -921,7 +921,7 @@ var validate = (function() { } if (!valid3) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/' + i0 + '/i18n', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', schemaPath: '#/items/properties/i18n/oneOf/1/enum', params: { allowedValues: schema3 @@ -945,7 +945,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/' + i0 + '/i18n', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', schemaPath: '#/items/properties/i18n/oneOf', params: { passingSchemas: passingSchemas2 @@ -969,7 +969,7 @@ var validate = (function() { if (typeof data1.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/hint', + dataPath: (dataPath || '') + '[' + i0 + '].hint', schemaPath: '#/items/properties/hint/type', params: { type: 'string' @@ -989,7 +989,7 @@ var validate = (function() { if (data2.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/' + i0 + '/pattern', + dataPath: (dataPath || '') + '[' + i0 + '].pattern', schemaPath: '#/items/properties/pattern/minItems', params: { limit: 2 @@ -1014,7 +1014,7 @@ var validate = (function() { if (typeof data3 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', schemaPath: '#/items/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -1035,7 +1035,7 @@ var validate = (function() { var errs__4 = errors; var valid4; customRule2.errors = null; - valid4 = customRule2.call(self, data3, (dataPath || '') + '/' + i0 + '/pattern/' + 0, data2, 0, rootData); + valid4 = customRule2.call(self, data3, (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', data2, 0, rootData); if (!valid4) { if (Array.isArray(customRule2.errors)) { if (vErrors === null) vErrors = customRule2.errors; @@ -1043,13 +1043,13 @@ var validate = (function() { errors = vErrors.length; for (var i4 = errs__4; i4 < errors; i4++) { var ruleErr4 = vErrors[i4]; - if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '/' + i0 + '/pattern/' + 0; + if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']'; ruleErr4.schemaPath = "#/items/properties/pattern/items/0/oneOf/1/instanceof"; } } else { var err = { keyword: 'instanceof', - dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', params: { keyword: 'instanceof' @@ -1074,7 +1074,7 @@ var validate = (function() { if (!valid3) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', schemaPath: '#/items/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas3 @@ -1099,7 +1099,7 @@ var validate = (function() { if (typeof data2[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 1, + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 1 + ']', schemaPath: '#/items/properties/pattern/items/1/type', params: { type: 'string' @@ -1115,7 +1115,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/pattern', + dataPath: (dataPath || '') + '[' + i0 + '].pattern', schemaPath: '#/items/properties/pattern/type', params: { type: 'array' @@ -1130,7 +1130,7 @@ var validate = (function() { } if (data1.field !== undefined) { var errs_2 = errors; - if (!refVal[1](data1.field, (dataPath || '') + '/' + i0 + '/field', data1, 'field', rootData)) { + if (!refVal[1](data1.field, (dataPath || '') + '[' + i0 + '].field', data1, 'field', rootData)) { if (vErrors === null) vErrors = refVal[1].errors; else vErrors = vErrors.concat(refVal[1].errors); errors = vErrors.length; @@ -1139,7 +1139,7 @@ var validate = (function() { } if (data1.fields !== undefined) { var errs_2 = errors; - if (!refVal[2](data1.fields, (dataPath || '') + '/' + i0 + '/fields', data1, 'fields', rootData)) { + if (!refVal[2](data1.fields, (dataPath || '') + '[' + i0 + '].fields', data1, 'fields', rootData)) { if (vErrors === null) vErrors = refVal[2].errors; else vErrors = vErrors.concat(refVal[2].errors); errors = vErrors.length; @@ -1148,7 +1148,7 @@ var validate = (function() { } if (data1.types !== undefined) { var errs_2 = errors; - if (!refVal[2](data1.types, (dataPath || '') + '/' + i0 + '/types', data1, 'types', rootData)) { + if (!refVal[2](data1.types, (dataPath || '') + '[' + i0 + '].types', data1, 'types', rootData)) { if (vErrors === null) vErrors = refVal[2].errors; else vErrors = vErrors.concat(refVal[2].errors); errors = vErrors.length; @@ -1158,7 +1158,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0, + dataPath: (dataPath || '') + '[' + i0 + ']', schemaPath: '#/items/type', params: { type: 'object' @@ -1181,7 +1181,7 @@ var validate = (function() { valid1 = definition1.validateSchema(schema1); if (valid1) { keywordValidate1.errors = null; - valid1 = keywordValidate1.call(self, schema1, data1, validate.schema.items, (dataPath || '') + '/' + i0, data, i0, rootData); + valid1 = keywordValidate1.call(self, schema1, data1, validate.schema.items, (dataPath || '') + '[' + i0 + ']', data, i0, rootData); } } if (!valid1) { @@ -1191,13 +1191,13 @@ var validate = (function() { errors = vErrors.length; for (var i1 = errs__1; i1 < errors; i1++) { var ruleErr1 = vErrors[i1]; - if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '/' + i0; + if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '[' + i0 + ']'; ruleErr1.schemaPath = "#/items/select"; } } else { var err = { keyword: 'select', - dataPath: (dataPath || '') + '/' + i0, + dataPath: (dataPath || '') + '[' + i0 + ']', schemaPath: '#/items/select', params: { keyword: 'select' @@ -1213,7 +1213,7 @@ var validate = (function() { var errs__1 = errors; var valid1; customRule3.errors = null; - valid1 = customRule3.call(self, data1, (dataPath || '') + '/' + i0, data, i0, rootData); + valid1 = customRule3.call(self, data1, (dataPath || '') + '[' + i0 + ']', data, i0, rootData); var valid1 = errors === errs_1; } customRule4.errors = null; @@ -1602,7 +1602,7 @@ var validate = (function() { if (typeof data.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/name', + dataPath: (dataPath || '') + '.name', schemaPath: '#/properties/name/type', params: { type: 'string' @@ -1620,7 +1620,7 @@ var validate = (function() { if (typeof data.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/label', + dataPath: (dataPath || '') + '.label', schemaPath: '#/properties/label/type', params: { type: 'string' @@ -1638,7 +1638,7 @@ var validate = (function() { if (typeof data.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/widget', + dataPath: (dataPath || '') + '.widget', schemaPath: '#/properties/widget/type', params: { type: 'string' @@ -1656,7 +1656,7 @@ var validate = (function() { if (typeof data.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/required', + dataPath: (dataPath || '') + '.required', schemaPath: '#/properties/required/type', params: { type: 'boolean' @@ -1680,7 +1680,7 @@ var validate = (function() { if (typeof data1 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/i18n', + dataPath: (dataPath || '') + '.i18n', schemaPath: '#/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -1700,7 +1700,7 @@ var validate = (function() { if (typeof data1 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/i18n', + dataPath: (dataPath || '') + '.i18n', schemaPath: '#/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -1721,7 +1721,7 @@ var validate = (function() { } if (!valid2) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/i18n', + dataPath: (dataPath || '') + '.i18n', schemaPath: '#/properties/i18n/oneOf/1/enum', params: { allowedValues: schema2 @@ -1745,7 +1745,7 @@ var validate = (function() { if (!valid1) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/i18n', + dataPath: (dataPath || '') + '.i18n', schemaPath: '#/properties/i18n/oneOf', params: { passingSchemas: passingSchemas1 @@ -1769,7 +1769,7 @@ var validate = (function() { if (typeof data.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/hint', + dataPath: (dataPath || '') + '.hint', schemaPath: '#/properties/hint/type', params: { type: 'string' @@ -1789,7 +1789,7 @@ var validate = (function() { if (data1.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/pattern', + dataPath: (dataPath || '') + '.pattern', schemaPath: '#/properties/pattern/minItems', params: { limit: 2 @@ -1814,7 +1814,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/pattern/' + 0, + dataPath: (dataPath || '') + '.pattern[' + 0 + ']', schemaPath: '#/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -1835,7 +1835,7 @@ var validate = (function() { var errs__3 = errors; var valid3; customRule10.errors = null; - valid3 = customRule10.call(self, data2, (dataPath || '') + '/pattern/' + 0, data1, 0, rootData); + valid3 = customRule10.call(self, data2, (dataPath || '') + '.pattern[' + 0 + ']', data1, 0, rootData); if (!valid3) { if (Array.isArray(customRule10.errors)) { if (vErrors === null) vErrors = customRule10.errors; @@ -1843,13 +1843,13 @@ var validate = (function() { errors = vErrors.length; for (var i3 = errs__3; i3 < errors; i3++) { var ruleErr3 = vErrors[i3]; - if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '/pattern/' + 0; + if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '.pattern[' + 0 + ']'; ruleErr3.schemaPath = "#/properties/pattern/items/0/oneOf/1/instanceof"; } } else { var err = { keyword: 'instanceof', - dataPath: (dataPath || '') + '/pattern/' + 0, + dataPath: (dataPath || '') + '.pattern[' + 0 + ']', schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', params: { keyword: 'instanceof' @@ -1874,7 +1874,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/pattern/' + 0, + dataPath: (dataPath || '') + '.pattern[' + 0 + ']', schemaPath: '#/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas2 @@ -1899,7 +1899,7 @@ var validate = (function() { if (typeof data1[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/pattern/' + 1, + dataPath: (dataPath || '') + '.pattern[' + 1 + ']', schemaPath: '#/properties/pattern/items/1/type', params: { type: 'string' @@ -1915,7 +1915,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/pattern', + dataPath: (dataPath || '') + '.pattern', schemaPath: '#/properties/pattern/type', params: { type: 'array' @@ -1930,7 +1930,7 @@ var validate = (function() { } if (data.field !== undefined) { var errs_1 = errors; - if (!refVal[3](data.field, (dataPath || '') + '/field', data, 'field', rootData)) { + if (!refVal[3](data.field, (dataPath || '') + '.field', data, 'field', rootData)) { if (vErrors === null) vErrors = refVal[3].errors; else vErrors = vErrors.concat(refVal[3].errors); errors = vErrors.length; @@ -1939,7 +1939,7 @@ var validate = (function() { } if (data.fields !== undefined) { var errs_1 = errors; - if (!refVal4(data.fields, (dataPath || '') + '/fields', data, 'fields', rootData)) { + if (!refVal4(data.fields, (dataPath || '') + '.fields', data, 'fields', rootData)) { if (vErrors === null) vErrors = refVal4.errors; else vErrors = vErrors.concat(refVal4.errors); errors = vErrors.length; @@ -1948,7 +1948,7 @@ var validate = (function() { } if (data.types !== undefined) { var errs_1 = errors; - if (!refVal[4](data.types, (dataPath || '') + '/types', data, 'types', rootData)) { + if (!refVal[4](data.types, (dataPath || '') + '.types', data, 'types', rootData)) { if (vErrors === null) vErrors = refVal[4].errors; else vErrors = vErrors.concat(refVal[4].errors); errors = vErrors.length; @@ -2355,7 +2355,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/' + i0, + dataPath: (dataPath || '') + '[' + i0 + ']', schemaPath: '#/items/required', params: { missingProperty: 'name' @@ -2370,7 +2370,7 @@ var validate = (function() { if (typeof data1.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/name', + dataPath: (dataPath || '') + '[' + i0 + '].name', schemaPath: '#/items/properties/name/type', params: { type: 'string' @@ -2388,7 +2388,7 @@ var validate = (function() { if (typeof data1.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/label', + dataPath: (dataPath || '') + '[' + i0 + '].label', schemaPath: '#/items/properties/label/type', params: { type: 'string' @@ -2406,7 +2406,7 @@ var validate = (function() { if (typeof data1.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/widget', + dataPath: (dataPath || '') + '[' + i0 + '].widget', schemaPath: '#/items/properties/widget/type', params: { type: 'string' @@ -2424,7 +2424,7 @@ var validate = (function() { if (typeof data1.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/required', + dataPath: (dataPath || '') + '[' + i0 + '].required', schemaPath: '#/items/properties/required/type', params: { type: 'boolean' @@ -2448,7 +2448,7 @@ var validate = (function() { if (typeof data2 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/i18n', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', schemaPath: '#/items/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -2468,7 +2468,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/i18n', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', schemaPath: '#/items/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -2489,7 +2489,7 @@ var validate = (function() { } if (!valid3) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/' + i0 + '/i18n', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', schemaPath: '#/items/properties/i18n/oneOf/1/enum', params: { allowedValues: schema3 @@ -2513,7 +2513,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/' + i0 + '/i18n', + dataPath: (dataPath || '') + '[' + i0 + '].i18n', schemaPath: '#/items/properties/i18n/oneOf', params: { passingSchemas: passingSchemas2 @@ -2537,7 +2537,7 @@ var validate = (function() { if (typeof data1.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/hint', + dataPath: (dataPath || '') + '[' + i0 + '].hint', schemaPath: '#/items/properties/hint/type', params: { type: 'string' @@ -2557,7 +2557,7 @@ var validate = (function() { if (data2.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/' + i0 + '/pattern', + dataPath: (dataPath || '') + '[' + i0 + '].pattern', schemaPath: '#/items/properties/pattern/minItems', params: { limit: 2 @@ -2582,7 +2582,7 @@ var validate = (function() { if (typeof data3 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', schemaPath: '#/items/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -2603,7 +2603,7 @@ var validate = (function() { var errs__4 = errors; var valid4; customRule11.errors = null; - valid4 = customRule11.call(self, data3, (dataPath || '') + '/' + i0 + '/pattern/' + 0, data2, 0, rootData); + valid4 = customRule11.call(self, data3, (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', data2, 0, rootData); if (!valid4) { if (Array.isArray(customRule11.errors)) { if (vErrors === null) vErrors = customRule11.errors; @@ -2611,13 +2611,13 @@ var validate = (function() { errors = vErrors.length; for (var i4 = errs__4; i4 < errors; i4++) { var ruleErr4 = vErrors[i4]; - if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '/' + i0 + '/pattern/' + 0; + if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']'; ruleErr4.schemaPath = "#/items/properties/pattern/items/0/oneOf/1/instanceof"; } } else { var err = { keyword: 'instanceof', - dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', params: { keyword: 'instanceof' @@ -2642,7 +2642,7 @@ var validate = (function() { if (!valid3) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 0, + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', schemaPath: '#/items/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas3 @@ -2667,7 +2667,7 @@ var validate = (function() { if (typeof data2[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/pattern/' + 1, + dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 1 + ']', schemaPath: '#/items/properties/pattern/items/1/type', params: { type: 'string' @@ -2683,7 +2683,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0 + '/pattern', + dataPath: (dataPath || '') + '[' + i0 + '].pattern', schemaPath: '#/items/properties/pattern/type', params: { type: 'array' @@ -2698,7 +2698,7 @@ var validate = (function() { } if (data1.field !== undefined) { var errs_2 = errors; - if (!refVal[3](data1.field, (dataPath || '') + '/' + i0 + '/field', data1, 'field', rootData)) { + if (!refVal[3](data1.field, (dataPath || '') + '[' + i0 + '].field', data1, 'field', rootData)) { if (vErrors === null) vErrors = refVal[3].errors; else vErrors = vErrors.concat(refVal[3].errors); errors = vErrors.length; @@ -2707,7 +2707,7 @@ var validate = (function() { } if (data1.fields !== undefined) { var errs_2 = errors; - if (!refVal[4](data1.fields, (dataPath || '') + '/' + i0 + '/fields', data1, 'fields', rootData)) { + if (!refVal[4](data1.fields, (dataPath || '') + '[' + i0 + '].fields', data1, 'fields', rootData)) { if (vErrors === null) vErrors = refVal[4].errors; else vErrors = vErrors.concat(refVal[4].errors); errors = vErrors.length; @@ -2716,7 +2716,7 @@ var validate = (function() { } if (data1.types !== undefined) { var errs_2 = errors; - if (!refVal[4](data1.types, (dataPath || '') + '/' + i0 + '/types', data1, 'types', rootData)) { + if (!refVal[4](data1.types, (dataPath || '') + '[' + i0 + '].types', data1, 'types', rootData)) { if (vErrors === null) vErrors = refVal[4].errors; else vErrors = vErrors.concat(refVal[4].errors); errors = vErrors.length; @@ -2726,7 +2726,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/' + i0, + dataPath: (dataPath || '') + '[' + i0 + ']', schemaPath: '#/items/type', params: { type: 'object' @@ -2749,7 +2749,7 @@ var validate = (function() { valid1 = definition1.validateSchema(schema1); if (valid1) { keywordValidate1.errors = null; - valid1 = keywordValidate1.call(self, schema1, data1, validate.schema.items, (dataPath || '') + '/' + i0, data, i0, rootData); + valid1 = keywordValidate1.call(self, schema1, data1, validate.schema.items, (dataPath || '') + '[' + i0 + ']', data, i0, rootData); } } if (!valid1) { @@ -2759,13 +2759,13 @@ var validate = (function() { errors = vErrors.length; for (var i1 = errs__1; i1 < errors; i1++) { var ruleErr1 = vErrors[i1]; - if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '/' + i0; + if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '[' + i0 + ']'; ruleErr1.schemaPath = "#/items/select"; } } else { var err = { keyword: 'select', - dataPath: (dataPath || '') + '/' + i0, + dataPath: (dataPath || '') + '[' + i0 + ']', schemaPath: '#/items/select', params: { keyword: 'select' @@ -2781,7 +2781,7 @@ var validate = (function() { var errs__1 = errors; var valid1; customRule12.errors = null; - valid1 = customRule12.call(self, data1, (dataPath || '') + '/' + i0, data, i0, rootData); + valid1 = customRule12.call(self, data1, (dataPath || '') + '[' + i0 + ']', data, i0, rootData); var valid1 = errors === errs_1; } customRule13.errors = null; @@ -3173,7 +3173,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/backend', + dataPath: (dataPath || '') + '.backend', schemaPath: '#/properties/backend/required', params: { missingProperty: 'name' @@ -3188,7 +3188,7 @@ var validate = (function() { if (typeof data1.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/backend/name', + dataPath: (dataPath || '') + '.backend.name', schemaPath: '#/properties/backend/properties/name/type', params: { type: 'string' @@ -3207,7 +3207,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/backend/auth_scope', + dataPath: (dataPath || '') + '.backend.auth_scope', schemaPath: '#/properties/backend/properties/auth_scope/type', params: { type: 'string' @@ -3228,7 +3228,7 @@ var validate = (function() { } if (!valid2) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/backend/auth_scope', + dataPath: (dataPath || '') + '.backend.auth_scope', schemaPath: '#/properties/backend/properties/auth_scope/enum', params: { allowedValues: schema2 @@ -3248,7 +3248,7 @@ var validate = (function() { if (ucs2length(data2) < 1) { var err = { keyword: 'minLength', - dataPath: (dataPath || '') + '/backend/cms_label_prefix', + dataPath: (dataPath || '') + '.backend.cms_label_prefix', schemaPath: '#/properties/backend/properties/cms_label_prefix/minLength', params: { limit: 1 @@ -3262,7 +3262,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/backend/cms_label_prefix', + dataPath: (dataPath || '') + '.backend.cms_label_prefix', schemaPath: '#/properties/backend/properties/cms_label_prefix/type', params: { type: 'string' @@ -3280,7 +3280,7 @@ var validate = (function() { if (typeof data1.open_authoring !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/backend/open_authoring', + dataPath: (dataPath || '') + '.backend.open_authoring', schemaPath: '#/properties/backend/properties/open_authoring/type', params: { type: 'boolean' @@ -3296,7 +3296,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/backend', + dataPath: (dataPath || '') + '.backend', schemaPath: '#/properties/backend/type', params: { type: 'object' @@ -3320,7 +3320,7 @@ var validate = (function() { if (typeof data1 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/local_backend', + dataPath: (dataPath || '') + '.local_backend', schemaPath: '#/properties/local_backend/oneOf/0/type', params: { type: 'boolean' @@ -3346,7 +3346,7 @@ var validate = (function() { valid3 = false; var err = { keyword: 'additionalProperties', - dataPath: (dataPath || '') + '/local_backend', + dataPath: (dataPath || '') + '.local_backend', schemaPath: '#/properties/local_backend/oneOf/1/additionalProperties', params: { additionalProperty: '' + key2 + '' @@ -3363,7 +3363,7 @@ var validate = (function() { if (typeof data1.url !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/local_backend/url', + dataPath: (dataPath || '') + '.local_backend.url', schemaPath: '#/properties/local_backend/oneOf/1/properties/url/type', params: { type: 'string' @@ -3387,7 +3387,7 @@ var validate = (function() { if (typeof data2[i3] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/local_backend/allowed_hosts/' + i3, + dataPath: (dataPath || '') + '.local_backend.allowed_hosts[' + i3 + ']', schemaPath: '#/properties/local_backend/oneOf/1/properties/allowed_hosts/items/type', params: { type: 'string' @@ -3403,7 +3403,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/local_backend/allowed_hosts', + dataPath: (dataPath || '') + '.local_backend.allowed_hosts', schemaPath: '#/properties/local_backend/oneOf/1/properties/allowed_hosts/type', params: { type: 'array' @@ -3419,7 +3419,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/local_backend', + dataPath: (dataPath || '') + '.local_backend', schemaPath: '#/properties/local_backend/oneOf/1/type', params: { type: 'object' @@ -3443,7 +3443,7 @@ var validate = (function() { if (!valid1) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/local_backend', + dataPath: (dataPath || '') + '.local_backend', schemaPath: '#/properties/local_backend/oneOf', params: { passingSchemas: passingSchemas1 @@ -3467,7 +3467,7 @@ var validate = (function() { if (typeof data.locale !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/locale', + dataPath: (dataPath || '') + '.locale', schemaPath: '#/properties/locale/type', params: { type: 'string' @@ -3491,7 +3491,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/i18n', + dataPath: (dataPath || '') + '.i18n', schemaPath: '#/properties/i18n/required', params: { missingProperty: 'structure' @@ -3506,7 +3506,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/i18n/structure', + dataPath: (dataPath || '') + '.i18n.structure', schemaPath: '#/properties/i18n/properties/structure/type', params: { type: 'string' @@ -3527,7 +3527,7 @@ var validate = (function() { } if (!valid2) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/i18n/structure', + dataPath: (dataPath || '') + '.i18n.structure', schemaPath: '#/properties/i18n/properties/structure/enum', params: { allowedValues: schema2 @@ -3545,7 +3545,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/i18n', + dataPath: (dataPath || '') + '.i18n', schemaPath: '#/properties/i18n/required', params: { missingProperty: 'locales' @@ -3561,7 +3561,7 @@ var validate = (function() { if (data2.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/i18n/locales', + dataPath: (dataPath || '') + '.i18n.locales', schemaPath: '#/properties/i18n/properties/locales/minItems', params: { limit: 2 @@ -3581,7 +3581,7 @@ var validate = (function() { if (ucs2length(data3) > 10) { var err = { keyword: 'maxLength', - dataPath: (dataPath || '') + '/i18n/locales/' + i2, + dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', schemaPath: '#/properties/i18n/properties/locales/items/maxLength', params: { limit: 10 @@ -3595,7 +3595,7 @@ var validate = (function() { if (ucs2length(data3) < 2) { var err = { keyword: 'minLength', - dataPath: (dataPath || '') + '/i18n/locales/' + i2, + dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', schemaPath: '#/properties/i18n/properties/locales/items/minLength', params: { limit: 2 @@ -3609,7 +3609,7 @@ var validate = (function() { if (!pattern0.test(data3)) { var err = { keyword: 'pattern', - dataPath: (dataPath || '') + '/i18n/locales/' + i2, + dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', schemaPath: '#/properties/i18n/properties/locales/items/pattern', params: { pattern: '^[a-zA-Z-_]+$' @@ -3623,7 +3623,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/i18n/locales/' + i2, + dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', schemaPath: '#/properties/i18n/properties/locales/items/type', params: { type: 'string' @@ -3656,7 +3656,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'uniqueItems', - dataPath: (dataPath || '') + '/i18n/locales', + dataPath: (dataPath || '') + '.i18n.locales', schemaPath: '#/properties/i18n/properties/locales/uniqueItems', params: { i: i, @@ -3671,7 +3671,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/i18n/locales', + dataPath: (dataPath || '') + '.i18n.locales', schemaPath: '#/properties/i18n/properties/locales/type', params: { type: 'array' @@ -3691,7 +3691,7 @@ var validate = (function() { if (ucs2length(data2) > 10) { var err = { keyword: 'maxLength', - dataPath: (dataPath || '') + '/i18n/default_locale', + dataPath: (dataPath || '') + '.i18n.default_locale', schemaPath: '#/properties/i18n/properties/default_locale/maxLength', params: { limit: 10 @@ -3705,7 +3705,7 @@ var validate = (function() { if (ucs2length(data2) < 2) { var err = { keyword: 'minLength', - dataPath: (dataPath || '') + '/i18n/default_locale', + dataPath: (dataPath || '') + '.i18n.default_locale', schemaPath: '#/properties/i18n/properties/default_locale/minLength', params: { limit: 2 @@ -3719,7 +3719,7 @@ var validate = (function() { if (!pattern0.test(data2)) { var err = { keyword: 'pattern', - dataPath: (dataPath || '') + '/i18n/default_locale', + dataPath: (dataPath || '') + '.i18n.default_locale', schemaPath: '#/properties/i18n/properties/default_locale/pattern', params: { pattern: '^[a-zA-Z-_]+$' @@ -3733,7 +3733,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/i18n/default_locale', + dataPath: (dataPath || '') + '.i18n.default_locale', schemaPath: '#/properties/i18n/properties/default_locale/type', params: { type: 'string' @@ -3749,7 +3749,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/i18n', + dataPath: (dataPath || '') + '.i18n', schemaPath: '#/properties/i18n/type', params: { type: 'object' @@ -3767,7 +3767,7 @@ var validate = (function() { if (typeof data.site_url !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/site_url', + dataPath: (dataPath || '') + '.site_url', schemaPath: '#/properties/site_url/type', params: { type: 'string' @@ -3785,7 +3785,7 @@ var validate = (function() { if (typeof data.display_url !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/display_url', + dataPath: (dataPath || '') + '.display_url', schemaPath: '#/properties/display_url/type', params: { type: 'string' @@ -3803,7 +3803,7 @@ var validate = (function() { if (typeof data.logo_url !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/logo_url', + dataPath: (dataPath || '') + '.logo_url', schemaPath: '#/properties/logo_url/type', params: { type: 'string' @@ -3821,7 +3821,7 @@ var validate = (function() { if (typeof data.show_preview_links !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/show_preview_links', + dataPath: (dataPath || '') + '.show_preview_links', schemaPath: '#/properties/show_preview_links/type', params: { type: 'boolean' @@ -3839,7 +3839,7 @@ var validate = (function() { if (typeof data.media_folder !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/media_folder', + dataPath: (dataPath || '') + '.media_folder', schemaPath: '#/properties/media_folder/type', params: { type: 'string' @@ -3857,7 +3857,7 @@ var validate = (function() { if (typeof data.public_folder !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/public_folder', + dataPath: (dataPath || '') + '.public_folder', schemaPath: '#/properties/public_folder/type', params: { type: 'string' @@ -3875,7 +3875,7 @@ var validate = (function() { if (typeof data.media_folder_relative !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/media_folder_relative', + dataPath: (dataPath || '') + '.media_folder_relative', schemaPath: '#/properties/media_folder_relative/type', params: { type: 'boolean' @@ -3898,7 +3898,7 @@ var validate = (function() { valid2 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/media_library', + dataPath: (dataPath || '') + '.media_library', schemaPath: '#/properties/media_library/required', params: { missingProperty: 'name' @@ -3913,7 +3913,7 @@ var validate = (function() { if (typeof data1.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/media_library/name', + dataPath: (dataPath || '') + '.media_library.name', schemaPath: '#/properties/media_library/properties/name/type', params: { type: 'string' @@ -3932,7 +3932,7 @@ var validate = (function() { if ((!data2 || typeof data2 !== "object" || Array.isArray(data2))) { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/media_library/config', + dataPath: (dataPath || '') + '.media_library.config', schemaPath: '#/properties/media_library/properties/config/type', params: { type: 'object' @@ -3948,7 +3948,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/media_library', + dataPath: (dataPath || '') + '.media_library', schemaPath: '#/properties/media_library/type', params: { type: 'object' @@ -3967,7 +3967,7 @@ var validate = (function() { if (typeof data1 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/publish_mode', + dataPath: (dataPath || '') + '.publish_mode', schemaPath: '#/properties/publish_mode/type', params: { type: 'string' @@ -3988,7 +3988,7 @@ var validate = (function() { } if (!valid1) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/publish_mode', + dataPath: (dataPath || '') + '.publish_mode', schemaPath: '#/properties/publish_mode/enum', params: { allowedValues: schema1 @@ -4013,7 +4013,7 @@ var validate = (function() { if (typeof data2 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/slug/encoding', + dataPath: (dataPath || '') + '.slug.encoding', schemaPath: '#/properties/slug/properties/encoding/type', params: { type: 'string' @@ -4034,7 +4034,7 @@ var validate = (function() { } if (!valid2) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/slug/encoding', + dataPath: (dataPath || '') + '.slug.encoding', schemaPath: '#/properties/slug/properties/encoding/enum', params: { allowedValues: schema2 @@ -4052,7 +4052,7 @@ var validate = (function() { if (typeof data1.clean_accents !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/slug/clean_accents', + dataPath: (dataPath || '') + '.slug.clean_accents', schemaPath: '#/properties/slug/properties/clean_accents/type', params: { type: 'boolean' @@ -4068,7 +4068,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/slug', + dataPath: (dataPath || '') + '.slug', schemaPath: '#/properties/slug/type', params: { type: 'object' @@ -4102,7 +4102,7 @@ var validate = (function() { if (data1.length < 1) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/collections', + dataPath: (dataPath || '') + '.collections', schemaPath: '#/properties/collections/minItems', params: { limit: 1 @@ -4131,7 +4131,7 @@ var validate = (function() { valid4 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/dependencies/frontmatter_delimiter/required', params: { missingProperty: 'format' @@ -4153,7 +4153,7 @@ var validate = (function() { } if (!valid4) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/collections/' + i1 + '/format', + dataPath: (dataPath || '') + '.collections[' + i1 + '].format', schemaPath: '#/properties/collections/items/dependencies/frontmatter_delimiter/properties/format/enum', params: { allowedValues: schema4 @@ -4175,7 +4175,7 @@ var validate = (function() { valid3 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/required', params: { missingProperty: 'name' @@ -4190,7 +4190,7 @@ var validate = (function() { if (typeof data2.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/name', + dataPath: (dataPath || '') + '.collections[' + i1 + '].name', schemaPath: '#/properties/collections/items/properties/name/type', params: { type: 'string' @@ -4207,7 +4207,7 @@ var validate = (function() { valid3 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/required', params: { missingProperty: 'label' @@ -4222,7 +4222,7 @@ var validate = (function() { if (typeof data2.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/label', + dataPath: (dataPath || '') + '.collections[' + i1 + '].label', schemaPath: '#/properties/collections/items/properties/label/type', params: { type: 'string' @@ -4240,7 +4240,7 @@ var validate = (function() { if (typeof data2.label_singular !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/label_singular', + dataPath: (dataPath || '') + '.collections[' + i1 + '].label_singular', schemaPath: '#/properties/collections/items/properties/label_singular/type', params: { type: 'string' @@ -4258,7 +4258,7 @@ var validate = (function() { if (typeof data2.description !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/description', + dataPath: (dataPath || '') + '.collections[' + i1 + '].description', schemaPath: '#/properties/collections/items/properties/description/type', params: { type: 'string' @@ -4276,7 +4276,7 @@ var validate = (function() { if (typeof data2.folder !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/folder', + dataPath: (dataPath || '') + '.collections[' + i1 + '].folder', schemaPath: '#/properties/collections/items/properties/folder/type', params: { type: 'string' @@ -4305,7 +4305,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/files/items/required', params: { missingProperty: 'name' @@ -4320,7 +4320,7 @@ var validate = (function() { if (typeof data4.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/name', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].name', schemaPath: '#/properties/collections/items/properties/files/items/properties/name/type', params: { type: 'string' @@ -4337,7 +4337,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/files/items/required', params: { missingProperty: 'label' @@ -4352,7 +4352,7 @@ var validate = (function() { if (typeof data4.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/label', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].label', schemaPath: '#/properties/collections/items/properties/files/items/properties/label/type', params: { type: 'string' @@ -4370,7 +4370,7 @@ var validate = (function() { if (typeof data4.label_singular !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/label_singular', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].label_singular', schemaPath: '#/properties/collections/items/properties/files/items/properties/label_singular/type', params: { type: 'string' @@ -4388,7 +4388,7 @@ var validate = (function() { if (typeof data4.description !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/description', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].description', schemaPath: '#/properties/collections/items/properties/files/items/properties/description/type', params: { type: 'string' @@ -4405,7 +4405,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/files/items/required', params: { missingProperty: 'file' @@ -4420,7 +4420,7 @@ var validate = (function() { if (typeof data4.file !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/file', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].file', schemaPath: '#/properties/collections/items/properties/files/items/properties/file/type', params: { type: 'string' @@ -4438,7 +4438,7 @@ var validate = (function() { if (typeof data4.preview_path !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/preview_path', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].preview_path', schemaPath: '#/properties/collections/items/properties/files/items/properties/preview_path/type', params: { type: 'string' @@ -4456,7 +4456,7 @@ var validate = (function() { if (typeof data4.preview_path_date_field !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/preview_path_date_field', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].preview_path_date_field', schemaPath: '#/properties/collections/items/properties/files/items/properties/preview_path_date_field/type', params: { type: 'string' @@ -4474,7 +4474,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/files/items/required', params: { missingProperty: 'fields' @@ -4490,7 +4490,7 @@ var validate = (function() { if (data5.length < 1) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/minItems', params: { limit: 1 @@ -4513,7 +4513,7 @@ var validate = (function() { valid7 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/required', params: { missingProperty: 'name' @@ -4528,7 +4528,7 @@ var validate = (function() { if (typeof data6.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/name', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].name', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/name/type', params: { type: 'string' @@ -4546,7 +4546,7 @@ var validate = (function() { if (typeof data6.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/label', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].label', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/label/type', params: { type: 'string' @@ -4564,7 +4564,7 @@ var validate = (function() { if (typeof data6.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/widget', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].widget', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/widget/type', params: { type: 'string' @@ -4582,7 +4582,7 @@ var validate = (function() { if (typeof data6.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].required', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/required/type', params: { type: 'boolean' @@ -4606,7 +4606,7 @@ var validate = (function() { if (typeof data7 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/i18n', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -4626,7 +4626,7 @@ var validate = (function() { if (typeof data7 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/i18n', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -4647,7 +4647,7 @@ var validate = (function() { } if (!valid8) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/i18n', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/enum', params: { allowedValues: schema8 @@ -4671,7 +4671,7 @@ var validate = (function() { if (!valid7) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/i18n', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf', params: { passingSchemas: passingSchemas7 @@ -4695,7 +4695,7 @@ var validate = (function() { if (typeof data6.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/hint', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].hint', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/hint/type', params: { type: 'string' @@ -4715,7 +4715,7 @@ var validate = (function() { if (data7.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/minItems', params: { limit: 2 @@ -4740,7 +4740,7 @@ var validate = (function() { if (typeof data8 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 0, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -4761,7 +4761,7 @@ var validate = (function() { var errs__9 = errors; var valid9; customRule0.errors = null; - valid9 = customRule0.call(self, data8, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 0, data7, 0, rootData); + valid9 = customRule0.call(self, data8, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', data7, 0, rootData); if (!valid9) { if (Array.isArray(customRule0.errors)) { if (vErrors === null) vErrors = customRule0.errors; @@ -4769,13 +4769,13 @@ var validate = (function() { errors = vErrors.length; for (var i9 = errs__9; i9 < errors; i9++) { var ruleErr9 = vErrors[i9]; - if (ruleErr9.dataPath === undefined) ruleErr9.dataPath = (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 0; + if (ruleErr9.dataPath === undefined) ruleErr9.dataPath = (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']'; ruleErr9.schemaPath = "#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof"; } } else { var err = { keyword: 'instanceof', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 0, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof', params: { keyword: 'instanceof' @@ -4800,7 +4800,7 @@ var validate = (function() { if (!valid8) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 0, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas8 @@ -4825,7 +4825,7 @@ var validate = (function() { if (typeof data7[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern/' + 1, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 1 + ']', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/1/type', params: { type: 'string' @@ -4841,7 +4841,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/pattern', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/type', params: { type: 'array' @@ -4856,7 +4856,7 @@ var validate = (function() { } if (data6.field !== undefined) { var errs_7 = errors; - if (!refVal1(data6.field, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/field', data6, 'field', rootData)) { + if (!refVal1(data6.field, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].field', data6, 'field', rootData)) { if (vErrors === null) vErrors = refVal1.errors; else vErrors = vErrors.concat(refVal1.errors); errors = vErrors.length; @@ -4865,7 +4865,7 @@ var validate = (function() { } if (data6.fields !== undefined) { var errs_7 = errors; - if (!refVal[2](data6.fields, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/fields', data6, 'fields', rootData)) { + if (!refVal[2](data6.fields, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].fields', data6, 'fields', rootData)) { if (vErrors === null) vErrors = refVal[2].errors; else vErrors = vErrors.concat(refVal[2].errors); errors = vErrors.length; @@ -4874,7 +4874,7 @@ var validate = (function() { } if (data6.types !== undefined) { var errs_7 = errors; - if (!refVal[2](data6.types, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5 + '/types', data6, 'types', rootData)) { + if (!refVal[2](data6.types, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].types', data6, 'types', rootData)) { if (vErrors === null) vErrors = refVal[2].errors; else vErrors = vErrors.concat(refVal[2].errors); errors = vErrors.length; @@ -4884,7 +4884,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/type', params: { type: 'object' @@ -4907,7 +4907,7 @@ var validate = (function() { valid6 = definition6.validateSchema(schema6); if (valid6) { keywordValidate6.errors = null; - valid6 = keywordValidate6.call(self, schema6, data6, validate.schema.properties.collections.items.properties.files.items.properties.fields.items, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5, data5, i5, rootData); + valid6 = keywordValidate6.call(self, schema6, data6, validate.schema.properties.collections.items.properties.files.items.properties.fields.items, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', data5, i5, rootData); } } if (!valid6) { @@ -4917,13 +4917,13 @@ var validate = (function() { errors = vErrors.length; for (var i6 = errs__6; i6 < errors; i6++) { var ruleErr6 = vErrors[i6]; - if (ruleErr6.dataPath === undefined) ruleErr6.dataPath = (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5; + if (ruleErr6.dataPath === undefined) ruleErr6.dataPath = (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']'; ruleErr6.schemaPath = "#/properties/collections/items/properties/files/items/properties/fields/items/select"; } } else { var err = { keyword: 'select', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/select', params: { keyword: 'select' @@ -4939,14 +4939,14 @@ var validate = (function() { var errs__6 = errors; var valid6; customRule6.errors = null; - valid6 = customRule6.call(self, data6, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields/' + i5, data5, i5, rootData); + valid6 = customRule6.call(self, data6, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', data5, i5, rootData); var valid6 = errors === errs_6; } customRule7.errors = null; var errs__5 = errors; var valid5; customRule7.errors = null; - valid5 = customRule7.call(self, data5, (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields', data4, 'fields', rootData); + valid5 = customRule7.call(self, data5, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', data4, 'fields', rootData); if (!valid5) { if (Array.isArray(customRule7.errors)) { if (vErrors === null) vErrors = customRule7.errors; @@ -4954,13 +4954,13 @@ var validate = (function() { errors = vErrors.length; for (var i5 = errs__5; i5 < errors; i5++) { var ruleErr5 = vErrors[i5]; - if (ruleErr5.dataPath === undefined) ruleErr5.dataPath = (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields'; + if (ruleErr5.dataPath === undefined) ruleErr5.dataPath = (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields'; ruleErr5.schemaPath = "#/properties/collections/items/properties/files/items/properties/fields/uniqueItemProperties"; } } else { var err = { keyword: 'uniqueItemProperties', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/uniqueItemProperties', params: { keyword: 'uniqueItemProperties' @@ -4975,7 +4975,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3 + '/fields', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/type', params: { type: 'array' @@ -4991,7 +4991,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/files/items/type', params: { type: 'object' @@ -5008,7 +5008,7 @@ var validate = (function() { var errs__3 = errors; var valid3; customRule8.errors = null; - valid3 = customRule8.call(self, data3, (dataPath || '') + '/collections/' + i1 + '/files', data2, 'files', rootData); + valid3 = customRule8.call(self, data3, (dataPath || '') + '.collections[' + i1 + '].files', data2, 'files', rootData); if (!valid3) { if (Array.isArray(customRule8.errors)) { if (vErrors === null) vErrors = customRule8.errors; @@ -5016,13 +5016,13 @@ var validate = (function() { errors = vErrors.length; for (var i3 = errs__3; i3 < errors; i3++) { var ruleErr3 = vErrors[i3]; - if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '/collections/' + i1 + '/files'; + if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '.collections[' + i1 + '].files'; ruleErr3.schemaPath = "#/properties/collections/items/properties/files/uniqueItemProperties"; } } else { var err = { keyword: 'uniqueItemProperties', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files', schemaPath: '#/properties/collections/items/properties/files/uniqueItemProperties', params: { keyword: 'uniqueItemProperties' @@ -5037,7 +5037,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/files', + dataPath: (dataPath || '') + '.collections[' + i1 + '].files', schemaPath: '#/properties/collections/items/properties/files/type', params: { type: 'array' @@ -5055,7 +5055,7 @@ var validate = (function() { if (typeof data2.identifier_field !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/identifier_field', + dataPath: (dataPath || '') + '.collections[' + i1 + '].identifier_field', schemaPath: '#/properties/collections/items/properties/identifier_field/type', params: { type: 'string' @@ -5073,7 +5073,7 @@ var validate = (function() { if (typeof data2.summary !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/summary', + dataPath: (dataPath || '') + '.collections[' + i1 + '].summary', schemaPath: '#/properties/collections/items/properties/summary/type', params: { type: 'string' @@ -5091,7 +5091,7 @@ var validate = (function() { if (typeof data2.slug !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/slug', + dataPath: (dataPath || '') + '.collections[' + i1 + '].slug', schemaPath: '#/properties/collections/items/properties/slug/type', params: { type: 'string' @@ -5109,7 +5109,7 @@ var validate = (function() { if (typeof data2.path !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/path', + dataPath: (dataPath || '') + '.collections[' + i1 + '].path', schemaPath: '#/properties/collections/items/properties/path/type', params: { type: 'string' @@ -5127,7 +5127,7 @@ var validate = (function() { if (typeof data2.preview_path !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/preview_path', + dataPath: (dataPath || '') + '.collections[' + i1 + '].preview_path', schemaPath: '#/properties/collections/items/properties/preview_path/type', params: { type: 'string' @@ -5145,7 +5145,7 @@ var validate = (function() { if (typeof data2.preview_path_date_field !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/preview_path_date_field', + dataPath: (dataPath || '') + '.collections[' + i1 + '].preview_path_date_field', schemaPath: '#/properties/collections/items/properties/preview_path_date_field/type', params: { type: 'string' @@ -5163,7 +5163,7 @@ var validate = (function() { if (typeof data2.create !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/create', + dataPath: (dataPath || '') + '.collections[' + i1 + '].create', schemaPath: '#/properties/collections/items/properties/create/type', params: { type: 'boolean' @@ -5181,7 +5181,7 @@ var validate = (function() { if (typeof data2.publish !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/publish', + dataPath: (dataPath || '') + '.collections[' + i1 + '].publish', schemaPath: '#/properties/collections/items/properties/publish/type', params: { type: 'boolean' @@ -5199,7 +5199,7 @@ var validate = (function() { if (typeof data2.hide !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/hide', + dataPath: (dataPath || '') + '.collections[' + i1 + '].hide', schemaPath: '#/properties/collections/items/properties/hide/type', params: { type: 'boolean' @@ -5223,7 +5223,7 @@ var validate = (function() { if (typeof data3.preview !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/editor/preview', + dataPath: (dataPath || '') + '.collections[' + i1 + '].editor.preview', schemaPath: '#/properties/collections/items/properties/editor/properties/preview/type', params: { type: 'boolean' @@ -5239,7 +5239,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/editor', + dataPath: (dataPath || '') + '.collections[' + i1 + '].editor', schemaPath: '#/properties/collections/items/properties/editor/type', params: { type: 'object' @@ -5258,7 +5258,7 @@ var validate = (function() { if (typeof data3 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/format', + dataPath: (dataPath || '') + '.collections[' + i1 + '].format', schemaPath: '#/properties/collections/items/properties/format/type', params: { type: 'string' @@ -5279,7 +5279,7 @@ var validate = (function() { } if (!valid3) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/collections/' + i1 + '/format', + dataPath: (dataPath || '') + '.collections[' + i1 + '].format', schemaPath: '#/properties/collections/items/properties/format/enum', params: { allowedValues: schema3 @@ -5297,7 +5297,7 @@ var validate = (function() { if (typeof data2.extension !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/extension', + dataPath: (dataPath || '') + '.collections[' + i1 + '].extension', schemaPath: '#/properties/collections/items/properties/extension/type', params: { type: 'string' @@ -5316,7 +5316,7 @@ var validate = (function() { if (typeof data3 !== "string" && !Array.isArray(data3)) { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/frontmatter_delimiter', + dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/type', params: { type: 'string,array' @@ -5331,7 +5331,7 @@ var validate = (function() { if (data3.length > 2) { var err = { keyword: 'maxItems', - dataPath: (dataPath || '') + '/collections/' + i1 + '/frontmatter_delimiter', + dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/maxItems', params: { limit: 2 @@ -5345,7 +5345,7 @@ var validate = (function() { if (data3.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/collections/' + i1 + '/frontmatter_delimiter', + dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/minItems', params: { limit: 2 @@ -5363,7 +5363,7 @@ var validate = (function() { if (typeof data3[i3] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/frontmatter_delimiter/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/items/type', params: { type: 'string' @@ -5386,7 +5386,7 @@ var validate = (function() { if (data3.length < 1) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields', schemaPath: '#/properties/collections/items/properties/fields/minItems', params: { limit: 1 @@ -5409,7 +5409,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/fields/items/required', params: { missingProperty: 'name' @@ -5424,7 +5424,7 @@ var validate = (function() { if (typeof data4.name !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/name', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].name', schemaPath: '#/properties/collections/items/properties/fields/items/properties/name/type', params: { type: 'string' @@ -5442,7 +5442,7 @@ var validate = (function() { if (typeof data4.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/label', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].label', schemaPath: '#/properties/collections/items/properties/fields/items/properties/label/type', params: { type: 'string' @@ -5460,7 +5460,7 @@ var validate = (function() { if (typeof data4.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/widget', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].widget', schemaPath: '#/properties/collections/items/properties/fields/items/properties/widget/type', params: { type: 'string' @@ -5478,7 +5478,7 @@ var validate = (function() { if (typeof data4.required !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/required', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].required', schemaPath: '#/properties/collections/items/properties/fields/items/properties/required/type', params: { type: 'boolean' @@ -5502,7 +5502,7 @@ var validate = (function() { if (typeof data5 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/i18n', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -5522,7 +5522,7 @@ var validate = (function() { if (typeof data5 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/i18n', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/type', params: { type: 'string' @@ -5543,7 +5543,7 @@ var validate = (function() { } if (!valid6) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/i18n', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/enum', params: { allowedValues: schema6 @@ -5567,7 +5567,7 @@ var validate = (function() { if (!valid5) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/i18n', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf', params: { passingSchemas: passingSchemas5 @@ -5591,7 +5591,7 @@ var validate = (function() { if (typeof data4.hint !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/hint', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].hint', schemaPath: '#/properties/collections/items/properties/fields/items/properties/hint/type', params: { type: 'string' @@ -5611,7 +5611,7 @@ var validate = (function() { if (data5.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern', schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/minItems', params: { limit: 2 @@ -5636,7 +5636,7 @@ var validate = (function() { if (typeof data6 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 0, + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type', params: { type: 'string' @@ -5657,7 +5657,7 @@ var validate = (function() { var errs__7 = errors; var valid7; customRule9.errors = null; - valid7 = customRule9.call(self, data6, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 0, data5, 0, rootData); + valid7 = customRule9.call(self, data6, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', data5, 0, rootData); if (!valid7) { if (Array.isArray(customRule9.errors)) { if (vErrors === null) vErrors = customRule9.errors; @@ -5665,13 +5665,13 @@ var validate = (function() { errors = vErrors.length; for (var i7 = errs__7; i7 < errors; i7++) { var ruleErr7 = vErrors[i7]; - if (ruleErr7.dataPath === undefined) ruleErr7.dataPath = (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 0; + if (ruleErr7.dataPath === undefined) ruleErr7.dataPath = (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']'; ruleErr7.schemaPath = "#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof"; } } else { var err = { keyword: 'instanceof', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 0, + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof', params: { keyword: 'instanceof' @@ -5696,7 +5696,7 @@ var validate = (function() { if (!valid6) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 0, + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf', params: { passingSchemas: passingSchemas6 @@ -5721,7 +5721,7 @@ var validate = (function() { if (typeof data5[1] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern/' + 1, + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 1 + ']', schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/1/type', params: { type: 'string' @@ -5737,7 +5737,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/pattern', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern', schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/type', params: { type: 'array' @@ -5752,7 +5752,7 @@ var validate = (function() { } if (data4.field !== undefined) { var errs_5 = errors; - if (!refVal3(data4.field, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/field', data4, 'field', rootData)) { + if (!refVal3(data4.field, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].field', data4, 'field', rootData)) { if (vErrors === null) vErrors = refVal3.errors; else vErrors = vErrors.concat(refVal3.errors); errors = vErrors.length; @@ -5761,7 +5761,7 @@ var validate = (function() { } if (data4.fields !== undefined) { var errs_5 = errors; - if (!refVal[4](data4.fields, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/fields', data4, 'fields', rootData)) { + if (!refVal[4](data4.fields, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].fields', data4, 'fields', rootData)) { if (vErrors === null) vErrors = refVal[4].errors; else vErrors = vErrors.concat(refVal[4].errors); errors = vErrors.length; @@ -5770,7 +5770,7 @@ var validate = (function() { } if (data4.types !== undefined) { var errs_5 = errors; - if (!refVal[4](data4.types, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3 + '/types', data4, 'types', rootData)) { + if (!refVal[4](data4.types, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].types', data4, 'types', rootData)) { if (vErrors === null) vErrors = refVal[4].errors; else vErrors = vErrors.concat(refVal[4].errors); errors = vErrors.length; @@ -5780,7 +5780,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/fields/items/type', params: { type: 'object' @@ -5803,7 +5803,7 @@ var validate = (function() { valid4 = definition4.validateSchema(schema4); if (valid4) { keywordValidate4.errors = null; - valid4 = keywordValidate4.call(self, schema4, data4, validate.schema.properties.collections.items.properties.fields.items, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3, data3, i3, rootData); + valid4 = keywordValidate4.call(self, schema4, data4, validate.schema.properties.collections.items.properties.fields.items, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', data3, i3, rootData); } } if (!valid4) { @@ -5813,13 +5813,13 @@ var validate = (function() { errors = vErrors.length; for (var i4 = errs__4; i4 < errors; i4++) { var ruleErr4 = vErrors[i4]; - if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '/collections/' + i1 + '/fields/' + i3; + if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']'; ruleErr4.schemaPath = "#/properties/collections/items/properties/fields/items/select"; } } else { var err = { keyword: 'select', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/fields/items/select', params: { keyword: 'select' @@ -5835,14 +5835,14 @@ var validate = (function() { var errs__4 = errors; var valid4; customRule15.errors = null; - valid4 = customRule15.call(self, data4, (dataPath || '') + '/collections/' + i1 + '/fields/' + i3, data3, i3, rootData); + valid4 = customRule15.call(self, data4, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', data3, i3, rootData); var valid4 = errors === errs_4; } customRule16.errors = null; var errs__3 = errors; var valid3; customRule16.errors = null; - valid3 = customRule16.call(self, data3, (dataPath || '') + '/collections/' + i1 + '/fields', data2, 'fields', rootData); + valid3 = customRule16.call(self, data3, (dataPath || '') + '.collections[' + i1 + '].fields', data2, 'fields', rootData); if (!valid3) { if (Array.isArray(customRule16.errors)) { if (vErrors === null) vErrors = customRule16.errors; @@ -5850,13 +5850,13 @@ var validate = (function() { errors = vErrors.length; for (var i3 = errs__3; i3 < errors; i3++) { var ruleErr3 = vErrors[i3]; - if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '/collections/' + i1 + '/fields'; + if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '.collections[' + i1 + '].fields'; ruleErr3.schemaPath = "#/properties/collections/items/properties/fields/uniqueItemProperties"; } } else { var err = { keyword: 'uniqueItemProperties', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields', schemaPath: '#/properties/collections/items/properties/fields/uniqueItemProperties', params: { keyword: 'uniqueItemProperties' @@ -5871,7 +5871,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/fields', + dataPath: (dataPath || '') + '.collections[' + i1 + '].fields', schemaPath: '#/properties/collections/items/properties/fields/type', params: { type: 'array' @@ -5895,7 +5895,7 @@ var validate = (function() { if (typeof data3[i3] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/sortable_fields/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].sortable_fields[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/sortable_fields/items/type', params: { type: 'string' @@ -5911,7 +5911,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/sortable_fields', + dataPath: (dataPath || '') + '.collections[' + i1 + '].sortable_fields', schemaPath: '#/properties/collections/items/properties/sortable_fields/type', params: { type: 'array' @@ -5935,7 +5935,7 @@ var validate = (function() { if (typeof data3[i3] !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/sortableFields/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].sortableFields[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/sortableFields/items/type', params: { type: 'string' @@ -5951,7 +5951,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/sortableFields', + dataPath: (dataPath || '') + '.collections[' + i1 + '].sortableFields', schemaPath: '#/properties/collections/items/properties/sortableFields/type', params: { type: 'array' @@ -5971,7 +5971,7 @@ var validate = (function() { if (data3.length < 1) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters', schemaPath: '#/properties/collections/items/properties/view_filters/minItems', params: { limit: 1 @@ -5996,7 +5996,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'additionalProperties', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/view_filters/items/additionalProperties', params: { additionalProperty: '' + key4 + '' @@ -6012,7 +6012,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/view_filters/items/required', params: { missingProperty: 'label' @@ -6027,7 +6027,7 @@ var validate = (function() { if (typeof data4.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3 + '/label', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].label', schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/label/type', params: { type: 'string' @@ -6044,7 +6044,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/view_filters/items/required', params: { missingProperty: 'field' @@ -6059,7 +6059,7 @@ var validate = (function() { if (typeof data4.field !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3 + '/field', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].field', schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/field/type', params: { type: 'string' @@ -6077,7 +6077,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/view_filters/items/required', params: { missingProperty: 'pattern' @@ -6097,7 +6097,7 @@ var validate = (function() { if (typeof data5 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3 + '/pattern', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/0/type', params: { type: 'boolean' @@ -6117,7 +6117,7 @@ var validate = (function() { if (typeof data5 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3 + '/pattern', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/1/type', params: { type: 'string' @@ -6141,7 +6141,7 @@ var validate = (function() { if (!valid5) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3 + '/pattern', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf', params: { passingSchemas: passingSchemas5 @@ -6163,7 +6163,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/view_filters/items/type', params: { type: 'object' @@ -6179,7 +6179,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_filters', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters', schemaPath: '#/properties/collections/items/properties/view_filters/type', params: { type: 'array' @@ -6199,7 +6199,7 @@ var validate = (function() { if (data3.length < 1) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups', schemaPath: '#/properties/collections/items/properties/view_groups/minItems', params: { limit: 1 @@ -6224,7 +6224,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'additionalProperties', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/view_groups/items/additionalProperties', params: { additionalProperty: '' + key4 + '' @@ -6240,7 +6240,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/view_groups/items/required', params: { missingProperty: 'label' @@ -6255,7 +6255,7 @@ var validate = (function() { if (typeof data4.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3 + '/label', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].label', schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/label/type', params: { type: 'string' @@ -6272,7 +6272,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/view_groups/items/required', params: { missingProperty: 'field' @@ -6287,7 +6287,7 @@ var validate = (function() { if (typeof data4.field !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3 + '/field', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].field', schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/field/type', params: { type: 'string' @@ -6305,7 +6305,7 @@ var validate = (function() { if (typeof data4.pattern !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3 + '/pattern', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].pattern', schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/pattern/type', params: { type: 'string' @@ -6321,7 +6321,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups/' + i3, + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', schemaPath: '#/properties/collections/items/properties/view_groups/items/type', params: { type: 'object' @@ -6337,7 +6337,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/view_groups', + dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups', schemaPath: '#/properties/collections/items/properties/view_groups/type', params: { type: 'array' @@ -6361,7 +6361,7 @@ var validate = (function() { valid4 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/nested', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested', schemaPath: '#/properties/collections/items/properties/nested/required', params: { missingProperty: 'depth' @@ -6377,7 +6377,7 @@ var validate = (function() { if (data4 > 1000 || data4 !== data4) { var err = { keyword: 'maximum', - dataPath: (dataPath || '') + '/collections/' + i1 + '/nested/depth', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', schemaPath: '#/properties/collections/items/properties/nested/properties/depth/maximum', params: { comparison: '<=', @@ -6393,7 +6393,7 @@ var validate = (function() { if (data4 < 1 || data4 !== data4) { var err = { keyword: 'minimum', - dataPath: (dataPath || '') + '/collections/' + i1 + '/nested/depth', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', schemaPath: '#/properties/collections/items/properties/nested/properties/depth/minimum', params: { comparison: '>=', @@ -6409,7 +6409,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/nested/depth', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', schemaPath: '#/properties/collections/items/properties/nested/properties/depth/type', params: { type: 'number' @@ -6427,7 +6427,7 @@ var validate = (function() { if (typeof data3.summary !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/nested/summary', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.summary', schemaPath: '#/properties/collections/items/properties/nested/properties/summary/type', params: { type: 'string' @@ -6443,7 +6443,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/nested', + dataPath: (dataPath || '') + '.collections[' + i1 + '].nested', schemaPath: '#/properties/collections/items/properties/nested/type', params: { type: 'object' @@ -6463,7 +6463,7 @@ var validate = (function() { if (Object.keys(data3).length < 1) { var err = { keyword: 'minProperties', - dataPath: (dataPath || '') + '/collections/' + i1 + '/meta', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', schemaPath: '#/properties/collections/items/properties/meta/minProperties', params: { limit: 1 @@ -6482,7 +6482,7 @@ var validate = (function() { valid4 = false; var err = { keyword: 'additionalProperties', - dataPath: (dataPath || '') + '/collections/' + i1 + '/meta', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', schemaPath: '#/properties/collections/items/properties/meta/additionalProperties', params: { additionalProperty: '' + key3 + '' @@ -6504,7 +6504,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', params: { missingProperty: 'label' @@ -6519,7 +6519,7 @@ var validate = (function() { if (typeof data4.label !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path/label', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.label', schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/label/type', params: { type: 'string' @@ -6536,7 +6536,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', params: { missingProperty: 'widget' @@ -6551,7 +6551,7 @@ var validate = (function() { if (typeof data4.widget !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path/widget', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.widget', schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/widget/type', params: { type: 'string' @@ -6568,7 +6568,7 @@ var validate = (function() { valid5 = false; var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', params: { missingProperty: 'index_file' @@ -6583,7 +6583,7 @@ var validate = (function() { if (typeof data4.index_file !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path/index_file', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.index_file', schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/index_file/type', params: { type: 'string' @@ -6599,7 +6599,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/meta/path', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', schemaPath: '#/properties/collections/items/properties/meta/properties/path/type', params: { type: 'object' @@ -6615,7 +6615,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/meta', + dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', schemaPath: '#/properties/collections/items/properties/meta/type', params: { type: 'object' @@ -6639,7 +6639,7 @@ var validate = (function() { if (typeof data3 !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/0/type', params: { type: 'boolean' @@ -6665,7 +6665,7 @@ var validate = (function() { if (typeof data4 !== "string") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/structure', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.structure', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/type', params: { type: 'string' @@ -6686,7 +6686,7 @@ var validate = (function() { } if (!valid5) { var err = { keyword: 'enum', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/structure', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.structure', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum', params: { allowedValues: schema5 @@ -6706,7 +6706,7 @@ var validate = (function() { if (data4.length < 2) { var err = { keyword: 'minItems', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/minItems', params: { limit: 2 @@ -6726,7 +6726,7 @@ var validate = (function() { if (ucs2length(data5) > 10) { var err = { keyword: 'maxLength', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales/' + i5, + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/maxLength', params: { limit: 10 @@ -6740,7 +6740,7 @@ var validate = (function() { if (ucs2length(data5) < 2) { var err = { keyword: 'minLength', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales/' + i5, + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/minLength', params: { limit: 2 @@ -6754,7 +6754,7 @@ var validate = (function() { if (!pattern0.test(data5)) { var err = { keyword: 'pattern', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales/' + i5, + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/pattern', params: { pattern: '^[a-zA-Z-_]+$' @@ -6768,7 +6768,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales/' + i5, + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/type', params: { type: 'string' @@ -6801,7 +6801,7 @@ var validate = (function() { if (!valid5) { var err = { keyword: 'uniqueItems', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems', params: { i: i, @@ -6816,7 +6816,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/locales', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/type', params: { type: 'array' @@ -6836,7 +6836,7 @@ var validate = (function() { if (ucs2length(data4) > 10) { var err = { keyword: 'maxLength', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/default_locale', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/maxLength', params: { limit: 10 @@ -6850,7 +6850,7 @@ var validate = (function() { if (ucs2length(data4) < 2) { var err = { keyword: 'minLength', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/default_locale', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/minLength', params: { limit: 2 @@ -6864,7 +6864,7 @@ var validate = (function() { if (!pattern0.test(data4)) { var err = { keyword: 'pattern', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/default_locale', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/pattern', params: { pattern: '^[a-zA-Z-_]+$' @@ -6878,7 +6878,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n/default_locale', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/type', params: { type: 'string' @@ -6894,7 +6894,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/type', params: { type: 'object' @@ -6918,7 +6918,7 @@ var validate = (function() { if (!valid3) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/collections/' + i1 + '/i18n', + dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', schemaPath: '#/properties/collections/items/properties/i18n/oneOf', params: { passingSchemas: passingSchemas3 @@ -6940,7 +6940,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/type', params: { type: 'object' @@ -6955,7 +6955,7 @@ var validate = (function() { var errs_3 = errors; if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { var missing3; - if (((data2.sortable_fields === undefined) && (missing3 = 'sortable_fields')) || ((data2.sortableFields === undefined) && (missing3 = 'sortableFields'))) { + if (((data2.sortable_fields === undefined) && (missing3 = '.sortable_fields')) || ((data2.sortableFields === undefined) && (missing3 = '.sortableFields'))) { var err = {}; if (vErrors === null) vErrors = [err]; else vErrors.push(err); @@ -6967,7 +6967,7 @@ var validate = (function() { if (valid3) { var err = { keyword: 'not', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/not', params: {}, message: 'should NOT be valid' @@ -6991,7 +6991,7 @@ var validate = (function() { if (data2.files === undefined) { var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/oneOf/0/required', params: { missingProperty: 'files' @@ -7013,7 +7013,7 @@ var validate = (function() { if (data2.folder === undefined) { var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/oneOf/1/required', params: { missingProperty: 'folder' @@ -7027,7 +7027,7 @@ var validate = (function() { if (data2.fields === undefined) { var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/oneOf/1/required', params: { missingProperty: 'fields' @@ -7052,7 +7052,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'oneOf', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/oneOf', params: { passingSchemas: passingSchemas2 @@ -7124,7 +7124,7 @@ var validate = (function() { if (data2.format === undefined) { var err = { keyword: 'required', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/then/else/required', params: { missingProperty: 'format' @@ -7142,7 +7142,7 @@ var validate = (function() { if (!valid3) { var err = { keyword: 'if', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/then/if', params: { failingKeyword: 'else' @@ -7159,7 +7159,7 @@ var validate = (function() { if (!valid2) { var err = { keyword: 'if', - dataPath: (dataPath || '') + '/collections/' + i1, + dataPath: (dataPath || '') + '.collections[' + i1 + ']', schemaPath: '#/properties/collections/items/if', params: { failingKeyword: 'then' @@ -7176,7 +7176,7 @@ var validate = (function() { var errs__1 = errors; var valid1; customRule17.errors = null; - valid1 = customRule17.call(self, data1, (dataPath || '') + '/collections', data, 'collections', rootData); + valid1 = customRule17.call(self, data1, (dataPath || '') + '.collections', data, 'collections', rootData); if (!valid1) { if (Array.isArray(customRule17.errors)) { if (vErrors === null) vErrors = customRule17.errors; @@ -7184,13 +7184,13 @@ var validate = (function() { errors = vErrors.length; for (var i1 = errs__1; i1 < errors; i1++) { var ruleErr1 = vErrors[i1]; - if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '/collections'; + if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '.collections'; ruleErr1.schemaPath = "#/properties/collections/uniqueItemProperties"; } } else { var err = { keyword: 'uniqueItemProperties', - dataPath: (dataPath || '') + '/collections', + dataPath: (dataPath || '') + '.collections', schemaPath: '#/properties/collections/uniqueItemProperties', params: { keyword: 'uniqueItemProperties' @@ -7205,7 +7205,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/collections', + dataPath: (dataPath || '') + '.collections', schemaPath: '#/properties/collections/type', params: { type: 'array' @@ -7229,7 +7229,7 @@ var validate = (function() { if (typeof data1.preview !== "boolean") { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/editor/preview', + dataPath: (dataPath || '') + '.editor.preview', schemaPath: '#/properties/editor/properties/preview/type', params: { type: 'boolean' @@ -7245,7 +7245,7 @@ var validate = (function() { } else { var err = { keyword: 'type', - dataPath: (dataPath || '') + '/editor', + dataPath: (dataPath || '') + '.editor', schemaPath: '#/properties/editor/type', params: { type: 'object' diff --git a/yarn.lock b/yarn.lock index 3726b313a329..4d9599452a89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4464,16 +4464,18 @@ airbnb-js-shims@^2.2.1: string.prototype.padstart "^3.0.0" symbol.prototype.description "^1.0.0" -ajv-cli@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/ajv-cli/-/ajv-cli-3.1.0.tgz#00e04c436c90ccc0883d31f21879ed932a774b19" - integrity sha512-QSHstRjJin970EspY92Qr8lDGYE9C88AwW7LJYJ/MFhKDsE6I75H2b8WObCeF+2q/1fJiolm0xX7I/VyGmw/JQ== +ajv-cli@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/ajv-cli/-/ajv-cli-3.3.0.tgz#dd72207f5395051db7d620ab7d4da1cec3d50f06" + integrity sha512-4eiNNjDlainn5Rm+rU3egxLUUxzevcB+gviBLs9sm6etHNrE7l2JSQ3yoz5hE+eqrth3pTygELOafhSIO8Hiig== dependencies: ajv "^6.7.0" ajv-pack "^0.3.0" fast-json-patch "^2.0.0" glob "^7.1.0" + js-yaml "^3.13.1" json-schema-migrate "^0.2.0" + json5 "^2.1.3" minimist "^1.2.0" ajv-errors@^1.0.0: @@ -11951,7 +11953,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== From 6d46ef92513353f880b94f4b9db831e45ad0749d Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Thu, 6 Jan 2022 08:43:09 -0800 Subject: [PATCH 09/20] chore(csp): one static test is passing --- packages/netlify-cms-core/package.json | 8 +- .../src/constants/configSchema.js | 18 +- .../src/constants/staticValidateConfig.js | 25526 +++++++++++----- yarn.lock | 112 +- 4 files changed, 17622 insertions(+), 8042 deletions(-) diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index feb86f986883..6b1c55164b49 100644 --- a/packages/netlify-cms-core/package.json +++ b/packages/netlify-cms-core/package.json @@ -17,7 +17,7 @@ "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\"", - "write-validate-schema": "NODE_ENV=production ajv -c ajv-keywords compile --all-errors --data -s ./config.schema.json -o ./src/constants/staticValidateConfig.js" + "write-validate-schema": "NODE_ENV=production ajv --strict=false -c ajv-keywords/dist/keywords/select compile --all-errors --data -s ./config.schema.json -o ./src/constants/staticValidateConfig.js" }, "keywords": [ "netlify", @@ -27,8 +27,8 @@ "license": "MIT", "dependencies": { "@iarna/toml": "2.2.5", - "ajv": "6.12.6", - "ajv-keywords": "3.5.2", + "ajv": "^8.8.2", + "ajv-keywords": "^5.1.0", "copy-text-to-clipboard": "^3.0.0", "deepmerge": "^4.2.2", "diacritics": "^1.3.0", @@ -95,7 +95,7 @@ "@types/history": "^4.7.8", "@types/redux-mock-store": "^1.0.2", "@types/url-join": "^4.0.0", - "ajv-cli": "^3.3.0", + "ajv-cli": "^5.0.0", "redux-mock-store": "^1.5.3" } } diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index c7ee0dfe153e..0dcab014c786 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -1,9 +1,9 @@ import AJV from 'ajv'; -import { select } from 'ajv-keywords/keywords/select' -import { uniqueItemProperties } from 'ajv-keywords/keywords/uniqueItemProperties' -import { instanceof as instanceOf } from 'ajv-keywords/keywords/instanceof' -import { prohibited } from 'ajv-keywords/keywords/prohibited' - +import { + select, + uniqueItemProperties, + instanceof as instanceOf, +} from 'ajv-keywords/keywords'; import uuid from 'uuid/v4'; import { set } from 'lodash/fp' @@ -101,12 +101,9 @@ function getWidgetSchemas() { class ConfigError extends Error { constructor(errors, ...args) { - console.log('errors', errors) const message = errors - .map(({ message, instancePath, dataPath }) => { - // taras: I'm 100% sure why instancePath is not available, but dataPath seems to have - // information about location - const dotPath = (instancePath || dataPath) + .map(({ message, instancePath }) => { + const dotPath = instancePath .slice(1) .split('/') .map(seg => (seg.match(/^\d+$/) ? `[${seg}]` : `.${seg}`)) @@ -135,7 +132,6 @@ function dynamicValidateConfig(config) { uniqueItemProperties(ajv); select(ajv); instanceOf(ajv); - prohibited(ajv); const valid = ajv.validate(getConfigSchema(), config); dynamicValidateConfig.errors = ajv.errors; diff --git a/packages/netlify-cms-core/src/constants/staticValidateConfig.js b/packages/netlify-cms-core/src/constants/staticValidateConfig.js index 196072e298ec..d7d68878633c 100644 --- a/packages/netlify-cms-core/src/constants/staticValidateConfig.js +++ b/packages/netlify-cms-core/src/constants/staticValidateConfig.js @@ -1,8367 +1,18021 @@ 'use strict'; -var RULES = require('ajv/lib/compile/rules')(); -var ucs2length = require('ajv/lib/compile/ucs2length'); -var equal = require('ajv/lib/compile/equal'); -var validate = (function() { - var pattern0 = new RegExp('^[a-zA-Z-_]+$'); - var refVal = []; - var refVal1 = (function() { - var pattern0 = new RegExp('^[a-zA-Z-_]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; /*# sourceURL=field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d */ - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if ((data && typeof data === "object" && !Array.isArray(data))) { - var errs__0 = errors; - var valid1 = true; - if (data.name === undefined) { - valid1 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + "", - schemaPath: '#/required', - params: { - missingProperty: 'name' - }, - message: 'should have required property \'name\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_1 = errors; - if (typeof data.name !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.name', - schemaPath: '#/properties/name/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.label !== undefined) { - var errs_1 = errors; - if (typeof data.label !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.label', - schemaPath: '#/properties/label/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.widget !== undefined) { - var errs_1 = errors; - if (typeof data.widget !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.widget', - schemaPath: '#/properties/widget/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.required !== undefined) { - var errs_1 = errors; - if (typeof data.required !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.required', - schemaPath: '#/properties/required/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - var data1 = data.i18n; - if (data1 !== undefined) { - var errs_1 = errors; - var errs__1 = errors, - prevValid1 = false, - valid1 = false, - passingSchemas1 = null; - var errs_2 = errors; - if (typeof data1 !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.i18n', - schemaPath: '#/properties/i18n/oneOf/0/type', - params: { - type: 'boolean' +module.exports = validate24; +module.exports.default = validate24; +const schema40 = { + $id: 'https://netlify-cms/object.json', + 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_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', + type: 'array', + minItems: 1, + items: { + $id: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', + 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' }, { instanceof: 'RegExp' }] }, + { type: 'string' }, + ], + }, + field: { $ref: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + fields: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + types: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + }, + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, + }, + }, + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, + }, + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, + }, + }, + }, + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + object: { + properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } }, + }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, + }, + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], + }, + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, + }, + }, + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, + }, + }, + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, + }, + }, + }, + color: {}, + }, + required: ['name'], + }, + uniqueItemProperties: ['name'], + }, }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - if (valid2) { - valid1 = prevValid1 = true; - passingSchemas1 = 0; - } - var errs_2 = errors; - if (typeof data1 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.i18n', - schemaPath: '#/properties/i18n/oneOf/1/type', - params: { - type: 'string' + required: ['name', 'label', 'file', 'fields'], + }, + uniqueItemProperties: ['name'], + }, + 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_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', + type: 'array', + minItems: 1, + items: { + $id: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', + 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' }, { instanceof: 'RegExp' }] }, + { type: 'string' }, + ], + }, + field: { $ref: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + fields: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + types: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema2 = validate.schema.properties.i18n.oneOf[1].enum; - var valid2; - valid2 = false; - for (var i2 = 0; i2 < schema2.length; i2++) - if (equal(data1, schema2[i2])) { - valid2 = true; - break; - } if (!valid2) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.i18n', - schemaPath: '#/properties/i18n/oneOf/1/enum', - params: { - allowedValues: schema2 + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, + }, + }, + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, + }, + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, + }, + }, + }, + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + object: { + properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } }, + }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, + }, + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], + }, + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, + }, + }, + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, + }, + }, + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, + }, + }, + }, + color: {}, }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - if (valid2 && prevValid1) { - valid1 = false; - passingSchemas1 = [passingSchemas1, 1]; - } else { - if (valid2) { - valid1 = prevValid1 = true; - passingSchemas1 = 1; - } - } - if (!valid1) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '.i18n', - schemaPath: '#/properties/i18n/oneOf', - params: { - passingSchemas: passingSchemas1 + required: ['name'], + }, + uniqueItemProperties: ['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' }] }, }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__1; - if (vErrors !== null) { - if (errs__1) vErrors.length = errs__1; - else vErrors = null; - } - } - var valid1 = errors === errs_1; - } - if (data.hint !== undefined) { - var errs_1 = errors; - if (typeof data.hint !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.hint', - schemaPath: '#/properties/hint/type', - params: { - 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' }, }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - var data1 = data.pattern; - if (data1 !== undefined) { - var errs_1 = errors; - if (Array.isArray(data1)) { - if (data1.length < 2) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.pattern', - schemaPath: '#/properties/pattern/minItems', - params: { - limit: 2 + 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' }, }, - message: 'should NOT have fewer than 2 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__1 = errors; - var valid1; - valid2 = true; - if (data1.length > 0) { - var data2 = data1[0]; - var errs_2 = errors; - var errs__2 = errors, - prevValid2 = false, - valid2 = false, - passingSchemas2 = null; - var errs_3 = errors; - if (typeof data2 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.pattern[' + 0 + ']', - schemaPath: '#/properties/pattern/items/0/oneOf/0/type', - params: { - 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'], }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - if (valid3) { - valid2 = prevValid2 = true; - passingSchemas2 = 0; - } - var errs_3 = errors; - customRule1.errors = null; - var errs__3 = errors; - var valid3; - customRule1.errors = null; - valid3 = customRule1.call(self, data2, (dataPath || '') + '.pattern[' + 0 + ']', data1, 0, rootData); - if (!valid3) { - if (Array.isArray(customRule1.errors)) { - if (vErrors === null) vErrors = customRule1.errors; - else vErrors = vErrors.concat(customRule1.errors); - errors = vErrors.length; - for (var i3 = errs__3; i3 < errors; i3++) { - var ruleErr3 = vErrors[i3]; - if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '.pattern[' + 0 + ']'; - ruleErr3.schemaPath = "#/properties/pattern/items/0/oneOf/1/instanceof"; - } - } else { - var err = { - keyword: 'instanceof', - dataPath: (dataPath || '') + '.pattern[' + 0 + ']', - schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', - params: { - keyword: 'instanceof' + locales: { + type: 'array', + minItems: 2, + items: { + type: 'string', + minLength: 2, + maxLength: 10, + pattern: '^[a-zA-Z-_]+$', }, - message: 'should pass "instanceof" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - var valid3 = errors === errs_3; - if (valid3 && prevValid2) { - valid2 = false; - passingSchemas2 = [passingSchemas2, 1]; - } else { - if (valid3) { - valid2 = prevValid2 = true; - passingSchemas2 = 1; - } - } - if (!valid2) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '.pattern[' + 0 + ']', - schemaPath: '#/properties/pattern/items/0/oneOf', - params: { - passingSchemas: passingSchemas2 + uniqueItems: true, }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__2; - if (vErrors !== null) { - if (errs__2) vErrors.length = errs__2; - else vErrors = null; - } - } - var valid2 = errors === errs_2; - } - valid2 = true; - if (data1.length > 1) { - var errs_2 = errors; - if (typeof data1[1] !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.pattern[' + 1 + ']', - schemaPath: '#/properties/pattern/items/1/type', - params: { - type: 'string' + default_locale: { + type: 'string', + minLength: 2, + maxLength: 10, + pattern: '^[a-zA-Z-_]+$', }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.pattern', - schemaPath: '#/properties/pattern/type', - params: { - type: 'array' + }, }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.field !== undefined) { - var errs_1 = errors; - if (!refVal[1](data.field, (dataPath || '') + '.field', data, 'field', rootData)) { - if (vErrors === null) vErrors = refVal[1].errors; - else vErrors = vErrors.concat(refVal[1].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.fields !== undefined) { - var errs_1 = errors; - if (!refVal2(data.fields, (dataPath || '') + '.fields', data, 'fields', rootData)) { - if (vErrors === null) vErrors = refVal2.errors; - else vErrors = vErrors.concat(refVal2.errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.types !== undefined) { - var errs_1 = errors; - if (!refVal[2](data.types, (dataPath || '') + '.types', data, 'types', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'object' + ], }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema0 = data && data.widget; - var definition0 = RULES.custom['select'].definition; - var keywordValidate0 = definition0.validate; - keywordValidate0.errors = null; - var errs__0 = errors; - var valid0; - if (schema0 === undefined) { - valid0 = true; - } else { - valid0 = definition0.validateSchema(schema0); - if (valid0) { - keywordValidate0.errors = null; - valid0 = keywordValidate0.call(self, schema0, data, validate.schema, (dataPath || ''), parentData, parentDataProperty, rootData); - } - } - if (!valid0) { - if (Array.isArray(keywordValidate0.errors)) { - if (vErrors === null) vErrors = keywordValidate0.errors; - else vErrors = vErrors.concat(keywordValidate0.errors); - errors = vErrors.length; - for (var i0 = errs__0; i0 < errors; i0++) { - var ruleErr0 = vErrors[i0]; - if (ruleErr0.dataPath === undefined) ruleErr0.dataPath = (dataPath || '') + ""; - ruleErr0.schemaPath = "#/select"; - } - } else { - var err = { - keyword: 'select', - dataPath: (dataPath || '') + "", - schemaPath: '#/select', - params: { - keyword: 'select' + }, + 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'] }, }, - message: 'should pass "select" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - customRule5.errors = null; - var errs__0 = errors; - var valid0; - customRule5.errors = null; - valid0 = customRule5.call(self, data, (dataPath || ''), parentData, parentDataProperty, rootData); - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal1.schema = { - "$id": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", - "type": "object", - "properties": { - "name": { - "type": "string" + }, + else: { required: ['format'] }, + }, + dependencies: { + frontmatter_delimiter: { + properties: { + format: { enum: ['yaml-frontmatter', 'toml-frontmatter', 'json-frontmatter'] }, + }, + required: ['format'], + }, + }, }, - "label": { - "type": "string" + uniqueItemProperties: ['name'], + }, + 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 func9 = require('ajv/dist/runtime/ucs2length').default; +const pattern0 = new RegExp('^[a-zA-Z-_]+$', 'u'); +const schema41 = { + $id: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', + 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], + }, + field: { $ref: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + fields: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + types: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + }, + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, }, - "widget": { - "type": "string" + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, + }, }, - "required": { - "type": "boolean" + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, + }, + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, + }, }, - "i18n": { - "oneOf": [{ - "type": "boolean" - }, { - "type": "string", - "enum": ["translate", "duplicate", "none"] - }] + }, + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, }, - "hint": { - "type": "string" + }, + object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, }, - "pattern": { - "type": "array", - "minItems": 2, - "items": [{ - "oneOf": [{ - "type": "string" - }, { - "instanceof": "RegExp" - }] - }, { - "type": "string" - }] + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], + }, + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, }, - "field": { - "$ref": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + }, + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, }, - "fields": { - "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + }, + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, + }, }, - "types": { - "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" - } }, - "select": { - "$data": "0/widget" + color: {}, + }, + required: ['name'], +}; +const wrapper0 = { validate: validate25 }; +const schema42 = { + $id: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', + type: 'array', + minItems: 1, + items: { + $id: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', + 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], + }, + field: { $ref: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + fields: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + types: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, }, - "selectCases": { - "unknown": {}, - "string": {}, - "number": { - "properties": { - "step": { - "type": "number" + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, }, - "value_type": { - "type": "string" + }, + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, }, - "min": { - "type": "number" + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, }, - "max": { - "type": "number" - } - } + }, }, - "text": {}, - "image": { - "properties": { - "allow_multiple": { - "type": "boolean" - } - } - }, - "file": { - "properties": { - "allow_multiple": { - "type": "boolean" - } - } - }, - "select": { - "properties": { - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "options": { - "type": "array", - "items": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }, { - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }] - } - }, - "required": ["label", "value"] - }] - } - } + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, }, - "required": ["options"] - }, - "markdown": { - "properties": { - "minimal": { - "type": "boolean" - }, - "buttons": { - "type": "array", - "items": { - "type": "string", - "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] - } - }, - "editor_components": { - "type": "array", - "items": { - "type": "string" - } - }, - "modes": { - "type": "array", - "items": { - "type": "string", - "enum": ["raw", "rich_text"] - }, - "minItems": 1 - } - } - }, - "list": { - "properties": { - "allow_add": { - "type": "boolean" - }, - "collapsed": { - "type": "boolean" - }, - "summary": { - "type": "string" - }, - "minimize_collapsed": { - "type": "boolean" - }, - "label_singular": { - "type": "string" - }, - "i18n": { - "type": "boolean" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" - } - } - }, - "object": { - "properties": { - "collapsed": { - "type": "boolean" - }, - "i18n": { - "type": "boolean" - } - } }, - "relation": { - "properties": { - "collection": { - "type": "string" - }, - "value_field": { - "type": "string" - }, - "search_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - }, - "file": { - "type": "string" - }, - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "display_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - }, - "options_length": { - "type": "integer" - } + object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, }, - "oneOf": [{ - "required": ["collection", "value_field", "search_fields"] - }, { - "required": ["collection", "valueField", "searchFields"] - }] + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], }, - "boolean": {}, - "map": { - "properties": { - "decimals": { - "type": "integer" - }, - "type": { - "type": "string", - "enum": ["Point", "LineString", "Polygon"] - } - } + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, + }, }, - "date": {}, - "datetime": { - "properties": { - "format": { - "type": "string" - }, - "date_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "time_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "picker_utc": { - "type": "boolean" - } - } + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, + }, }, - "code": { - "properties": { - "default_language": { - "type": "string" + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, }, - "allow_language_selection": { - "type": "boolean" - }, - "output_code_only": { - "type": "boolean" - }, - "keys": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "lang": { - "type": "string" - } - } - } - } + }, }, - "color": {} + color: {}, }, - "required": ["name"] - }; - refVal1.errors = null; - refVal[1] = refVal1; - var refVal2 = (function() { - var pattern0 = new RegExp('^[a-zA-Z-_]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; /*# sourceURL=fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d */ - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if (Array.isArray(data)) { - if (data.length < 1) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + "", - schemaPath: '#/minItems', - params: { - limit: 1 - }, - message: 'should NOT have fewer than 1 items' + required: ['name'], + }, + uniqueItemProperties: ['name'], +}; +const wrapper2 = { validate: validate26 }; +function validate26( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + /*# sourceURL="fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */ 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 < len0; i0++) { + let data0 = data[i0]; + const vSchema0 = data0 && data0.widget; + if (!(vSchema0 === undefined)) { + if ( + typeof vSchema0 !== 'string' && + !(typeof vSchema0 == 'number') && + typeof vSchema0 !== 'boolean' && + vSchema0 !== null + ) { + const err1 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/select', + keyword: 'select', + params: {}, + message: '"select" keyword must be string,number,boolean,null ($data)', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } errors++; - } - var errs__0 = errors; - var valid0; - for (var i0 = 0; i0 < data.length; i0++) { - var data1 = data[i0]; - var errs_1 = errors; - if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { - var errs__1 = errors; - var valid2 = true; - if (data1.name === undefined) { - valid2 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '[' + i0 + ']', - schemaPath: '#/items/required', - params: { - missingProperty: 'name' - }, - message: 'should have required property \'name\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_2 = errors; - if (typeof data1.name !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].name', - schemaPath: '#/items/properties/name/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - if (data1.label !== undefined) { - var errs_2 = errors; - if (typeof data1.label !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].label', - schemaPath: '#/items/properties/label/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - if (data1.widget !== undefined) { - var errs_2 = errors; - if (typeof data1.widget !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].widget', - schemaPath: '#/items/properties/widget/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - if (data1.required !== undefined) { - var errs_2 = errors; - if (typeof data1.required !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].required', - schemaPath: '#/items/properties/required/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - var data2 = data1.i18n; - if (data2 !== undefined) { - var errs_2 = errors; - var errs__2 = errors, - prevValid2 = false, - valid2 = false, - passingSchemas2 = null; - var errs_3 = errors; - if (typeof data2 !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', - schemaPath: '#/items/properties/i18n/oneOf/0/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } else { + let valid2 = true; + const value0 = vSchema0 === null ? 'null' : vSchema0; + if ('' + value0 == 'unknown') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'string') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'number') { + const _errs3 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.step !== undefined) { + if (!(typeof data0.step == 'number')) { + const err2 = { + instancePath: instancePath + '/' + i0 + '/step', + schemaPath: '#/items/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } } - var valid3 = errors === errs_3; - if (valid3) { - valid2 = prevValid2 = true; - passingSchemas2 = 0; + if (data0.value_type !== undefined) { + if (typeof data0.value_type !== 'string') { + const err3 = { + instancePath: instancePath + '/' + i0 + '/value_type', + schemaPath: '#/items/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } } - var errs_3 = errors; - if (typeof data2 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', - schemaPath: '#/items/properties/i18n/oneOf/1/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data0.min !== undefined) { + if (!(typeof data0.min == 'number')) { + const err4 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } } - var schema3 = validate.schema.items.properties.i18n.oneOf[1].enum; - var valid3; - valid3 = false; - for (var i3 = 0; i3 < schema3.length; i3++) - if (equal(data2, schema3[i3])) { - valid3 = true; - break; - } if (!valid3) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', - schemaPath: '#/items/properties/i18n/oneOf/1/enum', - params: { - allowedValues: schema3 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data0.max !== undefined) { + if (!(typeof data0.max == 'number')) { + const err5 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } } - var valid3 = errors === errs_3; - if (valid3 && prevValid2) { - valid2 = false; - passingSchemas2 = [passingSchemas2, 1]; - } else { - if (valid3) { - valid2 = prevValid2 = true; - passingSchemas2 = 1; + } + var _valid0 = _errs3 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'text') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'image') { + const _errs12 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_multiple !== undefined) { + if (typeof data0.allow_multiple !== 'boolean') { + const err6 = { + instancePath: instancePath + '/' + i0 + '/allow_multiple', + schemaPath: '#/items/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; } } - if (!valid2) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', - schemaPath: '#/items/properties/i18n/oneOf', - params: { - passingSchemas: passingSchemas2 - }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__2; - if (vErrors !== null) { - if (errs__2) vErrors.length = errs__2; - else vErrors = null; + } + var _valid0 = _errs12 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'file') { + const _errs15 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_multiple !== undefined) { + if (typeof data0.allow_multiple !== 'boolean') { + const err7 = { + instancePath: instancePath + '/' + i0 + '/allow_multiple', + schemaPath: '#/items/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; } } - var valid2 = errors === errs_2; } - if (data1.hint !== undefined) { - var errs_2 = errors; - if (typeof data1.hint !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].hint', - schemaPath: '#/items/properties/hint/type', - params: { - type: 'string' - }, - message: 'should be string' + var _valid0 = _errs15 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'select') { + const _errs18 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.options === undefined) { + const err8 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } errors++; } - var valid2 = errors === errs_2; - } - var data2 = data1.pattern; - if (data2 !== undefined) { - var errs_2 = errors; - if (Array.isArray(data2)) { - if (data2.length < 2) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '[' + i0 + '].pattern', - schemaPath: '#/items/properties/pattern/minItems', - params: { - limit: 2 - }, - message: 'should NOT have fewer than 2 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__2 = errors; - var valid2; - valid3 = true; - if (data2.length > 0) { - var data3 = data2[0]; - var errs_3 = errors; - var errs__3 = errors, - prevValid3 = false, - valid3 = false, - passingSchemas3 = null; - var errs_4 = errors; - if (typeof data3 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', - schemaPath: '#/items/properties/pattern/items/0/oneOf/0/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid4 = errors === errs_4; - if (valid4) { - valid3 = prevValid3 = true; - passingSchemas3 = 0; - } - var errs_4 = errors; - customRule2.errors = null; - var errs__4 = errors; - var valid4; - customRule2.errors = null; - valid4 = customRule2.call(self, data3, (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', data2, 0, rootData); - if (!valid4) { - if (Array.isArray(customRule2.errors)) { - if (vErrors === null) vErrors = customRule2.errors; - else vErrors = vErrors.concat(customRule2.errors); - errors = vErrors.length; - for (var i4 = errs__4; i4 < errors; i4++) { - var ruleErr4 = vErrors[i4]; - if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']'; - ruleErr4.schemaPath = "#/items/properties/pattern/items/0/oneOf/1/instanceof"; - } - } else { - var err = { - keyword: 'instanceof', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', - schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', - params: { - keyword: 'instanceof' - }, - message: 'should pass "instanceof" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - var valid4 = errors === errs_4; - if (valid4 && prevValid3) { - valid3 = false; - passingSchemas3 = [passingSchemas3, 1]; + if (data0.multiple !== undefined) { + if (typeof data0.multiple !== 'boolean') { + const err9 = { + instancePath: instancePath + '/' + i0 + '/multiple', + schemaPath: '#/items/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err9]; } else { - if (valid4) { - valid3 = prevValid3 = true; - passingSchemas3 = 1; - } + vErrors.push(err9); } - if (!valid3) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', - schemaPath: '#/items/properties/pattern/items/0/oneOf', - params: { - passingSchemas: passingSchemas3 - }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + errors++; + } + } + if (data0.min !== undefined) { + let data8 = data0.min; + if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { + const err10 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err10]; } else { - errors = errs__3; - if (vErrors !== null) { - if (errs__3) vErrors.length = errs__3; - else vErrors = null; - } + vErrors.push(err10); } - var valid3 = errors === errs_3; + errors++; } - valid3 = true; - if (data2.length > 1) { - var errs_3 = errors; - if (typeof data2[1] !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 1 + ']', - schemaPath: '#/items/properties/pattern/items/1/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } + if (data0.max !== undefined) { + let data9 = data0.max; + if (!(typeof data9 == 'number' && !(data9 % 1) && !isNaN(data9))) { + const err11 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); } - var valid3 = errors === errs_3; + errors++; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern', - schemaPath: '#/items/properties/pattern/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var valid2 = errors === errs_2; - } - if (data1.field !== undefined) { - var errs_2 = errors; - if (!refVal[1](data1.field, (dataPath || '') + '[' + i0 + '].field', data1, 'field', rootData)) { - if (vErrors === null) vErrors = refVal[1].errors; - else vErrors = vErrors.concat(refVal[1].errors); - errors = vErrors.length; - } - var valid2 = errors === errs_2; - } - if (data1.fields !== undefined) { - var errs_2 = errors; - if (!refVal[2](data1.fields, (dataPath || '') + '[' + i0 + '].fields', data1, 'fields', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid2 = errors === errs_2; - } - if (data1.types !== undefined) { - var errs_2 = errors; - if (!refVal[2](data1.types, (dataPath || '') + '[' + i0 + '].types', data1, 'types', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; - } - var valid2 = errors === errs_2; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + ']', - schemaPath: '#/items/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema1 = data1 && data1.widget; - var definition1 = RULES.custom['select'].definition; - var keywordValidate1 = definition1.validate; - keywordValidate1.errors = null; - var errs__1 = errors; - var valid1; - if (schema1 === undefined) { - valid1 = true; - } else { - valid1 = definition1.validateSchema(schema1); - if (valid1) { - keywordValidate1.errors = null; - valid1 = keywordValidate1.call(self, schema1, data1, validate.schema.items, (dataPath || '') + '[' + i0 + ']', data, i0, rootData); - } - } - if (!valid1) { - if (Array.isArray(keywordValidate1.errors)) { - if (vErrors === null) vErrors = keywordValidate1.errors; - else vErrors = vErrors.concat(keywordValidate1.errors); - errors = vErrors.length; - for (var i1 = errs__1; i1 < errors; i1++) { - var ruleErr1 = vErrors[i1]; - if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '[' + i0 + ']'; - ruleErr1.schemaPath = "#/items/select"; - } - } else { - var err = { - keyword: 'select', - dataPath: (dataPath || '') + '[' + i0 + ']', - schemaPath: '#/items/select', - params: { - keyword: 'select' - }, - message: 'should pass "select" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - customRule3.errors = null; - var errs__1 = errors; - var valid1; - customRule3.errors = null; - valid1 = customRule3.call(self, data1, (dataPath || '') + '[' + i0 + ']', data, i0, rootData); - var valid1 = errors === errs_1; - } - customRule4.errors = null; - var errs__0 = errors; - var valid0; - customRule4.errors = null; - valid0 = customRule4.call(self, data, (dataPath || ''), parentData, parentDataProperty, rootData); - if (!valid0) { - if (Array.isArray(customRule4.errors)) { - if (vErrors === null) vErrors = customRule4.errors; - else vErrors = vErrors.concat(customRule4.errors); - errors = vErrors.length; - for (var i0 = errs__0; i0 < errors; i0++) { - var ruleErr0 = vErrors[i0]; - if (ruleErr0.dataPath === undefined) ruleErr0.dataPath = (dataPath || '') + ""; - ruleErr0.schemaPath = "#/uniqueItemProperties"; - } - } else { - var err = { - keyword: 'uniqueItemProperties', - dataPath: (dataPath || '') + "", - schemaPath: '#/uniqueItemProperties', - params: { - keyword: 'uniqueItemProperties' - }, - message: 'should pass "uniqueItemProperties" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal2.schema = { - "$id": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", - "type": "array", - "minItems": 1, - "items": { - "$id": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", - "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" - }, { - "instanceof": "RegExp" - }] - }, { - "type": "string" - }] - }, - "field": { - "$ref": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" - }, - "fields": { - "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" - }, - "types": { - "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" - } - }, - "select": { - "$data": "0/widget" - }, - "selectCases": { - "unknown": {}, - "string": {}, - "number": { - "properties": { - "step": { - "type": "number" - }, - "value_type": { - "type": "string" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" - } - } - }, - "text": {}, - "image": { - "properties": { - "allow_multiple": { - "type": "boolean" - } - } - }, - "file": { - "properties": { - "allow_multiple": { - "type": "boolean" - } - } - }, - "select": { - "properties": { - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "options": { - "type": "array", - "items": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }, { - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }] + if (data0.options !== undefined) { + let data10 = data0.options; + if (Array.isArray(data10)) { + const len1 = data10.length; + for (let i1 = 0; i1 < len1; i1++) { + let data11 = data10[i1]; + const _errs28 = errors; + let valid9 = false; + let passing0 = null; + const _errs29 = errors; + if (typeof data11 !== 'string') { + const err12 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; } - }, - "required": ["label", "value"] - }] + var _valid1 = _errs29 === errors; + if (_valid1) { + valid9 = true; + passing0 = 0; + } + const _errs31 = errors; + if (!(typeof data11 == 'number')) { + const err13 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + var _valid1 = _errs31 === errors; + if (_valid1 && valid9) { + valid9 = false; + passing0 = [passing0, 1]; + } else { + if (_valid1) { + valid9 = true; + passing0 = 1; + } + const _errs33 = errors; + if (data11 && typeof data11 == 'object' && !Array.isArray(data11)) { + if (data11.label === undefined) { + const err14 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + if (data11.value === undefined) { + const err15 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + if (data11.label !== undefined) { + if (typeof data11.label !== 'string') { + const err16 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/label', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + if (data11.value !== undefined) { + let data13 = data11.value; + const _errs38 = errors; + let valid11 = false; + let passing1 = null; + const _errs39 = errors; + if (typeof data13 !== 'string') { + const err17 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var _valid2 = _errs39 === errors; + if (_valid2) { + valid11 = true; + passing1 = 0; + } + const _errs41 = errors; + if (!(typeof data13 == 'number')) { + const err18 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + var _valid2 = _errs41 === errors; + if (_valid2 && valid11) { + valid11 = false; + passing1 = [passing1, 1]; + } else { + if (_valid2) { + valid11 = true; + passing1 = 1; + } + } + if (!valid11) { + const err19 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs38; + if (vErrors !== null) { + if (_errs38) { + vErrors.length = _errs38; + } else { + vErrors = null; + } + } + } + } + } else { + const err20 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + var _valid1 = _errs33 === errors; + if (_valid1 && valid9) { + valid9 = false; + passing0 = [passing0, 2]; + } else { + if (_valid1) { + valid9 = true; + passing0 = 2; + } + } + } + if (!valid9) { + const err21 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: '#/items/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing0 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } else { + errors = _errs28; + if (vErrors !== null) { + if (_errs28) { + vErrors.length = _errs28; + } else { + vErrors = null; + } + } + } + } + } else { + const err22 = { + instancePath: instancePath + '/' + i0 + '/options', + schemaPath: '#/items/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } } } - }, - "required": ["options"] - }, - "markdown": { - "properties": { - "minimal": { - "type": "boolean" - }, - "buttons": { - "type": "array", - "items": { - "type": "string", - "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] + var _valid0 = _errs18 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'markdown') { + const _errs43 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.minimal !== undefined) { + if (typeof data0.minimal !== 'boolean') { + const err23 = { + instancePath: instancePath + '/' + i0 + '/minimal', + schemaPath: '#/items/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } } - }, - "editor_components": { - "type": "array", - "items": { - "type": "string" + if (data0.buttons !== undefined) { + let data15 = data0.buttons; + if (Array.isArray(data15)) { + const len2 = data15.length; + for (let i2 = 0; i2 < len2; i2++) { + let data16 = data15[i2]; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: instancePath + '/' + i0 + '/buttons/' + i2, + schemaPath: '#/items/selectCases/markdown/properties/buttons/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + if ( + !( + data16 === 'bold' || + data16 === 'italic' || + data16 === 'code' || + data16 === 'link' || + data16 === 'heading-one' || + data16 === 'heading-two' || + data16 === 'heading-three' || + data16 === 'heading-four' || + data16 === 'heading-five' || + data16 === 'heading-six' || + data16 === 'quote' || + data16 === 'bulleted-list' || + data16 === 'numbered-list' + ) + ) { + const err25 = { + instancePath: instancePath + '/' + i0 + '/buttons/' + i2, + schemaPath: '#/items/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema42.items.selectCases.markdown.properties.buttons.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + } else { + const err26 = { + instancePath: instancePath + '/' + i0 + '/buttons', + schemaPath: '#/items/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } } - }, - "modes": { - "type": "array", - "items": { - "type": "string", - "enum": ["raw", "rich_text"] - }, - "minItems": 1 - } - } - }, - "list": { - "properties": { - "allow_add": { - "type": "boolean" - }, - "collapsed": { - "type": "boolean" - }, - "summary": { - "type": "string" - }, - "minimize_collapsed": { - "type": "boolean" - }, - "label_singular": { - "type": "string" - }, - "i18n": { - "type": "boolean" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" - } - } - }, - "object": { - "properties": { - "collapsed": { - "type": "boolean" - }, - "i18n": { - "type": "boolean" - } - } - }, - "relation": { - "properties": { - "collection": { - "type": "string" - }, - "value_field": { - "type": "string" - }, - "search_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" + if (data0.editor_components !== undefined) { + let data17 = data0.editor_components; + if (Array.isArray(data17)) { + const len3 = data17.length; + for (let i3 = 0; i3 < len3; i3++) { + if (typeof data17[i3] !== 'string') { + const err27 = { + instancePath: instancePath + '/' + i0 + '/editor_components/' + i3, + schemaPath: + '#/items/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + } else { + const err28 = { + instancePath: instancePath + '/' + i0 + '/editor_components', + schemaPath: '#/items/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } } - }, - "file": { - "type": "string" - }, - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "display_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" + if (data0.modes !== undefined) { + let data19 = data0.modes; + if (Array.isArray(data19)) { + if (data19.length < 1) { + const err29 = { + instancePath: instancePath + '/' + i0 + '/modes', + schemaPath: '#/items/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + const len4 = data19.length; + for (let i4 = 0; i4 < len4; i4++) { + let data20 = data19[i4]; + if (typeof data20 !== 'string') { + const err30 = { + instancePath: instancePath + '/' + i0 + '/modes/' + i4, + schemaPath: '#/items/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + if (!(data20 === 'raw' || data20 === 'rich_text')) { + const err31 = { + instancePath: instancePath + '/' + i0 + '/modes/' + i4, + schemaPath: '#/items/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema42.items.selectCases.markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } + } else { + const err32 = { + instancePath: instancePath + '/' + i0 + '/modes', + schemaPath: '#/items/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } } - }, - "options_length": { - "type": "integer" - } - }, - "oneOf": [{ - "required": ["collection", "value_field", "search_fields"] - }, { - "required": ["collection", "valueField", "searchFields"] - }] - }, - "boolean": {}, - "map": { - "properties": { - "decimals": { - "type": "integer" - }, - "type": { - "type": "string", - "enum": ["Point", "LineString", "Polygon"] - } - } - }, - "date": {}, - "datetime": { - "properties": { - "format": { - "type": "string" - }, - "date_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "time_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "picker_utc": { - "type": "boolean" } - } - }, - "code": { - "properties": { - "default_language": { - "type": "string" - }, - "allow_language_selection": { - "type": "boolean" - }, - "output_code_only": { - "type": "boolean" - }, - "keys": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "lang": { - "type": "string" + var _valid0 = _errs43 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'list') { + const _errs58 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_add !== undefined) { + if (typeof data0.allow_add !== 'boolean') { + const err33 = { + instancePath: instancePath + '/' + i0 + '/allow_add', + schemaPath: '#/items/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; } } - } - } - }, - "color": {} - }, - "required": ["name"] - }, - "uniqueItemProperties": ["name"] - }; - refVal2.errors = null; - refVal[2] = refVal2; - var refVal3 = (function() { - var pattern0 = new RegExp('^[a-zA-Z-_]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; /*# sourceURL=field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e */ - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if ((data && typeof data === "object" && !Array.isArray(data))) { - var errs__0 = errors; - var valid1 = true; - if (data.name === undefined) { - valid1 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + "", - schemaPath: '#/required', - params: { - missingProperty: 'name' - }, - message: 'should have required property \'name\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_1 = errors; - if (typeof data.name !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.name', - schemaPath: '#/properties/name/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.label !== undefined) { - var errs_1 = errors; - if (typeof data.label !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.label', - schemaPath: '#/properties/label/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.widget !== undefined) { - var errs_1 = errors; - if (typeof data.widget !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.widget', - schemaPath: '#/properties/widget/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.required !== undefined) { - var errs_1 = errors; - if (typeof data.required !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.required', - schemaPath: '#/properties/required/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - var data1 = data.i18n; - if (data1 !== undefined) { - var errs_1 = errors; - var errs__1 = errors, - prevValid1 = false, - valid1 = false, - passingSchemas1 = null; - var errs_2 = errors; - if (typeof data1 !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.i18n', - schemaPath: '#/properties/i18n/oneOf/0/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - if (valid2) { - valid1 = prevValid1 = true; - passingSchemas1 = 0; - } - var errs_2 = errors; - if (typeof data1 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.i18n', - schemaPath: '#/properties/i18n/oneOf/1/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema2 = validate.schema.properties.i18n.oneOf[1].enum; - var valid2; - valid2 = false; - for (var i2 = 0; i2 < schema2.length; i2++) - if (equal(data1, schema2[i2])) { - valid2 = true; - break; - } if (!valid2) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.i18n', - schemaPath: '#/properties/i18n/oneOf/1/enum', - params: { - allowedValues: schema2 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - if (valid2 && prevValid1) { - valid1 = false; - passingSchemas1 = [passingSchemas1, 1]; - } else { - if (valid2) { - valid1 = prevValid1 = true; - passingSchemas1 = 1; - } - } - if (!valid1) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '.i18n', - schemaPath: '#/properties/i18n/oneOf', - params: { - passingSchemas: passingSchemas1 - }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__1; - if (vErrors !== null) { - if (errs__1) vErrors.length = errs__1; - else vErrors = null; - } - } - var valid1 = errors === errs_1; - } - if (data.hint !== undefined) { - var errs_1 = errors; - if (typeof data.hint !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.hint', - schemaPath: '#/properties/hint/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - var data1 = data.pattern; - if (data1 !== undefined) { - var errs_1 = errors; - if (Array.isArray(data1)) { - if (data1.length < 2) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.pattern', - schemaPath: '#/properties/pattern/minItems', - params: { - limit: 2 - }, - message: 'should NOT have fewer than 2 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__1 = errors; - var valid1; - valid2 = true; - if (data1.length > 0) { - var data2 = data1[0]; - var errs_2 = errors; - var errs__2 = errors, - prevValid2 = false, - valid2 = false, - passingSchemas2 = null; - var errs_3 = errors; - if (typeof data2 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.pattern[' + 0 + ']', - schemaPath: '#/properties/pattern/items/0/oneOf/0/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data0.collapsed !== undefined) { + if (typeof data0.collapsed !== 'boolean') { + const err34 = { + instancePath: instancePath + '/' + i0 + '/collapsed', + schemaPath: '#/items/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } } - var valid3 = errors === errs_3; - if (valid3) { - valid2 = prevValid2 = true; - passingSchemas2 = 0; - } - var errs_3 = errors; - customRule10.errors = null; - var errs__3 = errors; - var valid3; - customRule10.errors = null; - valid3 = customRule10.call(self, data2, (dataPath || '') + '.pattern[' + 0 + ']', data1, 0, rootData); - if (!valid3) { - if (Array.isArray(customRule10.errors)) { - if (vErrors === null) vErrors = customRule10.errors; - else vErrors = vErrors.concat(customRule10.errors); - errors = vErrors.length; - for (var i3 = errs__3; i3 < errors; i3++) { - var ruleErr3 = vErrors[i3]; - if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '.pattern[' + 0 + ']'; - ruleErr3.schemaPath = "#/properties/pattern/items/0/oneOf/1/instanceof"; + if (data0.summary !== undefined) { + if (typeof data0.summary !== 'string') { + const err35 = { + instancePath: instancePath + '/' + i0 + '/summary', + schemaPath: '#/items/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); } - } else { - var err = { - keyword: 'instanceof', - dataPath: (dataPath || '') + '.pattern[' + 0 + ']', - schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', - params: { - keyword: 'instanceof' - }, - message: 'should pass "instanceof" keyword validation' + errors++; + } + } + if (data0.minimize_collapsed !== undefined) { + if (typeof data0.minimize_collapsed !== 'boolean') { + const err36 = { + instancePath: instancePath + '/' + i0 + '/minimize_collapsed', + schemaPath: '#/items/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } errors++; } } - var valid3 = errors === errs_3; - if (valid3 && prevValid2) { - valid2 = false; - passingSchemas2 = [passingSchemas2, 1]; - } else { - if (valid3) { - valid2 = prevValid2 = true; - passingSchemas2 = 1; + if (data0.label_singular !== undefined) { + if (typeof data0.label_singular !== 'string') { + const err37 = { + instancePath: instancePath + '/' + i0 + '/label_singular', + schemaPath: '#/items/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; } } - if (!valid2) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '.pattern[' + 0 + ']', - schemaPath: '#/properties/pattern/items/0/oneOf', - params: { - passingSchemas: passingSchemas2 - }, - message: 'should match exactly one schema in oneOf' + if (data0.i18n !== undefined) { + if (typeof data0.i18n !== 'boolean') { + const err38 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + if (data0.min !== undefined) { + if (!(typeof data0.min == 'number')) { + const err39 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } + if (data0.max !== undefined) { + if (!(typeof data0.max == 'number')) { + const err40 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + var _valid0 = _errs58 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'object') { + const _errs75 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collapsed !== undefined) { + if (typeof data0.collapsed !== 'boolean') { + const err41 = { + instancePath: instancePath + '/' + i0 + '/collapsed', + schemaPath: '#/items/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + if (data0.i18n !== undefined) { + if (typeof data0.i18n !== 'boolean') { + const err42 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/selectCases/object/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + } + var _valid0 = _errs75 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'relation') { + const _errs80 = errors; + const _errs81 = errors; + let valid21 = false; + let passing2 = null; + const _errs82 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection === undefined) { + const err43 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } errors++; - } else { - errors = errs__2; - if (vErrors !== null) { - if (errs__2) vErrors.length = errs__2; - else vErrors = null; + } + if (data0.value_field === undefined) { + const err44 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); } + errors++; } - var valid2 = errors === errs_2; - } - valid2 = true; - if (data1.length > 1) { - var errs_2 = errors; - if (typeof data1[1] !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.pattern[' + 1 + ']', - schemaPath: '#/properties/pattern/items/1/type', - params: { - type: 'string' - }, - message: 'should be string' + if (data0.search_fields === undefined) { + const err45 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: "must have required property '" + 'search_fields' + "'", }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } errors++; } - var valid2 = errors === errs_2; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.pattern', - schemaPath: '#/properties/pattern/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.field !== undefined) { - var errs_1 = errors; - if (!refVal[3](data.field, (dataPath || '') + '.field', data, 'field', rootData)) { - if (vErrors === null) vErrors = refVal[3].errors; - else vErrors = vErrors.concat(refVal[3].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.fields !== undefined) { - var errs_1 = errors; - if (!refVal4(data.fields, (dataPath || '') + '.fields', data, 'fields', rootData)) { - if (vErrors === null) vErrors = refVal4.errors; - else vErrors = vErrors.concat(refVal4.errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - if (data.types !== undefined) { - var errs_1 = errors; - if (!refVal[4](data.types, (dataPath || '') + '.types', data, 'types', rootData)) { - if (vErrors === null) vErrors = refVal[4].errors; - else vErrors = vErrors.concat(refVal[4].errors); - errors = vErrors.length; - } - var valid1 = errors === errs_1; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema0 = data && data.widget; - var definition0 = RULES.custom['select'].definition; - var keywordValidate0 = definition0.validate; - keywordValidate0.errors = null; - var errs__0 = errors; - var valid0; - if (schema0 === undefined) { - valid0 = true; - } else { - valid0 = definition0.validateSchema(schema0); - if (valid0) { - keywordValidate0.errors = null; - valid0 = keywordValidate0.call(self, schema0, data, validate.schema, (dataPath || ''), parentData, parentDataProperty, rootData); - } - } - if (!valid0) { - if (Array.isArray(keywordValidate0.errors)) { - if (vErrors === null) vErrors = keywordValidate0.errors; - else vErrors = vErrors.concat(keywordValidate0.errors); - errors = vErrors.length; - for (var i0 = errs__0; i0 < errors; i0++) { - var ruleErr0 = vErrors[i0]; - if (ruleErr0.dataPath === undefined) ruleErr0.dataPath = (dataPath || '') + ""; - ruleErr0.schemaPath = "#/select"; - } - } else { - var err = { - keyword: 'select', - dataPath: (dataPath || '') + "", - schemaPath: '#/select', - params: { - keyword: 'select' - }, - message: 'should pass "select" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - customRule14.errors = null; - var errs__0 = errors; - var valid0; - customRule14.errors = null; - valid0 = customRule14.call(self, data, (dataPath || ''), parentData, parentDataProperty, rootData); - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal3.schema = { - "$id": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", - "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" - }, { - "instanceof": "RegExp" - }] - }, { - "type": "string" - }] - }, - "field": { - "$ref": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" - }, - "fields": { - "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" - }, - "types": { - "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" - } - }, - "select": { - "$data": "0/widget" - }, - "selectCases": { - "unknown": {}, - "string": {}, - "number": { - "properties": { - "step": { - "type": "number" - }, - "value_type": { - "type": "string" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" - } - } - }, - "text": {}, - "image": { - "properties": { - "allow_multiple": { - "type": "boolean" - } - } - }, - "file": { - "properties": { - "allow_multiple": { - "type": "boolean" - } - } - }, - "select": { - "properties": { - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "options": { - "type": "array", - "items": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }, { - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }] - } - }, - "required": ["label", "value"] - }] + var _valid3 = _errs82 === errors; + if (_valid3) { + valid21 = true; + passing2 = 0; } - } - }, - "required": ["options"] - }, - "markdown": { - "properties": { - "minimal": { - "type": "boolean" - }, - "buttons": { - "type": "array", - "items": { - "type": "string", - "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] + const _errs83 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection === undefined) { + const err46 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + if (data0.valueField === undefined) { + const err47 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + if (data0.searchFields === undefined) { + const err48 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } } - }, - "editor_components": { - "type": "array", - "items": { - "type": "string" + var _valid3 = _errs83 === errors; + if (_valid3 && valid21) { + valid21 = false; + passing2 = [passing2, 1]; + } else { + if (_valid3) { + valid21 = true; + passing2 = 1; + } } - }, - "modes": { - "type": "array", - "items": { - "type": "string", - "enum": ["raw", "rich_text"] - }, - "minItems": 1 - } - } - }, - "list": { - "properties": { - "allow_add": { - "type": "boolean" - }, - "collapsed": { - "type": "boolean" - }, - "summary": { - "type": "string" - }, - "minimize_collapsed": { - "type": "boolean" - }, - "label_singular": { - "type": "string" - }, - "i18n": { - "type": "boolean" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" - } - } - }, - "object": { - "properties": { - "collapsed": { - "type": "boolean" - }, - "i18n": { - "type": "boolean" - } - } - }, - "relation": { - "properties": { - "collection": { - "type": "string" - }, - "value_field": { - "type": "string" - }, - "search_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" + if (!valid21) { + const err49 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing2 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } else { + errors = _errs81; + if (vErrors !== null) { + if (_errs81) { + vErrors.length = _errs81; + } else { + vErrors = null; + } + } } - }, - "file": { - "type": "string" - }, - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "display_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - }, - "options_length": { - "type": "integer" - } - }, - "oneOf": [{ - "required": ["collection", "value_field", "search_fields"] - }, { - "required": ["collection", "valueField", "searchFields"] - }] - }, - "boolean": {}, - "map": { - "properties": { - "decimals": { - "type": "integer" - }, - "type": { - "type": "string", - "enum": ["Point", "LineString", "Polygon"] - } - } - }, - "date": {}, - "datetime": { - "properties": { - "format": { - "type": "string" - }, - "date_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "time_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "picker_utc": { - "type": "boolean" - } - } - }, - "code": { - "properties": { - "default_language": { - "type": "string" - }, - "allow_language_selection": { - "type": "boolean" - }, - "output_code_only": { - "type": "boolean" - }, - "keys": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "lang": { - "type": "string" - } - } - } - } - }, - "color": {} - }, - "required": ["name"] - }; - refVal3.errors = null; - refVal[3] = refVal3; - var refVal4 = (function() { - var pattern0 = new RegExp('^[a-zA-Z-_]+$'); - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; /*# sourceURL=fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e */ - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if (Array.isArray(data)) { - if (data.length < 1) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + "", - schemaPath: '#/minItems', - params: { - limit: 1 - }, - message: 'should NOT have fewer than 1 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__0 = errors; - var valid0; - for (var i0 = 0; i0 < data.length; i0++) { - var data1 = data[i0]; - var errs_1 = errors; - if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { - var errs__1 = errors; - var valid2 = true; - if (data1.name === undefined) { - valid2 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '[' + i0 + ']', - schemaPath: '#/items/required', - params: { - missingProperty: 'name' - }, - message: 'should have required property \'name\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_2 = errors; - if (typeof data1.name !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].name', - schemaPath: '#/items/properties/name/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - if (data1.label !== undefined) { - var errs_2 = errors; - if (typeof data1.label !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].label', - schemaPath: '#/items/properties/label/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - if (data1.widget !== undefined) { - var errs_2 = errors; - if (typeof data1.widget !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].widget', - schemaPath: '#/items/properties/widget/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - if (data1.required !== undefined) { - var errs_2 = errors; - if (typeof data1.required !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].required', - schemaPath: '#/items/properties/required/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - var data2 = data1.i18n; - if (data2 !== undefined) { - var errs_2 = errors; - var errs__2 = errors, - prevValid2 = false, - valid2 = false, - passingSchemas2 = null; - var errs_3 = errors; - if (typeof data2 !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', - schemaPath: '#/items/properties/i18n/oneOf/0/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection !== undefined) { + if (typeof data0.collection !== 'string') { + const err50 = { + instancePath: instancePath + '/' + i0 + '/collection', + schemaPath: '#/items/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } } - var valid3 = errors === errs_3; - if (valid3) { - valid2 = prevValid2 = true; - passingSchemas2 = 0; + if (data0.value_field !== undefined) { + if (typeof data0.value_field !== 'string') { + const err51 = { + instancePath: instancePath + '/' + i0 + '/value_field', + schemaPath: '#/items/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } } - var errs_3 = errors; - if (typeof data2 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', - schemaPath: '#/items/properties/i18n/oneOf/1/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data0.search_fields !== undefined) { + let data33 = data0.search_fields; + if (Array.isArray(data33)) { + if (data33.length < 1) { + const err52 = { + instancePath: instancePath + '/' + i0 + '/search_fields', + schemaPath: '#/items/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + const len5 = data33.length; + for (let i5 = 0; i5 < len5; i5++) { + if (typeof data33[i5] !== 'string') { + const err53 = { + instancePath: instancePath + '/' + i0 + '/search_fields/' + i5, + schemaPath: + '#/items/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + } else { + const err54 = { + instancePath: instancePath + '/' + i0 + '/search_fields', + schemaPath: '#/items/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } } - var schema3 = validate.schema.items.properties.i18n.oneOf[1].enum; - var valid3; - valid3 = false; - for (var i3 = 0; i3 < schema3.length; i3++) - if (equal(data2, schema3[i3])) { - valid3 = true; - break; - } if (!valid3) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', - schemaPath: '#/items/properties/i18n/oneOf/1/enum', - params: { - allowedValues: schema3 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data0.file !== undefined) { + if (typeof data0.file !== 'string') { + const err55 = { + instancePath: instancePath + '/' + i0 + '/file', + schemaPath: '#/items/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } } - var valid3 = errors === errs_3; - if (valid3 && prevValid2) { - valid2 = false; - passingSchemas2 = [passingSchemas2, 1]; - } else { - if (valid3) { - valid2 = prevValid2 = true; - passingSchemas2 = 1; + if (data0.multiple !== undefined) { + if (typeof data0.multiple !== 'boolean') { + const err56 = { + instancePath: instancePath + '/' + i0 + '/multiple', + schemaPath: '#/items/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; } } - if (!valid2) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '[' + i0 + '].i18n', - schemaPath: '#/items/properties/i18n/oneOf', - params: { - passingSchemas: passingSchemas2 - }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__2; - if (vErrors !== null) { - if (errs__2) vErrors.length = errs__2; - else vErrors = null; + if (data0.min !== undefined) { + let data37 = data0.min; + if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { + const err57 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; } } - var valid2 = errors === errs_2; - } - if (data1.hint !== undefined) { - var errs_2 = errors; - if (typeof data1.hint !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].hint', - schemaPath: '#/items/properties/hint/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data0.max !== undefined) { + let data38 = data0.max; + if (!(typeof data38 == 'number' && !(data38 % 1) && !isNaN(data38))) { + const err58 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } } - var valid2 = errors === errs_2; - } - var data2 = data1.pattern; - if (data2 !== undefined) { - var errs_2 = errors; - if (Array.isArray(data2)) { - if (data2.length < 2) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '[' + i0 + '].pattern', - schemaPath: '#/items/properties/pattern/minItems', - params: { - limit: 2 - }, - message: 'should NOT have fewer than 2 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__2 = errors; - var valid2; - valid3 = true; - if (data2.length > 0) { - var data3 = data2[0]; - var errs_3 = errors; - var errs__3 = errors, - prevValid3 = false, - valid3 = false, - passingSchemas3 = null; - var errs_4 = errors; - if (typeof data3 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', - schemaPath: '#/items/properties/pattern/items/0/oneOf/0/type', - params: { - type: 'string' - }, - message: 'should be string' + if (data0.display_fields !== undefined) { + let data39 = data0.display_fields; + if (Array.isArray(data39)) { + if (data39.length < 1) { + const err59 = { + instancePath: instancePath + '/' + i0 + '/display_fields', + schemaPath: '#/items/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } errors++; } - var valid4 = errors === errs_4; - if (valid4) { - valid3 = prevValid3 = true; - passingSchemas3 = 0; - } - var errs_4 = errors; - customRule11.errors = null; - var errs__4 = errors; - var valid4; - customRule11.errors = null; - valid4 = customRule11.call(self, data3, (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', data2, 0, rootData); - if (!valid4) { - if (Array.isArray(customRule11.errors)) { - if (vErrors === null) vErrors = customRule11.errors; - else vErrors = vErrors.concat(customRule11.errors); - errors = vErrors.length; - for (var i4 = errs__4; i4 < errors; i4++) { - var ruleErr4 = vErrors[i4]; - if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']'; - ruleErr4.schemaPath = "#/items/properties/pattern/items/0/oneOf/1/instanceof"; - } - } else { - var err = { - keyword: 'instanceof', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', - schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', - params: { - keyword: 'instanceof' - }, - message: 'should pass "instanceof" keyword validation' + const len6 = data39.length; + for (let i6 = 0; i6 < len6; i6++) { + if (typeof data39[i6] !== 'string') { + const err60 = { + instancePath: instancePath + '/' + i0 + '/display_fields/' + i6, + schemaPath: + '#/items/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } errors++; } } - var valid4 = errors === errs_4; - if (valid4 && prevValid3) { - valid3 = false; - passingSchemas3 = [passingSchemas3, 1]; - } else { - if (valid4) { - valid3 = prevValid3 = true; - passingSchemas3 = 1; - } - } - if (!valid3) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 0 + ']', - schemaPath: '#/items/properties/pattern/items/0/oneOf', - params: { - passingSchemas: passingSchemas3 - }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } else { + const err61 = { + instancePath: instancePath + '/' + i0 + '/display_fields', + schemaPath: '#/items/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err61]; } else { - errors = errs__3; - if (vErrors !== null) { - if (errs__3) vErrors.length = errs__3; - else vErrors = null; - } + vErrors.push(err61); } - var valid3 = errors === errs_3; + errors++; } - valid3 = true; - if (data2.length > 1) { - var errs_3 = errors; - if (typeof data2[1] !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern[' + 1 + ']', - schemaPath: '#/items/properties/pattern/items/1/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } + if (data0.options_length !== undefined) { + let data41 = data0.options_length; + if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { + const err62 = { + instancePath: instancePath + '/' + i0 + '/options_length', + schemaPath: '#/items/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); } - var valid3 = errors === errs_3; + errors++; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + '].pattern', - schemaPath: '#/items/properties/pattern/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var valid2 = errors === errs_2; } - if (data1.field !== undefined) { - var errs_2 = errors; - if (!refVal[3](data1.field, (dataPath || '') + '[' + i0 + '].field', data1, 'field', rootData)) { - if (vErrors === null) vErrors = refVal[3].errors; - else vErrors = vErrors.concat(refVal[3].errors); - errors = vErrors.length; + var _valid0 = _errs80 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'boolean') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'map') { + const _errs106 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.decimals !== undefined) { + let data42 = data0.decimals; + if (!(typeof data42 == 'number' && !(data42 % 1) && !isNaN(data42))) { + const err63 = { + instancePath: instancePath + '/' + i0 + '/decimals', + schemaPath: '#/items/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } } - var valid2 = errors === errs_2; - } - if (data1.fields !== undefined) { - var errs_2 = errors; - if (!refVal[4](data1.fields, (dataPath || '') + '[' + i0 + '].fields', data1, 'fields', rootData)) { - if (vErrors === null) vErrors = refVal[4].errors; - else vErrors = vErrors.concat(refVal[4].errors); - errors = vErrors.length; + if (data0.type !== undefined) { + let data43 = data0.type; + if (typeof data43 !== 'string') { + const err64 = { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/selectCases/map/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + if (!(data43 === 'Point' || data43 === 'LineString' || data43 === 'Polygon')) { + const err65 = { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/selectCases/map/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema42.items.selectCases.map.properties.type.enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } } - var valid2 = errors === errs_2; } - if (data1.types !== undefined) { - var errs_2 = errors; - if (!refVal[4](data1.types, (dataPath || '') + '[' + i0 + '].types', data1, 'types', rootData)) { - if (vErrors === null) vErrors = refVal[4].errors; - else vErrors = vErrors.concat(refVal[4].errors); - errors = vErrors.length; + var _valid0 = _errs106 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'date') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'datetime') { + const _errs111 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.format !== undefined) { + if (typeof data0.format !== 'string') { + const err66 = { + instancePath: instancePath + '/' + i0 + '/format', + schemaPath: '#/items/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } } - var valid2 = errors === errs_2; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '[' + i0 + ']', - schemaPath: '#/items/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema1 = data1 && data1.widget; - var definition1 = RULES.custom['select'].definition; - var keywordValidate1 = definition1.validate; - keywordValidate1.errors = null; - var errs__1 = errors; - var valid1; - if (schema1 === undefined) { - valid1 = true; - } else { - valid1 = definition1.validateSchema(schema1); - if (valid1) { - keywordValidate1.errors = null; - valid1 = keywordValidate1.call(self, schema1, data1, validate.schema.items, (dataPath || '') + '[' + i0 + ']', data, i0, rootData); - } - } - if (!valid1) { - if (Array.isArray(keywordValidate1.errors)) { - if (vErrors === null) vErrors = keywordValidate1.errors; - else vErrors = vErrors.concat(keywordValidate1.errors); - errors = vErrors.length; - for (var i1 = errs__1; i1 < errors; i1++) { - var ruleErr1 = vErrors[i1]; - if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '[' + i0 + ']'; - ruleErr1.schemaPath = "#/items/select"; + if (data0.date_format !== undefined) { + let data45 = data0.date_format; + const _errs115 = errors; + let valid29 = false; + let passing3 = null; + const _errs116 = errors; + if (typeof data45 !== 'string') { + const err67 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } + var _valid4 = _errs116 === errors; + if (_valid4) { + valid29 = true; + passing3 = 0; + } + const _errs118 = errors; + if (typeof data45 !== 'boolean') { + const err68 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + var _valid4 = _errs118 === errors; + if (_valid4 && valid29) { + valid29 = false; + passing3 = [passing3, 1]; + } else { + if (_valid4) { + valid29 = true; + passing3 = 1; + } + } + if (!valid29) { + const err69 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing3 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } else { + errors = _errs115; + if (vErrors !== null) { + if (_errs115) { + vErrors.length = _errs115; + } else { + vErrors = null; + } + } + } + } + if (data0.time_format !== undefined) { + let data46 = data0.time_format; + const _errs121 = errors; + let valid30 = false; + let passing4 = null; + const _errs122 = errors; + if (typeof data46 !== 'string') { + const err70 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var _valid5 = _errs122 === errors; + if (_valid5) { + valid30 = true; + passing4 = 0; + } + const _errs124 = errors; + if (typeof data46 !== 'boolean') { + const err71 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var _valid5 = _errs124 === errors; + if (_valid5 && valid30) { + valid30 = false; + passing4 = [passing4, 1]; + } else { + if (_valid5) { + valid30 = true; + passing4 = 1; + } + } + if (!valid30) { + const err72 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing4 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } else { + errors = _errs121; + if (vErrors !== null) { + if (_errs121) { + vErrors.length = _errs121; + } else { + vErrors = null; + } + } + } + } + if (data0.picker_utc !== undefined) { + if (typeof data0.picker_utc !== 'boolean') { + const err73 = { + instancePath: instancePath + '/' + i0 + '/picker_utc', + schemaPath: '#/items/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + } + } + var _valid0 = _errs111 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'code') { + const _errs128 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.default_language !== undefined) { + if (typeof data0.default_language !== 'string') { + const err74 = { + instancePath: instancePath + '/' + i0 + '/default_language', + schemaPath: '#/items/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } + if (data0.allow_language_selection !== undefined) { + if (typeof data0.allow_language_selection !== 'boolean') { + const err75 = { + instancePath: instancePath + '/' + i0 + '/allow_language_selection', + schemaPath: '#/items/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + if (data0.output_code_only !== undefined) { + if (typeof data0.output_code_only !== 'boolean') { + const err76 = { + instancePath: instancePath + '/' + i0 + '/output_code_only', + schemaPath: '#/items/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } + if (data0.keys !== undefined) { + let data51 = data0.keys; + if (data51 && typeof data51 == 'object' && !Array.isArray(data51)) { + if (data51.code !== undefined) { + if (typeof data51.code !== 'string') { + const err77 = { + instancePath: instancePath + '/' + i0 + '/keys/code', + schemaPath: '#/items/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + if (data51.lang !== undefined) { + if (typeof data51.lang !== 'string') { + const err78 = { + instancePath: instancePath + '/' + i0 + '/keys/lang', + schemaPath: '#/items/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + } else { + const err79 = { + instancePath: instancePath + '/' + i0 + '/keys', + schemaPath: '#/items/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } } - } else { - var err = { - keyword: 'select', - dataPath: (dataPath || '') + '[' + i0 + ']', - schemaPath: '#/items/select', - params: { - keyword: 'select' - }, - message: 'should pass "select" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } + var _valid0 = _errs128 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'color') { + var _valid0 = true; + valid2 = _valid0; } - customRule12.errors = null; - var errs__1 = errors; - var valid1; - customRule12.errors = null; - valid1 = customRule12.call(self, data1, (dataPath || '') + '[' + i0 + ']', data, i0, rootData); - var valid1 = errors === errs_1; - } - customRule13.errors = null; - var errs__0 = errors; - var valid0; - customRule13.errors = null; - valid0 = customRule13.call(self, data, (dataPath || ''), parentData, parentDataProperty, rootData); - if (!valid0) { - if (Array.isArray(customRule13.errors)) { - if (vErrors === null) vErrors = customRule13.errors; - else vErrors = vErrors.concat(customRule13.errors); - errors = vErrors.length; - for (var i0 = errs__0; i0 < errors; i0++) { - var ruleErr0 = vErrors[i0]; - if (ruleErr0.dataPath === undefined) ruleErr0.dataPath = (dataPath || '') + ""; - ruleErr0.schemaPath = "#/uniqueItemProperties"; + if (!valid2) { + const err80 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); } + errors++; + } + } + } + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.name === undefined) { + const err81 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err81]; } else { - var err = { - keyword: 'uniqueItemProperties', - dataPath: (dataPath || '') + "", - schemaPath: '#/uniqueItemProperties', - params: { - keyword: 'uniqueItemProperties' - }, - message: 'should pass "uniqueItemProperties" keyword validation' + vErrors.push(err81); + } + errors++; + } + if (data0.name !== undefined) { + if (typeof data0.name !== 'string') { + const err82 = { + instancePath: instancePath + '/' + i0 + '/name', + schemaPath: '#/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } errors++; } } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - validate.errors = vErrors; - return errors === 0; - }; - })(); - refVal4.schema = { - "$id": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", - "type": "array", - "minItems": 1, - "items": { - "$id": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", - "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" - }, { - "instanceof": "RegExp" - }] - }, { - "type": "string" - }] - }, - "field": { - "$ref": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" - }, - "fields": { - "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" - }, - "types": { - "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + if (data0.label !== undefined) { + if (typeof data0.label !== 'string') { + const err83 = { + instancePath: instancePath + '/' + i0 + '/label', + schemaPath: '#/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } } - }, - "select": { - "$data": "0/widget" - }, - "selectCases": { - "unknown": {}, - "string": {}, - "number": { - "properties": { - "step": { - "type": "number" - }, - "value_type": { - "type": "string" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" + if (data0.widget !== undefined) { + if (typeof data0.widget !== 'string') { + const err84 = { + instancePath: instancePath + '/' + i0 + '/widget', + schemaPath: '#/items/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); } + errors++; } - }, - "text": {}, - "image": { - "properties": { - "allow_multiple": { - "type": "boolean" + } + if (data0.required !== undefined) { + if (typeof data0.required !== 'boolean') { + const err85 = { + instancePath: instancePath + '/' + i0 + '/required', + schemaPath: '#/items/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); } + errors++; } - }, - "file": { - "properties": { - "allow_multiple": { - "type": "boolean" + } + if (data0.i18n !== undefined) { + let data58 = data0.i18n; + const _errs151 = errors; + let valid34 = false; + let passing5 = null; + const _errs152 = errors; + if (typeof data58 !== 'boolean') { + const err86 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); } + errors++; } - }, - "select": { - "properties": { - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "options": { - "type": "array", - "items": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }, { - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }] - } - }, - "required": ["label", "value"] - }] - } + var _valid6 = _errs152 === errors; + if (_valid6) { + valid34 = true; + passing5 = 0; + } + const _errs154 = errors; + if (typeof data58 !== 'string') { + const err87 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); } - }, - "required": ["options"] - }, - "markdown": { - "properties": { - "minimal": { - "type": "boolean" - }, - "buttons": { - "type": "array", - "items": { - "type": "string", - "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] - } - }, - "editor_components": { - "type": "array", - "items": { - "type": "string" - } - }, - "modes": { - "type": "array", - "items": { - "type": "string", - "enum": ["raw", "rich_text"] - }, - "minItems": 1 + errors++; + } + if (!(data58 === 'translate' || data58 === 'duplicate' || data58 === 'none')) { + const err88 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/enum', + keyword: 'enum', + params: { allowedValues: schema42.items.properties.i18n.oneOf[1].enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); } + errors++; } - }, - "list": { - "properties": { - "allow_add": { - "type": "boolean" - }, - "collapsed": { - "type": "boolean" - }, - "summary": { - "type": "string" - }, - "minimize_collapsed": { - "type": "boolean" - }, - "label_singular": { - "type": "string" - }, - "i18n": { - "type": "boolean" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" + var _valid6 = _errs154 === errors; + if (_valid6 && valid34) { + valid34 = false; + passing5 = [passing5, 1]; + } else { + if (_valid6) { + valid34 = true; + passing5 = 1; } } - }, - "object": { - "properties": { - "collapsed": { - "type": "boolean" - }, - "i18n": { - "type": "boolean" + if (!valid34) { + const err89 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing5 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } else { + errors = _errs151; + if (vErrors !== null) { + if (_errs151) { + vErrors.length = _errs151; + } else { + vErrors = null; + } } } - }, - "relation": { - "properties": { - "collection": { - "type": "string" - }, - "value_field": { - "type": "string" - }, - "search_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" + } + if (data0.hint !== undefined) { + if (typeof data0.hint !== 'string') { + const err90 = { + instancePath: instancePath + '/' + i0 + '/hint', + schemaPath: '#/items/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + if (data0.pattern !== undefined) { + let data60 = data0.pattern; + if (Array.isArray(data60)) { + if (data60.length < 2) { + const err91 = { + instancePath: instancePath + '/' + i0 + '/pattern', + schemaPath: '#/items/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); } - }, - "file": { - "type": "string" - }, - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "display_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" + errors++; + } + const len7 = data60.length; + if (len7 > 0) { + const _errs161 = errors; + let valid36 = false; + let passing6 = null; + const _errs162 = errors; + if (typeof data60[0] !== 'string') { + const err92 = { + 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 = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + var _valid7 = _errs162 === errors; + if (_valid7) { + valid36 = true; + passing6 = 0; + } + var _valid7 = true; + if (_valid7 && valid36) { + valid36 = false; + passing6 = [passing6, 1]; + } else { + if (_valid7) { + valid36 = true; + passing6 = 1; + } + } + if (!valid36) { + const err93 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing6 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } else { + errors = _errs161; + if (vErrors !== null) { + if (_errs161) { + vErrors.length = _errs161; + } else { + vErrors = null; + } + } } - }, - "options_length": { - "type": "integer" } - }, - "oneOf": [{ - "required": ["collection", "value_field", "search_fields"] - }, { - "required": ["collection", "valueField", "searchFields"] - }] - }, - "boolean": {}, - "map": { - "properties": { - "decimals": { - "type": "integer" - }, - "type": { - "type": "string", - "enum": ["Point", "LineString", "Polygon"] + if (len7 > 1) { + if (typeof data60[1] !== 'string') { + const err94 = { + 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 = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } } - } - }, - "date": {}, - "datetime": { - "properties": { - "format": { - "type": "string" - }, - "date_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "time_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "picker_utc": { - "type": "boolean" + } else { + const err95 = { + instancePath: instancePath + '/' + i0 + '/pattern', + schemaPath: '#/items/properties/pattern/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); } + errors++; } - }, - "code": { - "properties": { - "default_language": { - "type": "string" - }, - "allow_language_selection": { - "type": "boolean" - }, - "output_code_only": { - "type": "boolean" - }, - "keys": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "lang": { - "type": "string" + } + 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 err96 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + } else { + const err97 = { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + validate26.errors = vErrors; + return errors === 0; +} +function validate25( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + /*# sourceURL="field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */ 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 == 'unknown') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'string') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'number') { + const _errs1 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.step !== undefined) { + if (!(typeof data.step == 'number')) { + const err1 = { + instancePath: instancePath + '/step', + schemaPath: '#/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } + if (data.value_type !== undefined) { + if (typeof data.value_type !== 'string') { + const err2 = { + instancePath: instancePath + '/value_type', + schemaPath: '#/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + if (data.min !== undefined) { + if (!(typeof data.min == 'number')) { + const err3 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + if (data.max !== undefined) { + if (!(typeof data.max == 'number')) { + const err4 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + } + var _valid0 = _errs1 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'text') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'image') { + const _errs10 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_multiple !== undefined) { + if (typeof data.allow_multiple !== 'boolean') { + const err5 = { + instancePath: instancePath + '/allow_multiple', + schemaPath: '#/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + } + var _valid0 = _errs10 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'file') { + const _errs13 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_multiple !== undefined) { + if (typeof data.allow_multiple !== 'boolean') { + const err6 = { + instancePath: instancePath + '/allow_multiple', + schemaPath: '#/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + } + var _valid0 = _errs13 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'select') { + const _errs16 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.options === undefined) { + const err7 = { + instancePath, + schemaPath: '#/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + if (data.multiple !== undefined) { + if (typeof data.multiple !== 'boolean') { + const err8 = { + instancePath: instancePath + '/multiple', + schemaPath: '#/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + if (data.min !== undefined) { + let data7 = data.min; + if (!(typeof data7 == 'number' && !(data7 % 1) && !isNaN(data7))) { + const err9 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + if (data.max !== undefined) { + let data8 = data.max; + if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { + const err10 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + if (data.options !== undefined) { + let data9 = data.options; + if (Array.isArray(data9)) { + const len0 = data9.length; + for (let i0 = 0; i0 < len0; i0++) { + let data10 = data9[i0]; + const _errs26 = errors; + let valid7 = false; + let passing0 = null; + const _errs27 = errors; + if (typeof data10 !== 'string') { + const err11 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + var _valid1 = _errs27 === errors; + if (_valid1) { + valid7 = true; + passing0 = 0; + } + const _errs29 = errors; + if (!(typeof data10 == 'number')) { + const err12 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + var _valid1 = _errs29 === errors; + if (_valid1 && valid7) { + valid7 = false; + passing0 = [passing0, 1]; + } else { + if (_valid1) { + valid7 = true; + passing0 = 1; + } + const _errs31 = errors; + if (data10 && typeof data10 == 'object' && !Array.isArray(data10)) { + if (data10.label === undefined) { + const err13 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + if (data10.value === undefined) { + const err14 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + if (data10.label !== undefined) { + if (typeof data10.label !== 'string') { + const err15 = { + instancePath: instancePath + '/options/' + i0 + '/label', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + if (data10.value !== undefined) { + let data12 = data10.value; + const _errs36 = errors; + let valid9 = false; + let passing1 = null; + const _errs37 = errors; + if (typeof data12 !== 'string') { + const err16 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + var _valid2 = _errs37 === errors; + if (_valid2) { + valid9 = true; + passing1 = 0; + } + const _errs39 = errors; + if (!(typeof data12 == 'number')) { + const err17 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var _valid2 = _errs39 === errors; + if (_valid2 && valid9) { + valid9 = false; + passing1 = [passing1, 1]; + } else { + if (_valid2) { + valid9 = true; + passing1 = 1; + } + } + if (!valid9) { + const err18 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs36; + if (vErrors !== null) { + if (_errs36) { + vErrors.length = _errs36; + } else { + vErrors = null; + } + } + } + } + } else { + const err19 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var _valid1 = _errs31 === errors; + if (_valid1 && valid7) { + valid7 = false; + passing0 = [passing0, 2]; + } else { + if (_valid1) { + valid7 = true; + passing0 = 2; + } + } + } + if (!valid7) { + const err20 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing0 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } else { + errors = _errs26; + if (vErrors !== null) { + if (_errs26) { + vErrors.length = _errs26; + } else { + vErrors = null; + } + } + } + } + } else { + const err21 = { + instancePath: instancePath + '/options', + schemaPath: '#/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var _valid0 = _errs16 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'markdown') { + const _errs41 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.minimal !== undefined) { + if (typeof data.minimal !== 'boolean') { + const err22 = { + instancePath: instancePath + '/minimal', + schemaPath: '#/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } + if (data.buttons !== undefined) { + let data14 = data.buttons; + if (Array.isArray(data14)) { + const len1 = data14.length; + for (let i1 = 0; i1 < len1; i1++) { + let data15 = data14[i1]; + if (typeof data15 !== 'string') { + const err23 = { + instancePath: instancePath + '/buttons/' + i1, + schemaPath: '#/selectCases/markdown/properties/buttons/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data15 === 'bold' || + data15 === 'italic' || + data15 === 'code' || + data15 === 'link' || + data15 === 'heading-one' || + data15 === 'heading-two' || + data15 === 'heading-three' || + data15 === 'heading-four' || + data15 === 'heading-five' || + data15 === 'heading-six' || + data15 === 'quote' || + data15 === 'bulleted-list' || + data15 === 'numbered-list' + ) + ) { + const err24 = { + instancePath: instancePath + '/buttons/' + i1, + schemaPath: '#/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', + params: { + allowedValues: schema41.selectCases.markdown.properties.buttons.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + } + } else { + const err25 = { + instancePath: instancePath + '/buttons', + schemaPath: '#/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + if (data.editor_components !== undefined) { + let data16 = data.editor_components; + if (Array.isArray(data16)) { + const len2 = data16.length; + for (let i2 = 0; i2 < len2; i2++) { + if (typeof data16[i2] !== 'string') { + const err26 = { + instancePath: instancePath + '/editor_components/' + i2, + schemaPath: '#/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + } else { + const err27 = { + instancePath: instancePath + '/editor_components', + schemaPath: '#/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + if (data.modes !== undefined) { + let data18 = data.modes; + if (Array.isArray(data18)) { + if (data18.length < 1) { + const err28 = { + instancePath: instancePath + '/modes', + schemaPath: '#/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + const len3 = data18.length; + for (let i3 = 0; i3 < len3; i3++) { + let data19 = data18[i3]; + if (typeof data19 !== 'string') { + const err29 = { + instancePath: instancePath + '/modes/' + i3, + schemaPath: '#/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + if (!(data19 === 'raw' || data19 === 'rich_text')) { + const err30 = { + instancePath: instancePath + '/modes/' + i3, + schemaPath: '#/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: schema41.selectCases.markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + } + } else { + const err31 = { + instancePath: instancePath + '/modes', + schemaPath: '#/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } + } + var _valid0 = _errs41 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'list') { + const _errs56 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_add !== undefined) { + if (typeof data.allow_add !== 'boolean') { + const err32 = { + instancePath: instancePath + '/allow_add', + schemaPath: '#/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + if (data.collapsed !== undefined) { + if (typeof data.collapsed !== 'boolean') { + const err33 = { + instancePath: instancePath + '/collapsed', + schemaPath: '#/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + } + if (data.summary !== undefined) { + if (typeof data.summary !== 'string') { + const err34 = { + instancePath: instancePath + '/summary', + schemaPath: '#/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + } + if (data.minimize_collapsed !== undefined) { + if (typeof data.minimize_collapsed !== 'boolean') { + const err35 = { + instancePath: instancePath + '/minimize_collapsed', + schemaPath: '#/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } + if (data.label_singular !== undefined) { + if (typeof data.label_singular !== 'string') { + const err36 = { + instancePath: instancePath + '/label_singular', + schemaPath: '#/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + if (data.i18n !== undefined) { + if (typeof data.i18n !== 'boolean') { + const err37 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + if (data.min !== undefined) { + if (!(typeof data.min == 'number')) { + const err38 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + if (data.max !== undefined) { + if (!(typeof data.max == 'number')) { + const err39 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } + } + var _valid0 = _errs56 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'object') { + const _errs73 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collapsed !== undefined) { + if (typeof data.collapsed !== 'boolean') { + const err40 = { + instancePath: instancePath + '/collapsed', + schemaPath: '#/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + if (data.i18n !== undefined) { + if (typeof data.i18n !== 'boolean') { + const err41 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/selectCases/object/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + var _valid0 = _errs73 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'relation') { + const _errs78 = errors; + const _errs79 = errors; + let valid19 = false; + let passing2 = null; + const _errs80 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection === undefined) { + const err42 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + if (data.value_field === undefined) { + const err43 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + if (data.search_fields === undefined) { + const err44 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: "must have required property '" + 'search_fields' + "'", + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var _valid3 = _errs80 === errors; + if (_valid3) { + valid19 = true; + passing2 = 0; + } + const _errs81 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection === undefined) { + const err45 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + if (data.valueField === undefined) { + const err46 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + if (data.searchFields === undefined) { + const err47 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var _valid3 = _errs81 === errors; + if (_valid3 && valid19) { + valid19 = false; + passing2 = [passing2, 1]; + } else { + if (_valid3) { + valid19 = true; + passing2 = 1; + } + } + if (!valid19) { + const err48 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing2 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } else { + errors = _errs79; + if (vErrors !== null) { + if (_errs79) { + vErrors.length = _errs79; + } else { + vErrors = null; + } + } + } + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection !== undefined) { + if (typeof data.collection !== 'string') { + const err49 = { + instancePath: instancePath + '/collection', + schemaPath: '#/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + if (data.value_field !== undefined) { + if (typeof data.value_field !== 'string') { + const err50 = { + instancePath: instancePath + '/value_field', + schemaPath: '#/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + } + if (data.search_fields !== undefined) { + let data32 = data.search_fields; + if (Array.isArray(data32)) { + if (data32.length < 1) { + const err51 = { + instancePath: instancePath + '/search_fields', + schemaPath: '#/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + const len4 = data32.length; + for (let i4 = 0; i4 < len4; i4++) { + if (typeof data32[i4] !== 'string') { + const err52 = { + instancePath: instancePath + '/search_fields/' + i4, + schemaPath: '#/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } else { + const err53 = { + instancePath: instancePath + '/search_fields', + schemaPath: '#/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + if (data.file !== undefined) { + if (typeof data.file !== 'string') { + const err54 = { + instancePath: instancePath + '/file', + schemaPath: '#/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + if (data.multiple !== undefined) { + if (typeof data.multiple !== 'boolean') { + const err55 = { + instancePath: instancePath + '/multiple', + schemaPath: '#/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + if (data.min !== undefined) { + let data36 = data.min; + if (!(typeof data36 == 'number' && !(data36 % 1) && !isNaN(data36))) { + const err56 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + if (data.max !== undefined) { + let data37 = data.max; + if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { + const err57 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } + if (data.display_fields !== undefined) { + let data38 = data.display_fields; + if (Array.isArray(data38)) { + if (data38.length < 1) { + const err58 = { + instancePath: instancePath + '/display_fields', + schemaPath: '#/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + const len5 = data38.length; + for (let i5 = 0; i5 < len5; i5++) { + if (typeof data38[i5] !== 'string') { + const err59 = { + instancePath: instancePath + '/display_fields/' + i5, + schemaPath: '#/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } + } else { + const err60 = { + instancePath: instancePath + '/display_fields', + schemaPath: '#/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + if (data.options_length !== undefined) { + let data40 = data.options_length; + if (!(typeof data40 == 'number' && !(data40 % 1) && !isNaN(data40))) { + const err61 = { + instancePath: instancePath + '/options_length', + schemaPath: '#/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + } + var _valid0 = _errs78 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'boolean') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'map') { + const _errs104 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.decimals !== undefined) { + let data41 = data.decimals; + if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { + const err62 = { + instancePath: instancePath + '/decimals', + schemaPath: '#/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + if (data.type !== undefined) { + let data42 = data.type; + if (typeof data42 !== 'string') { + const err63 = { + instancePath: instancePath + '/type', + schemaPath: '#/selectCases/map/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + if (!(data42 === 'Point' || data42 === 'LineString' || data42 === 'Polygon')) { + const err64 = { + instancePath: instancePath + '/type', + schemaPath: '#/selectCases/map/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema41.selectCases.map.properties.type.enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + var _valid0 = _errs104 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'date') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'datetime') { + const _errs109 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.format !== undefined) { + if (typeof data.format !== 'string') { + const err65 = { + instancePath: instancePath + '/format', + schemaPath: '#/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + if (data.date_format !== undefined) { + let data44 = data.date_format; + const _errs113 = errors; + let valid27 = false; + let passing3 = null; + const _errs114 = errors; + if (typeof data44 !== 'string') { + const err66 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + var _valid4 = _errs114 === errors; + if (_valid4) { + valid27 = true; + passing3 = 0; + } + const _errs116 = errors; + if (typeof data44 !== 'boolean') { + const err67 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } + var _valid4 = _errs116 === errors; + if (_valid4 && valid27) { + valid27 = false; + passing3 = [passing3, 1]; + } else { + if (_valid4) { + valid27 = true; + passing3 = 1; + } + } + if (!valid27) { + const err68 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing3 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } else { + errors = _errs113; + if (vErrors !== null) { + if (_errs113) { + vErrors.length = _errs113; + } else { + vErrors = null; + } + } + } + } + if (data.time_format !== undefined) { + let data45 = data.time_format; + const _errs119 = errors; + let valid28 = false; + let passing4 = null; + const _errs120 = errors; + if (typeof data45 !== 'string') { + const err69 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + var _valid5 = _errs120 === errors; + if (_valid5) { + valid28 = true; + passing4 = 0; + } + const _errs122 = errors; + if (typeof data45 !== 'boolean') { + const err70 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var _valid5 = _errs122 === errors; + if (_valid5 && valid28) { + valid28 = false; + passing4 = [passing4, 1]; + } else { + if (_valid5) { + valid28 = true; + passing4 = 1; + } + } + if (!valid28) { + const err71 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing4 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } else { + errors = _errs119; + if (vErrors !== null) { + if (_errs119) { + vErrors.length = _errs119; + } else { + vErrors = null; + } + } + } + } + if (data.picker_utc !== undefined) { + if (typeof data.picker_utc !== 'boolean') { + const err72 = { + instancePath: instancePath + '/picker_utc', + schemaPath: '#/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + } + var _valid0 = _errs109 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'code') { + const _errs126 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.default_language !== undefined) { + if (typeof data.default_language !== 'string') { + const err73 = { + instancePath: instancePath + '/default_language', + schemaPath: '#/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + } + if (data.allow_language_selection !== undefined) { + if (typeof data.allow_language_selection !== 'boolean') { + const err74 = { + instancePath: instancePath + '/allow_language_selection', + schemaPath: '#/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } + if (data.output_code_only !== undefined) { + if (typeof data.output_code_only !== 'boolean') { + const err75 = { + instancePath: instancePath + '/output_code_only', + schemaPath: '#/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + if (data.keys !== undefined) { + let data50 = data.keys; + if (data50 && typeof data50 == 'object' && !Array.isArray(data50)) { + if (data50.code !== undefined) { + if (typeof data50.code !== 'string') { + const err76 = { + instancePath: instancePath + '/keys/code', + schemaPath: '#/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } + if (data50.lang !== undefined) { + if (typeof data50.lang !== 'string') { + const err77 = { + instancePath: instancePath + '/keys/lang', + schemaPath: '#/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } else { + const err78 = { + instancePath: instancePath + '/keys', + schemaPath: '#/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + } + var _valid0 = _errs126 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'color') { + var _valid0 = true; + valid0 = _valid0; + } + if (!valid0) { + const err79 = { + instancePath, + schemaPath: '#/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + } + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.name === undefined) { + const err80 = { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + if (data.name !== undefined) { + if (typeof data.name !== 'string') { + const err81 = { + instancePath: instancePath + '/name', + schemaPath: '#/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + if (data.label !== undefined) { + if (typeof data.label !== 'string') { + const err82 = { + instancePath: instancePath + '/label', + schemaPath: '#/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + if (data.widget !== undefined) { + if (typeof data.widget !== 'string') { + const err83 = { + instancePath: instancePath + '/widget', + schemaPath: '#/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + if (data.required !== undefined) { + if (typeof data.required !== 'boolean') { + const err84 = { + instancePath: instancePath + '/required', + schemaPath: '#/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + if (data.i18n !== undefined) { + let data57 = data.i18n; + const _errs149 = errors; + let valid32 = false; + let passing5 = null; + const _errs150 = errors; + if (typeof data57 !== 'boolean') { + const err85 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var _valid6 = _errs150 === errors; + if (_valid6) { + valid32 = true; + passing5 = 0; + } + const _errs152 = errors; + if (typeof data57 !== 'string') { + const err86 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + if (!(data57 === 'translate' || data57 === 'duplicate' || data57 === 'none')) { + const err87 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/1/enum', + keyword: 'enum', + params: { allowedValues: schema41.properties.i18n.oneOf[1].enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + var _valid6 = _errs152 === errors; + if (_valid6 && valid32) { + valid32 = false; + passing5 = [passing5, 1]; + } else { + if (_valid6) { + valid32 = true; + passing5 = 1; + } + } + if (!valid32) { + const err88 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing5 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } else { + errors = _errs149; + if (vErrors !== null) { + if (_errs149) { + vErrors.length = _errs149; + } else { + vErrors = null; + } + } + } + } + if (data.hint !== undefined) { + if (typeof data.hint !== 'string') { + const err89 = { + instancePath: instancePath + '/hint', + schemaPath: '#/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } + if (data.pattern !== undefined) { + let data59 = data.pattern; + if (Array.isArray(data59)) { + if (data59.length < 2) { + const err90 = { + instancePath: instancePath + '/pattern', + schemaPath: '#/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + const len6 = data59.length; + if (len6 > 0) { + const _errs159 = errors; + let valid34 = false; + let passing6 = null; + const _errs160 = errors; + if (typeof data59[0] !== 'string') { + const err91 = { + 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 = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var _valid7 = _errs160 === errors; + if (_valid7) { + valid34 = true; + passing6 = 0; + } + var _valid7 = true; + if (_valid7 && valid34) { + valid34 = false; + passing6 = [passing6, 1]; + } else { + if (_valid7) { + valid34 = true; + passing6 = 1; + } + } + if (!valid34) { + const err92 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing6 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } else { + errors = _errs159; + if (vErrors !== null) { + if (_errs159) { + vErrors.length = _errs159; + } else { + vErrors = null; + } + } + } + } + if (len6 > 1) { + if (typeof data59[1] !== 'string') { + const err93 = { + instancePath: instancePath + '/pattern/1', + schemaPath: '#/properties/pattern/items/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + } else { + const err94 = { + instancePath: instancePath + '/pattern', + schemaPath: '#/properties/pattern/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + 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 ( + !validate26(data.fields, { + instancePath: instancePath + '/fields', + parentData: data, + parentDataProperty: 'fields', + rootData, + }) + ) { + vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors); + errors = vErrors.length; + } + } + if (data.types !== undefined) { + if ( + !validate26(data.types, { + instancePath: instancePath + '/types', + parentData: data, + parentDataProperty: 'types', + rootData, + }) + ) { + vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors); + errors = vErrors.length; + } + } + } else { + const err95 = { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + validate25.errors = vErrors; + return errors === 0; +} +const schema43 = { + $id: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', + 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], + }, + field: { $ref: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + fields: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + types: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + }, + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, + }, + }, + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, + }, + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, + }, + }, + }, + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, + }, + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], + }, + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, + }, + }, + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, + }, + }, + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, + }, + }, + }, + color: {}, + }, + required: ['name'], +}; +const wrapper4 = { validate: validate32 }; +const schema44 = { + $id: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', + type: 'array', + minItems: 1, + items: { + $id: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', + 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], + }, + field: { $ref: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + fields: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + types: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + }, + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, + }, + }, + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, + }, + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, + }, + }, + }, + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, + }, + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], + }, + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, + }, + }, + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, + }, + }, + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, + }, + }, + }, + color: {}, + }, + required: ['name'], + }, + uniqueItemProperties: ['name'], +}; +const wrapper6 = { validate: validate33 }; +function validate33( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + /*# sourceURL="fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */ 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 < len0; i0++) { + let data0 = data[i0]; + const vSchema0 = data0 && data0.widget; + if (!(vSchema0 === undefined)) { + if ( + typeof vSchema0 !== 'string' && + !(typeof vSchema0 == 'number') && + typeof vSchema0 !== 'boolean' && + vSchema0 !== null + ) { + const err1 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/select', + keyword: 'select', + params: {}, + message: '"select" keyword must be string,number,boolean,null ($data)', + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } else { + let valid2 = true; + const value0 = vSchema0 === null ? 'null' : vSchema0; + if ('' + value0 == 'unknown') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'string') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'number') { + const _errs3 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.step !== undefined) { + if (!(typeof data0.step == 'number')) { + const err2 = { + instancePath: instancePath + '/' + i0 + '/step', + schemaPath: '#/items/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + if (data0.value_type !== undefined) { + if (typeof data0.value_type !== 'string') { + const err3 = { + instancePath: instancePath + '/' + i0 + '/value_type', + schemaPath: '#/items/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + if (data0.min !== undefined) { + if (!(typeof data0.min == 'number')) { + const err4 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + if (data0.max !== undefined) { + if (!(typeof data0.max == 'number')) { + const err5 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + } + var _valid0 = _errs3 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'text') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'image') { + const _errs12 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_multiple !== undefined) { + if (typeof data0.allow_multiple !== 'boolean') { + const err6 = { + instancePath: instancePath + '/' + i0 + '/allow_multiple', + schemaPath: '#/items/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + } + var _valid0 = _errs12 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'file') { + const _errs15 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_multiple !== undefined) { + if (typeof data0.allow_multiple !== 'boolean') { + const err7 = { + instancePath: instancePath + '/' + i0 + '/allow_multiple', + schemaPath: '#/items/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } + } + var _valid0 = _errs15 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'select') { + const _errs18 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.options === undefined) { + const err8 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + if (data0.multiple !== undefined) { + if (typeof data0.multiple !== 'boolean') { + const err9 = { + instancePath: instancePath + '/' + i0 + '/multiple', + schemaPath: '#/items/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + if (data0.min !== undefined) { + let data8 = data0.min; + if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { + const err10 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + if (data0.max !== undefined) { + let data9 = data0.max; + if (!(typeof data9 == 'number' && !(data9 % 1) && !isNaN(data9))) { + const err11 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + if (data0.options !== undefined) { + let data10 = data0.options; + if (Array.isArray(data10)) { + const len1 = data10.length; + for (let i1 = 0; i1 < len1; i1++) { + let data11 = data10[i1]; + const _errs28 = errors; + let valid9 = false; + let passing0 = null; + const _errs29 = errors; + if (typeof data11 !== 'string') { + const err12 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + var _valid1 = _errs29 === errors; + if (_valid1) { + valid9 = true; + passing0 = 0; + } + const _errs31 = errors; + if (!(typeof data11 == 'number')) { + const err13 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + var _valid1 = _errs31 === errors; + if (_valid1 && valid9) { + valid9 = false; + passing0 = [passing0, 1]; + } else { + if (_valid1) { + valid9 = true; + passing0 = 1; + } + const _errs33 = errors; + if (data11 && typeof data11 == 'object' && !Array.isArray(data11)) { + if (data11.label === undefined) { + const err14 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + if (data11.value === undefined) { + const err15 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + if (data11.label !== undefined) { + if (typeof data11.label !== 'string') { + const err16 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/label', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + if (data11.value !== undefined) { + let data13 = data11.value; + const _errs38 = errors; + let valid11 = false; + let passing1 = null; + const _errs39 = errors; + if (typeof data13 !== 'string') { + const err17 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var _valid2 = _errs39 === errors; + if (_valid2) { + valid11 = true; + passing1 = 0; + } + const _errs41 = errors; + if (!(typeof data13 == 'number')) { + const err18 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + var _valid2 = _errs41 === errors; + if (_valid2 && valid11) { + valid11 = false; + passing1 = [passing1, 1]; + } else { + if (_valid2) { + valid11 = true; + passing1 = 1; + } + } + if (!valid11) { + const err19 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs38; + if (vErrors !== null) { + if (_errs38) { + vErrors.length = _errs38; + } else { + vErrors = null; + } + } + } + } + } else { + const err20 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + var _valid1 = _errs33 === errors; + if (_valid1 && valid9) { + valid9 = false; + passing0 = [passing0, 2]; + } else { + if (_valid1) { + valid9 = true; + passing0 = 2; + } + } + } + if (!valid9) { + const err21 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: '#/items/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing0 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } else { + errors = _errs28; + if (vErrors !== null) { + if (_errs28) { + vErrors.length = _errs28; + } else { + vErrors = null; + } + } + } + } + } else { + const err22 = { + instancePath: instancePath + '/' + i0 + '/options', + schemaPath: '#/items/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } + } + var _valid0 = _errs18 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'markdown') { + const _errs43 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.minimal !== undefined) { + if (typeof data0.minimal !== 'boolean') { + const err23 = { + instancePath: instancePath + '/' + i0 + '/minimal', + schemaPath: '#/items/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + if (data0.buttons !== undefined) { + let data15 = data0.buttons; + if (Array.isArray(data15)) { + const len2 = data15.length; + for (let i2 = 0; i2 < len2; i2++) { + let data16 = data15[i2]; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: instancePath + '/' + i0 + '/buttons/' + i2, + schemaPath: '#/items/selectCases/markdown/properties/buttons/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + if ( + !( + data16 === 'bold' || + data16 === 'italic' || + data16 === 'code' || + data16 === 'link' || + data16 === 'heading-one' || + data16 === 'heading-two' || + data16 === 'heading-three' || + data16 === 'heading-four' || + data16 === 'heading-five' || + data16 === 'heading-six' || + data16 === 'quote' || + data16 === 'bulleted-list' || + data16 === 'numbered-list' + ) + ) { + const err25 = { + instancePath: instancePath + '/' + i0 + '/buttons/' + i2, + schemaPath: '#/items/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema44.items.selectCases.markdown.properties.buttons.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + } else { + const err26 = { + instancePath: instancePath + '/' + i0 + '/buttons', + schemaPath: '#/items/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + if (data0.editor_components !== undefined) { + let data17 = data0.editor_components; + if (Array.isArray(data17)) { + const len3 = data17.length; + for (let i3 = 0; i3 < len3; i3++) { + if (typeof data17[i3] !== 'string') { + const err27 = { + instancePath: instancePath + '/' + i0 + '/editor_components/' + i3, + schemaPath: + '#/items/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + } else { + const err28 = { + instancePath: instancePath + '/' + i0 + '/editor_components', + schemaPath: '#/items/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + if (data0.modes !== undefined) { + let data19 = data0.modes; + if (Array.isArray(data19)) { + if (data19.length < 1) { + const err29 = { + instancePath: instancePath + '/' + i0 + '/modes', + schemaPath: '#/items/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + const len4 = data19.length; + for (let i4 = 0; i4 < len4; i4++) { + let data20 = data19[i4]; + if (typeof data20 !== 'string') { + const err30 = { + instancePath: instancePath + '/' + i0 + '/modes/' + i4, + schemaPath: '#/items/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + if (!(data20 === 'raw' || data20 === 'rich_text')) { + const err31 = { + instancePath: instancePath + '/' + i0 + '/modes/' + i4, + schemaPath: '#/items/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema44.items.selectCases.markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } + } else { + const err32 = { + instancePath: instancePath + '/' + i0 + '/modes', + schemaPath: '#/items/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var _valid0 = _errs43 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'list') { + const _errs58 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_add !== undefined) { + if (typeof data0.allow_add !== 'boolean') { + const err33 = { + instancePath: instancePath + '/' + i0 + '/allow_add', + schemaPath: '#/items/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + } + if (data0.collapsed !== undefined) { + if (typeof data0.collapsed !== 'boolean') { + const err34 = { + instancePath: instancePath + '/' + i0 + '/collapsed', + schemaPath: '#/items/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + } + if (data0.summary !== undefined) { + if (typeof data0.summary !== 'string') { + const err35 = { + instancePath: instancePath + '/' + i0 + '/summary', + schemaPath: '#/items/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } + if (data0.minimize_collapsed !== undefined) { + if (typeof data0.minimize_collapsed !== 'boolean') { + const err36 = { + instancePath: instancePath + '/' + i0 + '/minimize_collapsed', + schemaPath: '#/items/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + if (data0.label_singular !== undefined) { + if (typeof data0.label_singular !== 'string') { + const err37 = { + instancePath: instancePath + '/' + i0 + '/label_singular', + schemaPath: '#/items/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + if (data0.i18n !== undefined) { + if (typeof data0.i18n !== 'boolean') { + const err38 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + if (data0.min !== undefined) { + if (!(typeof data0.min == 'number')) { + const err39 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } + if (data0.max !== undefined) { + if (!(typeof data0.max == 'number')) { + const err40 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + var _valid0 = _errs58 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'object') { + const _errs75 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collapsed !== undefined) { + if (typeof data0.collapsed !== 'boolean') { + const err41 = { + instancePath: instancePath + '/' + i0 + '/collapsed', + schemaPath: '#/items/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + if (data0.i18n !== undefined) { + if (typeof data0.i18n !== 'boolean') { + const err42 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/selectCases/object/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + } + var _valid0 = _errs75 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'relation') { + const _errs80 = errors; + const _errs81 = errors; + let valid21 = false; + let passing2 = null; + const _errs82 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection === undefined) { + const err43 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + if (data0.value_field === undefined) { + const err44 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + if (data0.search_fields === undefined) { + const err45 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: "must have required property '" + 'search_fields' + "'", + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + var _valid3 = _errs82 === errors; + if (_valid3) { + valid21 = true; + passing2 = 0; + } + const _errs83 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection === undefined) { + const err46 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + if (data0.valueField === undefined) { + const err47 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + if (data0.searchFields === undefined) { + const err48 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var _valid3 = _errs83 === errors; + if (_valid3 && valid21) { + valid21 = false; + passing2 = [passing2, 1]; + } else { + if (_valid3) { + valid21 = true; + passing2 = 1; + } + } + if (!valid21) { + const err49 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing2 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } else { + errors = _errs81; + if (vErrors !== null) { + if (_errs81) { + vErrors.length = _errs81; + } else { + vErrors = null; + } + } + } + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection !== undefined) { + if (typeof data0.collection !== 'string') { + const err50 = { + instancePath: instancePath + '/' + i0 + '/collection', + schemaPath: '#/items/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + } + if (data0.value_field !== undefined) { + if (typeof data0.value_field !== 'string') { + const err51 = { + instancePath: instancePath + '/' + i0 + '/value_field', + schemaPath: '#/items/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } + if (data0.search_fields !== undefined) { + let data33 = data0.search_fields; + if (Array.isArray(data33)) { + if (data33.length < 1) { + const err52 = { + instancePath: instancePath + '/' + i0 + '/search_fields', + schemaPath: '#/items/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + const len5 = data33.length; + for (let i5 = 0; i5 < len5; i5++) { + if (typeof data33[i5] !== 'string') { + const err53 = { + instancePath: instancePath + '/' + i0 + '/search_fields/' + i5, + schemaPath: + '#/items/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + } else { + const err54 = { + instancePath: instancePath + '/' + i0 + '/search_fields', + schemaPath: '#/items/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + if (data0.file !== undefined) { + if (typeof data0.file !== 'string') { + const err55 = { + instancePath: instancePath + '/' + i0 + '/file', + schemaPath: '#/items/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + if (data0.multiple !== undefined) { + if (typeof data0.multiple !== 'boolean') { + const err56 = { + instancePath: instancePath + '/' + i0 + '/multiple', + schemaPath: '#/items/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + if (data0.min !== undefined) { + let data37 = data0.min; + if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { + const err57 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } + if (data0.max !== undefined) { + let data38 = data0.max; + if (!(typeof data38 == 'number' && !(data38 % 1) && !isNaN(data38))) { + const err58 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + if (data0.display_fields !== undefined) { + let data39 = data0.display_fields; + if (Array.isArray(data39)) { + if (data39.length < 1) { + const err59 = { + instancePath: instancePath + '/' + i0 + '/display_fields', + schemaPath: '#/items/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + const len6 = data39.length; + for (let i6 = 0; i6 < len6; i6++) { + if (typeof data39[i6] !== 'string') { + const err60 = { + instancePath: instancePath + '/' + i0 + '/display_fields/' + i6, + schemaPath: + '#/items/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } else { + const err61 = { + instancePath: instancePath + '/' + i0 + '/display_fields', + schemaPath: '#/items/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + if (data0.options_length !== undefined) { + let data41 = data0.options_length; + if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { + const err62 = { + instancePath: instancePath + '/' + i0 + '/options_length', + schemaPath: '#/items/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + } + var _valid0 = _errs80 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'boolean') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'map') { + const _errs106 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.decimals !== undefined) { + let data42 = data0.decimals; + if (!(typeof data42 == 'number' && !(data42 % 1) && !isNaN(data42))) { + const err63 = { + instancePath: instancePath + '/' + i0 + '/decimals', + schemaPath: '#/items/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } + if (data0.type !== undefined) { + let data43 = data0.type; + if (typeof data43 !== 'string') { + const err64 = { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/selectCases/map/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + if (!(data43 === 'Point' || data43 === 'LineString' || data43 === 'Polygon')) { + const err65 = { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/selectCases/map/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema44.items.selectCases.map.properties.type.enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + } + var _valid0 = _errs106 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'date') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'datetime') { + const _errs111 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.format !== undefined) { + if (typeof data0.format !== 'string') { + const err66 = { + instancePath: instancePath + '/' + i0 + '/format', + schemaPath: '#/items/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + if (data0.date_format !== undefined) { + let data45 = data0.date_format; + const _errs115 = errors; + let valid29 = false; + let passing3 = null; + const _errs116 = errors; + if (typeof data45 !== 'string') { + const err67 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } + var _valid4 = _errs116 === errors; + if (_valid4) { + valid29 = true; + passing3 = 0; + } + const _errs118 = errors; + if (typeof data45 !== 'boolean') { + const err68 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + var _valid4 = _errs118 === errors; + if (_valid4 && valid29) { + valid29 = false; + passing3 = [passing3, 1]; + } else { + if (_valid4) { + valid29 = true; + passing3 = 1; + } + } + if (!valid29) { + const err69 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing3 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } else { + errors = _errs115; + if (vErrors !== null) { + if (_errs115) { + vErrors.length = _errs115; + } else { + vErrors = null; + } + } + } + } + if (data0.time_format !== undefined) { + let data46 = data0.time_format; + const _errs121 = errors; + let valid30 = false; + let passing4 = null; + const _errs122 = errors; + if (typeof data46 !== 'string') { + const err70 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var _valid5 = _errs122 === errors; + if (_valid5) { + valid30 = true; + passing4 = 0; + } + const _errs124 = errors; + if (typeof data46 !== 'boolean') { + const err71 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var _valid5 = _errs124 === errors; + if (_valid5 && valid30) { + valid30 = false; + passing4 = [passing4, 1]; + } else { + if (_valid5) { + valid30 = true; + passing4 = 1; + } + } + if (!valid30) { + const err72 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing4 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } else { + errors = _errs121; + if (vErrors !== null) { + if (_errs121) { + vErrors.length = _errs121; + } else { + vErrors = null; + } + } + } + } + if (data0.picker_utc !== undefined) { + if (typeof data0.picker_utc !== 'boolean') { + const err73 = { + instancePath: instancePath + '/' + i0 + '/picker_utc', + schemaPath: '#/items/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + } + } + var _valid0 = _errs111 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'code') { + const _errs128 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.default_language !== undefined) { + if (typeof data0.default_language !== 'string') { + const err74 = { + instancePath: instancePath + '/' + i0 + '/default_language', + schemaPath: '#/items/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } + if (data0.allow_language_selection !== undefined) { + if (typeof data0.allow_language_selection !== 'boolean') { + const err75 = { + instancePath: instancePath + '/' + i0 + '/allow_language_selection', + schemaPath: '#/items/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + if (data0.output_code_only !== undefined) { + if (typeof data0.output_code_only !== 'boolean') { + const err76 = { + instancePath: instancePath + '/' + i0 + '/output_code_only', + schemaPath: '#/items/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } + if (data0.keys !== undefined) { + let data51 = data0.keys; + if (data51 && typeof data51 == 'object' && !Array.isArray(data51)) { + if (data51.code !== undefined) { + if (typeof data51.code !== 'string') { + const err77 = { + instancePath: instancePath + '/' + i0 + '/keys/code', + schemaPath: '#/items/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + if (data51.lang !== undefined) { + if (typeof data51.lang !== 'string') { + const err78 = { + instancePath: instancePath + '/' + i0 + '/keys/lang', + schemaPath: '#/items/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + } else { + const err79 = { + instancePath: instancePath + '/' + i0 + '/keys', + schemaPath: '#/items/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + } + var _valid0 = _errs128 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'color') { + var _valid0 = true; + valid2 = _valid0; + } + if (!valid2) { + const err80 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + } + } + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.name === undefined) { + const err81 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + if (data0.name !== undefined) { + if (typeof data0.name !== 'string') { + const err82 = { + instancePath: instancePath + '/' + i0 + '/name', + schemaPath: '#/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + if (data0.label !== undefined) { + if (typeof data0.label !== 'string') { + const err83 = { + instancePath: instancePath + '/' + i0 + '/label', + schemaPath: '#/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + if (data0.widget !== undefined) { + if (typeof data0.widget !== 'string') { + const err84 = { + instancePath: instancePath + '/' + i0 + '/widget', + schemaPath: '#/items/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + if (data0.required !== undefined) { + if (typeof data0.required !== 'boolean') { + const err85 = { + instancePath: instancePath + '/' + i0 + '/required', + schemaPath: '#/items/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + if (data0.i18n !== undefined) { + let data58 = data0.i18n; + const _errs151 = errors; + let valid34 = false; + let passing5 = null; + const _errs152 = errors; + if (typeof data58 !== 'boolean') { + const err86 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var _valid6 = _errs152 === errors; + if (_valid6) { + valid34 = true; + passing5 = 0; + } + const _errs154 = errors; + if (typeof data58 !== 'string') { + const err87 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if (!(data58 === 'translate' || data58 === 'duplicate' || data58 === 'none')) { + const err88 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/enum', + keyword: 'enum', + params: { allowedValues: schema44.items.properties.i18n.oneOf[1].enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var _valid6 = _errs154 === errors; + if (_valid6 && valid34) { + valid34 = false; + passing5 = [passing5, 1]; + } else { + if (_valid6) { + valid34 = true; + passing5 = 1; + } + } + if (!valid34) { + const err89 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing5 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } else { + errors = _errs151; + if (vErrors !== null) { + if (_errs151) { + vErrors.length = _errs151; + } else { + vErrors = null; + } + } + } + } + if (data0.hint !== undefined) { + if (typeof data0.hint !== 'string') { + const err90 = { + instancePath: instancePath + '/' + i0 + '/hint', + schemaPath: '#/items/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + if (data0.pattern !== undefined) { + let data60 = data0.pattern; + if (Array.isArray(data60)) { + if (data60.length < 2) { + const err91 = { + instancePath: instancePath + '/' + i0 + '/pattern', + schemaPath: '#/items/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + const len7 = data60.length; + if (len7 > 0) { + const _errs161 = errors; + let valid36 = false; + let passing6 = null; + const _errs162 = errors; + if (typeof data60[0] !== 'string') { + const err92 = { + 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 = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + var _valid7 = _errs162 === errors; + if (_valid7) { + valid36 = true; + passing6 = 0; + } + var _valid7 = true; + if (_valid7 && valid36) { + valid36 = false; + passing6 = [passing6, 1]; + } else { + if (_valid7) { + valid36 = true; + passing6 = 1; + } + } + if (!valid36) { + const err93 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing6 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } else { + errors = _errs161; + if (vErrors !== null) { + if (_errs161) { + vErrors.length = _errs161; + } else { + vErrors = null; + } + } + } + } + if (len7 > 1) { + if (typeof data60[1] !== 'string') { + const err94 = { + 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 = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + } else { + const err95 = { + instancePath: instancePath + '/' + i0 + '/pattern', + schemaPath: '#/items/properties/pattern/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + 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 err96 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + } else { + const err97 = { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + validate33.errors = vErrors; + return errors === 0; +} +function validate32( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + /*# sourceURL="field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */ 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 == 'unknown') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'string') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'number') { + const _errs1 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.step !== undefined) { + if (!(typeof data.step == 'number')) { + const err1 = { + instancePath: instancePath + '/step', + schemaPath: '#/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } + if (data.value_type !== undefined) { + if (typeof data.value_type !== 'string') { + const err2 = { + instancePath: instancePath + '/value_type', + schemaPath: '#/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + if (data.min !== undefined) { + if (!(typeof data.min == 'number')) { + const err3 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + if (data.max !== undefined) { + if (!(typeof data.max == 'number')) { + const err4 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + } + var _valid0 = _errs1 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'text') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'image') { + const _errs10 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_multiple !== undefined) { + if (typeof data.allow_multiple !== 'boolean') { + const err5 = { + instancePath: instancePath + '/allow_multiple', + schemaPath: '#/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + } + var _valid0 = _errs10 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'file') { + const _errs13 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_multiple !== undefined) { + if (typeof data.allow_multiple !== 'boolean') { + const err6 = { + instancePath: instancePath + '/allow_multiple', + schemaPath: '#/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + } + var _valid0 = _errs13 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'select') { + const _errs16 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.options === undefined) { + const err7 = { + instancePath, + schemaPath: '#/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + if (data.multiple !== undefined) { + if (typeof data.multiple !== 'boolean') { + const err8 = { + instancePath: instancePath + '/multiple', + schemaPath: '#/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + if (data.min !== undefined) { + let data7 = data.min; + if (!(typeof data7 == 'number' && !(data7 % 1) && !isNaN(data7))) { + const err9 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + if (data.max !== undefined) { + let data8 = data.max; + if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { + const err10 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + if (data.options !== undefined) { + let data9 = data.options; + if (Array.isArray(data9)) { + const len0 = data9.length; + for (let i0 = 0; i0 < len0; i0++) { + let data10 = data9[i0]; + const _errs26 = errors; + let valid7 = false; + let passing0 = null; + const _errs27 = errors; + if (typeof data10 !== 'string') { + const err11 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + var _valid1 = _errs27 === errors; + if (_valid1) { + valid7 = true; + passing0 = 0; + } + const _errs29 = errors; + if (!(typeof data10 == 'number')) { + const err12 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + var _valid1 = _errs29 === errors; + if (_valid1 && valid7) { + valid7 = false; + passing0 = [passing0, 1]; + } else { + if (_valid1) { + valid7 = true; + passing0 = 1; + } + const _errs31 = errors; + if (data10 && typeof data10 == 'object' && !Array.isArray(data10)) { + if (data10.label === undefined) { + const err13 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + if (data10.value === undefined) { + const err14 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + if (data10.label !== undefined) { + if (typeof data10.label !== 'string') { + const err15 = { + instancePath: instancePath + '/options/' + i0 + '/label', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + if (data10.value !== undefined) { + let data12 = data10.value; + const _errs36 = errors; + let valid9 = false; + let passing1 = null; + const _errs37 = errors; + if (typeof data12 !== 'string') { + const err16 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + var _valid2 = _errs37 === errors; + if (_valid2) { + valid9 = true; + passing1 = 0; + } + const _errs39 = errors; + if (!(typeof data12 == 'number')) { + const err17 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var _valid2 = _errs39 === errors; + if (_valid2 && valid9) { + valid9 = false; + passing1 = [passing1, 1]; + } else { + if (_valid2) { + valid9 = true; + passing1 = 1; + } + } + if (!valid9) { + const err18 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs36; + if (vErrors !== null) { + if (_errs36) { + vErrors.length = _errs36; + } else { + vErrors = null; + } + } + } + } + } else { + const err19 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var _valid1 = _errs31 === errors; + if (_valid1 && valid7) { + valid7 = false; + passing0 = [passing0, 2]; + } else { + if (_valid1) { + valid7 = true; + passing0 = 2; + } + } + } + if (!valid7) { + const err20 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing0 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } else { + errors = _errs26; + if (vErrors !== null) { + if (_errs26) { + vErrors.length = _errs26; + } else { + vErrors = null; + } + } + } + } + } else { + const err21 = { + instancePath: instancePath + '/options', + schemaPath: '#/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var _valid0 = _errs16 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'markdown') { + const _errs41 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.minimal !== undefined) { + if (typeof data.minimal !== 'boolean') { + const err22 = { + instancePath: instancePath + '/minimal', + schemaPath: '#/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } + if (data.buttons !== undefined) { + let data14 = data.buttons; + if (Array.isArray(data14)) { + const len1 = data14.length; + for (let i1 = 0; i1 < len1; i1++) { + let data15 = data14[i1]; + if (typeof data15 !== 'string') { + const err23 = { + instancePath: instancePath + '/buttons/' + i1, + schemaPath: '#/selectCases/markdown/properties/buttons/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data15 === 'bold' || + data15 === 'italic' || + data15 === 'code' || + data15 === 'link' || + data15 === 'heading-one' || + data15 === 'heading-two' || + data15 === 'heading-three' || + data15 === 'heading-four' || + data15 === 'heading-five' || + data15 === 'heading-six' || + data15 === 'quote' || + data15 === 'bulleted-list' || + data15 === 'numbered-list' + ) + ) { + const err24 = { + instancePath: instancePath + '/buttons/' + i1, + schemaPath: '#/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', + params: { + allowedValues: schema43.selectCases.markdown.properties.buttons.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + } + } else { + const err25 = { + instancePath: instancePath + '/buttons', + schemaPath: '#/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + if (data.editor_components !== undefined) { + let data16 = data.editor_components; + if (Array.isArray(data16)) { + const len2 = data16.length; + for (let i2 = 0; i2 < len2; i2++) { + if (typeof data16[i2] !== 'string') { + const err26 = { + instancePath: instancePath + '/editor_components/' + i2, + schemaPath: '#/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + } else { + const err27 = { + instancePath: instancePath + '/editor_components', + schemaPath: '#/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + if (data.modes !== undefined) { + let data18 = data.modes; + if (Array.isArray(data18)) { + if (data18.length < 1) { + const err28 = { + instancePath: instancePath + '/modes', + schemaPath: '#/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + const len3 = data18.length; + for (let i3 = 0; i3 < len3; i3++) { + let data19 = data18[i3]; + if (typeof data19 !== 'string') { + const err29 = { + instancePath: instancePath + '/modes/' + i3, + schemaPath: '#/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + if (!(data19 === 'raw' || data19 === 'rich_text')) { + const err30 = { + instancePath: instancePath + '/modes/' + i3, + schemaPath: '#/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: schema43.selectCases.markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + } + } else { + const err31 = { + instancePath: instancePath + '/modes', + schemaPath: '#/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } + } + var _valid0 = _errs41 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'list') { + const _errs56 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_add !== undefined) { + if (typeof data.allow_add !== 'boolean') { + const err32 = { + instancePath: instancePath + '/allow_add', + schemaPath: '#/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + if (data.collapsed !== undefined) { + if (typeof data.collapsed !== 'boolean') { + const err33 = { + instancePath: instancePath + '/collapsed', + schemaPath: '#/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + } + if (data.summary !== undefined) { + if (typeof data.summary !== 'string') { + const err34 = { + instancePath: instancePath + '/summary', + schemaPath: '#/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + } + if (data.minimize_collapsed !== undefined) { + if (typeof data.minimize_collapsed !== 'boolean') { + const err35 = { + instancePath: instancePath + '/minimize_collapsed', + schemaPath: '#/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } + if (data.label_singular !== undefined) { + if (typeof data.label_singular !== 'string') { + const err36 = { + instancePath: instancePath + '/label_singular', + schemaPath: '#/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + if (data.i18n !== undefined) { + if (typeof data.i18n !== 'boolean') { + const err37 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + if (data.min !== undefined) { + if (!(typeof data.min == 'number')) { + const err38 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + if (data.max !== undefined) { + if (!(typeof data.max == 'number')) { + const err39 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } + } + var _valid0 = _errs56 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'object') { + const _errs73 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collapsed !== undefined) { + if (typeof data.collapsed !== 'boolean') { + const err40 = { + instancePath: instancePath + '/collapsed', + schemaPath: '#/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + if (data.i18n !== undefined) { + if (typeof data.i18n !== 'boolean') { + const err41 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/selectCases/object/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + var _valid0 = _errs73 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'relation') { + const _errs78 = errors; + const _errs79 = errors; + let valid19 = false; + let passing2 = null; + const _errs80 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection === undefined) { + const err42 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + if (data.value_field === undefined) { + const err43 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + if (data.search_fields === undefined) { + const err44 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: "must have required property '" + 'search_fields' + "'", + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var _valid3 = _errs80 === errors; + if (_valid3) { + valid19 = true; + passing2 = 0; + } + const _errs81 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection === undefined) { + const err45 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + if (data.valueField === undefined) { + const err46 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + if (data.searchFields === undefined) { + const err47 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var _valid3 = _errs81 === errors; + if (_valid3 && valid19) { + valid19 = false; + passing2 = [passing2, 1]; + } else { + if (_valid3) { + valid19 = true; + passing2 = 1; + } + } + if (!valid19) { + const err48 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing2 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } else { + errors = _errs79; + if (vErrors !== null) { + if (_errs79) { + vErrors.length = _errs79; + } else { + vErrors = null; + } + } + } + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection !== undefined) { + if (typeof data.collection !== 'string') { + const err49 = { + instancePath: instancePath + '/collection', + schemaPath: '#/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + if (data.value_field !== undefined) { + if (typeof data.value_field !== 'string') { + const err50 = { + instancePath: instancePath + '/value_field', + schemaPath: '#/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + } + if (data.search_fields !== undefined) { + let data32 = data.search_fields; + if (Array.isArray(data32)) { + if (data32.length < 1) { + const err51 = { + instancePath: instancePath + '/search_fields', + schemaPath: '#/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + const len4 = data32.length; + for (let i4 = 0; i4 < len4; i4++) { + if (typeof data32[i4] !== 'string') { + const err52 = { + instancePath: instancePath + '/search_fields/' + i4, + schemaPath: '#/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } else { + const err53 = { + instancePath: instancePath + '/search_fields', + schemaPath: '#/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + if (data.file !== undefined) { + if (typeof data.file !== 'string') { + const err54 = { + instancePath: instancePath + '/file', + schemaPath: '#/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + if (data.multiple !== undefined) { + if (typeof data.multiple !== 'boolean') { + const err55 = { + instancePath: instancePath + '/multiple', + schemaPath: '#/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + if (data.min !== undefined) { + let data36 = data.min; + if (!(typeof data36 == 'number' && !(data36 % 1) && !isNaN(data36))) { + const err56 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + if (data.max !== undefined) { + let data37 = data.max; + if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { + const err57 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } + if (data.display_fields !== undefined) { + let data38 = data.display_fields; + if (Array.isArray(data38)) { + if (data38.length < 1) { + const err58 = { + instancePath: instancePath + '/display_fields', + schemaPath: '#/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + const len5 = data38.length; + for (let i5 = 0; i5 < len5; i5++) { + if (typeof data38[i5] !== 'string') { + const err59 = { + instancePath: instancePath + '/display_fields/' + i5, + schemaPath: '#/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } + } else { + const err60 = { + instancePath: instancePath + '/display_fields', + schemaPath: '#/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + if (data.options_length !== undefined) { + let data40 = data.options_length; + if (!(typeof data40 == 'number' && !(data40 % 1) && !isNaN(data40))) { + const err61 = { + instancePath: instancePath + '/options_length', + schemaPath: '#/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + } + var _valid0 = _errs78 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'boolean') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'map') { + const _errs104 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.decimals !== undefined) { + let data41 = data.decimals; + if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { + const err62 = { + instancePath: instancePath + '/decimals', + schemaPath: '#/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + if (data.type !== undefined) { + let data42 = data.type; + if (typeof data42 !== 'string') { + const err63 = { + instancePath: instancePath + '/type', + schemaPath: '#/selectCases/map/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + if (!(data42 === 'Point' || data42 === 'LineString' || data42 === 'Polygon')) { + const err64 = { + instancePath: instancePath + '/type', + schemaPath: '#/selectCases/map/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema43.selectCases.map.properties.type.enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + var _valid0 = _errs104 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'date') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'datetime') { + const _errs109 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.format !== undefined) { + if (typeof data.format !== 'string') { + const err65 = { + instancePath: instancePath + '/format', + schemaPath: '#/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + if (data.date_format !== undefined) { + let data44 = data.date_format; + const _errs113 = errors; + let valid27 = false; + let passing3 = null; + const _errs114 = errors; + if (typeof data44 !== 'string') { + const err66 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + var _valid4 = _errs114 === errors; + if (_valid4) { + valid27 = true; + passing3 = 0; + } + const _errs116 = errors; + if (typeof data44 !== 'boolean') { + const err67 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } + var _valid4 = _errs116 === errors; + if (_valid4 && valid27) { + valid27 = false; + passing3 = [passing3, 1]; + } else { + if (_valid4) { + valid27 = true; + passing3 = 1; + } + } + if (!valid27) { + const err68 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing3 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } else { + errors = _errs113; + if (vErrors !== null) { + if (_errs113) { + vErrors.length = _errs113; + } else { + vErrors = null; + } + } + } + } + if (data.time_format !== undefined) { + let data45 = data.time_format; + const _errs119 = errors; + let valid28 = false; + let passing4 = null; + const _errs120 = errors; + if (typeof data45 !== 'string') { + const err69 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + var _valid5 = _errs120 === errors; + if (_valid5) { + valid28 = true; + passing4 = 0; + } + const _errs122 = errors; + if (typeof data45 !== 'boolean') { + const err70 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var _valid5 = _errs122 === errors; + if (_valid5 && valid28) { + valid28 = false; + passing4 = [passing4, 1]; + } else { + if (_valid5) { + valid28 = true; + passing4 = 1; + } + } + if (!valid28) { + const err71 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing4 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } else { + errors = _errs119; + if (vErrors !== null) { + if (_errs119) { + vErrors.length = _errs119; + } else { + vErrors = null; + } + } + } + } + if (data.picker_utc !== undefined) { + if (typeof data.picker_utc !== 'boolean') { + const err72 = { + instancePath: instancePath + '/picker_utc', + schemaPath: '#/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + } + var _valid0 = _errs109 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'code') { + const _errs126 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.default_language !== undefined) { + if (typeof data.default_language !== 'string') { + const err73 = { + instancePath: instancePath + '/default_language', + schemaPath: '#/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + } + if (data.allow_language_selection !== undefined) { + if (typeof data.allow_language_selection !== 'boolean') { + const err74 = { + instancePath: instancePath + '/allow_language_selection', + schemaPath: '#/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } + if (data.output_code_only !== undefined) { + if (typeof data.output_code_only !== 'boolean') { + const err75 = { + instancePath: instancePath + '/output_code_only', + schemaPath: '#/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + if (data.keys !== undefined) { + let data50 = data.keys; + if (data50 && typeof data50 == 'object' && !Array.isArray(data50)) { + if (data50.code !== undefined) { + if (typeof data50.code !== 'string') { + const err76 = { + instancePath: instancePath + '/keys/code', + schemaPath: '#/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } + if (data50.lang !== undefined) { + if (typeof data50.lang !== 'string') { + const err77 = { + instancePath: instancePath + '/keys/lang', + schemaPath: '#/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } else { + const err78 = { + instancePath: instancePath + '/keys', + schemaPath: '#/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + } + var _valid0 = _errs126 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'color') { + var _valid0 = true; + valid0 = _valid0; + } + if (!valid0) { + const err79 = { + instancePath, + schemaPath: '#/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + } + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.name === undefined) { + const err80 = { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + if (data.name !== undefined) { + if (typeof data.name !== 'string') { + const err81 = { + instancePath: instancePath + '/name', + schemaPath: '#/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + if (data.label !== undefined) { + if (typeof data.label !== 'string') { + const err82 = { + instancePath: instancePath + '/label', + schemaPath: '#/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + if (data.widget !== undefined) { + if (typeof data.widget !== 'string') { + const err83 = { + instancePath: instancePath + '/widget', + schemaPath: '#/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + if (data.required !== undefined) { + if (typeof data.required !== 'boolean') { + const err84 = { + instancePath: instancePath + '/required', + schemaPath: '#/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + if (data.i18n !== undefined) { + let data57 = data.i18n; + const _errs149 = errors; + let valid32 = false; + let passing5 = null; + const _errs150 = errors; + if (typeof data57 !== 'boolean') { + const err85 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var _valid6 = _errs150 === errors; + if (_valid6) { + valid32 = true; + passing5 = 0; + } + const _errs152 = errors; + if (typeof data57 !== 'string') { + const err86 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + if (!(data57 === 'translate' || data57 === 'duplicate' || data57 === 'none')) { + const err87 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/1/enum', + keyword: 'enum', + params: { allowedValues: schema43.properties.i18n.oneOf[1].enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + var _valid6 = _errs152 === errors; + if (_valid6 && valid32) { + valid32 = false; + passing5 = [passing5, 1]; + } else { + if (_valid6) { + valid32 = true; + passing5 = 1; + } + } + if (!valid32) { + const err88 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing5 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } else { + errors = _errs149; + if (vErrors !== null) { + if (_errs149) { + vErrors.length = _errs149; + } else { + vErrors = null; + } + } + } + } + if (data.hint !== undefined) { + if (typeof data.hint !== 'string') { + const err89 = { + instancePath: instancePath + '/hint', + schemaPath: '#/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } + if (data.pattern !== undefined) { + let data59 = data.pattern; + if (Array.isArray(data59)) { + if (data59.length < 2) { + const err90 = { + instancePath: instancePath + '/pattern', + schemaPath: '#/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + const len6 = data59.length; + if (len6 > 0) { + const _errs159 = errors; + let valid34 = false; + let passing6 = null; + const _errs160 = errors; + if (typeof data59[0] !== 'string') { + const err91 = { + 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 = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var _valid7 = _errs160 === errors; + if (_valid7) { + valid34 = true; + passing6 = 0; + } + var _valid7 = true; + if (_valid7 && valid34) { + valid34 = false; + passing6 = [passing6, 1]; + } else { + if (_valid7) { + valid34 = true; + passing6 = 1; + } + } + if (!valid34) { + const err92 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing6 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } else { + errors = _errs159; + if (vErrors !== null) { + if (_errs159) { + vErrors.length = _errs159; + } else { + vErrors = null; + } + } + } + } + if (len6 > 1) { + if (typeof data59[1] !== 'string') { + const err93 = { + instancePath: instancePath + '/pattern/1', + schemaPath: '#/properties/pattern/items/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + } else { + const err94 = { + instancePath: instancePath + '/pattern', + schemaPath: '#/properties/pattern/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + 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 ( + !validate33(data.fields, { + instancePath: instancePath + '/fields', + parentData: data, + parentDataProperty: 'fields', + rootData, + }) + ) { + vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); + errors = vErrors.length; + } + } + if (data.types !== undefined) { + if ( + !validate33(data.types, { + instancePath: instancePath + '/types', + parentData: data, + parentDataProperty: 'types', + rootData, + }) + ) { + vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); + errors = vErrors.length; + } + } + } else { + const err95 = { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + validate32.errors = vErrors; + return errors === 0; +} +function validate24( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + /*# sourceURL="https://netlify-cms/object.json" */ 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: schema40.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 (func9(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 < len0; i0++) { + if (typeof data7[i0] !== 'string') { + const err16 = { + instancePath: instancePath + '/local_backend/allowed_hosts/' + i0, + schemaPath: + '#/properties/local_backend/oneOf/1/properties/allowed_hosts/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + } else { + const err17 = { + instancePath: instancePath + '/local_backend/allowed_hosts', + schemaPath: '#/properties/local_backend/oneOf/1/properties/allowed_hosts/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + } else { + const err18 = { + instancePath: instancePath + '/local_backend', + schemaPath: '#/properties/local_backend/oneOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + var _valid1 = _errs18 === errors; + if (_valid1 && valid3) { + valid3 = false; + passing0 = [passing0, 1]; + } else { + if (_valid1) { + valid3 = true; + passing0 = 1; + } + } + if (!valid3) { + const err19 = { + instancePath: instancePath + '/local_backend', + schemaPath: '#/properties/local_backend/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing0 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } else { + errors = _errs15; + if (vErrors !== null) { + if (_errs15) { + vErrors.length = _errs15; + } else { + vErrors = null; + } + } + } + } + if (data.locale !== undefined) { + if (typeof data.locale !== 'string') { + const err20 = { + instancePath: instancePath + '/locale', + schemaPath: '#/properties/locale/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } + if (data.i18n !== undefined) { + let data10 = data.i18n; + if (data10 && typeof data10 == 'object' && !Array.isArray(data10)) { + if (data10.structure === undefined) { + const err21 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/required', + keyword: 'required', + params: { missingProperty: 'structure' }, + message: "must have required property '" + 'structure' + "'", + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + if (data10.locales === undefined) { + const err22 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/required', + keyword: 'required', + params: { missingProperty: 'locales' }, + message: "must have required property '" + 'locales' + "'", + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + if (data10.structure !== undefined) { + let data11 = data10.structure; + if (typeof data11 !== 'string') { + const err23 = { + instancePath: instancePath + '/i18n/structure', + schemaPath: '#/properties/i18n/properties/structure/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data11 === 'multiple_folders' || + data11 === 'multiple_files' || + data11 === 'single_file' + ) + ) { + const err24 = { + instancePath: instancePath + '/i18n/structure', + schemaPath: '#/properties/i18n/properties/structure/enum', + keyword: 'enum', + params: { allowedValues: schema40.properties.i18n.properties.structure.enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + } + if (data10.locales !== undefined) { + let data12 = data10.locales; + if (Array.isArray(data12)) { + if (data12.length < 2) { + const err25 = { + instancePath: instancePath + '/i18n/locales', + schemaPath: '#/properties/i18n/properties/locales/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + const len1 = data12.length; + for (let i1 = 0; i1 < len1; i1++) { + let data13 = data12[i1]; + if (typeof data13 === 'string') { + if (func9(data13) > 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 (func9(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 (func9(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 (func9(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: schema40.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: schema40.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 < len2; i3++) { + let data30 = data29[i3]; + const _errs71 = errors; + const _errs72 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + let missing0; + if ( + (data30.sortable_fields === undefined && (missing0 = 'sortable_fields')) || + (data30.sortableFields === undefined && (missing0 = 'sortableFields')) + ) { + const err55 = {}; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid15 = _errs72 === errors; + if (valid15) { + const err56 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/not', + keyword: 'not', + params: {}, + message: 'must NOT be valid', + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + errors = _errs71; + if (vErrors !== null) { + if (_errs71) { + vErrors.length = _errs71; + } else { + vErrors = null; + } + } + } + const _errs73 = errors; + let valid16 = false; + let passing1 = null; + const _errs74 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.files === undefined) { + const err57 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'files' }, + message: "must have required property '" + 'files' + "'", + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } + var _valid2 = _errs74 === errors; + if (_valid2) { + valid16 = true; + passing1 = 0; + } + const _errs75 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.folder === undefined) { + const err58 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'folder' }, + message: "must have required property '" + 'folder' + "'", + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + if (data30.fields === undefined) { + const err59 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'fields' }, + message: "must have required property '" + 'fields' + "'", + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } + var _valid2 = _errs75 === errors; + if (_valid2 && valid16) { + valid16 = false; + passing1 = [passing1, 1]; + } else { + if (_valid2) { + valid16 = true; + passing1 = 1; + } + } + if (!valid16) { + const err60 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing1 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } else { + errors = _errs73; + if (vErrors !== null) { + if (_errs73) { + vErrors.length = _errs73; + } else { + vErrors = null; + } + } + } + const _errs76 = errors; + let valid17 = true; + const _errs77 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + let missing1; + if (data30.extension === undefined && (missing1 = 'extension')) { + const err61 = {}; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + var _valid3 = _errs77 === errors; + errors = _errs76; + if (vErrors !== null) { + if (_errs76) { + vErrors.length = _errs76; + } else { + vErrors = null; + } + } + if (_valid3) { + const _errs78 = errors; + const _errs79 = errors; + let valid18 = true; + const _errs80 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.extension !== undefined) { + let data31 = data30.extension; + if ( + !( + data31 === 'yml' || + data31 === 'yaml' || + data31 === 'toml' || + data31 === 'json' || + data31 === 'md' || + data31 === 'markdown' || + data31 === 'html' + ) + ) { + const err62 = {}; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + } + var _valid4 = _errs80 === errors; + errors = _errs79; + if (vErrors !== null) { + if (_errs79) { + vErrors.length = _errs79; + } else { + vErrors = null; + } + } + if (!_valid4) { + const _errs82 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.format === undefined) { + const err63 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/then/else/required', + keyword: 'required', + params: { missingProperty: 'format' }, + message: "must have required property '" + 'format' + "'", + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } + var _valid4 = _errs82 === errors; + valid18 = _valid4; + } + if (!valid18) { + const err64 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/then/if', + keyword: 'if', + params: { failingKeyword: 'else' }, + message: 'must match "else" schema', + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + var _valid3 = _errs78 === errors; + valid17 = _valid3; + } + if (!valid17) { + const err65 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/if', + keyword: 'if', + params: { failingKeyword: 'then' }, + message: 'must match "then" schema', + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.name === undefined) { + const err66 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + if (data30.label === undefined) { + const err67 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } + if (data30.frontmatter_delimiter !== undefined) { + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.format === undefined) { + const err68 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: + '#/properties/collections/items/dependencies/frontmatter_delimiter/required', + keyword: 'required', + params: { missingProperty: 'format' }, + message: "must have required property '" + 'format' + "'", + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + if (data30.format !== undefined) { + let data32 = data30.format; + if ( + !( + data32 === 'yaml-frontmatter' || + data32 === 'toml-frontmatter' || + data32 === 'json-frontmatter' + ) + ) { + const err69 = { + instancePath: instancePath + '/collections/' + i3 + '/format', + schemaPath: + '#/properties/collections/items/dependencies/frontmatter_delimiter/properties/format/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.dependencies.frontmatter_delimiter + .properties.format.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + if (data30.name !== undefined) { + if (typeof data30.name !== 'string') { + const err70 = { + instancePath: instancePath + '/collections/' + i3 + '/name', + schemaPath: '#/properties/collections/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + if (data30.label !== undefined) { + if (typeof data30.label !== 'string') { + const err71 = { + instancePath: instancePath + '/collections/' + i3 + '/label', + schemaPath: '#/properties/collections/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + if (data30.label_singular !== undefined) { + if (typeof data30.label_singular !== 'string') { + const err72 = { + instancePath: instancePath + '/collections/' + i3 + '/label_singular', + schemaPath: '#/properties/collections/items/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + if (data30.description !== undefined) { + if (typeof data30.description !== 'string') { + const err73 = { + instancePath: instancePath + '/collections/' + i3 + '/description', + schemaPath: '#/properties/collections/items/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + } + if (data30.folder !== undefined) { + if (typeof data30.folder !== 'string') { + const err74 = { + instancePath: instancePath + '/collections/' + i3 + '/folder', + schemaPath: '#/properties/collections/items/properties/folder/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } + if (data30.files !== undefined) { + let data38 = data30.files; + if (Array.isArray(data38)) { + const len3 = data38.length; + for (let i4 = 0; i4 < len3; i4++) { + let data39 = data38[i4]; + if (data39 && typeof data39 == 'object' && !Array.isArray(data39)) { + if (data39.name === undefined) { + const err75 = { + instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, + schemaPath: + '#/properties/collections/items/properties/files/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + if (data39.label === undefined) { + const err76 = { + instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, + schemaPath: + '#/properties/collections/items/properties/files/items/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + if (data39.file === undefined) { + const err77 = { + instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, + schemaPath: + '#/properties/collections/items/properties/files/items/required', + keyword: 'required', + params: { missingProperty: 'file' }, + message: "must have required property '" + 'file' + "'", + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + if (data39.fields === undefined) { + const err78 = { + instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, + schemaPath: + '#/properties/collections/items/properties/files/items/required', + keyword: 'required', + params: { missingProperty: 'fields' }, + message: "must have required property '" + 'fields' + "'", + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + if (data39.name !== undefined) { + if (typeof data39.name !== 'string') { + const err79 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/name', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + if (data39.label !== undefined) { + if (typeof data39.label !== 'string') { + const err80 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/label', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + } + if (data39.label_singular !== undefined) { + if (typeof data39.label_singular !== 'string') { + const err81 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/label_singular', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + if (data39.description !== undefined) { + if (typeof data39.description !== 'string') { + const err82 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/description', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + if (data39.file !== undefined) { + if (typeof data39.file !== 'string') { + const err83 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/file', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + if (data39.preview_path !== undefined) { + if (typeof data39.preview_path !== 'string') { + const err84 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/preview_path', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/preview_path/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + if (data39.preview_path_date_field !== undefined) { + if (typeof data39.preview_path_date_field !== 'string') { + const err85 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/preview_path_date_field', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/preview_path_date_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + if (data39.fields !== undefined) { + let data47 = data39.fields; + if (Array.isArray(data47)) { + if (data47.length < 1) { + const err86 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/fields', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + const len4 = data47.length; + for (let i5 = 0; i5 < len4; i5++) { + let data48 = data47[i5]; + const vSchema6 = data48 && data48.widget; + if (!(vSchema6 === undefined)) { + if ( + typeof vSchema6 !== 'string' && + !(typeof vSchema6 == 'number') && + typeof vSchema6 !== 'boolean' && + vSchema6 !== null + ) { + const err87 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/select', + keyword: 'select', + params: {}, + message: + '"select" keyword must be string,number,boolean,null ($data)', + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } else { + let valid28 = true; + const value0 = vSchema6 === null ? 'null' : vSchema6; + if ('' + value0 == 'unknown') { + var _valid5 = true; + valid28 = _valid5; + } else if ('' + value0 == 'string') { + var _valid5 = true; + valid28 = _valid5; + } else if ('' + value0 == 'number') { + const _errs117 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.step !== undefined) { + if (!(typeof data48.step == 'number')) { + const err88 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/step', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + if (data48.value_type !== undefined) { + if (typeof data48.value_type !== 'string') { + const err89 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/value_type', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } + if (data48.min !== undefined) { + if (!(typeof data48.min == 'number')) { + const err90 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/min', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + if (data48.max !== undefined) { + if (!(typeof data48.max == 'number')) { + const err91 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/max', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } + } + var _valid5 = _errs117 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'text') { + var _valid5 = true; + valid28 = _valid5; + } else if ('' + value0 == 'image') { + const _errs126 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.allow_multiple !== undefined) { + if (typeof data48.allow_multiple !== 'boolean') { + const err92 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/allow_multiple', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + var _valid5 = _errs126 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'file') { + const _errs129 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.allow_multiple !== undefined) { + if (typeof data48.allow_multiple !== 'boolean') { + const err93 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/allow_multiple', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + } + var _valid5 = _errs129 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'select') { + const _errs132 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.options === undefined) { + const err94 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + if (data48.multiple !== undefined) { + if (typeof data48.multiple !== 'boolean') { + const err95 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/multiple', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + if (data48.min !== undefined) { + let data56 = data48.min; + if ( + !( + typeof data56 == 'number' && + !(data56 % 1) && + !isNaN(data56) + ) + ) { + const err96 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/min', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + if (data48.max !== undefined) { + let data57 = data48.max; + if ( + !( + typeof data57 == 'number' && + !(data57 % 1) && + !isNaN(data57) + ) + ) { + const err97 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/max', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + if (data48.options !== undefined) { + let data58 = data48.options; + if (Array.isArray(data58)) { + const len5 = data58.length; + for (let i6 = 0; i6 < len5; i6++) { + let data59 = data58[i6]; + const _errs142 = errors; + let valid35 = false; + let passing2 = null; + const _errs143 = errors; + if (typeof data59 !== 'string') { + const err98 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + var _valid6 = _errs143 === errors; + if (_valid6) { + valid35 = true; + passing2 = 0; + } + const _errs145 = errors; + if (!(typeof data59 == 'number')) { + const err99 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + var _valid6 = _errs145 === errors; + if (_valid6 && valid35) { + valid35 = false; + passing2 = [passing2, 1]; + } else { + if (_valid6) { + valid35 = true; + passing2 = 1; + } + const _errs147 = errors; + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + if (data59.label === undefined) { + const err100 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: + "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + if (data59.value === undefined) { + const err101 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: + "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + if (data59.label !== undefined) { + if (typeof data59.label !== 'string') { + const err102 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6 + + '/label', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + } + if (data59.value !== undefined) { + let data61 = data59.value; + const _errs152 = errors; + let valid37 = false; + let passing3 = null; + const _errs153 = errors; + if (typeof data61 !== 'string') { + const err103 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6 + + '/value', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var _valid7 = _errs153 === errors; + if (_valid7) { + valid37 = true; + passing3 = 0; + } + const _errs155 = errors; + if (!(typeof data61 == 'number')) { + const err104 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6 + + '/value', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var _valid7 = _errs155 === errors; + if (_valid7 && valid37) { + valid37 = false; + passing3 = [passing3, 1]; + } else { + if (_valid7) { + valid37 = true; + passing3 = 1; + } + } + if (!valid37) { + const err105 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6 + + '/value', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs152; + if (vErrors !== null) { + if (_errs152) { + vErrors.length = _errs152; + } else { + vErrors = null; + } + } + } + } + } else { + const err106 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + var _valid6 = _errs147 === errors; + if (_valid6 && valid35) { + valid35 = false; + passing2 = [passing2, 2]; + } else { + if (_valid6) { + valid35 = true; + passing2 = 2; + } + } + } + if (!valid35) { + const err107 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing2 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } else { + errors = _errs142; + if (vErrors !== null) { + if (_errs142) { + vErrors.length = _errs142; + } else { + vErrors = null; + } + } + } + } + } else { + const err108 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + } + var _valid5 = _errs132 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'markdown') { + const _errs157 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.minimal !== undefined) { + if (typeof data48.minimal !== 'boolean') { + const err109 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/minimal', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + if (data48.buttons !== undefined) { + let data63 = data48.buttons; + if (Array.isArray(data63)) { + const len6 = data63.length; + for (let i7 = 0; i7 < len6; i7++) { + let data64 = data63[i7]; + if (typeof data64 !== 'string') { + const err110 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/buttons/' + + i7, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/buttons/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } + if ( + !( + data64 === 'bold' || + data64 === 'italic' || + data64 === 'code' || + data64 === 'link' || + data64 === 'heading-one' || + data64 === 'heading-two' || + data64 === 'heading-three' || + data64 === 'heading-four' || + data64 === 'heading-five' || + data64 === 'heading-six' || + data64 === 'quote' || + data64 === 'bulleted-list' || + data64 === 'numbered-list' + ) + ) { + const err111 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/buttons/' + + i7, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties + .files.items.properties.fields.items.selectCases + .markdown.properties.buttons.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } + } else { + const err112 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/buttons', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + if (data48.editor_components !== undefined) { + let data65 = data48.editor_components; + if (Array.isArray(data65)) { + const len7 = data65.length; + for (let i8 = 0; i8 < len7; i8++) { + if (typeof data65[i8] !== 'string') { + const err113 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/editor_components/' + + i8, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + } else { + const err114 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/editor_components', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + if (data48.modes !== undefined) { + let data67 = data48.modes; + if (Array.isArray(data67)) { + if (data67.length < 1) { + const err115 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/modes', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + const len8 = data67.length; + for (let i9 = 0; i9 < len8; i9++) { + let data68 = data67[i9]; + if (typeof data68 !== 'string') { + const err116 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/modes/' + + i9, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } + if (!(data68 === 'raw' || data68 === 'rich_text')) { + const err117 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/modes/' + + i9, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties + .files.items.properties.fields.items.selectCases + .markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + } + } else { + const err118 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/modes', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } + } + } + var _valid5 = _errs157 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'list') { + const _errs172 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.allow_add !== undefined) { + if (typeof data48.allow_add !== 'boolean') { + const err119 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/allow_add', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } + if (data48.collapsed !== undefined) { + if (typeof data48.collapsed !== 'boolean') { + const err120 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/collapsed', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + if (data48.summary !== undefined) { + if (typeof data48.summary !== 'string') { + const err121 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/summary', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + if (data48.minimize_collapsed !== undefined) { + if (typeof data48.minimize_collapsed !== 'boolean') { + const err122 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/minimize_collapsed', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + if (data48.label_singular !== undefined) { + if (typeof data48.label_singular !== 'string') { + const err123 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/label_singular', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + if (data48.i18n !== undefined) { + if (typeof data48.i18n !== 'boolean') { + const err124 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + } + } + if (data48.min !== undefined) { + if (!(typeof data48.min == 'number')) { + const err125 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/min', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err125]; + } else { + vErrors.push(err125); + } + errors++; + } + } + if (data48.max !== undefined) { + if (!(typeof data48.max == 'number')) { + const err126 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/max', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err126]; + } else { + vErrors.push(err126); + } + errors++; + } + } + } + var _valid5 = _errs172 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'object') { + const _errs189 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.collapsed !== undefined) { + if (typeof data48.collapsed !== 'boolean') { + const err127 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/collapsed', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err127]; + } else { + vErrors.push(err127); + } + errors++; + } + } + if (data48.i18n !== undefined) { + if (typeof data48.i18n !== 'boolean') { + const err128 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/object/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err128]; + } else { + vErrors.push(err128); + } + errors++; + } + } + } + var _valid5 = _errs189 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'relation') { + const _errs194 = errors; + const _errs195 = errors; + let valid47 = false; + let passing4 = null; + const _errs196 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.collection === undefined) { + const err129 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err129]; + } else { + vErrors.push(err129); + } + errors++; + } + if (data48.value_field === undefined) { + const err130 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: + "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err130]; + } else { + vErrors.push(err130); + } + errors++; + } + if (data48.search_fields === undefined) { + const err131 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: + "must have required property '" + 'search_fields' + "'", + }; + if (vErrors === null) { + vErrors = [err131]; + } else { + vErrors.push(err131); + } + errors++; + } + } + var _valid8 = _errs196 === errors; + if (_valid8) { + valid47 = true; + passing4 = 0; + } + const _errs197 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.collection === undefined) { + const err132 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err132]; + } else { + vErrors.push(err132); + } + errors++; + } + if (data48.valueField === undefined) { + const err133 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err133]; + } else { + vErrors.push(err133); + } + errors++; + } + if (data48.searchFields === undefined) { + const err134 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: + "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err134]; + } else { + vErrors.push(err134); + } + errors++; + } + } + var _valid8 = _errs197 === errors; + if (_valid8 && valid47) { + valid47 = false; + passing4 = [passing4, 1]; + } else { + if (_valid8) { + valid47 = true; + passing4 = 1; + } + } + if (!valid47) { + const err135 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing4 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err135]; + } else { + vErrors.push(err135); + } + errors++; + } else { + errors = _errs195; + if (vErrors !== null) { + if (_errs195) { + vErrors.length = _errs195; + } else { + vErrors = null; + } + } + } + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.collection !== undefined) { + if (typeof data48.collection !== 'string') { + const err136 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/collection', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err136]; + } else { + vErrors.push(err136); + } + errors++; + } + } + if (data48.value_field !== undefined) { + if (typeof data48.value_field !== 'string') { + const err137 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/value_field', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err137]; + } else { + vErrors.push(err137); + } + errors++; + } + } + if (data48.search_fields !== undefined) { + let data81 = data48.search_fields; + if (Array.isArray(data81)) { + if (data81.length < 1) { + const err138 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/search_fields', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err138]; + } else { + vErrors.push(err138); + } + errors++; + } + const len9 = data81.length; + for (let i10 = 0; i10 < len9; i10++) { + if (typeof data81[i10] !== 'string') { + const err139 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/search_fields/' + + i10, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err139]; + } else { + vErrors.push(err139); + } + errors++; + } + } + } else { + const err140 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/search_fields', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err140]; + } else { + vErrors.push(err140); + } + errors++; + } + } + if (data48.file !== undefined) { + if (typeof data48.file !== 'string') { + const err141 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/file', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err141]; + } else { + vErrors.push(err141); + } + errors++; + } + } + if (data48.multiple !== undefined) { + if (typeof data48.multiple !== 'boolean') { + const err142 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/multiple', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err142]; + } else { + vErrors.push(err142); + } + errors++; + } + } + if (data48.min !== undefined) { + let data85 = data48.min; + if ( + !( + typeof data85 == 'number' && + !(data85 % 1) && + !isNaN(data85) + ) + ) { + const err143 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/min', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err143]; + } else { + vErrors.push(err143); + } + errors++; + } + } + if (data48.max !== undefined) { + let data86 = data48.max; + if ( + !( + typeof data86 == 'number' && + !(data86 % 1) && + !isNaN(data86) + ) + ) { + const err144 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/max', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err144]; + } else { + vErrors.push(err144); + } + errors++; + } + } + if (data48.display_fields !== undefined) { + let data87 = data48.display_fields; + if (Array.isArray(data87)) { + if (data87.length < 1) { + const err145 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/display_fields', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err145]; + } else { + vErrors.push(err145); + } + errors++; + } + const len10 = data87.length; + for (let i11 = 0; i11 < len10; i11++) { + if (typeof data87[i11] !== 'string') { + const err146 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/display_fields/' + + i11, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err146]; + } else { + vErrors.push(err146); + } + errors++; + } + } + } else { + const err147 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/display_fields', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err147]; + } else { + vErrors.push(err147); + } + errors++; + } + } + if (data48.options_length !== undefined) { + let data89 = data48.options_length; + if ( + !( + typeof data89 == 'number' && + !(data89 % 1) && + !isNaN(data89) + ) + ) { + const err148 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options_length', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err148]; + } else { + vErrors.push(err148); + } + errors++; + } + } + } + var _valid5 = _errs194 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'boolean') { + var _valid5 = true; + valid28 = _valid5; + } else if ('' + value0 == 'map') { + const _errs220 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.decimals !== undefined) { + let data90 = data48.decimals; + if ( + !( + typeof data90 == 'number' && + !(data90 % 1) && + !isNaN(data90) + ) + ) { + const err149 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/decimals', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err149]; + } else { + vErrors.push(err149); + } + errors++; + } + } + if (data48.type !== undefined) { + let data91 = data48.type; + if (typeof data91 !== 'string') { + const err150 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/type', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/map/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err150]; + } else { + vErrors.push(err150); + } + errors++; + } + if ( + !( + data91 === 'Point' || + data91 === 'LineString' || + data91 === 'Polygon' + ) + ) { + const err151 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/type', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/map/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties.files + .items.properties.fields.items.selectCases.map + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err151]; + } else { + vErrors.push(err151); + } + errors++; + } + } + } + var _valid5 = _errs220 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'date') { + var _valid5 = true; + valid28 = _valid5; + } else if ('' + value0 == 'datetime') { + const _errs225 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.format !== undefined) { + if (typeof data48.format !== 'string') { + const err152 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err152]; + } else { + vErrors.push(err152); + } + errors++; + } + } + if (data48.date_format !== undefined) { + let data93 = data48.date_format; + const _errs229 = errors; + let valid55 = false; + let passing5 = null; + const _errs230 = errors; + if (typeof data93 !== 'string') { + const err153 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err153]; + } else { + vErrors.push(err153); + } + errors++; + } + var _valid9 = _errs230 === errors; + if (_valid9) { + valid55 = true; + passing5 = 0; + } + const _errs232 = errors; + if (typeof data93 !== 'boolean') { + const err154 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err154]; + } else { + vErrors.push(err154); + } + errors++; + } + var _valid9 = _errs232 === errors; + if (_valid9 && valid55) { + valid55 = false; + passing5 = [passing5, 1]; + } else { + if (_valid9) { + valid55 = true; + passing5 = 1; + } + } + if (!valid55) { + const err155 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing5 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err155]; + } else { + vErrors.push(err155); + } + errors++; + } else { + errors = _errs229; + if (vErrors !== null) { + if (_errs229) { + vErrors.length = _errs229; + } else { + vErrors = null; + } + } + } + } + if (data48.time_format !== undefined) { + let data94 = data48.time_format; + const _errs235 = errors; + let valid56 = false; + let passing6 = null; + const _errs236 = errors; + if (typeof data94 !== 'string') { + const err156 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err156]; + } else { + vErrors.push(err156); + } + errors++; + } + var _valid10 = _errs236 === errors; + if (_valid10) { + valid56 = true; + passing6 = 0; + } + const _errs238 = errors; + if (typeof data94 !== 'boolean') { + const err157 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err157]; + } else { + vErrors.push(err157); + } + errors++; + } + var _valid10 = _errs238 === errors; + if (_valid10 && valid56) { + valid56 = false; + passing6 = [passing6, 1]; + } else { + if (_valid10) { + valid56 = true; + passing6 = 1; + } + } + if (!valid56) { + const err158 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing6 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err158]; + } else { + vErrors.push(err158); + } + errors++; + } else { + errors = _errs235; + if (vErrors !== null) { + if (_errs235) { + vErrors.length = _errs235; + } else { + vErrors = null; + } + } + } + } + if (data48.picker_utc !== undefined) { + if (typeof data48.picker_utc !== 'boolean') { + const err159 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/picker_utc', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err159]; + } else { + vErrors.push(err159); + } + errors++; + } + } + } + var _valid5 = _errs225 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'code') { + const _errs242 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.default_language !== undefined) { + if (typeof data48.default_language !== 'string') { + const err160 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/default_language', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err160]; + } else { + vErrors.push(err160); + } + errors++; + } + } + if (data48.allow_language_selection !== undefined) { + if (typeof data48.allow_language_selection !== 'boolean') { + const err161 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/allow_language_selection', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err161]; + } else { + vErrors.push(err161); + } + errors++; + } + } + if (data48.output_code_only !== undefined) { + if (typeof data48.output_code_only !== 'boolean') { + const err162 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/output_code_only', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err162]; + } else { + vErrors.push(err162); + } + errors++; + } + } + if (data48.keys !== undefined) { + let data99 = data48.keys; + if ( + data99 && + typeof data99 == 'object' && + !Array.isArray(data99) + ) { + if (data99.code !== undefined) { + if (typeof data99.code !== 'string') { + const err163 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/keys/code', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err163]; + } else { + vErrors.push(err163); + } + errors++; + } + } + if (data99.lang !== undefined) { + if (typeof data99.lang !== 'string') { + const err164 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/keys/lang', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err164]; + } else { + vErrors.push(err164); + } + errors++; + } + } + } else { + const err165 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/keys', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err165]; + } else { + vErrors.push(err165); + } + errors++; + } + } + } + var _valid5 = _errs242 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'color') { + var _valid5 = true; + valid28 = _valid5; + } + if (!valid28) { + const err166 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', + }; + if (vErrors === null) { + vErrors = [err166]; + } else { + vErrors.push(err166); + } + errors++; + } + } + } + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.name === undefined) { + const err167 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err167]; + } else { + vErrors.push(err167); + } + errors++; + } + if (data48.name !== undefined) { + if (typeof data48.name !== 'string') { + const err168 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/name', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err168]; + } else { + vErrors.push(err168); + } + errors++; + } + } + if (data48.label !== undefined) { + if (typeof data48.label !== 'string') { + const err169 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/label', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err169]; + } else { + vErrors.push(err169); + } + errors++; + } + } + if (data48.widget !== undefined) { + if (typeof data48.widget !== 'string') { + const err170 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/widget', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err170]; + } else { + vErrors.push(err170); + } + errors++; + } + } + if (data48.required !== undefined) { + if (typeof data48.required !== 'boolean') { + const err171 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/required', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err171]; + } else { + vErrors.push(err171); + } + errors++; + } + } + if (data48.i18n !== undefined) { + let data106 = data48.i18n; + const _errs265 = errors; + let valid60 = false; + let passing7 = null; + const _errs266 = errors; + if (typeof data106 !== 'boolean') { + const err172 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err172]; + } else { + vErrors.push(err172); + } + errors++; + } + var _valid11 = _errs266 === errors; + if (_valid11) { + valid60 = true; + passing7 = 0; + } + const _errs268 = errors; + if (typeof data106 !== 'string') { + const err173 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err173]; + } else { + vErrors.push(err173); + } + errors++; + } + if ( + !( + data106 === 'translate' || + data106 === 'duplicate' || + data106 === 'none' + ) + ) { + const err174 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties.files.items + .properties.fields.items.properties.i18n.oneOf[1].enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err174]; + } else { + vErrors.push(err174); + } + errors++; + } + var _valid11 = _errs268 === errors; + if (_valid11 && valid60) { + valid60 = false; + passing7 = [passing7, 1]; + } else { + if (_valid11) { + valid60 = true; + passing7 = 1; + } + } + if (!valid60) { + const err175 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing7 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err175]; + } else { + vErrors.push(err175); + } + errors++; + } else { + errors = _errs265; + if (vErrors !== null) { + if (_errs265) { + vErrors.length = _errs265; + } else { + vErrors = null; + } + } + } + } + if (data48.hint !== undefined) { + if (typeof data48.hint !== 'string') { + const err176 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/hint', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err176]; + } else { + vErrors.push(err176); + } + errors++; + } + } + if (data48.pattern !== undefined) { + let data108 = data48.pattern; + if (Array.isArray(data108)) { + if (data108.length < 2) { + const err177 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/pattern', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err177]; + } else { + vErrors.push(err177); + } + errors++; + } + const len11 = data108.length; + if (len11 > 0) { + const _errs275 = errors; + let valid62 = false; + let passing8 = null; + const _errs276 = errors; + if (typeof data108[0] !== 'string') { + const err178 = { + 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 = [err178]; + } else { + vErrors.push(err178); + } + errors++; + } + var _valid12 = _errs276 === errors; + if (_valid12) { + valid62 = true; + passing8 = 0; + } + var _valid12 = true; + if (_valid12 && valid62) { + valid62 = false; + passing8 = [passing8, 1]; + } else { + if (_valid12) { + valid62 = true; + passing8 = 1; + } + } + if (!valid62) { + const err179 = { + 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: passing8 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err179]; + } else { + vErrors.push(err179); + } + errors++; + } else { + errors = _errs275; + if (vErrors !== null) { + if (_errs275) { + vErrors.length = _errs275; + } else { + vErrors = null; + } + } + } + } + if (len11 > 1) { + if (typeof data108[1] !== 'string') { + const err180 = { + 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 = [err180]; + } else { + vErrors.push(err180); + } + errors++; + } + } + } else { + const err181 = { + 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 = [err181]; + } else { + vErrors.push(err181); + } + errors++; + } + } + if (data48.field !== undefined) { + if ( + !validate25(data48.field, { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/field', + parentData: data48, + parentDataProperty: 'field', + rootData, + }) + ) { + vErrors = + vErrors === null + ? validate25.errors + : vErrors.concat(validate25.errors); + errors = vErrors.length; + } + } + if (data48.fields !== undefined) { + if ( + !validate26(data48.fields, { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/fields', + parentData: data48, + parentDataProperty: 'fields', + rootData, + }) + ) { + vErrors = + vErrors === null + ? validate26.errors + : vErrors.concat(validate26.errors); + errors = vErrors.length; + } + } + if (data48.types !== undefined) { + if ( + !validate26(data48.types, { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/types', + parentData: data48, + parentDataProperty: 'types', + rootData, + }) + ) { + vErrors = + vErrors === null + ? validate26.errors + : vErrors.concat(validate26.errors); + errors = vErrors.length; + } + } + } else { + const err182 = { + 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 = [err182]; + } else { + vErrors.push(err182); + } + errors++; + } + } + } else { + const err183 = { + 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 = [err183]; + } else { + vErrors.push(err183); + } + errors++; + } + } + } else { + const err184 = { + 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 = [err184]; + } else { + vErrors.push(err184); + } + errors++; + } } - } - } - } - }, - "color": {} - }, - "required": ["name"] - }, - "uniqueItemProperties": ["name"] - }; - refVal4.errors = null; - refVal[4] = refVal4; - return function validate(data, dataPath, parentData, parentDataProperty, rootData) { - 'use strict'; /*# sourceURL=https://netlify-cms/object.json */ - var vErrors = null; - var errors = 0; - if (rootData === undefined) rootData = data; - if ((data && typeof data === "object" && !Array.isArray(data))) { - var errs__0 = errors; - var valid1 = true; - var data1 = data.backend; - if (data1 === undefined) { - valid1 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + "", - schemaPath: '#/required', - params: { - missingProperty: 'backend' - }, - message: 'should have required property \'backend\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_1 = errors; - if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { - var errs__1 = errors; - var valid2 = true; - if (data1.name === undefined) { - valid2 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.backend', - schemaPath: '#/properties/backend/required', - params: { - missingProperty: 'name' - }, - message: 'should have required property \'name\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_2 = errors; - if (typeof data1.name !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.backend.name', - schemaPath: '#/properties/backend/properties/name/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - var data2 = data1.auth_scope; - if (data2 !== undefined) { - var errs_2 = errors; - if (typeof data2 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.backend.auth_scope', - schemaPath: '#/properties/backend/properties/auth_scope/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema2 = validate.schema.properties.backend.properties.auth_scope.enum; - var valid2; - valid2 = false; - for (var i2 = 0; i2 < schema2.length; i2++) - if (equal(data2, schema2[i2])) { - valid2 = true; - break; - } if (!valid2) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.backend.auth_scope', - schemaPath: '#/properties/backend/properties/auth_scope/enum', - params: { - allowedValues: schema2 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - var data2 = data1.cms_label_prefix; - if (data2 !== undefined) { - var errs_2 = errors; - if (typeof data2 === "string") { - if (ucs2length(data2) < 1) { - var err = { - keyword: 'minLength', - dataPath: (dataPath || '') + '.backend.cms_label_prefix', - schemaPath: '#/properties/backend/properties/cms_label_prefix/minLength', - params: { - limit: 1 - }, - message: 'should NOT be shorter than 1 characters' + } else { + const err185 = { + 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 = [err]; - else vErrors.push(err); - errors++; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.backend.cms_label_prefix', - schemaPath: '#/properties/backend/properties/cms_label_prefix/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - if (data1.open_authoring !== undefined) { - var errs_2 = errors; - if (typeof data1.open_authoring !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.backend.open_authoring', - schemaPath: '#/properties/backend/properties/open_authoring/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.backend', - schemaPath: '#/properties/backend/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - var data1 = data.local_backend; - if (data1 !== undefined) { - var errs_1 = errors; - var errs__1 = errors, - prevValid1 = false, - valid1 = false, - passingSchemas1 = null; - var errs_2 = errors; - if (typeof data1 !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.local_backend', - schemaPath: '#/properties/local_backend/oneOf/0/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - if (valid2) { - valid1 = prevValid1 = true; - passingSchemas1 = 0; - } - var errs_2 = errors; - if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { - var errs__2 = errors; - var valid3 = true; - for (var key2 in data1) { - var isAdditional2 = !(false || key2 == 'url' || key2 == 'allowed_hosts'); - if (isAdditional2) { - valid3 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + '.local_backend', - schemaPath: '#/properties/local_backend/oneOf/1/additionalProperties', - params: { - additionalProperty: '' + key2 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - if (data1.url !== undefined) { - var errs_3 = errors; - if (typeof data1.url !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.local_backend.url', - schemaPath: '#/properties/local_backend/oneOf/1/properties/url/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data2 = data1.allowed_hosts; - if (data2 !== undefined) { - var errs_3 = errors; - if (Array.isArray(data2)) { - var errs__3 = errors; - var valid3; - for (var i3 = 0; i3 < data2.length; i3++) { - var errs_4 = errors; - if (typeof data2[i3] !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.local_backend.allowed_hosts[' + i3 + ']', - schemaPath: '#/properties/local_backend/oneOf/1/properties/allowed_hosts/items/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (vErrors === null) { + vErrors = [err185]; + } else { + vErrors.push(err185); } - var valid4 = errors === errs_4; + errors++; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.local_backend.allowed_hosts', - schemaPath: '#/properties/local_backend/oneOf/1/properties/allowed_hosts/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.local_backend', - schemaPath: '#/properties/local_backend/oneOf/1/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - if (valid2 && prevValid1) { - valid1 = false; - passingSchemas1 = [passingSchemas1, 1]; - } else { - if (valid2) { - valid1 = prevValid1 = true; - passingSchemas1 = 1; - } - } - if (!valid1) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '.local_backend', - schemaPath: '#/properties/local_backend/oneOf', - params: { - passingSchemas: passingSchemas1 - }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__1; - if (vErrors !== null) { - if (errs__1) vErrors.length = errs__1; - else vErrors = null; - } - } - var valid1 = errors === errs_1; - } - if (data.locale !== undefined) { - var errs_1 = errors; - if (typeof data.locale !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.locale', - schemaPath: '#/properties/locale/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - var data1 = data.i18n; - if (data1 !== undefined) { - var errs_1 = errors; - if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { - var errs__1 = errors; - var valid2 = true; - var data2 = data1.structure; - if (data2 === undefined) { - valid2 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.i18n', - schemaPath: '#/properties/i18n/required', - params: { - missingProperty: 'structure' - }, - message: 'should have required property \'structure\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_2 = errors; - if (typeof data2 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.i18n.structure', - schemaPath: '#/properties/i18n/properties/structure/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema2 = validate.schema.properties.i18n.properties.structure.enum; - var valid2; - valid2 = false; - for (var i2 = 0; i2 < schema2.length; i2++) - if (equal(data2, schema2[i2])) { - valid2 = true; - break; - } if (!valid2) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.i18n.structure', - schemaPath: '#/properties/i18n/properties/structure/enum', - params: { - allowedValues: schema2 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var valid2 = errors === errs_2; - } - var data2 = data1.locales; - if (data2 === undefined) { - valid2 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.i18n', - schemaPath: '#/properties/i18n/required', - params: { - missingProperty: 'locales' - }, - message: 'should have required property \'locales\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_2 = errors; - if (Array.isArray(data2)) { - if (data2.length < 2) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.i18n.locales', - schemaPath: '#/properties/i18n/properties/locales/minItems', - params: { - limit: 2 - }, - message: 'should NOT have fewer than 2 items' + if (data30.identifier_field !== undefined) { + if (typeof data30.identifier_field !== 'string') { + const err186 = { + 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 = [err]; - else vErrors.push(err); - errors++; - } - var errs__2 = errors; - var valid2; - for (var i2 = 0; i2 < data2.length; i2++) { - var data3 = data2[i2]; - var errs_3 = errors; - if (typeof data3 === "string") { - if (ucs2length(data3) > 10) { - var err = { - keyword: 'maxLength', - dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', - schemaPath: '#/properties/i18n/properties/locales/items/maxLength', - params: { - limit: 10 - }, - message: 'should NOT be longer than 10 characters' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - if (ucs2length(data3) < 2) { - var err = { - keyword: 'minLength', - dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', - schemaPath: '#/properties/i18n/properties/locales/items/minLength', - params: { - limit: 2 - }, - message: 'should NOT be shorter than 2 characters' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - if (!pattern0.test(data3)) { - var err = { - keyword: 'pattern', - dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', - schemaPath: '#/properties/i18n/properties/locales/items/pattern', - params: { - pattern: '^[a-zA-Z-_]+$' - }, - message: 'should match pattern "^[a-zA-Z-_]+$"' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } + if (vErrors === null) { + vErrors = [err186]; } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.i18n.locales[' + i2 + ']', - schemaPath: '#/properties/i18n/properties/locales/items/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + vErrors.push(err186); } - var valid3 = errors === errs_3; - } - var i = data2.length, - valid2 = true, - j; - if (i > 1) { - var itemIndices = {}, - item; - for (; i--;) { - var item = data2[i]; - if (typeof item !== "string") continue; - if (typeof itemIndices[item] == 'number') { - valid2 = false; - j = itemIndices[item]; - break; - } - itemIndices[item] = i; - } - } - if (!valid2) { - var err = { - keyword: 'uniqueItems', - dataPath: (dataPath || '') + '.i18n.locales', - schemaPath: '#/properties/i18n/properties/locales/uniqueItems', - params: { - i: i, - j: j - }, - message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); errors++; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.i18n.locales', - schemaPath: '#/properties/i18n/properties/locales/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var valid2 = errors === errs_2; - } - var data2 = data1.default_locale; - if (data2 !== undefined) { - var errs_2 = errors; - if (typeof data2 === "string") { - if (ucs2length(data2) > 10) { - var err = { - keyword: 'maxLength', - dataPath: (dataPath || '') + '.i18n.default_locale', - schemaPath: '#/properties/i18n/properties/default_locale/maxLength', - params: { - limit: 10 - }, - message: 'should NOT be longer than 10 characters' + if (data30.summary !== undefined) { + if (typeof data30.summary !== 'string') { + const err187 = { + 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 = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err187]; + } else { + vErrors.push(err187); + } errors++; } - if (ucs2length(data2) < 2) { - var err = { - keyword: 'minLength', - dataPath: (dataPath || '') + '.i18n.default_locale', - schemaPath: '#/properties/i18n/properties/default_locale/minLength', - params: { - limit: 2 - }, - message: 'should NOT be shorter than 2 characters' + } + if (data30.slug !== undefined) { + if (typeof data30.slug !== 'string') { + const err188 = { + 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 = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err188]; + } else { + vErrors.push(err188); + } errors++; } - if (!pattern0.test(data2)) { - var err = { - keyword: 'pattern', - dataPath: (dataPath || '') + '.i18n.default_locale', - schemaPath: '#/properties/i18n/properties/default_locale/pattern', - params: { - pattern: '^[a-zA-Z-_]+$' - }, - message: 'should match pattern "^[a-zA-Z-_]+$"' + } + if (data30.path !== undefined) { + if (typeof data30.path !== 'string') { + const err189 = { + 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 = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err189]; + } else { + vErrors.push(err189); + } errors++; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.i18n.default_locale', - schemaPath: '#/properties/i18n/properties/default_locale/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var valid2 = errors === errs_2; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.i18n', - schemaPath: '#/properties/i18n/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.site_url !== undefined) { - var errs_1 = errors; - if (typeof data.site_url !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.site_url', - schemaPath: '#/properties/site_url/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.display_url !== undefined) { - var errs_1 = errors; - if (typeof data.display_url !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.display_url', - schemaPath: '#/properties/display_url/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.logo_url !== undefined) { - var errs_1 = errors; - if (typeof data.logo_url !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.logo_url', - schemaPath: '#/properties/logo_url/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.show_preview_links !== undefined) { - var errs_1 = errors; - if (typeof data.show_preview_links !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.show_preview_links', - schemaPath: '#/properties/show_preview_links/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.media_folder !== undefined) { - var errs_1 = errors; - if (typeof data.media_folder !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.media_folder', - schemaPath: '#/properties/media_folder/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.public_folder !== undefined) { - var errs_1 = errors; - if (typeof data.public_folder !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.public_folder', - schemaPath: '#/properties/public_folder/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - if (data.media_folder_relative !== undefined) { - var errs_1 = errors; - if (typeof data.media_folder_relative !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.media_folder_relative', - schemaPath: '#/properties/media_folder_relative/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - var data1 = data.media_library; - if (data1 !== undefined) { - var errs_1 = errors; - if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { - var errs__1 = errors; - var valid2 = true; - if (data1.name === undefined) { - valid2 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.media_library', - schemaPath: '#/properties/media_library/required', - params: { - missingProperty: 'name' - }, - message: 'should have required property \'name\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_2 = errors; - if (typeof data1.name !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.media_library.name', - schemaPath: '#/properties/media_library/properties/name/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data30.preview_path !== undefined) { + if (typeof data30.preview_path !== 'string') { + const err190 = { + 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 = [err190]; + } else { + vErrors.push(err190); + } + errors++; + } } - var valid2 = errors === errs_2; - } - var data2 = data1.config; - if (data2 !== undefined) { - var errs_2 = errors; - if ((!data2 || typeof data2 !== "object" || Array.isArray(data2))) { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.media_library.config', - schemaPath: '#/properties/media_library/properties/config/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data30.preview_path_date_field !== undefined) { + if (typeof data30.preview_path_date_field !== 'string') { + const err191 = { + 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 = [err191]; + } else { + vErrors.push(err191); + } + errors++; + } } - var valid2 = errors === errs_2; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.media_library', - schemaPath: '#/properties/media_library/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - var data1 = data.publish_mode; - if (data1 !== undefined) { - var errs_1 = errors; - if (typeof data1 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.publish_mode', - schemaPath: '#/properties/publish_mode/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema1 = validate.schema.properties.publish_mode.enum; - var valid1; - valid1 = false; - for (var i1 = 0; i1 < schema1.length; i1++) - if (equal(data1, schema1[i1])) { - valid1 = true; - break; - } if (!valid1) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.publish_mode', - schemaPath: '#/properties/publish_mode/enum', - params: { - allowedValues: schema1 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - var data1 = data.slug; - if (data1 !== undefined) { - var errs_1 = errors; - if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { - var errs__1 = errors; - var valid2 = true; - var data2 = data1.encoding; - if (data2 !== undefined) { - var errs_2 = errors; - if (typeof data2 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.slug.encoding', - schemaPath: '#/properties/slug/properties/encoding/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data30.create !== undefined) { + if (typeof data30.create !== 'boolean') { + const err192 = { + 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 = [err192]; + } else { + vErrors.push(err192); + } + errors++; + } } - var schema2 = validate.schema.properties.slug.properties.encoding.enum; - var valid2; - valid2 = false; - for (var i2 = 0; i2 < schema2.length; i2++) - if (equal(data2, schema2[i2])) { - valid2 = true; - break; - } if (!valid2) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.slug.encoding', - schemaPath: '#/properties/slug/properties/encoding/enum', - params: { - allowedValues: schema2 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data30.publish !== undefined) { + if (typeof data30.publish !== 'boolean') { + const err193 = { + 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 = [err193]; + } else { + vErrors.push(err193); + } + errors++; + } } - var valid2 = errors === errs_2; - } - if (data1.clean_accents !== undefined) { - var errs_2 = errors; - if (typeof data1.clean_accents !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.slug.clean_accents', - schemaPath: '#/properties/slug/properties/clean_accents/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data30.hide !== undefined) { + if (typeof data30.hide !== 'boolean') { + const err194 = { + 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 = [err194]; + } else { + vErrors.push(err194); + } + errors++; + } } - var valid2 = errors === errs_2; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.slug', - schemaPath: '#/properties/slug/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - var data1 = data.collections; - if (data1 === undefined) { - valid1 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + "", - schemaPath: '#/required', - params: { - missingProperty: 'collections' - }, - message: 'should have required property \'collections\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_1 = errors; - if (Array.isArray(data1)) { - if (data1.length < 1) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.collections', - schemaPath: '#/properties/collections/minItems', - params: { - limit: 1 - }, - message: 'should NOT have fewer than 1 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__1 = errors; - var valid1; - for (var i1 = 0; i1 < data1.length; i1++) { - var data2 = data1[i1]; - var errs_2 = errors; - if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { - var errs__2 = errors; - var missing2; - valid3 = true; - if (data2.frontmatter_delimiter !== undefined) { - var errs_3 = errors; - if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { - var errs__3 = errors; - var valid4 = true; - if (data2.format === undefined) { - valid4 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/dependencies/frontmatter_delimiter/required', - params: { - missingProperty: 'format' - }, - message: 'should have required property \'format\'' + if (data30.editor !== undefined) { + let data123 = data30.editor; + if (data123 && typeof data123 == 'object' && !Array.isArray(data123)) { + if (data123.preview !== undefined) { + if (typeof data123.preview !== 'boolean') { + const err195 = { + 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 = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_4 = errors; - var schema4 = validate.schema.properties.collections.items.dependencies.frontmatter_delimiter.properties.format.enum; - var valid4; - valid4 = false; - for (var i4 = 0; i4 < schema4.length; i4++) - if (equal(data2.format, schema4[i4])) { - valid4 = true; - break; - } if (!valid4) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].format', - schemaPath: '#/properties/collections/items/dependencies/frontmatter_delimiter/properties/format/enum', - params: { - allowedValues: schema4 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (vErrors === null) { + vErrors = [err195]; + } else { + vErrors.push(err195); } - var valid4 = errors === errs_4; + errors++; } } - var valid3 = errors === errs_3; + } else { + const err196 = { + 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 = [err196]; + } else { + vErrors.push(err196); + } + errors++; } - var errs__2 = errors; - var valid3 = true; - if (data2.name === undefined) { - valid3 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/required', + } + if (data30.format !== undefined) { + let data125 = data30.format; + if (typeof data125 !== 'string') { + const err197 = { + 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 = [err197]; + } else { + vErrors.push(err197); + } + errors++; + } + if ( + !( + data125 === 'yml' || + data125 === 'yaml' || + data125 === 'toml' || + data125 === 'json' || + data125 === 'frontmatter' || + data125 === 'json-frontmatter' || + data125 === 'toml-frontmatter' || + data125 === 'yaml-frontmatter' + ) + ) { + const err198 = { + instancePath: instancePath + '/collections/' + i3 + '/format', + schemaPath: '#/properties/collections/items/properties/format/enum', + keyword: 'enum', params: { - missingProperty: 'name' + allowedValues: schema40.properties.collections.items.properties.format.enum, }, - message: 'should have required property \'name\'' + message: 'must be equal to one of the allowed values', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err198]; + } else { + vErrors.push(err198); + } errors++; - } else { - var errs_3 = errors; - if (typeof data2.name !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].name', - schemaPath: '#/properties/collections/items/properties/name/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } + } + if (data30.extension !== undefined) { + if (typeof data30.extension !== 'string') { + const err199 = { + 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 = [err199]; + } else { + vErrors.push(err199); } - var valid3 = errors === errs_3; + errors++; } - if (data2.label === undefined) { - valid3 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/required', + } + if (data30.frontmatter_delimiter !== undefined) { + let data127 = data30.frontmatter_delimiter; + if (typeof data127 !== 'string' && !Array.isArray(data127)) { + const err200 = { + instancePath: instancePath + '/collections/' + i3 + '/frontmatter_delimiter', + schemaPath: + '#/properties/collections/items/properties/frontmatter_delimiter/type', + keyword: 'type', params: { - missingProperty: 'label' + type: schema40.properties.collections.items.properties.frontmatter_delimiter + .type, }, - message: 'should have required property \'label\'' + message: 'must be string,array', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err200]; + } else { + vErrors.push(err200); + } errors++; - } else { - var errs_3 = errors; - if (typeof data2.label !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].label', - schemaPath: '#/properties/collections/items/properties/label/type', - params: { - type: 'string' - }, - message: 'should be string' + } + if (Array.isArray(data127)) { + if (data127.length > 2) { + const err201 = { + 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 = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err201]; + } else { + vErrors.push(err201); + } errors++; } - var valid3 = errors === errs_3; - } - if (data2.label_singular !== undefined) { - var errs_3 = errors; - if (typeof data2.label_singular !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].label_singular', - schemaPath: '#/properties/collections/items/properties/label_singular/type', - params: { - type: 'string' - }, - message: 'should be string' + if (data127.length < 2) { + const err202 = { + 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 = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err202]; + } else { + vErrors.push(err202); + } errors++; } - var valid3 = errors === errs_3; + const len12 = data127.length; + for (let i12 = 0; i12 < len12; i12++) { + if (typeof data127[i12] !== 'string') { + const err203 = { + instancePath: + instancePath + '/collections/' + i3 + '/frontmatter_delimiter/' + i12, + schemaPath: + '#/properties/collections/items/properties/frontmatter_delimiter/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err203]; + } else { + vErrors.push(err203); + } + errors++; + } + } } - if (data2.description !== undefined) { - var errs_3 = errors; - if (typeof data2.description !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].description', - schemaPath: '#/properties/collections/items/properties/description/type', - params: { - type: 'string' - }, - message: 'should be string' + } + if (data30.fields !== undefined) { + let data129 = data30.fields; + if (Array.isArray(data129)) { + if (data129.length < 1) { + const err204 = { + instancePath: instancePath + '/collections/' + i3 + '/fields', + schemaPath: '#/properties/collections/items/properties/fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err204]; + } else { + vErrors.push(err204); + } errors++; } - var valid3 = errors === errs_3; - } - if (data2.folder !== undefined) { - var errs_3 = errors; - if (typeof data2.folder !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].folder', - schemaPath: '#/properties/collections/items/properties/folder/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data3 = data2.files; - if (data3 !== undefined) { - var errs_3 = errors; - if (Array.isArray(data3)) { - var errs__3 = errors; - var valid3; - for (var i3 = 0; i3 < data3.length; i3++) { - var data4 = data3[i3]; - var errs_4 = errors; - if ((data4 && typeof data4 === "object" && !Array.isArray(data4))) { - var errs__4 = errors; - var valid5 = true; - if (data4.name === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/required', - params: { - missingProperty: 'name' - }, - message: 'should have required property \'name\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_5 = errors; - if (typeof data4.name !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].name', - schemaPath: '#/properties/collections/items/properties/files/items/properties/name/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid5 = errors === errs_5; - } - if (data4.label === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/required', - params: { - missingProperty: 'label' - }, - message: 'should have required property \'label\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + const len13 = data129.length; + for (let i13 = 0; i13 < len13; i13++) { + let data130 = data129[i13]; + const vSchema12 = data130 && data130.widget; + if (!(vSchema12 === undefined)) { + if ( + typeof vSchema12 !== 'string' && + !(typeof vSchema12 == 'number') && + typeof vSchema12 !== 'boolean' && + vSchema12 !== null + ) { + const err205 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: '#/properties/collections/items/properties/fields/items/select', + keyword: 'select', + params: {}, + message: '"select" keyword must be string,number,boolean,null ($data)', + }; + if (vErrors === null) { + vErrors = [err205]; } else { - var errs_5 = errors; - if (typeof data4.label !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].label', - schemaPath: '#/properties/collections/items/properties/files/items/properties/label/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid5 = errors === errs_5; - } - if (data4.label_singular !== undefined) { - var errs_5 = errors; - if (typeof data4.label_singular !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].label_singular', - schemaPath: '#/properties/collections/items/properties/files/items/properties/label_singular/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid5 = errors === errs_5; - } - if (data4.description !== undefined) { - var errs_5 = errors; - if (typeof data4.description !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].description', - schemaPath: '#/properties/collections/items/properties/files/items/properties/description/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid5 = errors === errs_5; + vErrors.push(err205); } - if (data4.file === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/required', - params: { - missingProperty: 'file' - }, - message: 'should have required property \'file\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_5 = errors; - if (typeof data4.file !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].file', - schemaPath: '#/properties/collections/items/properties/files/items/properties/file/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + errors++; + } else { + let valid68 = true; + const value1 = vSchema12 === null ? 'null' : vSchema12; + if ('' + value1 == 'unknown') { + var _valid13 = true; + valid68 = _valid13; + } else if ('' + value1 == 'string') { + var _valid13 = true; + valid68 = _valid13; + } else if ('' + value1 == 'number') { + const _errs317 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.step !== undefined) { + if (!(typeof data130.step == 'number')) { + const err206 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/step', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err206]; + } else { + vErrors.push(err206); + } + errors++; + } + } + if (data130.value_type !== undefined) { + if (typeof data130.value_type !== 'string') { + const err207 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/value_type', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err207]; + } else { + vErrors.push(err207); + } + errors++; + } + } + if (data130.min !== undefined) { + if (!(typeof data130.min == 'number')) { + const err208 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err208]; + } else { + vErrors.push(err208); + } + errors++; + } + } + if (data130.max !== undefined) { + if (!(typeof data130.max == 'number')) { + const err209 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err209]; + } else { + vErrors.push(err209); + } + errors++; + } + } } - var valid5 = errors === errs_5; - } - if (data4.preview_path !== undefined) { - var errs_5 = errors; - if (typeof data4.preview_path !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].preview_path', - schemaPath: '#/properties/collections/items/properties/files/items/properties/preview_path/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + var _valid13 = _errs317 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'text') { + var _valid13 = true; + valid68 = _valid13; + } else if ('' + value1 == 'image') { + const _errs326 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.allow_multiple !== undefined) { + if (typeof data130.allow_multiple !== 'boolean') { + const err210 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/allow_multiple', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err210]; + } else { + vErrors.push(err210); + } + errors++; + } + } } - var valid5 = errors === errs_5; - } - if (data4.preview_path_date_field !== undefined) { - var errs_5 = errors; - if (typeof data4.preview_path_date_field !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].preview_path_date_field', - schemaPath: '#/properties/collections/items/properties/files/items/properties/preview_path_date_field/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + var _valid13 = _errs326 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'file') { + const _errs329 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.allow_multiple !== undefined) { + if (typeof data130.allow_multiple !== 'boolean') { + const err211 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/allow_multiple', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err211]; + } else { + vErrors.push(err211); + } + errors++; + } + } } - var valid5 = errors === errs_5; - } - var data5 = data4.fields; - if (data5 === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/required', - params: { - missingProperty: 'fields' - }, - message: 'should have required property \'fields\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_5 = errors; - if (Array.isArray(data5)) { - if (data5.length < 1) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/minItems', - params: { - limit: 1 - }, - message: 'should NOT have fewer than 1 items' + var _valid13 = _errs329 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'select') { + const _errs332 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.options === undefined) { + const err212 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err212]; + } else { + vErrors.push(err212); + } errors++; } - var errs__5 = errors; - var valid5; - for (var i5 = 0; i5 < data5.length; i5++) { - var data6 = data5[i5]; - var errs_6 = errors; - if ((data6 && typeof data6 === "object" && !Array.isArray(data6))) { - var errs__6 = errors; - var valid7 = true; - if (data6.name === undefined) { - valid7 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/required', - params: { - missingProperty: 'name' - }, - message: 'should have required property \'name\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data130.multiple !== undefined) { + if (typeof data130.multiple !== 'boolean') { + const err213 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/multiple', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err213]; } else { - var errs_7 = errors; - if (typeof data6.name !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].name', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/name/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid7 = errors === errs_7; + vErrors.push(err213); } - if (data6.label !== undefined) { - var errs_7 = errors; - if (typeof data6.label !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].label', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/label/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid7 = errors === errs_7; - } - if (data6.widget !== undefined) { - var errs_7 = errors; - if (typeof data6.widget !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].widget', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/widget/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid7 = errors === errs_7; + errors++; + } + } + if (data130.min !== undefined) { + let data138 = data130.min; + if ( + !(typeof data138 == 'number' && !(data138 % 1) && !isNaN(data138)) + ) { + const err214 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err214]; + } else { + vErrors.push(err214); } - if (data6.required !== undefined) { - var errs_7 = errors; - if (typeof data6.required !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].required', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/required/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid7 = errors === errs_7; + errors++; + } + } + if (data130.max !== undefined) { + let data139 = data130.max; + if ( + !(typeof data139 == 'number' && !(data139 % 1) && !isNaN(data139)) + ) { + const err215 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err215]; + } else { + vErrors.push(err215); } - var data7 = data6.i18n; - if (data7 !== undefined) { - var errs_7 = errors; - var errs__7 = errors, - prevValid7 = false, - valid7 = false, - passingSchemas7 = null; - var errs_8 = errors; - if (typeof data7 !== "boolean") { - var err = { + errors++; + } + } + if (data130.options !== undefined) { + let data140 = data130.options; + if (Array.isArray(data140)) { + const len14 = data140.length; + for (let i14 = 0; i14 < len14; i14++) { + let data141 = data140[i14]; + const _errs342 = errors; + let valid75 = false; + let passing9 = null; + const _errs343 = errors; + if (typeof data141 !== 'string') { + const err216 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/0/type', keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/0/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' + params: { type: 'string' }, + message: 'must be string', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err216]; + } else { + vErrors.push(err216); + } errors++; } - var valid8 = errors === errs_8; - if (valid8) { - valid7 = prevValid7 = true; - passingSchemas7 = 0; + var _valid14 = _errs343 === errors; + if (_valid14) { + valid75 = true; + passing9 = 0; } - var errs_8 = errors; - if (typeof data7 !== "string") { - var err = { + const _errs345 = errors; + if (!(typeof data141 == 'number')) { + const err217 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/1/type', keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema8 = validate.schema.properties.collections.items.properties.files.items.properties.fields.items.properties.i18n.oneOf[1].enum; - var valid8; - valid8 = false; - for (var i8 = 0; i8 < schema8.length; i8++) - if (equal(data7, schema8[i8])) { - valid8 = true; - break; - } if (!valid8) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/enum', - params: { - allowedValues: schema8 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid8 = errors === errs_8; - if (valid8 && prevValid7) { - valid7 = false; - passingSchemas7 = [passingSchemas7, 1]; - } else { - if (valid8) { - valid7 = prevValid7 = true; - passingSchemas7 = 1; - } - } - if (!valid7) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].i18n', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf', - params: { - passingSchemas: passingSchemas7 - }, - message: 'should match exactly one schema in oneOf' + params: { type: 'number' }, + message: 'must be number', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__7; - if (vErrors !== null) { - if (errs__7) vErrors.length = errs__7; - else vErrors = null; + if (vErrors === null) { + vErrors = [err217]; + } else { + vErrors.push(err217); } - } - var valid7 = errors === errs_7; - } - if (data6.hint !== undefined) { - var errs_7 = errors; - if (typeof data6.hint !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].hint', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/hint/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); errors++; } - var valid7 = errors === errs_7; - } - var data7 = data6.pattern; - if (data7 !== undefined) { - var errs_7 = errors; - if (Array.isArray(data7)) { - if (data7.length < 2) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/minItems', - params: { - limit: 2 - }, - message: 'should NOT have fewer than 2 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + var _valid14 = _errs345 === errors; + if (_valid14 && valid75) { + valid75 = false; + passing9 = [passing9, 1]; + } else { + if (_valid14) { + valid75 = true; + passing9 = 1; } - var errs__7 = errors; - var valid7; - valid8 = true; - if (data7.length > 0) { - var data8 = data7[0]; - var errs_8 = errors; - var errs__8 = errors, - prevValid8 = false, - valid8 = false, - passingSchemas8 = null; - var errs_9 = errors; - if (typeof data8 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type', - params: { - type: 'string' - }, - message: 'should be string' + const _errs347 = errors; + if ( + data141 && + typeof data141 == 'object' && + !Array.isArray(data141) + ) { + if (data141.label === undefined) { + const err218 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err218]; + } else { + vErrors.push(err218); + } errors++; } - var valid9 = errors === errs_9; - if (valid9) { - valid8 = prevValid8 = true; - passingSchemas8 = 0; - } - var errs_9 = errors; - customRule0.errors = null; - var errs__9 = errors; - var valid9; - customRule0.errors = null; - valid9 = customRule0.call(self, data8, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', data7, 0, rootData); - if (!valid9) { - if (Array.isArray(customRule0.errors)) { - if (vErrors === null) vErrors = customRule0.errors; - else vErrors = vErrors.concat(customRule0.errors); - errors = vErrors.length; - for (var i9 = errs__9; i9 < errors; i9++) { - var ruleErr9 = vErrors[i9]; - if (ruleErr9.dataPath === undefined) ruleErr9.dataPath = (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']'; - ruleErr9.schemaPath = "#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof"; - } + if (data141.value === undefined) { + const err219 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err219]; } else { - var err = { - keyword: 'instanceof', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof', - params: { - keyword: 'instanceof' - }, - message: 'should pass "instanceof" keyword validation' + vErrors.push(err219); + } + errors++; + } + if (data141.label !== undefined) { + if (typeof data141.label !== 'string') { + const err220 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14 + + '/label', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err220]; + } else { + vErrors.push(err220); + } errors++; } } - var valid9 = errors === errs_9; - if (valid9 && prevValid8) { - valid8 = false; - passingSchemas8 = [passingSchemas8, 1]; - } else { - if (valid9) { - valid8 = prevValid8 = true; - passingSchemas8 = 1; + if (data141.value !== undefined) { + let data143 = data141.value; + const _errs352 = errors; + let valid77 = false; + let passing10 = null; + const _errs353 = errors; + if (typeof data143 !== 'string') { + const err221 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14 + + '/value', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err221]; + } else { + vErrors.push(err221); + } + errors++; + } + var _valid15 = _errs353 === errors; + if (_valid15) { + valid77 = true; + passing10 = 0; + } + const _errs355 = errors; + if (!(typeof data143 == 'number')) { + const err222 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14 + + '/value', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err222]; + } else { + vErrors.push(err222); + } + errors++; + } + var _valid15 = _errs355 === errors; + if (_valid15 && valid77) { + valid77 = false; + passing10 = [passing10, 1]; + } else { + if (_valid15) { + valid77 = true; + passing10 = 1; + } + } + if (!valid77) { + const err223 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14 + + '/value', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing10 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err223]; + } else { + vErrors.push(err223); + } + errors++; + } else { + errors = _errs352; + if (vErrors !== null) { + if (_errs352) { + vErrors.length = _errs352; + } else { + vErrors = null; + } + } } } - if (!valid8) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 0 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/0/oneOf', - params: { - passingSchemas: passingSchemas8 - }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } else { + const err224 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err224]; } else { - errors = errs__8; - if (vErrors !== null) { - if (errs__8) vErrors.length = errs__8; - else vErrors = null; - } + vErrors.push(err224); } - var valid8 = errors === errs_8; + errors++; } - valid8 = true; - if (data7.length > 1) { - var errs_8 = errors; - if (typeof data7[1] !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern[' + 1 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/items/1/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + var _valid14 = _errs347 === errors; + if (_valid14 && valid75) { + valid75 = false; + passing9 = [passing9, 2]; + } else { + if (_valid14) { + valid75 = true; + passing9 = 2; } - var valid8 = errors === errs_8; } + } + if (!valid75) { + const err225 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing9 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err225]; + } else { + vErrors.push(err225); + } + errors++; } else { - var err = { + errors = _errs342; + if (vErrors !== null) { + if (_errs342) { + vErrors.length = _errs342; + } else { + vErrors = null; + } + } + } + } + } else { + const err226 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err226]; + } else { + vErrors.push(err226); + } + errors++; + } + } + } + var _valid13 = _errs332 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'markdown') { + const _errs357 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.minimal !== undefined) { + if (typeof data130.minimal !== 'boolean') { + const err227 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/minimal', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err227]; + } else { + vErrors.push(err227); + } + errors++; + } + } + if (data130.buttons !== undefined) { + let data145 = data130.buttons; + if (Array.isArray(data145)) { + const len15 = data145.length; + for (let i15 = 0; i15 < len15; i15++) { + let data146 = data145[i15]; + if (typeof data146 !== 'string') { + const err228 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/buttons/' + + i15, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/buttons/items/type', keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].pattern', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err228]; + } else { + vErrors.push(err228); + } + errors++; + } + if ( + !( + data146 === 'bold' || + data146 === 'italic' || + data146 === 'code' || + data146 === 'link' || + data146 === 'heading-one' || + data146 === 'heading-two' || + data146 === 'heading-three' || + data146 === 'heading-four' || + data146 === 'heading-five' || + data146 === 'heading-six' || + data146 === 'quote' || + data146 === 'bulleted-list' || + data146 === 'numbered-list' + ) + ) { + const err229 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/buttons/' + + i15, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', params: { - type: 'array' + allowedValues: + schema40.properties.collections.items.properties.fields + .items.selectCases.markdown.properties.buttons.items.enum, }, - message: 'should be array' + message: 'must be equal to one of the allowed values', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err229]; + } else { + vErrors.push(err229); + } errors++; } - var valid7 = errors === errs_7; } - if (data6.field !== undefined) { - var errs_7 = errors; - if (!refVal1(data6.field, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].field', data6, 'field', rootData)) { - if (vErrors === null) vErrors = refVal1.errors; - else vErrors = vErrors.concat(refVal1.errors); - errors = vErrors.length; + } else { + const err230 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/buttons', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err230]; + } else { + vErrors.push(err230); + } + errors++; + } + } + if (data130.editor_components !== undefined) { + let data147 = data130.editor_components; + if (Array.isArray(data147)) { + const len16 = data147.length; + for (let i16 = 0; i16 < len16; i16++) { + if (typeof data147[i16] !== 'string') { + const err231 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/editor_components/' + + i16, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err231]; + } else { + vErrors.push(err231); + } + errors++; } - var valid7 = errors === errs_7; } - if (data6.fields !== undefined) { - var errs_7 = errors; - if (!refVal[2](data6.fields, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].fields', data6, 'fields', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; + } else { + const err232 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/editor_components', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err232]; + } else { + vErrors.push(err232); + } + errors++; + } + } + if (data130.modes !== undefined) { + let data149 = data130.modes; + if (Array.isArray(data149)) { + if (data149.length < 1) { + const err233 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/modes', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err233]; + } else { + vErrors.push(err233); } - var valid7 = errors === errs_7; + errors++; } - if (data6.types !== undefined) { - var errs_7 = errors; - if (!refVal[2](data6.types, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + '].types', data6, 'types', rootData)) { - if (vErrors === null) vErrors = refVal[2].errors; - else vErrors = vErrors.concat(refVal[2].errors); - errors = vErrors.length; + const len17 = data149.length; + for (let i17 = 0; i17 < len17; i17++) { + let data150 = data149[i17]; + if (typeof data150 !== 'string') { + const err234 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/modes/' + + i17, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err234]; + } else { + vErrors.push(err234); + } + errors++; + } + if (!(data150 === 'raw' || data150 === 'rich_text')) { + const err235 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/modes/' + + i17, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties.fields + .items.selectCases.markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err235]; + } else { + vErrors.push(err235); + } + errors++; } - var valid7 = errors === errs_7; } } else { - var err = { + const err236 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/modes', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err236]; + } else { + vErrors.push(err236); + } + errors++; + } + } + } + var _valid13 = _errs357 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'list') { + const _errs372 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.allow_add !== undefined) { + if (typeof data130.allow_add !== 'boolean') { + const err237 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/allow_add', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err237]; + } else { + vErrors.push(err237); + } + errors++; + } + } + if (data130.collapsed !== undefined) { + if (typeof data130.collapsed !== 'boolean') { + const err238 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/collapsed', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err238]; + } else { + vErrors.push(err238); + } + errors++; + } + } + if (data130.summary !== undefined) { + if (typeof data130.summary !== 'string') { + const err239 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/summary', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err239]; + } else { + vErrors.push(err239); + } + errors++; + } + } + if (data130.minimize_collapsed !== undefined) { + if (typeof data130.minimize_collapsed !== 'boolean') { + const err240 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/minimize_collapsed', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err240]; + } else { + vErrors.push(err240); + } + errors++; + } + } + if (data130.label_singular !== undefined) { + if (typeof data130.label_singular !== 'string') { + const err241 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/label_singular', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err241]; + } else { + vErrors.push(err241); + } + errors++; + } + } + if (data130.i18n !== undefined) { + if (typeof data130.i18n !== 'boolean') { + const err242 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err242]; + } else { + vErrors.push(err242); + } + errors++; + } + } + if (data130.min !== undefined) { + if (!(typeof data130.min == 'number')) { + const err243 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err243]; + } else { + vErrors.push(err243); + } + errors++; + } + } + if (data130.max !== undefined) { + if (!(typeof data130.max == 'number')) { + const err244 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err244]; + } else { + vErrors.push(err244); + } + errors++; + } + } + } + var _valid13 = _errs372 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'object') { + const _errs389 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.collapsed !== undefined) { + if (typeof data130.collapsed !== 'boolean') { + const err245 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/collapsed', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err245]; + } else { + vErrors.push(err245); + } + errors++; + } + } + if (data130.i18n !== undefined) { + if (typeof data130.i18n !== 'boolean') { + const err246 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/object/properties/i18n/type', keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/type', - params: { - type: 'object' - }, - message: 'should be object' + params: { type: 'boolean' }, + message: 'must be boolean', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err246]; + } else { + vErrors.push(err246); + } errors++; } - var schema6 = data6 && data6.widget; - var definition6 = RULES.custom['select'].definition; - var keywordValidate6 = definition6.validate; - keywordValidate6.errors = null; - var errs__6 = errors; - var valid6; - if (schema6 === undefined) { - valid6 = true; + } + } + var _valid13 = _errs389 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'relation') { + const _errs394 = errors; + const _errs395 = errors; + let valid87 = false; + let passing11 = null; + const _errs396 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.collection === undefined) { + const err247 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err247]; } else { - valid6 = definition6.validateSchema(schema6); - if (valid6) { - keywordValidate6.errors = null; - valid6 = keywordValidate6.call(self, schema6, data6, validate.schema.properties.collections.items.properties.files.items.properties.fields.items, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', data5, i5, rootData); - } + vErrors.push(err247); } - if (!valid6) { - if (Array.isArray(keywordValidate6.errors)) { - if (vErrors === null) vErrors = keywordValidate6.errors; - else vErrors = vErrors.concat(keywordValidate6.errors); - errors = vErrors.length; - for (var i6 = errs__6; i6 < errors; i6++) { - var ruleErr6 = vErrors[i6]; - if (ruleErr6.dataPath === undefined) ruleErr6.dataPath = (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']'; - ruleErr6.schemaPath = "#/properties/collections/items/properties/files/items/properties/fields/items/select"; - } - } else { - var err = { - keyword: 'select', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/items/select', - params: { - keyword: 'select' - }, - message: 'should pass "select" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } + errors++; + } + if (data130.value_field === undefined) { + const err248 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err248]; + } else { + vErrors.push(err248); } - customRule6.errors = null; - var errs__6 = errors; - var valid6; - customRule6.errors = null; - valid6 = customRule6.call(self, data6, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields[' + i5 + ']', data5, i5, rootData); - var valid6 = errors === errs_6; + errors++; } - customRule7.errors = null; - var errs__5 = errors; - var valid5; - customRule7.errors = null; - valid5 = customRule7.call(self, data5, (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', data4, 'fields', rootData); - if (!valid5) { - if (Array.isArray(customRule7.errors)) { - if (vErrors === null) vErrors = customRule7.errors; - else vErrors = vErrors.concat(customRule7.errors); - errors = vErrors.length; - for (var i5 = errs__5; i5 < errors; i5++) { - var ruleErr5 = vErrors[i5]; - if (ruleErr5.dataPath === undefined) ruleErr5.dataPath = (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields'; - ruleErr5.schemaPath = "#/properties/collections/items/properties/files/items/properties/fields/uniqueItemProperties"; - } + if (data130.search_fields === undefined) { + const err249 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: "must have required property '" + 'search_fields' + "'", + }; + if (vErrors === null) { + vErrors = [err249]; } else { - var err = { - keyword: 'uniqueItemProperties', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/uniqueItemProperties', - params: { - keyword: 'uniqueItemProperties' - }, - message: 'should pass "uniqueItemProperties" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + vErrors.push(err249); } + errors++; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + '].fields', - schemaPath: '#/properties/collections/items/properties/files/items/properties/fields/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid5 = errors === errs_5; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/files/items/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid4 = errors === errs_4; - } - customRule8.errors = null; - var errs__3 = errors; - var valid3; - customRule8.errors = null; - valid3 = customRule8.call(self, data3, (dataPath || '') + '.collections[' + i1 + '].files', data2, 'files', rootData); - if (!valid3) { - if (Array.isArray(customRule8.errors)) { - if (vErrors === null) vErrors = customRule8.errors; - else vErrors = vErrors.concat(customRule8.errors); - errors = vErrors.length; - for (var i3 = errs__3; i3 < errors; i3++) { - var ruleErr3 = vErrors[i3]; - if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '.collections[' + i1 + '].files'; - ruleErr3.schemaPath = "#/properties/collections/items/properties/files/uniqueItemProperties"; - } - } else { - var err = { - keyword: 'uniqueItemProperties', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files', - schemaPath: '#/properties/collections/items/properties/files/uniqueItemProperties', - params: { - keyword: 'uniqueItemProperties' - }, - message: 'should pass "uniqueItemProperties" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].files', - schemaPath: '#/properties/collections/items/properties/files/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - if (data2.identifier_field !== undefined) { - var errs_3 = errors; - if (typeof data2.identifier_field !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].identifier_field', - schemaPath: '#/properties/collections/items/properties/identifier_field/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - if (data2.summary !== undefined) { - var errs_3 = errors; - if (typeof data2.summary !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].summary', - schemaPath: '#/properties/collections/items/properties/summary/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - if (data2.slug !== undefined) { - var errs_3 = errors; - if (typeof data2.slug !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].slug', - schemaPath: '#/properties/collections/items/properties/slug/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - if (data2.path !== undefined) { - var errs_3 = errors; - if (typeof data2.path !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].path', - schemaPath: '#/properties/collections/items/properties/path/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - if (data2.preview_path !== undefined) { - var errs_3 = errors; - if (typeof data2.preview_path !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].preview_path', - schemaPath: '#/properties/collections/items/properties/preview_path/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - if (data2.preview_path_date_field !== undefined) { - var errs_3 = errors; - if (typeof data2.preview_path_date_field !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].preview_path_date_field', - schemaPath: '#/properties/collections/items/properties/preview_path_date_field/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - if (data2.create !== undefined) { - var errs_3 = errors; - if (typeof data2.create !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].create', - schemaPath: '#/properties/collections/items/properties/create/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - if (data2.publish !== undefined) { - var errs_3 = errors; - if (typeof data2.publish !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].publish', - schemaPath: '#/properties/collections/items/properties/publish/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - if (data2.hide !== undefined) { - var errs_3 = errors; - if (typeof data2.hide !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].hide', - schemaPath: '#/properties/collections/items/properties/hide/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data3 = data2.editor; - if (data3 !== undefined) { - var errs_3 = errors; - if ((data3 && typeof data3 === "object" && !Array.isArray(data3))) { - var errs__3 = errors; - var valid4 = true; - if (data3.preview !== undefined) { - var errs_4 = errors; - if (typeof data3.preview !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].editor.preview', - schemaPath: '#/properties/collections/items/properties/editor/properties/preview/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid4 = errors === errs_4; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].editor', - schemaPath: '#/properties/collections/items/properties/editor/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data3 = data2.format; - if (data3 !== undefined) { - var errs_3 = errors; - if (typeof data3 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].format', - schemaPath: '#/properties/collections/items/properties/format/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema3 = validate.schema.properties.collections.items.properties.format.enum; - var valid3; - valid3 = false; - for (var i3 = 0; i3 < schema3.length; i3++) - if (equal(data3, schema3[i3])) { - valid3 = true; - break; - } if (!valid3) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].format', - schemaPath: '#/properties/collections/items/properties/format/enum', - params: { - allowedValues: schema3 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - if (data2.extension !== undefined) { - var errs_3 = errors; - if (typeof data2.extension !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].extension', - schemaPath: '#/properties/collections/items/properties/extension/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data3 = data2.frontmatter_delimiter; - if (data3 !== undefined) { - var errs_3 = errors; - if (typeof data3 !== "string" && !Array.isArray(data3)) { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', - schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/type', - params: { - type: 'string,array' - }, - message: 'should be string,array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - if (Array.isArray(data3)) { - if (data3.length > 2) { - var err = { - keyword: 'maxItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', - schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/maxItems', - params: { - limit: 2 - }, - message: 'should NOT have more than 2 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - if (data3.length < 2) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter', - schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/minItems', - params: { - limit: 2 - }, - message: 'should NOT have fewer than 2 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__3 = errors; - var valid3; - for (var i3 = 0; i3 < data3.length; i3++) { - var errs_4 = errors; - if (typeof data3[i3] !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].frontmatter_delimiter[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/frontmatter_delimiter/items/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid4 = errors === errs_4; - } - } - var valid3 = errors === errs_3; - } - var data3 = data2.fields; - if (data3 !== undefined) { - var errs_3 = errors; - if (Array.isArray(data3)) { - if (data3.length < 1) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields', - schemaPath: '#/properties/collections/items/properties/fields/minItems', - params: { - limit: 1 - }, - message: 'should NOT have fewer than 1 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__3 = errors; - var valid3; - for (var i3 = 0; i3 < data3.length; i3++) { - var data4 = data3[i3]; - var errs_4 = errors; - if ((data4 && typeof data4 === "object" && !Array.isArray(data4))) { - var errs__4 = errors; - var valid5 = true; - if (data4.name === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/fields/items/required', - params: { - missingProperty: 'name' - }, - message: 'should have required property \'name\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_5 = errors; - if (typeof data4.name !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].name', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/name/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid5 = errors === errs_5; - } - if (data4.label !== undefined) { - var errs_5 = errors; - if (typeof data4.label !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].label', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/label/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid5 = errors === errs_5; - } - if (data4.widget !== undefined) { - var errs_5 = errors; - if (typeof data4.widget !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].widget', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/widget/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var valid5 = errors === errs_5; - } - if (data4.required !== undefined) { - var errs_5 = errors; - if (typeof data4.required !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].required', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/required/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid5 = errors === errs_5; - } - var data5 = data4.i18n; - if (data5 !== undefined) { - var errs_5 = errors; - var errs__5 = errors, - prevValid5 = false, - valid5 = false, - passingSchemas5 = null; - var errs_6 = errors; - if (typeof data5 !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/0/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + var _valid16 = _errs396 === errors; + if (_valid16) { + valid87 = true; + passing11 = 0; } - var valid6 = errors === errs_6; - if (valid6) { - valid5 = prevValid5 = true; - passingSchemas5 = 0; + const _errs397 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.collection === undefined) { + const err250 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err250]; + } else { + vErrors.push(err250); + } + errors++; + } + if (data130.valueField === undefined) { + const err251 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err251]; + } else { + vErrors.push(err251); + } + errors++; + } + if (data130.searchFields === undefined) { + const err252 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err252]; + } else { + vErrors.push(err252); + } + errors++; + } } - var errs_6 = errors; - if (typeof data5 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + var _valid16 = _errs397 === errors; + if (_valid16 && valid87) { + valid87 = false; + passing11 = [passing11, 1]; + } else { + if (_valid16) { + valid87 = true; + passing11 = 1; + } } - var schema6 = validate.schema.properties.collections.items.properties.fields.items.properties.i18n.oneOf[1].enum; - var valid6; - valid6 = false; - for (var i6 = 0; i6 < schema6.length; i6++) - if (equal(data5, schema6[i6])) { - valid6 = true; - break; - } if (!valid6) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/enum', - params: { - allowedValues: schema6 - }, - message: 'should be equal to one of the allowed values' + if (!valid87) { + const err253 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing11 }, + message: 'must match exactly one schema in oneOf', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err253]; + } else { + vErrors.push(err253); + } errors++; - } - var valid6 = errors === errs_6; - if (valid6 && prevValid5) { - valid5 = false; - passingSchemas5 = [passingSchemas5, 1]; } else { - if (valid6) { - valid5 = prevValid5 = true; - passingSchemas5 = 1; + errors = _errs395; + if (vErrors !== null) { + if (_errs395) { + vErrors.length = _errs395; + } else { + vErrors = null; + } + } + } + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.collection !== undefined) { + if (typeof data130.collection !== 'string') { + const err254 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/collection', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err254]; + } else { + vErrors.push(err254); + } + errors++; + } + } + if (data130.value_field !== undefined) { + if (typeof data130.value_field !== 'string') { + const err255 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/value_field', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err255]; + } else { + vErrors.push(err255); + } + errors++; + } } - } - if (!valid5) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].i18n', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf', - params: { - passingSchemas: passingSchemas5 - }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__5; - if (vErrors !== null) { - if (errs__5) vErrors.length = errs__5; - else vErrors = null; + if (data130.search_fields !== undefined) { + let data163 = data130.search_fields; + if (Array.isArray(data163)) { + if (data163.length < 1) { + const err256 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/search_fields', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err256]; + } else { + vErrors.push(err256); + } + errors++; + } + const len18 = data163.length; + for (let i18 = 0; i18 < len18; i18++) { + if (typeof data163[i18] !== 'string') { + const err257 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/search_fields/' + + i18, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err257]; + } else { + vErrors.push(err257); + } + errors++; + } + } + } else { + const err258 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/search_fields', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err258]; + } else { + vErrors.push(err258); + } + errors++; + } + } + if (data130.file !== undefined) { + if (typeof data130.file !== 'string') { + const err259 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/file', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err259]; + } else { + vErrors.push(err259); + } + errors++; + } + } + if (data130.multiple !== undefined) { + if (typeof data130.multiple !== 'boolean') { + const err260 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/multiple', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err260]; + } else { + vErrors.push(err260); + } + errors++; + } + } + if (data130.min !== undefined) { + let data167 = data130.min; + if ( + !(typeof data167 == 'number' && !(data167 % 1) && !isNaN(data167)) + ) { + const err261 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err261]; + } else { + vErrors.push(err261); + } + errors++; + } + } + if (data130.max !== undefined) { + let data168 = data130.max; + if ( + !(typeof data168 == 'number' && !(data168 % 1) && !isNaN(data168)) + ) { + const err262 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err262]; + } else { + vErrors.push(err262); + } + errors++; + } + } + if (data130.display_fields !== undefined) { + let data169 = data130.display_fields; + if (Array.isArray(data169)) { + if (data169.length < 1) { + const err263 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/display_fields', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err263]; + } else { + vErrors.push(err263); + } + errors++; + } + const len19 = data169.length; + for (let i19 = 0; i19 < len19; i19++) { + if (typeof data169[i19] !== 'string') { + const err264 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/display_fields/' + + i19, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err264]; + } else { + vErrors.push(err264); + } + errors++; + } + } + } else { + const err265 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/display_fields', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err265]; + } else { + vErrors.push(err265); + } + errors++; + } + } + if (data130.options_length !== undefined) { + let data171 = data130.options_length; + if ( + !(typeof data171 == 'number' && !(data171 % 1) && !isNaN(data171)) + ) { + const err266 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options_length', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err266]; + } else { + vErrors.push(err266); + } + errors++; + } } } - var valid5 = errors === errs_5; - } - if (data4.hint !== undefined) { - var errs_5 = errors; - if (typeof data4.hint !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].hint', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/hint/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid5 = errors === errs_5; - } - var data5 = data4.pattern; - if (data5 !== undefined) { - var errs_5 = errors; - if (Array.isArray(data5)) { - if (data5.length < 2) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/minItems', - params: { - limit: 2 - }, - message: 'should NOT have fewer than 2 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + var _valid13 = _errs394 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'boolean') { + var _valid13 = true; + valid68 = _valid13; + } else if ('' + value1 == 'map') { + const _errs420 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.decimals !== undefined) { + let data172 = data130.decimals; + if ( + !(typeof data172 == 'number' && !(data172 % 1) && !isNaN(data172)) + ) { + const err267 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/decimals', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err267]; + } else { + vErrors.push(err267); + } + errors++; + } } - var errs__5 = errors; - var valid5; - valid6 = true; - if (data5.length > 0) { - var data6 = data5[0]; - var errs_6 = errors; - var errs__6 = errors, - prevValid6 = false, - valid6 = false, - passingSchemas6 = null; - var errs_7 = errors; - if (typeof data6 !== "string") { - var err = { + if (data130.type !== undefined) { + let data173 = data130.type; + if (typeof data173 !== 'string') { + const err268 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/type', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/map/properties/type/type', keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/0/type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err268]; + } else { + vErrors.push(err268); + } + errors++; + } + if ( + !( + data173 === 'Point' || + data173 === 'LineString' || + data173 === 'Polygon' + ) + ) { + const err269 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/type', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/map/properties/type/enum', + keyword: 'enum', params: { - type: 'string' + allowedValues: + schema40.properties.collections.items.properties.fields.items + .selectCases.map.properties.type.enum, }, - message: 'should be string' + message: 'must be equal to one of the allowed values', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err269]; + } else { + vErrors.push(err269); + } errors++; } - var valid7 = errors === errs_7; - if (valid7) { - valid6 = prevValid6 = true; - passingSchemas6 = 0; + } + } + var _valid13 = _errs420 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'date') { + var _valid13 = true; + valid68 = _valid13; + } else if ('' + value1 == 'datetime') { + const _errs425 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.format !== undefined) { + if (typeof data130.format !== 'string') { + const err270 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err270]; + } else { + vErrors.push(err270); + } + errors++; } - var errs_7 = errors; - customRule9.errors = null; - var errs__7 = errors; - var valid7; - customRule9.errors = null; - valid7 = customRule9.call(self, data6, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', data5, 0, rootData); - if (!valid7) { - if (Array.isArray(customRule9.errors)) { - if (vErrors === null) vErrors = customRule9.errors; - else vErrors = vErrors.concat(customRule9.errors); - errors = vErrors.length; - for (var i7 = errs__7; i7 < errors; i7++) { - var ruleErr7 = vErrors[i7]; - if (ruleErr7.dataPath === undefined) ruleErr7.dataPath = (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']'; - ruleErr7.schemaPath = "#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof"; - } + } + if (data130.date_format !== undefined) { + let data175 = data130.date_format; + const _errs429 = errors; + let valid95 = false; + let passing12 = null; + const _errs430 = errors; + if (typeof data175 !== 'string') { + const err271 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err271]; } else { - var err = { - keyword: 'instanceof', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof', - params: { - keyword: 'instanceof' - }, - message: 'should pass "instanceof" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + vErrors.push(err271); + } + errors++; + } + var _valid17 = _errs430 === errors; + if (_valid17) { + valid95 = true; + passing12 = 0; + } + const _errs432 = errors; + if (typeof data175 !== 'boolean') { + const err272 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err272]; + } else { + vErrors.push(err272); } + errors++; } - var valid7 = errors === errs_7; - if (valid7 && prevValid6) { - valid6 = false; - passingSchemas6 = [passingSchemas6, 1]; + var _valid17 = _errs432 === errors; + if (_valid17 && valid95) { + valid95 = false; + passing12 = [passing12, 1]; } else { - if (valid7) { - valid6 = prevValid6 = true; - passingSchemas6 = 1; + if (_valid17) { + valid95 = true; + passing12 = 1; } } - if (!valid6) { - var err = { + if (!valid95) { + const err273 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf', keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 0 + ']', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf', - params: { - passingSchemas: passingSchemas6 - }, - message: 'should match exactly one schema in oneOf' + params: { passingSchemas: passing12 }, + message: 'must match exactly one schema in oneOf', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err273]; + } else { + vErrors.push(err273); + } errors++; } else { - errors = errs__6; + errors = _errs429; if (vErrors !== null) { - if (errs__6) vErrors.length = errs__6; - else vErrors = null; + if (_errs429) { + vErrors.length = _errs429; + } else { + vErrors = null; + } } } - var valid6 = errors === errs_6; } - valid6 = true; - if (data5.length > 1) { - var errs_6 = errors; - if (typeof data5[1] !== "string") { - var err = { + if (data130.time_format !== undefined) { + let data176 = data130.time_format; + const _errs435 = errors; + let valid96 = false; + let passing13 = null; + const _errs436 = errors; + if (typeof data176 !== 'string') { + const err274 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/0/type', keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern[' + 1 + ']', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/items/1/type', - params: { - type: 'string' - }, - message: 'should be string' + params: { type: 'string' }, + message: 'must be string', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err274]; + } else { + vErrors.push(err274); + } errors++; } - var valid6 = errors === errs_6; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].pattern', - schemaPath: '#/properties/collections/items/properties/fields/items/properties/pattern/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid5 = errors === errs_5; - } - if (data4.field !== undefined) { - var errs_5 = errors; - if (!refVal3(data4.field, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].field', data4, 'field', rootData)) { - if (vErrors === null) vErrors = refVal3.errors; - else vErrors = vErrors.concat(refVal3.errors); - errors = vErrors.length; - } - var valid5 = errors === errs_5; - } - if (data4.fields !== undefined) { - var errs_5 = errors; - if (!refVal[4](data4.fields, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].fields', data4, 'fields', rootData)) { - if (vErrors === null) vErrors = refVal[4].errors; - else vErrors = vErrors.concat(refVal[4].errors); - errors = vErrors.length; - } - var valid5 = errors === errs_5; - } - if (data4.types !== undefined) { - var errs_5 = errors; - if (!refVal[4](data4.types, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + '].types', data4, 'types', rootData)) { - if (vErrors === null) vErrors = refVal[4].errors; - else vErrors = vErrors.concat(refVal[4].errors); - errors = vErrors.length; - } - var valid5 = errors === errs_5; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/fields/items/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema4 = data4 && data4.widget; - var definition4 = RULES.custom['select'].definition; - var keywordValidate4 = definition4.validate; - keywordValidate4.errors = null; - var errs__4 = errors; - var valid4; - if (schema4 === undefined) { - valid4 = true; - } else { - valid4 = definition4.validateSchema(schema4); - if (valid4) { - keywordValidate4.errors = null; - valid4 = keywordValidate4.call(self, schema4, data4, validate.schema.properties.collections.items.properties.fields.items, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', data3, i3, rootData); - } - } - if (!valid4) { - if (Array.isArray(keywordValidate4.errors)) { - if (vErrors === null) vErrors = keywordValidate4.errors; - else vErrors = vErrors.concat(keywordValidate4.errors); - errors = vErrors.length; - for (var i4 = errs__4; i4 < errors; i4++) { - var ruleErr4 = vErrors[i4]; - if (ruleErr4.dataPath === undefined) ruleErr4.dataPath = (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']'; - ruleErr4.schemaPath = "#/properties/collections/items/properties/fields/items/select"; - } - } else { - var err = { - keyword: 'select', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/fields/items/select', - params: { - keyword: 'select' - }, - message: 'should pass "select" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - customRule15.errors = null; - var errs__4 = errors; - var valid4; - customRule15.errors = null; - valid4 = customRule15.call(self, data4, (dataPath || '') + '.collections[' + i1 + '].fields[' + i3 + ']', data3, i3, rootData); - var valid4 = errors === errs_4; - } - customRule16.errors = null; - var errs__3 = errors; - var valid3; - customRule16.errors = null; - valid3 = customRule16.call(self, data3, (dataPath || '') + '.collections[' + i1 + '].fields', data2, 'fields', rootData); - if (!valid3) { - if (Array.isArray(customRule16.errors)) { - if (vErrors === null) vErrors = customRule16.errors; - else vErrors = vErrors.concat(customRule16.errors); - errors = vErrors.length; - for (var i3 = errs__3; i3 < errors; i3++) { - var ruleErr3 = vErrors[i3]; - if (ruleErr3.dataPath === undefined) ruleErr3.dataPath = (dataPath || '') + '.collections[' + i1 + '].fields'; - ruleErr3.schemaPath = "#/properties/collections/items/properties/fields/uniqueItemProperties"; - } - } else { - var err = { - keyword: 'uniqueItemProperties', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields', - schemaPath: '#/properties/collections/items/properties/fields/uniqueItemProperties', - params: { - keyword: 'uniqueItemProperties' - }, - message: 'should pass "uniqueItemProperties" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].fields', - schemaPath: '#/properties/collections/items/properties/fields/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data3 = data2.sortable_fields; - if (data3 !== undefined) { - var errs_3 = errors; - if (Array.isArray(data3)) { - var errs__3 = errors; - var valid3; - for (var i3 = 0; i3 < data3.length; i3++) { - var errs_4 = errors; - if (typeof data3[i3] !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].sortable_fields[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/sortable_fields/items/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid4 = errors === errs_4; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].sortable_fields', - schemaPath: '#/properties/collections/items/properties/sortable_fields/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data3 = data2.sortableFields; - if (data3 !== undefined) { - var errs_3 = errors; - if (Array.isArray(data3)) { - var errs__3 = errors; - var valid3; - for (var i3 = 0; i3 < data3.length; i3++) { - var errs_4 = errors; - if (typeof data3[i3] !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].sortableFields[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/sortableFields/items/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid4 = errors === errs_4; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].sortableFields', - schemaPath: '#/properties/collections/items/properties/sortableFields/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data3 = data2.view_filters; - if (data3 !== undefined) { - var errs_3 = errors; - if (Array.isArray(data3)) { - if (data3.length < 1) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters', - schemaPath: '#/properties/collections/items/properties/view_filters/minItems', - params: { - limit: 1 - }, - message: 'should NOT have fewer than 1 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__3 = errors; - var valid3; - for (var i3 = 0; i3 < data3.length; i3++) { - var data4 = data3[i3]; - var errs_4 = errors; - if ((data4 && typeof data4 === "object" && !Array.isArray(data4))) { - var errs__4 = errors; - var valid5 = true; - for (var key4 in data4) { - var isAdditional4 = !(false || key4 == 'label' || key4 == 'field' || key4 == 'pattern'); - if (isAdditional4) { - valid5 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/view_filters/items/additionalProperties', - params: { - additionalProperty: '' + key4 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - if (data4.label === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/view_filters/items/required', - params: { - missingProperty: 'label' - }, - message: 'should have required property \'label\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_5 = errors; - if (typeof data4.label !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].label', - schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/label/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + var _valid18 = _errs436 === errors; + if (_valid18) { + valid96 = true; + passing13 = 0; + } + const _errs438 = errors; + if (typeof data176 !== 'boolean') { + const err275 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err275]; + } else { + vErrors.push(err275); + } + errors++; + } + var _valid18 = _errs438 === errors; + if (_valid18 && valid96) { + valid96 = false; + passing13 = [passing13, 1]; + } else { + if (_valid18) { + valid96 = true; + passing13 = 1; + } + } + if (!valid96) { + const err276 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing13 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err276]; + } else { + vErrors.push(err276); + } + errors++; + } else { + errors = _errs435; + if (vErrors !== null) { + if (_errs435) { + vErrors.length = _errs435; + } else { + vErrors = null; + } + } + } + } + if (data130.picker_utc !== undefined) { + if (typeof data130.picker_utc !== 'boolean') { + const err277 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/picker_utc', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err277]; + } else { + vErrors.push(err277); + } + errors++; + } + } } - var valid5 = errors === errs_5; - } - if (data4.field === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/view_filters/items/required', - params: { - missingProperty: 'field' - }, - message: 'should have required property \'field\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_5 = errors; - if (typeof data4.field !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].field', - schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/field/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + var _valid13 = _errs425 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'code') { + const _errs442 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.default_language !== undefined) { + if (typeof data130.default_language !== 'string') { + const err278 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/default_language', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err278]; + } else { + vErrors.push(err278); + } + errors++; + } + } + if (data130.allow_language_selection !== undefined) { + if (typeof data130.allow_language_selection !== 'boolean') { + const err279 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/allow_language_selection', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err279]; + } else { + vErrors.push(err279); + } + errors++; + } + } + if (data130.output_code_only !== undefined) { + if (typeof data130.output_code_only !== 'boolean') { + const err280 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/output_code_only', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err280]; + } else { + vErrors.push(err280); + } + errors++; + } + } + if (data130.keys !== undefined) { + let data181 = data130.keys; + if (data181 && typeof data181 == 'object' && !Array.isArray(data181)) { + if (data181.code !== undefined) { + if (typeof data181.code !== 'string') { + const err281 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/keys/code', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err281]; + } else { + vErrors.push(err281); + } + errors++; + } + } + if (data181.lang !== undefined) { + if (typeof data181.lang !== 'string') { + const err282 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/keys/lang', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err282]; + } else { + vErrors.push(err282); + } + errors++; + } + } + } else { + const err283 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/keys', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err283]; + } else { + vErrors.push(err283); + } + errors++; + } + } } - var valid5 = errors === errs_5; + var _valid13 = _errs442 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'color') { + var _valid13 = true; + valid68 = _valid13; } - var data5 = data4.pattern; - if (data5 === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/view_filters/items/required', - params: { - missingProperty: 'pattern' - }, - message: 'should have required property \'pattern\'' + if (!valid68) { + const err284 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_5 = errors; - var errs__5 = errors, - prevValid5 = false, - valid5 = false, - passingSchemas5 = null; - var errs_6 = errors; - if (typeof data5 !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', - schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/0/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid6 = errors === errs_6; - if (valid6) { - valid5 = prevValid5 = true; - passingSchemas5 = 0; - } - var errs_6 = errors; - if (typeof data5 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', - schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/1/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid6 = errors === errs_6; - if (valid6 && prevValid5) { - valid5 = false; - passingSchemas5 = [passingSchemas5, 1]; + if (vErrors === null) { + vErrors = [err284]; } else { - if (valid6) { - valid5 = prevValid5 = true; - passingSchemas5 = 1; - } - } - if (!valid5) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + '].pattern', - schemaPath: '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf', - params: { - passingSchemas: passingSchemas5 - }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__5; - if (vErrors !== null) { - if (errs__5) vErrors.length = errs__5; - else vErrors = null; - } + vErrors.push(err284); } - var valid5 = errors === errs_5; + errors++; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/view_filters/items/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var valid4 = errors === errs_4; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_filters', - schemaPath: '#/properties/collections/items/properties/view_filters/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data3 = data2.view_groups; - if (data3 !== undefined) { - var errs_3 = errors; - if (Array.isArray(data3)) { - if (data3.length < 1) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups', - schemaPath: '#/properties/collections/items/properties/view_groups/minItems', - params: { - limit: 1 - }, - message: 'should NOT have fewer than 1 items' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var errs__3 = errors; - var valid3; - for (var i3 = 0; i3 < data3.length; i3++) { - var data4 = data3[i3]; - var errs_4 = errors; - if ((data4 && typeof data4 === "object" && !Array.isArray(data4))) { - var errs__4 = errors; - var valid5 = true; - for (var key4 in data4) { - var isAdditional4 = !(false || key4 == 'label' || key4 == 'field' || key4 == 'pattern'); - if (isAdditional4) { - valid5 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/view_groups/items/additionalProperties', - params: { - additionalProperty: '' + key4 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - if (data4.label === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/view_groups/items/required', - params: { - missingProperty: 'label' - }, - message: 'should have required property \'label\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.name === undefined) { + const err285 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err285]; } else { - var errs_5 = errors; - if (typeof data4.label !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].label', - schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/label/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid5 = errors === errs_5; + vErrors.push(err285); } - if (data4.field === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/view_groups/items/required', - params: { - missingProperty: 'field' - }, - message: 'should have required property \'field\'' + errors++; + } + if (data130.name !== undefined) { + if (typeof data130.name !== 'string') { + const err286 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/name', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_5 = errors; - if (typeof data4.field !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].field', - schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/field/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (vErrors === null) { + vErrors = [err286]; + } else { + vErrors.push(err286); } - var valid5 = errors === errs_5; + errors++; } - if (data4.pattern !== undefined) { - var errs_5 = errors; - if (typeof data4.pattern !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + '].pattern', - schemaPath: '#/properties/collections/items/properties/view_groups/items/properties/pattern/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } + if (data130.label !== undefined) { + if (typeof data130.label !== 'string') { + const err287 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/label', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err287]; + } else { + vErrors.push(err287); } - var valid5 = errors === errs_5; + errors++; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups[' + i3 + ']', - schemaPath: '#/properties/collections/items/properties/view_groups/items/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var valid4 = errors === errs_4; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].view_groups', - schemaPath: '#/properties/collections/items/properties/view_groups/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data3 = data2.nested; - if (data3 !== undefined) { - var errs_3 = errors; - if ((data3 && typeof data3 === "object" && !Array.isArray(data3))) { - var errs__3 = errors; - var valid4 = true; - var data4 = data3.depth; - if (data4 === undefined) { - valid4 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested', - schemaPath: '#/properties/collections/items/properties/nested/required', - params: { - missingProperty: 'depth' - }, - message: 'should have required property \'depth\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - var errs_4 = errors; - if ((typeof data4 === "number")) { - if (data4 > 1000 || data4 !== data4) { - var err = { - keyword: 'maximum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', - schemaPath: '#/properties/collections/items/properties/nested/properties/depth/maximum', - params: { - comparison: '<=', - limit: 1000, - exclusive: false - }, - message: 'should be <= 1000' + if (data130.widget !== undefined) { + if (typeof data130.widget !== 'string') { + const err288 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/widget', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err288]; + } else { + vErrors.push(err288); + } errors++; } - if (data4 < 1 || data4 !== data4) { - var err = { - keyword: 'minimum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', - schemaPath: '#/properties/collections/items/properties/nested/properties/depth/minimum', - params: { - comparison: '>=', - limit: 1, - exclusive: false - }, - message: 'should be >= 1' + } + if (data130.required !== undefined) { + if (typeof data130.required !== 'boolean') { + const err289 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/required', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err289]; + } else { + vErrors.push(err289); + } errors++; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.depth', - schemaPath: '#/properties/collections/items/properties/nested/properties/depth/type', - params: { - type: 'number' - }, - message: 'should be number' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid4 = errors === errs_4; - } - if (data3.summary !== undefined) { - var errs_4 = errors; - if (typeof data3.summary !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested.summary', - schemaPath: '#/properties/collections/items/properties/nested/properties/summary/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid4 = errors === errs_4; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].nested', - schemaPath: '#/properties/collections/items/properties/nested/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data3 = data2.meta; - if (data3 !== undefined) { - var errs_3 = errors; - if ((data3 && typeof data3 === "object" && !Array.isArray(data3))) { - if (Object.keys(data3).length < 1) { - var err = { - keyword: 'minProperties', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', - schemaPath: '#/properties/collections/items/properties/meta/minProperties', - params: { - limit: 1 - }, - message: 'should NOT have fewer than 1 properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__3 = errors; - var valid4 = true; - for (var key3 in data3) { - var isAdditional3 = !(false || key3 == 'path'); - if (isAdditional3) { - valid4 = false; - var err = { - keyword: 'additionalProperties', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', - schemaPath: '#/properties/collections/items/properties/meta/additionalProperties', - params: { - additionalProperty: '' + key3 + '' - }, - message: 'should NOT have additional properties' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - } - var data4 = data3.path; - if (data4 !== undefined) { - var errs_4 = errors; - if ((data4 && typeof data4 === "object" && !Array.isArray(data4))) { - var errs__4 = errors; - var valid5 = true; - if (data4.label === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', - schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', - params: { - missingProperty: 'label' - }, - message: 'should have required property \'label\'' + if (data130.i18n !== undefined) { + let data188 = data130.i18n; + const _errs465 = errors; + let valid100 = false; + let passing14 = null; + const _errs466 = errors; + if (typeof data188 !== 'boolean') { + const err290 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err290]; + } else { + vErrors.push(err290); + } errors++; - } else { - var errs_5 = errors; - if (typeof data4.label !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.label', - schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/label/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } + var _valid19 = _errs466 === errors; + if (_valid19) { + valid100 = true; + passing14 = 0; + } + const _errs468 = errors; + if (typeof data188 !== 'string') { + const err291 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err291]; + } else { + vErrors.push(err291); } - var valid5 = errors === errs_5; + errors++; } - if (data4.widget === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', - schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', + if ( + !(data188 === 'translate' || data188 === 'duplicate' || data188 === 'none') + ) { + const err292 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/enum', + keyword: 'enum', params: { - missingProperty: 'widget' + allowedValues: + schema40.properties.collections.items.properties.fields.items + .properties.i18n.oneOf[1].enum, }, - message: 'should have required property \'widget\'' + message: 'must be equal to one of the allowed values', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err292]; + } else { + vErrors.push(err292); + } errors++; + } + var _valid19 = _errs468 === errors; + if (_valid19 && valid100) { + valid100 = false; + passing14 = [passing14, 1]; } else { - var errs_5 = errors; - if (typeof data4.widget !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.widget', - schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/widget/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (_valid19) { + valid100 = true; + passing14 = 1; } - var valid5 = errors === errs_5; } - if (data4.index_file === undefined) { - valid5 = false; - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', - schemaPath: '#/properties/collections/items/properties/meta/properties/path/required', - params: { - missingProperty: 'index_file' - }, - message: 'should have required property \'index_file\'' + if (!valid100) { + const err293 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing14 }, + message: 'must match exactly one schema in oneOf', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err293]; + } else { + vErrors.push(err293); + } errors++; } else { - var errs_5 = errors; - if (typeof data4.index_file !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path.index_file', - schemaPath: '#/properties/collections/items/properties/meta/properties/path/properties/index_file/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + errors = _errs465; + if (vErrors !== null) { + if (_errs465) { + vErrors.length = _errs465; + } else { + vErrors = null; + } } - var valid5 = errors === errs_5; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta.path', - schemaPath: '#/properties/collections/items/properties/meta/properties/path/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid4 = errors === errs_4; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].meta', - schemaPath: '#/properties/collections/items/properties/meta/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid3 = errors === errs_3; - } - var data3 = data2.i18n; - if (data3 !== undefined) { - var errs_3 = errors; - var errs__3 = errors, - prevValid3 = false, - valid3 = false, - passingSchemas3 = null; - var errs_4 = errors; - if (typeof data3 !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/0/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid4 = errors === errs_4; - if (valid4) { - valid3 = prevValid3 = true; - passingSchemas3 = 0; - } - var errs_4 = errors; - if ((data3 && typeof data3 === "object" && !Array.isArray(data3))) { - var errs__4 = errors; - var valid5 = true; - var data4 = data3.structure; - if (data4 !== undefined) { - var errs_5 = errors; - if (typeof data4 !== "string") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.structure', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var schema5 = validate.schema.properties.collections.items.properties.i18n.oneOf[1].properties.structure.enum; - var valid5; - valid5 = false; - for (var i5 = 0; i5 < schema5.length; i5++) - if (equal(data4, schema5[i5])) { - valid5 = true; - break; - } if (!valid5) { - var err = { - keyword: 'enum', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.structure', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum', - params: { - allowedValues: schema5 - }, - message: 'should be equal to one of the allowed values' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var valid5 = errors === errs_5; - } - var data4 = data3.locales; - if (data4 !== undefined) { - var errs_5 = errors; - if (Array.isArray(data4)) { - if (data4.length < 2) { - var err = { - keyword: 'minItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/minItems', - params: { - limit: 2 - }, - message: 'should NOT have fewer than 2 items' + if (data130.hint !== undefined) { + if (typeof data130.hint !== 'string') { + const err294 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/hint', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err294]; + } else { + vErrors.push(err294); + } errors++; } - var errs__5 = errors; - var valid5; - for (var i5 = 0; i5 < data4.length; i5++) { - var data5 = data4[i5]; - var errs_6 = errors; - if (typeof data5 === "string") { - if (ucs2length(data5) > 10) { - var err = { - keyword: 'maxLength', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/maxLength', - params: { - limit: 10 - }, - message: 'should NOT be longer than 10 characters' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } + if (data130.pattern !== undefined) { + let data190 = data130.pattern; + if (Array.isArray(data190)) { + if (data190.length < 2) { + const err295 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/pattern', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err295]; + } else { + vErrors.push(err295); } - if (ucs2length(data5) < 2) { - var err = { - keyword: 'minLength', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/minLength', - params: { - limit: 2 - }, - message: 'should NOT be shorter than 2 characters' + errors++; + } + const len20 = data190.length; + if (len20 > 0) { + const _errs475 = errors; + let valid102 = false; + let passing15 = null; + const _errs476 = errors; + if (typeof data190[0] !== 'string') { + const err296 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/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 = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err296]; + } else { + vErrors.push(err296); + } errors++; } - if (!pattern0.test(data5)) { - var err = { - keyword: 'pattern', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/pattern', - params: { - pattern: '^[a-zA-Z-_]+$' - }, - message: 'should match pattern "^[a-zA-Z-_]+$"' + var _valid20 = _errs476 === errors; + if (_valid20) { + valid102 = true; + passing15 = 0; + } + var _valid20 = true; + if (_valid20 && valid102) { + valid102 = false; + passing15 = [passing15, 1]; + } else { + if (_valid20) { + valid102 = true; + passing15 = 1; + } + } + if (!valid102) { + const err297 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/pattern/0', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing15 }, + message: 'must match exactly one schema in oneOf', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err297]; + } else { + vErrors.push(err297); + } errors++; + } else { + errors = _errs475; + if (vErrors !== null) { + if (_errs475) { + vErrors.length = _errs475; + } else { + vErrors = null; + } + } } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales[' + i5 + ']', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/items/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var valid6 = errors === errs_6; - } - var i = data4.length, - valid5 = true, - j; - if (i > 1) { - var itemIndices = {}, - item; - for (; i--;) { - var item = data4[i]; - if (typeof item !== "string") continue; - if (typeof itemIndices[item] == 'number') { - valid5 = false; - j = itemIndices[item]; - break; + if (len20 > 1) { + if (typeof data190[1] !== 'string') { + const err298 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/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 = [err298]; + } else { + vErrors.push(err298); + } + errors++; } - itemIndices[item] = i; } - } - if (!valid5) { - var err = { - keyword: 'uniqueItems', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems', - params: { - i: i, - j: j - }, - message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' + } else { + const err299 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/pattern', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/pattern/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err299]; + } else { + vErrors.push(err299); + } errors++; } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.locales', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; } - var valid5 = errors === errs_5; - } - var data4 = data3.default_locale; - if (data4 !== undefined) { - var errs_5 = errors; - if (typeof data4 === "string") { - if (ucs2length(data4) > 10) { - var err = { - keyword: 'maxLength', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/maxLength', - params: { - limit: 10 - }, - message: 'should NOT be longer than 10 characters' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + if (data130.field !== undefined) { + if ( + !validate32(data130.field, { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/field', + parentData: data130, + parentDataProperty: 'field', + rootData, + }) + ) { + vErrors = + vErrors === null ? validate32.errors : vErrors.concat(validate32.errors); + errors = vErrors.length; } - if (ucs2length(data4) < 2) { - var err = { - keyword: 'minLength', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/minLength', - params: { - limit: 2 - }, - message: 'should NOT be shorter than 2 characters' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } + if (data130.fields !== undefined) { + if ( + !validate33(data130.fields, { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/fields', + parentData: data130, + parentDataProperty: 'fields', + rootData, + }) + ) { + vErrors = + vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); + errors = vErrors.length; } - if (!pattern0.test(data4)) { - var err = { - keyword: 'pattern', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/pattern', - params: { - pattern: '^[a-zA-Z-_]+$' - }, - message: 'should match pattern "^[a-zA-Z-_]+$"' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } + if (data130.types !== undefined) { + if ( + !validate33(data130.types, { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/types', + parentData: data130, + parentDataProperty: 'types', + rootData, + }) + ) { + vErrors = + vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); + errors = vErrors.length; } + } + } else { + const err300 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: '#/properties/collections/items/properties/fields/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err300]; } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n.default_locale', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/properties/default_locale/type', - params: { - type: 'string' - }, - message: 'should be string' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + vErrors.push(err300); } - var valid5 = errors === errs_5; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf/1/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid4 = errors === errs_4; - if (valid4 && prevValid3) { - valid3 = false; - passingSchemas3 = [passingSchemas3, 1]; - } else { - if (valid4) { - valid3 = prevValid3 = true; - passingSchemas3 = 1; + errors++; } } - if (!valid3) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + '].i18n', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf', - params: { - passingSchemas: passingSchemas3 - }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; + } else { + const err301 = { + 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 = [err301]; } else { - errors = errs__3; - if (vErrors !== null) { - if (errs__3) vErrors.length = errs__3; - else vErrors = null; - } + vErrors.push(err301); } - var valid3 = errors === errs_3; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__2 = errors; - var errs_3 = errors; - if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { - var missing3; - if (((data2.sortable_fields === undefined) && (missing3 = '.sortable_fields')) || ((data2.sortableFields === undefined) && (missing3 = '.sortableFields'))) { - var err = {}; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else {} - } - if (errors === errs_3) {} - var valid3 = errors === errs_3; - if (valid3) { - var err = { - keyword: 'not', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/not', - params: {}, - message: 'should NOT be valid' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__2; - if (vErrors !== null) { - if (errs__2) vErrors.length = errs__2; - else vErrors = null; - } - } - var errs__2 = errors, - prevValid2 = false, - valid2 = false, - passingSchemas2 = null; - var errs_3 = errors; - if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { - if (data2.files === undefined) { - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/oneOf/0/required', - params: { - missingProperty: 'files' - }, - message: 'should have required property \'files\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); errors++; } } - var valid3 = errors === errs_3; - if (valid3) { - valid2 = prevValid2 = true; - passingSchemas2 = 0; - } - var errs_3 = errors; - if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { - if (data2.folder === undefined) { - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/oneOf/1/required', - params: { - missingProperty: 'folder' - }, - message: 'should have required property \'folder\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - if (data2.fields === undefined) { - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/oneOf/1/required', - params: { - missingProperty: 'fields' - }, - message: 'should have required property \'fields\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - var valid3 = errors === errs_3; - if (valid3 && prevValid2) { - valid2 = false; - passingSchemas2 = [passingSchemas2, 1]; - } else { - if (valid3) { - valid2 = prevValid2 = true; - passingSchemas2 = 1; - } - } - if (!valid2) { - var err = { - keyword: 'oneOf', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/oneOf', - params: { - passingSchemas: passingSchemas2 - }, - message: 'should match exactly one schema in oneOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__2; - if (vErrors !== null) { - if (errs__2) vErrors.length = errs__2; - else vErrors = null; - } - } - var errs__2 = errors; - var valid2 = true; - var errs_3 = errors; - if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { - if (data2.extension === undefined) { - var err = {}; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - var valid3 = errors === errs_3; - errors = errs__2; - if (vErrors !== null) { - if (errs__2) vErrors.length = errs__2; - else vErrors = null; - } - if (valid3) { - var errs_3 = errors; - var errs__3 = errors; - var valid3 = true; - var errs_4 = errors; - if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { - var errs__4 = errors; - var valid5 = true; - if (data2.extension !== undefined) { - var errs_5 = errors; - var schema5 = validate.schema.properties.collections.items.then.if.properties.extension.enum; - var valid5; - valid5 = false; - for (var i5 = 0; i5 < schema5.length; i5++) - if (equal(data2.extension, schema5[i5])) { - valid5 = true; - break; - } if (!valid5) { - var err = {}; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (data30.sortable_fields !== undefined) { + let data196 = data30.sortable_fields; + if (Array.isArray(data196)) { + const len21 = data196.length; + for (let i20 = 0; i20 < len21; i20++) { + if (typeof data196[i20] !== 'string') { + const err302 = { + instancePath: instancePath + '/collections/' + i3 + '/sortable_fields/' + i20, + schemaPath: + '#/properties/collections/items/properties/sortable_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err302]; + } else { + vErrors.push(err302); + } errors++; } - var valid5 = errors === errs_5; } + } else { + const err303 = { + instancePath: instancePath + '/collections/' + i3 + '/sortable_fields', + schemaPath: '#/properties/collections/items/properties/sortable_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err303]; + } else { + vErrors.push(err303); + } + errors++; } - var valid4 = errors === errs_4; - errors = errs__3; - if (vErrors !== null) { - if (errs__3) vErrors.length = errs__3; - else vErrors = null; - } - if (!valid4) { - var errs_4 = errors; - if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) { - if (data2.format === undefined) { - var err = { - keyword: 'required', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/then/else/required', - params: { - missingProperty: 'format' - }, - message: 'should have required property \'format\'' + } + if (data30.sortableFields !== undefined) { + let data198 = data30.sortableFields; + if (Array.isArray(data198)) { + const len22 = data198.length; + for (let i21 = 0; i21 < len22; i21++) { + if (typeof data198[i21] !== 'string') { + const err304 = { + instancePath: instancePath + '/collections/' + i3 + '/sortableFields/' + i21, + schemaPath: + '#/properties/collections/items/properties/sortableFields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err304]; + } else { + vErrors.push(err304); + } errors++; } } - var valid4 = errors === errs_4; - valid3 = valid4; - } - if (!valid3) { - var err = { - keyword: 'if', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/then/if', - params: { - failingKeyword: 'else' - }, - message: 'should match "' + 'else' + '" schema' + } else { + const err305 = { + instancePath: instancePath + '/collections/' + i3 + '/sortableFields', + schemaPath: '#/properties/collections/items/properties/sortableFields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); + if (vErrors === null) { + vErrors = [err305]; + } else { + vErrors.push(err305); + } errors++; } - var valid3 = errors === errs_3; - valid2 = valid3; - } - if (!valid2) { - var err = { - keyword: 'if', - dataPath: (dataPath || '') + '.collections[' + i1 + ']', - schemaPath: '#/properties/collections/items/if', - params: { - failingKeyword: 'then' - }, - message: 'should match "' + 'then' + '" schema' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - customRule17.errors = null; - var errs__1 = errors; - var valid1; - customRule17.errors = null; - valid1 = customRule17.call(self, data1, (dataPath || '') + '.collections', data, 'collections', rootData); - if (!valid1) { - if (Array.isArray(customRule17.errors)) { - if (vErrors === null) vErrors = customRule17.errors; - else vErrors = vErrors.concat(customRule17.errors); - errors = vErrors.length; - for (var i1 = errs__1; i1 < errors; i1++) { - var ruleErr1 = vErrors[i1]; - if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '.collections'; - ruleErr1.schemaPath = "#/properties/collections/uniqueItemProperties"; - } - } else { - var err = { - keyword: 'uniqueItemProperties', - dataPath: (dataPath || '') + '.collections', - schemaPath: '#/properties/collections/uniqueItemProperties', - params: { - keyword: 'uniqueItemProperties' - }, - message: 'should pass "uniqueItemProperties" keyword validation' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.collections', - schemaPath: '#/properties/collections/type', - params: { - type: 'array' - }, - message: 'should be array' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - var data1 = data.editor; - if (data1 !== undefined) { - var errs_1 = errors; - if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) { - var errs__1 = errors; - var valid2 = true; - if (data1.preview !== undefined) { - var errs_2 = errors; - if (typeof data1.preview !== "boolean") { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.editor.preview', - schemaPath: '#/properties/editor/properties/preview/type', - params: { - type: 'boolean' - }, - message: 'should be boolean' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid2 = errors === errs_2; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + '.editor', - schemaPath: '#/properties/editor/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var valid1 = errors === errs_1; - } - } else { - var err = { - keyword: 'type', - dataPath: (dataPath || '') + "", - schemaPath: '#/type', - params: { - type: 'object' - }, - message: 'should be object' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - var errs__0 = errors; - var valid0 = false; - var errs_1 = errors; - if ((data && typeof data === "object" && !Array.isArray(data))) { - if (data.media_folder === undefined) { - var err = { - keyword: 'required', - dataPath: (dataPath || '') + "", - schemaPath: '#/anyOf/0/required', - params: { - missingProperty: 'media_folder' - }, - message: 'should have required property \'media_folder\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - var valid1 = errors === errs_1; - valid0 = valid0 || valid1; - if (!valid0) { - var errs_1 = errors; - if ((data && typeof data === "object" && !Array.isArray(data))) { - if (data.media_library === undefined) { - var err = { - keyword: 'required', - dataPath: (dataPath || '') + "", - schemaPath: '#/anyOf/1/required', - params: { - missingProperty: 'media_library' - }, - message: 'should have required property \'media_library\'' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } - } - var valid1 = errors === errs_1; - valid0 = valid0 || valid1; - if (!valid0) {} - } - if (!valid0) { - var err = { - keyword: 'anyOf', - dataPath: (dataPath || '') + "", - schemaPath: '#/anyOf', - params: {}, - message: 'should match some schema in anyOf' - }; - if (vErrors === null) vErrors = [err]; - else vErrors.push(err); - errors++; - } else { - errors = errs__0; - if (vErrors !== null) { - if (errs__0) vErrors.length = errs__0; - else vErrors = null; - } - } - validate.errors = vErrors; - return errors === 0; - }; -})(); -validate.schema = { - "$id": "https://netlify-cms/object.json", - "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_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", - "type": "array", - "minItems": 1, - "items": { - "$id": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d", - "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" - }, { - "instanceof": "RegExp" - }] - }, { - "type": "string" - }] - }, - "field": { - "$ref": "field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" - }, - "fields": { - "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" - }, - "types": { - "$ref": "fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" + if (data30.view_filters !== undefined) { + let data200 = data30.view_filters; + if (Array.isArray(data200)) { + if (data200.length < 1) { + const err306 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters', + schemaPath: '#/properties/collections/items/properties/view_filters/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err306]; + } else { + vErrors.push(err306); + } + errors++; + } + const len23 = data200.length; + for (let i22 = 0; i22 < len23; i22++) { + let data201 = data200[i22]; + if (data201 && typeof data201 == 'object' && !Array.isArray(data201)) { + if (data201.label === undefined) { + const err307 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, + schemaPath: + '#/properties/collections/items/properties/view_filters/items/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err307]; + } else { + vErrors.push(err307); } - }, - "select": { - "$data": "0/widget" - }, - "selectCases": { - "unknown": {}, - "string": {}, - "number": { - "properties": { - "step": { - "type": "number" - }, - "value_type": { - "type": "string" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" - } + errors++; + } + if (data201.field === undefined) { + const err308 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, + schemaPath: + '#/properties/collections/items/properties/view_filters/items/required', + keyword: 'required', + params: { missingProperty: 'field' }, + message: "must have required property '" + 'field' + "'", + }; + if (vErrors === null) { + vErrors = [err308]; + } else { + vErrors.push(err308); + } + errors++; + } + if (data201.pattern === undefined) { + const err309 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, + schemaPath: + '#/properties/collections/items/properties/view_filters/items/required', + keyword: 'required', + params: { missingProperty: 'pattern' }, + message: "must have required property '" + 'pattern' + "'", + }; + if (vErrors === null) { + vErrors = [err309]; + } else { + vErrors.push(err309); + } + errors++; + } + for (const key1 in data201) { + if (!(key1 === 'label' || key1 === 'field' || key1 === 'pattern')) { + const err310 = { + instancePath: + instancePath + '/collections/' + i3 + '/view_filters/' + i22, + schemaPath: + '#/properties/collections/items/properties/view_filters/items/additionalProperties', + keyword: 'additionalProperties', + params: { additionalProperty: key1 }, + message: 'must NOT have additional properties', + }; + if (vErrors === null) { + vErrors = [err310]; + } else { + vErrors.push(err310); } - }, - "text": {}, - "image": { - "properties": { - "allow_multiple": { - "type": "boolean" - } + errors++; + } + } + if (data201.label !== undefined) { + if (typeof data201.label !== 'string') { + const err311 = { + instancePath: + instancePath + '/collections/' + i3 + '/view_filters/' + i22 + '/label', + schemaPath: + '#/properties/collections/items/properties/view_filters/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err311]; + } else { + vErrors.push(err311); } - }, - "file": { - "properties": { - "allow_multiple": { - "type": "boolean" - } + errors++; + } + } + if (data201.field !== undefined) { + if (typeof data201.field !== 'string') { + const err312 = { + instancePath: + instancePath + '/collections/' + i3 + '/view_filters/' + i22 + '/field', + schemaPath: + '#/properties/collections/items/properties/view_filters/items/properties/field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err312]; + } else { + vErrors.push(err312); } - }, - "select": { - "properties": { - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "options": { - "type": "array", - "items": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }, { - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }] - } - }, - "required": ["label", "value"] - }] - } - } - }, - "required": ["options"] - }, - "markdown": { - "properties": { - "minimal": { - "type": "boolean" - }, - "buttons": { - "type": "array", - "items": { - "type": "string", - "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] - } - }, - "editor_components": { - "type": "array", - "items": { - "type": "string" - } - }, - "modes": { - "type": "array", - "items": { - "type": "string", - "enum": ["raw", "rich_text"] - }, - "minItems": 1 - } + errors++; + } + } + if (data201.pattern !== undefined) { + let data204 = data201.pattern; + const _errs501 = errors; + let valid110 = false; + let passing16 = null; + const _errs502 = errors; + if (typeof data204 !== 'boolean') { + const err313 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/view_filters/' + + i22 + + '/pattern', + schemaPath: + '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err313]; + } else { + vErrors.push(err313); } - }, - "list": { - "properties": { - "allow_add": { - "type": "boolean" - }, - "collapsed": { - "type": "boolean" - }, - "summary": { - "type": "string" - }, - "minimize_collapsed": { - "type": "boolean" - }, - "label_singular": { - "type": "string" - }, - "i18n": { - "type": "boolean" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" - } + errors++; + } + var _valid21 = _errs502 === errors; + if (_valid21) { + valid110 = true; + passing16 = 0; + } + const _errs504 = errors; + if (typeof data204 !== 'string') { + const err314 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/view_filters/' + + i22 + + '/pattern', + schemaPath: + '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err314]; + } else { + vErrors.push(err314); } - }, - "object": { - "properties": { - "collapsed": { - "type": "boolean" - }, - "i18n": { - "type": "boolean" - } + errors++; + } + var _valid21 = _errs504 === errors; + if (_valid21 && valid110) { + valid110 = false; + passing16 = [passing16, 1]; + } else { + if (_valid21) { + valid110 = true; + passing16 = 1; } - }, - "relation": { - "properties": { - "collection": { - "type": "string" - }, - "value_field": { - "type": "string" - }, - "search_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - }, - "file": { - "type": "string" - }, - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "display_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - }, - "options_length": { - "type": "integer" - } - }, - "oneOf": [{ - "required": ["collection", "value_field", "search_fields"] - }, { - "required": ["collection", "valueField", "searchFields"] - }] - }, - "boolean": {}, - "map": { - "properties": { - "decimals": { - "type": "integer" - }, - "type": { - "type": "string", - "enum": ["Point", "LineString", "Polygon"] - } + } + if (!valid110) { + const err315 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/view_filters/' + + i22 + + '/pattern', + schemaPath: + '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing16 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err315]; + } else { + vErrors.push(err315); } - }, - "date": {}, - "datetime": { - "properties": { - "format": { - "type": "string" - }, - "date_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "time_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "picker_utc": { - "type": "boolean" + errors++; + } else { + errors = _errs501; + if (vErrors !== null) { + if (_errs501) { + vErrors.length = _errs501; + } else { + vErrors = null; } } - }, - "code": { - "properties": { - "default_language": { - "type": "string" - }, - "allow_language_selection": { - "type": "boolean" - }, - "output_code_only": { - "type": "boolean" - }, - "keys": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "lang": { - "type": "string" - } - } - } + } + } + } else { + const err316 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, + schemaPath: + '#/properties/collections/items/properties/view_filters/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err316]; + } else { + vErrors.push(err316); + } + errors++; + } + } + } else { + const err317 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters', + schemaPath: '#/properties/collections/items/properties/view_filters/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err317]; + } else { + vErrors.push(err317); + } + errors++; + } + } + if (data30.view_groups !== undefined) { + let data205 = data30.view_groups; + if (Array.isArray(data205)) { + if (data205.length < 1) { + const err318 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups', + schemaPath: '#/properties/collections/items/properties/view_groups/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err318]; + } else { + vErrors.push(err318); + } + errors++; + } + const len24 = data205.length; + for (let i23 = 0; i23 < len24; i23++) { + let data206 = data205[i23]; + if (data206 && typeof data206 == 'object' && !Array.isArray(data206)) { + if (data206.label === undefined) { + const err319 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, + schemaPath: + '#/properties/collections/items/properties/view_groups/items/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err319]; + } else { + vErrors.push(err319); + } + errors++; + } + if (data206.field === undefined) { + const err320 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, + schemaPath: + '#/properties/collections/items/properties/view_groups/items/required', + keyword: 'required', + params: { missingProperty: 'field' }, + message: "must have required property '" + 'field' + "'", + }; + if (vErrors === null) { + vErrors = [err320]; + } else { + vErrors.push(err320); + } + errors++; + } + for (const key2 in data206) { + if (!(key2 === 'label' || key2 === 'field' || key2 === 'pattern')) { + const err321 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, + schemaPath: + '#/properties/collections/items/properties/view_groups/items/additionalProperties', + keyword: 'additionalProperties', + params: { additionalProperty: key2 }, + message: 'must NOT have additional properties', + }; + if (vErrors === null) { + vErrors = [err321]; + } else { + vErrors.push(err321); } - }, - "color": {} - }, - "required": ["name"] - }, - "uniqueItemProperties": ["name"] + errors++; + } + } + if (data206.label !== undefined) { + if (typeof data206.label !== 'string') { + const err322 = { + instancePath: + instancePath + '/collections/' + i3 + '/view_groups/' + i23 + '/label', + schemaPath: + '#/properties/collections/items/properties/view_groups/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err322]; + } else { + vErrors.push(err322); + } + errors++; + } + } + if (data206.field !== undefined) { + if (typeof data206.field !== 'string') { + const err323 = { + instancePath: + instancePath + '/collections/' + i3 + '/view_groups/' + i23 + '/field', + schemaPath: + '#/properties/collections/items/properties/view_groups/items/properties/field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err323]; + } else { + vErrors.push(err323); + } + errors++; + } + } + if (data206.pattern !== undefined) { + if (typeof data206.pattern !== 'string') { + const err324 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/view_groups/' + + i23 + + '/pattern', + schemaPath: + '#/properties/collections/items/properties/view_groups/items/properties/pattern/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err324]; + } else { + vErrors.push(err324); + } + errors++; + } + } + } else { + const err325 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, + schemaPath: + '#/properties/collections/items/properties/view_groups/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err325]; + } else { + vErrors.push(err325); + } + errors++; + } } - }, - "required": ["name", "label", "file", "fields"] - }, - "uniqueItemProperties": ["name"] - }, - "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" + } else { + const err326 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups', + schemaPath: '#/properties/collections/items/properties/view_groups/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err326]; + } else { + vErrors.push(err326); + } + errors++; } } - }, - "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" + if (data30.nested !== undefined) { + let data210 = data30.nested; + if (data210 && typeof data210 == 'object' && !Array.isArray(data210)) { + if (data210.depth === undefined) { + const err327 = { + instancePath: instancePath + '/collections/' + i3 + '/nested', + schemaPath: '#/properties/collections/items/properties/nested/required', + keyword: 'required', + params: { missingProperty: 'depth' }, + message: "must have required property '" + 'depth' + "'", + }; + if (vErrors === null) { + vErrors = [err327]; + } else { + vErrors.push(err327); + } + errors++; + } + if (data210.depth !== undefined) { + let data211 = data210.depth; + if (typeof data211 == 'number') { + if (data211 > 1000 || isNaN(data211)) { + const err328 = { + 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 = [err328]; + } else { + vErrors.push(err328); + } + errors++; + } + if (data211 < 1 || isNaN(data211)) { + const err329 = { + 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 = [err329]; + } else { + vErrors.push(err329); + } + errors++; + } + } else { + const err330 = { + 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 = [err330]; + } else { + vErrors.push(err330); + } + errors++; + } + } + if (data210.summary !== undefined) { + if (typeof data210.summary !== 'string') { + const err331 = { + 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 = [err331]; + } else { + vErrors.push(err331); + } + errors++; + } + } + } else { + const err332 = { + 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 = [err332]; + } else { + vErrors.push(err332); + } + errors++; + } } - }, - "fields": { - "$id": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", - "type": "array", - "minItems": 1, - "items": { - "$id": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e", - "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" - }, { - "instanceof": "RegExp" - }] - }, { - "type": "string" - }] - }, - "field": { - "$ref": "field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" - }, - "fields": { - "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" - }, - "types": { - "$ref": "fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" + if (data30.meta !== undefined) { + let data213 = data30.meta; + if (data213 && typeof data213 == 'object' && !Array.isArray(data213)) { + if (Object.keys(data213).length < 1) { + const err333 = { + 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 = [err333]; + } else { + vErrors.push(err333); + } + errors++; } - }, - "select": { - "$data": "0/widget" - }, - "selectCases": { - "unknown": {}, - "string": {}, - "number": { - "properties": { - "step": { - "type": "number" - }, - "value_type": { - "type": "string" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" + for (const key3 in data213) { + if (!(key3 === 'path')) { + const err334 = { + 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 = [err334]; + } else { + vErrors.push(err334); } + errors++; } - }, - "text": {}, - "image": { - "properties": { - "allow_multiple": { - "type": "boolean" + } + if (data213.path !== undefined) { + let data214 = data213.path; + if (data214 && typeof data214 == 'object' && !Array.isArray(data214)) { + if (data214.label === undefined) { + const err335 = { + 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 = [err335]; + } else { + vErrors.push(err335); + } + errors++; } - } - }, - "file": { - "properties": { - "allow_multiple": { - "type": "boolean" + if (data214.widget === undefined) { + const err336 = { + 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 = [err336]; + } else { + vErrors.push(err336); + } + errors++; } - } - }, - "select": { - "properties": { - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "options": { - "type": "array", - "items": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }, { - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "oneOf": [{ - "type": "string" - }, { - "type": "number" - }] - } - }, - "required": ["label", "value"] - }] + if (data214.index_file === undefined) { + const err337 = { + 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 = [err337]; + } else { + vErrors.push(err337); } + errors++; } - }, - "required": ["options"] - }, - "markdown": { - "properties": { - "minimal": { - "type": "boolean" - }, - "buttons": { - "type": "array", - "items": { - "type": "string", - "enum": ["bold", "italic", "code", "link", "heading-one", "heading-two", "heading-three", "heading-four", "heading-five", "heading-six", "quote", "bulleted-list", "numbered-list"] + if (data214.label !== undefined) { + if (typeof data214.label !== 'string') { + const err338 = { + 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 = [err338]; + } else { + vErrors.push(err338); + } + errors++; } - }, - "editor_components": { - "type": "array", - "items": { - "type": "string" + } + if (data214.widget !== undefined) { + if (typeof data214.widget !== 'string') { + const err339 = { + 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 = [err339]; + } else { + vErrors.push(err339); + } + errors++; } - }, - "modes": { - "type": "array", - "items": { - "type": "string", - "enum": ["raw", "rich_text"] - }, - "minItems": 1 } + if (data214.index_file !== undefined) { + if (typeof data214.index_file !== 'string') { + const err340 = { + 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 = [err340]; + } else { + vErrors.push(err340); + } + errors++; + } + } + } else { + const err341 = { + 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 = [err341]; + } else { + vErrors.push(err341); + } + errors++; } - }, - "list": { - "properties": { - "allow_add": { - "type": "boolean" - }, - "collapsed": { - "type": "boolean" - }, - "summary": { - "type": "string" - }, - "minimize_collapsed": { - "type": "boolean" - }, - "label_singular": { - "type": "string" - }, - "i18n": { - "type": "boolean" - }, - "min": { - "type": "number" - }, - "max": { - "type": "number" + } + } else { + const err342 = { + 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 = [err342]; + } else { + vErrors.push(err342); + } + errors++; + } + } + if (data30.i18n !== undefined) { + let data218 = data30.i18n; + const _errs535 = errors; + let valid117 = false; + let passing17 = null; + const _errs536 = errors; + if (typeof data218 !== 'boolean') { + const err343 = { + 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 = [err343]; + } else { + vErrors.push(err343); + } + errors++; + } + var _valid22 = _errs536 === errors; + if (_valid22) { + valid117 = true; + passing17 = 0; + } + const _errs538 = errors; + if (data218 && typeof data218 == 'object' && !Array.isArray(data218)) { + if (data218.structure !== undefined) { + let data219 = data218.structure; + if (typeof data219 !== 'string') { + const err344 = { + 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 = [err344]; + } else { + vErrors.push(err344); } + errors++; } - }, - "object": { - "properties": { - "collapsed": { - "type": "boolean" - }, - "i18n": { - "type": "boolean" + if ( + !( + data219 === 'multiple_folders' || + data219 === 'multiple_files' || + data219 === 'single_file' + ) + ) { + const err345 = { + instancePath: instancePath + '/collections/' + i3 + '/i18n/structure', + schemaPath: + '#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties.i18n.oneOf[1].properties + .structure.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err345]; + } else { + vErrors.push(err345); } + errors++; } - }, - "relation": { - "properties": { - "collection": { - "type": "string" - }, - "value_field": { - "type": "string" - }, - "search_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" + } + if (data218.locales !== undefined) { + let data220 = data218.locales; + if (Array.isArray(data220)) { + if (data220.length < 2) { + const err346 = { + 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 = [err346]; + } else { + vErrors.push(err346); } - }, - "file": { - "type": "string" - }, - "multiple": { - "type": "boolean" - }, - "min": { - "type": "integer" - }, - "max": { - "type": "integer" - }, - "display_fields": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" + errors++; + } + const len25 = data220.length; + for (let i24 = 0; i24 < len25; i24++) { + let data221 = data220[i24]; + if (typeof data221 === 'string') { + if (func9(data221) > 10) { + const err347 = { + instancePath: + instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, + 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 = [err347]; + } else { + vErrors.push(err347); + } + errors++; + } + if (func9(data221) < 2) { + const err348 = { + instancePath: + instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, + 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 = [err348]; + } else { + vErrors.push(err348); + } + errors++; + } + if (!pattern0.test(data221)) { + const err349 = { + instancePath: + instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, + 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 = [err349]; + } else { + vErrors.push(err349); + } + errors++; + } + } else { + const err350 = { + instancePath: + instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, + 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 = [err350]; + } else { + vErrors.push(err350); + } + errors++; } - }, - "options_length": { - "type": "integer" } - }, - "oneOf": [{ - "required": ["collection", "value_field", "search_fields"] - }, { - "required": ["collection", "valueField", "searchFields"] - }] - }, - "boolean": {}, - "map": { - "properties": { - "decimals": { - "type": "integer" - }, - "type": { - "type": "string", - "enum": ["Point", "LineString", "Polygon"] + let i25 = data220.length; + let j1; + if (i25 > 1) { + const indices1 = {}; + for (; i25--; ) { + let item1 = data220[i25]; + if (typeof item1 !== 'string') { + continue; + } + if (typeof indices1[item1] == 'number') { + j1 = indices1[item1]; + const err351 = { + instancePath: instancePath + '/collections/' + i3 + '/i18n/locales', + schemaPath: + '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems', + keyword: 'uniqueItems', + params: { i: i25, j: j1 }, + message: + 'must NOT have duplicate items (items ## ' + + j1 + + ' and ' + + i25 + + ' are identical)', + }; + if (vErrors === null) { + vErrors = [err351]; + } else { + vErrors.push(err351); + } + errors++; + break; + } + indices1[item1] = i25; + } } - } - }, - "date": {}, - "datetime": { - "properties": { - "format": { - "type": "string" - }, - "date_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "time_format": { - "oneOf": [{ - "type": "string" - }, { - "type": "boolean" - }] - }, - "picker_utc": { - "type": "boolean" + } else { + const err352 = { + 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 = [err352]; + } else { + vErrors.push(err352); } + errors++; } - }, - "code": { - "properties": { - "default_language": { - "type": "string" - }, - "allow_language_selection": { - "type": "boolean" - }, - "output_code_only": { - "type": "boolean" - }, - "keys": { - "type": "object", - "properties": { - "code": { - "type": "string" - }, - "lang": { - "type": "string" - } + } + if (data218.default_locale !== undefined) { + let data222 = data218.default_locale; + if (typeof data222 === 'string') { + if (func9(data222) > 10) { + const err353 = { + 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 = [err353]; + } else { + vErrors.push(err353); + } + errors++; + } + if (func9(data222) < 2) { + const err354 = { + 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 = [err354]; + } else { + vErrors.push(err354); + } + errors++; + } + if (!pattern0.test(data222)) { + const err355 = { + 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 = [err355]; + } else { + vErrors.push(err355); } + errors++; + } + } else { + const err356 = { + 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 = [err356]; + } else { + vErrors.push(err356); } + errors++; } - }, - "color": {} - }, - "required": ["name"] - }, - "uniqueItemProperties": ["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" + } else { + const err357 = { + 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 = [err357]; + } else { + vErrors.push(err357); } - }, - "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"] + errors++; } - }, - "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-_]+$" + var _valid22 = _errs538 === errors; + if (_valid22 && valid117) { + valid117 = false; + passing17 = [passing17, 1]; + } else { + if (_valid22) { + valid117 = true; + passing17 = 1; } } - }] - } - }, - "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"] + if (!valid117) { + const err358 = { + instancePath: instancePath + '/collections/' + i3 + '/i18n', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing17 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err358]; + } else { + vErrors.push(err358); + } + errors++; + } else { + errors = _errs535; + if (vErrors !== null) { + if (_errs535) { + vErrors.length = _errs535; + } else { + vErrors = null; + } + } } } - }, - "else": { - "required": ["format"] + } else { + const err359 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err359]; + } else { + vErrors.push(err359); + } + errors++; } - }, - "dependencies": { - "frontmatter_delimiter": { - "properties": { - "format": { - "enum": ["yaml-frontmatter", "toml-frontmatter", "json-frontmatter"] - } - }, - "required": ["format"] + } + } else { + const err360 = { + instancePath: instancePath + '/collections', + schemaPath: '#/properties/collections/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err360]; + } else { + vErrors.push(err360); + } + errors++; + } + } + if (data.editor !== undefined) { + let data223 = data.editor; + if (data223 && typeof data223 == 'object' && !Array.isArray(data223)) { + if (data223.preview !== undefined) { + if (typeof data223.preview !== 'boolean') { + const err361 = { + instancePath: instancePath + '/editor/preview', + schemaPath: '#/properties/editor/properties/preview/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err361]; + } else { + vErrors.push(err361); + } + errors++; } } - }, - "uniqueItemProperties": ["name"] - }, - "editor": { - "type": "object", - "properties": { - "preview": { - "type": "boolean" + } else { + const err362 = { + instancePath: instancePath + '/editor', + schemaPath: '#/properties/editor/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err362]; + } else { + vErrors.push(err362); } + errors++; } } - }, - "required": ["backend", "collections"], - "anyOf": [{ - "required": ["media_folder"] - }, { - "required": ["media_library"] - }] -}; -validate.errors = null; -module.exports = validate; \ No newline at end of file + } else { + const err363 = { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err363]; + } else { + vErrors.push(err363); + } + errors++; + } + validate24.errors = vErrors; + return errors === 0; +} diff --git a/yarn.lock b/yarn.lock index 4d9599452a89..fbb8b10df312 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4464,17 +4464,16 @@ airbnb-js-shims@^2.2.1: string.prototype.padstart "^3.0.0" symbol.prototype.description "^1.0.0" -ajv-cli@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/ajv-cli/-/ajv-cli-3.3.0.tgz#dd72207f5395051db7d620ab7d4da1cec3d50f06" - integrity sha512-4eiNNjDlainn5Rm+rU3egxLUUxzevcB+gviBLs9sm6etHNrE7l2JSQ3yoz5hE+eqrth3pTygELOafhSIO8Hiig== +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 "^6.7.0" - ajv-pack "^0.3.0" + ajv "^8.0.0" fast-json-patch "^2.0.0" glob "^7.1.0" - js-yaml "^3.13.1" - json-schema-migrate "^0.2.0" + js-yaml "^3.14.0" + json-schema-migrate "^2.0.0" json5 "^2.1.3" minimist "^1.2.0" @@ -4483,20 +4482,19 @@ ajv-errors@^1.0.0: resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== -ajv-keywords@3.5.2, ajv-keywords@^3.1.0, ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: +ajv-keywords@^3.1.0, ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv-pack@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/ajv-pack/-/ajv-pack-0.3.1.tgz#b72c4d4219e3928e62842d742ded93bf50796560" - integrity sha1-tyxNQhnjko5ihC10Le2Tv1B5ZWA= +ajv-keywords@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== dependencies: - js-beautify "^1.6.4" - require-from-string "^1.2.0" + fast-deep-equal "^3.1.3" -ajv@6.12.6, ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6, ajv@^6.7.0: +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5, ajv@^6.12.6: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -4506,17 +4504,7 @@ ajv@6.12.6, ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4, ajv@ json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^5.0.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -ajv@^8.0.1: +ajv@^8.0.0, ajv@^8.0.1, ajv@^8.8.2: version "8.8.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb" integrity sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw== @@ -7955,16 +7943,6 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -editorconfig@^0.15.3: - version "0.15.3" - resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.15.3.tgz#bef84c4e75fb8dcb0ce5cee8efd51c15999befc5" - integrity sha512-M9wIMFx96vq0R4F+gRpY3o2exzb8hEj/n9S8unZtHSvYjibBp/iMufSzvmOcV/laG0ZtuTVGtiJggPOSW2r93g== - dependencies: - commander "^2.19.0" - lru-cache "^4.1.5" - semver "^5.6.0" - sigmund "^1.0.1" - ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -8799,11 +8777,6 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.1.tgz#8d172c064867f235c0c84a596806d279bf4bcc07" integrity sha512-Wrk35e8ydCKDj/ArClo1VrPVmN8zph5V4AtHwIuHhvMXsKf73UT3BOD+azBIW+3wOJ4FhEH7zyaJCFvChjYvMA== -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= - fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" @@ -11789,16 +11762,6 @@ js-base64@*, js-base64@^3.0.0: resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.2.tgz#816d11d81a8aff241603d19ce5761e13e41d7745" integrity sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ== -js-beautify@^1.6.4: - version "1.14.0" - resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.14.0.tgz#2ce790c555d53ce1e3d7363227acf5dc69024c2d" - integrity sha512-yuck9KirNSCAwyNJbqW+BxJqJ0NLJ4PwBUzQQACl5O3qHMBXVkXb/rD0ilh/Lat/tn88zSZ+CAHOlk0DsY7GuQ== - dependencies: - config-chain "^1.1.12" - editorconfig "^0.15.3" - glob "^7.1.3" - nopt "^5.0.0" - js-sha256@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" @@ -11814,7 +11777,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== @@ -11906,17 +11869,12 @@ 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@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/json-schema-migrate/-/json-schema-migrate-0.2.0.tgz#ba47a5b0072fc72396460e1bd60b44d52178bbc6" - integrity sha1-ukelsAcvxyOWRg4b1gtE1SF4u8Y= +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 "^5.0.0" - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= + ajv "^8.0.0" json-schema-traverse@^0.4.1: version "0.4.1" @@ -12493,14 +12451,6 @@ lowlight@~1.11.0: fault "^1.0.2" highlight.js "~9.13.0" -lru-cache@^4.1.5: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -15034,11 +14984,6 @@ ps-tree@1.2.0: dependencies: event-stream "=3.3.4" -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - psl@^1.1.28, psl@^1.1.33: version "1.8.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" @@ -16261,11 +16206,6 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -require-from-string@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" - integrity sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg= - require-from-string@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" @@ -16822,11 +16762,6 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -sigmund@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" - integrity sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA= - signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: version "3.0.6" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af" @@ -19713,11 +19648,6 @@ yaeti@^0.0.6: resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc= -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - yallist@^3.0.0, yallist@^3.0.2, yallist@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" From 035b6b89b4c884e489d47da2b6cdef62aefe4a24 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Thu, 6 Jan 2022 09:16:02 -0800 Subject: [PATCH 10/20] chore(csp): estore tests back to original --- .../constants/__tests__/configSchema.spec.js | 163 +++++++++--------- 1 file changed, 81 insertions(+), 82 deletions(-) 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 0d1ddbd5dbbb..829f90058811 100644 --- a/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js +++ b/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js @@ -31,7 +31,7 @@ describe('static config validation', () => { ], }; - it.only('should not throw if no errors', () => { + it('should not throw if no errors', () => { expect(() => { validateConfig(validConfig); }).not.toThrowError(); @@ -428,85 +428,84 @@ describe('static config validation', () => { }).not.toThrow(); }); }); + + describe('nested validation', () => { + const { getWidgets } = require('../../lib/registry'); + getWidgets.mockImplementation(() => [ + { + name: 'relation', + schema: { + properties: { + search_fields: { type: 'array', items: { type: 'string' } }, + display_fields: { type: 'array', items: { type: 'string' } }, + }, + }, + }, + ]); + + it('should throw if nested relation display_fields and search_fields are not arrays', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [ + { + fields: [ + { name: 'title', label: 'title', widget: 'string' }, + { + name: 'object', + label: 'Object', + widget: 'object', + fields: [ + { name: 'title', label: 'title', widget: 'string' }, + { + name: 'relation', + label: 'relation', + widget: 'relation', + display_fields: 'title', + search_fields: 'title', + }, + ], + }, + ], + }, + ], + }), + ); + }).toThrowError( + "'collections[0].fields[1].fields[1].search_fields' must be array\n'collections[0].fields[1].fields[1].display_fields' must be array", + ); + }); + + it('should not throw if nested relation display_fields and search_fields are arrays', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [ + { + fields: [ + { name: 'title', label: 'title', widget: 'string' }, + { + name: 'object', + label: 'Object', + widget: 'object', + fields: [ + { name: 'title', label: 'title', widget: 'string' }, + { + name: 'relation', + label: 'relation', + widget: 'relation', + display_fields: ['title'], + search_fields: ['title'], + }, + ], + }, + ], + }, + ], + }), + ); + }).not.toThrow(); + }); + }); }); -}); - - -// describe('nested validation', () => { -// const { getWidgets } = require('../../lib/registry'); -// getWidgets.mockImplementation(() => [ -// { -// name: 'relation', -// schema: { -// properties: { -// search_fields: { type: 'array', items: { type: 'string' } }, -// display_fields: { type: 'array', items: { type: 'string' } }, -// }, -// }, -// }, -// ]); - -// it('should throw if nested relation display_fields and search_fields are not arrays', () => { -// expect(() => { -// validateConfig( -// merge({}, validConfig, { -// collections: [ -// { -// fields: [ -// { name: 'title', label: 'title', widget: 'string' }, -// { -// name: 'object', -// label: 'Object', -// widget: 'object', -// fields: [ -// { name: 'title', label: 'title', widget: 'string' }, -// { -// name: 'relation', -// label: 'relation', -// widget: 'relation', -// display_fields: 'title', -// search_fields: 'title', -// }, -// ], -// }, -// ], -// }, -// ], -// }), -// ); -// }).toThrowError( -// "'collections[0].fields[1].fields[1].search_fields' must be array\n'collections[0].fields[1].fields[1].display_fields' must be array", -// ); -// }); - -// it('should not throw if nested relation display_fields and search_fields are arrays', () => { -// expect(() => { -// validateConfig( -// merge({}, validConfig, { -// collections: [ -// { -// fields: [ -// { name: 'title', label: 'title', widget: 'string' }, -// { -// name: 'object', -// label: 'Object', -// widget: 'object', -// fields: [ -// { name: 'title', label: 'title', widget: 'string' }, -// { -// name: 'relation', -// label: 'relation', -// widget: 'relation', -// display_fields: ['title'], -// search_fields: ['title'], -// }, -// ], -// }, -// ], -// }, -// ], -// }), -// ); -// }).not.toThrow(); -// }); -// }); \ No newline at end of file +}); \ No newline at end of file From 33c6e034b082527f629a02f287dde75f4401192b Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Thu, 6 Jan 2022 09:19:53 -0800 Subject: [PATCH 11/20] chore(csp): fix indentation --- .../constants/__tests__/configSchema.spec.js | 144 +++++++++--------- 1 file changed, 72 insertions(+), 72 deletions(-) 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 829f90058811..e61493997994 100644 --- a/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js +++ b/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js @@ -4,7 +4,7 @@ import { validateConfig } from '../configSchema'; jest.mock('../../lib/registry'); -describe('static config validation', () => { +describe('config validation', () => { /** * Suppress error logging to reduce noise during testing. Jest will still * log test failures and associated errors as expected. @@ -430,82 +430,82 @@ describe('static config validation', () => { }); describe('nested validation', () => { - const { getWidgets } = require('../../lib/registry'); - getWidgets.mockImplementation(() => [ - { - name: 'relation', - schema: { - properties: { - search_fields: { type: 'array', items: { type: 'string' } }, - display_fields: { type: 'array', items: { type: 'string' } }, + const { getWidgets } = require('../../lib/registry'); + getWidgets.mockImplementation(() => [ + { + name: 'relation', + schema: { + properties: { + search_fields: { type: 'array', items: { type: 'string' } }, + display_fields: { type: 'array', items: { type: 'string' } }, + }, }, }, - }, - ]); + ]); - it('should throw if nested relation display_fields and search_fields are not arrays', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - collections: [ - { - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { - name: 'object', - label: 'Object', - widget: 'object', - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { - name: 'relation', - label: 'relation', - widget: 'relation', - display_fields: 'title', - search_fields: 'title', - }, - ], - }, - ], - }, - ], - }), + it('should throw if nested relation display_fields and search_fields are not arrays', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [ + { + fields: [ + { name: 'title', label: 'title', widget: 'string' }, + { + name: 'object', + label: 'Object', + widget: 'object', + fields: [ + { name: 'title', label: 'title', widget: 'string' }, + { + name: 'relation', + label: 'relation', + widget: 'relation', + display_fields: 'title', + search_fields: 'title', + }, + ], + }, + ], + }, + ], + }), + ); + }).toThrowError( + "'collections[0].fields[1].fields[1].search_fields' must be array\n'collections[0].fields[1].fields[1].display_fields' must be array", ); - }).toThrowError( - "'collections[0].fields[1].fields[1].search_fields' must be array\n'collections[0].fields[1].fields[1].display_fields' must be array", - ); - }); + }); - it('should not throw if nested relation display_fields and search_fields are arrays', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - collections: [ - { - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { - name: 'object', - label: 'Object', - widget: 'object', - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { - name: 'relation', - label: 'relation', - widget: 'relation', - display_fields: ['title'], - search_fields: ['title'], - }, - ], - }, - ], - }, - ], - }), - ); - }).not.toThrow(); + it('should not throw if nested relation display_fields and search_fields are arrays', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [ + { + fields: [ + { name: 'title', label: 'title', widget: 'string' }, + { + name: 'object', + label: 'Object', + widget: 'object', + fields: [ + { name: 'title', label: 'title', widget: 'string' }, + { + name: 'relation', + label: 'relation', + widget: 'relation', + display_fields: ['title'], + search_fields: ['title'], + }, + ], + }, + ], + }, + ], + }), + ); + }).not.toThrow(); + }); }); }); - }); }); \ No newline at end of file From a6b93a7f0127771f2a1028e4b0118a355b2554dd Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Thu, 6 Jan 2022 13:30:18 -0800 Subject: [PATCH 12/20] fix(csp): fixed instanceof validation tests --- packages/netlify-cms-core/package.json | 2 +- .../constants/__tests__/configSchema.spec.js | 7 +- .../src/constants/staticValidateConfig.js | 18022 +--------------- .../validation-rules/instanceof.js | 26 + 4 files changed, 34 insertions(+), 18023 deletions(-) create mode 100644 packages/netlify-cms-core/validation-rules/instanceof.js diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index 6b1c55164b49..30543585d92b 100644 --- a/packages/netlify-cms-core/package.json +++ b/packages/netlify-cms-core/package.json @@ -17,7 +17,7 @@ "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\"", - "write-validate-schema": "NODE_ENV=production ajv --strict=false -c ajv-keywords/dist/keywords/select compile --all-errors --data -s ./config.schema.json -o ./src/constants/staticValidateConfig.js" + "write-validate-schema": "NODE_ENV=production ajv --strict=false -c ajv-keywords/dist/keywords/select -c ./validation-rules/instanceof.js compile --all-errors --data -s ./config.schema.json -o ./src/constants/staticValidateConfig.js" }, "keywords": [ "netlify", 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 e61493997994..530ac07acc9a 100644 --- a/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js +++ b/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js @@ -16,6 +16,11 @@ describe('config validation', () => { const { getWidgets } = require('../../lib/registry'); getWidgets.mockImplementation(() => [{}]); + describe('static validation', validationTests) + +}); + +function validationTests() { describe('validateConfig', () => { const validConfig = { foo: 'bar', @@ -508,4 +513,4 @@ describe('config validation', () => { }); }); }); -}); \ No newline at end of file +} \ No newline at end of file diff --git a/packages/netlify-cms-core/src/constants/staticValidateConfig.js b/packages/netlify-cms-core/src/constants/staticValidateConfig.js index d7d68878633c..c445b53a9820 100644 --- a/packages/netlify-cms-core/src/constants/staticValidateConfig.js +++ b/packages/netlify-cms-core/src/constants/staticValidateConfig.js @@ -1,18021 +1 @@ -'use strict'; -module.exports = validate24; -module.exports.default = validate24; -const schema40 = { - $id: 'https://netlify-cms/object.json', - 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_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', - type: 'array', - minItems: 1, - items: { - $id: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', - 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' }, { instanceof: 'RegExp' }] }, - { type: 'string' }, - ], - }, - field: { $ref: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, - fields: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, - types: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, - }, - select: { $data: '0/widget' }, - selectCases: { - unknown: {}, - string: {}, - number: { - properties: { - step: { type: 'number' }, - value_type: { type: 'string' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - text: {}, - image: { properties: { allow_multiple: { type: 'boolean' } } }, - file: { properties: { allow_multiple: { type: 'boolean' } } }, - select: { - properties: { - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - options: { - type: 'array', - items: { - oneOf: [ - { type: 'string' }, - { type: 'number' }, - { - type: 'object', - properties: { - label: { type: 'string' }, - value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, - }, - required: ['label', 'value'], - }, - ], - }, - }, - }, - required: ['options'], - }, - markdown: { - properties: { - minimal: { type: 'boolean' }, - buttons: { - type: 'array', - items: { - type: 'string', - enum: [ - 'bold', - 'italic', - 'code', - 'link', - 'heading-one', - 'heading-two', - 'heading-three', - 'heading-four', - 'heading-five', - 'heading-six', - 'quote', - 'bulleted-list', - 'numbered-list', - ], - }, - }, - editor_components: { type: 'array', items: { type: 'string' } }, - modes: { - type: 'array', - items: { type: 'string', enum: ['raw', 'rich_text'] }, - minItems: 1, - }, - }, - }, - list: { - properties: { - allow_add: { type: 'boolean' }, - collapsed: { type: 'boolean' }, - summary: { type: 'string' }, - minimize_collapsed: { type: 'boolean' }, - label_singular: { type: 'string' }, - i18n: { type: 'boolean' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - object: { - properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } }, - }, - relation: { - properties: { - collection: { type: 'string' }, - value_field: { type: 'string' }, - search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - file: { type: 'string' }, - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - options_length: { type: 'integer' }, - }, - oneOf: [ - { required: ['collection', 'value_field', 'search_fields'] }, - { required: ['collection', 'valueField', 'searchFields'] }, - ], - }, - boolean: {}, - map: { - properties: { - decimals: { type: 'integer' }, - type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, - }, - }, - date: {}, - datetime: { - properties: { - format: { type: 'string' }, - date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - picker_utc: { type: 'boolean' }, - }, - }, - code: { - properties: { - default_language: { type: 'string' }, - allow_language_selection: { type: 'boolean' }, - output_code_only: { type: 'boolean' }, - keys: { - type: 'object', - properties: { code: { type: 'string' }, lang: { type: 'string' } }, - }, - }, - }, - color: {}, - }, - required: ['name'], - }, - uniqueItemProperties: ['name'], - }, - }, - required: ['name', 'label', 'file', 'fields'], - }, - uniqueItemProperties: ['name'], - }, - 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_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', - type: 'array', - minItems: 1, - items: { - $id: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', - 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' }, { instanceof: 'RegExp' }] }, - { type: 'string' }, - ], - }, - field: { $ref: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, - fields: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, - types: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, - }, - select: { $data: '0/widget' }, - selectCases: { - unknown: {}, - string: {}, - number: { - properties: { - step: { type: 'number' }, - value_type: { type: 'string' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - text: {}, - image: { properties: { allow_multiple: { type: 'boolean' } } }, - file: { properties: { allow_multiple: { type: 'boolean' } } }, - select: { - properties: { - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - options: { - type: 'array', - items: { - oneOf: [ - { type: 'string' }, - { type: 'number' }, - { - type: 'object', - properties: { - label: { type: 'string' }, - value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, - }, - required: ['label', 'value'], - }, - ], - }, - }, - }, - required: ['options'], - }, - markdown: { - properties: { - minimal: { type: 'boolean' }, - buttons: { - type: 'array', - items: { - type: 'string', - enum: [ - 'bold', - 'italic', - 'code', - 'link', - 'heading-one', - 'heading-two', - 'heading-three', - 'heading-four', - 'heading-five', - 'heading-six', - 'quote', - 'bulleted-list', - 'numbered-list', - ], - }, - }, - editor_components: { type: 'array', items: { type: 'string' } }, - modes: { - type: 'array', - items: { type: 'string', enum: ['raw', 'rich_text'] }, - minItems: 1, - }, - }, - }, - list: { - properties: { - allow_add: { type: 'boolean' }, - collapsed: { type: 'boolean' }, - summary: { type: 'string' }, - minimize_collapsed: { type: 'boolean' }, - label_singular: { type: 'string' }, - i18n: { type: 'boolean' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - object: { - properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } }, - }, - relation: { - properties: { - collection: { type: 'string' }, - value_field: { type: 'string' }, - search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - file: { type: 'string' }, - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - options_length: { type: 'integer' }, - }, - oneOf: [ - { required: ['collection', 'value_field', 'search_fields'] }, - { required: ['collection', 'valueField', 'searchFields'] }, - ], - }, - boolean: {}, - map: { - properties: { - decimals: { type: 'integer' }, - type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, - }, - }, - date: {}, - datetime: { - properties: { - format: { type: 'string' }, - date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - picker_utc: { type: 'boolean' }, - }, - }, - code: { - properties: { - default_language: { type: 'string' }, - allow_language_selection: { type: 'boolean' }, - output_code_only: { type: 'boolean' }, - keys: { - type: 'object', - properties: { code: { type: 'string' }, lang: { type: 'string' } }, - }, - }, - }, - color: {}, - }, - required: ['name'], - }, - uniqueItemProperties: ['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'], - }, - }, - }, - uniqueItemProperties: ['name'], - }, - 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 func9 = require('ajv/dist/runtime/ucs2length').default; -const pattern0 = new RegExp('^[a-zA-Z-_]+$', 'u'); -const schema41 = { - $id: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', - 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], - }, - field: { $ref: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, - fields: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, - types: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, - }, - select: { $data: '0/widget' }, - selectCases: { - unknown: {}, - string: {}, - number: { - properties: { - step: { type: 'number' }, - value_type: { type: 'string' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - text: {}, - image: { properties: { allow_multiple: { type: 'boolean' } } }, - file: { properties: { allow_multiple: { type: 'boolean' } } }, - select: { - properties: { - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - options: { - type: 'array', - items: { - oneOf: [ - { type: 'string' }, - { type: 'number' }, - { - type: 'object', - properties: { - label: { type: 'string' }, - value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, - }, - required: ['label', 'value'], - }, - ], - }, - }, - }, - required: ['options'], - }, - markdown: { - properties: { - minimal: { type: 'boolean' }, - buttons: { - type: 'array', - items: { - type: 'string', - enum: [ - 'bold', - 'italic', - 'code', - 'link', - 'heading-one', - 'heading-two', - 'heading-three', - 'heading-four', - 'heading-five', - 'heading-six', - 'quote', - 'bulleted-list', - 'numbered-list', - ], - }, - }, - editor_components: { type: 'array', items: { type: 'string' } }, - modes: { - type: 'array', - items: { type: 'string', enum: ['raw', 'rich_text'] }, - minItems: 1, - }, - }, - }, - list: { - properties: { - allow_add: { type: 'boolean' }, - collapsed: { type: 'boolean' }, - summary: { type: 'string' }, - minimize_collapsed: { type: 'boolean' }, - label_singular: { type: 'string' }, - i18n: { type: 'boolean' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, - relation: { - properties: { - collection: { type: 'string' }, - value_field: { type: 'string' }, - search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - file: { type: 'string' }, - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - options_length: { type: 'integer' }, - }, - oneOf: [ - { required: ['collection', 'value_field', 'search_fields'] }, - { required: ['collection', 'valueField', 'searchFields'] }, - ], - }, - boolean: {}, - map: { - properties: { - decimals: { type: 'integer' }, - type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, - }, - }, - date: {}, - datetime: { - properties: { - format: { type: 'string' }, - date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - picker_utc: { type: 'boolean' }, - }, - }, - code: { - properties: { - default_language: { type: 'string' }, - allow_language_selection: { type: 'boolean' }, - output_code_only: { type: 'boolean' }, - keys: { - type: 'object', - properties: { code: { type: 'string' }, lang: { type: 'string' } }, - }, - }, - }, - color: {}, - }, - required: ['name'], -}; -const wrapper0 = { validate: validate25 }; -const schema42 = { - $id: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', - type: 'array', - minItems: 1, - items: { - $id: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', - 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], - }, - field: { $ref: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, - fields: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, - types: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, - }, - select: { $data: '0/widget' }, - selectCases: { - unknown: {}, - string: {}, - number: { - properties: { - step: { type: 'number' }, - value_type: { type: 'string' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - text: {}, - image: { properties: { allow_multiple: { type: 'boolean' } } }, - file: { properties: { allow_multiple: { type: 'boolean' } } }, - select: { - properties: { - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - options: { - type: 'array', - items: { - oneOf: [ - { type: 'string' }, - { type: 'number' }, - { - type: 'object', - properties: { - label: { type: 'string' }, - value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, - }, - required: ['label', 'value'], - }, - ], - }, - }, - }, - required: ['options'], - }, - markdown: { - properties: { - minimal: { type: 'boolean' }, - buttons: { - type: 'array', - items: { - type: 'string', - enum: [ - 'bold', - 'italic', - 'code', - 'link', - 'heading-one', - 'heading-two', - 'heading-three', - 'heading-four', - 'heading-five', - 'heading-six', - 'quote', - 'bulleted-list', - 'numbered-list', - ], - }, - }, - editor_components: { type: 'array', items: { type: 'string' } }, - modes: { - type: 'array', - items: { type: 'string', enum: ['raw', 'rich_text'] }, - minItems: 1, - }, - }, - }, - list: { - properties: { - allow_add: { type: 'boolean' }, - collapsed: { type: 'boolean' }, - summary: { type: 'string' }, - minimize_collapsed: { type: 'boolean' }, - label_singular: { type: 'string' }, - i18n: { type: 'boolean' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, - relation: { - properties: { - collection: { type: 'string' }, - value_field: { type: 'string' }, - search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - file: { type: 'string' }, - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - options_length: { type: 'integer' }, - }, - oneOf: [ - { required: ['collection', 'value_field', 'search_fields'] }, - { required: ['collection', 'valueField', 'searchFields'] }, - ], - }, - boolean: {}, - map: { - properties: { - decimals: { type: 'integer' }, - type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, - }, - }, - date: {}, - datetime: { - properties: { - format: { type: 'string' }, - date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - picker_utc: { type: 'boolean' }, - }, - }, - code: { - properties: { - default_language: { type: 'string' }, - allow_language_selection: { type: 'boolean' }, - output_code_only: { type: 'boolean' }, - keys: { - type: 'object', - properties: { code: { type: 'string' }, lang: { type: 'string' } }, - }, - }, - }, - color: {}, - }, - required: ['name'], - }, - uniqueItemProperties: ['name'], -}; -const wrapper2 = { validate: validate26 }; -function validate26( - data, - { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, -) { - /*# sourceURL="fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */ 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 < len0; i0++) { - let data0 = data[i0]; - const vSchema0 = data0 && data0.widget; - if (!(vSchema0 === undefined)) { - if ( - typeof vSchema0 !== 'string' && - !(typeof vSchema0 == 'number') && - typeof vSchema0 !== 'boolean' && - vSchema0 !== null - ) { - const err1 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/select', - keyword: 'select', - params: {}, - message: '"select" keyword must be string,number,boolean,null ($data)', - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } else { - let valid2 = true; - const value0 = vSchema0 === null ? 'null' : vSchema0; - if ('' + value0 == 'unknown') { - var _valid0 = true; - valid2 = _valid0; - } else if ('' + value0 == 'string') { - var _valid0 = true; - valid2 = _valid0; - } else if ('' + value0 == 'number') { - const _errs3 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.step !== undefined) { - if (!(typeof data0.step == 'number')) { - const err2 = { - instancePath: instancePath + '/' + i0 + '/step', - schemaPath: '#/items/selectCases/number/properties/step/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - } - } - if (data0.value_type !== undefined) { - if (typeof data0.value_type !== 'string') { - const err3 = { - instancePath: instancePath + '/' + i0 + '/value_type', - schemaPath: '#/items/selectCases/number/properties/value_type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - } - } - if (data0.min !== undefined) { - if (!(typeof data0.min == 'number')) { - const err4 = { - instancePath: instancePath + '/' + i0 + '/min', - schemaPath: '#/items/selectCases/number/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); - } - errors++; - } - } - if (data0.max !== undefined) { - if (!(typeof data0.max == 'number')) { - const err5 = { - instancePath: instancePath + '/' + i0 + '/max', - schemaPath: '#/items/selectCases/number/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); - } - errors++; - } - } - } - var _valid0 = _errs3 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'text') { - var _valid0 = true; - valid2 = _valid0; - } else if ('' + value0 == 'image') { - const _errs12 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.allow_multiple !== undefined) { - if (typeof data0.allow_multiple !== 'boolean') { - const err6 = { - instancePath: instancePath + '/' + i0 + '/allow_multiple', - schemaPath: '#/items/selectCases/image/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); - } - errors++; - } - } - } - var _valid0 = _errs12 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'file') { - const _errs15 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.allow_multiple !== undefined) { - if (typeof data0.allow_multiple !== 'boolean') { - const err7 = { - instancePath: instancePath + '/' + i0 + '/allow_multiple', - schemaPath: '#/items/selectCases/file/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); - } - errors++; - } - } - } - var _valid0 = _errs15 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'select') { - const _errs18 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.options === undefined) { - const err8 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/select/required', - keyword: 'required', - params: { missingProperty: 'options' }, - message: "must have required property '" + 'options' + "'", - }; - if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); - } - errors++; - } - if (data0.multiple !== undefined) { - if (typeof data0.multiple !== 'boolean') { - const err9 = { - instancePath: instancePath + '/' + i0 + '/multiple', - schemaPath: '#/items/selectCases/select/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err9]; - } else { - vErrors.push(err9); - } - errors++; - } - } - if (data0.min !== undefined) { - let data8 = data0.min; - if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { - const err10 = { - instancePath: instancePath + '/' + i0 + '/min', - schemaPath: '#/items/selectCases/select/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err10]; - } else { - vErrors.push(err10); - } - errors++; - } - } - if (data0.max !== undefined) { - let data9 = data0.max; - if (!(typeof data9 == 'number' && !(data9 % 1) && !isNaN(data9))) { - const err11 = { - instancePath: instancePath + '/' + i0 + '/max', - schemaPath: '#/items/selectCases/select/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err11]; - } else { - vErrors.push(err11); - } - errors++; - } - } - if (data0.options !== undefined) { - let data10 = data0.options; - if (Array.isArray(data10)) { - const len1 = data10.length; - for (let i1 = 0; i1 < len1; i1++) { - let data11 = data10[i1]; - const _errs28 = errors; - let valid9 = false; - let passing0 = null; - const _errs29 = errors; - if (typeof data11 !== 'string') { - const err12 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err12]; - } else { - vErrors.push(err12); - } - errors++; - } - var _valid1 = _errs29 === errors; - if (_valid1) { - valid9 = true; - passing0 = 0; - } - const _errs31 = errors; - if (!(typeof data11 == 'number')) { - const err13 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err13]; - } else { - vErrors.push(err13); - } - errors++; - } - var _valid1 = _errs31 === errors; - if (_valid1 && valid9) { - valid9 = false; - passing0 = [passing0, 1]; - } else { - if (_valid1) { - valid9 = true; - passing0 = 1; - } - const _errs33 = errors; - if (data11 && typeof data11 == 'object' && !Array.isArray(data11)) { - if (data11.label === undefined) { - const err14 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'label' }, - message: "must have required property '" + 'label' + "'", - }; - if (vErrors === null) { - vErrors = [err14]; - } else { - vErrors.push(err14); - } - errors++; - } - if (data11.value === undefined) { - const err15 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'value' }, - message: "must have required property '" + 'value' + "'", - }; - if (vErrors === null) { - vErrors = [err15]; - } else { - vErrors.push(err15); - } - errors++; - } - if (data11.label !== undefined) { - if (typeof data11.label !== 'string') { - const err16 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/label', - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err16]; - } else { - vErrors.push(err16); - } - errors++; - } - } - if (data11.value !== undefined) { - let data13 = data11.value; - const _errs38 = errors; - let valid11 = false; - let passing1 = null; - const _errs39 = errors; - if (typeof data13 !== 'string') { - const err17 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err17]; - } else { - vErrors.push(err17); - } - errors++; - } - var _valid2 = _errs39 === errors; - if (_valid2) { - valid11 = true; - passing1 = 0; - } - const _errs41 = errors; - if (!(typeof data13 == 'number')) { - const err18 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err18]; - } else { - vErrors.push(err18); - } - errors++; - } - var _valid2 = _errs41 === errors; - if (_valid2 && valid11) { - valid11 = false; - passing1 = [passing1, 1]; - } else { - if (_valid2) { - valid11 = true; - passing1 = 1; - } - } - if (!valid11) { - const err19 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs38; - if (vErrors !== null) { - if (_errs38) { - vErrors.length = _errs38; - } else { - vErrors = null; - } - } - } - } - } else { - const err20 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err20]; - } else { - vErrors.push(err20); - } - errors++; - } - var _valid1 = _errs33 === errors; - if (_valid1 && valid9) { - valid9 = false; - passing0 = [passing0, 2]; - } else { - if (_valid1) { - valid9 = true; - passing0 = 2; - } - } - } - if (!valid9) { - const err21 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: '#/items/selectCases/select/properties/options/items/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing0 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err21]; - } else { - vErrors.push(err21); - } - errors++; - } else { - errors = _errs28; - if (vErrors !== null) { - if (_errs28) { - vErrors.length = _errs28; - } else { - vErrors = null; - } - } - } - } - } else { - const err22 = { - instancePath: instancePath + '/' + i0 + '/options', - schemaPath: '#/items/selectCases/select/properties/options/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err22]; - } else { - vErrors.push(err22); - } - errors++; - } - } - } - var _valid0 = _errs18 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'markdown') { - const _errs43 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.minimal !== undefined) { - if (typeof data0.minimal !== 'boolean') { - const err23 = { - instancePath: instancePath + '/' + i0 + '/minimal', - schemaPath: '#/items/selectCases/markdown/properties/minimal/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err23]; - } else { - vErrors.push(err23); - } - errors++; - } - } - if (data0.buttons !== undefined) { - let data15 = data0.buttons; - if (Array.isArray(data15)) { - const len2 = data15.length; - for (let i2 = 0; i2 < len2; i2++) { - let data16 = data15[i2]; - if (typeof data16 !== 'string') { - const err24 = { - instancePath: instancePath + '/' + i0 + '/buttons/' + i2, - schemaPath: '#/items/selectCases/markdown/properties/buttons/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err24]; - } else { - vErrors.push(err24); - } - errors++; - } - if ( - !( - data16 === 'bold' || - data16 === 'italic' || - data16 === 'code' || - data16 === 'link' || - data16 === 'heading-one' || - data16 === 'heading-two' || - data16 === 'heading-three' || - data16 === 'heading-four' || - data16 === 'heading-five' || - data16 === 'heading-six' || - data16 === 'quote' || - data16 === 'bulleted-list' || - data16 === 'numbered-list' - ) - ) { - const err25 = { - instancePath: instancePath + '/' + i0 + '/buttons/' + i2, - schemaPath: '#/items/selectCases/markdown/properties/buttons/items/enum', - keyword: 'enum', - params: { - allowedValues: - schema42.items.selectCases.markdown.properties.buttons.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err25]; - } else { - vErrors.push(err25); - } - errors++; - } - } - } else { - const err26 = { - instancePath: instancePath + '/' + i0 + '/buttons', - schemaPath: '#/items/selectCases/markdown/properties/buttons/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err26]; - } else { - vErrors.push(err26); - } - errors++; - } - } - if (data0.editor_components !== undefined) { - let data17 = data0.editor_components; - if (Array.isArray(data17)) { - const len3 = data17.length; - for (let i3 = 0; i3 < len3; i3++) { - if (typeof data17[i3] !== 'string') { - const err27 = { - instancePath: instancePath + '/' + i0 + '/editor_components/' + i3, - schemaPath: - '#/items/selectCases/markdown/properties/editor_components/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err27]; - } else { - vErrors.push(err27); - } - errors++; - } - } - } else { - const err28 = { - instancePath: instancePath + '/' + i0 + '/editor_components', - schemaPath: '#/items/selectCases/markdown/properties/editor_components/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err28]; - } else { - vErrors.push(err28); - } - errors++; - } - } - if (data0.modes !== undefined) { - let data19 = data0.modes; - if (Array.isArray(data19)) { - if (data19.length < 1) { - const err29 = { - instancePath: instancePath + '/' + i0 + '/modes', - schemaPath: '#/items/selectCases/markdown/properties/modes/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err29]; - } else { - vErrors.push(err29); - } - errors++; - } - const len4 = data19.length; - for (let i4 = 0; i4 < len4; i4++) { - let data20 = data19[i4]; - if (typeof data20 !== 'string') { - const err30 = { - instancePath: instancePath + '/' + i0 + '/modes/' + i4, - schemaPath: '#/items/selectCases/markdown/properties/modes/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err30]; - } else { - vErrors.push(err30); - } - errors++; - } - if (!(data20 === 'raw' || data20 === 'rich_text')) { - const err31 = { - instancePath: instancePath + '/' + i0 + '/modes/' + i4, - schemaPath: '#/items/selectCases/markdown/properties/modes/items/enum', - keyword: 'enum', - params: { - allowedValues: - schema42.items.selectCases.markdown.properties.modes.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err31]; - } else { - vErrors.push(err31); - } - errors++; - } - } - } else { - const err32 = { - instancePath: instancePath + '/' + i0 + '/modes', - schemaPath: '#/items/selectCases/markdown/properties/modes/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err32]; - } else { - vErrors.push(err32); - } - errors++; - } - } - } - var _valid0 = _errs43 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'list') { - const _errs58 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.allow_add !== undefined) { - if (typeof data0.allow_add !== 'boolean') { - const err33 = { - instancePath: instancePath + '/' + i0 + '/allow_add', - schemaPath: '#/items/selectCases/list/properties/allow_add/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err33]; - } else { - vErrors.push(err33); - } - errors++; - } - } - if (data0.collapsed !== undefined) { - if (typeof data0.collapsed !== 'boolean') { - const err34 = { - instancePath: instancePath + '/' + i0 + '/collapsed', - schemaPath: '#/items/selectCases/list/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err34]; - } else { - vErrors.push(err34); - } - errors++; - } - } - if (data0.summary !== undefined) { - if (typeof data0.summary !== 'string') { - const err35 = { - instancePath: instancePath + '/' + i0 + '/summary', - schemaPath: '#/items/selectCases/list/properties/summary/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err35]; - } else { - vErrors.push(err35); - } - errors++; - } - } - if (data0.minimize_collapsed !== undefined) { - if (typeof data0.minimize_collapsed !== 'boolean') { - const err36 = { - instancePath: instancePath + '/' + i0 + '/minimize_collapsed', - schemaPath: '#/items/selectCases/list/properties/minimize_collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err36]; - } else { - vErrors.push(err36); - } - errors++; - } - } - if (data0.label_singular !== undefined) { - if (typeof data0.label_singular !== 'string') { - const err37 = { - instancePath: instancePath + '/' + i0 + '/label_singular', - schemaPath: '#/items/selectCases/list/properties/label_singular/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err37]; - } else { - vErrors.push(err37); - } - errors++; - } - } - if (data0.i18n !== undefined) { - if (typeof data0.i18n !== 'boolean') { - const err38 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/selectCases/list/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err38]; - } else { - vErrors.push(err38); - } - errors++; - } - } - if (data0.min !== undefined) { - if (!(typeof data0.min == 'number')) { - const err39 = { - instancePath: instancePath + '/' + i0 + '/min', - schemaPath: '#/items/selectCases/list/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err39]; - } else { - vErrors.push(err39); - } - errors++; - } - } - if (data0.max !== undefined) { - if (!(typeof data0.max == 'number')) { - const err40 = { - instancePath: instancePath + '/' + i0 + '/max', - schemaPath: '#/items/selectCases/list/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err40]; - } else { - vErrors.push(err40); - } - errors++; - } - } - } - var _valid0 = _errs58 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'object') { - const _errs75 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.collapsed !== undefined) { - if (typeof data0.collapsed !== 'boolean') { - const err41 = { - instancePath: instancePath + '/' + i0 + '/collapsed', - schemaPath: '#/items/selectCases/object/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err41]; - } else { - vErrors.push(err41); - } - errors++; - } - } - if (data0.i18n !== undefined) { - if (typeof data0.i18n !== 'boolean') { - const err42 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/selectCases/object/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err42]; - } else { - vErrors.push(err42); - } - errors++; - } - } - } - var _valid0 = _errs75 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'relation') { - const _errs80 = errors; - const _errs81 = errors; - let valid21 = false; - let passing2 = null; - const _errs82 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.collection === undefined) { - const err43 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err43]; - } else { - vErrors.push(err43); - } - errors++; - } - if (data0.value_field === undefined) { - const err44 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'value_field' }, - message: "must have required property '" + 'value_field' + "'", - }; - if (vErrors === null) { - vErrors = [err44]; - } else { - vErrors.push(err44); - } - errors++; - } - if (data0.search_fields === undefined) { - const err45 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'search_fields' }, - message: "must have required property '" + 'search_fields' + "'", - }; - if (vErrors === null) { - vErrors = [err45]; - } else { - vErrors.push(err45); - } - errors++; - } - } - var _valid3 = _errs82 === errors; - if (_valid3) { - valid21 = true; - passing2 = 0; - } - const _errs83 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.collection === undefined) { - const err46 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err46]; - } else { - vErrors.push(err46); - } - errors++; - } - if (data0.valueField === undefined) { - const err47 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'valueField' }, - message: "must have required property '" + 'valueField' + "'", - }; - if (vErrors === null) { - vErrors = [err47]; - } else { - vErrors.push(err47); - } - errors++; - } - if (data0.searchFields === undefined) { - const err48 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'searchFields' }, - message: "must have required property '" + 'searchFields' + "'", - }; - if (vErrors === null) { - vErrors = [err48]; - } else { - vErrors.push(err48); - } - errors++; - } - } - var _valid3 = _errs83 === errors; - if (_valid3 && valid21) { - valid21 = false; - passing2 = [passing2, 1]; - } else { - if (_valid3) { - valid21 = true; - passing2 = 1; - } - } - if (!valid21) { - const err49 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing2 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err49]; - } else { - vErrors.push(err49); - } - errors++; - } else { - errors = _errs81; - if (vErrors !== null) { - if (_errs81) { - vErrors.length = _errs81; - } else { - vErrors = null; - } - } - } - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.collection !== undefined) { - if (typeof data0.collection !== 'string') { - const err50 = { - instancePath: instancePath + '/' + i0 + '/collection', - schemaPath: '#/items/selectCases/relation/properties/collection/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err50]; - } else { - vErrors.push(err50); - } - errors++; - } - } - if (data0.value_field !== undefined) { - if (typeof data0.value_field !== 'string') { - const err51 = { - instancePath: instancePath + '/' + i0 + '/value_field', - schemaPath: '#/items/selectCases/relation/properties/value_field/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err51]; - } else { - vErrors.push(err51); - } - errors++; - } - } - if (data0.search_fields !== undefined) { - let data33 = data0.search_fields; - if (Array.isArray(data33)) { - if (data33.length < 1) { - const err52 = { - instancePath: instancePath + '/' + i0 + '/search_fields', - schemaPath: '#/items/selectCases/relation/properties/search_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err52]; - } else { - vErrors.push(err52); - } - errors++; - } - const len5 = data33.length; - for (let i5 = 0; i5 < len5; i5++) { - if (typeof data33[i5] !== 'string') { - const err53 = { - instancePath: instancePath + '/' + i0 + '/search_fields/' + i5, - schemaPath: - '#/items/selectCases/relation/properties/search_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err53]; - } else { - vErrors.push(err53); - } - errors++; - } - } - } else { - const err54 = { - instancePath: instancePath + '/' + i0 + '/search_fields', - schemaPath: '#/items/selectCases/relation/properties/search_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err54]; - } else { - vErrors.push(err54); - } - errors++; - } - } - if (data0.file !== undefined) { - if (typeof data0.file !== 'string') { - const err55 = { - instancePath: instancePath + '/' + i0 + '/file', - schemaPath: '#/items/selectCases/relation/properties/file/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err55]; - } else { - vErrors.push(err55); - } - errors++; - } - } - if (data0.multiple !== undefined) { - if (typeof data0.multiple !== 'boolean') { - const err56 = { - instancePath: instancePath + '/' + i0 + '/multiple', - schemaPath: '#/items/selectCases/relation/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err56]; - } else { - vErrors.push(err56); - } - errors++; - } - } - if (data0.min !== undefined) { - let data37 = data0.min; - if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { - const err57 = { - instancePath: instancePath + '/' + i0 + '/min', - schemaPath: '#/items/selectCases/relation/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err57]; - } else { - vErrors.push(err57); - } - errors++; - } - } - if (data0.max !== undefined) { - let data38 = data0.max; - if (!(typeof data38 == 'number' && !(data38 % 1) && !isNaN(data38))) { - const err58 = { - instancePath: instancePath + '/' + i0 + '/max', - schemaPath: '#/items/selectCases/relation/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err58]; - } else { - vErrors.push(err58); - } - errors++; - } - } - if (data0.display_fields !== undefined) { - let data39 = data0.display_fields; - if (Array.isArray(data39)) { - if (data39.length < 1) { - const err59 = { - instancePath: instancePath + '/' + i0 + '/display_fields', - schemaPath: '#/items/selectCases/relation/properties/display_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err59]; - } else { - vErrors.push(err59); - } - errors++; - } - const len6 = data39.length; - for (let i6 = 0; i6 < len6; i6++) { - if (typeof data39[i6] !== 'string') { - const err60 = { - instancePath: instancePath + '/' + i0 + '/display_fields/' + i6, - schemaPath: - '#/items/selectCases/relation/properties/display_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err60]; - } else { - vErrors.push(err60); - } - errors++; - } - } - } else { - const err61 = { - instancePath: instancePath + '/' + i0 + '/display_fields', - schemaPath: '#/items/selectCases/relation/properties/display_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err61]; - } else { - vErrors.push(err61); - } - errors++; - } - } - if (data0.options_length !== undefined) { - let data41 = data0.options_length; - if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { - const err62 = { - instancePath: instancePath + '/' + i0 + '/options_length', - schemaPath: '#/items/selectCases/relation/properties/options_length/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err62]; - } else { - vErrors.push(err62); - } - errors++; - } - } - } - var _valid0 = _errs80 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'boolean') { - var _valid0 = true; - valid2 = _valid0; - } else if ('' + value0 == 'map') { - const _errs106 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.decimals !== undefined) { - let data42 = data0.decimals; - if (!(typeof data42 == 'number' && !(data42 % 1) && !isNaN(data42))) { - const err63 = { - instancePath: instancePath + '/' + i0 + '/decimals', - schemaPath: '#/items/selectCases/map/properties/decimals/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err63]; - } else { - vErrors.push(err63); - } - errors++; - } - } - if (data0.type !== undefined) { - let data43 = data0.type; - if (typeof data43 !== 'string') { - const err64 = { - instancePath: instancePath + '/' + i0 + '/type', - schemaPath: '#/items/selectCases/map/properties/type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err64]; - } else { - vErrors.push(err64); - } - errors++; - } - if (!(data43 === 'Point' || data43 === 'LineString' || data43 === 'Polygon')) { - const err65 = { - instancePath: instancePath + '/' + i0 + '/type', - schemaPath: '#/items/selectCases/map/properties/type/enum', - keyword: 'enum', - params: { allowedValues: schema42.items.selectCases.map.properties.type.enum }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err65]; - } else { - vErrors.push(err65); - } - errors++; - } - } - } - var _valid0 = _errs106 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'date') { - var _valid0 = true; - valid2 = _valid0; - } else if ('' + value0 == 'datetime') { - const _errs111 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.format !== undefined) { - if (typeof data0.format !== 'string') { - const err66 = { - instancePath: instancePath + '/' + i0 + '/format', - schemaPath: '#/items/selectCases/datetime/properties/format/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err66]; - } else { - vErrors.push(err66); - } - errors++; - } - } - if (data0.date_format !== undefined) { - let data45 = data0.date_format; - const _errs115 = errors; - let valid29 = false; - let passing3 = null; - const _errs116 = errors; - if (typeof data45 !== 'string') { - const err67 = { - instancePath: instancePath + '/' + i0 + '/date_format', - schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err67]; - } else { - vErrors.push(err67); - } - errors++; - } - var _valid4 = _errs116 === errors; - if (_valid4) { - valid29 = true; - passing3 = 0; - } - const _errs118 = errors; - if (typeof data45 !== 'boolean') { - const err68 = { - instancePath: instancePath + '/' + i0 + '/date_format', - schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err68]; - } else { - vErrors.push(err68); - } - errors++; - } - var _valid4 = _errs118 === errors; - if (_valid4 && valid29) { - valid29 = false; - passing3 = [passing3, 1]; - } else { - if (_valid4) { - valid29 = true; - passing3 = 1; - } - } - if (!valid29) { - const err69 = { - instancePath: instancePath + '/' + i0 + '/date_format', - schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing3 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err69]; - } else { - vErrors.push(err69); - } - errors++; - } else { - errors = _errs115; - if (vErrors !== null) { - if (_errs115) { - vErrors.length = _errs115; - } else { - vErrors = null; - } - } - } - } - if (data0.time_format !== undefined) { - let data46 = data0.time_format; - const _errs121 = errors; - let valid30 = false; - let passing4 = null; - const _errs122 = errors; - if (typeof data46 !== 'string') { - const err70 = { - instancePath: instancePath + '/' + i0 + '/time_format', - schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err70]; - } else { - vErrors.push(err70); - } - errors++; - } - var _valid5 = _errs122 === errors; - if (_valid5) { - valid30 = true; - passing4 = 0; - } - const _errs124 = errors; - if (typeof data46 !== 'boolean') { - const err71 = { - instancePath: instancePath + '/' + i0 + '/time_format', - schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err71]; - } else { - vErrors.push(err71); - } - errors++; - } - var _valid5 = _errs124 === errors; - if (_valid5 && valid30) { - valid30 = false; - passing4 = [passing4, 1]; - } else { - if (_valid5) { - valid30 = true; - passing4 = 1; - } - } - if (!valid30) { - const err72 = { - instancePath: instancePath + '/' + i0 + '/time_format', - schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing4 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err72]; - } else { - vErrors.push(err72); - } - errors++; - } else { - errors = _errs121; - if (vErrors !== null) { - if (_errs121) { - vErrors.length = _errs121; - } else { - vErrors = null; - } - } - } - } - if (data0.picker_utc !== undefined) { - if (typeof data0.picker_utc !== 'boolean') { - const err73 = { - instancePath: instancePath + '/' + i0 + '/picker_utc', - schemaPath: '#/items/selectCases/datetime/properties/picker_utc/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err73]; - } else { - vErrors.push(err73); - } - errors++; - } - } - } - var _valid0 = _errs111 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'code') { - const _errs128 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.default_language !== undefined) { - if (typeof data0.default_language !== 'string') { - const err74 = { - instancePath: instancePath + '/' + i0 + '/default_language', - schemaPath: '#/items/selectCases/code/properties/default_language/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err74]; - } else { - vErrors.push(err74); - } - errors++; - } - } - if (data0.allow_language_selection !== undefined) { - if (typeof data0.allow_language_selection !== 'boolean') { - const err75 = { - instancePath: instancePath + '/' + i0 + '/allow_language_selection', - schemaPath: '#/items/selectCases/code/properties/allow_language_selection/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err75]; - } else { - vErrors.push(err75); - } - errors++; - } - } - if (data0.output_code_only !== undefined) { - if (typeof data0.output_code_only !== 'boolean') { - const err76 = { - instancePath: instancePath + '/' + i0 + '/output_code_only', - schemaPath: '#/items/selectCases/code/properties/output_code_only/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err76]; - } else { - vErrors.push(err76); - } - errors++; - } - } - if (data0.keys !== undefined) { - let data51 = data0.keys; - if (data51 && typeof data51 == 'object' && !Array.isArray(data51)) { - if (data51.code !== undefined) { - if (typeof data51.code !== 'string') { - const err77 = { - instancePath: instancePath + '/' + i0 + '/keys/code', - schemaPath: '#/items/selectCases/code/properties/keys/properties/code/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err77]; - } else { - vErrors.push(err77); - } - errors++; - } - } - if (data51.lang !== undefined) { - if (typeof data51.lang !== 'string') { - const err78 = { - instancePath: instancePath + '/' + i0 + '/keys/lang', - schemaPath: '#/items/selectCases/code/properties/keys/properties/lang/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err78]; - } else { - vErrors.push(err78); - } - errors++; - } - } - } else { - const err79 = { - instancePath: instancePath + '/' + i0 + '/keys', - schemaPath: '#/items/selectCases/code/properties/keys/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err79]; - } else { - vErrors.push(err79); - } - errors++; - } - } - } - var _valid0 = _errs128 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'color') { - var _valid0 = true; - valid2 = _valid0; - } - if (!valid2) { - const err80 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/select', - keyword: 'select', - params: { failingCase: 'color' }, - message: 'should match case "color" schema', - }; - if (vErrors === null) { - vErrors = [err80]; - } else { - vErrors.push(err80); - } - errors++; - } - } - } - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.name === undefined) { - const err81 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/required', - keyword: 'required', - params: { missingProperty: 'name' }, - message: "must have required property '" + 'name' + "'", - }; - if (vErrors === null) { - vErrors = [err81]; - } else { - vErrors.push(err81); - } - errors++; - } - if (data0.name !== undefined) { - if (typeof data0.name !== 'string') { - const err82 = { - instancePath: instancePath + '/' + i0 + '/name', - schemaPath: '#/items/properties/name/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err82]; - } else { - vErrors.push(err82); - } - errors++; - } - } - if (data0.label !== undefined) { - if (typeof data0.label !== 'string') { - const err83 = { - instancePath: instancePath + '/' + i0 + '/label', - schemaPath: '#/items/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err83]; - } else { - vErrors.push(err83); - } - errors++; - } - } - if (data0.widget !== undefined) { - if (typeof data0.widget !== 'string') { - const err84 = { - instancePath: instancePath + '/' + i0 + '/widget', - schemaPath: '#/items/properties/widget/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err84]; - } else { - vErrors.push(err84); - } - errors++; - } - } - if (data0.required !== undefined) { - if (typeof data0.required !== 'boolean') { - const err85 = { - instancePath: instancePath + '/' + i0 + '/required', - schemaPath: '#/items/properties/required/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err85]; - } else { - vErrors.push(err85); - } - errors++; - } - } - if (data0.i18n !== undefined) { - let data58 = data0.i18n; - const _errs151 = errors; - let valid34 = false; - let passing5 = null; - const _errs152 = errors; - if (typeof data58 !== 'boolean') { - const err86 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/properties/i18n/oneOf/0/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err86]; - } else { - vErrors.push(err86); - } - errors++; - } - var _valid6 = _errs152 === errors; - if (_valid6) { - valid34 = true; - passing5 = 0; - } - const _errs154 = errors; - if (typeof data58 !== 'string') { - const err87 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/properties/i18n/oneOf/1/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err87]; - } else { - vErrors.push(err87); - } - errors++; - } - if (!(data58 === 'translate' || data58 === 'duplicate' || data58 === 'none')) { - const err88 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/properties/i18n/oneOf/1/enum', - keyword: 'enum', - params: { allowedValues: schema42.items.properties.i18n.oneOf[1].enum }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err88]; - } else { - vErrors.push(err88); - } - errors++; - } - var _valid6 = _errs154 === errors; - if (_valid6 && valid34) { - valid34 = false; - passing5 = [passing5, 1]; - } else { - if (_valid6) { - valid34 = true; - passing5 = 1; - } - } - if (!valid34) { - const err89 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/properties/i18n/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing5 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err89]; - } else { - vErrors.push(err89); - } - errors++; - } else { - errors = _errs151; - if (vErrors !== null) { - if (_errs151) { - vErrors.length = _errs151; - } else { - vErrors = null; - } - } - } - } - if (data0.hint !== undefined) { - if (typeof data0.hint !== 'string') { - const err90 = { - instancePath: instancePath + '/' + i0 + '/hint', - schemaPath: '#/items/properties/hint/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err90]; - } else { - vErrors.push(err90); - } - errors++; - } - } - if (data0.pattern !== undefined) { - let data60 = data0.pattern; - if (Array.isArray(data60)) { - if (data60.length < 2) { - const err91 = { - instancePath: instancePath + '/' + i0 + '/pattern', - schemaPath: '#/items/properties/pattern/minItems', - keyword: 'minItems', - params: { limit: 2 }, - message: 'must NOT have fewer than 2 items', - }; - if (vErrors === null) { - vErrors = [err91]; - } else { - vErrors.push(err91); - } - errors++; - } - const len7 = data60.length; - if (len7 > 0) { - const _errs161 = errors; - let valid36 = false; - let passing6 = null; - const _errs162 = errors; - if (typeof data60[0] !== 'string') { - const err92 = { - 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 = [err92]; - } else { - vErrors.push(err92); - } - errors++; - } - var _valid7 = _errs162 === errors; - if (_valid7) { - valid36 = true; - passing6 = 0; - } - var _valid7 = true; - if (_valid7 && valid36) { - valid36 = false; - passing6 = [passing6, 1]; - } else { - if (_valid7) { - valid36 = true; - passing6 = 1; - } - } - if (!valid36) { - const err93 = { - instancePath: instancePath + '/' + i0 + '/pattern/0', - schemaPath: '#/items/properties/pattern/items/0/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing6 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err93]; - } else { - vErrors.push(err93); - } - errors++; - } else { - errors = _errs161; - if (vErrors !== null) { - if (_errs161) { - vErrors.length = _errs161; - } else { - vErrors = null; - } - } - } - } - if (len7 > 1) { - if (typeof data60[1] !== 'string') { - const err94 = { - 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 = [err94]; - } else { - vErrors.push(err94); - } - errors++; - } - } - } else { - const err95 = { - instancePath: instancePath + '/' + i0 + '/pattern', - schemaPath: '#/items/properties/pattern/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err95]; - } else { - vErrors.push(err95); - } - 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 err96 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err96]; - } else { - vErrors.push(err96); - } - errors++; - } - } - } else { - const err97 = { - instancePath, - schemaPath: '#/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err97]; - } else { - vErrors.push(err97); - } - errors++; - } - validate26.errors = vErrors; - return errors === 0; -} -function validate25( - data, - { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, -) { - /*# sourceURL="field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */ 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 == 'unknown') { - var _valid0 = true; - valid0 = _valid0; - } else if ('' + value0 == 'string') { - var _valid0 = true; - valid0 = _valid0; - } else if ('' + value0 == 'number') { - const _errs1 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.step !== undefined) { - if (!(typeof data.step == 'number')) { - const err1 = { - instancePath: instancePath + '/step', - schemaPath: '#/selectCases/number/properties/step/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - } - if (data.value_type !== undefined) { - if (typeof data.value_type !== 'string') { - const err2 = { - instancePath: instancePath + '/value_type', - schemaPath: '#/selectCases/number/properties/value_type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - } - } - if (data.min !== undefined) { - if (!(typeof data.min == 'number')) { - const err3 = { - instancePath: instancePath + '/min', - schemaPath: '#/selectCases/number/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - } - } - if (data.max !== undefined) { - if (!(typeof data.max == 'number')) { - const err4 = { - instancePath: instancePath + '/max', - schemaPath: '#/selectCases/number/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); - } - errors++; - } - } - } - var _valid0 = _errs1 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'text') { - var _valid0 = true; - valid0 = _valid0; - } else if ('' + value0 == 'image') { - const _errs10 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.allow_multiple !== undefined) { - if (typeof data.allow_multiple !== 'boolean') { - const err5 = { - instancePath: instancePath + '/allow_multiple', - schemaPath: '#/selectCases/image/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); - } - errors++; - } - } - } - var _valid0 = _errs10 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'file') { - const _errs13 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.allow_multiple !== undefined) { - if (typeof data.allow_multiple !== 'boolean') { - const err6 = { - instancePath: instancePath + '/allow_multiple', - schemaPath: '#/selectCases/file/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); - } - errors++; - } - } - } - var _valid0 = _errs13 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'select') { - const _errs16 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.options === undefined) { - const err7 = { - instancePath, - schemaPath: '#/selectCases/select/required', - keyword: 'required', - params: { missingProperty: 'options' }, - message: "must have required property '" + 'options' + "'", - }; - if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); - } - errors++; - } - if (data.multiple !== undefined) { - if (typeof data.multiple !== 'boolean') { - const err8 = { - instancePath: instancePath + '/multiple', - schemaPath: '#/selectCases/select/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); - } - errors++; - } - } - if (data.min !== undefined) { - let data7 = data.min; - if (!(typeof data7 == 'number' && !(data7 % 1) && !isNaN(data7))) { - const err9 = { - instancePath: instancePath + '/min', - schemaPath: '#/selectCases/select/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err9]; - } else { - vErrors.push(err9); - } - errors++; - } - } - if (data.max !== undefined) { - let data8 = data.max; - if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { - const err10 = { - instancePath: instancePath + '/max', - schemaPath: '#/selectCases/select/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err10]; - } else { - vErrors.push(err10); - } - errors++; - } - } - if (data.options !== undefined) { - let data9 = data.options; - if (Array.isArray(data9)) { - const len0 = data9.length; - for (let i0 = 0; i0 < len0; i0++) { - let data10 = data9[i0]; - const _errs26 = errors; - let valid7 = false; - let passing0 = null; - const _errs27 = errors; - if (typeof data10 !== 'string') { - const err11 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: '#/selectCases/select/properties/options/items/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err11]; - } else { - vErrors.push(err11); - } - errors++; - } - var _valid1 = _errs27 === errors; - if (_valid1) { - valid7 = true; - passing0 = 0; - } - const _errs29 = errors; - if (!(typeof data10 == 'number')) { - const err12 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: '#/selectCases/select/properties/options/items/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err12]; - } else { - vErrors.push(err12); - } - errors++; - } - var _valid1 = _errs29 === errors; - if (_valid1 && valid7) { - valid7 = false; - passing0 = [passing0, 1]; - } else { - if (_valid1) { - valid7 = true; - passing0 = 1; - } - const _errs31 = errors; - if (data10 && typeof data10 == 'object' && !Array.isArray(data10)) { - if (data10.label === undefined) { - const err13 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'label' }, - message: "must have required property '" + 'label' + "'", - }; - if (vErrors === null) { - vErrors = [err13]; - } else { - vErrors.push(err13); - } - errors++; - } - if (data10.value === undefined) { - const err14 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'value' }, - message: "must have required property '" + 'value' + "'", - }; - if (vErrors === null) { - vErrors = [err14]; - } else { - vErrors.push(err14); - } - errors++; - } - if (data10.label !== undefined) { - if (typeof data10.label !== 'string') { - const err15 = { - instancePath: instancePath + '/options/' + i0 + '/label', - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err15]; - } else { - vErrors.push(err15); - } - errors++; - } - } - if (data10.value !== undefined) { - let data12 = data10.value; - const _errs36 = errors; - let valid9 = false; - let passing1 = null; - const _errs37 = errors; - if (typeof data12 !== 'string') { - const err16 = { - instancePath: instancePath + '/options/' + i0 + '/value', - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err16]; - } else { - vErrors.push(err16); - } - errors++; - } - var _valid2 = _errs37 === errors; - if (_valid2) { - valid9 = true; - passing1 = 0; - } - const _errs39 = errors; - if (!(typeof data12 == 'number')) { - const err17 = { - instancePath: instancePath + '/options/' + i0 + '/value', - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err17]; - } else { - vErrors.push(err17); - } - errors++; - } - var _valid2 = _errs39 === errors; - if (_valid2 && valid9) { - valid9 = false; - passing1 = [passing1, 1]; - } else { - if (_valid2) { - valid9 = true; - passing1 = 1; - } - } - if (!valid9) { - const err18 = { - instancePath: instancePath + '/options/' + i0 + '/value', - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs36; - if (vErrors !== null) { - if (_errs36) { - vErrors.length = _errs36; - } else { - vErrors = null; - } - } - } - } - } else { - const err19 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: '#/selectCases/select/properties/options/items/oneOf/2/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err19]; - } else { - vErrors.push(err19); - } - errors++; - } - var _valid1 = _errs31 === errors; - if (_valid1 && valid7) { - valid7 = false; - passing0 = [passing0, 2]; - } else { - if (_valid1) { - valid7 = true; - passing0 = 2; - } - } - } - if (!valid7) { - const err20 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: '#/selectCases/select/properties/options/items/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing0 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err20]; - } else { - vErrors.push(err20); - } - errors++; - } else { - errors = _errs26; - if (vErrors !== null) { - if (_errs26) { - vErrors.length = _errs26; - } else { - vErrors = null; - } - } - } - } - } else { - const err21 = { - instancePath: instancePath + '/options', - schemaPath: '#/selectCases/select/properties/options/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err21]; - } else { - vErrors.push(err21); - } - errors++; - } - } - } - var _valid0 = _errs16 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'markdown') { - const _errs41 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.minimal !== undefined) { - if (typeof data.minimal !== 'boolean') { - const err22 = { - instancePath: instancePath + '/minimal', - schemaPath: '#/selectCases/markdown/properties/minimal/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err22]; - } else { - vErrors.push(err22); - } - errors++; - } - } - if (data.buttons !== undefined) { - let data14 = data.buttons; - if (Array.isArray(data14)) { - const len1 = data14.length; - for (let i1 = 0; i1 < len1; i1++) { - let data15 = data14[i1]; - if (typeof data15 !== 'string') { - const err23 = { - instancePath: instancePath + '/buttons/' + i1, - schemaPath: '#/selectCases/markdown/properties/buttons/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err23]; - } else { - vErrors.push(err23); - } - errors++; - } - if ( - !( - data15 === 'bold' || - data15 === 'italic' || - data15 === 'code' || - data15 === 'link' || - data15 === 'heading-one' || - data15 === 'heading-two' || - data15 === 'heading-three' || - data15 === 'heading-four' || - data15 === 'heading-five' || - data15 === 'heading-six' || - data15 === 'quote' || - data15 === 'bulleted-list' || - data15 === 'numbered-list' - ) - ) { - const err24 = { - instancePath: instancePath + '/buttons/' + i1, - schemaPath: '#/selectCases/markdown/properties/buttons/items/enum', - keyword: 'enum', - params: { - allowedValues: schema41.selectCases.markdown.properties.buttons.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err24]; - } else { - vErrors.push(err24); - } - errors++; - } - } - } else { - const err25 = { - instancePath: instancePath + '/buttons', - schemaPath: '#/selectCases/markdown/properties/buttons/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err25]; - } else { - vErrors.push(err25); - } - errors++; - } - } - if (data.editor_components !== undefined) { - let data16 = data.editor_components; - if (Array.isArray(data16)) { - const len2 = data16.length; - for (let i2 = 0; i2 < len2; i2++) { - if (typeof data16[i2] !== 'string') { - const err26 = { - instancePath: instancePath + '/editor_components/' + i2, - schemaPath: '#/selectCases/markdown/properties/editor_components/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err26]; - } else { - vErrors.push(err26); - } - errors++; - } - } - } else { - const err27 = { - instancePath: instancePath + '/editor_components', - schemaPath: '#/selectCases/markdown/properties/editor_components/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err27]; - } else { - vErrors.push(err27); - } - errors++; - } - } - if (data.modes !== undefined) { - let data18 = data.modes; - if (Array.isArray(data18)) { - if (data18.length < 1) { - const err28 = { - instancePath: instancePath + '/modes', - schemaPath: '#/selectCases/markdown/properties/modes/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err28]; - } else { - vErrors.push(err28); - } - errors++; - } - const len3 = data18.length; - for (let i3 = 0; i3 < len3; i3++) { - let data19 = data18[i3]; - if (typeof data19 !== 'string') { - const err29 = { - instancePath: instancePath + '/modes/' + i3, - schemaPath: '#/selectCases/markdown/properties/modes/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err29]; - } else { - vErrors.push(err29); - } - errors++; - } - if (!(data19 === 'raw' || data19 === 'rich_text')) { - const err30 = { - instancePath: instancePath + '/modes/' + i3, - schemaPath: '#/selectCases/markdown/properties/modes/items/enum', - keyword: 'enum', - params: { - allowedValues: schema41.selectCases.markdown.properties.modes.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err30]; - } else { - vErrors.push(err30); - } - errors++; - } - } - } else { - const err31 = { - instancePath: instancePath + '/modes', - schemaPath: '#/selectCases/markdown/properties/modes/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err31]; - } else { - vErrors.push(err31); - } - errors++; - } - } - } - var _valid0 = _errs41 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'list') { - const _errs56 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.allow_add !== undefined) { - if (typeof data.allow_add !== 'boolean') { - const err32 = { - instancePath: instancePath + '/allow_add', - schemaPath: '#/selectCases/list/properties/allow_add/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err32]; - } else { - vErrors.push(err32); - } - errors++; - } - } - if (data.collapsed !== undefined) { - if (typeof data.collapsed !== 'boolean') { - const err33 = { - instancePath: instancePath + '/collapsed', - schemaPath: '#/selectCases/list/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err33]; - } else { - vErrors.push(err33); - } - errors++; - } - } - if (data.summary !== undefined) { - if (typeof data.summary !== 'string') { - const err34 = { - instancePath: instancePath + '/summary', - schemaPath: '#/selectCases/list/properties/summary/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err34]; - } else { - vErrors.push(err34); - } - errors++; - } - } - if (data.minimize_collapsed !== undefined) { - if (typeof data.minimize_collapsed !== 'boolean') { - const err35 = { - instancePath: instancePath + '/minimize_collapsed', - schemaPath: '#/selectCases/list/properties/minimize_collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err35]; - } else { - vErrors.push(err35); - } - errors++; - } - } - if (data.label_singular !== undefined) { - if (typeof data.label_singular !== 'string') { - const err36 = { - instancePath: instancePath + '/label_singular', - schemaPath: '#/selectCases/list/properties/label_singular/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err36]; - } else { - vErrors.push(err36); - } - errors++; - } - } - if (data.i18n !== undefined) { - if (typeof data.i18n !== 'boolean') { - const err37 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/selectCases/list/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err37]; - } else { - vErrors.push(err37); - } - errors++; - } - } - if (data.min !== undefined) { - if (!(typeof data.min == 'number')) { - const err38 = { - instancePath: instancePath + '/min', - schemaPath: '#/selectCases/list/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err38]; - } else { - vErrors.push(err38); - } - errors++; - } - } - if (data.max !== undefined) { - if (!(typeof data.max == 'number')) { - const err39 = { - instancePath: instancePath + '/max', - schemaPath: '#/selectCases/list/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err39]; - } else { - vErrors.push(err39); - } - errors++; - } - } - } - var _valid0 = _errs56 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'object') { - const _errs73 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.collapsed !== undefined) { - if (typeof data.collapsed !== 'boolean') { - const err40 = { - instancePath: instancePath + '/collapsed', - schemaPath: '#/selectCases/object/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err40]; - } else { - vErrors.push(err40); - } - errors++; - } - } - if (data.i18n !== undefined) { - if (typeof data.i18n !== 'boolean') { - const err41 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/selectCases/object/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err41]; - } else { - vErrors.push(err41); - } - errors++; - } - } - } - var _valid0 = _errs73 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'relation') { - const _errs78 = errors; - const _errs79 = errors; - let valid19 = false; - let passing2 = null; - const _errs80 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.collection === undefined) { - const err42 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err42]; - } else { - vErrors.push(err42); - } - errors++; - } - if (data.value_field === undefined) { - const err43 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'value_field' }, - message: "must have required property '" + 'value_field' + "'", - }; - if (vErrors === null) { - vErrors = [err43]; - } else { - vErrors.push(err43); - } - errors++; - } - if (data.search_fields === undefined) { - const err44 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'search_fields' }, - message: "must have required property '" + 'search_fields' + "'", - }; - if (vErrors === null) { - vErrors = [err44]; - } else { - vErrors.push(err44); - } - errors++; - } - } - var _valid3 = _errs80 === errors; - if (_valid3) { - valid19 = true; - passing2 = 0; - } - const _errs81 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.collection === undefined) { - const err45 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err45]; - } else { - vErrors.push(err45); - } - errors++; - } - if (data.valueField === undefined) { - const err46 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'valueField' }, - message: "must have required property '" + 'valueField' + "'", - }; - if (vErrors === null) { - vErrors = [err46]; - } else { - vErrors.push(err46); - } - errors++; - } - if (data.searchFields === undefined) { - const err47 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'searchFields' }, - message: "must have required property '" + 'searchFields' + "'", - }; - if (vErrors === null) { - vErrors = [err47]; - } else { - vErrors.push(err47); - } - errors++; - } - } - var _valid3 = _errs81 === errors; - if (_valid3 && valid19) { - valid19 = false; - passing2 = [passing2, 1]; - } else { - if (_valid3) { - valid19 = true; - passing2 = 1; - } - } - if (!valid19) { - const err48 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing2 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err48]; - } else { - vErrors.push(err48); - } - errors++; - } else { - errors = _errs79; - if (vErrors !== null) { - if (_errs79) { - vErrors.length = _errs79; - } else { - vErrors = null; - } - } - } - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.collection !== undefined) { - if (typeof data.collection !== 'string') { - const err49 = { - instancePath: instancePath + '/collection', - schemaPath: '#/selectCases/relation/properties/collection/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err49]; - } else { - vErrors.push(err49); - } - errors++; - } - } - if (data.value_field !== undefined) { - if (typeof data.value_field !== 'string') { - const err50 = { - instancePath: instancePath + '/value_field', - schemaPath: '#/selectCases/relation/properties/value_field/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err50]; - } else { - vErrors.push(err50); - } - errors++; - } - } - if (data.search_fields !== undefined) { - let data32 = data.search_fields; - if (Array.isArray(data32)) { - if (data32.length < 1) { - const err51 = { - instancePath: instancePath + '/search_fields', - schemaPath: '#/selectCases/relation/properties/search_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err51]; - } else { - vErrors.push(err51); - } - errors++; - } - const len4 = data32.length; - for (let i4 = 0; i4 < len4; i4++) { - if (typeof data32[i4] !== 'string') { - const err52 = { - instancePath: instancePath + '/search_fields/' + i4, - schemaPath: '#/selectCases/relation/properties/search_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err52]; - } else { - vErrors.push(err52); - } - errors++; - } - } - } else { - const err53 = { - instancePath: instancePath + '/search_fields', - schemaPath: '#/selectCases/relation/properties/search_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err53]; - } else { - vErrors.push(err53); - } - errors++; - } - } - if (data.file !== undefined) { - if (typeof data.file !== 'string') { - const err54 = { - instancePath: instancePath + '/file', - schemaPath: '#/selectCases/relation/properties/file/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err54]; - } else { - vErrors.push(err54); - } - errors++; - } - } - if (data.multiple !== undefined) { - if (typeof data.multiple !== 'boolean') { - const err55 = { - instancePath: instancePath + '/multiple', - schemaPath: '#/selectCases/relation/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err55]; - } else { - vErrors.push(err55); - } - errors++; - } - } - if (data.min !== undefined) { - let data36 = data.min; - if (!(typeof data36 == 'number' && !(data36 % 1) && !isNaN(data36))) { - const err56 = { - instancePath: instancePath + '/min', - schemaPath: '#/selectCases/relation/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err56]; - } else { - vErrors.push(err56); - } - errors++; - } - } - if (data.max !== undefined) { - let data37 = data.max; - if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { - const err57 = { - instancePath: instancePath + '/max', - schemaPath: '#/selectCases/relation/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err57]; - } else { - vErrors.push(err57); - } - errors++; - } - } - if (data.display_fields !== undefined) { - let data38 = data.display_fields; - if (Array.isArray(data38)) { - if (data38.length < 1) { - const err58 = { - instancePath: instancePath + '/display_fields', - schemaPath: '#/selectCases/relation/properties/display_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err58]; - } else { - vErrors.push(err58); - } - errors++; - } - const len5 = data38.length; - for (let i5 = 0; i5 < len5; i5++) { - if (typeof data38[i5] !== 'string') { - const err59 = { - instancePath: instancePath + '/display_fields/' + i5, - schemaPath: '#/selectCases/relation/properties/display_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err59]; - } else { - vErrors.push(err59); - } - errors++; - } - } - } else { - const err60 = { - instancePath: instancePath + '/display_fields', - schemaPath: '#/selectCases/relation/properties/display_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err60]; - } else { - vErrors.push(err60); - } - errors++; - } - } - if (data.options_length !== undefined) { - let data40 = data.options_length; - if (!(typeof data40 == 'number' && !(data40 % 1) && !isNaN(data40))) { - const err61 = { - instancePath: instancePath + '/options_length', - schemaPath: '#/selectCases/relation/properties/options_length/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err61]; - } else { - vErrors.push(err61); - } - errors++; - } - } - } - var _valid0 = _errs78 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'boolean') { - var _valid0 = true; - valid0 = _valid0; - } else if ('' + value0 == 'map') { - const _errs104 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.decimals !== undefined) { - let data41 = data.decimals; - if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { - const err62 = { - instancePath: instancePath + '/decimals', - schemaPath: '#/selectCases/map/properties/decimals/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err62]; - } else { - vErrors.push(err62); - } - errors++; - } - } - if (data.type !== undefined) { - let data42 = data.type; - if (typeof data42 !== 'string') { - const err63 = { - instancePath: instancePath + '/type', - schemaPath: '#/selectCases/map/properties/type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err63]; - } else { - vErrors.push(err63); - } - errors++; - } - if (!(data42 === 'Point' || data42 === 'LineString' || data42 === 'Polygon')) { - const err64 = { - instancePath: instancePath + '/type', - schemaPath: '#/selectCases/map/properties/type/enum', - keyword: 'enum', - params: { allowedValues: schema41.selectCases.map.properties.type.enum }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err64]; - } else { - vErrors.push(err64); - } - errors++; - } - } - } - var _valid0 = _errs104 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'date') { - var _valid0 = true; - valid0 = _valid0; - } else if ('' + value0 == 'datetime') { - const _errs109 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.format !== undefined) { - if (typeof data.format !== 'string') { - const err65 = { - instancePath: instancePath + '/format', - schemaPath: '#/selectCases/datetime/properties/format/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err65]; - } else { - vErrors.push(err65); - } - errors++; - } - } - if (data.date_format !== undefined) { - let data44 = data.date_format; - const _errs113 = errors; - let valid27 = false; - let passing3 = null; - const _errs114 = errors; - if (typeof data44 !== 'string') { - const err66 = { - instancePath: instancePath + '/date_format', - schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err66]; - } else { - vErrors.push(err66); - } - errors++; - } - var _valid4 = _errs114 === errors; - if (_valid4) { - valid27 = true; - passing3 = 0; - } - const _errs116 = errors; - if (typeof data44 !== 'boolean') { - const err67 = { - instancePath: instancePath + '/date_format', - schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err67]; - } else { - vErrors.push(err67); - } - errors++; - } - var _valid4 = _errs116 === errors; - if (_valid4 && valid27) { - valid27 = false; - passing3 = [passing3, 1]; - } else { - if (_valid4) { - valid27 = true; - passing3 = 1; - } - } - if (!valid27) { - const err68 = { - instancePath: instancePath + '/date_format', - schemaPath: '#/selectCases/datetime/properties/date_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing3 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err68]; - } else { - vErrors.push(err68); - } - errors++; - } else { - errors = _errs113; - if (vErrors !== null) { - if (_errs113) { - vErrors.length = _errs113; - } else { - vErrors = null; - } - } - } - } - if (data.time_format !== undefined) { - let data45 = data.time_format; - const _errs119 = errors; - let valid28 = false; - let passing4 = null; - const _errs120 = errors; - if (typeof data45 !== 'string') { - const err69 = { - instancePath: instancePath + '/time_format', - schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err69]; - } else { - vErrors.push(err69); - } - errors++; - } - var _valid5 = _errs120 === errors; - if (_valid5) { - valid28 = true; - passing4 = 0; - } - const _errs122 = errors; - if (typeof data45 !== 'boolean') { - const err70 = { - instancePath: instancePath + '/time_format', - schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err70]; - } else { - vErrors.push(err70); - } - errors++; - } - var _valid5 = _errs122 === errors; - if (_valid5 && valid28) { - valid28 = false; - passing4 = [passing4, 1]; - } else { - if (_valid5) { - valid28 = true; - passing4 = 1; - } - } - if (!valid28) { - const err71 = { - instancePath: instancePath + '/time_format', - schemaPath: '#/selectCases/datetime/properties/time_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing4 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err71]; - } else { - vErrors.push(err71); - } - errors++; - } else { - errors = _errs119; - if (vErrors !== null) { - if (_errs119) { - vErrors.length = _errs119; - } else { - vErrors = null; - } - } - } - } - if (data.picker_utc !== undefined) { - if (typeof data.picker_utc !== 'boolean') { - const err72 = { - instancePath: instancePath + '/picker_utc', - schemaPath: '#/selectCases/datetime/properties/picker_utc/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err72]; - } else { - vErrors.push(err72); - } - errors++; - } - } - } - var _valid0 = _errs109 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'code') { - const _errs126 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.default_language !== undefined) { - if (typeof data.default_language !== 'string') { - const err73 = { - instancePath: instancePath + '/default_language', - schemaPath: '#/selectCases/code/properties/default_language/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err73]; - } else { - vErrors.push(err73); - } - errors++; - } - } - if (data.allow_language_selection !== undefined) { - if (typeof data.allow_language_selection !== 'boolean') { - const err74 = { - instancePath: instancePath + '/allow_language_selection', - schemaPath: '#/selectCases/code/properties/allow_language_selection/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err74]; - } else { - vErrors.push(err74); - } - errors++; - } - } - if (data.output_code_only !== undefined) { - if (typeof data.output_code_only !== 'boolean') { - const err75 = { - instancePath: instancePath + '/output_code_only', - schemaPath: '#/selectCases/code/properties/output_code_only/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err75]; - } else { - vErrors.push(err75); - } - errors++; - } - } - if (data.keys !== undefined) { - let data50 = data.keys; - if (data50 && typeof data50 == 'object' && !Array.isArray(data50)) { - if (data50.code !== undefined) { - if (typeof data50.code !== 'string') { - const err76 = { - instancePath: instancePath + '/keys/code', - schemaPath: '#/selectCases/code/properties/keys/properties/code/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err76]; - } else { - vErrors.push(err76); - } - errors++; - } - } - if (data50.lang !== undefined) { - if (typeof data50.lang !== 'string') { - const err77 = { - instancePath: instancePath + '/keys/lang', - schemaPath: '#/selectCases/code/properties/keys/properties/lang/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err77]; - } else { - vErrors.push(err77); - } - errors++; - } - } - } else { - const err78 = { - instancePath: instancePath + '/keys', - schemaPath: '#/selectCases/code/properties/keys/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err78]; - } else { - vErrors.push(err78); - } - errors++; - } - } - } - var _valid0 = _errs126 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'color') { - var _valid0 = true; - valid0 = _valid0; - } - if (!valid0) { - const err79 = { - instancePath, - schemaPath: '#/select', - keyword: 'select', - params: { failingCase: 'color' }, - message: 'should match case "color" schema', - }; - if (vErrors === null) { - vErrors = [err79]; - } else { - vErrors.push(err79); - } - errors++; - } - } - } - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.name === undefined) { - const err80 = { - instancePath, - schemaPath: '#/required', - keyword: 'required', - params: { missingProperty: 'name' }, - message: "must have required property '" + 'name' + "'", - }; - if (vErrors === null) { - vErrors = [err80]; - } else { - vErrors.push(err80); - } - errors++; - } - if (data.name !== undefined) { - if (typeof data.name !== 'string') { - const err81 = { - instancePath: instancePath + '/name', - schemaPath: '#/properties/name/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err81]; - } else { - vErrors.push(err81); - } - errors++; - } - } - if (data.label !== undefined) { - if (typeof data.label !== 'string') { - const err82 = { - instancePath: instancePath + '/label', - schemaPath: '#/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err82]; - } else { - vErrors.push(err82); - } - errors++; - } - } - if (data.widget !== undefined) { - if (typeof data.widget !== 'string') { - const err83 = { - instancePath: instancePath + '/widget', - schemaPath: '#/properties/widget/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err83]; - } else { - vErrors.push(err83); - } - errors++; - } - } - if (data.required !== undefined) { - if (typeof data.required !== 'boolean') { - const err84 = { - instancePath: instancePath + '/required', - schemaPath: '#/properties/required/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err84]; - } else { - vErrors.push(err84); - } - errors++; - } - } - if (data.i18n !== undefined) { - let data57 = data.i18n; - const _errs149 = errors; - let valid32 = false; - let passing5 = null; - const _errs150 = errors; - if (typeof data57 !== 'boolean') { - const err85 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/properties/i18n/oneOf/0/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err85]; - } else { - vErrors.push(err85); - } - errors++; - } - var _valid6 = _errs150 === errors; - if (_valid6) { - valid32 = true; - passing5 = 0; - } - const _errs152 = errors; - if (typeof data57 !== 'string') { - const err86 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/properties/i18n/oneOf/1/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err86]; - } else { - vErrors.push(err86); - } - errors++; - } - if (!(data57 === 'translate' || data57 === 'duplicate' || data57 === 'none')) { - const err87 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/properties/i18n/oneOf/1/enum', - keyword: 'enum', - params: { allowedValues: schema41.properties.i18n.oneOf[1].enum }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err87]; - } else { - vErrors.push(err87); - } - errors++; - } - var _valid6 = _errs152 === errors; - if (_valid6 && valid32) { - valid32 = false; - passing5 = [passing5, 1]; - } else { - if (_valid6) { - valid32 = true; - passing5 = 1; - } - } - if (!valid32) { - const err88 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/properties/i18n/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing5 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err88]; - } else { - vErrors.push(err88); - } - errors++; - } else { - errors = _errs149; - if (vErrors !== null) { - if (_errs149) { - vErrors.length = _errs149; - } else { - vErrors = null; - } - } - } - } - if (data.hint !== undefined) { - if (typeof data.hint !== 'string') { - const err89 = { - instancePath: instancePath + '/hint', - schemaPath: '#/properties/hint/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err89]; - } else { - vErrors.push(err89); - } - errors++; - } - } - if (data.pattern !== undefined) { - let data59 = data.pattern; - if (Array.isArray(data59)) { - if (data59.length < 2) { - const err90 = { - instancePath: instancePath + '/pattern', - schemaPath: '#/properties/pattern/minItems', - keyword: 'minItems', - params: { limit: 2 }, - message: 'must NOT have fewer than 2 items', - }; - if (vErrors === null) { - vErrors = [err90]; - } else { - vErrors.push(err90); - } - errors++; - } - const len6 = data59.length; - if (len6 > 0) { - const _errs159 = errors; - let valid34 = false; - let passing6 = null; - const _errs160 = errors; - if (typeof data59[0] !== 'string') { - const err91 = { - 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 = [err91]; - } else { - vErrors.push(err91); - } - errors++; - } - var _valid7 = _errs160 === errors; - if (_valid7) { - valid34 = true; - passing6 = 0; - } - var _valid7 = true; - if (_valid7 && valid34) { - valid34 = false; - passing6 = [passing6, 1]; - } else { - if (_valid7) { - valid34 = true; - passing6 = 1; - } - } - if (!valid34) { - const err92 = { - instancePath: instancePath + '/pattern/0', - schemaPath: '#/properties/pattern/items/0/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing6 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err92]; - } else { - vErrors.push(err92); - } - errors++; - } else { - errors = _errs159; - if (vErrors !== null) { - if (_errs159) { - vErrors.length = _errs159; - } else { - vErrors = null; - } - } - } - } - if (len6 > 1) { - if (typeof data59[1] !== 'string') { - const err93 = { - instancePath: instancePath + '/pattern/1', - schemaPath: '#/properties/pattern/items/1/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err93]; - } else { - vErrors.push(err93); - } - errors++; - } - } - } else { - const err94 = { - instancePath: instancePath + '/pattern', - schemaPath: '#/properties/pattern/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err94]; - } else { - vErrors.push(err94); - } - 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 ( - !validate26(data.fields, { - instancePath: instancePath + '/fields', - parentData: data, - parentDataProperty: 'fields', - rootData, - }) - ) { - vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors); - errors = vErrors.length; - } - } - if (data.types !== undefined) { - if ( - !validate26(data.types, { - instancePath: instancePath + '/types', - parentData: data, - parentDataProperty: 'types', - rootData, - }) - ) { - vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors); - errors = vErrors.length; - } - } - } else { - const err95 = { - instancePath, - schemaPath: '#/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err95]; - } else { - vErrors.push(err95); - } - errors++; - } - validate25.errors = vErrors; - return errors === 0; -} -const schema43 = { - $id: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', - 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], - }, - field: { $ref: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, - fields: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, - types: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, - }, - select: { $data: '0/widget' }, - selectCases: { - unknown: {}, - string: {}, - number: { - properties: { - step: { type: 'number' }, - value_type: { type: 'string' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - text: {}, - image: { properties: { allow_multiple: { type: 'boolean' } } }, - file: { properties: { allow_multiple: { type: 'boolean' } } }, - select: { - properties: { - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - options: { - type: 'array', - items: { - oneOf: [ - { type: 'string' }, - { type: 'number' }, - { - type: 'object', - properties: { - label: { type: 'string' }, - value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, - }, - required: ['label', 'value'], - }, - ], - }, - }, - }, - required: ['options'], - }, - markdown: { - properties: { - minimal: { type: 'boolean' }, - buttons: { - type: 'array', - items: { - type: 'string', - enum: [ - 'bold', - 'italic', - 'code', - 'link', - 'heading-one', - 'heading-two', - 'heading-three', - 'heading-four', - 'heading-five', - 'heading-six', - 'quote', - 'bulleted-list', - 'numbered-list', - ], - }, - }, - editor_components: { type: 'array', items: { type: 'string' } }, - modes: { - type: 'array', - items: { type: 'string', enum: ['raw', 'rich_text'] }, - minItems: 1, - }, - }, - }, - list: { - properties: { - allow_add: { type: 'boolean' }, - collapsed: { type: 'boolean' }, - summary: { type: 'string' }, - minimize_collapsed: { type: 'boolean' }, - label_singular: { type: 'string' }, - i18n: { type: 'boolean' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, - relation: { - properties: { - collection: { type: 'string' }, - value_field: { type: 'string' }, - search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - file: { type: 'string' }, - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - options_length: { type: 'integer' }, - }, - oneOf: [ - { required: ['collection', 'value_field', 'search_fields'] }, - { required: ['collection', 'valueField', 'searchFields'] }, - ], - }, - boolean: {}, - map: { - properties: { - decimals: { type: 'integer' }, - type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, - }, - }, - date: {}, - datetime: { - properties: { - format: { type: 'string' }, - date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - picker_utc: { type: 'boolean' }, - }, - }, - code: { - properties: { - default_language: { type: 'string' }, - allow_language_selection: { type: 'boolean' }, - output_code_only: { type: 'boolean' }, - keys: { - type: 'object', - properties: { code: { type: 'string' }, lang: { type: 'string' } }, - }, - }, - }, - color: {}, - }, - required: ['name'], -}; -const wrapper4 = { validate: validate32 }; -const schema44 = { - $id: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', - type: 'array', - minItems: 1, - items: { - $id: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', - 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], - }, - field: { $ref: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, - fields: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, - types: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, - }, - select: { $data: '0/widget' }, - selectCases: { - unknown: {}, - string: {}, - number: { - properties: { - step: { type: 'number' }, - value_type: { type: 'string' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - text: {}, - image: { properties: { allow_multiple: { type: 'boolean' } } }, - file: { properties: { allow_multiple: { type: 'boolean' } } }, - select: { - properties: { - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - options: { - type: 'array', - items: { - oneOf: [ - { type: 'string' }, - { type: 'number' }, - { - type: 'object', - properties: { - label: { type: 'string' }, - value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, - }, - required: ['label', 'value'], - }, - ], - }, - }, - }, - required: ['options'], - }, - markdown: { - properties: { - minimal: { type: 'boolean' }, - buttons: { - type: 'array', - items: { - type: 'string', - enum: [ - 'bold', - 'italic', - 'code', - 'link', - 'heading-one', - 'heading-two', - 'heading-three', - 'heading-four', - 'heading-five', - 'heading-six', - 'quote', - 'bulleted-list', - 'numbered-list', - ], - }, - }, - editor_components: { type: 'array', items: { type: 'string' } }, - modes: { - type: 'array', - items: { type: 'string', enum: ['raw', 'rich_text'] }, - minItems: 1, - }, - }, - }, - list: { - properties: { - allow_add: { type: 'boolean' }, - collapsed: { type: 'boolean' }, - summary: { type: 'string' }, - minimize_collapsed: { type: 'boolean' }, - label_singular: { type: 'string' }, - i18n: { type: 'boolean' }, - min: { type: 'number' }, - max: { type: 'number' }, - }, - }, - object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, - relation: { - properties: { - collection: { type: 'string' }, - value_field: { type: 'string' }, - search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - file: { type: 'string' }, - multiple: { type: 'boolean' }, - min: { type: 'integer' }, - max: { type: 'integer' }, - display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, - options_length: { type: 'integer' }, - }, - oneOf: [ - { required: ['collection', 'value_field', 'search_fields'] }, - { required: ['collection', 'valueField', 'searchFields'] }, - ], - }, - boolean: {}, - map: { - properties: { - decimals: { type: 'integer' }, - type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, - }, - }, - date: {}, - datetime: { - properties: { - format: { type: 'string' }, - date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, - picker_utc: { type: 'boolean' }, - }, - }, - code: { - properties: { - default_language: { type: 'string' }, - allow_language_selection: { type: 'boolean' }, - output_code_only: { type: 'boolean' }, - keys: { - type: 'object', - properties: { code: { type: 'string' }, lang: { type: 'string' } }, - }, - }, - }, - color: {}, - }, - required: ['name'], - }, - uniqueItemProperties: ['name'], -}; -const wrapper6 = { validate: validate33 }; -function validate33( - data, - { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, -) { - /*# sourceURL="fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */ 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 < len0; i0++) { - let data0 = data[i0]; - const vSchema0 = data0 && data0.widget; - if (!(vSchema0 === undefined)) { - if ( - typeof vSchema0 !== 'string' && - !(typeof vSchema0 == 'number') && - typeof vSchema0 !== 'boolean' && - vSchema0 !== null - ) { - const err1 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/select', - keyword: 'select', - params: {}, - message: '"select" keyword must be string,number,boolean,null ($data)', - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } else { - let valid2 = true; - const value0 = vSchema0 === null ? 'null' : vSchema0; - if ('' + value0 == 'unknown') { - var _valid0 = true; - valid2 = _valid0; - } else if ('' + value0 == 'string') { - var _valid0 = true; - valid2 = _valid0; - } else if ('' + value0 == 'number') { - const _errs3 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.step !== undefined) { - if (!(typeof data0.step == 'number')) { - const err2 = { - instancePath: instancePath + '/' + i0 + '/step', - schemaPath: '#/items/selectCases/number/properties/step/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - } - } - if (data0.value_type !== undefined) { - if (typeof data0.value_type !== 'string') { - const err3 = { - instancePath: instancePath + '/' + i0 + '/value_type', - schemaPath: '#/items/selectCases/number/properties/value_type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - } - } - if (data0.min !== undefined) { - if (!(typeof data0.min == 'number')) { - const err4 = { - instancePath: instancePath + '/' + i0 + '/min', - schemaPath: '#/items/selectCases/number/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); - } - errors++; - } - } - if (data0.max !== undefined) { - if (!(typeof data0.max == 'number')) { - const err5 = { - instancePath: instancePath + '/' + i0 + '/max', - schemaPath: '#/items/selectCases/number/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); - } - errors++; - } - } - } - var _valid0 = _errs3 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'text') { - var _valid0 = true; - valid2 = _valid0; - } else if ('' + value0 == 'image') { - const _errs12 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.allow_multiple !== undefined) { - if (typeof data0.allow_multiple !== 'boolean') { - const err6 = { - instancePath: instancePath + '/' + i0 + '/allow_multiple', - schemaPath: '#/items/selectCases/image/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); - } - errors++; - } - } - } - var _valid0 = _errs12 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'file') { - const _errs15 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.allow_multiple !== undefined) { - if (typeof data0.allow_multiple !== 'boolean') { - const err7 = { - instancePath: instancePath + '/' + i0 + '/allow_multiple', - schemaPath: '#/items/selectCases/file/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); - } - errors++; - } - } - } - var _valid0 = _errs15 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'select') { - const _errs18 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.options === undefined) { - const err8 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/select/required', - keyword: 'required', - params: { missingProperty: 'options' }, - message: "must have required property '" + 'options' + "'", - }; - if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); - } - errors++; - } - if (data0.multiple !== undefined) { - if (typeof data0.multiple !== 'boolean') { - const err9 = { - instancePath: instancePath + '/' + i0 + '/multiple', - schemaPath: '#/items/selectCases/select/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err9]; - } else { - vErrors.push(err9); - } - errors++; - } - } - if (data0.min !== undefined) { - let data8 = data0.min; - if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { - const err10 = { - instancePath: instancePath + '/' + i0 + '/min', - schemaPath: '#/items/selectCases/select/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err10]; - } else { - vErrors.push(err10); - } - errors++; - } - } - if (data0.max !== undefined) { - let data9 = data0.max; - if (!(typeof data9 == 'number' && !(data9 % 1) && !isNaN(data9))) { - const err11 = { - instancePath: instancePath + '/' + i0 + '/max', - schemaPath: '#/items/selectCases/select/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err11]; - } else { - vErrors.push(err11); - } - errors++; - } - } - if (data0.options !== undefined) { - let data10 = data0.options; - if (Array.isArray(data10)) { - const len1 = data10.length; - for (let i1 = 0; i1 < len1; i1++) { - let data11 = data10[i1]; - const _errs28 = errors; - let valid9 = false; - let passing0 = null; - const _errs29 = errors; - if (typeof data11 !== 'string') { - const err12 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err12]; - } else { - vErrors.push(err12); - } - errors++; - } - var _valid1 = _errs29 === errors; - if (_valid1) { - valid9 = true; - passing0 = 0; - } - const _errs31 = errors; - if (!(typeof data11 == 'number')) { - const err13 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err13]; - } else { - vErrors.push(err13); - } - errors++; - } - var _valid1 = _errs31 === errors; - if (_valid1 && valid9) { - valid9 = false; - passing0 = [passing0, 1]; - } else { - if (_valid1) { - valid9 = true; - passing0 = 1; - } - const _errs33 = errors; - if (data11 && typeof data11 == 'object' && !Array.isArray(data11)) { - if (data11.label === undefined) { - const err14 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'label' }, - message: "must have required property '" + 'label' + "'", - }; - if (vErrors === null) { - vErrors = [err14]; - } else { - vErrors.push(err14); - } - errors++; - } - if (data11.value === undefined) { - const err15 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'value' }, - message: "must have required property '" + 'value' + "'", - }; - if (vErrors === null) { - vErrors = [err15]; - } else { - vErrors.push(err15); - } - errors++; - } - if (data11.label !== undefined) { - if (typeof data11.label !== 'string') { - const err16 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/label', - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err16]; - } else { - vErrors.push(err16); - } - errors++; - } - } - if (data11.value !== undefined) { - let data13 = data11.value; - const _errs38 = errors; - let valid11 = false; - let passing1 = null; - const _errs39 = errors; - if (typeof data13 !== 'string') { - const err17 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err17]; - } else { - vErrors.push(err17); - } - errors++; - } - var _valid2 = _errs39 === errors; - if (_valid2) { - valid11 = true; - passing1 = 0; - } - const _errs41 = errors; - if (!(typeof data13 == 'number')) { - const err18 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err18]; - } else { - vErrors.push(err18); - } - errors++; - } - var _valid2 = _errs41 === errors; - if (_valid2 && valid11) { - valid11 = false; - passing1 = [passing1, 1]; - } else { - if (_valid2) { - valid11 = true; - passing1 = 1; - } - } - if (!valid11) { - const err19 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs38; - if (vErrors !== null) { - if (_errs38) { - vErrors.length = _errs38; - } else { - vErrors = null; - } - } - } - } - } else { - const err20 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: - '#/items/selectCases/select/properties/options/items/oneOf/2/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err20]; - } else { - vErrors.push(err20); - } - errors++; - } - var _valid1 = _errs33 === errors; - if (_valid1 && valid9) { - valid9 = false; - passing0 = [passing0, 2]; - } else { - if (_valid1) { - valid9 = true; - passing0 = 2; - } - } - } - if (!valid9) { - const err21 = { - instancePath: instancePath + '/' + i0 + '/options/' + i1, - schemaPath: '#/items/selectCases/select/properties/options/items/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing0 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err21]; - } else { - vErrors.push(err21); - } - errors++; - } else { - errors = _errs28; - if (vErrors !== null) { - if (_errs28) { - vErrors.length = _errs28; - } else { - vErrors = null; - } - } - } - } - } else { - const err22 = { - instancePath: instancePath + '/' + i0 + '/options', - schemaPath: '#/items/selectCases/select/properties/options/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err22]; - } else { - vErrors.push(err22); - } - errors++; - } - } - } - var _valid0 = _errs18 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'markdown') { - const _errs43 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.minimal !== undefined) { - if (typeof data0.minimal !== 'boolean') { - const err23 = { - instancePath: instancePath + '/' + i0 + '/minimal', - schemaPath: '#/items/selectCases/markdown/properties/minimal/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err23]; - } else { - vErrors.push(err23); - } - errors++; - } - } - if (data0.buttons !== undefined) { - let data15 = data0.buttons; - if (Array.isArray(data15)) { - const len2 = data15.length; - for (let i2 = 0; i2 < len2; i2++) { - let data16 = data15[i2]; - if (typeof data16 !== 'string') { - const err24 = { - instancePath: instancePath + '/' + i0 + '/buttons/' + i2, - schemaPath: '#/items/selectCases/markdown/properties/buttons/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err24]; - } else { - vErrors.push(err24); - } - errors++; - } - if ( - !( - data16 === 'bold' || - data16 === 'italic' || - data16 === 'code' || - data16 === 'link' || - data16 === 'heading-one' || - data16 === 'heading-two' || - data16 === 'heading-three' || - data16 === 'heading-four' || - data16 === 'heading-five' || - data16 === 'heading-six' || - data16 === 'quote' || - data16 === 'bulleted-list' || - data16 === 'numbered-list' - ) - ) { - const err25 = { - instancePath: instancePath + '/' + i0 + '/buttons/' + i2, - schemaPath: '#/items/selectCases/markdown/properties/buttons/items/enum', - keyword: 'enum', - params: { - allowedValues: - schema44.items.selectCases.markdown.properties.buttons.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err25]; - } else { - vErrors.push(err25); - } - errors++; - } - } - } else { - const err26 = { - instancePath: instancePath + '/' + i0 + '/buttons', - schemaPath: '#/items/selectCases/markdown/properties/buttons/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err26]; - } else { - vErrors.push(err26); - } - errors++; - } - } - if (data0.editor_components !== undefined) { - let data17 = data0.editor_components; - if (Array.isArray(data17)) { - const len3 = data17.length; - for (let i3 = 0; i3 < len3; i3++) { - if (typeof data17[i3] !== 'string') { - const err27 = { - instancePath: instancePath + '/' + i0 + '/editor_components/' + i3, - schemaPath: - '#/items/selectCases/markdown/properties/editor_components/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err27]; - } else { - vErrors.push(err27); - } - errors++; - } - } - } else { - const err28 = { - instancePath: instancePath + '/' + i0 + '/editor_components', - schemaPath: '#/items/selectCases/markdown/properties/editor_components/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err28]; - } else { - vErrors.push(err28); - } - errors++; - } - } - if (data0.modes !== undefined) { - let data19 = data0.modes; - if (Array.isArray(data19)) { - if (data19.length < 1) { - const err29 = { - instancePath: instancePath + '/' + i0 + '/modes', - schemaPath: '#/items/selectCases/markdown/properties/modes/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err29]; - } else { - vErrors.push(err29); - } - errors++; - } - const len4 = data19.length; - for (let i4 = 0; i4 < len4; i4++) { - let data20 = data19[i4]; - if (typeof data20 !== 'string') { - const err30 = { - instancePath: instancePath + '/' + i0 + '/modes/' + i4, - schemaPath: '#/items/selectCases/markdown/properties/modes/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err30]; - } else { - vErrors.push(err30); - } - errors++; - } - if (!(data20 === 'raw' || data20 === 'rich_text')) { - const err31 = { - instancePath: instancePath + '/' + i0 + '/modes/' + i4, - schemaPath: '#/items/selectCases/markdown/properties/modes/items/enum', - keyword: 'enum', - params: { - allowedValues: - schema44.items.selectCases.markdown.properties.modes.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err31]; - } else { - vErrors.push(err31); - } - errors++; - } - } - } else { - const err32 = { - instancePath: instancePath + '/' + i0 + '/modes', - schemaPath: '#/items/selectCases/markdown/properties/modes/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err32]; - } else { - vErrors.push(err32); - } - errors++; - } - } - } - var _valid0 = _errs43 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'list') { - const _errs58 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.allow_add !== undefined) { - if (typeof data0.allow_add !== 'boolean') { - const err33 = { - instancePath: instancePath + '/' + i0 + '/allow_add', - schemaPath: '#/items/selectCases/list/properties/allow_add/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err33]; - } else { - vErrors.push(err33); - } - errors++; - } - } - if (data0.collapsed !== undefined) { - if (typeof data0.collapsed !== 'boolean') { - const err34 = { - instancePath: instancePath + '/' + i0 + '/collapsed', - schemaPath: '#/items/selectCases/list/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err34]; - } else { - vErrors.push(err34); - } - errors++; - } - } - if (data0.summary !== undefined) { - if (typeof data0.summary !== 'string') { - const err35 = { - instancePath: instancePath + '/' + i0 + '/summary', - schemaPath: '#/items/selectCases/list/properties/summary/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err35]; - } else { - vErrors.push(err35); - } - errors++; - } - } - if (data0.minimize_collapsed !== undefined) { - if (typeof data0.minimize_collapsed !== 'boolean') { - const err36 = { - instancePath: instancePath + '/' + i0 + '/minimize_collapsed', - schemaPath: '#/items/selectCases/list/properties/minimize_collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err36]; - } else { - vErrors.push(err36); - } - errors++; - } - } - if (data0.label_singular !== undefined) { - if (typeof data0.label_singular !== 'string') { - const err37 = { - instancePath: instancePath + '/' + i0 + '/label_singular', - schemaPath: '#/items/selectCases/list/properties/label_singular/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err37]; - } else { - vErrors.push(err37); - } - errors++; - } - } - if (data0.i18n !== undefined) { - if (typeof data0.i18n !== 'boolean') { - const err38 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/selectCases/list/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err38]; - } else { - vErrors.push(err38); - } - errors++; - } - } - if (data0.min !== undefined) { - if (!(typeof data0.min == 'number')) { - const err39 = { - instancePath: instancePath + '/' + i0 + '/min', - schemaPath: '#/items/selectCases/list/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err39]; - } else { - vErrors.push(err39); - } - errors++; - } - } - if (data0.max !== undefined) { - if (!(typeof data0.max == 'number')) { - const err40 = { - instancePath: instancePath + '/' + i0 + '/max', - schemaPath: '#/items/selectCases/list/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err40]; - } else { - vErrors.push(err40); - } - errors++; - } - } - } - var _valid0 = _errs58 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'object') { - const _errs75 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.collapsed !== undefined) { - if (typeof data0.collapsed !== 'boolean') { - const err41 = { - instancePath: instancePath + '/' + i0 + '/collapsed', - schemaPath: '#/items/selectCases/object/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err41]; - } else { - vErrors.push(err41); - } - errors++; - } - } - if (data0.i18n !== undefined) { - if (typeof data0.i18n !== 'boolean') { - const err42 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/selectCases/object/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err42]; - } else { - vErrors.push(err42); - } - errors++; - } - } - } - var _valid0 = _errs75 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'relation') { - const _errs80 = errors; - const _errs81 = errors; - let valid21 = false; - let passing2 = null; - const _errs82 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.collection === undefined) { - const err43 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err43]; - } else { - vErrors.push(err43); - } - errors++; - } - if (data0.value_field === undefined) { - const err44 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'value_field' }, - message: "must have required property '" + 'value_field' + "'", - }; - if (vErrors === null) { - vErrors = [err44]; - } else { - vErrors.push(err44); - } - errors++; - } - if (data0.search_fields === undefined) { - const err45 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'search_fields' }, - message: "must have required property '" + 'search_fields' + "'", - }; - if (vErrors === null) { - vErrors = [err45]; - } else { - vErrors.push(err45); - } - errors++; - } - } - var _valid3 = _errs82 === errors; - if (_valid3) { - valid21 = true; - passing2 = 0; - } - const _errs83 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.collection === undefined) { - const err46 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err46]; - } else { - vErrors.push(err46); - } - errors++; - } - if (data0.valueField === undefined) { - const err47 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'valueField' }, - message: "must have required property '" + 'valueField' + "'", - }; - if (vErrors === null) { - vErrors = [err47]; - } else { - vErrors.push(err47); - } - errors++; - } - if (data0.searchFields === undefined) { - const err48 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'searchFields' }, - message: "must have required property '" + 'searchFields' + "'", - }; - if (vErrors === null) { - vErrors = [err48]; - } else { - vErrors.push(err48); - } - errors++; - } - } - var _valid3 = _errs83 === errors; - if (_valid3 && valid21) { - valid21 = false; - passing2 = [passing2, 1]; - } else { - if (_valid3) { - valid21 = true; - passing2 = 1; - } - } - if (!valid21) { - const err49 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/selectCases/relation/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing2 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err49]; - } else { - vErrors.push(err49); - } - errors++; - } else { - errors = _errs81; - if (vErrors !== null) { - if (_errs81) { - vErrors.length = _errs81; - } else { - vErrors = null; - } - } - } - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.collection !== undefined) { - if (typeof data0.collection !== 'string') { - const err50 = { - instancePath: instancePath + '/' + i0 + '/collection', - schemaPath: '#/items/selectCases/relation/properties/collection/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err50]; - } else { - vErrors.push(err50); - } - errors++; - } - } - if (data0.value_field !== undefined) { - if (typeof data0.value_field !== 'string') { - const err51 = { - instancePath: instancePath + '/' + i0 + '/value_field', - schemaPath: '#/items/selectCases/relation/properties/value_field/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err51]; - } else { - vErrors.push(err51); - } - errors++; - } - } - if (data0.search_fields !== undefined) { - let data33 = data0.search_fields; - if (Array.isArray(data33)) { - if (data33.length < 1) { - const err52 = { - instancePath: instancePath + '/' + i0 + '/search_fields', - schemaPath: '#/items/selectCases/relation/properties/search_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err52]; - } else { - vErrors.push(err52); - } - errors++; - } - const len5 = data33.length; - for (let i5 = 0; i5 < len5; i5++) { - if (typeof data33[i5] !== 'string') { - const err53 = { - instancePath: instancePath + '/' + i0 + '/search_fields/' + i5, - schemaPath: - '#/items/selectCases/relation/properties/search_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err53]; - } else { - vErrors.push(err53); - } - errors++; - } - } - } else { - const err54 = { - instancePath: instancePath + '/' + i0 + '/search_fields', - schemaPath: '#/items/selectCases/relation/properties/search_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err54]; - } else { - vErrors.push(err54); - } - errors++; - } - } - if (data0.file !== undefined) { - if (typeof data0.file !== 'string') { - const err55 = { - instancePath: instancePath + '/' + i0 + '/file', - schemaPath: '#/items/selectCases/relation/properties/file/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err55]; - } else { - vErrors.push(err55); - } - errors++; - } - } - if (data0.multiple !== undefined) { - if (typeof data0.multiple !== 'boolean') { - const err56 = { - instancePath: instancePath + '/' + i0 + '/multiple', - schemaPath: '#/items/selectCases/relation/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err56]; - } else { - vErrors.push(err56); - } - errors++; - } - } - if (data0.min !== undefined) { - let data37 = data0.min; - if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { - const err57 = { - instancePath: instancePath + '/' + i0 + '/min', - schemaPath: '#/items/selectCases/relation/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err57]; - } else { - vErrors.push(err57); - } - errors++; - } - } - if (data0.max !== undefined) { - let data38 = data0.max; - if (!(typeof data38 == 'number' && !(data38 % 1) && !isNaN(data38))) { - const err58 = { - instancePath: instancePath + '/' + i0 + '/max', - schemaPath: '#/items/selectCases/relation/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err58]; - } else { - vErrors.push(err58); - } - errors++; - } - } - if (data0.display_fields !== undefined) { - let data39 = data0.display_fields; - if (Array.isArray(data39)) { - if (data39.length < 1) { - const err59 = { - instancePath: instancePath + '/' + i0 + '/display_fields', - schemaPath: '#/items/selectCases/relation/properties/display_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err59]; - } else { - vErrors.push(err59); - } - errors++; - } - const len6 = data39.length; - for (let i6 = 0; i6 < len6; i6++) { - if (typeof data39[i6] !== 'string') { - const err60 = { - instancePath: instancePath + '/' + i0 + '/display_fields/' + i6, - schemaPath: - '#/items/selectCases/relation/properties/display_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err60]; - } else { - vErrors.push(err60); - } - errors++; - } - } - } else { - const err61 = { - instancePath: instancePath + '/' + i0 + '/display_fields', - schemaPath: '#/items/selectCases/relation/properties/display_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err61]; - } else { - vErrors.push(err61); - } - errors++; - } - } - if (data0.options_length !== undefined) { - let data41 = data0.options_length; - if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { - const err62 = { - instancePath: instancePath + '/' + i0 + '/options_length', - schemaPath: '#/items/selectCases/relation/properties/options_length/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err62]; - } else { - vErrors.push(err62); - } - errors++; - } - } - } - var _valid0 = _errs80 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'boolean') { - var _valid0 = true; - valid2 = _valid0; - } else if ('' + value0 == 'map') { - const _errs106 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.decimals !== undefined) { - let data42 = data0.decimals; - if (!(typeof data42 == 'number' && !(data42 % 1) && !isNaN(data42))) { - const err63 = { - instancePath: instancePath + '/' + i0 + '/decimals', - schemaPath: '#/items/selectCases/map/properties/decimals/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err63]; - } else { - vErrors.push(err63); - } - errors++; - } - } - if (data0.type !== undefined) { - let data43 = data0.type; - if (typeof data43 !== 'string') { - const err64 = { - instancePath: instancePath + '/' + i0 + '/type', - schemaPath: '#/items/selectCases/map/properties/type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err64]; - } else { - vErrors.push(err64); - } - errors++; - } - if (!(data43 === 'Point' || data43 === 'LineString' || data43 === 'Polygon')) { - const err65 = { - instancePath: instancePath + '/' + i0 + '/type', - schemaPath: '#/items/selectCases/map/properties/type/enum', - keyword: 'enum', - params: { allowedValues: schema44.items.selectCases.map.properties.type.enum }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err65]; - } else { - vErrors.push(err65); - } - errors++; - } - } - } - var _valid0 = _errs106 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'date') { - var _valid0 = true; - valid2 = _valid0; - } else if ('' + value0 == 'datetime') { - const _errs111 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.format !== undefined) { - if (typeof data0.format !== 'string') { - const err66 = { - instancePath: instancePath + '/' + i0 + '/format', - schemaPath: '#/items/selectCases/datetime/properties/format/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err66]; - } else { - vErrors.push(err66); - } - errors++; - } - } - if (data0.date_format !== undefined) { - let data45 = data0.date_format; - const _errs115 = errors; - let valid29 = false; - let passing3 = null; - const _errs116 = errors; - if (typeof data45 !== 'string') { - const err67 = { - instancePath: instancePath + '/' + i0 + '/date_format', - schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err67]; - } else { - vErrors.push(err67); - } - errors++; - } - var _valid4 = _errs116 === errors; - if (_valid4) { - valid29 = true; - passing3 = 0; - } - const _errs118 = errors; - if (typeof data45 !== 'boolean') { - const err68 = { - instancePath: instancePath + '/' + i0 + '/date_format', - schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err68]; - } else { - vErrors.push(err68); - } - errors++; - } - var _valid4 = _errs118 === errors; - if (_valid4 && valid29) { - valid29 = false; - passing3 = [passing3, 1]; - } else { - if (_valid4) { - valid29 = true; - passing3 = 1; - } - } - if (!valid29) { - const err69 = { - instancePath: instancePath + '/' + i0 + '/date_format', - schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing3 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err69]; - } else { - vErrors.push(err69); - } - errors++; - } else { - errors = _errs115; - if (vErrors !== null) { - if (_errs115) { - vErrors.length = _errs115; - } else { - vErrors = null; - } - } - } - } - if (data0.time_format !== undefined) { - let data46 = data0.time_format; - const _errs121 = errors; - let valid30 = false; - let passing4 = null; - const _errs122 = errors; - if (typeof data46 !== 'string') { - const err70 = { - instancePath: instancePath + '/' + i0 + '/time_format', - schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err70]; - } else { - vErrors.push(err70); - } - errors++; - } - var _valid5 = _errs122 === errors; - if (_valid5) { - valid30 = true; - passing4 = 0; - } - const _errs124 = errors; - if (typeof data46 !== 'boolean') { - const err71 = { - instancePath: instancePath + '/' + i0 + '/time_format', - schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err71]; - } else { - vErrors.push(err71); - } - errors++; - } - var _valid5 = _errs124 === errors; - if (_valid5 && valid30) { - valid30 = false; - passing4 = [passing4, 1]; - } else { - if (_valid5) { - valid30 = true; - passing4 = 1; - } - } - if (!valid30) { - const err72 = { - instancePath: instancePath + '/' + i0 + '/time_format', - schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing4 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err72]; - } else { - vErrors.push(err72); - } - errors++; - } else { - errors = _errs121; - if (vErrors !== null) { - if (_errs121) { - vErrors.length = _errs121; - } else { - vErrors = null; - } - } - } - } - if (data0.picker_utc !== undefined) { - if (typeof data0.picker_utc !== 'boolean') { - const err73 = { - instancePath: instancePath + '/' + i0 + '/picker_utc', - schemaPath: '#/items/selectCases/datetime/properties/picker_utc/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err73]; - } else { - vErrors.push(err73); - } - errors++; - } - } - } - var _valid0 = _errs111 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'code') { - const _errs128 = errors; - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.default_language !== undefined) { - if (typeof data0.default_language !== 'string') { - const err74 = { - instancePath: instancePath + '/' + i0 + '/default_language', - schemaPath: '#/items/selectCases/code/properties/default_language/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err74]; - } else { - vErrors.push(err74); - } - errors++; - } - } - if (data0.allow_language_selection !== undefined) { - if (typeof data0.allow_language_selection !== 'boolean') { - const err75 = { - instancePath: instancePath + '/' + i0 + '/allow_language_selection', - schemaPath: '#/items/selectCases/code/properties/allow_language_selection/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err75]; - } else { - vErrors.push(err75); - } - errors++; - } - } - if (data0.output_code_only !== undefined) { - if (typeof data0.output_code_only !== 'boolean') { - const err76 = { - instancePath: instancePath + '/' + i0 + '/output_code_only', - schemaPath: '#/items/selectCases/code/properties/output_code_only/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err76]; - } else { - vErrors.push(err76); - } - errors++; - } - } - if (data0.keys !== undefined) { - let data51 = data0.keys; - if (data51 && typeof data51 == 'object' && !Array.isArray(data51)) { - if (data51.code !== undefined) { - if (typeof data51.code !== 'string') { - const err77 = { - instancePath: instancePath + '/' + i0 + '/keys/code', - schemaPath: '#/items/selectCases/code/properties/keys/properties/code/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err77]; - } else { - vErrors.push(err77); - } - errors++; - } - } - if (data51.lang !== undefined) { - if (typeof data51.lang !== 'string') { - const err78 = { - instancePath: instancePath + '/' + i0 + '/keys/lang', - schemaPath: '#/items/selectCases/code/properties/keys/properties/lang/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err78]; - } else { - vErrors.push(err78); - } - errors++; - } - } - } else { - const err79 = { - instancePath: instancePath + '/' + i0 + '/keys', - schemaPath: '#/items/selectCases/code/properties/keys/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err79]; - } else { - vErrors.push(err79); - } - errors++; - } - } - } - var _valid0 = _errs128 === errors; - valid2 = _valid0; - } else if ('' + value0 == 'color') { - var _valid0 = true; - valid2 = _valid0; - } - if (!valid2) { - const err80 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/select', - keyword: 'select', - params: { failingCase: 'color' }, - message: 'should match case "color" schema', - }; - if (vErrors === null) { - vErrors = [err80]; - } else { - vErrors.push(err80); - } - errors++; - } - } - } - if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { - if (data0.name === undefined) { - const err81 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/required', - keyword: 'required', - params: { missingProperty: 'name' }, - message: "must have required property '" + 'name' + "'", - }; - if (vErrors === null) { - vErrors = [err81]; - } else { - vErrors.push(err81); - } - errors++; - } - if (data0.name !== undefined) { - if (typeof data0.name !== 'string') { - const err82 = { - instancePath: instancePath + '/' + i0 + '/name', - schemaPath: '#/items/properties/name/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err82]; - } else { - vErrors.push(err82); - } - errors++; - } - } - if (data0.label !== undefined) { - if (typeof data0.label !== 'string') { - const err83 = { - instancePath: instancePath + '/' + i0 + '/label', - schemaPath: '#/items/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err83]; - } else { - vErrors.push(err83); - } - errors++; - } - } - if (data0.widget !== undefined) { - if (typeof data0.widget !== 'string') { - const err84 = { - instancePath: instancePath + '/' + i0 + '/widget', - schemaPath: '#/items/properties/widget/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err84]; - } else { - vErrors.push(err84); - } - errors++; - } - } - if (data0.required !== undefined) { - if (typeof data0.required !== 'boolean') { - const err85 = { - instancePath: instancePath + '/' + i0 + '/required', - schemaPath: '#/items/properties/required/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err85]; - } else { - vErrors.push(err85); - } - errors++; - } - } - if (data0.i18n !== undefined) { - let data58 = data0.i18n; - const _errs151 = errors; - let valid34 = false; - let passing5 = null; - const _errs152 = errors; - if (typeof data58 !== 'boolean') { - const err86 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/properties/i18n/oneOf/0/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err86]; - } else { - vErrors.push(err86); - } - errors++; - } - var _valid6 = _errs152 === errors; - if (_valid6) { - valid34 = true; - passing5 = 0; - } - const _errs154 = errors; - if (typeof data58 !== 'string') { - const err87 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/properties/i18n/oneOf/1/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err87]; - } else { - vErrors.push(err87); - } - errors++; - } - if (!(data58 === 'translate' || data58 === 'duplicate' || data58 === 'none')) { - const err88 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/properties/i18n/oneOf/1/enum', - keyword: 'enum', - params: { allowedValues: schema44.items.properties.i18n.oneOf[1].enum }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err88]; - } else { - vErrors.push(err88); - } - errors++; - } - var _valid6 = _errs154 === errors; - if (_valid6 && valid34) { - valid34 = false; - passing5 = [passing5, 1]; - } else { - if (_valid6) { - valid34 = true; - passing5 = 1; - } - } - if (!valid34) { - const err89 = { - instancePath: instancePath + '/' + i0 + '/i18n', - schemaPath: '#/items/properties/i18n/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing5 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err89]; - } else { - vErrors.push(err89); - } - errors++; - } else { - errors = _errs151; - if (vErrors !== null) { - if (_errs151) { - vErrors.length = _errs151; - } else { - vErrors = null; - } - } - } - } - if (data0.hint !== undefined) { - if (typeof data0.hint !== 'string') { - const err90 = { - instancePath: instancePath + '/' + i0 + '/hint', - schemaPath: '#/items/properties/hint/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err90]; - } else { - vErrors.push(err90); - } - errors++; - } - } - if (data0.pattern !== undefined) { - let data60 = data0.pattern; - if (Array.isArray(data60)) { - if (data60.length < 2) { - const err91 = { - instancePath: instancePath + '/' + i0 + '/pattern', - schemaPath: '#/items/properties/pattern/minItems', - keyword: 'minItems', - params: { limit: 2 }, - message: 'must NOT have fewer than 2 items', - }; - if (vErrors === null) { - vErrors = [err91]; - } else { - vErrors.push(err91); - } - errors++; - } - const len7 = data60.length; - if (len7 > 0) { - const _errs161 = errors; - let valid36 = false; - let passing6 = null; - const _errs162 = errors; - if (typeof data60[0] !== 'string') { - const err92 = { - 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 = [err92]; - } else { - vErrors.push(err92); - } - errors++; - } - var _valid7 = _errs162 === errors; - if (_valid7) { - valid36 = true; - passing6 = 0; - } - var _valid7 = true; - if (_valid7 && valid36) { - valid36 = false; - passing6 = [passing6, 1]; - } else { - if (_valid7) { - valid36 = true; - passing6 = 1; - } - } - if (!valid36) { - const err93 = { - instancePath: instancePath + '/' + i0 + '/pattern/0', - schemaPath: '#/items/properties/pattern/items/0/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing6 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err93]; - } else { - vErrors.push(err93); - } - errors++; - } else { - errors = _errs161; - if (vErrors !== null) { - if (_errs161) { - vErrors.length = _errs161; - } else { - vErrors = null; - } - } - } - } - if (len7 > 1) { - if (typeof data60[1] !== 'string') { - const err94 = { - 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 = [err94]; - } else { - vErrors.push(err94); - } - errors++; - } - } - } else { - const err95 = { - instancePath: instancePath + '/' + i0 + '/pattern', - schemaPath: '#/items/properties/pattern/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err95]; - } else { - vErrors.push(err95); - } - 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 err96 = { - instancePath: instancePath + '/' + i0, - schemaPath: '#/items/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err96]; - } else { - vErrors.push(err96); - } - errors++; - } - } - } else { - const err97 = { - instancePath, - schemaPath: '#/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err97]; - } else { - vErrors.push(err97); - } - errors++; - } - validate33.errors = vErrors; - return errors === 0; -} -function validate32( - data, - { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, -) { - /*# sourceURL="field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */ 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 == 'unknown') { - var _valid0 = true; - valid0 = _valid0; - } else if ('' + value0 == 'string') { - var _valid0 = true; - valid0 = _valid0; - } else if ('' + value0 == 'number') { - const _errs1 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.step !== undefined) { - if (!(typeof data.step == 'number')) { - const err1 = { - instancePath: instancePath + '/step', - schemaPath: '#/selectCases/number/properties/step/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - } - if (data.value_type !== undefined) { - if (typeof data.value_type !== 'string') { - const err2 = { - instancePath: instancePath + '/value_type', - schemaPath: '#/selectCases/number/properties/value_type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - } - } - if (data.min !== undefined) { - if (!(typeof data.min == 'number')) { - const err3 = { - instancePath: instancePath + '/min', - schemaPath: '#/selectCases/number/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - } - } - if (data.max !== undefined) { - if (!(typeof data.max == 'number')) { - const err4 = { - instancePath: instancePath + '/max', - schemaPath: '#/selectCases/number/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); - } - errors++; - } - } - } - var _valid0 = _errs1 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'text') { - var _valid0 = true; - valid0 = _valid0; - } else if ('' + value0 == 'image') { - const _errs10 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.allow_multiple !== undefined) { - if (typeof data.allow_multiple !== 'boolean') { - const err5 = { - instancePath: instancePath + '/allow_multiple', - schemaPath: '#/selectCases/image/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); - } - errors++; - } - } - } - var _valid0 = _errs10 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'file') { - const _errs13 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.allow_multiple !== undefined) { - if (typeof data.allow_multiple !== 'boolean') { - const err6 = { - instancePath: instancePath + '/allow_multiple', - schemaPath: '#/selectCases/file/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); - } - errors++; - } - } - } - var _valid0 = _errs13 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'select') { - const _errs16 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.options === undefined) { - const err7 = { - instancePath, - schemaPath: '#/selectCases/select/required', - keyword: 'required', - params: { missingProperty: 'options' }, - message: "must have required property '" + 'options' + "'", - }; - if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); - } - errors++; - } - if (data.multiple !== undefined) { - if (typeof data.multiple !== 'boolean') { - const err8 = { - instancePath: instancePath + '/multiple', - schemaPath: '#/selectCases/select/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); - } - errors++; - } - } - if (data.min !== undefined) { - let data7 = data.min; - if (!(typeof data7 == 'number' && !(data7 % 1) && !isNaN(data7))) { - const err9 = { - instancePath: instancePath + '/min', - schemaPath: '#/selectCases/select/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err9]; - } else { - vErrors.push(err9); - } - errors++; - } - } - if (data.max !== undefined) { - let data8 = data.max; - if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { - const err10 = { - instancePath: instancePath + '/max', - schemaPath: '#/selectCases/select/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err10]; - } else { - vErrors.push(err10); - } - errors++; - } - } - if (data.options !== undefined) { - let data9 = data.options; - if (Array.isArray(data9)) { - const len0 = data9.length; - for (let i0 = 0; i0 < len0; i0++) { - let data10 = data9[i0]; - const _errs26 = errors; - let valid7 = false; - let passing0 = null; - const _errs27 = errors; - if (typeof data10 !== 'string') { - const err11 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: '#/selectCases/select/properties/options/items/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err11]; - } else { - vErrors.push(err11); - } - errors++; - } - var _valid1 = _errs27 === errors; - if (_valid1) { - valid7 = true; - passing0 = 0; - } - const _errs29 = errors; - if (!(typeof data10 == 'number')) { - const err12 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: '#/selectCases/select/properties/options/items/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err12]; - } else { - vErrors.push(err12); - } - errors++; - } - var _valid1 = _errs29 === errors; - if (_valid1 && valid7) { - valid7 = false; - passing0 = [passing0, 1]; - } else { - if (_valid1) { - valid7 = true; - passing0 = 1; - } - const _errs31 = errors; - if (data10 && typeof data10 == 'object' && !Array.isArray(data10)) { - if (data10.label === undefined) { - const err13 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'label' }, - message: "must have required property '" + 'label' + "'", - }; - if (vErrors === null) { - vErrors = [err13]; - } else { - vErrors.push(err13); - } - errors++; - } - if (data10.value === undefined) { - const err14 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'value' }, - message: "must have required property '" + 'value' + "'", - }; - if (vErrors === null) { - vErrors = [err14]; - } else { - vErrors.push(err14); - } - errors++; - } - if (data10.label !== undefined) { - if (typeof data10.label !== 'string') { - const err15 = { - instancePath: instancePath + '/options/' + i0 + '/label', - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err15]; - } else { - vErrors.push(err15); - } - errors++; - } - } - if (data10.value !== undefined) { - let data12 = data10.value; - const _errs36 = errors; - let valid9 = false; - let passing1 = null; - const _errs37 = errors; - if (typeof data12 !== 'string') { - const err16 = { - instancePath: instancePath + '/options/' + i0 + '/value', - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err16]; - } else { - vErrors.push(err16); - } - errors++; - } - var _valid2 = _errs37 === errors; - if (_valid2) { - valid9 = true; - passing1 = 0; - } - const _errs39 = errors; - if (!(typeof data12 == 'number')) { - const err17 = { - instancePath: instancePath + '/options/' + i0 + '/value', - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err17]; - } else { - vErrors.push(err17); - } - errors++; - } - var _valid2 = _errs39 === errors; - if (_valid2 && valid9) { - valid9 = false; - passing1 = [passing1, 1]; - } else { - if (_valid2) { - valid9 = true; - passing1 = 1; - } - } - if (!valid9) { - const err18 = { - instancePath: instancePath + '/options/' + i0 + '/value', - schemaPath: - '#/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs36; - if (vErrors !== null) { - if (_errs36) { - vErrors.length = _errs36; - } else { - vErrors = null; - } - } - } - } - } else { - const err19 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: '#/selectCases/select/properties/options/items/oneOf/2/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err19]; - } else { - vErrors.push(err19); - } - errors++; - } - var _valid1 = _errs31 === errors; - if (_valid1 && valid7) { - valid7 = false; - passing0 = [passing0, 2]; - } else { - if (_valid1) { - valid7 = true; - passing0 = 2; - } - } - } - if (!valid7) { - const err20 = { - instancePath: instancePath + '/options/' + i0, - schemaPath: '#/selectCases/select/properties/options/items/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing0 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err20]; - } else { - vErrors.push(err20); - } - errors++; - } else { - errors = _errs26; - if (vErrors !== null) { - if (_errs26) { - vErrors.length = _errs26; - } else { - vErrors = null; - } - } - } - } - } else { - const err21 = { - instancePath: instancePath + '/options', - schemaPath: '#/selectCases/select/properties/options/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err21]; - } else { - vErrors.push(err21); - } - errors++; - } - } - } - var _valid0 = _errs16 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'markdown') { - const _errs41 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.minimal !== undefined) { - if (typeof data.minimal !== 'boolean') { - const err22 = { - instancePath: instancePath + '/minimal', - schemaPath: '#/selectCases/markdown/properties/minimal/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err22]; - } else { - vErrors.push(err22); - } - errors++; - } - } - if (data.buttons !== undefined) { - let data14 = data.buttons; - if (Array.isArray(data14)) { - const len1 = data14.length; - for (let i1 = 0; i1 < len1; i1++) { - let data15 = data14[i1]; - if (typeof data15 !== 'string') { - const err23 = { - instancePath: instancePath + '/buttons/' + i1, - schemaPath: '#/selectCases/markdown/properties/buttons/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err23]; - } else { - vErrors.push(err23); - } - errors++; - } - if ( - !( - data15 === 'bold' || - data15 === 'italic' || - data15 === 'code' || - data15 === 'link' || - data15 === 'heading-one' || - data15 === 'heading-two' || - data15 === 'heading-three' || - data15 === 'heading-four' || - data15 === 'heading-five' || - data15 === 'heading-six' || - data15 === 'quote' || - data15 === 'bulleted-list' || - data15 === 'numbered-list' - ) - ) { - const err24 = { - instancePath: instancePath + '/buttons/' + i1, - schemaPath: '#/selectCases/markdown/properties/buttons/items/enum', - keyword: 'enum', - params: { - allowedValues: schema43.selectCases.markdown.properties.buttons.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err24]; - } else { - vErrors.push(err24); - } - errors++; - } - } - } else { - const err25 = { - instancePath: instancePath + '/buttons', - schemaPath: '#/selectCases/markdown/properties/buttons/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err25]; - } else { - vErrors.push(err25); - } - errors++; - } - } - if (data.editor_components !== undefined) { - let data16 = data.editor_components; - if (Array.isArray(data16)) { - const len2 = data16.length; - for (let i2 = 0; i2 < len2; i2++) { - if (typeof data16[i2] !== 'string') { - const err26 = { - instancePath: instancePath + '/editor_components/' + i2, - schemaPath: '#/selectCases/markdown/properties/editor_components/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err26]; - } else { - vErrors.push(err26); - } - errors++; - } - } - } else { - const err27 = { - instancePath: instancePath + '/editor_components', - schemaPath: '#/selectCases/markdown/properties/editor_components/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err27]; - } else { - vErrors.push(err27); - } - errors++; - } - } - if (data.modes !== undefined) { - let data18 = data.modes; - if (Array.isArray(data18)) { - if (data18.length < 1) { - const err28 = { - instancePath: instancePath + '/modes', - schemaPath: '#/selectCases/markdown/properties/modes/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err28]; - } else { - vErrors.push(err28); - } - errors++; - } - const len3 = data18.length; - for (let i3 = 0; i3 < len3; i3++) { - let data19 = data18[i3]; - if (typeof data19 !== 'string') { - const err29 = { - instancePath: instancePath + '/modes/' + i3, - schemaPath: '#/selectCases/markdown/properties/modes/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err29]; - } else { - vErrors.push(err29); - } - errors++; - } - if (!(data19 === 'raw' || data19 === 'rich_text')) { - const err30 = { - instancePath: instancePath + '/modes/' + i3, - schemaPath: '#/selectCases/markdown/properties/modes/items/enum', - keyword: 'enum', - params: { - allowedValues: schema43.selectCases.markdown.properties.modes.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err30]; - } else { - vErrors.push(err30); - } - errors++; - } - } - } else { - const err31 = { - instancePath: instancePath + '/modes', - schemaPath: '#/selectCases/markdown/properties/modes/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err31]; - } else { - vErrors.push(err31); - } - errors++; - } - } - } - var _valid0 = _errs41 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'list') { - const _errs56 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.allow_add !== undefined) { - if (typeof data.allow_add !== 'boolean') { - const err32 = { - instancePath: instancePath + '/allow_add', - schemaPath: '#/selectCases/list/properties/allow_add/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err32]; - } else { - vErrors.push(err32); - } - errors++; - } - } - if (data.collapsed !== undefined) { - if (typeof data.collapsed !== 'boolean') { - const err33 = { - instancePath: instancePath + '/collapsed', - schemaPath: '#/selectCases/list/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err33]; - } else { - vErrors.push(err33); - } - errors++; - } - } - if (data.summary !== undefined) { - if (typeof data.summary !== 'string') { - const err34 = { - instancePath: instancePath + '/summary', - schemaPath: '#/selectCases/list/properties/summary/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err34]; - } else { - vErrors.push(err34); - } - errors++; - } - } - if (data.minimize_collapsed !== undefined) { - if (typeof data.minimize_collapsed !== 'boolean') { - const err35 = { - instancePath: instancePath + '/minimize_collapsed', - schemaPath: '#/selectCases/list/properties/minimize_collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err35]; - } else { - vErrors.push(err35); - } - errors++; - } - } - if (data.label_singular !== undefined) { - if (typeof data.label_singular !== 'string') { - const err36 = { - instancePath: instancePath + '/label_singular', - schemaPath: '#/selectCases/list/properties/label_singular/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err36]; - } else { - vErrors.push(err36); - } - errors++; - } - } - if (data.i18n !== undefined) { - if (typeof data.i18n !== 'boolean') { - const err37 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/selectCases/list/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err37]; - } else { - vErrors.push(err37); - } - errors++; - } - } - if (data.min !== undefined) { - if (!(typeof data.min == 'number')) { - const err38 = { - instancePath: instancePath + '/min', - schemaPath: '#/selectCases/list/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err38]; - } else { - vErrors.push(err38); - } - errors++; - } - } - if (data.max !== undefined) { - if (!(typeof data.max == 'number')) { - const err39 = { - instancePath: instancePath + '/max', - schemaPath: '#/selectCases/list/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err39]; - } else { - vErrors.push(err39); - } - errors++; - } - } - } - var _valid0 = _errs56 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'object') { - const _errs73 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.collapsed !== undefined) { - if (typeof data.collapsed !== 'boolean') { - const err40 = { - instancePath: instancePath + '/collapsed', - schemaPath: '#/selectCases/object/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err40]; - } else { - vErrors.push(err40); - } - errors++; - } - } - if (data.i18n !== undefined) { - if (typeof data.i18n !== 'boolean') { - const err41 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/selectCases/object/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err41]; - } else { - vErrors.push(err41); - } - errors++; - } - } - } - var _valid0 = _errs73 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'relation') { - const _errs78 = errors; - const _errs79 = errors; - let valid19 = false; - let passing2 = null; - const _errs80 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.collection === undefined) { - const err42 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err42]; - } else { - vErrors.push(err42); - } - errors++; - } - if (data.value_field === undefined) { - const err43 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'value_field' }, - message: "must have required property '" + 'value_field' + "'", - }; - if (vErrors === null) { - vErrors = [err43]; - } else { - vErrors.push(err43); - } - errors++; - } - if (data.search_fields === undefined) { - const err44 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'search_fields' }, - message: "must have required property '" + 'search_fields' + "'", - }; - if (vErrors === null) { - vErrors = [err44]; - } else { - vErrors.push(err44); - } - errors++; - } - } - var _valid3 = _errs80 === errors; - if (_valid3) { - valid19 = true; - passing2 = 0; - } - const _errs81 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.collection === undefined) { - const err45 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err45]; - } else { - vErrors.push(err45); - } - errors++; - } - if (data.valueField === undefined) { - const err46 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'valueField' }, - message: "must have required property '" + 'valueField' + "'", - }; - if (vErrors === null) { - vErrors = [err46]; - } else { - vErrors.push(err46); - } - errors++; - } - if (data.searchFields === undefined) { - const err47 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'searchFields' }, - message: "must have required property '" + 'searchFields' + "'", - }; - if (vErrors === null) { - vErrors = [err47]; - } else { - vErrors.push(err47); - } - errors++; - } - } - var _valid3 = _errs81 === errors; - if (_valid3 && valid19) { - valid19 = false; - passing2 = [passing2, 1]; - } else { - if (_valid3) { - valid19 = true; - passing2 = 1; - } - } - if (!valid19) { - const err48 = { - instancePath, - schemaPath: '#/selectCases/relation/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing2 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err48]; - } else { - vErrors.push(err48); - } - errors++; - } else { - errors = _errs79; - if (vErrors !== null) { - if (_errs79) { - vErrors.length = _errs79; - } else { - vErrors = null; - } - } - } - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.collection !== undefined) { - if (typeof data.collection !== 'string') { - const err49 = { - instancePath: instancePath + '/collection', - schemaPath: '#/selectCases/relation/properties/collection/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err49]; - } else { - vErrors.push(err49); - } - errors++; - } - } - if (data.value_field !== undefined) { - if (typeof data.value_field !== 'string') { - const err50 = { - instancePath: instancePath + '/value_field', - schemaPath: '#/selectCases/relation/properties/value_field/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err50]; - } else { - vErrors.push(err50); - } - errors++; - } - } - if (data.search_fields !== undefined) { - let data32 = data.search_fields; - if (Array.isArray(data32)) { - if (data32.length < 1) { - const err51 = { - instancePath: instancePath + '/search_fields', - schemaPath: '#/selectCases/relation/properties/search_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err51]; - } else { - vErrors.push(err51); - } - errors++; - } - const len4 = data32.length; - for (let i4 = 0; i4 < len4; i4++) { - if (typeof data32[i4] !== 'string') { - const err52 = { - instancePath: instancePath + '/search_fields/' + i4, - schemaPath: '#/selectCases/relation/properties/search_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err52]; - } else { - vErrors.push(err52); - } - errors++; - } - } - } else { - const err53 = { - instancePath: instancePath + '/search_fields', - schemaPath: '#/selectCases/relation/properties/search_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err53]; - } else { - vErrors.push(err53); - } - errors++; - } - } - if (data.file !== undefined) { - if (typeof data.file !== 'string') { - const err54 = { - instancePath: instancePath + '/file', - schemaPath: '#/selectCases/relation/properties/file/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err54]; - } else { - vErrors.push(err54); - } - errors++; - } - } - if (data.multiple !== undefined) { - if (typeof data.multiple !== 'boolean') { - const err55 = { - instancePath: instancePath + '/multiple', - schemaPath: '#/selectCases/relation/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err55]; - } else { - vErrors.push(err55); - } - errors++; - } - } - if (data.min !== undefined) { - let data36 = data.min; - if (!(typeof data36 == 'number' && !(data36 % 1) && !isNaN(data36))) { - const err56 = { - instancePath: instancePath + '/min', - schemaPath: '#/selectCases/relation/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err56]; - } else { - vErrors.push(err56); - } - errors++; - } - } - if (data.max !== undefined) { - let data37 = data.max; - if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { - const err57 = { - instancePath: instancePath + '/max', - schemaPath: '#/selectCases/relation/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err57]; - } else { - vErrors.push(err57); - } - errors++; - } - } - if (data.display_fields !== undefined) { - let data38 = data.display_fields; - if (Array.isArray(data38)) { - if (data38.length < 1) { - const err58 = { - instancePath: instancePath + '/display_fields', - schemaPath: '#/selectCases/relation/properties/display_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err58]; - } else { - vErrors.push(err58); - } - errors++; - } - const len5 = data38.length; - for (let i5 = 0; i5 < len5; i5++) { - if (typeof data38[i5] !== 'string') { - const err59 = { - instancePath: instancePath + '/display_fields/' + i5, - schemaPath: '#/selectCases/relation/properties/display_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err59]; - } else { - vErrors.push(err59); - } - errors++; - } - } - } else { - const err60 = { - instancePath: instancePath + '/display_fields', - schemaPath: '#/selectCases/relation/properties/display_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err60]; - } else { - vErrors.push(err60); - } - errors++; - } - } - if (data.options_length !== undefined) { - let data40 = data.options_length; - if (!(typeof data40 == 'number' && !(data40 % 1) && !isNaN(data40))) { - const err61 = { - instancePath: instancePath + '/options_length', - schemaPath: '#/selectCases/relation/properties/options_length/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err61]; - } else { - vErrors.push(err61); - } - errors++; - } - } - } - var _valid0 = _errs78 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'boolean') { - var _valid0 = true; - valid0 = _valid0; - } else if ('' + value0 == 'map') { - const _errs104 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.decimals !== undefined) { - let data41 = data.decimals; - if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { - const err62 = { - instancePath: instancePath + '/decimals', - schemaPath: '#/selectCases/map/properties/decimals/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err62]; - } else { - vErrors.push(err62); - } - errors++; - } - } - if (data.type !== undefined) { - let data42 = data.type; - if (typeof data42 !== 'string') { - const err63 = { - instancePath: instancePath + '/type', - schemaPath: '#/selectCases/map/properties/type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err63]; - } else { - vErrors.push(err63); - } - errors++; - } - if (!(data42 === 'Point' || data42 === 'LineString' || data42 === 'Polygon')) { - const err64 = { - instancePath: instancePath + '/type', - schemaPath: '#/selectCases/map/properties/type/enum', - keyword: 'enum', - params: { allowedValues: schema43.selectCases.map.properties.type.enum }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err64]; - } else { - vErrors.push(err64); - } - errors++; - } - } - } - var _valid0 = _errs104 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'date') { - var _valid0 = true; - valid0 = _valid0; - } else if ('' + value0 == 'datetime') { - const _errs109 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.format !== undefined) { - if (typeof data.format !== 'string') { - const err65 = { - instancePath: instancePath + '/format', - schemaPath: '#/selectCases/datetime/properties/format/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err65]; - } else { - vErrors.push(err65); - } - errors++; - } - } - if (data.date_format !== undefined) { - let data44 = data.date_format; - const _errs113 = errors; - let valid27 = false; - let passing3 = null; - const _errs114 = errors; - if (typeof data44 !== 'string') { - const err66 = { - instancePath: instancePath + '/date_format', - schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err66]; - } else { - vErrors.push(err66); - } - errors++; - } - var _valid4 = _errs114 === errors; - if (_valid4) { - valid27 = true; - passing3 = 0; - } - const _errs116 = errors; - if (typeof data44 !== 'boolean') { - const err67 = { - instancePath: instancePath + '/date_format', - schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err67]; - } else { - vErrors.push(err67); - } - errors++; - } - var _valid4 = _errs116 === errors; - if (_valid4 && valid27) { - valid27 = false; - passing3 = [passing3, 1]; - } else { - if (_valid4) { - valid27 = true; - passing3 = 1; - } - } - if (!valid27) { - const err68 = { - instancePath: instancePath + '/date_format', - schemaPath: '#/selectCases/datetime/properties/date_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing3 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err68]; - } else { - vErrors.push(err68); - } - errors++; - } else { - errors = _errs113; - if (vErrors !== null) { - if (_errs113) { - vErrors.length = _errs113; - } else { - vErrors = null; - } - } - } - } - if (data.time_format !== undefined) { - let data45 = data.time_format; - const _errs119 = errors; - let valid28 = false; - let passing4 = null; - const _errs120 = errors; - if (typeof data45 !== 'string') { - const err69 = { - instancePath: instancePath + '/time_format', - schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err69]; - } else { - vErrors.push(err69); - } - errors++; - } - var _valid5 = _errs120 === errors; - if (_valid5) { - valid28 = true; - passing4 = 0; - } - const _errs122 = errors; - if (typeof data45 !== 'boolean') { - const err70 = { - instancePath: instancePath + '/time_format', - schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err70]; - } else { - vErrors.push(err70); - } - errors++; - } - var _valid5 = _errs122 === errors; - if (_valid5 && valid28) { - valid28 = false; - passing4 = [passing4, 1]; - } else { - if (_valid5) { - valid28 = true; - passing4 = 1; - } - } - if (!valid28) { - const err71 = { - instancePath: instancePath + '/time_format', - schemaPath: '#/selectCases/datetime/properties/time_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing4 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err71]; - } else { - vErrors.push(err71); - } - errors++; - } else { - errors = _errs119; - if (vErrors !== null) { - if (_errs119) { - vErrors.length = _errs119; - } else { - vErrors = null; - } - } - } - } - if (data.picker_utc !== undefined) { - if (typeof data.picker_utc !== 'boolean') { - const err72 = { - instancePath: instancePath + '/picker_utc', - schemaPath: '#/selectCases/datetime/properties/picker_utc/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err72]; - } else { - vErrors.push(err72); - } - errors++; - } - } - } - var _valid0 = _errs109 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'code') { - const _errs126 = errors; - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.default_language !== undefined) { - if (typeof data.default_language !== 'string') { - const err73 = { - instancePath: instancePath + '/default_language', - schemaPath: '#/selectCases/code/properties/default_language/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err73]; - } else { - vErrors.push(err73); - } - errors++; - } - } - if (data.allow_language_selection !== undefined) { - if (typeof data.allow_language_selection !== 'boolean') { - const err74 = { - instancePath: instancePath + '/allow_language_selection', - schemaPath: '#/selectCases/code/properties/allow_language_selection/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err74]; - } else { - vErrors.push(err74); - } - errors++; - } - } - if (data.output_code_only !== undefined) { - if (typeof data.output_code_only !== 'boolean') { - const err75 = { - instancePath: instancePath + '/output_code_only', - schemaPath: '#/selectCases/code/properties/output_code_only/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err75]; - } else { - vErrors.push(err75); - } - errors++; - } - } - if (data.keys !== undefined) { - let data50 = data.keys; - if (data50 && typeof data50 == 'object' && !Array.isArray(data50)) { - if (data50.code !== undefined) { - if (typeof data50.code !== 'string') { - const err76 = { - instancePath: instancePath + '/keys/code', - schemaPath: '#/selectCases/code/properties/keys/properties/code/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err76]; - } else { - vErrors.push(err76); - } - errors++; - } - } - if (data50.lang !== undefined) { - if (typeof data50.lang !== 'string') { - const err77 = { - instancePath: instancePath + '/keys/lang', - schemaPath: '#/selectCases/code/properties/keys/properties/lang/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err77]; - } else { - vErrors.push(err77); - } - errors++; - } - } - } else { - const err78 = { - instancePath: instancePath + '/keys', - schemaPath: '#/selectCases/code/properties/keys/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err78]; - } else { - vErrors.push(err78); - } - errors++; - } - } - } - var _valid0 = _errs126 === errors; - valid0 = _valid0; - } else if ('' + value0 == 'color') { - var _valid0 = true; - valid0 = _valid0; - } - if (!valid0) { - const err79 = { - instancePath, - schemaPath: '#/select', - keyword: 'select', - params: { failingCase: 'color' }, - message: 'should match case "color" schema', - }; - if (vErrors === null) { - vErrors = [err79]; - } else { - vErrors.push(err79); - } - errors++; - } - } - } - if (data && typeof data == 'object' && !Array.isArray(data)) { - if (data.name === undefined) { - const err80 = { - instancePath, - schemaPath: '#/required', - keyword: 'required', - params: { missingProperty: 'name' }, - message: "must have required property '" + 'name' + "'", - }; - if (vErrors === null) { - vErrors = [err80]; - } else { - vErrors.push(err80); - } - errors++; - } - if (data.name !== undefined) { - if (typeof data.name !== 'string') { - const err81 = { - instancePath: instancePath + '/name', - schemaPath: '#/properties/name/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err81]; - } else { - vErrors.push(err81); - } - errors++; - } - } - if (data.label !== undefined) { - if (typeof data.label !== 'string') { - const err82 = { - instancePath: instancePath + '/label', - schemaPath: '#/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err82]; - } else { - vErrors.push(err82); - } - errors++; - } - } - if (data.widget !== undefined) { - if (typeof data.widget !== 'string') { - const err83 = { - instancePath: instancePath + '/widget', - schemaPath: '#/properties/widget/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err83]; - } else { - vErrors.push(err83); - } - errors++; - } - } - if (data.required !== undefined) { - if (typeof data.required !== 'boolean') { - const err84 = { - instancePath: instancePath + '/required', - schemaPath: '#/properties/required/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err84]; - } else { - vErrors.push(err84); - } - errors++; - } - } - if (data.i18n !== undefined) { - let data57 = data.i18n; - const _errs149 = errors; - let valid32 = false; - let passing5 = null; - const _errs150 = errors; - if (typeof data57 !== 'boolean') { - const err85 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/properties/i18n/oneOf/0/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err85]; - } else { - vErrors.push(err85); - } - errors++; - } - var _valid6 = _errs150 === errors; - if (_valid6) { - valid32 = true; - passing5 = 0; - } - const _errs152 = errors; - if (typeof data57 !== 'string') { - const err86 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/properties/i18n/oneOf/1/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err86]; - } else { - vErrors.push(err86); - } - errors++; - } - if (!(data57 === 'translate' || data57 === 'duplicate' || data57 === 'none')) { - const err87 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/properties/i18n/oneOf/1/enum', - keyword: 'enum', - params: { allowedValues: schema43.properties.i18n.oneOf[1].enum }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err87]; - } else { - vErrors.push(err87); - } - errors++; - } - var _valid6 = _errs152 === errors; - if (_valid6 && valid32) { - valid32 = false; - passing5 = [passing5, 1]; - } else { - if (_valid6) { - valid32 = true; - passing5 = 1; - } - } - if (!valid32) { - const err88 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/properties/i18n/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing5 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err88]; - } else { - vErrors.push(err88); - } - errors++; - } else { - errors = _errs149; - if (vErrors !== null) { - if (_errs149) { - vErrors.length = _errs149; - } else { - vErrors = null; - } - } - } - } - if (data.hint !== undefined) { - if (typeof data.hint !== 'string') { - const err89 = { - instancePath: instancePath + '/hint', - schemaPath: '#/properties/hint/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err89]; - } else { - vErrors.push(err89); - } - errors++; - } - } - if (data.pattern !== undefined) { - let data59 = data.pattern; - if (Array.isArray(data59)) { - if (data59.length < 2) { - const err90 = { - instancePath: instancePath + '/pattern', - schemaPath: '#/properties/pattern/minItems', - keyword: 'minItems', - params: { limit: 2 }, - message: 'must NOT have fewer than 2 items', - }; - if (vErrors === null) { - vErrors = [err90]; - } else { - vErrors.push(err90); - } - errors++; - } - const len6 = data59.length; - if (len6 > 0) { - const _errs159 = errors; - let valid34 = false; - let passing6 = null; - const _errs160 = errors; - if (typeof data59[0] !== 'string') { - const err91 = { - 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 = [err91]; - } else { - vErrors.push(err91); - } - errors++; - } - var _valid7 = _errs160 === errors; - if (_valid7) { - valid34 = true; - passing6 = 0; - } - var _valid7 = true; - if (_valid7 && valid34) { - valid34 = false; - passing6 = [passing6, 1]; - } else { - if (_valid7) { - valid34 = true; - passing6 = 1; - } - } - if (!valid34) { - const err92 = { - instancePath: instancePath + '/pattern/0', - schemaPath: '#/properties/pattern/items/0/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing6 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err92]; - } else { - vErrors.push(err92); - } - errors++; - } else { - errors = _errs159; - if (vErrors !== null) { - if (_errs159) { - vErrors.length = _errs159; - } else { - vErrors = null; - } - } - } - } - if (len6 > 1) { - if (typeof data59[1] !== 'string') { - const err93 = { - instancePath: instancePath + '/pattern/1', - schemaPath: '#/properties/pattern/items/1/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err93]; - } else { - vErrors.push(err93); - } - errors++; - } - } - } else { - const err94 = { - instancePath: instancePath + '/pattern', - schemaPath: '#/properties/pattern/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err94]; - } else { - vErrors.push(err94); - } - 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 ( - !validate33(data.fields, { - instancePath: instancePath + '/fields', - parentData: data, - parentDataProperty: 'fields', - rootData, - }) - ) { - vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); - errors = vErrors.length; - } - } - if (data.types !== undefined) { - if ( - !validate33(data.types, { - instancePath: instancePath + '/types', - parentData: data, - parentDataProperty: 'types', - rootData, - }) - ) { - vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); - errors = vErrors.length; - } - } - } else { - const err95 = { - instancePath, - schemaPath: '#/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err95]; - } else { - vErrors.push(err95); - } - errors++; - } - validate32.errors = vErrors; - return errors === 0; -} -function validate24( - data, - { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, -) { - /*# sourceURL="https://netlify-cms/object.json" */ 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: schema40.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 (func9(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 < len0; i0++) { - if (typeof data7[i0] !== 'string') { - const err16 = { - instancePath: instancePath + '/local_backend/allowed_hosts/' + i0, - schemaPath: - '#/properties/local_backend/oneOf/1/properties/allowed_hosts/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err16]; - } else { - vErrors.push(err16); - } - errors++; - } - } - } else { - const err17 = { - instancePath: instancePath + '/local_backend/allowed_hosts', - schemaPath: '#/properties/local_backend/oneOf/1/properties/allowed_hosts/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err17]; - } else { - vErrors.push(err17); - } - errors++; - } - } - } else { - const err18 = { - instancePath: instancePath + '/local_backend', - schemaPath: '#/properties/local_backend/oneOf/1/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err18]; - } else { - vErrors.push(err18); - } - errors++; - } - var _valid1 = _errs18 === errors; - if (_valid1 && valid3) { - valid3 = false; - passing0 = [passing0, 1]; - } else { - if (_valid1) { - valid3 = true; - passing0 = 1; - } - } - if (!valid3) { - const err19 = { - instancePath: instancePath + '/local_backend', - schemaPath: '#/properties/local_backend/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing0 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err19]; - } else { - vErrors.push(err19); - } - errors++; - } else { - errors = _errs15; - if (vErrors !== null) { - if (_errs15) { - vErrors.length = _errs15; - } else { - vErrors = null; - } - } - } - } - if (data.locale !== undefined) { - if (typeof data.locale !== 'string') { - const err20 = { - instancePath: instancePath + '/locale', - schemaPath: '#/properties/locale/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err20]; - } else { - vErrors.push(err20); - } - errors++; - } - } - if (data.i18n !== undefined) { - let data10 = data.i18n; - if (data10 && typeof data10 == 'object' && !Array.isArray(data10)) { - if (data10.structure === undefined) { - const err21 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/properties/i18n/required', - keyword: 'required', - params: { missingProperty: 'structure' }, - message: "must have required property '" + 'structure' + "'", - }; - if (vErrors === null) { - vErrors = [err21]; - } else { - vErrors.push(err21); - } - errors++; - } - if (data10.locales === undefined) { - const err22 = { - instancePath: instancePath + '/i18n', - schemaPath: '#/properties/i18n/required', - keyword: 'required', - params: { missingProperty: 'locales' }, - message: "must have required property '" + 'locales' + "'", - }; - if (vErrors === null) { - vErrors = [err22]; - } else { - vErrors.push(err22); - } - errors++; - } - if (data10.structure !== undefined) { - let data11 = data10.structure; - if (typeof data11 !== 'string') { - const err23 = { - instancePath: instancePath + '/i18n/structure', - schemaPath: '#/properties/i18n/properties/structure/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err23]; - } else { - vErrors.push(err23); - } - errors++; - } - if ( - !( - data11 === 'multiple_folders' || - data11 === 'multiple_files' || - data11 === 'single_file' - ) - ) { - const err24 = { - instancePath: instancePath + '/i18n/structure', - schemaPath: '#/properties/i18n/properties/structure/enum', - keyword: 'enum', - params: { allowedValues: schema40.properties.i18n.properties.structure.enum }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err24]; - } else { - vErrors.push(err24); - } - errors++; - } - } - if (data10.locales !== undefined) { - let data12 = data10.locales; - if (Array.isArray(data12)) { - if (data12.length < 2) { - const err25 = { - instancePath: instancePath + '/i18n/locales', - schemaPath: '#/properties/i18n/properties/locales/minItems', - keyword: 'minItems', - params: { limit: 2 }, - message: 'must NOT have fewer than 2 items', - }; - if (vErrors === null) { - vErrors = [err25]; - } else { - vErrors.push(err25); - } - errors++; - } - const len1 = data12.length; - for (let i1 = 0; i1 < len1; i1++) { - let data13 = data12[i1]; - if (typeof data13 === 'string') { - if (func9(data13) > 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 (func9(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 (func9(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 (func9(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: schema40.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: schema40.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 < len2; i3++) { - let data30 = data29[i3]; - const _errs71 = errors; - const _errs72 = errors; - if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { - let missing0; - if ( - (data30.sortable_fields === undefined && (missing0 = 'sortable_fields')) || - (data30.sortableFields === undefined && (missing0 = 'sortableFields')) - ) { - const err55 = {}; - if (vErrors === null) { - vErrors = [err55]; - } else { - vErrors.push(err55); - } - errors++; - } - } - var valid15 = _errs72 === errors; - if (valid15) { - const err56 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: '#/properties/collections/items/not', - keyword: 'not', - params: {}, - message: 'must NOT be valid', - }; - if (vErrors === null) { - vErrors = [err56]; - } else { - vErrors.push(err56); - } - errors++; - } else { - errors = _errs71; - if (vErrors !== null) { - if (_errs71) { - vErrors.length = _errs71; - } else { - vErrors = null; - } - } - } - const _errs73 = errors; - let valid16 = false; - let passing1 = null; - const _errs74 = errors; - if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { - if (data30.files === undefined) { - const err57 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: '#/properties/collections/items/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'files' }, - message: "must have required property '" + 'files' + "'", - }; - if (vErrors === null) { - vErrors = [err57]; - } else { - vErrors.push(err57); - } - errors++; - } - } - var _valid2 = _errs74 === errors; - if (_valid2) { - valid16 = true; - passing1 = 0; - } - const _errs75 = errors; - if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { - if (data30.folder === undefined) { - const err58 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: '#/properties/collections/items/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'folder' }, - message: "must have required property '" + 'folder' + "'", - }; - if (vErrors === null) { - vErrors = [err58]; - } else { - vErrors.push(err58); - } - errors++; - } - if (data30.fields === undefined) { - const err59 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: '#/properties/collections/items/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'fields' }, - message: "must have required property '" + 'fields' + "'", - }; - if (vErrors === null) { - vErrors = [err59]; - } else { - vErrors.push(err59); - } - errors++; - } - } - var _valid2 = _errs75 === errors; - if (_valid2 && valid16) { - valid16 = false; - passing1 = [passing1, 1]; - } else { - if (_valid2) { - valid16 = true; - passing1 = 1; - } - } - if (!valid16) { - const err60 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: '#/properties/collections/items/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing1 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err60]; - } else { - vErrors.push(err60); - } - errors++; - } else { - errors = _errs73; - if (vErrors !== null) { - if (_errs73) { - vErrors.length = _errs73; - } else { - vErrors = null; - } - } - } - const _errs76 = errors; - let valid17 = true; - const _errs77 = errors; - if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { - let missing1; - if (data30.extension === undefined && (missing1 = 'extension')) { - const err61 = {}; - if (vErrors === null) { - vErrors = [err61]; - } else { - vErrors.push(err61); - } - errors++; - } - } - var _valid3 = _errs77 === errors; - errors = _errs76; - if (vErrors !== null) { - if (_errs76) { - vErrors.length = _errs76; - } else { - vErrors = null; - } - } - if (_valid3) { - const _errs78 = errors; - const _errs79 = errors; - let valid18 = true; - const _errs80 = errors; - if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { - if (data30.extension !== undefined) { - let data31 = data30.extension; - if ( - !( - data31 === 'yml' || - data31 === 'yaml' || - data31 === 'toml' || - data31 === 'json' || - data31 === 'md' || - data31 === 'markdown' || - data31 === 'html' - ) - ) { - const err62 = {}; - if (vErrors === null) { - vErrors = [err62]; - } else { - vErrors.push(err62); - } - errors++; - } - } - } - var _valid4 = _errs80 === errors; - errors = _errs79; - if (vErrors !== null) { - if (_errs79) { - vErrors.length = _errs79; - } else { - vErrors = null; - } - } - if (!_valid4) { - const _errs82 = errors; - if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { - if (data30.format === undefined) { - const err63 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: '#/properties/collections/items/then/else/required', - keyword: 'required', - params: { missingProperty: 'format' }, - message: "must have required property '" + 'format' + "'", - }; - if (vErrors === null) { - vErrors = [err63]; - } else { - vErrors.push(err63); - } - errors++; - } - } - var _valid4 = _errs82 === errors; - valid18 = _valid4; - } - if (!valid18) { - const err64 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: '#/properties/collections/items/then/if', - keyword: 'if', - params: { failingKeyword: 'else' }, - message: 'must match "else" schema', - }; - if (vErrors === null) { - vErrors = [err64]; - } else { - vErrors.push(err64); - } - errors++; - } - var _valid3 = _errs78 === errors; - valid17 = _valid3; - } - if (!valid17) { - const err65 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: '#/properties/collections/items/if', - keyword: 'if', - params: { failingKeyword: 'then' }, - message: 'must match "then" schema', - }; - if (vErrors === null) { - vErrors = [err65]; - } else { - vErrors.push(err65); - } - errors++; - } - if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { - if (data30.name === undefined) { - const err66 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: '#/properties/collections/items/required', - keyword: 'required', - params: { missingProperty: 'name' }, - message: "must have required property '" + 'name' + "'", - }; - if (vErrors === null) { - vErrors = [err66]; - } else { - vErrors.push(err66); - } - errors++; - } - if (data30.label === undefined) { - const err67 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: '#/properties/collections/items/required', - keyword: 'required', - params: { missingProperty: 'label' }, - message: "must have required property '" + 'label' + "'", - }; - if (vErrors === null) { - vErrors = [err67]; - } else { - vErrors.push(err67); - } - errors++; - } - if (data30.frontmatter_delimiter !== undefined) { - if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { - if (data30.format === undefined) { - const err68 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: - '#/properties/collections/items/dependencies/frontmatter_delimiter/required', - keyword: 'required', - params: { missingProperty: 'format' }, - message: "must have required property '" + 'format' + "'", - }; - if (vErrors === null) { - vErrors = [err68]; - } else { - vErrors.push(err68); - } - errors++; - } - if (data30.format !== undefined) { - let data32 = data30.format; - if ( - !( - data32 === 'yaml-frontmatter' || - data32 === 'toml-frontmatter' || - data32 === 'json-frontmatter' - ) - ) { - const err69 = { - instancePath: instancePath + '/collections/' + i3 + '/format', - schemaPath: - '#/properties/collections/items/dependencies/frontmatter_delimiter/properties/format/enum', - keyword: 'enum', - params: { - allowedValues: - schema40.properties.collections.items.dependencies.frontmatter_delimiter - .properties.format.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err69]; - } else { - vErrors.push(err69); - } - errors++; - } - } - } - } - if (data30.name !== undefined) { - if (typeof data30.name !== 'string') { - const err70 = { - instancePath: instancePath + '/collections/' + i3 + '/name', - schemaPath: '#/properties/collections/items/properties/name/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err70]; - } else { - vErrors.push(err70); - } - errors++; - } - } - if (data30.label !== undefined) { - if (typeof data30.label !== 'string') { - const err71 = { - instancePath: instancePath + '/collections/' + i3 + '/label', - schemaPath: '#/properties/collections/items/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err71]; - } else { - vErrors.push(err71); - } - errors++; - } - } - if (data30.label_singular !== undefined) { - if (typeof data30.label_singular !== 'string') { - const err72 = { - instancePath: instancePath + '/collections/' + i3 + '/label_singular', - schemaPath: '#/properties/collections/items/properties/label_singular/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err72]; - } else { - vErrors.push(err72); - } - errors++; - } - } - if (data30.description !== undefined) { - if (typeof data30.description !== 'string') { - const err73 = { - instancePath: instancePath + '/collections/' + i3 + '/description', - schemaPath: '#/properties/collections/items/properties/description/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err73]; - } else { - vErrors.push(err73); - } - errors++; - } - } - if (data30.folder !== undefined) { - if (typeof data30.folder !== 'string') { - const err74 = { - instancePath: instancePath + '/collections/' + i3 + '/folder', - schemaPath: '#/properties/collections/items/properties/folder/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err74]; - } else { - vErrors.push(err74); - } - errors++; - } - } - if (data30.files !== undefined) { - let data38 = data30.files; - if (Array.isArray(data38)) { - const len3 = data38.length; - for (let i4 = 0; i4 < len3; i4++) { - let data39 = data38[i4]; - if (data39 && typeof data39 == 'object' && !Array.isArray(data39)) { - if (data39.name === undefined) { - const err75 = { - instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, - schemaPath: - '#/properties/collections/items/properties/files/items/required', - keyword: 'required', - params: { missingProperty: 'name' }, - message: "must have required property '" + 'name' + "'", - }; - if (vErrors === null) { - vErrors = [err75]; - } else { - vErrors.push(err75); - } - errors++; - } - if (data39.label === undefined) { - const err76 = { - instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, - schemaPath: - '#/properties/collections/items/properties/files/items/required', - keyword: 'required', - params: { missingProperty: 'label' }, - message: "must have required property '" + 'label' + "'", - }; - if (vErrors === null) { - vErrors = [err76]; - } else { - vErrors.push(err76); - } - errors++; - } - if (data39.file === undefined) { - const err77 = { - instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, - schemaPath: - '#/properties/collections/items/properties/files/items/required', - keyword: 'required', - params: { missingProperty: 'file' }, - message: "must have required property '" + 'file' + "'", - }; - if (vErrors === null) { - vErrors = [err77]; - } else { - vErrors.push(err77); - } - errors++; - } - if (data39.fields === undefined) { - const err78 = { - instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, - schemaPath: - '#/properties/collections/items/properties/files/items/required', - keyword: 'required', - params: { missingProperty: 'fields' }, - message: "must have required property '" + 'fields' + "'", - }; - if (vErrors === null) { - vErrors = [err78]; - } else { - vErrors.push(err78); - } - errors++; - } - if (data39.name !== undefined) { - if (typeof data39.name !== 'string') { - const err79 = { - instancePath: - instancePath + '/collections/' + i3 + '/files/' + i4 + '/name', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/name/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err79]; - } else { - vErrors.push(err79); - } - errors++; - } - } - if (data39.label !== undefined) { - if (typeof data39.label !== 'string') { - const err80 = { - instancePath: - instancePath + '/collections/' + i3 + '/files/' + i4 + '/label', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err80]; - } else { - vErrors.push(err80); - } - errors++; - } - } - if (data39.label_singular !== undefined) { - if (typeof data39.label_singular !== 'string') { - const err81 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/label_singular', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/label_singular/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err81]; - } else { - vErrors.push(err81); - } - errors++; - } - } - if (data39.description !== undefined) { - if (typeof data39.description !== 'string') { - const err82 = { - instancePath: - instancePath + '/collections/' + i3 + '/files/' + i4 + '/description', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/description/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err82]; - } else { - vErrors.push(err82); - } - errors++; - } - } - if (data39.file !== undefined) { - if (typeof data39.file !== 'string') { - const err83 = { - instancePath: - instancePath + '/collections/' + i3 + '/files/' + i4 + '/file', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/file/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err83]; - } else { - vErrors.push(err83); - } - errors++; - } - } - if (data39.preview_path !== undefined) { - if (typeof data39.preview_path !== 'string') { - const err84 = { - instancePath: - instancePath + '/collections/' + i3 + '/files/' + i4 + '/preview_path', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/preview_path/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err84]; - } else { - vErrors.push(err84); - } - errors++; - } - } - if (data39.preview_path_date_field !== undefined) { - if (typeof data39.preview_path_date_field !== 'string') { - const err85 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/preview_path_date_field', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/preview_path_date_field/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err85]; - } else { - vErrors.push(err85); - } - errors++; - } - } - if (data39.fields !== undefined) { - let data47 = data39.fields; - if (Array.isArray(data47)) { - if (data47.length < 1) { - const err86 = { - instancePath: - instancePath + '/collections/' + i3 + '/files/' + i4 + '/fields', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err86]; - } else { - vErrors.push(err86); - } - errors++; - } - const len4 = data47.length; - for (let i5 = 0; i5 < len4; i5++) { - let data48 = data47[i5]; - const vSchema6 = data48 && data48.widget; - if (!(vSchema6 === undefined)) { - if ( - typeof vSchema6 !== 'string' && - !(typeof vSchema6 == 'number') && - typeof vSchema6 !== 'boolean' && - vSchema6 !== null - ) { - const err87 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/select', - keyword: 'select', - params: {}, - message: - '"select" keyword must be string,number,boolean,null ($data)', - }; - if (vErrors === null) { - vErrors = [err87]; - } else { - vErrors.push(err87); - } - errors++; - } else { - let valid28 = true; - const value0 = vSchema6 === null ? 'null' : vSchema6; - if ('' + value0 == 'unknown') { - var _valid5 = true; - valid28 = _valid5; - } else if ('' + value0 == 'string') { - var _valid5 = true; - valid28 = _valid5; - } else if ('' + value0 == 'number') { - const _errs117 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.step !== undefined) { - if (!(typeof data48.step == 'number')) { - const err88 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/step', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/step/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err88]; - } else { - vErrors.push(err88); - } - errors++; - } - } - if (data48.value_type !== undefined) { - if (typeof data48.value_type !== 'string') { - const err89 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/value_type', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/value_type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err89]; - } else { - vErrors.push(err89); - } - errors++; - } - } - if (data48.min !== undefined) { - if (!(typeof data48.min == 'number')) { - const err90 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/min', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err90]; - } else { - vErrors.push(err90); - } - errors++; - } - } - if (data48.max !== undefined) { - if (!(typeof data48.max == 'number')) { - const err91 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/max', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err91]; - } else { - vErrors.push(err91); - } - errors++; - } - } - } - var _valid5 = _errs117 === errors; - valid28 = _valid5; - } else if ('' + value0 == 'text') { - var _valid5 = true; - valid28 = _valid5; - } else if ('' + value0 == 'image') { - const _errs126 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.allow_multiple !== undefined) { - if (typeof data48.allow_multiple !== 'boolean') { - const err92 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/allow_multiple', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/image/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err92]; - } else { - vErrors.push(err92); - } - errors++; - } - } - } - var _valid5 = _errs126 === errors; - valid28 = _valid5; - } else if ('' + value0 == 'file') { - const _errs129 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.allow_multiple !== undefined) { - if (typeof data48.allow_multiple !== 'boolean') { - const err93 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/allow_multiple', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/file/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err93]; - } else { - vErrors.push(err93); - } - errors++; - } - } - } - var _valid5 = _errs129 === errors; - valid28 = _valid5; - } else if ('' + value0 == 'select') { - const _errs132 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.options === undefined) { - const err94 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/required', - keyword: 'required', - params: { missingProperty: 'options' }, - message: "must have required property '" + 'options' + "'", - }; - if (vErrors === null) { - vErrors = [err94]; - } else { - vErrors.push(err94); - } - errors++; - } - if (data48.multiple !== undefined) { - if (typeof data48.multiple !== 'boolean') { - const err95 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/multiple', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err95]; - } else { - vErrors.push(err95); - } - errors++; - } - } - if (data48.min !== undefined) { - let data56 = data48.min; - if ( - !( - typeof data56 == 'number' && - !(data56 % 1) && - !isNaN(data56) - ) - ) { - const err96 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/min', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err96]; - } else { - vErrors.push(err96); - } - errors++; - } - } - if (data48.max !== undefined) { - let data57 = data48.max; - if ( - !( - typeof data57 == 'number' && - !(data57 % 1) && - !isNaN(data57) - ) - ) { - const err97 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/max', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err97]; - } else { - vErrors.push(err97); - } - errors++; - } - } - if (data48.options !== undefined) { - let data58 = data48.options; - if (Array.isArray(data58)) { - const len5 = data58.length; - for (let i6 = 0; i6 < len5; i6++) { - let data59 = data58[i6]; - const _errs142 = errors; - let valid35 = false; - let passing2 = null; - const _errs143 = errors; - if (typeof data59 !== 'string') { - const err98 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options/' + - i6, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err98]; - } else { - vErrors.push(err98); - } - errors++; - } - var _valid6 = _errs143 === errors; - if (_valid6) { - valid35 = true; - passing2 = 0; - } - const _errs145 = errors; - if (!(typeof data59 == 'number')) { - const err99 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options/' + - i6, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err99]; - } else { - vErrors.push(err99); - } - errors++; - } - var _valid6 = _errs145 === errors; - if (_valid6 && valid35) { - valid35 = false; - passing2 = [passing2, 1]; - } else { - if (_valid6) { - valid35 = true; - passing2 = 1; - } - const _errs147 = errors; - if ( - data59 && - typeof data59 == 'object' && - !Array.isArray(data59) - ) { - if (data59.label === undefined) { - const err100 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options/' + - i6, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'label' }, - message: - "must have required property '" + 'label' + "'", - }; - if (vErrors === null) { - vErrors = [err100]; - } else { - vErrors.push(err100); - } - errors++; - } - if (data59.value === undefined) { - const err101 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options/' + - i6, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'value' }, - message: - "must have required property '" + 'value' + "'", - }; - if (vErrors === null) { - vErrors = [err101]; - } else { - vErrors.push(err101); - } - errors++; - } - if (data59.label !== undefined) { - if (typeof data59.label !== 'string') { - const err102 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options/' + - i6 + - '/label', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err102]; - } else { - vErrors.push(err102); - } - errors++; - } - } - if (data59.value !== undefined) { - let data61 = data59.value; - const _errs152 = errors; - let valid37 = false; - let passing3 = null; - const _errs153 = errors; - if (typeof data61 !== 'string') { - const err103 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options/' + - i6 + - '/value', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err103]; - } else { - vErrors.push(err103); - } - errors++; - } - var _valid7 = _errs153 === errors; - if (_valid7) { - valid37 = true; - passing3 = 0; - } - const _errs155 = errors; - if (!(typeof data61 == 'number')) { - const err104 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options/' + - i6 + - '/value', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err104]; - } else { - vErrors.push(err104); - } - errors++; - } - var _valid7 = _errs155 === errors; - if (_valid7 && valid37) { - valid37 = false; - passing3 = [passing3, 1]; - } else { - if (_valid7) { - valid37 = true; - passing3 = 1; - } - } - if (!valid37) { - const err105 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options/' + - i6 + - '/value', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs152; - if (vErrors !== null) { - if (_errs152) { - vErrors.length = _errs152; - } else { - vErrors = null; - } - } - } - } - } else { - const err106 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options/' + - i6, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err106]; - } else { - vErrors.push(err106); - } - errors++; - } - var _valid6 = _errs147 === errors; - if (_valid6 && valid35) { - valid35 = false; - passing2 = [passing2, 2]; - } else { - if (_valid6) { - valid35 = true; - passing2 = 2; - } - } - } - if (!valid35) { - const err107 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options/' + - i6, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing2 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err107]; - } else { - vErrors.push(err107); - } - errors++; - } else { - errors = _errs142; - if (vErrors !== null) { - if (_errs142) { - vErrors.length = _errs142; - } else { - vErrors = null; - } - } - } - } - } else { - const err108 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err108]; - } else { - vErrors.push(err108); - } - errors++; - } - } - } - var _valid5 = _errs132 === errors; - valid28 = _valid5; - } else if ('' + value0 == 'markdown') { - const _errs157 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.minimal !== undefined) { - if (typeof data48.minimal !== 'boolean') { - const err109 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/minimal', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/minimal/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err109]; - } else { - vErrors.push(err109); - } - errors++; - } - } - if (data48.buttons !== undefined) { - let data63 = data48.buttons; - if (Array.isArray(data63)) { - const len6 = data63.length; - for (let i7 = 0; i7 < len6; i7++) { - let data64 = data63[i7]; - if (typeof data64 !== 'string') { - const err110 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/buttons/' + - i7, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/buttons/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err110]; - } else { - vErrors.push(err110); - } - errors++; - } - if ( - !( - data64 === 'bold' || - data64 === 'italic' || - data64 === 'code' || - data64 === 'link' || - data64 === 'heading-one' || - data64 === 'heading-two' || - data64 === 'heading-three' || - data64 === 'heading-four' || - data64 === 'heading-five' || - data64 === 'heading-six' || - data64 === 'quote' || - data64 === 'bulleted-list' || - data64 === 'numbered-list' - ) - ) { - const err111 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/buttons/' + - i7, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/buttons/items/enum', - keyword: 'enum', - params: { - allowedValues: - schema40.properties.collections.items.properties - .files.items.properties.fields.items.selectCases - .markdown.properties.buttons.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err111]; - } else { - vErrors.push(err111); - } - errors++; - } - } - } else { - const err112 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/buttons', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/buttons/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err112]; - } else { - vErrors.push(err112); - } - errors++; - } - } - if (data48.editor_components !== undefined) { - let data65 = data48.editor_components; - if (Array.isArray(data65)) { - const len7 = data65.length; - for (let i8 = 0; i8 < len7; i8++) { - if (typeof data65[i8] !== 'string') { - const err113 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/editor_components/' + - i8, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/editor_components/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err113]; - } else { - vErrors.push(err113); - } - errors++; - } - } - } else { - const err114 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/editor_components', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/editor_components/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err114]; - } else { - vErrors.push(err114); - } - errors++; - } - } - if (data48.modes !== undefined) { - let data67 = data48.modes; - if (Array.isArray(data67)) { - if (data67.length < 1) { - const err115 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/modes', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err115]; - } else { - vErrors.push(err115); - } - errors++; - } - const len8 = data67.length; - for (let i9 = 0; i9 < len8; i9++) { - let data68 = data67[i9]; - if (typeof data68 !== 'string') { - const err116 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/modes/' + - i9, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err116]; - } else { - vErrors.push(err116); - } - errors++; - } - if (!(data68 === 'raw' || data68 === 'rich_text')) { - const err117 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/modes/' + - i9, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/items/enum', - keyword: 'enum', - params: { - allowedValues: - schema40.properties.collections.items.properties - .files.items.properties.fields.items.selectCases - .markdown.properties.modes.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err117]; - } else { - vErrors.push(err117); - } - errors++; - } - } - } else { - const err118 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/modes', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err118]; - } else { - vErrors.push(err118); - } - errors++; - } - } - } - var _valid5 = _errs157 === errors; - valid28 = _valid5; - } else if ('' + value0 == 'list') { - const _errs172 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.allow_add !== undefined) { - if (typeof data48.allow_add !== 'boolean') { - const err119 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/allow_add', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/allow_add/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err119]; - } else { - vErrors.push(err119); - } - errors++; - } - } - if (data48.collapsed !== undefined) { - if (typeof data48.collapsed !== 'boolean') { - const err120 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/collapsed', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err120]; - } else { - vErrors.push(err120); - } - errors++; - } - } - if (data48.summary !== undefined) { - if (typeof data48.summary !== 'string') { - const err121 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/summary', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/summary/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err121]; - } else { - vErrors.push(err121); - } - errors++; - } - } - if (data48.minimize_collapsed !== undefined) { - if (typeof data48.minimize_collapsed !== 'boolean') { - const err122 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/minimize_collapsed', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/minimize_collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err122]; - } else { - vErrors.push(err122); - } - errors++; - } - } - if (data48.label_singular !== undefined) { - if (typeof data48.label_singular !== 'string') { - const err123 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/label_singular', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/label_singular/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err123]; - } else { - vErrors.push(err123); - } - errors++; - } - } - if (data48.i18n !== undefined) { - if (typeof data48.i18n !== 'boolean') { - const err124 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/i18n', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err124]; - } else { - vErrors.push(err124); - } - errors++; - } - } - if (data48.min !== undefined) { - if (!(typeof data48.min == 'number')) { - const err125 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/min', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err125]; - } else { - vErrors.push(err125); - } - errors++; - } - } - if (data48.max !== undefined) { - if (!(typeof data48.max == 'number')) { - const err126 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/max', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err126]; - } else { - vErrors.push(err126); - } - errors++; - } - } - } - var _valid5 = _errs172 === errors; - valid28 = _valid5; - } else if ('' + value0 == 'object') { - const _errs189 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.collapsed !== undefined) { - if (typeof data48.collapsed !== 'boolean') { - const err127 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/collapsed', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/object/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err127]; - } else { - vErrors.push(err127); - } - errors++; - } - } - if (data48.i18n !== undefined) { - if (typeof data48.i18n !== 'boolean') { - const err128 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/i18n', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/object/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err128]; - } else { - vErrors.push(err128); - } - errors++; - } - } - } - var _valid5 = _errs189 === errors; - valid28 = _valid5; - } else if ('' + value0 == 'relation') { - const _errs194 = errors; - const _errs195 = errors; - let valid47 = false; - let passing4 = null; - const _errs196 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.collection === undefined) { - const err129 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err129]; - } else { - vErrors.push(err129); - } - errors++; - } - if (data48.value_field === undefined) { - const err130 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'value_field' }, - message: - "must have required property '" + 'value_field' + "'", - }; - if (vErrors === null) { - vErrors = [err130]; - } else { - vErrors.push(err130); - } - errors++; - } - if (data48.search_fields === undefined) { - const err131 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'search_fields' }, - message: - "must have required property '" + 'search_fields' + "'", - }; - if (vErrors === null) { - vErrors = [err131]; - } else { - vErrors.push(err131); - } - errors++; - } - } - var _valid8 = _errs196 === errors; - if (_valid8) { - valid47 = true; - passing4 = 0; - } - const _errs197 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.collection === undefined) { - const err132 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err132]; - } else { - vErrors.push(err132); - } - errors++; - } - if (data48.valueField === undefined) { - const err133 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'valueField' }, - message: "must have required property '" + 'valueField' + "'", - }; - if (vErrors === null) { - vErrors = [err133]; - } else { - vErrors.push(err133); - } - errors++; - } - if (data48.searchFields === undefined) { - const err134 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'searchFields' }, - message: - "must have required property '" + 'searchFields' + "'", - }; - if (vErrors === null) { - vErrors = [err134]; - } else { - vErrors.push(err134); - } - errors++; - } - } - var _valid8 = _errs197 === errors; - if (_valid8 && valid47) { - valid47 = false; - passing4 = [passing4, 1]; - } else { - if (_valid8) { - valid47 = true; - passing4 = 1; - } - } - if (!valid47) { - const err135 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing4 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err135]; - } else { - vErrors.push(err135); - } - errors++; - } else { - errors = _errs195; - if (vErrors !== null) { - if (_errs195) { - vErrors.length = _errs195; - } else { - vErrors = null; - } - } - } - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.collection !== undefined) { - if (typeof data48.collection !== 'string') { - const err136 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/collection', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/collection/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err136]; - } else { - vErrors.push(err136); - } - errors++; - } - } - if (data48.value_field !== undefined) { - if (typeof data48.value_field !== 'string') { - const err137 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/value_field', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/value_field/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err137]; - } else { - vErrors.push(err137); - } - errors++; - } - } - if (data48.search_fields !== undefined) { - let data81 = data48.search_fields; - if (Array.isArray(data81)) { - if (data81.length < 1) { - const err138 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/search_fields', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/search_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err138]; - } else { - vErrors.push(err138); - } - errors++; - } - const len9 = data81.length; - for (let i10 = 0; i10 < len9; i10++) { - if (typeof data81[i10] !== 'string') { - const err139 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/search_fields/' + - i10, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/search_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err139]; - } else { - vErrors.push(err139); - } - errors++; - } - } - } else { - const err140 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/search_fields', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/search_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err140]; - } else { - vErrors.push(err140); - } - errors++; - } - } - if (data48.file !== undefined) { - if (typeof data48.file !== 'string') { - const err141 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/file', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/file/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err141]; - } else { - vErrors.push(err141); - } - errors++; - } - } - if (data48.multiple !== undefined) { - if (typeof data48.multiple !== 'boolean') { - const err142 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/multiple', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err142]; - } else { - vErrors.push(err142); - } - errors++; - } - } - if (data48.min !== undefined) { - let data85 = data48.min; - if ( - !( - typeof data85 == 'number' && - !(data85 % 1) && - !isNaN(data85) - ) - ) { - const err143 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/min', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err143]; - } else { - vErrors.push(err143); - } - errors++; - } - } - if (data48.max !== undefined) { - let data86 = data48.max; - if ( - !( - typeof data86 == 'number' && - !(data86 % 1) && - !isNaN(data86) - ) - ) { - const err144 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/max', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err144]; - } else { - vErrors.push(err144); - } - errors++; - } - } - if (data48.display_fields !== undefined) { - let data87 = data48.display_fields; - if (Array.isArray(data87)) { - if (data87.length < 1) { - const err145 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/display_fields', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/display_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err145]; - } else { - vErrors.push(err145); - } - errors++; - } - const len10 = data87.length; - for (let i11 = 0; i11 < len10; i11++) { - if (typeof data87[i11] !== 'string') { - const err146 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/display_fields/' + - i11, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/display_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err146]; - } else { - vErrors.push(err146); - } - errors++; - } - } - } else { - const err147 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/display_fields', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/display_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err147]; - } else { - vErrors.push(err147); - } - errors++; - } - } - if (data48.options_length !== undefined) { - let data89 = data48.options_length; - if ( - !( - typeof data89 == 'number' && - !(data89 % 1) && - !isNaN(data89) - ) - ) { - const err148 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/options_length', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/options_length/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err148]; - } else { - vErrors.push(err148); - } - errors++; - } - } - } - var _valid5 = _errs194 === errors; - valid28 = _valid5; - } else if ('' + value0 == 'boolean') { - var _valid5 = true; - valid28 = _valid5; - } else if ('' + value0 == 'map') { - const _errs220 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.decimals !== undefined) { - let data90 = data48.decimals; - if ( - !( - typeof data90 == 'number' && - !(data90 % 1) && - !isNaN(data90) - ) - ) { - const err149 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/decimals', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/map/properties/decimals/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err149]; - } else { - vErrors.push(err149); - } - errors++; - } - } - if (data48.type !== undefined) { - let data91 = data48.type; - if (typeof data91 !== 'string') { - const err150 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/type', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/map/properties/type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err150]; - } else { - vErrors.push(err150); - } - errors++; - } - if ( - !( - data91 === 'Point' || - data91 === 'LineString' || - data91 === 'Polygon' - ) - ) { - const err151 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/type', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/map/properties/type/enum', - keyword: 'enum', - params: { - allowedValues: - schema40.properties.collections.items.properties.files - .items.properties.fields.items.selectCases.map - .properties.type.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err151]; - } else { - vErrors.push(err151); - } - errors++; - } - } - } - var _valid5 = _errs220 === errors; - valid28 = _valid5; - } else if ('' + value0 == 'date') { - var _valid5 = true; - valid28 = _valid5; - } else if ('' + value0 == 'datetime') { - const _errs225 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.format !== undefined) { - if (typeof data48.format !== 'string') { - const err152 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/format', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/format/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err152]; - } else { - vErrors.push(err152); - } - errors++; - } - } - if (data48.date_format !== undefined) { - let data93 = data48.date_format; - const _errs229 = errors; - let valid55 = false; - let passing5 = null; - const _errs230 = errors; - if (typeof data93 !== 'string') { - const err153 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/date_format', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err153]; - } else { - vErrors.push(err153); - } - errors++; - } - var _valid9 = _errs230 === errors; - if (_valid9) { - valid55 = true; - passing5 = 0; - } - const _errs232 = errors; - if (typeof data93 !== 'boolean') { - const err154 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/date_format', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err154]; - } else { - vErrors.push(err154); - } - errors++; - } - var _valid9 = _errs232 === errors; - if (_valid9 && valid55) { - valid55 = false; - passing5 = [passing5, 1]; - } else { - if (_valid9) { - valid55 = true; - passing5 = 1; - } - } - if (!valid55) { - const err155 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/date_format', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing5 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err155]; - } else { - vErrors.push(err155); - } - errors++; - } else { - errors = _errs229; - if (vErrors !== null) { - if (_errs229) { - vErrors.length = _errs229; - } else { - vErrors = null; - } - } - } - } - if (data48.time_format !== undefined) { - let data94 = data48.time_format; - const _errs235 = errors; - let valid56 = false; - let passing6 = null; - const _errs236 = errors; - if (typeof data94 !== 'string') { - const err156 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/time_format', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err156]; - } else { - vErrors.push(err156); - } - errors++; - } - var _valid10 = _errs236 === errors; - if (_valid10) { - valid56 = true; - passing6 = 0; - } - const _errs238 = errors; - if (typeof data94 !== 'boolean') { - const err157 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/time_format', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err157]; - } else { - vErrors.push(err157); - } - errors++; - } - var _valid10 = _errs238 === errors; - if (_valid10 && valid56) { - valid56 = false; - passing6 = [passing6, 1]; - } else { - if (_valid10) { - valid56 = true; - passing6 = 1; - } - } - if (!valid56) { - const err158 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/time_format', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing6 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err158]; - } else { - vErrors.push(err158); - } - errors++; - } else { - errors = _errs235; - if (vErrors !== null) { - if (_errs235) { - vErrors.length = _errs235; - } else { - vErrors = null; - } - } - } - } - if (data48.picker_utc !== undefined) { - if (typeof data48.picker_utc !== 'boolean') { - const err159 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/picker_utc', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/picker_utc/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err159]; - } else { - vErrors.push(err159); - } - errors++; - } - } - } - var _valid5 = _errs225 === errors; - valid28 = _valid5; - } else if ('' + value0 == 'code') { - const _errs242 = errors; - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.default_language !== undefined) { - if (typeof data48.default_language !== 'string') { - const err160 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/default_language', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/default_language/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err160]; - } else { - vErrors.push(err160); - } - errors++; - } - } - if (data48.allow_language_selection !== undefined) { - if (typeof data48.allow_language_selection !== 'boolean') { - const err161 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/allow_language_selection', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/allow_language_selection/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err161]; - } else { - vErrors.push(err161); - } - errors++; - } - } - if (data48.output_code_only !== undefined) { - if (typeof data48.output_code_only !== 'boolean') { - const err162 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/output_code_only', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/output_code_only/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err162]; - } else { - vErrors.push(err162); - } - errors++; - } - } - if (data48.keys !== undefined) { - let data99 = data48.keys; - if ( - data99 && - typeof data99 == 'object' && - !Array.isArray(data99) - ) { - if (data99.code !== undefined) { - if (typeof data99.code !== 'string') { - const err163 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/keys/code', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/keys/properties/code/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err163]; - } else { - vErrors.push(err163); - } - errors++; - } - } - if (data99.lang !== undefined) { - if (typeof data99.lang !== 'string') { - const err164 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/keys/lang', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/keys/properties/lang/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err164]; - } else { - vErrors.push(err164); - } - errors++; - } - } - } else { - const err165 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/keys', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/keys/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err165]; - } else { - vErrors.push(err165); - } - errors++; - } - } - } - var _valid5 = _errs242 === errors; - valid28 = _valid5; - } else if ('' + value0 == 'color') { - var _valid5 = true; - valid28 = _valid5; - } - if (!valid28) { - const err166 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/select', - keyword: 'select', - params: { failingCase: 'color' }, - message: 'should match case "color" schema', - }; - if (vErrors === null) { - vErrors = [err166]; - } else { - vErrors.push(err166); - } - errors++; - } - } - } - if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { - if (data48.name === undefined) { - const err167 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5, - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/required', - keyword: 'required', - params: { missingProperty: 'name' }, - message: "must have required property '" + 'name' + "'", - }; - if (vErrors === null) { - vErrors = [err167]; - } else { - vErrors.push(err167); - } - errors++; - } - if (data48.name !== undefined) { - if (typeof data48.name !== 'string') { - const err168 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/name', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/properties/name/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err168]; - } else { - vErrors.push(err168); - } - errors++; - } - } - if (data48.label !== undefined) { - if (typeof data48.label !== 'string') { - const err169 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/label', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err169]; - } else { - vErrors.push(err169); - } - errors++; - } - } - if (data48.widget !== undefined) { - if (typeof data48.widget !== 'string') { - const err170 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/widget', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/properties/widget/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err170]; - } else { - vErrors.push(err170); - } - errors++; - } - } - if (data48.required !== undefined) { - if (typeof data48.required !== 'boolean') { - const err171 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/required', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/properties/required/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err171]; - } else { - vErrors.push(err171); - } - errors++; - } - } - if (data48.i18n !== undefined) { - let data106 = data48.i18n; - const _errs265 = errors; - let valid60 = false; - let passing7 = null; - const _errs266 = errors; - if (typeof data106 !== 'boolean') { - const err172 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/i18n', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/0/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err172]; - } else { - vErrors.push(err172); - } - errors++; - } - var _valid11 = _errs266 === errors; - if (_valid11) { - valid60 = true; - passing7 = 0; - } - const _errs268 = errors; - if (typeof data106 !== 'string') { - const err173 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/i18n', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err173]; - } else { - vErrors.push(err173); - } - errors++; - } - if ( - !( - data106 === 'translate' || - data106 === 'duplicate' || - data106 === 'none' - ) - ) { - const err174 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/i18n', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/enum', - keyword: 'enum', - params: { - allowedValues: - schema40.properties.collections.items.properties.files.items - .properties.fields.items.properties.i18n.oneOf[1].enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err174]; - } else { - vErrors.push(err174); - } - errors++; - } - var _valid11 = _errs268 === errors; - if (_valid11 && valid60) { - valid60 = false; - passing7 = [passing7, 1]; - } else { - if (_valid11) { - valid60 = true; - passing7 = 1; - } - } - if (!valid60) { - const err175 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/i18n', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing7 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err175]; - } else { - vErrors.push(err175); - } - errors++; - } else { - errors = _errs265; - if (vErrors !== null) { - if (_errs265) { - vErrors.length = _errs265; - } else { - vErrors = null; - } - } - } - } - if (data48.hint !== undefined) { - if (typeof data48.hint !== 'string') { - const err176 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/hint', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/properties/hint/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err176]; - } else { - vErrors.push(err176); - } - errors++; - } - } - if (data48.pattern !== undefined) { - let data108 = data48.pattern; - if (Array.isArray(data108)) { - if (data108.length < 2) { - const err177 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/pattern', - schemaPath: - '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/minItems', - keyword: 'minItems', - params: { limit: 2 }, - message: 'must NOT have fewer than 2 items', - }; - if (vErrors === null) { - vErrors = [err177]; - } else { - vErrors.push(err177); - } - errors++; - } - const len11 = data108.length; - if (len11 > 0) { - const _errs275 = errors; - let valid62 = false; - let passing8 = null; - const _errs276 = errors; - if (typeof data108[0] !== 'string') { - const err178 = { - 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 = [err178]; - } else { - vErrors.push(err178); - } - errors++; - } - var _valid12 = _errs276 === errors; - if (_valid12) { - valid62 = true; - passing8 = 0; - } - var _valid12 = true; - if (_valid12 && valid62) { - valid62 = false; - passing8 = [passing8, 1]; - } else { - if (_valid12) { - valid62 = true; - passing8 = 1; - } - } - if (!valid62) { - const err179 = { - 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: passing8 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err179]; - } else { - vErrors.push(err179); - } - errors++; - } else { - errors = _errs275; - if (vErrors !== null) { - if (_errs275) { - vErrors.length = _errs275; - } else { - vErrors = null; - } - } - } - } - if (len11 > 1) { - if (typeof data108[1] !== 'string') { - const err180 = { - 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 = [err180]; - } else { - vErrors.push(err180); - } - errors++; - } - } - } else { - const err181 = { - 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 = [err181]; - } else { - vErrors.push(err181); - } - errors++; - } - } - if (data48.field !== undefined) { - if ( - !validate25(data48.field, { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/field', - parentData: data48, - parentDataProperty: 'field', - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate25.errors - : vErrors.concat(validate25.errors); - errors = vErrors.length; - } - } - if (data48.fields !== undefined) { - if ( - !validate26(data48.fields, { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/fields', - parentData: data48, - parentDataProperty: 'fields', - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate26.errors - : vErrors.concat(validate26.errors); - errors = vErrors.length; - } - } - if (data48.types !== undefined) { - if ( - !validate26(data48.types, { - instancePath: - instancePath + - '/collections/' + - i3 + - '/files/' + - i4 + - '/fields/' + - i5 + - '/types', - parentData: data48, - parentDataProperty: 'types', - rootData, - }) - ) { - vErrors = - vErrors === null - ? validate26.errors - : vErrors.concat(validate26.errors); - errors = vErrors.length; - } - } - } else { - const err182 = { - 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 = [err182]; - } else { - vErrors.push(err182); - } - errors++; - } - } - } else { - const err183 = { - 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 = [err183]; - } else { - vErrors.push(err183); - } - errors++; - } - } - } else { - const err184 = { - 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 = [err184]; - } else { - vErrors.push(err184); - } - errors++; - } - } - } else { - const err185 = { - 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 = [err185]; - } else { - vErrors.push(err185); - } - errors++; - } - } - if (data30.identifier_field !== undefined) { - if (typeof data30.identifier_field !== 'string') { - const err186 = { - 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 = [err186]; - } else { - vErrors.push(err186); - } - errors++; - } - } - if (data30.summary !== undefined) { - if (typeof data30.summary !== 'string') { - const err187 = { - 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 = [err187]; - } else { - vErrors.push(err187); - } - errors++; - } - } - if (data30.slug !== undefined) { - if (typeof data30.slug !== 'string') { - const err188 = { - 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 = [err188]; - } else { - vErrors.push(err188); - } - errors++; - } - } - if (data30.path !== undefined) { - if (typeof data30.path !== 'string') { - const err189 = { - 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 = [err189]; - } else { - vErrors.push(err189); - } - errors++; - } - } - if (data30.preview_path !== undefined) { - if (typeof data30.preview_path !== 'string') { - const err190 = { - 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 = [err190]; - } else { - vErrors.push(err190); - } - errors++; - } - } - if (data30.preview_path_date_field !== undefined) { - if (typeof data30.preview_path_date_field !== 'string') { - const err191 = { - 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 = [err191]; - } else { - vErrors.push(err191); - } - errors++; - } - } - if (data30.create !== undefined) { - if (typeof data30.create !== 'boolean') { - const err192 = { - 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 = [err192]; - } else { - vErrors.push(err192); - } - errors++; - } - } - if (data30.publish !== undefined) { - if (typeof data30.publish !== 'boolean') { - const err193 = { - 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 = [err193]; - } else { - vErrors.push(err193); - } - errors++; - } - } - if (data30.hide !== undefined) { - if (typeof data30.hide !== 'boolean') { - const err194 = { - 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 = [err194]; - } else { - vErrors.push(err194); - } - errors++; - } - } - if (data30.editor !== undefined) { - let data123 = data30.editor; - if (data123 && typeof data123 == 'object' && !Array.isArray(data123)) { - if (data123.preview !== undefined) { - if (typeof data123.preview !== 'boolean') { - const err195 = { - 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 = [err195]; - } else { - vErrors.push(err195); - } - errors++; - } - } - } else { - const err196 = { - 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 = [err196]; - } else { - vErrors.push(err196); - } - errors++; - } - } - if (data30.format !== undefined) { - let data125 = data30.format; - if (typeof data125 !== 'string') { - const err197 = { - 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 = [err197]; - } else { - vErrors.push(err197); - } - errors++; - } - if ( - !( - data125 === 'yml' || - data125 === 'yaml' || - data125 === 'toml' || - data125 === 'json' || - data125 === 'frontmatter' || - data125 === 'json-frontmatter' || - data125 === 'toml-frontmatter' || - data125 === 'yaml-frontmatter' - ) - ) { - const err198 = { - instancePath: instancePath + '/collections/' + i3 + '/format', - schemaPath: '#/properties/collections/items/properties/format/enum', - keyword: 'enum', - params: { - allowedValues: schema40.properties.collections.items.properties.format.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err198]; - } else { - vErrors.push(err198); - } - errors++; - } - } - if (data30.extension !== undefined) { - if (typeof data30.extension !== 'string') { - const err199 = { - 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 = [err199]; - } else { - vErrors.push(err199); - } - errors++; - } - } - if (data30.frontmatter_delimiter !== undefined) { - let data127 = data30.frontmatter_delimiter; - if (typeof data127 !== 'string' && !Array.isArray(data127)) { - const err200 = { - instancePath: instancePath + '/collections/' + i3 + '/frontmatter_delimiter', - schemaPath: - '#/properties/collections/items/properties/frontmatter_delimiter/type', - keyword: 'type', - params: { - type: schema40.properties.collections.items.properties.frontmatter_delimiter - .type, - }, - message: 'must be string,array', - }; - if (vErrors === null) { - vErrors = [err200]; - } else { - vErrors.push(err200); - } - errors++; - } - if (Array.isArray(data127)) { - if (data127.length > 2) { - const err201 = { - 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 = [err201]; - } else { - vErrors.push(err201); - } - errors++; - } - if (data127.length < 2) { - const err202 = { - 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 = [err202]; - } else { - vErrors.push(err202); - } - errors++; - } - const len12 = data127.length; - for (let i12 = 0; i12 < len12; i12++) { - if (typeof data127[i12] !== 'string') { - const err203 = { - instancePath: - instancePath + '/collections/' + i3 + '/frontmatter_delimiter/' + i12, - schemaPath: - '#/properties/collections/items/properties/frontmatter_delimiter/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err203]; - } else { - vErrors.push(err203); - } - errors++; - } - } - } - } - if (data30.fields !== undefined) { - let data129 = data30.fields; - if (Array.isArray(data129)) { - if (data129.length < 1) { - const err204 = { - instancePath: instancePath + '/collections/' + i3 + '/fields', - schemaPath: '#/properties/collections/items/properties/fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err204]; - } else { - vErrors.push(err204); - } - errors++; - } - const len13 = data129.length; - for (let i13 = 0; i13 < len13; i13++) { - let data130 = data129[i13]; - const vSchema12 = data130 && data130.widget; - if (!(vSchema12 === undefined)) { - if ( - typeof vSchema12 !== 'string' && - !(typeof vSchema12 == 'number') && - typeof vSchema12 !== 'boolean' && - vSchema12 !== null - ) { - const err205 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: '#/properties/collections/items/properties/fields/items/select', - keyword: 'select', - params: {}, - message: '"select" keyword must be string,number,boolean,null ($data)', - }; - if (vErrors === null) { - vErrors = [err205]; - } else { - vErrors.push(err205); - } - errors++; - } else { - let valid68 = true; - const value1 = vSchema12 === null ? 'null' : vSchema12; - if ('' + value1 == 'unknown') { - var _valid13 = true; - valid68 = _valid13; - } else if ('' + value1 == 'string') { - var _valid13 = true; - valid68 = _valid13; - } else if ('' + value1 == 'number') { - const _errs317 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.step !== undefined) { - if (!(typeof data130.step == 'number')) { - const err206 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/step', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/number/properties/step/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err206]; - } else { - vErrors.push(err206); - } - errors++; - } - } - if (data130.value_type !== undefined) { - if (typeof data130.value_type !== 'string') { - const err207 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/value_type', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/number/properties/value_type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err207]; - } else { - vErrors.push(err207); - } - errors++; - } - } - if (data130.min !== undefined) { - if (!(typeof data130.min == 'number')) { - const err208 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/number/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err208]; - } else { - vErrors.push(err208); - } - errors++; - } - } - if (data130.max !== undefined) { - if (!(typeof data130.max == 'number')) { - const err209 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/number/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err209]; - } else { - vErrors.push(err209); - } - errors++; - } - } - } - var _valid13 = _errs317 === errors; - valid68 = _valid13; - } else if ('' + value1 == 'text') { - var _valid13 = true; - valid68 = _valid13; - } else if ('' + value1 == 'image') { - const _errs326 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.allow_multiple !== undefined) { - if (typeof data130.allow_multiple !== 'boolean') { - const err210 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/allow_multiple', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/image/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err210]; - } else { - vErrors.push(err210); - } - errors++; - } - } - } - var _valid13 = _errs326 === errors; - valid68 = _valid13; - } else if ('' + value1 == 'file') { - const _errs329 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.allow_multiple !== undefined) { - if (typeof data130.allow_multiple !== 'boolean') { - const err211 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/allow_multiple', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/file/properties/allow_multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err211]; - } else { - vErrors.push(err211); - } - errors++; - } - } - } - var _valid13 = _errs329 === errors; - valid68 = _valid13; - } else if ('' + value1 == 'select') { - const _errs332 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.options === undefined) { - const err212 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/required', - keyword: 'required', - params: { missingProperty: 'options' }, - message: "must have required property '" + 'options' + "'", - }; - if (vErrors === null) { - vErrors = [err212]; - } else { - vErrors.push(err212); - } - errors++; - } - if (data130.multiple !== undefined) { - if (typeof data130.multiple !== 'boolean') { - const err213 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/multiple', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err213]; - } else { - vErrors.push(err213); - } - errors++; - } - } - if (data130.min !== undefined) { - let data138 = data130.min; - if ( - !(typeof data138 == 'number' && !(data138 % 1) && !isNaN(data138)) - ) { - const err214 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err214]; - } else { - vErrors.push(err214); - } - errors++; - } - } - if (data130.max !== undefined) { - let data139 = data130.max; - if ( - !(typeof data139 == 'number' && !(data139 % 1) && !isNaN(data139)) - ) { - const err215 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err215]; - } else { - vErrors.push(err215); - } - errors++; - } - } - if (data130.options !== undefined) { - let data140 = data130.options; - if (Array.isArray(data140)) { - const len14 = data140.length; - for (let i14 = 0; i14 < len14; i14++) { - let data141 = data140[i14]; - const _errs342 = errors; - let valid75 = false; - let passing9 = null; - const _errs343 = errors; - if (typeof data141 !== 'string') { - const err216 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options/' + - i14, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err216]; - } else { - vErrors.push(err216); - } - errors++; - } - var _valid14 = _errs343 === errors; - if (_valid14) { - valid75 = true; - passing9 = 0; - } - const _errs345 = errors; - if (!(typeof data141 == 'number')) { - const err217 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options/' + - i14, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err217]; - } else { - vErrors.push(err217); - } - errors++; - } - var _valid14 = _errs345 === errors; - if (_valid14 && valid75) { - valid75 = false; - passing9 = [passing9, 1]; - } else { - if (_valid14) { - valid75 = true; - passing9 = 1; - } - const _errs347 = errors; - if ( - data141 && - typeof data141 == 'object' && - !Array.isArray(data141) - ) { - if (data141.label === undefined) { - const err218 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options/' + - i14, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'label' }, - message: "must have required property '" + 'label' + "'", - }; - if (vErrors === null) { - vErrors = [err218]; - } else { - vErrors.push(err218); - } - errors++; - } - if (data141.value === undefined) { - const err219 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options/' + - i14, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', - keyword: 'required', - params: { missingProperty: 'value' }, - message: "must have required property '" + 'value' + "'", - }; - if (vErrors === null) { - vErrors = [err219]; - } else { - vErrors.push(err219); - } - errors++; - } - if (data141.label !== undefined) { - if (typeof data141.label !== 'string') { - const err220 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options/' + - i14 + - '/label', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err220]; - } else { - vErrors.push(err220); - } - errors++; - } - } - if (data141.value !== undefined) { - let data143 = data141.value; - const _errs352 = errors; - let valid77 = false; - let passing10 = null; - const _errs353 = errors; - if (typeof data143 !== 'string') { - const err221 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options/' + - i14 + - '/value', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err221]; - } else { - vErrors.push(err221); - } - errors++; - } - var _valid15 = _errs353 === errors; - if (_valid15) { - valid77 = true; - passing10 = 0; - } - const _errs355 = errors; - if (!(typeof data143 == 'number')) { - const err222 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options/' + - i14 + - '/value', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err222]; - } else { - vErrors.push(err222); - } - errors++; - } - var _valid15 = _errs355 === errors; - if (_valid15 && valid77) { - valid77 = false; - passing10 = [passing10, 1]; - } else { - if (_valid15) { - valid77 = true; - passing10 = 1; - } - } - if (!valid77) { - const err223 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options/' + - i14 + - '/value', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing10 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err223]; - } else { - vErrors.push(err223); - } - errors++; - } else { - errors = _errs352; - if (vErrors !== null) { - if (_errs352) { - vErrors.length = _errs352; - } else { - vErrors = null; - } - } - } - } - } else { - const err224 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options/' + - i14, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err224]; - } else { - vErrors.push(err224); - } - errors++; - } - var _valid14 = _errs347 === errors; - if (_valid14 && valid75) { - valid75 = false; - passing9 = [passing9, 2]; - } else { - if (_valid14) { - valid75 = true; - passing9 = 2; - } - } - } - if (!valid75) { - const err225 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options/' + - i14, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing9 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err225]; - } else { - vErrors.push(err225); - } - errors++; - } else { - errors = _errs342; - if (vErrors !== null) { - if (_errs342) { - vErrors.length = _errs342; - } else { - vErrors = null; - } - } - } - } - } else { - const err226 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err226]; - } else { - vErrors.push(err226); - } - errors++; - } - } - } - var _valid13 = _errs332 === errors; - valid68 = _valid13; - } else if ('' + value1 == 'markdown') { - const _errs357 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.minimal !== undefined) { - if (typeof data130.minimal !== 'boolean') { - const err227 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/minimal', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/minimal/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err227]; - } else { - vErrors.push(err227); - } - errors++; - } - } - if (data130.buttons !== undefined) { - let data145 = data130.buttons; - if (Array.isArray(data145)) { - const len15 = data145.length; - for (let i15 = 0; i15 < len15; i15++) { - let data146 = data145[i15]; - if (typeof data146 !== 'string') { - const err228 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/buttons/' + - i15, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/buttons/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err228]; - } else { - vErrors.push(err228); - } - errors++; - } - if ( - !( - data146 === 'bold' || - data146 === 'italic' || - data146 === 'code' || - data146 === 'link' || - data146 === 'heading-one' || - data146 === 'heading-two' || - data146 === 'heading-three' || - data146 === 'heading-four' || - data146 === 'heading-five' || - data146 === 'heading-six' || - data146 === 'quote' || - data146 === 'bulleted-list' || - data146 === 'numbered-list' - ) - ) { - const err229 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/buttons/' + - i15, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/buttons/items/enum', - keyword: 'enum', - params: { - allowedValues: - schema40.properties.collections.items.properties.fields - .items.selectCases.markdown.properties.buttons.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err229]; - } else { - vErrors.push(err229); - } - errors++; - } - } - } else { - const err230 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/buttons', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/buttons/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err230]; - } else { - vErrors.push(err230); - } - errors++; - } - } - if (data130.editor_components !== undefined) { - let data147 = data130.editor_components; - if (Array.isArray(data147)) { - const len16 = data147.length; - for (let i16 = 0; i16 < len16; i16++) { - if (typeof data147[i16] !== 'string') { - const err231 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/editor_components/' + - i16, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/editor_components/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err231]; - } else { - vErrors.push(err231); - } - errors++; - } - } - } else { - const err232 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/editor_components', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/editor_components/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err232]; - } else { - vErrors.push(err232); - } - errors++; - } - } - if (data130.modes !== undefined) { - let data149 = data130.modes; - if (Array.isArray(data149)) { - if (data149.length < 1) { - const err233 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/modes', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err233]; - } else { - vErrors.push(err233); - } - errors++; - } - const len17 = data149.length; - for (let i17 = 0; i17 < len17; i17++) { - let data150 = data149[i17]; - if (typeof data150 !== 'string') { - const err234 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/modes/' + - i17, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err234]; - } else { - vErrors.push(err234); - } - errors++; - } - if (!(data150 === 'raw' || data150 === 'rich_text')) { - const err235 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/modes/' + - i17, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/items/enum', - keyword: 'enum', - params: { - allowedValues: - schema40.properties.collections.items.properties.fields - .items.selectCases.markdown.properties.modes.items.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err235]; - } else { - vErrors.push(err235); - } - errors++; - } - } - } else { - const err236 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/modes', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err236]; - } else { - vErrors.push(err236); - } - errors++; - } - } - } - var _valid13 = _errs357 === errors; - valid68 = _valid13; - } else if ('' + value1 == 'list') { - const _errs372 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.allow_add !== undefined) { - if (typeof data130.allow_add !== 'boolean') { - const err237 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/allow_add', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/list/properties/allow_add/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err237]; - } else { - vErrors.push(err237); - } - errors++; - } - } - if (data130.collapsed !== undefined) { - if (typeof data130.collapsed !== 'boolean') { - const err238 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/collapsed', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/list/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err238]; - } else { - vErrors.push(err238); - } - errors++; - } - } - if (data130.summary !== undefined) { - if (typeof data130.summary !== 'string') { - const err239 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/summary', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/list/properties/summary/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err239]; - } else { - vErrors.push(err239); - } - errors++; - } - } - if (data130.minimize_collapsed !== undefined) { - if (typeof data130.minimize_collapsed !== 'boolean') { - const err240 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/minimize_collapsed', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/list/properties/minimize_collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err240]; - } else { - vErrors.push(err240); - } - errors++; - } - } - if (data130.label_singular !== undefined) { - if (typeof data130.label_singular !== 'string') { - const err241 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/label_singular', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/list/properties/label_singular/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err241]; - } else { - vErrors.push(err241); - } - errors++; - } - } - if (data130.i18n !== undefined) { - if (typeof data130.i18n !== 'boolean') { - const err242 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/list/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err242]; - } else { - vErrors.push(err242); - } - errors++; - } - } - if (data130.min !== undefined) { - if (!(typeof data130.min == 'number')) { - const err243 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/list/properties/min/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err243]; - } else { - vErrors.push(err243); - } - errors++; - } - } - if (data130.max !== undefined) { - if (!(typeof data130.max == 'number')) { - const err244 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/list/properties/max/type', - keyword: 'type', - params: { type: 'number' }, - message: 'must be number', - }; - if (vErrors === null) { - vErrors = [err244]; - } else { - vErrors.push(err244); - } - errors++; - } - } - } - var _valid13 = _errs372 === errors; - valid68 = _valid13; - } else if ('' + value1 == 'object') { - const _errs389 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.collapsed !== undefined) { - if (typeof data130.collapsed !== 'boolean') { - const err245 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/collapsed', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/object/properties/collapsed/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err245]; - } else { - vErrors.push(err245); - } - errors++; - } - } - if (data130.i18n !== undefined) { - if (typeof data130.i18n !== 'boolean') { - const err246 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/object/properties/i18n/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err246]; - } else { - vErrors.push(err246); - } - errors++; - } - } - } - var _valid13 = _errs389 === errors; - valid68 = _valid13; - } else if ('' + value1 == 'relation') { - const _errs394 = errors; - const _errs395 = errors; - let valid87 = false; - let passing11 = null; - const _errs396 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.collection === undefined) { - const err247 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err247]; - } else { - vErrors.push(err247); - } - errors++; - } - if (data130.value_field === undefined) { - const err248 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'value_field' }, - message: "must have required property '" + 'value_field' + "'", - }; - if (vErrors === null) { - vErrors = [err248]; - } else { - vErrors.push(err248); - } - errors++; - } - if (data130.search_fields === undefined) { - const err249 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/0/required', - keyword: 'required', - params: { missingProperty: 'search_fields' }, - message: "must have required property '" + 'search_fields' + "'", - }; - if (vErrors === null) { - vErrors = [err249]; - } else { - vErrors.push(err249); - } - errors++; - } - } - var _valid16 = _errs396 === errors; - if (_valid16) { - valid87 = true; - passing11 = 0; - } - const _errs397 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.collection === undefined) { - const err250 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'collection' }, - message: "must have required property '" + 'collection' + "'", - }; - if (vErrors === null) { - vErrors = [err250]; - } else { - vErrors.push(err250); - } - errors++; - } - if (data130.valueField === undefined) { - const err251 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'valueField' }, - message: "must have required property '" + 'valueField' + "'", - }; - if (vErrors === null) { - vErrors = [err251]; - } else { - vErrors.push(err251); - } - errors++; - } - if (data130.searchFields === undefined) { - const err252 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/1/required', - keyword: 'required', - params: { missingProperty: 'searchFields' }, - message: "must have required property '" + 'searchFields' + "'", - }; - if (vErrors === null) { - vErrors = [err252]; - } else { - vErrors.push(err252); - } - errors++; - } - } - var _valid16 = _errs397 === errors; - if (_valid16 && valid87) { - valid87 = false; - passing11 = [passing11, 1]; - } else { - if (_valid16) { - valid87 = true; - passing11 = 1; - } - } - if (!valid87) { - const err253 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing11 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err253]; - } else { - vErrors.push(err253); - } - errors++; - } else { - errors = _errs395; - if (vErrors !== null) { - if (_errs395) { - vErrors.length = _errs395; - } else { - vErrors = null; - } - } - } - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.collection !== undefined) { - if (typeof data130.collection !== 'string') { - const err254 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/collection', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/collection/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err254]; - } else { - vErrors.push(err254); - } - errors++; - } - } - if (data130.value_field !== undefined) { - if (typeof data130.value_field !== 'string') { - const err255 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/value_field', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/value_field/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err255]; - } else { - vErrors.push(err255); - } - errors++; - } - } - if (data130.search_fields !== undefined) { - let data163 = data130.search_fields; - if (Array.isArray(data163)) { - if (data163.length < 1) { - const err256 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/search_fields', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/search_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err256]; - } else { - vErrors.push(err256); - } - errors++; - } - const len18 = data163.length; - for (let i18 = 0; i18 < len18; i18++) { - if (typeof data163[i18] !== 'string') { - const err257 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/search_fields/' + - i18, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/search_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err257]; - } else { - vErrors.push(err257); - } - errors++; - } - } - } else { - const err258 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/search_fields', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/search_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err258]; - } else { - vErrors.push(err258); - } - errors++; - } - } - if (data130.file !== undefined) { - if (typeof data130.file !== 'string') { - const err259 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/file', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/file/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err259]; - } else { - vErrors.push(err259); - } - errors++; - } - } - if (data130.multiple !== undefined) { - if (typeof data130.multiple !== 'boolean') { - const err260 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/multiple', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/multiple/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err260]; - } else { - vErrors.push(err260); - } - errors++; - } - } - if (data130.min !== undefined) { - let data167 = data130.min; - if ( - !(typeof data167 == 'number' && !(data167 % 1) && !isNaN(data167)) - ) { - const err261 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/min/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err261]; - } else { - vErrors.push(err261); - } - errors++; - } - } - if (data130.max !== undefined) { - let data168 = data130.max; - if ( - !(typeof data168 == 'number' && !(data168 % 1) && !isNaN(data168)) - ) { - const err262 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/max/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err262]; - } else { - vErrors.push(err262); - } - errors++; - } - } - if (data130.display_fields !== undefined) { - let data169 = data130.display_fields; - if (Array.isArray(data169)) { - if (data169.length < 1) { - const err263 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/display_fields', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/display_fields/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err263]; - } else { - vErrors.push(err263); - } - errors++; - } - const len19 = data169.length; - for (let i19 = 0; i19 < len19; i19++) { - if (typeof data169[i19] !== 'string') { - const err264 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/display_fields/' + - i19, - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/display_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err264]; - } else { - vErrors.push(err264); - } - errors++; - } - } - } else { - const err265 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/display_fields', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/display_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err265]; - } else { - vErrors.push(err265); - } - errors++; - } - } - if (data130.options_length !== undefined) { - let data171 = data130.options_length; - if ( - !(typeof data171 == 'number' && !(data171 % 1) && !isNaN(data171)) - ) { - const err266 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/options_length', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/options_length/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err266]; - } else { - vErrors.push(err266); - } - errors++; - } - } - } - var _valid13 = _errs394 === errors; - valid68 = _valid13; - } else if ('' + value1 == 'boolean') { - var _valid13 = true; - valid68 = _valid13; - } else if ('' + value1 == 'map') { - const _errs420 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.decimals !== undefined) { - let data172 = data130.decimals; - if ( - !(typeof data172 == 'number' && !(data172 % 1) && !isNaN(data172)) - ) { - const err267 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/decimals', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/map/properties/decimals/type', - keyword: 'type', - params: { type: 'integer' }, - message: 'must be integer', - }; - if (vErrors === null) { - vErrors = [err267]; - } else { - vErrors.push(err267); - } - errors++; - } - } - if (data130.type !== undefined) { - let data173 = data130.type; - if (typeof data173 !== 'string') { - const err268 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/type', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/map/properties/type/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err268]; - } else { - vErrors.push(err268); - } - errors++; - } - if ( - !( - data173 === 'Point' || - data173 === 'LineString' || - data173 === 'Polygon' - ) - ) { - const err269 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/type', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/map/properties/type/enum', - keyword: 'enum', - params: { - allowedValues: - schema40.properties.collections.items.properties.fields.items - .selectCases.map.properties.type.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err269]; - } else { - vErrors.push(err269); - } - errors++; - } - } - } - var _valid13 = _errs420 === errors; - valid68 = _valid13; - } else if ('' + value1 == 'date') { - var _valid13 = true; - valid68 = _valid13; - } else if ('' + value1 == 'datetime') { - const _errs425 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.format !== undefined) { - if (typeof data130.format !== 'string') { - const err270 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/format', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/format/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err270]; - } else { - vErrors.push(err270); - } - errors++; - } - } - if (data130.date_format !== undefined) { - let data175 = data130.date_format; - const _errs429 = errors; - let valid95 = false; - let passing12 = null; - const _errs430 = errors; - if (typeof data175 !== 'string') { - const err271 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/date_format', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err271]; - } else { - vErrors.push(err271); - } - errors++; - } - var _valid17 = _errs430 === errors; - if (_valid17) { - valid95 = true; - passing12 = 0; - } - const _errs432 = errors; - if (typeof data175 !== 'boolean') { - const err272 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/date_format', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err272]; - } else { - vErrors.push(err272); - } - errors++; - } - var _valid17 = _errs432 === errors; - if (_valid17 && valid95) { - valid95 = false; - passing12 = [passing12, 1]; - } else { - if (_valid17) { - valid95 = true; - passing12 = 1; - } - } - if (!valid95) { - const err273 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/date_format', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing12 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err273]; - } else { - vErrors.push(err273); - } - errors++; - } else { - errors = _errs429; - if (vErrors !== null) { - if (_errs429) { - vErrors.length = _errs429; - } else { - vErrors = null; - } - } - } - } - if (data130.time_format !== undefined) { - let data176 = data130.time_format; - const _errs435 = errors; - let valid96 = false; - let passing13 = null; - const _errs436 = errors; - if (typeof data176 !== 'string') { - const err274 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/time_format', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/0/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err274]; - } else { - vErrors.push(err274); - } - errors++; - } - var _valid18 = _errs436 === errors; - if (_valid18) { - valid96 = true; - passing13 = 0; - } - const _errs438 = errors; - if (typeof data176 !== 'boolean') { - const err275 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/time_format', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/1/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err275]; - } else { - vErrors.push(err275); - } - errors++; - } - var _valid18 = _errs438 === errors; - if (_valid18 && valid96) { - valid96 = false; - passing13 = [passing13, 1]; - } else { - if (_valid18) { - valid96 = true; - passing13 = 1; - } - } - if (!valid96) { - const err276 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/time_format', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing13 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err276]; - } else { - vErrors.push(err276); - } - errors++; - } else { - errors = _errs435; - if (vErrors !== null) { - if (_errs435) { - vErrors.length = _errs435; - } else { - vErrors = null; - } - } - } - } - if (data130.picker_utc !== undefined) { - if (typeof data130.picker_utc !== 'boolean') { - const err277 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/picker_utc', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/picker_utc/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err277]; - } else { - vErrors.push(err277); - } - errors++; - } - } - } - var _valid13 = _errs425 === errors; - valid68 = _valid13; - } else if ('' + value1 == 'code') { - const _errs442 = errors; - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.default_language !== undefined) { - if (typeof data130.default_language !== 'string') { - const err278 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/default_language', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/code/properties/default_language/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err278]; - } else { - vErrors.push(err278); - } - errors++; - } - } - if (data130.allow_language_selection !== undefined) { - if (typeof data130.allow_language_selection !== 'boolean') { - const err279 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/allow_language_selection', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/code/properties/allow_language_selection/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err279]; - } else { - vErrors.push(err279); - } - errors++; - } - } - if (data130.output_code_only !== undefined) { - if (typeof data130.output_code_only !== 'boolean') { - const err280 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/output_code_only', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/code/properties/output_code_only/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err280]; - } else { - vErrors.push(err280); - } - errors++; - } - } - if (data130.keys !== undefined) { - let data181 = data130.keys; - if (data181 && typeof data181 == 'object' && !Array.isArray(data181)) { - if (data181.code !== undefined) { - if (typeof data181.code !== 'string') { - const err281 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/keys/code', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/code/properties/keys/properties/code/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err281]; - } else { - vErrors.push(err281); - } - errors++; - } - } - if (data181.lang !== undefined) { - if (typeof data181.lang !== 'string') { - const err282 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/keys/lang', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/code/properties/keys/properties/lang/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err282]; - } else { - vErrors.push(err282); - } - errors++; - } - } - } else { - const err283 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/keys', - schemaPath: - '#/properties/collections/items/properties/fields/items/selectCases/code/properties/keys/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err283]; - } else { - vErrors.push(err283); - } - errors++; - } - } - } - var _valid13 = _errs442 === errors; - valid68 = _valid13; - } else if ('' + value1 == 'color') { - var _valid13 = true; - valid68 = _valid13; - } - if (!valid68) { - const err284 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: - '#/properties/collections/items/properties/fields/items/select', - keyword: 'select', - params: { failingCase: 'color' }, - message: 'should match case "color" schema', - }; - if (vErrors === null) { - vErrors = [err284]; - } else { - vErrors.push(err284); - } - errors++; - } - } - } - if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { - if (data130.name === undefined) { - const err285 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: - '#/properties/collections/items/properties/fields/items/required', - keyword: 'required', - params: { missingProperty: 'name' }, - message: "must have required property '" + 'name' + "'", - }; - if (vErrors === null) { - vErrors = [err285]; - } else { - vErrors.push(err285); - } - errors++; - } - if (data130.name !== undefined) { - if (typeof data130.name !== 'string') { - const err286 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/name', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/name/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err286]; - } else { - vErrors.push(err286); - } - errors++; - } - } - if (data130.label !== undefined) { - if (typeof data130.label !== 'string') { - const err287 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/label', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err287]; - } else { - vErrors.push(err287); - } - errors++; - } - } - if (data130.widget !== undefined) { - if (typeof data130.widget !== 'string') { - const err288 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/widget', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/widget/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err288]; - } else { - vErrors.push(err288); - } - errors++; - } - } - if (data130.required !== undefined) { - if (typeof data130.required !== 'boolean') { - const err289 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/required', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/required/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err289]; - } else { - vErrors.push(err289); - } - errors++; - } - } - if (data130.i18n !== undefined) { - let data188 = data130.i18n; - const _errs465 = errors; - let valid100 = false; - let passing14 = null; - const _errs466 = errors; - if (typeof data188 !== 'boolean') { - const err290 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/0/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err290]; - } else { - vErrors.push(err290); - } - errors++; - } - var _valid19 = _errs466 === errors; - if (_valid19) { - valid100 = true; - passing14 = 0; - } - const _errs468 = errors; - if (typeof data188 !== 'string') { - const err291 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err291]; - } else { - vErrors.push(err291); - } - errors++; - } - if ( - !(data188 === 'translate' || data188 === 'duplicate' || data188 === 'none') - ) { - const err292 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/enum', - keyword: 'enum', - params: { - allowedValues: - schema40.properties.collections.items.properties.fields.items - .properties.i18n.oneOf[1].enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err292]; - } else { - vErrors.push(err292); - } - errors++; - } - var _valid19 = _errs468 === errors; - if (_valid19 && valid100) { - valid100 = false; - passing14 = [passing14, 1]; - } else { - if (_valid19) { - valid100 = true; - passing14 = 1; - } - } - if (!valid100) { - const err293 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing14 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err293]; - } else { - vErrors.push(err293); - } - errors++; - } else { - errors = _errs465; - if (vErrors !== null) { - if (_errs465) { - vErrors.length = _errs465; - } else { - vErrors = null; - } - } - } - } - if (data130.hint !== undefined) { - if (typeof data130.hint !== 'string') { - const err294 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/hint', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/hint/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err294]; - } else { - vErrors.push(err294); - } - errors++; - } - } - if (data130.pattern !== undefined) { - let data190 = data130.pattern; - if (Array.isArray(data190)) { - if (data190.length < 2) { - const err295 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/pattern', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/pattern/minItems', - keyword: 'minItems', - params: { limit: 2 }, - message: 'must NOT have fewer than 2 items', - }; - if (vErrors === null) { - vErrors = [err295]; - } else { - vErrors.push(err295); - } - errors++; - } - const len20 = data190.length; - if (len20 > 0) { - const _errs475 = errors; - let valid102 = false; - let passing15 = null; - const _errs476 = errors; - if (typeof data190[0] !== 'string') { - const err296 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/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 = [err296]; - } else { - vErrors.push(err296); - } - errors++; - } - var _valid20 = _errs476 === errors; - if (_valid20) { - valid102 = true; - passing15 = 0; - } - var _valid20 = true; - if (_valid20 && valid102) { - valid102 = false; - passing15 = [passing15, 1]; - } else { - if (_valid20) { - valid102 = true; - passing15 = 1; - } - } - if (!valid102) { - const err297 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/pattern/0', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing15 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err297]; - } else { - vErrors.push(err297); - } - errors++; - } else { - errors = _errs475; - if (vErrors !== null) { - if (_errs475) { - vErrors.length = _errs475; - } else { - vErrors = null; - } - } - } - } - if (len20 > 1) { - if (typeof data190[1] !== 'string') { - const err298 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/fields/' + - i13 + - '/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 = [err298]; - } else { - vErrors.push(err298); - } - errors++; - } - } - } else { - const err299 = { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/pattern', - schemaPath: - '#/properties/collections/items/properties/fields/items/properties/pattern/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err299]; - } else { - vErrors.push(err299); - } - errors++; - } - } - if (data130.field !== undefined) { - if ( - !validate32(data130.field, { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/field', - parentData: data130, - parentDataProperty: 'field', - rootData, - }) - ) { - vErrors = - vErrors === null ? validate32.errors : vErrors.concat(validate32.errors); - errors = vErrors.length; - } - } - if (data130.fields !== undefined) { - if ( - !validate33(data130.fields, { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/fields', - parentData: data130, - parentDataProperty: 'fields', - rootData, - }) - ) { - vErrors = - vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); - errors = vErrors.length; - } - } - if (data130.types !== undefined) { - if ( - !validate33(data130.types, { - instancePath: - instancePath + '/collections/' + i3 + '/fields/' + i13 + '/types', - parentData: data130, - parentDataProperty: 'types', - rootData, - }) - ) { - vErrors = - vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); - errors = vErrors.length; - } - } - } else { - const err300 = { - instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, - schemaPath: '#/properties/collections/items/properties/fields/items/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err300]; - } else { - vErrors.push(err300); - } - errors++; - } - } - } else { - const err301 = { - 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 = [err301]; - } else { - vErrors.push(err301); - } - errors++; - } - } - if (data30.sortable_fields !== undefined) { - let data196 = data30.sortable_fields; - if (Array.isArray(data196)) { - const len21 = data196.length; - for (let i20 = 0; i20 < len21; i20++) { - if (typeof data196[i20] !== 'string') { - const err302 = { - instancePath: instancePath + '/collections/' + i3 + '/sortable_fields/' + i20, - schemaPath: - '#/properties/collections/items/properties/sortable_fields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err302]; - } else { - vErrors.push(err302); - } - errors++; - } - } - } else { - const err303 = { - instancePath: instancePath + '/collections/' + i3 + '/sortable_fields', - schemaPath: '#/properties/collections/items/properties/sortable_fields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err303]; - } else { - vErrors.push(err303); - } - errors++; - } - } - if (data30.sortableFields !== undefined) { - let data198 = data30.sortableFields; - if (Array.isArray(data198)) { - const len22 = data198.length; - for (let i21 = 0; i21 < len22; i21++) { - if (typeof data198[i21] !== 'string') { - const err304 = { - instancePath: instancePath + '/collections/' + i3 + '/sortableFields/' + i21, - schemaPath: - '#/properties/collections/items/properties/sortableFields/items/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err304]; - } else { - vErrors.push(err304); - } - errors++; - } - } - } else { - const err305 = { - instancePath: instancePath + '/collections/' + i3 + '/sortableFields', - schemaPath: '#/properties/collections/items/properties/sortableFields/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err305]; - } else { - vErrors.push(err305); - } - errors++; - } - } - if (data30.view_filters !== undefined) { - let data200 = data30.view_filters; - if (Array.isArray(data200)) { - if (data200.length < 1) { - const err306 = { - instancePath: instancePath + '/collections/' + i3 + '/view_filters', - schemaPath: '#/properties/collections/items/properties/view_filters/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err306]; - } else { - vErrors.push(err306); - } - errors++; - } - const len23 = data200.length; - for (let i22 = 0; i22 < len23; i22++) { - let data201 = data200[i22]; - if (data201 && typeof data201 == 'object' && !Array.isArray(data201)) { - if (data201.label === undefined) { - const err307 = { - instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, - schemaPath: - '#/properties/collections/items/properties/view_filters/items/required', - keyword: 'required', - params: { missingProperty: 'label' }, - message: "must have required property '" + 'label' + "'", - }; - if (vErrors === null) { - vErrors = [err307]; - } else { - vErrors.push(err307); - } - errors++; - } - if (data201.field === undefined) { - const err308 = { - instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, - schemaPath: - '#/properties/collections/items/properties/view_filters/items/required', - keyword: 'required', - params: { missingProperty: 'field' }, - message: "must have required property '" + 'field' + "'", - }; - if (vErrors === null) { - vErrors = [err308]; - } else { - vErrors.push(err308); - } - errors++; - } - if (data201.pattern === undefined) { - const err309 = { - instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, - schemaPath: - '#/properties/collections/items/properties/view_filters/items/required', - keyword: 'required', - params: { missingProperty: 'pattern' }, - message: "must have required property '" + 'pattern' + "'", - }; - if (vErrors === null) { - vErrors = [err309]; - } else { - vErrors.push(err309); - } - errors++; - } - for (const key1 in data201) { - if (!(key1 === 'label' || key1 === 'field' || key1 === 'pattern')) { - const err310 = { - instancePath: - instancePath + '/collections/' + i3 + '/view_filters/' + i22, - schemaPath: - '#/properties/collections/items/properties/view_filters/items/additionalProperties', - keyword: 'additionalProperties', - params: { additionalProperty: key1 }, - message: 'must NOT have additional properties', - }; - if (vErrors === null) { - vErrors = [err310]; - } else { - vErrors.push(err310); - } - errors++; - } - } - if (data201.label !== undefined) { - if (typeof data201.label !== 'string') { - const err311 = { - instancePath: - instancePath + '/collections/' + i3 + '/view_filters/' + i22 + '/label', - schemaPath: - '#/properties/collections/items/properties/view_filters/items/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err311]; - } else { - vErrors.push(err311); - } - errors++; - } - } - if (data201.field !== undefined) { - if (typeof data201.field !== 'string') { - const err312 = { - instancePath: - instancePath + '/collections/' + i3 + '/view_filters/' + i22 + '/field', - schemaPath: - '#/properties/collections/items/properties/view_filters/items/properties/field/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err312]; - } else { - vErrors.push(err312); - } - errors++; - } - } - if (data201.pattern !== undefined) { - let data204 = data201.pattern; - const _errs501 = errors; - let valid110 = false; - let passing16 = null; - const _errs502 = errors; - if (typeof data204 !== 'boolean') { - const err313 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/view_filters/' + - i22 + - '/pattern', - schemaPath: - '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/0/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err313]; - } else { - vErrors.push(err313); - } - errors++; - } - var _valid21 = _errs502 === errors; - if (_valid21) { - valid110 = true; - passing16 = 0; - } - const _errs504 = errors; - if (typeof data204 !== 'string') { - const err314 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/view_filters/' + - i22 + - '/pattern', - schemaPath: - '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/1/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err314]; - } else { - vErrors.push(err314); - } - errors++; - } - var _valid21 = _errs504 === errors; - if (_valid21 && valid110) { - valid110 = false; - passing16 = [passing16, 1]; - } else { - if (_valid21) { - valid110 = true; - passing16 = 1; - } - } - if (!valid110) { - const err315 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/view_filters/' + - i22 + - '/pattern', - schemaPath: - '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing16 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err315]; - } else { - vErrors.push(err315); - } - errors++; - } else { - errors = _errs501; - if (vErrors !== null) { - if (_errs501) { - vErrors.length = _errs501; - } else { - vErrors = null; - } - } - } - } - } else { - const err316 = { - instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, - schemaPath: - '#/properties/collections/items/properties/view_filters/items/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err316]; - } else { - vErrors.push(err316); - } - errors++; - } - } - } else { - const err317 = { - instancePath: instancePath + '/collections/' + i3 + '/view_filters', - schemaPath: '#/properties/collections/items/properties/view_filters/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err317]; - } else { - vErrors.push(err317); - } - errors++; - } - } - if (data30.view_groups !== undefined) { - let data205 = data30.view_groups; - if (Array.isArray(data205)) { - if (data205.length < 1) { - const err318 = { - instancePath: instancePath + '/collections/' + i3 + '/view_groups', - schemaPath: '#/properties/collections/items/properties/view_groups/minItems', - keyword: 'minItems', - params: { limit: 1 }, - message: 'must NOT have fewer than 1 items', - }; - if (vErrors === null) { - vErrors = [err318]; - } else { - vErrors.push(err318); - } - errors++; - } - const len24 = data205.length; - for (let i23 = 0; i23 < len24; i23++) { - let data206 = data205[i23]; - if (data206 && typeof data206 == 'object' && !Array.isArray(data206)) { - if (data206.label === undefined) { - const err319 = { - instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, - schemaPath: - '#/properties/collections/items/properties/view_groups/items/required', - keyword: 'required', - params: { missingProperty: 'label' }, - message: "must have required property '" + 'label' + "'", - }; - if (vErrors === null) { - vErrors = [err319]; - } else { - vErrors.push(err319); - } - errors++; - } - if (data206.field === undefined) { - const err320 = { - instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, - schemaPath: - '#/properties/collections/items/properties/view_groups/items/required', - keyword: 'required', - params: { missingProperty: 'field' }, - message: "must have required property '" + 'field' + "'", - }; - if (vErrors === null) { - vErrors = [err320]; - } else { - vErrors.push(err320); - } - errors++; - } - for (const key2 in data206) { - if (!(key2 === 'label' || key2 === 'field' || key2 === 'pattern')) { - const err321 = { - instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, - schemaPath: - '#/properties/collections/items/properties/view_groups/items/additionalProperties', - keyword: 'additionalProperties', - params: { additionalProperty: key2 }, - message: 'must NOT have additional properties', - }; - if (vErrors === null) { - vErrors = [err321]; - } else { - vErrors.push(err321); - } - errors++; - } - } - if (data206.label !== undefined) { - if (typeof data206.label !== 'string') { - const err322 = { - instancePath: - instancePath + '/collections/' + i3 + '/view_groups/' + i23 + '/label', - schemaPath: - '#/properties/collections/items/properties/view_groups/items/properties/label/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err322]; - } else { - vErrors.push(err322); - } - errors++; - } - } - if (data206.field !== undefined) { - if (typeof data206.field !== 'string') { - const err323 = { - instancePath: - instancePath + '/collections/' + i3 + '/view_groups/' + i23 + '/field', - schemaPath: - '#/properties/collections/items/properties/view_groups/items/properties/field/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err323]; - } else { - vErrors.push(err323); - } - errors++; - } - } - if (data206.pattern !== undefined) { - if (typeof data206.pattern !== 'string') { - const err324 = { - instancePath: - instancePath + - '/collections/' + - i3 + - '/view_groups/' + - i23 + - '/pattern', - schemaPath: - '#/properties/collections/items/properties/view_groups/items/properties/pattern/type', - keyword: 'type', - params: { type: 'string' }, - message: 'must be string', - }; - if (vErrors === null) { - vErrors = [err324]; - } else { - vErrors.push(err324); - } - errors++; - } - } - } else { - const err325 = { - instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, - schemaPath: - '#/properties/collections/items/properties/view_groups/items/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err325]; - } else { - vErrors.push(err325); - } - errors++; - } - } - } else { - const err326 = { - instancePath: instancePath + '/collections/' + i3 + '/view_groups', - schemaPath: '#/properties/collections/items/properties/view_groups/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err326]; - } else { - vErrors.push(err326); - } - errors++; - } - } - if (data30.nested !== undefined) { - let data210 = data30.nested; - if (data210 && typeof data210 == 'object' && !Array.isArray(data210)) { - if (data210.depth === undefined) { - const err327 = { - instancePath: instancePath + '/collections/' + i3 + '/nested', - schemaPath: '#/properties/collections/items/properties/nested/required', - keyword: 'required', - params: { missingProperty: 'depth' }, - message: "must have required property '" + 'depth' + "'", - }; - if (vErrors === null) { - vErrors = [err327]; - } else { - vErrors.push(err327); - } - errors++; - } - if (data210.depth !== undefined) { - let data211 = data210.depth; - if (typeof data211 == 'number') { - if (data211 > 1000 || isNaN(data211)) { - const err328 = { - 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 = [err328]; - } else { - vErrors.push(err328); - } - errors++; - } - if (data211 < 1 || isNaN(data211)) { - const err329 = { - 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 = [err329]; - } else { - vErrors.push(err329); - } - errors++; - } - } else { - const err330 = { - 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 = [err330]; - } else { - vErrors.push(err330); - } - errors++; - } - } - if (data210.summary !== undefined) { - if (typeof data210.summary !== 'string') { - const err331 = { - 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 = [err331]; - } else { - vErrors.push(err331); - } - errors++; - } - } - } else { - const err332 = { - 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 = [err332]; - } else { - vErrors.push(err332); - } - errors++; - } - } - if (data30.meta !== undefined) { - let data213 = data30.meta; - if (data213 && typeof data213 == 'object' && !Array.isArray(data213)) { - if (Object.keys(data213).length < 1) { - const err333 = { - 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 = [err333]; - } else { - vErrors.push(err333); - } - errors++; - } - for (const key3 in data213) { - if (!(key3 === 'path')) { - const err334 = { - 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 = [err334]; - } else { - vErrors.push(err334); - } - errors++; - } - } - if (data213.path !== undefined) { - let data214 = data213.path; - if (data214 && typeof data214 == 'object' && !Array.isArray(data214)) { - if (data214.label === undefined) { - const err335 = { - 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 = [err335]; - } else { - vErrors.push(err335); - } - errors++; - } - if (data214.widget === undefined) { - const err336 = { - 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 = [err336]; - } else { - vErrors.push(err336); - } - errors++; - } - if (data214.index_file === undefined) { - const err337 = { - 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 = [err337]; - } else { - vErrors.push(err337); - } - errors++; - } - if (data214.label !== undefined) { - if (typeof data214.label !== 'string') { - const err338 = { - 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 = [err338]; - } else { - vErrors.push(err338); - } - errors++; - } - } - if (data214.widget !== undefined) { - if (typeof data214.widget !== 'string') { - const err339 = { - 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 = [err339]; - } else { - vErrors.push(err339); - } - errors++; - } - } - if (data214.index_file !== undefined) { - if (typeof data214.index_file !== 'string') { - const err340 = { - 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 = [err340]; - } else { - vErrors.push(err340); - } - errors++; - } - } - } else { - const err341 = { - 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 = [err341]; - } else { - vErrors.push(err341); - } - errors++; - } - } - } else { - const err342 = { - 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 = [err342]; - } else { - vErrors.push(err342); - } - errors++; - } - } - if (data30.i18n !== undefined) { - let data218 = data30.i18n; - const _errs535 = errors; - let valid117 = false; - let passing17 = null; - const _errs536 = errors; - if (typeof data218 !== 'boolean') { - const err343 = { - 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 = [err343]; - } else { - vErrors.push(err343); - } - errors++; - } - var _valid22 = _errs536 === errors; - if (_valid22) { - valid117 = true; - passing17 = 0; - } - const _errs538 = errors; - if (data218 && typeof data218 == 'object' && !Array.isArray(data218)) { - if (data218.structure !== undefined) { - let data219 = data218.structure; - if (typeof data219 !== 'string') { - const err344 = { - 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 = [err344]; - } else { - vErrors.push(err344); - } - errors++; - } - if ( - !( - data219 === 'multiple_folders' || - data219 === 'multiple_files' || - data219 === 'single_file' - ) - ) { - const err345 = { - instancePath: instancePath + '/collections/' + i3 + '/i18n/structure', - schemaPath: - '#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum', - keyword: 'enum', - params: { - allowedValues: - schema40.properties.collections.items.properties.i18n.oneOf[1].properties - .structure.enum, - }, - message: 'must be equal to one of the allowed values', - }; - if (vErrors === null) { - vErrors = [err345]; - } else { - vErrors.push(err345); - } - errors++; - } - } - if (data218.locales !== undefined) { - let data220 = data218.locales; - if (Array.isArray(data220)) { - if (data220.length < 2) { - const err346 = { - 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 = [err346]; - } else { - vErrors.push(err346); - } - errors++; - } - const len25 = data220.length; - for (let i24 = 0; i24 < len25; i24++) { - let data221 = data220[i24]; - if (typeof data221 === 'string') { - if (func9(data221) > 10) { - const err347 = { - instancePath: - instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, - 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 = [err347]; - } else { - vErrors.push(err347); - } - errors++; - } - if (func9(data221) < 2) { - const err348 = { - instancePath: - instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, - 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 = [err348]; - } else { - vErrors.push(err348); - } - errors++; - } - if (!pattern0.test(data221)) { - const err349 = { - instancePath: - instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, - 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 = [err349]; - } else { - vErrors.push(err349); - } - errors++; - } - } else { - const err350 = { - instancePath: - instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, - 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 = [err350]; - } else { - vErrors.push(err350); - } - errors++; - } - } - let i25 = data220.length; - let j1; - if (i25 > 1) { - const indices1 = {}; - for (; i25--; ) { - let item1 = data220[i25]; - if (typeof item1 !== 'string') { - continue; - } - if (typeof indices1[item1] == 'number') { - j1 = indices1[item1]; - const err351 = { - instancePath: instancePath + '/collections/' + i3 + '/i18n/locales', - schemaPath: - '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems', - keyword: 'uniqueItems', - params: { i: i25, j: j1 }, - message: - 'must NOT have duplicate items (items ## ' + - j1 + - ' and ' + - i25 + - ' are identical)', - }; - if (vErrors === null) { - vErrors = [err351]; - } else { - vErrors.push(err351); - } - errors++; - break; - } - indices1[item1] = i25; - } - } - } else { - const err352 = { - 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 = [err352]; - } else { - vErrors.push(err352); - } - errors++; - } - } - if (data218.default_locale !== undefined) { - let data222 = data218.default_locale; - if (typeof data222 === 'string') { - if (func9(data222) > 10) { - const err353 = { - 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 = [err353]; - } else { - vErrors.push(err353); - } - errors++; - } - if (func9(data222) < 2) { - const err354 = { - 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 = [err354]; - } else { - vErrors.push(err354); - } - errors++; - } - if (!pattern0.test(data222)) { - const err355 = { - 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 = [err355]; - } else { - vErrors.push(err355); - } - errors++; - } - } else { - const err356 = { - 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 = [err356]; - } else { - vErrors.push(err356); - } - errors++; - } - } - } else { - const err357 = { - 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 = [err357]; - } else { - vErrors.push(err357); - } - errors++; - } - var _valid22 = _errs538 === errors; - if (_valid22 && valid117) { - valid117 = false; - passing17 = [passing17, 1]; - } else { - if (_valid22) { - valid117 = true; - passing17 = 1; - } - } - if (!valid117) { - const err358 = { - instancePath: instancePath + '/collections/' + i3 + '/i18n', - schemaPath: '#/properties/collections/items/properties/i18n/oneOf', - keyword: 'oneOf', - params: { passingSchemas: passing17 }, - message: 'must match exactly one schema in oneOf', - }; - if (vErrors === null) { - vErrors = [err358]; - } else { - vErrors.push(err358); - } - errors++; - } else { - errors = _errs535; - if (vErrors !== null) { - if (_errs535) { - vErrors.length = _errs535; - } else { - vErrors = null; - } - } - } - } - } else { - const err359 = { - instancePath: instancePath + '/collections/' + i3, - schemaPath: '#/properties/collections/items/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err359]; - } else { - vErrors.push(err359); - } - errors++; - } - } - } else { - const err360 = { - instancePath: instancePath + '/collections', - schemaPath: '#/properties/collections/type', - keyword: 'type', - params: { type: 'array' }, - message: 'must be array', - }; - if (vErrors === null) { - vErrors = [err360]; - } else { - vErrors.push(err360); - } - errors++; - } - } - if (data.editor !== undefined) { - let data223 = data.editor; - if (data223 && typeof data223 == 'object' && !Array.isArray(data223)) { - if (data223.preview !== undefined) { - if (typeof data223.preview !== 'boolean') { - const err361 = { - instancePath: instancePath + '/editor/preview', - schemaPath: '#/properties/editor/properties/preview/type', - keyword: 'type', - params: { type: 'boolean' }, - message: 'must be boolean', - }; - if (vErrors === null) { - vErrors = [err361]; - } else { - vErrors.push(err361); - } - errors++; - } - } - } else { - const err362 = { - instancePath: instancePath + '/editor', - schemaPath: '#/properties/editor/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err362]; - } else { - vErrors.push(err362); - } - errors++; - } - } - } else { - const err363 = { - instancePath, - schemaPath: '#/type', - keyword: 'type', - params: { type: 'object' }, - message: 'must be object', - }; - if (vErrors === null) { - vErrors = [err363]; - } else { - vErrors.push(err363); - } - errors++; - } - validate24.errors = vErrors; - return errors === 0; -} +"use strict";module.exports = validate25;module.exports.default = validate25;const schema41 = {"$id":"https://netlify-cms/object.json","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_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","type":"array","minItems":1,"items":{"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]}},"required":["name","label","file","fields"]},"uniqueItemProperties":["name"]},"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_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","type":"array","minItems":1,"items":{"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["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"]}}},"uniqueItemProperties":["name"]},"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 func9 = require("ajv/dist/runtime/ucs2length").default;const pattern0 = new RegExp("^[a-zA-Z-_]+$", "u");const schema42 = {"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]};const wrapper0 = {validate: validate26};const schema43 = {"$id":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","type":"array","minItems":1,"items":{"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]};const wrapper2 = {validate: validate27};function validate27(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */;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){let data61 = data60[0];const _errs161 = errors;let valid36 = false;let passing6 = null;const _errs162 = errors;if(typeof data61 !== "string"){const err92 = {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 = [err92];}else {vErrors.push(err92);}errors++;}var _valid7 = _errs162 === errors;if(_valid7){valid36 = true;passing6 = 0;}const _errs164 = errors;if(typeof data61 == "number"){if(!(data61 instanceof RegExp)){const err93 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(typeof data61 === "string"){if(!(data61 instanceof RegExp)){const err94 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(Array.isArray(data61)){if(!(data61 instanceof RegExp)){const err95 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data61 && typeof data61 == "object" && !Array.isArray(data61)){if(!(data61 instanceof RegExp)){const err96 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}var _valid7 = _errs164 === errors;if(_valid7 && valid36){valid36 = false;passing6 = [passing6, 1];}else {if(_valid7){valid36 = true;passing6 = 1;}}if(!valid36){const err97 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing6},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}else {errors = _errs161;if(vErrors !== null){if(_errs161){vErrors.length = _errs161;}else {vErrors = null;}}}}if(len7 > 1){if(typeof data60[1] !== "string"){const err98 = {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 = [err98];}else {vErrors.push(err98);}errors++;}}}else {const err99 = {instancePath:instancePath+"/" + i0+"/pattern",schemaPath:"#/items/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}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 err100 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}}else {const err101 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}validate27.errors = vErrors;return errors === 0;}function validate26(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */;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 == "unknown"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "string"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "number"){const _errs1 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.step !== undefined){if(!(typeof data.step == "number")){const err1 = {instancePath:instancePath+"/step",schemaPath:"#/selectCases/number/properties/step/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.value_type !== undefined){if(typeof data.value_type !== "string"){const err2 = {instancePath:instancePath+"/value_type",schemaPath:"#/selectCases/number/properties/value_type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.min !== undefined){if(!(typeof data.min == "number")){const err3 = {instancePath:instancePath+"/min",schemaPath:"#/selectCases/number/properties/min/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.max !== undefined){if(!(typeof data.max == "number")){const err4 = {instancePath:instancePath+"/max",schemaPath:"#/selectCases/number/properties/max/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}var _valid0 = _errs1 === errors;valid0 = _valid0;}else if("" + value0 == "text"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "image"){const _errs10 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.allow_multiple !== undefined){if(typeof data.allow_multiple !== "boolean"){const err5 = {instancePath:instancePath+"/allow_multiple",schemaPath:"#/selectCases/image/properties/allow_multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}var _valid0 = _errs10 === errors;valid0 = _valid0;}else if("" + value0 == "file"){const _errs13 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.allow_multiple !== undefined){if(typeof data.allow_multiple !== "boolean"){const err6 = {instancePath:instancePath+"/allow_multiple",schemaPath:"#/selectCases/file/properties/allow_multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}var _valid0 = _errs13 === errors;valid0 = _valid0;}else if("" + value0 == "select"){const _errs16 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.options === undefined){const err7 = {instancePath,schemaPath:"#/selectCases/select/required",keyword:"required",params:{missingProperty: "options"},message:"must have required property '"+"options"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.multiple !== undefined){if(typeof data.multiple !== "boolean"){const err8 = {instancePath:instancePath+"/multiple",schemaPath:"#/selectCases/select/properties/multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.min !== undefined){let data7 = data.min;if(!((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7)))){const err9 = {instancePath:instancePath+"/min",schemaPath:"#/selectCases/select/properties/min/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.max !== undefined){let data8 = data.max;if(!((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8)))){const err10 = {instancePath:instancePath+"/max",schemaPath:"#/selectCases/select/properties/max/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.options !== undefined){let data9 = data.options;if(Array.isArray(data9)){const len0 = data9.length;for(let i0=0; i0 0){let data60 = data59[0];const _errs159 = errors;let valid34 = false;let passing6 = null;const _errs160 = errors;if(typeof data60 !== "string"){const err91 = {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 = [err91];}else {vErrors.push(err91);}errors++;}var _valid7 = _errs160 === errors;if(_valid7){valid34 = true;passing6 = 0;}const _errs162 = errors;if(typeof data60 == "number"){if(!(data60 instanceof RegExp)){const err92 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}if(typeof data60 === "string"){if(!(data60 instanceof RegExp)){const err93 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(Array.isArray(data60)){if(!(data60 instanceof RegExp)){const err94 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(data60 && typeof data60 == "object" && !Array.isArray(data60)){if(!(data60 instanceof RegExp)){const err95 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}var _valid7 = _errs162 === errors;if(_valid7 && valid34){valid34 = false;passing6 = [passing6, 1];}else {if(_valid7){valid34 = true;passing6 = 1;}}if(!valid34){const err96 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing6},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}else {errors = _errs159;if(vErrors !== null){if(_errs159){vErrors.length = _errs159;}else {vErrors = null;}}}}if(len6 > 1){if(typeof data59[1] !== "string"){const err97 = {instancePath:instancePath+"/pattern/1",schemaPath:"#/properties/pattern/items/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}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(!(validate27(data.fields, {instancePath:instancePath+"/fields",parentData:data,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);errors = vErrors.length;}}if(data.types !== undefined){if(!(validate27(data.types, {instancePath:instancePath+"/types",parentData:data,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);errors = vErrors.length;}}}else {const err99 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}validate26.errors = vErrors;return errors === 0;}const schema44 = {"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]};const wrapper4 = {validate: validate33};const schema45 = {"$id":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","type":"array","minItems":1,"items":{"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]};const wrapper6 = {validate: validate34};function validate34(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */;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){let data61 = data60[0];const _errs161 = errors;let valid36 = false;let passing6 = null;const _errs162 = errors;if(typeof data61 !== "string"){const err92 = {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 = [err92];}else {vErrors.push(err92);}errors++;}var _valid7 = _errs162 === errors;if(_valid7){valid36 = true;passing6 = 0;}const _errs164 = errors;if(typeof data61 == "number"){if(!(data61 instanceof RegExp)){const err93 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(typeof data61 === "string"){if(!(data61 instanceof RegExp)){const err94 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(Array.isArray(data61)){if(!(data61 instanceof RegExp)){const err95 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data61 && typeof data61 == "object" && !Array.isArray(data61)){if(!(data61 instanceof RegExp)){const err96 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}var _valid7 = _errs164 === errors;if(_valid7 && valid36){valid36 = false;passing6 = [passing6, 1];}else {if(_valid7){valid36 = true;passing6 = 1;}}if(!valid36){const err97 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing6},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}else {errors = _errs161;if(vErrors !== null){if(_errs161){vErrors.length = _errs161;}else {vErrors = null;}}}}if(len7 > 1){if(typeof data60[1] !== "string"){const err98 = {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 = [err98];}else {vErrors.push(err98);}errors++;}}}else {const err99 = {instancePath:instancePath+"/" + i0+"/pattern",schemaPath:"#/items/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}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 err100 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}}else {const err101 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}validate34.errors = vErrors;return errors === 0;}function validate33(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */;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 == "unknown"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "string"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "number"){const _errs1 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.step !== undefined){if(!(typeof data.step == "number")){const err1 = {instancePath:instancePath+"/step",schemaPath:"#/selectCases/number/properties/step/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.value_type !== undefined){if(typeof data.value_type !== "string"){const err2 = {instancePath:instancePath+"/value_type",schemaPath:"#/selectCases/number/properties/value_type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.min !== undefined){if(!(typeof data.min == "number")){const err3 = {instancePath:instancePath+"/min",schemaPath:"#/selectCases/number/properties/min/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.max !== undefined){if(!(typeof data.max == "number")){const err4 = {instancePath:instancePath+"/max",schemaPath:"#/selectCases/number/properties/max/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}var _valid0 = _errs1 === errors;valid0 = _valid0;}else if("" + value0 == "text"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "image"){const _errs10 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.allow_multiple !== undefined){if(typeof data.allow_multiple !== "boolean"){const err5 = {instancePath:instancePath+"/allow_multiple",schemaPath:"#/selectCases/image/properties/allow_multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}var _valid0 = _errs10 === errors;valid0 = _valid0;}else if("" + value0 == "file"){const _errs13 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.allow_multiple !== undefined){if(typeof data.allow_multiple !== "boolean"){const err6 = {instancePath:instancePath+"/allow_multiple",schemaPath:"#/selectCases/file/properties/allow_multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}var _valid0 = _errs13 === errors;valid0 = _valid0;}else if("" + value0 == "select"){const _errs16 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.options === undefined){const err7 = {instancePath,schemaPath:"#/selectCases/select/required",keyword:"required",params:{missingProperty: "options"},message:"must have required property '"+"options"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.multiple !== undefined){if(typeof data.multiple !== "boolean"){const err8 = {instancePath:instancePath+"/multiple",schemaPath:"#/selectCases/select/properties/multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.min !== undefined){let data7 = data.min;if(!((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7)))){const err9 = {instancePath:instancePath+"/min",schemaPath:"#/selectCases/select/properties/min/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.max !== undefined){let data8 = data.max;if(!((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8)))){const err10 = {instancePath:instancePath+"/max",schemaPath:"#/selectCases/select/properties/max/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.options !== undefined){let data9 = data.options;if(Array.isArray(data9)){const len0 = data9.length;for(let i0=0; i0 0){let data60 = data59[0];const _errs159 = errors;let valid34 = false;let passing6 = null;const _errs160 = errors;if(typeof data60 !== "string"){const err91 = {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 = [err91];}else {vErrors.push(err91);}errors++;}var _valid7 = _errs160 === errors;if(_valid7){valid34 = true;passing6 = 0;}const _errs162 = errors;if(typeof data60 == "number"){if(!(data60 instanceof RegExp)){const err92 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}if(typeof data60 === "string"){if(!(data60 instanceof RegExp)){const err93 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(Array.isArray(data60)){if(!(data60 instanceof RegExp)){const err94 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(data60 && typeof data60 == "object" && !Array.isArray(data60)){if(!(data60 instanceof RegExp)){const err95 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}var _valid7 = _errs162 === errors;if(_valid7 && valid34){valid34 = false;passing6 = [passing6, 1];}else {if(_valid7){valid34 = true;passing6 = 1;}}if(!valid34){const err96 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing6},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}else {errors = _errs159;if(vErrors !== null){if(_errs159){vErrors.length = _errs159;}else {vErrors = null;}}}}if(len6 > 1){if(typeof data59[1] !== "string"){const err97 = {instancePath:instancePath+"/pattern/1",schemaPath:"#/properties/pattern/items/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}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(!(validate34(data.fields, {instancePath:instancePath+"/fields",parentData:data,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}if(data.types !== undefined){if(!(validate34(data.types, {instancePath:instancePath+"/types",parentData:data,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}}else {const err99 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}validate33.errors = vErrors;return errors === 0;}function validate25(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="https://netlify-cms/object.json" */;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: schema41.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(func9(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(func9(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(func9(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(func9(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: schema41.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: schema41.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){let data109 = data108[0];const _errs275 = errors;let valid62 = false;let passing8 = null;const _errs276 = errors;if(typeof data109 !== "string"){const err178 = {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 = [err178];}else {vErrors.push(err178);}errors++;}var _valid12 = _errs276 === errors;if(_valid12){valid62 = true;passing8 = 0;}const _errs278 = errors;if(typeof data109 == "number"){if(!(data109 instanceof RegExp)){const err179 = {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/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(typeof data109 === "string"){if(!(data109 instanceof RegExp)){const err180 = {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/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(Array.isArray(data109)){if(!(data109 instanceof RegExp)){const err181 = {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/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}if(data109 && typeof data109 == "object" && !Array.isArray(data109)){if(!(data109 instanceof RegExp)){const err182 = {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/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}var _valid12 = _errs278 === errors;if(_valid12 && valid62){valid62 = false;passing8 = [passing8, 1];}else {if(_valid12){valid62 = true;passing8 = 1;}}if(!valid62){const err183 = {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: passing8},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}else {errors = _errs275;if(vErrors !== null){if(_errs275){vErrors.length = _errs275;}else {vErrors = null;}}}}if(len11 > 1){if(typeof data108[1] !== "string"){const err184 = {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 = [err184];}else {vErrors.push(err184);}errors++;}}}else {const err185 = {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 = [err185];}else {vErrors.push(err185);}errors++;}}if(data48.field !== undefined){if(!(validate26(data48.field, {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/field",parentData:data48,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);errors = vErrors.length;}}if(data48.fields !== undefined){if(!(validate27(data48.fields, {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/fields",parentData:data48,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);errors = vErrors.length;}}if(data48.types !== undefined){if(!(validate27(data48.types, {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/types",parentData:data48,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);errors = vErrors.length;}}}else {const err186 = {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 = [err186];}else {vErrors.push(err186);}errors++;}}}else {const err187 = {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 = [err187];}else {vErrors.push(err187);}errors++;}}}else {const err188 = {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 = [err188];}else {vErrors.push(err188);}errors++;}}}else {const err189 = {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 = [err189];}else {vErrors.push(err189);}errors++;}}if(data30.identifier_field !== undefined){if(typeof data30.identifier_field !== "string"){const err190 = {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 = [err190];}else {vErrors.push(err190);}errors++;}}if(data30.summary !== undefined){if(typeof data30.summary !== "string"){const err191 = {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 = [err191];}else {vErrors.push(err191);}errors++;}}if(data30.slug !== undefined){if(typeof data30.slug !== "string"){const err192 = {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 = [err192];}else {vErrors.push(err192);}errors++;}}if(data30.path !== undefined){if(typeof data30.path !== "string"){const err193 = {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 = [err193];}else {vErrors.push(err193);}errors++;}}if(data30.preview_path !== undefined){if(typeof data30.preview_path !== "string"){const err194 = {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 = [err194];}else {vErrors.push(err194);}errors++;}}if(data30.preview_path_date_field !== undefined){if(typeof data30.preview_path_date_field !== "string"){const err195 = {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 = [err195];}else {vErrors.push(err195);}errors++;}}if(data30.create !== undefined){if(typeof data30.create !== "boolean"){const err196 = {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 = [err196];}else {vErrors.push(err196);}errors++;}}if(data30.publish !== undefined){if(typeof data30.publish !== "boolean"){const err197 = {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 = [err197];}else {vErrors.push(err197);}errors++;}}if(data30.hide !== undefined){if(typeof data30.hide !== "boolean"){const err198 = {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 = [err198];}else {vErrors.push(err198);}errors++;}}if(data30.editor !== undefined){let data123 = data30.editor;if(data123 && typeof data123 == "object" && !Array.isArray(data123)){if(data123.preview !== undefined){if(typeof data123.preview !== "boolean"){const err199 = {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 = [err199];}else {vErrors.push(err199);}errors++;}}}else {const err200 = {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 = [err200];}else {vErrors.push(err200);}errors++;}}if(data30.format !== undefined){let data125 = data30.format;if(typeof data125 !== "string"){const err201 = {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 = [err201];}else {vErrors.push(err201);}errors++;}if(!((((((((data125 === "yml") || (data125 === "yaml")) || (data125 === "toml")) || (data125 === "json")) || (data125 === "frontmatter")) || (data125 === "json-frontmatter")) || (data125 === "toml-frontmatter")) || (data125 === "yaml-frontmatter"))){const err202 = {instancePath:instancePath+"/collections/" + i3+"/format",schemaPath:"#/properties/collections/items/properties/format/enum",keyword:"enum",params:{allowedValues: schema41.properties.collections.items.properties.format.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}if(data30.extension !== undefined){if(typeof data30.extension !== "string"){const err203 = {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 = [err203];}else {vErrors.push(err203);}errors++;}}if(data30.frontmatter_delimiter !== undefined){let data127 = data30.frontmatter_delimiter;if((typeof data127 !== "string") && (!(Array.isArray(data127)))){const err204 = {instancePath:instancePath+"/collections/" + i3+"/frontmatter_delimiter",schemaPath:"#/properties/collections/items/properties/frontmatter_delimiter/type",keyword:"type",params:{type: schema41.properties.collections.items.properties.frontmatter_delimiter.type},message:"must be string,array"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}if(Array.isArray(data127)){if(data127.length > 2){const err205 = {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 = [err205];}else {vErrors.push(err205);}errors++;}if(data127.length < 2){const err206 = {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 = [err206];}else {vErrors.push(err206);}errors++;}const len12 = data127.length;for(let i12=0; i12 0){let data191 = data190[0];const _errs476 = errors;let valid102 = false;let passing15 = null;const _errs477 = errors;if(typeof data191 !== "string"){const err300 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/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 = [err300];}else {vErrors.push(err300);}errors++;}var _valid20 = _errs477 === errors;if(_valid20){valid102 = true;passing15 = 0;}const _errs479 = errors;if(typeof data191 == "number"){if(!(data191 instanceof RegExp)){const err301 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err301];}else {vErrors.push(err301);}errors++;}}if(typeof data191 === "string"){if(!(data191 instanceof RegExp)){const err302 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err302];}else {vErrors.push(err302);}errors++;}}if(Array.isArray(data191)){if(!(data191 instanceof RegExp)){const err303 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err303];}else {vErrors.push(err303);}errors++;}}if(data191 && typeof data191 == "object" && !Array.isArray(data191)){if(!(data191 instanceof RegExp)){const err304 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err304];}else {vErrors.push(err304);}errors++;}}var _valid20 = _errs479 === errors;if(_valid20 && valid102){valid102 = false;passing15 = [passing15, 1];}else {if(_valid20){valid102 = true;passing15 = 1;}}if(!valid102){const err305 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing15},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err305];}else {vErrors.push(err305);}errors++;}else {errors = _errs476;if(vErrors !== null){if(_errs476){vErrors.length = _errs476;}else {vErrors = null;}}}}if(len20 > 1){if(typeof data190[1] !== "string"){const err306 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/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 = [err306];}else {vErrors.push(err306);}errors++;}}}else {const err307 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err307];}else {vErrors.push(err307);}errors++;}}if(data130.field !== undefined){if(!(validate33(data130.field, {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/field",parentData:data130,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);errors = vErrors.length;}}if(data130.fields !== undefined){if(!(validate34(data130.fields, {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/fields",parentData:data130,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}if(data130.types !== undefined){if(!(validate34(data130.types, {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/types",parentData:data130,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}}else {const err308 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13,schemaPath:"#/properties/collections/items/properties/fields/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err308];}else {vErrors.push(err308);}errors++;}}}else {const err309 = {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 = [err309];}else {vErrors.push(err309);}errors++;}}if(data30.sortable_fields !== undefined){let data196 = data30.sortable_fields;if(Array.isArray(data196)){const len21 = data196.length;for(let i20=0; i20 1000 || isNaN(data211)){const err336 = {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 = [err336];}else {vErrors.push(err336);}errors++;}if(data211 < 1 || isNaN(data211)){const err337 = {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 = [err337];}else {vErrors.push(err337);}errors++;}}else {const err338 = {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 = [err338];}else {vErrors.push(err338);}errors++;}}if(data210.summary !== undefined){if(typeof data210.summary !== "string"){const err339 = {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 = [err339];}else {vErrors.push(err339);}errors++;}}}else {const err340 = {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 = [err340];}else {vErrors.push(err340);}errors++;}}if(data30.meta !== undefined){let data213 = data30.meta;if(data213 && typeof data213 == "object" && !Array.isArray(data213)){if(Object.keys(data213).length < 1){const err341 = {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 = [err341];}else {vErrors.push(err341);}errors++;}for(const key3 in data213){if(!(key3 === "path")){const err342 = {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 = [err342];}else {vErrors.push(err342);}errors++;}}if(data213.path !== undefined){let data214 = data213.path;if(data214 && typeof data214 == "object" && !Array.isArray(data214)){if(data214.label === undefined){const err343 = {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 = [err343];}else {vErrors.push(err343);}errors++;}if(data214.widget === undefined){const err344 = {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 = [err344];}else {vErrors.push(err344);}errors++;}if(data214.index_file === undefined){const err345 = {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 = [err345];}else {vErrors.push(err345);}errors++;}if(data214.label !== undefined){if(typeof data214.label !== "string"){const err346 = {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 = [err346];}else {vErrors.push(err346);}errors++;}}if(data214.widget !== undefined){if(typeof data214.widget !== "string"){const err347 = {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 = [err347];}else {vErrors.push(err347);}errors++;}}if(data214.index_file !== undefined){if(typeof data214.index_file !== "string"){const err348 = {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 = [err348];}else {vErrors.push(err348);}errors++;}}}else {const err349 = {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 = [err349];}else {vErrors.push(err349);}errors++;}}}else {const err350 = {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 = [err350];}else {vErrors.push(err350);}errors++;}}if(data30.i18n !== undefined){let data218 = data30.i18n;const _errs537 = errors;let valid117 = false;let passing17 = null;const _errs538 = errors;if(typeof data218 !== "boolean"){const err351 = {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 = [err351];}else {vErrors.push(err351);}errors++;}var _valid22 = _errs538 === errors;if(_valid22){valid117 = true;passing17 = 0;}const _errs540 = errors;if(data218 && typeof data218 == "object" && !Array.isArray(data218)){if(data218.structure !== undefined){let data219 = data218.structure;if(typeof data219 !== "string"){const err352 = {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 = [err352];}else {vErrors.push(err352);}errors++;}if(!(((data219 === "multiple_folders") || (data219 === "multiple_files")) || (data219 === "single_file"))){const err353 = {instancePath:instancePath+"/collections/" + i3+"/i18n/structure",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum",keyword:"enum",params:{allowedValues: schema41.properties.collections.items.properties.i18n.oneOf[1].properties.structure.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err353];}else {vErrors.push(err353);}errors++;}}if(data218.locales !== undefined){let data220 = data218.locales;if(Array.isArray(data220)){if(data220.length < 2){const err354 = {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 = [err354];}else {vErrors.push(err354);}errors++;}const len25 = data220.length;for(let i24=0; i24 10){const err355 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i24,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 = [err355];}else {vErrors.push(err355);}errors++;}if(func9(data221) < 2){const err356 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i24,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 = [err356];}else {vErrors.push(err356);}errors++;}if(!pattern0.test(data221)){const err357 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i24,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 = [err357];}else {vErrors.push(err357);}errors++;}}else {const err358 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i24,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 = [err358];}else {vErrors.push(err358);}errors++;}}let i25 = data220.length;let j1;if(i25 > 1){const indices1 = {};for(;i25--;){let item1 = data220[i25];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j1 = indices1[item1];const err359 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems",keyword:"uniqueItems",params:{i: i25, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i25+" are identical)"};if(vErrors === null){vErrors = [err359];}else {vErrors.push(err359);}errors++;break;}indices1[item1] = i25;}}}else {const err360 = {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 = [err360];}else {vErrors.push(err360);}errors++;}}if(data218.default_locale !== undefined){let data222 = data218.default_locale;if(typeof data222 === "string"){if(func9(data222) > 10){const err361 = {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 = [err361];}else {vErrors.push(err361);}errors++;}if(func9(data222) < 2){const err362 = {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 = [err362];}else {vErrors.push(err362);}errors++;}if(!pattern0.test(data222)){const err363 = {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 = [err363];}else {vErrors.push(err363);}errors++;}}else {const err364 = {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 = [err364];}else {vErrors.push(err364);}errors++;}}}else {const err365 = {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 = [err365];}else {vErrors.push(err365);}errors++;}var _valid22 = _errs540 === errors;if(_valid22 && valid117){valid117 = false;passing17 = [passing17, 1];}else {if(_valid22){valid117 = true;passing17 = 1;}}if(!valid117){const err366 = {instancePath:instancePath+"/collections/" + i3+"/i18n",schemaPath:"#/properties/collections/items/properties/i18n/oneOf",keyword:"oneOf",params:{passingSchemas: passing17},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err366];}else {vErrors.push(err366);}errors++;}else {errors = _errs537;if(vErrors !== null){if(_errs537){vErrors.length = _errs537;}else {vErrors = null;}}}}}else {const err367 = {instancePath:instancePath+"/collections/" + i3,schemaPath:"#/properties/collections/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err367];}else {vErrors.push(err367);}errors++;}}}else {const err368 = {instancePath:instancePath+"/collections",schemaPath:"#/properties/collections/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err368];}else {vErrors.push(err368);}errors++;}}if(data.editor !== undefined){let data223 = data.editor;if(data223 && typeof data223 == "object" && !Array.isArray(data223)){if(data223.preview !== undefined){if(typeof data223.preview !== "boolean"){const err369 = {instancePath:instancePath+"/editor/preview",schemaPath:"#/properties/editor/properties/preview/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err369];}else {vErrors.push(err369);}errors++;}}}else {const err370 = {instancePath:instancePath+"/editor",schemaPath:"#/properties/editor/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err370];}else {vErrors.push(err370);}errors++;}}}else {const err371 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err371];}else {vErrors.push(err371);}errors++;}validate25.errors = vErrors;return errors === 0;} \ No newline at end of file diff --git a/packages/netlify-cms-core/validation-rules/instanceof.js b/packages/netlify-cms-core/validation-rules/instanceof.js new file mode 100644 index 000000000000..f02a51a38df3 --- /dev/null +++ b/packages/netlify-cms-core/validation-rules/instanceof.js @@ -0,0 +1,26 @@ +const { _ } = require('ajv'); + +module.exports = function addInstanceOfKeyword(ajv) { + ajv.addKeyword({ + keyword: 'instanceof', + schemaType: 'string', + type: ['string', 'number', 'array', 'object'], + compile(schema) { + return data => + data instanceof + ({ + Object, + Array, + Function, + Number, + String, + Date, + RegExp, + })[schema]; + }, + code(cxt) { + const { data, schema } = cxt; + cxt.fail(_`!(${data} instanceof ` + schema + `)`); + } + }); +}; From 231914cecec2b33cbf78895c92ee061adb916c03 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Thu, 6 Jan 2022 14:22:20 -0800 Subject: [PATCH 13/20] chore(csp): uniqueItemProperties tests are passing --- packages/netlify-cms-core/package.json | 2 +- .../src/constants/staticValidateConfig.js | 18652 +++++++++++++++- .../validation-rules/instanceof.js | 26 +- .../validation-rules/uniqueItemProperties.js | 19 + 4 files changed, 18684 insertions(+), 15 deletions(-) create mode 100644 packages/netlify-cms-core/validation-rules/uniqueItemProperties.js diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index 30543585d92b..a8c479903369 100644 --- a/packages/netlify-cms-core/package.json +++ b/packages/netlify-cms-core/package.json @@ -17,7 +17,7 @@ "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\"", - "write-validate-schema": "NODE_ENV=production ajv --strict=false -c ajv-keywords/dist/keywords/select -c ./validation-rules/instanceof.js compile --all-errors --data -s ./config.schema.json -o ./src/constants/staticValidateConfig.js" + "write-validate-schema": "NODE_ENV=production ajv --strict=false -c ajv-keywords/dist/keywords/select -c ./validation-rules/instanceof.js -c ./validation-rules/uniqueItemProperties.js compile --all-errors --data -s ./config.schema.json -o ./src/constants/staticValidateConfig.js" }, "keywords": [ "netlify", diff --git a/packages/netlify-cms-core/src/constants/staticValidateConfig.js b/packages/netlify-cms-core/src/constants/staticValidateConfig.js index c445b53a9820..d6ec4beb793d 100644 --- a/packages/netlify-cms-core/src/constants/staticValidateConfig.js +++ b/packages/netlify-cms-core/src/constants/staticValidateConfig.js @@ -1 +1,18651 @@ -"use strict";module.exports = validate25;module.exports.default = validate25;const schema41 = {"$id":"https://netlify-cms/object.json","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_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","type":"array","minItems":1,"items":{"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]}},"required":["name","label","file","fields"]},"uniqueItemProperties":["name"]},"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_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","type":"array","minItems":1,"items":{"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["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"]}}},"uniqueItemProperties":["name"]},"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 func9 = require("ajv/dist/runtime/ucs2length").default;const pattern0 = new RegExp("^[a-zA-Z-_]+$", "u");const schema42 = {"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]};const wrapper0 = {validate: validate26};const schema43 = {"$id":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","type":"array","minItems":1,"items":{"$id":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"fields":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"},"types":{"$ref":"fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]};const wrapper2 = {validate: validate27};function validate27(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */;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){let data61 = data60[0];const _errs161 = errors;let valid36 = false;let passing6 = null;const _errs162 = errors;if(typeof data61 !== "string"){const err92 = {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 = [err92];}else {vErrors.push(err92);}errors++;}var _valid7 = _errs162 === errors;if(_valid7){valid36 = true;passing6 = 0;}const _errs164 = errors;if(typeof data61 == "number"){if(!(data61 instanceof RegExp)){const err93 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(typeof data61 === "string"){if(!(data61 instanceof RegExp)){const err94 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(Array.isArray(data61)){if(!(data61 instanceof RegExp)){const err95 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data61 && typeof data61 == "object" && !Array.isArray(data61)){if(!(data61 instanceof RegExp)){const err96 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}var _valid7 = _errs164 === errors;if(_valid7 && valid36){valid36 = false;passing6 = [passing6, 1];}else {if(_valid7){valid36 = true;passing6 = 1;}}if(!valid36){const err97 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing6},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}else {errors = _errs161;if(vErrors !== null){if(_errs161){vErrors.length = _errs161;}else {vErrors = null;}}}}if(len7 > 1){if(typeof data60[1] !== "string"){const err98 = {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 = [err98];}else {vErrors.push(err98);}errors++;}}}else {const err99 = {instancePath:instancePath+"/" + i0+"/pattern",schemaPath:"#/items/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}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 err100 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}}else {const err101 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}validate27.errors = vErrors;return errors === 0;}function validate26(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */;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 == "unknown"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "string"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "number"){const _errs1 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.step !== undefined){if(!(typeof data.step == "number")){const err1 = {instancePath:instancePath+"/step",schemaPath:"#/selectCases/number/properties/step/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.value_type !== undefined){if(typeof data.value_type !== "string"){const err2 = {instancePath:instancePath+"/value_type",schemaPath:"#/selectCases/number/properties/value_type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.min !== undefined){if(!(typeof data.min == "number")){const err3 = {instancePath:instancePath+"/min",schemaPath:"#/selectCases/number/properties/min/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.max !== undefined){if(!(typeof data.max == "number")){const err4 = {instancePath:instancePath+"/max",schemaPath:"#/selectCases/number/properties/max/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}var _valid0 = _errs1 === errors;valid0 = _valid0;}else if("" + value0 == "text"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "image"){const _errs10 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.allow_multiple !== undefined){if(typeof data.allow_multiple !== "boolean"){const err5 = {instancePath:instancePath+"/allow_multiple",schemaPath:"#/selectCases/image/properties/allow_multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}var _valid0 = _errs10 === errors;valid0 = _valid0;}else if("" + value0 == "file"){const _errs13 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.allow_multiple !== undefined){if(typeof data.allow_multiple !== "boolean"){const err6 = {instancePath:instancePath+"/allow_multiple",schemaPath:"#/selectCases/file/properties/allow_multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}var _valid0 = _errs13 === errors;valid0 = _valid0;}else if("" + value0 == "select"){const _errs16 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.options === undefined){const err7 = {instancePath,schemaPath:"#/selectCases/select/required",keyword:"required",params:{missingProperty: "options"},message:"must have required property '"+"options"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.multiple !== undefined){if(typeof data.multiple !== "boolean"){const err8 = {instancePath:instancePath+"/multiple",schemaPath:"#/selectCases/select/properties/multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.min !== undefined){let data7 = data.min;if(!((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7)))){const err9 = {instancePath:instancePath+"/min",schemaPath:"#/selectCases/select/properties/min/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.max !== undefined){let data8 = data.max;if(!((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8)))){const err10 = {instancePath:instancePath+"/max",schemaPath:"#/selectCases/select/properties/max/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.options !== undefined){let data9 = data.options;if(Array.isArray(data9)){const len0 = data9.length;for(let i0=0; i0 0){let data60 = data59[0];const _errs159 = errors;let valid34 = false;let passing6 = null;const _errs160 = errors;if(typeof data60 !== "string"){const err91 = {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 = [err91];}else {vErrors.push(err91);}errors++;}var _valid7 = _errs160 === errors;if(_valid7){valid34 = true;passing6 = 0;}const _errs162 = errors;if(typeof data60 == "number"){if(!(data60 instanceof RegExp)){const err92 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}if(typeof data60 === "string"){if(!(data60 instanceof RegExp)){const err93 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(Array.isArray(data60)){if(!(data60 instanceof RegExp)){const err94 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(data60 && typeof data60 == "object" && !Array.isArray(data60)){if(!(data60 instanceof RegExp)){const err95 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}var _valid7 = _errs162 === errors;if(_valid7 && valid34){valid34 = false;passing6 = [passing6, 1];}else {if(_valid7){valid34 = true;passing6 = 1;}}if(!valid34){const err96 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing6},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}else {errors = _errs159;if(vErrors !== null){if(_errs159){vErrors.length = _errs159;}else {vErrors = null;}}}}if(len6 > 1){if(typeof data59[1] !== "string"){const err97 = {instancePath:instancePath+"/pattern/1",schemaPath:"#/properties/pattern/items/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}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(!(validate27(data.fields, {instancePath:instancePath+"/fields",parentData:data,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);errors = vErrors.length;}}if(data.types !== undefined){if(!(validate27(data.types, {instancePath:instancePath+"/types",parentData:data,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);errors = vErrors.length;}}}else {const err99 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}validate26.errors = vErrors;return errors === 0;}const schema44 = {"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]};const wrapper4 = {validate: validate33};const schema45 = {"$id":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","type":"array","minItems":1,"items":{"$id":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e","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"},{"instanceof":"RegExp"}]},{"type":"string"}]},"field":{"$ref":"field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"fields":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"},"types":{"$ref":"fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e"}},"select":{"$data":"0/widget"},"selectCases":{"unknown":{},"string":{},"number":{"properties":{"step":{"type":"number"},"value_type":{"type":"string"},"min":{"type":"number"},"max":{"type":"number"}}},"text":{},"image":{"properties":{"allow_multiple":{"type":"boolean"}}},"file":{"properties":{"allow_multiple":{"type":"boolean"}}},"select":{"properties":{"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"options":{"type":"array","items":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"object","properties":{"label":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"}]}},"required":["label","value"]}]}}},"required":["options"]},"markdown":{"properties":{"minimal":{"type":"boolean"},"buttons":{"type":"array","items":{"type":"string","enum":["bold","italic","code","link","heading-one","heading-two","heading-three","heading-four","heading-five","heading-six","quote","bulleted-list","numbered-list"]}},"editor_components":{"type":"array","items":{"type":"string"}},"modes":{"type":"array","items":{"type":"string","enum":["raw","rich_text"]},"minItems":1}}},"list":{"properties":{"allow_add":{"type":"boolean"},"collapsed":{"type":"boolean"},"summary":{"type":"string"},"minimize_collapsed":{"type":"boolean"},"label_singular":{"type":"string"},"i18n":{"type":"boolean"},"min":{"type":"number"},"max":{"type":"number"}}},"object":{"properties":{"collapsed":{"type":"boolean"},"i18n":{"type":"boolean"}}},"relation":{"properties":{"collection":{"type":"string"},"value_field":{"type":"string"},"search_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"file":{"type":"string"},"multiple":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"display_fields":{"type":"array","minItems":1,"items":{"type":"string"}},"options_length":{"type":"integer"}},"oneOf":[{"required":["collection","value_field","search_fields"]},{"required":["collection","valueField","searchFields"]}]},"boolean":{},"map":{"properties":{"decimals":{"type":"integer"},"type":{"type":"string","enum":["Point","LineString","Polygon"]}}},"date":{},"datetime":{"properties":{"format":{"type":"string"},"date_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"time_format":{"oneOf":[{"type":"string"},{"type":"boolean"}]},"picker_utc":{"type":"boolean"}}},"code":{"properties":{"default_language":{"type":"string"},"allow_language_selection":{"type":"boolean"},"output_code_only":{"type":"boolean"},"keys":{"type":"object","properties":{"code":{"type":"string"},"lang":{"type":"string"}}}}},"color":{}},"required":["name"]},"uniqueItemProperties":["name"]};const wrapper6 = {validate: validate34};function validate34(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */;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){let data61 = data60[0];const _errs161 = errors;let valid36 = false;let passing6 = null;const _errs162 = errors;if(typeof data61 !== "string"){const err92 = {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 = [err92];}else {vErrors.push(err92);}errors++;}var _valid7 = _errs162 === errors;if(_valid7){valid36 = true;passing6 = 0;}const _errs164 = errors;if(typeof data61 == "number"){if(!(data61 instanceof RegExp)){const err93 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(typeof data61 === "string"){if(!(data61 instanceof RegExp)){const err94 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(Array.isArray(data61)){if(!(data61 instanceof RegExp)){const err95 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}if(data61 && typeof data61 == "object" && !Array.isArray(data61)){if(!(data61 instanceof RegExp)){const err96 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}}var _valid7 = _errs164 === errors;if(_valid7 && valid36){valid36 = false;passing6 = [passing6, 1];}else {if(_valid7){valid36 = true;passing6 = 1;}}if(!valid36){const err97 = {instancePath:instancePath+"/" + i0+"/pattern/0",schemaPath:"#/items/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing6},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}else {errors = _errs161;if(vErrors !== null){if(_errs161){vErrors.length = _errs161;}else {vErrors = null;}}}}if(len7 > 1){if(typeof data60[1] !== "string"){const err98 = {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 = [err98];}else {vErrors.push(err98);}errors++;}}}else {const err99 = {instancePath:instancePath+"/" + i0+"/pattern",schemaPath:"#/items/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}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 err100 = {instancePath:instancePath+"/" + i0,schemaPath:"#/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}}}else {const err101 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}validate34.errors = vErrors;return errors === 0;}function validate33(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */;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 == "unknown"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "string"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "number"){const _errs1 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.step !== undefined){if(!(typeof data.step == "number")){const err1 = {instancePath:instancePath+"/step",schemaPath:"#/selectCases/number/properties/step/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.value_type !== undefined){if(typeof data.value_type !== "string"){const err2 = {instancePath:instancePath+"/value_type",schemaPath:"#/selectCases/number/properties/value_type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.min !== undefined){if(!(typeof data.min == "number")){const err3 = {instancePath:instancePath+"/min",schemaPath:"#/selectCases/number/properties/min/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.max !== undefined){if(!(typeof data.max == "number")){const err4 = {instancePath:instancePath+"/max",schemaPath:"#/selectCases/number/properties/max/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}}var _valid0 = _errs1 === errors;valid0 = _valid0;}else if("" + value0 == "text"){var _valid0 = true;valid0 = _valid0;}else if("" + value0 == "image"){const _errs10 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.allow_multiple !== undefined){if(typeof data.allow_multiple !== "boolean"){const err5 = {instancePath:instancePath+"/allow_multiple",schemaPath:"#/selectCases/image/properties/allow_multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}var _valid0 = _errs10 === errors;valid0 = _valid0;}else if("" + value0 == "file"){const _errs13 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.allow_multiple !== undefined){if(typeof data.allow_multiple !== "boolean"){const err6 = {instancePath:instancePath+"/allow_multiple",schemaPath:"#/selectCases/file/properties/allow_multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}var _valid0 = _errs13 === errors;valid0 = _valid0;}else if("" + value0 == "select"){const _errs16 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.options === undefined){const err7 = {instancePath,schemaPath:"#/selectCases/select/required",keyword:"required",params:{missingProperty: "options"},message:"must have required property '"+"options"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.multiple !== undefined){if(typeof data.multiple !== "boolean"){const err8 = {instancePath:instancePath+"/multiple",schemaPath:"#/selectCases/select/properties/multiple/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.min !== undefined){let data7 = data.min;if(!((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7)))){const err9 = {instancePath:instancePath+"/min",schemaPath:"#/selectCases/select/properties/min/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.max !== undefined){let data8 = data.max;if(!((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8)))){const err10 = {instancePath:instancePath+"/max",schemaPath:"#/selectCases/select/properties/max/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.options !== undefined){let data9 = data.options;if(Array.isArray(data9)){const len0 = data9.length;for(let i0=0; i0 0){let data60 = data59[0];const _errs159 = errors;let valid34 = false;let passing6 = null;const _errs160 = errors;if(typeof data60 !== "string"){const err91 = {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 = [err91];}else {vErrors.push(err91);}errors++;}var _valid7 = _errs160 === errors;if(_valid7){valid34 = true;passing6 = 0;}const _errs162 = errors;if(typeof data60 == "number"){if(!(data60 instanceof RegExp)){const err92 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err92];}else {vErrors.push(err92);}errors++;}}if(typeof data60 === "string"){if(!(data60 instanceof RegExp)){const err93 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err93];}else {vErrors.push(err93);}errors++;}}if(Array.isArray(data60)){if(!(data60 instanceof RegExp)){const err94 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err94];}else {vErrors.push(err94);}errors++;}}if(data60 && typeof data60 == "object" && !Array.isArray(data60)){if(!(data60 instanceof RegExp)){const err95 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err95];}else {vErrors.push(err95);}errors++;}}var _valid7 = _errs162 === errors;if(_valid7 && valid34){valid34 = false;passing6 = [passing6, 1];}else {if(_valid7){valid34 = true;passing6 = 1;}}if(!valid34){const err96 = {instancePath:instancePath+"/pattern/0",schemaPath:"#/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing6},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}else {errors = _errs159;if(vErrors !== null){if(_errs159){vErrors.length = _errs159;}else {vErrors = null;}}}}if(len6 > 1){if(typeof data59[1] !== "string"){const err97 = {instancePath:instancePath+"/pattern/1",schemaPath:"#/properties/pattern/items/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}}else {const err98 = {instancePath:instancePath+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}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(!(validate34(data.fields, {instancePath:instancePath+"/fields",parentData:data,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}if(data.types !== undefined){if(!(validate34(data.types, {instancePath:instancePath+"/types",parentData:data,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}}else {const err99 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}validate33.errors = vErrors;return errors === 0;}function validate25(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="https://netlify-cms/object.json" */;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: schema41.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(func9(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(func9(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(func9(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(func9(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: schema41.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: schema41.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){let data109 = data108[0];const _errs275 = errors;let valid62 = false;let passing8 = null;const _errs276 = errors;if(typeof data109 !== "string"){const err178 = {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 = [err178];}else {vErrors.push(err178);}errors++;}var _valid12 = _errs276 === errors;if(_valid12){valid62 = true;passing8 = 0;}const _errs278 = errors;if(typeof data109 == "number"){if(!(data109 instanceof RegExp)){const err179 = {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/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err179];}else {vErrors.push(err179);}errors++;}}if(typeof data109 === "string"){if(!(data109 instanceof RegExp)){const err180 = {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/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err180];}else {vErrors.push(err180);}errors++;}}if(Array.isArray(data109)){if(!(data109 instanceof RegExp)){const err181 = {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/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err181];}else {vErrors.push(err181);}errors++;}}if(data109 && typeof data109 == "object" && !Array.isArray(data109)){if(!(data109 instanceof RegExp)){const err182 = {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/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err182];}else {vErrors.push(err182);}errors++;}}var _valid12 = _errs278 === errors;if(_valid12 && valid62){valid62 = false;passing8 = [passing8, 1];}else {if(_valid12){valid62 = true;passing8 = 1;}}if(!valid62){const err183 = {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: passing8},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err183];}else {vErrors.push(err183);}errors++;}else {errors = _errs275;if(vErrors !== null){if(_errs275){vErrors.length = _errs275;}else {vErrors = null;}}}}if(len11 > 1){if(typeof data108[1] !== "string"){const err184 = {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 = [err184];}else {vErrors.push(err184);}errors++;}}}else {const err185 = {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 = [err185];}else {vErrors.push(err185);}errors++;}}if(data48.field !== undefined){if(!(validate26(data48.field, {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/field",parentData:data48,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);errors = vErrors.length;}}if(data48.fields !== undefined){if(!(validate27(data48.fields, {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/fields",parentData:data48,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);errors = vErrors.length;}}if(data48.types !== undefined){if(!(validate27(data48.types, {instancePath:instancePath+"/collections/" + i3+"/files/" + i4+"/fields/" + i5+"/types",parentData:data48,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);errors = vErrors.length;}}}else {const err186 = {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 = [err186];}else {vErrors.push(err186);}errors++;}}}else {const err187 = {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 = [err187];}else {vErrors.push(err187);}errors++;}}}else {const err188 = {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 = [err188];}else {vErrors.push(err188);}errors++;}}}else {const err189 = {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 = [err189];}else {vErrors.push(err189);}errors++;}}if(data30.identifier_field !== undefined){if(typeof data30.identifier_field !== "string"){const err190 = {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 = [err190];}else {vErrors.push(err190);}errors++;}}if(data30.summary !== undefined){if(typeof data30.summary !== "string"){const err191 = {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 = [err191];}else {vErrors.push(err191);}errors++;}}if(data30.slug !== undefined){if(typeof data30.slug !== "string"){const err192 = {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 = [err192];}else {vErrors.push(err192);}errors++;}}if(data30.path !== undefined){if(typeof data30.path !== "string"){const err193 = {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 = [err193];}else {vErrors.push(err193);}errors++;}}if(data30.preview_path !== undefined){if(typeof data30.preview_path !== "string"){const err194 = {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 = [err194];}else {vErrors.push(err194);}errors++;}}if(data30.preview_path_date_field !== undefined){if(typeof data30.preview_path_date_field !== "string"){const err195 = {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 = [err195];}else {vErrors.push(err195);}errors++;}}if(data30.create !== undefined){if(typeof data30.create !== "boolean"){const err196 = {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 = [err196];}else {vErrors.push(err196);}errors++;}}if(data30.publish !== undefined){if(typeof data30.publish !== "boolean"){const err197 = {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 = [err197];}else {vErrors.push(err197);}errors++;}}if(data30.hide !== undefined){if(typeof data30.hide !== "boolean"){const err198 = {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 = [err198];}else {vErrors.push(err198);}errors++;}}if(data30.editor !== undefined){let data123 = data30.editor;if(data123 && typeof data123 == "object" && !Array.isArray(data123)){if(data123.preview !== undefined){if(typeof data123.preview !== "boolean"){const err199 = {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 = [err199];}else {vErrors.push(err199);}errors++;}}}else {const err200 = {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 = [err200];}else {vErrors.push(err200);}errors++;}}if(data30.format !== undefined){let data125 = data30.format;if(typeof data125 !== "string"){const err201 = {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 = [err201];}else {vErrors.push(err201);}errors++;}if(!((((((((data125 === "yml") || (data125 === "yaml")) || (data125 === "toml")) || (data125 === "json")) || (data125 === "frontmatter")) || (data125 === "json-frontmatter")) || (data125 === "toml-frontmatter")) || (data125 === "yaml-frontmatter"))){const err202 = {instancePath:instancePath+"/collections/" + i3+"/format",schemaPath:"#/properties/collections/items/properties/format/enum",keyword:"enum",params:{allowedValues: schema41.properties.collections.items.properties.format.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err202];}else {vErrors.push(err202);}errors++;}}if(data30.extension !== undefined){if(typeof data30.extension !== "string"){const err203 = {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 = [err203];}else {vErrors.push(err203);}errors++;}}if(data30.frontmatter_delimiter !== undefined){let data127 = data30.frontmatter_delimiter;if((typeof data127 !== "string") && (!(Array.isArray(data127)))){const err204 = {instancePath:instancePath+"/collections/" + i3+"/frontmatter_delimiter",schemaPath:"#/properties/collections/items/properties/frontmatter_delimiter/type",keyword:"type",params:{type: schema41.properties.collections.items.properties.frontmatter_delimiter.type},message:"must be string,array"};if(vErrors === null){vErrors = [err204];}else {vErrors.push(err204);}errors++;}if(Array.isArray(data127)){if(data127.length > 2){const err205 = {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 = [err205];}else {vErrors.push(err205);}errors++;}if(data127.length < 2){const err206 = {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 = [err206];}else {vErrors.push(err206);}errors++;}const len12 = data127.length;for(let i12=0; i12 0){let data191 = data190[0];const _errs476 = errors;let valid102 = false;let passing15 = null;const _errs477 = errors;if(typeof data191 !== "string"){const err300 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/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 = [err300];}else {vErrors.push(err300);}errors++;}var _valid20 = _errs477 === errors;if(_valid20){valid102 = true;passing15 = 0;}const _errs479 = errors;if(typeof data191 == "number"){if(!(data191 instanceof RegExp)){const err301 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err301];}else {vErrors.push(err301);}errors++;}}if(typeof data191 === "string"){if(!(data191 instanceof RegExp)){const err302 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err302];}else {vErrors.push(err302);}errors++;}}if(Array.isArray(data191)){if(!(data191 instanceof RegExp)){const err303 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err303];}else {vErrors.push(err303);}errors++;}}if(data191 && typeof data191 == "object" && !Array.isArray(data191)){if(!(data191 instanceof RegExp)){const err304 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof",keyword:"instanceof",params:{},message:"must pass \"instanceof\" keyword validation"};if(vErrors === null){vErrors = [err304];}else {vErrors.push(err304);}errors++;}}var _valid20 = _errs479 === errors;if(_valid20 && valid102){valid102 = false;passing15 = [passing15, 1];}else {if(_valid20){valid102 = true;passing15 = 1;}}if(!valid102){const err305 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern/0",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf",keyword:"oneOf",params:{passingSchemas: passing15},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err305];}else {vErrors.push(err305);}errors++;}else {errors = _errs476;if(vErrors !== null){if(_errs476){vErrors.length = _errs476;}else {vErrors = null;}}}}if(len20 > 1){if(typeof data190[1] !== "string"){const err306 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/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 = [err306];}else {vErrors.push(err306);}errors++;}}}else {const err307 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/pattern",schemaPath:"#/properties/collections/items/properties/fields/items/properties/pattern/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err307];}else {vErrors.push(err307);}errors++;}}if(data130.field !== undefined){if(!(validate33(data130.field, {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/field",parentData:data130,parentDataProperty:"field",rootData}))){vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);errors = vErrors.length;}}if(data130.fields !== undefined){if(!(validate34(data130.fields, {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/fields",parentData:data130,parentDataProperty:"fields",rootData}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}if(data130.types !== undefined){if(!(validate34(data130.types, {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13+"/types",parentData:data130,parentDataProperty:"types",rootData}))){vErrors = vErrors === null ? validate34.errors : vErrors.concat(validate34.errors);errors = vErrors.length;}}}else {const err308 = {instancePath:instancePath+"/collections/" + i3+"/fields/" + i13,schemaPath:"#/properties/collections/items/properties/fields/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err308];}else {vErrors.push(err308);}errors++;}}}else {const err309 = {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 = [err309];}else {vErrors.push(err309);}errors++;}}if(data30.sortable_fields !== undefined){let data196 = data30.sortable_fields;if(Array.isArray(data196)){const len21 = data196.length;for(let i20=0; i20 1000 || isNaN(data211)){const err336 = {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 = [err336];}else {vErrors.push(err336);}errors++;}if(data211 < 1 || isNaN(data211)){const err337 = {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 = [err337];}else {vErrors.push(err337);}errors++;}}else {const err338 = {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 = [err338];}else {vErrors.push(err338);}errors++;}}if(data210.summary !== undefined){if(typeof data210.summary !== "string"){const err339 = {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 = [err339];}else {vErrors.push(err339);}errors++;}}}else {const err340 = {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 = [err340];}else {vErrors.push(err340);}errors++;}}if(data30.meta !== undefined){let data213 = data30.meta;if(data213 && typeof data213 == "object" && !Array.isArray(data213)){if(Object.keys(data213).length < 1){const err341 = {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 = [err341];}else {vErrors.push(err341);}errors++;}for(const key3 in data213){if(!(key3 === "path")){const err342 = {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 = [err342];}else {vErrors.push(err342);}errors++;}}if(data213.path !== undefined){let data214 = data213.path;if(data214 && typeof data214 == "object" && !Array.isArray(data214)){if(data214.label === undefined){const err343 = {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 = [err343];}else {vErrors.push(err343);}errors++;}if(data214.widget === undefined){const err344 = {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 = [err344];}else {vErrors.push(err344);}errors++;}if(data214.index_file === undefined){const err345 = {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 = [err345];}else {vErrors.push(err345);}errors++;}if(data214.label !== undefined){if(typeof data214.label !== "string"){const err346 = {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 = [err346];}else {vErrors.push(err346);}errors++;}}if(data214.widget !== undefined){if(typeof data214.widget !== "string"){const err347 = {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 = [err347];}else {vErrors.push(err347);}errors++;}}if(data214.index_file !== undefined){if(typeof data214.index_file !== "string"){const err348 = {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 = [err348];}else {vErrors.push(err348);}errors++;}}}else {const err349 = {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 = [err349];}else {vErrors.push(err349);}errors++;}}}else {const err350 = {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 = [err350];}else {vErrors.push(err350);}errors++;}}if(data30.i18n !== undefined){let data218 = data30.i18n;const _errs537 = errors;let valid117 = false;let passing17 = null;const _errs538 = errors;if(typeof data218 !== "boolean"){const err351 = {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 = [err351];}else {vErrors.push(err351);}errors++;}var _valid22 = _errs538 === errors;if(_valid22){valid117 = true;passing17 = 0;}const _errs540 = errors;if(data218 && typeof data218 == "object" && !Array.isArray(data218)){if(data218.structure !== undefined){let data219 = data218.structure;if(typeof data219 !== "string"){const err352 = {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 = [err352];}else {vErrors.push(err352);}errors++;}if(!(((data219 === "multiple_folders") || (data219 === "multiple_files")) || (data219 === "single_file"))){const err353 = {instancePath:instancePath+"/collections/" + i3+"/i18n/structure",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum",keyword:"enum",params:{allowedValues: schema41.properties.collections.items.properties.i18n.oneOf[1].properties.structure.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err353];}else {vErrors.push(err353);}errors++;}}if(data218.locales !== undefined){let data220 = data218.locales;if(Array.isArray(data220)){if(data220.length < 2){const err354 = {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 = [err354];}else {vErrors.push(err354);}errors++;}const len25 = data220.length;for(let i24=0; i24 10){const err355 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i24,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 = [err355];}else {vErrors.push(err355);}errors++;}if(func9(data221) < 2){const err356 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i24,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 = [err356];}else {vErrors.push(err356);}errors++;}if(!pattern0.test(data221)){const err357 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i24,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 = [err357];}else {vErrors.push(err357);}errors++;}}else {const err358 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales/" + i24,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 = [err358];}else {vErrors.push(err358);}errors++;}}let i25 = data220.length;let j1;if(i25 > 1){const indices1 = {};for(;i25--;){let item1 = data220[i25];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j1 = indices1[item1];const err359 = {instancePath:instancePath+"/collections/" + i3+"/i18n/locales",schemaPath:"#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems",keyword:"uniqueItems",params:{i: i25, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i25+" are identical)"};if(vErrors === null){vErrors = [err359];}else {vErrors.push(err359);}errors++;break;}indices1[item1] = i25;}}}else {const err360 = {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 = [err360];}else {vErrors.push(err360);}errors++;}}if(data218.default_locale !== undefined){let data222 = data218.default_locale;if(typeof data222 === "string"){if(func9(data222) > 10){const err361 = {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 = [err361];}else {vErrors.push(err361);}errors++;}if(func9(data222) < 2){const err362 = {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 = [err362];}else {vErrors.push(err362);}errors++;}if(!pattern0.test(data222)){const err363 = {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 = [err363];}else {vErrors.push(err363);}errors++;}}else {const err364 = {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 = [err364];}else {vErrors.push(err364);}errors++;}}}else {const err365 = {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 = [err365];}else {vErrors.push(err365);}errors++;}var _valid22 = _errs540 === errors;if(_valid22 && valid117){valid117 = false;passing17 = [passing17, 1];}else {if(_valid22){valid117 = true;passing17 = 1;}}if(!valid117){const err366 = {instancePath:instancePath+"/collections/" + i3+"/i18n",schemaPath:"#/properties/collections/items/properties/i18n/oneOf",keyword:"oneOf",params:{passingSchemas: passing17},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err366];}else {vErrors.push(err366);}errors++;}else {errors = _errs537;if(vErrors !== null){if(_errs537){vErrors.length = _errs537;}else {vErrors = null;}}}}}else {const err367 = {instancePath:instancePath+"/collections/" + i3,schemaPath:"#/properties/collections/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err367];}else {vErrors.push(err367);}errors++;}}}else {const err368 = {instancePath:instancePath+"/collections",schemaPath:"#/properties/collections/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err368];}else {vErrors.push(err368);}errors++;}}if(data.editor !== undefined){let data223 = data.editor;if(data223 && typeof data223 == "object" && !Array.isArray(data223)){if(data223.preview !== undefined){if(typeof data223.preview !== "boolean"){const err369 = {instancePath:instancePath+"/editor/preview",schemaPath:"#/properties/editor/properties/preview/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err369];}else {vErrors.push(err369);}errors++;}}}else {const err370 = {instancePath:instancePath+"/editor",schemaPath:"#/properties/editor/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err370];}else {vErrors.push(err370);}errors++;}}}else {const err371 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err371];}else {vErrors.push(err371);}errors++;}validate25.errors = vErrors;return errors === 0;} \ No newline at end of file +'use strict'; +module.exports = validate24; +module.exports.default = validate24; +const schema40 = { + $id: 'https://netlify-cms/object.json', + 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_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', + type: 'array', + minItems: 1, + items: { + $id: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', + 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' }, { instanceof: 'RegExp' }] }, + { type: 'string' }, + ], + }, + field: { $ref: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + fields: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + types: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + }, + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, + }, + }, + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, + }, + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, + }, + }, + }, + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + object: { + properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } }, + }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, + }, + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], + }, + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, + }, + }, + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, + }, + }, + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, + }, + }, + }, + color: {}, + }, + required: ['name'], + }, + uniqueItemProperties: ['name'], + }, + }, + required: ['name', 'label', 'file', 'fields'], + }, + uniqueItemProperties: ['name'], + }, + 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_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', + type: 'array', + minItems: 1, + items: { + $id: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', + 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' }, { instanceof: 'RegExp' }] }, + { type: 'string' }, + ], + }, + field: { $ref: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + fields: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + types: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + }, + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, + }, + }, + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, + }, + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, + }, + }, + }, + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + object: { + properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } }, + }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, + }, + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], + }, + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, + }, + }, + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, + }, + }, + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, + }, + }, + }, + color: {}, + }, + required: ['name'], + }, + uniqueItemProperties: ['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'], + }, + }, + }, + uniqueItemProperties: ['name'], + }, + 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 func9 = require('ajv/dist/runtime/ucs2length').default; +const pattern0 = new RegExp('^[a-zA-Z-_]+$', 'u'); +const schema41 = { + $id: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', + 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], + }, + field: { $ref: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + fields: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + types: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + }, + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, + }, + }, + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, + }, + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, + }, + }, + }, + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, + }, + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], + }, + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, + }, + }, + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, + }, + }, + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, + }, + }, + }, + color: {}, + }, + required: ['name'], +}; +const wrapper0 = { validate: validate25 }; +const schema42 = { + $id: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', + type: 'array', + minItems: 1, + items: { + $id: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d', + 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], + }, + field: { $ref: 'field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + fields: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + types: { $ref: 'fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d' }, + }, + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, + }, + }, + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, + }, + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, + }, + }, + }, + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, + }, + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], + }, + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, + }, + }, + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, + }, + }, + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, + }, + }, + }, + color: {}, + }, + required: ['name'], + }, + uniqueItemProperties: ['name'], +}; +const wrapper2 = { validate: validate26 }; +function validate26( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + /*# sourceURL="fields_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */ 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 < len0; i0++) { + let data0 = data[i0]; + const vSchema0 = data0 && data0.widget; + if (!(vSchema0 === undefined)) { + if ( + typeof vSchema0 !== 'string' && + !(typeof vSchema0 == 'number') && + typeof vSchema0 !== 'boolean' && + vSchema0 !== null + ) { + const err1 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/select', + keyword: 'select', + params: {}, + message: '"select" keyword must be string,number,boolean,null ($data)', + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } else { + let valid2 = true; + const value0 = vSchema0 === null ? 'null' : vSchema0; + if ('' + value0 == 'unknown') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'string') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'number') { + const _errs3 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.step !== undefined) { + if (!(typeof data0.step == 'number')) { + const err2 = { + instancePath: instancePath + '/' + i0 + '/step', + schemaPath: '#/items/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + if (data0.value_type !== undefined) { + if (typeof data0.value_type !== 'string') { + const err3 = { + instancePath: instancePath + '/' + i0 + '/value_type', + schemaPath: '#/items/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + if (data0.min !== undefined) { + if (!(typeof data0.min == 'number')) { + const err4 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + if (data0.max !== undefined) { + if (!(typeof data0.max == 'number')) { + const err5 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + } + var _valid0 = _errs3 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'text') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'image') { + const _errs12 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_multiple !== undefined) { + if (typeof data0.allow_multiple !== 'boolean') { + const err6 = { + instancePath: instancePath + '/' + i0 + '/allow_multiple', + schemaPath: '#/items/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + } + var _valid0 = _errs12 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'file') { + const _errs15 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_multiple !== undefined) { + if (typeof data0.allow_multiple !== 'boolean') { + const err7 = { + instancePath: instancePath + '/' + i0 + '/allow_multiple', + schemaPath: '#/items/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } + } + var _valid0 = _errs15 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'select') { + const _errs18 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.options === undefined) { + const err8 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + if (data0.multiple !== undefined) { + if (typeof data0.multiple !== 'boolean') { + const err9 = { + instancePath: instancePath + '/' + i0 + '/multiple', + schemaPath: '#/items/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + if (data0.min !== undefined) { + let data8 = data0.min; + if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { + const err10 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + if (data0.max !== undefined) { + let data9 = data0.max; + if (!(typeof data9 == 'number' && !(data9 % 1) && !isNaN(data9))) { + const err11 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + if (data0.options !== undefined) { + let data10 = data0.options; + if (Array.isArray(data10)) { + const len1 = data10.length; + for (let i1 = 0; i1 < len1; i1++) { + let data11 = data10[i1]; + const _errs28 = errors; + let valid9 = false; + let passing0 = null; + const _errs29 = errors; + if (typeof data11 !== 'string') { + const err12 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + var _valid1 = _errs29 === errors; + if (_valid1) { + valid9 = true; + passing0 = 0; + } + const _errs31 = errors; + if (!(typeof data11 == 'number')) { + const err13 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + var _valid1 = _errs31 === errors; + if (_valid1 && valid9) { + valid9 = false; + passing0 = [passing0, 1]; + } else { + if (_valid1) { + valid9 = true; + passing0 = 1; + } + const _errs33 = errors; + if (data11 && typeof data11 == 'object' && !Array.isArray(data11)) { + if (data11.label === undefined) { + const err14 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + if (data11.value === undefined) { + const err15 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + if (data11.label !== undefined) { + if (typeof data11.label !== 'string') { + const err16 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/label', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + if (data11.value !== undefined) { + let data13 = data11.value; + const _errs38 = errors; + let valid11 = false; + let passing1 = null; + const _errs39 = errors; + if (typeof data13 !== 'string') { + const err17 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var _valid2 = _errs39 === errors; + if (_valid2) { + valid11 = true; + passing1 = 0; + } + const _errs41 = errors; + if (!(typeof data13 == 'number')) { + const err18 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + var _valid2 = _errs41 === errors; + if (_valid2 && valid11) { + valid11 = false; + passing1 = [passing1, 1]; + } else { + if (_valid2) { + valid11 = true; + passing1 = 1; + } + } + if (!valid11) { + const err19 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs38; + if (vErrors !== null) { + if (_errs38) { + vErrors.length = _errs38; + } else { + vErrors = null; + } + } + } + } + } else { + const err20 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + var _valid1 = _errs33 === errors; + if (_valid1 && valid9) { + valid9 = false; + passing0 = [passing0, 2]; + } else { + if (_valid1) { + valid9 = true; + passing0 = 2; + } + } + } + if (!valid9) { + const err21 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: '#/items/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing0 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } else { + errors = _errs28; + if (vErrors !== null) { + if (_errs28) { + vErrors.length = _errs28; + } else { + vErrors = null; + } + } + } + } + } else { + const err22 = { + instancePath: instancePath + '/' + i0 + '/options', + schemaPath: '#/items/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } + } + var _valid0 = _errs18 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'markdown') { + const _errs43 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.minimal !== undefined) { + if (typeof data0.minimal !== 'boolean') { + const err23 = { + instancePath: instancePath + '/' + i0 + '/minimal', + schemaPath: '#/items/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + if (data0.buttons !== undefined) { + let data15 = data0.buttons; + if (Array.isArray(data15)) { + const len2 = data15.length; + for (let i2 = 0; i2 < len2; i2++) { + let data16 = data15[i2]; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: instancePath + '/' + i0 + '/buttons/' + i2, + schemaPath: '#/items/selectCases/markdown/properties/buttons/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + if ( + !( + data16 === 'bold' || + data16 === 'italic' || + data16 === 'code' || + data16 === 'link' || + data16 === 'heading-one' || + data16 === 'heading-two' || + data16 === 'heading-three' || + data16 === 'heading-four' || + data16 === 'heading-five' || + data16 === 'heading-six' || + data16 === 'quote' || + data16 === 'bulleted-list' || + data16 === 'numbered-list' + ) + ) { + const err25 = { + instancePath: instancePath + '/' + i0 + '/buttons/' + i2, + schemaPath: '#/items/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema42.items.selectCases.markdown.properties.buttons.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + } else { + const err26 = { + instancePath: instancePath + '/' + i0 + '/buttons', + schemaPath: '#/items/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + if (data0.editor_components !== undefined) { + let data17 = data0.editor_components; + if (Array.isArray(data17)) { + const len3 = data17.length; + for (let i3 = 0; i3 < len3; i3++) { + if (typeof data17[i3] !== 'string') { + const err27 = { + instancePath: instancePath + '/' + i0 + '/editor_components/' + i3, + schemaPath: + '#/items/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + } else { + const err28 = { + instancePath: instancePath + '/' + i0 + '/editor_components', + schemaPath: '#/items/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + if (data0.modes !== undefined) { + let data19 = data0.modes; + if (Array.isArray(data19)) { + if (data19.length < 1) { + const err29 = { + instancePath: instancePath + '/' + i0 + '/modes', + schemaPath: '#/items/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + const len4 = data19.length; + for (let i4 = 0; i4 < len4; i4++) { + let data20 = data19[i4]; + if (typeof data20 !== 'string') { + const err30 = { + instancePath: instancePath + '/' + i0 + '/modes/' + i4, + schemaPath: '#/items/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + if (!(data20 === 'raw' || data20 === 'rich_text')) { + const err31 = { + instancePath: instancePath + '/' + i0 + '/modes/' + i4, + schemaPath: '#/items/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema42.items.selectCases.markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } + } else { + const err32 = { + instancePath: instancePath + '/' + i0 + '/modes', + schemaPath: '#/items/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var _valid0 = _errs43 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'list') { + const _errs58 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_add !== undefined) { + if (typeof data0.allow_add !== 'boolean') { + const err33 = { + instancePath: instancePath + '/' + i0 + '/allow_add', + schemaPath: '#/items/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + } + if (data0.collapsed !== undefined) { + if (typeof data0.collapsed !== 'boolean') { + const err34 = { + instancePath: instancePath + '/' + i0 + '/collapsed', + schemaPath: '#/items/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + } + if (data0.summary !== undefined) { + if (typeof data0.summary !== 'string') { + const err35 = { + instancePath: instancePath + '/' + i0 + '/summary', + schemaPath: '#/items/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } + if (data0.minimize_collapsed !== undefined) { + if (typeof data0.minimize_collapsed !== 'boolean') { + const err36 = { + instancePath: instancePath + '/' + i0 + '/minimize_collapsed', + schemaPath: '#/items/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + if (data0.label_singular !== undefined) { + if (typeof data0.label_singular !== 'string') { + const err37 = { + instancePath: instancePath + '/' + i0 + '/label_singular', + schemaPath: '#/items/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + if (data0.i18n !== undefined) { + if (typeof data0.i18n !== 'boolean') { + const err38 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + if (data0.min !== undefined) { + if (!(typeof data0.min == 'number')) { + const err39 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } + if (data0.max !== undefined) { + if (!(typeof data0.max == 'number')) { + const err40 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + var _valid0 = _errs58 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'object') { + const _errs75 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collapsed !== undefined) { + if (typeof data0.collapsed !== 'boolean') { + const err41 = { + instancePath: instancePath + '/' + i0 + '/collapsed', + schemaPath: '#/items/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + if (data0.i18n !== undefined) { + if (typeof data0.i18n !== 'boolean') { + const err42 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/selectCases/object/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + } + var _valid0 = _errs75 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'relation') { + const _errs80 = errors; + const _errs81 = errors; + let valid21 = false; + let passing2 = null; + const _errs82 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection === undefined) { + const err43 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + if (data0.value_field === undefined) { + const err44 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + if (data0.search_fields === undefined) { + const err45 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: "must have required property '" + 'search_fields' + "'", + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + var _valid3 = _errs82 === errors; + if (_valid3) { + valid21 = true; + passing2 = 0; + } + const _errs83 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection === undefined) { + const err46 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + if (data0.valueField === undefined) { + const err47 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + if (data0.searchFields === undefined) { + const err48 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var _valid3 = _errs83 === errors; + if (_valid3 && valid21) { + valid21 = false; + passing2 = [passing2, 1]; + } else { + if (_valid3) { + valid21 = true; + passing2 = 1; + } + } + if (!valid21) { + const err49 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing2 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } else { + errors = _errs81; + if (vErrors !== null) { + if (_errs81) { + vErrors.length = _errs81; + } else { + vErrors = null; + } + } + } + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection !== undefined) { + if (typeof data0.collection !== 'string') { + const err50 = { + instancePath: instancePath + '/' + i0 + '/collection', + schemaPath: '#/items/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + } + if (data0.value_field !== undefined) { + if (typeof data0.value_field !== 'string') { + const err51 = { + instancePath: instancePath + '/' + i0 + '/value_field', + schemaPath: '#/items/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } + if (data0.search_fields !== undefined) { + let data33 = data0.search_fields; + if (Array.isArray(data33)) { + if (data33.length < 1) { + const err52 = { + instancePath: instancePath + '/' + i0 + '/search_fields', + schemaPath: '#/items/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + const len5 = data33.length; + for (let i5 = 0; i5 < len5; i5++) { + if (typeof data33[i5] !== 'string') { + const err53 = { + instancePath: instancePath + '/' + i0 + '/search_fields/' + i5, + schemaPath: + '#/items/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + } else { + const err54 = { + instancePath: instancePath + '/' + i0 + '/search_fields', + schemaPath: '#/items/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + if (data0.file !== undefined) { + if (typeof data0.file !== 'string') { + const err55 = { + instancePath: instancePath + '/' + i0 + '/file', + schemaPath: '#/items/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + if (data0.multiple !== undefined) { + if (typeof data0.multiple !== 'boolean') { + const err56 = { + instancePath: instancePath + '/' + i0 + '/multiple', + schemaPath: '#/items/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + if (data0.min !== undefined) { + let data37 = data0.min; + if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { + const err57 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } + if (data0.max !== undefined) { + let data38 = data0.max; + if (!(typeof data38 == 'number' && !(data38 % 1) && !isNaN(data38))) { + const err58 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + if (data0.display_fields !== undefined) { + let data39 = data0.display_fields; + if (Array.isArray(data39)) { + if (data39.length < 1) { + const err59 = { + instancePath: instancePath + '/' + i0 + '/display_fields', + schemaPath: '#/items/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + const len6 = data39.length; + for (let i6 = 0; i6 < len6; i6++) { + if (typeof data39[i6] !== 'string') { + const err60 = { + instancePath: instancePath + '/' + i0 + '/display_fields/' + i6, + schemaPath: + '#/items/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } else { + const err61 = { + instancePath: instancePath + '/' + i0 + '/display_fields', + schemaPath: '#/items/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + if (data0.options_length !== undefined) { + let data41 = data0.options_length; + if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { + const err62 = { + instancePath: instancePath + '/' + i0 + '/options_length', + schemaPath: '#/items/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + } + var _valid0 = _errs80 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'boolean') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'map') { + const _errs106 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.decimals !== undefined) { + let data42 = data0.decimals; + if (!(typeof data42 == 'number' && !(data42 % 1) && !isNaN(data42))) { + const err63 = { + instancePath: instancePath + '/' + i0 + '/decimals', + schemaPath: '#/items/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } + if (data0.type !== undefined) { + let data43 = data0.type; + if (typeof data43 !== 'string') { + const err64 = { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/selectCases/map/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + if (!(data43 === 'Point' || data43 === 'LineString' || data43 === 'Polygon')) { + const err65 = { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/selectCases/map/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema42.items.selectCases.map.properties.type.enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + } + var _valid0 = _errs106 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'date') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'datetime') { + const _errs111 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.format !== undefined) { + if (typeof data0.format !== 'string') { + const err66 = { + instancePath: instancePath + '/' + i0 + '/format', + schemaPath: '#/items/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + if (data0.date_format !== undefined) { + let data45 = data0.date_format; + const _errs115 = errors; + let valid29 = false; + let passing3 = null; + const _errs116 = errors; + if (typeof data45 !== 'string') { + const err67 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } + var _valid4 = _errs116 === errors; + if (_valid4) { + valid29 = true; + passing3 = 0; + } + const _errs118 = errors; + if (typeof data45 !== 'boolean') { + const err68 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + var _valid4 = _errs118 === errors; + if (_valid4 && valid29) { + valid29 = false; + passing3 = [passing3, 1]; + } else { + if (_valid4) { + valid29 = true; + passing3 = 1; + } + } + if (!valid29) { + const err69 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing3 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } else { + errors = _errs115; + if (vErrors !== null) { + if (_errs115) { + vErrors.length = _errs115; + } else { + vErrors = null; + } + } + } + } + if (data0.time_format !== undefined) { + let data46 = data0.time_format; + const _errs121 = errors; + let valid30 = false; + let passing4 = null; + const _errs122 = errors; + if (typeof data46 !== 'string') { + const err70 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var _valid5 = _errs122 === errors; + if (_valid5) { + valid30 = true; + passing4 = 0; + } + const _errs124 = errors; + if (typeof data46 !== 'boolean') { + const err71 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var _valid5 = _errs124 === errors; + if (_valid5 && valid30) { + valid30 = false; + passing4 = [passing4, 1]; + } else { + if (_valid5) { + valid30 = true; + passing4 = 1; + } + } + if (!valid30) { + const err72 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing4 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } else { + errors = _errs121; + if (vErrors !== null) { + if (_errs121) { + vErrors.length = _errs121; + } else { + vErrors = null; + } + } + } + } + if (data0.picker_utc !== undefined) { + if (typeof data0.picker_utc !== 'boolean') { + const err73 = { + instancePath: instancePath + '/' + i0 + '/picker_utc', + schemaPath: '#/items/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + } + } + var _valid0 = _errs111 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'code') { + const _errs128 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.default_language !== undefined) { + if (typeof data0.default_language !== 'string') { + const err74 = { + instancePath: instancePath + '/' + i0 + '/default_language', + schemaPath: '#/items/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } + if (data0.allow_language_selection !== undefined) { + if (typeof data0.allow_language_selection !== 'boolean') { + const err75 = { + instancePath: instancePath + '/' + i0 + '/allow_language_selection', + schemaPath: '#/items/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + if (data0.output_code_only !== undefined) { + if (typeof data0.output_code_only !== 'boolean') { + const err76 = { + instancePath: instancePath + '/' + i0 + '/output_code_only', + schemaPath: '#/items/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } + if (data0.keys !== undefined) { + let data51 = data0.keys; + if (data51 && typeof data51 == 'object' && !Array.isArray(data51)) { + if (data51.code !== undefined) { + if (typeof data51.code !== 'string') { + const err77 = { + instancePath: instancePath + '/' + i0 + '/keys/code', + schemaPath: '#/items/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + if (data51.lang !== undefined) { + if (typeof data51.lang !== 'string') { + const err78 = { + instancePath: instancePath + '/' + i0 + '/keys/lang', + schemaPath: '#/items/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + } else { + const err79 = { + instancePath: instancePath + '/' + i0 + '/keys', + schemaPath: '#/items/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + } + var _valid0 = _errs128 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'color') { + var _valid0 = true; + valid2 = _valid0; + } + if (!valid2) { + const err80 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + } + } + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.name === undefined) { + const err81 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + if (data0.name !== undefined) { + if (typeof data0.name !== 'string') { + const err82 = { + instancePath: instancePath + '/' + i0 + '/name', + schemaPath: '#/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + if (data0.label !== undefined) { + if (typeof data0.label !== 'string') { + const err83 = { + instancePath: instancePath + '/' + i0 + '/label', + schemaPath: '#/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + if (data0.widget !== undefined) { + if (typeof data0.widget !== 'string') { + const err84 = { + instancePath: instancePath + '/' + i0 + '/widget', + schemaPath: '#/items/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + if (data0.required !== undefined) { + if (typeof data0.required !== 'boolean') { + const err85 = { + instancePath: instancePath + '/' + i0 + '/required', + schemaPath: '#/items/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + if (data0.i18n !== undefined) { + let data58 = data0.i18n; + const _errs151 = errors; + let valid34 = false; + let passing5 = null; + const _errs152 = errors; + if (typeof data58 !== 'boolean') { + const err86 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var _valid6 = _errs152 === errors; + if (_valid6) { + valid34 = true; + passing5 = 0; + } + const _errs154 = errors; + if (typeof data58 !== 'string') { + const err87 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if (!(data58 === 'translate' || data58 === 'duplicate' || data58 === 'none')) { + const err88 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/enum', + keyword: 'enum', + params: { allowedValues: schema42.items.properties.i18n.oneOf[1].enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var _valid6 = _errs154 === errors; + if (_valid6 && valid34) { + valid34 = false; + passing5 = [passing5, 1]; + } else { + if (_valid6) { + valid34 = true; + passing5 = 1; + } + } + if (!valid34) { + const err89 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing5 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } else { + errors = _errs151; + if (vErrors !== null) { + if (_errs151) { + vErrors.length = _errs151; + } else { + vErrors = null; + } + } + } + } + if (data0.hint !== undefined) { + if (typeof data0.hint !== 'string') { + const err90 = { + instancePath: instancePath + '/' + i0 + '/hint', + schemaPath: '#/items/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + if (data0.pattern !== undefined) { + let data60 = data0.pattern; + if (Array.isArray(data60)) { + if (data60.length < 2) { + const err91 = { + instancePath: instancePath + '/' + i0 + '/pattern', + schemaPath: '#/items/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + const len7 = data60.length; + if (len7 > 0) { + let data61 = data60[0]; + const _errs161 = errors; + let valid36 = false; + let passing6 = null; + const _errs162 = errors; + if (typeof data61 !== 'string') { + const err92 = { + 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 = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + var _valid7 = _errs162 === errors; + if (_valid7) { + valid36 = true; + passing6 = 0; + } + const _errs164 = errors; + if (typeof data61 == 'number') { + if (!(data61 instanceof RegExp)) { + const err93 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + if (typeof data61 === 'string') { + if (!(data61 instanceof RegExp)) { + const err94 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + if (Array.isArray(data61)) { + if (!(data61 instanceof RegExp)) { + const err95 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + if (data61 && typeof data61 == 'object' && !Array.isArray(data61)) { + if (!(data61 instanceof RegExp)) { + const err96 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var _valid7 = _errs164 === errors; + if (_valid7 && valid36) { + valid36 = false; + passing6 = [passing6, 1]; + } else { + if (_valid7) { + valid36 = true; + passing6 = 1; + } + } + if (!valid36) { + const err97 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing6 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + errors = _errs161; + if (vErrors !== null) { + if (_errs161) { + vErrors.length = _errs161; + } else { + vErrors = null; + } + } + } + } + if (len7 > 1) { + if (typeof data60[1] !== 'string') { + const err98 = { + 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 = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + } else { + const err99 = { + instancePath: instancePath + '/' + i0 + '/pattern', + schemaPath: '#/items/properties/pattern/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + 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 err100 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + if ( + schema42.uniqueItemProperties + .map(property => + data + .map(item => item && item[property]) + .some((value, index, array) => array.indexOf(value) !== index), + ) + .some(value => value) + ) { + const err101 = { + instancePath, + schemaPath: '#/uniqueItemProperties', + keyword: 'uniqueItemProperties', + params: {}, + message: 'must pass "uniqueItemProperties" keyword validation', + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + } else { + const err102 = { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + validate26.errors = vErrors; + return errors === 0; +} +function validate25( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + /*# sourceURL="field_4be0cf9d-cc93-4d38-9c75-3fd30b602e1d" */ 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 == 'unknown') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'string') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'number') { + const _errs1 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.step !== undefined) { + if (!(typeof data.step == 'number')) { + const err1 = { + instancePath: instancePath + '/step', + schemaPath: '#/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } + if (data.value_type !== undefined) { + if (typeof data.value_type !== 'string') { + const err2 = { + instancePath: instancePath + '/value_type', + schemaPath: '#/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + if (data.min !== undefined) { + if (!(typeof data.min == 'number')) { + const err3 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + if (data.max !== undefined) { + if (!(typeof data.max == 'number')) { + const err4 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + } + var _valid0 = _errs1 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'text') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'image') { + const _errs10 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_multiple !== undefined) { + if (typeof data.allow_multiple !== 'boolean') { + const err5 = { + instancePath: instancePath + '/allow_multiple', + schemaPath: '#/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + } + var _valid0 = _errs10 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'file') { + const _errs13 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_multiple !== undefined) { + if (typeof data.allow_multiple !== 'boolean') { + const err6 = { + instancePath: instancePath + '/allow_multiple', + schemaPath: '#/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + } + var _valid0 = _errs13 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'select') { + const _errs16 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.options === undefined) { + const err7 = { + instancePath, + schemaPath: '#/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + if (data.multiple !== undefined) { + if (typeof data.multiple !== 'boolean') { + const err8 = { + instancePath: instancePath + '/multiple', + schemaPath: '#/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + if (data.min !== undefined) { + let data7 = data.min; + if (!(typeof data7 == 'number' && !(data7 % 1) && !isNaN(data7))) { + const err9 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + if (data.max !== undefined) { + let data8 = data.max; + if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { + const err10 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + if (data.options !== undefined) { + let data9 = data.options; + if (Array.isArray(data9)) { + const len0 = data9.length; + for (let i0 = 0; i0 < len0; i0++) { + let data10 = data9[i0]; + const _errs26 = errors; + let valid7 = false; + let passing0 = null; + const _errs27 = errors; + if (typeof data10 !== 'string') { + const err11 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + var _valid1 = _errs27 === errors; + if (_valid1) { + valid7 = true; + passing0 = 0; + } + const _errs29 = errors; + if (!(typeof data10 == 'number')) { + const err12 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + var _valid1 = _errs29 === errors; + if (_valid1 && valid7) { + valid7 = false; + passing0 = [passing0, 1]; + } else { + if (_valid1) { + valid7 = true; + passing0 = 1; + } + const _errs31 = errors; + if (data10 && typeof data10 == 'object' && !Array.isArray(data10)) { + if (data10.label === undefined) { + const err13 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + if (data10.value === undefined) { + const err14 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + if (data10.label !== undefined) { + if (typeof data10.label !== 'string') { + const err15 = { + instancePath: instancePath + '/options/' + i0 + '/label', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + if (data10.value !== undefined) { + let data12 = data10.value; + const _errs36 = errors; + let valid9 = false; + let passing1 = null; + const _errs37 = errors; + if (typeof data12 !== 'string') { + const err16 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + var _valid2 = _errs37 === errors; + if (_valid2) { + valid9 = true; + passing1 = 0; + } + const _errs39 = errors; + if (!(typeof data12 == 'number')) { + const err17 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var _valid2 = _errs39 === errors; + if (_valid2 && valid9) { + valid9 = false; + passing1 = [passing1, 1]; + } else { + if (_valid2) { + valid9 = true; + passing1 = 1; + } + } + if (!valid9) { + const err18 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs36; + if (vErrors !== null) { + if (_errs36) { + vErrors.length = _errs36; + } else { + vErrors = null; + } + } + } + } + } else { + const err19 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var _valid1 = _errs31 === errors; + if (_valid1 && valid7) { + valid7 = false; + passing0 = [passing0, 2]; + } else { + if (_valid1) { + valid7 = true; + passing0 = 2; + } + } + } + if (!valid7) { + const err20 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing0 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } else { + errors = _errs26; + if (vErrors !== null) { + if (_errs26) { + vErrors.length = _errs26; + } else { + vErrors = null; + } + } + } + } + } else { + const err21 = { + instancePath: instancePath + '/options', + schemaPath: '#/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var _valid0 = _errs16 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'markdown') { + const _errs41 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.minimal !== undefined) { + if (typeof data.minimal !== 'boolean') { + const err22 = { + instancePath: instancePath + '/minimal', + schemaPath: '#/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } + if (data.buttons !== undefined) { + let data14 = data.buttons; + if (Array.isArray(data14)) { + const len1 = data14.length; + for (let i1 = 0; i1 < len1; i1++) { + let data15 = data14[i1]; + if (typeof data15 !== 'string') { + const err23 = { + instancePath: instancePath + '/buttons/' + i1, + schemaPath: '#/selectCases/markdown/properties/buttons/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data15 === 'bold' || + data15 === 'italic' || + data15 === 'code' || + data15 === 'link' || + data15 === 'heading-one' || + data15 === 'heading-two' || + data15 === 'heading-three' || + data15 === 'heading-four' || + data15 === 'heading-five' || + data15 === 'heading-six' || + data15 === 'quote' || + data15 === 'bulleted-list' || + data15 === 'numbered-list' + ) + ) { + const err24 = { + instancePath: instancePath + '/buttons/' + i1, + schemaPath: '#/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', + params: { + allowedValues: schema41.selectCases.markdown.properties.buttons.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + } + } else { + const err25 = { + instancePath: instancePath + '/buttons', + schemaPath: '#/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + if (data.editor_components !== undefined) { + let data16 = data.editor_components; + if (Array.isArray(data16)) { + const len2 = data16.length; + for (let i2 = 0; i2 < len2; i2++) { + if (typeof data16[i2] !== 'string') { + const err26 = { + instancePath: instancePath + '/editor_components/' + i2, + schemaPath: '#/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + } else { + const err27 = { + instancePath: instancePath + '/editor_components', + schemaPath: '#/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + if (data.modes !== undefined) { + let data18 = data.modes; + if (Array.isArray(data18)) { + if (data18.length < 1) { + const err28 = { + instancePath: instancePath + '/modes', + schemaPath: '#/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + const len3 = data18.length; + for (let i3 = 0; i3 < len3; i3++) { + let data19 = data18[i3]; + if (typeof data19 !== 'string') { + const err29 = { + instancePath: instancePath + '/modes/' + i3, + schemaPath: '#/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + if (!(data19 === 'raw' || data19 === 'rich_text')) { + const err30 = { + instancePath: instancePath + '/modes/' + i3, + schemaPath: '#/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: schema41.selectCases.markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + } + } else { + const err31 = { + instancePath: instancePath + '/modes', + schemaPath: '#/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } + } + var _valid0 = _errs41 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'list') { + const _errs56 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_add !== undefined) { + if (typeof data.allow_add !== 'boolean') { + const err32 = { + instancePath: instancePath + '/allow_add', + schemaPath: '#/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + if (data.collapsed !== undefined) { + if (typeof data.collapsed !== 'boolean') { + const err33 = { + instancePath: instancePath + '/collapsed', + schemaPath: '#/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + } + if (data.summary !== undefined) { + if (typeof data.summary !== 'string') { + const err34 = { + instancePath: instancePath + '/summary', + schemaPath: '#/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + } + if (data.minimize_collapsed !== undefined) { + if (typeof data.minimize_collapsed !== 'boolean') { + const err35 = { + instancePath: instancePath + '/minimize_collapsed', + schemaPath: '#/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } + if (data.label_singular !== undefined) { + if (typeof data.label_singular !== 'string') { + const err36 = { + instancePath: instancePath + '/label_singular', + schemaPath: '#/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + if (data.i18n !== undefined) { + if (typeof data.i18n !== 'boolean') { + const err37 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + if (data.min !== undefined) { + if (!(typeof data.min == 'number')) { + const err38 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + if (data.max !== undefined) { + if (!(typeof data.max == 'number')) { + const err39 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } + } + var _valid0 = _errs56 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'object') { + const _errs73 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collapsed !== undefined) { + if (typeof data.collapsed !== 'boolean') { + const err40 = { + instancePath: instancePath + '/collapsed', + schemaPath: '#/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + if (data.i18n !== undefined) { + if (typeof data.i18n !== 'boolean') { + const err41 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/selectCases/object/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + var _valid0 = _errs73 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'relation') { + const _errs78 = errors; + const _errs79 = errors; + let valid19 = false; + let passing2 = null; + const _errs80 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection === undefined) { + const err42 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + if (data.value_field === undefined) { + const err43 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + if (data.search_fields === undefined) { + const err44 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: "must have required property '" + 'search_fields' + "'", + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var _valid3 = _errs80 === errors; + if (_valid3) { + valid19 = true; + passing2 = 0; + } + const _errs81 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection === undefined) { + const err45 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + if (data.valueField === undefined) { + const err46 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + if (data.searchFields === undefined) { + const err47 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var _valid3 = _errs81 === errors; + if (_valid3 && valid19) { + valid19 = false; + passing2 = [passing2, 1]; + } else { + if (_valid3) { + valid19 = true; + passing2 = 1; + } + } + if (!valid19) { + const err48 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing2 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } else { + errors = _errs79; + if (vErrors !== null) { + if (_errs79) { + vErrors.length = _errs79; + } else { + vErrors = null; + } + } + } + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection !== undefined) { + if (typeof data.collection !== 'string') { + const err49 = { + instancePath: instancePath + '/collection', + schemaPath: '#/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + if (data.value_field !== undefined) { + if (typeof data.value_field !== 'string') { + const err50 = { + instancePath: instancePath + '/value_field', + schemaPath: '#/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + } + if (data.search_fields !== undefined) { + let data32 = data.search_fields; + if (Array.isArray(data32)) { + if (data32.length < 1) { + const err51 = { + instancePath: instancePath + '/search_fields', + schemaPath: '#/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + const len4 = data32.length; + for (let i4 = 0; i4 < len4; i4++) { + if (typeof data32[i4] !== 'string') { + const err52 = { + instancePath: instancePath + '/search_fields/' + i4, + schemaPath: '#/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } else { + const err53 = { + instancePath: instancePath + '/search_fields', + schemaPath: '#/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + if (data.file !== undefined) { + if (typeof data.file !== 'string') { + const err54 = { + instancePath: instancePath + '/file', + schemaPath: '#/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + if (data.multiple !== undefined) { + if (typeof data.multiple !== 'boolean') { + const err55 = { + instancePath: instancePath + '/multiple', + schemaPath: '#/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + if (data.min !== undefined) { + let data36 = data.min; + if (!(typeof data36 == 'number' && !(data36 % 1) && !isNaN(data36))) { + const err56 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + if (data.max !== undefined) { + let data37 = data.max; + if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { + const err57 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } + if (data.display_fields !== undefined) { + let data38 = data.display_fields; + if (Array.isArray(data38)) { + if (data38.length < 1) { + const err58 = { + instancePath: instancePath + '/display_fields', + schemaPath: '#/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + const len5 = data38.length; + for (let i5 = 0; i5 < len5; i5++) { + if (typeof data38[i5] !== 'string') { + const err59 = { + instancePath: instancePath + '/display_fields/' + i5, + schemaPath: '#/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } + } else { + const err60 = { + instancePath: instancePath + '/display_fields', + schemaPath: '#/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + if (data.options_length !== undefined) { + let data40 = data.options_length; + if (!(typeof data40 == 'number' && !(data40 % 1) && !isNaN(data40))) { + const err61 = { + instancePath: instancePath + '/options_length', + schemaPath: '#/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + } + var _valid0 = _errs78 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'boolean') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'map') { + const _errs104 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.decimals !== undefined) { + let data41 = data.decimals; + if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { + const err62 = { + instancePath: instancePath + '/decimals', + schemaPath: '#/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + if (data.type !== undefined) { + let data42 = data.type; + if (typeof data42 !== 'string') { + const err63 = { + instancePath: instancePath + '/type', + schemaPath: '#/selectCases/map/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + if (!(data42 === 'Point' || data42 === 'LineString' || data42 === 'Polygon')) { + const err64 = { + instancePath: instancePath + '/type', + schemaPath: '#/selectCases/map/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema41.selectCases.map.properties.type.enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + var _valid0 = _errs104 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'date') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'datetime') { + const _errs109 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.format !== undefined) { + if (typeof data.format !== 'string') { + const err65 = { + instancePath: instancePath + '/format', + schemaPath: '#/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + if (data.date_format !== undefined) { + let data44 = data.date_format; + const _errs113 = errors; + let valid27 = false; + let passing3 = null; + const _errs114 = errors; + if (typeof data44 !== 'string') { + const err66 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + var _valid4 = _errs114 === errors; + if (_valid4) { + valid27 = true; + passing3 = 0; + } + const _errs116 = errors; + if (typeof data44 !== 'boolean') { + const err67 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } + var _valid4 = _errs116 === errors; + if (_valid4 && valid27) { + valid27 = false; + passing3 = [passing3, 1]; + } else { + if (_valid4) { + valid27 = true; + passing3 = 1; + } + } + if (!valid27) { + const err68 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing3 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } else { + errors = _errs113; + if (vErrors !== null) { + if (_errs113) { + vErrors.length = _errs113; + } else { + vErrors = null; + } + } + } + } + if (data.time_format !== undefined) { + let data45 = data.time_format; + const _errs119 = errors; + let valid28 = false; + let passing4 = null; + const _errs120 = errors; + if (typeof data45 !== 'string') { + const err69 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + var _valid5 = _errs120 === errors; + if (_valid5) { + valid28 = true; + passing4 = 0; + } + const _errs122 = errors; + if (typeof data45 !== 'boolean') { + const err70 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var _valid5 = _errs122 === errors; + if (_valid5 && valid28) { + valid28 = false; + passing4 = [passing4, 1]; + } else { + if (_valid5) { + valid28 = true; + passing4 = 1; + } + } + if (!valid28) { + const err71 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing4 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } else { + errors = _errs119; + if (vErrors !== null) { + if (_errs119) { + vErrors.length = _errs119; + } else { + vErrors = null; + } + } + } + } + if (data.picker_utc !== undefined) { + if (typeof data.picker_utc !== 'boolean') { + const err72 = { + instancePath: instancePath + '/picker_utc', + schemaPath: '#/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + } + var _valid0 = _errs109 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'code') { + const _errs126 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.default_language !== undefined) { + if (typeof data.default_language !== 'string') { + const err73 = { + instancePath: instancePath + '/default_language', + schemaPath: '#/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + } + if (data.allow_language_selection !== undefined) { + if (typeof data.allow_language_selection !== 'boolean') { + const err74 = { + instancePath: instancePath + '/allow_language_selection', + schemaPath: '#/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } + if (data.output_code_only !== undefined) { + if (typeof data.output_code_only !== 'boolean') { + const err75 = { + instancePath: instancePath + '/output_code_only', + schemaPath: '#/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + if (data.keys !== undefined) { + let data50 = data.keys; + if (data50 && typeof data50 == 'object' && !Array.isArray(data50)) { + if (data50.code !== undefined) { + if (typeof data50.code !== 'string') { + const err76 = { + instancePath: instancePath + '/keys/code', + schemaPath: '#/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } + if (data50.lang !== undefined) { + if (typeof data50.lang !== 'string') { + const err77 = { + instancePath: instancePath + '/keys/lang', + schemaPath: '#/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } else { + const err78 = { + instancePath: instancePath + '/keys', + schemaPath: '#/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + } + var _valid0 = _errs126 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'color') { + var _valid0 = true; + valid0 = _valid0; + } + if (!valid0) { + const err79 = { + instancePath, + schemaPath: '#/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + } + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.name === undefined) { + const err80 = { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + if (data.name !== undefined) { + if (typeof data.name !== 'string') { + const err81 = { + instancePath: instancePath + '/name', + schemaPath: '#/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + if (data.label !== undefined) { + if (typeof data.label !== 'string') { + const err82 = { + instancePath: instancePath + '/label', + schemaPath: '#/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + if (data.widget !== undefined) { + if (typeof data.widget !== 'string') { + const err83 = { + instancePath: instancePath + '/widget', + schemaPath: '#/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + if (data.required !== undefined) { + if (typeof data.required !== 'boolean') { + const err84 = { + instancePath: instancePath + '/required', + schemaPath: '#/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + if (data.i18n !== undefined) { + let data57 = data.i18n; + const _errs149 = errors; + let valid32 = false; + let passing5 = null; + const _errs150 = errors; + if (typeof data57 !== 'boolean') { + const err85 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var _valid6 = _errs150 === errors; + if (_valid6) { + valid32 = true; + passing5 = 0; + } + const _errs152 = errors; + if (typeof data57 !== 'string') { + const err86 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + if (!(data57 === 'translate' || data57 === 'duplicate' || data57 === 'none')) { + const err87 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/1/enum', + keyword: 'enum', + params: { allowedValues: schema41.properties.i18n.oneOf[1].enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + var _valid6 = _errs152 === errors; + if (_valid6 && valid32) { + valid32 = false; + passing5 = [passing5, 1]; + } else { + if (_valid6) { + valid32 = true; + passing5 = 1; + } + } + if (!valid32) { + const err88 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing5 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } else { + errors = _errs149; + if (vErrors !== null) { + if (_errs149) { + vErrors.length = _errs149; + } else { + vErrors = null; + } + } + } + } + if (data.hint !== undefined) { + if (typeof data.hint !== 'string') { + const err89 = { + instancePath: instancePath + '/hint', + schemaPath: '#/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } + if (data.pattern !== undefined) { + let data59 = data.pattern; + if (Array.isArray(data59)) { + if (data59.length < 2) { + const err90 = { + instancePath: instancePath + '/pattern', + schemaPath: '#/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + const len6 = data59.length; + if (len6 > 0) { + let data60 = data59[0]; + const _errs159 = errors; + let valid34 = false; + let passing6 = null; + const _errs160 = errors; + if (typeof data60 !== 'string') { + const err91 = { + 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 = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var _valid7 = _errs160 === errors; + if (_valid7) { + valid34 = true; + passing6 = 0; + } + const _errs162 = errors; + if (typeof data60 == 'number') { + if (!(data60 instanceof RegExp)) { + const err92 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + if (typeof data60 === 'string') { + if (!(data60 instanceof RegExp)) { + const err93 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + if (Array.isArray(data60)) { + if (!(data60 instanceof RegExp)) { + const err94 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + if (data60 && typeof data60 == 'object' && !Array.isArray(data60)) { + if (!(data60 instanceof RegExp)) { + const err95 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var _valid7 = _errs162 === errors; + if (_valid7 && valid34) { + valid34 = false; + passing6 = [passing6, 1]; + } else { + if (_valid7) { + valid34 = true; + passing6 = 1; + } + } + if (!valid34) { + const err96 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing6 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } else { + errors = _errs159; + if (vErrors !== null) { + if (_errs159) { + vErrors.length = _errs159; + } else { + vErrors = null; + } + } + } + } + if (len6 > 1) { + if (typeof data59[1] !== 'string') { + const err97 = { + instancePath: instancePath + '/pattern/1', + schemaPath: '#/properties/pattern/items/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } else { + const err98 = { + instancePath: instancePath + '/pattern', + schemaPath: '#/properties/pattern/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + 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 ( + !validate26(data.fields, { + instancePath: instancePath + '/fields', + parentData: data, + parentDataProperty: 'fields', + rootData, + }) + ) { + vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors); + errors = vErrors.length; + } + } + if (data.types !== undefined) { + if ( + !validate26(data.types, { + instancePath: instancePath + '/types', + parentData: data, + parentDataProperty: 'types', + rootData, + }) + ) { + vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors); + errors = vErrors.length; + } + } + } else { + const err99 = { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + validate25.errors = vErrors; + return errors === 0; +} +const schema43 = { + $id: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', + 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], + }, + field: { $ref: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + fields: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + types: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + }, + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, + }, + }, + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, + }, + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, + }, + }, + }, + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, + }, + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], + }, + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, + }, + }, + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, + }, + }, + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, + }, + }, + }, + color: {}, + }, + required: ['name'], +}; +const wrapper4 = { validate: validate32 }; +const schema44 = { + $id: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', + type: 'array', + minItems: 1, + items: { + $id: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e', + 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' }, { instanceof: 'RegExp' }] }, { type: 'string' }], + }, + field: { $ref: 'field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + fields: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + types: { $ref: 'fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e' }, + }, + select: { $data: '0/widget' }, + selectCases: { + unknown: {}, + string: {}, + number: { + properties: { + step: { type: 'number' }, + value_type: { type: 'string' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + text: {}, + image: { properties: { allow_multiple: { type: 'boolean' } } }, + file: { properties: { allow_multiple: { type: 'boolean' } } }, + select: { + properties: { + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + options: { + type: 'array', + items: { + oneOf: [ + { type: 'string' }, + { type: 'number' }, + { + type: 'object', + properties: { + label: { type: 'string' }, + value: { oneOf: [{ type: 'string' }, { type: 'number' }] }, + }, + required: ['label', 'value'], + }, + ], + }, + }, + }, + required: ['options'], + }, + markdown: { + properties: { + minimal: { type: 'boolean' }, + buttons: { + type: 'array', + items: { + type: 'string', + enum: [ + 'bold', + 'italic', + 'code', + 'link', + 'heading-one', + 'heading-two', + 'heading-three', + 'heading-four', + 'heading-five', + 'heading-six', + 'quote', + 'bulleted-list', + 'numbered-list', + ], + }, + }, + editor_components: { type: 'array', items: { type: 'string' } }, + modes: { + type: 'array', + items: { type: 'string', enum: ['raw', 'rich_text'] }, + minItems: 1, + }, + }, + }, + list: { + properties: { + allow_add: { type: 'boolean' }, + collapsed: { type: 'boolean' }, + summary: { type: 'string' }, + minimize_collapsed: { type: 'boolean' }, + label_singular: { type: 'string' }, + i18n: { type: 'boolean' }, + min: { type: 'number' }, + max: { type: 'number' }, + }, + }, + object: { properties: { collapsed: { type: 'boolean' }, i18n: { type: 'boolean' } } }, + relation: { + properties: { + collection: { type: 'string' }, + value_field: { type: 'string' }, + search_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + file: { type: 'string' }, + multiple: { type: 'boolean' }, + min: { type: 'integer' }, + max: { type: 'integer' }, + display_fields: { type: 'array', minItems: 1, items: { type: 'string' } }, + options_length: { type: 'integer' }, + }, + oneOf: [ + { required: ['collection', 'value_field', 'search_fields'] }, + { required: ['collection', 'valueField', 'searchFields'] }, + ], + }, + boolean: {}, + map: { + properties: { + decimals: { type: 'integer' }, + type: { type: 'string', enum: ['Point', 'LineString', 'Polygon'] }, + }, + }, + date: {}, + datetime: { + properties: { + format: { type: 'string' }, + date_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + time_format: { oneOf: [{ type: 'string' }, { type: 'boolean' }] }, + picker_utc: { type: 'boolean' }, + }, + }, + code: { + properties: { + default_language: { type: 'string' }, + allow_language_selection: { type: 'boolean' }, + output_code_only: { type: 'boolean' }, + keys: { + type: 'object', + properties: { code: { type: 'string' }, lang: { type: 'string' } }, + }, + }, + }, + color: {}, + }, + required: ['name'], + }, + uniqueItemProperties: ['name'], +}; +const wrapper6 = { validate: validate33 }; +function validate33( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + /*# sourceURL="fields_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */ 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 < len0; i0++) { + let data0 = data[i0]; + const vSchema0 = data0 && data0.widget; + if (!(vSchema0 === undefined)) { + if ( + typeof vSchema0 !== 'string' && + !(typeof vSchema0 == 'number') && + typeof vSchema0 !== 'boolean' && + vSchema0 !== null + ) { + const err1 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/select', + keyword: 'select', + params: {}, + message: '"select" keyword must be string,number,boolean,null ($data)', + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } else { + let valid2 = true; + const value0 = vSchema0 === null ? 'null' : vSchema0; + if ('' + value0 == 'unknown') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'string') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'number') { + const _errs3 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.step !== undefined) { + if (!(typeof data0.step == 'number')) { + const err2 = { + instancePath: instancePath + '/' + i0 + '/step', + schemaPath: '#/items/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + if (data0.value_type !== undefined) { + if (typeof data0.value_type !== 'string') { + const err3 = { + instancePath: instancePath + '/' + i0 + '/value_type', + schemaPath: '#/items/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + if (data0.min !== undefined) { + if (!(typeof data0.min == 'number')) { + const err4 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + if (data0.max !== undefined) { + if (!(typeof data0.max == 'number')) { + const err5 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + } + var _valid0 = _errs3 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'text') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'image') { + const _errs12 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_multiple !== undefined) { + if (typeof data0.allow_multiple !== 'boolean') { + const err6 = { + instancePath: instancePath + '/' + i0 + '/allow_multiple', + schemaPath: '#/items/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + } + var _valid0 = _errs12 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'file') { + const _errs15 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_multiple !== undefined) { + if (typeof data0.allow_multiple !== 'boolean') { + const err7 = { + instancePath: instancePath + '/' + i0 + '/allow_multiple', + schemaPath: '#/items/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + } + } + var _valid0 = _errs15 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'select') { + const _errs18 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.options === undefined) { + const err8 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + if (data0.multiple !== undefined) { + if (typeof data0.multiple !== 'boolean') { + const err9 = { + instancePath: instancePath + '/' + i0 + '/multiple', + schemaPath: '#/items/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + if (data0.min !== undefined) { + let data8 = data0.min; + if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { + const err10 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + if (data0.max !== undefined) { + let data9 = data0.max; + if (!(typeof data9 == 'number' && !(data9 % 1) && !isNaN(data9))) { + const err11 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + } + if (data0.options !== undefined) { + let data10 = data0.options; + if (Array.isArray(data10)) { + const len1 = data10.length; + for (let i1 = 0; i1 < len1; i1++) { + let data11 = data10[i1]; + const _errs28 = errors; + let valid9 = false; + let passing0 = null; + const _errs29 = errors; + if (typeof data11 !== 'string') { + const err12 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + var _valid1 = _errs29 === errors; + if (_valid1) { + valid9 = true; + passing0 = 0; + } + const _errs31 = errors; + if (!(typeof data11 == 'number')) { + const err13 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + var _valid1 = _errs31 === errors; + if (_valid1 && valid9) { + valid9 = false; + passing0 = [passing0, 1]; + } else { + if (_valid1) { + valid9 = true; + passing0 = 1; + } + const _errs33 = errors; + if (data11 && typeof data11 == 'object' && !Array.isArray(data11)) { + if (data11.label === undefined) { + const err14 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + if (data11.value === undefined) { + const err15 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + if (data11.label !== undefined) { + if (typeof data11.label !== 'string') { + const err16 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/label', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + if (data11.value !== undefined) { + let data13 = data11.value; + const _errs38 = errors; + let valid11 = false; + let passing1 = null; + const _errs39 = errors; + if (typeof data13 !== 'string') { + const err17 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var _valid2 = _errs39 === errors; + if (_valid2) { + valid11 = true; + passing1 = 0; + } + const _errs41 = errors; + if (!(typeof data13 == 'number')) { + const err18 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + var _valid2 = _errs41 === errors; + if (_valid2 && valid11) { + valid11 = false; + passing1 = [passing1, 1]; + } else { + if (_valid2) { + valid11 = true; + passing1 = 1; + } + } + if (!valid11) { + const err19 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1 + '/value', + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs38; + if (vErrors !== null) { + if (_errs38) { + vErrors.length = _errs38; + } else { + vErrors = null; + } + } + } + } + } else { + const err20 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: + '#/items/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + var _valid1 = _errs33 === errors; + if (_valid1 && valid9) { + valid9 = false; + passing0 = [passing0, 2]; + } else { + if (_valid1) { + valid9 = true; + passing0 = 2; + } + } + } + if (!valid9) { + const err21 = { + instancePath: instancePath + '/' + i0 + '/options/' + i1, + schemaPath: '#/items/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing0 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } else { + errors = _errs28; + if (vErrors !== null) { + if (_errs28) { + vErrors.length = _errs28; + } else { + vErrors = null; + } + } + } + } + } else { + const err22 = { + instancePath: instancePath + '/' + i0 + '/options', + schemaPath: '#/items/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } + } + var _valid0 = _errs18 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'markdown') { + const _errs43 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.minimal !== undefined) { + if (typeof data0.minimal !== 'boolean') { + const err23 = { + instancePath: instancePath + '/' + i0 + '/minimal', + schemaPath: '#/items/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + } + if (data0.buttons !== undefined) { + let data15 = data0.buttons; + if (Array.isArray(data15)) { + const len2 = data15.length; + for (let i2 = 0; i2 < len2; i2++) { + let data16 = data15[i2]; + if (typeof data16 !== 'string') { + const err24 = { + instancePath: instancePath + '/' + i0 + '/buttons/' + i2, + schemaPath: '#/items/selectCases/markdown/properties/buttons/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + if ( + !( + data16 === 'bold' || + data16 === 'italic' || + data16 === 'code' || + data16 === 'link' || + data16 === 'heading-one' || + data16 === 'heading-two' || + data16 === 'heading-three' || + data16 === 'heading-four' || + data16 === 'heading-five' || + data16 === 'heading-six' || + data16 === 'quote' || + data16 === 'bulleted-list' || + data16 === 'numbered-list' + ) + ) { + const err25 = { + instancePath: instancePath + '/' + i0 + '/buttons/' + i2, + schemaPath: '#/items/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema44.items.selectCases.markdown.properties.buttons.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + } else { + const err26 = { + instancePath: instancePath + '/' + i0 + '/buttons', + schemaPath: '#/items/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + if (data0.editor_components !== undefined) { + let data17 = data0.editor_components; + if (Array.isArray(data17)) { + const len3 = data17.length; + for (let i3 = 0; i3 < len3; i3++) { + if (typeof data17[i3] !== 'string') { + const err27 = { + instancePath: instancePath + '/' + i0 + '/editor_components/' + i3, + schemaPath: + '#/items/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + } else { + const err28 = { + instancePath: instancePath + '/' + i0 + '/editor_components', + schemaPath: '#/items/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + } + if (data0.modes !== undefined) { + let data19 = data0.modes; + if (Array.isArray(data19)) { + if (data19.length < 1) { + const err29 = { + instancePath: instancePath + '/' + i0 + '/modes', + schemaPath: '#/items/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + const len4 = data19.length; + for (let i4 = 0; i4 < len4; i4++) { + let data20 = data19[i4]; + if (typeof data20 !== 'string') { + const err30 = { + instancePath: instancePath + '/' + i0 + '/modes/' + i4, + schemaPath: '#/items/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + if (!(data20 === 'raw' || data20 === 'rich_text')) { + const err31 = { + instancePath: instancePath + '/' + i0 + '/modes/' + i4, + schemaPath: '#/items/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema44.items.selectCases.markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } + } else { + const err32 = { + instancePath: instancePath + '/' + i0 + '/modes', + schemaPath: '#/items/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + } + var _valid0 = _errs43 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'list') { + const _errs58 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.allow_add !== undefined) { + if (typeof data0.allow_add !== 'boolean') { + const err33 = { + instancePath: instancePath + '/' + i0 + '/allow_add', + schemaPath: '#/items/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + } + if (data0.collapsed !== undefined) { + if (typeof data0.collapsed !== 'boolean') { + const err34 = { + instancePath: instancePath + '/' + i0 + '/collapsed', + schemaPath: '#/items/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + } + if (data0.summary !== undefined) { + if (typeof data0.summary !== 'string') { + const err35 = { + instancePath: instancePath + '/' + i0 + '/summary', + schemaPath: '#/items/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } + if (data0.minimize_collapsed !== undefined) { + if (typeof data0.minimize_collapsed !== 'boolean') { + const err36 = { + instancePath: instancePath + '/' + i0 + '/minimize_collapsed', + schemaPath: '#/items/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + if (data0.label_singular !== undefined) { + if (typeof data0.label_singular !== 'string') { + const err37 = { + instancePath: instancePath + '/' + i0 + '/label_singular', + schemaPath: '#/items/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + if (data0.i18n !== undefined) { + if (typeof data0.i18n !== 'boolean') { + const err38 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + if (data0.min !== undefined) { + if (!(typeof data0.min == 'number')) { + const err39 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } + if (data0.max !== undefined) { + if (!(typeof data0.max == 'number')) { + const err40 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + } + var _valid0 = _errs58 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'object') { + const _errs75 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collapsed !== undefined) { + if (typeof data0.collapsed !== 'boolean') { + const err41 = { + instancePath: instancePath + '/' + i0 + '/collapsed', + schemaPath: '#/items/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + if (data0.i18n !== undefined) { + if (typeof data0.i18n !== 'boolean') { + const err42 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/selectCases/object/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + } + } + var _valid0 = _errs75 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'relation') { + const _errs80 = errors; + const _errs81 = errors; + let valid21 = false; + let passing2 = null; + const _errs82 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection === undefined) { + const err43 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + if (data0.value_field === undefined) { + const err44 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + if (data0.search_fields === undefined) { + const err45 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: "must have required property '" + 'search_fields' + "'", + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + } + var _valid3 = _errs82 === errors; + if (_valid3) { + valid21 = true; + passing2 = 0; + } + const _errs83 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection === undefined) { + const err46 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + if (data0.valueField === undefined) { + const err47 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + if (data0.searchFields === undefined) { + const err48 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } + } + var _valid3 = _errs83 === errors; + if (_valid3 && valid21) { + valid21 = false; + passing2 = [passing2, 1]; + } else { + if (_valid3) { + valid21 = true; + passing2 = 1; + } + } + if (!valid21) { + const err49 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing2 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } else { + errors = _errs81; + if (vErrors !== null) { + if (_errs81) { + vErrors.length = _errs81; + } else { + vErrors = null; + } + } + } + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.collection !== undefined) { + if (typeof data0.collection !== 'string') { + const err50 = { + instancePath: instancePath + '/' + i0 + '/collection', + schemaPath: '#/items/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + } + if (data0.value_field !== undefined) { + if (typeof data0.value_field !== 'string') { + const err51 = { + instancePath: instancePath + '/' + i0 + '/value_field', + schemaPath: '#/items/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + } + if (data0.search_fields !== undefined) { + let data33 = data0.search_fields; + if (Array.isArray(data33)) { + if (data33.length < 1) { + const err52 = { + instancePath: instancePath + '/' + i0 + '/search_fields', + schemaPath: '#/items/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + const len5 = data33.length; + for (let i5 = 0; i5 < len5; i5++) { + if (typeof data33[i5] !== 'string') { + const err53 = { + instancePath: instancePath + '/' + i0 + '/search_fields/' + i5, + schemaPath: + '#/items/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + } else { + const err54 = { + instancePath: instancePath + '/' + i0 + '/search_fields', + schemaPath: '#/items/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + if (data0.file !== undefined) { + if (typeof data0.file !== 'string') { + const err55 = { + instancePath: instancePath + '/' + i0 + '/file', + schemaPath: '#/items/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + if (data0.multiple !== undefined) { + if (typeof data0.multiple !== 'boolean') { + const err56 = { + instancePath: instancePath + '/' + i0 + '/multiple', + schemaPath: '#/items/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + if (data0.min !== undefined) { + let data37 = data0.min; + if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { + const err57 = { + instancePath: instancePath + '/' + i0 + '/min', + schemaPath: '#/items/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } + if (data0.max !== undefined) { + let data38 = data0.max; + if (!(typeof data38 == 'number' && !(data38 % 1) && !isNaN(data38))) { + const err58 = { + instancePath: instancePath + '/' + i0 + '/max', + schemaPath: '#/items/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + } + if (data0.display_fields !== undefined) { + let data39 = data0.display_fields; + if (Array.isArray(data39)) { + if (data39.length < 1) { + const err59 = { + instancePath: instancePath + '/' + i0 + '/display_fields', + schemaPath: '#/items/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + const len6 = data39.length; + for (let i6 = 0; i6 < len6; i6++) { + if (typeof data39[i6] !== 'string') { + const err60 = { + instancePath: instancePath + '/' + i0 + '/display_fields/' + i6, + schemaPath: + '#/items/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + } else { + const err61 = { + instancePath: instancePath + '/' + i0 + '/display_fields', + schemaPath: '#/items/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + if (data0.options_length !== undefined) { + let data41 = data0.options_length; + if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { + const err62 = { + instancePath: instancePath + '/' + i0 + '/options_length', + schemaPath: '#/items/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + } + var _valid0 = _errs80 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'boolean') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'map') { + const _errs106 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.decimals !== undefined) { + let data42 = data0.decimals; + if (!(typeof data42 == 'number' && !(data42 % 1) && !isNaN(data42))) { + const err63 = { + instancePath: instancePath + '/' + i0 + '/decimals', + schemaPath: '#/items/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } + if (data0.type !== undefined) { + let data43 = data0.type; + if (typeof data43 !== 'string') { + const err64 = { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/selectCases/map/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + if (!(data43 === 'Point' || data43 === 'LineString' || data43 === 'Polygon')) { + const err65 = { + instancePath: instancePath + '/' + i0 + '/type', + schemaPath: '#/items/selectCases/map/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema44.items.selectCases.map.properties.type.enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + } + var _valid0 = _errs106 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'date') { + var _valid0 = true; + valid2 = _valid0; + } else if ('' + value0 == 'datetime') { + const _errs111 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.format !== undefined) { + if (typeof data0.format !== 'string') { + const err66 = { + instancePath: instancePath + '/' + i0 + '/format', + schemaPath: '#/items/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + } + if (data0.date_format !== undefined) { + let data45 = data0.date_format; + const _errs115 = errors; + let valid29 = false; + let passing3 = null; + const _errs116 = errors; + if (typeof data45 !== 'string') { + const err67 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } + var _valid4 = _errs116 === errors; + if (_valid4) { + valid29 = true; + passing3 = 0; + } + const _errs118 = errors; + if (typeof data45 !== 'boolean') { + const err68 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + var _valid4 = _errs118 === errors; + if (_valid4 && valid29) { + valid29 = false; + passing3 = [passing3, 1]; + } else { + if (_valid4) { + valid29 = true; + passing3 = 1; + } + } + if (!valid29) { + const err69 = { + instancePath: instancePath + '/' + i0 + '/date_format', + schemaPath: '#/items/selectCases/datetime/properties/date_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing3 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } else { + errors = _errs115; + if (vErrors !== null) { + if (_errs115) { + vErrors.length = _errs115; + } else { + vErrors = null; + } + } + } + } + if (data0.time_format !== undefined) { + let data46 = data0.time_format; + const _errs121 = errors; + let valid30 = false; + let passing4 = null; + const _errs122 = errors; + if (typeof data46 !== 'string') { + const err70 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var _valid5 = _errs122 === errors; + if (_valid5) { + valid30 = true; + passing4 = 0; + } + const _errs124 = errors; + if (typeof data46 !== 'boolean') { + const err71 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + var _valid5 = _errs124 === errors; + if (_valid5 && valid30) { + valid30 = false; + passing4 = [passing4, 1]; + } else { + if (_valid5) { + valid30 = true; + passing4 = 1; + } + } + if (!valid30) { + const err72 = { + instancePath: instancePath + '/' + i0 + '/time_format', + schemaPath: '#/items/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing4 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } else { + errors = _errs121; + if (vErrors !== null) { + if (_errs121) { + vErrors.length = _errs121; + } else { + vErrors = null; + } + } + } + } + if (data0.picker_utc !== undefined) { + if (typeof data0.picker_utc !== 'boolean') { + const err73 = { + instancePath: instancePath + '/' + i0 + '/picker_utc', + schemaPath: '#/items/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + } + } + var _valid0 = _errs111 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'code') { + const _errs128 = errors; + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.default_language !== undefined) { + if (typeof data0.default_language !== 'string') { + const err74 = { + instancePath: instancePath + '/' + i0 + '/default_language', + schemaPath: '#/items/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } + if (data0.allow_language_selection !== undefined) { + if (typeof data0.allow_language_selection !== 'boolean') { + const err75 = { + instancePath: instancePath + '/' + i0 + '/allow_language_selection', + schemaPath: '#/items/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + if (data0.output_code_only !== undefined) { + if (typeof data0.output_code_only !== 'boolean') { + const err76 = { + instancePath: instancePath + '/' + i0 + '/output_code_only', + schemaPath: '#/items/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } + if (data0.keys !== undefined) { + let data51 = data0.keys; + if (data51 && typeof data51 == 'object' && !Array.isArray(data51)) { + if (data51.code !== undefined) { + if (typeof data51.code !== 'string') { + const err77 = { + instancePath: instancePath + '/' + i0 + '/keys/code', + schemaPath: '#/items/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + if (data51.lang !== undefined) { + if (typeof data51.lang !== 'string') { + const err78 = { + instancePath: instancePath + '/' + i0 + '/keys/lang', + schemaPath: '#/items/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + } else { + const err79 = { + instancePath: instancePath + '/' + i0 + '/keys', + schemaPath: '#/items/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + } + var _valid0 = _errs128 === errors; + valid2 = _valid0; + } else if ('' + value0 == 'color') { + var _valid0 = true; + valid2 = _valid0; + } + if (!valid2) { + const err80 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + } + } + if (data0 && typeof data0 == 'object' && !Array.isArray(data0)) { + if (data0.name === undefined) { + const err81 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + if (data0.name !== undefined) { + if (typeof data0.name !== 'string') { + const err82 = { + instancePath: instancePath + '/' + i0 + '/name', + schemaPath: '#/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + if (data0.label !== undefined) { + if (typeof data0.label !== 'string') { + const err83 = { + instancePath: instancePath + '/' + i0 + '/label', + schemaPath: '#/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + if (data0.widget !== undefined) { + if (typeof data0.widget !== 'string') { + const err84 = { + instancePath: instancePath + '/' + i0 + '/widget', + schemaPath: '#/items/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + if (data0.required !== undefined) { + if (typeof data0.required !== 'boolean') { + const err85 = { + instancePath: instancePath + '/' + i0 + '/required', + schemaPath: '#/items/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + if (data0.i18n !== undefined) { + let data58 = data0.i18n; + const _errs151 = errors; + let valid34 = false; + let passing5 = null; + const _errs152 = errors; + if (typeof data58 !== 'boolean') { + const err86 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + var _valid6 = _errs152 === errors; + if (_valid6) { + valid34 = true; + passing5 = 0; + } + const _errs154 = errors; + if (typeof data58 !== 'string') { + const err87 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + if (!(data58 === 'translate' || data58 === 'duplicate' || data58 === 'none')) { + const err88 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf/1/enum', + keyword: 'enum', + params: { allowedValues: schema44.items.properties.i18n.oneOf[1].enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + var _valid6 = _errs154 === errors; + if (_valid6 && valid34) { + valid34 = false; + passing5 = [passing5, 1]; + } else { + if (_valid6) { + valid34 = true; + passing5 = 1; + } + } + if (!valid34) { + const err89 = { + instancePath: instancePath + '/' + i0 + '/i18n', + schemaPath: '#/items/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing5 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } else { + errors = _errs151; + if (vErrors !== null) { + if (_errs151) { + vErrors.length = _errs151; + } else { + vErrors = null; + } + } + } + } + if (data0.hint !== undefined) { + if (typeof data0.hint !== 'string') { + const err90 = { + instancePath: instancePath + '/' + i0 + '/hint', + schemaPath: '#/items/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + if (data0.pattern !== undefined) { + let data60 = data0.pattern; + if (Array.isArray(data60)) { + if (data60.length < 2) { + const err91 = { + instancePath: instancePath + '/' + i0 + '/pattern', + schemaPath: '#/items/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + const len7 = data60.length; + if (len7 > 0) { + let data61 = data60[0]; + const _errs161 = errors; + let valid36 = false; + let passing6 = null; + const _errs162 = errors; + if (typeof data61 !== 'string') { + const err92 = { + 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 = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + var _valid7 = _errs162 === errors; + if (_valid7) { + valid36 = true; + passing6 = 0; + } + const _errs164 = errors; + if (typeof data61 == 'number') { + if (!(data61 instanceof RegExp)) { + const err93 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + if (typeof data61 === 'string') { + if (!(data61 instanceof RegExp)) { + const err94 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + if (Array.isArray(data61)) { + if (!(data61 instanceof RegExp)) { + const err95 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + if (data61 && typeof data61 == 'object' && !Array.isArray(data61)) { + if (!(data61 instanceof RegExp)) { + const err96 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + var _valid7 = _errs164 === errors; + if (_valid7 && valid36) { + valid36 = false; + passing6 = [passing6, 1]; + } else { + if (_valid7) { + valid36 = true; + passing6 = 1; + } + } + if (!valid36) { + const err97 = { + instancePath: instancePath + '/' + i0 + '/pattern/0', + schemaPath: '#/items/properties/pattern/items/0/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing6 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } else { + errors = _errs161; + if (vErrors !== null) { + if (_errs161) { + vErrors.length = _errs161; + } else { + vErrors = null; + } + } + } + } + if (len7 > 1) { + if (typeof data60[1] !== 'string') { + const err98 = { + 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 = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + } + } else { + const err99 = { + instancePath: instancePath + '/' + i0 + '/pattern', + schemaPath: '#/items/properties/pattern/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + 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 err100 = { + instancePath: instancePath + '/' + i0, + schemaPath: '#/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + } + if ( + schema44.uniqueItemProperties + .map(property => + data + .map(item => item && item[property]) + .some((value, index, array) => array.indexOf(value) !== index), + ) + .some(value => value) + ) { + const err101 = { + instancePath, + schemaPath: '#/uniqueItemProperties', + keyword: 'uniqueItemProperties', + params: {}, + message: 'must pass "uniqueItemProperties" keyword validation', + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + } else { + const err102 = { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + validate33.errors = vErrors; + return errors === 0; +} +function validate32( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + /*# sourceURL="field_2adbd682-fad2-4d92-a8a2-d5235f5f6a9e" */ 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 == 'unknown') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'string') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'number') { + const _errs1 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.step !== undefined) { + if (!(typeof data.step == 'number')) { + const err1 = { + instancePath: instancePath + '/step', + schemaPath: '#/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err1]; + } else { + vErrors.push(err1); + } + errors++; + } + } + if (data.value_type !== undefined) { + if (typeof data.value_type !== 'string') { + const err2 = { + instancePath: instancePath + '/value_type', + schemaPath: '#/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err2]; + } else { + vErrors.push(err2); + } + errors++; + } + } + if (data.min !== undefined) { + if (!(typeof data.min == 'number')) { + const err3 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err3]; + } else { + vErrors.push(err3); + } + errors++; + } + } + if (data.max !== undefined) { + if (!(typeof data.max == 'number')) { + const err4 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err4]; + } else { + vErrors.push(err4); + } + errors++; + } + } + } + var _valid0 = _errs1 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'text') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'image') { + const _errs10 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_multiple !== undefined) { + if (typeof data.allow_multiple !== 'boolean') { + const err5 = { + instancePath: instancePath + '/allow_multiple', + schemaPath: '#/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err5]; + } else { + vErrors.push(err5); + } + errors++; + } + } + } + var _valid0 = _errs10 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'file') { + const _errs13 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_multiple !== undefined) { + if (typeof data.allow_multiple !== 'boolean') { + const err6 = { + instancePath: instancePath + '/allow_multiple', + schemaPath: '#/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err6]; + } else { + vErrors.push(err6); + } + errors++; + } + } + } + var _valid0 = _errs13 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'select') { + const _errs16 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.options === undefined) { + const err7 = { + instancePath, + schemaPath: '#/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", + }; + if (vErrors === null) { + vErrors = [err7]; + } else { + vErrors.push(err7); + } + errors++; + } + if (data.multiple !== undefined) { + if (typeof data.multiple !== 'boolean') { + const err8 = { + instancePath: instancePath + '/multiple', + schemaPath: '#/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err8]; + } else { + vErrors.push(err8); + } + errors++; + } + } + if (data.min !== undefined) { + let data7 = data.min; + if (!(typeof data7 == 'number' && !(data7 % 1) && !isNaN(data7))) { + const err9 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err9]; + } else { + vErrors.push(err9); + } + errors++; + } + } + if (data.max !== undefined) { + let data8 = data.max; + if (!(typeof data8 == 'number' && !(data8 % 1) && !isNaN(data8))) { + const err10 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err10]; + } else { + vErrors.push(err10); + } + errors++; + } + } + if (data.options !== undefined) { + let data9 = data.options; + if (Array.isArray(data9)) { + const len0 = data9.length; + for (let i0 = 0; i0 < len0; i0++) { + let data10 = data9[i0]; + const _errs26 = errors; + let valid7 = false; + let passing0 = null; + const _errs27 = errors; + if (typeof data10 !== 'string') { + const err11 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err11]; + } else { + vErrors.push(err11); + } + errors++; + } + var _valid1 = _errs27 === errors; + if (_valid1) { + valid7 = true; + passing0 = 0; + } + const _errs29 = errors; + if (!(typeof data10 == 'number')) { + const err12 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err12]; + } else { + vErrors.push(err12); + } + errors++; + } + var _valid1 = _errs29 === errors; + if (_valid1 && valid7) { + valid7 = false; + passing0 = [passing0, 1]; + } else { + if (_valid1) { + valid7 = true; + passing0 = 1; + } + const _errs31 = errors; + if (data10 && typeof data10 == 'object' && !Array.isArray(data10)) { + if (data10.label === undefined) { + const err13 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err13]; + } else { + vErrors.push(err13); + } + errors++; + } + if (data10.value === undefined) { + const err14 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err14]; + } else { + vErrors.push(err14); + } + errors++; + } + if (data10.label !== undefined) { + if (typeof data10.label !== 'string') { + const err15 = { + instancePath: instancePath + '/options/' + i0 + '/label', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err15]; + } else { + vErrors.push(err15); + } + errors++; + } + } + if (data10.value !== undefined) { + let data12 = data10.value; + const _errs36 = errors; + let valid9 = false; + let passing1 = null; + const _errs37 = errors; + if (typeof data12 !== 'string') { + const err16 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + var _valid2 = _errs37 === errors; + if (_valid2) { + valid9 = true; + passing1 = 0; + } + const _errs39 = errors; + if (!(typeof data12 == 'number')) { + const err17 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + var _valid2 = _errs39 === errors; + if (_valid2 && valid9) { + valid9 = false; + passing1 = [passing1, 1]; + } else { + if (_valid2) { + valid9 = true; + passing1 = 1; + } + } + if (!valid9) { + const err18 = { + instancePath: instancePath + '/options/' + i0 + '/value', + schemaPath: + '#/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs36; + if (vErrors !== null) { + if (_errs36) { + vErrors.length = _errs36; + } else { + vErrors = null; + } + } + } + } + } else { + const err19 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } + var _valid1 = _errs31 === errors; + if (_valid1 && valid7) { + valid7 = false; + passing0 = [passing0, 2]; + } else { + if (_valid1) { + valid7 = true; + passing0 = 2; + } + } + } + if (!valid7) { + const err20 = { + instancePath: instancePath + '/options/' + i0, + schemaPath: '#/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing0 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } else { + errors = _errs26; + if (vErrors !== null) { + if (_errs26) { + vErrors.length = _errs26; + } else { + vErrors = null; + } + } + } + } + } else { + const err21 = { + instancePath: instancePath + '/options', + schemaPath: '#/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + } + } + var _valid0 = _errs16 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'markdown') { + const _errs41 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.minimal !== undefined) { + if (typeof data.minimal !== 'boolean') { + const err22 = { + instancePath: instancePath + '/minimal', + schemaPath: '#/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + } + if (data.buttons !== undefined) { + let data14 = data.buttons; + if (Array.isArray(data14)) { + const len1 = data14.length; + for (let i1 = 0; i1 < len1; i1++) { + let data15 = data14[i1]; + if (typeof data15 !== 'string') { + const err23 = { + instancePath: instancePath + '/buttons/' + i1, + schemaPath: '#/selectCases/markdown/properties/buttons/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data15 === 'bold' || + data15 === 'italic' || + data15 === 'code' || + data15 === 'link' || + data15 === 'heading-one' || + data15 === 'heading-two' || + data15 === 'heading-three' || + data15 === 'heading-four' || + data15 === 'heading-five' || + data15 === 'heading-six' || + data15 === 'quote' || + data15 === 'bulleted-list' || + data15 === 'numbered-list' + ) + ) { + const err24 = { + instancePath: instancePath + '/buttons/' + i1, + schemaPath: '#/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', + params: { + allowedValues: schema43.selectCases.markdown.properties.buttons.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + } + } else { + const err25 = { + instancePath: instancePath + '/buttons', + schemaPath: '#/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + } + if (data.editor_components !== undefined) { + let data16 = data.editor_components; + if (Array.isArray(data16)) { + const len2 = data16.length; + for (let i2 = 0; i2 < len2; i2++) { + if (typeof data16[i2] !== 'string') { + const err26 = { + instancePath: instancePath + '/editor_components/' + i2, + schemaPath: '#/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err26]; + } else { + vErrors.push(err26); + } + errors++; + } + } + } else { + const err27 = { + instancePath: instancePath + '/editor_components', + schemaPath: '#/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err27]; + } else { + vErrors.push(err27); + } + errors++; + } + } + if (data.modes !== undefined) { + let data18 = data.modes; + if (Array.isArray(data18)) { + if (data18.length < 1) { + const err28 = { + instancePath: instancePath + '/modes', + schemaPath: '#/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err28]; + } else { + vErrors.push(err28); + } + errors++; + } + const len3 = data18.length; + for (let i3 = 0; i3 < len3; i3++) { + let data19 = data18[i3]; + if (typeof data19 !== 'string') { + const err29 = { + instancePath: instancePath + '/modes/' + i3, + schemaPath: '#/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err29]; + } else { + vErrors.push(err29); + } + errors++; + } + if (!(data19 === 'raw' || data19 === 'rich_text')) { + const err30 = { + instancePath: instancePath + '/modes/' + i3, + schemaPath: '#/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: schema43.selectCases.markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err30]; + } else { + vErrors.push(err30); + } + errors++; + } + } + } else { + const err31 = { + instancePath: instancePath + '/modes', + schemaPath: '#/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err31]; + } else { + vErrors.push(err31); + } + errors++; + } + } + } + var _valid0 = _errs41 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'list') { + const _errs56 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.allow_add !== undefined) { + if (typeof data.allow_add !== 'boolean') { + const err32 = { + instancePath: instancePath + '/allow_add', + schemaPath: '#/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err32]; + } else { + vErrors.push(err32); + } + errors++; + } + } + if (data.collapsed !== undefined) { + if (typeof data.collapsed !== 'boolean') { + const err33 = { + instancePath: instancePath + '/collapsed', + schemaPath: '#/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err33]; + } else { + vErrors.push(err33); + } + errors++; + } + } + if (data.summary !== undefined) { + if (typeof data.summary !== 'string') { + const err34 = { + instancePath: instancePath + '/summary', + schemaPath: '#/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err34]; + } else { + vErrors.push(err34); + } + errors++; + } + } + if (data.minimize_collapsed !== undefined) { + if (typeof data.minimize_collapsed !== 'boolean') { + const err35 = { + instancePath: instancePath + '/minimize_collapsed', + schemaPath: '#/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err35]; + } else { + vErrors.push(err35); + } + errors++; + } + } + if (data.label_singular !== undefined) { + if (typeof data.label_singular !== 'string') { + const err36 = { + instancePath: instancePath + '/label_singular', + schemaPath: '#/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err36]; + } else { + vErrors.push(err36); + } + errors++; + } + } + if (data.i18n !== undefined) { + if (typeof data.i18n !== 'boolean') { + const err37 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err37]; + } else { + vErrors.push(err37); + } + errors++; + } + } + if (data.min !== undefined) { + if (!(typeof data.min == 'number')) { + const err38 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err38]; + } else { + vErrors.push(err38); + } + errors++; + } + } + if (data.max !== undefined) { + if (!(typeof data.max == 'number')) { + const err39 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err39]; + } else { + vErrors.push(err39); + } + errors++; + } + } + } + var _valid0 = _errs56 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'object') { + const _errs73 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collapsed !== undefined) { + if (typeof data.collapsed !== 'boolean') { + const err40 = { + instancePath: instancePath + '/collapsed', + schemaPath: '#/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err40]; + } else { + vErrors.push(err40); + } + errors++; + } + } + if (data.i18n !== undefined) { + if (typeof data.i18n !== 'boolean') { + const err41 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/selectCases/object/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err41]; + } else { + vErrors.push(err41); + } + errors++; + } + } + } + var _valid0 = _errs73 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'relation') { + const _errs78 = errors; + const _errs79 = errors; + let valid19 = false; + let passing2 = null; + const _errs80 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection === undefined) { + const err42 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err42]; + } else { + vErrors.push(err42); + } + errors++; + } + if (data.value_field === undefined) { + const err43 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err43]; + } else { + vErrors.push(err43); + } + errors++; + } + if (data.search_fields === undefined) { + const err44 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: "must have required property '" + 'search_fields' + "'", + }; + if (vErrors === null) { + vErrors = [err44]; + } else { + vErrors.push(err44); + } + errors++; + } + } + var _valid3 = _errs80 === errors; + if (_valid3) { + valid19 = true; + passing2 = 0; + } + const _errs81 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection === undefined) { + const err45 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err45]; + } else { + vErrors.push(err45); + } + errors++; + } + if (data.valueField === undefined) { + const err46 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err46]; + } else { + vErrors.push(err46); + } + errors++; + } + if (data.searchFields === undefined) { + const err47 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err47]; + } else { + vErrors.push(err47); + } + errors++; + } + } + var _valid3 = _errs81 === errors; + if (_valid3 && valid19) { + valid19 = false; + passing2 = [passing2, 1]; + } else { + if (_valid3) { + valid19 = true; + passing2 = 1; + } + } + if (!valid19) { + const err48 = { + instancePath, + schemaPath: '#/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing2 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err48]; + } else { + vErrors.push(err48); + } + errors++; + } else { + errors = _errs79; + if (vErrors !== null) { + if (_errs79) { + vErrors.length = _errs79; + } else { + vErrors = null; + } + } + } + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.collection !== undefined) { + if (typeof data.collection !== 'string') { + const err49 = { + instancePath: instancePath + '/collection', + schemaPath: '#/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err49]; + } else { + vErrors.push(err49); + } + errors++; + } + } + if (data.value_field !== undefined) { + if (typeof data.value_field !== 'string') { + const err50 = { + instancePath: instancePath + '/value_field', + schemaPath: '#/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err50]; + } else { + vErrors.push(err50); + } + errors++; + } + } + if (data.search_fields !== undefined) { + let data32 = data.search_fields; + if (Array.isArray(data32)) { + if (data32.length < 1) { + const err51 = { + instancePath: instancePath + '/search_fields', + schemaPath: '#/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err51]; + } else { + vErrors.push(err51); + } + errors++; + } + const len4 = data32.length; + for (let i4 = 0; i4 < len4; i4++) { + if (typeof data32[i4] !== 'string') { + const err52 = { + instancePath: instancePath + '/search_fields/' + i4, + schemaPath: '#/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err52]; + } else { + vErrors.push(err52); + } + errors++; + } + } + } else { + const err53 = { + instancePath: instancePath + '/search_fields', + schemaPath: '#/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err53]; + } else { + vErrors.push(err53); + } + errors++; + } + } + if (data.file !== undefined) { + if (typeof data.file !== 'string') { + const err54 = { + instancePath: instancePath + '/file', + schemaPath: '#/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err54]; + } else { + vErrors.push(err54); + } + errors++; + } + } + if (data.multiple !== undefined) { + if (typeof data.multiple !== 'boolean') { + const err55 = { + instancePath: instancePath + '/multiple', + schemaPath: '#/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + if (data.min !== undefined) { + let data36 = data.min; + if (!(typeof data36 == 'number' && !(data36 % 1) && !isNaN(data36))) { + const err56 = { + instancePath: instancePath + '/min', + schemaPath: '#/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } + } + if (data.max !== undefined) { + let data37 = data.max; + if (!(typeof data37 == 'number' && !(data37 % 1) && !isNaN(data37))) { + const err57 = { + instancePath: instancePath + '/max', + schemaPath: '#/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } + if (data.display_fields !== undefined) { + let data38 = data.display_fields; + if (Array.isArray(data38)) { + if (data38.length < 1) { + const err58 = { + instancePath: instancePath + '/display_fields', + schemaPath: '#/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + const len5 = data38.length; + for (let i5 = 0; i5 < len5; i5++) { + if (typeof data38[i5] !== 'string') { + const err59 = { + instancePath: instancePath + '/display_fields/' + i5, + schemaPath: '#/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } + } else { + const err60 = { + instancePath: instancePath + '/display_fields', + schemaPath: '#/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } + } + if (data.options_length !== undefined) { + let data40 = data.options_length; + if (!(typeof data40 == 'number' && !(data40 % 1) && !isNaN(data40))) { + const err61 = { + instancePath: instancePath + '/options_length', + schemaPath: '#/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + } + var _valid0 = _errs78 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'boolean') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'map') { + const _errs104 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.decimals !== undefined) { + let data41 = data.decimals; + if (!(typeof data41 == 'number' && !(data41 % 1) && !isNaN(data41))) { + const err62 = { + instancePath: instancePath + '/decimals', + schemaPath: '#/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + if (data.type !== undefined) { + let data42 = data.type; + if (typeof data42 !== 'string') { + const err63 = { + instancePath: instancePath + '/type', + schemaPath: '#/selectCases/map/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + if (!(data42 === 'Point' || data42 === 'LineString' || data42 === 'Polygon')) { + const err64 = { + instancePath: instancePath + '/type', + schemaPath: '#/selectCases/map/properties/type/enum', + keyword: 'enum', + params: { allowedValues: schema43.selectCases.map.properties.type.enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + } + } + var _valid0 = _errs104 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'date') { + var _valid0 = true; + valid0 = _valid0; + } else if ('' + value0 == 'datetime') { + const _errs109 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.format !== undefined) { + if (typeof data.format !== 'string') { + const err65 = { + instancePath: instancePath + '/format', + schemaPath: '#/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + } + if (data.date_format !== undefined) { + let data44 = data.date_format; + const _errs113 = errors; + let valid27 = false; + let passing3 = null; + const _errs114 = errors; + if (typeof data44 !== 'string') { + const err66 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + var _valid4 = _errs114 === errors; + if (_valid4) { + valid27 = true; + passing3 = 0; + } + const _errs116 = errors; + if (typeof data44 !== 'boolean') { + const err67 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } + var _valid4 = _errs116 === errors; + if (_valid4 && valid27) { + valid27 = false; + passing3 = [passing3, 1]; + } else { + if (_valid4) { + valid27 = true; + passing3 = 1; + } + } + if (!valid27) { + const err68 = { + instancePath: instancePath + '/date_format', + schemaPath: '#/selectCases/datetime/properties/date_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing3 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } else { + errors = _errs113; + if (vErrors !== null) { + if (_errs113) { + vErrors.length = _errs113; + } else { + vErrors = null; + } + } + } + } + if (data.time_format !== undefined) { + let data45 = data.time_format; + const _errs119 = errors; + let valid28 = false; + let passing4 = null; + const _errs120 = errors; + if (typeof data45 !== 'string') { + const err69 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + var _valid5 = _errs120 === errors; + if (_valid5) { + valid28 = true; + passing4 = 0; + } + const _errs122 = errors; + if (typeof data45 !== 'boolean') { + const err70 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + var _valid5 = _errs122 === errors; + if (_valid5 && valid28) { + valid28 = false; + passing4 = [passing4, 1]; + } else { + if (_valid5) { + valid28 = true; + passing4 = 1; + } + } + if (!valid28) { + const err71 = { + instancePath: instancePath + '/time_format', + schemaPath: '#/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing4 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } else { + errors = _errs119; + if (vErrors !== null) { + if (_errs119) { + vErrors.length = _errs119; + } else { + vErrors = null; + } + } + } + } + if (data.picker_utc !== undefined) { + if (typeof data.picker_utc !== 'boolean') { + const err72 = { + instancePath: instancePath + '/picker_utc', + schemaPath: '#/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + } + var _valid0 = _errs109 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'code') { + const _errs126 = errors; + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.default_language !== undefined) { + if (typeof data.default_language !== 'string') { + const err73 = { + instancePath: instancePath + '/default_language', + schemaPath: '#/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + } + if (data.allow_language_selection !== undefined) { + if (typeof data.allow_language_selection !== 'boolean') { + const err74 = { + instancePath: instancePath + '/allow_language_selection', + schemaPath: '#/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } + if (data.output_code_only !== undefined) { + if (typeof data.output_code_only !== 'boolean') { + const err75 = { + instancePath: instancePath + '/output_code_only', + schemaPath: '#/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + } + if (data.keys !== undefined) { + let data50 = data.keys; + if (data50 && typeof data50 == 'object' && !Array.isArray(data50)) { + if (data50.code !== undefined) { + if (typeof data50.code !== 'string') { + const err76 = { + instancePath: instancePath + '/keys/code', + schemaPath: '#/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + } + if (data50.lang !== undefined) { + if (typeof data50.lang !== 'string') { + const err77 = { + instancePath: instancePath + '/keys/lang', + schemaPath: '#/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + } + } else { + const err78 = { + instancePath: instancePath + '/keys', + schemaPath: '#/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + } + } + var _valid0 = _errs126 === errors; + valid0 = _valid0; + } else if ('' + value0 == 'color') { + var _valid0 = true; + valid0 = _valid0; + } + if (!valid0) { + const err79 = { + instancePath, + schemaPath: '#/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + } + if (data && typeof data == 'object' && !Array.isArray(data)) { + if (data.name === undefined) { + const err80 = { + instancePath, + schemaPath: '#/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + if (data.name !== undefined) { + if (typeof data.name !== 'string') { + const err81 = { + instancePath: instancePath + '/name', + schemaPath: '#/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + if (data.label !== undefined) { + if (typeof data.label !== 'string') { + const err82 = { + instancePath: instancePath + '/label', + schemaPath: '#/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + if (data.widget !== undefined) { + if (typeof data.widget !== 'string') { + const err83 = { + instancePath: instancePath + '/widget', + schemaPath: '#/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + if (data.required !== undefined) { + if (typeof data.required !== 'boolean') { + const err84 = { + instancePath: instancePath + '/required', + schemaPath: '#/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + if (data.i18n !== undefined) { + let data57 = data.i18n; + const _errs149 = errors; + let valid32 = false; + let passing5 = null; + const _errs150 = errors; + if (typeof data57 !== 'boolean') { + const err85 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + var _valid6 = _errs150 === errors; + if (_valid6) { + valid32 = true; + passing5 = 0; + } + const _errs152 = errors; + if (typeof data57 !== 'string') { + const err86 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + if (!(data57 === 'translate' || data57 === 'duplicate' || data57 === 'none')) { + const err87 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf/1/enum', + keyword: 'enum', + params: { allowedValues: schema43.properties.i18n.oneOf[1].enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } + var _valid6 = _errs152 === errors; + if (_valid6 && valid32) { + valid32 = false; + passing5 = [passing5, 1]; + } else { + if (_valid6) { + valid32 = true; + passing5 = 1; + } + } + if (!valid32) { + const err88 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing5 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } else { + errors = _errs149; + if (vErrors !== null) { + if (_errs149) { + vErrors.length = _errs149; + } else { + vErrors = null; + } + } + } + } + if (data.hint !== undefined) { + if (typeof data.hint !== 'string') { + const err89 = { + instancePath: instancePath + '/hint', + schemaPath: '#/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } + if (data.pattern !== undefined) { + let data59 = data.pattern; + if (Array.isArray(data59)) { + if (data59.length < 2) { + const err90 = { + instancePath: instancePath + '/pattern', + schemaPath: '#/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + const len6 = data59.length; + if (len6 > 0) { + let data60 = data59[0]; + const _errs159 = errors; + let valid34 = false; + let passing6 = null; + const _errs160 = errors; + if (typeof data60 !== 'string') { + const err91 = { + 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 = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + var _valid7 = _errs160 === errors; + if (_valid7) { + valid34 = true; + passing6 = 0; + } + const _errs162 = errors; + if (typeof data60 == 'number') { + if (!(data60 instanceof RegExp)) { + const err92 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + if (typeof data60 === 'string') { + if (!(data60 instanceof RegExp)) { + const err93 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + if (Array.isArray(data60)) { + if (!(data60 instanceof RegExp)) { + const err94 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + } + if (data60 && typeof data60 == 'object' && !Array.isArray(data60)) { + if (!(data60 instanceof RegExp)) { + const err95 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + var _valid7 = _errs162 === errors; + if (_valid7 && valid34) { + valid34 = false; + passing6 = [passing6, 1]; + } else { + if (_valid7) { + valid34 = true; + passing6 = 1; + } + } + if (!valid34) { + const err96 = { + instancePath: instancePath + '/pattern/0', + schemaPath: '#/properties/pattern/items/0/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing6 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } else { + errors = _errs159; + if (vErrors !== null) { + if (_errs159) { + vErrors.length = _errs159; + } else { + vErrors = null; + } + } + } + } + if (len6 > 1) { + if (typeof data59[1] !== 'string') { + const err97 = { + instancePath: instancePath + '/pattern/1', + schemaPath: '#/properties/pattern/items/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + } else { + const err98 = { + instancePath: instancePath + '/pattern', + schemaPath: '#/properties/pattern/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + 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 ( + !validate33(data.fields, { + instancePath: instancePath + '/fields', + parentData: data, + parentDataProperty: 'fields', + rootData, + }) + ) { + vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); + errors = vErrors.length; + } + } + if (data.types !== undefined) { + if ( + !validate33(data.types, { + instancePath: instancePath + '/types', + parentData: data, + parentDataProperty: 'types', + rootData, + }) + ) { + vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); + errors = vErrors.length; + } + } + } else { + const err99 = { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + validate32.errors = vErrors; + return errors === 0; +} +function validate24( + data, + { instancePath = '', parentData, parentDataProperty, rootData = data } = {}, +) { + /*# sourceURL="https://netlify-cms/object.json" */ 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: schema40.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 (func9(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 < len0; i0++) { + if (typeof data7[i0] !== 'string') { + const err16 = { + instancePath: instancePath + '/local_backend/allowed_hosts/' + i0, + schemaPath: + '#/properties/local_backend/oneOf/1/properties/allowed_hosts/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err16]; + } else { + vErrors.push(err16); + } + errors++; + } + } + } else { + const err17 = { + instancePath: instancePath + '/local_backend/allowed_hosts', + schemaPath: '#/properties/local_backend/oneOf/1/properties/allowed_hosts/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err17]; + } else { + vErrors.push(err17); + } + errors++; + } + } + } else { + const err18 = { + instancePath: instancePath + '/local_backend', + schemaPath: '#/properties/local_backend/oneOf/1/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err18]; + } else { + vErrors.push(err18); + } + errors++; + } + var _valid1 = _errs18 === errors; + if (_valid1 && valid3) { + valid3 = false; + passing0 = [passing0, 1]; + } else { + if (_valid1) { + valid3 = true; + passing0 = 1; + } + } + if (!valid3) { + const err19 = { + instancePath: instancePath + '/local_backend', + schemaPath: '#/properties/local_backend/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing0 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err19]; + } else { + vErrors.push(err19); + } + errors++; + } else { + errors = _errs15; + if (vErrors !== null) { + if (_errs15) { + vErrors.length = _errs15; + } else { + vErrors = null; + } + } + } + } + if (data.locale !== undefined) { + if (typeof data.locale !== 'string') { + const err20 = { + instancePath: instancePath + '/locale', + schemaPath: '#/properties/locale/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err20]; + } else { + vErrors.push(err20); + } + errors++; + } + } + if (data.i18n !== undefined) { + let data10 = data.i18n; + if (data10 && typeof data10 == 'object' && !Array.isArray(data10)) { + if (data10.structure === undefined) { + const err21 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/required', + keyword: 'required', + params: { missingProperty: 'structure' }, + message: "must have required property '" + 'structure' + "'", + }; + if (vErrors === null) { + vErrors = [err21]; + } else { + vErrors.push(err21); + } + errors++; + } + if (data10.locales === undefined) { + const err22 = { + instancePath: instancePath + '/i18n', + schemaPath: '#/properties/i18n/required', + keyword: 'required', + params: { missingProperty: 'locales' }, + message: "must have required property '" + 'locales' + "'", + }; + if (vErrors === null) { + vErrors = [err22]; + } else { + vErrors.push(err22); + } + errors++; + } + if (data10.structure !== undefined) { + let data11 = data10.structure; + if (typeof data11 !== 'string') { + const err23 = { + instancePath: instancePath + '/i18n/structure', + schemaPath: '#/properties/i18n/properties/structure/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err23]; + } else { + vErrors.push(err23); + } + errors++; + } + if ( + !( + data11 === 'multiple_folders' || + data11 === 'multiple_files' || + data11 === 'single_file' + ) + ) { + const err24 = { + instancePath: instancePath + '/i18n/structure', + schemaPath: '#/properties/i18n/properties/structure/enum', + keyword: 'enum', + params: { allowedValues: schema40.properties.i18n.properties.structure.enum }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err24]; + } else { + vErrors.push(err24); + } + errors++; + } + } + if (data10.locales !== undefined) { + let data12 = data10.locales; + if (Array.isArray(data12)) { + if (data12.length < 2) { + const err25 = { + instancePath: instancePath + '/i18n/locales', + schemaPath: '#/properties/i18n/properties/locales/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err25]; + } else { + vErrors.push(err25); + } + errors++; + } + const len1 = data12.length; + for (let i1 = 0; i1 < len1; i1++) { + let data13 = data12[i1]; + if (typeof data13 === 'string') { + if (func9(data13) > 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 (func9(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 (func9(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 (func9(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: schema40.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: schema40.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 < len2; i3++) { + let data30 = data29[i3]; + const _errs71 = errors; + const _errs72 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + let missing0; + if ( + (data30.sortable_fields === undefined && (missing0 = 'sortable_fields')) || + (data30.sortableFields === undefined && (missing0 = 'sortableFields')) + ) { + const err55 = {}; + if (vErrors === null) { + vErrors = [err55]; + } else { + vErrors.push(err55); + } + errors++; + } + } + var valid15 = _errs72 === errors; + if (valid15) { + const err56 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/not', + keyword: 'not', + params: {}, + message: 'must NOT be valid', + }; + if (vErrors === null) { + vErrors = [err56]; + } else { + vErrors.push(err56); + } + errors++; + } else { + errors = _errs71; + if (vErrors !== null) { + if (_errs71) { + vErrors.length = _errs71; + } else { + vErrors = null; + } + } + } + const _errs73 = errors; + let valid16 = false; + let passing1 = null; + const _errs74 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.files === undefined) { + const err57 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'files' }, + message: "must have required property '" + 'files' + "'", + }; + if (vErrors === null) { + vErrors = [err57]; + } else { + vErrors.push(err57); + } + errors++; + } + } + var _valid2 = _errs74 === errors; + if (_valid2) { + valid16 = true; + passing1 = 0; + } + const _errs75 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.folder === undefined) { + const err58 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'folder' }, + message: "must have required property '" + 'folder' + "'", + }; + if (vErrors === null) { + vErrors = [err58]; + } else { + vErrors.push(err58); + } + errors++; + } + if (data30.fields === undefined) { + const err59 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'fields' }, + message: "must have required property '" + 'fields' + "'", + }; + if (vErrors === null) { + vErrors = [err59]; + } else { + vErrors.push(err59); + } + errors++; + } + } + var _valid2 = _errs75 === errors; + if (_valid2 && valid16) { + valid16 = false; + passing1 = [passing1, 1]; + } else { + if (_valid2) { + valid16 = true; + passing1 = 1; + } + } + if (!valid16) { + const err60 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing1 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err60]; + } else { + vErrors.push(err60); + } + errors++; + } else { + errors = _errs73; + if (vErrors !== null) { + if (_errs73) { + vErrors.length = _errs73; + } else { + vErrors = null; + } + } + } + const _errs76 = errors; + let valid17 = true; + const _errs77 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + let missing1; + if (data30.extension === undefined && (missing1 = 'extension')) { + const err61 = {}; + if (vErrors === null) { + vErrors = [err61]; + } else { + vErrors.push(err61); + } + errors++; + } + } + var _valid3 = _errs77 === errors; + errors = _errs76; + if (vErrors !== null) { + if (_errs76) { + vErrors.length = _errs76; + } else { + vErrors = null; + } + } + if (_valid3) { + const _errs78 = errors; + const _errs79 = errors; + let valid18 = true; + const _errs80 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.extension !== undefined) { + let data31 = data30.extension; + if ( + !( + data31 === 'yml' || + data31 === 'yaml' || + data31 === 'toml' || + data31 === 'json' || + data31 === 'md' || + data31 === 'markdown' || + data31 === 'html' + ) + ) { + const err62 = {}; + if (vErrors === null) { + vErrors = [err62]; + } else { + vErrors.push(err62); + } + errors++; + } + } + } + var _valid4 = _errs80 === errors; + errors = _errs79; + if (vErrors !== null) { + if (_errs79) { + vErrors.length = _errs79; + } else { + vErrors = null; + } + } + if (!_valid4) { + const _errs82 = errors; + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.format === undefined) { + const err63 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/then/else/required', + keyword: 'required', + params: { missingProperty: 'format' }, + message: "must have required property '" + 'format' + "'", + }; + if (vErrors === null) { + vErrors = [err63]; + } else { + vErrors.push(err63); + } + errors++; + } + } + var _valid4 = _errs82 === errors; + valid18 = _valid4; + } + if (!valid18) { + const err64 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/then/if', + keyword: 'if', + params: { failingKeyword: 'else' }, + message: 'must match "else" schema', + }; + if (vErrors === null) { + vErrors = [err64]; + } else { + vErrors.push(err64); + } + errors++; + } + var _valid3 = _errs78 === errors; + valid17 = _valid3; + } + if (!valid17) { + const err65 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/if', + keyword: 'if', + params: { failingKeyword: 'then' }, + message: 'must match "then" schema', + }; + if (vErrors === null) { + vErrors = [err65]; + } else { + vErrors.push(err65); + } + errors++; + } + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.name === undefined) { + const err66 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err66]; + } else { + vErrors.push(err66); + } + errors++; + } + if (data30.label === undefined) { + const err67 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err67]; + } else { + vErrors.push(err67); + } + errors++; + } + if (data30.frontmatter_delimiter !== undefined) { + if (data30 && typeof data30 == 'object' && !Array.isArray(data30)) { + if (data30.format === undefined) { + const err68 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: + '#/properties/collections/items/dependencies/frontmatter_delimiter/required', + keyword: 'required', + params: { missingProperty: 'format' }, + message: "must have required property '" + 'format' + "'", + }; + if (vErrors === null) { + vErrors = [err68]; + } else { + vErrors.push(err68); + } + errors++; + } + if (data30.format !== undefined) { + let data32 = data30.format; + if ( + !( + data32 === 'yaml-frontmatter' || + data32 === 'toml-frontmatter' || + data32 === 'json-frontmatter' + ) + ) { + const err69 = { + instancePath: instancePath + '/collections/' + i3 + '/format', + schemaPath: + '#/properties/collections/items/dependencies/frontmatter_delimiter/properties/format/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.dependencies.frontmatter_delimiter + .properties.format.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err69]; + } else { + vErrors.push(err69); + } + errors++; + } + } + } + } + if (data30.name !== undefined) { + if (typeof data30.name !== 'string') { + const err70 = { + instancePath: instancePath + '/collections/' + i3 + '/name', + schemaPath: '#/properties/collections/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err70]; + } else { + vErrors.push(err70); + } + errors++; + } + } + if (data30.label !== undefined) { + if (typeof data30.label !== 'string') { + const err71 = { + instancePath: instancePath + '/collections/' + i3 + '/label', + schemaPath: '#/properties/collections/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err71]; + } else { + vErrors.push(err71); + } + errors++; + } + } + if (data30.label_singular !== undefined) { + if (typeof data30.label_singular !== 'string') { + const err72 = { + instancePath: instancePath + '/collections/' + i3 + '/label_singular', + schemaPath: '#/properties/collections/items/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err72]; + } else { + vErrors.push(err72); + } + errors++; + } + } + if (data30.description !== undefined) { + if (typeof data30.description !== 'string') { + const err73 = { + instancePath: instancePath + '/collections/' + i3 + '/description', + schemaPath: '#/properties/collections/items/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err73]; + } else { + vErrors.push(err73); + } + errors++; + } + } + if (data30.folder !== undefined) { + if (typeof data30.folder !== 'string') { + const err74 = { + instancePath: instancePath + '/collections/' + i3 + '/folder', + schemaPath: '#/properties/collections/items/properties/folder/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err74]; + } else { + vErrors.push(err74); + } + errors++; + } + } + if (data30.files !== undefined) { + let data38 = data30.files; + if (Array.isArray(data38)) { + const len3 = data38.length; + for (let i4 = 0; i4 < len3; i4++) { + let data39 = data38[i4]; + if (data39 && typeof data39 == 'object' && !Array.isArray(data39)) { + if (data39.name === undefined) { + const err75 = { + instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, + schemaPath: + '#/properties/collections/items/properties/files/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err75]; + } else { + vErrors.push(err75); + } + errors++; + } + if (data39.label === undefined) { + const err76 = { + instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, + schemaPath: + '#/properties/collections/items/properties/files/items/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err76]; + } else { + vErrors.push(err76); + } + errors++; + } + if (data39.file === undefined) { + const err77 = { + instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, + schemaPath: + '#/properties/collections/items/properties/files/items/required', + keyword: 'required', + params: { missingProperty: 'file' }, + message: "must have required property '" + 'file' + "'", + }; + if (vErrors === null) { + vErrors = [err77]; + } else { + vErrors.push(err77); + } + errors++; + } + if (data39.fields === undefined) { + const err78 = { + instancePath: instancePath + '/collections/' + i3 + '/files/' + i4, + schemaPath: + '#/properties/collections/items/properties/files/items/required', + keyword: 'required', + params: { missingProperty: 'fields' }, + message: "must have required property '" + 'fields' + "'", + }; + if (vErrors === null) { + vErrors = [err78]; + } else { + vErrors.push(err78); + } + errors++; + } + if (data39.name !== undefined) { + if (typeof data39.name !== 'string') { + const err79 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/name', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err79]; + } else { + vErrors.push(err79); + } + errors++; + } + } + if (data39.label !== undefined) { + if (typeof data39.label !== 'string') { + const err80 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/label', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err80]; + } else { + vErrors.push(err80); + } + errors++; + } + } + if (data39.label_singular !== undefined) { + if (typeof data39.label_singular !== 'string') { + const err81 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/label_singular', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err81]; + } else { + vErrors.push(err81); + } + errors++; + } + } + if (data39.description !== undefined) { + if (typeof data39.description !== 'string') { + const err82 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/description', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/description/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err82]; + } else { + vErrors.push(err82); + } + errors++; + } + } + if (data39.file !== undefined) { + if (typeof data39.file !== 'string') { + const err83 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/file', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err83]; + } else { + vErrors.push(err83); + } + errors++; + } + } + if (data39.preview_path !== undefined) { + if (typeof data39.preview_path !== 'string') { + const err84 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/preview_path', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/preview_path/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err84]; + } else { + vErrors.push(err84); + } + errors++; + } + } + if (data39.preview_path_date_field !== undefined) { + if (typeof data39.preview_path_date_field !== 'string') { + const err85 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/preview_path_date_field', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/preview_path_date_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err85]; + } else { + vErrors.push(err85); + } + errors++; + } + } + if (data39.fields !== undefined) { + let data47 = data39.fields; + if (Array.isArray(data47)) { + if (data47.length < 1) { + const err86 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/fields', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err86]; + } else { + vErrors.push(err86); + } + errors++; + } + const len4 = data47.length; + for (let i5 = 0; i5 < len4; i5++) { + let data48 = data47[i5]; + const vSchema6 = data48 && data48.widget; + if (!(vSchema6 === undefined)) { + if ( + typeof vSchema6 !== 'string' && + !(typeof vSchema6 == 'number') && + typeof vSchema6 !== 'boolean' && + vSchema6 !== null + ) { + const err87 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/select', + keyword: 'select', + params: {}, + message: + '"select" keyword must be string,number,boolean,null ($data)', + }; + if (vErrors === null) { + vErrors = [err87]; + } else { + vErrors.push(err87); + } + errors++; + } else { + let valid28 = true; + const value0 = vSchema6 === null ? 'null' : vSchema6; + if ('' + value0 == 'unknown') { + var _valid5 = true; + valid28 = _valid5; + } else if ('' + value0 == 'string') { + var _valid5 = true; + valid28 = _valid5; + } else if ('' + value0 == 'number') { + const _errs117 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.step !== undefined) { + if (!(typeof data48.step == 'number')) { + const err88 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/step', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err88]; + } else { + vErrors.push(err88); + } + errors++; + } + } + if (data48.value_type !== undefined) { + if (typeof data48.value_type !== 'string') { + const err89 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/value_type', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err89]; + } else { + vErrors.push(err89); + } + errors++; + } + } + if (data48.min !== undefined) { + if (!(typeof data48.min == 'number')) { + const err90 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/min', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err90]; + } else { + vErrors.push(err90); + } + errors++; + } + } + if (data48.max !== undefined) { + if (!(typeof data48.max == 'number')) { + const err91 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/max', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err91]; + } else { + vErrors.push(err91); + } + errors++; + } + } + } + var _valid5 = _errs117 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'text') { + var _valid5 = true; + valid28 = _valid5; + } else if ('' + value0 == 'image') { + const _errs126 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.allow_multiple !== undefined) { + if (typeof data48.allow_multiple !== 'boolean') { + const err92 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/allow_multiple', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err92]; + } else { + vErrors.push(err92); + } + errors++; + } + } + } + var _valid5 = _errs126 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'file') { + const _errs129 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.allow_multiple !== undefined) { + if (typeof data48.allow_multiple !== 'boolean') { + const err93 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/allow_multiple', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err93]; + } else { + vErrors.push(err93); + } + errors++; + } + } + } + var _valid5 = _errs129 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'select') { + const _errs132 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.options === undefined) { + const err94 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", + }; + if (vErrors === null) { + vErrors = [err94]; + } else { + vErrors.push(err94); + } + errors++; + } + if (data48.multiple !== undefined) { + if (typeof data48.multiple !== 'boolean') { + const err95 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/multiple', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err95]; + } else { + vErrors.push(err95); + } + errors++; + } + } + if (data48.min !== undefined) { + let data56 = data48.min; + if ( + !( + typeof data56 == 'number' && + !(data56 % 1) && + !isNaN(data56) + ) + ) { + const err96 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/min', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err96]; + } else { + vErrors.push(err96); + } + errors++; + } + } + if (data48.max !== undefined) { + let data57 = data48.max; + if ( + !( + typeof data57 == 'number' && + !(data57 % 1) && + !isNaN(data57) + ) + ) { + const err97 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/max', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err97]; + } else { + vErrors.push(err97); + } + errors++; + } + } + if (data48.options !== undefined) { + let data58 = data48.options; + if (Array.isArray(data58)) { + const len5 = data58.length; + for (let i6 = 0; i6 < len5; i6++) { + let data59 = data58[i6]; + const _errs142 = errors; + let valid35 = false; + let passing2 = null; + const _errs143 = errors; + if (typeof data59 !== 'string') { + const err98 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err98]; + } else { + vErrors.push(err98); + } + errors++; + } + var _valid6 = _errs143 === errors; + if (_valid6) { + valid35 = true; + passing2 = 0; + } + const _errs145 = errors; + if (!(typeof data59 == 'number')) { + const err99 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err99]; + } else { + vErrors.push(err99); + } + errors++; + } + var _valid6 = _errs145 === errors; + if (_valid6 && valid35) { + valid35 = false; + passing2 = [passing2, 1]; + } else { + if (_valid6) { + valid35 = true; + passing2 = 1; + } + const _errs147 = errors; + if ( + data59 && + typeof data59 == 'object' && + !Array.isArray(data59) + ) { + if (data59.label === undefined) { + const err100 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: + "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err100]; + } else { + vErrors.push(err100); + } + errors++; + } + if (data59.value === undefined) { + const err101 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: + "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err101]; + } else { + vErrors.push(err101); + } + errors++; + } + if (data59.label !== undefined) { + if (typeof data59.label !== 'string') { + const err102 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6 + + '/label', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err102]; + } else { + vErrors.push(err102); + } + errors++; + } + } + if (data59.value !== undefined) { + let data61 = data59.value; + const _errs152 = errors; + let valid37 = false; + let passing3 = null; + const _errs153 = errors; + if (typeof data61 !== 'string') { + const err103 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6 + + '/value', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err103]; + } else { + vErrors.push(err103); + } + errors++; + } + var _valid7 = _errs153 === errors; + if (_valid7) { + valid37 = true; + passing3 = 0; + } + const _errs155 = errors; + if (!(typeof data61 == 'number')) { + const err104 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6 + + '/value', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err104]; + } else { + vErrors.push(err104); + } + errors++; + } + var _valid7 = _errs155 === errors; + if (_valid7 && valid37) { + valid37 = false; + passing3 = [passing3, 1]; + } else { + if (_valid7) { + valid37 = true; + passing3 = 1; + } + } + if (!valid37) { + const err105 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6 + + '/value', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/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 = _errs152; + if (vErrors !== null) { + if (_errs152) { + vErrors.length = _errs152; + } else { + vErrors = null; + } + } + } + } + } else { + const err106 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err106]; + } else { + vErrors.push(err106); + } + errors++; + } + var _valid6 = _errs147 === errors; + if (_valid6 && valid35) { + valid35 = false; + passing2 = [passing2, 2]; + } else { + if (_valid6) { + valid35 = true; + passing2 = 2; + } + } + } + if (!valid35) { + const err107 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options/' + + i6, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing2 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err107]; + } else { + vErrors.push(err107); + } + errors++; + } else { + errors = _errs142; + if (vErrors !== null) { + if (_errs142) { + vErrors.length = _errs142; + } else { + vErrors = null; + } + } + } + } + } else { + const err108 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err108]; + } else { + vErrors.push(err108); + } + errors++; + } + } + } + var _valid5 = _errs132 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'markdown') { + const _errs157 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.minimal !== undefined) { + if (typeof data48.minimal !== 'boolean') { + const err109 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/minimal', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err109]; + } else { + vErrors.push(err109); + } + errors++; + } + } + if (data48.buttons !== undefined) { + let data63 = data48.buttons; + if (Array.isArray(data63)) { + const len6 = data63.length; + for (let i7 = 0; i7 < len6; i7++) { + let data64 = data63[i7]; + if (typeof data64 !== 'string') { + const err110 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/buttons/' + + i7, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/buttons/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err110]; + } else { + vErrors.push(err110); + } + errors++; + } + if ( + !( + data64 === 'bold' || + data64 === 'italic' || + data64 === 'code' || + data64 === 'link' || + data64 === 'heading-one' || + data64 === 'heading-two' || + data64 === 'heading-three' || + data64 === 'heading-four' || + data64 === 'heading-five' || + data64 === 'heading-six' || + data64 === 'quote' || + data64 === 'bulleted-list' || + data64 === 'numbered-list' + ) + ) { + const err111 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/buttons/' + + i7, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties + .files.items.properties.fields.items.selectCases + .markdown.properties.buttons.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err111]; + } else { + vErrors.push(err111); + } + errors++; + } + } + } else { + const err112 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/buttons', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err112]; + } else { + vErrors.push(err112); + } + errors++; + } + } + if (data48.editor_components !== undefined) { + let data65 = data48.editor_components; + if (Array.isArray(data65)) { + const len7 = data65.length; + for (let i8 = 0; i8 < len7; i8++) { + if (typeof data65[i8] !== 'string') { + const err113 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/editor_components/' + + i8, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err113]; + } else { + vErrors.push(err113); + } + errors++; + } + } + } else { + const err114 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/editor_components', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err114]; + } else { + vErrors.push(err114); + } + errors++; + } + } + if (data48.modes !== undefined) { + let data67 = data48.modes; + if (Array.isArray(data67)) { + if (data67.length < 1) { + const err115 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/modes', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err115]; + } else { + vErrors.push(err115); + } + errors++; + } + const len8 = data67.length; + for (let i9 = 0; i9 < len8; i9++) { + let data68 = data67[i9]; + if (typeof data68 !== 'string') { + const err116 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/modes/' + + i9, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err116]; + } else { + vErrors.push(err116); + } + errors++; + } + if (!(data68 === 'raw' || data68 === 'rich_text')) { + const err117 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/modes/' + + i9, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties + .files.items.properties.fields.items.selectCases + .markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err117]; + } else { + vErrors.push(err117); + } + errors++; + } + } + } else { + const err118 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/modes', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err118]; + } else { + vErrors.push(err118); + } + errors++; + } + } + } + var _valid5 = _errs157 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'list') { + const _errs172 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.allow_add !== undefined) { + if (typeof data48.allow_add !== 'boolean') { + const err119 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/allow_add', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err119]; + } else { + vErrors.push(err119); + } + errors++; + } + } + if (data48.collapsed !== undefined) { + if (typeof data48.collapsed !== 'boolean') { + const err120 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/collapsed', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err120]; + } else { + vErrors.push(err120); + } + errors++; + } + } + if (data48.summary !== undefined) { + if (typeof data48.summary !== 'string') { + const err121 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/summary', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err121]; + } else { + vErrors.push(err121); + } + errors++; + } + } + if (data48.minimize_collapsed !== undefined) { + if (typeof data48.minimize_collapsed !== 'boolean') { + const err122 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/minimize_collapsed', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err122]; + } else { + vErrors.push(err122); + } + errors++; + } + } + if (data48.label_singular !== undefined) { + if (typeof data48.label_singular !== 'string') { + const err123 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/label_singular', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err123]; + } else { + vErrors.push(err123); + } + errors++; + } + } + if (data48.i18n !== undefined) { + if (typeof data48.i18n !== 'boolean') { + const err124 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err124]; + } else { + vErrors.push(err124); + } + errors++; + } + } + if (data48.min !== undefined) { + if (!(typeof data48.min == 'number')) { + const err125 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/min', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err125]; + } else { + vErrors.push(err125); + } + errors++; + } + } + if (data48.max !== undefined) { + if (!(typeof data48.max == 'number')) { + const err126 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/max', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err126]; + } else { + vErrors.push(err126); + } + errors++; + } + } + } + var _valid5 = _errs172 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'object') { + const _errs189 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.collapsed !== undefined) { + if (typeof data48.collapsed !== 'boolean') { + const err127 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/collapsed', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err127]; + } else { + vErrors.push(err127); + } + errors++; + } + } + if (data48.i18n !== undefined) { + if (typeof data48.i18n !== 'boolean') { + const err128 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/object/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err128]; + } else { + vErrors.push(err128); + } + errors++; + } + } + } + var _valid5 = _errs189 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'relation') { + const _errs194 = errors; + const _errs195 = errors; + let valid47 = false; + let passing4 = null; + const _errs196 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.collection === undefined) { + const err129 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err129]; + } else { + vErrors.push(err129); + } + errors++; + } + if (data48.value_field === undefined) { + const err130 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: + "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err130]; + } else { + vErrors.push(err130); + } + errors++; + } + if (data48.search_fields === undefined) { + const err131 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: + "must have required property '" + 'search_fields' + "'", + }; + if (vErrors === null) { + vErrors = [err131]; + } else { + vErrors.push(err131); + } + errors++; + } + } + var _valid8 = _errs196 === errors; + if (_valid8) { + valid47 = true; + passing4 = 0; + } + const _errs197 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.collection === undefined) { + const err132 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err132]; + } else { + vErrors.push(err132); + } + errors++; + } + if (data48.valueField === undefined) { + const err133 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err133]; + } else { + vErrors.push(err133); + } + errors++; + } + if (data48.searchFields === undefined) { + const err134 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: + "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err134]; + } else { + vErrors.push(err134); + } + errors++; + } + } + var _valid8 = _errs197 === errors; + if (_valid8 && valid47) { + valid47 = false; + passing4 = [passing4, 1]; + } else { + if (_valid8) { + valid47 = true; + passing4 = 1; + } + } + if (!valid47) { + const err135 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing4 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err135]; + } else { + vErrors.push(err135); + } + errors++; + } else { + errors = _errs195; + if (vErrors !== null) { + if (_errs195) { + vErrors.length = _errs195; + } else { + vErrors = null; + } + } + } + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.collection !== undefined) { + if (typeof data48.collection !== 'string') { + const err136 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/collection', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err136]; + } else { + vErrors.push(err136); + } + errors++; + } + } + if (data48.value_field !== undefined) { + if (typeof data48.value_field !== 'string') { + const err137 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/value_field', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err137]; + } else { + vErrors.push(err137); + } + errors++; + } + } + if (data48.search_fields !== undefined) { + let data81 = data48.search_fields; + if (Array.isArray(data81)) { + if (data81.length < 1) { + const err138 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/search_fields', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err138]; + } else { + vErrors.push(err138); + } + errors++; + } + const len9 = data81.length; + for (let i10 = 0; i10 < len9; i10++) { + if (typeof data81[i10] !== 'string') { + const err139 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/search_fields/' + + i10, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err139]; + } else { + vErrors.push(err139); + } + errors++; + } + } + } else { + const err140 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/search_fields', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err140]; + } else { + vErrors.push(err140); + } + errors++; + } + } + if (data48.file !== undefined) { + if (typeof data48.file !== 'string') { + const err141 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/file', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err141]; + } else { + vErrors.push(err141); + } + errors++; + } + } + if (data48.multiple !== undefined) { + if (typeof data48.multiple !== 'boolean') { + const err142 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/multiple', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err142]; + } else { + vErrors.push(err142); + } + errors++; + } + } + if (data48.min !== undefined) { + let data85 = data48.min; + if ( + !( + typeof data85 == 'number' && + !(data85 % 1) && + !isNaN(data85) + ) + ) { + const err143 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/min', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err143]; + } else { + vErrors.push(err143); + } + errors++; + } + } + if (data48.max !== undefined) { + let data86 = data48.max; + if ( + !( + typeof data86 == 'number' && + !(data86 % 1) && + !isNaN(data86) + ) + ) { + const err144 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/max', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err144]; + } else { + vErrors.push(err144); + } + errors++; + } + } + if (data48.display_fields !== undefined) { + let data87 = data48.display_fields; + if (Array.isArray(data87)) { + if (data87.length < 1) { + const err145 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/display_fields', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err145]; + } else { + vErrors.push(err145); + } + errors++; + } + const len10 = data87.length; + for (let i11 = 0; i11 < len10; i11++) { + if (typeof data87[i11] !== 'string') { + const err146 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/display_fields/' + + i11, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err146]; + } else { + vErrors.push(err146); + } + errors++; + } + } + } else { + const err147 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/display_fields', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err147]; + } else { + vErrors.push(err147); + } + errors++; + } + } + if (data48.options_length !== undefined) { + let data89 = data48.options_length; + if ( + !( + typeof data89 == 'number' && + !(data89 % 1) && + !isNaN(data89) + ) + ) { + const err148 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/options_length', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err148]; + } else { + vErrors.push(err148); + } + errors++; + } + } + } + var _valid5 = _errs194 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'boolean') { + var _valid5 = true; + valid28 = _valid5; + } else if ('' + value0 == 'map') { + const _errs220 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.decimals !== undefined) { + let data90 = data48.decimals; + if ( + !( + typeof data90 == 'number' && + !(data90 % 1) && + !isNaN(data90) + ) + ) { + const err149 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/decimals', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err149]; + } else { + vErrors.push(err149); + } + errors++; + } + } + if (data48.type !== undefined) { + let data91 = data48.type; + if (typeof data91 !== 'string') { + const err150 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/type', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/map/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err150]; + } else { + vErrors.push(err150); + } + errors++; + } + if ( + !( + data91 === 'Point' || + data91 === 'LineString' || + data91 === 'Polygon' + ) + ) { + const err151 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/type', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/map/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties.files + .items.properties.fields.items.selectCases.map + .properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err151]; + } else { + vErrors.push(err151); + } + errors++; + } + } + } + var _valid5 = _errs220 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'date') { + var _valid5 = true; + valid28 = _valid5; + } else if ('' + value0 == 'datetime') { + const _errs225 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.format !== undefined) { + if (typeof data48.format !== 'string') { + const err152 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err152]; + } else { + vErrors.push(err152); + } + errors++; + } + } + if (data48.date_format !== undefined) { + let data93 = data48.date_format; + const _errs229 = errors; + let valid55 = false; + let passing5 = null; + const _errs230 = errors; + if (typeof data93 !== 'string') { + const err153 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err153]; + } else { + vErrors.push(err153); + } + errors++; + } + var _valid9 = _errs230 === errors; + if (_valid9) { + valid55 = true; + passing5 = 0; + } + const _errs232 = errors; + if (typeof data93 !== 'boolean') { + const err154 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err154]; + } else { + vErrors.push(err154); + } + errors++; + } + var _valid9 = _errs232 === errors; + if (_valid9 && valid55) { + valid55 = false; + passing5 = [passing5, 1]; + } else { + if (_valid9) { + valid55 = true; + passing5 = 1; + } + } + if (!valid55) { + const err155 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing5 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err155]; + } else { + vErrors.push(err155); + } + errors++; + } else { + errors = _errs229; + if (vErrors !== null) { + if (_errs229) { + vErrors.length = _errs229; + } else { + vErrors = null; + } + } + } + } + if (data48.time_format !== undefined) { + let data94 = data48.time_format; + const _errs235 = errors; + let valid56 = false; + let passing6 = null; + const _errs236 = errors; + if (typeof data94 !== 'string') { + const err156 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err156]; + } else { + vErrors.push(err156); + } + errors++; + } + var _valid10 = _errs236 === errors; + if (_valid10) { + valid56 = true; + passing6 = 0; + } + const _errs238 = errors; + if (typeof data94 !== 'boolean') { + const err157 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err157]; + } else { + vErrors.push(err157); + } + errors++; + } + var _valid10 = _errs238 === errors; + if (_valid10 && valid56) { + valid56 = false; + passing6 = [passing6, 1]; + } else { + if (_valid10) { + valid56 = true; + passing6 = 1; + } + } + if (!valid56) { + const err158 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing6 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err158]; + } else { + vErrors.push(err158); + } + errors++; + } else { + errors = _errs235; + if (vErrors !== null) { + if (_errs235) { + vErrors.length = _errs235; + } else { + vErrors = null; + } + } + } + } + if (data48.picker_utc !== undefined) { + if (typeof data48.picker_utc !== 'boolean') { + const err159 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/picker_utc', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err159]; + } else { + vErrors.push(err159); + } + errors++; + } + } + } + var _valid5 = _errs225 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'code') { + const _errs242 = errors; + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.default_language !== undefined) { + if (typeof data48.default_language !== 'string') { + const err160 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/default_language', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err160]; + } else { + vErrors.push(err160); + } + errors++; + } + } + if (data48.allow_language_selection !== undefined) { + if (typeof data48.allow_language_selection !== 'boolean') { + const err161 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/allow_language_selection', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err161]; + } else { + vErrors.push(err161); + } + errors++; + } + } + if (data48.output_code_only !== undefined) { + if (typeof data48.output_code_only !== 'boolean') { + const err162 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/output_code_only', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err162]; + } else { + vErrors.push(err162); + } + errors++; + } + } + if (data48.keys !== undefined) { + let data99 = data48.keys; + if ( + data99 && + typeof data99 == 'object' && + !Array.isArray(data99) + ) { + if (data99.code !== undefined) { + if (typeof data99.code !== 'string') { + const err163 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/keys/code', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err163]; + } else { + vErrors.push(err163); + } + errors++; + } + } + if (data99.lang !== undefined) { + if (typeof data99.lang !== 'string') { + const err164 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/keys/lang', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err164]; + } else { + vErrors.push(err164); + } + errors++; + } + } + } else { + const err165 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/keys', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err165]; + } else { + vErrors.push(err165); + } + errors++; + } + } + } + var _valid5 = _errs242 === errors; + valid28 = _valid5; + } else if ('' + value0 == 'color') { + var _valid5 = true; + valid28 = _valid5; + } + if (!valid28) { + const err166 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', + }; + if (vErrors === null) { + vErrors = [err166]; + } else { + vErrors.push(err166); + } + errors++; + } + } + } + if (data48 && typeof data48 == 'object' && !Array.isArray(data48)) { + if (data48.name === undefined) { + const err167 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5, + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err167]; + } else { + vErrors.push(err167); + } + errors++; + } + if (data48.name !== undefined) { + if (typeof data48.name !== 'string') { + const err168 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/name', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err168]; + } else { + vErrors.push(err168); + } + errors++; + } + } + if (data48.label !== undefined) { + if (typeof data48.label !== 'string') { + const err169 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/label', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err169]; + } else { + vErrors.push(err169); + } + errors++; + } + } + if (data48.widget !== undefined) { + if (typeof data48.widget !== 'string') { + const err170 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/widget', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err170]; + } else { + vErrors.push(err170); + } + errors++; + } + } + if (data48.required !== undefined) { + if (typeof data48.required !== 'boolean') { + const err171 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/required', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err171]; + } else { + vErrors.push(err171); + } + errors++; + } + } + if (data48.i18n !== undefined) { + let data106 = data48.i18n; + const _errs265 = errors; + let valid60 = false; + let passing7 = null; + const _errs266 = errors; + if (typeof data106 !== 'boolean') { + const err172 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err172]; + } else { + vErrors.push(err172); + } + errors++; + } + var _valid11 = _errs266 === errors; + if (_valid11) { + valid60 = true; + passing7 = 0; + } + const _errs268 = errors; + if (typeof data106 !== 'string') { + const err173 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err173]; + } else { + vErrors.push(err173); + } + errors++; + } + if ( + !( + data106 === 'translate' || + data106 === 'duplicate' || + data106 === 'none' + ) + ) { + const err174 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf/1/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties.files.items + .properties.fields.items.properties.i18n.oneOf[1].enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err174]; + } else { + vErrors.push(err174); + } + errors++; + } + var _valid11 = _errs268 === errors; + if (_valid11 && valid60) { + valid60 = false; + passing7 = [passing7, 1]; + } else { + if (_valid11) { + valid60 = true; + passing7 = 1; + } + } + if (!valid60) { + const err175 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/i18n', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing7 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err175]; + } else { + vErrors.push(err175); + } + errors++; + } else { + errors = _errs265; + if (vErrors !== null) { + if (_errs265) { + vErrors.length = _errs265; + } else { + vErrors = null; + } + } + } + } + if (data48.hint !== undefined) { + if (typeof data48.hint !== 'string') { + const err176 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/hint', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err176]; + } else { + vErrors.push(err176); + } + errors++; + } + } + if (data48.pattern !== undefined) { + let data108 = data48.pattern; + if (Array.isArray(data108)) { + if (data108.length < 2) { + const err177 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/pattern', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/items/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err177]; + } else { + vErrors.push(err177); + } + errors++; + } + const len11 = data108.length; + if (len11 > 0) { + let data109 = data108[0]; + const _errs275 = errors; + let valid62 = false; + let passing8 = null; + const _errs276 = errors; + if (typeof data109 !== 'string') { + const err178 = { + 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 = [err178]; + } else { + vErrors.push(err178); + } + errors++; + } + var _valid12 = _errs276 === errors; + if (_valid12) { + valid62 = true; + passing8 = 0; + } + const _errs278 = errors; + if (typeof data109 == 'number') { + if (!(data109 instanceof RegExp)) { + const err179 = { + 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/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err179]; + } else { + vErrors.push(err179); + } + errors++; + } + } + if (typeof data109 === 'string') { + if (!(data109 instanceof RegExp)) { + const err180 = { + 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/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err180]; + } else { + vErrors.push(err180); + } + errors++; + } + } + if (Array.isArray(data109)) { + if (!(data109 instanceof RegExp)) { + const err181 = { + 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/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err181]; + } else { + vErrors.push(err181); + } + errors++; + } + } + if ( + data109 && + typeof data109 == 'object' && + !Array.isArray(data109) + ) { + if (!(data109 instanceof RegExp)) { + const err182 = { + 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/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err182]; + } else { + vErrors.push(err182); + } + errors++; + } + } + var _valid12 = _errs278 === errors; + if (_valid12 && valid62) { + valid62 = false; + passing8 = [passing8, 1]; + } else { + if (_valid12) { + valid62 = true; + passing8 = 1; + } + } + if (!valid62) { + const err183 = { + 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: passing8 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err183]; + } else { + vErrors.push(err183); + } + errors++; + } else { + errors = _errs275; + if (vErrors !== null) { + if (_errs275) { + vErrors.length = _errs275; + } else { + vErrors = null; + } + } + } + } + if (len11 > 1) { + if (typeof data108[1] !== 'string') { + const err184 = { + 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 = [err184]; + } else { + vErrors.push(err184); + } + errors++; + } + } + } else { + const err185 = { + 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 = [err185]; + } else { + vErrors.push(err185); + } + errors++; + } + } + if (data48.field !== undefined) { + if ( + !validate25(data48.field, { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/field', + parentData: data48, + parentDataProperty: 'field', + rootData, + }) + ) { + vErrors = + vErrors === null + ? validate25.errors + : vErrors.concat(validate25.errors); + errors = vErrors.length; + } + } + if (data48.fields !== undefined) { + if ( + !validate26(data48.fields, { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/fields', + parentData: data48, + parentDataProperty: 'fields', + rootData, + }) + ) { + vErrors = + vErrors === null + ? validate26.errors + : vErrors.concat(validate26.errors); + errors = vErrors.length; + } + } + if (data48.types !== undefined) { + if ( + !validate26(data48.types, { + instancePath: + instancePath + + '/collections/' + + i3 + + '/files/' + + i4 + + '/fields/' + + i5 + + '/types', + parentData: data48, + parentDataProperty: 'types', + rootData, + }) + ) { + vErrors = + vErrors === null + ? validate26.errors + : vErrors.concat(validate26.errors); + errors = vErrors.length; + } + } + } else { + const err186 = { + 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 = [err186]; + } else { + vErrors.push(err186); + } + errors++; + } + } + if ( + schema40.properties.collections.items.properties.files.items.properties.fields.uniqueItemProperties + .map(property => + data47 + .map(item => item && item[property]) + .some((value, index, array) => array.indexOf(value) !== index), + ) + .some(value => value) + ) { + const err187 = { + instancePath: + instancePath + '/collections/' + i3 + '/files/' + i4 + '/fields', + schemaPath: + '#/properties/collections/items/properties/files/items/properties/fields/uniqueItemProperties', + keyword: 'uniqueItemProperties', + params: {}, + message: 'must pass "uniqueItemProperties" keyword validation', + }; + if (vErrors === null) { + vErrors = [err187]; + } else { + vErrors.push(err187); + } + errors++; + } + } else { + const err188 = { + 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 = [err188]; + } else { + vErrors.push(err188); + } + errors++; + } + } + } else { + const err189 = { + 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 = [err189]; + } else { + vErrors.push(err189); + } + errors++; + } + } + if ( + schema40.properties.collections.items.properties.files.uniqueItemProperties + .map(property => + data38 + .map(item => item && item[property]) + .some((value, index, array) => array.indexOf(value) !== index), + ) + .some(value => value) + ) { + const err190 = { + instancePath: instancePath + '/collections/' + i3 + '/files', + schemaPath: + '#/properties/collections/items/properties/files/uniqueItemProperties', + keyword: 'uniqueItemProperties', + params: {}, + message: 'must pass "uniqueItemProperties" keyword validation', + }; + if (vErrors === null) { + vErrors = [err190]; + } else { + vErrors.push(err190); + } + errors++; + } + } else { + const err191 = { + 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 = [err191]; + } else { + vErrors.push(err191); + } + errors++; + } + } + if (data30.identifier_field !== undefined) { + if (typeof data30.identifier_field !== 'string') { + const err192 = { + 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 = [err192]; + } else { + vErrors.push(err192); + } + errors++; + } + } + if (data30.summary !== undefined) { + if (typeof data30.summary !== 'string') { + const err193 = { + 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 = [err193]; + } else { + vErrors.push(err193); + } + errors++; + } + } + if (data30.slug !== undefined) { + if (typeof data30.slug !== 'string') { + const err194 = { + 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 = [err194]; + } else { + vErrors.push(err194); + } + errors++; + } + } + if (data30.path !== undefined) { + if (typeof data30.path !== 'string') { + const err195 = { + 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 = [err195]; + } else { + vErrors.push(err195); + } + errors++; + } + } + if (data30.preview_path !== undefined) { + if (typeof data30.preview_path !== 'string') { + const err196 = { + 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 = [err196]; + } else { + vErrors.push(err196); + } + errors++; + } + } + if (data30.preview_path_date_field !== undefined) { + if (typeof data30.preview_path_date_field !== 'string') { + const err197 = { + 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 = [err197]; + } else { + vErrors.push(err197); + } + errors++; + } + } + if (data30.create !== undefined) { + if (typeof data30.create !== 'boolean') { + const err198 = { + 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 = [err198]; + } else { + vErrors.push(err198); + } + errors++; + } + } + if (data30.publish !== undefined) { + if (typeof data30.publish !== 'boolean') { + const err199 = { + 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 = [err199]; + } else { + vErrors.push(err199); + } + errors++; + } + } + if (data30.hide !== undefined) { + if (typeof data30.hide !== 'boolean') { + const err200 = { + 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 = [err200]; + } else { + vErrors.push(err200); + } + errors++; + } + } + if (data30.editor !== undefined) { + let data123 = data30.editor; + if (data123 && typeof data123 == 'object' && !Array.isArray(data123)) { + if (data123.preview !== undefined) { + if (typeof data123.preview !== 'boolean') { + const err201 = { + 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 = [err201]; + } else { + vErrors.push(err201); + } + errors++; + } + } + } else { + const err202 = { + 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 = [err202]; + } else { + vErrors.push(err202); + } + errors++; + } + } + if (data30.format !== undefined) { + let data125 = data30.format; + if (typeof data125 !== 'string') { + const err203 = { + 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 = [err203]; + } else { + vErrors.push(err203); + } + errors++; + } + if ( + !( + data125 === 'yml' || + data125 === 'yaml' || + data125 === 'toml' || + data125 === 'json' || + data125 === 'frontmatter' || + data125 === 'json-frontmatter' || + data125 === 'toml-frontmatter' || + data125 === 'yaml-frontmatter' + ) + ) { + const err204 = { + instancePath: instancePath + '/collections/' + i3 + '/format', + schemaPath: '#/properties/collections/items/properties/format/enum', + keyword: 'enum', + params: { + allowedValues: schema40.properties.collections.items.properties.format.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err204]; + } else { + vErrors.push(err204); + } + errors++; + } + } + if (data30.extension !== undefined) { + if (typeof data30.extension !== 'string') { + const err205 = { + 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 = [err205]; + } else { + vErrors.push(err205); + } + errors++; + } + } + if (data30.frontmatter_delimiter !== undefined) { + let data127 = data30.frontmatter_delimiter; + if (typeof data127 !== 'string' && !Array.isArray(data127)) { + const err206 = { + instancePath: instancePath + '/collections/' + i3 + '/frontmatter_delimiter', + schemaPath: + '#/properties/collections/items/properties/frontmatter_delimiter/type', + keyword: 'type', + params: { + type: schema40.properties.collections.items.properties.frontmatter_delimiter + .type, + }, + message: 'must be string,array', + }; + if (vErrors === null) { + vErrors = [err206]; + } else { + vErrors.push(err206); + } + errors++; + } + if (Array.isArray(data127)) { + if (data127.length > 2) { + const err207 = { + 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 = [err207]; + } else { + vErrors.push(err207); + } + errors++; + } + if (data127.length < 2) { + const err208 = { + 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 = [err208]; + } else { + vErrors.push(err208); + } + errors++; + } + const len12 = data127.length; + for (let i12 = 0; i12 < len12; i12++) { + if (typeof data127[i12] !== 'string') { + const err209 = { + instancePath: + instancePath + '/collections/' + i3 + '/frontmatter_delimiter/' + i12, + schemaPath: + '#/properties/collections/items/properties/frontmatter_delimiter/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err209]; + } else { + vErrors.push(err209); + } + errors++; + } + } + } + } + if (data30.fields !== undefined) { + let data129 = data30.fields; + if (Array.isArray(data129)) { + if (data129.length < 1) { + const err210 = { + instancePath: instancePath + '/collections/' + i3 + '/fields', + schemaPath: '#/properties/collections/items/properties/fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err210]; + } else { + vErrors.push(err210); + } + errors++; + } + const len13 = data129.length; + for (let i13 = 0; i13 < len13; i13++) { + let data130 = data129[i13]; + const vSchema12 = data130 && data130.widget; + if (!(vSchema12 === undefined)) { + if ( + typeof vSchema12 !== 'string' && + !(typeof vSchema12 == 'number') && + typeof vSchema12 !== 'boolean' && + vSchema12 !== null + ) { + const err211 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: '#/properties/collections/items/properties/fields/items/select', + keyword: 'select', + params: {}, + message: '"select" keyword must be string,number,boolean,null ($data)', + }; + if (vErrors === null) { + vErrors = [err211]; + } else { + vErrors.push(err211); + } + errors++; + } else { + let valid68 = true; + const value1 = vSchema12 === null ? 'null' : vSchema12; + if ('' + value1 == 'unknown') { + var _valid13 = true; + valid68 = _valid13; + } else if ('' + value1 == 'string') { + var _valid13 = true; + valid68 = _valid13; + } else if ('' + value1 == 'number') { + const _errs318 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.step !== undefined) { + if (!(typeof data130.step == 'number')) { + const err212 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/step', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/number/properties/step/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err212]; + } else { + vErrors.push(err212); + } + errors++; + } + } + if (data130.value_type !== undefined) { + if (typeof data130.value_type !== 'string') { + const err213 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/value_type', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/number/properties/value_type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err213]; + } else { + vErrors.push(err213); + } + errors++; + } + } + if (data130.min !== undefined) { + if (!(typeof data130.min == 'number')) { + const err214 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/number/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err214]; + } else { + vErrors.push(err214); + } + errors++; + } + } + if (data130.max !== undefined) { + if (!(typeof data130.max == 'number')) { + const err215 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/number/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err215]; + } else { + vErrors.push(err215); + } + errors++; + } + } + } + var _valid13 = _errs318 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'text') { + var _valid13 = true; + valid68 = _valid13; + } else if ('' + value1 == 'image') { + const _errs327 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.allow_multiple !== undefined) { + if (typeof data130.allow_multiple !== 'boolean') { + const err216 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/allow_multiple', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/image/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err216]; + } else { + vErrors.push(err216); + } + errors++; + } + } + } + var _valid13 = _errs327 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'file') { + const _errs330 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.allow_multiple !== undefined) { + if (typeof data130.allow_multiple !== 'boolean') { + const err217 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/allow_multiple', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/file/properties/allow_multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err217]; + } else { + vErrors.push(err217); + } + errors++; + } + } + } + var _valid13 = _errs330 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'select') { + const _errs333 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.options === undefined) { + const err218 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/required', + keyword: 'required', + params: { missingProperty: 'options' }, + message: "must have required property '" + 'options' + "'", + }; + if (vErrors === null) { + vErrors = [err218]; + } else { + vErrors.push(err218); + } + errors++; + } + if (data130.multiple !== undefined) { + if (typeof data130.multiple !== 'boolean') { + const err219 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/multiple', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err219]; + } else { + vErrors.push(err219); + } + errors++; + } + } + if (data130.min !== undefined) { + let data138 = data130.min; + if ( + !(typeof data138 == 'number' && !(data138 % 1) && !isNaN(data138)) + ) { + const err220 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err220]; + } else { + vErrors.push(err220); + } + errors++; + } + } + if (data130.max !== undefined) { + let data139 = data130.max; + if ( + !(typeof data139 == 'number' && !(data139 % 1) && !isNaN(data139)) + ) { + const err221 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err221]; + } else { + vErrors.push(err221); + } + errors++; + } + } + if (data130.options !== undefined) { + let data140 = data130.options; + if (Array.isArray(data140)) { + const len14 = data140.length; + for (let i14 = 0; i14 < len14; i14++) { + let data141 = data140[i14]; + const _errs343 = errors; + let valid75 = false; + let passing9 = null; + const _errs344 = errors; + if (typeof data141 !== 'string') { + const err222 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err222]; + } else { + vErrors.push(err222); + } + errors++; + } + var _valid14 = _errs344 === errors; + if (_valid14) { + valid75 = true; + passing9 = 0; + } + const _errs346 = errors; + if (!(typeof data141 == 'number')) { + const err223 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err223]; + } else { + vErrors.push(err223); + } + errors++; + } + var _valid14 = _errs346 === errors; + if (_valid14 && valid75) { + valid75 = false; + passing9 = [passing9, 1]; + } else { + if (_valid14) { + valid75 = true; + passing9 = 1; + } + const _errs348 = errors; + if ( + data141 && + typeof data141 == 'object' && + !Array.isArray(data141) + ) { + if (data141.label === undefined) { + const err224 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err224]; + } else { + vErrors.push(err224); + } + errors++; + } + if (data141.value === undefined) { + const err225 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/required', + keyword: 'required', + params: { missingProperty: 'value' }, + message: "must have required property '" + 'value' + "'", + }; + if (vErrors === null) { + vErrors = [err225]; + } else { + vErrors.push(err225); + } + errors++; + } + if (data141.label !== undefined) { + if (typeof data141.label !== 'string') { + const err226 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14 + + '/label', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err226]; + } else { + vErrors.push(err226); + } + errors++; + } + } + if (data141.value !== undefined) { + let data143 = data141.value; + const _errs353 = errors; + let valid77 = false; + let passing10 = null; + const _errs354 = errors; + if (typeof data143 !== 'string') { + const err227 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14 + + '/value', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err227]; + } else { + vErrors.push(err227); + } + errors++; + } + var _valid15 = _errs354 === errors; + if (_valid15) { + valid77 = true; + passing10 = 0; + } + const _errs356 = errors; + if (!(typeof data143 == 'number')) { + const err228 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14 + + '/value', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf/1/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err228]; + } else { + vErrors.push(err228); + } + errors++; + } + var _valid15 = _errs356 === errors; + if (_valid15 && valid77) { + valid77 = false; + passing10 = [passing10, 1]; + } else { + if (_valid15) { + valid77 = true; + passing10 = 1; + } + } + if (!valid77) { + const err229 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14 + + '/value', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/properties/value/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing10 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err229]; + } else { + vErrors.push(err229); + } + errors++; + } else { + errors = _errs353; + if (vErrors !== null) { + if (_errs353) { + vErrors.length = _errs353; + } else { + vErrors = null; + } + } + } + } + } else { + const err230 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf/2/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err230]; + } else { + vErrors.push(err230); + } + errors++; + } + var _valid14 = _errs348 === errors; + if (_valid14 && valid75) { + valid75 = false; + passing9 = [passing9, 2]; + } else { + if (_valid14) { + valid75 = true; + passing9 = 2; + } + } + } + if (!valid75) { + const err231 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options/' + + i14, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/items/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing9 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err231]; + } else { + vErrors.push(err231); + } + errors++; + } else { + errors = _errs343; + if (vErrors !== null) { + if (_errs343) { + vErrors.length = _errs343; + } else { + vErrors = null; + } + } + } + } + } else { + const err232 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/select/properties/options/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err232]; + } else { + vErrors.push(err232); + } + errors++; + } + } + } + var _valid13 = _errs333 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'markdown') { + const _errs358 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.minimal !== undefined) { + if (typeof data130.minimal !== 'boolean') { + const err233 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/minimal', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/minimal/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err233]; + } else { + vErrors.push(err233); + } + errors++; + } + } + if (data130.buttons !== undefined) { + let data145 = data130.buttons; + if (Array.isArray(data145)) { + const len15 = data145.length; + for (let i15 = 0; i15 < len15; i15++) { + let data146 = data145[i15]; + if (typeof data146 !== 'string') { + const err234 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/buttons/' + + i15, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/buttons/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err234]; + } else { + vErrors.push(err234); + } + errors++; + } + if ( + !( + data146 === 'bold' || + data146 === 'italic' || + data146 === 'code' || + data146 === 'link' || + data146 === 'heading-one' || + data146 === 'heading-two' || + data146 === 'heading-three' || + data146 === 'heading-four' || + data146 === 'heading-five' || + data146 === 'heading-six' || + data146 === 'quote' || + data146 === 'bulleted-list' || + data146 === 'numbered-list' + ) + ) { + const err235 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/buttons/' + + i15, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/buttons/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties.fields + .items.selectCases.markdown.properties.buttons.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err235]; + } else { + vErrors.push(err235); + } + errors++; + } + } + } else { + const err236 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/buttons', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/buttons/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err236]; + } else { + vErrors.push(err236); + } + errors++; + } + } + if (data130.editor_components !== undefined) { + let data147 = data130.editor_components; + if (Array.isArray(data147)) { + const len16 = data147.length; + for (let i16 = 0; i16 < len16; i16++) { + if (typeof data147[i16] !== 'string') { + const err237 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/editor_components/' + + i16, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/editor_components/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err237]; + } else { + vErrors.push(err237); + } + errors++; + } + } + } else { + const err238 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/editor_components', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/editor_components/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err238]; + } else { + vErrors.push(err238); + } + errors++; + } + } + if (data130.modes !== undefined) { + let data149 = data130.modes; + if (Array.isArray(data149)) { + if (data149.length < 1) { + const err239 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/modes', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err239]; + } else { + vErrors.push(err239); + } + errors++; + } + const len17 = data149.length; + for (let i17 = 0; i17 < len17; i17++) { + let data150 = data149[i17]; + if (typeof data150 !== 'string') { + const err240 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/modes/' + + i17, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err240]; + } else { + vErrors.push(err240); + } + errors++; + } + if (!(data150 === 'raw' || data150 === 'rich_text')) { + const err241 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/modes/' + + i17, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/items/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties.fields + .items.selectCases.markdown.properties.modes.items.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err241]; + } else { + vErrors.push(err241); + } + errors++; + } + } + } else { + const err242 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/modes', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/markdown/properties/modes/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err242]; + } else { + vErrors.push(err242); + } + errors++; + } + } + } + var _valid13 = _errs358 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'list') { + const _errs373 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.allow_add !== undefined) { + if (typeof data130.allow_add !== 'boolean') { + const err243 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/allow_add', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/allow_add/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err243]; + } else { + vErrors.push(err243); + } + errors++; + } + } + if (data130.collapsed !== undefined) { + if (typeof data130.collapsed !== 'boolean') { + const err244 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/collapsed', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err244]; + } else { + vErrors.push(err244); + } + errors++; + } + } + if (data130.summary !== undefined) { + if (typeof data130.summary !== 'string') { + const err245 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/summary', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/summary/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err245]; + } else { + vErrors.push(err245); + } + errors++; + } + } + if (data130.minimize_collapsed !== undefined) { + if (typeof data130.minimize_collapsed !== 'boolean') { + const err246 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/minimize_collapsed', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/minimize_collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err246]; + } else { + vErrors.push(err246); + } + errors++; + } + } + if (data130.label_singular !== undefined) { + if (typeof data130.label_singular !== 'string') { + const err247 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/label_singular', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/label_singular/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err247]; + } else { + vErrors.push(err247); + } + errors++; + } + } + if (data130.i18n !== undefined) { + if (typeof data130.i18n !== 'boolean') { + const err248 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err248]; + } else { + vErrors.push(err248); + } + errors++; + } + } + if (data130.min !== undefined) { + if (!(typeof data130.min == 'number')) { + const err249 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/min/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err249]; + } else { + vErrors.push(err249); + } + errors++; + } + } + if (data130.max !== undefined) { + if (!(typeof data130.max == 'number')) { + const err250 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/list/properties/max/type', + keyword: 'type', + params: { type: 'number' }, + message: 'must be number', + }; + if (vErrors === null) { + vErrors = [err250]; + } else { + vErrors.push(err250); + } + errors++; + } + } + } + var _valid13 = _errs373 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'object') { + const _errs390 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.collapsed !== undefined) { + if (typeof data130.collapsed !== 'boolean') { + const err251 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/collapsed', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/object/properties/collapsed/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err251]; + } else { + vErrors.push(err251); + } + errors++; + } + } + if (data130.i18n !== undefined) { + if (typeof data130.i18n !== 'boolean') { + const err252 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/object/properties/i18n/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err252]; + } else { + vErrors.push(err252); + } + errors++; + } + } + } + var _valid13 = _errs390 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'relation') { + const _errs395 = errors; + const _errs396 = errors; + let valid87 = false; + let passing11 = null; + const _errs397 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.collection === undefined) { + const err253 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err253]; + } else { + vErrors.push(err253); + } + errors++; + } + if (data130.value_field === undefined) { + const err254 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'value_field' }, + message: "must have required property '" + 'value_field' + "'", + }; + if (vErrors === null) { + vErrors = [err254]; + } else { + vErrors.push(err254); + } + errors++; + } + if (data130.search_fields === undefined) { + const err255 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/0/required', + keyword: 'required', + params: { missingProperty: 'search_fields' }, + message: "must have required property '" + 'search_fields' + "'", + }; + if (vErrors === null) { + vErrors = [err255]; + } else { + vErrors.push(err255); + } + errors++; + } + } + var _valid16 = _errs397 === errors; + if (_valid16) { + valid87 = true; + passing11 = 0; + } + const _errs398 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.collection === undefined) { + const err256 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'collection' }, + message: "must have required property '" + 'collection' + "'", + }; + if (vErrors === null) { + vErrors = [err256]; + } else { + vErrors.push(err256); + } + errors++; + } + if (data130.valueField === undefined) { + const err257 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'valueField' }, + message: "must have required property '" + 'valueField' + "'", + }; + if (vErrors === null) { + vErrors = [err257]; + } else { + vErrors.push(err257); + } + errors++; + } + if (data130.searchFields === undefined) { + const err258 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf/1/required', + keyword: 'required', + params: { missingProperty: 'searchFields' }, + message: "must have required property '" + 'searchFields' + "'", + }; + if (vErrors === null) { + vErrors = [err258]; + } else { + vErrors.push(err258); + } + errors++; + } + } + var _valid16 = _errs398 === errors; + if (_valid16 && valid87) { + valid87 = false; + passing11 = [passing11, 1]; + } else { + if (_valid16) { + valid87 = true; + passing11 = 1; + } + } + if (!valid87) { + const err259 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing11 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err259]; + } else { + vErrors.push(err259); + } + errors++; + } else { + errors = _errs396; + if (vErrors !== null) { + if (_errs396) { + vErrors.length = _errs396; + } else { + vErrors = null; + } + } + } + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.collection !== undefined) { + if (typeof data130.collection !== 'string') { + const err260 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/collection', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/collection/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err260]; + } else { + vErrors.push(err260); + } + errors++; + } + } + if (data130.value_field !== undefined) { + if (typeof data130.value_field !== 'string') { + const err261 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/value_field', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/value_field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err261]; + } else { + vErrors.push(err261); + } + errors++; + } + } + if (data130.search_fields !== undefined) { + let data163 = data130.search_fields; + if (Array.isArray(data163)) { + if (data163.length < 1) { + const err262 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/search_fields', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/search_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err262]; + } else { + vErrors.push(err262); + } + errors++; + } + const len18 = data163.length; + for (let i18 = 0; i18 < len18; i18++) { + if (typeof data163[i18] !== 'string') { + const err263 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/search_fields/' + + i18, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/search_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err263]; + } else { + vErrors.push(err263); + } + errors++; + } + } + } else { + const err264 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/search_fields', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/search_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err264]; + } else { + vErrors.push(err264); + } + errors++; + } + } + if (data130.file !== undefined) { + if (typeof data130.file !== 'string') { + const err265 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/file', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/file/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err265]; + } else { + vErrors.push(err265); + } + errors++; + } + } + if (data130.multiple !== undefined) { + if (typeof data130.multiple !== 'boolean') { + const err266 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/multiple', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/multiple/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err266]; + } else { + vErrors.push(err266); + } + errors++; + } + } + if (data130.min !== undefined) { + let data167 = data130.min; + if ( + !(typeof data167 == 'number' && !(data167 % 1) && !isNaN(data167)) + ) { + const err267 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/min', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/min/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err267]; + } else { + vErrors.push(err267); + } + errors++; + } + } + if (data130.max !== undefined) { + let data168 = data130.max; + if ( + !(typeof data168 == 'number' && !(data168 % 1) && !isNaN(data168)) + ) { + const err268 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/max', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/max/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err268]; + } else { + vErrors.push(err268); + } + errors++; + } + } + if (data130.display_fields !== undefined) { + let data169 = data130.display_fields; + if (Array.isArray(data169)) { + if (data169.length < 1) { + const err269 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/display_fields', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/display_fields/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err269]; + } else { + vErrors.push(err269); + } + errors++; + } + const len19 = data169.length; + for (let i19 = 0; i19 < len19; i19++) { + if (typeof data169[i19] !== 'string') { + const err270 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/display_fields/' + + i19, + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/display_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err270]; + } else { + vErrors.push(err270); + } + errors++; + } + } + } else { + const err271 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/display_fields', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/display_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err271]; + } else { + vErrors.push(err271); + } + errors++; + } + } + if (data130.options_length !== undefined) { + let data171 = data130.options_length; + if ( + !(typeof data171 == 'number' && !(data171 % 1) && !isNaN(data171)) + ) { + const err272 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/options_length', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/relation/properties/options_length/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err272]; + } else { + vErrors.push(err272); + } + errors++; + } + } + } + var _valid13 = _errs395 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'boolean') { + var _valid13 = true; + valid68 = _valid13; + } else if ('' + value1 == 'map') { + const _errs421 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.decimals !== undefined) { + let data172 = data130.decimals; + if ( + !(typeof data172 == 'number' && !(data172 % 1) && !isNaN(data172)) + ) { + const err273 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/decimals', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/map/properties/decimals/type', + keyword: 'type', + params: { type: 'integer' }, + message: 'must be integer', + }; + if (vErrors === null) { + vErrors = [err273]; + } else { + vErrors.push(err273); + } + errors++; + } + } + if (data130.type !== undefined) { + let data173 = data130.type; + if (typeof data173 !== 'string') { + const err274 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/type', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/map/properties/type/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err274]; + } else { + vErrors.push(err274); + } + errors++; + } + if ( + !( + data173 === 'Point' || + data173 === 'LineString' || + data173 === 'Polygon' + ) + ) { + const err275 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/type', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/map/properties/type/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties.fields.items + .selectCases.map.properties.type.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err275]; + } else { + vErrors.push(err275); + } + errors++; + } + } + } + var _valid13 = _errs421 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'date') { + var _valid13 = true; + valid68 = _valid13; + } else if ('' + value1 == 'datetime') { + const _errs426 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.format !== undefined) { + if (typeof data130.format !== 'string') { + const err276 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/format/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err276]; + } else { + vErrors.push(err276); + } + errors++; + } + } + if (data130.date_format !== undefined) { + let data175 = data130.date_format; + const _errs430 = errors; + let valid95 = false; + let passing12 = null; + const _errs431 = errors; + if (typeof data175 !== 'string') { + const err277 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err277]; + } else { + vErrors.push(err277); + } + errors++; + } + var _valid17 = _errs431 === errors; + if (_valid17) { + valid95 = true; + passing12 = 0; + } + const _errs433 = errors; + if (typeof data175 !== 'boolean') { + const err278 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err278]; + } else { + vErrors.push(err278); + } + errors++; + } + var _valid17 = _errs433 === errors; + if (_valid17 && valid95) { + valid95 = false; + passing12 = [passing12, 1]; + } else { + if (_valid17) { + valid95 = true; + passing12 = 1; + } + } + if (!valid95) { + const err279 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/date_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/date_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing12 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err279]; + } else { + vErrors.push(err279); + } + errors++; + } else { + errors = _errs430; + if (vErrors !== null) { + if (_errs430) { + vErrors.length = _errs430; + } else { + vErrors = null; + } + } + } + } + if (data130.time_format !== undefined) { + let data176 = data130.time_format; + const _errs436 = errors; + let valid96 = false; + let passing13 = null; + const _errs437 = errors; + if (typeof data176 !== 'string') { + const err280 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/0/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err280]; + } else { + vErrors.push(err280); + } + errors++; + } + var _valid18 = _errs437 === errors; + if (_valid18) { + valid96 = true; + passing13 = 0; + } + const _errs439 = errors; + if (typeof data176 !== 'boolean') { + const err281 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf/1/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err281]; + } else { + vErrors.push(err281); + } + errors++; + } + var _valid18 = _errs439 === errors; + if (_valid18 && valid96) { + valid96 = false; + passing13 = [passing13, 1]; + } else { + if (_valid18) { + valid96 = true; + passing13 = 1; + } + } + if (!valid96) { + const err282 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/time_format', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/time_format/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing13 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err282]; + } else { + vErrors.push(err282); + } + errors++; + } else { + errors = _errs436; + if (vErrors !== null) { + if (_errs436) { + vErrors.length = _errs436; + } else { + vErrors = null; + } + } + } + } + if (data130.picker_utc !== undefined) { + if (typeof data130.picker_utc !== 'boolean') { + const err283 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/picker_utc', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/datetime/properties/picker_utc/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err283]; + } else { + vErrors.push(err283); + } + errors++; + } + } + } + var _valid13 = _errs426 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'code') { + const _errs443 = errors; + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.default_language !== undefined) { + if (typeof data130.default_language !== 'string') { + const err284 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/default_language', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/default_language/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err284]; + } else { + vErrors.push(err284); + } + errors++; + } + } + if (data130.allow_language_selection !== undefined) { + if (typeof data130.allow_language_selection !== 'boolean') { + const err285 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/allow_language_selection', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/allow_language_selection/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err285]; + } else { + vErrors.push(err285); + } + errors++; + } + } + if (data130.output_code_only !== undefined) { + if (typeof data130.output_code_only !== 'boolean') { + const err286 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/output_code_only', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/output_code_only/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err286]; + } else { + vErrors.push(err286); + } + errors++; + } + } + if (data130.keys !== undefined) { + let data181 = data130.keys; + if (data181 && typeof data181 == 'object' && !Array.isArray(data181)) { + if (data181.code !== undefined) { + if (typeof data181.code !== 'string') { + const err287 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/keys/code', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/keys/properties/code/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err287]; + } else { + vErrors.push(err287); + } + errors++; + } + } + if (data181.lang !== undefined) { + if (typeof data181.lang !== 'string') { + const err288 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/keys/lang', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/keys/properties/lang/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err288]; + } else { + vErrors.push(err288); + } + errors++; + } + } + } else { + const err289 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/keys', + schemaPath: + '#/properties/collections/items/properties/fields/items/selectCases/code/properties/keys/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err289]; + } else { + vErrors.push(err289); + } + errors++; + } + } + } + var _valid13 = _errs443 === errors; + valid68 = _valid13; + } else if ('' + value1 == 'color') { + var _valid13 = true; + valid68 = _valid13; + } + if (!valid68) { + const err290 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/select', + keyword: 'select', + params: { failingCase: 'color' }, + message: 'should match case "color" schema', + }; + if (vErrors === null) { + vErrors = [err290]; + } else { + vErrors.push(err290); + } + errors++; + } + } + } + if (data130 && typeof data130 == 'object' && !Array.isArray(data130)) { + if (data130.name === undefined) { + const err291 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: + '#/properties/collections/items/properties/fields/items/required', + keyword: 'required', + params: { missingProperty: 'name' }, + message: "must have required property '" + 'name' + "'", + }; + if (vErrors === null) { + vErrors = [err291]; + } else { + vErrors.push(err291); + } + errors++; + } + if (data130.name !== undefined) { + if (typeof data130.name !== 'string') { + const err292 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/name', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/name/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err292]; + } else { + vErrors.push(err292); + } + errors++; + } + } + if (data130.label !== undefined) { + if (typeof data130.label !== 'string') { + const err293 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/label', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err293]; + } else { + vErrors.push(err293); + } + errors++; + } + } + if (data130.widget !== undefined) { + if (typeof data130.widget !== 'string') { + const err294 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/widget', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/widget/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err294]; + } else { + vErrors.push(err294); + } + errors++; + } + } + if (data130.required !== undefined) { + if (typeof data130.required !== 'boolean') { + const err295 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/required', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/required/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err295]; + } else { + vErrors.push(err295); + } + errors++; + } + } + if (data130.i18n !== undefined) { + let data188 = data130.i18n; + const _errs466 = errors; + let valid100 = false; + let passing14 = null; + const _errs467 = errors; + if (typeof data188 !== 'boolean') { + const err296 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err296]; + } else { + vErrors.push(err296); + } + errors++; + } + var _valid19 = _errs467 === errors; + if (_valid19) { + valid100 = true; + passing14 = 0; + } + const _errs469 = errors; + if (typeof data188 !== 'string') { + const err297 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err297]; + } else { + vErrors.push(err297); + } + errors++; + } + if ( + !(data188 === 'translate' || data188 === 'duplicate' || data188 === 'none') + ) { + const err298 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf/1/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties.fields.items + .properties.i18n.oneOf[1].enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err298]; + } else { + vErrors.push(err298); + } + errors++; + } + var _valid19 = _errs469 === errors; + if (_valid19 && valid100) { + valid100 = false; + passing14 = [passing14, 1]; + } else { + if (_valid19) { + valid100 = true; + passing14 = 1; + } + } + if (!valid100) { + const err299 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/i18n', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing14 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err299]; + } else { + vErrors.push(err299); + } + errors++; + } else { + errors = _errs466; + if (vErrors !== null) { + if (_errs466) { + vErrors.length = _errs466; + } else { + vErrors = null; + } + } + } + } + if (data130.hint !== undefined) { + if (typeof data130.hint !== 'string') { + const err300 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/hint', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/hint/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err300]; + } else { + vErrors.push(err300); + } + errors++; + } + } + if (data130.pattern !== undefined) { + let data190 = data130.pattern; + if (Array.isArray(data190)) { + if (data190.length < 2) { + const err301 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/pattern', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/pattern/minItems', + keyword: 'minItems', + params: { limit: 2 }, + message: 'must NOT have fewer than 2 items', + }; + if (vErrors === null) { + vErrors = [err301]; + } else { + vErrors.push(err301); + } + errors++; + } + const len20 = data190.length; + if (len20 > 0) { + let data191 = data190[0]; + const _errs476 = errors; + let valid102 = false; + let passing15 = null; + const _errs477 = errors; + if (typeof data191 !== 'string') { + const err302 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/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 = [err302]; + } else { + vErrors.push(err302); + } + errors++; + } + var _valid20 = _errs477 === errors; + if (_valid20) { + valid102 = true; + passing15 = 0; + } + const _errs479 = errors; + if (typeof data191 == 'number') { + if (!(data191 instanceof RegExp)) { + const err303 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/pattern/0', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err303]; + } else { + vErrors.push(err303); + } + errors++; + } + } + if (typeof data191 === 'string') { + if (!(data191 instanceof RegExp)) { + const err304 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/pattern/0', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err304]; + } else { + vErrors.push(err304); + } + errors++; + } + } + if (Array.isArray(data191)) { + if (!(data191 instanceof RegExp)) { + const err305 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/pattern/0', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err305]; + } else { + vErrors.push(err305); + } + errors++; + } + } + if (data191 && typeof data191 == 'object' && !Array.isArray(data191)) { + if (!(data191 instanceof RegExp)) { + const err306 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/pattern/0', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf/1/instanceof', + keyword: 'instanceof', + params: {}, + message: 'must pass "instanceof" keyword validation', + }; + if (vErrors === null) { + vErrors = [err306]; + } else { + vErrors.push(err306); + } + errors++; + } + } + var _valid20 = _errs479 === errors; + if (_valid20 && valid102) { + valid102 = false; + passing15 = [passing15, 1]; + } else { + if (_valid20) { + valid102 = true; + passing15 = 1; + } + } + if (!valid102) { + const err307 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/pattern/0', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/pattern/items/0/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing15 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err307]; + } else { + vErrors.push(err307); + } + errors++; + } else { + errors = _errs476; + if (vErrors !== null) { + if (_errs476) { + vErrors.length = _errs476; + } else { + vErrors = null; + } + } + } + } + if (len20 > 1) { + if (typeof data190[1] !== 'string') { + const err308 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/fields/' + + i13 + + '/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 = [err308]; + } else { + vErrors.push(err308); + } + errors++; + } + } + } else { + const err309 = { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/pattern', + schemaPath: + '#/properties/collections/items/properties/fields/items/properties/pattern/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err309]; + } else { + vErrors.push(err309); + } + errors++; + } + } + if (data130.field !== undefined) { + if ( + !validate32(data130.field, { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/field', + parentData: data130, + parentDataProperty: 'field', + rootData, + }) + ) { + vErrors = + vErrors === null ? validate32.errors : vErrors.concat(validate32.errors); + errors = vErrors.length; + } + } + if (data130.fields !== undefined) { + if ( + !validate33(data130.fields, { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/fields', + parentData: data130, + parentDataProperty: 'fields', + rootData, + }) + ) { + vErrors = + vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); + errors = vErrors.length; + } + } + if (data130.types !== undefined) { + if ( + !validate33(data130.types, { + instancePath: + instancePath + '/collections/' + i3 + '/fields/' + i13 + '/types', + parentData: data130, + parentDataProperty: 'types', + rootData, + }) + ) { + vErrors = + vErrors === null ? validate33.errors : vErrors.concat(validate33.errors); + errors = vErrors.length; + } + } + } else { + const err310 = { + instancePath: instancePath + '/collections/' + i3 + '/fields/' + i13, + schemaPath: '#/properties/collections/items/properties/fields/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err310]; + } else { + vErrors.push(err310); + } + errors++; + } + } + if ( + schema40.properties.collections.items.properties.fields.uniqueItemProperties + .map(property => + data129 + .map(item => item && item[property]) + .some((value, index, array) => array.indexOf(value) !== index), + ) + .some(value => value) + ) { + const err311 = { + instancePath: instancePath + '/collections/' + i3 + '/fields', + schemaPath: + '#/properties/collections/items/properties/fields/uniqueItemProperties', + keyword: 'uniqueItemProperties', + params: {}, + message: 'must pass "uniqueItemProperties" keyword validation', + }; + if (vErrors === null) { + vErrors = [err311]; + } else { + vErrors.push(err311); + } + errors++; + } + } else { + const err312 = { + 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 = [err312]; + } else { + vErrors.push(err312); + } + errors++; + } + } + if (data30.sortable_fields !== undefined) { + let data196 = data30.sortable_fields; + if (Array.isArray(data196)) { + const len21 = data196.length; + for (let i20 = 0; i20 < len21; i20++) { + if (typeof data196[i20] !== 'string') { + const err313 = { + instancePath: instancePath + '/collections/' + i3 + '/sortable_fields/' + i20, + schemaPath: + '#/properties/collections/items/properties/sortable_fields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err313]; + } else { + vErrors.push(err313); + } + errors++; + } + } + } else { + const err314 = { + instancePath: instancePath + '/collections/' + i3 + '/sortable_fields', + schemaPath: '#/properties/collections/items/properties/sortable_fields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err314]; + } else { + vErrors.push(err314); + } + errors++; + } + } + if (data30.sortableFields !== undefined) { + let data198 = data30.sortableFields; + if (Array.isArray(data198)) { + const len22 = data198.length; + for (let i21 = 0; i21 < len22; i21++) { + if (typeof data198[i21] !== 'string') { + const err315 = { + instancePath: instancePath + '/collections/' + i3 + '/sortableFields/' + i21, + schemaPath: + '#/properties/collections/items/properties/sortableFields/items/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err315]; + } else { + vErrors.push(err315); + } + errors++; + } + } + } else { + const err316 = { + instancePath: instancePath + '/collections/' + i3 + '/sortableFields', + schemaPath: '#/properties/collections/items/properties/sortableFields/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err316]; + } else { + vErrors.push(err316); + } + errors++; + } + } + if (data30.view_filters !== undefined) { + let data200 = data30.view_filters; + if (Array.isArray(data200)) { + if (data200.length < 1) { + const err317 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters', + schemaPath: '#/properties/collections/items/properties/view_filters/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err317]; + } else { + vErrors.push(err317); + } + errors++; + } + const len23 = data200.length; + for (let i22 = 0; i22 < len23; i22++) { + let data201 = data200[i22]; + if (data201 && typeof data201 == 'object' && !Array.isArray(data201)) { + if (data201.label === undefined) { + const err318 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, + schemaPath: + '#/properties/collections/items/properties/view_filters/items/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err318]; + } else { + vErrors.push(err318); + } + errors++; + } + if (data201.field === undefined) { + const err319 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, + schemaPath: + '#/properties/collections/items/properties/view_filters/items/required', + keyword: 'required', + params: { missingProperty: 'field' }, + message: "must have required property '" + 'field' + "'", + }; + if (vErrors === null) { + vErrors = [err319]; + } else { + vErrors.push(err319); + } + errors++; + } + if (data201.pattern === undefined) { + const err320 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, + schemaPath: + '#/properties/collections/items/properties/view_filters/items/required', + keyword: 'required', + params: { missingProperty: 'pattern' }, + message: "must have required property '" + 'pattern' + "'", + }; + if (vErrors === null) { + vErrors = [err320]; + } else { + vErrors.push(err320); + } + errors++; + } + for (const key1 in data201) { + if (!(key1 === 'label' || key1 === 'field' || key1 === 'pattern')) { + const err321 = { + instancePath: + instancePath + '/collections/' + i3 + '/view_filters/' + i22, + schemaPath: + '#/properties/collections/items/properties/view_filters/items/additionalProperties', + keyword: 'additionalProperties', + params: { additionalProperty: key1 }, + message: 'must NOT have additional properties', + }; + if (vErrors === null) { + vErrors = [err321]; + } else { + vErrors.push(err321); + } + errors++; + } + } + if (data201.label !== undefined) { + if (typeof data201.label !== 'string') { + const err322 = { + instancePath: + instancePath + '/collections/' + i3 + '/view_filters/' + i22 + '/label', + schemaPath: + '#/properties/collections/items/properties/view_filters/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err322]; + } else { + vErrors.push(err322); + } + errors++; + } + } + if (data201.field !== undefined) { + if (typeof data201.field !== 'string') { + const err323 = { + instancePath: + instancePath + '/collections/' + i3 + '/view_filters/' + i22 + '/field', + schemaPath: + '#/properties/collections/items/properties/view_filters/items/properties/field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err323]; + } else { + vErrors.push(err323); + } + errors++; + } + } + if (data201.pattern !== undefined) { + let data204 = data201.pattern; + const _errs503 = errors; + let valid110 = false; + let passing16 = null; + const _errs504 = errors; + if (typeof data204 !== 'boolean') { + const err324 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/view_filters/' + + i22 + + '/pattern', + schemaPath: + '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/0/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err324]; + } else { + vErrors.push(err324); + } + errors++; + } + var _valid21 = _errs504 === errors; + if (_valid21) { + valid110 = true; + passing16 = 0; + } + const _errs506 = errors; + if (typeof data204 !== 'string') { + const err325 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/view_filters/' + + i22 + + '/pattern', + schemaPath: + '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf/1/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err325]; + } else { + vErrors.push(err325); + } + errors++; + } + var _valid21 = _errs506 === errors; + if (_valid21 && valid110) { + valid110 = false; + passing16 = [passing16, 1]; + } else { + if (_valid21) { + valid110 = true; + passing16 = 1; + } + } + if (!valid110) { + const err326 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/view_filters/' + + i22 + + '/pattern', + schemaPath: + '#/properties/collections/items/properties/view_filters/items/properties/pattern/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing16 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err326]; + } else { + vErrors.push(err326); + } + errors++; + } else { + errors = _errs503; + if (vErrors !== null) { + if (_errs503) { + vErrors.length = _errs503; + } else { + vErrors = null; + } + } + } + } + } else { + const err327 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters/' + i22, + schemaPath: + '#/properties/collections/items/properties/view_filters/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err327]; + } else { + vErrors.push(err327); + } + errors++; + } + } + } else { + const err328 = { + instancePath: instancePath + '/collections/' + i3 + '/view_filters', + schemaPath: '#/properties/collections/items/properties/view_filters/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err328]; + } else { + vErrors.push(err328); + } + errors++; + } + } + if (data30.view_groups !== undefined) { + let data205 = data30.view_groups; + if (Array.isArray(data205)) { + if (data205.length < 1) { + const err329 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups', + schemaPath: '#/properties/collections/items/properties/view_groups/minItems', + keyword: 'minItems', + params: { limit: 1 }, + message: 'must NOT have fewer than 1 items', + }; + if (vErrors === null) { + vErrors = [err329]; + } else { + vErrors.push(err329); + } + errors++; + } + const len24 = data205.length; + for (let i23 = 0; i23 < len24; i23++) { + let data206 = data205[i23]; + if (data206 && typeof data206 == 'object' && !Array.isArray(data206)) { + if (data206.label === undefined) { + const err330 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, + schemaPath: + '#/properties/collections/items/properties/view_groups/items/required', + keyword: 'required', + params: { missingProperty: 'label' }, + message: "must have required property '" + 'label' + "'", + }; + if (vErrors === null) { + vErrors = [err330]; + } else { + vErrors.push(err330); + } + errors++; + } + if (data206.field === undefined) { + const err331 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, + schemaPath: + '#/properties/collections/items/properties/view_groups/items/required', + keyword: 'required', + params: { missingProperty: 'field' }, + message: "must have required property '" + 'field' + "'", + }; + if (vErrors === null) { + vErrors = [err331]; + } else { + vErrors.push(err331); + } + errors++; + } + for (const key2 in data206) { + if (!(key2 === 'label' || key2 === 'field' || key2 === 'pattern')) { + const err332 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, + schemaPath: + '#/properties/collections/items/properties/view_groups/items/additionalProperties', + keyword: 'additionalProperties', + params: { additionalProperty: key2 }, + message: 'must NOT have additional properties', + }; + if (vErrors === null) { + vErrors = [err332]; + } else { + vErrors.push(err332); + } + errors++; + } + } + if (data206.label !== undefined) { + if (typeof data206.label !== 'string') { + const err333 = { + instancePath: + instancePath + '/collections/' + i3 + '/view_groups/' + i23 + '/label', + schemaPath: + '#/properties/collections/items/properties/view_groups/items/properties/label/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err333]; + } else { + vErrors.push(err333); + } + errors++; + } + } + if (data206.field !== undefined) { + if (typeof data206.field !== 'string') { + const err334 = { + instancePath: + instancePath + '/collections/' + i3 + '/view_groups/' + i23 + '/field', + schemaPath: + '#/properties/collections/items/properties/view_groups/items/properties/field/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err334]; + } else { + vErrors.push(err334); + } + errors++; + } + } + if (data206.pattern !== undefined) { + if (typeof data206.pattern !== 'string') { + const err335 = { + instancePath: + instancePath + + '/collections/' + + i3 + + '/view_groups/' + + i23 + + '/pattern', + schemaPath: + '#/properties/collections/items/properties/view_groups/items/properties/pattern/type', + keyword: 'type', + params: { type: 'string' }, + message: 'must be string', + }; + if (vErrors === null) { + vErrors = [err335]; + } else { + vErrors.push(err335); + } + errors++; + } + } + } else { + const err336 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups/' + i23, + schemaPath: + '#/properties/collections/items/properties/view_groups/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err336]; + } else { + vErrors.push(err336); + } + errors++; + } + } + } else { + const err337 = { + instancePath: instancePath + '/collections/' + i3 + '/view_groups', + schemaPath: '#/properties/collections/items/properties/view_groups/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err337]; + } else { + vErrors.push(err337); + } + errors++; + } + } + if (data30.nested !== undefined) { + let data210 = data30.nested; + if (data210 && typeof data210 == 'object' && !Array.isArray(data210)) { + if (data210.depth === undefined) { + const err338 = { + instancePath: instancePath + '/collections/' + i3 + '/nested', + schemaPath: '#/properties/collections/items/properties/nested/required', + keyword: 'required', + params: { missingProperty: 'depth' }, + message: "must have required property '" + 'depth' + "'", + }; + if (vErrors === null) { + vErrors = [err338]; + } else { + vErrors.push(err338); + } + errors++; + } + if (data210.depth !== undefined) { + let data211 = data210.depth; + if (typeof data211 == 'number') { + if (data211 > 1000 || isNaN(data211)) { + const err339 = { + 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 = [err339]; + } else { + vErrors.push(err339); + } + errors++; + } + if (data211 < 1 || isNaN(data211)) { + const err340 = { + 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 = [err340]; + } else { + vErrors.push(err340); + } + errors++; + } + } else { + const err341 = { + 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 = [err341]; + } else { + vErrors.push(err341); + } + errors++; + } + } + if (data210.summary !== undefined) { + if (typeof data210.summary !== 'string') { + const err342 = { + 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 = [err342]; + } else { + vErrors.push(err342); + } + errors++; + } + } + } else { + const err343 = { + 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 = [err343]; + } else { + vErrors.push(err343); + } + errors++; + } + } + if (data30.meta !== undefined) { + let data213 = data30.meta; + if (data213 && typeof data213 == 'object' && !Array.isArray(data213)) { + if (Object.keys(data213).length < 1) { + const err344 = { + 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 = [err344]; + } else { + vErrors.push(err344); + } + errors++; + } + for (const key3 in data213) { + if (!(key3 === 'path')) { + const err345 = { + 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 = [err345]; + } else { + vErrors.push(err345); + } + errors++; + } + } + if (data213.path !== undefined) { + let data214 = data213.path; + if (data214 && typeof data214 == 'object' && !Array.isArray(data214)) { + if (data214.label === undefined) { + const err346 = { + 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 = [err346]; + } else { + vErrors.push(err346); + } + errors++; + } + if (data214.widget === undefined) { + const err347 = { + 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 = [err347]; + } else { + vErrors.push(err347); + } + errors++; + } + if (data214.index_file === undefined) { + const err348 = { + 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 = [err348]; + } else { + vErrors.push(err348); + } + errors++; + } + if (data214.label !== undefined) { + if (typeof data214.label !== 'string') { + const err349 = { + 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 = [err349]; + } else { + vErrors.push(err349); + } + errors++; + } + } + if (data214.widget !== undefined) { + if (typeof data214.widget !== 'string') { + const err350 = { + 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 = [err350]; + } else { + vErrors.push(err350); + } + errors++; + } + } + if (data214.index_file !== undefined) { + if (typeof data214.index_file !== 'string') { + const err351 = { + 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 = [err351]; + } else { + vErrors.push(err351); + } + errors++; + } + } + } else { + const err352 = { + 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 = [err352]; + } else { + vErrors.push(err352); + } + errors++; + } + } + } else { + const err353 = { + 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 = [err353]; + } else { + vErrors.push(err353); + } + errors++; + } + } + if (data30.i18n !== undefined) { + let data218 = data30.i18n; + const _errs537 = errors; + let valid117 = false; + let passing17 = null; + const _errs538 = errors; + if (typeof data218 !== 'boolean') { + const err354 = { + 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 = [err354]; + } else { + vErrors.push(err354); + } + errors++; + } + var _valid22 = _errs538 === errors; + if (_valid22) { + valid117 = true; + passing17 = 0; + } + const _errs540 = errors; + if (data218 && typeof data218 == 'object' && !Array.isArray(data218)) { + if (data218.structure !== undefined) { + let data219 = data218.structure; + if (typeof data219 !== 'string') { + const err355 = { + 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 = [err355]; + } else { + vErrors.push(err355); + } + errors++; + } + if ( + !( + data219 === 'multiple_folders' || + data219 === 'multiple_files' || + data219 === 'single_file' + ) + ) { + const err356 = { + instancePath: instancePath + '/collections/' + i3 + '/i18n/structure', + schemaPath: + '#/properties/collections/items/properties/i18n/oneOf/1/properties/structure/enum', + keyword: 'enum', + params: { + allowedValues: + schema40.properties.collections.items.properties.i18n.oneOf[1].properties + .structure.enum, + }, + message: 'must be equal to one of the allowed values', + }; + if (vErrors === null) { + vErrors = [err356]; + } else { + vErrors.push(err356); + } + errors++; + } + } + if (data218.locales !== undefined) { + let data220 = data218.locales; + if (Array.isArray(data220)) { + if (data220.length < 2) { + const err357 = { + 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 = [err357]; + } else { + vErrors.push(err357); + } + errors++; + } + const len25 = data220.length; + for (let i24 = 0; i24 < len25; i24++) { + let data221 = data220[i24]; + if (typeof data221 === 'string') { + if (func9(data221) > 10) { + const err358 = { + instancePath: + instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, + 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 = [err358]; + } else { + vErrors.push(err358); + } + errors++; + } + if (func9(data221) < 2) { + const err359 = { + instancePath: + instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, + 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 = [err359]; + } else { + vErrors.push(err359); + } + errors++; + } + if (!pattern0.test(data221)) { + const err360 = { + instancePath: + instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, + 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 = [err360]; + } else { + vErrors.push(err360); + } + errors++; + } + } else { + const err361 = { + instancePath: + instancePath + '/collections/' + i3 + '/i18n/locales/' + i24, + 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 = [err361]; + } else { + vErrors.push(err361); + } + errors++; + } + } + let i25 = data220.length; + let j1; + if (i25 > 1) { + const indices1 = {}; + for (; i25--; ) { + let item1 = data220[i25]; + if (typeof item1 !== 'string') { + continue; + } + if (typeof indices1[item1] == 'number') { + j1 = indices1[item1]; + const err362 = { + instancePath: instancePath + '/collections/' + i3 + '/i18n/locales', + schemaPath: + '#/properties/collections/items/properties/i18n/oneOf/1/properties/locales/uniqueItems', + keyword: 'uniqueItems', + params: { i: i25, j: j1 }, + message: + 'must NOT have duplicate items (items ## ' + + j1 + + ' and ' + + i25 + + ' are identical)', + }; + if (vErrors === null) { + vErrors = [err362]; + } else { + vErrors.push(err362); + } + errors++; + break; + } + indices1[item1] = i25; + } + } + } else { + const err363 = { + 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 = [err363]; + } else { + vErrors.push(err363); + } + errors++; + } + } + if (data218.default_locale !== undefined) { + let data222 = data218.default_locale; + if (typeof data222 === 'string') { + if (func9(data222) > 10) { + const err364 = { + 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 = [err364]; + } else { + vErrors.push(err364); + } + errors++; + } + if (func9(data222) < 2) { + const err365 = { + 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 = [err365]; + } else { + vErrors.push(err365); + } + errors++; + } + if (!pattern0.test(data222)) { + const err366 = { + 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 = [err366]; + } else { + vErrors.push(err366); + } + errors++; + } + } else { + const err367 = { + 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 = [err367]; + } else { + vErrors.push(err367); + } + errors++; + } + } + } else { + const err368 = { + 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 = [err368]; + } else { + vErrors.push(err368); + } + errors++; + } + var _valid22 = _errs540 === errors; + if (_valid22 && valid117) { + valid117 = false; + passing17 = [passing17, 1]; + } else { + if (_valid22) { + valid117 = true; + passing17 = 1; + } + } + if (!valid117) { + const err369 = { + instancePath: instancePath + '/collections/' + i3 + '/i18n', + schemaPath: '#/properties/collections/items/properties/i18n/oneOf', + keyword: 'oneOf', + params: { passingSchemas: passing17 }, + message: 'must match exactly one schema in oneOf', + }; + if (vErrors === null) { + vErrors = [err369]; + } else { + vErrors.push(err369); + } + errors++; + } else { + errors = _errs537; + if (vErrors !== null) { + if (_errs537) { + vErrors.length = _errs537; + } else { + vErrors = null; + } + } + } + } + } else { + const err370 = { + instancePath: instancePath + '/collections/' + i3, + schemaPath: '#/properties/collections/items/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err370]; + } else { + vErrors.push(err370); + } + errors++; + } + } + if ( + schema40.properties.collections.uniqueItemProperties + .map(property => + data29 + .map(item => item && item[property]) + .some((value, index, array) => array.indexOf(value) !== index), + ) + .some(value => value) + ) { + const err371 = { + instancePath: instancePath + '/collections', + schemaPath: '#/properties/collections/uniqueItemProperties', + keyword: 'uniqueItemProperties', + params: {}, + message: 'must pass "uniqueItemProperties" keyword validation', + }; + if (vErrors === null) { + vErrors = [err371]; + } else { + vErrors.push(err371); + } + errors++; + } + } else { + const err372 = { + instancePath: instancePath + '/collections', + schemaPath: '#/properties/collections/type', + keyword: 'type', + params: { type: 'array' }, + message: 'must be array', + }; + if (vErrors === null) { + vErrors = [err372]; + } else { + vErrors.push(err372); + } + errors++; + } + } + if (data.editor !== undefined) { + let data223 = data.editor; + if (data223 && typeof data223 == 'object' && !Array.isArray(data223)) { + if (data223.preview !== undefined) { + if (typeof data223.preview !== 'boolean') { + const err373 = { + instancePath: instancePath + '/editor/preview', + schemaPath: '#/properties/editor/properties/preview/type', + keyword: 'type', + params: { type: 'boolean' }, + message: 'must be boolean', + }; + if (vErrors === null) { + vErrors = [err373]; + } else { + vErrors.push(err373); + } + errors++; + } + } + } else { + const err374 = { + instancePath: instancePath + '/editor', + schemaPath: '#/properties/editor/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err374]; + } else { + vErrors.push(err374); + } + errors++; + } + } + } else { + const err375 = { + instancePath, + schemaPath: '#/type', + keyword: 'type', + params: { type: 'object' }, + message: 'must be object', + }; + if (vErrors === null) { + vErrors = [err375]; + } else { + vErrors.push(err375); + } + errors++; + } + validate24.errors = vErrors; + return errors === 0; +} diff --git a/packages/netlify-cms-core/validation-rules/instanceof.js b/packages/netlify-cms-core/validation-rules/instanceof.js index f02a51a38df3..910d2fca5c45 100644 --- a/packages/netlify-cms-core/validation-rules/instanceof.js +++ b/packages/netlify-cms-core/validation-rules/instanceof.js @@ -5,19 +5,19 @@ module.exports = function addInstanceOfKeyword(ajv) { keyword: 'instanceof', schemaType: 'string', type: ['string', 'number', 'array', 'object'], - compile(schema) { - return data => - data instanceof - ({ - Object, - Array, - Function, - Number, - String, - Date, - RegExp, - })[schema]; - }, + // compile(schema) { + // return data => + // data instanceof + // ({ + // Object, + // Array, + // Function, + // Number, + // String, + // Date, + // RegExp, + // })[schema]; + // }, code(cxt) { const { data, schema } = cxt; cxt.fail(_`!(${data} instanceof ` + schema + `)`); diff --git a/packages/netlify-cms-core/validation-rules/uniqueItemProperties.js b/packages/netlify-cms-core/validation-rules/uniqueItemProperties.js new file mode 100644 index 000000000000..8b8e9daa3bc3 --- /dev/null +++ b/packages/netlify-cms-core/validation-rules/uniqueItemProperties.js @@ -0,0 +1,19 @@ +const { _ } = require('ajv'); + +module.exports = function uniqueItemPropertiesKeyword(ajv) { + ajv.addKeyword({ + keyword: 'uniqueItemProperties', + type: "array", + schemaType: "array", + code(cxt) { + const { data, schemaValue } = cxt; + cxt.fail(_`${schemaValue} + .map( + property => ${data} + .map(item => item && item[property]) + .some((value, index, array) => array.indexOf(value) !== index) + ) + .some((value) => value)`); + } + }); +}; From 1c943609d1768dc7cd1184d87263d987b378163b Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Thu, 6 Jan 2022 14:34:55 -0800 Subject: [PATCH 14/20] chore(csp): all static validation tests are passing --- .../src/constants/__tests__/configSchema.spec.js | 3 +++ 1 file changed, 3 insertions(+) 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 530ac07acc9a..3a1d6b1043e7 100644 --- a/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js +++ b/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js @@ -501,6 +501,9 @@ function validationTests() { widget: 'relation', display_fields: ['title'], search_fields: ['title'], + collection: 'mycollection', + valueField: 'name', + searchFields: ['name'], }, ], }, From 7c4ac023dcc75921459b727c003d975709bae8b7 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Fri, 7 Jan 2022 09:37:26 -0800 Subject: [PATCH 15/20] chore(csp): activated tests for dynamic validation --- .../constants/__tests__/configSchema.spec.js | 912 ++++++++++-------- .../src/constants/configSchema.js | 35 +- 2 files changed, 503 insertions(+), 444 deletions(-) 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 3a1d6b1043e7..828491b8900d 100644 --- a/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js +++ b/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js @@ -1,519 +1,581 @@ import { merge } from 'lodash'; -import { validateConfig } from '../configSchema'; +import { validateConfig, hasCustomWidgetSchemas } from '../configSchema'; jest.mock('../../lib/registry'); -describe('config validation', () => { - /** - * Suppress error logging to reduce noise during testing. Jest will still - * log test failures and associated errors as expected. - */ +const validConfig = { + foo: 'bar', + backend: { name: 'bar' }, + media_folder: 'baz', + collections: [ + { + name: 'posts', + label: 'Posts', + folder: '_posts', + fields: [{ name: 'title', label: 'title', widget: 'string' }], + }, + ], +}; + +/** + * Suppress error logging to reduce noise during testing. Jest will still + * log test failures and associated errors as expected. + */ +beforeEach(() => { + jest.spyOn(console, 'error').mockImplementation(() => {}); +}); + +describe('static validation', () => { beforeEach(() => { - jest.spyOn(console, 'error').mockImplementation(() => {}); + const { getWidgets } = require('../../lib/registry'); + getWidgets.mockImplementation(() => [{}]); + }) + + it("does not have custom widgets", () => { + expect(hasCustomWidgetSchemas()).toBeFalsy(); }); - const { getWidgets } = require('../../lib/registry'); - getWidgets.mockImplementation(() => [{}]); + validationTests(); + + describe('nested validation', () => { + beforeEach(() => { + const { getWidgets } = require('../../lib/registry'); + getWidgets.mockImplementation(() => [ + { + name: 'relation', + schema: { + properties: { + search_fields: { type: 'array', items: { type: 'string' } }, + display_fields: { type: 'array', items: { type: 'string' } }, + }, + }, + }, + ]); + }); - describe('static validation', validationTests) + it("does not have custom widgets", () => { + expect(hasCustomWidgetSchemas()).toBeFalsy(); + }); + nestedValidationTests(); + }); }); -function validationTests() { - describe('validateConfig', () => { - const validConfig = { - foo: 'bar', - backend: { name: 'bar' }, - media_folder: 'baz', - collections: [ - { - name: 'posts', - label: 'Posts', - folder: '_posts', - fields: [{ name: 'title', label: 'title', widget: 'string' }], +describe('dynamic validation', () => { + beforeEach(() => { + const { getWidgets } = require('../../lib/registry'); + getWidgets.mockImplementation(() => [ + { + name: 'my_custom_widget', + schema: { + properties: { + name_field: { type: 'string' }, + }, }, - ], - }; + }, + ]); + }); - it('should not throw if no errors', () => { - expect(() => { - validateConfig(validConfig); - }).not.toThrowError(); - }); + it("has custom schemas", () => { + expect(hasCustomWidgetSchemas()).toBeTruthy(); + }); - it('should throw if backend is not defined in config', () => { - expect(() => { - validateConfig({ foo: 'bar' }); - }).toThrowError("config must have required property 'backend'"); - }); + validationTests(); - it('should throw if backend name is not defined in config', () => { - expect(() => { - validateConfig({ foo: 'bar', backend: {} }); - }).toThrowError("'backend' must have required property 'name'"); + describe('nested validation', () => { + beforeEach(() => { + const { getWidgets } = require('../../lib/registry'); + getWidgets.mockImplementation(() => [ + { + name: 'my_custom_widget', + schema: { + properties: { + name_field: { type: 'string' }, + }, + }, + }, + { + name: 'relation', + schema: { + properties: { + search_fields: { type: 'array', items: { type: 'string' } }, + display_fields: { type: 'array', items: { type: 'string' } }, + }, + }, + }, + ]); }); - it('should throw if backend name is not a string in config', () => { - expect(() => { - validateConfig({ foo: 'bar', backend: { name: {} } }); - }).toThrowError("'backend.name' must be string"); + it("has custom widgets", () => { + expect(hasCustomWidgetSchemas()).toBeTruthy(); }); + + nestedValidationTests(); + }); +}); - it('should throw if backend.open_authoring is not a boolean in config', () => { - expect(() => { - validateConfig(merge(validConfig, { backend: { open_authoring: 'true' } })); - }).toThrowError("'backend.open_authoring' must be boolean"); - }); +function validationTests() { + it('should not throw if no errors', () => { + expect(() => { + validateConfig(validConfig); + }).not.toThrowError(); + }); - it('should not throw if backend.open_authoring is boolean in config', () => { - expect(() => { - validateConfig(merge(validConfig, { backend: { open_authoring: true } })); - }).not.toThrowError(); - }); + it('should throw if backend is not defined in config', () => { + expect(() => { + validateConfig({ foo: 'bar' }); + }).toThrowError("config must have required property 'backend'"); + }); - it('should throw if backend.auth_scope is not "repo" or "public_repo" in config', () => { - expect(() => { - validateConfig(merge(validConfig, { backend: { auth_scope: 'user' } })); - }).toThrowError("'backend.auth_scope' must be equal to one of the allowed values"); - }); + it('should throw if backend name is not defined in config', () => { + expect(() => { + validateConfig({ foo: 'bar', backend: {} }); + }).toThrowError("'backend' must have required property 'name'"); + }); - it('should not throw if backend.auth_scope is one of "repo" or "public_repo" in config', () => { - expect(() => { - validateConfig(merge(validConfig, { backend: { auth_scope: 'repo' } })); - }).not.toThrowError(); - expect(() => { - validateConfig(merge(validConfig, { backend: { auth_scope: 'public_repo' } })); - }).not.toThrowError(); - }); + it('should throw if backend name is not a string in config', () => { + expect(() => { + validateConfig({ foo: 'bar', backend: { name: {} } }); + }).toThrowError("'backend.name' must be string"); + }); - it('should throw if media_folder is not defined in config', () => { - expect(() => { - validateConfig({ foo: 'bar', backend: { name: 'bar' } }); - }).toThrowError("config must have required property 'media_folder'"); - }); + it('should throw if backend.open_authoring is not a boolean in config', () => { + expect(() => { + validateConfig(merge(validConfig, { backend: { open_authoring: 'true' } })); + }).toThrowError("'backend.open_authoring' must be boolean"); + }); - it('should throw if media_folder is not a string in config', () => { - expect(() => { - validateConfig({ foo: 'bar', backend: { name: 'bar' }, media_folder: {} }); - }).toThrowError("'media_folder' must be string"); - }); + it('should not throw if backend.open_authoring is boolean in config', () => { + expect(() => { + validateConfig(merge(validConfig, { backend: { open_authoring: true } })); + }).not.toThrowError(); + }); - it('should throw if collections is not defined in config', () => { - expect(() => { - validateConfig({ foo: 'bar', backend: { name: 'bar' }, media_folder: 'baz' }); - }).toThrowError("config must have required property 'collections'"); - }); + it('should throw if backend.auth_scope is not "repo" or "public_repo" in config', () => { + expect(() => { + validateConfig(merge(validConfig, { backend: { auth_scope: 'user' } })); + }).toThrowError("'backend.auth_scope' must be equal to one of the allowed values"); + }); - it('should throw if collections not an array in config', () => { - expect(() => { - validateConfig({ - foo: 'bar', - backend: { name: 'bar' }, - media_folder: 'baz', - collections: {}, - }); - }).toThrowError("'collections' must be array"); - }); + it('should not throw if backend.auth_scope is one of "repo" or "public_repo" in config', () => { + expect(() => { + validateConfig(merge(validConfig, { backend: { auth_scope: 'repo' } })); + }).not.toThrowError(); + expect(() => { + validateConfig(merge(validConfig, { backend: { auth_scope: 'public_repo' } })); + }).not.toThrowError(); + }); - it('should throw if collections is an empty array in config', () => { - expect(() => { - validateConfig({ - foo: 'bar', - backend: { name: 'bar' }, - media_folder: 'baz', - collections: [], - }); - }).toThrowError("'collections' must NOT have fewer than 1 items"); - }); + it('should throw if media_folder is not defined in config', () => { + expect(() => { + validateConfig({ foo: 'bar', backend: { name: 'bar' } }); + }).toThrowError("config must have required property 'media_folder'"); + }); - it('should throw if collections is an array with a single null element in config', () => { - expect(() => { - validateConfig({ - foo: 'bar', - backend: { name: 'bar' }, - media_folder: 'baz', - collections: [null], - }); - }).toThrowError("'collections[0]' must be object"); - }); + it('should throw if media_folder is not a string in config', () => { + expect(() => { + validateConfig({ foo: 'bar', backend: { name: 'bar' }, media_folder: {} }); + }).toThrowError("'media_folder' must be string"); + }); - it('should throw if local_backend is not a boolean or plain object', () => { - expect(() => { - validateConfig({ ...validConfig, local_backend: [] }); - }).toThrowError("'local_backend' must be boolean"); - }); + it('should throw if collections is not defined in config', () => { + expect(() => { + validateConfig({ foo: 'bar', backend: { name: 'bar' }, media_folder: 'baz' }); + }).toThrowError("config must have required property 'collections'"); + }); - it('should throw if local_backend url is not a string', () => { - expect(() => { - validateConfig({ ...validConfig, local_backend: { url: [] } }); - }).toThrowError("'local_backend.url' must be string"); - }); + it('should throw if collections not an array in config', () => { + expect(() => { + validateConfig({ + foo: 'bar', + backend: { name: 'bar' }, + media_folder: 'baz', + collections: {}, + }); + }).toThrowError("'collections' must be array"); + }); - it('should throw if local_backend allowed_hosts is not a string array', () => { - expect(() => { - validateConfig({ ...validConfig, local_backend: { allowed_hosts: [true] } }); - }).toThrowError("'local_backend.allowed_hosts[0]' must be string"); - }); + it('should throw if collections is an empty array in config', () => { + expect(() => { + validateConfig({ + foo: 'bar', + backend: { name: 'bar' }, + media_folder: 'baz', + collections: [], + }); + }).toThrowError("'collections' must NOT have fewer than 1 items"); + }); - it('should not throw if local_backend is a boolean', () => { - expect(() => { - validateConfig({ ...validConfig, local_backend: true }); - }).not.toThrowError(); - }); + it('should throw if collections is an array with a single null element in config', () => { + expect(() => { + validateConfig({ + foo: 'bar', + backend: { name: 'bar' }, + media_folder: 'baz', + collections: [null], + }); + }).toThrowError("'collections[0]' must be object"); + }); - it('should not throw if local_backend is a plain object with url string property', () => { - expect(() => { - validateConfig({ ...validConfig, local_backend: { url: 'http://localhost:8081/api/v1' } }); - }).not.toThrowError(); - }); + it('should throw if local_backend is not a boolean or plain object', () => { + expect(() => { + validateConfig({ ...validConfig, local_backend: [] }); + }).toThrowError("'local_backend' must be boolean"); + }); - it('should not throw if local_backend is a plain object with allowed_hosts string array property', () => { - expect(() => { - validateConfig({ - ...validConfig, - local_backend: { allowed_hosts: ['192.168.0.1'] }, - }); - }).not.toThrowError(); - }); + it('should throw if local_backend url is not a string', () => { + expect(() => { + validateConfig({ ...validConfig, local_backend: { url: [] } }); + }).toThrowError("'local_backend.url' must be string"); + }); - it('should throw if collection publish is not a boolean', () => { - expect(() => { - validateConfig(merge({}, validConfig, { collections: [{ publish: 'false' }] })); - }).toThrowError("'collections[0].publish' must be boolean"); - }); + it('should throw if local_backend allowed_hosts is not a string array', () => { + expect(() => { + validateConfig({ ...validConfig, local_backend: { allowed_hosts: [true] } }); + }).toThrowError("'local_backend.allowed_hosts[0]' must be string"); + }); - it('should not throw if collection publish is a boolean', () => { - expect(() => { - validateConfig(merge({}, validConfig, { collections: [{ publish: false }] })); - }).not.toThrowError(); - }); + it('should not throw if local_backend is a boolean', () => { + expect(() => { + validateConfig({ ...validConfig, local_backend: true }); + }).not.toThrowError(); + }); - it('should throw if collections sortable_fields is not a boolean or a string array', () => { - expect(() => { - validateConfig(merge({}, validConfig, { collections: [{ sortable_fields: 'title' }] })); - }).toThrowError("'collections[0].sortable_fields' must be array"); - }); + it('should not throw if local_backend is a plain object with url string property', () => { + expect(() => { + validateConfig({ ...validConfig, local_backend: { url: 'http://localhost:8081/api/v1' } }); + }).not.toThrowError(); + }); - it('should allow sortable_fields to be a string array', () => { - expect(() => { - validateConfig(merge({}, validConfig, { collections: [{ sortable_fields: ['title'] }] })); - }).not.toThrow(); - }); + it('should not throw if local_backend is a plain object with allowed_hosts string array property', () => { + expect(() => { + validateConfig({ + ...validConfig, + local_backend: { allowed_hosts: ['192.168.0.1'] }, + }); + }).not.toThrowError(); + }); - it('should allow sortable_fields to be a an empty array', () => { - expect(() => { - validateConfig(merge({}, validConfig, { collections: [{ sortable_fields: [] }] })); - }).not.toThrow(); - }); + it('should throw if collection publish is not a boolean', () => { + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ publish: 'false' }] })); + }).toThrowError("'collections[0].publish' must be boolean"); + }); - it('should allow sortableFields instead of sortable_fields', () => { - expect(() => { - validateConfig(merge({}, validConfig, { collections: [{ sortableFields: [] }] })); - }).not.toThrow(); - }); + it('should not throw if collection publish is a boolean', () => { + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ publish: false }] })); + }).not.toThrowError(); + }); - it('should throw if both sortable_fields and sortableFields exist', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { collections: [{ sortable_fields: [], sortableFields: [] }] }), - ); - }).toThrowError("'collections[0]' must NOT be valid"); - }); + it('should throw if collections sortable_fields is not a boolean or a string array', () => { + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ sortable_fields: 'title' }] })); + }).toThrowError("'collections[0].sortable_fields' must be array"); + }); - it('should throw if collection names are not unique', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - collections: [validConfig.collections[0], validConfig.collections[0]], - }), - ); - }).toThrowError("'collections' collections names must be unique"); - }); + it('should allow sortable_fields to be a string array', () => { + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ sortable_fields: ['title'] }] })); + }).not.toThrow(); + }); - it('should throw if collection file names are not unique', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - collections: [ - {}, - { - files: [ - { - name: 'a', - label: 'a', - file: 'a.md', - fields: [{ name: 'title', label: 'title', widget: 'string' }], - }, - { - name: 'a', - label: 'b', - file: 'b.md', - fields: [{ name: 'title', label: 'title', widget: 'string' }], - }, - ], - }, - ], - }), - ); - }).toThrowError("'collections[1].files' files names must be unique"); - }); + it('should allow sortable_fields to be a an empty array', () => { + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ sortable_fields: [] }] })); + }).not.toThrow(); + }); - it('should throw if collection fields names are not unique', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - collections: [ - { - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { name: 'title', label: 'other title', widget: 'string' }, - ], - }, - ], - }), - ); - }).toThrowError("'collections[0].fields' fields names must be unique"); - }); + it('should allow sortableFields instead of sortable_fields', () => { + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ sortableFields: [] }] })); + }).not.toThrow(); + }); - it('should not throw if collection fields are unique across nesting levels', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - collections: [ - { - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { - name: 'object', - label: 'Object', - widget: 'object', - fields: [{ name: 'title', label: 'title', widget: 'string' }], - }, - ], - }, - ], - }), - ); - }).not.toThrow(); - }); + it('should throw if both sortable_fields and sortableFields exist', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { collections: [{ sortable_fields: [], sortableFields: [] }] }), + ); + }).toThrowError("'collections[0]' must NOT be valid"); + }); - it('should throw if collection meta is not a plain object', () => { - expect(() => { - validateConfig(merge({}, validConfig, { collections: [{ meta: [] }] })); - }).toThrowError("'collections[0].meta' must be object"); - }); + it('should throw if collection names are not unique', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [validConfig.collections[0], validConfig.collections[0]], + }), + ); + }).toThrowError("'collections' collections names must be unique"); + }); - it('should throw if collection meta is an empty object', () => { - expect(() => { - validateConfig(merge({}, validConfig, { collections: [{ meta: {} }] })); - }).toThrowError("'collections[0].meta' must NOT have fewer than 1 items"); - }); + it('should throw if collection file names are not unique', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [ + {}, + { + files: [ + { + name: 'a', + label: 'a', + file: 'a.md', + fields: [{ name: 'title', label: 'title', widget: 'string' }], + }, + { + name: 'a', + label: 'b', + file: 'b.md', + fields: [{ name: 'title', label: 'title', widget: 'string' }], + }, + ], + }, + ], + }), + ); + }).toThrowError("'collections[1].files' files names must be unique"); + }); - it('should throw if collection meta is an empty object', () => { - expect(() => { - validateConfig(merge({}, validConfig, { collections: [{ meta: { path: {} } }] })); - }).toThrowError("'collections[0].meta.path' must have required property 'label'"); - expect(() => { - validateConfig( - merge({}, validConfig, { collections: [{ meta: { path: { label: 'Label' } } }] }), - ); - }).toThrowError("'collections[0].meta.path' must have required property 'widget'"); + it('should throw if collection fields names are not unique', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [ + { + fields: [ + { name: 'title', label: 'title', widget: 'string' }, + { name: 'title', label: 'other title', widget: 'string' }, + ], + }, + ], + }), + ); + }).toThrowError("'collections[0].fields' fields names must be unique"); + }); + + it('should not throw if collection fields are unique across nesting levels', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [ + { + fields: [ + { name: 'title', label: 'title', widget: 'string' }, + { + name: 'object', + label: 'Object', + widget: 'object', + fields: [{ name: 'title', label: 'title', widget: 'string' }], + }, + ], + }, + ], + }), + ); + }).not.toThrow(); + }); + + it('should throw if collection meta is not a plain object', () => { + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ meta: [] }] })); + }).toThrowError("'collections[0].meta' must be object"); + }); + + it('should throw if collection meta is an empty object', () => { + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ meta: {} }] })); + }).toThrowError("'collections[0].meta' must NOT have fewer than 1 items"); + }); + + it('should throw if collection meta is an empty object', () => { + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ meta: { path: {} } }] })); + }).toThrowError("'collections[0].meta.path' must have required property 'label'"); + expect(() => { + validateConfig( + merge({}, validConfig, { collections: [{ meta: { path: { label: 'Label' } } }] }), + ); + }).toThrowError("'collections[0].meta.path' must have required property 'widget'"); + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [{ meta: { path: { label: 'Label', widget: 'widget' } } }], + }), + ); + }).toThrowError("'collections[0].meta.path' must have required property 'index_file'"); + }); + + it('should allow collection meta to have a path configuration', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [ + { meta: { path: { label: 'Path', widget: 'string', index_file: 'index' } } }, + ], + }), + ); + }).not.toThrow(); + }); + + it('should throw if collection field pattern is not an array', () => { + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ fields: [{ pattern: '' }] }] })); + }).toThrowError("'collections[0].fields[0].pattern' must be array"); + }); + + it('should throw if collection field pattern is not an array of [string|regex, string]', () => { + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ fields: [{ pattern: [1, ''] }] }] })); + }).toThrowError( + "'collections[0].fields[0].pattern[0]' must be string\n'collections[0].fields[0].pattern[0]' must be a regular expression", + ); + + expect(() => { + validateConfig(merge({}, validConfig, { collections: [{ fields: [{ pattern: ['', 1] }] }] })); + }).toThrowError("'collections[0].fields[0].pattern[1]' must be string"); + }); + + it('should allow collection field pattern to be an array of [string|regex, string]', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [{ fields: [{ pattern: ['pattern', 'error'] }] }], + }), + ); + }).not.toThrow(); + + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [{ fields: [{ pattern: [/pattern/, 'error'] }] }], + }), + ); + }).not.toThrow(); + }); + + describe('i18n', () => { + it('should throw error when locale has invalid characters', () => { expect(() => { validateConfig( merge({}, validConfig, { - collections: [{ meta: { path: { label: 'Label', widget: 'widget' } } }], + i18n: { + structure: 'multiple_folders', + locales: ['en', 'tr.TR'], + }, }), ); - }).toThrowError("'collections[0].meta.path' must have required property 'index_file'"); + }).toThrowError(`'i18n.locales[1]' must match pattern "^[a-zA-Z-_]+$"`); }); - it('should allow collection meta to have a path configuration', () => { + it('should throw error when locale is less than 2 characters', () => { expect(() => { validateConfig( merge({}, validConfig, { - collections: [ - { meta: { path: { label: 'Path', widget: 'string', index_file: 'index' } } }, - ], + i18n: { + structure: 'multiple_folders', + locales: ['en', 't'], + }, }), ); - }).not.toThrow(); + }).toThrowError(`'i18n.locales[1]' must NOT have fewer than 2 characters`); }); - it('should throw if collection field pattern is not an array', () => { - expect(() => { - validateConfig(merge({}, validConfig, { collections: [{ fields: [{ pattern: '' }] }] })); - }).toThrowError("'collections[0].fields[0].pattern' must be array"); - }); - - it('should throw if collection field pattern is not an array of [string|regex, string]', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { collections: [{ fields: [{ pattern: [1, ''] }] }] }), - ); - }).toThrowError( - "'collections[0].fields[0].pattern[0]' must be string\n'collections[0].fields[0].pattern[0]' must be a regular expression", - ); - - expect(() => { - validateConfig( - merge({}, validConfig, { collections: [{ fields: [{ pattern: ['', 1] }] }] }), - ); - }).toThrowError("'collections[0].fields[0].pattern[1]' must be string"); - }); - - it('should allow collection field pattern to be an array of [string|regex, string]', () => { + it('should throw error when locale is more than 10 characters', () => { expect(() => { validateConfig( merge({}, validConfig, { - collections: [{ fields: [{ pattern: ['pattern', 'error'] }] }], + i18n: { + structure: 'multiple_folders', + locales: ['en', 'a_very_long_locale'], + }, }), ); - }).not.toThrow(); + }).toThrowError(`'i18n.locales[1]' must NOT have more than 10 characters`); + }); + it('should allow valid locales strings', () => { expect(() => { validateConfig( merge({}, validConfig, { - collections: [{ fields: [{ pattern: [/pattern/, 'error'] }] }], + i18n: { + structure: 'multiple_folders', + locales: ['en', 'tr-TR', 'zh_CHS'], + }, }), ); }).not.toThrow(); }); - - describe('i18n', () => { - it('should throw error when locale has invalid characters', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - i18n: { - structure: 'multiple_folders', - locales: ['en', 'tr.TR'], - }, - }), - ); - }).toThrowError(`'i18n.locales[1]' must match pattern "^[a-zA-Z-_]+$"`); - }); - - it('should throw error when locale is less than 2 characters', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - i18n: { - structure: 'multiple_folders', - locales: ['en', 't'], - }, - }), - ); - }).toThrowError(`'i18n.locales[1]' must NOT have fewer than 2 characters`); - }); - - it('should throw error when locale is more than 10 characters', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - i18n: { - structure: 'multiple_folders', - locales: ['en', 'a_very_long_locale'], - }, - }), - ); - }).toThrowError(`'i18n.locales[1]' must NOT have more than 10 characters`); - }); - - it('should allow valid locales strings', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - i18n: { - structure: 'multiple_folders', - locales: ['en', 'tr-TR', 'zh_CHS'], - }, - }), - ); - }).not.toThrow(); - }); - }); - - describe('nested validation', () => { - const { getWidgets } = require('../../lib/registry'); - getWidgets.mockImplementation(() => [ - { - name: 'relation', - schema: { - properties: { - search_fields: { type: 'array', items: { type: 'string' } }, - display_fields: { type: 'array', items: { type: 'string' } }, - }, - }, - }, - ]); - - it('should throw if nested relation display_fields and search_fields are not arrays', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - collections: [ + }); +} + +function nestedValidationTests() { + it('should throw if nested relation display_fields and search_fields are not arrays', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [ + { + fields: [ + { name: 'title', label: 'title', widget: 'string' }, { + name: 'object', + label: 'Object', + widget: 'object', fields: [ { name: 'title', label: 'title', widget: 'string' }, { - name: 'object', - label: 'Object', - widget: 'object', - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { - name: 'relation', - label: 'relation', - widget: 'relation', - display_fields: 'title', - search_fields: 'title', - }, - ], + name: 'relation', + label: 'relation', + widget: 'relation', + display_fields: 'title', + search_fields: 'title', }, ], }, ], - }), - ); - }).toThrowError( - "'collections[0].fields[1].fields[1].search_fields' must be array\n'collections[0].fields[1].fields[1].display_fields' must be array", - ); - }); + }, + ], + }), + ); + }).toThrowError( + "'collections[0].fields[1].fields[1].search_fields' must be array\n'collections[0].fields[1].fields[1].display_fields' must be array", + ); + }); - it('should not throw if nested relation display_fields and search_fields are arrays', () => { - expect(() => { - validateConfig( - merge({}, validConfig, { - collections: [ + it('should not throw if nested relation display_fields and search_fields are arrays', () => { + expect(() => { + validateConfig( + merge({}, validConfig, { + collections: [ + { + fields: [ + { name: 'title', label: 'title', widget: 'string' }, { + name: 'object', + label: 'Object', + widget: 'object', fields: [ { name: 'title', label: 'title', widget: 'string' }, { - name: 'object', - label: 'Object', - widget: 'object', - fields: [ - { name: 'title', label: 'title', widget: 'string' }, - { - name: 'relation', - label: 'relation', - widget: 'relation', - display_fields: ['title'], - search_fields: ['title'], - collection: 'mycollection', - valueField: 'name', - searchFields: ['name'], - }, - ], + name: 'relation', + label: 'relation', + widget: 'relation', + display_fields: ['title'], + search_fields: ['title'], + collection: 'mycollection', + valueField: 'name', + searchFields: ['name'], }, ], }, ], - }), - ); - }).not.toThrow(); - }); - }); + }, + ], + }), + ); + }).not.toThrow(); }); -} \ No newline at end of file +} diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index 0dcab014c786..0f51a69c286d 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -1,9 +1,5 @@ import AJV from 'ajv'; -import { - select, - uniqueItemProperties, - instanceof as instanceOf, -} from 'ajv-keywords/keywords'; +import ajvKeywords from 'ajv-keywords'; import uuid from 'uuid/v4'; import { set } from 'lodash/fp' @@ -129,9 +125,8 @@ class ConfigError extends Error { */ function dynamicValidateConfig(config) { const ajv = new AJV({ allErrors: true, $data: true, strict: false }); - uniqueItemProperties(ajv); - select(ajv); - instanceOf(ajv); + + ajvKeywords(ajv, ['instanceof', 'select', 'uniqueItemProperties']) const valid = ajv.validate(getConfigSchema(), config); dynamicValidateConfig.errors = ajv.errors; @@ -172,25 +167,27 @@ function extractValidationErrors(validator) { }) } - -export function validateConfig(config) { - const customWidgets = Object.keys(getWidgetSchemas()).filter( +export function hasCustomWidgetSchemas() { + const widgetSchemas = getWidgetSchemas(); + const customWidgets = Object.keys(widgetSchemas).filter( widgetKey => NativeCMSWidgets.includes(widgetKey) === false, ); - let validator; - if (customWidgets.length > 0) { - console.debug('using dynamic ajv validation'); - validator = dynamicValidateConfig; + return customWidgets.length > 0; +} + +export function validateConfig(config) { + let validate; + if (hasCustomWidgetSchemas()) { + validate = dynamicValidateConfig; } else { - console.debug('using static ajv validation'); - validator = staticValidateConfig; + validate = staticValidateConfig; } - const result = validator(config); + const result = validate(config); if (result === false) { - const errors = extractValidationErrors(validator); + const errors = extractValidationErrors(validate); console.error('Config Errors', errors); throw new ConfigError(errors); } From 463f650e22569a0b5344e212ce3e88466afd3cb3 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Fri, 7 Jan 2022 09:44:55 -0800 Subject: [PATCH 16/20] chore(csp): do some clean up --- packages/netlify-cms-core/src/constants/configSchema.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index 0f51a69c286d..bf5c915ebe86 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -79,13 +79,9 @@ function fieldsConfig() { * where the imports get resolved asynchronously. */ export function getConfigSchema() { - - // This will immutably apply fields schema to the schema properrites that need them - // TODO: it might be better to use ref here as per https://github.com/ajv-validator/ajv/issues/1707#issuecomment-890479942 - + // This will immutably apply fields schema to the schema properites that need them const s1 = set('properties.collections.items.properties.files.items.properties.fields', fieldsConfig(), schema); const s2 = set('properties.collections.items.properties.fields', fieldsConfig(), s1); - return s2; } From 25c09c6eebd7cbb18f74a49ae26f89bebfc82841 Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Fri, 7 Jan 2022 10:54:07 -0800 Subject: [PATCH 17/20] chore(csp): add instructions to the readme about static validation --- packages/netlify-cms-core/README.md | 10 ++++++++++ .../src/constants/staticValidateConfig.js | 3 +++ .../netlify-cms-core/validation-rules/instanceof.js | 13 ------------- .../validation-rules/uniqueItemProperties.js | 1 + 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/netlify-cms-core/README.md b/packages/netlify-cms-core/README.md index fe9fafd03c9b..5e1f3766ce25 100644 --- a/packages/netlify-cms-core/README.md +++ b/packages/netlify-cms-core/README.md @@ -9,3 +9,13 @@ In the meantime, you can: site](https://www.netlifycms.org) for more info. 2. Reach out to the [community chat](https://netlifycms.org/chat/) if you need help. 3. Help out and [write the readme yourself](https://github.com/netlify/netlify-cms/edit/master/packages/netlify-cms-core/README.md)! + +## Config Schema Validation + +This package uses [AJV](http://ajv.js.org) to validate user's configuration files. There are two versions of this validation mechanism - static and dynamic. Dynamic validation is triggered when the configuration file includes custom validation schema for custom widgets. Static validation is used when the configuration does not have custom validation schema. Dynamic validation does not work in environments where Content Security Policy does not allow `unsafe-eval`. Due to this constraint, custom validation for custom widgets does not work where `unsafe-eval` is disallowed. You can learn more about this in [CMS does not work with Content Security Policy (CSP). Requires unsafe-eval / unsafe-inline for script-src / style-src](https://github.com/netlify/netlify-cms/issues/2138) issue. + +### Modifying Static Config Schema validation + +Static schema validation is stored in [./src/constants/staticValidateConfig.js](./src/constants/staticValidateConfig.js). It is generated using `yarn write-validate-schema` script which intern uses `ajv` CLI to compile schema stored in [./config.schema.json](./config.schema.json) to JavaScript that can be executed the browsers without triggering Content Security Policy where `unsafe-eval` is disallowed. This script relies on [./validation-rules/instanceof.js](./validation-rules/instanceof.js) and [./validation-rules/uniqueItemProperties.js](./validation-rules/uniqueItemProperties.js) these validation rules describe how AJV should generate source code for `instanceof` and `uniqueItemProperties` keywords. They are necessary because `ajv-keywords@5.0.0` which is used by this package does not support code generation yet - see notes in [instanceof](https://github.com/ajv-validator/ajv-keywords#instanceof) and [uniqueItemProperties](https://github.com/ajv-validator/ajv-keywords#uniqueitemproperties). These two files can be removed when `ajv-keywords` adds support for code generation for thes keywords. + +**Note**: If you modify [./config.schema.json](./config.schema.json) then you should run `yarn write-validate-schema` to regenerate the [./src/constants/staticValidateConfig.js](./src/constants/staticValidateConfig.js) file. \ No newline at end of file diff --git a/packages/netlify-cms-core/src/constants/staticValidateConfig.js b/packages/netlify-cms-core/src/constants/staticValidateConfig.js index d6ec4beb793d..72c0fc4205a8 100644 --- a/packages/netlify-cms-core/src/constants/staticValidateConfig.js +++ b/packages/netlify-cms-core/src/constants/staticValidateConfig.js @@ -1,3 +1,6 @@ +// Do not edit this file. It was generated using `yarn write-validate-schema` script +// Checkout Config Schema Validation section in README.md for more information +/* eslint-disable */ 'use strict'; module.exports = validate24; module.exports.default = validate24; diff --git a/packages/netlify-cms-core/validation-rules/instanceof.js b/packages/netlify-cms-core/validation-rules/instanceof.js index 910d2fca5c45..87e8089a019d 100644 --- a/packages/netlify-cms-core/validation-rules/instanceof.js +++ b/packages/netlify-cms-core/validation-rules/instanceof.js @@ -5,19 +5,6 @@ module.exports = function addInstanceOfKeyword(ajv) { keyword: 'instanceof', schemaType: 'string', type: ['string', 'number', 'array', 'object'], - // compile(schema) { - // return data => - // data instanceof - // ({ - // Object, - // Array, - // Function, - // Number, - // String, - // Date, - // RegExp, - // })[schema]; - // }, code(cxt) { const { data, schema } = cxt; cxt.fail(_`!(${data} instanceof ` + schema + `)`); diff --git a/packages/netlify-cms-core/validation-rules/uniqueItemProperties.js b/packages/netlify-cms-core/validation-rules/uniqueItemProperties.js index 8b8e9daa3bc3..c0cb85faa18b 100644 --- a/packages/netlify-cms-core/validation-rules/uniqueItemProperties.js +++ b/packages/netlify-cms-core/validation-rules/uniqueItemProperties.js @@ -7,6 +7,7 @@ module.exports = function uniqueItemPropertiesKeyword(ajv) { schemaType: "array", code(cxt) { const { data, schemaValue } = cxt; + // generates code that checks if any property in the value repeats itself cxt.fail(_`${schemaValue} .map( property => ${data} From c0a9fbacc501e5bbc5db5f755167c29da4831cbd Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Fri, 7 Jan 2022 10:57:25 -0800 Subject: [PATCH 18/20] chore(csp): fix prettier formatting --- .../constants/__tests__/configSchema.spec.js | 12 ++++++------ .../src/constants/configSchema.js | 18 ++++++++++++------ .../validation-rules/instanceof.js | 2 +- .../validation-rules/uniqueItemProperties.js | 6 +++--- 4 files changed, 22 insertions(+), 16 deletions(-) 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 828491b8900d..50419dd7210e 100644 --- a/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js +++ b/packages/netlify-cms-core/src/constants/__tests__/configSchema.spec.js @@ -30,9 +30,9 @@ describe('static validation', () => { beforeEach(() => { const { getWidgets } = require('../../lib/registry'); getWidgets.mockImplementation(() => [{}]); - }) + }); - it("does not have custom widgets", () => { + it('does not have custom widgets', () => { expect(hasCustomWidgetSchemas()).toBeFalsy(); }); @@ -54,7 +54,7 @@ describe('static validation', () => { ]); }); - it("does not have custom widgets", () => { + it('does not have custom widgets', () => { expect(hasCustomWidgetSchemas()).toBeFalsy(); }); @@ -77,7 +77,7 @@ describe('dynamic validation', () => { ]); }); - it("has custom schemas", () => { + it('has custom schemas', () => { expect(hasCustomWidgetSchemas()).toBeTruthy(); }); @@ -107,10 +107,10 @@ describe('dynamic validation', () => { ]); }); - it("has custom widgets", () => { + it('has custom widgets', () => { expect(hasCustomWidgetSchemas()).toBeTruthy(); }); - + nestedValidationTests(); }); }); diff --git a/packages/netlify-cms-core/src/constants/configSchema.js b/packages/netlify-cms-core/src/constants/configSchema.js index bf5c915ebe86..146d8bcb984f 100644 --- a/packages/netlify-cms-core/src/constants/configSchema.js +++ b/packages/netlify-cms-core/src/constants/configSchema.js @@ -1,7 +1,7 @@ import AJV from 'ajv'; import ajvKeywords from 'ajv-keywords'; import uuid from 'uuid/v4'; -import { set } from 'lodash/fp' +import { set } from 'lodash/fp'; import { getWidgets } from '../lib/registry'; import { I18N_FIELD } from '../lib/i18n'; @@ -80,14 +80,20 @@ function fieldsConfig() { */ export function getConfigSchema() { // This will immutably apply fields schema to the schema properites that need them - const s1 = set('properties.collections.items.properties.files.items.properties.fields', fieldsConfig(), schema); + const s1 = set( + 'properties.collections.items.properties.files.items.properties.fields', + fieldsConfig(), + schema, + ); const s2 = set('properties.collections.items.properties.fields', fieldsConfig(), s1); return s2; } function getWidgetSchemas() { const widgets = getWidgets(); - const schemas = widgets.filter(widget => widget.schema).map(widget => ({ [widget.name]: widget.schema })); + const schemas = widgets + .filter(widget => widget.schema) + .map(widget => ({ [widget.name]: widget.schema })); return Object.assign({}, ...schemas); } @@ -122,7 +128,7 @@ class ConfigError extends Error { function dynamicValidateConfig(config) { const ajv = new AJV({ allErrors: true, $data: true, strict: false }); - ajvKeywords(ajv, ['instanceof', 'select', 'uniqueItemProperties']) + ajvKeywords(ajv, ['instanceof', 'select', 'uniqueItemProperties']); const valid = ajv.validate(getConfigSchema(), config); dynamicValidateConfig.errors = ajv.errors; @@ -160,7 +166,7 @@ function extractValidationErrors(validator) { default: return e; } - }) + }); } export function hasCustomWidgetSchemas() { @@ -179,7 +185,7 @@ export function validateConfig(config) { } else { validate = staticValidateConfig; } - + const result = validate(config); if (result === false) { diff --git a/packages/netlify-cms-core/validation-rules/instanceof.js b/packages/netlify-cms-core/validation-rules/instanceof.js index 87e8089a019d..0a570fd39eb4 100644 --- a/packages/netlify-cms-core/validation-rules/instanceof.js +++ b/packages/netlify-cms-core/validation-rules/instanceof.js @@ -8,6 +8,6 @@ module.exports = function addInstanceOfKeyword(ajv) { code(cxt) { const { data, schema } = cxt; cxt.fail(_`!(${data} instanceof ` + schema + `)`); - } + }, }); }; diff --git a/packages/netlify-cms-core/validation-rules/uniqueItemProperties.js b/packages/netlify-cms-core/validation-rules/uniqueItemProperties.js index c0cb85faa18b..aef6686cb132 100644 --- a/packages/netlify-cms-core/validation-rules/uniqueItemProperties.js +++ b/packages/netlify-cms-core/validation-rules/uniqueItemProperties.js @@ -3,8 +3,8 @@ const { _ } = require('ajv'); module.exports = function uniqueItemPropertiesKeyword(ajv) { ajv.addKeyword({ keyword: 'uniqueItemProperties', - type: "array", - schemaType: "array", + type: 'array', + schemaType: 'array', code(cxt) { const { data, schemaValue } = cxt; // generates code that checks if any property in the value repeats itself @@ -15,6 +15,6 @@ module.exports = function uniqueItemPropertiesKeyword(ajv) { .some((value, index, array) => array.indexOf(value) !== index) ) .some((value) => value)`); - } + }, }); }; From b06567dc42a62a316111aaf46bebbc6e993d2a5a Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Fri, 7 Jan 2022 11:05:43 -0800 Subject: [PATCH 19/20] chore(csp): remove nohoist --- package.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/package.json b/package.json index 7be83b38d703..864ea1a98411 100644 --- a/package.json +++ b/package.json @@ -172,11 +172,7 @@ ], "nohoist": [ "husky", - "run-node", - "netlify-cms-core/ajv", - "netlify-cms-core/ajv-cli", - "netlify-cms-core/ajv-keywords", - "netlify-cms-core/**/ajv-pack" + "run-node" ] }, "private": true, From 81af32946f61022eef7cf6fb647e4bf69bf2d86f Mon Sep 17 00:00:00 2001 From: Taras Mankovski Date: Fri, 7 Jan 2022 13:48:46 -0800 Subject: [PATCH 20/20] chore(csp): restore accidentally updated file --- dev-test/config.yml | 164 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 163 insertions(+), 1 deletion(-) diff --git a/dev-test/config.yml b/dev-test/config.yml index e26ca6bd31a2..2ffe5041ddb5 100644 --- a/dev-test/config.yml +++ b/dev-test/config.yml @@ -103,4 +103,166 @@ collections: # A list of collections the CMS should be able to edit widget: list fields: - { label: 'Name', name: 'name', widget: 'string', hint: 'First and Last' } - - { label: 'Description', name: 'description', widget: 'markdown' } \ No newline at end of file + - { label: 'Description', name: 'description', widget: 'markdown' } + + - name: 'kitchenSink' # all the things in one entry, for documentation and quick testing + label: 'Kitchen Sink' + folder: '_sink' + create: true + fields: + - label: 'Related Post' + name: 'post' + widget: 'relationKitchenSinkPost' + collection: 'posts' + display_fields: ['title', 'date'] + search_fields: ['title', 'body'] + value_field: 'title' + - { label: 'Title', name: 'title', widget: 'string' } + - { label: 'Boolean', name: 'boolean', widget: 'boolean', default: true } + - { label: 'Map', name: 'map', widget: 'map' } + - { label: 'Text', name: 'text', widget: 'text', hint: 'Plain text, not markdown' } + - { label: 'Number', name: 'number', widget: 'number', hint: 'To infinity and beyond!' } + - { label: 'Markdown', name: 'markdown', widget: 'markdown' } + - { label: 'Datetime', name: 'datetime', widget: 'datetime' } + - { label: 'Date', name: 'date', widget: 'date' } + - { label: 'Color', name: 'color', widget: 'color' } + - { + label: 'Color string editable and alpha enabled', + name: 'colorEditable', + widget: 'color', + enableAlpha: true, + allowInput: true, + } + - { label: 'Image', name: 'image', widget: 'image' } + - { label: 'File', name: 'file', widget: 'file' } + - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } + - { + label: 'Select multiple', + name: 'select_multiple', + widget: 'select', + options: ['a', 'b', 'c'], + multiple: true, + } + - { + label: 'Select numeric', + name: 'select_numeric', + widget: 'select', + options: + [{ label: 'One', value: 1 }, { label: 'Two', value: 2 }, { label: 'Three', value: 3 }], + } + - { label: 'Hidden', name: 'hidden', widget: 'hidden', default: 'hidden' } + - label: 'Object' + name: 'object' + widget: 'object' + collapsed: true + fields: + - label: 'Related Post' + name: 'post' + widget: 'relationKitchenSinkPost' + collection: 'posts' + search_fields: ['title', 'body'] + value_field: 'title' + - { label: 'String', name: 'string', widget: 'string' } + - { label: 'Boolean', name: 'boolean', widget: 'boolean', default: false } + - { label: 'Text', name: 'text', widget: 'text' } + - { label: 'Number', name: 'number', widget: 'number' } + - { label: 'Markdown', name: 'markdown', widget: 'markdown' } + - { label: 'Datetime', name: 'datetime', widget: 'datetime' } + - { label: 'Date', name: 'date', widget: 'date' } + - { label: 'Image', name: 'image', widget: 'image' } + - { label: 'File', name: 'file', widget: 'file' } + - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } + - label: 'List' + name: 'list' + widget: 'list' + fields: + - { label: 'String', name: 'string', widget: 'string' } + - { label: 'Boolean', name: 'boolean', widget: 'boolean' } + - { label: 'Text', name: 'text', widget: 'text' } + - { label: 'Number', name: 'number', widget: 'number' } + - { label: 'Markdown', name: 'markdown', widget: 'markdown' } + - { label: 'Datetime', name: 'datetime', widget: 'datetime' } + - { label: 'Date', name: 'date', widget: 'date' } + - { label: 'Image', name: 'image', widget: 'image' } + - { label: 'File', name: 'file', widget: 'file' } + - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } + - label: 'Object' + name: 'object' + widget: 'object' + fields: + - { label: 'String', name: 'string', widget: 'string' } + - { label: 'Boolean', name: 'boolean', widget: 'boolean' } + - { label: 'Text', name: 'text', widget: 'text' } + - { label: 'Number', name: 'number', widget: 'number' } + - { label: 'Markdown', name: 'markdown', widget: 'markdown' } + - { label: 'Datetime', name: 'datetime', widget: 'datetime' } + - { label: 'Date', name: 'date', widget: 'date' } + - { label: 'Image', name: 'image', widget: 'image' } + - { label: 'File', name: 'file', widget: 'file' } + - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } + - label: 'List' + name: 'list' + widget: 'list' + fields: + - label: 'Related Post' + name: 'post' + widget: 'relationKitchenSinkPost' + collection: 'posts' + search_fields: ['title', 'body'] + value_field: 'title' + - { label: 'String', name: 'string', widget: 'string' } + - { label: 'Boolean', name: 'boolean', widget: 'boolean' } + - { label: 'Text', name: 'text', widget: 'text' } + - { label: 'Number', name: 'number', widget: 'number' } + - { label: 'Markdown', name: 'markdown', widget: 'markdown' } + - { label: 'Datetime', name: 'datetime', widget: 'datetime' } + - { label: 'Date', name: 'date', widget: 'date' } + - { label: 'Image', name: 'image', widget: 'image' } + - { label: 'File', name: 'file', widget: 'file' } + - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } + - { label: 'Hidden', name: 'hidden', widget: 'hidden', default: 'hidden' } + - label: 'Object' + name: 'object' + widget: 'object' + fields: + - { label: 'String', name: 'string', widget: 'string' } + - { label: 'Boolean', name: 'boolean', widget: 'boolean' } + - { label: 'Text', name: 'text', widget: 'text' } + - { label: 'Number', name: 'number', widget: 'number' } + - { label: 'Markdown', name: 'markdown', widget: 'markdown' } + - { label: 'Datetime', name: 'datetime', widget: 'datetime' } + - { label: 'Date', name: 'date', widget: 'date' } + - { label: 'Image', name: 'image', widget: 'image' } + - { label: 'File', name: 'file', widget: 'file' } + - { + label: 'Select', + name: 'select', + widget: 'select', + options: ['a', 'b', 'c'], + } + - label: 'Typed List' + name: 'typed_list' + widget: 'list' + types: + - label: 'Type 1 Object' + name: 'type_1_object' + widget: 'object' + fields: + - { label: 'String', name: 'string', widget: 'string' } + - { label: 'Boolean', name: 'boolean', widget: 'boolean' } + - { label: 'Text', name: 'text', widget: 'text' } + - label: 'Type 2 Object' + name: 'type_2_object' + widget: 'object' + fields: + - { label: 'Number', name: 'number', widget: 'number' } + - { label: 'Select', name: 'select', widget: 'select', options: ['a', 'b', 'c'] } + - { label: 'Datetime', name: 'datetime', widget: 'datetime' } + - { label: 'Markdown', name: 'markdown', widget: 'markdown' } + - label: 'Type 3 Object' + name: 'type_3_object' + widget: 'object' + fields: + - { label: 'Date', name: 'date', widget: 'date' } + - { label: 'Image', name: 'image', widget: 'image' } + - { label: 'File', name: 'file', widget: 'file' }