fix: resolve pipeline warnings

- Fix ESLint unused variable warnings in auto-init-db.js
- Downgrade cross-env to v7.0.3 (compatible with Node 18)
- Fix npm audit high severity vulnerability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
soufiane 2025-12-06 16:43:09 +01:00
parent 86d1850f9b
commit 48995d2869
3 changed files with 21 additions and 27 deletions

42
package-lock.json generated
View File

@ -31,7 +31,7 @@
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.39.0", "@eslint/js": "^9.39.0",
"cross-env": "^10.1.0", "cross-env": "^7.0.3",
"eslint": "^9.39.0", "eslint": "^9.39.0",
"jest": "^30.2.0", "jest": "^30.2.0",
"nodemon": "^3.1.10", "nodemon": "^3.1.10",
@ -568,13 +568,6 @@
"tslib": "^2.4.0" "tslib": "^2.4.0"
} }
}, },
"node_modules/@epic-web/invariant": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz",
"integrity": "sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==",
"dev": true,
"license": "MIT"
},
"node_modules/@eslint-community/eslint-utils": { "node_modules/@eslint-community/eslint-utils": {
"version": "4.9.0", "version": "4.9.0",
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz",
@ -2636,21 +2629,22 @@
} }
}, },
"node_modules/cross-env": { "node_modules/cross-env": {
"version": "10.1.0", "version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz",
"integrity": "sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==", "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@epic-web/invariant": "^1.0.0", "cross-spawn": "^7.0.1"
"cross-spawn": "^7.0.6"
}, },
"bin": { "bin": {
"cross-env": "dist/bin/cross-env.js", "cross-env": "src/bin/cross-env.js",
"cross-env-shell": "dist/bin/cross-env-shell.js" "cross-env-shell": "src/bin/cross-env-shell.js"
}, },
"engines": { "engines": {
"node": ">=20" "node": ">=10.14",
"npm": ">=6",
"yarn": ">=1"
} }
}, },
"node_modules/cross-spawn": { "node_modules/cross-spawn": {
@ -4916,12 +4910,12 @@
} }
}, },
"node_modules/jsonwebtoken/node_modules/jws": { "node_modules/jsonwebtoken/node_modules/jws": {
"version": "3.2.2", "version": "3.2.3",
"resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz",
"integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", "integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"jwa": "^1.4.1", "jwa": "^1.4.2",
"safe-buffer": "^5.0.1" "safe-buffer": "^5.0.1"
} }
}, },
@ -4949,12 +4943,12 @@
} }
}, },
"node_modules/jws": { "node_modules/jws": {
"version": "4.0.0", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz",
"integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"jwa": "^2.0.0", "jwa": "^2.0.1",
"safe-buffer": "^5.0.1" "safe-buffer": "^5.0.1"
} }
}, },

View File

@ -45,7 +45,7 @@
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.39.0", "@eslint/js": "^9.39.0",
"cross-env": "^10.1.0", "cross-env": "^7.0.3",
"eslint": "^9.39.0", "eslint": "^9.39.0",
"jest": "^30.2.0", "jest": "^30.2.0",
"nodemon": "^3.1.10", "nodemon": "^3.1.10",

View File

@ -51,7 +51,7 @@ async function ticketsExist() {
try { try {
const result = await pool.query('SELECT COUNT(*) as count FROM tickets'); const result = await pool.query('SELECT COUNT(*) as count FROM tickets');
return parseInt(result.rows[0].count) >= TOTAL_TICKETS; return parseInt(result.rows[0].count) >= TOTAL_TICKETS;
} catch (error) { } catch {
return false; return false;
} }
} }
@ -66,7 +66,7 @@ async function usersExist() {
WHERE email IN ('admin@thetiptop.com', 'employee1@thetiptop.com') WHERE email IN ('admin@thetiptop.com', 'employee1@thetiptop.com')
`); `);
return parseInt(result.rows[0].count) >= 2; return parseInt(result.rows[0].count) >= 2;
} catch (error) { } catch {
return false; return false;
} }
} }