weavedb-node-client 0.19.4 → 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.
- package/index.js +11 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -89,14 +89,22 @@ class SDK extends Base {
|
|
|
89
89
|
async write(func, query, nocache, bundle, relay = false) {
|
|
90
90
|
if (!includes(func)(this.reads)) {
|
|
91
91
|
if (relay) return query
|
|
92
|
-
|
|
92
|
+
if (is(Boolean, nocache)) {
|
|
93
|
+
nocache = !nocache
|
|
94
|
+
} else if (is(Object, nocache)) {
|
|
95
|
+
query.dryWrite = nocache
|
|
96
|
+
nocache = false
|
|
97
|
+
query ||= {}
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
query ||= []
|
|
93
101
|
}
|
|
94
|
-
let params = query || []
|
|
95
102
|
const request = {
|
|
96
103
|
method: `${func}@${this.contractTxId}`,
|
|
97
|
-
query: JSON.stringify(
|
|
104
|
+
query: JSON.stringify(query),
|
|
98
105
|
nocache,
|
|
99
106
|
}
|
|
107
|
+
console.log(query)
|
|
100
108
|
const _query = () =>
|
|
101
109
|
new Promise(ret => {
|
|
102
110
|
this.client.query(request, (err, response) => {
|