@ocap/indexdb-elasticsearch 1.13.12 → 1.13.16

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 (2) hide show
  1. package/lib/db.js +6 -0
  2. package/package.json +4 -4
package/lib/db.js CHANGED
@@ -96,6 +96,7 @@ class ESIndexDB extends BaseIndexDB {
96
96
  tokenFilter = {},
97
97
  accountFilter = {},
98
98
  validityFilter = {},
99
+ txFilter = {},
99
100
  } = {}) {
100
101
  const pagination = formatPagination({ paging, defaultSortField: 'time' });
101
102
 
@@ -105,6 +106,7 @@ class ESIndexDB extends BaseIndexDB {
105
106
  const { assets = [] } = assetFilter;
106
107
  const { tokens = [] } = tokenFilter;
107
108
  const { accounts = [] } = accountFilter;
109
+ const { txs = [] } = txFilter;
108
110
  let { startDateTime, endDateTime } = timeFilter;
109
111
  startDateTime = parseDateTime(startDateTime);
110
112
  endDateTime = parseDateTime(endDateTime);
@@ -164,6 +166,10 @@ class ESIndexDB extends BaseIndexDB {
164
166
  conditions.push({ terms: { accounts } });
165
167
  }
166
168
 
169
+ if (txs.length) {
170
+ conditions.push({ terms: { hash: txs } });
171
+ }
172
+
167
173
  if (startDateTime && endDateTime) {
168
174
  conditions.push({ range: { time: { gt: startDateTime, lte: endDateTime } } });
169
175
  } else if (startDateTime) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ocap/indexdb-elasticsearch",
3
3
  "description": "OCAP indexdb adapter that uses elasticsearch as backend",
4
- "version": "1.13.12",
4
+ "version": "1.13.16",
5
5
  "author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/ArcBlock/asset-chain/issues",
@@ -38,11 +38,11 @@
38
38
  "test": "node tools/jest.js",
39
39
  "coverage": "npm run test -- --coverage"
40
40
  },
41
- "gitHead": "64135c8f8f7edc1180e0604a4501a9504bcbe4d0",
41
+ "gitHead": "7b5bdaf7b0404fa5d59c4160ab986e2dc6c565a3",
42
42
  "dependencies": {
43
43
  "@elastic/elasticsearch": "^7.10.0",
44
- "@ocap/indexdb": "1.13.12",
45
- "@ocap/util": "1.13.12",
44
+ "@ocap/indexdb": "1.13.16",
45
+ "@ocap/util": "1.13.16",
46
46
  "axios": "^0.21.4",
47
47
  "bn.js": "^5.2.0",
48
48
  "debug": "^4.3.2",