@qrvey/formula-lang 0.4.0 → 0.5.1
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/.vscode/launch.json +15 -0
- package/CHANGELOG.md +12 -0
- package/dist/{constants → cjs/constants}/index.d.ts +11 -2
- package/dist/cjs/constants/index.js +117 -0
- package/dist/cjs/constants/index.js.map +1 -0
- package/dist/{constants → cjs/constants}/interfaces.d.ts +14 -4
- package/dist/cjs/constants/interfaces.js +3 -0
- package/dist/{constants → cjs/constants}/interfaces.js.map +1 -1
- package/dist/{errors → cjs/errors}/definitions.d.ts +20 -3
- package/dist/cjs/errors/definitions.js +91 -0
- package/dist/cjs/errors/definitions.js.map +1 -0
- package/dist/cjs/errors/elasticsearch.js +30 -0
- package/dist/cjs/errors/elasticsearch.js.map +1 -0
- package/dist/cjs/errors/engineErrors.js +25 -0
- package/dist/cjs/errors/engineErrors.js.map +1 -0
- package/dist/cjs/errors/index.js +21 -0
- package/dist/cjs/errors/index.js.map +1 -0
- package/dist/cjs/errors/snowflake.js +20 -0
- package/dist/cjs/errors/snowflake.js.map +1 -0
- package/dist/cjs/functions/abs.js +38 -0
- package/dist/cjs/functions/abs.js.map +1 -0
- package/dist/cjs/functions/datedif.js +64 -0
- package/dist/cjs/functions/datedif.js.map +1 -0
- package/dist/cjs/functions/day.js +39 -0
- package/dist/cjs/functions/day.js.map +1 -0
- package/dist/cjs/functions/hour.js +39 -0
- package/dist/cjs/functions/hour.js.map +1 -0
- package/dist/cjs/functions/if.js +52 -0
- package/dist/cjs/functions/if.js.map +1 -0
- package/dist/cjs/functions/ifs.js +74 -0
- package/dist/cjs/functions/ifs.js.map +1 -0
- package/dist/cjs/functions/index.js +33 -0
- package/dist/cjs/functions/index.js.map +1 -0
- package/dist/cjs/functions/mid.js +54 -0
- package/dist/cjs/functions/mid.js.map +1 -0
- package/dist/cjs/functions/minute.js +39 -0
- package/dist/cjs/functions/minute.js.map +1 -0
- package/dist/cjs/functions/month.js +39 -0
- package/dist/cjs/functions/month.js.map +1 -0
- package/dist/cjs/functions/second.js +39 -0
- package/dist/cjs/functions/second.js.map +1 -0
- package/dist/cjs/functions/year.js +39 -0
- package/dist/cjs/functions/year.js.map +1 -0
- package/dist/cjs/grammar/generated/qformula.lang.d.ts +13 -0
- package/dist/cjs/grammar/generated/qformula.lang.js +50 -0
- package/dist/cjs/grammar/generated/qformula.lang.js.map +1 -0
- package/dist/cjs/grammar/qformula.grammar.js +18 -0
- package/dist/cjs/grammar/qformula.grammar.js.map +1 -0
- package/dist/{index.d.ts → cjs/index.d.ts} +3 -2
- package/dist/cjs/index.js +33 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/main.d.ts +1 -0
- package/dist/cjs/main.js +69 -0
- package/dist/cjs/main.js.map +1 -0
- package/dist/cjs/parser/json-parser.js +201 -0
- package/dist/cjs/parser/json-parser.js.map +1 -0
- package/dist/cjs/parser/syntax-errors.d.ts +3 -0
- package/dist/cjs/parser/syntax-errors.js +28 -0
- package/dist/cjs/parser/syntax-errors.js.map +1 -0
- package/dist/cjs/transpiler/columnTranspilation.d.ts +3 -0
- package/dist/cjs/transpiler/columnTranspilation.js +29 -0
- package/dist/cjs/transpiler/columnTranspilation.js.map +1 -0
- package/dist/{transpiler → cjs/transpiler}/index.d.ts +4 -4
- package/dist/cjs/transpiler/index.js +107 -0
- package/dist/cjs/transpiler/index.js.map +1 -0
- package/dist/cjs/transpiler/unshiftCustomFunctions.d.ts +2 -0
- package/dist/cjs/transpiler/unshiftCustomFunctions.js +14 -0
- package/dist/cjs/transpiler/unshiftCustomFunctions.js.map +1 -0
- package/dist/cjs/transpiler/validateFuncStructure.js +41 -0
- package/dist/cjs/transpiler/validateFuncStructure.js.map +1 -0
- package/dist/{utils → cjs/utils}/customFunctions.d.ts +1 -0
- package/dist/cjs/utils/customFunctions.js +35 -0
- package/dist/cjs/utils/customFunctions.js.map +1 -0
- package/dist/{utils → cjs/utils}/elasticsearch/index.d.ts +1 -1
- package/dist/cjs/utils/elasticsearch/index.js +22 -0
- package/dist/cjs/utils/elasticsearch/index.js.map +1 -0
- package/dist/{utils → cjs/utils}/elasticsearch/scripts.d.ts +1 -0
- package/dist/cjs/utils/elasticsearch/scripts.js +57 -0
- package/dist/cjs/utils/elasticsearch/scripts.js.map +1 -0
- package/dist/cjs/utils/getMonthMaxDayAllowed.js +26 -0
- package/dist/cjs/utils/getMonthMaxDayAllowed.js.map +1 -0
- package/dist/cjs/utils/getNodeValue.js +13 -0
- package/dist/cjs/utils/getNodeValue.js.map +1 -0
- package/dist/cjs/utils/getVariableType.js +19 -0
- package/dist/cjs/utils/getVariableType.js.map +1 -0
- package/dist/cjs/utils/index.js +29 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/isDateParam.js +12 -0
- package/dist/cjs/utils/isDateParam.js.map +1 -0
- package/dist/cjs/utils/isNumberParam.js +12 -0
- package/dist/cjs/utils/isNumberParam.js.map +1 -0
- package/dist/cjs/utils/isPositiveNumberParam.js +12 -0
- package/dist/cjs/utils/isPositiveNumberParam.js.map +1 -0
- package/dist/cjs/utils/isStringParam.js +12 -0
- package/dist/cjs/utils/isStringParam.js.map +1 -0
- package/dist/cjs/utils/isValidDate.js +8 -0
- package/dist/cjs/utils/isValidDate.js.map +1 -0
- package/dist/cjs/utils/sql/index.js +6 -0
- package/dist/cjs/utils/sql/index.js.map +1 -0
- package/dist/cjs/utils/sql/scripts.js +44 -0
- package/dist/cjs/utils/sql/scripts.js.map +1 -0
- package/dist/module/constants/index.d.ts +53 -0
- package/dist/{constants → module/constants}/index.js +26 -0
- package/dist/module/constants/index.js.map +1 -0
- package/dist/module/constants/interfaces.d.ts +91 -0
- package/dist/module/constants/interfaces.js.map +1 -0
- package/dist/module/errors/definitions.d.ts +43 -0
- package/dist/module/errors/definitions.js +78 -0
- package/dist/module/errors/definitions.js.map +1 -0
- package/dist/module/errors/elasticsearch.d.ts +24 -0
- package/dist/module/errors/elasticsearch.js.map +1 -0
- package/dist/module/errors/engineErrors.d.ts +2 -0
- package/dist/module/errors/engineErrors.js.map +1 -0
- package/dist/module/errors/index.d.ts +2 -0
- package/dist/module/errors/index.js.map +1 -0
- package/dist/module/errors/snowflake.d.ts +15 -0
- package/dist/module/errors/snowflake.js.map +1 -0
- package/dist/module/functions/abs.d.ts +5 -0
- package/dist/module/functions/abs.js.map +1 -0
- package/dist/module/functions/datedif.d.ts +5 -0
- package/dist/module/functions/datedif.js.map +1 -0
- package/dist/module/functions/day.d.ts +5 -0
- package/dist/module/functions/day.js.map +1 -0
- package/dist/module/functions/hour.d.ts +5 -0
- package/dist/module/functions/hour.js.map +1 -0
- package/dist/module/functions/if.d.ts +5 -0
- package/dist/module/functions/if.js.map +1 -0
- package/dist/module/functions/ifs.d.ts +5 -0
- package/dist/module/functions/ifs.js.map +1 -0
- package/dist/module/functions/index.d.ts +4 -0
- package/dist/module/functions/index.js.map +1 -0
- package/dist/module/functions/mid.d.ts +5 -0
- package/dist/module/functions/mid.js.map +1 -0
- package/dist/module/functions/minute.d.ts +5 -0
- package/dist/module/functions/minute.js.map +1 -0
- package/dist/module/functions/month.d.ts +5 -0
- package/dist/module/functions/month.js.map +1 -0
- package/dist/module/functions/second.d.ts +5 -0
- package/dist/module/functions/second.js.map +1 -0
- package/dist/module/functions/year.d.ts +5 -0
- package/dist/module/functions/year.js.map +1 -0
- package/dist/module/grammar/generated/qformula.lang.d.ts +13 -0
- package/dist/{grammar → module/grammar}/generated/qformula.lang.js +5 -4
- package/dist/module/grammar/generated/qformula.lang.js.map +1 -0
- package/dist/module/grammar/qformula.grammar.d.ts +1 -0
- package/dist/module/grammar/qformula.grammar.js.map +1 -0
- package/dist/module/index.d.ts +10 -0
- package/dist/{index.js → module/index.js} +3 -2
- package/dist/module/index.js.map +1 -0
- package/dist/module/main.d.ts +1 -0
- package/dist/module/main.js +67 -0
- package/dist/module/main.js.map +1 -0
- package/dist/module/parser/json-parser.d.ts +3 -0
- package/dist/module/parser/json-parser.js +197 -0
- package/dist/module/parser/json-parser.js.map +1 -0
- package/dist/module/parser/syntax-errors.d.ts +3 -0
- package/dist/module/parser/syntax-errors.js +24 -0
- package/dist/module/parser/syntax-errors.js.map +1 -0
- package/dist/module/transpiler/columnTranspilation.d.ts +3 -0
- package/dist/module/transpiler/columnTranspilation.js +25 -0
- package/dist/module/transpiler/columnTranspilation.js.map +1 -0
- package/dist/module/transpiler/index.d.ts +18 -0
- package/dist/{transpiler → module/transpiler}/index.js +29 -21
- package/dist/module/transpiler/index.js.map +1 -0
- package/dist/module/transpiler/unshiftCustomFunctions.d.ts +2 -0
- package/dist/module/transpiler/unshiftCustomFunctions.js +10 -0
- package/dist/module/transpiler/unshiftCustomFunctions.js.map +1 -0
- package/dist/module/transpiler/validateFuncStructure.d.ts +2 -0
- package/dist/module/transpiler/validateFuncStructure.js.map +1 -0
- package/dist/module/utils/customFunctions.d.ts +4 -0
- package/dist/{utils → module/utils}/customFunctions.js +10 -2
- package/dist/module/utils/customFunctions.js.map +1 -0
- package/dist/module/utils/elasticsearch/index.d.ts +2 -0
- package/dist/{utils → module/utils}/elasticsearch/index.js +1 -1
- package/dist/module/utils/elasticsearch/index.js.map +1 -0
- package/dist/module/utils/elasticsearch/scripts.d.ts +11 -0
- package/dist/{utils → module/utils}/elasticsearch/scripts.js +14 -4
- package/dist/module/utils/elasticsearch/scripts.js.map +1 -0
- package/dist/module/utils/getMonthMaxDayAllowed.d.ts +7 -0
- package/dist/module/utils/getMonthMaxDayAllowed.js.map +1 -0
- package/dist/module/utils/getNodeValue.d.ts +2 -0
- package/dist/module/utils/getNodeValue.js.map +1 -0
- package/dist/module/utils/getVariableType.d.ts +3 -0
- package/dist/{utils → module/utils}/getVariableType.js +3 -2
- package/dist/module/utils/getVariableType.js.map +1 -0
- package/dist/module/utils/index.d.ts +10 -0
- package/dist/module/utils/index.js.map +1 -0
- package/dist/module/utils/isDateParam.d.ts +2 -0
- package/dist/module/utils/isDateParam.js.map +1 -0
- package/dist/module/utils/isNumberParam.d.ts +2 -0
- package/dist/module/utils/isNumberParam.js.map +1 -0
- package/dist/module/utils/isPositiveNumberParam.d.ts +2 -0
- package/dist/module/utils/isPositiveNumberParam.js.map +1 -0
- package/dist/module/utils/isStringParam.d.ts +2 -0
- package/dist/module/utils/isStringParam.js.map +1 -0
- package/dist/module/utils/isValidDate.d.ts +1 -0
- package/dist/module/utils/isValidDate.js.map +1 -0
- package/dist/module/utils/sql/index.d.ts +1 -0
- package/dist/module/utils/sql/index.js.map +1 -0
- package/dist/module/utils/sql/scripts.d.ts +3 -0
- package/dist/module/utils/sql/scripts.js.map +1 -0
- package/jest.config.ts +6 -0
- package/package.json +21 -6
- package/__tests__/integration/__mocks__/context.ts +0 -23
- package/__tests__/integration/__mocks__/elasticsearchScripts.ts +0 -28
- package/__tests__/integration/__mocks__/sqlScripts.ts +0 -21
- package/__tests__/integration/elasticsearch.test.ts +0 -172
- package/__tests__/integration/expression.test.ts +0 -56
- package/__tests__/integration/redshift.test.ts +0 -142
- package/__tests__/integration/sonwflake.test.ts +0 -138
- package/__tests__/unit/parser.test.ts +0 -236
- package/__tests__/unit/transpiler.test.ts +0 -128
- package/bitbucket-pipelines.yml +0 -63
- package/dist/constants/index.js.map +0 -1
- package/dist/errors/definitions.js +0 -42
- package/dist/errors/definitions.js.map +0 -1
- package/dist/errors/elasticsearch.js.map +0 -1
- package/dist/errors/engineErrors.js.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/errors/snowflake.js.map +0 -1
- package/dist/functions/abs.js.map +0 -1
- package/dist/functions/datedif.js.map +0 -1
- package/dist/functions/day.js.map +0 -1
- package/dist/functions/hour.js.map +0 -1
- package/dist/functions/if.js.map +0 -1
- package/dist/functions/ifs.js.map +0 -1
- package/dist/functions/index.js.map +0 -1
- package/dist/functions/mid.js.map +0 -1
- package/dist/functions/minute.js.map +0 -1
- package/dist/functions/month.js.map +0 -1
- package/dist/functions/second.js.map +0 -1
- package/dist/functions/year.js.map +0 -1
- package/dist/grammar/generated/qformula.lang.d.ts +0 -4
- package/dist/grammar/generated/qformula.lang.js.map +0 -1
- package/dist/grammar/qformula.grammar.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/parser/json-parser.js +0 -147
- package/dist/parser/json-parser.js.map +0 -1
- package/dist/transpiler/columnTranspilation.d.ts +0 -3
- package/dist/transpiler/columnTranspilation.js +0 -19
- package/dist/transpiler/columnTranspilation.js.map +0 -1
- package/dist/transpiler/index.js.map +0 -1
- package/dist/transpiler/validateFuncStructure.js.map +0 -1
- package/dist/utils/customFunctions.js.map +0 -1
- package/dist/utils/elasticsearch/index.js.map +0 -1
- package/dist/utils/elasticsearch/scripts.js.map +0 -1
- package/dist/utils/getMonthMaxDayAllowed.js.map +0 -1
- package/dist/utils/getNodeValue.js.map +0 -1
- package/dist/utils/getVariableType.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/isDateParam.js.map +0 -1
- package/dist/utils/isNumberParam.js.map +0 -1
- package/dist/utils/isPositiveNumberParam.js.map +0 -1
- package/dist/utils/isStringParam.js.map +0 -1
- package/dist/utils/isValidDate.js.map +0 -1
- package/dist/utils/sql/index.js.map +0 -1
- package/dist/utils/sql/scripts.js.map +0 -1
- /package/dist/{errors → cjs/errors}/elasticsearch.d.ts +0 -0
- /package/dist/{errors → cjs/errors}/engineErrors.d.ts +0 -0
- /package/dist/{errors → cjs/errors}/index.d.ts +0 -0
- /package/dist/{errors → cjs/errors}/snowflake.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/abs.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/datedif.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/day.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/hour.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/if.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/ifs.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/index.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/mid.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/minute.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/month.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/second.d.ts +0 -0
- /package/dist/{functions → cjs/functions}/year.d.ts +0 -0
- /package/dist/{grammar → cjs/grammar}/qformula.grammar.d.ts +0 -0
- /package/dist/{parser → cjs/parser}/json-parser.d.ts +0 -0
- /package/dist/{transpiler → cjs/transpiler}/validateFuncStructure.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/getMonthMaxDayAllowed.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/getNodeValue.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/getVariableType.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/index.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/isDateParam.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/isNumberParam.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/isPositiveNumberParam.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/isStringParam.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/isValidDate.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/sql/index.d.ts +0 -0
- /package/dist/{utils → cjs/utils}/sql/scripts.d.ts +0 -0
- /package/dist/{constants → module/constants}/interfaces.js +0 -0
- /package/dist/{errors → module/errors}/elasticsearch.js +0 -0
- /package/dist/{errors → module/errors}/engineErrors.js +0 -0
- /package/dist/{errors → module/errors}/index.js +0 -0
- /package/dist/{errors → module/errors}/snowflake.js +0 -0
- /package/dist/{functions → module/functions}/abs.js +0 -0
- /package/dist/{functions → module/functions}/datedif.js +0 -0
- /package/dist/{functions → module/functions}/day.js +0 -0
- /package/dist/{functions → module/functions}/hour.js +0 -0
- /package/dist/{functions → module/functions}/if.js +0 -0
- /package/dist/{functions → module/functions}/ifs.js +0 -0
- /package/dist/{functions → module/functions}/index.js +0 -0
- /package/dist/{functions → module/functions}/mid.js +0 -0
- /package/dist/{functions → module/functions}/minute.js +0 -0
- /package/dist/{functions → module/functions}/month.js +0 -0
- /package/dist/{functions → module/functions}/second.js +0 -0
- /package/dist/{functions → module/functions}/year.js +0 -0
- /package/dist/{grammar → module/grammar}/qformula.grammar.js +0 -0
- /package/dist/{transpiler → module/transpiler}/validateFuncStructure.js +0 -0
- /package/dist/{utils → module/utils}/getMonthMaxDayAllowed.js +0 -0
- /package/dist/{utils → module/utils}/getNodeValue.js +0 -0
- /package/dist/{utils → module/utils}/index.js +0 -0
- /package/dist/{utils → module/utils}/isDateParam.js +0 -0
- /package/dist/{utils → module/utils}/isNumberParam.js +0 -0
- /package/dist/{utils → module/utils}/isPositiveNumberParam.js +0 -0
- /package/dist/{utils → module/utils}/isStringParam.js +0 -0
- /package/dist/{utils → module/utils}/isValidDate.js +0 -0
- /package/dist/{utils → module/utils}/sql/index.js +0 -0
- /package/dist/{utils → module/utils}/sql/scripts.js +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.customFunctionsList = exports.setTimezoneToColumnDate = exports.toDate = void 0;
|
|
4
|
+
const scripts_1 = require("./scripts");
|
|
5
|
+
var scripts_2 = require("./scripts");
|
|
6
|
+
Object.defineProperty(exports, "toDate", { enumerable: true, get: function () { return scripts_2.toDate; } });
|
|
7
|
+
Object.defineProperty(exports, "setTimezoneToColumnDate", { enumerable: true, get: function () { return scripts_2.setTimezoneToColumnDate; } });
|
|
8
|
+
function customFunctionsList(func) {
|
|
9
|
+
switch (func) {
|
|
10
|
+
case 'DAY':
|
|
11
|
+
case 'MONTH':
|
|
12
|
+
case 'YEAR':
|
|
13
|
+
case 'HOUR':
|
|
14
|
+
case 'MINUTE':
|
|
15
|
+
case 'SECOND':
|
|
16
|
+
return scripts_1.dateFormatScript;
|
|
17
|
+
default:
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.customFunctionsList = customFunctionsList;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/elasticsearch/index.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAC7C,qCAA4D;AAAnD,iGAAA,MAAM,OAAA;AAAE,kHAAA,uBAAuB,OAAA;AAExC,SAAgB,mBAAmB,CAAC,IAAY;IAC5C,QAAQ,IAAI,EAAE;QACV,KAAK,KAAK,CAAC;QACX,KAAK,OAAO,CAAC;QACb,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC;QACZ,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ;YACT,OAAO,0BAAgB,CAAC;QAC5B;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC;AAZD,kDAYC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DateDifUnitParam } from '../../constants/interfaces';
|
|
2
2
|
export declare function toDate(value: string): string;
|
|
3
|
+
export declare const setTimezoneToColumnDate: string;
|
|
3
4
|
export declare const dateFormatScript: string;
|
|
4
5
|
export declare const dayScript: (value: any) => string;
|
|
5
6
|
export declare const monthScript: (value: any) => string;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateDif = exports.secondScript = exports.minuteScript = exports.hourScript = exports.yearScript = exports.monthScript = exports.dayScript = exports.dateFormatScript = exports.setTimezoneToColumnDate = exports.toDate = void 0;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
function toDate(value) {
|
|
6
|
+
return `ZonedDateTime.parse("${value}")`;
|
|
7
|
+
}
|
|
8
|
+
exports.toDate = toDate;
|
|
9
|
+
exports.setTimezoneToColumnDate = `
|
|
10
|
+
${constants_1.ELASTICSEARCH_SCRIPT_NAMES.setTimezone}(def date, String timezone) {
|
|
11
|
+
if (date == null) return null;
|
|
12
|
+
def value;
|
|
13
|
+
if (date instanceof List) {
|
|
14
|
+
if (date.empty) return null;
|
|
15
|
+
value = date.value;
|
|
16
|
+
} else {
|
|
17
|
+
value = date;
|
|
18
|
+
}
|
|
19
|
+
return value.withZoneSameInstant(ZoneId.of(timezone));
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
exports.dateFormatScript = `
|
|
23
|
+
String ${constants_1.ELASTICSEARCH_SCRIPT_NAMES.dateFormat}(def date_value, String format) {
|
|
24
|
+
def isCustomDate = (date_value instanceof JodaCompatibleZonedDateTime || date_value instanceof ZonedDateTime);
|
|
25
|
+
if (date_value instanceof List && !isCustomDate) {
|
|
26
|
+
if (date_value.empty) return null;
|
|
27
|
+
date_value = date_value.value;
|
|
28
|
+
}
|
|
29
|
+
return DateTimeFormatter.ofPattern(format).format(date_value)
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
function dateFormatToInt(value, format) {
|
|
33
|
+
return `Integer.parseInt(${constants_1.ELASTICSEARCH_SCRIPT_NAMES.dateFormat}(${value}, '${format}'))`;
|
|
34
|
+
}
|
|
35
|
+
const dayScript = (value) => dateFormatToInt(value, 'dd');
|
|
36
|
+
exports.dayScript = dayScript;
|
|
37
|
+
const monthScript = (value) => dateFormatToInt(value, 'MM');
|
|
38
|
+
exports.monthScript = monthScript;
|
|
39
|
+
const yearScript = (value) => dateFormatToInt(value, 'yyyy');
|
|
40
|
+
exports.yearScript = yearScript;
|
|
41
|
+
const hourScript = (value) => dateFormatToInt(value, 'HH');
|
|
42
|
+
exports.hourScript = hourScript;
|
|
43
|
+
const minuteScript = (value) => dateFormatToInt(value, 'mm');
|
|
44
|
+
exports.minuteScript = minuteScript;
|
|
45
|
+
const secondScript = (value) => dateFormatToInt(value, 'ss');
|
|
46
|
+
exports.secondScript = secondScript;
|
|
47
|
+
function dateDif(start, end, unit) {
|
|
48
|
+
const units = {
|
|
49
|
+
Y: 'YEARS',
|
|
50
|
+
M: 'MONTHS',
|
|
51
|
+
D: 'DAYS',
|
|
52
|
+
};
|
|
53
|
+
const currentUnit = units[unit];
|
|
54
|
+
return `ChronoUnit.${currentUnit}.between(${start}, ${end})`;
|
|
55
|
+
}
|
|
56
|
+
exports.dateDif = dateDif;
|
|
57
|
+
//# sourceMappingURL=scripts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts.js","sourceRoot":"","sources":["../../../../src/utils/elasticsearch/scripts.ts"],"names":[],"mappings":";;;AACA,+CAA6E;AAE7E,SAAgB,MAAM,CAAC,KAAa;IAChC,OAAO,wBAAwB,KAAK,IAAI,CAAC;AAC7C,CAAC;AAFD,wBAEC;AAEY,QAAA,uBAAuB,GAAG;EACrC,sCAAY,CAAC,WAAW;;;;;;;;;;;CAWzB,CAAC;AAEW,QAAA,gBAAgB,GAAG;SACvB,sCAAY,CAAC,UAAU;;;;;;;;CAQ/B,CAAC;AAEF,SAAS,eAAe,CAAC,KAAU,EAAE,MAAc;IAC/C,OAAO,oBAAoB,sCAAY,CAAC,UAAU,IAAI,KAAK,MAAM,MAAM,KAAK,CAAC;AACjF,CAAC;AAEM,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAAzD,QAAA,SAAS,aAAgD;AAE/D,MAAM,WAAW,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAA3D,QAAA,WAAW,eAAgD;AAEjE,MAAM,UAAU,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAA5D,QAAA,UAAU,cAAkD;AAElE,MAAM,UAAU,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAA1D,QAAA,UAAU,cAAgD;AAEhE,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAA5D,QAAA,YAAY,gBAAgD;AAElE,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAA5D,QAAA,YAAY,gBAAgD;AAEzE,SAAgB,OAAO,CAAC,KAAU,EAAE,GAAQ,EAAE,IAAsB;IAChE,MAAM,KAAK,GAAG;QACV,CAAC,EAAE,OAAO;QACV,CAAC,EAAE,QAAQ;QACX,CAAC,EAAE,MAAM;KACZ,CAAC;IACF,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,cAAc,WAAW,YAAY,KAAK,KAAK,GAAG,GAAG,CAAC;AACjE,CAAC;AARD,0BAQC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMonthMaxDayAllowed = void 0;
|
|
4
|
+
function isLeapYear(year) {
|
|
5
|
+
return year % 4 === 0 && year % 100 !== 0;
|
|
6
|
+
}
|
|
7
|
+
const MONTH_MAX_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
8
|
+
/**
|
|
9
|
+
* Gets the max number of days allowed for a date
|
|
10
|
+
* @param month 0 index month of the year
|
|
11
|
+
* @param year year of a date
|
|
12
|
+
* @returns number with the max number allowed. -1 if month does not exist in array list
|
|
13
|
+
*/
|
|
14
|
+
function getMonthMaxDayAllowed(month, year) {
|
|
15
|
+
if (month > 11 || month < 0)
|
|
16
|
+
return -1;
|
|
17
|
+
if (month === 1) {
|
|
18
|
+
// case for february
|
|
19
|
+
return isLeapYear(year) ? 29 : MONTH_MAX_DAYS[month];
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return MONTH_MAX_DAYS[month];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.getMonthMaxDayAllowed = getMonthMaxDayAllowed;
|
|
26
|
+
//# sourceMappingURL=getMonthMaxDayAllowed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMonthMaxDayAllowed.js","sourceRoot":"","sources":["../../../src/utils/getMonthMaxDayAllowed.ts"],"names":[],"mappings":";;;AAAA,SAAS,UAAU,CAAC,IAAY;IAC5B,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,cAAc,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AAExE;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,KAAa,EAAE,IAAY;IAC7D,IAAI,KAAK,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,CAAC,EAAE;QACb,oBAAoB;QACpB,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;KACxD;SAAM;QACH,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;KAChC;AACL,CAAC;AARD,sDAQC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNodeValue = void 0;
|
|
4
|
+
function getNodeValue(str, node) {
|
|
5
|
+
if (!str || !node)
|
|
6
|
+
return '';
|
|
7
|
+
return sliceNodeValue(str, node);
|
|
8
|
+
}
|
|
9
|
+
exports.getNodeValue = getNodeValue;
|
|
10
|
+
function sliceNodeValue(str, { from, to }) {
|
|
11
|
+
return str.slice(from, to);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=getNodeValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNodeValue.js","sourceRoot":"","sources":["../../../src/utils/getNodeValue.ts"],"names":[],"mappings":";;;AAEA,SAAgB,YAAY,CAAC,GAAW,EAAE,IAAgB;IACtD,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAC7B,OAAO,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AAHD,oCAGC;AAED,SAAS,cAAc,CACnB,GAAW,EACX,EAAE,IAAI,EAAE,EAAE,EAAgC;IAE1C,OAAO,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVariableType = exports.getVariableContext = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
function getVariableContext(variableName, context) {
|
|
6
|
+
var _a;
|
|
7
|
+
return (_a = context === null || context === void 0 ? void 0 : context.model) === null || _a === void 0 ? void 0 : _a.find((model) => model.id === variableName);
|
|
8
|
+
}
|
|
9
|
+
exports.getVariableContext = getVariableContext;
|
|
10
|
+
function getVariableSpecificType(variableContext) {
|
|
11
|
+
return variableContext.replacement ? constants_1.AST_TYPES.column : constants_1.AST_TYPES.token;
|
|
12
|
+
}
|
|
13
|
+
function getVariableType(columnCxt) {
|
|
14
|
+
return columnCxt !== undefined
|
|
15
|
+
? getVariableSpecificType(columnCxt)
|
|
16
|
+
: constants_1.AST_TYPES.variable;
|
|
17
|
+
}
|
|
18
|
+
exports.getVariableType = getVariableType;
|
|
19
|
+
//# sourceMappingURL=getVariableType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getVariableType.js","sourceRoot":"","sources":["../../../src/utils/getVariableType.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AAOzC,SAAgB,kBAAkB,CAC9B,YAAoB,EACpB,OAAwB;;IAExB,OAAO,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,YAAY,CAAC,CAAC;AACtE,CAAC;AALD,gDAKC;AAED,SAAS,uBAAuB,CAC5B,eAA0C;IAE1C,OAAO,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,qBAAS,CAAC,MAAM,CAAC,CAAC,CAAC,qBAAS,CAAC,KAAK,CAAC;AAC5E,CAAC;AAED,SAAgB,eAAe,CAC3B,SAAqC;IAErC,OAAO,SAAS,KAAK,SAAS;QAC1B,CAAC,CAAC,uBAAuB,CAAC,SAAS,CAAC;QACpC,CAAC,CAAC,qBAAS,CAAC,QAAQ,CAAC;AAC7B,CAAC;AAND,0CAMC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.removeQuotes = void 0;
|
|
18
|
+
__exportStar(require("./customFunctions"), exports);
|
|
19
|
+
__exportStar(require("./isNumberParam"), exports);
|
|
20
|
+
__exportStar(require("./isPositiveNumberParam"), exports);
|
|
21
|
+
__exportStar(require("./isStringParam"), exports);
|
|
22
|
+
__exportStar(require("./isDateParam"), exports);
|
|
23
|
+
__exportStar(require("./isValidDate"), exports);
|
|
24
|
+
__exportStar(require("./getMonthMaxDayAllowed"), exports);
|
|
25
|
+
__exportStar(require("./getNodeValue"), exports);
|
|
26
|
+
__exportStar(require("./getVariableType"), exports);
|
|
27
|
+
const removeQuotes = (str) => str.replace(/'/g, '');
|
|
28
|
+
exports.removeQuotes = removeQuotes;
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,kDAAgC;AAChC,0DAAwC;AACxC,kDAAgC;AAChC,gDAA8B;AAC9B,gDAA8B;AAC9B,0DAAwC;AACxC,iDAA+B;AAC/B,oDAAkC;AAE3B,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAAtD,QAAA,YAAY,gBAA0C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDateParam = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
function isDateParam(_param, dataType) {
|
|
6
|
+
const valid = dataType === 'date';
|
|
7
|
+
if (!valid)
|
|
8
|
+
return Object.assign({ valid }, constants_1.ERROR_DICTIONARY[constants_1.ERROR_LIST.missingDate]);
|
|
9
|
+
return { valid };
|
|
10
|
+
}
|
|
11
|
+
exports.isDateParam = isDateParam;
|
|
12
|
+
//# sourceMappingURL=isDateParam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDateParam.js","sourceRoot":"","sources":["../../../src/utils/isDateParam.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAG5D,SAAgB,WAAW,CACvB,MAAW,EACX,QAA4B;IAE5B,MAAM,KAAK,GAAG,QAAQ,KAAK,MAAM,CAAC;IAClC,IAAI,CAAC,KAAK;QAAE,uBAAS,KAAK,IAAK,4BAAgB,CAAC,sBAAU,CAAC,WAAW,CAAC,EAAG;IAC1E,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC;AAPD,kCAOC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNumberParam = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
function isNumberParam(param) {
|
|
6
|
+
const valid = typeof param === 'number';
|
|
7
|
+
if (!valid)
|
|
8
|
+
return Object.assign({ valid }, constants_1.ERROR_DICTIONARY[constants_1.ERROR_LIST.missingNumber]);
|
|
9
|
+
return { valid };
|
|
10
|
+
}
|
|
11
|
+
exports.isNumberParam = isNumberParam;
|
|
12
|
+
//# sourceMappingURL=isNumberParam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isNumberParam.js","sourceRoot":"","sources":["../../../src/utils/isNumberParam.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAG5D,SAAgB,aAAa,CAAC,KAAU;IACpC,MAAM,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC;IACxC,IAAI,CAAC,KAAK;QAAE,uBAAS,KAAK,IAAK,4BAAgB,CAAC,sBAAU,CAAC,aAAa,CAAC,EAAG;IAC5E,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC;AAJD,sCAIC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPositiveNumberParam = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
function isPositiveNumberParam(param) {
|
|
6
|
+
const valid = param >= 0;
|
|
7
|
+
if (!valid)
|
|
8
|
+
return Object.assign({ valid }, constants_1.ERROR_DICTIONARY[constants_1.ERROR_LIST.greaterThanZero]);
|
|
9
|
+
return { valid };
|
|
10
|
+
}
|
|
11
|
+
exports.isPositiveNumberParam = isPositiveNumberParam;
|
|
12
|
+
//# sourceMappingURL=isPositiveNumberParam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPositiveNumberParam.js","sourceRoot":"","sources":["../../../src/utils/isPositiveNumberParam.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAG5D,SAAgB,qBAAqB,CAAC,KAAU;IAC5C,MAAM,KAAK,GAAG,KAAK,IAAI,CAAC,CAAC;IACzB,IAAI,CAAC,KAAK;QACN,uBAAS,KAAK,IAAK,4BAAgB,CAAC,sBAAU,CAAC,eAAe,CAAC,EAAG;IACtE,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC;AALD,sDAKC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isStringParam = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
function isStringParam(param) {
|
|
6
|
+
const valid = typeof param === 'string';
|
|
7
|
+
if (!valid)
|
|
8
|
+
return Object.assign({ valid }, constants_1.ERROR_DICTIONARY[constants_1.ERROR_LIST.missingString]);
|
|
9
|
+
return { valid };
|
|
10
|
+
}
|
|
11
|
+
exports.isStringParam = isStringParam;
|
|
12
|
+
//# sourceMappingURL=isStringParam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isStringParam.js","sourceRoot":"","sources":["../../../src/utils/isStringParam.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAG5D,SAAgB,aAAa,CAAC,KAAU;IACpC,MAAM,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC;IACxC,IAAI,CAAC,KAAK;QAAE,uBAAS,KAAK,IAAK,4BAAgB,CAAC,sBAAU,CAAC,aAAa,CAAC,EAAG;IAC5E,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC;AAJD,sCAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isValidDate.js","sourceRoot":"","sources":["../../../src/utils/isValidDate.ts"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,CAAC,CAAU;IAClC,OAAO,CAAC,KAAK,CAAC,CAAW,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC;AACpD,CAAC;AAFD,kCAEC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toDate = void 0;
|
|
4
|
+
var scripts_1 = require("./scripts");
|
|
5
|
+
Object.defineProperty(exports, "toDate", { enumerable: true, get: function () { return scripts_1.toDate; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utils/sql/index.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AAA1B,iGAAA,MAAM,OAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateDif = exports.toDate = void 0;
|
|
4
|
+
function datePart(value, format) {
|
|
5
|
+
return `DATE_PART('${format}', ${value})`;
|
|
6
|
+
}
|
|
7
|
+
function toDate(value) {
|
|
8
|
+
return `CAST('${value}' AS TIMESTAMPTZ)`;
|
|
9
|
+
}
|
|
10
|
+
exports.toDate = toDate;
|
|
11
|
+
function generalDateDif(start, end, unit) {
|
|
12
|
+
const units = {
|
|
13
|
+
Y: 'year',
|
|
14
|
+
M: 'month',
|
|
15
|
+
D: 'day',
|
|
16
|
+
};
|
|
17
|
+
const currentUnit = units[unit];
|
|
18
|
+
return `DATEDIFF('${currentUnit}', ${start}, ${end})`;
|
|
19
|
+
}
|
|
20
|
+
function customDateDifYear(start, end) {
|
|
21
|
+
const month = datePart('month', end);
|
|
22
|
+
const day = datePart('day', end);
|
|
23
|
+
const year = datePart('year', start);
|
|
24
|
+
const parts = [year, month, day].join(`|| '-' ||`);
|
|
25
|
+
const customDate = toDate(parts);
|
|
26
|
+
const dateDifToCompare = generalDateDif(start, customDate, 'D');
|
|
27
|
+
const dateDifYear = generalDateDif(start, end, 'Y');
|
|
28
|
+
const result = `CASE
|
|
29
|
+
WHEN ${dateDifToCompare} >= 0
|
|
30
|
+
THEN ${dateDifYear}
|
|
31
|
+
ELSE ${dateDifYear} - 1
|
|
32
|
+
END`;
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
function dateDif(start, end, unit) {
|
|
36
|
+
const units = {
|
|
37
|
+
Y: customDateDifYear,
|
|
38
|
+
M: generalDateDif,
|
|
39
|
+
D: generalDateDif,
|
|
40
|
+
};
|
|
41
|
+
return units[unit](start, end, unit);
|
|
42
|
+
}
|
|
43
|
+
exports.dateDif = dateDif;
|
|
44
|
+
//# sourceMappingURL=scripts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts.js","sourceRoot":"","sources":["../../../../src/utils/sql/scripts.ts"],"names":[],"mappings":";;;AAEA,SAAS,QAAQ,CAAC,KAAa,EAAE,MAAc;IAC3C,OAAO,cAAc,MAAM,MAAM,KAAK,GAAG,CAAC;AAC9C,CAAC;AAED,SAAgB,MAAM,CAAC,KAAa;IAChC,OAAO,SAAS,KAAK,mBAAmB,CAAC;AAC7C,CAAC;AAFD,wBAEC;AAED,SAAS,cAAc,CAAC,KAAa,EAAE,GAAW,EAAE,IAAsB;IACtE,MAAM,KAAK,GAAG;QACV,CAAC,EAAE,MAAM;QACT,CAAC,EAAE,OAAO;QACV,CAAC,EAAE,KAAK;KACX,CAAC;IACF,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,aAAa,WAAW,MAAM,KAAK,KAAK,GAAG,GAAG,CAAC;AAC1D,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAa,EAAE,GAAW;IACjD,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACrC,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,MAAM,gBAAgB,GAAG,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC;IAChE,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG;eACJ,gBAAgB;mBACZ,WAAW;eACf,WAAW;QAClB,CAAC;IACL,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,SAAgB,OAAO,CAAC,KAAa,EAAE,GAAW,EAAE,IAAsB;IACtE,MAAM,KAAK,GAAG;QACV,CAAC,EAAE,iBAAiB;QACpB,CAAC,EAAE,cAAc;QACjB,CAAC,EAAE,cAAc;KACpB,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAPD,0BAOC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare enum ENGINES {
|
|
2
|
+
ELASTICSEARCH = "elasticsearch",
|
|
3
|
+
SNOWFLAKE = "snowflake",
|
|
4
|
+
REDSHIFT = "redshift"
|
|
5
|
+
}
|
|
6
|
+
export declare enum AST_TYPES {
|
|
7
|
+
program = "Program",
|
|
8
|
+
binaryExpression = "BinaryExpression",
|
|
9
|
+
unaryExpression = "UnaryExpression",
|
|
10
|
+
functionCall = "FunctionCall",
|
|
11
|
+
variable = "Variable",
|
|
12
|
+
column = "Column",
|
|
13
|
+
token = "Token",
|
|
14
|
+
literal = "Literal",
|
|
15
|
+
unknown = "Unknown"
|
|
16
|
+
}
|
|
17
|
+
export declare enum ERROR_LIST {
|
|
18
|
+
arguments = "arguments",
|
|
19
|
+
nulls = "nulls",
|
|
20
|
+
floatingPoint = "floatingPoint",
|
|
21
|
+
missingString = "missingString",
|
|
22
|
+
missingNumber = "missingNumber",
|
|
23
|
+
missingDate = "missingDate",
|
|
24
|
+
greaterThanZero = "greaterThanZero",
|
|
25
|
+
missingArg = "missingArg",
|
|
26
|
+
missingParenthesis = "missingParenthesis",
|
|
27
|
+
unknownFunction = "unknownFunction",
|
|
28
|
+
unknown = "unknown",
|
|
29
|
+
customDateDifParams = "customDateDifParams",
|
|
30
|
+
tooManyArguments = "tooManyArguments",
|
|
31
|
+
unknownExpression = "unknownExpression",
|
|
32
|
+
unknownToken = "unknownToken",
|
|
33
|
+
notAllowedExpression = "notAllowedExpression"
|
|
34
|
+
}
|
|
35
|
+
type iErrorsType = {
|
|
36
|
+
[key in ERROR_LIST]: IErrorDictionary;
|
|
37
|
+
};
|
|
38
|
+
interface IErrorDictionary {
|
|
39
|
+
message: string;
|
|
40
|
+
code: string;
|
|
41
|
+
}
|
|
42
|
+
export declare const ERROR_DICTIONARY: iErrorsType;
|
|
43
|
+
export type CustomEngineOperators = {
|
|
44
|
+
[key in ENGINES]?: {
|
|
45
|
+
[T: string]: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare const CustomOperators: CustomEngineOperators;
|
|
49
|
+
export declare enum ELASTICSEARCH_SCRIPT_NAMES {
|
|
50
|
+
dateFormat = "DATE_FORMAT_SCRIPT",
|
|
51
|
+
setTimezone = "SET_TIMEZONE_SCRIPT"
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -14,6 +14,7 @@ export var AST_TYPES;
|
|
|
14
14
|
AST_TYPES["column"] = "Column";
|
|
15
15
|
AST_TYPES["token"] = "Token";
|
|
16
16
|
AST_TYPES["literal"] = "Literal";
|
|
17
|
+
AST_TYPES["unknown"] = "Unknown";
|
|
17
18
|
})(AST_TYPES || (AST_TYPES = {}));
|
|
18
19
|
export var ERROR_LIST;
|
|
19
20
|
(function (ERROR_LIST) {
|
|
@@ -25,10 +26,14 @@ export var ERROR_LIST;
|
|
|
25
26
|
ERROR_LIST["missingDate"] = "missingDate";
|
|
26
27
|
ERROR_LIST["greaterThanZero"] = "greaterThanZero";
|
|
27
28
|
ERROR_LIST["missingArg"] = "missingArg";
|
|
29
|
+
ERROR_LIST["missingParenthesis"] = "missingParenthesis";
|
|
28
30
|
ERROR_LIST["unknownFunction"] = "unknownFunction";
|
|
29
31
|
ERROR_LIST["unknown"] = "unknown";
|
|
30
32
|
ERROR_LIST["customDateDifParams"] = "customDateDifParams";
|
|
31
33
|
ERROR_LIST["tooManyArguments"] = "tooManyArguments";
|
|
34
|
+
ERROR_LIST["unknownExpression"] = "unknownExpression";
|
|
35
|
+
ERROR_LIST["unknownToken"] = "unknownToken";
|
|
36
|
+
ERROR_LIST["notAllowedExpression"] = "notAllowedExpression";
|
|
32
37
|
})(ERROR_LIST || (ERROR_LIST = {}));
|
|
33
38
|
export const ERROR_DICTIONARY = {
|
|
34
39
|
[ERROR_LIST.arguments]: {
|
|
@@ -63,6 +68,14 @@ export const ERROR_DICTIONARY = {
|
|
|
63
68
|
message: 'Missing arguments',
|
|
64
69
|
code: 'MISSING_ARG',
|
|
65
70
|
},
|
|
71
|
+
[ERROR_LIST.missingParenthesis]: {
|
|
72
|
+
message: 'Missing parenthesis',
|
|
73
|
+
code: 'MISSING_PARENTHESIS',
|
|
74
|
+
},
|
|
75
|
+
[ERROR_LIST.unknownToken]: {
|
|
76
|
+
message: 'Unknown token',
|
|
77
|
+
code: 'UNKNOWN_TOKEN',
|
|
78
|
+
},
|
|
66
79
|
[ERROR_LIST.unknownFunction]: {
|
|
67
80
|
message: 'Unknown function',
|
|
68
81
|
code: 'UNKNOWN_FUNCTION',
|
|
@@ -79,10 +92,23 @@ export const ERROR_DICTIONARY = {
|
|
|
79
92
|
message: 'Unit param have to be equal to: "Y", "M", "D"',
|
|
80
93
|
code: 'DATE_DIF_UNIT_PARAM',
|
|
81
94
|
},
|
|
95
|
+
[ERROR_LIST.unknownExpression]: {
|
|
96
|
+
message: 'Unknown expression',
|
|
97
|
+
code: 'UNKNOWN_EXPRESSION',
|
|
98
|
+
},
|
|
99
|
+
[ERROR_LIST.notAllowedExpression]: {
|
|
100
|
+
message: 'Expression not allowed',
|
|
101
|
+
code: 'NOT_ALLOWED_EXPRESSION',
|
|
102
|
+
},
|
|
82
103
|
};
|
|
83
104
|
export const CustomOperators = {
|
|
84
105
|
[ENGINES.ELASTICSEARCH]: {
|
|
85
106
|
'=': '==',
|
|
86
107
|
},
|
|
87
108
|
};
|
|
109
|
+
export var ELASTICSEARCH_SCRIPT_NAMES;
|
|
110
|
+
(function (ELASTICSEARCH_SCRIPT_NAMES) {
|
|
111
|
+
ELASTICSEARCH_SCRIPT_NAMES["dateFormat"] = "DATE_FORMAT_SCRIPT";
|
|
112
|
+
ELASTICSEARCH_SCRIPT_NAMES["setTimezone"] = "SET_TIMEZONE_SCRIPT";
|
|
113
|
+
})(ELASTICSEARCH_SCRIPT_NAMES || (ELASTICSEARCH_SCRIPT_NAMES = {}));
|
|
88
114
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ENGINES, AST_TYPES } from '.';
|
|
2
|
+
import { BaseError } from '../errors';
|
|
3
|
+
interface FunctionElementDefinition {
|
|
4
|
+
identifier: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FunctionDefinition extends FunctionElementDefinition {
|
|
8
|
+
recursiveStartIn?: number;
|
|
9
|
+
transpiler: TranspilerEnginesFunction;
|
|
10
|
+
parameters?: Array<FunctionParameters>;
|
|
11
|
+
}
|
|
12
|
+
export type TranspilerEnginesFunction = {
|
|
13
|
+
[key in ENGINES]: Function;
|
|
14
|
+
};
|
|
15
|
+
interface FunctionParameters extends FunctionElementDefinition {
|
|
16
|
+
type: string;
|
|
17
|
+
optional: boolean;
|
|
18
|
+
validator: Array<ValidatorFunctionParameter>;
|
|
19
|
+
}
|
|
20
|
+
export interface ProcessNodeResult {
|
|
21
|
+
value: any;
|
|
22
|
+
dataType?: string;
|
|
23
|
+
}
|
|
24
|
+
interface ValidatorFunctionParameter {
|
|
25
|
+
(value: any, dataType: string | undefined): ValidatorResponse;
|
|
26
|
+
}
|
|
27
|
+
export interface ValidatorResponse {
|
|
28
|
+
valid: boolean;
|
|
29
|
+
code?: string;
|
|
30
|
+
message?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface TranspilationResponse {
|
|
33
|
+
valid: boolean;
|
|
34
|
+
expression?: string;
|
|
35
|
+
errors?: BaseError[];
|
|
36
|
+
}
|
|
37
|
+
export interface FunctionList {
|
|
38
|
+
[identifier: string]: FunctionDefinition;
|
|
39
|
+
}
|
|
40
|
+
export interface CommonAST {
|
|
41
|
+
type: AST_TYPES;
|
|
42
|
+
from: number;
|
|
43
|
+
to: number;
|
|
44
|
+
}
|
|
45
|
+
export interface ProgramAST extends CommonAST {
|
|
46
|
+
exp: string;
|
|
47
|
+
lang: string;
|
|
48
|
+
version: string;
|
|
49
|
+
body?: CommonAST;
|
|
50
|
+
errors?: BaseError[];
|
|
51
|
+
}
|
|
52
|
+
export interface UnaryExpressionAST extends CommonAST {
|
|
53
|
+
operator: string;
|
|
54
|
+
right: CommonAST;
|
|
55
|
+
}
|
|
56
|
+
export interface BinaryExpressionAST extends UnaryExpressionAST {
|
|
57
|
+
left: CommonAST;
|
|
58
|
+
}
|
|
59
|
+
export interface FunctionCallAST extends CommonAST {
|
|
60
|
+
name: string;
|
|
61
|
+
arguments: Array<CommonAST>;
|
|
62
|
+
}
|
|
63
|
+
export type ValueASTType = string | boolean | number | CommonAST[] | null | Date;
|
|
64
|
+
export interface CommonValueAST extends CommonAST {
|
|
65
|
+
value: ValueASTType;
|
|
66
|
+
}
|
|
67
|
+
export interface UnknownAST extends CommonAST {
|
|
68
|
+
text: string;
|
|
69
|
+
}
|
|
70
|
+
export interface VariableAST extends CommonValueAST {
|
|
71
|
+
context?: VariableContextDefinition;
|
|
72
|
+
}
|
|
73
|
+
export interface LiteralAST extends CommonValueAST {
|
|
74
|
+
dataType: string;
|
|
75
|
+
}
|
|
76
|
+
export interface VariableContextDefinition {
|
|
77
|
+
label: string;
|
|
78
|
+
id: string;
|
|
79
|
+
replacement?: string;
|
|
80
|
+
type: string;
|
|
81
|
+
}
|
|
82
|
+
export interface FormulaContext {
|
|
83
|
+
model?: VariableContextDefinition[];
|
|
84
|
+
timezone?: TimezoneDefinition;
|
|
85
|
+
}
|
|
86
|
+
interface TimezoneDefinition {
|
|
87
|
+
offset: string;
|
|
88
|
+
}
|
|
89
|
+
export type VariableASTType = AST_TYPES.variable | AST_TYPES.column | AST_TYPES.token;
|
|
90
|
+
export type DateDifUnitParam = 'Y' | 'M' | 'D';
|
|
91
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/constants/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { CommonAST, FunctionCallAST, UnknownAST, ValidatorResponse } from '../constants/interfaces';
|
|
2
|
+
export declare class BaseError extends Error {
|
|
3
|
+
code: string;
|
|
4
|
+
message: string;
|
|
5
|
+
node?: FunctionCallAST | CommonAST | undefined;
|
|
6
|
+
constructor(code: string, message: string, node?: FunctionCallAST | CommonAST | undefined);
|
|
7
|
+
toString(): string;
|
|
8
|
+
}
|
|
9
|
+
export declare class GenericError extends BaseError {
|
|
10
|
+
constructor(message?: string);
|
|
11
|
+
}
|
|
12
|
+
export declare class UnknownFunctionError extends BaseError {
|
|
13
|
+
node: FunctionCallAST;
|
|
14
|
+
constructor(node: FunctionCallAST);
|
|
15
|
+
}
|
|
16
|
+
export declare class MissingArgumentError extends BaseError {
|
|
17
|
+
node: FunctionCallAST;
|
|
18
|
+
constructor(node: FunctionCallAST);
|
|
19
|
+
}
|
|
20
|
+
export declare class MissingParenthesisError extends BaseError {
|
|
21
|
+
node: FunctionCallAST;
|
|
22
|
+
constructor(node: FunctionCallAST);
|
|
23
|
+
}
|
|
24
|
+
export declare class UnknownTokenError extends BaseError {
|
|
25
|
+
node: UnknownAST;
|
|
26
|
+
constructor(node: UnknownAST);
|
|
27
|
+
}
|
|
28
|
+
export declare class NotAllowedExpressionError extends BaseError {
|
|
29
|
+
node: CommonAST;
|
|
30
|
+
constructor(node: CommonAST);
|
|
31
|
+
}
|
|
32
|
+
export declare class TooManyArgumentsError extends BaseError {
|
|
33
|
+
node: FunctionCallAST;
|
|
34
|
+
constructor(node: FunctionCallAST);
|
|
35
|
+
}
|
|
36
|
+
export declare class InvalidArgumentError extends BaseError {
|
|
37
|
+
node: FunctionCallAST;
|
|
38
|
+
constructor(node: FunctionCallAST, validatorResponse: ValidatorResponse);
|
|
39
|
+
}
|
|
40
|
+
export declare class UnknownExpressionError extends BaseError {
|
|
41
|
+
expression: CommonAST;
|
|
42
|
+
constructor(expression: CommonAST);
|
|
43
|
+
}
|