UNPKG

@mapeo/schema

Version:

JSON schema and flow types for Mapeo

1 lines 133 kB
"use strict";export const Common_1 = validate10;const schema11 = {"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://mapeo.world/schemas/common/v1.json","title":"Common","description":"These properties are shared by all objects in the Mapeo database.","type":"object","properties":{"id":{"description":"Unique value that identifies this element","type":"string"},"version":{"description":"Unique value that identifies this particular version of this element","type":"string"},"created_at":{"description":"RFC3339-formatted datetime of when the first version of the element was created","type":"string","format":"date-time"},"timestamp":{"description":"RFC3339-formatted datetime of when this version of the element was created","type":"string","format":"date-time"},"userId":{"description":"ID of the user who made this edit","type":"string"},"deviceId":{"description":"ID of the device that made this edit","type":"string"},"schemaType":{"description":"enum that defines the type of document in the database (defines which schema should be used)","type":"string"},"links":{"description":"Version ids of the previous document versions this one is replacing","type":"array","uniqueItems":true,"items":{"type":"string"}},"schemaVersion":{"description":"Version of schema. Should increment for breaking changes to the schema","type":"number","minimum":1}},"required":["id","created_at","schemaType"]};function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="http://mapeo.world/schemas/common/v1.json" */;let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((((data.id === undefined) && (missing0 = "id")) || ((data.created_at === undefined) && (missing0 = "created_at"))) || ((data.schemaType === undefined) && (missing0 = "schemaType"))){validate10.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.id !== undefined){const _errs1 = errors;if(typeof data.id !== "string"){validate10.errors = [{instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.version !== undefined){const _errs3 = errors;if(typeof data.version !== "string"){validate10.errors = [{instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.created_at !== undefined){const _errs5 = errors;if(errors === _errs5){if(errors === _errs5){if(!(typeof data.created_at === "string")){validate10.errors = [{instancePath:instancePath+"/created_at",schemaPath:"#/properties/created_at/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid0 = _errs5 === errors;}else {var valid0 = true;}if(valid0){if(data.timestamp !== undefined){const _errs7 = errors;if(errors === _errs7){if(errors === _errs7){if(!(typeof data.timestamp === "string")){validate10.errors = [{instancePath:instancePath+"/timestamp",schemaPath:"#/properties/timestamp/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid0 = _errs7 === errors;}else {var valid0 = true;}if(valid0){if(data.userId !== undefined){const _errs9 = errors;if(typeof data.userId !== "string"){validate10.errors = [{instancePath:instancePath+"/userId",schemaPath:"#/properties/userId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs9 === errors;}else {var valid0 = true;}if(valid0){if(data.deviceId !== undefined){const _errs11 = errors;if(typeof data.deviceId !== "string"){validate10.errors = [{instancePath:instancePath+"/deviceId",schemaPath:"#/properties/deviceId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs11 === errors;}else {var valid0 = true;}if(valid0){if(data.schemaType !== undefined){const _errs13 = errors;if(typeof data.schemaType !== "string"){validate10.errors = [{instancePath:instancePath+"/schemaType",schemaPath:"#/properties/schemaType/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs13 === errors;}else {var valid0 = true;}if(valid0){if(data.links !== undefined){let data7 = data.links;const _errs15 = errors;if(errors === _errs15){if(Array.isArray(data7)){var valid1 = true;const len0 = data7.length;for(let i0=0; i0<len0; i0++){const _errs17 = errors;if(typeof data7[i0] !== "string"){validate10.errors = [{instancePath:instancePath+"/links/" + i0,schemaPath:"#/properties/links/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid1 = _errs17 === errors;if(!valid1){break;}}if(valid1){let i1 = data7.length;let j0;if(i1 > 1){const indices0 = {};for(;i1--;){let item0 = data7[i1];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j0 = indices0[item0];validate10.errors = [{instancePath:instancePath+"/links",schemaPath:"#/properties/links/uniqueItems",keyword:"uniqueItems",params:{i: i1, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i1+" are identical)"}];return false;break;}indices0[item0] = i1;}}}}else {validate10.errors = [{instancePath:instancePath+"/links",schemaPath:"#/properties/links/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs15 === errors;}else {var valid0 = true;}if(valid0){if(data.schemaVersion !== undefined){let data9 = data.schemaVersion;const _errs19 = errors;if(errors === _errs19){if((typeof data9 == "number") && (isFinite(data9))){if(data9 < 1 || isNaN(data9)){validate10.errors = [{instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}else {validate10.errors = [{instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid0 = _errs19 === errors;}else {var valid0 = true;}}}}}}}}}}}else {validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate10.errors = vErrors;return errors === 0;}export const CoreOwnership_1 = validate11;const schema12 = {"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://mapeo.world/schemas/coreOwnership/v1.json","title":"CoreOwnership","type":"object","allOf":[{"$ref":"../common/v1.json"}],"properties":{"schemaType":{"type":"string","pattern":"^coreOwnership$"},"action":{"type":"string","enum":["core:owner"]},"schemaVersion":{"type":"number","minimum":1,"enum":[1]},"coreId":{"type":"string"},"projectId":{"type":"string"},"storeType":{"type":"string"},"signature":{"type":"string"},"authorIndex":{"type":"integer"},"deviceIndex":{"type":"integer"}}};const pattern0 = new RegExp("^coreOwnership$", "u");function validate11(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="http://mapeo.world/schemas/coreOwnership/v1.json" */;let vErrors = null;let errors = 0;const _errs2 = errors;if(errors === _errs2){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((((data.id === undefined) && (missing0 = "id")) || ((data.created_at === undefined) && (missing0 = "created_at"))) || ((data.schemaType === undefined) && (missing0 = "schemaType"))){validate11.errors = [{instancePath,schemaPath:"../common/v1.json/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.id !== undefined){const _errs4 = errors;if(typeof data.id !== "string"){validate11.errors = [{instancePath:instancePath+"/id",schemaPath:"../common/v1.json/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs4 === errors;}else {var valid2 = true;}if(valid2){if(data.version !== undefined){const _errs6 = errors;if(typeof data.version !== "string"){validate11.errors = [{instancePath:instancePath+"/version",schemaPath:"../common/v1.json/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs6 === errors;}else {var valid2 = true;}if(valid2){if(data.created_at !== undefined){const _errs8 = errors;if(errors === _errs8){if(errors === _errs8){if(!(typeof data.created_at === "string")){validate11.errors = [{instancePath:instancePath+"/created_at",schemaPath:"../common/v1.json/properties/created_at/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid2 = _errs8 === errors;}else {var valid2 = true;}if(valid2){if(data.timestamp !== undefined){const _errs10 = errors;if(errors === _errs10){if(errors === _errs10){if(!(typeof data.timestamp === "string")){validate11.errors = [{instancePath:instancePath+"/timestamp",schemaPath:"../common/v1.json/properties/timestamp/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid2 = _errs10 === errors;}else {var valid2 = true;}if(valid2){if(data.userId !== undefined){const _errs12 = errors;if(typeof data.userId !== "string"){validate11.errors = [{instancePath:instancePath+"/userId",schemaPath:"../common/v1.json/properties/userId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs12 === errors;}else {var valid2 = true;}if(valid2){if(data.deviceId !== undefined){const _errs14 = errors;if(typeof data.deviceId !== "string"){validate11.errors = [{instancePath:instancePath+"/deviceId",schemaPath:"../common/v1.json/properties/deviceId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs14 === errors;}else {var valid2 = true;}if(valid2){if(data.schemaType !== undefined){const _errs16 = errors;if(typeof data.schemaType !== "string"){validate11.errors = [{instancePath:instancePath+"/schemaType",schemaPath:"../common/v1.json/properties/schemaType/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs16 === errors;}else {var valid2 = true;}if(valid2){if(data.links !== undefined){let data7 = data.links;const _errs18 = errors;if(errors === _errs18){if(Array.isArray(data7)){var valid3 = true;const len0 = data7.length;for(let i0=0; i0<len0; i0++){const _errs20 = errors;if(typeof data7[i0] !== "string"){validate11.errors = [{instancePath:instancePath+"/links/" + i0,schemaPath:"../common/v1.json/properties/links/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid3 = _errs20 === errors;if(!valid3){break;}}if(valid3){let i1 = data7.length;let j0;if(i1 > 1){const indices0 = {};for(;i1--;){let item0 = data7[i1];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j0 = indices0[item0];validate11.errors = [{instancePath:instancePath+"/links",schemaPath:"../common/v1.json/properties/links/uniqueItems",keyword:"uniqueItems",params:{i: i1, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i1+" are identical)"}];return false;break;}indices0[item0] = i1;}}}}else {validate11.errors = [{instancePath:instancePath+"/links",schemaPath:"../common/v1.json/properties/links/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid2 = _errs18 === errors;}else {var valid2 = true;}if(valid2){if(data.schemaVersion !== undefined){let data9 = data.schemaVersion;const _errs22 = errors;if(errors === _errs22){if((typeof data9 == "number") && (isFinite(data9))){if(data9 < 1 || isNaN(data9)){validate11.errors = [{instancePath:instancePath+"/schemaVersion",schemaPath:"../common/v1.json/properties/schemaVersion/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}else {validate11.errors = [{instancePath:instancePath+"/schemaVersion",schemaPath:"../common/v1.json/properties/schemaVersion/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid2 = _errs22 === errors;}else {var valid2 = true;}}}}}}}}}}}else {validate11.errors = [{instancePath,schemaPath:"../common/v1.json/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaType !== undefined){let data10 = data.schemaType;const _errs24 = errors;if(errors === _errs24){if(typeof data10 === "string"){if(!pattern0.test(data10)){validate11.errors = [{instancePath:instancePath+"/schemaType",schemaPath:"#/properties/schemaType/pattern",keyword:"pattern",params:{pattern: "^coreOwnership$"},message:"must match pattern \""+"^coreOwnership$"+"\""}];return false;}}else {validate11.errors = [{instancePath:instancePath+"/schemaType",schemaPath:"#/properties/schemaType/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid5 = _errs24 === errors;}else {var valid5 = true;}if(valid5){if(data.action !== undefined){let data11 = data.action;const _errs26 = errors;if(typeof data11 !== "string"){validate11.errors = [{instancePath:instancePath+"/action",schemaPath:"#/properties/action/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(data11 === "core:owner")){validate11.errors = [{instancePath:instancePath+"/action",schemaPath:"#/properties/action/enum",keyword:"enum",params:{allowedValues: schema12.properties.action.enum},message:"must be equal to one of the allowed values"}];return false;}var valid5 = _errs26 === errors;}else {var valid5 = true;}if(valid5){if(data.schemaVersion !== undefined){let data12 = data.schemaVersion;const _errs28 = errors;if(!(data12 === 1)){validate11.errors = [{instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/enum",keyword:"enum",params:{allowedValues: schema12.properties.schemaVersion.enum},message:"must be equal to one of the allowed values"}];return false;}if(errors === _errs28){if((typeof data12 == "number") && (isFinite(data12))){if(data12 < 1 || isNaN(data12)){validate11.errors = [{instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}else {validate11.errors = [{instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid5 = _errs28 === errors;}else {var valid5 = true;}if(valid5){if(data.coreId !== undefined){const _errs30 = errors;if(typeof data.coreId !== "string"){validate11.errors = [{instancePath:instancePath+"/coreId",schemaPath:"#/properties/coreId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid5 = _errs30 === errors;}else {var valid5 = true;}if(valid5){if(data.projectId !== undefined){const _errs32 = errors;if(typeof data.projectId !== "string"){validate11.errors = [{instancePath:instancePath+"/projectId",schemaPath:"#/properties/projectId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid5 = _errs32 === errors;}else {var valid5 = true;}if(valid5){if(data.storeType !== undefined){const _errs34 = errors;if(typeof data.storeType !== "string"){validate11.errors = [{instancePath:instancePath+"/storeType",schemaPath:"#/properties/storeType/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid5 = _errs34 === errors;}else {var valid5 = true;}if(valid5){if(data.signature !== undefined){const _errs36 = errors;if(typeof data.signature !== "string"){validate11.errors = [{instancePath:instancePath+"/signature",schemaPath:"#/properties/signature/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid5 = _errs36 === errors;}else {var valid5 = true;}if(valid5){if(data.authorIndex !== undefined){let data17 = data.authorIndex;const _errs38 = errors;if(!(((typeof data17 == "number") && (!(data17 % 1) && !isNaN(data17))) && (isFinite(data17)))){validate11.errors = [{instancePath:instancePath+"/authorIndex",schemaPath:"#/properties/authorIndex/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}var valid5 = _errs38 === errors;}else {var valid5 = true;}if(valid5){if(data.deviceIndex !== undefined){let data18 = data.deviceIndex;const _errs40 = errors;if(!(((typeof data18 == "number") && (!(data18 % 1) && !isNaN(data18))) && (isFinite(data18)))){validate11.errors = [{instancePath:instancePath+"/deviceIndex",schemaPath:"#/properties/deviceIndex/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}var valid5 = _errs40 === errors;}else {var valid5 = true;}}}}}}}}}}else {validate11.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate11.errors = vErrors;return errors === 0;}export const Device_1 = validate12;const schema14 = {"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://mapeo.world/schemas/device/v1.json","title":"Device","type":"object","allOf":[{"$ref":"../common/v1.json"}],"properties":{"schemaType":{"type":"string","pattern":"^Device$"},"action":{"type":"string","enum":["device:add","device:remove","device:restore"]},"authorId":{"type":"string"},"projectId":{"type":"string"},"signature":{"type":"string"},"authorIndex":{"type":"integer"},"deviceIndex":{"type":"integer"}}};const pattern1 = new RegExp("^Device$", "u");function validate12(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="http://mapeo.world/schemas/device/v1.json" */;let vErrors = null;let errors = 0;const _errs2 = errors;if(errors === _errs2){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((((data.id === undefined) && (missing0 = "id")) || ((data.created_at === undefined) && (missing0 = "created_at"))) || ((data.schemaType === undefined) && (missing0 = "schemaType"))){validate12.errors = [{instancePath,schemaPath:"../common/v1.json/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.id !== undefined){const _errs4 = errors;if(typeof data.id !== "string"){validate12.errors = [{instancePath:instancePath+"/id",schemaPath:"../common/v1.json/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs4 === errors;}else {var valid2 = true;}if(valid2){if(data.version !== undefined){const _errs6 = errors;if(typeof data.version !== "string"){validate12.errors = [{instancePath:instancePath+"/version",schemaPath:"../common/v1.json/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs6 === errors;}else {var valid2 = true;}if(valid2){if(data.created_at !== undefined){const _errs8 = errors;if(errors === _errs8){if(errors === _errs8){if(!(typeof data.created_at === "string")){validate12.errors = [{instancePath:instancePath+"/created_at",schemaPath:"../common/v1.json/properties/created_at/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid2 = _errs8 === errors;}else {var valid2 = true;}if(valid2){if(data.timestamp !== undefined){const _errs10 = errors;if(errors === _errs10){if(errors === _errs10){if(!(typeof data.timestamp === "string")){validate12.errors = [{instancePath:instancePath+"/timestamp",schemaPath:"../common/v1.json/properties/timestamp/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid2 = _errs10 === errors;}else {var valid2 = true;}if(valid2){if(data.userId !== undefined){const _errs12 = errors;if(typeof data.userId !== "string"){validate12.errors = [{instancePath:instancePath+"/userId",schemaPath:"../common/v1.json/properties/userId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs12 === errors;}else {var valid2 = true;}if(valid2){if(data.deviceId !== undefined){const _errs14 = errors;if(typeof data.deviceId !== "string"){validate12.errors = [{instancePath:instancePath+"/deviceId",schemaPath:"../common/v1.json/properties/deviceId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs14 === errors;}else {var valid2 = true;}if(valid2){if(data.schemaType !== undefined){const _errs16 = errors;if(typeof data.schemaType !== "string"){validate12.errors = [{instancePath:instancePath+"/schemaType",schemaPath:"../common/v1.json/properties/schemaType/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs16 === errors;}else {var valid2 = true;}if(valid2){if(data.links !== undefined){let data7 = data.links;const _errs18 = errors;if(errors === _errs18){if(Array.isArray(data7)){var valid3 = true;const len0 = data7.length;for(let i0=0; i0<len0; i0++){const _errs20 = errors;if(typeof data7[i0] !== "string"){validate12.errors = [{instancePath:instancePath+"/links/" + i0,schemaPath:"../common/v1.json/properties/links/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid3 = _errs20 === errors;if(!valid3){break;}}if(valid3){let i1 = data7.length;let j0;if(i1 > 1){const indices0 = {};for(;i1--;){let item0 = data7[i1];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j0 = indices0[item0];validate12.errors = [{instancePath:instancePath+"/links",schemaPath:"../common/v1.json/properties/links/uniqueItems",keyword:"uniqueItems",params:{i: i1, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i1+" are identical)"}];return false;break;}indices0[item0] = i1;}}}}else {validate12.errors = [{instancePath:instancePath+"/links",schemaPath:"../common/v1.json/properties/links/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid2 = _errs18 === errors;}else {var valid2 = true;}if(valid2){if(data.schemaVersion !== undefined){let data9 = data.schemaVersion;const _errs22 = errors;if(errors === _errs22){if((typeof data9 == "number") && (isFinite(data9))){if(data9 < 1 || isNaN(data9)){validate12.errors = [{instancePath:instancePath+"/schemaVersion",schemaPath:"../common/v1.json/properties/schemaVersion/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"}];return false;}}else {validate12.errors = [{instancePath:instancePath+"/schemaVersion",schemaPath:"../common/v1.json/properties/schemaVersion/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid2 = _errs22 === errors;}else {var valid2 = true;}}}}}}}}}}}else {validate12.errors = [{instancePath,schemaPath:"../common/v1.json/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaType !== undefined){let data10 = data.schemaType;const _errs24 = errors;if(errors === _errs24){if(typeof data10 === "string"){if(!pattern1.test(data10)){validate12.errors = [{instancePath:instancePath+"/schemaType",schemaPath:"#/properties/schemaType/pattern",keyword:"pattern",params:{pattern: "^Device$"},message:"must match pattern \""+"^Device$"+"\""}];return false;}}else {validate12.errors = [{instancePath:instancePath+"/schemaType",schemaPath:"#/properties/schemaType/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid5 = _errs24 === errors;}else {var valid5 = true;}if(valid5){if(data.action !== undefined){let data11 = data.action;const _errs26 = errors;if(typeof data11 !== "string"){validate12.errors = [{instancePath:instancePath+"/action",schemaPath:"#/properties/action/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(((data11 === "device:add") || (data11 === "device:remove")) || (data11 === "device:restore"))){validate12.errors = [{instancePath:instancePath+"/action",schemaPath:"#/properties/action/enum",keyword:"enum",params:{allowedValues: schema14.properties.action.enum},message:"must be equal to one of the allowed values"}];return false;}var valid5 = _errs26 === errors;}else {var valid5 = true;}if(valid5){if(data.authorId !== undefined){const _errs28 = errors;if(typeof data.authorId !== "string"){validate12.errors = [{instancePath:instancePath+"/authorId",schemaPath:"#/properties/authorId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid5 = _errs28 === errors;}else {var valid5 = true;}if(valid5){if(data.projectId !== undefined){const _errs30 = errors;if(typeof data.projectId !== "string"){validate12.errors = [{instancePath:instancePath+"/projectId",schemaPath:"#/properties/projectId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid5 = _errs30 === errors;}else {var valid5 = true;}if(valid5){if(data.signature !== undefined){const _errs32 = errors;if(typeof data.signature !== "string"){validate12.errors = [{instancePath:instancePath+"/signature",schemaPath:"#/properties/signature/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid5 = _errs32 === errors;}else {var valid5 = true;}if(valid5){if(data.authorIndex !== undefined){let data15 = data.authorIndex;const _errs34 = errors;if(!(((typeof data15 == "number") && (!(data15 % 1) && !isNaN(data15))) && (isFinite(data15)))){validate12.errors = [{instancePath:instancePath+"/authorIndex",schemaPath:"#/properties/authorIndex/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}var valid5 = _errs34 === errors;}else {var valid5 = true;}if(valid5){if(data.deviceIndex !== undefined){let data16 = data.deviceIndex;const _errs36 = errors;if(!(((typeof data16 == "number") && (!(data16 % 1) && !isNaN(data16))) && (isFinite(data16)))){validate12.errors = [{instancePath:instancePath+"/deviceIndex",schemaPath:"#/properties/deviceIndex/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}var valid5 = _errs36 === errors;}else {var valid5 = true;}}}}}}}}else {validate12.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate12.errors = vErrors;return errors === 0;}export const Field_1 = validate13;const schema16 = {"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://mapeo.world/schemas/field.json","title":"Field","description":"A field defines a form field that will be shown to the user when creating or editing a map entity. Presets define which fields are shown to the user for a particular map entity. The field definition defines whether the field should show as a text box, multiple choice, single-select, etc. It defines what tag-value is set when the field is entered.","type":"object","properties":{"id":{"description":"Unique value that identifies this element","type":"string"},"key":{"description":"They key in a tags object that this field applies to. For nested properties, key can be an array e.g. for tags = `{ foo: { bar: 1 } }` the key is `['foo', 'bar']`","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"type":{"description":"Type of field - defines how the field is displayed to the user.","type":"string","meta:enum":{"text":"Freeform text field","localized":"Text field with localization abilities (e.g. name=*, name:es=*, etc.). Currently only supported in Mapeo Desktop territory view.","number":"Allows only numbers","select_one":"Select one item from a list of pre-defined options","select_multiple":"Select any number of items from a list of pre-defined options","date":"Select a date","datetime":"Select a date and time"},"enum":["text","localized","number","select_one","select_multiple","date","datetime"]},"label":{"description":"Default language label for the form field label","type":"string"},"readonly":{"description":"Field is displayed, but it can't be edited","type":"boolean","default":false},"appearance":{"description":"For text fields, display as a single-line or multi-line field","type":"string","meta:enum":{"singleline":"Text will be cut-off if more than one line","multiline":"Text will wrap to multiple lines within text field"},"enum":["singleline","multiline"],"default":"multiline"},"snake_case":{"description":"Convert field value into snake_case (replace spaces with underscores and convert to lowercase)","type":"boolean","default":false},"options":{"description":"List of options the user can select for single- or multi-select fields","type":"array","items":{"anyOf":[{"type":"string"},{"type":"boolean"},{"type":"number"},{"type":"null"},{"type":"object","properties":{"label":{"description":"Label in default language to display to the user for this option","type":"string"},"value":{"description":"Value for tag when this option is selected","anyOf":[{"type":"string"},{"type":"boolean"},{"type":"number"},{"type":"null"}]}},"required":["value"]}]}},"universal":{"description":"If true, this field will appear in the Add Field list for all presets","type":"boolean","default":false},"placeholder":{"description":"Displayed as a placeholder in an empty text or number field before the user begins typing. Use 'helperText' for important information, because the placeholder is not visible after the user has entered data.","type":"string"},"helperText":{"description":"Additional context about the field, e.g. hints about how to answer the question.","type":"string"},"min_value":{"description":"Minimum field value (number, date or datetime fields only). For date or datetime fields, is seconds since unix epoch","type":"integer"},"max_value":{"description":"Maximum field value (number, date or datetime fields only). For date or datetime fields, is seconds since unix epoch","type":"integer"}},"required":["id","key","type"],"additionalProperties":false};const func2 = Object.prototype.hasOwnProperty;function validate13(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="http://mapeo.world/schemas/field.json" */;let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((((data.id === undefined) && (missing0 = "id")) || ((data.key === undefined) && (missing0 = "key"))) || ((data.type === undefined) && (missing0 = "type"))){validate13.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs1 = errors;for(const key0 in data){if(!(func2.call(schema16.properties, key0))){validate13.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.id !== undefined){const _errs2 = errors;if(typeof data.id !== "string"){validate13.errors = [{instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.key !== undefined){let data1 = data.key;const _errs4 = errors;const _errs5 = errors;let valid1 = false;let passing0 = null;const _errs6 = errors;if(typeof data1 !== "string"){const err0 = {instancePath:instancePath+"/key",schemaPath:"#/properties/key/oneOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}var _valid0 = _errs6 === errors;if(_valid0){valid1 = true;passing0 = 0;}const _errs8 = errors;if(errors === _errs8){if(Array.isArray(data1)){var valid2 = true;const len0 = data1.length;for(let i0=0; i0<len0; i0++){const _errs10 = errors;if(typeof data1[i0] !== "string"){const err1 = {instancePath:instancePath+"/key/" + i0,schemaPath:"#/properties/key/oneOf/1/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var valid2 = _errs10 === errors;if(!valid2){break;}}}else {const err2 = {instancePath:instancePath+"/key",schemaPath:"#/properties/key/oneOf/1/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}var _valid0 = _errs8 === errors;if(_valid0 && valid1){valid1 = false;passing0 = [passing0, 1];}else {if(_valid0){valid1 = true;passing0 = 1;}}if(!valid1){const err3 = {instancePath:instancePath+"/key",schemaPath:"#/properties/key/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;validate13.errors = vErrors;return false;}else {errors = _errs5;if(vErrors !== null){if(_errs5){vErrors.length = _errs5;}else {vErrors = null;}}}var valid0 = _errs4 === errors;}else {var valid0 = true;}if(valid0){if(data.type !== undefined){let data3 = data.type;const _errs12 = errors;if(typeof data3 !== "string"){validate13.errors = [{instancePath:instancePath+"/type",schemaPath:"#/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(((((((data3 === "text") || (data3 === "localized")) || (data3 === "number")) || (data3 === "select_one")) || (data3 === "select_multiple")) || (data3 === "date")) || (data3 === "datetime"))){validate13.errors = [{instancePath:instancePath+"/type",schemaPath:"#/properties/type/enum",keyword:"enum",params:{allowedValues: schema16.properties.type.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs12 === errors;}else {var valid0 = true;}if(valid0){if(data.label !== undefined){const _errs14 = errors;if(typeof data.label !== "string"){validate13.errors = [{instancePath:instancePath+"/label",schemaPath:"#/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs14 === errors;}else {var valid0 = true;}if(valid0){if(data.readonly !== undefined){const _errs16 = errors;if(typeof data.readonly !== "boolean"){validate13.errors = [{instancePath:instancePath+"/readonly",schemaPath:"#/properties/readonly/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs16 === errors;}else {var valid0 = true;}if(valid0){if(data.appearance !== undefined){let data6 = data.appearance;const _errs18 = errors;if(typeof data6 !== "string"){validate13.errors = [{instancePath:instancePath+"/appearance",schemaPath:"#/properties/appearance/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!((data6 === "singleline") || (data6 === "multiline"))){validate13.errors = [{instancePath:instancePath+"/appearance",schemaPath:"#/properties/appearance/enum",keyword:"enum",params:{allowedValues: schema16.properties.appearance.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs18 === errors;}else {var valid0 = true;}if(valid0){if(data.snake_case !== undefined){const _errs20 = errors;if(typeof data.snake_case !== "boolean"){validate13.errors = [{instancePath:instancePath+"/snake_case",schemaPath:"#/properties/snake_case/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs20 === errors;}else {var valid0 = true;}if(valid0){if(data.options !== undefined){let data8 = data.options;const _errs22 = errors;if(errors === _errs22){if(Array.isArray(data8)){var valid3 = true;const len1 = data8.length;for(let i1=0; i1<len1; i1++){let data9 = data8[i1];const _errs24 = errors;const _errs25 = errors;let valid4 = false;const _errs26 = errors;if(typeof data9 !== "string"){const err4 = {instancePath:instancePath+"/options/" + i1,schemaPath:"#/properties/options/items/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var _valid1 = _errs26 === errors;valid4 = valid4 || _valid1;if(!valid4){const _errs28 = errors;if(typeof data9 !== "boolean"){const err5 = {instancePath:instancePath+"/options/" + i1,schemaPath:"#/properties/options/items/anyOf/1/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}var _valid1 = _errs28 === errors;valid4 = valid4 || _valid1;if(!valid4){const _errs30 = errors;if(!((typeof data9 == "number") && (isFinite(data9)))){const err6 = {instancePath:instancePath+"/options/" + i1,schemaPath:"#/properties/options/items/anyOf/2/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var _valid1 = _errs30 === errors;valid4 = valid4 || _valid1;if(!valid4){const _errs32 = errors;if(data9 !== null){const err7 = {instancePath:instancePath+"/options/" + i1,schemaPath:"#/properties/options/items/anyOf/3/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}var _valid1 = _errs32 === errors;valid4 = valid4 || _valid1;if(!valid4){const _errs34 = errors;if(errors === _errs34){if(data9 && typeof data9 == "object" && !Array.isArray(data9)){let missing1;if((data9.value === undefined) && (missing1 = "value")){const err8 = {instancePath:instancePath+"/options/" + i1,schemaPath:"#/properties/options/items/anyOf/4/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {if(data9.label !== undefined){const _errs36 = errors;if(typeof data9.label !== "string"){const err9 = {instancePath:instancePath+"/options/" + i1+"/label",schemaPath:"#/properties/options/items/anyOf/4/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}var valid5 = _errs36 === errors;}else {var valid5 = true;}if(valid5){if(data9.value !== undefined){let data11 = data9.value;const _errs38 = errors;const _errs39 = errors;let valid6 = false;const _errs40 = errors;if(typeof data11 !== "string"){const err10 = {instancePath:instancePath+"/options/" + i1+"/value",schemaPath:"#/properties/options/items/anyOf/4/properties/value/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}var _valid2 = _errs40 === errors;valid6 = valid6 || _valid2;if(!valid6){const _errs42 = errors;if(typeof data11 !== "boolean"){const err11 = {instancePath:instancePath+"/options/" + i1+"/value",schemaPath:"#/properties/options/items/anyOf/4/properties/value/anyOf/1/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var _valid2 = _errs42 === errors;valid6 = valid6 || _valid2;if(!valid6){const _errs44 = errors;if(!((typeof data11 == "number") && (isFinite(data11)))){const err12 = {instancePath:instancePath+"/options/" + i1+"/value",schemaPath:"#/properties/options/items/anyOf/4/properties/value/anyOf/2/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}var _valid2 = _errs44 === errors;valid6 = valid6 || _valid2;if(!valid6){const _errs46 = errors;if(data11 !== null){const err13 = {instancePath:instancePath+"/options/" + i1+"/value",schemaPath:"#/properties/options/items/anyOf/4/properties/value/anyOf/3/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}var _valid2 = _errs46 === errors;valid6 = valid6 || _valid2;}}}if(!valid6){const err14 = {instancePath:instancePath+"/options/" + i1+"/value",schemaPath:"#/properties/options/items/anyOf/4/properties/value/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}else {errors = _errs39;if(vErrors !== null){if(_errs39){vErrors.length = _errs39;}else {vErrors = null;}}}var valid5 = _errs38 === errors;}else {var valid5 = true;}}}}else {const err15 = {instancePath:instancePath+"/options/" + i1,schemaPath:"#/properties/options/items/anyOf/4/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}var _valid1 = _errs34 === errors;valid4 = valid4 || _valid1;}}}}if(!valid4){const err16 = {instancePath:instancePath+"/options/" + i1,schemaPath:"#/properties/options/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;validate13.errors = vErrors;return false;}else {errors = _errs25;if(vErrors !== null){if(_errs25){vErrors.length = _errs25;}else {vErrors = null;}}}var valid3 = _errs24 === errors;if(!valid3){break;}}}else {validate13.errors = [{instancePath:instancePath+"/options",schemaPath:"#/properties/options/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs22 === errors;}else {var valid0 = true;}if(valid0){if(data.universal !== undefined){const _errs48 = errors;if(typeof data.universal !== "boolean"){validate13.errors = [{instancePath:instancePath+"/universal",schemaPath:"#/properties/universal/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs48 === errors;}else {var valid0 = true;}if(valid0){if(data.placeholder !== undefined){const _errs50 = errors;if(typeof data.placeholder !== "string"){validate13.errors = [{instancePath:instancePath+"/placeholder",schemaPath:"#/properties/placeholder/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs50 === errors;}else {var valid0 = true;}if(valid0){if(data.helperText !== undefined){const _errs52 = errors;if(typeof data.helperText !== "string"){validate13.errors = [{instancePath:instancePath+"/helperText",schemaPath:"#/properties/helperText/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs52 === errors;}else {var valid0 = true;}if(valid0){if(data.min_value !== undefined){let data15 = data.min_value;const _errs54 = errors;if(!(((typeof data15 == "number") && (!(data15 % 1) && !isNaN(data15))) && (isFinite(data15)))){validate13.errors = [{instancePath:instancePath+"/min_value",schemaPath:"#/properties/min_value/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}var valid0 = _errs54 === errors;}else {var valid0 = true;}if(valid0){if(data.max_value !== undefined){let data16 = data.max_value;const _errs56 = errors;if(!(((typeof data16 == "number") && (!(data16 % 1) && !isNaN(data16))) && (isFinite(data16)))){validate13.errors = [{instancePath:instancePath+"/max_value",schemaPath:"#/properties/max_value/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];return false;}var valid0 = _errs56 === errors;}else {var valid0 = true;}}}}}}}}}}}}}}}}else {validate13.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate13.errors = vErrors;return errors === 0;}export const Filter_1 = validate14;const schema17 = {"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://mapeo.world/schemas/filter.json","title":"Filter","description":"A filter is a saved view of data in the Mapeo database, filtered by tag or date. E.g. a filter could define observations between two dates, or only observations with the tag `public=true`","type":"object","properties":{"id":{"description":"Unique value that identifies this element","type":"string"},"version":{"description":"Unique value that identifies this particular version of this element","type":"string"},"created_at":{"description":"RFC3339-formatted datetime of when the first version of the element was created","type":"string","format":"date-time"},"timestamp":{"description":"RFC3339-formatted datetime of when this version of the element was created","type":"string","format":"date-time"},"userId":{"description":"ID of the user who edited/created this record","type":"string"},"deviceId":{"description":"ID of the device that made this edit","type":"string"},"type":{"description":"Must be `filter`","type":"string","enum":["filter"]},"links":{"description":"Version ids of the previous document versions this one is replacing","type":"array","uniqueItems":true,"items":{"type":"string"}},"schemaVersion":{"description":"Version of this schema. Should increment for breaking changes to the schema","type":"number","minimum":1,"enum":[1]},"filter":{"type":"array","description":"A filter expression as defined in https://docs.mapbox.com/mapbox-gl-js/style-spec/#other-filter but where the special fields `$type` refers to the mapeo type (observation, node, way etc) and `$id` is the mapeo id."},"name":{"type":"string","description":"A human-readable name for this filter."}},"required":["id","version","created_at","type","schemaVersion","filter","name"]};function validate14(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){/*# sourceURL="http://mapeo.world/schemas/filter.json" */;let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((((((((data.id === undefined) && (missing0 = "id")) || ((data.version === undefined) && (missing0 = "version"))) || ((data.created_at === undefined) && (missing0 = "created_at"))) || ((data.type === undefined) && (missing0 = "type"))) || ((data.schemaVersion === undefined) && (missing0 = "schemaVersion"))) || ((data.filter === undefined) && (missing0 = "filter"))) || ((data.name === undefined) && (missing0 = "name"))){validate14.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {if(data.id !== undefined){const _errs1 = errors;if(typeof data.id !== "string"){validate14.errors = [{instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs1 === errors;}else {var valid0 = true;}if(valid0){if(data.version !== undefined){const _errs3 = errors;if(typeof data.version !== "string"){validate14.errors = [{instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs3 === errors;}else {var valid0 = true;}if(valid0){if(data.created_at !== undefined){const _errs5 = errors;if(errors === _errs5){if(errors === _errs5){if(!(typeof data.created_at === "string")){validate14.errors = [{instancePath:instancePath+"/created_at",schemaPath:"#/properties/created_at/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid0 = _errs5 === errors;}else {var valid0 = true;}if(valid0){if(data.timestamp !== undefined){const _errs7 = errors;if(errors === _errs7){if(errors === _errs7){if(!(typeof data.timestamp === "string")){validate14.errors = [{instancePath:instancePath+"/timestamp",schemaPath:"#/properties/timestamp/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}}var valid0 = _errs7 === errors;}else {var valid0 = true;}if(valid0){if(data.userId !== undefined){const _errs9 = errors;if(typeof data.userId !== "string"){validate14.errors = [{instancePath:instancePath+"/userId",schemaPath:"#/properties/userId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs9 === errors;}else {var valid0 = true;}if(valid0){if(data.deviceId !== undefined){const _errs11 = errors;if(typeof data.deviceId !== "string"){validate14.errors = [{instancePath:instancePath+"/deviceId",schemaPath:"#/properties/deviceId/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs11 === errors;}else {var valid0 = true;}if(valid0){if(data.type !== undefined){let data6 = data.type;const _errs13 = errors;if(typeof data6 !== "string"){validate14.errors = [{instancePath:instancePath+"/type",schemaPath:"#/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(data6 === "filter")){validate14.errors = [{instancePath:instancePath+"/type",schemaPath:"#/properties/type/enum",keyword:"enum",params:{allowedValues: schema17.properties.type.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs13 === errors;}else {var valid0 = true;}if(valid0){if(data.links !== undefined){let data7 = data.links;const _errs15 = errors;if(errors === _errs15){if(Array.isArray(data7)){var valid1 = true;const len0 = data7.length;for(let i0=0; i0<len0; i0++){const _errs17 = errors;if(typeof data7[i0] !== "string"){validate14.errors = [{instancePath:instanc