@imqueue/rpc 1.16.0 → 1.17.1
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/package.json +17 -17
- package/src/IMQClient.d.ts +0 -1
- package/src/IMQClient.js +3 -3
- package/src/IMQLock.js +8 -1
- package/src/IMQRPCError.js +2 -2
- package/src/IMQService.js +2 -2
- package/src/cache/RedisCache.d.ts +9 -9
- package/src/decorators/expose.js +1 -2
- package/src/decorators/indexed.js +1 -2
- package/src/decorators/lock.js +1 -2
- package/src/decorators/logged.js +1 -2
- package/src/decorators/property.js +1 -2
- package/src/decorators/remote.js +1 -2
- package/src/helpers/fs.js +3 -4
- package/src/helpers/os-uuid.js +1 -2
- package/src/helpers/pid.js +3 -3
- package/src/helpers/signature.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imqueue/rpc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.1",
|
|
4
4
|
"description": "RPC-like client-service implementation over messaging queue",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"redis",
|
|
@@ -38,32 +38,32 @@
|
|
|
38
38
|
"author": "imqueue.com <support@imqueue.com> (https://imqueue.com)",
|
|
39
39
|
"license": "ISC",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@imqueue/core": "^1.
|
|
42
|
-
"@types/node": "^
|
|
43
|
-
"acorn": "^8.
|
|
41
|
+
"@imqueue/core": "^1.15.0",
|
|
42
|
+
"@types/node": "^22.9.0",
|
|
43
|
+
"acorn": "^8.14.0",
|
|
44
44
|
"farmhash": "^4.0.1",
|
|
45
45
|
"node-machine-id": "^1.1.12",
|
|
46
|
-
"reflect-metadata": "^0.
|
|
47
|
-
"typescript": "^5.
|
|
46
|
+
"reflect-metadata": "^0.2.2",
|
|
47
|
+
"typescript": "^5.6.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@types/chai": "^
|
|
51
|
-
"@types/mocha": "^10.0.
|
|
52
|
-
"@types/mock-require": "^
|
|
53
|
-
"@types/sinon": "^17.0.
|
|
50
|
+
"@types/chai": "^5.0.1",
|
|
51
|
+
"@types/mocha": "^10.0.9",
|
|
52
|
+
"@types/mock-require": "^3.0.0",
|
|
53
|
+
"@types/sinon": "^17.0.3",
|
|
54
54
|
"chai": "^4.3.10",
|
|
55
55
|
"codeclimate-test-reporter": "^0.5.1",
|
|
56
|
-
"coveralls": "^
|
|
56
|
+
"coveralls-next": "^4.2.1",
|
|
57
57
|
"minimist": "^1.2.8",
|
|
58
|
-
"mocha": "^10.2
|
|
58
|
+
"mocha": "^10.8.2",
|
|
59
59
|
"mocha-lcov-reporter": "^1.3.0",
|
|
60
60
|
"mock-require": "^3.0.3",
|
|
61
|
-
"nyc": "^
|
|
62
|
-
"open": "^
|
|
63
|
-
"sinon": "^
|
|
61
|
+
"nyc": "^17.1.0",
|
|
62
|
+
"open": "^10.1.0",
|
|
63
|
+
"sinon": "^19.0.2",
|
|
64
64
|
"source-map-support": "^0.5.21",
|
|
65
|
-
"ts-node": "^10.9.
|
|
66
|
-
"typedoc": "^0.
|
|
65
|
+
"ts-node": "^10.9.2",
|
|
66
|
+
"typedoc": "^0.26.11"
|
|
67
67
|
},
|
|
68
68
|
"main": "index.js",
|
|
69
69
|
"typescript": {
|
package/src/IMQClient.d.ts
CHANGED
package/src/IMQClient.js
CHANGED
|
@@ -9,7 +9,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.IMQClient = void 0;
|
|
13
|
+
exports.imqCallResolver = imqCallResolver;
|
|
14
|
+
exports.imqCallRejector = imqCallRejector;
|
|
13
15
|
/*!
|
|
14
16
|
* IMQClient implementation
|
|
15
17
|
*
|
|
@@ -250,7 +252,6 @@ function imqCallResolver(resolve, req, client) {
|
|
|
250
252
|
}
|
|
251
253
|
};
|
|
252
254
|
}
|
|
253
|
-
exports.imqCallResolver = imqCallResolver;
|
|
254
255
|
/**
|
|
255
256
|
* Builds and returns call rejector, which supports after call optional hook
|
|
256
257
|
*
|
|
@@ -274,7 +275,6 @@ function imqCallRejector(reject, req, client) {
|
|
|
274
275
|
}
|
|
275
276
|
};
|
|
276
277
|
}
|
|
277
|
-
exports.imqCallRejector = imqCallRejector;
|
|
278
278
|
/**
|
|
279
279
|
* Class GeneratorClient - generator helper class implementation
|
|
280
280
|
* @access private
|
package/src/IMQLock.js
CHANGED
|
@@ -80,7 +80,14 @@ class IMQLock {
|
|
|
80
80
|
if (IMQLock.deadlockTimeout) {
|
|
81
81
|
// avoid dead-locks using timeouts
|
|
82
82
|
timer = setTimeout(() => {
|
|
83
|
-
|
|
83
|
+
let dumpStr = '';
|
|
84
|
+
try {
|
|
85
|
+
dumpStr = JSON.stringify(IMQLock.metadata[key]);
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
dumpStr = 'Unable to stringify metadata';
|
|
89
|
+
}
|
|
90
|
+
const err = new Error(`Lock timeout, "${key}" call rejected, metadata: ${dumpStr}`);
|
|
84
91
|
clearTimeout(timer);
|
|
85
92
|
timer = null;
|
|
86
93
|
IMQLock.release(key, null, err);
|
package/src/IMQRPCError.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AFTER_HOOK_ERROR = exports.BEFORE_HOOK_ERROR = void 0;
|
|
4
|
+
exports.IMQError = IMQError;
|
|
4
5
|
exports.BEFORE_HOOK_ERROR = 'Before call hook error:';
|
|
5
6
|
exports.AFTER_HOOK_ERROR = 'After call hook error:';
|
|
6
7
|
// istanbul ignore next
|
|
@@ -32,5 +33,4 @@ function IMQError(code, message, stack, method, args, original) {
|
|
|
32
33
|
})(),
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
exports.IMQError = IMQError;
|
|
36
36
|
//# sourceMappingURL=IMQRPCError.js.map
|
package/src/IMQService.js
CHANGED
|
@@ -9,7 +9,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.IMQService = exports.Description = void 0;
|
|
13
|
+
exports.send = send;
|
|
13
14
|
/*!
|
|
14
15
|
* IMQService implementation
|
|
15
16
|
*
|
|
@@ -270,5 +271,4 @@ async function send(request, response, service) {
|
|
|
270
271
|
}
|
|
271
272
|
return id;
|
|
272
273
|
}
|
|
273
|
-
exports.send = send;
|
|
274
274
|
//# sourceMappingURL=IMQService.js.map
|
|
@@ -24,18 +24,18 @@ export declare const DEFAULT_REDIS_CACHE_OPTIONS: {
|
|
|
24
24
|
prefix: string;
|
|
25
25
|
cleanup: boolean;
|
|
26
26
|
cleanupFilter: string;
|
|
27
|
-
host?: string
|
|
28
|
-
port?: number
|
|
29
|
-
vendor?: string
|
|
30
|
-
logger?: ILogger
|
|
31
|
-
watcherCheckDelay?: number
|
|
32
|
-
useGzip?: boolean
|
|
33
|
-
safeDelivery?: boolean
|
|
34
|
-
safeDeliveryTtl?: number
|
|
27
|
+
host?: string;
|
|
28
|
+
port?: number;
|
|
29
|
+
vendor?: string;
|
|
30
|
+
logger?: ILogger;
|
|
31
|
+
watcherCheckDelay?: number;
|
|
32
|
+
useGzip?: boolean;
|
|
33
|
+
safeDelivery?: boolean;
|
|
34
|
+
safeDeliveryTtl?: number;
|
|
35
35
|
cluster?: {
|
|
36
36
|
host: string;
|
|
37
37
|
port: number;
|
|
38
|
-
}[]
|
|
38
|
+
}[];
|
|
39
39
|
};
|
|
40
40
|
export declare const REDIS_CLIENT_INIT_ERROR = "Redis client is not initialized!";
|
|
41
41
|
/**
|
package/src/decorators/expose.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.expose =
|
|
3
|
+
exports.expose = expose;
|
|
4
4
|
/*!
|
|
5
5
|
* IMQ-RPC Decorators: expose
|
|
6
6
|
*
|
|
@@ -284,5 +284,4 @@ function expose() {
|
|
|
284
284
|
};
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
|
-
exports.expose = expose;
|
|
288
287
|
//# sourceMappingURL=expose.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.indexed =
|
|
3
|
+
exports.indexed = indexed;
|
|
4
4
|
/*!
|
|
5
5
|
* IMQ-RPC Decorators: property
|
|
6
6
|
*
|
|
@@ -60,5 +60,4 @@ function indexed(indexTypedef) {
|
|
|
60
60
|
.indexType = indexTypedef;
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
exports.indexed = indexed;
|
|
64
63
|
//# sourceMappingURL=indexed.js.map
|
package/src/decorators/lock.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lock =
|
|
3
|
+
exports.lock = lock;
|
|
4
4
|
/*!
|
|
5
5
|
* IMQ-RPC Decorators: lock
|
|
6
6
|
*
|
|
@@ -84,5 +84,4 @@ function lock(enabledOrOptions = true) {
|
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
exports.lock = lock;
|
|
88
87
|
//# sourceMappingURL=lock.js.map
|
package/src/decorators/logged.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logged =
|
|
3
|
+
exports.logged = logged;
|
|
4
4
|
// noinspection JSUnusedGlobalSymbols
|
|
5
5
|
/**
|
|
6
6
|
* Logger decorator factory for class methods. Will try, catch and log errors
|
|
@@ -39,5 +39,4 @@ function logged(options) {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
exports.logged = logged;
|
|
43
42
|
//# sourceMappingURL=logged.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.property =
|
|
3
|
+
exports.property = property;
|
|
4
4
|
/*!
|
|
5
5
|
* IMQ-RPC Decorators: property
|
|
6
6
|
*
|
|
@@ -115,5 +115,4 @@ function property(type, isOptional = false) {
|
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
exports.property = property;
|
|
119
118
|
//# sourceMappingURL=property.js.map
|
package/src/decorators/remote.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.remote =
|
|
3
|
+
exports.remote = remote;
|
|
4
4
|
/*!
|
|
5
5
|
* IMQ-RPC Decorators: remote
|
|
6
6
|
*
|
|
@@ -37,5 +37,4 @@ function remote() {
|
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
exports.remote = remote;
|
|
41
40
|
//# sourceMappingURL=remote.js.map
|
package/src/helpers/fs.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.fileExists = fileExists;
|
|
4
|
+
exports.mkdir = mkdir;
|
|
5
|
+
exports.writeFile = writeFile;
|
|
4
6
|
/*!
|
|
5
7
|
* IMQ-RPC helpers: fs
|
|
6
8
|
*
|
|
@@ -28,7 +30,6 @@ const fs = require("fs");
|
|
|
28
30
|
function fileExists(path) {
|
|
29
31
|
return new Promise(resolve => fs.access(path, err => resolve(!err)));
|
|
30
32
|
}
|
|
31
|
-
exports.fileExists = fileExists;
|
|
32
33
|
/**
|
|
33
34
|
* Async mkdir
|
|
34
35
|
*
|
|
@@ -38,7 +39,6 @@ exports.fileExists = fileExists;
|
|
|
38
39
|
function mkdir(path) {
|
|
39
40
|
return new Promise((resolve, reject) => fs.mkdir(path, generalCallback.bind(null, resolve, reject)));
|
|
40
41
|
}
|
|
41
|
-
exports.mkdir = mkdir;
|
|
42
42
|
/**
|
|
43
43
|
* Async writeFile
|
|
44
44
|
*
|
|
@@ -49,7 +49,6 @@ exports.mkdir = mkdir;
|
|
|
49
49
|
function writeFile(path, content) {
|
|
50
50
|
return new Promise((resolve, reject) => fs.writeFile(path, content, { encoding: 'utf8' }, generalCallback.bind(null, resolve, reject)));
|
|
51
51
|
}
|
|
52
|
-
exports.writeFile = writeFile;
|
|
53
52
|
/**
|
|
54
53
|
* Constructs and return callback which will resolve promise using
|
|
55
54
|
* given resolver and reject'or
|
package/src/helpers/os-uuid.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.osUuid =
|
|
3
|
+
exports.osUuid = osUuid;
|
|
4
4
|
/*!
|
|
5
5
|
* IMQ-RPC helpers: osUuid
|
|
6
6
|
*
|
|
@@ -27,5 +27,4 @@ const { machineIdSync } = require('node-machine-id');
|
|
|
27
27
|
function osUuid() {
|
|
28
28
|
return machineIdSync({ original: true });
|
|
29
29
|
}
|
|
30
|
-
exports.osUuid = osUuid;
|
|
31
30
|
//# sourceMappingURL=os-uuid.js.map
|
package/src/helpers/pid.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.IMQ_PID_DIR = exports.IMQ_TMP_DIR = exports.SIGNALS = void 0;
|
|
4
|
+
exports.pid = pid;
|
|
5
|
+
exports.forgetPid = forgetPid;
|
|
4
6
|
/*!
|
|
5
7
|
* IMQ-RPC helpers: pid, forgetPid
|
|
6
8
|
*
|
|
@@ -64,7 +66,6 @@ path = exports.IMQ_PID_DIR) {
|
|
|
64
66
|
}
|
|
65
67
|
return id;
|
|
66
68
|
}
|
|
67
|
-
exports.pid = pid;
|
|
68
69
|
/**
|
|
69
70
|
* Removes pid file for a given name and id
|
|
70
71
|
*
|
|
@@ -81,5 +82,4 @@ path = exports.IMQ_PID_DIR) {
|
|
|
81
82
|
}
|
|
82
83
|
catch (err) { /* ignore */ }
|
|
83
84
|
}
|
|
84
|
-
exports.forgetPid = forgetPid;
|
|
85
85
|
//# sourceMappingURL=pid.js.map
|
package/src/helpers/signature.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.signature =
|
|
3
|
+
exports.signature = signature;
|
|
4
4
|
/*!
|
|
5
5
|
* IMQ-RPC helpers: signature
|
|
6
6
|
*
|
|
@@ -33,5 +33,4 @@ function signature(className, methodName, args) {
|
|
|
33
33
|
const hashBigInt = (0, farmhash_1.fingerprint64)(data);
|
|
34
34
|
return hashBigInt.toString(16);
|
|
35
35
|
}
|
|
36
|
-
exports.signature = signature;
|
|
37
36
|
//# sourceMappingURL=signature.js.map
|