@fluid-experimental/property-changeset 2.71.0 → 2.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"templateValidator.js","sourceRoot":"","sources":["../src/templateValidator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;;;GAIG;AAEH,6CAA6C;AAE7C,+CAA+C;AAE/C,yEAA8E;AAC9E,iCAA8B;AAC9B,uEAA4C;AAC5C,yEAA8C;AAC9C,6DAAkC;AAClC,+DAAoC;AACpC,6DAAkC;AAClC,2DAAgC;AAChC,qEAA0C;AAC1C,mEAAwC;AACxC,mEAAwC;AACxC,qEAA0C;AAC1C,qEAA0C;AAC1C,2DAAgC;AAChC,uEAA4C;AAC5C,mCAAyD;AACzD,wDAAgC;AAEhC,qDAA8C;AAC9C,+DAAyD;AACzD,2DAAqD;AACrD,6EAA+F;AAE/F,MAAM,EAAE,GAAG,EAAE,GAAG,2BAAS,CAAC;AAE1B,MAAM,gBAAgB,GAAG,2BAAU,CAAC,OAAO,CAAC,kCAAc,CAAC,CAAC;AAyB5D;;;;;;GAMG;AACH,MAAM,YAAY,GAAG;IACpB,KAAK,EAAE,CAAC,EAAE,qBAAqB;IAC/B,KAAK,EAAE,CAAC,EAAE,qBAAqB;IAC/B,KAAK,EAAE,CAAC,EAAE,qBAAqB;IAE/B,UAAU,EAAE,CAAC,EAAE,6BAA6B;IAC5C,QAAQ,EAAE,CAAC,EAAE,6BAA6B;IAC1C,QAAQ,EAAE,CAAC,EAAE,6BAA6B;IAC1C,QAAQ,EAAE,CAAC,EAAE,6BAA6B;CAC1C,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAEjE,MAAM,cAAc,GAAG,UAAU,iBAAyB;IACzD,2DAA2D;IAC3D,IAAI,CAAC,IAAA,qBAAQ,EA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,mBAAmB,CAAC,CAAC;oBAClE,MAAM;gBACP,KAAK,CAAC;oBACL,wBAAwB;oBACxB,0BAA0B,CAAC,IAAI,CAC9B,IAAI,EACJ,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,eAAe,CACf,CAAC;oBACF,MAAM;gBACP,QAAQ;gBACR,KAAK,CAAC,CAAC;oBACN,gDAAgD;oBAChD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAC3B,IAAI,KAAK,CACR,GAAG,CAAC,oBAAoB;wBACvB,IAAI,CAAC,SAAS,CAAC;4BACd,OAAO,EAAE,OAAO;4BAChB,QAAQ,EAAE,eAAe;yBACzB,CAAC,CACH,CACD,CAAC;oBACF,MAAM;YACR,CAAC;YAED,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;;AAhSF,8CAiSC;AAhSO,uBAAK,GAAG,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview\n * @description The TemplateValidator can examine consecutive versions of a given template to detect semantic\n * versioning (semver) errors and warn about incorrect versioning practices.\n */\n\n// There are lots of violations in this file.\n\n/* eslint-disable jsdoc/check-line-alignment */\n\nimport { constants, ConsoleUtils } from \"@fluid-experimental/property-common\";\nimport { queue } from \"async\";\nimport cloneDeep from \"lodash/cloneDeep.js\";\nimport difference from \"lodash/difference.js\";\nimport each from \"lodash/each.js\";\nimport every from \"lodash/every.js\";\nimport find from \"lodash/find.js\";\nimport has from \"lodash/has.js\";\nimport includes from \"lodash/includes.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\nimport isEqual from \"lodash/isEqual.js\";\nimport isObject from \"lodash/isObject.js\";\nimport isString from \"lodash/isString.js\";\nimport map from \"lodash/map.js\";\nimport mapValues from \"lodash/mapValues.js\";\nimport { compare, diff, gt, major, valid } from \"semver\";\nimport traverse from \"traverse\";\n\nimport { ajvFactory } from \"./ajvFactory.cjs\";\nimport { TypeIdHelper } from \"./helpers/typeidHelper.js\";\nimport { TemplateSchema } from \"./templateSchema.js\";\nimport { SchemaValidationResult, ValidationResultBuilder } from \"./validationResultBuilder.js\";\n\nconst { MSG } = constants;\n\nconst _syntaxValidator = ajvFactory.compile(TemplateSchema);\n\ntype ValuesType = { [key: string]: ValuesType };\n\ntype PropertyType = {\n\tid: string;\n\tcontext: string;\n\ttypeid: string;\n\tvalues: ValuesType;\n};\n\ntype PropertiesType = PropertyType[];\n\nexport interface PropertySchema {\n\tconstants?: any[];\n\tcontext: string;\n\tinherits?: string[];\n\tannotation?: { [key: string]: string };\n\tproperties: PropertiesType;\n\ttypeid: string;\n\tvalues: ValuesType;\n}\n\ntype SchemaEntityType = PropertySchema | string[] | PropertiesType;\n\n/**\n * A weighted enumeration of semver change types. Higher values are more important.\n * PATCH: Annotation and comment changes.\n * MINOR: Added properties.\n * MAJOR: Everything else, including deleting properties.\n * @ignore\n */\nconst CHANGE_LEVEL = {\n\tpatch: 0, // '1.0.0' -> '1.0.1'\n\tminor: 1, // '1.0.0' -> '1.1.0'\n\tmajor: 2, // '1.5.2' -> '2.0.0'\n\n\tprerelease: 0, // '1.0.0-alpha.1' -> '1.0.0'\n\tprepatch: 0, // '1.0.0-alpha.1' -> '1.0.1'\n\tpreminor: 1, // '1.0.0-alpha.1' -> '1.1.0'\n\tpremajor: 2, // '1.0.0-alpha.1' -> '2.0.0'\n};\n\nconst VALID_CONTEXTS = [\"single\", \"array\", \"map\", \"set\", \"enum\"];\n\nconst _extractTypeid = function (typeidOrReference: string) {\n\t// Take Reference<strong-type-id> and return strong-type-id\n\tif (!isString(typeidOrReference)) {\n\t\tthrow new Error(MSG.TYPEID_MUST_BE_STRING + typeidOrReference);\n\t}\n\tconst reference = \"Reference<\";\n\tlet result = typeidOrReference || \"\";\n\tconst isReference = result.startsWith(reference);\n\tif (isReference) {\n\t\tresult = typeidOrReference.substring(reference.length, typeidOrReference.length - 1);\n\t}\n\treturn result;\n};\n\n/**\n * Given a typeid string, fetches the semver 'x.y.z' version string.\n * @param in_typeid - A PropertySet typeid. For example: 'TeamLeoValidation2:ColorID-1.0.0'.\n * @returns The semver 'x.y.z' version string, or null if in_typeid is not a valid PropertySet typeid.\n */\nconst _getSemverFromTypeId = function (in_typeid: string): string | null {\n\tconst semverRegex = /.*-(.*)$/g;\n\tconst match = semverRegex.exec(in_typeid);\n\treturn match ? match[1] : null;\n};\n\n/**\n * Fetches the type name of a javascript entity.\n * @param in_obj - A javascript entity.\n * @returns The type name for in_obj.\n */\nconst _getType = (in_obj: any): string => Object.prototype.toString.call(in_obj).slice(8, -1);\n\ntype PathEqualityInfo = {\n\tisEqual: boolean;\n\tpath: string;\n};\n\nfunction isPropertyArray(source: SchemaEntityType): source is PropertiesType {\n\treturn every(source, (entry: PropertyType) => isObject(entry) && entry.id !== undefined);\n}\n\n// function isSchemaTemplate(source: SchemaEntityType): source is PropertySchema {\n// return isObject(source) && !Array.isArray(source);\n// }\n\n/**\n * An object deep compare with special handling for pset property arrays.\n * pset property arrays are allowed to be out of order as long as elements can be matched with\n * their id.\n * @param in_source - The source entity to test for deep equality.\n * @param in_target - The target entity to test for deep equality.\n * @returns {isEqual: false, path: 'foo.properties[1].x'}\n *\n * - isEqual: true if in_source and in_target property sets are equal, even if the individual property arrays\n * differ but contain the same out of order elements.\n *\n * - path: path to the property that is not equal.\n */\nconst _psetDeepEquals = function (\n\tin_source: SchemaEntityType,\n\tin_target: SchemaEntityType,\n): PathEqualityInfo {\n\tconst idPath = [];\n\tif (!Array.isArray(in_source) && in_source.typeid) {\n\t\tidPath.push(`<${in_source.typeid}>`);\n\t}\n\n\t/**\n\t * Create the _psetDeepEquals result.\n\t * @param isEqual - Whether or not a PropertySet result is being constructed for\n\t * PropertySets that are deeply equal.\n\t * @returns {{isEqual: boolean, path: string}} An object that indicates whether or not the source\n\t * and target PropertySets are deeply equal. If they're not, it also contains a path to the\n\t * property that is not equal.\n\t */\n\tconst _getPSetDeepEqualsResult = (isEqual: boolean): PathEqualityInfo => ({\n\t\tisEqual,\n\t\tpath: isEqual ? undefined : idPath.join(\"\"),\n\t});\n\n\t/**\n\t * Performs a recursive, depth first deep equal test against two PropertySets.\n\t * @param source - The source entity to test for deep equality.\n\t * @param target - The target entity to test for deep equality.\n\t * @param id - The current path element being compared.\n\t * @return The result of _getPSetDeepEqualsResult\n\t */\n\tlet _depthFirstDeepEquals = function (\n\t\tsource: SchemaEntityType,\n\t\ttarget: SchemaEntityType,\n\t\tid?: string,\n\t): PathEqualityInfo {\n\t\tlet result = _getPSetDeepEqualsResult(true);\n\n\t\tif (id) {\n\t\t\tif (typeof id === \"number\") {\n\t\t\t\tidPath.push(`[${id}]`);\n\t\t\t} else {\n\t\t\t\tidPath.push(`.${id}`);\n\t\t\t}\n\t\t}\n\n\t\tif (Array.isArray(source)) {\n\t\t\tif (!Array.isArray(target)) {\n\t\t\t\treturn _getPSetDeepEqualsResult(false);\n\t\t\t}\n\n\t\t\tif (source.length !== target.length) {\n\t\t\t\treturn _getPSetDeepEqualsResult(false);\n\t\t\t}\n\n\t\t\tif (source.length === 0) {\n\t\t\t\treturn _getPSetDeepEqualsResult(true);\n\t\t\t}\n\n\t\t\t// See if we're comparing arrays of objects (like properties) or simple arrays of strings\n\t\t\t// like inheritance lists.\n\t\t\tif (isPropertyArray(source)) {\n\t\t\t\tconst targetMap = {};\n\t\t\t\teach(target, function (element: PropertyType) {\n\t\t\t\t\ttargetMap[element.id] = element;\n\t\t\t\t});\n\n\t\t\t\tfor (let i = 0; i < source.length && result.isEqual; i++) {\n\t\t\t\t\tconst sourceId = source[i].id;\n\t\t\t\t\tresult = _depthFirstDeepEquals.call(this, source[i], targetMap[sourceId], sourceId);\n\t\t\t\t\tidPath.pop();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Element order matters\n\t\t\t\tfor (let i = 0; i < source.length && result.isEqual; i++) {\n\t\t\t\t\tresult = _depthFirstDeepEquals.call(this, source[i], target[i], i);\n\t\t\t\t\tidPath.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isObject(source)) {\n\t\t\tif (!isObject(target)) {\n\t\t\t\treturn _getPSetDeepEqualsResult(false);\n\t\t\t}\n\n\t\t\tconst keysSource = Object.keys(source);\n\t\t\tconst keysTarget = Object.keys(target);\n\t\t\tif (keysSource.length !== keysTarget.length) {\n\t\t\t\t// A template with abstract properties must equal one with an empty properties array\n\t\t\t\t// We check the difference in keys between the source and target and if the only difference is the\n\t\t\t\t// properties array we check if it's empty. Then we reverse the condition so it work both ways.\n\t\t\t\tif (\n\t\t\t\t\t(isEqual(difference(keysTarget, keysSource), [\"properties\"]) &&\n\t\t\t\t\t\t!(target as any).properties.length) ||\n\t\t\t\t\t(isEqual(difference(keysSource, keysTarget), [\"properties\"]) &&\n\t\t\t\t\t\t!source.properties.length)\n\t\t\t\t) {\n\t\t\t\t\treturn _getPSetDeepEqualsResult(true);\n\t\t\t\t}\n\n\t\t\t\treturn _getPSetDeepEqualsResult(false);\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < keysSource.length && result.isEqual; i++) {\n\t\t\t\tconst keyName = keysSource[i];\n\t\t\t\tlet id = keyName === \"properties\" ? undefined : keyName;\n\t\t\t\tresult = _depthFirstDeepEquals.call(this, source[keyName], target[keyName], id);\n\t\t\t\tif (id) {\n\t\t\t\t\tidPath.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tresult = _getPSetDeepEqualsResult(\n\t\t\t\t_getType.call(this, source) === _getType.call(this, target) && source === target,\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t};\n\n\treturn _depthFirstDeepEquals.call(this, in_source, in_target);\n};\n\n/**\n * Fetches the non semver part of a typeid string.\n * @param in_typeid - A PropertySet typeid. For example: 'TeamLeoValidation2:ColorID-1.0.0'.\n * @returns The typeid, without a semver.\n */\nconst _stripSemverFromTypeId = function (in_typeid: string): string | null {\n\tconst semverRegex = /(.*)-.*$/g;\n\tconst match = semverRegex.exec(in_typeid);\n\treturn match ? match[1] : null;\n};\n\nconst _unresolvedTypes = function (in_template: PropertySchema) {\n\tlet first = true;\n\tconst that = this;\n\tconst accSet = traverse(in_template).reduce(function (\n\t\tacc: { [x: string]: string },\n\t\tx: PropertySchema,\n\t) {\n\t\tif (first) {\n\t\t\tacc = {};\n\t\t\tfirst = false;\n\t\t}\n\t\tif (isObject(x) && has(x, \"typeid\")) {\n\t\t\tconst extractedTypeid = _extractTypeid.call(that, x.typeid);\n\n\t\t\tif (!TypeIdHelper.isPrimitiveType(extractedTypeid)) {\n\t\t\t\tacc[extractedTypeid] = \"\";\n\t\t\t}\n\t\t}\n\t\treturn acc;\n\t});\n\n\treturn Object.keys(accSet);\n};\n\n/**\n * Performs basic template validation.\n * @param in_template - The template object to validate.\n */\nconst _validateBasic = function (in_template: PropertySchema) {\n\tif (!in_template) {\n\t\tthis._resultBuilder.addError(new Error(MSG.NO_TEMPLATE));\n\t} else if (!in_template.typeid) {\n\t\tthis._resultBuilder.addError(new Error(MSG.MISSING_TYPE_ID + JSON.stringify(in_template)));\n\t}\n};\n\n/**\n * Validations performed when the version increases between consecutive templates.\n *\n * @remarks\n * For example: 1.1.3 -> 2.0.0\n * This function checks the change level (PATCH, MINOR, MAJOR) and analyses the template content\n * to emit warnings if the change level should be higher, given the content that changed.\n * This function assumes that: in_versionPrevious < in_version.\n *\n * @param in_template - The latest template object.\n * @param in_templatePrevious - The previous template object.\n * @param in_version - The latest template version. Ex.: '2.0.0'.\n * @param in_versionPrevious - The previous template version. Ex.: '1.1.3'.\n */\nconst _validatePositiveIncrement = function (\n\tin_template: PropertySchema,\n\tin_templatePrevious: PropertySchema,\n\tin_version: string,\n\tin_versionPrevious: string,\n) {\n\tConsoleUtils.assert(\n\t\tgt(in_version, in_versionPrevious),\n\t\t\"property-changeset.TemplateValidator._validatePositiveIncrement called on non incremental \" +\n\t\t\t\"template versions\",\n\t);\n\n\tconst versionDiff = diff(in_version, in_versionPrevious);\n\n\tif (CHANGE_LEVEL[versionDiff] >= CHANGE_LEVEL.major) {\n\t\t// No need to warn about change levels since they're already declared to be major.\n\t\treturn;\n\t}\n\n\tif (major(in_version) === 0) {\n\t\t// Unstable version doesn't produce any warning.\n\t\treturn;\n\t}\n\n\tconst idPath = [`<${in_template.typeid}>`];\n\n\tlet _depthFirstCompare = function (\n\t\tid: string,\n\t\tsourceObj: SchemaEntityType,\n\t\ttargetObj: SchemaEntityType,\n\t) {\n\t\tif (id === \"annotation\") {\n\t\t\t// Here, we know that the version has increased (patch, prepatch or prerelease), so\n\t\t\t// there's no need to check inside comments for changes.\n\t\t\treturn;\n\t\t}\n\n\t\tif (id) {\n\t\t\tidPath.push(id);\n\t\t}\n\n\t\tif ((sourceObj === undefined) !== (targetObj === undefined)) {\n\t\t\tlet minimumLevel: string;\n\t\t\tlet mutation: string;\n\n\t\t\tif (targetObj === undefined) {\n\t\t\t\t// An element has been deleted.\n\t\t\t\tminimumLevel = \"major\";\n\t\t\t\tmutation = \"delete\";\n\t\t\t} else {\n\t\t\t\t// An element has been added\n\t\t\t\tminimumLevel = \"minor\";\n\t\t\t\tmutation = \"add\";\n\t\t\t}\n\n\t\t\tif (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {\n\t\t\t\t// Violates rule 6 (warning).\n\t\t\t\tthis._resultBuilder.addWarning(\n\t\t\t\t\tMSG.CHANGE_LEVEL_TOO_LOW_1 +\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tmutation,\n\t\t\t\t\t\t\tid: idPath.join(\".\"),\n\t\t\t\t\t\t\tlevel: {\n\t\t\t\t\t\t\t\texpected: minimumLevel,\n\t\t\t\t\t\t\t\tactual: versionDiff,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tversion: {\n\t\t\t\t\t\t\t\tcurrent: in_version,\n\t\t\t\t\t\t\t\tprevious: in_versionPrevious,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tconst sourceObjType = _getType.call(this, sourceObj);\n\t\t\tconst targetObjType = _getType.call(this, targetObj);\n\t\t\tif (sourceObjType !== targetObjType) {\n\t\t\t\tthis._resultBuilder.addWarning(\n\t\t\t\t\tMSG.CHANGE_LEVEL_TOO_LOW_1 +\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tmutation: \"change\",\n\t\t\t\t\t\t\tid: idPath.join(\".\"),\n\t\t\t\t\t\t\ttype: {\n\t\t\t\t\t\t\t\tcurrent: targetObjType,\n\t\t\t\t\t\t\t\tprevious: sourceObjType,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tlevel: {\n\t\t\t\t\t\t\t\texpected: \"major\",\n\t\t\t\t\t\t\t\tactual: versionDiff,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tversion: {\n\t\t\t\t\t\t\t\tcurrent: in_version,\n\t\t\t\t\t\t\t\tprevious: in_versionPrevious,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (Array.isArray(sourceObj)) {\n\t\t\t\tlet targetMap = {};\n\t\t\t\teach(targetObj, function (element: any) {\n\t\t\t\t\ttargetMap[element.id] = element;\n\t\t\t\t});\n\n\t\t\t\tfor (let i = 0; i < sourceObj.length; i++) {\n\t\t\t\t\tconst element = sourceObj[i] as any;\n\t\t\t\t\t_depthFirstCompare.call(this, element.id, element, targetMap[element.id]);\n\t\t\t\t\tdelete targetMap[element.id];\n\t\t\t\t}\n\n\t\t\t\tif (!isEmpty(targetMap)) {\n\t\t\t\t\t// Added array element.\n\t\t\t\t\tlet minimumLevel = \"minor\";\n\t\t\t\t\tif (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {\n\t\t\t\t\t\t// Violates rule 5 (warning)\n\t\t\t\t\t\tidPath.push(Object.keys(targetMap)[0]);\n\t\t\t\t\t\tthis._resultBuilder.addWarning(\n\t\t\t\t\t\t\tMSG.CHANGE_LEVEL_TOO_LOW_1 +\n\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\tmutation: \"add\",\n\t\t\t\t\t\t\t\t\tid: idPath.join(\".\"),\n\t\t\t\t\t\t\t\t\tlevel: {\n\t\t\t\t\t\t\t\t\t\texpected: minimumLevel,\n\t\t\t\t\t\t\t\t\t\tactual: versionDiff,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tversion: {\n\t\t\t\t\t\t\t\t\t\tcurrent: in_version,\n\t\t\t\t\t\t\t\t\t\tprevious: in_versionPrevious,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tidPath.pop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (isObject(sourceObj)) {\n\t\t\t\tconst keysSource = Object.keys(sourceObj);\n\t\t\t\tlet targetMap = {};\n\t\t\t\tmapValues(targetObj, function (val, key) {\n\t\t\t\t\ttargetMap[key] = val;\n\t\t\t\t});\n\n\t\t\t\tfor (let i = 0; i < keysSource.length; i++) {\n\t\t\t\t\tlet valueSource = sourceObj[keysSource[i]];\n\t\t\t\t\tlet valueTarget = targetObj[keysSource[i]];\n\t\t\t\t\t_depthFirstCompare.call(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tkeysSource[i] === \"properties\" ? undefined : keysSource[i],\n\t\t\t\t\t\tvalueSource,\n\t\t\t\t\t\tvalueTarget,\n\t\t\t\t\t);\n\t\t\t\t\tdelete targetMap[keysSource[i]];\n\t\t\t\t}\n\n\t\t\t\tconst remainingKeys = Object.keys(targetMap);\n\t\t\t\tif (!isEmpty(remainingKeys)) {\n\t\t\t\t\t// Added new keys to the target. This is a MINOR change, unless they new key is a\n\t\t\t\t\t// comment, in which case this is a PATCH level change.\n\t\t\t\t\tlet minimumLevel =\n\t\t\t\t\t\tremainingKeys.length === 1 && remainingKeys[0] === \"annotation\"\n\t\t\t\t\t\t\t? \"patch\"\n\t\t\t\t\t\t\t: \"minor\";\n\t\t\t\t\tif (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {\n\t\t\t\t\t\t// Violates rule 5 (warning)\n\t\t\t\t\t\tidPath.push(remainingKeys[0]);\n\t\t\t\t\t\tthis._resultBuilder.addWarning(\n\t\t\t\t\t\t\tMSG.CHANGE_LEVEL_TOO_LOW_1 +\n\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\tmutation: \"add\",\n\t\t\t\t\t\t\t\t\tid: idPath.join(\".\"),\n\t\t\t\t\t\t\t\t\tlevel: {\n\t\t\t\t\t\t\t\t\t\texpected: minimumLevel,\n\t\t\t\t\t\t\t\t\t\tactual: versionDiff,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tversion: {\n\t\t\t\t\t\t\t\t\t\tcurrent: in_version,\n\t\t\t\t\t\t\t\t\t\tprevious: in_versionPrevious,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tidPath.pop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (idPath.length === 2 && id === \"typeid\") {\n\t\t\t\t\t// This is the root property typeid. Ignore the version component.\n\t\t\t\t\tsourceObj = _stripSemverFromTypeId.call(this);\n\t\t\t\t\ttargetObj = _stripSemverFromTypeId.call(this);\n\t\t\t\t}\n\n\t\t\t\tif (sourceObj !== targetObj) {\n\t\t\t\t\tlet minimumLevel = id === \"value\" ? \"minor\" : \"major\";\n\t\t\t\t\tif (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {\n\t\t\t\t\t\tthis._resultBuilder.addWarning(\n\t\t\t\t\t\t\tMSG.CHANGE_LEVEL_TOO_LOW_1 +\n\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\tmutation: \"change\",\n\t\t\t\t\t\t\t\t\tid: idPath.join(\".\"),\n\t\t\t\t\t\t\t\t\tlevel: {\n\t\t\t\t\t\t\t\t\t\texpected: minimumLevel,\n\t\t\t\t\t\t\t\t\t\tactual: versionDiff,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t\t\t\tcurrent: targetObj,\n\t\t\t\t\t\t\t\t\t\tprevious: sourceObj,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tversion: {\n\t\t\t\t\t\t\t\t\t\tcurrent: in_version,\n\t\t\t\t\t\t\t\t\t\tprevious: in_versionPrevious,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (id) {\n\t\t\tidPath.pop();\n\t\t}\n\t};\n\t// console.assert(has(in_templatePrevious, 'id')); // TODO: Revisit this line after running the tests.\n\t_depthFirstCompare.call(\n\t\tthis,\n\t\t(in_templatePrevious as any).id,\n\t\tin_templatePrevious,\n\t\tin_template,\n\t);\n};\n\n/**\n * Validations performed when the version between consecutive templates doesn't change.\n * For example: 1.1.3 -> 1.1.3.\n * Templates whose version didn't change should have identical content.\n * @param in_template - The latest template object.\n * @param in_templatePrevious - The previous template object.\n */\nconst _validateSameVersion = function (\n\tin_template: PropertySchema,\n\tin_templatePrevious: PropertySchema,\n) {\n\tconst result = _psetDeepEquals.call(this, in_templatePrevious, in_template);\n\tif (!result.isEqual) {\n\t\t// Violates rule 3a.\n\t\tthis._resultBuilder.addError(\n\t\t\tnew Error(MSG.MODIFIED_TEMPLATE_SAME_VERSION_1 + result.path),\n\t\t);\n\t}\n};\n\n/**\n * Validate a template\n * Check that the template is syntactically correct as well as semantically correct.\n * @param in_template - The template to check against.\n * Produces an {object|undefined} map of key-value pairs where the path of the invalid property is the key and the\n * value is the error message.\n *\n * i.e.\n *\n * ```\n * <pre>\n * {\n * 'isValid': true or false,\n * 'typeid': 'The typeid of the object being parsed',\n * 'unresolvedTypes': [ 'An array', 'of strong typeids', 'that were found',\n * 'in the document', 'but not resolved from the local cache' ],\n * 'resolvedTypes': [ 'Array of', 'strong types resolved', 'during template parsing'],\n * 'errors': [ 'Array of', 'objects describing', 'syntax errors in the template' ]\n * ...\n * }\n * </pre>\n * ```\n * @throws if context validation fails\n */\nconst _validateSemanticAndSyntax = function (in_template: PropertySchema) {\n\t_validateSyntax.call(this, in_template);\n\t_validateConstants.call(this, in_template);\n\t// TODO: _validateSemantic\n};\n\n/**\n * Validate a template\n * Check that the template is syntactically correct as well as semantically correct.\n * @param in_template - The template to check against\n * @return {Promise} a promise that resolved to nothing\n * @ignore\n */\nconst _validateSemanticAndSyntaxAsync = async function (\n\tin_template: PropertySchema,\n): Promise<any> {\n\treturn _validateSyntaxAsync.call(this, in_template);\n};\n\n/**\n * Validates that the semver part of a template's typeid is valid.\n * @param {Object} in_template - The template object to validate.\n * @return {string} The semver string. For example: '1.0.0'.\n * @private\n * @this TemplateValidator\n * @ignore\n */\nconst _validateSemverFormat = function (in_template) {\n\tconst templateVersion = _getSemverFromTypeId.call(this, in_template.typeid);\n\tif (!templateVersion) {\n\t\tthis._resultBuilder.addError(new Error(MSG.MISSING_VERSION + in_template.typeid));\n\t} else if (valid(templateVersion) !== templateVersion) {\n\t\tthis._resultBuilder.addError(new Error(MSG.INVALID_VERSION_1 + templateVersion));\n\t}\n\n\treturn templateVersion;\n};\n\n/**\n * Skip semver validation. Verify that the content is the same for both templates, while ignoring\n * the root 'typeid' property.\n * @param {Object} in_template - The latest template object.\n * @param {Object} in_templatePrevious - The previous template object.\n * @private\n * @this TemplateValidator\n */\nconst _validateSkipSemver = function (in_template, in_templatePrevious) {\n\t// Skipping the semver validation. Ignore the root typeid field.\n\tconst result = _psetDeepEquals.call(this, in_template, in_templatePrevious);\n\tif (!result.isEqual) {\n\t\t// Violates rule 3a.\n\t\tthis._resultBuilder.addError(new Error(MSG.MODIFIED_TEMPLATE_1 + result.path));\n\t}\n};\n\n/**\n * Checks if an invalid context error should be signified\n *\n * @param {String} in_context - The latest template object.\n * @return {Error|undefined} If exists returns the InvalidContext error\n * @private\n * @this TemplateValidator\n */\nconst getInvalidContextError = function (in_context) {\n\tif (in_context && !includes(VALID_CONTEXTS, in_context)) {\n\t\treturn new Error(`${MSG.NOT_A_VALID_CONTEXT} ${in_context}`);\n\t}\n\n\treturn undefined;\n};\n\n/**\n * Validate that the context is valid\n * Validate that only Named Properties are in sets\n * @param {object} in_template - The template to check against\n * @ignore\n * @throws if the context is invalid.\n */\nconst _validateContext = function (in_template) {\n\tconst context = in_template.context;\n\n\tconst error = getInvalidContextError(context);\n\tif (error) {\n\t\tthrow error;\n\t}\n\tif (context === \"map\" && in_template.contextKeyType === \"typeid\") {\n\t\tthrow new Error(MSG.INVALID_OPTION_NONE_CONSTANTS);\n\t}\n};\n\n/**\n * Validate just the syntax of a template\n * Check that the template is well-formed, according to the schema.\n * @param {object} in_template - The template to check against\n *\n * Context validation makes sure that elements of sets eventually inherit from NamedProperty.\n * If this is not the case, a promise rejection will occur with the appropriate error.\n * @return {Promise} promise that returns without any value and rejects in case of validation error\n * @ignore\n */\nconst _validateContextAsync = async function (in_template) {\n\tconst that = this;\n\tconst context = in_template.context;\n\n\tconst error = getInvalidContextError(context);\n\tif (error) {\n\t\tthrow error;\n\t}\n\tif (context === \"map\" && in_template.contextKeyType === \"typeid\") {\n\t\tthrow new Error(MSG.INVALID_OPTION_NONE_CONSTANTS);\n\t}\n\t// If context is not 'set' validation doesn't apply\n\tif (context !== \"set\") {\n\t\treturn Promise.resolve();\n\t}\n\n\tlet typedValuePromises = [Promise.resolve()];\n\tif (in_template.typedValue) {\n\t\ttypedValuePromises = map(in_template.typedValue, (tv) =>\n\t\t\tthat.inheritsFrom(tv.typeid, \"NamedProperty\"),\n\t\t);\n\t} else {\n\t\t// Since context is 'set' the template must eventually inherit from NamedProperty\n\t\tif (in_template.inherits === undefined) {\n\t\t\tthrow new Error(MSG.SET_ONLY_NAMED_PROPS);\n\t\t}\n\n\t\t// Since context is 'set' the template must eventually inherit from NamedProperty (same as above)\n\t\tif (\n\t\t\tincludes(in_template.inherits, \"NamedProperty\") ||\n\t\t\tin_template.inherits === \"NamedProperty\"\n\t\t) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\t}\n\tconst typedValuePromise = Promise.all(typedValuePromises);\n\n\tlet parents = [];\n\tif (in_template.inherits) {\n\t\tparents = Array.isArray(in_template.inherits)\n\t\t\t? in_template.inherits\n\t\t\t: [in_template.inherits];\n\t}\n\tconst inheritsPromises = parents.map((typeid) =>\n\t\tthis._inheritsFromAsync(typeid, \"NamedProperty\"),\n\t);\n\n\t// Combine results from inheritsPromises and typedValuePromise\n\tinheritsPromises.push(typedValuePromise);\n\treturn Promise.all(inheritsPromises)\n\t\t.then(function (results) {\n\t\t\tconst foundNamedPropertyDescendant = find(results, (res) => res);\n\t\t\tif (!foundNamedPropertyDescendant) {\n\t\t\t\tthrow Error(MSG.SET_ONLY_NAMED_PROPS);\n\t\t\t}\n\n\t\t\treturn that._hasSchemaAsync(in_template.typeid);\n\t\t})\n\t\t.then(function (hasIt) {\n\t\t\tif (!hasIt) {\n\t\t\t\tthrow new Error(MSG.SET_ONLY_NAMED_PROPS);\n\t\t\t}\n\n\t\t\treturn that._inheritsFromAsync(in_template.typeid, \"NamedProperty\");\n\t\t})\n\t\t.then(async function (res) {\n\t\t\tif (res) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tthrow new Error(MSG.SET_ONLY_NAMED_PROPS);\n\t\t});\n};\n\n/**\n * Validate that the context is valid\n * Validate that only Named Properties are in sets\n * @param {object} in_template - The template to check against\n * @ignore\n * @throws if the context is invalid.\n */\nlet _validateConstants = function (in_template) {\n\tconst that = this;\n\tif (in_template.constants && Array.isArray(in_template.constants)) {\n\t\tfor (let i = 0; i < in_template.constants.length; i++) {\n\t\t\tconst constant = in_template.constants[i];\n\t\t\tconst context = constant.context;\n\n\t\t\tif (context === \"map\" && constant.contextKeyType === \"typeid\") {\n\t\t\t\teach(constant.value, function (value, key) {\n\t\t\t\t\tif (!TypeIdHelper.isTemplateTypeid(key)) {\n\t\t\t\t\t\tthat._resultBuilder.addError(new Error(MSG.KEY_MUST_BE_TYPEID + key));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * Analyze output of the syntax validation and build error messages\n *\n * @param in_template - The template that was analyzed\n */\nconst _processValidationResults = function (in_template: PropertySchema) {\n\tlet that = this;\n\tlet result = this._resultBuilder.result;\n\n\tresult.isValid = _syntaxValidator(in_template);\n\tif (!result.isValid) {\n\t\tConsoleUtils.assert(\n\t\t\t!isEmpty(_syntaxValidator.errors),\n\t\t\t\"template validation failed but produced no error\",\n\t\t);\n\t}\n\n\tif (_syntaxValidator.errors) {\n\t\teach(_syntaxValidator.errors, function (error) {\n\t\t\tconst regexTypeId = /typeid/;\n\t\t\tswitch (error.keyword) {\n\t\t\t\tcase \"pattern\":\n\t\t\t\t\tif (error.instancePath === \".typeid\") {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\t\t\t\terror.message = `typeid should have a pattern like: my.example:point-1.0.0 ${error.data} does not match that pattern`;\n\t\t\t\t\t} else if (\"pattern\" && regexTypeId.test(error.instancePath)) {\n\t\t\t\t\t\terror.message =\n\t\t\t\t\t\t\terror.schemaPath === \"#/definitions/typed-reference-typeid/pattern\"\n\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t: `${error.instancePath} should follow this pattern: <namespace>:<typeid>-<version> ` +\n\t\t\t\t\t\t\t\t\t`(for example: Sample:Rectangle-1.0.0) or match one of the Primitive Types (Float32, Float64, ` +\n\t\t\t\t\t\t\t\t\t`Int8, Uint8, Int16, Uint16, Int32, Uint32, Bool, String, Reference, Enum, Int64, Uint64) or ` +\n\t\t\t\t\t\t\t\t\t`Reserved Types (BaseProperty, NamedProperty, NodeProperty, NamedNodeProperty, ` +\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\t\t\t\t\t\t\t`RelationshipProperty). '${error.data}' is not valid`;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"enum\":\n\t\t\t\t\terror.message = regexTypeId.test(error.instancePath)\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: // eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\t\t\t\t\t`${error.instancePath} should match one of the following: ${error.schema}`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"type\":\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\t\t\terror.message = `${error.instancePath} should be a ${error.schema}`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"not\":\n\t\t\t\t\tif (error.schemaPath === \"#/switch/1/then/anyOf/0/properties/typeid/not\") {\n\t\t\t\t\t\t// remove .typeid at the end of the instancePath\n\t\t\t\t\t\terror.message = `For ${error.instancePath.slice(\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t-7,\n\t\t\t\t\t\t)}: Properties should have either a typeid or an array of child properties, but not both.`;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\terror.schemaPath === \"#/switch/1/then/anyOf/1/properties/properties/not\"\n\t\t\t\t\t) {\n\t\t\t\t\t\t// remove .properties at the end of the instancePath\n\t\t\t\t\t\terror.message = `For ${error.instancePath.slice(\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t-11,\n\t\t\t\t\t\t)}: Properties should have either a typeid or an array of child properties, but not both.`;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t// these errors do not add any information. All necessary information is in the 'enum' errors\n\t\t\t\t// empty errors will be filtered out before logging.\n\t\t\t\tcase \"oneOf\":\n\t\t\t\tcase \"anyOf\":\n\t\t\t\t\terror.message = \"\";\n\t\t\t\t\tbreak;\n\n\t\t\t\t// for minItems, required and any other error - add instancePath to indicate which part of the\n\t\t\t\t// template the error refers to.\n\t\t\t\tdefault:\n\t\t\t\t\terror.message = `${error.instancePath} ${error.message}`;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Deep-copy for thread-safety.\n\t\t\tthat._resultBuilder.addError(cloneDeep(error));\n\t\t});\n\t}\n\n\tresult.unresolvedTypes = _unresolvedTypes.call(this, in_template);\n};\n\n/**\n * Validate just the syntax of a template\n * Check that the template is well-formed, according to the schema.\n * @param in_template - The template to check against\n * @throws if a property with context set is not an instance of NamedProperties\n * @ignore\n */\nlet _validateSyntax = function (in_template: PropertySchema) {\n\tconst that = this;\n\t// recursively test all properties for context\n\tlet recursiveContextCheck = function (template) {\n\t\t_validateContext.call(that, template);\n\t\tif (template.properties) {\n\t\t\ttemplate.properties.forEach(function (property) {\n\t\t\t\trecursiveContextCheck(property);\n\t\t\t});\n\t\t}\n\t};\n\n\trecursiveContextCheck(in_template);\n\n\t_processValidationResults.call(this, in_template);\n\n\tconst result = this._resultBuilder.result;\n\tresult.unresolvedTypes = _unresolvedTypes.call(this, in_template);\n};\n\nconst createContextCheckAsyncQueue = function () {\n\tconst that = this;\n\tconst contextCheckWorker = function (in_task, in_callback) {\n\t\tconst property = in_task.property;\n\t\t_validateContextAsync\n\t\t\t.call(that, property)\n\t\t\t.then(function (response) {\n\t\t\t\tin_callback();\n\t\t\t})\n\t\t\t.catch(function (error) {\n\t\t\t\tin_callback({ error });\n\t\t\t});\n\t};\n\t// Async queue for schema context check tasks\n\treturn queue(contextCheckWorker, 5);\n};\n\n/**\n * Validate just the syntax of a template\n * Check that the template is well-formed, according to the schema.\n *\n * @param in_template - The template to check against\n * Mainly checks context. See _validateContextAsync\n * @returns Promise that resolves without any result\n * @ignore\n */\nlet _validateSyntaxAsync = async function (\n\tin_template: PropertySchema,\n): Promise<SchemaValidationResult> {\n\tconst that = this;\n\n\treturn new Promise(function (resolve, reject) {\n\t\tif (that.asyncValidationInProgress === true) {\n\t\t\treject(new Error(MSG.CONTEXT_VALIDATION_IN_PROGRESS));\n\t\t\treturn;\n\t\t}\n\n\t\tthat.asyncValidationInProgress = true;\n\n\t\tconst contextCheckAsyncQueue = createContextCheckAsyncQueue.call(that);\n\n\t\t// recursively test all properties for context\n\t\tlet recursiveContextCheck = function (template) {\n\t\t\t// Does the call to _validateContextAsync\n\t\t\tcontextCheckAsyncQueue.push({ property: template }, function (error) {\n\t\t\t\tif (error !== undefined) {\n\t\t\t\t\treject(new Error(error));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (template.properties) {\n\t\t\t\ttemplate.properties.forEach(function (property) {\n\t\t\t\t\trecursiveContextCheck(property);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t\trecursiveContextCheck(in_template);\n\n\t\tcontextCheckAsyncQueue.drain(function () {\n\t\t\tconst result = that._resultBuilder.result;\n\t\t\t_processValidationResults.call(that, in_template);\n\t\t\tresult.unresolvedTypes = _unresolvedTypes.call(that, in_template);\n\n\t\t\tthat.asyncValidationInProgress = false;\n\t\t\tresolve(result);\n\t\t});\n\t});\n};\n\nexport interface TemplateValidatorOptions {\n\t/**\n\t * When set to true, {@link #validate} only checks the supplied templates' content\n\t * and fails the validation if they're not identical. Defaults to false.\n\t */\n\tskipSemver?: boolean;\n\t/**\n\t * When set to true, the typeid of any schema can have '-draft' as a version. Defaults to false.\n\t */\n\tallowDraft?: boolean;\n\t/**\n\t * Function that checks if a template inherits from another.\n\t */\n\tinheritsFrom?: (source: PropertySchema, target: PropertySchema) => boolean;\n\t/**\n\t * Function that checks if we have a template matching a typeid.\n\t */\n\thasSchema?: (schema: PropertySchema, typeid: string) => boolean;\n\t/**\n\t * Function that checks if a template inherits from another asynchronously.\n\t */\n\tinheritsFromAsync?: (source: PropertySchema, target: PropertySchema) => Promise<boolean>;\n\t/**\n\t * Function that checks if we have a template matching a typeid asynchronously.\n\t */\n\thasSchemaAsync?: (schema: PropertySchema, typeid: string) => Promise<boolean>;\n}\n\nconst Utils = {\n\tpsetDeepEquals(in_source: PropertySchema, in_target: PropertySchema) {\n\t\treturn _psetDeepEquals.call(this, in_source, in_target).isEqual;\n\t},\n};\n\n/**\n * Instantiates a new TemplateValidator. Must be provided with a set of inheritsFrom and hasSchema\n * function or inheritsFromAsync and hasSchemaAsync, but not both.\n * @internal\n */\nexport class TemplateValidator {\n\tstatic Utils = Utils;\n\tprivate _resultBuilder: ValidationResultBuilder;\n\tpublic _inheritsFrom: (source: PropertySchema, target: PropertySchema) => boolean;\n\tpublic _hasSchema: (schema: PropertySchema, typeid: string) => boolean;\n\tpublic _inheritsFromAsync: (\n\t\tsource: PropertySchema,\n\t\ttarget: PropertySchema,\n\t) => Promise<boolean>;\n\tpublic _hasSchemaAsync: (schema: PropertySchema, typeid: string) => Promise<boolean>;\n\tprivate readonly _allowDraft: boolean;\n\tprivate readonly _skipSemver: boolean;\n\tconstructor(in_params: TemplateValidatorOptions = { skipSemver: false, allowDraft: false }) {\n\t\tthis._skipSemver = in_params ? !!in_params.skipSemver : false;\n\t\tthis._allowDraft = in_params ? !!in_params.allowDraft : false;\n\t\t// Used by validate()\n\t\tif (\n\t\t\tin_params &&\n\t\t\tin_params.inheritsFrom !== undefined &&\n\t\t\tin_params.hasSchema !== undefined\n\t\t) {\n\t\t\tthis._inheritsFrom = in_params.inheritsFrom;\n\t\t\tthis._hasSchema = in_params.hasSchema;\n\t\t} else if (\n\t\t\tin_params &&\n\t\t\tin_params.inheritsFromAsync !== undefined &&\n\t\t\tin_params.hasSchemaAsync !== undefined\n\t\t) {\n\t\t\tthis._inheritsFromAsync = in_params.inheritsFromAsync;\n\t\t\tthis._hasSchemaAsync = in_params.hasSchemaAsync;\n\t\t} else {\n\t\t\tthrow new Error(MSG.MISSING_INHERITSFROM_OR_HASSCHEMA);\n\t\t}\n\t}\n\n\t/**\n\t * Validates that all templates conform to the following mandatory rules:\n\t *\n\t * 1. Must have a typeid attribute.\n\t *\n\t * 2. typeid must end in a valid semver string.\n\t *\n\t * 3. When both in_template (B) and in_templatePrevious (A) are supplied:\n\t *\n\t * - 3a. Semver is identical only if content is identical.\n\t *\n\t * - 3b. B's semver >= A's semver\n\t *\n\t * Additionally, the following soft rules will produce warnings when violated:\n\t *\n\t * 3.5. Elements of sets must eventually inherit from 'NamedProperty'\n\t *\n\t * 4. PATCH revision should be increased when _only_ the template description changes.\n\t *\n\t * 5. Adding one or more template attributes is a MINOR change.\n\t *\n\t * 6. Removing one or more template attributes is a MAJOR change.\n\t *\n\t * @param in_template - The latest template version, as a JSON object.\n\t * @param in_templatePrevious - The previous template version, as a JSON object. Optional.\n\t * @returns The validation results. Example:\n\t *\n\t * ```json\n\t * {\n\t * isValid: false,\n\t * errors: ['Something went wrong. Validation failed.'],\n\t * warnings: ['A non-fatal warning'],\n\t * typeid: 'SomeNamespace:PointID-1.0.0'\n\t * }\n\t * ```\n\t *\n\t * It's possible for 'isValid' to be true while 'warnings' contains one or more messages.\n\t */\n\tvalidate(\n\t\tin_template: PropertySchema,\n\t\tin_templatePrevious?: PropertySchema,\n\t): SchemaValidationResult {\n\t\tthis._resultBuilder = new ValidationResultBuilder(in_template ? in_template.typeid : \"\");\n\n\t\tlet isDraft = false;\n\t\tif (\n\t\t\tin_template &&\n\t\t\tin_template.typeid &&\n\t\t\tTypeIdHelper.extractVersion(in_template.typeid).version === \"draft\"\n\t\t) {\n\t\t\tif (this._allowDraft) {\n\t\t\t\tisDraft = true;\n\t\t\t} else {\n\t\t\t\tthis._resultBuilder.addError(new Error(MSG.DRAFT_AS_VERSION_TYPEID));\n\t\t\t}\n\t\t}\n\n\t\t_validateBasic.call(this, in_template);\n\t\tif (in_templatePrevious) {\n\t\t\t_validateBasic.call(this, in_templatePrevious);\n\t\t}\n\n\t\t// Basic validation (such as input params) must pass before the real validation can begin.\n\t\tif (!this._resultBuilder.isValid()) {\n\t\t\treturn this._resultBuilder.result;\n\t\t}\n\n\t\t_validateSemanticAndSyntax.call(this, in_template);\n\t\tif (!this._resultBuilder.isValid() || isDraft) {\n\t\t\treturn this._resultBuilder.result;\n\t\t}\n\n\t\tif (in_templatePrevious) {\n\t\t\t_validateSemanticAndSyntax.call(this, in_templatePrevious);\n\t\t\tif (!this._resultBuilder.isValid()) {\n\t\t\t\t// Here the previous template is not valid. Make sure the typeid in the returned info is\n\t\t\t\t// the root of the template that failed validation.\n\t\t\t\tthis._resultBuilder.result.typeid = in_templatePrevious.typeid;\n\t\t\t\treturn this._resultBuilder.result;\n\t\t\t}\n\t\t}\n\n\t\tif (this._skipSemver && in_templatePrevious) {\n\t\t\t_validateSkipSemver.call(this, in_template, in_templatePrevious);\n\t\t\treturn this._resultBuilder.result;\n\t\t}\n\n\t\t// semver format validation\n\t\tconst version = _validateSemverFormat.call(this, in_template);\n\t\tconst versionPrevious = in_templatePrevious\n\t\t\t? _validateSemverFormat.call(this, in_templatePrevious)\n\t\t\t: null;\n\n\t\t// semver format validation must pass.\n\t\tif (!this._resultBuilder.isValid()) {\n\t\t\treturn this._resultBuilder.result;\n\t\t}\n\n\t\tif (in_templatePrevious) {\n\t\t\t// Validate that the semver change is valid.\n\t\t\tswitch (compare(version, versionPrevious)) {\n\t\t\t\tcase 0:\n\t\t\t\t\t_validateSameVersion.call(this, in_template, in_templatePrevious);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t// newVersion is greater\n\t\t\t\t\t_validatePositiveIncrement.call(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tin_template,\n\t\t\t\t\t\tin_templatePrevious,\n\t\t\t\t\t\tversion,\n\t\t\t\t\t\tversionPrevious,\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\tcase -1:\n\t\t\t\t\t// previousVersion is greater. Violates rule 3b.\n\t\t\t\t\tthis._resultBuilder.addError(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\tMSG.VERSION_REGRESSION_1 +\n\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\tcurrent: version,\n\t\t\t\t\t\t\t\t\tprevious: versionPrevious,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn this._resultBuilder.result;\n\t}\n\n\t/**\n\t * Validates that all templates conform to the following mandatory rules:\n\t *\n\t * 1. Must have a typeid attribute.\n\t *\n\t * 2. typeid must end in a valid semver string.\n\t *\n\t * 3. When both in_template (B) and in_templatePrevious (A) are supplied:\n\t *\n\t * - 3a. Semver is identical only if content is identical.\n\t *\n\t * - 3b. B's semver >= A's semver\n\t *\n\t * Additionally, the following soft rules will produce warnings when violated:\n\t *\n\t * 3.5. Elements of sets must eventually inherit from 'NamedProperty'\n\t *\n\t * 4. PATCH revision should be increased when _only_ the template description changes.\n\t *\n\t * 5. Adding one or more template attributes is a MINOR change.\n\t *\n\t * 6. Removing one or more template attributes is a MAJOR change.\n\t *\n\t * @param in_template - The latest template version, as a JSON object.\n\t * @param in_templatePrevious - The previous template version, as a JSON object. Optional.\n\t * @returns A promise that resolves to the validation results as an object. Example:\n\t *\n\t * ```json\n\t * {\n\t * isValid: false,\n\t * errors: ['Something went wrong. Validation failed.'],\n\t * warnings: ['A non-fatal warning'],\n\t * typeid: 'SomeNamespace:PointID-1.0.0'\n\t * }\n\t * ```\n\t *\n\t * It's possible for 'isValid' to be true while 'warnings' contains one or more messages.\n\t */\n\tasync validateAsync(\n\t\tin_template: PropertySchema,\n\t\tin_templatePrevious?: PropertySchema,\n\t): Promise<SchemaValidationResult> {\n\t\tthis._resultBuilder = new ValidationResultBuilder(in_template ? in_template.typeid : \"\");\n\t\t_validateBasic.call(this, in_template);\n\t\tif (in_templatePrevious) {\n\t\t\t_validateBasic.call(this, in_templatePrevious);\n\t\t}\n\t\tif (!this._resultBuilder.isValid()) {\n\t\t\treturn Promise.resolve(this._resultBuilder.result);\n\t\t}\n\t\treturn in_templatePrevious\n\t\t\t? this._validateAsyncWithPreviousSchema(in_template, in_templatePrevious)\n\t\t\t: _validateSemanticAndSyntaxAsync.call(this, in_template);\n\t}\n\n\t/**\n\t * Called by validateAsync if a previous schema is passed in argument\n\t *\n\t * @param in_template - The latest template version, as a JSON object.\n\t * @param in_templatePrevious - The previous template version, as a JSON object. Optional.\n\t *\n\t * @returns promise that resolves to the validation results as an objet. See validateAsync\n\t * @ignore\n\t */\n\tprivate async _validateAsyncWithPreviousSchema(\n\t\tin_template: PropertySchema,\n\t\tin_templatePrevious: PropertySchema,\n\t): Promise<SchemaValidationResult> {\n\t\tconst that = this;\n\t\treturn _validateSemanticAndSyntaxAsync\n\t\t\t.call(that, in_template)\n\t\t\t.then(() => _validateSemanticAndSyntaxAsync.call(that, in_templatePrevious))\n\t\t\t.then(function () {\n\t\t\t\tif (!that._resultBuilder.isValid()) {\n\t\t\t\t\t// Here the previous template is not valid. Make sure the typeid in the returned info is\n\t\t\t\t\t// the root of the template that failed validation.\n\t\t\t\t\tthat._resultBuilder.result.typeid = in_templatePrevious.typeid;\n\t\t\t\t}\n\n\t\t\t\tif (that._skipSemver && in_templatePrevious) {\n\t\t\t\t\t_validateSkipSemver.call(that, in_template, in_templatePrevious);\n\t\t\t\t}\n\n\t\t\t\tconst version = _validateSemverFormat.call(that, in_template);\n\t\t\t\tconst versionPrevious = in_templatePrevious\n\t\t\t\t\t? _validateSemverFormat.call(that, in_templatePrevious)\n\t\t\t\t\t: null;\n\n\t\t\t\t// Validate that the semver change is valid.\n\t\t\t\tswitch (compare(version, versionPrevious)) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t_validateSameVersion.call(that, in_template, in_templatePrevious);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t// newVersion is greater\n\t\t\t\t\t\t_validatePositiveIncrement.call(\n\t\t\t\t\t\t\tthat,\n\t\t\t\t\t\t\tin_template,\n\t\t\t\t\t\t\tin_templatePrevious,\n\t\t\t\t\t\t\tversion,\n\t\t\t\t\t\t\tversionPrevious,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\tcase -1:\n\t\t\t\t\t\t// previousVersion is greater. Violates rule 3b.\n\t\t\t\t\t\tthat._resultBuilder.addError(\n\t\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t\tMSG.VERSION_REGRESSION_1 +\n\t\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\t\tcurrent: version,\n\t\t\t\t\t\t\t\t\t\tprevious: versionPrevious,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\treturn that._resultBuilder.result;\n\t\t\t});\n\t}\n}\n"]}
1
+ {"version":3,"file":"templateValidator.js","sourceRoot":"","sources":["../src/templateValidator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH;;;;GAIG;AAEH,6CAA6C;AAE7C,+CAA+C;AAE/C,yEAA8E;AAE9E,iCAA8B;AAC9B,uEAA4C;AAC5C,yEAA8C;AAC9C,6DAAkC;AAClC,+DAAoC;AACpC,6DAAkC;AAClC,2DAAgC;AAChC,qEAA0C;AAC1C,mEAAwC;AACxC,mEAAwC;AACxC,qEAA0C;AAC1C,qEAA0C;AAC1C,2DAAgC;AAChC,uEAA4C;AAC5C,mCAAyD;AACzD,wDAAgC;AAEhC,qDAA8C;AAC9C,+DAAyD;AACzD,2DAAqD;AACrD,6EAA+F;AAE/F,MAAM,EAAE,GAAG,EAAE,GAAG,2BAAS,CAAC;AAE1B,MAAM,gBAAgB,GAAG,2BAAU,CAAC,OAAO,CAAC,kCAAc,CAAC,CAAC;AAyB5D;;;;;;GAMG;AACH,MAAM,YAAY,GAAG;IACpB,KAAK,EAAE,CAAC,EAAE,qBAAq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IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC;YAClE,CAAC;YAED,MAAM,OAAO,GAAG,qBAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YAC9D,MAAM,eAAe,GAAG,mBAAmB;gBAC1C,CAAC,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC;gBACvD,CAAC,CAAC,IAAI,CAAC;YAER,4CAA4C;YAC5C,QAAQ,IAAA,gBAAO,EAAC,OAAO,EAAE,eAAe,CAAC,EAAE,CAAC;gBAC3C,KAAK,CAAC;oBACL,oBAAoB,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAC;oBAClE,MAAM;gBACP,KAAK,CAAC;oBACL,wBAAwB;oBACxB,0BAA0B,CAAC,IAAI,CAC9B,IAAI,EACJ,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,eAAe,CACf,CAAC;oBACF,MAAM;gBACP,QAAQ;gBACR,KAAK,CAAC,CAAC;oBACN,gDAAgD;oBAChD,IAAI,CAAC,cAAc,CAAC,QAAQ,CAC3B,IAAI,KAAK,CACR,GAAG,CAAC,oBAAoB;wBACvB,IAAI,CAAC,SAAS,CAAC;4BACd,OAAO,EAAE,OAAO;4BAChB,QAAQ,EAAE,eAAe;yBACzB,CAAC,CACH,CACD,CAAC;oBACF,MAAM;YACR,CAAC;YAED,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;;AAhSF,8CAiSC;AAhSO,uBAAK,GAAG,KAAK,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * @fileoverview\n * @description The TemplateValidator can examine consecutive versions of a given template to detect semantic\n * versioning (semver) errors and warn about incorrect versioning practices.\n */\n\n// There are lots of violations in this file.\n\n/* eslint-disable jsdoc/check-line-alignment */\n\nimport { constants, ConsoleUtils } from \"@fluid-experimental/property-common\";\n\nimport { queue } from \"async\";\nimport cloneDeep from \"lodash/cloneDeep.js\";\nimport difference from \"lodash/difference.js\";\nimport each from \"lodash/each.js\";\nimport every from \"lodash/every.js\";\nimport find from \"lodash/find.js\";\nimport has from \"lodash/has.js\";\nimport includes from \"lodash/includes.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\nimport isEqual from \"lodash/isEqual.js\";\nimport isObject from \"lodash/isObject.js\";\nimport isString from \"lodash/isString.js\";\nimport map from \"lodash/map.js\";\nimport mapValues from \"lodash/mapValues.js\";\nimport { compare, diff, gt, major, valid } from \"semver\";\nimport traverse from \"traverse\";\n\nimport { ajvFactory } from \"./ajvFactory.cjs\";\nimport { TypeIdHelper } from \"./helpers/typeidHelper.js\";\nimport { TemplateSchema } from \"./templateSchema.js\";\nimport { SchemaValidationResult, ValidationResultBuilder } from \"./validationResultBuilder.js\";\n\nconst { MSG } = constants;\n\nconst _syntaxValidator = ajvFactory.compile(TemplateSchema);\n\ntype ValuesType = { [key: string]: ValuesType };\n\ntype PropertyType = {\n\tid: string;\n\tcontext: string;\n\ttypeid: string;\n\tvalues: ValuesType;\n};\n\ntype PropertiesType = PropertyType[];\n\nexport interface PropertySchema {\n\tconstants?: any[];\n\tcontext: string;\n\tinherits?: string[];\n\tannotation?: { [key: string]: string };\n\tproperties: PropertiesType;\n\ttypeid: string;\n\tvalues: ValuesType;\n}\n\ntype SchemaEntityType = PropertySchema | string[] | PropertiesType;\n\n/**\n * A weighted enumeration of semver change types. Higher values are more important.\n * PATCH: Annotation and comment changes.\n * MINOR: Added properties.\n * MAJOR: Everything else, including deleting properties.\n * @ignore\n */\nconst CHANGE_LEVEL = {\n\tpatch: 0, // '1.0.0' -> '1.0.1'\n\tminor: 1, // '1.0.0' -> '1.1.0'\n\tmajor: 2, // '1.5.2' -> '2.0.0'\n\n\tprerelease: 0, // '1.0.0-alpha.1' -> '1.0.0'\n\tprepatch: 0, // '1.0.0-alpha.1' -> '1.0.1'\n\tpreminor: 1, // '1.0.0-alpha.1' -> '1.1.0'\n\tpremajor: 2, // '1.0.0-alpha.1' -> '2.0.0'\n};\n\nconst VALID_CONTEXTS = [\"single\", \"array\", \"map\", \"set\", \"enum\"];\n\nconst _extractTypeid = function (typeidOrReference: string) {\n\t// Take Reference<strong-type-id> and return strong-type-id\n\tif (!isString(typeidOrReference)) {\n\t\tthrow new Error(MSG.TYPEID_MUST_BE_STRING + typeidOrReference);\n\t}\n\tconst reference = \"Reference<\";\n\tlet result = typeidOrReference || \"\";\n\tconst isReference = result.startsWith(reference);\n\tif (isReference) {\n\t\tresult = typeidOrReference.substring(reference.length, typeidOrReference.length - 1);\n\t}\n\treturn result;\n};\n\n/**\n * Given a typeid string, fetches the semver 'x.y.z' version string.\n * @param in_typeid - A PropertySet typeid. For example: 'TeamLeoValidation2:ColorID-1.0.0'.\n * @returns The semver 'x.y.z' version string, or null if in_typeid is not a valid PropertySet typeid.\n */\nconst _getSemverFromTypeId = function (in_typeid: string): string | null {\n\tconst semverRegex = /.*-(.*)$/g;\n\tconst match = semverRegex.exec(in_typeid);\n\treturn match ? match[1] : null;\n};\n\n/**\n * Fetches the type name of a javascript entity.\n * @param in_obj - A javascript entity.\n * @returns The type name for in_obj.\n */\nconst _getType = (in_obj: any): string => Object.prototype.toString.call(in_obj).slice(8, -1);\n\ntype PathEqualityInfo = {\n\tisEqual: boolean;\n\tpath: string;\n};\n\nfunction isPropertyArray(source: SchemaEntityType): source is PropertiesType {\n\treturn every(source, (entry: PropertyType) => isObject(entry) && entry.id !== undefined);\n}\n\n// function isSchemaTemplate(source: SchemaEntityType): source is PropertySchema {\n// return isObject(source) && !Array.isArray(source);\n// }\n\n/**\n * An object deep compare with special handling for pset property arrays.\n * pset property arrays are allowed to be out of order as long as elements can be matched with\n * their id.\n * @param in_source - The source entity to test for deep equality.\n * @param in_target - The target entity to test for deep equality.\n * @returns {isEqual: false, path: 'foo.properties[1].x'}\n *\n * - isEqual: true if in_source and in_target property sets are equal, even if the individual property arrays\n * differ but contain the same out of order elements.\n *\n * - path: path to the property that is not equal.\n */\nconst _psetDeepEquals = function (\n\tin_source: SchemaEntityType,\n\tin_target: SchemaEntityType,\n): PathEqualityInfo {\n\tconst idPath = [];\n\tif (!Array.isArray(in_source) && in_source.typeid) {\n\t\tidPath.push(`<${in_source.typeid}>`);\n\t}\n\n\t/**\n\t * Create the _psetDeepEquals result.\n\t * @param isEqual - Whether or not a PropertySet result is being constructed for\n\t * PropertySets that are deeply equal.\n\t * @returns {{isEqual: boolean, path: string}} An object that indicates whether or not the source\n\t * and target PropertySets are deeply equal. If they're not, it also contains a path to the\n\t * property that is not equal.\n\t */\n\tconst _getPSetDeepEqualsResult = (isEqual: boolean): PathEqualityInfo => ({\n\t\tisEqual,\n\t\tpath: isEqual ? undefined : idPath.join(\"\"),\n\t});\n\n\t/**\n\t * Performs a recursive, depth first deep equal test against two PropertySets.\n\t * @param source - The source entity to test for deep equality.\n\t * @param target - The target entity to test for deep equality.\n\t * @param id - The current path element being compared.\n\t * @return The result of _getPSetDeepEqualsResult\n\t */\n\tlet _depthFirstDeepEquals = function (\n\t\tsource: SchemaEntityType,\n\t\ttarget: SchemaEntityType,\n\t\tid?: string,\n\t): PathEqualityInfo {\n\t\tlet result = _getPSetDeepEqualsResult(true);\n\n\t\tif (id) {\n\t\t\tif (typeof id === \"number\") {\n\t\t\t\tidPath.push(`[${id}]`);\n\t\t\t} else {\n\t\t\t\tidPath.push(`.${id}`);\n\t\t\t}\n\t\t}\n\n\t\tif (Array.isArray(source)) {\n\t\t\tif (!Array.isArray(target)) {\n\t\t\t\treturn _getPSetDeepEqualsResult(false);\n\t\t\t}\n\n\t\t\tif (source.length !== target.length) {\n\t\t\t\treturn _getPSetDeepEqualsResult(false);\n\t\t\t}\n\n\t\t\tif (source.length === 0) {\n\t\t\t\treturn _getPSetDeepEqualsResult(true);\n\t\t\t}\n\n\t\t\t// See if we're comparing arrays of objects (like properties) or simple arrays of strings\n\t\t\t// like inheritance lists.\n\t\t\tif (isPropertyArray(source)) {\n\t\t\t\tconst targetMap = {};\n\t\t\t\teach(target, function (element: PropertyType) {\n\t\t\t\t\ttargetMap[element.id] = element;\n\t\t\t\t});\n\n\t\t\t\tfor (let i = 0; i < source.length && result.isEqual; i++) {\n\t\t\t\t\tconst sourceId = source[i].id;\n\t\t\t\t\tresult = _depthFirstDeepEquals.call(this, source[i], targetMap[sourceId], sourceId);\n\t\t\t\t\tidPath.pop();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Element order matters\n\t\t\t\tfor (let i = 0; i < source.length && result.isEqual; i++) {\n\t\t\t\t\tresult = _depthFirstDeepEquals.call(this, source[i], target[i], i);\n\t\t\t\t\tidPath.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isObject(source)) {\n\t\t\tif (!isObject(target)) {\n\t\t\t\treturn _getPSetDeepEqualsResult(false);\n\t\t\t}\n\n\t\t\tconst keysSource = Object.keys(source);\n\t\t\tconst keysTarget = Object.keys(target);\n\t\t\tif (keysSource.length !== keysTarget.length) {\n\t\t\t\t// A template with abstract properties must equal one with an empty properties array\n\t\t\t\t// We check the difference in keys between the source and target and if the only difference is the\n\t\t\t\t// properties array we check if it's empty. Then we reverse the condition so it work both ways.\n\t\t\t\tif (\n\t\t\t\t\t(isEqual(difference(keysTarget, keysSource), [\"properties\"]) &&\n\t\t\t\t\t\t!(target as any).properties.length) ||\n\t\t\t\t\t(isEqual(difference(keysSource, keysTarget), [\"properties\"]) &&\n\t\t\t\t\t\t!source.properties.length)\n\t\t\t\t) {\n\t\t\t\t\treturn _getPSetDeepEqualsResult(true);\n\t\t\t\t}\n\n\t\t\t\treturn _getPSetDeepEqualsResult(false);\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < keysSource.length && result.isEqual; i++) {\n\t\t\t\tconst keyName = keysSource[i];\n\t\t\t\tlet id = keyName === \"properties\" ? undefined : keyName;\n\t\t\t\tresult = _depthFirstDeepEquals.call(this, source[keyName], target[keyName], id);\n\t\t\t\tif (id) {\n\t\t\t\t\tidPath.pop();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tresult = _getPSetDeepEqualsResult(\n\t\t\t\t_getType.call(this, source) === _getType.call(this, target) && source === target,\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t};\n\n\treturn _depthFirstDeepEquals.call(this, in_source, in_target);\n};\n\n/**\n * Fetches the non semver part of a typeid string.\n * @param in_typeid - A PropertySet typeid. For example: 'TeamLeoValidation2:ColorID-1.0.0'.\n * @returns The typeid, without a semver.\n */\nconst _stripSemverFromTypeId = function (in_typeid: string): string | null {\n\tconst semverRegex = /(.*)-.*$/g;\n\tconst match = semverRegex.exec(in_typeid);\n\treturn match ? match[1] : null;\n};\n\nconst _unresolvedTypes = function (in_template: PropertySchema) {\n\tlet first = true;\n\tconst that = this;\n\tconst accSet = traverse(in_template).reduce(function (\n\t\tacc: { [x: string]: string },\n\t\tx: PropertySchema,\n\t) {\n\t\tif (first) {\n\t\t\tacc = {};\n\t\t\tfirst = false;\n\t\t}\n\t\tif (isObject(x) && has(x, \"typeid\")) {\n\t\t\tconst extractedTypeid = _extractTypeid.call(that, x.typeid);\n\n\t\t\tif (!TypeIdHelper.isPrimitiveType(extractedTypeid)) {\n\t\t\t\tacc[extractedTypeid] = \"\";\n\t\t\t}\n\t\t}\n\t\treturn acc;\n\t});\n\n\treturn Object.keys(accSet);\n};\n\n/**\n * Performs basic template validation.\n * @param in_template - The template object to validate.\n */\nconst _validateBasic = function (in_template: PropertySchema) {\n\tif (!in_template) {\n\t\tthis._resultBuilder.addError(new Error(MSG.NO_TEMPLATE));\n\t} else if (!in_template.typeid) {\n\t\tthis._resultBuilder.addError(new Error(MSG.MISSING_TYPE_ID + JSON.stringify(in_template)));\n\t}\n};\n\n/**\n * Validations performed when the version increases between consecutive templates.\n *\n * @remarks\n * For example: 1.1.3 -> 2.0.0\n * This function checks the change level (PATCH, MINOR, MAJOR) and analyses the template content\n * to emit warnings if the change level should be higher, given the content that changed.\n * This function assumes that: in_versionPrevious < in_version.\n *\n * @param in_template - The latest template object.\n * @param in_templatePrevious - The previous template object.\n * @param in_version - The latest template version. Ex.: '2.0.0'.\n * @param in_versionPrevious - The previous template version. Ex.: '1.1.3'.\n */\nconst _validatePositiveIncrement = function (\n\tin_template: PropertySchema,\n\tin_templatePrevious: PropertySchema,\n\tin_version: string,\n\tin_versionPrevious: string,\n) {\n\tConsoleUtils.assert(\n\t\tgt(in_version, in_versionPrevious),\n\t\t\"property-changeset.TemplateValidator._validatePositiveIncrement called on non incremental \" +\n\t\t\t\"template versions\",\n\t);\n\n\tconst versionDiff = diff(in_version, in_versionPrevious);\n\n\tif (CHANGE_LEVEL[versionDiff] >= CHANGE_LEVEL.major) {\n\t\t// No need to warn about change levels since they're already declared to be major.\n\t\treturn;\n\t}\n\n\tif (major(in_version) === 0) {\n\t\t// Unstable version doesn't produce any warning.\n\t\treturn;\n\t}\n\n\tconst idPath = [`<${in_template.typeid}>`];\n\n\tlet _depthFirstCompare = function (\n\t\tid: string,\n\t\tsourceObj: SchemaEntityType,\n\t\ttargetObj: SchemaEntityType,\n\t) {\n\t\tif (id === \"annotation\") {\n\t\t\t// Here, we know that the version has increased (patch, prepatch or prerelease), so\n\t\t\t// there's no need to check inside comments for changes.\n\t\t\treturn;\n\t\t}\n\n\t\tif (id) {\n\t\t\tidPath.push(id);\n\t\t}\n\n\t\tif ((sourceObj === undefined) !== (targetObj === undefined)) {\n\t\t\tlet minimumLevel: string;\n\t\t\tlet mutation: string;\n\n\t\t\tif (targetObj === undefined) {\n\t\t\t\t// An element has been deleted.\n\t\t\t\tminimumLevel = \"major\";\n\t\t\t\tmutation = \"delete\";\n\t\t\t} else {\n\t\t\t\t// An element has been added\n\t\t\t\tminimumLevel = \"minor\";\n\t\t\t\tmutation = \"add\";\n\t\t\t}\n\n\t\t\tif (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {\n\t\t\t\t// Violates rule 6 (warning).\n\t\t\t\tthis._resultBuilder.addWarning(\n\t\t\t\t\tMSG.CHANGE_LEVEL_TOO_LOW_1 +\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tmutation,\n\t\t\t\t\t\t\tid: idPath.join(\".\"),\n\t\t\t\t\t\t\tlevel: {\n\t\t\t\t\t\t\t\texpected: minimumLevel,\n\t\t\t\t\t\t\t\tactual: versionDiff,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tversion: {\n\t\t\t\t\t\t\t\tcurrent: in_version,\n\t\t\t\t\t\t\t\tprevious: in_versionPrevious,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tconst sourceObjType = _getType.call(this, sourceObj);\n\t\t\tconst targetObjType = _getType.call(this, targetObj);\n\t\t\tif (sourceObjType !== targetObjType) {\n\t\t\t\tthis._resultBuilder.addWarning(\n\t\t\t\t\tMSG.CHANGE_LEVEL_TOO_LOW_1 +\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tmutation: \"change\",\n\t\t\t\t\t\t\tid: idPath.join(\".\"),\n\t\t\t\t\t\t\ttype: {\n\t\t\t\t\t\t\t\tcurrent: targetObjType,\n\t\t\t\t\t\t\t\tprevious: sourceObjType,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tlevel: {\n\t\t\t\t\t\t\t\texpected: \"major\",\n\t\t\t\t\t\t\t\tactual: versionDiff,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tversion: {\n\t\t\t\t\t\t\t\tcurrent: in_version,\n\t\t\t\t\t\t\t\tprevious: in_versionPrevious,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (Array.isArray(sourceObj)) {\n\t\t\t\tlet targetMap = {};\n\t\t\t\teach(targetObj, function (element: any) {\n\t\t\t\t\ttargetMap[element.id] = element;\n\t\t\t\t});\n\n\t\t\t\tfor (let i = 0; i < sourceObj.length; i++) {\n\t\t\t\t\tconst element = sourceObj[i] as any;\n\t\t\t\t\t_depthFirstCompare.call(this, element.id, element, targetMap[element.id]);\n\t\t\t\t\tdelete targetMap[element.id];\n\t\t\t\t}\n\n\t\t\t\tif (!isEmpty(targetMap)) {\n\t\t\t\t\t// Added array element.\n\t\t\t\t\tlet minimumLevel = \"minor\";\n\t\t\t\t\tif (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {\n\t\t\t\t\t\t// Violates rule 5 (warning)\n\t\t\t\t\t\tidPath.push(Object.keys(targetMap)[0]);\n\t\t\t\t\t\tthis._resultBuilder.addWarning(\n\t\t\t\t\t\t\tMSG.CHANGE_LEVEL_TOO_LOW_1 +\n\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\tmutation: \"add\",\n\t\t\t\t\t\t\t\t\tid: idPath.join(\".\"),\n\t\t\t\t\t\t\t\t\tlevel: {\n\t\t\t\t\t\t\t\t\t\texpected: minimumLevel,\n\t\t\t\t\t\t\t\t\t\tactual: versionDiff,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tversion: {\n\t\t\t\t\t\t\t\t\t\tcurrent: in_version,\n\t\t\t\t\t\t\t\t\t\tprevious: in_versionPrevious,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tidPath.pop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (isObject(sourceObj)) {\n\t\t\t\tconst keysSource = Object.keys(sourceObj);\n\t\t\t\tlet targetMap = {};\n\t\t\t\tmapValues(targetObj, function (val, key) {\n\t\t\t\t\ttargetMap[key] = val;\n\t\t\t\t});\n\n\t\t\t\tfor (let i = 0; i < keysSource.length; i++) {\n\t\t\t\t\tlet valueSource = sourceObj[keysSource[i]];\n\t\t\t\t\tlet valueTarget = targetObj[keysSource[i]];\n\t\t\t\t\t_depthFirstCompare.call(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tkeysSource[i] === \"properties\" ? undefined : keysSource[i],\n\t\t\t\t\t\tvalueSource,\n\t\t\t\t\t\tvalueTarget,\n\t\t\t\t\t);\n\t\t\t\t\tdelete targetMap[keysSource[i]];\n\t\t\t\t}\n\n\t\t\t\tconst remainingKeys = Object.keys(targetMap);\n\t\t\t\tif (!isEmpty(remainingKeys)) {\n\t\t\t\t\t// Added new keys to the target. This is a MINOR change, unless they new key is a\n\t\t\t\t\t// comment, in which case this is a PATCH level change.\n\t\t\t\t\tlet minimumLevel =\n\t\t\t\t\t\tremainingKeys.length === 1 && remainingKeys[0] === \"annotation\"\n\t\t\t\t\t\t\t? \"patch\"\n\t\t\t\t\t\t\t: \"minor\";\n\t\t\t\t\tif (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {\n\t\t\t\t\t\t// Violates rule 5 (warning)\n\t\t\t\t\t\tidPath.push(remainingKeys[0]);\n\t\t\t\t\t\tthis._resultBuilder.addWarning(\n\t\t\t\t\t\t\tMSG.CHANGE_LEVEL_TOO_LOW_1 +\n\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\tmutation: \"add\",\n\t\t\t\t\t\t\t\t\tid: idPath.join(\".\"),\n\t\t\t\t\t\t\t\t\tlevel: {\n\t\t\t\t\t\t\t\t\t\texpected: minimumLevel,\n\t\t\t\t\t\t\t\t\t\tactual: versionDiff,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tversion: {\n\t\t\t\t\t\t\t\t\t\tcurrent: in_version,\n\t\t\t\t\t\t\t\t\t\tprevious: in_versionPrevious,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tidPath.pop();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (idPath.length === 2 && id === \"typeid\") {\n\t\t\t\t\t// This is the root property typeid. Ignore the version component.\n\t\t\t\t\tsourceObj = _stripSemverFromTypeId.call(this);\n\t\t\t\t\ttargetObj = _stripSemverFromTypeId.call(this);\n\t\t\t\t}\n\n\t\t\t\tif (sourceObj !== targetObj) {\n\t\t\t\t\tlet minimumLevel = id === \"value\" ? \"minor\" : \"major\";\n\t\t\t\t\tif (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {\n\t\t\t\t\t\tthis._resultBuilder.addWarning(\n\t\t\t\t\t\t\tMSG.CHANGE_LEVEL_TOO_LOW_1 +\n\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\tmutation: \"change\",\n\t\t\t\t\t\t\t\t\tid: idPath.join(\".\"),\n\t\t\t\t\t\t\t\t\tlevel: {\n\t\t\t\t\t\t\t\t\t\texpected: minimumLevel,\n\t\t\t\t\t\t\t\t\t\tactual: versionDiff,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tvalue: {\n\t\t\t\t\t\t\t\t\t\tcurrent: targetObj,\n\t\t\t\t\t\t\t\t\t\tprevious: sourceObj,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tversion: {\n\t\t\t\t\t\t\t\t\t\tcurrent: in_version,\n\t\t\t\t\t\t\t\t\t\tprevious: in_versionPrevious,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (id) {\n\t\t\tidPath.pop();\n\t\t}\n\t};\n\t// console.assert(has(in_templatePrevious, 'id')); // TODO: Revisit this line after running the tests.\n\t_depthFirstCompare.call(\n\t\tthis,\n\t\t(in_templatePrevious as any).id,\n\t\tin_templatePrevious,\n\t\tin_template,\n\t);\n};\n\n/**\n * Validations performed when the version between consecutive templates doesn't change.\n * For example: 1.1.3 -> 1.1.3.\n * Templates whose version didn't change should have identical content.\n * @param in_template - The latest template object.\n * @param in_templatePrevious - The previous template object.\n */\nconst _validateSameVersion = function (\n\tin_template: PropertySchema,\n\tin_templatePrevious: PropertySchema,\n) {\n\tconst result = _psetDeepEquals.call(this, in_templatePrevious, in_template);\n\tif (!result.isEqual) {\n\t\t// Violates rule 3a.\n\t\tthis._resultBuilder.addError(\n\t\t\tnew Error(MSG.MODIFIED_TEMPLATE_SAME_VERSION_1 + result.path),\n\t\t);\n\t}\n};\n\n/**\n * Validate a template\n * Check that the template is syntactically correct as well as semantically correct.\n * @param in_template - The template to check against.\n * Produces an {object|undefined} map of key-value pairs where the path of the invalid property is the key and the\n * value is the error message.\n *\n * i.e.\n *\n * ```\n * <pre>\n * {\n * 'isValid': true or false,\n * 'typeid': 'The typeid of the object being parsed',\n * 'unresolvedTypes': [ 'An array', 'of strong typeids', 'that were found',\n * 'in the document', 'but not resolved from the local cache' ],\n * 'resolvedTypes': [ 'Array of', 'strong types resolved', 'during template parsing'],\n * 'errors': [ 'Array of', 'objects describing', 'syntax errors in the template' ]\n * ...\n * }\n * </pre>\n * ```\n * @throws if context validation fails\n */\nconst _validateSemanticAndSyntax = function (in_template: PropertySchema) {\n\t_validateSyntax.call(this, in_template);\n\t_validateConstants.call(this, in_template);\n\t// TODO: _validateSemantic\n};\n\n/**\n * Validate a template\n * Check that the template is syntactically correct as well as semantically correct.\n * @param in_template - The template to check against\n * @return {Promise} a promise that resolved to nothing\n * @ignore\n */\nconst _validateSemanticAndSyntaxAsync = async function (\n\tin_template: PropertySchema,\n): Promise<any> {\n\treturn _validateSyntaxAsync.call(this, in_template);\n};\n\n/**\n * Validates that the semver part of a template's typeid is valid.\n * @param {Object} in_template - The template object to validate.\n * @return {string} The semver string. For example: '1.0.0'.\n * @private\n * @this TemplateValidator\n * @ignore\n */\nconst _validateSemverFormat = function (in_template) {\n\tconst templateVersion = _getSemverFromTypeId.call(this, in_template.typeid);\n\tif (!templateVersion) {\n\t\tthis._resultBuilder.addError(new Error(MSG.MISSING_VERSION + in_template.typeid));\n\t} else if (valid(templateVersion) !== templateVersion) {\n\t\tthis._resultBuilder.addError(new Error(MSG.INVALID_VERSION_1 + templateVersion));\n\t}\n\n\treturn templateVersion;\n};\n\n/**\n * Skip semver validation. Verify that the content is the same for both templates, while ignoring\n * the root 'typeid' property.\n * @param {Object} in_template - The latest template object.\n * @param {Object} in_templatePrevious - The previous template object.\n * @private\n * @this TemplateValidator\n */\nconst _validateSkipSemver = function (in_template, in_templatePrevious) {\n\t// Skipping the semver validation. Ignore the root typeid field.\n\tconst result = _psetDeepEquals.call(this, in_template, in_templatePrevious);\n\tif (!result.isEqual) {\n\t\t// Violates rule 3a.\n\t\tthis._resultBuilder.addError(new Error(MSG.MODIFIED_TEMPLATE_1 + result.path));\n\t}\n};\n\n/**\n * Checks if an invalid context error should be signified\n *\n * @param {String} in_context - The latest template object.\n * @return {Error|undefined} If exists returns the InvalidContext error\n * @private\n * @this TemplateValidator\n */\nconst getInvalidContextError = function (in_context) {\n\tif (in_context && !includes(VALID_CONTEXTS, in_context)) {\n\t\treturn new Error(`${MSG.NOT_A_VALID_CONTEXT} ${in_context}`);\n\t}\n\n\treturn undefined;\n};\n\n/**\n * Validate that the context is valid\n * Validate that only Named Properties are in sets\n * @param {object} in_template - The template to check against\n * @ignore\n * @throws if the context is invalid.\n */\nconst _validateContext = function (in_template) {\n\tconst context = in_template.context;\n\n\tconst error = getInvalidContextError(context);\n\tif (error) {\n\t\tthrow error;\n\t}\n\tif (context === \"map\" && in_template.contextKeyType === \"typeid\") {\n\t\tthrow new Error(MSG.INVALID_OPTION_NONE_CONSTANTS);\n\t}\n};\n\n/**\n * Validate just the syntax of a template\n * Check that the template is well-formed, according to the schema.\n * @param {object} in_template - The template to check against\n *\n * Context validation makes sure that elements of sets eventually inherit from NamedProperty.\n * If this is not the case, a promise rejection will occur with the appropriate error.\n * @return {Promise} promise that returns without any value and rejects in case of validation error\n * @ignore\n */\nconst _validateContextAsync = async function (in_template) {\n\tconst that = this;\n\tconst context = in_template.context;\n\n\tconst error = getInvalidContextError(context);\n\tif (error) {\n\t\tthrow error;\n\t}\n\tif (context === \"map\" && in_template.contextKeyType === \"typeid\") {\n\t\tthrow new Error(MSG.INVALID_OPTION_NONE_CONSTANTS);\n\t}\n\t// If context is not 'set' validation doesn't apply\n\tif (context !== \"set\") {\n\t\treturn Promise.resolve();\n\t}\n\n\tlet typedValuePromises = [Promise.resolve()];\n\tif (in_template.typedValue) {\n\t\ttypedValuePromises = map(in_template.typedValue, (tv) =>\n\t\t\tthat.inheritsFrom(tv.typeid, \"NamedProperty\"),\n\t\t);\n\t} else {\n\t\t// Since context is 'set' the template must eventually inherit from NamedProperty\n\t\tif (in_template.inherits === undefined) {\n\t\t\tthrow new Error(MSG.SET_ONLY_NAMED_PROPS);\n\t\t}\n\n\t\t// Since context is 'set' the template must eventually inherit from NamedProperty (same as above)\n\t\tif (\n\t\t\tincludes(in_template.inherits, \"NamedProperty\") ||\n\t\t\tin_template.inherits === \"NamedProperty\"\n\t\t) {\n\t\t\treturn Promise.resolve();\n\t\t}\n\t}\n\tconst typedValuePromise = Promise.all(typedValuePromises);\n\n\tlet parents = [];\n\tif (in_template.inherits) {\n\t\tparents = Array.isArray(in_template.inherits)\n\t\t\t? in_template.inherits\n\t\t\t: [in_template.inherits];\n\t}\n\tconst inheritsPromises = parents.map((typeid) =>\n\t\tthis._inheritsFromAsync(typeid, \"NamedProperty\"),\n\t);\n\n\t// Combine results from inheritsPromises and typedValuePromise\n\tinheritsPromises.push(typedValuePromise);\n\treturn Promise.all(inheritsPromises)\n\t\t.then(function (results) {\n\t\t\tconst foundNamedPropertyDescendant = find(results, (res) => res);\n\t\t\tif (!foundNamedPropertyDescendant) {\n\t\t\t\tthrow Error(MSG.SET_ONLY_NAMED_PROPS);\n\t\t\t}\n\n\t\t\treturn that._hasSchemaAsync(in_template.typeid);\n\t\t})\n\t\t.then(function (hasIt) {\n\t\t\tif (!hasIt) {\n\t\t\t\tthrow new Error(MSG.SET_ONLY_NAMED_PROPS);\n\t\t\t}\n\n\t\t\treturn that._inheritsFromAsync(in_template.typeid, \"NamedProperty\");\n\t\t})\n\t\t.then(async function (res) {\n\t\t\tif (res) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tthrow new Error(MSG.SET_ONLY_NAMED_PROPS);\n\t\t});\n};\n\n/**\n * Validate that the context is valid\n * Validate that only Named Properties are in sets\n * @param {object} in_template - The template to check against\n * @ignore\n * @throws if the context is invalid.\n */\nlet _validateConstants = function (in_template) {\n\tconst that = this;\n\tif (in_template.constants && Array.isArray(in_template.constants)) {\n\t\tfor (let i = 0; i < in_template.constants.length; i++) {\n\t\t\tconst constant = in_template.constants[i];\n\t\t\tconst context = constant.context;\n\n\t\t\tif (context === \"map\" && constant.contextKeyType === \"typeid\") {\n\t\t\t\teach(constant.value, function (value, key) {\n\t\t\t\t\tif (!TypeIdHelper.isTemplateTypeid(key)) {\n\t\t\t\t\t\tthat._resultBuilder.addError(new Error(MSG.KEY_MUST_BE_TYPEID + key));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * Analyze output of the syntax validation and build error messages\n *\n * @param in_template - The template that was analyzed\n */\nconst _processValidationResults = function (in_template: PropertySchema) {\n\tlet that = this;\n\tlet result = this._resultBuilder.result;\n\n\tresult.isValid = _syntaxValidator(in_template);\n\tif (!result.isValid) {\n\t\tConsoleUtils.assert(\n\t\t\t!isEmpty(_syntaxValidator.errors),\n\t\t\t\"template validation failed but produced no error\",\n\t\t);\n\t}\n\n\tif (_syntaxValidator.errors) {\n\t\teach(_syntaxValidator.errors, function (error) {\n\t\t\tconst regexTypeId = /typeid/;\n\t\t\tswitch (error.keyword) {\n\t\t\t\tcase \"pattern\":\n\t\t\t\t\tif (error.instancePath === \".typeid\") {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\t\t\t\terror.message = `typeid should have a pattern like: my.example:point-1.0.0 ${error.data} does not match that pattern`;\n\t\t\t\t\t} else if (\"pattern\" && regexTypeId.test(error.instancePath)) {\n\t\t\t\t\t\terror.message =\n\t\t\t\t\t\t\terror.schemaPath === \"#/definitions/typed-reference-typeid/pattern\"\n\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t: `${error.instancePath} should follow this pattern: <namespace>:<typeid>-<version> ` +\n\t\t\t\t\t\t\t\t\t`(for example: Sample:Rectangle-1.0.0) or match one of the Primitive Types (Float32, Float64, ` +\n\t\t\t\t\t\t\t\t\t`Int8, Uint8, Int16, Uint16, Int32, Uint32, Bool, String, Reference, Enum, Int64, Uint64) or ` +\n\t\t\t\t\t\t\t\t\t`Reserved Types (BaseProperty, NamedProperty, NodeProperty, NamedNodeProperty, ` +\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\t\t\t\t\t\t\t`RelationshipProperty). '${error.data}' is not valid`;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"enum\":\n\t\t\t\t\terror.message = regexTypeId.test(error.instancePath)\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: // eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\t\t\t\t\t`${error.instancePath} should match one of the following: ${error.schema}`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"type\":\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-base-to-string\n\t\t\t\t\terror.message = `${error.instancePath} should be a ${error.schema}`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase \"not\":\n\t\t\t\t\tif (error.schemaPath === \"#/switch/1/then/anyOf/0/properties/typeid/not\") {\n\t\t\t\t\t\t// remove .typeid at the end of the instancePath\n\t\t\t\t\t\terror.message = `For ${error.instancePath.slice(\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t-7,\n\t\t\t\t\t\t)}: Properties should have either a typeid or an array of child properties, but not both.`;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\terror.schemaPath === \"#/switch/1/then/anyOf/1/properties/properties/not\"\n\t\t\t\t\t) {\n\t\t\t\t\t\t// remove .properties at the end of the instancePath\n\t\t\t\t\t\terror.message = `For ${error.instancePath.slice(\n\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t-11,\n\t\t\t\t\t\t)}: Properties should have either a typeid or an array of child properties, but not both.`;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\t// these errors do not add any information. All necessary information is in the 'enum' errors\n\t\t\t\t// empty errors will be filtered out before logging.\n\t\t\t\tcase \"oneOf\":\n\t\t\t\tcase \"anyOf\":\n\t\t\t\t\terror.message = \"\";\n\t\t\t\t\tbreak;\n\n\t\t\t\t// for minItems, required and any other error - add instancePath to indicate which part of the\n\t\t\t\t// template the error refers to.\n\t\t\t\tdefault:\n\t\t\t\t\terror.message = `${error.instancePath} ${error.message}`;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// Deep-copy for thread-safety.\n\t\t\tthat._resultBuilder.addError(cloneDeep(error));\n\t\t});\n\t}\n\n\tresult.unresolvedTypes = _unresolvedTypes.call(this, in_template);\n};\n\n/**\n * Validate just the syntax of a template\n * Check that the template is well-formed, according to the schema.\n * @param in_template - The template to check against\n * @throws if a property with context set is not an instance of NamedProperties\n * @ignore\n */\nlet _validateSyntax = function (in_template: PropertySchema) {\n\tconst that = this;\n\t// recursively test all properties for context\n\tlet recursiveContextCheck = function (template) {\n\t\t_validateContext.call(that, template);\n\t\tif (template.properties) {\n\t\t\ttemplate.properties.forEach(function (property) {\n\t\t\t\trecursiveContextCheck(property);\n\t\t\t});\n\t\t}\n\t};\n\n\trecursiveContextCheck(in_template);\n\n\t_processValidationResults.call(this, in_template);\n\n\tconst result = this._resultBuilder.result;\n\tresult.unresolvedTypes = _unresolvedTypes.call(this, in_template);\n};\n\nconst createContextCheckAsyncQueue = function () {\n\tconst that = this;\n\tconst contextCheckWorker = function (in_task, in_callback) {\n\t\tconst property = in_task.property;\n\t\t_validateContextAsync\n\t\t\t.call(that, property)\n\t\t\t.then(function (response) {\n\t\t\t\tin_callback();\n\t\t\t})\n\t\t\t.catch(function (error) {\n\t\t\t\tin_callback({ error });\n\t\t\t});\n\t};\n\t// Async queue for schema context check tasks\n\treturn queue(contextCheckWorker, 5);\n};\n\n/**\n * Validate just the syntax of a template\n * Check that the template is well-formed, according to the schema.\n *\n * @param in_template - The template to check against\n * Mainly checks context. See _validateContextAsync\n * @returns Promise that resolves without any result\n * @ignore\n */\nlet _validateSyntaxAsync = async function (\n\tin_template: PropertySchema,\n): Promise<SchemaValidationResult> {\n\tconst that = this;\n\n\treturn new Promise(function (resolve, reject) {\n\t\tif (that.asyncValidationInProgress === true) {\n\t\t\treject(new Error(MSG.CONTEXT_VALIDATION_IN_PROGRESS));\n\t\t\treturn;\n\t\t}\n\n\t\tthat.asyncValidationInProgress = true;\n\n\t\tconst contextCheckAsyncQueue = createContextCheckAsyncQueue.call(that);\n\n\t\t// recursively test all properties for context\n\t\tlet recursiveContextCheck = function (template) {\n\t\t\t// Does the call to _validateContextAsync\n\t\t\tcontextCheckAsyncQueue.push({ property: template }, function (error) {\n\t\t\t\tif (error !== undefined) {\n\t\t\t\t\treject(new Error(error));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (template.properties) {\n\t\t\t\ttemplate.properties.forEach(function (property) {\n\t\t\t\t\trecursiveContextCheck(property);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\t\trecursiveContextCheck(in_template);\n\n\t\tcontextCheckAsyncQueue.drain(function () {\n\t\t\tconst result = that._resultBuilder.result;\n\t\t\t_processValidationResults.call(that, in_template);\n\t\t\tresult.unresolvedTypes = _unresolvedTypes.call(that, in_template);\n\n\t\t\tthat.asyncValidationInProgress = false;\n\t\t\tresolve(result);\n\t\t});\n\t});\n};\n\nexport interface TemplateValidatorOptions {\n\t/**\n\t * When set to true, {@link #validate} only checks the supplied templates' content\n\t * and fails the validation if they're not identical. Defaults to false.\n\t */\n\tskipSemver?: boolean;\n\t/**\n\t * When set to true, the typeid of any schema can have '-draft' as a version. Defaults to false.\n\t */\n\tallowDraft?: boolean;\n\t/**\n\t * Function that checks if a template inherits from another.\n\t */\n\tinheritsFrom?: (source: PropertySchema, target: PropertySchema) => boolean;\n\t/**\n\t * Function that checks if we have a template matching a typeid.\n\t */\n\thasSchema?: (schema: PropertySchema, typeid: string) => boolean;\n\t/**\n\t * Function that checks if a template inherits from another asynchronously.\n\t */\n\tinheritsFromAsync?: (source: PropertySchema, target: PropertySchema) => Promise<boolean>;\n\t/**\n\t * Function that checks if we have a template matching a typeid asynchronously.\n\t */\n\thasSchemaAsync?: (schema: PropertySchema, typeid: string) => Promise<boolean>;\n}\n\nconst Utils = {\n\tpsetDeepEquals(in_source: PropertySchema, in_target: PropertySchema) {\n\t\treturn _psetDeepEquals.call(this, in_source, in_target).isEqual;\n\t},\n};\n\n/**\n * Instantiates a new TemplateValidator. Must be provided with a set of inheritsFrom and hasSchema\n * function or inheritsFromAsync and hasSchemaAsync, but not both.\n * @internal\n */\nexport class TemplateValidator {\n\tstatic Utils = Utils;\n\tprivate _resultBuilder: ValidationResultBuilder;\n\tpublic _inheritsFrom: (source: PropertySchema, target: PropertySchema) => boolean;\n\tpublic _hasSchema: (schema: PropertySchema, typeid: string) => boolean;\n\tpublic _inheritsFromAsync: (\n\t\tsource: PropertySchema,\n\t\ttarget: PropertySchema,\n\t) => Promise<boolean>;\n\tpublic _hasSchemaAsync: (schema: PropertySchema, typeid: string) => Promise<boolean>;\n\tprivate readonly _allowDraft: boolean;\n\tprivate readonly _skipSemver: boolean;\n\tconstructor(in_params: TemplateValidatorOptions = { skipSemver: false, allowDraft: false }) {\n\t\tthis._skipSemver = in_params ? !!in_params.skipSemver : false;\n\t\tthis._allowDraft = in_params ? !!in_params.allowDraft : false;\n\t\t// Used by validate()\n\t\tif (\n\t\t\tin_params &&\n\t\t\tin_params.inheritsFrom !== undefined &&\n\t\t\tin_params.hasSchema !== undefined\n\t\t) {\n\t\t\tthis._inheritsFrom = in_params.inheritsFrom;\n\t\t\tthis._hasSchema = in_params.hasSchema;\n\t\t} else if (\n\t\t\tin_params &&\n\t\t\tin_params.inheritsFromAsync !== undefined &&\n\t\t\tin_params.hasSchemaAsync !== undefined\n\t\t) {\n\t\t\tthis._inheritsFromAsync = in_params.inheritsFromAsync;\n\t\t\tthis._hasSchemaAsync = in_params.hasSchemaAsync;\n\t\t} else {\n\t\t\tthrow new Error(MSG.MISSING_INHERITSFROM_OR_HASSCHEMA);\n\t\t}\n\t}\n\n\t/**\n\t * Validates that all templates conform to the following mandatory rules:\n\t *\n\t * 1. Must have a typeid attribute.\n\t *\n\t * 2. typeid must end in a valid semver string.\n\t *\n\t * 3. When both in_template (B) and in_templatePrevious (A) are supplied:\n\t *\n\t * - 3a. Semver is identical only if content is identical.\n\t *\n\t * - 3b. B's semver >= A's semver\n\t *\n\t * Additionally, the following soft rules will produce warnings when violated:\n\t *\n\t * 3.5. Elements of sets must eventually inherit from 'NamedProperty'\n\t *\n\t * 4. PATCH revision should be increased when _only_ the template description changes.\n\t *\n\t * 5. Adding one or more template attributes is a MINOR change.\n\t *\n\t * 6. Removing one or more template attributes is a MAJOR change.\n\t *\n\t * @param in_template - The latest template version, as a JSON object.\n\t * @param in_templatePrevious - The previous template version, as a JSON object. Optional.\n\t * @returns The validation results. Example:\n\t *\n\t * ```json\n\t * {\n\t * isValid: false,\n\t * errors: ['Something went wrong. Validation failed.'],\n\t * warnings: ['A non-fatal warning'],\n\t * typeid: 'SomeNamespace:PointID-1.0.0'\n\t * }\n\t * ```\n\t *\n\t * It's possible for 'isValid' to be true while 'warnings' contains one or more messages.\n\t */\n\tvalidate(\n\t\tin_template: PropertySchema,\n\t\tin_templatePrevious?: PropertySchema,\n\t): SchemaValidationResult {\n\t\tthis._resultBuilder = new ValidationResultBuilder(in_template ? in_template.typeid : \"\");\n\n\t\tlet isDraft = false;\n\t\tif (\n\t\t\tin_template &&\n\t\t\tin_template.typeid &&\n\t\t\tTypeIdHelper.extractVersion(in_template.typeid).version === \"draft\"\n\t\t) {\n\t\t\tif (this._allowDraft) {\n\t\t\t\tisDraft = true;\n\t\t\t} else {\n\t\t\t\tthis._resultBuilder.addError(new Error(MSG.DRAFT_AS_VERSION_TYPEID));\n\t\t\t}\n\t\t}\n\n\t\t_validateBasic.call(this, in_template);\n\t\tif (in_templatePrevious) {\n\t\t\t_validateBasic.call(this, in_templatePrevious);\n\t\t}\n\n\t\t// Basic validation (such as input params) must pass before the real validation can begin.\n\t\tif (!this._resultBuilder.isValid()) {\n\t\t\treturn this._resultBuilder.result;\n\t\t}\n\n\t\t_validateSemanticAndSyntax.call(this, in_template);\n\t\tif (!this._resultBuilder.isValid() || isDraft) {\n\t\t\treturn this._resultBuilder.result;\n\t\t}\n\n\t\tif (in_templatePrevious) {\n\t\t\t_validateSemanticAndSyntax.call(this, in_templatePrevious);\n\t\t\tif (!this._resultBuilder.isValid()) {\n\t\t\t\t// Here the previous template is not valid. Make sure the typeid in the returned info is\n\t\t\t\t// the root of the template that failed validation.\n\t\t\t\tthis._resultBuilder.result.typeid = in_templatePrevious.typeid;\n\t\t\t\treturn this._resultBuilder.result;\n\t\t\t}\n\t\t}\n\n\t\tif (this._skipSemver && in_templatePrevious) {\n\t\t\t_validateSkipSemver.call(this, in_template, in_templatePrevious);\n\t\t\treturn this._resultBuilder.result;\n\t\t}\n\n\t\t// semver format validation\n\t\tconst version = _validateSemverFormat.call(this, in_template);\n\t\tconst versionPrevious = in_templatePrevious\n\t\t\t? _validateSemverFormat.call(this, in_templatePrevious)\n\t\t\t: null;\n\n\t\t// semver format validation must pass.\n\t\tif (!this._resultBuilder.isValid()) {\n\t\t\treturn this._resultBuilder.result;\n\t\t}\n\n\t\tif (in_templatePrevious) {\n\t\t\t// Validate that the semver change is valid.\n\t\t\tswitch (compare(version, versionPrevious)) {\n\t\t\t\tcase 0:\n\t\t\t\t\t_validateSameVersion.call(this, in_template, in_templatePrevious);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t// newVersion is greater\n\t\t\t\t\t_validatePositiveIncrement.call(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\tin_template,\n\t\t\t\t\t\tin_templatePrevious,\n\t\t\t\t\t\tversion,\n\t\t\t\t\t\tversionPrevious,\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\tcase -1:\n\t\t\t\t\t// previousVersion is greater. Violates rule 3b.\n\t\t\t\t\tthis._resultBuilder.addError(\n\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\tMSG.VERSION_REGRESSION_1 +\n\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\tcurrent: version,\n\t\t\t\t\t\t\t\t\tprevious: versionPrevious,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn this._resultBuilder.result;\n\t}\n\n\t/**\n\t * Validates that all templates conform to the following mandatory rules:\n\t *\n\t * 1. Must have a typeid attribute.\n\t *\n\t * 2. typeid must end in a valid semver string.\n\t *\n\t * 3. When both in_template (B) and in_templatePrevious (A) are supplied:\n\t *\n\t * - 3a. Semver is identical only if content is identical.\n\t *\n\t * - 3b. B's semver >= A's semver\n\t *\n\t * Additionally, the following soft rules will produce warnings when violated:\n\t *\n\t * 3.5. Elements of sets must eventually inherit from 'NamedProperty'\n\t *\n\t * 4. PATCH revision should be increased when _only_ the template description changes.\n\t *\n\t * 5. Adding one or more template attributes is a MINOR change.\n\t *\n\t * 6. Removing one or more template attributes is a MAJOR change.\n\t *\n\t * @param in_template - The latest template version, as a JSON object.\n\t * @param in_templatePrevious - The previous template version, as a JSON object. Optional.\n\t * @returns A promise that resolves to the validation results as an object. Example:\n\t *\n\t * ```json\n\t * {\n\t * isValid: false,\n\t * errors: ['Something went wrong. Validation failed.'],\n\t * warnings: ['A non-fatal warning'],\n\t * typeid: 'SomeNamespace:PointID-1.0.0'\n\t * }\n\t * ```\n\t *\n\t * It's possible for 'isValid' to be true while 'warnings' contains one or more messages.\n\t */\n\tasync validateAsync(\n\t\tin_template: PropertySchema,\n\t\tin_templatePrevious?: PropertySchema,\n\t): Promise<SchemaValidationResult> {\n\t\tthis._resultBuilder = new ValidationResultBuilder(in_template ? in_template.typeid : \"\");\n\t\t_validateBasic.call(this, in_template);\n\t\tif (in_templatePrevious) {\n\t\t\t_validateBasic.call(this, in_templatePrevious);\n\t\t}\n\t\tif (!this._resultBuilder.isValid()) {\n\t\t\treturn Promise.resolve(this._resultBuilder.result);\n\t\t}\n\t\treturn in_templatePrevious\n\t\t\t? this._validateAsyncWithPreviousSchema(in_template, in_templatePrevious)\n\t\t\t: _validateSemanticAndSyntaxAsync.call(this, in_template);\n\t}\n\n\t/**\n\t * Called by validateAsync if a previous schema is passed in argument\n\t *\n\t * @param in_template - The latest template version, as a JSON object.\n\t * @param in_templatePrevious - The previous template version, as a JSON object. Optional.\n\t *\n\t * @returns promise that resolves to the validation results as an objet. See validateAsync\n\t * @ignore\n\t */\n\tprivate async _validateAsyncWithPreviousSchema(\n\t\tin_template: PropertySchema,\n\t\tin_templatePrevious: PropertySchema,\n\t): Promise<SchemaValidationResult> {\n\t\tconst that = this;\n\t\treturn _validateSemanticAndSyntaxAsync\n\t\t\t.call(that, in_template)\n\t\t\t.then(() => _validateSemanticAndSyntaxAsync.call(that, in_templatePrevious))\n\t\t\t.then(function () {\n\t\t\t\tif (!that._resultBuilder.isValid()) {\n\t\t\t\t\t// Here the previous template is not valid. Make sure the typeid in the returned info is\n\t\t\t\t\t// the root of the template that failed validation.\n\t\t\t\t\tthat._resultBuilder.result.typeid = in_templatePrevious.typeid;\n\t\t\t\t}\n\n\t\t\t\tif (that._skipSemver && in_templatePrevious) {\n\t\t\t\t\t_validateSkipSemver.call(that, in_template, in_templatePrevious);\n\t\t\t\t}\n\n\t\t\t\tconst version = _validateSemverFormat.call(that, in_template);\n\t\t\t\tconst versionPrevious = in_templatePrevious\n\t\t\t\t\t? _validateSemverFormat.call(that, in_templatePrevious)\n\t\t\t\t\t: null;\n\n\t\t\t\t// Validate that the semver change is valid.\n\t\t\t\tswitch (compare(version, versionPrevious)) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t_validateSameVersion.call(that, in_template, in_templatePrevious);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t// newVersion is greater\n\t\t\t\t\t\t_validatePositiveIncrement.call(\n\t\t\t\t\t\t\tthat,\n\t\t\t\t\t\t\tin_template,\n\t\t\t\t\t\t\tin_templatePrevious,\n\t\t\t\t\t\t\tversion,\n\t\t\t\t\t\t\tversionPrevious,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\tcase -1:\n\t\t\t\t\t\t// previousVersion is greater. Violates rule 3b.\n\t\t\t\t\t\tthat._resultBuilder.addError(\n\t\t\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\t\tMSG.VERSION_REGRESSION_1 +\n\t\t\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\t\t\tcurrent: version,\n\t\t\t\t\t\t\t\t\t\tprevious: versionPrevious,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\treturn that._resultBuilder.result;\n\t\t\t});\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,aAAa,EAAyD,MAAM,OAAO,CAAC;AAU7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGrD,OA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