@ocap/indexdb-elasticsearch 1.18.96 → 1.18.98

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/db.js CHANGED
@@ -109,6 +109,7 @@ class ESIndexDB extends BaseIndexDB {
109
109
  txFilter = {},
110
110
  rollupFilter = {},
111
111
  stakeFilter = {},
112
+ delegationFilter = {},
112
113
  } = {}) {
113
114
  const pagination = formatPagination({ paging, defaultSortField: 'time' });
114
115
 
@@ -121,6 +122,7 @@ class ESIndexDB extends BaseIndexDB {
121
122
  const { txs = [] } = txFilter;
122
123
  const { rollups = [] } = rollupFilter;
123
124
  const { stakes = [] } = stakeFilter;
125
+ const { delegations = [] } = delegationFilter;
124
126
 
125
127
  // OR is spelled should
126
128
  // AND is spelled must
@@ -189,6 +191,10 @@ class ESIndexDB extends BaseIndexDB {
189
191
  conditions.push({ terms: { stakes } });
190
192
  }
191
193
 
194
+ if (delegations.length) {
195
+ conditions.push({ terms: { delegations } });
196
+ }
197
+
192
198
  const condition = getTimeCondition(timeFilter, ['time'], 'time');
193
199
  if (condition) {
194
200
  conditions.push(condition);
package/lib/model/tx.js CHANGED
@@ -88,6 +88,7 @@ module.exports = () => ({
88
88
  receiver: { type: 'keyword' },
89
89
  stakes: { type: 'keyword' },
90
90
  rollups: { type: 'keyword' },
91
+ delegations: { type: 'keyword' },
91
92
  },
92
93
  },
93
94
  settings: {
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.18.96",
4
+ "version": "1.18.98",
5
5
  "author": "wangshijun <shijun@arcblock.io> (https://www.arcblock.io)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/ArcBlock/blockchain/issues",
@@ -38,12 +38,12 @@
38
38
  "test": "jest --forceExit --detectOpenHandles",
39
39
  "coverage": "npm run test -- --coverage"
40
40
  },
41
- "gitHead": "aa29013a8114a39db09e0e787ab1e1bd94fcb453",
41
+ "gitHead": "41138be9ecae27624397a8b5ee270e2101944560",
42
42
  "dependencies": {
43
- "@arcblock/did": "1.18.96",
43
+ "@arcblock/did": "1.18.98",
44
44
  "@elastic/elasticsearch": "7.13.0",
45
- "@ocap/indexdb": "1.18.96",
46
- "@ocap/util": "1.18.96",
45
+ "@ocap/indexdb": "1.18.98",
46
+ "@ocap/util": "1.18.98",
47
47
  "axios": "^0.27.2",
48
48
  "bn.js": "^5.2.1",
49
49
  "debug": "^4.3.4",