@qrvey/formula-lang 0.5.1 → 0.6.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.
Files changed (118) hide show
  1. package/CHANGELOG.md +24 -2
  2. package/dist/cjs/constants/index.d.ts +0 -27
  3. package/dist/cjs/constants/index.js +1 -86
  4. package/dist/cjs/constants/index.js.map +1 -1
  5. package/dist/cjs/constants/interfaces.d.ts +4 -3
  6. package/dist/cjs/errors/analyzer/elasticsearch.d.ts +8 -0
  7. package/dist/cjs/errors/analyzer/elasticsearch.js +21 -0
  8. package/dist/cjs/errors/analyzer/elasticsearch.js.map +1 -0
  9. package/dist/cjs/errors/analyzer/index.d.ts +3 -0
  10. package/dist/cjs/errors/analyzer/index.js +31 -0
  11. package/dist/cjs/errors/analyzer/index.js.map +1 -0
  12. package/dist/cjs/errors/analyzer/redshift.d.ts +8 -0
  13. package/dist/cjs/errors/analyzer/redshift.js +21 -0
  14. package/dist/cjs/errors/analyzer/redshift.js.map +1 -0
  15. package/dist/cjs/errors/analyzer/snowflake.d.ts +8 -0
  16. package/dist/cjs/errors/analyzer/snowflake.js +25 -0
  17. package/dist/cjs/errors/analyzer/snowflake.js.map +1 -0
  18. package/dist/cjs/errors/definitions.d.ts +5 -2
  19. package/dist/cjs/errors/definitions.js +16 -11
  20. package/dist/cjs/errors/definitions.js.map +1 -1
  21. package/dist/cjs/errors/dictionary.d.ts +27 -0
  22. package/dist/cjs/errors/dictionary.js +89 -0
  23. package/dist/cjs/errors/dictionary.js.map +1 -0
  24. package/dist/cjs/errors/index.d.ts +1 -1
  25. package/dist/cjs/errors/index.js +1 -3
  26. package/dist/cjs/errors/index.js.map +1 -1
  27. package/dist/cjs/functions/datedif.js +2 -2
  28. package/dist/cjs/functions/datedif.js.map +1 -1
  29. package/dist/cjs/index.d.ts +1 -1
  30. package/dist/cjs/index.js +2 -1
  31. package/dist/cjs/index.js.map +1 -1
  32. package/dist/cjs/parser/json-parser.js +7 -3
  33. package/dist/cjs/parser/json-parser.js.map +1 -1
  34. package/dist/cjs/transpiler/formulaErrorList.d.ts +7 -0
  35. package/dist/cjs/transpiler/formulaErrorList.js +28 -0
  36. package/dist/cjs/transpiler/formulaErrorList.js.map +1 -0
  37. package/dist/cjs/transpiler/index.d.ts +9 -8
  38. package/dist/cjs/transpiler/index.js +35 -28
  39. package/dist/cjs/transpiler/index.js.map +1 -1
  40. package/dist/cjs/transpiler/validateFuncStructure.js +1 -1
  41. package/dist/cjs/transpiler/validateFuncStructure.js.map +1 -1
  42. package/dist/cjs/utils/isDateParam.js +2 -2
  43. package/dist/cjs/utils/isDateParam.js.map +1 -1
  44. package/dist/cjs/utils/isNumberParam.js +2 -2
  45. package/dist/cjs/utils/isNumberParam.js.map +1 -1
  46. package/dist/cjs/utils/isPositiveNumberParam.js +2 -2
  47. package/dist/cjs/utils/isPositiveNumberParam.js.map +1 -1
  48. package/dist/cjs/utils/isStringParam.js +2 -2
  49. package/dist/cjs/utils/isStringParam.js.map +1 -1
  50. package/dist/module/constants/index.d.ts +0 -27
  51. package/dist/module/constants/index.js +0 -85
  52. package/dist/module/constants/index.js.map +1 -1
  53. package/dist/module/constants/interfaces.d.ts +4 -3
  54. package/dist/module/errors/analyzer/elasticsearch.d.ts +8 -0
  55. package/dist/module/errors/analyzer/elasticsearch.js +17 -0
  56. package/dist/module/errors/analyzer/elasticsearch.js.map +1 -0
  57. package/dist/module/errors/analyzer/index.d.ts +3 -0
  58. package/dist/module/errors/analyzer/index.js +27 -0
  59. package/dist/module/errors/analyzer/index.js.map +1 -0
  60. package/dist/module/errors/analyzer/redshift.d.ts +8 -0
  61. package/dist/module/errors/analyzer/redshift.js +17 -0
  62. package/dist/module/errors/analyzer/redshift.js.map +1 -0
  63. package/dist/module/errors/analyzer/snowflake.d.ts +8 -0
  64. package/dist/module/errors/analyzer/snowflake.js +21 -0
  65. package/dist/module/errors/analyzer/snowflake.js.map +1 -0
  66. package/dist/module/errors/definitions.d.ts +5 -2
  67. package/dist/module/errors/definitions.js +7 -2
  68. package/dist/module/errors/definitions.js.map +1 -1
  69. package/dist/module/errors/dictionary.d.ts +27 -0
  70. package/dist/module/errors/dictionary.js +86 -0
  71. package/dist/module/errors/dictionary.js.map +1 -0
  72. package/dist/module/errors/index.d.ts +1 -1
  73. package/dist/module/errors/index.js +1 -3
  74. package/dist/module/errors/index.js.map +1 -1
  75. package/dist/module/functions/datedif.js +1 -1
  76. package/dist/module/functions/datedif.js.map +1 -1
  77. package/dist/module/index.d.ts +1 -1
  78. package/dist/module/index.js +1 -1
  79. package/dist/module/index.js.map +1 -1
  80. package/dist/module/parser/json-parser.js +7 -3
  81. package/dist/module/parser/json-parser.js.map +1 -1
  82. package/dist/module/transpiler/formulaErrorList.d.ts +7 -0
  83. package/dist/module/transpiler/formulaErrorList.js +24 -0
  84. package/dist/module/transpiler/formulaErrorList.js.map +1 -0
  85. package/dist/module/transpiler/index.d.ts +9 -8
  86. package/dist/module/transpiler/index.js +35 -28
  87. package/dist/module/transpiler/index.js.map +1 -1
  88. package/dist/module/transpiler/validateFuncStructure.js +1 -1
  89. package/dist/module/transpiler/validateFuncStructure.js.map +1 -1
  90. package/dist/module/utils/isDateParam.js +1 -1
  91. package/dist/module/utils/isDateParam.js.map +1 -1
  92. package/dist/module/utils/isNumberParam.js +1 -1
  93. package/dist/module/utils/isNumberParam.js.map +1 -1
  94. package/dist/module/utils/isPositiveNumberParam.js +1 -1
  95. package/dist/module/utils/isPositiveNumberParam.js.map +1 -1
  96. package/dist/module/utils/isStringParam.js +1 -1
  97. package/dist/module/utils/isStringParam.js.map +1 -1
  98. package/package.json +3 -2
  99. package/.vscode/launch.json +0 -15
  100. package/dist/cjs/errors/elasticsearch.d.ts +0 -24
  101. package/dist/cjs/errors/elasticsearch.js +0 -30
  102. package/dist/cjs/errors/elasticsearch.js.map +0 -1
  103. package/dist/cjs/errors/engineErrors.d.ts +0 -2
  104. package/dist/cjs/errors/engineErrors.js +0 -25
  105. package/dist/cjs/errors/engineErrors.js.map +0 -1
  106. package/dist/cjs/errors/snowflake.d.ts +0 -15
  107. package/dist/cjs/errors/snowflake.js +0 -20
  108. package/dist/cjs/errors/snowflake.js.map +0 -1
  109. package/dist/module/errors/elasticsearch.d.ts +0 -24
  110. package/dist/module/errors/elasticsearch.js +0 -27
  111. package/dist/module/errors/elasticsearch.js.map +0 -1
  112. package/dist/module/errors/engineErrors.d.ts +0 -2
  113. package/dist/module/errors/engineErrors.js +0 -21
  114. package/dist/module/errors/engineErrors.js.map +0 -1
  115. package/dist/module/errors/snowflake.d.ts +0 -15
  116. package/dist/module/errors/snowflake.js +0 -17
  117. package/dist/module/errors/snowflake.js.map +0 -1
  118. package/jest.config.ts +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"isDateParam.js","sourceRoot":"","sources":["../../../src/utils/isDateParam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG5D,MAAM,UAAU,WAAW,CACvB,MAAW,EACX,QAA4B;IAE5B,MAAM,KAAK,GAAG,QAAQ,KAAK,MAAM,CAAC;IAClC,IAAI,CAAC,KAAK;QAAE,uBAAS,KAAK,IAAK,gBAAgB,CAAC,UAAU,CAAC,WAAW,CAAC,EAAG;IAC1E,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"isDateParam.js","sourceRoot":"","sources":["../../../src/utils/isDateParam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGpE,MAAM,UAAU,WAAW,CACvB,MAAW,EACX,QAA4B;IAE5B,MAAM,KAAK,GAAG,QAAQ,KAAK,MAAM,CAAC;IAClC,IAAI,CAAC,KAAK;QAAE,uBAAS,KAAK,IAAK,gBAAgB,CAAC,UAAU,CAAC,WAAW,CAAC,EAAG;IAC1E,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ERROR_LIST, ERROR_DICTIONARY } from '../constants';
