weavedb-node-client 0.18.0 → 0.18.3
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 +1 -37
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -23,27 +23,6 @@ const packageDefinition = protoLoader.loadSync(PROTO_PATH, {
|
|
|
23
23
|
const weavedb_proto = grpc.loadPackageDefinition(packageDefinition).weavedb
|
|
24
24
|
let Arweave = require("arweave")
|
|
25
25
|
|
|
26
|
-
const reads = [
|
|
27
|
-
"get",
|
|
28
|
-
"cget",
|
|
29
|
-
"getIndexes",
|
|
30
|
-
"getCrons",
|
|
31
|
-
"getSchema",
|
|
32
|
-
"getRules",
|
|
33
|
-
"getIds",
|
|
34
|
-
"getOwner",
|
|
35
|
-
"getAddressLink",
|
|
36
|
-
"getAlgorithms",
|
|
37
|
-
"getLinkedContract",
|
|
38
|
-
"getEvolve",
|
|
39
|
-
"getVersion",
|
|
40
|
-
"getRelayerJob",
|
|
41
|
-
"listRelayerJobs",
|
|
42
|
-
"listCollections",
|
|
43
|
-
"getInfo",
|
|
44
|
-
,
|
|
45
|
-
]
|
|
46
|
-
|
|
47
26
|
class SDK extends Base {
|
|
48
27
|
constructor({
|
|
49
28
|
rpc,
|
|
@@ -107,17 +86,8 @@ class SDK extends Base {
|
|
|
107
86
|
if (!isNil(EthWallet)) this.setEthWallet(EthWallet)
|
|
108
87
|
}
|
|
109
88
|
|
|
110
|
-
parseQuery(func, query) {
|
|
111
|
-
let nocache = false
|
|
112
|
-
if (includes(func)(reads) && is(Boolean, last(query))) {
|
|
113
|
-
nocache = last(query)
|
|
114
|
-
query = init(query)
|
|
115
|
-
}
|
|
116
|
-
return { nocache, query }
|
|
117
|
-
}
|
|
118
|
-
|
|
119
89
|
async write(func, query, nocache, bundle, relay = false) {
|
|
120
|
-
if (!includes(func)(reads)) {
|
|
90
|
+
if (!includes(func)(this.reads)) {
|
|
121
91
|
nocache = false
|
|
122
92
|
if (relay) {
|
|
123
93
|
return query
|
|
@@ -159,12 +129,6 @@ class SDK extends Base {
|
|
|
159
129
|
return await this.write(params.function, query, nocache)
|
|
160
130
|
}
|
|
161
131
|
|
|
162
|
-
async readQuery(func, ...query) {
|
|
163
|
-
let nocache = false
|
|
164
|
-
;({ nocache, query } = this.parseQuery(func, query))
|
|
165
|
-
return await this.read({ function: func, query }, nocache)
|
|
166
|
-
}
|
|
167
|
-
|
|
168
132
|
async getNonce(addr) {
|
|
169
133
|
return this.readQuery("getNonce", addr, true)
|
|
170
134
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weavedb-node-client",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.3",
|
|
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.
|
|
14
|
+
"weavedb-base": "^0.18.2"
|
|
15
15
|
}
|
|
16
16
|
}
|