UNPKG

another-json-rules-engine

Version:

Another Json Rules Engine: a flexible rules engine for validating JSON objects in Node.js and browser.

1 lines 54.5 kB
{"version":3,"file":"index.cjs","sources":["../node_modules/object-path/index.js","../src/businessRules.js"],"sourcesContent":["(function (root, factory) {\n 'use strict'\n\n /*istanbul ignore next:cant test*/\n if (typeof module === 'object' && typeof module.exports === 'object') {\n module.exports = factory()\n } else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define([], factory)\n } else {\n // Browser globals\n root.objectPath = factory()\n }\n})(this, function () {\n 'use strict'\n\n var toStr = Object.prototype.toString\n\n function hasOwnProperty (obj, prop) {\n if (obj == null) {\n return false\n }\n //to handle objects with null prototypes (too edge case?)\n return Object.prototype.hasOwnProperty.call(obj, prop)\n }\n\n function isEmpty (value) {\n if (!value) {\n return true\n }\n if (isArray(value) && value.length === 0) {\n return true\n } else if (typeof value !== 'string') {\n for (var i in value) {\n if (hasOwnProperty(value, i)) {\n return false\n }\n }\n return true\n }\n return false\n }\n\n function toString (type) {\n return toStr.call(type)\n }\n\n function isObject (obj) {\n return typeof obj === 'object' && toString(obj) === '[object Object]'\n }\n\n var isArray = Array.isArray || function (obj) {\n /*istanbul ignore next:cant test*/\n return toStr.call(obj) === '[object Array]'\n }\n\n function isBoolean (obj) {\n return typeof obj === 'boolean' || toString(obj) === '[object Boolean]'\n }\n\n function getKey (key) {\n var intKey = parseInt(key)\n if (intKey.toString() === key) {\n return intKey\n }\n return key\n }\n\n function factory (options) {\n options = options || {}\n\n var objectPath = function (obj) {\n return Object.keys(objectPath).reduce(function (proxy, prop) {\n if (prop === 'create') {\n return proxy\n }\n\n /*istanbul ignore else*/\n if (typeof objectPath[prop] === 'function') {\n proxy[prop] = objectPath[prop].bind(objectPath, obj)\n }\n\n return proxy\n }, {})\n }\n\n var hasShallowProperty\n if (options.includeInheritedProps) {\n hasShallowProperty = function () {\n return true\n }\n } else {\n hasShallowProperty = function (obj, prop) {\n return (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop)\n }\n }\n\n function getShallowProperty (obj, prop) {\n if (hasShallowProperty(obj, prop)) {\n return obj[prop]\n }\n }\n\n var getShallowPropertySafely\n if (options.includeInheritedProps) {\n getShallowPropertySafely = function (obj, currentPath) {\n if (typeof currentPath !== 'string' && typeof currentPath !== 'number') {\n currentPath = String(currentPath)\n }\n var currentValue = getShallowProperty(obj, currentPath)\n if (currentPath === '__proto__' || currentPath === 'prototype' ||\n (currentPath === 'constructor' && typeof currentValue === 'function')) {\n throw new Error('For security reasons, object\\'s magic properties cannot be set')\n }\n return currentValue\n }\n } else {\n getShallowPropertySafely = function (obj, currentPath) {\n return getShallowProperty(obj, currentPath)\n }\n }\n\n function set (obj, path, value, doNotReplace) {\n if (typeof path === 'number') {\n path = [path]\n }\n if (!path || path.length === 0) {\n return obj\n }\n if (typeof path === 'string') {\n return set(obj, path.split('.').map(getKey), value, doNotReplace)\n }\n var currentPath = path[0]\n var currentValue = getShallowPropertySafely(obj, currentPath)\n if (path.length === 1) {\n if (currentValue === void 0 || !doNotReplace) {\n obj[currentPath] = value\n }\n return currentValue\n }\n\n if (currentValue === void 0) {\n //check if we assume an array\n if (typeof path[1] === 'number') {\n obj[currentPath] = []\n } else {\n obj[currentPath] = {}\n }\n }\n\n return set(obj[currentPath], path.slice(1), value, doNotReplace)\n }\n\n objectPath.has = function (obj, path) {\n if (typeof path === 'number') {\n path = [path]\n } else if (typeof path === 'string') {\n path = path.split('.')\n }\n\n if (!path || path.length === 0) {\n return !!obj\n }\n\n for (var i = 0; i < path.length; i++) {\n var j = getKey(path[i])\n\n if ((typeof j === 'number' && isArray(obj) && j < obj.length) ||\n (options.includeInheritedProps ? (j in Object(obj)) : hasOwnProperty(obj, j))) {\n obj = obj[j]\n } else {\n return false\n }\n }\n\n return true\n }\n\n objectPath.ensureExists = function (obj, path, value) {\n return set(obj, path, value, true)\n }\n\n objectPath.set = function (obj, path, value, doNotReplace) {\n return set(obj, path, value, doNotReplace)\n }\n\n objectPath.insert = function (obj, path, value, at) {\n var arr = objectPath.get(obj, path)\n at = ~~at\n if (!isArray(arr)) {\n arr = []\n objectPath.set(obj, path, arr)\n }\n arr.splice(at, 0, value)\n }\n\n objectPath.empty = function (obj, path) {\n if (isEmpty(path)) {\n return void 0\n }\n if (obj == null) {\n return void 0\n }\n\n var value, i\n if (!(value = objectPath.get(obj, path))) {\n return void 0\n }\n\n if (typeof value === 'string') {\n return objectPath.set(obj, path, '')\n } else if (isBoolean(value)) {\n return objectPath.set(obj, path, false)\n } else if (typeof value === 'number') {\n return objectPath.set(obj, path, 0)\n } else if (isArray(value)) {\n value.length = 0\n } else if (isObject(value)) {\n for (i in value) {\n if (hasShallowProperty(value, i)) {\n delete value[i]\n }\n }\n } else {\n return objectPath.set(obj, path, null)\n }\n }\n\n objectPath.push = function (obj, path /*, values */) {\n var arr = objectPath.get(obj, path)\n if (!isArray(arr)) {\n arr = []\n objectPath.set(obj, path, arr)\n }\n\n arr.push.apply(arr, Array.prototype.slice.call(arguments, 2))\n }\n\n objectPath.coalesce = function (obj, paths, defaultValue) {\n var value\n\n for (var i = 0, len = paths.length; i < len; i++) {\n if ((value = objectPath.get(obj, paths[i])) !== void 0) {\n return value\n }\n }\n\n return defaultValue\n }\n\n objectPath.get = function (obj, path, defaultValue) {\n if (typeof path === 'number') {\n path = [path]\n }\n if (!path || path.length === 0) {\n return obj\n }\n if (obj == null) {\n return defaultValue\n }\n if (typeof path === 'string') {\n return objectPath.get(obj, path.split('.'), defaultValue)\n }\n\n var currentPath = getKey(path[0])\n var nextObj = getShallowPropertySafely(obj, currentPath)\n if (nextObj === void 0) {\n return defaultValue\n }\n\n if (path.length === 1) {\n return nextObj\n }\n\n return objectPath.get(obj[currentPath], path.slice(1), defaultValue)\n }\n\n objectPath.del = function del (obj, path) {\n if (typeof path === 'number') {\n path = [path]\n }\n\n if (obj == null) {\n return obj\n }\n\n if (isEmpty(path)) {\n return obj\n }\n if (typeof path === 'string') {\n return objectPath.del(obj, path.split('.'))\n }\n\n var currentPath = getKey(path[0])\n getShallowPropertySafely(obj, currentPath)\n if (!hasShallowProperty(obj, currentPath)) {\n return obj\n }\n\n if (path.length === 1) {\n if (isArray(obj)) {\n obj.splice(currentPath, 1)\n } else {\n delete obj[currentPath]\n }\n } else {\n return objectPath.del(obj[currentPath], path.slice(1))\n }\n\n return obj\n }\n\n return objectPath\n }\n\n var mod = factory()\n mod.create = factory\n mod.withInheritedProps = factory({includeInheritedProps: true})\n return mod\n})\n","/* eslint-disable max-len */\r\nimport objectPath from 'object-path';\r\n\r\n/**\r\n * Validates a set of rules against a JSON document.\r\n * Now supports arrays referenced in both 'ref' and 'comparisonRef',\r\n * generating contexts for all possible combinations (cartesian product)\r\n * when necessary.\r\n *\r\n * Example with arrays in both fields:\r\n * ref: 'clients[].age', comparisonRef: 'references[].minAge'\r\n * => All combinations of clients and references will be evaluated.\r\n *\r\n * Example with only one array field:\r\n * ref: 'clients[].age', comparisonRef: 'minAge'\r\n * => Each client will be evaluated against the fixed minAge value.\r\n *\r\n * @param {object} documentJson The JSON document to validate.\r\n * @param {Array<object>} rules The array of rules to validate.\r\n * @param {object|null} contextObj Optional context object. If provided, rules can reference it using '_context.' in their paths.\r\n * @param {object} options Optional settings: { contextLimit: number (default 10000), timeLimit: number (seconds, default 200), returnAllContexts: boolean (default true) }\r\n * @return {Array<object>} An array of objects containing the IDs and types of the rules that passed, along with their contexts.\r\n */\r\nexport function validateRules(documentJson, rules, contextObj = null, options = {}) {\r\n const rulesObj = JSON.parse(JSON.stringify(rules));\r\n const contextLimit = options.contextLimit !== undefined ? options.contextLimit : 10000;\r\n const timeLimit = options.timeLimit !== undefined ? options.timeLimit : 200; // seconds\r\n const returnAllContexts = options.returnAllContexts !== undefined ? options.returnAllContexts : true;\r\n const results = [];\r\n const validRulesByDate = filterRulesByDate(rulesObj);\r\n const startTime = Date.now();\r\n\r\n validRulesByDate.forEach((rule) => {\r\n try {\r\n const loops = [];\r\n rule.conditionResultContext = [];\r\n\r\n processConditionsForLoops(rule, loops);\r\n\r\n const sortedLoops = sortLoopsByPath(loops);\r\n if (!validateArrayReferences(sortedLoops, rule)) return;\r\n\r\n // CONTADOR DE CONTEXTOS E FLAGS DE LIMITE\r\n const contextCounter = { count: 0, limitReached: false, timeReached: false };\r\n rule.contexts = explodeContexts(documentJson, rule.conditions, loops, [], contextLimit, startTime, timeLimit, contextCounter);\r\n rule.contextLimitReached = contextCounter.limitReached;\r\n rule.timeLimitReached = contextCounter.timeReached;\r\n\r\n if (rule.contexts.length === 0) {\r\n rule.conditionsResult = evaluateSimpleConditions(documentJson, rule.conditions, contextObj);\r\n } else {\r\n rule.conditionResultContext = evaluateConditionsInContexts(documentJson, rule, loops, contextObj, returnAllContexts);\r\n }\r\n\r\n addRuleToResults(rule, results);\r\n // Adiciona aviso se limite atingido\r\n if (rule.contextLimitReached || rule.timeLimitReached) {\r\n results.push({\r\n id: rule.id,\r\n type: rule.type,\r\n message: rule.description,\r\n keyword: 'context_limit',\r\n errors: [\r\n rule.contextLimitReached ? { cause: 'Context limit reached', context: `The number of contexts exceeded the limit (${contextLimit}).` } : null,\r\n rule.timeLimitReached ? { cause: 'Time limit reached', context: `The time limit of ${timeLimit} seconds was exceeded during context generation.` } : null,\r\n ].filter(Boolean),\r\n });\r\n }\r\n } catch (error) {\r\n logError(`Error processing rule [${rule.id}]`, error);\r\n results.push({\r\n id: rule.id,\r\n type: rule.type,\r\n message: rule.description,\r\n conditions: rule.conditionsResult?.items || [],\r\n keyword: 'conditional',\r\n errors: [\r\n {\r\n cause: error.message,\r\n context: `Error occurred while processing rule [${rule.id}]`,\r\n },\r\n ],\r\n });\r\n }\r\n });\r\n\r\n return results;\r\n}\r\n\r\n/**\r\n * Filters rules based on their validity dates.\r\n * @param {Array<object>} rules The array of rules.\r\n * @return {Array<object>} The filtered rules.\r\n */\r\nfunction filterRulesByDate(rules) {\r\n return rules.filter((rule) => {\r\n const isAfterStartDate = rule.initialDate ? new Date(rule.initialDate) <= new Date() : true;\r\n const isBeforeEndDate = rule.endDate ? new Date(rule.endDate) >= new Date() : true;\r\n return isAfterStartDate && isBeforeEndDate;\r\n });\r\n}\r\n\r\n/**\r\n * Identifies and expands loops (arrays) in a rule's conditions.\r\n * Now analyzes both the 'ref' and 'comparisonRef' fields,\r\n * ensuring all referenced arrays are considered in context generation.\r\n *\r\n * Example: If 'ref' references 'clients[]' and 'comparisonRef' references 'references[]',\r\n * both will be considered and the cartesian product of indices will be generated.\r\n *\r\n * @param {object} rule The rule being processed.\r\n * @param {Array<object>} loops The array where identified loops will be stored.\r\n */\r\nfunction processConditionsForLoops(rule, loops) {\r\n rule.conditions.forEach((condition, conditionIndex) => {\r\n // Lista de campos a analisar: ref e comparisonRef\r\n ['ref', 'comparisonRef'].forEach((field) => {\r\n if (condition[field]) {\r\n let refValue = condition[field];\r\n while (refValue.includes('[]')) {\r\n const {objectName, completeObjectPath} = extractLoopDetails(refValue);\r\n // Evita duplicidade de loops\r\n if (!loops.some(loop => loop.completeObjectPath === completeObjectPath)) {\r\n loops.push({objectName, completeObjectPath, parm: `@${loops.length}`});\r\n }\r\n // Atualiza todos os campos ref e comparisonRef das condições\r\n rule.conditions.forEach((innerCondition) => {\r\n ['ref', 'comparisonRef'].forEach((innerField) => {\r\n if (innerCondition[innerField] && innerCondition[innerField].includes(`${objectName}[]`)) {\r\n innerCondition[innerField] = innerCondition[innerField].replaceAll(\r\n `${objectName}[]`,\r\n `${objectName}[@${loops.length - 1}]`,\r\n );\r\n }\r\n });\r\n });\r\n // Atualiza o valor para continuar o while, se houver mais de um []\r\n refValue = refValue.replace(`${objectName}[]`, `${objectName}[@${loops.length - 1}]`);\r\n }\r\n }\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Extracts details of a loop from a condition value.\r\n * @param {string} value The condition value.\r\n * @return {object} The extracted loop details.\r\n */\r\nfunction extractLoopDetails(value) {\r\n const completeObjectPath = value.split('[]')[0];\r\n const lastDotIndex = completeObjectPath.lastIndexOf('.');\r\n const objectName = completeObjectPath.slice(lastDotIndex + 1);\r\n return {objectName, completeObjectPath};\r\n}\r\n\r\n/**\r\n * Sorts loops by their complete object paths.\r\n * @param {Array<object>} loops The array of loops.\r\n * @return {Array<object>} The sorted loops.\r\n */\r\nfunction sortLoopsByPath(loops) {\r\n return loops.sort((a, b) => a.completeObjectPath.localeCompare(b.completeObjectPath));\r\n}\r\n\r\n/**\r\n * Validates array references in loops.\r\n * Now allows any combination of arrays (cartesian product),\r\n * only issuing a warning if there are arrays with the same name but different paths.\r\n * Never blocks the rule.\r\n *\r\n * @param {Array<object>} sortedLoops The sorted loops.\r\n * @param {object} rule The rule being validated.\r\n * @return {boolean} Always returns true.\r\n */\r\nfunction validateArrayReferences(sortedLoops, rule) {\r\n // Permitir qualquer combinação de arrays (produto cartesiano)\r\n // Apenas emitir aviso se houver caminhos de array com o mesmo nome mas caminhos diferentes\r\n const paths = sortedLoops.map(l => l.completeObjectPath);\r\n const names = sortedLoops.map(l => l.objectName);\r\n const duplicates = names.filter((name, idx) => names.indexOf(name) !== idx);\r\n if (duplicates.length > 0) {\r\n console.warn(\r\n `Warning: Rule [${rule.id}] references multiple arrays with the same name (${duplicates.join(', ')}), but different paths: ${paths.join(', ')}`\r\n );\r\n }\r\n return true;\r\n}\r\n\r\n/**\r\n * Generates all possible contexts of a JSON document based on conditions and loops.\r\n * Now always returns an array of contexts, even when there are no loops (returns [ [] ]).\r\n * This ensures rules with only one array field or different arrays are evaluated correctly.\r\n *\r\n * Example:\r\n * loops: [clients[], references[]] => contexts: [ [0,0], [0,1], [1,0], [1,1] ]\r\n *\r\n * @param {object} documentJson The JSON document to explode.\r\n * @param {Array<object>} conditions The conditions to apply.\r\n * @param {Array<object>} existingLoops The identified loops.\r\n * @param {Array<number>} currentTuple The current tuple of indices (for recursion).\r\n * @param {number} contextLimit The maximum number of contexts allowed.\r\n * @param {number} startTime The start time of the operation.\r\n * @param {number} timeLimit The maximum time allowed for the operation.\r\n * @param {object} contextCounter An object to track context count and limits.\r\n * @return {Array<Array<number>>} Array of contexts (each context is an array of indices).\r\n */\r\nfunction explodeContexts(documentJson, conditions, existingLoops, currentTuple, contextLimit = 10000, startTime = Date.now(), timeLimit = 200, contextCounter = { count: 0, limitReached: false, timeReached: false }) {\r\n const loops = [...existingLoops];\r\n const totalTuples = [];\r\n if (loops.length === 0) {\r\n contextCounter.count++;\r\n if (contextCounter.count > contextLimit) {\r\n contextCounter.limitReached = true;\r\n return [];\r\n }\r\n if ((Date.now() - startTime) / 1000 > timeLimit) {\r\n contextCounter.timeReached = true;\r\n return [];\r\n }\r\n return [currentTuple];\r\n }\r\n const currentLoop = JSON.parse(JSON.stringify(loops.shift()));\r\n const loopItemsCount = objectPath.get(documentJson, currentLoop.completeObjectPath) ?? [];\r\n for (let i = 0; i < loopItemsCount.length; i++) {\r\n if (contextCounter.limitReached || contextCounter.timeReached) break;\r\n if (loops.length > 0) {\r\n const newLoops = loops.map((item) => {\r\n return {\r\n objectName: item.objectName,\r\n completeObjectPath: item.completeObjectPath.replace(\r\n `${currentLoop.completeObjectPath}[${currentLoop.parm}]`,\r\n `${currentLoop.completeObjectPath}.${i}`,\r\n ),\r\n };\r\n });\r\n explodeContexts(documentJson, conditions, [...newLoops], [...currentTuple, i], contextLimit, startTime, timeLimit, contextCounter).forEach((tuple) => {\r\n if (!contextCounter.limitReached && !contextCounter.timeReached) {\r\n totalTuples.push(tuple);\r\n }\r\n });\r\n } else {\r\n contextCounter.count++;\r\n if (contextCounter.count > contextLimit) {\r\n contextCounter.limitReached = true;\r\n break;\r\n }\r\n if ((Date.now() - startTime) / 1000 > timeLimit) {\r\n contextCounter.timeReached = true;\r\n break;\r\n }\r\n totalTuples.push([...currentTuple, i]);\r\n }\r\n }\r\n return totalTuples;\r\n}\r\n\r\n/**\r\n * Evaluates simple conditions without contexts.\r\n * @param {object} documentJson The JSON document.\r\n * @param {Array<object>} conditions The conditions to evaluate.\r\n * @param {object|null} contextObj Optional context object. If provided, rules can reference it using '_context.' in their ref or comparisonRef paths.\r\n * @return {object} The result of the evaluation.\r\n */\r\nfunction evaluateSimpleConditions(documentJson, conditions, contextObj = null) {\r\n return conditions.reduce(\r\n (result, condition) => {\r\n if (result.response) {\r\n try {\r\n // Suporte a comparisonRef\r\n if (condition.comparisonValue !== undefined && condition.comparisonRef !== undefined) {\r\n throw new Error('A condition cannot have both comparisonValue and comparisonRef.');\r\n }\r\n const leftValue = getValueWithContext(documentJson, condition.ref, contextObj);\r\n let rightValue;\r\n if (condition.comparisonRef !== undefined) {\r\n rightValue = getValueWithContext(documentJson, condition.comparisonRef, contextObj);\r\n } else {\r\n rightValue = condition.comparisonValue;\r\n }\r\n const test = testCondition(leftValue, rightValue, condition.operator);\r\n if (test) {\r\n result.items.push({\r\n instancePath: condition.ref,\r\n instancePathValue: leftValue,\r\n operator: condition.operator,\r\n comparisonValue: rightValue,\r\n });\r\n }\r\n return {response: test, items: result.items};\r\n } catch (error) {\r\n logError('Error in evaluateSimpleConditions', error);\r\n throw new Error(`Failed to evaluate conditions in one context.`);\r\n }\r\n }\r\n return {response: false, items: result.items};\r\n },\r\n {response: true, items: []},\r\n );\r\n}\r\n\r\n/**\r\n * Evaluates conditions in multiple contexts.\r\n * @param {object} documentJson The JSON document.\r\n * @param {object} rule The rule being evaluated.\r\n * @param {Array<object>} loops The loops to consider.\r\n * @param {object|null} contextObj Optional context object. If provided, rules can reference it using '_context.' in their ref or comparisonRef paths.\r\n * @param {boolean} returnAllContexts Whether to return all contexts or stop at the first valid one.\r\n * @return {Array<object>} The results of the evaluation for each context.\r\n */\r\nfunction evaluateConditionsInContexts(documentJson, rule, loops, contextObj = null, returnAllContexts = true) {\r\n const results = [];\r\n for (const context of rule.contexts) {\r\n const conditionsInContext = rule.conditions.map((condition) =>\r\n replaceContextValues(condition, loops, context),\r\n );\r\n\r\n const evaluation = conditionsInContext.reduce(\r\n (prevItem, condition) => {\r\n if (prevItem.result) {\r\n try {\r\n if (condition.comparisonValue !== undefined && condition.comparisonRef !== undefined) {\r\n throw new Error('A condition cannot have both comparisonValue and comparisonRef.');\r\n }\r\n const leftValue = getValueWithContext(documentJson, condition.ref, contextObj);\r\n let rightValue;\r\n if (condition.comparisonRef !== undefined) {\r\n rightValue = getValueWithContext(documentJson, condition.comparisonRef, contextObj);\r\n } else {\r\n rightValue = condition.comparisonValue;\r\n }\r\n const test = testCondition(leftValue, rightValue, condition.operator);\r\n if (test) {\r\n prevItem.conditionValues.push({\r\n instancePath: condition.ref,\r\n instancePathValue: leftValue,\r\n operator: condition.operator,\r\n comparisonValue: rightValue,\r\n });\r\n return {result: true, conditionValues: prevItem.conditionValues};\r\n }\r\n return {result: false, conditionValues: prevItem.conditionValues};\r\n } catch (error) {\r\n logError('Error in evaluateConditionsInContexts', error);\r\n throw new Error(`Failed to evaluate conditions in one context in rule [${rule.id}].`);\r\n }\r\n }\r\n return {result: false, conditionValues: prevItem.conditionValues};\r\n },\r\n {result: true, conditionValues: []},\r\n );\r\n\r\n if (evaluation.result) {\r\n results.push(evaluation);\r\n if (!returnAllContexts) {\r\n return results;\r\n }\r\n }\r\n }\r\n return results;\r\n}\r\n\r\n/**\r\n * Tests a condition against two values.\r\n * @param {any} leftValue The left-hand side value of the condition.\r\n * @param {any} rightValue The right-hand side value of the condition.\r\n * @param {string} operator The operator to use for the comparison.\r\n * @return {boolean} True if the condition is met, false otherwise.\r\n */\r\nfunction testCondition(leftValue, rightValue, operator) {\r\n try {\r\n if (operator === 'exists') return typeof leftValue !== 'undefined';\r\n if (operator === 'does_not_exists') return typeof leftValue === 'undefined';\r\n if (typeof leftValue === 'undefined') return false; // Avoids error when leftValue is undefined\r\n if (operator === 'is_empty') return leftValue.length === 0;\r\n if (operator === 'is_not_empty') return leftValue.length > 0;\r\n\r\n if (typeof leftValue === 'string') leftValue = leftValue.toLowerCase();\r\n if (typeof rightValue === 'string') rightValue = rightValue.toLowerCase();\r\n\r\n if (operator === '=') return leftValue === rightValue;\r\n if (operator === '<>') return leftValue !== rightValue;\r\n if (operator === '<') return leftValue < rightValue;\r\n if (operator === '<=') return leftValue <= rightValue;\r\n if (operator === '>') return leftValue > rightValue;\r\n if (operator === '>=') return leftValue >= rightValue;\r\n if (operator === 'contains') return leftValue.includes(rightValue);\r\n if (operator === 'does_not_contains') return !leftValue.includes(rightValue);\r\n if (operator === 'is_contained') return rightValue.includes(leftValue);\r\n if (operator === 'in') return rightValue.includes(leftValue);\r\n if (operator === 'not_in') return !rightValue.includes(leftValue);\r\n\r\n throw new Error(`Unsupported operator: ${operator}`);\r\n } catch (error) {\r\n logError(`Error in testCondition with operator [${operator}]`, error);\r\n throw new Error(`Failed to test condition with operator [${operator}].`);\r\n }\r\n}\r\n\r\n/**\r\n * Replaces context indices in both 'ref' and 'comparisonRef'.\r\n * This ensures that, for each context, the paths are correct for lookup in the JSON.\r\n *\r\n * Example:\r\n * ref: 'clients[@0].age', comparisonRef: 'references[@1].minAge', context: [1,0]\r\n * => ref: 'clients.1.age', comparisonRef: 'references.0.minAge'\r\n *\r\n * @param {object} condition The condition to be adjusted.\r\n * @param {Array<object>} loops The considered loops.\r\n * @param {Array<number>} context The context of indices.\r\n * @return {object} The condition with adjusted paths.\r\n */\r\nfunction replaceContextValues(condition, loops, context) {\r\n let adjustedRef = condition.ref;\r\n let adjustedComparisonRef = condition.comparisonRef;\r\n loops.forEach((loop, loopIndex) => {\r\n adjustedRef = adjustedRef?.replaceAll(`[@${loopIndex}]`, `.${context[loopIndex]}`);\r\n if (adjustedComparisonRef) {\r\n adjustedComparisonRef = adjustedComparisonRef.replaceAll(`[@${loopIndex}]`, `.${context[loopIndex]}`);\r\n }\r\n });\r\n return {\r\n ref: adjustedRef,\r\n operator: condition.operator,\r\n comparisonValue: condition.comparisonValue,\r\n comparisonRef: adjustedComparisonRef,\r\n };\r\n}\r\n\r\n/**\r\n * Adds a rule to the results if its conditions are met.\r\n * If an error occurs, it should be handled gracefully.\r\n * @param {object} rule The rule being processed.\r\n * @param {Array<object>} results The results array.\r\n */\r\nfunction addRuleToResults(rule, results) {\r\n try {\r\n if (rule.conditionResultContext && rule.conditionResultContext.length > 0) {\r\n results.push({\r\n id: rule.id,\r\n type: rule.type,\r\n message: rule.description,\r\n conditions: rule.conditionResultContext,\r\n keyword: 'conditional',\r\n });\r\n } else if (rule.conditionsResult && rule.conditionsResult.response && rule.conditionsResult.items && rule.conditionsResult.items.length > 0) {\r\n results.push({\r\n id: rule.id,\r\n type: rule.type,\r\n message: rule.description,\r\n conditions: {result: true, conditionValues: rule.conditionsResult.items},\r\n keyword: 'conditional',\r\n });\r\n }\r\n } catch (error) {\r\n logError(`Error adding rule [${rule.id}] to results`, error);\r\n results.push({\r\n id: rule.id,\r\n type: rule.type,\r\n message: rule.description,\r\n conditions: [],\r\n keyword: 'conditional',\r\n errors: [\r\n {\r\n cause: error.message,\r\n context: `Error occurred while adding rule [${rule.id}] to results`,\r\n },\r\n ],\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Logs an error with a detailed message.\r\n * @param {string} message The error message.\r\n * @param {Error} error The error object.\r\n */\r\nfunction logError(message, error) {\r\n console.error(`[ERROR] ${message}:`, {\r\n message: error.message,\r\n stack: error.stack,\r\n });\r\n}\r\n\r\n// Nova função utilitária para buscar valores considerando contextObj e _context prefix\r\nfunction getValueWithContext(documentJson, path, contextObj) {\r\n if (typeof path === 'string' && path.startsWith('_context.') && contextObj) {\r\n return objectPath.get(contextObj, path.replace('_context.', ''));\r\n }\r\n return objectPath.get(documentJson, path);\r\n}\r\n"],"names":["this"],"mappings":";;;;;;;;;;;AAAA,CAAA,CAAC,UAAU,IAAI,EAAE,OAAO,EAAE;;AAG1B;GACwE;AACxE,KAAI,iBAAiB,OAAO;;EAQ3B,EAAEA,cAAI,EAAE,YAAY;;AAGrB,GAAE,IAAI,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC;;AAE/B,GAAE,SAAS,cAAc,EAAE,GAAG,EAAE,IAAI,EAAE;AACtC,KAAI,IAAI,GAAG,IAA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