From c77b2fccd7deb8ae4b052722b330534d4cda390a Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Tue, 13 Dec 2022 15:49:14 +0100 Subject: [PATCH 1/3] Updated all dependencies --- .../jitar-nodejs-server/package-lock.json | 179 +++++++++--------- packages/jitar-nodejs-server/package.json | 6 +- 2 files changed, 92 insertions(+), 93 deletions(-) diff --git a/packages/jitar-nodejs-server/package-lock.json b/packages/jitar-nodejs-server/package-lock.json index 18024bbf..2d5b21e0 100644 --- a/packages/jitar-nodejs-server/package-lock.json +++ b/packages/jitar-nodejs-server/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@overnightjs/core": "^1.7.6", "class-transformer": "^0.5.1", - "class-validator": "^0.13.2", + "class-validator": "^0.14.0", "express": "^4.18.1", "express-http-proxy": "^1.6.3", "fs-extra": "^11.1.0", @@ -19,7 +19,7 @@ "glob-promise": "^5.0.0", "jitar": "^0.2.1", "mime-types": "^2.1.35", - "tslog": "^3.3.3", + "tslog": "^4.4.4", "yargs": "^17.6.0" }, "devDependencies": { @@ -1385,9 +1385,9 @@ "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" }, "node_modules/@types/node": { - "version": "18.11.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.10.tgz", - "integrity": "sha512-juG3RWMBOqcOuXC643OAdSA525V44cVgGV6dUDuiFtss+8Fk5x1hI93Rsld43VeJVIeqlP9I7Fn9/qaVqoEAuQ==" + "version": "18.11.14", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.14.tgz", + "integrity": "sha512-0KXV57tENYmmJMl+FekeW9V3O/rlcqGQQJ/hNh9r8pKIj304pskWuEd8fCyNT86g/TpO0gcOTiLzsHLEURFMIQ==" }, "node_modules/@types/prettier": { "version": "2.7.1", @@ -1429,10 +1429,15 @@ "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", "dev": true }, + "node_modules/@types/validator": { + "version": "13.7.10", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.7.10.tgz", + "integrity": "sha512-t1yxFAR2n0+VO6hd/FJ9F2uezAZVWHLmpmlJzm1eX03+H7+HsuTAp7L8QJs+2pQCfWkP1+EXsGK9Z9v7o/qPVQ==" + }, "node_modules/@types/yargs": { - "version": "17.0.15", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.15.tgz", - "integrity": "sha512-ZHc4W2dnEQPfhn06TBEdWaiUHEZAocYaiVMfwOipY5jcJt/251wVrKCBWBetGZWO5CF8tdb7L3DmdxVlZ2BOIg==", + "version": "17.0.17", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.17.tgz", + "integrity": "sha512-72bWxFKTK6uwWJAVT+3rF6Jo6RTojiJ27FQo8Rf60AL+VZbzoVPnMFhKsUnbjR8A3BTCYQ7Mv3hnl8T0A+CX9g==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -1445,14 +1450,14 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.45.0.tgz", - "integrity": "sha512-CXXHNlf0oL+Yg021cxgOdMHNTXD17rHkq7iW6RFHoybdFgQBjU3yIXhhcPpGwr1CjZlo6ET8C6tzX5juQoXeGA==", + "version": "5.46.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.46.1.tgz", + "integrity": "sha512-YpzNv3aayRBwjs4J3oz65eVLXc9xx0PDbIRisHj+dYhvBn02MjYOD96P8YGiWEIFBrojaUjxvkaUpakD82phsA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.45.0", - "@typescript-eslint/type-utils": "5.45.0", - "@typescript-eslint/utils": "5.45.0", + "@typescript-eslint/scope-manager": "5.46.1", + "@typescript-eslint/type-utils": "5.46.1", + "@typescript-eslint/utils": "5.46.1", "debug": "^4.3.4", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", @@ -1478,14 +1483,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.45.0.tgz", - "integrity": "sha512-brvs/WSM4fKUmF5Ot/gEve6qYiCMjm6w4HkHPfS6ZNmxTS0m0iNN4yOChImaCkqc1hRwFGqUyanMXuGal6oyyQ==", + "version": "5.46.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.46.1.tgz", + "integrity": "sha512-RelQ5cGypPh4ySAtfIMBzBGyrNerQcmfA1oJvPj5f+H4jI59rl9xxpn4bonC0tQvUKOEN7eGBFWxFLK3Xepneg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.45.0", - "@typescript-eslint/types": "5.45.0", - "@typescript-eslint/typescript-estree": "5.45.0", + "@typescript-eslint/scope-manager": "5.46.1", + "@typescript-eslint/types": "5.46.1", + "@typescript-eslint/typescript-estree": "5.46.1", "debug": "^4.3.4" }, "engines": { @@ -1505,13 +1510,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.45.0.tgz", - "integrity": "sha512-noDMjr87Arp/PuVrtvN3dXiJstQR1+XlQ4R1EvzG+NMgXi8CuMCXpb8JqNtFHKceVSQ985BZhfRdowJzbv4yKw==", + "version": "5.46.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.46.1.tgz", + "integrity": "sha512-iOChVivo4jpwUdrJZyXSMrEIM/PvsbbDOX1y3UCKjSgWn+W89skxWaYXACQfxmIGhPVpRWK/VWPYc+bad6smIA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.45.0", - "@typescript-eslint/visitor-keys": "5.45.0" + "@typescript-eslint/types": "5.46.1", + "@typescript-eslint/visitor-keys": "5.46.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1522,13 +1527,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.45.0.tgz", - "integrity": "sha512-DY7BXVFSIGRGFZ574hTEyLPRiQIvI/9oGcN8t1A7f6zIs6ftbrU0nhyV26ZW//6f85avkwrLag424n+fkuoJ1Q==", + "version": "5.46.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.46.1.tgz", + "integrity": "sha512-V/zMyfI+jDmL1ADxfDxjZ0EMbtiVqj8LUGPAGyBkXXStWmCUErMpW873zEHsyguWCuq2iN4BrlWUkmuVj84yng==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.45.0", - "@typescript-eslint/utils": "5.45.0", + "@typescript-eslint/typescript-estree": "5.46.1", + "@typescript-eslint/utils": "5.46.1", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -1549,9 +1554,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.45.0.tgz", - "integrity": "sha512-QQij+u/vgskA66azc9dCmx+rev79PzX8uDHpsqSjEFtfF2gBUTRCpvYMh2gw2ghkJabNkPlSUCimsyBEQZd1DA==", + "version": "5.46.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.46.1.tgz", + "integrity": "sha512-Z5pvlCaZgU+93ryiYUwGwLl9AQVB/PQ1TsJ9NZ/gHzZjN7g9IAn6RSDkpCV8hqTwAiaj6fmCcKSQeBPlIpW28w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1562,13 +1567,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.45.0.tgz", - "integrity": "sha512-maRhLGSzqUpFcZgXxg1qc/+H0bT36lHK4APhp0AEUVrpSwXiRAomm/JGjSG+kNUio5kAa3uekCYu/47cnGn5EQ==", + "version": "5.46.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.46.1.tgz", + "integrity": "sha512-j9W4t67QiNp90kh5Nbr1w92wzt+toiIsaVPnEblB2Ih2U9fqBTyqV9T3pYWZBRt6QoMh/zVWP59EpuCjc4VRBg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.45.0", - "@typescript-eslint/visitor-keys": "5.45.0", + "@typescript-eslint/types": "5.46.1", + "@typescript-eslint/visitor-keys": "5.46.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1589,16 +1594,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.45.0.tgz", - "integrity": "sha512-OUg2JvsVI1oIee/SwiejTot2OxwU8a7UfTFMOdlhD2y+Hl6memUSL4s98bpUTo8EpVEr0lmwlU7JSu/p2QpSvA==", + "version": "5.46.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.46.1.tgz", + "integrity": "sha512-RBdBAGv3oEpFojaCYT4Ghn4775pdjvwfDOfQ2P6qzNVgQOVrnSPe5/Pb88kv7xzYQjoio0eKHKB9GJ16ieSxvA==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.45.0", - "@typescript-eslint/types": "5.45.0", - "@typescript-eslint/typescript-estree": "5.45.0", + "@typescript-eslint/scope-manager": "5.46.1", + "@typescript-eslint/types": "5.46.1", + "@typescript-eslint/typescript-estree": "5.46.1", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" @@ -1615,12 +1620,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.45.0.tgz", - "integrity": "sha512-jc6Eccbn2RtQPr1s7th6jJWQHBHI6GBVQkCHoJFQ5UreaKm59Vxw+ynQUPPY2u2Amquc+7tmEoC2G52ApsGNNg==", + "version": "5.46.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.46.1.tgz", + "integrity": "sha512-jczZ9noovXwy59KjRTk1OftT78pwygdcmCuBf8yMoWt/8O8l+6x2LSEze0E4TeepXK4MezW3zGSyoDRZK7Y9cg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.45.0", + "@typescript-eslint/types": "5.46.1", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -1968,7 +1973,8 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true }, "node_modules/bytes": { "version": "3.1.2", @@ -2009,9 +2015,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001435", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001435.tgz", - "integrity": "sha512-kdCkUTjR+v4YAJelyiDTqiu82BDr4W4CP5sgTA0ZBmqn30XfS2ZghPLMowik9TPhS+psWJiUNxsqLyurDbmutA==", + "version": "1.0.30001439", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001439.tgz", + "integrity": "sha512-1MgUzEkoMO6gKfXflStpYgZDlFM7M/ck/bgfVCACO5vnAf0fXoNVHdWtqGU+MYca+4bL9Z5bpOVmR33cWW9G2A==", "dev": true, "funding": [ { @@ -2070,11 +2076,12 @@ "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==" }, "node_modules/class-validator": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.13.2.tgz", - "integrity": "sha512-yBUcQy07FPlGzUjoLuUfIOXzgynnQPPruyK1Ge2B74k9ROwnle1E+NxLWnUv5OLU8hA/qL5leAE9XnXq3byaBw==", + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.14.0.tgz", + "integrity": "sha512-ct3ltplN8I9fOwUd8GrP8UQixwff129BkEtuWDKL5W45cQuLd19xqmTLu5ge78YDm/fdje6FMt0hGOhl0lii3A==", "dependencies": { - "libphonenumber-js": "^1.9.43", + "@types/validator": "^13.7.10", + "libphonenumber-js": "^1.10.14", "validator": "^13.7.0" } }, @@ -2354,9 +2361,9 @@ } }, "node_modules/eslint": { - "version": "8.28.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.28.0.tgz", - "integrity": "sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ==", + "version": "8.29.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.29.0.tgz", + "integrity": "sha512-isQ4EEiyUjZFbEKvEGJKKGBwXtvXX+zJbkVKCgTuB9t/+jUBcy8avhkEwWJecI15BkRkOYmvIM5ynbhRjEkoeg==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.3.3", @@ -2748,9 +2755,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.14.0.tgz", + "integrity": "sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -3026,9 +3033,9 @@ } }, "node_modules/globals": { - "version": "13.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.18.0.tgz", - "integrity": "sha512-/mR4KI8Ps2spmoc0Ulu9L7agOF0du1CZNQ3dke8yItYlyKNmGrkONemBbd6V8UTc1Wgcqn21t3WYB7dbRmh6/A==", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -4101,9 +4108,9 @@ } }, "node_modules/libphonenumber-js": { - "version": "1.10.14", - "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.14.tgz", - "integrity": "sha512-McGS7GV/WjJ2KjfOGhJU1oJn29RYeo7Q+RpANRbUNMQ9gj5XArpbjurSuyYPTejFwbaUojstQ4XyWCrAzGOUXw==" + "version": "1.10.15", + "resolved": "https://registry.npmjs.org/libphonenumber-js/-/libphonenumber-js-1.10.15.tgz", + "integrity": "sha512-sLeVLmWX17VCKKulc+aDIRHS95TxoTsKMRJi5s5gJdwlqNzMWcBCtSHHruVyXjqfi67daXM2SnLf2juSrdx5Sg==" }, "node_modules/lines-and-columns": { "version": "1.2.4", @@ -4321,9 +4328,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", - "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.7.tgz", + "integrity": "sha512-EJ3rzxL9pTWPjk5arA0s0dgXpnyiAbJDE6wHT62g7VsgrgQgmmZ+Ru++M1BFofncWja+Pnn3rEr3fieRySAdKQ==", "dev": true }, "node_modules/normalize-path": { @@ -5060,6 +5067,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -5353,23 +5361,14 @@ "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==" }, "node_modules/tslog": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/tslog/-/tslog-3.3.4.tgz", - "integrity": "sha512-N0HHuHE0e/o75ALfkioFObknHR5dVchUad4F0XyFf3gXJYB++DewEzwGI/uIOM216E5a43ovnRNEeQIq9qgm4Q==", - "dependencies": { - "source-map-support": "^0.5.21" - }, + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/tslog/-/tslog-4.4.4.tgz", + "integrity": "sha512-+IJBVcB6h4BhMH3+IvB69lDZ/5ClHX40I66bGTKPAx+/S9nDqJCYN323MxR/gch3Agvrwif4HQorI/YLqAeoNA==", "engines": { - "node": ">=10" - } - }, - "node_modules/tslog/node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "node": ">=16" + }, + "funding": { + "url": "https://github.com/fullstack-build/tslog?sponsor=1" } }, "node_modules/tsutils": { @@ -5439,9 +5438,9 @@ } }, "node_modules/typescript": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz", - "integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==", + "version": "4.9.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.4.tgz", + "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==", "dev": true, "peer": true, "bin": { diff --git a/packages/jitar-nodejs-server/package.json b/packages/jitar-nodejs-server/package.json index 04e4dc1f..d51303f1 100644 --- a/packages/jitar-nodejs-server/package.json +++ b/packages/jitar-nodejs-server/package.json @@ -1,6 +1,6 @@ { "name": "jitar-nodejs-server", - "version": "0.2.1", + "version": "0.2.2", "description": "NodeJS server implementation for Jitar.", "author": "Masking Technology (https://jitar.dev)", "license": "MIT", @@ -22,14 +22,14 @@ "dependencies": { "@overnightjs/core": "^1.7.6", "class-transformer": "^0.5.1", - "class-validator": "^0.13.2", + "class-validator": "^0.14.0", "express": "^4.18.1", "express-http-proxy": "^1.6.3", "fs-extra": "^11.1.0", "glob": "^8.0.3", "glob-promise": "^5.0.0", "mime-types": "^2.1.35", - "tslog": "^3.3.3", + "tslog": "^4.4.4", "yargs": "^17.6.0", "jitar": "^0.2.1" }, From fc821057eb9a8b1ac8691a6fb360a5e1cb6507ca Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Tue, 13 Dec 2022 15:49:35 +0100 Subject: [PATCH 2/3] Added type to logger for tslog 4 --- .../jitar-nodejs-server/src/controllers/AssetsController.ts | 4 ++-- .../jitar-nodejs-server/src/controllers/HealthController.ts | 4 ++-- .../jitar-nodejs-server/src/controllers/ModulesController.ts | 4 ++-- .../jitar-nodejs-server/src/controllers/NodesController.ts | 4 ++-- .../src/controllers/ProceduresController.ts | 4 ++-- .../jitar-nodejs-server/src/controllers/ProxyController.ts | 4 ++-- packages/jitar-nodejs-server/src/controllers/RPCController.ts | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/jitar-nodejs-server/src/controllers/AssetsController.ts b/packages/jitar-nodejs-server/src/controllers/AssetsController.ts index d91631f5..1cf2c07d 100644 --- a/packages/jitar-nodejs-server/src/controllers/AssetsController.ts +++ b/packages/jitar-nodejs-server/src/controllers/AssetsController.ts @@ -10,9 +10,9 @@ export default class AssetsController { #repository: LocalRepository | Proxy; #indexFile: string; - #logger: Logger; + #logger: Logger; - constructor(app: express.Application, repository: LocalRepository | Proxy, indexFile: string, logger: Logger) + constructor(app: express.Application, repository: LocalRepository | Proxy, indexFile: string, logger: Logger) { this.#repository = repository; this.#indexFile = indexFile; diff --git a/packages/jitar-nodejs-server/src/controllers/HealthController.ts b/packages/jitar-nodejs-server/src/controllers/HealthController.ts index f46d92cd..656e008f 100644 --- a/packages/jitar-nodejs-server/src/controllers/HealthController.ts +++ b/packages/jitar-nodejs-server/src/controllers/HealthController.ts @@ -9,9 +9,9 @@ import { LocalNode, Proxy } from 'jitar'; export default class HealthController { #node: LocalNode | Proxy; - #logger: Logger; + #logger: Logger; - constructor(node: LocalNode | Proxy, logger: Logger) + constructor(node: LocalNode | Proxy, logger: Logger) { this.#node = node; this.#logger = logger; diff --git a/packages/jitar-nodejs-server/src/controllers/ModulesController.ts b/packages/jitar-nodejs-server/src/controllers/ModulesController.ts index b1149ad3..3e814aab 100644 --- a/packages/jitar-nodejs-server/src/controllers/ModulesController.ts +++ b/packages/jitar-nodejs-server/src/controllers/ModulesController.ts @@ -9,9 +9,9 @@ import { ClientId, LocalRepository, Proxy, ValueSerializer } from 'jitar'; export default class ModulesController { #repository: LocalRepository | Proxy; - #logger: Logger; + #logger: Logger; - constructor(repository: LocalRepository | Proxy, logger: Logger) + constructor(repository: LocalRepository | Proxy, logger: Logger) { this.#repository = repository; this.#logger = logger; diff --git a/packages/jitar-nodejs-server/src/controllers/NodesController.ts b/packages/jitar-nodejs-server/src/controllers/NodesController.ts index bbaee559..86c95b16 100644 --- a/packages/jitar-nodejs-server/src/controllers/NodesController.ts +++ b/packages/jitar-nodejs-server/src/controllers/NodesController.ts @@ -12,9 +12,9 @@ import DataConverter from '../utils/DataConverter.js'; export default class NodesController { #gateway: LocalGateway; - #logger: Logger; + #logger: Logger; - constructor(gateway: LocalGateway, logger: Logger) + constructor(gateway: LocalGateway, logger: Logger) { this.#gateway = gateway; this.#logger = logger; diff --git a/packages/jitar-nodejs-server/src/controllers/ProceduresController.ts b/packages/jitar-nodejs-server/src/controllers/ProceduresController.ts index 83f3000f..09abc666 100644 --- a/packages/jitar-nodejs-server/src/controllers/ProceduresController.ts +++ b/packages/jitar-nodejs-server/src/controllers/ProceduresController.ts @@ -9,9 +9,9 @@ import { LocalGateway, LocalNode, Proxy } from 'jitar'; export default class ProceduresController { #runtime: LocalGateway | LocalNode | Proxy; - #logger: Logger; + #logger: Logger; - constructor(runtime: LocalGateway | LocalNode | Proxy, logger: Logger) + constructor(runtime: LocalGateway | LocalNode | Proxy, logger: Logger) { this.#runtime = runtime; this.#logger = logger; diff --git a/packages/jitar-nodejs-server/src/controllers/ProxyController.ts b/packages/jitar-nodejs-server/src/controllers/ProxyController.ts index 59ace2c0..54b59e2a 100644 --- a/packages/jitar-nodejs-server/src/controllers/ProxyController.ts +++ b/packages/jitar-nodejs-server/src/controllers/ProxyController.ts @@ -10,12 +10,12 @@ import { Proxy } from 'jitar'; @Controller('') export default class ProxyController { - #logger: Logger; + #logger: Logger; #repositoryUrl: string; #runnerUrl: string; - constructor(app: express.Application, proxy: Proxy, logger: Logger) + constructor(app: express.Application, proxy: Proxy, logger: Logger) { this.#logger = logger; diff --git a/packages/jitar-nodejs-server/src/controllers/RPCController.ts b/packages/jitar-nodejs-server/src/controllers/RPCController.ts index 433a8738..bdc6cdc0 100644 --- a/packages/jitar-nodejs-server/src/controllers/RPCController.ts +++ b/packages/jitar-nodejs-server/src/controllers/RPCController.ts @@ -14,10 +14,10 @@ const NOT_FOUND_ERRORS = [ImplementationNotFound, ProcedureNotFound]; export default class RPCController { #runtime: ProcedureContainer; - #logger: Logger; + #logger: Logger; #useSerializer: boolean; - constructor(runtime: ProcedureContainer, logger: Logger, useSerializer: boolean) + constructor(runtime: ProcedureContainer, logger: Logger, useSerializer: boolean) { this.#runtime = runtime; this.#logger = logger; From 38acbb7ed3d32400c220fee703b6ef448e7f5d53 Mon Sep 17 00:00:00 2001 From: Bas Meeuwissen Date: Tue, 13 Dec 2022 20:23:52 +0100 Subject: [PATCH 3/3] Implemented LogBuilder --- .../jitar-nodejs-server/src/JitarServer.ts | 26 ++++------ .../src/configuration/ServerOptions.ts | 4 +- .../src/utils/LogBuilder.ts | 48 +++++++++++++++++++ 3 files changed, 60 insertions(+), 18 deletions(-) create mode 100644 packages/jitar-nodejs-server/src/utils/LogBuilder.ts diff --git a/packages/jitar-nodejs-server/src/JitarServer.ts b/packages/jitar-nodejs-server/src/JitarServer.ts index 7b8b3be7..8a0c0c88 100644 --- a/packages/jitar-nodejs-server/src/JitarServer.ts +++ b/packages/jitar-nodejs-server/src/JitarServer.ts @@ -1,7 +1,7 @@ import { Server as OvernightServer } from '@overnightjs/core'; import bodyParser from 'body-parser'; -import { Logger, TLogLevelName } from 'tslog'; +import { Logger } from 'tslog'; import { HealthCheck, LocalGateway, LocalNode, LocalRepository, Proxy, Runtime } from 'jitar'; @@ -22,6 +22,7 @@ import RuntimeConfiguration from './configuration/RuntimeConfiguration.js'; import RuntimeDefaults from './definitions/RuntimeDefaults.js'; import RuntimeNotAvaiable from './errors/RuntimeNotAvaiable.js'; +import LogBuilder from './utils/LogBuilder.js'; const STARTUP_MESSAGE = ` ██ ██ ████████ █████ ██████ @@ -53,7 +54,7 @@ export default class JitarServer extends OvernightServer const configuration = await RuntimeConfigurationLoader.load(options.config); const runtime = await RuntimeConfigurator.configure(configuration); - const logger = this.#createLogger(options.loglevel); + const logger = LogBuilder.build(options.loglevel); this.#addControllers(configuration, runtime, logger); @@ -76,16 +77,7 @@ export default class JitarServer extends OvernightServer this.#runtime.addHealthCheck(name, healthCheck); } - #createLogger(level: string): Logger - { - return new Logger( - { - displayFilePath: 'hidden', - minLevel: level as TLogLevelName - }); - } - - #addControllers(configuration: RuntimeConfiguration, runtime: Runtime, logger: Logger): void + #addControllers(configuration: RuntimeConfiguration, runtime: Runtime, logger: Logger): void { if (configuration.standalone !== undefined && runtime instanceof Proxy) { @@ -113,7 +105,7 @@ export default class JitarServer extends OvernightServer } } - #addStandAloneControllers(proxy: Proxy, logger: Logger, index: string): void + #addStandAloneControllers(proxy: Proxy, logger: Logger, index: string): void { super.addControllers(new HealthController(proxy, logger)); super.addControllers(new JitarController(this.app)); @@ -123,28 +115,28 @@ export default class JitarServer extends OvernightServer super.addControllers(new AssetsController(this.app, proxy, index, logger)); } - #addRepositoryControllers(repository: LocalRepository, logger: Logger, index: string): void + #addRepositoryControllers(repository: LocalRepository, logger: Logger, index: string): void { super.addControllers(new JitarController(this.app)); super.addControllers(new ModulesController(repository, logger)); super.addControllers(new AssetsController(this.app, repository, index, logger)); } - #addGatewayControllers(gateway: LocalGateway, logger: Logger): void + #addGatewayControllers(gateway: LocalGateway, logger: Logger): void { super.addControllers(new NodesController(gateway, logger)); super.addControllers(new ProceduresController(gateway, logger)); super.addControllers(new RPCController(gateway, logger, false)); } - #addNodeControllers(node: LocalNode, logger: Logger): void + #addNodeControllers(node: LocalNode, logger: Logger): void { super.addControllers(new HealthController(node, logger)); super.addControllers(new ProceduresController(node, logger)); super.addControllers(new RPCController(node, logger, true)); } - #addProxyControllers(proxy: Proxy, logger: Logger): void + #addProxyControllers(proxy: Proxy, logger: Logger): void { super.addControllers(new ProxyController(this.app, proxy, logger)); } diff --git a/packages/jitar-nodejs-server/src/configuration/ServerOptions.ts b/packages/jitar-nodejs-server/src/configuration/ServerOptions.ts index f16c1f21..dae98d72 100644 --- a/packages/jitar-nodejs-server/src/configuration/ServerOptions.ts +++ b/packages/jitar-nodejs-server/src/configuration/ServerOptions.ts @@ -1,10 +1,12 @@ -import { Contains, IsOptional, IsString } from 'class-validator'; +import { Contains, IsEnum, IsOptional, IsString } from 'class-validator'; +import { LogLevel } from '../utils/LogBuilder.js'; export default class ServerOptions { @IsString() @IsOptional() + @IsEnum(LogLevel) loglevel = 'info'; @IsString() diff --git a/packages/jitar-nodejs-server/src/utils/LogBuilder.ts b/packages/jitar-nodejs-server/src/utils/LogBuilder.ts new file mode 100644 index 00000000..98e1470a --- /dev/null +++ b/packages/jitar-nodejs-server/src/utils/LogBuilder.ts @@ -0,0 +1,48 @@ + +import { Logger } from 'tslog'; + +export enum LogLevel +{ + DEBUG = 'debug', + INFO = 'info', + WARN = 'warn', + ERROR = 'error', + FATAL = 'fatal' +} + +export default class LogBuilder +{ + static build(level: string): Logger + { + const logConfiguration = this.#getLogConfiguration(level); + + return new Logger(logConfiguration); + } + + static #getLogConfiguration(level: string): object + { + const logLevel = this.#getLogLevel(level); + + return { + prettyLogTemplate: "{{dateIsoStr}}\t{{logLevelName}}\t", + minLevel: logLevel + }; + } + + static #getLogLevel(level: string): number + { + switch (level) + { + case LogLevel.FATAL: + return 6; + case LogLevel.ERROR: + return 5; + case LogLevel.WARN: + return 4; + case LogLevel.INFO: + return 3; + default: + return 2; + } + } +}