entangld 2.4.1 → 2.6.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/lib/Datastore.js +3 -2
- package/lib/Message.js +1 -1
- package/package.json +1 -4
- package/tags +0 -0
package/lib/Datastore.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { randomUUID: uuidv4 } = require("node:crypto");
|
|
2
2
|
const EventEmitter = require("events");
|
|
3
3
|
const uuid_regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
4
4
|
|
|
@@ -408,8 +408,9 @@ class Entangld extends EventEmitter {
|
|
|
408
408
|
* @throws {RPCError} if the rpc call experienced an error
|
|
409
409
|
* @return {Promise} promise resolving to return value of the rpc
|
|
410
410
|
*/
|
|
411
|
-
call_rpc(path, args=[]) {
|
|
411
|
+
async call_rpc(path, args=[]) {
|
|
412
412
|
return this.get(path,args).then((args) => {
|
|
413
|
+
if ( !Array.isArray(args) || args.length != 2) throw new EntangldError(`Endpoint is not configured for RPC: '${path}'`);
|
|
413
414
|
if (args[0] === false) throw RPCError.from_remote_error(args[1]);
|
|
414
415
|
if ( typeof(args[0]) == "string" ) return args[0];
|
|
415
416
|
return args[1];
|
package/lib/Message.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "entangld",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Synchronized key-value stores with RPCs and events",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"jshintConfig": {
|
|
@@ -34,8 +34,5 @@
|
|
|
34
34
|
"mocha": "^10.0.0",
|
|
35
35
|
"nodemon": "^2.0.16",
|
|
36
36
|
"sockhop": "^1.4.3"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"uuid": "^8.3.2"
|
|
40
37
|
}
|
|
41
38
|
}
|
package/tags
CHANGED
|
File without changes
|