diff --git a/lib/command-handler/inquiry.js b/lib/command-handler/inquiry.js index 4caa400..644c200 100644 --- a/lib/command-handler/inquiry.js +++ b/lib/command-handler/inquiry.js @@ -1,5 +1,6 @@ const moment = require('moment'); +const uniqid = require('uniqid'); const commandError = require('./error'); const coreapi = require('../coreapi'); @@ -31,7 +32,7 @@ function execute(tokens, params, cb) { product_name: tokens[1].trim().toUpperCase(), destination: tokens[2].trim().replace(/^\+62/, '0'), terminal_password: tokens[3], - request_id: `${generateRequestId(tokens[1], tokens[2])}${Number(tokens[4]) ? '_req' + Number(tokens[4]) : ''}`, + request_id: `${generateRequestId(tokens[1], tokens[2])}${Number(tokens[4]) ? `_req${Number(tokens[4])}` : `_rnd_${uniqid()}`}`, }; coreapi(coreEndpoint, coreParams, 'GET', cb); diff --git a/package-lock.json b/package-lock.json index ada233a..2ee53cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2439,7 +2439,7 @@ "basic-auth": "^2.0.0", "body-parser": "^1.18.2", "dot-object": "^1.7.0", - "express": "^4.16.3", + "express": "^4.17.1", "express-session": "^1.15.6", "fs-copy-file": "^2.1.2", "json-query": "^2.2.2", @@ -2449,7 +2449,7 @@ "node-machine-id": "^1.1.10", "node-natural-sort": "^0.8.6", "numeral": "^2.0.6", - "nunjucks": "^3.2.0", + "nunjucks": "^3.2.1", "pkginfo": "^0.4.1", "redis": "^2.8.0", "request": "^2.88.0", @@ -2462,6 +2462,16 @@ "winston": "^3.2.1", "winston-circular-buffer": "^1.0.0", "winston-daily-rotate-file": "^3.10.0" + }, + "dependencies": { + "uniqid": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-4.1.1.tgz", + "integrity": "sha1-iSIN32t1GuUrX3JISGNShZa7hME=", + "requires": { + "macaddress": "^0.2.8" + } + } } }, "kuler": { @@ -4066,12 +4076,9 @@ } }, "uniqid": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-4.1.1.tgz", - "integrity": "sha1-iSIN32t1GuUrX3JISGNShZa7hME=", - "requires": { - "macaddress": "^0.2.8" - } + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-5.2.0.tgz", + "integrity": "sha512-LH8zsvwJ/GL6YtNfSOmMCrI9piraAUjBfw2MCvleNE6a4pVKJwXjG2+HWhkVeFcSg+nmaPKbMrMOoxwQluZ1Mg==" }, "unpipe": { "version": "1.0.0", diff --git a/package.json b/package.json index f38a349..6c8274d 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "natural-compare-lite": "^1.4.0", "redis": "^2.8.0", "request": "^2.88.0", + "uniqid": "^5.2.0", "yargs": "^13.2.4" }, "devDependencies": {