@qrvey/formula-lang 2.0.0-post-mvp → 2.0.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.
- package/CHANGELOG.md +210 -0
- package/README.md +32 -0
- package/dist/cjs/constants/index.d.ts +9 -2
- package/dist/cjs/constants/index.js +12 -1
- package/dist/cjs/constants/index.js.map +1 -1
- package/dist/cjs/constants/interfaces.d.ts +44 -14
- package/dist/cjs/errors/analyzer/index.js +1 -1
- package/dist/cjs/errors/analyzer/index.js.map +1 -1
- package/dist/cjs/errors/definitions.d.ts +27 -15
- package/dist/cjs/errors/definitions.js +47 -21
- package/dist/cjs/errors/definitions.js.map +1 -1
- package/dist/cjs/errors/dictionary.d.ts +6 -5
- package/dist/cjs/errors/dictionary.js +27 -22
- package/dist/cjs/errors/dictionary.js.map +1 -1
- package/dist/cjs/errors/index.d.ts +1 -0
- package/dist/cjs/errors/index.js +1 -0
- package/dist/cjs/errors/index.js.map +1 -1
- package/dist/cjs/errors/mismatch.d.ts +31 -0
- package/dist/cjs/errors/mismatch.js +77 -0
- package/dist/cjs/errors/mismatch.js.map +1 -0
- package/dist/cjs/functions/abs.js +1 -2
- package/dist/cjs/functions/abs.js.map +1 -1
- package/dist/cjs/functions/and.d.ts +5 -0
- package/dist/cjs/functions/and.js +55 -0
- package/dist/cjs/functions/and.js.map +1 -0
- package/dist/cjs/functions/concatenate.d.ts +5 -0
- package/dist/cjs/functions/concatenate.js +56 -0
- package/dist/cjs/functions/concatenate.js.map +1 -0
- package/dist/cjs/functions/dateadd.d.ts +5 -0
- package/dist/cjs/functions/dateadd.js +114 -0
- package/dist/cjs/functions/dateadd.js.map +1 -0
- package/dist/cjs/functions/datedif.js +9 -15
- package/dist/cjs/functions/datedif.js.map +1 -1
- package/dist/cjs/functions/datesubtract.d.ts +5 -0
- package/dist/cjs/functions/datesubtract.js +114 -0
- package/dist/cjs/functions/datesubtract.js.map +1 -0
- package/dist/cjs/functions/day.js +1 -2
- package/dist/cjs/functions/day.js.map +1 -1
- package/dist/cjs/functions/dayofweek.d.ts +5 -0
- package/dist/cjs/functions/dayofweek.js +90 -0
- package/dist/cjs/functions/dayofweek.js.map +1 -0
- package/dist/cjs/functions/even.d.ts +5 -0
- package/dist/cjs/functions/even.js +46 -0
- package/dist/cjs/functions/even.js.map +1 -0
- package/dist/cjs/functions/exp.d.ts +5 -0
- package/dist/cjs/functions/exp.js +42 -0
- package/dist/cjs/functions/exp.js.map +1 -0
- package/dist/cjs/functions/hour.js +1 -2
- package/dist/cjs/functions/hour.js.map +1 -1
- package/dist/cjs/functions/if.js +32 -13
- package/dist/cjs/functions/if.js.map +1 -1
- package/dist/cjs/functions/ifs.js +37 -15
- package/dist/cjs/functions/ifs.js.map +1 -1
- package/dist/cjs/functions/include.d.ts +5 -0
- package/dist/cjs/functions/include.js +48 -0
- package/dist/cjs/functions/include.js.map +1 -0
- package/dist/cjs/functions/index.js +54 -0
- package/dist/cjs/functions/index.js.map +1 -1
- package/dist/cjs/functions/isNull.js +53 -12
- package/dist/cjs/functions/isNull.js.map +1 -1
- package/dist/cjs/functions/left.d.ts +5 -0
- package/dist/cjs/functions/left.js +62 -0
- package/dist/cjs/functions/left.js.map +1 -0
- package/dist/cjs/functions/length.d.ts +5 -0
- package/dist/cjs/functions/length.js +45 -0
- package/dist/cjs/functions/length.js.map +1 -0
- package/dist/cjs/functions/log.d.ts +5 -0
- package/dist/cjs/functions/log.js +59 -0
- package/dist/cjs/functions/log.js.map +1 -0
- package/dist/cjs/functions/lower.d.ts +5 -0
- package/dist/cjs/functions/lower.js +42 -0
- package/dist/cjs/functions/lower.js.map +1 -0
- package/dist/cjs/functions/max.d.ts +5 -0
- package/dist/cjs/functions/max.js +60 -0
- package/dist/cjs/functions/max.js.map +1 -0
- package/dist/cjs/functions/mid.js +32 -13
- package/dist/cjs/functions/mid.js.map +1 -1
- package/dist/cjs/functions/min.d.ts +5 -0
- package/dist/cjs/functions/min.js +60 -0
- package/dist/cjs/functions/min.js.map +1 -0
- package/dist/cjs/functions/minute.js +1 -2
- package/dist/cjs/functions/minute.js.map +1 -1
- package/dist/cjs/functions/month.js +1 -2
- package/dist/cjs/functions/month.js.map +1 -1
- package/dist/cjs/functions/odd.d.ts +5 -0
- package/dist/cjs/functions/odd.js +46 -0
- package/dist/cjs/functions/odd.js.map +1 -0
- package/dist/cjs/functions/or.d.ts +5 -0
- package/dist/cjs/functions/or.js +55 -0
- package/dist/cjs/functions/or.js.map +1 -0
- package/dist/cjs/functions/power.d.ts +5 -0
- package/dist/cjs/functions/power.js +53 -0
- package/dist/cjs/functions/power.js.map +1 -0
- package/dist/cjs/functions/proper.d.ts +5 -0
- package/dist/cjs/functions/proper.js +39 -0
- package/dist/cjs/functions/proper.js.map +1 -0
- package/dist/cjs/functions/random.d.ts +5 -0
- package/dist/cjs/functions/random.js +34 -0
- package/dist/cjs/functions/random.js.map +1 -0
- package/dist/cjs/functions/replace.d.ts +5 -0
- package/dist/cjs/functions/replace.js +54 -0
- package/dist/cjs/functions/replace.js.map +1 -0
- package/dist/cjs/functions/right.d.ts +5 -0
- package/dist/cjs/functions/right.js +63 -0
- package/dist/cjs/functions/right.js.map +1 -0
- package/dist/cjs/functions/round.d.ts +5 -0
- package/dist/cjs/functions/round.js +59 -0
- package/dist/cjs/functions/round.js.map +1 -0
- package/dist/cjs/functions/rounddown.d.ts +5 -0
- package/dist/cjs/functions/rounddown.js +59 -0
- package/dist/cjs/functions/rounddown.js.map +1 -0
- package/dist/cjs/functions/roundup.d.ts +5 -0
- package/dist/cjs/functions/roundup.js +59 -0
- package/dist/cjs/functions/roundup.js.map +1 -0
- package/dist/cjs/functions/second.js +1 -2
- package/dist/cjs/functions/second.js.map +1 -1
- package/dist/cjs/functions/sqrt.d.ts +5 -0
- package/dist/cjs/functions/sqrt.js +46 -0
- package/dist/cjs/functions/sqrt.js.map +1 -0
- package/dist/cjs/functions/trim.d.ts +5 -0
- package/dist/cjs/functions/trim.js +42 -0
- package/dist/cjs/functions/trim.js.map +1 -0
- package/dist/cjs/functions/upper.d.ts +5 -0
- package/dist/cjs/functions/upper.js +42 -0
- package/dist/cjs/functions/upper.js.map +1 -0
- package/dist/cjs/functions/year.js +1 -2
- package/dist/cjs/functions/year.js.map +1 -1
- package/dist/cjs/grammar/generated/qformula.lang.d.ts +2 -9
- package/dist/cjs/grammar/generated/qformula.lang.js +58 -33
- package/dist/cjs/grammar/generated/qformula.lang.js.map +1 -1
- package/dist/cjs/grammar/generated/qformula.lang.terms.d.ts +20 -19
- package/dist/cjs/grammar/generated/qformula.lang.terms.js +2 -2
- package/dist/cjs/grammar/generated/qformula.lang.terms.js.map +1 -1
- package/dist/cjs/grammar/tokens.d.ts +2 -0
- package/dist/cjs/grammar/tokens.js +26 -0
- package/dist/cjs/grammar/tokens.js.map +1 -0
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/parser/formula-parser.d.ts +2 -1
- package/dist/cjs/parser/formula-parser.js +11 -12
- package/dist/cjs/parser/formula-parser.js.map +1 -1
- package/dist/cjs/parser/json-parser.js +73 -27
- package/dist/cjs/parser/json-parser.js.map +1 -1
- package/dist/cjs/transpiler/columnTranspilation.d.ts +1 -1
- package/dist/cjs/transpiler/columnTranspilation.js +22 -4
- package/dist/cjs/transpiler/columnTranspilation.js.map +1 -1
- package/dist/cjs/transpiler/index.js +104 -17
- package/dist/cjs/transpiler/index.js.map +1 -1
- package/dist/cjs/transpiler/validateFuncStructure.d.ts +1 -1
- package/dist/cjs/transpiler/validateFuncStructure.js +65 -17
- package/dist/cjs/transpiler/validateFuncStructure.js.map +1 -1
- package/dist/cjs/utils/addDecimalPointIfNeeded.d.ts +3 -0
- package/dist/cjs/utils/addDecimalPointIfNeeded.js +19 -0
- package/dist/cjs/utils/addDecimalPointIfNeeded.js.map +1 -0
- package/dist/cjs/utils/cleanInvalidItemsInContext.d.ts +3 -0
- package/dist/cjs/utils/cleanInvalidItemsInContext.js +28 -0
- package/dist/cjs/utils/cleanInvalidItemsInContext.js.map +1 -0
- package/dist/cjs/utils/elasticsearch/index.js +33 -0
- package/dist/cjs/utils/elasticsearch/index.js.map +1 -1
- package/dist/cjs/utils/elasticsearch/scripts.d.ts +16 -1
- package/dist/cjs/utils/elasticsearch/scripts.js +150 -12
- package/dist/cjs/utils/elasticsearch/scripts.js.map +1 -1
- package/dist/cjs/utils/escapeCharacters.d.ts +2 -0
- package/dist/cjs/utils/escapeCharacters.js +41 -0
- package/dist/cjs/utils/escapeCharacters.js.map +1 -0
- package/dist/cjs/utils/getNumericValueFromArgument.d.ts +3 -0
- package/dist/cjs/utils/getNumericValueFromArgument.js +32 -0
- package/dist/cjs/utils/getNumericValueFromArgument.js.map +1 -0
- package/dist/cjs/utils/getValidDataTypeParam.d.ts +3 -0
- package/dist/cjs/utils/getValidDataTypeParam.js +10 -0
- package/dist/cjs/utils/getValidDataTypeParam.js.map +1 -0
- package/dist/cjs/utils/getVariableType.js +2 -0
- package/dist/cjs/utils/getVariableType.js.map +1 -1
- package/dist/cjs/utils/greaterThanOrEqualToReference.d.ts +3 -0
- package/dist/cjs/utils/greaterThanOrEqualToReference.js +20 -0
- package/dist/cjs/utils/greaterThanOrEqualToReference.js.map +1 -0
- package/dist/cjs/utils/greaterThanReference.d.ts +3 -0
- package/dist/cjs/utils/greaterThanReference.js +19 -0
- package/dist/cjs/utils/greaterThanReference.js.map +1 -0
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/cjs/utils/index.js +2 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/isAColumn.d.ts +2 -3
- package/dist/cjs/utils/isAColumn.js +2 -6
- package/dist/cjs/utils/isAColumn.js.map +1 -1
- package/dist/cjs/utils/isALiteral.d.ts +2 -0
- package/dist/cjs/utils/isALiteral.js +9 -0
- package/dist/cjs/utils/isALiteral.js.map +1 -0
- package/dist/cjs/utils/isAValidPower.d.ts +3 -0
- package/dist/cjs/utils/isAValidPower.js +21 -0
- package/dist/cjs/utils/isAValidPower.js.map +1 -0
- package/dist/cjs/utils/isAnAllowedValue.d.ts +2 -0
- package/dist/cjs/utils/isAnAllowedValue.js +20 -0
- package/dist/cjs/utils/isAnAllowedValue.js.map +1 -0
- package/dist/cjs/utils/isBetweenInclusiveRange.d.ts +3 -0
- package/dist/cjs/utils/isBetweenInclusiveRange.js +21 -0
- package/dist/cjs/utils/isBetweenInclusiveRange.js.map +1 -0
- package/dist/cjs/utils/isBooleanExpression.d.ts +1 -1
- package/dist/cjs/utils/isBooleanExpression.js +9 -5
- package/dist/cjs/utils/isBooleanExpression.js.map +1 -1
- package/dist/cjs/utils/isDateParam.js +8 -2
- package/dist/cjs/utils/isDateParam.js.map +1 -1
- package/dist/cjs/utils/isInteger.d.ts +3 -0
- package/dist/cjs/utils/isInteger.js +25 -0
- package/dist/cjs/utils/isInteger.js.map +1 -0
- package/dist/cjs/utils/isLongLiteralNumber.js +2 -1
- package/dist/cjs/utils/isLongLiteralNumber.js.map +1 -1
- package/dist/cjs/utils/isNumberParam.js +8 -2
- package/dist/cjs/utils/isNumberParam.js.map +1 -1
- package/dist/cjs/utils/isSameAndValidRecursiveDataType.d.ts +3 -0
- package/dist/cjs/utils/isSameAndValidRecursiveDataType.js +32 -0
- package/dist/cjs/utils/isSameAndValidRecursiveDataType.js.map +1 -0
- package/dist/cjs/utils/isStringParam.js +8 -2
- package/dist/cjs/utils/isStringParam.js.map +1 -1
- package/dist/cjs/utils/primitiveFunctions.d.ts +4 -0
- package/dist/cjs/utils/primitiveFunctions.js +11 -1
- package/dist/cjs/utils/primitiveFunctions.js.map +1 -1
- package/dist/module/constants/index.d.ts +9 -2
- package/dist/module/constants/index.js +11 -0
- package/dist/module/constants/index.js.map +1 -1
- package/dist/module/constants/interfaces.d.ts +44 -14
- package/dist/module/errors/analyzer/index.js +1 -1
- package/dist/module/errors/analyzer/index.js.map +1 -1
- package/dist/module/errors/definitions.d.ts +27 -15
- package/dist/module/errors/definitions.js +41 -17
- package/dist/module/errors/definitions.js.map +1 -1
- package/dist/module/errors/dictionary.d.ts +6 -5
- package/dist/module/errors/dictionary.js +27 -22
- package/dist/module/errors/dictionary.js.map +1 -1
- package/dist/module/errors/index.d.ts +1 -0
- package/dist/module/errors/index.js +1 -0
- package/dist/module/errors/index.js.map +1 -1
- package/dist/module/errors/mismatch.d.ts +31 -0
- package/dist/module/errors/mismatch.js +72 -0
- package/dist/module/errors/mismatch.js.map +1 -0
- package/dist/module/functions/abs.js +1 -2
- package/dist/module/functions/abs.js.map +1 -1
- package/dist/module/functions/and.d.ts +5 -0
- package/dist/module/functions/and.js +52 -0
- package/dist/module/functions/and.js.map +1 -0
- package/dist/module/functions/concatenate.d.ts +5 -0
- package/dist/module/functions/concatenate.js +53 -0
- package/dist/module/functions/concatenate.js.map +1 -0
- package/dist/module/functions/dateadd.d.ts +5 -0
- package/dist/module/functions/dateadd.js +111 -0
- package/dist/module/functions/dateadd.js.map +1 -0
- package/dist/module/functions/datedif.js +9 -15
- package/dist/module/functions/datedif.js.map +1 -1
- package/dist/module/functions/datesubtract.d.ts +5 -0
- package/dist/module/functions/datesubtract.js +111 -0
- package/dist/module/functions/datesubtract.js.map +1 -0
- package/dist/module/functions/day.js +1 -2
- package/dist/module/functions/day.js.map +1 -1
- package/dist/module/functions/dayofweek.d.ts +5 -0
- package/dist/module/functions/dayofweek.js +87 -0
- package/dist/module/functions/dayofweek.js.map +1 -0
- package/dist/module/functions/even.d.ts +5 -0
- package/dist/module/functions/even.js +43 -0
- package/dist/module/functions/even.js.map +1 -0
- package/dist/module/functions/exp.d.ts +5 -0
- package/dist/module/functions/exp.js +39 -0
- package/dist/module/functions/exp.js.map +1 -0
- package/dist/module/functions/hour.js +1 -2
- package/dist/module/functions/hour.js.map +1 -1
- package/dist/module/functions/if.js +33 -14
- package/dist/module/functions/if.js.map +1 -1
- package/dist/module/functions/ifs.js +38 -16
- package/dist/module/functions/ifs.js.map +1 -1
- package/dist/module/functions/include.d.ts +5 -0
- package/dist/module/functions/include.js +45 -0
- package/dist/module/functions/include.js.map +1 -0
- package/dist/module/functions/index.js +54 -0
- package/dist/module/functions/index.js.map +1 -1
- package/dist/module/functions/isNull.js +55 -14
- package/dist/module/functions/isNull.js.map +1 -1
- package/dist/module/functions/left.d.ts +5 -0
- package/dist/module/functions/left.js +59 -0
- package/dist/module/functions/left.js.map +1 -0
- package/dist/module/functions/length.d.ts +5 -0
- package/dist/module/functions/length.js +42 -0
- package/dist/module/functions/length.js.map +1 -0
- package/dist/module/functions/log.d.ts +5 -0
- package/dist/module/functions/log.js +56 -0
- package/dist/module/functions/log.js.map +1 -0
- package/dist/module/functions/lower.d.ts +5 -0
- package/dist/module/functions/lower.js +39 -0
- package/dist/module/functions/lower.js.map +1 -0
- package/dist/module/functions/max.d.ts +5 -0
- package/dist/module/functions/max.js +57 -0
- package/dist/module/functions/max.js.map +1 -0
- package/dist/module/functions/mid.js +32 -13
- package/dist/module/functions/mid.js.map +1 -1
- package/dist/module/functions/min.d.ts +5 -0
- package/dist/module/functions/min.js +57 -0
- package/dist/module/functions/min.js.map +1 -0
- package/dist/module/functions/minute.js +1 -2
- package/dist/module/functions/minute.js.map +1 -1
- package/dist/module/functions/month.js +1 -2
- package/dist/module/functions/month.js.map +1 -1
- package/dist/module/functions/odd.d.ts +5 -0
- package/dist/module/functions/odd.js +43 -0
- package/dist/module/functions/odd.js.map +1 -0
- package/dist/module/functions/or.d.ts +5 -0
- package/dist/module/functions/or.js +52 -0
- package/dist/module/functions/or.js.map +1 -0
- package/dist/module/functions/power.d.ts +5 -0
- package/dist/module/functions/power.js +50 -0
- package/dist/module/functions/power.js.map +1 -0
- package/dist/module/functions/proper.d.ts +5 -0
- package/dist/module/functions/proper.js +36 -0
- package/dist/module/functions/proper.js.map +1 -0
- package/dist/module/functions/random.d.ts +5 -0
- package/dist/module/functions/random.js +31 -0
- package/dist/module/functions/random.js.map +1 -0
- package/dist/module/functions/replace.d.ts +5 -0
- package/dist/module/functions/replace.js +51 -0
- package/dist/module/functions/replace.js.map +1 -0
- package/dist/module/functions/right.d.ts +5 -0
- package/dist/module/functions/right.js +60 -0
- package/dist/module/functions/right.js.map +1 -0
- package/dist/module/functions/round.d.ts +5 -0
- package/dist/module/functions/round.js +56 -0
- package/dist/module/functions/round.js.map +1 -0
- package/dist/module/functions/rounddown.d.ts +5 -0
- package/dist/module/functions/rounddown.js +56 -0
- package/dist/module/functions/rounddown.js.map +1 -0
- package/dist/module/functions/roundup.d.ts +5 -0
- package/dist/module/functions/roundup.js +56 -0
- package/dist/module/functions/roundup.js.map +1 -0
- package/dist/module/functions/second.js +1 -2
- package/dist/module/functions/second.js.map +1 -1
- package/dist/module/functions/sqrt.d.ts +5 -0
- package/dist/module/functions/sqrt.js +43 -0
- package/dist/module/functions/sqrt.js.map +1 -0
- package/dist/module/functions/trim.d.ts +5 -0
- package/dist/module/functions/trim.js +39 -0
- package/dist/module/functions/trim.js.map +1 -0
- package/dist/module/functions/upper.d.ts +5 -0
- package/dist/module/functions/upper.js +39 -0
- package/dist/module/functions/upper.js.map +1 -0
- package/dist/module/functions/year.js +1 -2
- package/dist/module/functions/year.js.map +1 -1
- package/dist/module/grammar/generated/qformula.lang.d.ts +2 -9
- package/dist/module/grammar/generated/qformula.lang.js +58 -33
- package/dist/module/grammar/generated/qformula.lang.js.map +1 -1
- package/dist/module/grammar/generated/qformula.lang.terms.d.ts +20 -19
- package/dist/module/grammar/generated/qformula.lang.terms.js +1 -1
- package/dist/module/grammar/generated/qformula.lang.terms.js.map +1 -1
- package/dist/module/grammar/tokens.d.ts +2 -0
- package/dist/module/grammar/tokens.js +23 -0
- package/dist/module/grammar/tokens.js.map +1 -0
- package/dist/module/index.d.ts +3 -1
- package/dist/module/index.js +3 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/parser/formula-parser.d.ts +2 -1
- package/dist/module/parser/formula-parser.js +9 -11
- package/dist/module/parser/formula-parser.js.map +1 -1
- package/dist/module/parser/json-parser.js +75 -29
- package/dist/module/parser/json-parser.js.map +1 -1
- package/dist/module/transpiler/columnTranspilation.d.ts +1 -1
- package/dist/module/transpiler/columnTranspilation.js +22 -4
- package/dist/module/transpiler/columnTranspilation.js.map +1 -1
- package/dist/module/transpiler/index.js +104 -17
- package/dist/module/transpiler/index.js.map +1 -1
- package/dist/module/transpiler/validateFuncStructure.d.ts +1 -1
- package/dist/module/transpiler/validateFuncStructure.js +65 -17
- package/dist/module/transpiler/validateFuncStructure.js.map +1 -1
- package/dist/module/utils/addDecimalPointIfNeeded.d.ts +3 -0
- package/dist/module/utils/addDecimalPointIfNeeded.js +15 -0
- package/dist/module/utils/addDecimalPointIfNeeded.js.map +1 -0
- package/dist/module/utils/cleanInvalidItemsInContext.d.ts +3 -0
- package/dist/module/utils/cleanInvalidItemsInContext.js +24 -0
- package/dist/module/utils/cleanInvalidItemsInContext.js.map +1 -0
- package/dist/module/utils/elasticsearch/index.js +34 -1
- package/dist/module/utils/elasticsearch/index.js.map +1 -1
- package/dist/module/utils/elasticsearch/scripts.d.ts +16 -1
- package/dist/module/utils/elasticsearch/scripts.js +149 -11
- package/dist/module/utils/elasticsearch/scripts.js.map +1 -1
- package/dist/module/utils/escapeCharacters.d.ts +2 -0
- package/dist/module/utils/escapeCharacters.js +37 -0
- package/dist/module/utils/escapeCharacters.js.map +1 -0
- package/dist/module/utils/getNumericValueFromArgument.d.ts +3 -0
- package/dist/module/utils/getNumericValueFromArgument.js +27 -0
- package/dist/module/utils/getNumericValueFromArgument.js.map +1 -0
- package/dist/module/utils/getValidDataTypeParam.d.ts +3 -0
- package/dist/module/utils/getValidDataTypeParam.js +6 -0
- package/dist/module/utils/getValidDataTypeParam.js.map +1 -0
- package/dist/module/utils/getVariableType.js +2 -0
- package/dist/module/utils/getVariableType.js.map +1 -1
- package/dist/module/utils/greaterThanOrEqualToReference.d.ts +3 -0
- package/dist/module/utils/greaterThanOrEqualToReference.js +16 -0
- package/dist/module/utils/greaterThanOrEqualToReference.js.map +1 -0
- package/dist/module/utils/greaterThanReference.d.ts +3 -0
- package/dist/module/utils/greaterThanReference.js +15 -0
- package/dist/module/utils/greaterThanReference.js.map +1 -0
- package/dist/module/utils/index.d.ts +1 -0
- package/dist/module/utils/index.js +2 -1
- package/dist/module/utils/index.js.map +1 -1
- package/dist/module/utils/isAColumn.d.ts +2 -3
- package/dist/module/utils/isAColumn.js +2 -6
- package/dist/module/utils/isAColumn.js.map +1 -1
- package/dist/module/utils/isALiteral.d.ts +2 -0
- package/dist/module/utils/isALiteral.js +5 -0
- package/dist/module/utils/isALiteral.js.map +1 -0
- package/dist/module/utils/isAValidPower.d.ts +3 -0
- package/dist/module/utils/isAValidPower.js +17 -0
- package/dist/module/utils/isAValidPower.js.map +1 -0
- package/dist/module/utils/isAnAllowedValue.d.ts +2 -0
- package/dist/module/utils/isAnAllowedValue.js +16 -0
- package/dist/module/utils/isAnAllowedValue.js.map +1 -0
- package/dist/module/utils/isBetweenInclusiveRange.d.ts +3 -0
- package/dist/module/utils/isBetweenInclusiveRange.js +17 -0
- package/dist/module/utils/isBetweenInclusiveRange.js.map +1 -0
- package/dist/module/utils/isBooleanExpression.d.ts +1 -1
- package/dist/module/utils/isBooleanExpression.js +9 -5
- package/dist/module/utils/isBooleanExpression.js.map +1 -1
- package/dist/module/utils/isDateParam.js +8 -2
- package/dist/module/utils/isDateParam.js.map +1 -1
- package/dist/module/utils/isInteger.d.ts +3 -0
- package/dist/module/utils/isInteger.js +21 -0
- package/dist/module/utils/isInteger.js.map +1 -0
- package/dist/module/utils/isLongLiteralNumber.js +2 -1
- package/dist/module/utils/isLongLiteralNumber.js.map +1 -1
- package/dist/module/utils/isNumberParam.js +8 -2
- package/dist/module/utils/isNumberParam.js.map +1 -1
- package/dist/module/utils/isSameAndValidRecursiveDataType.d.ts +3 -0
- package/dist/module/utils/isSameAndValidRecursiveDataType.js +28 -0
- package/dist/module/utils/isSameAndValidRecursiveDataType.js.map +1 -0
- package/dist/module/utils/isStringParam.js +8 -2
- package/dist/module/utils/isStringParam.js.map +1 -1
- package/dist/module/utils/primitiveFunctions.d.ts +4 -0
- package/dist/module/utils/primitiveFunctions.js +8 -0
- package/dist/module/utils/primitiveFunctions.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/utils/isNotAColumn.d.ts +0 -3
- package/dist/cjs/utils/isNotAColumn.js +0 -13
- package/dist/cjs/utils/isNotAColumn.js.map +0 -1
- package/dist/module/utils/isNotAColumn.d.ts +0 -3
- package/dist/module/utils/isNotAColumn.js +0 -9
- package/dist/module/utils/isNotAColumn.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,213 @@
|
|
|
1
|
+
<a name="2.0.0"></a>
|
|
2
|
+
# [2.0.0](https://bitbucket.org/qrvey/qrvey_formula_lang/compare/v1.1.0...v2.0.0) (2023-09-26)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* **concatenate:** concatenate primitive is string ([c0021a4](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/c0021a4))
|
|
8
|
+
* **concatenate:** concatenate primitive is string ([a112345](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/a112345))
|
|
9
|
+
* **datediff:** datediff for DataView have to be cast as INT ([c6cd081](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/c6cd081))
|
|
10
|
+
* **datefunctions:** add floor round to intervals in date add and subtract functions RB-1399 ([a317b2f](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/a317b2f))
|
|
11
|
+
* **datefunctions:** fix data type in floor RB-1399 ([1da0e8a](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/1da0e8a))
|
|
12
|
+
* **datesubtract:** fix DATESUBTRACT function with decimal numbers ([08fb4b2](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/08fb4b2))
|
|
13
|
+
* **errors:** fix expected result from mismatch error RB-1501 ([580c2c8](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/580c2c8))
|
|
14
|
+
* **errors:** fix expected result from mismatch error RB-1501 ([a299d6b](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/a299d6b))
|
|
15
|
+
* **escape:** fix escape character when is a number ([75e2523](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/75e2523))
|
|
16
|
+
* **function:** change transpilation logic of even and odd function ([620eb9d](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/620eb9d))
|
|
17
|
+
* **functions:** fix functions to only receive integer in numeric argments RB-1515 ([0fd936c](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/0fd936c))
|
|
18
|
+
* **functions:** fix roundown (negative numbers) in functions right and mid RB-1515 ([e22c587](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/e22c587))
|
|
19
|
+
* **functions:** fix transpilations of DATEADD and DATESUBTRACT for postgresql and snowflake RB-1398 ([c52166c](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/c52166c))
|
|
20
|
+
* **functions:** minor refactor ([dac4e02](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/dac4e02))
|
|
21
|
+
* **integer:** add integer as validator ([a3aaa5a](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/a3aaa5a))
|
|
22
|
+
* **isinteger:** isInteger only apply if is literal ([00627e9](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/00627e9))
|
|
23
|
+
* **logfunction:** do not allow 0 values in the first parameter (log function) RB-1349 ([164ab9f](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/164ab9f))
|
|
24
|
+
* **long number:** long number for elasticSearch when are Float, doesn't need to change ([82b4bf3](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/82b4bf3))
|
|
25
|
+
* **maxfunction:** fix max and min function when there two invalid parameters RB-1299 ([0c0d039](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/0c0d039))
|
|
26
|
+
* **maxfunction:** fix max and min function when there two invalid parameters RB-1299 ([b2429eb](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/b2429eb))
|
|
27
|
+
* **mid:** fix mid function to receive only integer parameters (second and third one) RB-1515 ([183a851](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/183a851))
|
|
28
|
+
* **min/max:** fix max/min function for bar charts and improve performance RB-1299 ([b8eb4c0](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/b8eb4c0))
|
|
29
|
+
* **mismatchdetail:** mismatchDetail extend ValidatorExpectedInfo ([f582b24](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/f582b24))
|
|
30
|
+
* **numbers:** convert to decimals integer numbers RB-1486 ([c78bc43](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/c78bc43))
|
|
31
|
+
* **numbervalidators:** fix number validators RB-1486 ([a3a6d40](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/a3a6d40))
|
|
32
|
+
* **round:** add is integer number to ROUND functions RB-1478 ([89660d7](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/89660d7))
|
|
33
|
+
* **roundfunction:** fix round for negative numbers in ES RB-1349 ([27a46a7](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/27a46a7))
|
|
34
|
+
* **roundfunctions:** fix transpilation for round, rounddown y roundup function tocomplain round rule ([d4c9852](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/d4c9852))
|
|
35
|
+
* **roundfunctions:** fix transpilation for round, rounddown y roundup function tocomplain round rule RB-1349 ([ae20b4a](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/ae20b4a))
|
|
36
|
+
* **tests:** fix all tests numbers changes RB-1486 ([c2bd167](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/c2bd167))
|
|
37
|
+
* **usesample:** if externalFormula and NOT sampleData ([6cedcc8](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/6cedcc8))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Code Refactoring
|
|
41
|
+
|
|
42
|
+
* **rangeerrors:** refactor bad naming in numeric range validation ([4cfae47](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/4cfae47))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Features
|
|
46
|
+
|
|
47
|
+
* **datesubtract:** add datesubtract function RB-1360 ([834cebf](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/834cebf))
|
|
48
|
+
* **evenfunction:** fix EVEN function for null case RB-1349 ([cef3aa4](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/cef3aa4))
|
|
49
|
+
* **expfunction:** add EXP function RB-1299 ([b7232d8](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/b7232d8))
|
|
50
|
+
* **expfunction:** add INCLUDE function RB-1299 ([7cb2545](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/7cb2545))
|
|
51
|
+
* **expfunction:** add REPLACE function RB-1299 ([707a580](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/707a580))
|
|
52
|
+
* **functions:** add even function RB-1417 ([e566fd3](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/e566fd3))
|
|
53
|
+
* **improvement:** add log error test and delete unnecessary file ([b6fc0db](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/b6fc0db))
|
|
54
|
+
* **leastfunction:** add MIN function RB-1299 ([fc2581e](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/fc2581e))
|
|
55
|
+
* **lengthfunction:** add length function RB-1299 ([63e0fd7](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/63e0fd7))
|
|
56
|
+
* **logfunction:** add log function RB-1418 ([8e46ce1](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/8e46ce1))
|
|
57
|
+
* **max function:** add better test of erros for max function and minor refactors RB-1299 ([092174d](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/092174d))
|
|
58
|
+
* **maxfunction:** add integration tests RB-1299 ([b0fd4f5](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/b0fd4f5))
|
|
59
|
+
* **maxfunction:** add max function ([28da9e7](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/28da9e7))
|
|
60
|
+
* **maxfunction:** add null checks in elasticsearch script ([7cdaad7](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/7cdaad7))
|
|
61
|
+
* **maxfunction:** add support for date in max function ([6cda42d](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/6cda42d))
|
|
62
|
+
* **maxfunction:** add validations for max function RB-1299 ([cedb769](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/cedb769))
|
|
63
|
+
* **maxfunction:** return array in expected primitive values RB-1299 ([62d2f6e](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/62d2f6e))
|
|
64
|
+
* **oddfunction:** add odd function RB-1419 ([3960fa4](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/3960fa4))
|
|
65
|
+
* **powerfunction:** add power Function RB-1420 RB-1349 ([4a43f0e](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/4a43f0e))
|
|
66
|
+
* **powerfunction:** add power Function RB-1420 RB-1349 ([b64d92d](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/b64d92d))
|
|
67
|
+
* **primitiveFunctions.ts:** export getPrimitiveAsValue ([59bb1ea](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/59bb1ea))
|
|
68
|
+
* **randomfunction:** add random function RB-1421 RB-1349 ([68d3f5e](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/68d3f5e))
|
|
69
|
+
* **rounddownfunction:** add rounddown function RB-1423 RB-1349 ([88fa4fc](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/88fa4fc))
|
|
70
|
+
* **roundfunction:** add round function RB-1422 RB-1349 ([ecfd32a](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/ecfd32a))
|
|
71
|
+
* **roundupfunction:** add roundup function RB-1424 RB-1349 ([4c4d695](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/4c4d695))
|
|
72
|
+
* **sqrtfunction:** add sqrt function RB-1299 ([d51e35a](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/d51e35a))
|
|
73
|
+
* **sqrtfunction:** add sqrt function RB-1299 ([2596515](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/2596515))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Reverts
|
|
77
|
+
|
|
78
|
+
* **round:** take only the integer in case of decimales 2nd argument in round functions RB-1478 ([63d0614](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/63d0614))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### BREAKING CHANGES
|
|
82
|
+
|
|
83
|
+
* **rangeerrors:** For functions like dateadd, datesubtract, left, log, mid, right and sqrt when there
|
|
84
|
+
are numbers negatives now will return MATCH_RANGE inside number validation error instead of GREATER_THAN. Additionally, in the info object it will return greaterThanOrEqualTo instead of greaterThan.
|
|
85
|
+
* **maxfunction:** MismatchDetail.primitive and ValidatorExpectedInfo.primitive interfaces now are
|
|
86
|
+
returning array
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<a name="1.1.0"></a>
|
|
91
|
+
# [1.1.0](https://bitbucket.org/qrvey/qrvey_formula_lang/compare/v1.0.1...v1.1.0) (2023-07-24)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
### Features
|
|
95
|
+
|
|
96
|
+
* **circular:** catch Circular Dependency in a Formula ([4f8846d](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/4f8846d))
|
|
97
|
+
* **clean cntx:** clean model context ([8827cd2](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/8827cd2))
|
|
98
|
+
* **json-parser.ts:** nested formulas on variables ([8107d2e](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/8107d2e))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
<a name="1.0.1"></a>
|
|
103
|
+
## [1.0.1](https://bitbucket.org/qrvey/qrvey_formula_lang/compare/v1.0.0...v1.0.1) (2023-07-11)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
### Bug Fixes
|
|
107
|
+
|
|
108
|
+
* **dateadd:** fix bug with dateadd function ([640981b](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/640981b))
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<a name="1.0.0"></a>
|
|
113
|
+
# [1.0.0](https://bitbucket.org/qrvey/qrvey_formula_lang/compare/v0.11.5...v1.0.0) (2023-07-10)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### Bug Fixes
|
|
117
|
+
|
|
118
|
+
* **dayofweek:** day of week with D (numeric) return string in Postgres ([ce97f3d](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/ce97f3d))
|
|
119
|
+
* **logicalfunctions:** minor change, update comment ([1113d17](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/1113d17))
|
|
120
|
+
* **properfunction:** add escaper characters in literals ([8f82079](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/8f82079))
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
### Code Refactoring
|
|
124
|
+
|
|
125
|
+
* **datedifffunction:** refactor unit validation ([7b2ad5c](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/7b2ad5c))
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
### Features
|
|
129
|
+
|
|
130
|
+
* **concantenatefunction:** add concatenate function ([194c976](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/194c976))
|
|
131
|
+
* **concantenatefunction:** add concatenate function ([007ad6d](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/007ad6d))
|
|
132
|
+
* **dateaddfunction:** add dateadd function RB-1241 ([267058d](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/267058d))
|
|
133
|
+
* **dateaddfunction:** add dateadd function RB-1241 ([07845f2](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/07845f2))
|
|
134
|
+
* **dateaddfunction:** add dateadd function RB-1241 ([7e63f72](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/7e63f72))
|
|
135
|
+
* **dayofweek:** add day of week function RB-1241 ([1284b16](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/1284b16))
|
|
136
|
+
* **escapedfunction:** improve esacape function RB-1241 ([3781e95](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/3781e95))
|
|
137
|
+
* **functions:** add upper and lower case functions RB-1241 ([b939582](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/b939582))
|
|
138
|
+
* **leftfunction:** add left function RB-1241 ([7282421](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/7282421))
|
|
139
|
+
* **logicalfunction:** add AND function RB-1241 ([8ff2d07](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/8ff2d07))
|
|
140
|
+
* **logicalfunctions:** add or function RB-1247 ([0e2894b](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/0e2894b))
|
|
141
|
+
* **properfunction:** add pg scaped RB-1241 ([1375ffa](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/1375ffa))
|
|
142
|
+
* **properfunction:** add proper function RB-1241 ([1fc83a4](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/1fc83a4))
|
|
143
|
+
* **properfunction:** fix ? character in snowflake RB-1241 ([364f6c4](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/364f6c4))
|
|
144
|
+
* **properfunction:** fix characterlist snowfalek RB-1241 ([3ef0f3e](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/3ef0f3e))
|
|
145
|
+
* **rightfunction:** add right function RB-1241 ([9a69425](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/9a69425))
|
|
146
|
+
* **strings:** Scape literal string characters ([5ce0c0e](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/5ce0c0e))
|
|
147
|
+
* **strings:** Scape literal string characters ([4de920e](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/4de920e))
|
|
148
|
+
* **strings:** Scape literal string characters ([52e13bb](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/52e13bb))
|
|
149
|
+
* **strings:** Scape literal string characters ([b56a665](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/b56a665))
|
|
150
|
+
* **trim:** add trim function RB-1241 ([9b1e675](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/9b1e675))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
### BREAKING CHANGES
|
|
154
|
+
|
|
155
|
+
* **datedifffunction:** DATE_DIF_UNIT_PARAM now is INVALID_ALLOW_VALUE
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
<a name="0.11.5"></a>
|
|
160
|
+
## [0.11.5](https://bitbucket.org/qrvey/qrvey_formula_lang/compare/v0.11.4...v0.11.5) (2023-06-20)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
### Bug Fixes
|
|
164
|
+
|
|
165
|
+
* **midfunction:** fix mid function for ES when length is negative RB-1278 ([ceae6fc](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/ceae6fc))
|
|
166
|
+
* **midfunction:** improve mid function with AC RB-1278 ([8886b29](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/8886b29))
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
<a name="0.11.4"></a>
|
|
171
|
+
## [0.11.4](https://bitbucket.org/qrvey/qrvey_formula_lang/compare/v0.11.3...v0.11.4) (2023-06-20)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
### Bug Fixes
|
|
175
|
+
|
|
176
|
+
* **midfunction:** set 3rd argument as required RB-1285 ([5994518](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/5994518))
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
<a name="0.11.3"></a>
|
|
181
|
+
## [0.11.3](https://bitbucket.org/qrvey/qrvey_formula_lang/compare/v0.11.2...v0.11.3) (2023-06-20)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
### Bug Fixes
|
|
185
|
+
|
|
186
|
+
* **mid.ts:** validate negatives on mid ([0c24e61](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/0c24e61))
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
<a name="0.11.0"></a>
|
|
191
|
+
# [0.11.0](https://bitbucket.org/qrvey/qrvey_formula_lang/compare/v0.10.0...v0.11.0) (2023-06-13)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
### Features
|
|
195
|
+
|
|
196
|
+
* **mismatch:** adding mismatch error ([79d2bf0](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/79d2bf0))
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
<a name="0.10.0"></a>
|
|
201
|
+
# [0.10.0](https://bitbucket.org/qrvey/qrvey_formula_lang/compare/v0.9.3...v0.10.0) (2023-06-09)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
### Features
|
|
205
|
+
|
|
206
|
+
* **postgres:** datedif ([4b31655](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/4b31655))
|
|
207
|
+
* **postgresql:** add postgres ([1c55de9](https://bitbucket.org/qrvey/qrvey_formula_lang/commits/1c55de9))
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
1
211
|
<a name="0.9.2"></a>
|
|
2
212
|
## [0.9.2](https://bitbucket.org/qrvey/qrvey_formula_lang/compare/v0.9.1...v0.9.2) (2023-06-01)
|
|
3
213
|
|
package/README.md
CHANGED
|
@@ -75,4 +75,36 @@ private dispatchTextUpdate(state: EditorState) {
|
|
|
75
75
|
// dispatch event after return
|
|
76
76
|
return { text, ast }
|
|
77
77
|
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### How create a context
|
|
81
|
+
|
|
82
|
+
The context is a object where implementor can build the information required for the transpiler. For example, the columns that will be used in the formula.
|
|
83
|
+
|
|
84
|
+
The properties needed are:
|
|
85
|
+
|
|
86
|
+
1. _useSampleData_: (Boolean) If you want to overwrite columns/externalFormulas by custom data, enable this flag. **Default**: `false`
|
|
87
|
+
1. _sampleData_: Optional (Object) Object to overwrite columns for custom data. **Key** represent the ID of the column, **Value** represent the replacement. See: `__tests__/__mocks__/context.ts` > `testContext`
|
|
88
|
+
1. _timezone_: Optional (Object). `{ offset: 'String' }` Set the timezone offset in String format.
|
|
89
|
+
1. _currentFormulaId_: Optional (String): ID of the current formula if you are edited one. This flag help to avoid any Circular Dependency when edit one formula, to avoid call itself
|
|
90
|
+
1. _model_: Optional (Object)
|
|
91
|
+
1. _label_: (String): Visualization
|
|
92
|
+
1. _id_: (String): ID of item (Column)
|
|
93
|
+
1. _replacement_: Optional (String): The ID will be replaced by this value.
|
|
94
|
+
1. _type_: (AST_PRIMITIVES) Native type
|
|
95
|
+
1. _isExternalFormula_: Optional (Boolean): If the item is a Formula created by this Package, need to set this flag in true
|
|
96
|
+
|
|
97
|
+
Use this Interfaces and Constants to build a **Context**
|
|
98
|
+
```js
|
|
99
|
+
import { FormulaContext, AST_PRIMITIVES } from '"@qrvey/formula-lang"';
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### How create clean the context
|
|
103
|
+
|
|
104
|
+
In some scenarios will be necessary to clean the Context, for example: Delete columns that will cause Circular Dependencies. This package have a utility call: `cleanInvalidItemsInContext` for that
|
|
105
|
+
|
|
106
|
+
```js
|
|
107
|
+
import { cleanInvalidItemsInContext } from "@qrvey/formula-lang";
|
|
108
|
+
const cleanContext = cleanInvalidItemsInContext(dirtyContext);
|
|
109
|
+
|
|
78
110
|
```
|
|
@@ -5,7 +5,8 @@ export declare enum ENGINES {
|
|
|
5
5
|
POSTGRESQL = "postgresql"
|
|
6
6
|
}
|
|
7
7
|
export declare enum RESPONSE_LEVEL {
|
|
8
|
-
runtime = "Runtime"
|
|
8
|
+
runtime = "Runtime",
|
|
9
|
+
function = "Function"
|
|
9
10
|
}
|
|
10
11
|
export declare enum AST_TYPES {
|
|
11
12
|
program = "Program",
|
|
@@ -17,7 +18,8 @@ export declare enum AST_TYPES {
|
|
|
17
18
|
column = "Column",
|
|
18
19
|
token = "Token",
|
|
19
20
|
literal = "Literal",
|
|
20
|
-
unknown = "Unknown"
|
|
21
|
+
unknown = "Unknown",
|
|
22
|
+
externalFormula = "ExternalFormula"
|
|
21
23
|
}
|
|
22
24
|
export declare enum AST_PRIMITIVES {
|
|
23
25
|
STRING = "string",
|
|
@@ -26,6 +28,10 @@ export declare enum AST_PRIMITIVES {
|
|
|
26
28
|
BOOLEAN = "boolean",
|
|
27
29
|
UNKNOWN = "unknown"
|
|
28
30
|
}
|
|
31
|
+
export declare enum CUSTOM_PRIMITIVE {
|
|
32
|
+
INTEGER = "INTEGER",
|
|
33
|
+
DECIMAL = "DECIMAL"
|
|
34
|
+
}
|
|
29
35
|
export type Primitive = AST_PRIMITIVES | AST_PRIMITIVES[];
|
|
30
36
|
export type CustomEngineOperators = {
|
|
31
37
|
[key in ENGINES]?: {
|
|
@@ -38,3 +44,4 @@ export declare enum ELASTICSEARCH_SCRIPT_NAMES {
|
|
|
38
44
|
setTimezone = "SET_TIMEZONE_SCRIPT",
|
|
39
45
|
subString = "SUBSTRING_SCRIPT"
|
|
40
46
|
}
|
|
47
|
+
export declare const DATE_AND_NUMBERS_DATA_TYPES: AST_PRIMITIVES[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ELASTICSEARCH_SCRIPT_NAMES = exports.CustomOperators = exports.AST_PRIMITIVES = exports.AST_TYPES = exports.RESPONSE_LEVEL = exports.ENGINES = void 0;
|
|
3
|
+
exports.DATE_AND_NUMBERS_DATA_TYPES = exports.ELASTICSEARCH_SCRIPT_NAMES = exports.CustomOperators = exports.CUSTOM_PRIMITIVE = exports.AST_PRIMITIVES = exports.AST_TYPES = exports.RESPONSE_LEVEL = exports.ENGINES = void 0;
|
|
4
4
|
var ENGINES;
|
|
5
5
|
(function (ENGINES) {
|
|
6
6
|
ENGINES["ELASTICSEARCH"] = "elasticsearch";
|
|
@@ -11,6 +11,7 @@ var ENGINES;
|
|
|
11
11
|
var RESPONSE_LEVEL;
|
|
12
12
|
(function (RESPONSE_LEVEL) {
|
|
13
13
|
RESPONSE_LEVEL["runtime"] = "Runtime";
|
|
14
|
+
RESPONSE_LEVEL["function"] = "Function";
|
|
14
15
|
})(RESPONSE_LEVEL = exports.RESPONSE_LEVEL || (exports.RESPONSE_LEVEL = {}));
|
|
15
16
|
var AST_TYPES;
|
|
16
17
|
(function (AST_TYPES) {
|
|
@@ -24,6 +25,7 @@ var AST_TYPES;
|
|
|
24
25
|
AST_TYPES["token"] = "Token";
|
|
25
26
|
AST_TYPES["literal"] = "Literal";
|
|
26
27
|
AST_TYPES["unknown"] = "Unknown";
|
|
28
|
+
AST_TYPES["externalFormula"] = "ExternalFormula";
|
|
27
29
|
})(AST_TYPES = exports.AST_TYPES || (exports.AST_TYPES = {}));
|
|
28
30
|
var AST_PRIMITIVES;
|
|
29
31
|
(function (AST_PRIMITIVES) {
|
|
@@ -33,6 +35,11 @@ var AST_PRIMITIVES;
|
|
|
33
35
|
AST_PRIMITIVES["BOOLEAN"] = "boolean";
|
|
34
36
|
AST_PRIMITIVES["UNKNOWN"] = "unknown";
|
|
35
37
|
})(AST_PRIMITIVES = exports.AST_PRIMITIVES || (exports.AST_PRIMITIVES = {}));
|
|
38
|
+
var CUSTOM_PRIMITIVE;
|
|
39
|
+
(function (CUSTOM_PRIMITIVE) {
|
|
40
|
+
CUSTOM_PRIMITIVE["INTEGER"] = "INTEGER";
|
|
41
|
+
CUSTOM_PRIMITIVE["DECIMAL"] = "DECIMAL";
|
|
42
|
+
})(CUSTOM_PRIMITIVE = exports.CUSTOM_PRIMITIVE || (exports.CUSTOM_PRIMITIVE = {}));
|
|
36
43
|
exports.CustomOperators = {
|
|
37
44
|
[ENGINES.ELASTICSEARCH]: {
|
|
38
45
|
'=': '==',
|
|
@@ -45,4 +52,8 @@ var ELASTICSEARCH_SCRIPT_NAMES;
|
|
|
45
52
|
ELASTICSEARCH_SCRIPT_NAMES["setTimezone"] = "SET_TIMEZONE_SCRIPT";
|
|
46
53
|
ELASTICSEARCH_SCRIPT_NAMES["subString"] = "SUBSTRING_SCRIPT";
|
|
47
54
|
})(ELASTICSEARCH_SCRIPT_NAMES = exports.ELASTICSEARCH_SCRIPT_NAMES || (exports.ELASTICSEARCH_SCRIPT_NAMES = {}));
|
|
55
|
+
exports.DATE_AND_NUMBERS_DATA_TYPES = [
|
|
56
|
+
AST_PRIMITIVES.DATE,
|
|
57
|
+
AST_PRIMITIVES.NUMBER,
|
|
58
|
+
];
|
|
48
59
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":";;;AAAA,IAAY,OAKX;AALD,WAAY,OAAO;IACf,0CAA+B,CAAA;IAC/B,kCAAuB,CAAA;IACvB,gCAAqB,CAAA;IACrB,oCAAyB,CAAA;AAC7B,CAAC,EALW,OAAO,GAAP,eAAO,KAAP,eAAO,QAKlB;AAED,IAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":";;;AAAA,IAAY,OAKX;AALD,WAAY,OAAO;IACf,0CAA+B,CAAA;IAC/B,kCAAuB,CAAA;IACvB,gCAAqB,CAAA;IACrB,oCAAyB,CAAA;AAC7B,CAAC,EALW,OAAO,GAAP,eAAO,KAAP,eAAO,QAKlB;AAED,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;AACzB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AAED,IAAY,SAYX;AAZD,WAAY,SAAS;IACjB,gCAAmB,CAAA;IACnB,4DAA+C,CAAA;IAC/C,kDAAqC,CAAA;IACrC,gDAAmC,CAAA;IACnC,0CAA6B,CAAA;IAC7B,kCAAqB,CAAA;IACrB,8BAAiB,CAAA;IACjB,4BAAe,CAAA;IACf,gCAAmB,CAAA;IACnB,gCAAmB,CAAA;IACnB,gDAAmC,CAAA;AACvC,CAAC,EAZW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAYpB;AAED,IAAY,cAMX;AAND,WAAY,cAAc;IACtB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,mCAAiB,CAAA;IACjB,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;AACvB,CAAC,EANW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAMzB;AAED,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;AACvB,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AAQY,QAAA,eAAe,GAA0B;IAClD,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;QACrB,GAAG,EAAE,IAAI;QACT,IAAI,EAAE,IAAI;KACb;CACJ,CAAC;AAEF,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IAClC,+DAAiC,CAAA;IACjC,iEAAmC,CAAA;IACnC,4DAA8B,CAAA;AAClC,CAAC,EAJW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAIrC;AAEY,QAAA,2BAA2B,GAAG;IACvC,cAAc,CAAC,IAAI;IACnB,cAAc,CAAC,MAAM;CACxB,CAAC"}
|
|
@@ -1,36 +1,53 @@
|
|
|
1
|
-
import { ENGINES, AST_TYPES, RESPONSE_LEVEL, AST_PRIMITIVES, Primitive } from '.';
|
|
1
|
+
import { ENGINES, AST_TYPES, RESPONSE_LEVEL, AST_PRIMITIVES, CUSTOM_PRIMITIVE, Primitive } from '.';
|
|
2
2
|
import { BaseError } from '../errors';
|
|
3
3
|
interface FunctionElementDefinition {
|
|
4
4
|
identifier: string;
|
|
5
|
-
name: string;
|
|
6
5
|
}
|
|
7
6
|
export interface FunctionDefinition extends FunctionElementDefinition {
|
|
8
7
|
recursiveStartIn?: number;
|
|
9
8
|
transpiler: EnginesFunction;
|
|
10
|
-
parameters?: Array<
|
|
9
|
+
parameters?: Array<FunctionParameter>;
|
|
11
10
|
primitiveResult: Primitive | ((args: CommonAST[]) => Primitive);
|
|
12
11
|
}
|
|
13
12
|
export type EnginesFunction = {
|
|
14
13
|
[key in ENGINES]: Function;
|
|
15
14
|
};
|
|
16
|
-
export interface
|
|
15
|
+
export interface FunctionParameter extends FunctionElementDefinition {
|
|
17
16
|
optional: boolean;
|
|
17
|
+
generic?: boolean;
|
|
18
|
+
expectedPrimitive?: AST_PRIMITIVES;
|
|
18
19
|
validator: Array<ValidatorFunctionParameter>;
|
|
19
20
|
}
|
|
20
21
|
export interface ProcessNodeResult {
|
|
21
22
|
value: any;
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
type: AST_TYPES;
|
|
24
|
+
dataType: Primitive;
|
|
25
|
+
node: CommonAST;
|
|
26
|
+
}
|
|
27
|
+
export interface ValidatorParameterContext {
|
|
28
|
+
fnNode: FunctionCallAST;
|
|
29
|
+
argument: ProcessNodeResult;
|
|
24
30
|
}
|
|
25
|
-
interface ValidatorFunctionParameter {
|
|
26
|
-
(value: any, dataType: Primitive | undefined,
|
|
31
|
+
export interface ValidatorFunctionParameter {
|
|
32
|
+
(value: any, dataType: Primitive | undefined, context: ValidatorParameterContext): ValidatorResponse;
|
|
27
33
|
}
|
|
28
34
|
export interface ValidatorResponse {
|
|
29
35
|
valid: boolean;
|
|
30
36
|
code?: string;
|
|
31
|
-
|
|
37
|
+
source?: RESPONSE_LEVEL;
|
|
32
38
|
message?: string;
|
|
33
39
|
info?: any;
|
|
40
|
+
mismatchData?: ValidatorExpectedInfo;
|
|
41
|
+
}
|
|
42
|
+
export interface ValidatorParameterResponse extends ValidatorResponse {
|
|
43
|
+
parameter: FunctionParameter;
|
|
44
|
+
argumentIndex: number;
|
|
45
|
+
}
|
|
46
|
+
export interface ValidatorExpectedInfo {
|
|
47
|
+
primitive: Primitive;
|
|
48
|
+
customPrimitive?: CUSTOM_PRIMITIVE;
|
|
49
|
+
customReceived?: CUSTOM_PRIMITIVE;
|
|
50
|
+
type?: AST_TYPES;
|
|
34
51
|
}
|
|
35
52
|
export interface TranspilationResponse {
|
|
36
53
|
valid: boolean;
|
|
@@ -45,10 +62,12 @@ interface TranspilationDetails {
|
|
|
45
62
|
export interface FunctionList {
|
|
46
63
|
[identifier: string]: FunctionDefinition;
|
|
47
64
|
}
|
|
48
|
-
export interface
|
|
49
|
-
type: AST_TYPES;
|
|
65
|
+
export interface ProgramPosition {
|
|
50
66
|
from: number;
|
|
51
67
|
to: number;
|
|
68
|
+
}
|
|
69
|
+
export interface CommonAST extends ProgramPosition {
|
|
70
|
+
type: AST_TYPES;
|
|
52
71
|
primitive: Primitive;
|
|
53
72
|
}
|
|
54
73
|
export interface ProgramAST extends CommonAST {
|
|
@@ -63,6 +82,8 @@ export interface ProgramAST extends CommonAST {
|
|
|
63
82
|
}
|
|
64
83
|
export interface UnaryExpressionAST extends CommonAST {
|
|
65
84
|
operator: string;
|
|
85
|
+
operatorNode?: ProgramPosition;
|
|
86
|
+
validOperators: string[];
|
|
66
87
|
right: CommonAST;
|
|
67
88
|
}
|
|
68
89
|
export interface BinaryExpressionAST extends UnaryExpressionAST {
|
|
@@ -73,7 +94,8 @@ export interface FunctionCallAST extends CommonAST {
|
|
|
73
94
|
arguments: Array<CommonAST>;
|
|
74
95
|
parenthesisStart: boolean;
|
|
75
96
|
parenthesisEnd: boolean;
|
|
76
|
-
|
|
97
|
+
functionText: string;
|
|
98
|
+
functionIdentifier: ProgramPosition;
|
|
77
99
|
}
|
|
78
100
|
export type ValueASTType = string | boolean | number | CommonAST[] | null | Date;
|
|
79
101
|
export interface CommonValueAST extends CommonAST {
|
|
@@ -85,6 +107,9 @@ export interface UnknownAST extends CommonAST {
|
|
|
85
107
|
export interface VariableAST extends CommonValueAST {
|
|
86
108
|
context?: VariableContextDefinition;
|
|
87
109
|
}
|
|
110
|
+
export interface ExternalFormulaAST extends VariableAST {
|
|
111
|
+
isExternalFormula: boolean;
|
|
112
|
+
}
|
|
88
113
|
export interface LiteralAST extends CommonValueAST {
|
|
89
114
|
dataType: AST_PRIMITIVES;
|
|
90
115
|
}
|
|
@@ -94,9 +119,11 @@ export interface VariableContextDefinition {
|
|
|
94
119
|
replacement?: string;
|
|
95
120
|
type: AST_PRIMITIVES;
|
|
96
121
|
extras?: Record<string, any>;
|
|
122
|
+
isExternalFormula?: boolean;
|
|
97
123
|
}
|
|
98
124
|
export interface FormulaContext {
|
|
99
125
|
model?: VariableContextDefinition[];
|
|
126
|
+
currentFormulaId?: string;
|
|
100
127
|
timezone?: TimezoneDefinition;
|
|
101
128
|
useSampleData?: boolean;
|
|
102
129
|
sampleData?: any;
|
|
@@ -110,6 +137,9 @@ export interface FormulaInference {
|
|
|
110
137
|
interface TimezoneDefinition {
|
|
111
138
|
offset: string;
|
|
112
139
|
}
|
|
113
|
-
export type VariableASTType = AST_TYPES.variable | AST_TYPES.column | AST_TYPES.token;
|
|
114
|
-
export type
|
|
140
|
+
export type VariableASTType = AST_TYPES.variable | AST_TYPES.column | AST_TYPES.token | AST_TYPES.externalFormula;
|
|
141
|
+
export type DateUnit = 'Y' | 'M' | 'D';
|
|
142
|
+
export type DateDifUnitParam = DateUnit;
|
|
143
|
+
export type DateTimeUnit = DateUnit | 'H' | 'MI' | 'S';
|
|
144
|
+
export type DayOfWeekFormat = 'Day' | 'D';
|
|
115
145
|
export {};
|
|
@@ -16,7 +16,7 @@ function errorAnalyzer(engine, errorObj) {
|
|
|
16
16
|
};
|
|
17
17
|
const { errorList, messageList } = info[engine](errorObj);
|
|
18
18
|
const currentError = analyzer(messageList, errorList);
|
|
19
|
-
return Object.assign({ valid: false,
|
|
19
|
+
return Object.assign({ valid: false, source: constants_1.RESPONSE_LEVEL.runtime, info: errorObj }, currentError);
|
|
20
20
|
}
|
|
21
21
|
exports.errorAnalyzer = errorAnalyzer;
|
|
22
22
|
function analyzer(messageList, errorList) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/errors/analyzer/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0D;AAE1D,8CAA8E;AAC9E,2CAAmD;AACnD,mDAA2D;AAC3D,yCAAiD;AACjD,6CAAqD;AAErD,SAAgB,aAAa,CACzB,MAAe,EACf,QAAiB;IAEjB,MAAM,IAAI,GAAoB;QAC1B,CAAC,mBAAO,CAAC,aAAa,CAAC,EAAE,uBAAa;QACtC,CAAC,mBAAO,CAAC,SAAS,CAAC,EAAE,mBAAS;QAC9B,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE,kBAAQ;QAC5B,CAAC,mBAAO,CAAC,UAAU,CAAC,EAAE,oBAAU;KACnC,CAAC;IACF,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACtD,uBACI,KAAK,EAAE,KAAK,EACZ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/errors/analyzer/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0D;AAE1D,8CAA8E;AAC9E,2CAAmD;AACnD,mDAA2D;AAC3D,yCAAiD;AACjD,6CAAqD;AAErD,SAAgB,aAAa,CACzB,MAAe,EACf,QAAiB;IAEjB,MAAM,IAAI,GAAoB;QAC1B,CAAC,mBAAO,CAAC,aAAa,CAAC,EAAE,uBAAa;QACtC,CAAC,mBAAO,CAAC,SAAS,CAAC,EAAE,mBAAS;QAC9B,CAAC,mBAAO,CAAC,QAAQ,CAAC,EAAE,kBAAQ;QAC5B,CAAC,mBAAO,CAAC,UAAU,CAAC,EAAE,oBAAU;KACnC,CAAC;IACF,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACtD,uBACI,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,0BAAc,CAAC,OAAO,EAC9B,IAAI,EAAE,QAAQ,IACX,YAAY,EACjB;AACN,CAAC;AAlBD,sCAkBC;AAED,SAAS,QAAQ,CACb,WAA0B,EAC1B,SAA2B;IAE3B,IAAI,MAAM,GAAG,6BAAgB,CAAC,OAAO,CAAC;IACtC,WAAW,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC5B,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC1B,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC7C,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;gBAAE,MAAM,GAAG,6BAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ErrorDictionary } from './dictionary';
|
|
2
|
+
import { BinaryExpressionAST, CommonAST, FunctionCallAST, FunctionParameter, UnaryExpressionAST, UnknownAST, ValidatorParameterResponse, ValidatorResponse } from '../constants/interfaces';
|
|
3
|
+
import { Primitive } from '../constants';
|
|
2
4
|
export declare class BaseError extends Error {
|
|
3
5
|
code: string;
|
|
4
6
|
message: string;
|
|
@@ -9,15 +11,28 @@ export declare class BaseError extends Error {
|
|
|
9
11
|
export declare class GenericError extends BaseError {
|
|
10
12
|
constructor(message?: string);
|
|
11
13
|
}
|
|
12
|
-
export declare class
|
|
14
|
+
export declare class FunctionError extends BaseError {
|
|
15
|
+
node: FunctionCallAST;
|
|
16
|
+
constructor(node: FunctionCallAST, errorDict: ErrorDictionary);
|
|
17
|
+
}
|
|
18
|
+
export declare class UnknownFunctionError extends FunctionError {
|
|
13
19
|
node: FunctionCallAST;
|
|
14
20
|
constructor(node: FunctionCallAST);
|
|
15
21
|
}
|
|
16
|
-
export declare class
|
|
22
|
+
export declare class ArgumentError extends FunctionError {
|
|
23
|
+
node: FunctionCallAST;
|
|
24
|
+
constructor(node: FunctionCallAST, errorDict: ErrorDictionary);
|
|
25
|
+
}
|
|
26
|
+
export declare class ArgumentValidatorError extends FunctionError {
|
|
27
|
+
node: FunctionCallAST;
|
|
28
|
+
readonly validator: ValidatorParameterResponse;
|
|
29
|
+
constructor(node: FunctionCallAST, validator: ValidatorParameterResponse);
|
|
30
|
+
}
|
|
31
|
+
export declare class MissingArgumentError extends ArgumentError {
|
|
17
32
|
node: FunctionCallAST;
|
|
18
|
-
parameter:
|
|
33
|
+
parameter: FunctionParameter;
|
|
19
34
|
readonly argumentIndex: number;
|
|
20
|
-
constructor(node: FunctionCallAST, parameter:
|
|
35
|
+
constructor(node: FunctionCallAST, parameter: FunctionParameter, argumentIndex: number);
|
|
21
36
|
toString(): string;
|
|
22
37
|
}
|
|
23
38
|
export declare class MissingParenthesisError extends BaseError {
|
|
@@ -28,9 +43,11 @@ export declare class UnknownTokenError extends BaseError {
|
|
|
28
43
|
node: UnknownAST;
|
|
29
44
|
constructor(node: UnknownAST);
|
|
30
45
|
}
|
|
31
|
-
export declare class
|
|
32
|
-
node:
|
|
33
|
-
constructor(node:
|
|
46
|
+
export declare class NotAllowedOperationError extends BaseError {
|
|
47
|
+
node: UnaryExpressionAST | BinaryExpressionAST;
|
|
48
|
+
constructor(node: UnaryExpressionAST | BinaryExpressionAST);
|
|
49
|
+
get leftPrimitive(): Primitive | undefined;
|
|
50
|
+
get rightPrimitive(): Primitive | undefined;
|
|
34
51
|
}
|
|
35
52
|
export declare class TooManyArgumentsError extends BaseError {
|
|
36
53
|
node: FunctionCallAST;
|
|
@@ -42,15 +59,10 @@ export declare class InvalidArgumentError extends BaseError {
|
|
|
42
59
|
readonly argumentIndex: number;
|
|
43
60
|
constructor(node: FunctionCallAST, validatorResponse: ValidatorResponse, argumentIndex: number);
|
|
44
61
|
}
|
|
45
|
-
export declare class UnknownExpressionError extends BaseError {
|
|
46
|
-
expression: CommonAST;
|
|
47
|
-
constructor(expression: CommonAST);
|
|
48
|
-
}
|
|
49
62
|
export declare class InferredPrimitiveError extends BaseError {
|
|
50
63
|
expression: CommonAST;
|
|
51
64
|
constructor(expression: CommonAST);
|
|
52
65
|
}
|
|
53
|
-
export declare class
|
|
54
|
-
|
|
55
|
-
constructor(expression: CommonAST);
|
|
66
|
+
export declare class CircularDependencyError extends BaseError {
|
|
67
|
+
constructor();
|
|
56
68
|
}
|