IO-2998 Add winston and replace logger.js
This commit is contained in:
177
package-lock.json
generated
177
package-lock.json
generated
@@ -56,6 +56,8 @@
|
|||||||
"ssh2-sftp-client": "^10.0.3",
|
"ssh2-sftp-client": "^10.0.3",
|
||||||
"twilio": "^4.23.0",
|
"twilio": "^4.23.0",
|
||||||
"uuid": "^10.0.0",
|
"uuid": "^10.0.0",
|
||||||
|
"winston": "^3.15.0",
|
||||||
|
"winston-cloudwatch": "^6.3.0",
|
||||||
"xml2js": "^0.6.2",
|
"xml2js": "^0.6.2",
|
||||||
"xmlbuilder2": "^3.1.1"
|
"xmlbuilder2": "^3.1.1"
|
||||||
},
|
},
|
||||||
@@ -1705,6 +1707,7 @@
|
|||||||
"version": "1.6.0",
|
"version": "1.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz",
|
||||||
"integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==",
|
"integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==",
|
||||||
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.1.90"
|
"node": ">=0.1.90"
|
||||||
}
|
}
|
||||||
@@ -3158,7 +3161,8 @@
|
|||||||
"node_modules/@types/triple-beam": {
|
"node_modules/@types/triple-beam": {
|
||||||
"version": "1.3.5",
|
"version": "1.3.5",
|
||||||
"resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz",
|
"resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz",
|
||||||
"integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw=="
|
"integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==",
|
||||||
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@xmldom/is-dom-node": {
|
"node_modules/@xmldom/is-dom-node": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
@@ -3185,7 +3189,6 @@
|
|||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
||||||
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
||||||
"optional": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"event-target-shim": "^5.0.0"
|
"event-target-shim": "^5.0.0"
|
||||||
},
|
},
|
||||||
@@ -3398,8 +3401,7 @@
|
|||||||
"type": "consulting",
|
"type": "consulting",
|
||||||
"url": "https://feross.org/support"
|
"url": "https://feross.org/support"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"node_modules/base64id": {
|
"node_modules/base64id": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
@@ -3537,6 +3539,30 @@
|
|||||||
"node": ">= 0.4.0"
|
"node": ">= 0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/buffer": {
|
||||||
|
"version": "6.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
|
||||||
|
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/feross"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "patreon",
|
||||||
|
"url": "https://www.patreon.com/feross"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "consulting",
|
||||||
|
"url": "https://feross.org/support"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"base64-js": "^1.3.1",
|
||||||
|
"ieee754": "^1.2.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/buffer-equal-constant-time": {
|
"node_modules/buffer-equal-constant-time": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
|
||||||
@@ -3612,7 +3638,6 @@
|
|||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ansi-styles": "^4.1.0",
|
"ansi-styles": "^4.1.0",
|
||||||
"supports-color": "^7.1.0"
|
"supports-color": "^7.1.0"
|
||||||
@@ -3628,7 +3653,6 @@
|
|||||||
"version": "7.2.0",
|
"version": "7.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"has-flag": "^4.0.0"
|
"has-flag": "^4.0.0"
|
||||||
},
|
},
|
||||||
@@ -4605,11 +4629,19 @@
|
|||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
||||||
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
|
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
|
||||||
"optional": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/events": {
|
||||||
|
"version": "3.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
|
||||||
|
"integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8.x"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/express": {
|
"node_modules/express": {
|
||||||
"version": "4.21.0",
|
"version": "4.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz",
|
"resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz",
|
||||||
@@ -4769,7 +4801,8 @@
|
|||||||
"node_modules/fecha": {
|
"node_modules/fecha": {
|
||||||
"version": "4.2.3",
|
"version": "4.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
|
||||||
"integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw=="
|
"integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==",
|
||||||
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/file-uri-to-path": {
|
"node_modules/file-uri-to-path": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
@@ -5345,7 +5378,6 @@
|
|||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
@@ -5501,6 +5533,26 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ieee754": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/feross"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "patreon",
|
||||||
|
"url": "https://www.patreon.com/feross"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "consulting",
|
||||||
|
"url": "https://feross.org/support"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "BSD-3-Clause"
|
||||||
|
},
|
||||||
"node_modules/inflight": {
|
"node_modules/inflight": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||||
@@ -5911,6 +5963,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||||
},
|
},
|
||||||
|
"node_modules/lodash.assign": {
|
||||||
|
"version": "4.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",
|
||||||
|
"integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/lodash.camelcase": {
|
"node_modules/lodash.camelcase": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
|
||||||
@@ -5928,6 +5986,12 @@
|
|||||||
"integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==",
|
"integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/lodash.find": {
|
||||||
|
"version": "4.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.find/-/lodash.find-4.6.0.tgz",
|
||||||
|
"integrity": "sha512-yaRZoAV3Xq28F1iafWN1+a0rflOej93l1DQUejs3SZ41h2O9UJBoS9aueGjPDgAl4B6tPC0NuuchLKaDQQ3Isg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/lodash.includes": {
|
"node_modules/lodash.includes": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
|
||||||
@@ -5944,6 +6008,18 @@
|
|||||||
"resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
|
||||||
"integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg=="
|
"integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg=="
|
||||||
},
|
},
|
||||||
|
"node_modules/lodash.isempty": {
|
||||||
|
"version": "4.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz",
|
||||||
|
"integrity": "sha512-oKMuF3xEeqDltrGMfDxAPGIVMSSRv8tbRSODbrs4KGsRRLEhrW8N8Rd4DRgB2+621hY8A8XwwrTVhXWpxFvMzg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/lodash.iserror": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash.iserror/-/lodash.iserror-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-eT/VeNns9hS7vAj1NKW/rRX6b+C3UX3/IAAqEE7aC4Oo2C0iD82NaP5IS4bSlQsammTii4qBJ8G1zd1LTL8hCw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/lodash.isinteger": {
|
"node_modules/lodash.isinteger": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
|
||||||
@@ -5970,9 +6046,10 @@
|
|||||||
"integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg=="
|
"integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg=="
|
||||||
},
|
},
|
||||||
"node_modules/logform": {
|
"node_modules/logform": {
|
||||||
"version": "2.6.0",
|
"version": "2.6.1",
|
||||||
"resolved": "https://registry.npmjs.org/logform/-/logform-2.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/logform/-/logform-2.6.1.tgz",
|
||||||
"integrity": "sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==",
|
"integrity": "sha512-CdaO738xRapbKIMVn2m4F6KTj4j7ooJ8POVnebSgKo3KBz5axNXRAL7ZdRjIV6NOr2Uf4vjtRkxrFETOioCqSA==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@colors/colors": "1.6.0",
|
"@colors/colors": "1.6.0",
|
||||||
"@types/triple-beam": "^1.3.2",
|
"@types/triple-beam": "^1.3.2",
|
||||||
@@ -6635,6 +6712,15 @@
|
|||||||
"url": "https://github.com/prettier/prettier?sponsor=1"
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/process": {
|
||||||
|
"version": "0.11.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
|
||||||
|
"integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/process-nextick-args": {
|
"node_modules/process-nextick-args": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||||
@@ -6978,9 +7064,10 @@
|
|||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||||
},
|
},
|
||||||
"node_modules/safe-stable-stringify": {
|
"node_modules/safe-stable-stringify": {
|
||||||
"version": "2.4.3",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz",
|
||||||
"integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==",
|
"integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==",
|
||||||
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
@@ -7952,6 +8039,7 @@
|
|||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz",
|
||||||
"integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==",
|
"integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==",
|
||||||
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 14.0.0"
|
"node": ">= 14.0.0"
|
||||||
}
|
}
|
||||||
@@ -8191,39 +8279,76 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/winston": {
|
"node_modules/winston": {
|
||||||
"version": "3.11.0",
|
"version": "3.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/winston/-/winston-3.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/winston/-/winston-3.15.0.tgz",
|
||||||
"integrity": "sha512-L3yR6/MzZAOl0DsysUXHVjOwv8mKZ71TrA/41EIduGpOOV5LQVodqN+QdQ6BS6PJ/RdIshZhq84P/fStEZkk7g==",
|
"integrity": "sha512-RhruH2Cj0bV0WgNL+lOfoUBI4DVfdUNjVnJGVovWZmrcKtrFTTRzgXYK2O9cymSGjrERCtaAeHwMNnUWXlwZow==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@colors/colors": "^1.6.0",
|
"@colors/colors": "^1.6.0",
|
||||||
"@dabh/diagnostics": "^2.0.2",
|
"@dabh/diagnostics": "^2.0.2",
|
||||||
"async": "^3.2.3",
|
"async": "^3.2.3",
|
||||||
"is-stream": "^2.0.0",
|
"is-stream": "^2.0.0",
|
||||||
"logform": "^2.4.0",
|
"logform": "^2.6.0",
|
||||||
"one-time": "^1.0.0",
|
"one-time": "^1.0.0",
|
||||||
"readable-stream": "^3.4.0",
|
"readable-stream": "^3.4.0",
|
||||||
"safe-stable-stringify": "^2.3.1",
|
"safe-stable-stringify": "^2.3.1",
|
||||||
"stack-trace": "0.0.x",
|
"stack-trace": "0.0.x",
|
||||||
"triple-beam": "^1.3.0",
|
"triple-beam": "^1.3.0",
|
||||||
"winston-transport": "^4.5.0"
|
"winston-transport": "^4.7.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 12.0.0"
|
"node": ">= 12.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/winston-transport": {
|
"node_modules/winston-cloudwatch": {
|
||||||
"version": "4.6.0",
|
"version": "6.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/winston-cloudwatch/-/winston-cloudwatch-6.3.0.tgz",
|
||||||
"integrity": "sha512-wbBA9PbPAHxKiygo7ub7BYRiKxms0tpfU2ljtWzb3SjRjv5yl6Ozuy/TkXf00HTAt+Uylo3gSkNwzc4ME0wiIg==",
|
"integrity": "sha512-ffLMBUtas4qCpAyNfA6yUjZUQPepl6XduwHjukxRtI8hSWE4dKmy1k1lcLpyYiglrsgZop+OQYAV/iJJ+7Z94g==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"logform": "^2.3.2",
|
"async": "^3.1.0",
|
||||||
"readable-stream": "^3.6.0",
|
"chalk": "^4.0.0",
|
||||||
|
"fast-safe-stringify": "^2.0.7",
|
||||||
|
"lodash.assign": "^4.2.0",
|
||||||
|
"lodash.find": "^4.6.0",
|
||||||
|
"lodash.isempty": "^4.4.0",
|
||||||
|
"lodash.iserror": "^3.1.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@aws-sdk/client-cloudwatch-logs": "^3.0.0",
|
||||||
|
"winston": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/winston-transport": {
|
||||||
|
"version": "4.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.8.0.tgz",
|
||||||
|
"integrity": "sha512-qxSTKswC6llEMZKgCQdaWgDuMJQnhuvF5f2Nk3SNXc4byfQ+voo2mX1Px9dkNOuR8p0KAjfPG29PuYUSIb+vSA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"logform": "^2.6.1",
|
||||||
|
"readable-stream": "^4.5.2",
|
||||||
"triple-beam": "^1.3.0"
|
"triple-beam": "^1.3.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 12.0.0"
|
"node": ">= 12.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/winston-transport/node_modules/readable-stream": {
|
||||||
|
"version": "4.5.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz",
|
||||||
|
"integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"abort-controller": "^3.0.0",
|
||||||
|
"buffer": "^6.0.3",
|
||||||
|
"events": "^3.3.0",
|
||||||
|
"process": "^0.11.10",
|
||||||
|
"string_decoder": "^1.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/word-wrap": {
|
"node_modules/word-wrap": {
|
||||||
"version": "1.2.5",
|
"version": "1.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
|
||||||
|
|||||||
@@ -66,6 +66,8 @@
|
|||||||
"ssh2-sftp-client": "^10.0.3",
|
"ssh2-sftp-client": "^10.0.3",
|
||||||
"twilio": "^4.23.0",
|
"twilio": "^4.23.0",
|
||||||
"uuid": "^10.0.0",
|
"uuid": "^10.0.0",
|
||||||
|
"winston": "^3.15.0",
|
||||||
|
"winston-cloudwatch": "^6.3.0",
|
||||||
"xml2js": "^0.6.2",
|
"xml2js": "^0.6.2",
|
||||||
"xmlbuilder2": "^3.1.1"
|
"xmlbuilder2": "^3.1.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ axios.interceptors.request.use((x) => {
|
|||||||
const printable = `${new Date()} | Request: ${x.method.toUpperCase()} | ${
|
const printable = `${new Date()} | Request: ${x.method.toUpperCase()} | ${
|
||||||
x.url
|
x.url
|
||||||
} | ${JSON.stringify(x.data)} | ${JSON.stringify(headers)}`;
|
} | ${JSON.stringify(x.data)} | ${JSON.stringify(headers)}`;
|
||||||
console.log(printable);
|
//console.log(printable);
|
||||||
|
|
||||||
CdkBase.createJsonEvent(socket, "TRACE", `Raw Request: ${printable}`, x.data);
|
CdkBase.createJsonEvent(socket, "TRACE", `Raw Request: ${printable}`, x.data);
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ axios.interceptors.response.use((x) => {
|
|||||||
const socket = x.config.socket;
|
const socket = x.config.socket;
|
||||||
|
|
||||||
const printable = `${new Date()} | Response: ${x.status} | ${JSON.stringify(x.data)}`;
|
const printable = `${new Date()} | Response: ${x.status} | ${JSON.stringify(x.data)}`;
|
||||||
console.log(printable);
|
//console.log(printable);
|
||||||
CdkBase.createJsonEvent(socket, "TRACE", `Raw Response: ${printable}`, x.data);
|
CdkBase.createJsonEvent(socket, "TRACE", `Raw Response: ${printable}`, x.data);
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ axios.interceptors.request.use((x) => {
|
|||||||
const printable = `${new Date()} | Request: ${x.method.toUpperCase()} | ${
|
const printable = `${new Date()} | Request: ${x.method.toUpperCase()} | ${
|
||||||
x.url
|
x.url
|
||||||
} | ${JSON.stringify(x.data)} | ${JSON.stringify(headers)}`;
|
} | ${JSON.stringify(x.data)} | ${JSON.stringify(headers)}`;
|
||||||
console.log(printable);
|
//console.log(printable);
|
||||||
|
|
||||||
CdkBase.createJsonEvent(socket, "TRACE", `Raw Request: ${printable}`, x.data);
|
CdkBase.createJsonEvent(socket, "TRACE", `Raw Request: ${printable}`, x.data);
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ axios.interceptors.response.use((x) => {
|
|||||||
const socket = x.config.socket;
|
const socket = x.config.socket;
|
||||||
|
|
||||||
const printable = `${new Date()} | Response: ${x.status} | ${JSON.stringify(x.data)}`;
|
const printable = `${new Date()} | Response: ${x.status} | ${JSON.stringify(x.data)}`;
|
||||||
console.log(printable);
|
//console.log(printable);
|
||||||
CdkBase.createJsonEvent(socket, "TRACE", `Raw Response: ${printable}`, x.data);
|
CdkBase.createJsonEvent(socket, "TRACE", `Raw Response: ${printable}`, x.data);
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!hasMapaLine && jobs_by_pk.job_totals.rates.mapa.total.amount > 0) {
|
if (!hasMapaLine && jobs_by_pk.job_totals.rates.mapa.total.amount > 0) {
|
||||||
// console.log("Adding MAPA Line Manually.");
|
// //console.log("Adding MAPA Line Manually.");
|
||||||
const mapaAccountName = responsibilityCenters.defaults.profits.MAPA;
|
const mapaAccountName = responsibilityCenters.defaults.profits.MAPA;
|
||||||
|
|
||||||
const mapaAccount = responsibilityCenters.profits.find((c) => c.name === mapaAccountName);
|
const mapaAccount = responsibilityCenters.profits.find((c) => c.name === mapaAccountName);
|
||||||
@@ -272,12 +272,12 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//console.log("NO MAPA ACCOUNT FOUND!!");
|
////console.log("NO MAPA ACCOUNT FOUND!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasMashLine && jobs_by_pk.job_totals.rates.mash.total.amount > 0) {
|
if (!hasMashLine && jobs_by_pk.job_totals.rates.mash.total.amount > 0) {
|
||||||
// console.log("Adding MASH Line Manually.");
|
// //console.log("Adding MASH Line Manually.");
|
||||||
|
|
||||||
const mashAccountName = responsibilityCenters.defaults.profits.MASH;
|
const mashAccountName = responsibilityCenters.defaults.profits.MASH;
|
||||||
|
|
||||||
@@ -341,7 +341,7 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// console.log("NO MASH ACCOUNT FOUND!!");
|
// //console.log("NO MASH ACCOUNT FOUND!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -795,7 +795,7 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes
|
|||||||
: taxCodes[taxAccountCode];
|
: taxCodes[taxAccountCode];
|
||||||
for (let tyCounter = 1; tyCounter <= 5; tyCounter++) {
|
for (let tyCounter = 1; tyCounter <= 5; tyCounter++) {
|
||||||
const taxAmount = Dinero(job_totals.totals.us_sales_tax_breakdown[`ty${tyCounter}Tax`]);
|
const taxAmount = Dinero(job_totals.totals.us_sales_tax_breakdown[`ty${tyCounter}Tax`]);
|
||||||
console.log(`Tax ${tyCounter}`, taxAmount.toFormat());
|
//console.log(`Tax ${tyCounter}`, taxAmount.toFormat());
|
||||||
if (taxAmount.getAmount() > 0) {
|
if (taxAmount.getAmount() > 0) {
|
||||||
if (qbo) {
|
if (qbo) {
|
||||||
InvoiceLineAdd.push({
|
InvoiceLineAdd.push({
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ exports.default = async (req, res) => {
|
|||||||
|
|
||||||
res.status(200).json(ret);
|
res.status(200).json(ret);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
//console.log(error);
|
||||||
logger.log("qbo-payable-create-error", "ERROR", req.user.email, {
|
logger.log("qbo-payable-create-error", "ERROR", req.user.email, {
|
||||||
error: error.message,
|
error: error.message,
|
||||||
stack: error.stack
|
stack: error.stack
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ exports.default = async (req, res) => {
|
|||||||
|
|
||||||
res.status(200).json(ret);
|
res.status(200).json(ret);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
//console.log(error);
|
||||||
logger.log("qbo-payment-create-error", "ERROR", req.user.email, {
|
logger.log("qbo-payment-create-error", "ERROR", req.user.email, {
|
||||||
error: error.message,
|
error: error.message,
|
||||||
stack: error.stack
|
stack: error.stack
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ exports.default = async (req, res) => {
|
|||||||
error?.response?.data ||
|
error?.response?.data ||
|
||||||
error?.message
|
error?.message
|
||||||
});
|
});
|
||||||
console.log(error);
|
//console.log(error);
|
||||||
logger.log("qbo-receivable-create-error", "ERROR", req.user.email, {
|
logger.log("qbo-receivable-create-error", "ERROR", req.user.email, {
|
||||||
error: error.message,
|
error: error.message,
|
||||||
stack: error.stack
|
stack: error.stack
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ require("dotenv").config({
|
|||||||
const client = require("../graphql-client/graphql-client").client;
|
const client = require("../graphql-client/graphql-client").client;
|
||||||
|
|
||||||
exports.createAssociation = async (req, res) => {
|
exports.createAssociation = async (req, res) => {
|
||||||
logger.log("admin-create-association", "ADMIN", req.user.email, null, {
|
logger.log("admin-create-association", "debug", req.user.email, null, {
|
||||||
request: req.body,
|
request: req.body,
|
||||||
ioadmin: true
|
ioadmin: true
|
||||||
});
|
});
|
||||||
@@ -31,7 +31,7 @@ exports.createAssociation = async (req, res) => {
|
|||||||
res.json(result);
|
res.json(result);
|
||||||
};
|
};
|
||||||
exports.createShop = async (req, res) => {
|
exports.createShop = async (req, res) => {
|
||||||
logger.log("admin-create-shop", "ADMIN", req.user.email, null, {
|
logger.log("admin-create-shop", "debug", req.user.email, null, {
|
||||||
request: req.body,
|
request: req.body,
|
||||||
ioadmin: true
|
ioadmin: true
|
||||||
});
|
});
|
||||||
@@ -64,7 +64,7 @@ exports.createShop = async (req, res) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
exports.updateCounter = async (req, res) => {
|
exports.updateCounter = async (req, res) => {
|
||||||
logger.log("admin-update-counter", "ADMIN", req.user.email, null, {
|
logger.log("admin-update-counter", "debug", req.user.email, null, {
|
||||||
request: req.body,
|
request: req.body,
|
||||||
ioadmin: true
|
ioadmin: true
|
||||||
});
|
});
|
||||||
@@ -91,7 +91,7 @@ exports.updateCounter = async (req, res) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
exports.updateShop = async (req, res) => {
|
exports.updateShop = async (req, res) => {
|
||||||
logger.log("admin-update-shop", "ADMIN", req.user.email, null, {
|
logger.log("admin-update-shop", "debug", req.user.email, null, {
|
||||||
request: req.body,
|
request: req.body,
|
||||||
ioadmin: true
|
ioadmin: true
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ exports.defaultRoute = async function (req, res) {
|
|||||||
const jobData = await QueryJobData(req, req.BearerToken, req.body.jobid);
|
const jobData = await QueryJobData(req, req.BearerToken, req.body.jobid);
|
||||||
return res.status(200).json({ data: calculateAllocations(req, jobData) });
|
return res.status(200).json({ data: calculateAllocations(req, jobData) });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
////console.log(error);
|
||||||
CdkBase.createLogEvent(req, "ERROR", `Error encountered in CdkCalculateAllocations. ${error}`);
|
CdkBase.createLogEvent(req, "ERROR", `Error encountered in CdkCalculateAllocations. ${error}`);
|
||||||
res.status(500).json({ error: `Error encountered in CdkCalculateAllocations. ${error}` });
|
res.status(500).json({ error: `Error encountered in CdkCalculateAllocations. ${error}` });
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ exports.default = async function (socket, jobid) {
|
|||||||
const jobData = await QueryJobData(socket, "Bearer " + socket.handshake.auth.token, jobid);
|
const jobData = await QueryJobData(socket, "Bearer " + socket.handshake.auth.token, jobid);
|
||||||
return calculateAllocations(socket, jobData);
|
return calculateAllocations(socket, jobData);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
////console.log(error);
|
||||||
CdkBase.createLogEvent(socket, "ERROR", `Error encountered in CdkCalculateAllocations. ${error}`);
|
CdkBase.createLogEvent(socket, "ERROR", `Error encountered in CdkCalculateAllocations. ${error}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -212,7 +212,7 @@ function calculateAllocations(connectionData, job) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!hasMapaLine && job.job_totals.rates.mapa.total.amount > 0) {
|
if (!hasMapaLine && job.job_totals.rates.mapa.total.amount > 0) {
|
||||||
// console.log("Adding MAPA Line Manually.");
|
// //console.log("Adding MAPA Line Manually.");
|
||||||
const mapaAccountName = selectedDmsAllocationConfig.profits.MAPA;
|
const mapaAccountName = selectedDmsAllocationConfig.profits.MAPA;
|
||||||
|
|
||||||
const mapaAccount = bodyshop.md_responsibility_centers.profits.find((c) => c.name === mapaAccountName);
|
const mapaAccount = bodyshop.md_responsibility_centers.profits.find((c) => c.name === mapaAccountName);
|
||||||
@@ -224,7 +224,7 @@ function calculateAllocations(connectionData, job) {
|
|||||||
Dinero(job.job_totals.rates.mapa.total)
|
Dinero(job.job_totals.rates.mapa.total)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
//console.log("NO MAPA ACCOUNT FOUND!!");
|
////console.log("NO MAPA ACCOUNT FOUND!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -820,7 +820,7 @@ exports.default = async (req, res) => {
|
|||||||
job: JSON.stringify({ id: job.id, ro_number: job.ro_number }),
|
job: JSON.stringify({ id: job.id, ro_number: job.ro_number }),
|
||||||
error: error.message || JSON.stringify(error)
|
error: error.message || JSON.stringify(error)
|
||||||
});
|
});
|
||||||
console.log(error);
|
//console.log(error);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log("arms-failed-job", "ERROR", "api", job.shopid, {
|
logger.log("arms-failed-job", "ERROR", "api", job.shopid, {
|
||||||
@@ -886,7 +886,10 @@ exports.default = async (req, res) => {
|
|||||||
const [result, rawResponse, , rawRequest] = entegralResponse;
|
const [result, rawResponse, , rawRequest] = entegralResponse;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml);
|
fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml);
|
||||||
console.log(error);
|
//console.log(error);
|
||||||
|
logger.log("arms-error-shop", "ERROR", "api", bodyshop.id, {
|
||||||
|
error
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//Error at the shop level.
|
//Error at the shop level.
|
||||||
|
|||||||
@@ -206,9 +206,6 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
|
|
||||||
const repairCosts = CreateCosts(job);
|
const repairCosts = CreateCosts(job);
|
||||||
|
|
||||||
if (job.ro_number === "QBD209") {
|
|
||||||
console.log("Stop here");
|
|
||||||
}
|
|
||||||
//Calculate detail only lines.
|
//Calculate detail only lines.
|
||||||
const detailAdjustments = job.joblines
|
const detailAdjustments = job.joblines
|
||||||
.filter((jl) => jl.ah_detail_line && jl.mod_lbr_ty)
|
.filter((jl) => jl.ah_detail_line && jl.mod_lbr_ty)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ admin.initializeApp({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const createUser = async (req, res) => {
|
const createUser = async (req, res) => {
|
||||||
logger.log("admin-create-user", "ADMIN", req.user.email, null, {
|
logger.log("admin-create-user", "debug", req.user.email, null, {
|
||||||
request: req.body,
|
request: req.body,
|
||||||
ioadmin: true
|
ioadmin: true
|
||||||
});
|
});
|
||||||
@@ -97,7 +97,7 @@ const sendPromanagerWelcomeEmail = (req, res) => {
|
|||||||
|
|
||||||
// Validate email before proceeding
|
// Validate email before proceeding
|
||||||
if (!dbUser.validemail) {
|
if (!dbUser.validemail) {
|
||||||
logger.log("admin-send-welcome-email-skip", "ADMIN", req.user.email, null, {
|
logger.log("admin-send-welcome-email-skip", "debug", req.user.email, null, {
|
||||||
message: "User email is not valid, skipping email.",
|
message: "User email is not valid, skipping email.",
|
||||||
email
|
email
|
||||||
});
|
});
|
||||||
@@ -107,7 +107,7 @@ const sendPromanagerWelcomeEmail = (req, res) => {
|
|||||||
// Check if the user's company is ProManager
|
// Check if the user's company is ProManager
|
||||||
const convenientCompany = dbUser.associations?.[0]?.bodyshop?.convenient_company;
|
const convenientCompany = dbUser.associations?.[0]?.bodyshop?.convenient_company;
|
||||||
if (convenientCompany !== "promanager") {
|
if (convenientCompany !== "promanager") {
|
||||||
logger.log("admin-send-welcome-email-skip", "ADMIN", req.user.email, null, {
|
logger.log("admin-send-welcome-email-skip", "debug", req.user.email, null, {
|
||||||
message: 'convenient_company is not "promanager", skipping email.',
|
message: 'convenient_company is not "promanager", skipping email.',
|
||||||
convenientCompany
|
convenientCompany
|
||||||
});
|
});
|
||||||
@@ -141,7 +141,7 @@ const sendPromanagerWelcomeEmail = (req, res) => {
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// Log success and return response
|
// Log success and return response
|
||||||
logger.log("admin-send-welcome-email", "ADMIN", req.user.email, null, {
|
logger.log("admin-send-welcome-email", "debug", req.user.email, null, {
|
||||||
request: req.body,
|
request: req.body,
|
||||||
ioadmin: true,
|
ioadmin: true,
|
||||||
emailSentTo: email
|
emailSentTo: email
|
||||||
@@ -161,7 +161,7 @@ const sendPromanagerWelcomeEmail = (req, res) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const updateUser = (req, res) => {
|
const updateUser = (req, res) => {
|
||||||
logger.log("admin-update-user", "ADMIN", req.user.email, null, {
|
logger.log("admin-update-user", "debug", req.user.email, null, {
|
||||||
request: req.body,
|
request: req.body,
|
||||||
ioadmin: true
|
ioadmin: true
|
||||||
});
|
});
|
||||||
@@ -184,7 +184,7 @@ const updateUser = (req, res) => {
|
|||||||
.then((userRecord) => {
|
.then((userRecord) => {
|
||||||
// See the UserRecord reference doc for the contents of userRecord.
|
// See the UserRecord reference doc for the contents of userRecord.
|
||||||
|
|
||||||
logger.log("admin-update-user-success", "ADMIN", req.user.email, null, {
|
logger.log("admin-update-user-success", "debug", req.user.email, null, {
|
||||||
userRecord,
|
userRecord,
|
||||||
ioadmin: true
|
ioadmin: true
|
||||||
});
|
});
|
||||||
@@ -199,7 +199,7 @@ const updateUser = (req, res) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getUser = (req, res) => {
|
const getUser = (req, res) => {
|
||||||
logger.log("admin-get-user", "ADMIN", req.user.email, null, {
|
logger.log("admin-get-user", "debug", req.user.email, null, {
|
||||||
request: req.body,
|
request: req.body,
|
||||||
ioadmin: true
|
ioadmin: true
|
||||||
});
|
});
|
||||||
@@ -321,7 +321,7 @@ module.exports = {
|
|||||||
// admin.auth().setCustomUserClaims(uid, {
|
// admin.auth().setCustomUserClaims(uid, {
|
||||||
// ioadmin: true,
|
// ioadmin: true,
|
||||||
// "https://hasura.io/jwt/claims": {
|
// "https://hasura.io/jwt/claims": {
|
||||||
// "x-hasura-default-role": "admin",
|
// "x-hasura-default-role": "debug",
|
||||||
// "x-hasura-allowed-roles": ["admin"],
|
// "x-hasura-allowed-roles": ["admin"],
|
||||||
// "x-hasura-user-id": uid,
|
// "x-hasura-user-id": uid,
|
||||||
// },
|
// },
|
||||||
|
|||||||
@@ -1,25 +1,66 @@
|
|||||||
const graylog2 = require("graylog2");
|
const graylog2 = require("graylog2");
|
||||||
|
const InstanceManager = require("../utils/instanceMgr").default;
|
||||||
|
|
||||||
const logger = new graylog2.graylog({
|
const logger = new graylog2.graylog({
|
||||||
servers: [{ host: "logs.bodyshop.app", port: 12201 }]
|
servers: [{ host: "logs.bodyshop.app", port: 12201 }]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const winston = require("winston");
|
||||||
|
const WinstonCloudWatch = require("winston-cloudwatch");
|
||||||
|
|
||||||
|
const region = InstanceManager({
|
||||||
|
imex: "ca-central-1",
|
||||||
|
rome: "us-east-2"
|
||||||
|
});
|
||||||
|
|
||||||
|
const logGroupName = process.env.CLOUDWATCH_LOG_GROUP;
|
||||||
|
|
||||||
|
const winstonLogger = winston.createLogger({
|
||||||
|
//level: "debug",
|
||||||
|
format: winston.format.json(),
|
||||||
|
transports: [
|
||||||
|
...(process.env.NODE_ENV !== "production" ? [new winston.transports.Console({ level: "silly" })] : []),
|
||||||
|
new WinstonCloudWatch({
|
||||||
|
level: "error",
|
||||||
|
logGroupName: logGroupName,
|
||||||
|
logStreamName: "errors",
|
||||||
|
awsRegion: region,
|
||||||
|
jsonMessage: true
|
||||||
|
}),
|
||||||
|
new WinstonCloudWatch({
|
||||||
|
level: "warn",
|
||||||
|
logGroupName: logGroupName,
|
||||||
|
logStreamName: "warn",
|
||||||
|
awsRegion: region,
|
||||||
|
jsonMessage: true
|
||||||
|
}),
|
||||||
|
new WinstonCloudWatch({
|
||||||
|
level: "debug",
|
||||||
|
logGroupName: logGroupName,
|
||||||
|
logStreamName: "debug",
|
||||||
|
awsRegion: region,
|
||||||
|
jsonMessage: true
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
function log(message, type, user, record, object) {
|
function log(message, type, user, record, object) {
|
||||||
if (type !== "ioevent")
|
// winstonLogger.debug(message, user, record, object);
|
||||||
console.log(message, {
|
|
||||||
type,
|
winstonLogger.log({
|
||||||
env: process.env.NODE_ENV || "development",
|
level: type.toLowerCase(),
|
||||||
user,
|
message: message,
|
||||||
record,
|
user: user,
|
||||||
...object
|
record: record,
|
||||||
});
|
object: object
|
||||||
logger.log(message, message, {
|
|
||||||
type,
|
|
||||||
env: process.env.NODE_ENV || "development",
|
|
||||||
user,
|
|
||||||
record,
|
|
||||||
...object
|
|
||||||
});
|
});
|
||||||
|
// logger.log(message, message, {
|
||||||
|
// type,
|
||||||
|
// env: process.env.NODE_ENV || "development",
|
||||||
|
// user,
|
||||||
|
// record,
|
||||||
|
// ...object
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { log };
|
module.exports = { log };
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ io.on("connection", (socket) => {
|
|||||||
|
|
||||||
function createLogEvent(socket, level, message) {
|
function createLogEvent(socket, level, message) {
|
||||||
if (LogLevelHierarchy(socket.log_level) >= LogLevelHierarchy(level)) {
|
if (LogLevelHierarchy(socket.log_level) >= LogLevelHierarchy(level)) {
|
||||||
console.log(`[WS LOG EVENT] ${level} - ${new Date()} - ${socket.user.email} - ${socket.id} - ${message}`);
|
// console.log(`[WS LOG EVENT] ${level} - ${new Date()} - ${socket.user.email} - ${socket.id} - ${message}`);
|
||||||
socket.emit("log-event", {
|
socket.emit("log-event", {
|
||||||
timestamp: new Date(),
|
timestamp: new Date(),
|
||||||
level,
|
level,
|
||||||
|
|||||||
Reference in New Issue
Block a user