1
+ import { ERROR_LIST, ERROR_DICTIONARY } from '../errors/dictionary';
2
2
  export function isNumberParam(param) {
3
3
  const valid = typeof param === 'number';
4
4
  if (!valid)
@@ -1 +1 @@
1
- {"version":3,"file":"isNumberParam.js","sourceRoot":"","sources":["../../../src/utils/isNumberParam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG5D,MAAM,UAAU,aAAa,CAAC,KAAU;IACpC,MAAM,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC;IACxC,IAAI,CAAC,KAAK;QAAE,uBAAS,KAAK,IAAK,gBAAgB,CAAC,UAAU,CAAC,aAAa,CAAC,EAAG;IAC5E,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"isNumberParam.js","sourceRoot":"","sources":["../../../src/utils/isNumberParam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGpE,MAAM,UAAU,aAAa,CAAC,KAAU;IACpC,MAAM,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC;IACxC,IAAI,CAAC,KAAK;QAAE,uBAAS,KAAK,IAAK,gBAAgB,CAAC,UAAU,CAAC,aAAa,CAAC,EAAG;IAC5E,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ERROR_LIST, ERROR_DICTIONARY } from '../constants';
1
+ import { ERROR_LIST, ERROR_DICTIONARY } from '../errors/dictionary';
2
2
  export function isPositiveNumberParam(param) {
3
3
  const valid = param >= 0;
4
4
  if (!valid)
@@ -1 +1 @@
1
- {"version":3,"file":"isPositiveNumberParam.js","sourceRoot":"","sources":["../../../src/utils/isPositiveNumberParam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG5D,MAAM,UAAU,qBAAqB,CAAC,KAAU;IAC5C,MAAM,KAAK,GAAG,KAAK,IAAI,CAAC,CAAC;IACzB,IAAI,CAAC,KAAK;QACN,uBAAS,KAAK,IAAK,gBAAgB,CAAC,UAAU,CAAC,eAAe,CAAC,EAAG;IACtE,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"isPositiveNumberParam.js","sourceRoot":"","sources":["../../../src/utils/isPositiveNumberParam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGpE,MAAM,UAAU,qBAAqB,CAAC,KAAU;IAC5C,MAAM,KAAK,GAAG,KAAK,IAAI,CAAC,CAAC;IACzB,IAAI,CAAC,KAAK;QACN,uBAAS,KAAK,IAAK,gBAAgB,CAAC,UAAU,CAAC,eAAe,CAAC,EAAG;IACtE,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ERROR_LIST, ERROR_DICTIONARY } from '../constants';
1
+ import { ERROR_LIST, ERROR_DICTIONARY } from '../errors/dictionary';
2
2
  export function isStringParam(param) {
3
3
  const valid = typeof param === 'string';
4
4
  if (!valid)
@@ -1 +1 @@
1
- {"version":3,"file":"isStringParam.js","sourceRoot":"","sources":["../../../src/utils/isStringParam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG5D,MAAM,UAAU,aAAa,CAAC,KAAU;IACpC,MAAM,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC;IACxC,IAAI,CAAC,KAAK;QAAE,uBAAS,KAAK,IAAK,gBAAgB,CAAC,UAAU,CAAC,aAAa,CAAC,EAAG;IAC5E,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"isStringParam.js","sourceRoot":"","sources":["../../../src/utils/isStringParam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGpE,MAAM,UAAU,aAAa,CAAC,KAAU;IACpC,MAAM,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC;IACxC,IAAI,CAAC,KAAK;QAAE,uBAAS,KAAK,IAAK,gBAAgB,CAAC,UAAU,CAAC,aAAa,CAAC,EAAG;IAC5E,OAAO,EAAE,KAAK,EAAE,CAAC;AACrB,CAAC"}
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@qrvey/formula-lang",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "QFormula support for qrvey projects",
5
5
  "types": "dist/module/index.d.ts",
6
+ "main": "dist/module/index.js",
6
7
  "exports": {
7
8
  ".": {
8
9
  "import": "./dist/module/index.js",
@@ -12,7 +13,7 @@
12
13
  "scripts": {
13
14
  "test": "jest __tests__",
14
15
  "test:coverage": "jest __tests__ --collect-coverage",
15
- "build": "tsc && tsc -m commonjs --outDir dist/cjs",
16
+ "build": "rm -rf dist && tsc && tsc -m commonjs --outDir dist/cjs",
16
17
  "build:watch": "tsc -w",
17
18
  "debug:bundle": "webpack",
18
19
  "debug:watch": "webpack --watch",
@@ -1,15 +0,0 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "type": "chrome",
9
- "request": "launch",
10
- "name": "Launch Chrome against localhost",
11
- "url": "http://localhost:3553",
12
- "webRoot": "${workspaceFolder}"
13
- }
14
- ]
15
- }
@@ -1,24 +0,0 @@
1
- import { ERROR_LIST } from '../constants';
2
- export declare const errorRegex: ({
3
- unknownFunction: {
4
- regex: RegExp;
5
- value: ERROR_LIST;
6
- };
7
- missingArguments: {
8
- regex: RegExp;
9
- value: ERROR_LIST;
10
- };
11
- } | {
12
- arguments: {
13
- regex: RegExp;
14
- value: ERROR_LIST;
15
- };
16
- state: {
17
- regex: RegExp;
18
- value: ERROR_LIST;
19
- };
20
- null_pointer: {
21
- regex: RegExp;
22
- value: ERROR_LIST;
23
- };
24
- })[];
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.errorRegex = void 0;
4
- const constants_1 = require("../constants");
5
- const reasonsRegex = {
6
- unknownFunction: {
7
- regex: /Unknown call \[.*\] with/,
8
- value: constants_1.ERROR_LIST.unknownFunction,
9
- },
10
- missingArguments: {
11
- regex: /static method \[.*\] not found/,
12
- value: constants_1.ERROR_LIST.arguments,
13
- },
14
- };
15
- const typesRegex = {
16
- arguments: {
17
- regex: /illegal_argument_exception/,
18
- value: constants_1.ERROR_LIST.arguments,
19
- },
20
- state: {
21
- regex: /illegal_state_exception/,
22
- value: constants_1.ERROR_LIST.nulls,
23
- },
24
- null_pointer: {
25
- regex: /null_pointer_exception/,
26
- value: constants_1.ERROR_LIST.nulls,
27
- },
28
- };
29
- exports.errorRegex = [reasonsRegex, typesRegex];
30
- //# sourceMappingURL=elasticsearch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"elasticsearch.js","sourceRoot":"","sources":["../../../src/errors/elasticsearch.ts"],"names":[],"mappings":";;;AAAA,4CAA0C;AAE1C,MAAM,YAAY,GAAG;IACjB,eAAe,EAAE;QACb,KAAK,EAAE,0BAA0B;QACjC,KAAK,EAAE,sBAAU,CAAC,eAAe;KACpC;IACD,gBAAgB,EAAE;QACd,KAAK,EAAE,gCAAgC;QACvC,KAAK,EAAE,sBAAU,CAAC,SAAS;KAC9B;CACJ,CAAC;AAEF,MAAM,UAAU,GAAG;IACf,SAAS,EAAE;QACP,KAAK,EAAE,4BAA4B;QACnC,KAAK,EAAE,sBAAU,CAAC,SAAS;KAC9B;IACD,KAAK,EAAE;QACH,KAAK,EAAE,yBAAyB;QAChC,KAAK,EAAE,sBAAU,CAAC,KAAK;KAC1B;IACD,YAAY,EAAE;QACV,KAAK,EAAE,wBAAwB;QAC/B,KAAK,EAAE,sBAAU,CAAC,KAAK;KAC1B;CACJ,CAAC;AAEW,QAAA,UAAU,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { ValidatorResponse } from '../constants/interfaces';
2
- export declare function engineErrors(messages: Array<string>, regexs: Array<object>): ValidatorResponse;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.engineErrors = void 0;
4
- const constants_1 = require("../constants");
5
- function engineErrors(messages, regexs) {
6
- const loopParams = (obj, str) => {
7
- for (const key in obj) {
8
- const regex = new RegExp(obj[key].regex, 'g');
9
- if (regex.test(str)) {
10
- return obj[key].value;
11
- }
12
- }
13
- };
14
- let value;
15
- messages.forEach((message) => {
16
- regexs.forEach((regex) => {
17
- value = loopParams(regex, message);
18
- });
19
- });
20
- if (!value)
21
- value = constants_1.ERROR_LIST.unknown;
22
- return Object.assign({ valid: false }, constants_1.ERROR_DICTIONARY[value]);
23
- }
24
- exports.engineErrors = engineErrors;
25
- //# sourceMappingURL=engineErrors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"engineErrors.js","sourceRoot":"","sources":["../../../src/errors/engineErrors.ts"],"names":[],"mappings":";;;AAAA,4CAA4D;AAG5D,SAAgB,YAAY,CACxB,QAAuB,EACvB,MAAqB;IAErB,MAAM,UAAU,GAAG,CAAC,GAAQ,EAAE,GAAW,EAAE,EAAE;QACzC,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;YACnB,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC9C,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACjB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;aACzB;SACJ;IACL,CAAC,CAAC;IAEF,IAAI,KAAK,CAAC;IACV,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACzB,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACrB,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,KAAK;QAAE,KAAK,GAAG,sBAAU,CAAC,OAAO,CAAC;IACvC,uBAAS,KAAK,EAAE,KAAK,IAAK,4BAAgB,CAAC,KAAK,CAAC,EAAG;AACxD,CAAC;AArBD,oCAqBC"}
@@ -1,15 +0,0 @@
1
- import { ERROR_LIST } from '../constants';
2
- export declare const errorRegex: {
3
- missingArguments: {
4
- regex: RegExp;
5
- value: ERROR_LIST;
6
- };
7
- floatingPoint: {
8
- regex: RegExp;
9
- value: ERROR_LIST;
10
- };
11
- unknownFunction: {
12
- regex: RegExp;
13
- value: ERROR_LIST;
14
- };
15
- }[];
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.errorRegex = void 0;
4
- const constants_1 = require("../constants");
5
- const reasonsRegex = {
6
- missingArguments: {
7
- regex: /not enough arguments for function/,
8
- value: constants_1.ERROR_LIST.arguments,
9
- },
10
- floatingPoint: {
11
- regex: /Invalid floating point operation/,
12
- value: constants_1.ERROR_LIST.floatingPoint,
13
- },
14
- unknownFunction: {
15
- regex: /Unknown function/,
16
- value: constants_1.ERROR_LIST.unknownFunction,
17
- },
18
- };
19
- exports.errorRegex = [reasonsRegex];
20
- //# sourceMappingURL=snowflake.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snowflake.js","sourceRoot":"","sources":["../../../src/errors/snowflake.ts"],"names":[],"mappings":";;;AAAA,4CAA0C;AAE1C,MAAM,YAAY,GAAG;IACjB,gBAAgB,EAAE;QACd,KAAK,EAAE,mCAAmC;QAC1C,KAAK,EAAE,sBAAU,CAAC,SAAS;KAC9B;IACD,aAAa,EAAE;QACX,KAAK,EAAE,kCAAkC;QACzC,KAAK,EAAE,sBAAU,CAAC,aAAa;KAClC;IACD,eAAe,EAAE;QACb,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,sBAAU,CAAC,eAAe;KACpC;CACJ,CAAC;AAEW,QAAA,UAAU,GAAG,CAAC,YAAY,CAAC,CAAC"}
@@ -1,24 +0,0 @@
1
- import { ERROR_LIST } from '../constants';
2
- export declare const errorRegex: ({
3
- unknownFunction: {
4
- regex: RegExp;
5
- value: ERROR_LIST;
6
- };
7
- missingArguments: {
8
- regex: RegExp;
9
- value: ERROR_LIST;
10
- };
11
- } | {
12
- arguments: {
13
- regex: RegExp;
14
- value: ERROR_LIST;
15
- };
16
- state: {
17
- regex: RegExp;
18
- value: ERROR_LIST;
19
- };
20
- null_pointer: {
21
- regex: RegExp;
22
- value: ERROR_LIST;
23
- };
24
- })[];
@@ -1,27 +0,0 @@
1
- import { ERROR_LIST } from '../constants';
2
- const reasonsRegex = {
3
- unknownFunction: {
4
- regex: /Unknown call \[.*\] with/,
5
- value: ERROR_LIST.unknownFunction,
6
- },
7
- missingArguments: {
8
- regex: /static method \[.*\] not found/,
9
- value: ERROR_LIST.arguments,
10
- },
11
- };
12
- const typesRegex = {
13
- arguments: {
14
- regex: /illegal_argument_exception/,
15
- value: ERROR_LIST.arguments,
16
- },
17
- state: {
18
- regex: /illegal_state_exception/,
19
- value: ERROR_LIST.nulls,
20
- },
21
- null_pointer: {
22
- regex: /null_pointer_exception/,
23
- value: ERROR_LIST.nulls,
24
- },
25
- };
26
- export const errorRegex = [reasonsRegex, typesRegex];
27
- //# sourceMappingURL=elasticsearch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"elasticsearch.js","sourceRoot":"","sources":["../../../src/errors/elasticsearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,YAAY,GAAG;IACjB,eAAe,EAAE;QACb,KAAK,EAAE,0BAA0B;QACjC,KAAK,EAAE,UAAU,CAAC,eAAe;KACpC;IACD,gBAAgB,EAAE;QACd,KAAK,EAAE,gCAAgC;QACvC,KAAK,EAAE,UAAU,CAAC,SAAS;KAC9B;CACJ,CAAC;AAEF,MAAM,UAAU,GAAG;IACf,SAAS,EAAE;QACP,KAAK,EAAE,4BAA4B;QACnC,KAAK,EAAE,UAAU,CAAC,SAAS;KAC9B;IACD,KAAK,EAAE;QACH,KAAK,EAAE,yBAAyB;QAChC,KAAK,EAAE,UAAU,CAAC,KAAK;KAC1B;IACD,YAAY,EAAE;QACV,KAAK,EAAE,wBAAwB;QAC/B,KAAK,EAAE,UAAU,CAAC,KAAK;KAC1B;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- import { ValidatorResponse } from '../constants/interfaces';
2
- export declare function engineErrors(messages: Array<string>, regexs: Array<object>): ValidatorResponse;
@@ -1,21 +0,0 @@
1
- import { ERROR_LIST, ERROR_DICTIONARY } from '../constants';
2
- export function engineErrors(messages, regexs) {
3
- const loopParams = (obj, str) => {
4
- for (const key in obj) {
5
- const regex = new RegExp(obj[key].regex, 'g');
6
- if (regex.test(str)) {
7
- return obj[key].value;
8
- }
9
- }
10
- };
11
- let value;
12
- messages.forEach((message) => {
13
- regexs.forEach((regex) => {
14
- value = loopParams(regex, message);
15
- });
16
- });
17
- if (!value)
18
- value = ERROR_LIST.unknown;
19
- return Object.assign({ valid: false }, ERROR_DICTIONARY[value]);
20
- }
21
- //# sourceMappingURL=engineErrors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"engineErrors.js","sourceRoot":"","sources":["../../../src/errors/engineErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG5D,MAAM,UAAU,YAAY,CACxB,QAAuB,EACvB,MAAqB;IAErB,MAAM,UAAU,GAAG,CAAC,GAAQ,EAAE,GAAW,EAAE,EAAE;QACzC,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;YACnB,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC9C,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACjB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;aACzB;SACJ;IACL,CAAC,CAAC;IAEF,IAAI,KAAK,CAAC;IACV,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QACzB,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACrB,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,KAAK;QAAE,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC;IACvC,uBAAS,KAAK,EAAE,KAAK,IAAK,gBAAgB,CAAC,KAAK,CAAC,EAAG;AACxD,CAAC"}
@@ -1,15 +0,0 @@
1
- import { ERROR_LIST } from '../constants';
2
- export declare const errorRegex: {
3
- missingArguments: {
4
- regex: RegExp;
5
- value: ERROR_LIST;
6
- };
7
- floatingPoint: {
8
- regex: RegExp;
9
- value: ERROR_LIST;
10
- };
11
- unknownFunction: {
12
- regex: RegExp;
13
- value: ERROR_LIST;
14
- };
15
- }[];
@@ -1,17 +0,0 @@
1
- import { ERROR_LIST } from '../constants';
2
- const reasonsRegex = {
3
- missingArguments: {
4
- regex: /not enough arguments for function/,
5
- value: ERROR_LIST.arguments,
6
- },
7
- floatingPoint: {
8
- regex: /Invalid floating point operation/,
9
- value: ERROR_LIST.floatingPoint,
10
- },
11
- unknownFunction: {
12
- regex: /Unknown function/,
13
- value: ERROR_LIST.unknownFunction,
14
- },
15
- };
16
- export const errorRegex = [reasonsRegex];
17
- //# sourceMappingURL=snowflake.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"snowflake.js","sourceRoot":"","sources":["../../../src/errors/snowflake.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,YAAY,GAAG;IACjB,gBAAgB,EAAE;QACd,KAAK,EAAE,mCAAmC;QAC1C,KAAK,EAAE,UAAU,CAAC,SAAS;KAC9B;IACD,aAAa,EAAE;QACX,KAAK,EAAE,kCAAkC;QACzC,KAAK,EAAE,UAAU,CAAC,aAAa;KAClC;IACD,eAAe,EAAE;QACb,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,UAAU,CAAC,eAAe;KACpC;CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,YAAY,CAAC,CAAC"}
package/jest.config.ts DELETED
@@ -1,6 +0,0 @@
1
- export default {
2
- preset: 'ts-jest',
3
- testEnvironment: 'node',
4
- transform: { '^.+\\.lang.js$': 'ts-jest' },
5
- testPathIgnorePatterns: ['/__mocks__/'],
6
- };