dbgate-filterparser 6.6.11 → 6.7.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/lib/filterTool.js CHANGED
@@ -16,6 +16,7 @@ function getDateStringWithoutTimeZone(dateString) {
16
16
  return dateString;
17
17
  }
18
18
  function getFilterValueExpression(value, dataType) {
19
+ var _a;
19
20
  if (value == null)
20
21
  return 'NULL';
21
22
  if ((0, dbgate_tools_1.isTypeDateTime)(dataType))
@@ -31,6 +32,9 @@ function getFilterValueExpression(value, dataType) {
31
32
  if (value.type == 'Buffer' && Array.isArray(value.data)) {
32
33
  return '0x' + (0, dbgate_tools_1.arrayToHexString)(value.data);
33
34
  }
35
+ if ((_a = value === null || value === void 0 ? void 0 : value.$binary) === null || _a === void 0 ? void 0 : _a.base64) {
36
+ return (0, dbgate_tools_1.base64ToHex)(value.$binary.base64);
37
+ }
34
38
  return `="${value}"`;
35
39
  }
36
40
  exports.getFilterValueExpression = getFilterValueExpression;
@@ -329,10 +329,7 @@ const createParser = (filterBehaviour) => {
329
329
  objectid: () => (0, common_1.token)(parsimmon_1.default.regexp(/ObjectId\(['"]?[0-9a-f]{24}['"]?\)/)).desc('ObjectId'),
330
330
  objectidstr: () => (0, common_1.token)(parsimmon_1.default.regexp(/[0-9a-f]{24}/)).desc('ObjectId string'),
331
331
  hexstring: () => (0, common_1.token)(parsimmon_1.default.regexp(/0x(([0-9a-fA-F][0-9a-fA-F])+)/, 1))
332
- .map(x => ({
333
- type: 'Buffer',
334
- data: (0, dbgate_tools_1.hexStringToArray)(x),
335
- }))
332
+ .map(x => ({ $binary: { base64: (0, dbgate_tools_1.hexToBase64)(x) } }))
336
333
  .desc('hex string'),
337
334
  noQuotedString: () => parsimmon_1.default.regexp(/[^\s^,^'^"]+/).desc('string unquoted'),
338
335
  sql: () => (0, common_1.token)(parsimmon_1.default.regexp(/\{(.*?)\}/, 1))
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "6.6.11",
2
+ "version": "6.7.0",
3
3
  "name": "dbgate-filterparser",
4
4
  "main": "lib/index.js",
5
5
  "typings": "lib/index.d.ts",
@@ -17,7 +17,7 @@
17
17
  "lib"
18
18
  ],
19
19
  "devDependencies": {
20
- "dbgate-types": "^6.6.11",
20
+ "dbgate-types": "^6.7.0",
21
21
  "@types/jest": "^25.1.4",
22
22
  "@types/node": "^13.7.0",
23
23
  "jest": "^28.1.3",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@types/parsimmon": "^1.10.1",
29
- "dbgate-tools": "^6.6.11",
29
+ "dbgate-tools": "^6.7.0",
30
30
  "lodash": "^4.17.21",
31
31
  "date-fns": "^4.1.0",
32
32
  "moment": "^2.24.0",