Clean Sonar findings: merge RUNs, drop commented code, update node imports
All checks were successful
build-and-push / lint (push) Successful in 4s
build-and-push / sonar (push) Successful in 11s
build-and-push / docker (push) Successful in 1m13s

This commit is contained in:
nocci 2025-12-30 15:39:11 +00:00
parent 37ffd09545
commit 405e801851
7 changed files with 44 additions and 72 deletions

View file

@ -6,33 +6,38 @@ const URL_CLAIM = 'https://gaming.amazon.com/home'; // dummy URL
console.debug('NOTIFY:', cfg.notify);
if (true) {
const notify_games = [
// { title: 'Kerbal Space Program', status: 'claimed', url: URL_CLAIM },
// { title: "Shadow Tactics - Aiko's Choice", status: 'claimed', url: URL_CLAIM },
{ title: 'Epistory - Typing Chronicles', status: 'claimed', url: URL_CLAIM },
];
await notify(`epic-games:<br>${html_game_list(notify_games)}`);
}
const scenarios = [
{
enabled: process.env.TEST_NOTIFY_EPIC === '1',
title: 'epic-games',
games: [
{ title: 'Epistory - Typing Chronicles', status: 'claimed', url: URL_CLAIM },
],
},
{
enabled: process.env.TEST_NOTIFY_PG === '1',
delayMs: 1000,
title: 'prime-gaming',
games: [
{ title: 'Faraway 2: Jungle Escape', status: 'claimed', url: URL_CLAIM },
{ title: 'Chicken Police - Paint it RED!', status: 'claimed', url: URL_CLAIM },
{ title: 'Lawn Mowing Simulator', status: 'claimed', url: URL_CLAIM },
{ title: 'Breathedge', status: 'claimed', url: URL_CLAIM },
{ title: 'The Evil Within 2', status: `<a href="${URL_CLAIM}">redeem</a> H97S6FB38FA6D09DEA on gog.com`, url: URL_CLAIM },
{ title: 'Beat Cop', status: `<a href="${URL_CLAIM}">redeem</a> BMKM8558EC55F7B38F on gog.com`, url: URL_CLAIM },
{ title: 'Dishonored 2', status: `<a href="${URL_CLAIM}">redeem</a> NNEK0987AB20DFBF8F on gog.com`, url: URL_CLAIM },
],
},
{
enabled: process.env.TEST_NOTIFY_GOG === '1',
delayMs: 1000,
title: 'gog',
games: [{ title: 'Haven Park', status: 'claimed', url: URL_CLAIM }],
},
];
if (false) {
await delay(1000);
const notify_games = [
{ title: 'Faraway 2: Jungle Escape', status: 'claimed', url: URL_CLAIM },
{ title: 'Chicken Police - Paint it RED!', status: 'claimed', url: URL_CLAIM },
{ title: 'Lawn Mowing Simulator', status: 'claimed', url: URL_CLAIM },
{ title: 'Breathedge', status: 'claimed', url: URL_CLAIM },
{ title: 'The Evil Within 2', status: `<a href="${URL_CLAIM}">redeem</a> H97S6FB38FA6D09DEA on gog.com`, url: URL_CLAIM },
{ title: 'Beat Cop', status: `<a href="${URL_CLAIM}">redeem</a> BMKM8558EC55F7B38F on gog.com`, url: URL_CLAIM },
{ title: 'Dishonored 2', status: `<a href="${URL_CLAIM}">redeem</a> NNEK0987AB20DFBF8F on gog.com`, url: URL_CLAIM },
];
notify(`prime-gaming:<br>${html_game_list(notify_games)}`);
}
if (false) {
await delay(1000);
const notify_games = [
{ title: 'Haven Park', status: 'claimed', url: URL_CLAIM },
];
notify(`gog:<br>${html_game_list(notify_games)}`);
for (const scenario of scenarios) {
if (!scenario.enabled) continue;
if (scenario.delayMs) await delay(scenario.delayMs);
await notify(`${scenario.title}:<br>${html_game_list(scenario.games)}`);
}