weavedb-node-client 0.19.3 → 0.20.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 (2) hide show
  1. package/index.js +11 -4
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -88,16 +88,23 @@ class SDK extends Base {
88
88
 
89
89
  async write(func, query, nocache, bundle, relay = false) {
90
90
  if (!includes(func)(this.reads)) {
91
- nocache = false
92
- if (relay) {
93
- return query
91
+ if (relay) return query
92
+ if (is(Boolean, nocache)) {
93
+ nocache = !nocache
94
+ } else if (is(Object, nocache)) {
95
+ query.dryWrite = nocache
96
+ nocache = false
97
+ query ||= {}
94
98
  }
99
+ } else {
100
+ query ||= []
95
101
  }
96
102
  const request = {
97
103
  method: `${func}@${this.contractTxId}`,
98
- query: JSON.stringify(isNil(query) ? "" : query),
104
+ query: JSON.stringify(query),
99
105
  nocache,
100
106
  }
107
+ console.log(query)
101
108
  const _query = () =>
102
109
  new Promise(ret => {
103
110
  this.client.query(request, (err, response) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weavedb-node-client",
3
- "version": "0.19.3",
3
+ "version": "0.20.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -11,6 +11,6 @@
11
11
  "@grpc/proto-loader": "^0.5.0",
12
12
  "arweave": "^1.12.2",
13
13
  "ramda": "^0.28.0",
14
- "weavedb-base": "^0.18.5"
14
+ "weavedb-base": "^0.18.6"
15
15
  }
16
16
  }