From 56cfab6e21c3b8e86f9066f2019e1cfd69e8ea2a Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 28 Dec 2023 11:28:23 +0100 Subject: [PATCH 001/134] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dfb5c92..265bfad 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ _Works on Windows/macOS/Linux._ Raspberry Pi (3, 4, Zero 2): [requires 64-bit OS](https://github.com/vogler/free-games-claimer/issues/3) like Raspberry Pi OS or Ubuntu (Raspbian won't work since it's 32-bit). ## How to run -Easy option: [install Docker](https://docs.docker.com/get-docker/) (or [podman](https://podman-desktop.io/)) and run this command in a terminal (Windows: `cmd`, `.bat` file): +Easy option: [install Docker](https://docs.docker.com/get-docker/) (or [podman](https://podman-desktop.io/)) and run this command in a terminal: ``` docker run --rm -it -p 6080:6080 -v fgc:/fgc/data --pull=always ghcr.io/vogler/free-games-claimer ``` @@ -156,7 +156,7 @@ If you want it to run regularly, you have to schedule the runs yourself: - Linux/macOS: `crontab -e` ([example](https://github.com/vogler/free-games-claimer/discussions/56)) - macOS: [launchd](https://stackoverflow.com/questions/132955/how-do-i-set-a-task-to-run-every-so-often) -- Windows: [task scheduler](https://active-directory-wp.com/docs/Usage/How_to_add_a_cron_job_on_Windows/Scheduled_tasks_and_cron_jobs_on_Windows/index.html), [other options](https://stackoverflow.com/questions/132971/what-is-the-windows-version-of-cron) +- Windows: [task scheduler](https://active-directory-wp.com/docs/Usage/How_to_add_a_cron_job_on_Windows/Scheduled_tasks_and_cron_jobs_on_Windows/index.html), [other options](https://stackoverflow.com/questions/132971/what-is-the-windows-version-of-cron), or just put the command in a `.bat` file in Autostart if you restart often... - any OS: use a process manager like [pm2](https://pm2.keymetrics.io/docs/usage/restart-strategies/) - Docker Compose `command: bash -c "node epic-games; node prime-gaming; node gog; echo sleeping; sleep 1d"` additionally add `restart: unless-stopped` to it. From 7ca79bd4139d61eabc05a50326356923c1350f48 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 28 Dec 2023 17:31:18 +0100 Subject: [PATCH 002/134] eg: debug window.screen --- epic-games.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index 1a2b602..2644c40 100644 --- a/epic-games.js +++ b/epic-games.js @@ -41,8 +41,10 @@ await stealth(context); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist + +// some debug info about the page (screen dimensions, user agent, platform) // eslint-disable-next-line no-undef -if (cfg.debug) console.debug(await page.evaluate(() => [window.screen, navigator.userAgent, navigator.platform])); +if (cfg.debug) console.debug(await page.evaluate(() => [(({ width, height, availWidth, availHeight }) => ({ width, height, availWidth, availHeight }))(window.screen), navigator.userAgent, navigator.platform, navigator.vendor])); // deconstruct screen needed since `window.screen` prints {}, `window.screen.toString()` '[object Screen]', and can't use some pick function without defining it on `page` if (cfg.debug_network) { // const filter = _ => true; const filter = r => r.url().includes('store.epicgames.com'); From c3657f05ac6440563b5bf82cd3db37941d8bf1b5 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 28 Dec 2023 17:56:09 +0100 Subject: [PATCH 003/134] workaround for cropped viewport (Playwright regression), fixes #277 --- epic-games.js | 1 + gog.js | 1 + prime-gaming.js | 1 + unrealengine.js | 1 + xbox.js | 1 + 5 files changed, 5 insertions(+) diff --git a/epic-games.js b/epic-games.js index 2644c40..55d9ad7 100644 --- a/epic-games.js +++ b/epic-games.js @@ -41,6 +41,7 @@ await stealth(context); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist +await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it // some debug info about the page (screen dimensions, user agent, platform) // eslint-disable-next-line no-undef diff --git a/gog.js b/gog.js index 048e04a..651afa6 100644 --- a/gog.js +++ b/gog.js @@ -25,6 +25,7 @@ handleSIGINT(context); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist +await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it // console.debug('userAgent:', await page.evaluate(() => navigator.userAgent)); const notify_games = []; diff --git a/prime-gaming.js b/prime-gaming.js index 7b7f18b..3868274 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -31,6 +31,7 @@ await stealth(context); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist +await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it // console.debug('userAgent:', await page.evaluate(() => navigator.userAgent)); const notify_games = []; diff --git a/unrealengine.js b/unrealengine.js index bfd3417..e67633e 100644 --- a/unrealengine.js +++ b/unrealengine.js @@ -36,6 +36,7 @@ await stealth(context); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist +await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it // console.debug('userAgent:', await page.evaluate(() => navigator.userAgent)); const notify_games = []; diff --git a/xbox.js b/xbox.js index 008388c..b2406cc 100644 --- a/xbox.js +++ b/xbox.js @@ -32,6 +32,7 @@ if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist +await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it const notify_games = []; let user; From 0ec24ef0620d3053645c11b8e41e2c8c75c34668 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sat, 30 Dec 2023 13:37:04 +0100 Subject: [PATCH 004/134] fix import paths for test/ --- test/notify.js | 4 ++-- test/sigint-enquirer-raw.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/notify.js b/test/notify.js index 3479076..6d89086 100644 --- a/test/notify.js +++ b/test/notify.js @@ -1,6 +1,6 @@ /* eslint-disable no-constant-condition */ -import { delay, html_game_list, notify } from '../util.js'; -import { cfg } from '../config.js'; +import { delay, html_game_list, notify } from '../src/util.js'; +import { cfg } from '../src/config.js'; const URL_CLAIM = 'https://gaming.amazon.com/home'; // dummy URL diff --git a/test/sigint-enquirer-raw.js b/test/sigint-enquirer-raw.js index 0459aa7..0a95892 100644 --- a/test/sigint-enquirer-raw.js +++ b/test/sigint-enquirer-raw.js @@ -1,5 +1,5 @@ // https://github.com/enquirer/enquirer/issues/372 -import { prompt } from '../util.js'; +import { prompt } from '../src/util.js'; const handleSIGINT = () => process.on('SIGINT', () => { // e.g. when killed by Ctrl-C console.log('\nInterrupted by SIGINT. Exit!'); From 28bcceb285ef7e4ccc0e4d0c1ba5a074fd29904b Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sun, 31 Dec 2023 16:58:56 +0100 Subject: [PATCH 005/134] eg: enter date of birth if age confirmation pops up, #275 --- epic-games.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epic-games.js b/epic-games.js index 55d9ad7..68a2dde 100644 --- a/epic-games.js +++ b/epic-games.js @@ -148,6 +148,12 @@ try { console.log(' This game contains mature content recommended only for ages 18+'); if (await page.locator('[data-testid="AgeSelect"]').count()) { console.error(' Got "To continue, please provide your date of birth" - This shouldn\'t happen due to cookie set above. Please report to https://github.com/vogler/free-games-claimer/issues/275'); + await page.locator('#month_toggle').click(); + await page.locator('#month_menu li:has-text("01")').click(); + await page.locator('#day_toggle').click(); + await page.locator('#day_menu li:has-text("01")').click(); + await page.locator('#year_toggle').click(); + await page.locator('#year_menu li:has-text("1987")').click(); } await page.click('button:has-text("Continue")', { delay: 111 }); await page.waitForTimeout(2000); From fc810af80e72d08ac5f871ea7fb512303109f1e4 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 11 Jan 2024 15:58:56 +0100 Subject: [PATCH 006/134] Update README.md: add Repobeats insights --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 265bfad..754df22 100644 --- a/README.md +++ b/README.md @@ -213,6 +213,8 @@ Added notifications via [apprise](https://github.com/caronc/apprise). [![Star History Chart](https://api.star-history.com/svg?repos=vogler/free-games-claimer&type=Date)](https://star-history.com/#vogler/free-games-claimer&Date) +![Alt](https://repobeats.axiom.co/api/embed/a1c5e6e420d90e0d6b34c1285e92a69a44138faa.svg "Repobeats analytics image") + --- Logo with smaller aspect ratio (for Telegram bot etc.): 👾 - [emojipedia](https://emojipedia.org/alien-monster/) From e4e4ce703df9f018da9b848e3b60193504469f72 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 13 Feb 2024 23:45:10 +0100 Subject: [PATCH 007/134] pg: also get and store url for internal games --- prime-gaming.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index 3868274..4bb0d1f 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -112,12 +112,14 @@ try { for (const card of internal) { await card.scrollIntoViewIfNeeded(); const title = await (await card.$('.item-card-details__body__primary')).innerText(); + const slug = await (await card.$('a')).getAttribute('href'); + const url = 'https://gaming.amazon.com' + slug.split('?')[0]; console.log('Current free game:', title); if (cfg.dryrun) continue; if (cfg.interactive && !await confirm()) continue; await (await card.$('.tw-button:has-text("Claim")')).click(); - db.data[user][title] ||= { title, time: datetime(), store: 'internal' }; - notify_games.push({ title, status: 'claimed', url: URL_CLAIM }); + db.data[user][title] ||= { title, time: datetime(), url, store: 'internal' }; + notify_games.push({ title, status: 'claimed', url }); // const img = await (await card.$('img.tw-image')).getAttribute('src'); // console.log('Image:', img); await card.screenshot({ path: screenshot('internal', `${filenamify(title)}.png`) }); From 2ea0c611e4da2729ea16fafadf576017c566cca6 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 13 Feb 2024 23:48:48 +0100 Subject: [PATCH 008/134] pg: fix claiming external games, detect store early in description, delete old code --- prime-gaming.js | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index 4bb0d1f..b555f67 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -138,30 +138,12 @@ try { console.log('Current free game:', title); // , url); await page.goto(url, { waitUntil: 'domcontentloaded' }); if (cfg.debug) await page.pause(); + const item_text = await page.innerText('[data-a-target="DescriptionItemDetails"]'); + const store = item_text.toLowerCase().replace(/.* on /, '').slice(0, -1); + console.log(' External store:', store); if (cfg.dryrun) continue; if (cfg.interactive && !await confirm()) continue; - await Promise.any([page.click('.tw-button:has-text("Get game")'), page.click('.tw-button:has-text("Claim")'), page.click('.tw-button:has-text("Complete Claim")'), page.waitForSelector('div:has-text("Link game account")'), page.waitForSelector('.thank-you-title:has-text("Success")')]); // waits for navigation - - // TODO would be simpler than the below, but will block for linked stores without code - // const redeem_text = await page.textContent('text=/ code on /'); // FAQ: How do I redeem my code? - // console.log(' ', redeem_text); - // // Before July 29, 2023, redeem your offer code on GOG.com. - // // Before July 1, 2023, redeem your product code on Legacy Games. - // let store = redeem_text.toLowerCase().replace(/.* on /, '').slice(0, -1); - - let store = ''; - const store_text = await page.$('[data-a-target="hero-header-subtitle"]'); // worked fine for every store, but now no longer works for gog.com - if (store_text) { // legacy games, ? - const store_texts = await store_text.innerText(); - // Full game for PC [and MAC] on: Legacy Games, Origin, EPIC GAMES, Battle.net; alt: 3 Full PC Games on Legacy Games - store = store_texts.toLowerCase().replace(/.* on /, ''); - } else { // gog.com, ? - // $('[data-a-target="DescriptionItemDetails"]').innerText is e.g. 'Prey for PC on GOG.com.' but does not work for Legacy Games - const item_text = await page.innerText('[data-a-target="DescriptionItemDetails"]'); - store = item_text.toLowerCase().replace(/.* on /, '').slice(0, -1); - } - console.log(' External store:', store); - + await Promise.any([page.click('[data-a-target="buy-box"] .tw-button:has-text("Get game")'), page.click('[data-a-target="buy-box"] .tw-button:has-text("Claim")'), page.click('.tw-button:has-text("Complete Claim")'), page.waitForSelector('div:has-text("Link game account")'), page.waitForSelector('.thank-you-title:has-text("Success")')]); // waits for navigation db.data[user][title] ||= { title, time: datetime(), url, store }; const notify_game = { title, url }; notify_games.push(notify_game); // status is updated below From 285c7a44fd997c11706f8c667be1c83da23087b1 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 29 Feb 2024 16:35:02 +0100 Subject: [PATCH 009/134] README.md: comment alternative starchart.cc --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 754df22..cfdddec 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,7 @@ Added notifications via [apprise](https://github.com/caronc/apprise). [![Star History Chart](https://api.star-history.com/svg?repos=vogler/free-games-claimer&type=Date)](https://star-history.com/#vogler/free-games-claimer&Date) + ![Alt](https://repobeats.axiom.co/api/embed/a1c5e6e420d90e0d6b34c1285e92a69a44138faa.svg "Repobeats analytics image") From 61fdf566c9c2748ce06e35cd7262d314151c836d Mon Sep 17 00:00:00 2001 From: Rex Date: Fri, 1 Mar 2024 20:57:00 +0800 Subject: [PATCH 010/134] Resolve error with no default data --- xbox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbox.js b/xbox.js index b2406cc..67054ef 100644 --- a/xbox.js +++ b/xbox.js @@ -15,7 +15,7 @@ const URL_CLAIM = 'https://www.xbox.com/en-US/live/gold'; // #gameswithgold"; console.log(datetime(), 'started checking xbox'); -const db = await jsonDb('xbox.json'); +const db = await jsonDb('xbox.json', {}); db.data ||= {}; handleSIGINT(); From 6f06fccd461cf1cbb79dd2440c88222d4f52bfa8 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 7 Mar 2024 13:47:58 +0100 Subject: [PATCH 011/134] eslint: prefer-const --- eslint.config.js | 1 + src/util.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/eslint.config.js b/eslint.config.js index bc6447f..48b1cbc 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -24,6 +24,7 @@ export default [ // https://eslint.style/packages/js rules: { 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }], + 'prefer-const': 'error', '@stylistic/js/array-bracket-newline': ['error', 'consistent'], '@stylistic/js/array-bracket-spacing': 'error', '@stylistic/js/array-element-newline': ['error', 'consistent'], diff --git a/src/util.js b/src/util.js index f82102b..bda3f78 100644 --- a/src/util.js +++ b/src/util.js @@ -81,7 +81,7 @@ export const stealth = async context => { const evasion = await import(`puppeteer-extra-plugin-stealth/evasions/${e}/index.js`); evasion.default().onPageCreated(stealth); } - for (let evasion of stealth.callbacks) { + for (const evasion of stealth.callbacks) { await context.addInitScript(evasion.cb, evasion.a); } }; From da6964c19afbb24848c997b1d8b1f9995d360791 Mon Sep 17 00:00:00 2001 From: Targunitoth Date: Thu, 25 Apr 2024 13:51:40 +0200 Subject: [PATCH 012/134] Escape the apprise -b parameter --- src/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.js b/src/util.js index bda3f78..69cbf7a 100644 --- a/src/util.js +++ b/src/util.js @@ -116,7 +116,7 @@ export const notify = html => new Promise((resolve, reject) => { return resolve(); } // const cmd = `apprise '${cfg.notify}' ${title} -i html -b '${html}'`; // this had problems if e.g. ' was used in arg; could have `npm i shell-escape`, but instead using safer execFile which takes args as array instead of exec which spawned a shell to execute the command - const args = [cfg.notify, '-i', 'html', '-b', html]; + const args = [cfg.notify, '-i', 'html', '-b', `'${html}'`]; if (cfg.notify_title) args.push(...['-t', cfg.notify_title]); if (cfg.debug) console.debug(`apprise ${args.map(a => `'${a}'`).join(' ')}`); // this also doesn't escape, but it's just for info execFile('apprise', args, (error, stdout, stderr) => { From 3338d08a1d29584d7a209656b17266cd19b06c7a Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 2 May 2024 16:58:31 +0200 Subject: [PATCH 013/134] eg: fix title for Bundles, TODO got stuck after happened for 'LISA: The Definitive Edition' - https://store.epicgames.com/en-US/bundles/lisa-the-definitive-edition --- epic-games.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/epic-games.js b/epic-games.js index 68a2dde..b703de5 100644 --- a/epic-games.js +++ b/epic-games.js @@ -159,7 +159,13 @@ try { await page.waitForTimeout(2000); } - const title = await page.locator('h1').first().innerText(); + let title; + if (await page.locator('span:text-is("About Bundle")').count()) { + // console.log(' This is a bundle containing: TODO'); + title = (await page.locator('span:has-text("Buy"):left-of([data-testid="purchase-cta-button"])').first().innerText()).replace('Buy ', ''); + } else { + title = await page.locator('h1').first().innerText(); + } const game_id = page.url().split('/').pop(); db.data[user][game_id] ||= { title, time: datetime(), url: page.url() }; // this will be set on the initial run only! console.log('Current free game:', title); @@ -191,8 +197,8 @@ try { // Accept End User License Agreement (only needed once) page.locator('input#agree').waitFor().then(async () => { - console.log('Accept End User License Agreement (only needed once)'); - await page.locator('input#agree').check(); + console.log(' Accept End User License Agreement (only needed once)'); + await page.locator('input#agree').check(); // TODO Bundle: got stuck here await page.locator('button:has-text("Accept")').click(); }).catch(_ => { }); @@ -243,7 +249,7 @@ try { // console.info(' Saved a screenshot of hcaptcha challenge to', p); // console.error(' Got hcaptcha challenge. To avoid it, get a link from https://www.hcaptcha.com/accessibility'); // TODO save this link in config and visit it daily to set accessibility cookie to avoid captcha challenge? }).catch(_ => { }); // may time out if not shown - await page.locator('text=Thanks for your order!').waitFor({ state: 'attached' }); + await page.locator('text=Thanks for your order!').waitFor({ state: 'attached' }); // TODO Bundle: got stuck here db.data[user][game_id].status = 'claimed'; db.data[user][game_id].time = datetime(); // claimed time overwrites failed/dryrun time console.log(' Claimed successfully!'); From 075106da11ce4bb250a11a47ba232072e9546f1a Mon Sep 17 00:00:00 2001 From: Tymec Date: Sat, 18 May 2024 19:45:59 +0200 Subject: [PATCH 014/134] Update config.js --- src/config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config.js b/src/config.js index bd41c7d..4c32d59 100644 --- a/src/config.js +++ b/src/config.js @@ -49,4 +49,6 @@ export const cfg = { // experimmental - likely to change pg_redeem: process.env.PG_REDEEM == '1', // prime-gaming: redeem keys on external stores pg_claimdlc: process.env.PG_CLAIMDLC == '1', // prime-gaming: claim in-game content + // external stores + lg_email: process.env.LG_EMAIL || process.env.PG_EMAIL || process.env.EMAIL, // legacy-games: email to use for redeeming }; From 8c535f48fa8f2de63fe32cf4a000b962c3a60e6b Mon Sep 17 00:00:00 2001 From: Tymec Date: Sat, 18 May 2024 19:47:18 +0200 Subject: [PATCH 015/134] Update prime-gaming.js --- prime-gaming.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index b555f67..2bd705f 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -243,8 +243,8 @@ try { } } else if (store == 'legacy games') { await page2.fill('[name=coupon_code]', code); - await page2.fill('[name=email]', cfg.pg_email); // TODO option for sep. email? - await page2.fill('[name=email_validate]', cfg.pg_email); + await page2.fill('[name=email]', cfg.lg_email); + await page2.fill('[name=email_validate]', cfg.lg_email); await page2.uncheck('[name=newsletter_sub]'); await page2.click('[type="submit"]'); try { From c4ae3505b38f25361bf1a16ab2089fffc63e4d9f Mon Sep 17 00:00:00 2001 From: Tymec Date: Sat, 18 May 2024 19:50:13 +0200 Subject: [PATCH 016/134] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cfdddec..1491257 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ Available options/variables and their default values: | GOG_EMAIL | | GOG email for login. Overrides EMAIL. | | GOG_PASSWORD | | GOG password for login. Overrides PASSWORD. | | GOG_NEWSLETTER | 0 | Do not unsubscribe from newsletter after claiming a game if 1. | +| LG_EMAIL | | Legacy Games: email to use for redeeming (if not set, defaults to PG_EMAIL) | See `src/config.js` for all options. From e49fa930e0b426a497ca32e0d30cbfe707ece459 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 23 May 2024 15:54:23 +0200 Subject: [PATCH 017/134] eg: claim base game before add-on --- epic-games.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epic-games.js b/epic-games.js index b703de5..3ead561 100644 --- a/epic-games.js +++ b/epic-games.js @@ -185,6 +185,8 @@ try { const baseUrl = 'https://store.epicgames.com' + await page.locator('a:has-text("Overview")').getAttribute('href'); console.log(' Base game:', baseUrl); // await page.click('a:has-text("Overview")'); + urls.push(baseUrl); // add base game to the list of games to claim + urls.push(url); // add add-on itself again } else { // GET console.log(' Not in library yet! Click GET.'); await page.click('[data-testid="purchase-cta-button"]', { delay: 11 }); // got stuck here without delay (or mouse move), see #75, 1ms was also enough From 9ef9798626c7f6108b0eb76cb651f8027f7a6931 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 23 May 2024 15:55:07 +0200 Subject: [PATCH 018/134] eg: detect 'Failed to challenge captcha, please try again later.' --- epic-games.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epic-games.js b/epic-games.js index 3ead561..54ca597 100644 --- a/epic-games.js +++ b/epic-games.js @@ -251,6 +251,10 @@ try { // console.info(' Saved a screenshot of hcaptcha challenge to', p); // console.error(' Got hcaptcha challenge. To avoid it, get a link from https://www.hcaptcha.com/accessibility'); // TODO save this link in config and visit it daily to set accessibility cookie to avoid captcha challenge? }).catch(_ => { }); // may time out if not shown + iframe.locator('.payment__errors:has-text("Failed to challenge captcha, please try again later.")').waitFor().then(async () => { + console.error(' Failed to challenge captcha, please try again later.'); + await notify('epic-games: failed to challenge captcha. Please check.'); + }); await page.locator('text=Thanks for your order!').waitFor({ state: 'attached' }); // TODO Bundle: got stuck here db.data[user][game_id].status = 'claimed'; db.data[user][game_id].time = datetime(); // claimed time overwrites failed/dryrun time From f7c23569c7a40fa6f56d5a32d855e0b60c530a0e Mon Sep 17 00:00:00 2001 From: Vladimir Budylnikov Date: Sun, 2 Jun 2024 13:33:51 +0400 Subject: [PATCH 019/134] Update README.md I've made i howto for windows users --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cfdddec..a6e3825 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ If you want it to run regularly, you have to schedule the runs yourself: - Linux/macOS: `crontab -e` ([example](https://github.com/vogler/free-games-claimer/discussions/56)) - macOS: [launchd](https://stackoverflow.com/questions/132955/how-do-i-set-a-task-to-run-every-so-often) -- Windows: [task scheduler](https://active-directory-wp.com/docs/Usage/How_to_add_a_cron_job_on_Windows/Scheduled_tasks_and_cron_jobs_on_Windows/index.html), [other options](https://stackoverflow.com/questions/132971/what-is-the-windows-version-of-cron), or just put the command in a `.bat` file in Autostart if you restart often... +- Windows: [task scheduler](https://active-directory-wp.com/docs/Usage/How_to_add_a_cron_job_on_Windows/Scheduled_tasks_and_cron_jobs_on_Windows/index.html) ([example](https://github.com/vogler/free-games-claimer/wiki/%5BHowTo%5D-Schedule-runs-on-Windows)), [other options](https://stackoverflow.com/questions/132971/what-is-the-windows-version-of-cron), or just put the command in a `.bat` file in Autostart if you restart often... - any OS: use a process manager like [pm2](https://pm2.keymetrics.io/docs/usage/restart-strategies/) - Docker Compose `command: bash -c "node epic-games; node prime-gaming; node gog; echo sleeping; sleep 1d"` additionally add `restart: unless-stopped` to it. From cf59da5d9e74d49d684762625ae2446341115336 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sun, 23 Jun 2024 18:02:02 +0200 Subject: [PATCH 020/134] gog: new locators, fixes #326, #334 --- gog.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gog.js b/gog.js index 651afa6..de5d02f 100644 --- a/gog.js +++ b/gog.js @@ -93,10 +93,9 @@ try { if (!await banner.count()) { console.log('Currently no free giveaway!'); } else { - const text = await page.locator('.giveaway-banner__title').innerText(); - const title = text.match(/Claim (.*)/)[1]; - const slug = await banner.getAttribute('href'); - const url = `https://gog.com${slug}`; + const text = await page.locator('.giveaway__content-header').innerText(); + const title = text.match(/Claim (.*) and don't miss the/)[1]; + const url = await banner.locator('a').first().getAttribute('href'); console.log(`Current free game: ${title} - ${url}`); db.data[user][title] ||= { title, time: datetime(), url }; if (cfg.dryrun) process.exit(1); From f0f142733e0fd7e365a239fbc8d737a70a739cbc Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sun, 23 Jun 2024 19:14:13 +0200 Subject: [PATCH 021/134] ncu -u: lowdb 6 -> 7 dropped support for Node 16 --- package-lock.json | 647 ++++++++++++++++++++++++++-------------------- package.json | 12 +- src/util.js | 4 +- 3 files changed, 376 insertions(+), 287 deletions(-) diff --git a/package-lock.json b/package-lock.json index 930e7bf..3d1d878 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,16 +11,16 @@ "dependencies": { "chalk": "^5.3.0", "cross-env": "^7.0.3", - "dotenv": "^16.3.1", + "dotenv": "^16.4.5", "enquirer": "^2.4.1", - "lowdb": "^6.1.1", + "lowdb": "^7.0.1", "otplib": "^12.0.1", - "playwright-firefox": "^1.40.1", + "playwright-firefox": "^1.44.1", "puppeteer-extra-plugin-stealth": "^2.11.2" }, "devDependencies": { - "@stylistic/eslint-plugin-js": "^1.5.1", - "eslint": "^8.56.0" + "@stylistic/eslint-plugin-js": "^2.2.2", + "eslint": "^9.5.0" }, "engines": { "node": ">=15" @@ -59,16 +59,32 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "node_modules/@eslint/config-array": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.16.0.tgz", + "integrity": "sha512-/jmuSd74i4Czf1XXn7wGRWZCuyaUZ330NH1Bek0Pplatt4Sy1S5haN21SCLLdbeKslQ+S0wEJ+++v5YibSi+Lg==", "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -76,33 +92,30 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.5.0.tgz", + "integrity": "sha512-A7+AOT2ICkodvtsWnxZP4Xxk3NbZ3VMHd8oihydLRGrJgqqdEz1qSeEgXYyT/Cu8h1TWWsQRejIx48mtjZ5y1w==", "dev": true, + "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "node_modules/@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - }, + "license": "Apache-2.0", "engines": { - "node": ">=10.10.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@humanwhocodes/module-importer": { @@ -118,11 +131,19 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", - "dev": true + "node_modules/@humanwhocodes/retry": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", + "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -202,23 +223,37 @@ } }, "node_modules/@stylistic/eslint-plugin-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-1.5.1.tgz", - "integrity": "sha512-iZF0rF+uOhAmOJYOJx1Yvmm3CZ1uz9n0SRd9dpBYHA3QAvfABUORh9LADWwZCigjHJkp2QbCZelGFJGwGz7Siw==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.2.2.tgz", + "integrity": "sha512-Vj2Q1YHVvJw+ThtOvmk5Yx7wZanVrIBRUTT89horLDb4xdP9GA1um9XOYQC6j67VeUC2gjZQnz5/RVJMzaOhtw==", "dev": true, + "license": "MIT", "dependencies": { - "acorn": "^8.11.2", - "escape-string-regexp": "^4.0.0", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1" + "@types/eslint": "^8.56.10", + "acorn": "^8.11.3", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.0.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "peerDependencies": { "eslint": ">=8.40.0" } }, + "node_modules/@stylistic/eslint-plugin-js/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@types/debug": { "version": "4.1.8", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.8.tgz", @@ -227,22 +262,42 @@ "@types/ms": "*" } }, + "node_modules/@types/eslint": { + "version": "8.56.10", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", + "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/ms": { "version": "0.7.31", "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true - }, "node_modules/acorn": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", - "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -255,6 +310,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -264,6 +320,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -310,7 +367,8 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "dev": true, + "license": "Python-2.0" }, "node_modules/arr-union": { "version": "3.1.0", @@ -339,6 +397,7 @@ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -452,27 +511,16 @@ "node": ">=0.10.0" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "license": "BSD-2-Clause", "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" + "url": "https://dotenvx.com" } }, "node_modules/enquirer": { @@ -500,41 +548,38 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.5.0.tgz", + "integrity": "sha512-+NAOZFrW/jFTS3dASCGBxX1pkFD0/fsO+hfAkJ4TyYKwgsXZbqzrw+seCYFCcPCYXvnD67tAnglU7GQTz6kcVw==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/config-array": "^0.16.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.5.0", "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.0.1", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.0.1", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", @@ -548,23 +593,24 @@ "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://eslint.org/donate" } }, "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz", + "integrity": "sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -598,18 +644,45 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz", + "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==", + "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.11.3", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.0.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -632,6 +705,7 @@ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, @@ -653,6 +727,7 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, + "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } @@ -661,13 +736,15 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", @@ -685,15 +762,16 @@ } }, "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, + "license": "MIT", "dependencies": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16.0.0" } }, "node_modules/find-up": { @@ -713,24 +791,25 @@ } }, "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, + "license": "MIT", "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=16" } }, "node_modules/flatted": { - "version": "3.2.9", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", - "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", - "dev": true + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true, + "license": "ISC" }, "node_modules/for-in": { "version": "1.0.2", @@ -801,15 +880,13 @@ } }, "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -820,12 +897,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -836,10 +907,11 @@ } }, "node_modules/ignore": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", - "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 4" } @@ -849,6 +921,7 @@ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, + "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -955,6 +1028,7 @@ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -966,13 +1040,15 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -996,6 +1072,7 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, + "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } @@ -1054,14 +1131,15 @@ "dev": true }, "node_modules/lowdb": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/lowdb/-/lowdb-6.1.1.tgz", - "integrity": "sha512-HO13FCxI8SCwfj2JRXOKgXggxnmfSc+l0aJsZ5I34X3pwzG/DPBSKyKu3Zkgg/pNmx854SVgE2la0oUeh6wzNw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/lowdb/-/lowdb-7.0.1.tgz", + "integrity": "sha512-neJAj8GwF0e8EpycYIDFqEPcx9Qz4GUho20jWFR7YiFeXzF1YMLdxB36PypcTSPMA+4+LvgyMacYhlr18Zlymw==", + "license": "MIT", "dependencies": { - "steno": "^3.1.1" + "steno": "^4.0.2" }, "engines": { - "node": ">=16" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" @@ -1192,6 +1270,7 @@ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, @@ -1225,9 +1304,10 @@ } }, "node_modules/playwright-core": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", - "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", + "version": "1.44.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.1.tgz", + "integrity": "sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA==", + "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, @@ -1236,12 +1316,13 @@ } }, "node_modules/playwright-firefox": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.40.1.tgz", - "integrity": "sha512-+C5eOWZv/CvALM0yBZFSYThvUzGKusNw6soDMhTEJwDUB5i9q/yZVFkj6I8CFXM4U6Pf1q0PXHMca70HoIwnCQ==", + "version": "1.44.1", + "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.44.1.tgz", + "integrity": "sha512-ywwHQGTLM7P5r3SzVTSyRQQUK8xsCj6MrIqY9cn8SNz+GkKL4atZb1KuYDulxrfKFzZWXLJ8M+VGc0/vNWLMfA==", "hasInstallScript": true, + "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.40.1" + "playwright-core": "1.44.1" }, "bin": { "playwright": "cli.js" @@ -1264,6 +1345,7 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -1395,6 +1477,7 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } @@ -1499,11 +1582,12 @@ } }, "node_modules/steno": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/steno/-/steno-3.1.1.tgz", - "integrity": "sha512-B7c6EVH7oEiaMRW36SjUnktkDwp/qd4pQiduylyiqvcZEZDeX0IIFZRBZdwO/RaVo60M0wkDwC0e8yeKaR4VGg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/steno/-/steno-4.0.2.tgz", + "integrity": "sha512-yhPIQXjrlt1xv7dyPQg2P17URmXbuM5pdGkpiMB3RenprfiBlvK415Lctfe0eshk90oA7/tNq7WEiMK8RSP39A==", + "license": "MIT", "engines": { - "node": ">=16" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" @@ -1525,6 +1609,7 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" }, @@ -1570,18 +1655,6 @@ "node": ">= 0.8.0" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", @@ -1595,6 +1668,7 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } @@ -1653,16 +1727,27 @@ "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", "dev": true }, + "@eslint/config-array": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.16.0.tgz", + "integrity": "sha512-/jmuSd74i4Czf1XXn7wGRWZCuyaUZ330NH1Bek0Pplatt4Sy1S5haN21SCLLdbeKslQ+S0wEJ+++v5YibSi+Lg==", + "dev": true, + "requires": { + "@eslint/object-schema": "^2.1.4", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + } + }, "@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -1671,21 +1756,16 @@ } }, "@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.5.0.tgz", + "integrity": "sha512-A7+AOT2ICkodvtsWnxZP4Xxk3NbZ3VMHd8oihydLRGrJgqqdEz1qSeEgXYyT/Cu8h1TWWsQRejIx48mtjZ5y1w==", "dev": true }, - "@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", - "dev": true, - "requires": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - } + "@eslint/object-schema": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", + "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "dev": true }, "@humanwhocodes/module-importer": { "version": "1.0.1", @@ -1693,10 +1773,10 @@ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true }, - "@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "@humanwhocodes/retry": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.0.tgz", + "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", "dev": true }, "@nodelib/fs.scandir": { @@ -1768,15 +1848,23 @@ } }, "@stylistic/eslint-plugin-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-1.5.1.tgz", - "integrity": "sha512-iZF0rF+uOhAmOJYOJx1Yvmm3CZ1uz9n0SRd9dpBYHA3QAvfABUORh9LADWwZCigjHJkp2QbCZelGFJGwGz7Siw==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.2.2.tgz", + "integrity": "sha512-Vj2Q1YHVvJw+ThtOvmk5Yx7wZanVrIBRUTT89horLDb4xdP9GA1um9XOYQC6j67VeUC2gjZQnz5/RVJMzaOhtw==", "dev": true, "requires": { - "acorn": "^8.11.2", - "escape-string-regexp": "^4.0.0", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1" + "@types/eslint": "^8.56.10", + "acorn": "^8.11.3", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.0.1" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true + } } }, "@types/debug": { @@ -1787,21 +1875,37 @@ "@types/ms": "*" } }, + "@types/eslint": { + "version": "8.56.10", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", + "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, "@types/ms": { "version": "0.7.31", "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" }, - "@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", - "dev": true - }, "acorn": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", - "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true }, "acorn-jsx": { @@ -1947,19 +2051,10 @@ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==" }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, "dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==" + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==" }, "enquirer": { "version": "2.4.1", @@ -1977,41 +2072,37 @@ "dev": true }, "eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.5.0.tgz", + "integrity": "sha512-+NAOZFrW/jFTS3dASCGBxX1pkFD0/fsO+hfAkJ4TyYKwgsXZbqzrw+seCYFCcPCYXvnD67tAnglU7GQTz6kcVw==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/config-array": "^0.16.0", + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "9.5.0", "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.3.0", "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.0.1", + "eslint-visitor-keys": "^4.0.0", + "espree": "^10.0.1", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", @@ -2031,13 +2122,19 @@ "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } + }, + "eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true } } }, "eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz", + "integrity": "sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==", "dev": true, "requires": { "esrecurse": "^4.3.0", @@ -2051,14 +2148,22 @@ "dev": true }, "espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz", + "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==", "dev": true, "requires": { - "acorn": "^8.9.0", + "acorn": "^8.11.3", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true + } } }, "esquery": { @@ -2119,12 +2224,12 @@ } }, "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "requires": { - "flat-cache": "^3.0.4" + "flat-cache": "^4.0.0" } }, "find-up": { @@ -2138,20 +2243,19 @@ } }, "flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "requires": { "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" + "keyv": "^4.5.4" } }, "flatted": { - "version": "3.2.9", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", - "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true }, "for-in": { @@ -2205,25 +2309,16 @@ } }, "globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true }, "graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, - "graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2231,9 +2326,9 @@ "dev": true }, "ignore": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", - "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true }, "import-fresh": { @@ -2399,11 +2494,11 @@ "dev": true }, "lowdb": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/lowdb/-/lowdb-6.1.1.tgz", - "integrity": "sha512-HO13FCxI8SCwfj2JRXOKgXggxnmfSc+l0aJsZ5I34X3pwzG/DPBSKyKu3Zkgg/pNmx854SVgE2la0oUeh6wzNw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/lowdb/-/lowdb-7.0.1.tgz", + "integrity": "sha512-neJAj8GwF0e8EpycYIDFqEPcx9Qz4GUho20jWFR7YiFeXzF1YMLdxB36PypcTSPMA+4+LvgyMacYhlr18Zlymw==", "requires": { - "steno": "^3.1.1" + "steno": "^4.0.2" } }, "merge-deep": { @@ -2527,16 +2622,16 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, "playwright-core": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", - "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==" + "version": "1.44.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.1.tgz", + "integrity": "sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA==" }, "playwright-firefox": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.40.1.tgz", - "integrity": "sha512-+C5eOWZv/CvALM0yBZFSYThvUzGKusNw6soDMhTEJwDUB5i9q/yZVFkj6I8CFXM4U6Pf1q0PXHMca70HoIwnCQ==", + "version": "1.44.1", + "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.44.1.tgz", + "integrity": "sha512-ywwHQGTLM7P5r3SzVTSyRQQUK8xsCj6MrIqY9cn8SNz+GkKL4atZb1KuYDulxrfKFzZWXLJ8M+VGc0/vNWLMfA==", "requires": { - "playwright-core": "1.40.1" + "playwright-core": "1.44.1" } }, "prelude-ls": { @@ -2668,9 +2763,9 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "steno": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/steno/-/steno-3.1.1.tgz", - "integrity": "sha512-B7c6EVH7oEiaMRW36SjUnktkDwp/qd4pQiduylyiqvcZEZDeX0IIFZRBZdwO/RaVo60M0wkDwC0e8yeKaR4VGg==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/steno/-/steno-4.0.2.tgz", + "integrity": "sha512-yhPIQXjrlt1xv7dyPQg2P17URmXbuM5pdGkpiMB3RenprfiBlvK415Lctfe0eshk90oA7/tNq7WEiMK8RSP39A==" }, "strip-ansi": { "version": "6.0.1", @@ -2715,12 +2810,6 @@ "prelude-ls": "^1.2.1" } }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true - }, "universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", diff --git a/package.json b/package.json index 6c954cd..b2eee9f 100644 --- a/package.json +++ b/package.json @@ -17,20 +17,20 @@ }, "type": "module", "engines": { - "node": ">=15" + "node": ">=17" }, "dependencies": { "chalk": "^5.3.0", "cross-env": "^7.0.3", - "dotenv": "^16.3.1", + "dotenv": "^16.4.5", "enquirer": "^2.4.1", - "lowdb": "^6.1.1", + "lowdb": "^7.0.1", "otplib": "^12.0.1", - "playwright-firefox": "^1.40.1", + "playwright-firefox": "^1.44.1", "puppeteer-extra-plugin-stealth": "^2.11.2" }, "devDependencies": { - "@stylistic/eslint-plugin-js": "^1.5.1", - "eslint": "^8.56.0" + "@stylistic/eslint-plugin-js": "^2.2.2", + "eslint": "^9.5.0" } } diff --git a/src/util.js b/src/util.js index bda3f78..20c2f97 100644 --- a/src/util.js +++ b/src/util.js @@ -11,8 +11,8 @@ export const dataDir = s => path.resolve(__dirname, '..', 'data', s); export const resolve = (...a) => a.length && a[0] == '0' ? null : path.resolve(...a); // json database -import { JSONPreset } from 'lowdb/node'; -export const jsonDb = (file, defaultData) => JSONPreset(dataDir(file), defaultData); +import { JSONFilePreset } from 'lowdb/node'; +export const jsonDb = (file, defaultData) => JSONFilePreset(dataDir(file), defaultData); export const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); // date and time as UTC (no timezone offset) in nicely readable and sortable format, e.g., 2022-10-06 12:05:27.313 From 30b1835bdbf850eae389a0010945ca607cf61f6a Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sun, 23 Jun 2024 19:16:01 +0200 Subject: [PATCH 022/134] pg: reverse games: oldest/bottom to newest/top --- prime-gaming.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prime-gaming.js b/prime-gaming.js index b555f67..ca3fcee 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -107,6 +107,9 @@ try { // can't use .all() since the list of elements via locator will change after click while we iterate over it const internal = await games.locator('.item-card__action:has([data-a-target="FGWPOffer"])').elementHandles(); const external = await games.locator('.item-card__action:has([data-a-target="ExternalOfferClaim"])').all(); + // bottom to top: oldest to newest games + internal.reverse(); + external.reverse(); console.log('Number of free unclaimed games (Prime Gaming):', internal.length); // claim games in internal store for (const card of internal) { From f920aa26d0d89404a97a715c14f8f7b9400beda5 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sun, 23 Jun 2024 19:18:30 +0200 Subject: [PATCH 023/134] pg: checkTimeLeft via PG_TIMELEFT=1 --- prime-gaming.js | 19 +++++++++++++++++++ src/config.js | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/prime-gaming.js b/prime-gaming.js index ca3fcee..d8caaeb 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -110,6 +110,23 @@ try { // bottom to top: oldest to newest games internal.reverse(); external.reverse(); + const checkTimeLeft = async url => { + // console.log(' Checking time left for game:', url); + const check = async p => { + console.log(' ', await p.locator('.availability-date').innerText()); + const dueDateOrg = await p.locator('.availability-date .tw-bold').innerText(); + const dueDate = datetime(new Date(Date.parse(dueDateOrg + ' 17:00'))); + console.log(' Due date:', dueDate); + }; + if (page.url() == url) { + await check(page); + } else { + const p = await context.newPage(); + await p.goto(url, { waitUntil: 'domcontentloaded' }); + await check(p); + p.close(); + } + }; console.log('Number of free unclaimed games (Prime Gaming):', internal.length); // claim games in internal store for (const card of internal) { @@ -118,6 +135,7 @@ try { const slug = await (await card.$('a')).getAttribute('href'); const url = 'https://gaming.amazon.com' + slug.split('?')[0]; console.log('Current free game:', title); + if (cfg.pg_timeLeft) await checkTimeLeft(url); if (cfg.dryrun) continue; if (cfg.interactive && !await confirm()) continue; await (await card.$('.tw-button:has-text("Claim")')).click(); @@ -144,6 +162,7 @@ try { const item_text = await page.innerText('[data-a-target="DescriptionItemDetails"]'); const store = item_text.toLowerCase().replace(/.* on /, '').slice(0, -1); console.log(' External store:', store); + if (cfg.pg_timeLeft) await checkTimeLeft(url); if (cfg.dryrun) continue; if (cfg.interactive && !await confirm()) continue; await Promise.any([page.click('[data-a-target="buy-box"] .tw-button:has-text("Get game")'), page.click('[data-a-target="buy-box"] .tw-button:has-text("Claim")'), page.click('.tw-button:has-text("Complete Claim")'), page.waitForSelector('div:has-text("Link game account")'), page.waitForSelector('.thank-you-title:has-text("Success")')]); // waits for navigation diff --git a/src/config.js b/src/config.js index bd41c7d..56e42d2 100644 --- a/src/config.js +++ b/src/config.js @@ -46,7 +46,8 @@ export const cfg = { xbox_email: process.env.XBOX_EMAIL || process.env.EMAIL, xbox_password: process.env.XBOX_PASSWORD || process.env.PASSWORD, xbox_otpkey: process.env.XBOX_OTPKEY, - // experimmental - likely to change + // experimmental pg_redeem: process.env.PG_REDEEM == '1', // prime-gaming: redeem keys on external stores pg_claimdlc: process.env.PG_CLAIMDLC == '1', // prime-gaming: claim in-game content + pg_timeLeft: process.env.PG_TIMELEFT == '1', // prime-gaming: list time left to claim }; From 43bef9b23c93104345fa2e9b52c1db6ef231bbba Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sun, 23 Jun 2024 20:44:03 +0200 Subject: [PATCH 024/134] pg: redeem microsoft store and xbox, WIP, #315, #5 --- prime-gaming.js | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index d8caaeb..1f20a47 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -155,6 +155,7 @@ try { // await (await card.$('text=Claim')).click(); // goes to URL of game, no need to wait external_info.push({ title, url }); } + // external_info = [ { title: 'Fallout 76 (XBOX)', url: 'https://gaming.amazon.com/fallout-76-xbox-fgwp/dp/amzn1.pg.item.9fe17d7b-b6c2-4f58-b494-cc4e79528d0b?ingress=amzn&ref_=SM_Fallout76XBOX_S01_FGWP_CRWN' } ]; for (const { title, url } of external_info) { console.log('Current free game:', title); // , url); await page.goto(url, { waitUntil: 'domcontentloaded' }); @@ -185,7 +186,8 @@ try { const redeem = { // 'origin': 'https://www.origin.com/redeem', // TODO still needed or now only via account linking? 'gog.com': 'https://www.gog.com/redeem', - 'microsoft games': 'https://redeem.microsoft.com', + 'microsoft store': 'https://account.microsoft.com/billing/redeem', + xbox: 'https://account.microsoft.com/billing/redeem', 'legacy games': 'https://www.legacygames.com/primedeal', }; if (store in redeem) { // did not work for linked origin: && !await page.locator('div:has-text("Successfully Claimed")').count() @@ -240,27 +242,44 @@ try { console.log(' Unknown Response 2 - please report in https://github.com/vogler/free-games-claimer/issues/5'); } } - } else if (store == 'microsoft games') { - console.error(` Redeem on ${store} not yet implemented!`); + } else if (store == 'microsoft store' || store == 'xbox') { + console.error(` Redeem on ${store} is experimental!`); + // await page2.pause(); if (page2.url().startsWith('https://login.')) { - console.error(' Not logged in! Use the browser to login manually.'); + console.error(' Not logged in! Use the browser to login manually. Waiting for 60s.'); + await page2.waitForTimeout(60 * 1000); redeem_action = 'redeem (login)'; } else { - const r = page2.waitForResponse(r => r.url().startsWith('https://purchase.mp.microsoft.com/')); - await page2.fill('[name=tokenString]', code); + const iframe = page2.frameLocator('#redeem-iframe'); + const input = iframe.locator('[name=tokenString]'); + await input.waitFor(); + await input.fill(code); + const r = page2.waitForResponse(r => r.url().startsWith('https://cart.production.store-web.dynamics.com/v1.0/Redeem/PrepareRedeem')); // console.log(await page2.locator('.redeem_code_error').innerText()); const rt = await (await r).text(); - console.debug(` Response: ${rt}`); // {"code":"NotFound","data":[],"details":[],"innererror":{"code":"TokenNotFound",... - const reason = JSON.parse(rt).code; - if (reason == 'NotFound') { + const j = JSON.parse(rt); + const reason = j?.events?.cart.length && j.events.cart[0]?.data?.reason; + if (reason == 'TokenNotFound') { redeem_action = 'redeem (not found)'; console.error(' Code was not found!'); + } else if (j?.productInfos?.length && j.productInfos[0]?.redeemable) { + await iframe.locator('button:has-text("Next")').click(); + await iframe.locator('button:has-text("Confirm")').click(); + const r = page2.waitForResponse(r => r.url().startsWith('https://cart.production.store-web.dynamics.com/v1.0/Redeem/RedeemToken')); + const j = JSON.parse(await (await r).text()); + if (j?.events?.cart.length && j.events.cart[0]?.data?.reason == 'UserAlreadyOwnsContent') { + redeem_action = 'already redeemed'; + console.error(' error: UserAlreadyOwnsContent'); + } else if (true) { // TODO what's returned on success? + redeem_action = 'redeemed'; + db.data[user][title].status = 'claimed and redeemed?'; + console.log(' Redeemed successfully? Please report if not in https://github.com/vogler/free-games-claimer/issues/5'); + } } else { // TODO find out other responses - await page2.click('#nextButton'); - redeem_action = 'redeemed?'; + redeem_action = 'unknown'; + console.debug(` Response: ${rt}`); console.log(' Redeemed successfully? Please report your Response from above (if it is new) in https://github.com/vogler/free-games-claimer/issues/5'); - db.data[user][title].status = 'claimed and redeemed?'; } } } else if (store == 'legacy games') { From 601e893714731767ca5ce7ef6ca46c1e3330ed60 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sun, 23 Jun 2024 20:50:00 +0200 Subject: [PATCH 025/134] README: link example how to set env vars on Windows, closes #314 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a6e3825..a2da668 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ You can pass variables using `-e VAR=VAL`, for example `docker run -e EMAIL=foo@ If you are using [docker compose](https://docs.docker.com/compose/environment-variables/) (or Portainer etc.), you can put options in the `environment:` section. ##### Without Docker -On Linux/macOS you can prefix the variables you want to set, for example `EMAIL=foo@bar.baz SHOW=1 node epic-games` will show the browser and skip asking you for your login email. +On Linux/macOS you can prefix the variables you want to set, for example `EMAIL=foo@bar.baz SHOW=1 node epic-games` will show the browser and skip asking you for your login email. On Windows you have to use `set`, [example](https://github.com/vogler/free-games-claimer/issues/314). You can also put options in `data/config.env` which will be loaded by [dotenv](https://github.com/motdotla/dotenv). ### Notifications From 076738e3012ff9f90b75e9c6161f63314c96d6a1 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 25 Jun 2024 13:09:10 +0200 Subject: [PATCH 026/134] gog: fail if WIDTH<1280 due to hidden username, closes #335 --- gog.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gog.js b/gog.js index de5d02f..40d8fad 100644 --- a/gog.js +++ b/gog.js @@ -10,6 +10,11 @@ console.log(datetime(), 'started checking gog'); const db = await jsonDb('gog.json', {}); +if (cfg.width < 1280) { // otherwise 'Sign in' and #menuUsername are hidden (but attached to DOM), see https://github.com/vogler/free-games-claimer/issues/335 + console.error(`Window width is set to ${cfg.width} but needs to be at least 1280 for GOG!`); + process.exit(1); +} + // https://playwright.dev/docs/auth#multi-factor-authentication const context = await firefox.launchPersistentContext(cfg.dir.browser, { headless: cfg.headless, From c0eb6dbb0bb6c64e268ae70b9e37586c92a59366 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 25 Jun 2024 13:24:55 +0200 Subject: [PATCH 027/134] ncu -u: playwright 1.44.1 -> 1.45.0 --- package-lock.json | 36 ++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3d1d878..e6f66b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "enquirer": "^2.4.1", "lowdb": "^7.0.1", "otplib": "^12.0.1", - "playwright-firefox": "^1.44.1", + "playwright-firefox": "^1.45.0", "puppeteer-extra-plugin-stealth": "^2.11.2" }, "devDependencies": { @@ -23,7 +23,7 @@ "eslint": "^9.5.0" }, "engines": { - "node": ">=15" + "node": ">=17" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1304,31 +1304,31 @@ } }, "node_modules/playwright-core": { - "version": "1.44.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.1.tgz", - "integrity": "sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA==", + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.0.tgz", + "integrity": "sha512-lZmHlFQ0VYSpAs43dRq1/nJ9G/6SiTI7VPqidld9TDefL9tX87bTKExWZZUF5PeRyqtXqd8fQi2qmfIedkwsNQ==", "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/playwright-firefox": { - "version": "1.44.1", - "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.44.1.tgz", - "integrity": "sha512-ywwHQGTLM7P5r3SzVTSyRQQUK8xsCj6MrIqY9cn8SNz+GkKL4atZb1KuYDulxrfKFzZWXLJ8M+VGc0/vNWLMfA==", + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.45.0.tgz", + "integrity": "sha512-JmGESfFR8xTjAYQzECYO00yBbSSnu4dBImsrmJVeOXTvT+i9p1dpVUaxKz6lTFMI/xzYROqB4E4Km8NBiOgslw==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.44.1" + "playwright-core": "1.45.0" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/prelude-ls": { @@ -2622,16 +2622,16 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, "playwright-core": { - "version": "1.44.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.1.tgz", - "integrity": "sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA==" + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.0.tgz", + "integrity": "sha512-lZmHlFQ0VYSpAs43dRq1/nJ9G/6SiTI7VPqidld9TDefL9tX87bTKExWZZUF5PeRyqtXqd8fQi2qmfIedkwsNQ==" }, "playwright-firefox": { - "version": "1.44.1", - "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.44.1.tgz", - "integrity": "sha512-ywwHQGTLM7P5r3SzVTSyRQQUK8xsCj6MrIqY9cn8SNz+GkKL4atZb1KuYDulxrfKFzZWXLJ8M+VGc0/vNWLMfA==", + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.45.0.tgz", + "integrity": "sha512-JmGESfFR8xTjAYQzECYO00yBbSSnu4dBImsrmJVeOXTvT+i9p1dpVUaxKz6lTFMI/xzYROqB4E4Km8NBiOgslw==", "requires": { - "playwright-core": "1.44.1" + "playwright-core": "1.45.0" } }, "prelude-ls": { diff --git a/package.json b/package.json index b2eee9f..2c64f46 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "enquirer": "^2.4.1", "lowdb": "^7.0.1", "otplib": "^12.0.1", - "playwright-firefox": "^1.44.1", + "playwright-firefox": "^1.45.0", "puppeteer-extra-plugin-stealth": "^2.11.2" }, "devDependencies": { From 55226933c0eb01a0f0b258732e1bb3fc67849200 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 25 Jun 2024 15:30:02 +0200 Subject: [PATCH 028/134] filenamify datetime recordHar for Windows : -> ., fix #336 --- epic-games.js | 2 +- gog.js | 2 +- prime-gaming.js | 2 +- unrealengine.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epic-games.js b/epic-games.js index 54ca597..5487445 100644 --- a/epic-games.js +++ b/epic-games.js @@ -25,7 +25,7 @@ const context = await firefox.launchPersistentContext(cfg.dir.browser, { // userAgent firefox (docker): Mozilla/5.0 (X11; Linux aarch64; rv:109.0) Gecko/20100101 Firefox/115.0 locale: 'en-US', // ignore OS locale to be sure to have english text for locators recordVideo: cfg.record ? { dir: 'data/record/', size: { width: cfg.width, height: cfg.height } } : undefined, // will record a .webm video for each page navigated; without size, video would be scaled down to fit 800x800 - recordHar: cfg.record ? { path: `data/record/eg-${datetime()}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools + recordHar: cfg.record ? { path: `data/record/eg-${filenamify(datetime())}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools handleSIGINT: false, // have to handle ourselves and call context.close(), otherwise recordings from above won't be saved // user settings for firefox have to be put in $BROWSER_DIR/user.js args: [ // https://wiki.mozilla.org/Firefox/CommandLineOptions diff --git a/gog.js b/gog.js index 40d8fad..0688626 100644 --- a/gog.js +++ b/gog.js @@ -21,7 +21,7 @@ const context = await firefox.launchPersistentContext(cfg.dir.browser, { viewport: { width: cfg.width, height: cfg.height }, locale: 'en-US', // ignore OS locale to be sure to have english text for locators -> done via /en in URL recordVideo: cfg.record ? { dir: 'data/record/', size: { width: cfg.width, height: cfg.height } } : undefined, // will record a .webm video for each page navigated; without size, video would be scaled down to fit 800x800 - recordHar: cfg.record ? { path: `data/record/gog-${datetime()}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools + recordHar: cfg.record ? { path: `data/record/gog-${filenamify(datetime())}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools handleSIGINT: false, // have to handle ourselves and call context.close(), otherwise recordings from above won't be saved }); diff --git a/prime-gaming.js b/prime-gaming.js index 6e8cb03..91d3fe2 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -19,7 +19,7 @@ const context = await firefox.launchPersistentContext(cfg.dir.browser, { viewport: { width: cfg.width, height: cfg.height }, locale: 'en-US', // ignore OS locale to be sure to have english text for locators recordVideo: cfg.record ? { dir: 'data/record/', size: { width: cfg.width, height: cfg.height } } : undefined, // will record a .webm video for each page navigated; without size, video would be scaled down to fit 800x800 - recordHar: cfg.record ? { path: `data/record/pg-${datetime()}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools + recordHar: cfg.record ? { path: `data/record/pg-${filenamify(datetime())}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools handleSIGINT: false, // have to handle ourselves and call context.close(), otherwise recordings from above won't be saved }); diff --git a/unrealengine.js b/unrealengine.js index e67633e..2bb8ee9 100644 --- a/unrealengine.js +++ b/unrealengine.js @@ -25,7 +25,7 @@ const context = await firefox.launchPersistentContext(cfg.dir.browser, { // userAgent for firefox: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0 locale: 'en-US', // ignore OS locale to be sure to have english text for locators recordVideo: cfg.record ? { dir: 'data/record/', size: { width: cfg.width, height: cfg.height } } : undefined, // will record a .webm video for each page navigated; without size, video would be scaled down to fit 800x800 - recordHar: cfg.record ? { path: `data/record/ue-${datetime()}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools + recordHar: cfg.record ? { path: `data/record/ue-${filenamify(datetime())}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools handleSIGINT: false, // have to handle ourselves and call context.close(), otherwise recordings from above won't be saved }); From 9cf5d2f7f21157566dad636b75febb831d14b333 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 25 Jun 2024 15:50:02 +0200 Subject: [PATCH 029/134] pg: include code in redeem_url for gog, closes #330 --- prime-gaming.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index 91d3fe2..5e3e283 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -196,7 +196,9 @@ try { if (store == 'legacy games') { // may be different URL like https://legacygames.com/primeday/puzzleoftheyear/ redeem[store] = await (await page.$('li:has-text("Click here") a')).getAttribute('href'); // full text: Click here to enter your redemption code. } - console.log(' URL to redeem game:', redeem[store]); + let redeem_url = redeem[store]; + if (store == 'gog.com') redeem_url += '/' + code; // to log and notify, but can't use for goto below (captcha) + console.log(' URL to redeem game:', redeem_url); db.data[user][title].code = code; let redeem_action = 'redeem'; if (cfg.pg_redeem) { // try to redeem keys on external stores @@ -305,7 +307,7 @@ try { if (cfg.debug) await page2.pause(); await page2.close(); } - notify_game.status = `${redeem_action} ${code} on ${store}`; + notify_game.status = `${redeem_action} ${code} on ${store}`; } else { notify_game.status = `claimed on ${store}`; db.data[user][title].status = 'claimed'; From c4be7ece21702fb73bc7ed61bafd7abc6133a911 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 25 Jun 2024 18:45:21 +0200 Subject: [PATCH 030/134] xbox: fixup #307 --- xbox.js | 1 - 1 file changed, 1 deletion(-) diff --git a/xbox.js b/xbox.js index 67054ef..fd78c66 100644 --- a/xbox.js +++ b/xbox.js @@ -16,7 +16,6 @@ const URL_CLAIM = 'https://www.xbox.com/en-US/live/gold'; // #gameswithgold"; console.log(datetime(), 'started checking xbox'); const db = await jsonDb('xbox.json', {}); -db.data ||= {}; handleSIGINT(); From 9af36e902c0634d8fc19fdb8a75267b0887ccf47 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 26 Jun 2024 17:10:04 +0200 Subject: [PATCH 031/134] eg: fix login: password now together with email again, detect login error, closes #338, closes #337 --- epic-games.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/epic-games.js b/epic-games.js index 5487445..70807b8 100644 --- a/epic-games.js +++ b/epic-games.js @@ -20,7 +20,7 @@ if (cfg.time) console.time('startup'); const context = await firefox.launchPersistentContext(cfg.dir.browser, { headless: cfg.headless, viewport: { width: cfg.width, height: cfg.height }, - userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36', // see replace of Headless in util.newStealthContext. TODO Windows UA enough to avoid 'device not supported'? update if browser is updated? + userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0', // see replace of Headless in util.newStealthContext. TODO Windows UA enough to avoid 'device not supported'? update if browser is updated? // userAgent firefox (macOS): Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0 // userAgent firefox (docker): Mozilla/5.0 (X11; Linux aarch64; rv:109.0) Gecko/20100101 Firefox/115.0 locale: 'en-US', // ignore OS locale to be sure to have english text for locators @@ -90,8 +90,6 @@ try { if (!email) await notifyBrowserLogin(); else { // await page.click('text=Sign in with Epic Games'); - await page.fill('#email', email); - await page.click('button[type="submit"]'); page.waitForSelector('.h_captcha_challenge iframe').then(async () => { console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); await notify('epic-games: got captcha during login. Please check.'); @@ -99,10 +97,20 @@ try { page.waitForSelector('p:has-text("Incorrect response.")').then(async () => { console.error('Incorrect repsonse for captcha!'); }).catch(_ => { }); + await page.fill('#email', email); + // await page.click('button[type="submit"]'); login was split in two steps for some time, now email and password are on the same form again const password = email && (cfg.eg_password || await prompt({ type: 'password', message: 'Enter password' })); if (!password) await notifyBrowserLogin(); - await page.fill('#password', password); - await page.click('button[type="submit"]'); + else { + await page.fill('#password', password); + await page.click('button[type="submit"]'); + } + const error = page.locator('#form-error-message'); + error.waitFor().then(async () => { + console.error('Login error:', await error.innerText()); + await context.close(); // finishes potential recording + process.exit(1); + }).catch(_ => { }); // handle MFA, but don't await it page.waitForURL('**/id/login/mfa**').then(async () => { console.log('Enter the security code to continue - This appears to be a new device, browser or location. A security code has been sent to your email address at ...'); From d85cd8d20ccb27834bfaafd98f8be95fecb7a3d5 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 27 Jun 2024 10:54:46 +0200 Subject: [PATCH 032/134] rm xbox.js, no more games with gold, closes #286, closes #339 TODO integrate login code for microsoft games in prime-gaming --- src/config.js | 4 - xbox.js | 250 -------------------------------------------------- 2 files changed, 254 deletions(-) delete mode 100644 xbox.js diff --git a/src/config.js b/src/config.js index 9624471..03414a0 100644 --- a/src/config.js +++ b/src/config.js @@ -42,10 +42,6 @@ export const cfg = { gog_password: process.env.GOG_PASSWORD || process.env.PASSWORD, gog_newsletter: process.env.GOG_NEWSLETTER == '1', // do not unsubscribe from newsletter after claiming a game // OTP only via GOG_EMAIL, can't add app... - // auth xbox - xbox_email: process.env.XBOX_EMAIL || process.env.EMAIL, - xbox_password: process.env.XBOX_PASSWORD || process.env.PASSWORD, - xbox_otpkey: process.env.XBOX_OTPKEY, // experimmental pg_redeem: process.env.PG_REDEEM == '1', // prime-gaming: redeem keys on external stores lg_email: process.env.LG_EMAIL || process.env.PG_EMAIL || process.env.EMAIL, // prime-gaming: external: legacy-games: email to use for redeeming diff --git a/xbox.js b/xbox.js deleted file mode 100644 index fd78c66..0000000 --- a/xbox.js +++ /dev/null @@ -1,250 +0,0 @@ -import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdated playwright-extra -import { authenticator } from 'otplib'; -import { - datetime, - handleSIGINT, - html_game_list, - jsonDb, - notify, - prompt, -} from './src/util.js'; -import { cfg } from './src/config.js'; - -// ### SETUP -const URL_CLAIM = 'https://www.xbox.com/en-US/live/gold'; // #gameswithgold"; - -console.log(datetime(), 'started checking xbox'); - -const db = await jsonDb('xbox.json', {}); - -handleSIGINT(); - -// https://playwright.dev/docs/auth#multi-factor-authentication -const context = await firefox.launchPersistentContext(cfg.dir.browser, { - headless: cfg.headless, - viewport: { width: cfg.width, height: cfg.height }, - locale: 'en-US', // ignore OS locale to be sure to have english text for locators -> done via /en in URL -}); - -if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); - -const page = context.pages().length - ? context.pages()[0] - : await context.newPage(); // should always exist -await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it - -const notify_games = []; -let user; - -main(); - -async function main() { - try { - await performLogin(); - await getAndSaveUser(); - await redeemFreeGames(); - } catch (error) { - console.error(error); - process.exitCode ||= 1; - if (error.message && process.exitCode != 130) notify(`xbox failed: ${error.message.split('\n')[0]}`); - } finally { - await db.write(); // write out json db - if (notify_games.filter(g => g.status != 'existed').length) { - // don't notify if all were already claimed - notify(`xbox (${user}):
${html_game_list(notify_games)}`); - } - await context.close(); - } -} - -async function performLogin() { - await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); // default 'load' takes forever - - const signInLocator = page - .getByRole('link', { - name: 'Sign in to your account', - }) - .first(); - const usernameLocator = page - .getByRole('button', { - name: 'Account manager for', - }) - .first(); - - await Promise.any([signInLocator.waitFor(), usernameLocator.waitFor()]); - - if (await usernameLocator.isVisible()) { - return; // logged in using saved cookie - } else if (await signInLocator.isVisible()) { - console.error('Not signed in anymore.'); - await signInLocator.click(); - await signInToXbox(); - } else { - console.error('lost! where am i?'); - } -} - -async function signInToXbox() { - page.waitForLoadState('domcontentloaded'); - if (!cfg.debug) context.setDefaultTimeout(cfg.login_timeout); // give user some extra time to log in - console.info(`Login timeout is ${cfg.login_timeout / 1000} seconds!`); - - // ### FETCH EMAIL/PASS - if (cfg.xbox_email && cfg.xbox_password) console.info('Using email and password from environment.'); - else console.info( - 'Press ESC to skip the prompts if you want to login in the browser (not possible in headless mode).', - ); - const email = cfg.xbox_email || await prompt({ message: 'Enter email' }); - const password = - email && - (cfg.xbox_password || - await prompt({ - type: 'password', - message: 'Enter password', - })); - // ### FILL IN EMAIL/PASS - if (email && password) { - const usernameLocator = page - .getByPlaceholder('Email, phone, or Skype') - .first(); - const passwordLocator = page.getByPlaceholder('Password').first(); - - await Promise.any([ - usernameLocator.waitFor(), - passwordLocator.waitFor(), - ]); - - // username may already be saved from before, if so, skip to filling in password - if (await page.getByPlaceholder('Email, phone, or Skype').isVisible()) { - await usernameLocator.fill(email); - await page.getByRole('button', { name: 'Next' }).click(); - } - - await passwordLocator.fill(password); - await page.getByRole('button', { name: 'Sign in' }).click(); - - // handle MFA, but don't await it - page.locator('input[name="otc"]') - .waitFor() - .then(async () => { - console.log('Two-Step Verification - Enter security code'); - console.log( - await page - .locator('div[data-bind="text: description"]') - .innerText(), - ); - const otp = - cfg.xbox_otpkey && - authenticator.generate(cfg.xbox_otpkey) || - await prompt({ - type: 'text', - message: 'Enter two-factor sign in code', - validate: n => n.toString().length == 6 || - 'The code must be 6 digits!', - }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them - await page.type('input[name="otc"]', otp.toString()); - await page - .getByLabel('Don\'t ask me again on this device') - .check(); // Trust this Browser - await page.getByRole('button', { name: 'Verify' }).click(); - }) - .catch(_ => {}); - - // Trust this browser, but don't await it - page.getByLabel('Don\'t show this again') - .waitFor() - .then(async () => { - await page.getByLabel('Don\'t show this again').check(); - await page.getByRole('button', { name: 'Yes' }).click(); - }) - .catch(_ => {}); - } else { - console.log('Waiting for you to login in the browser.'); - await notify( - 'xbox: no longer signed in and not enough options set for automatic login.', - ); - if (cfg.headless) { - console.log( - 'Run `SHOW=1 node xbox` to login in the opened browser.', - ); - await context.close(); - process.exit(1); - } - } - - // ### VERIFY SIGNED IN - await page.waitForURL(`${URL_CLAIM}**`); - - if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); -} - -async function getAndSaveUser() { - user = await page.locator('#mectrl_currentAccount_primary').innerHTML(); - console.log(`Signed in as '${user}'`); - db.data[user] ||= {}; -} - -async function redeemFreeGames() { - const monthlyGamesLocator = await page.locator('.f-size-large').all(); - - const monthlyGamesPageLinks = await Promise.all( - monthlyGamesLocator.map( - async el => await el.locator('a').getAttribute('href'), - ), - ); - console.log('Free games:', monthlyGamesPageLinks); - - for (const url of monthlyGamesPageLinks) { - await page.goto(url); - - const title = await page.locator('h1').first().innerText(); - const game_id = page.url().split('/').pop(); - db.data[user][game_id] ||= { title, time: datetime(), url: page.url() }; // this will be set on the initial run only! - console.log('Current free game:', title); - const notify_game = { title, url, status: 'failed' }; - notify_games.push(notify_game); // status is updated below - - // SELECTORS - const getBtnLocator = page.getByText('GET', { exact: true }).first(); - const installToLocator = page - .getByText('INSTALL TO', { exact: true }) - .first(); - - await Promise.any([ - getBtnLocator.waitFor(), - installToLocator.waitFor(), - ]); - - if (await installToLocator.isVisible()) { - console.log(' Already in library! Nothing to claim.'); - notify_game.status = 'existed'; - db.data[user][game_id].status ||= 'existed'; // does not overwrite claimed or failed - } else if (await getBtnLocator.isVisible()) { - console.log(' Not in library yet! Click GET.'); - await getBtnLocator.click(); - - // wait for popup - await page - .locator('iframe[name="purchase-sdk-hosted-iframe"]') - .waitFor(); - const popupLocator = page.frameLocator( - '[name=purchase-sdk-hosted-iframe]', - ); - - const finalGetBtnLocator = popupLocator.getByText('GET'); - await finalGetBtnLocator.waitFor(); - await finalGetBtnLocator.click(); - - await page.getByText('Thank you for your purchase.').waitFor(); - notify_game.status = 'claimed'; - db.data[user][game_id].status = 'claimed'; - db.data[user][game_id].time = datetime(); // claimed time overwrites failed/dryrun time - console.log(' Claimed successfully!'); - } - - // notify_game.status = db.data[user][game_id].status; // claimed or failed - - // const p = path.resolve(cfg.dir.screenshots, playstation-plus', `${game_id}.png`); - // if (!existsSync(p)) await page.screenshot({ path: p, fullPage: false }); // fullPage is quite long... - } -} From e154b74e4d3a927f230d39fd63b374f92f37f7ef Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 27 Jun 2024 14:09:37 +0200 Subject: [PATCH 033/134] eg: TODO handle base game for add-ons via function --- epic-games.js | 1 + 1 file changed, 1 insertion(+) diff --git a/epic-games.js b/epic-games.js index 70807b8..9aeb6ab 100644 --- a/epic-games.js +++ b/epic-games.js @@ -193,6 +193,7 @@ try { const baseUrl = 'https://store.epicgames.com' + await page.locator('a:has-text("Overview")').getAttribute('href'); console.log(' Base game:', baseUrl); // await page.click('a:has-text("Overview")'); + // TODO handle this via function call for base game above since this will never terminate if DRYRUN=1 urls.push(baseUrl); // add base game to the list of games to claim urls.push(url); // add add-on itself again } else { // GET From 00275d825baa6f7ddc04f74b091b4639e7948212 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 27 Jun 2024 15:40:45 +0200 Subject: [PATCH 034/134] eg: forgot to catch timeout for captcha detection --- epic-games.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index 9aeb6ab..04a091e 100644 --- a/epic-games.js +++ b/epic-games.js @@ -263,7 +263,7 @@ try { iframe.locator('.payment__errors:has-text("Failed to challenge captcha, please try again later.")').waitFor().then(async () => { console.error(' Failed to challenge captcha, please try again later.'); await notify('epic-games: failed to challenge captcha. Please check.'); - }); + }).catch(_ => { }); await page.locator('text=Thanks for your order!').waitFor({ state: 'attached' }); // TODO Bundle: got stuck here db.data[user][game_id].status = 'claimed'; db.data[user][game_id].time = datetime(); // claimed time overwrites failed/dryrun time From aee72327eaf06600ae43c80799188b58d9074ddf Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 27 Jun 2024 15:41:58 +0200 Subject: [PATCH 035/134] eg: disable webgl since it leaks running virtualized, #183 --- epic-games.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index 04a091e..d0b9a03 100644 --- a/epic-games.js +++ b/epic-games.js @@ -1,7 +1,7 @@ import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdated playwright-extra import { authenticator } from 'otplib'; import path from 'path'; -import { existsSync, writeFileSync } from 'fs'; +import { existsSync, writeFileSync, appendFileSync } from 'fs'; import { resolve, jsonDb, datetime, stealth, filenamify, prompt, notify, html_game_list, handleSIGINT } from './src/util.js'; import { cfg } from './src/config.js'; @@ -16,6 +16,14 @@ const db = await jsonDb('epic-games.json', {}); if (cfg.time) console.time('startup'); +const browserPrefs = path.join(cfg.dir.browser, 'prefs.js'); +if (existsSync(browserPrefs)) { + console.log('Adding webgl.disabled to', browserPrefs); + appendFileSync(browserPrefs, 'user_pref("webgl.disabled", true);'); // apparently Firefox removes duplicates (and sorts), so no problem appending every time +} else { + console.log(browserPrefs, 'does not exist yet, will patch it on next run. Restart the script if you get a captcha.'); +} + // https://playwright.dev/docs/auth#multi-factor-authentication const context = await firefox.launchPersistentContext(cfg.dir.browser, { headless: cfg.headless, From 17f1ee41c975e1dc9d8a7e5abef254a17bf07349 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 27 Jun 2024 23:32:15 +0200 Subject: [PATCH 036/134] eg: don't exit on login error since it may be 'Incorrect response' for captcha https://github.com/vogler/free-games-claimer/issues/183#issuecomment-2195691372 --- epic-games.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/epic-games.js b/epic-games.js index d0b9a03..9d492a0 100644 --- a/epic-games.js +++ b/epic-games.js @@ -103,7 +103,7 @@ try { await notify('epic-games: got captcha during login. Please check.'); }).catch(_ => { }); page.waitForSelector('p:has-text("Incorrect response.")').then(async () => { - console.error('Incorrect repsonse for captcha!'); + console.error('Incorrect response for captcha!'); }).catch(_ => { }); await page.fill('#email', email); // await page.click('button[type="submit"]'); login was split in two steps for some time, now email and password are on the same form again @@ -116,8 +116,7 @@ try { const error = page.locator('#form-error-message'); error.waitFor().then(async () => { console.error('Login error:', await error.innerText()); - await context.close(); // finishes potential recording - process.exit(1); + console.log('Please login in the browser!'); }).catch(_ => { }); // handle MFA, but don't await it page.waitForURL('**/id/login/mfa**').then(async () => { From b8f7068a873d47ccc3c657c2c82aa1bc718cc455 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 10 Jul 2024 13:27:48 +0200 Subject: [PATCH 037/134] pg: scrollUntilStable to wait in loop to load all games since one scroll may not be enough --- prime-gaming.js | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index 5e3e283..eeface0 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -97,12 +97,25 @@ try { process.exit(1); } + const waitUntilStable = async (f, act) => { + let v; + while (true) { + const v2 = await f(); + if (v == v2) break; + v = v2; + await act(); + } + }; + const scrollUntilStable = async f => waitUntilStable(f, async () => { + await page.keyboard.press('End'); // scroll to bottom to show all games + await page.waitForLoadState('networkidle'); // wait for all games to be loaded + await page.waitForTimeout(2000); // TODO networkidle wasn't enough to load all already collected games + }); + await page.click('button[data-type="Game"]'); - await page.keyboard.press('End'); // scroll to bottom to show all games - await page.waitForLoadState('networkidle'); // wait for all games to be loaded - await page.waitForTimeout(2000); // TODO networkidle wasn't enough to load all already collected games const games = page.locator('div[data-a-target="offer-list-FGWP_FULL"]'); await games.waitFor(); + await scrollUntilStable(() => games.locator('.item-card__action').count()); console.log('Number of already claimed games (total):', await games.locator('p:has-text("Collected")').count()); // can't use .all() since the list of elements via locator will change after click while we iterate over it const internal = await games.locator('.item-card__action:has([data-a-target="FGWPOffer"])').elementHandles(); @@ -324,8 +337,7 @@ try { if (notify_games.length) { // make screenshot of all games if something was claimed const p = screenshot(`${filenamify(datetime())}.png`); // await page.screenshot({ path: p, fullPage: true }); // fullPage does not make a difference since scroll not on body but on some element - await page.keyboard.press('End'); // scroll to bottom to show all games - await page.waitForTimeout(1000); // wait for fade in animation + await scrollUntilStable(() => games.locator('.item-card__action').count()); const viewportSize = page.viewportSize(); // current viewport size await page.setViewportSize({ ...viewportSize, height: 3000 }); // increase height, otherwise element screenshot is cut off at the top and bottom await games.screenshot({ path: p }); // screenshot of all claimed games @@ -339,17 +351,7 @@ try { await loot.waitFor(); process.stdout.write('Loading all DLCs on page...'); - let n1 = 0; - let n2 = 0; - do { - n1 = n2; - n2 = await loot.locator('[data-a-target="item-card"]').count(); - // console.log(n2); - process.stdout.write(` ${n2}`); - await page.keyboard.press('End'); // scroll to bottom to show all dlcs - await page.waitForLoadState('networkidle'); // did not wait for dlcs to be loaded - await page.waitForTimeout(1000); - } while (n2 > n1); + scrollUntilStable(() => loot.locator('[data-a-target="item-card"]').count()) console.log('\nNumber of already claimed DLC:', await loot.locator('p:has-text("Collected")').count()); From a39d737999c509b9065ee07dd7a806e6579ff5e6 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Fri, 19 Jul 2024 14:35:40 +0200 Subject: [PATCH 038/134] aliexpress: collect daily coins via desktop website All load in webview in android app. Other games have no desktop version and mobile version uses canvas and only refers to download app with both stealth and fingerprint-injector. Also stuck on loading screen when using firefox instead of chrome. --- aliexpress.js | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/config.js | 3 ++ 2 files changed, 108 insertions(+) create mode 100644 aliexpress.js diff --git a/aliexpress.js b/aliexpress.js new file mode 100644 index 0000000..c44c673 --- /dev/null +++ b/aliexpress.js @@ -0,0 +1,105 @@ +import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdated playwright-extra +import { datetime, filenamify, prompt, handleSIGINT, stealth } from './src/util.js'; +import { cfg } from './src/config.js'; + +const context = await firefox.launchPersistentContext(cfg.dir.browser, { + headless: cfg.headless, + viewport: { width: cfg.width, height: cfg.height }, + locale: 'en-US', // ignore OS locale to be sure to have english text for locators -> done via /en in URL + recordVideo: cfg.record ? { dir: 'data/record/', size: { width: cfg.width, height: cfg.height } } : undefined, // will record a .webm video for each page navigated; without size, video would be scaled down to fit 800x800 + recordHar: cfg.record ? { path: `data/record/gog-${filenamify(datetime())}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools + handleSIGINT: false, // have to handle ourselves and call context.close(), otherwise recordings from above won't be saved +}); +handleSIGINT(context); +await stealth(context); + +context.setDefaultTimeout(cfg.debug ? 0 : cfg.timeout); + +const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist + +const auth = async (url) => { + console.log('auth', url); + await page.goto(url, { waitUntil: 'domcontentloaded' }); + // redirects to https://login.aliexpress.com/?return_url=https%3A%2F%2Fwww.aliexpress.com%2Fp%2Fcoin-pc-index%2Findex.html + await Promise.any([page.waitForURL(/.*login.aliexpress.com.*/).then(async () => { + // manual login + console.error('Not logged in! Will wait for 120s for you to login...'); + // await page.waitForTimeout(120*1000); + // or try automated + page.locator('span:has-text("Switch account")').click().catch(_ => {}); // sometimes no longer logged in, but previous user/email is pre-selected -> in this case we want to go back to the classic login + const login = page.locator('.login-container'); + const email = cfg.ae_email || await prompt({ message: 'Enter email' }); + const emailInput = login.locator('input[label="Email or phone number"]'); + await emailInput.fill(email); + await emailInput.blur(); // otherwise Continue button stays disabled + const continueButton = login.locator('button:has-text("Continue")'); + await continueButton.click({ force: true }); // normal click waits for button to no longer be covered by their suggestion menu, so we have to force click somewhere for the menu to close and then click + await continueButton.click(); + const password = email && (cfg.ae_password || await prompt({ type: 'password', message: 'Enter password' })); + await login.locator('input[label="Password"]').fill(password); + await login.locator('button:has-text("Sign in")').click(); + const error = login.locator('.error-text'); + error.waitFor().then(async _ => console.error('Login error:', await error.innerText())); + await page.waitForURL(url); + // await page.addLocatorHandler(page.getByRole('button', { name: 'Accept cookies' }), btn => btn.click()); + page.getByRole('button', { name: 'Accept cookies' }).click().then(_ => console.log('Accepted cookies')).catch(_ => { }); + }), page.locator('#nav-user-account').waitFor()]).catch(_ => {}); + + // await page.locator('#nav-user-account').hover(); + // console.log('Logged in as:', await page.locator('.welcome-name').innerText()); +}; + +// copied URLs from AliExpress app on tablet which has menu for the used webview +const urls = { + // works with desktop view, but stuck at 100% loading in mobile view: + coins: 'https://www.aliexpress.com/p/coin-pc-index/index.html', + // only work with mobile view: + grow: 'https://m.aliexpress.com/p/ae_fruit/index.html', // firefox: stuck at 60% loading, chrome: loads, but canvas + gogo: 'https://m.aliexpress.com/p/gogo-match-cc/index.html', // closes firefox?! + // only show notification to install the app + euro: 'https://m.aliexpress.com/p/european-cup/index.html', // doesn't load + merge: 'https://m.aliexpress.com/p/merge-market/index.html', +}; + +const coins = async () => { + // await auth(urls.coins); + await Promise.any([page.locator('.checkin-button').click(), page.locator('.addcoin').waitFor()]); + console.log('Coins:', await page.locator('.mycoin-content-right-money').innerText()); + console.log('Streak:', await page.locator('.title-box').innerText()); + console.log('Tomorrow:', await page.locator('.addcoin').innerText()); +}; + +const grow = async () => { + await page.pause(); +}; + +const gogo = async () => { + await page.pause(); +}; + +const euro = async () => { + await page.pause(); +}; + +const merge = async () => { + await page.pause(); +}; + +try { + // await coins(); + await [ + coins, + // grow, + // gogo, + // euro, + // merge, + ].reduce((a, f) => a.then(async _ => { await auth(urls[f.name]); await f(); console.log() }), Promise.resolve()); + + // await page.pause(); +} catch (error) { + process.exitCode ||= 1; + console.error('--- Exception:'); + console.error(error); // .toString()? +} +if (page.video()) console.log('Recorded video:', await page.video().path()); +await context.close(); diff --git a/src/config.js b/src/config.js index 03414a0..4a384b8 100644 --- a/src/config.js +++ b/src/config.js @@ -41,6 +41,9 @@ export const cfg = { gog_email: process.env.GOG_EMAIL || process.env.EMAIL, gog_password: process.env.GOG_PASSWORD || process.env.PASSWORD, gog_newsletter: process.env.GOG_NEWSLETTER == '1', // do not unsubscribe from newsletter after claiming a game + // auth AliExpress + ae_email: process.env.AE_EMAIL || process.env.EMAIL, + ae_password: process.env.AE_PASSWORD || process.env.PASSWORD, // OTP only via GOG_EMAIL, can't add app... // experimmental pg_redeem: process.env.PG_REDEEM == '1', // prime-gaming: redeem keys on external stores From d9e91d22c9f01114f905b8edf6e7322bb56639be Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 1 Aug 2024 15:46:41 +0200 Subject: [PATCH 039/134] eg: fix changed button locators --- epic-games.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/epic-games.js b/epic-games.js index 9d492a0..ff8f3e0 100644 --- a/epic-games.js +++ b/epic-games.js @@ -156,7 +156,8 @@ try { for (const url of urls) { if (cfg.time) console.time('claim game'); await page.goto(url); // , { waitUntil: 'domcontentloaded' }); - const btnText = await page.locator('//button[@data-testid="purchase-cta-button"][not(contains(.,"Loading"))]').first().innerText(); // barrier to block until page is loaded + const purcahseBtn = page.locator('aside button').first(); + const btnText = (await purcahseBtn.innerText()).toLowerCase(); // barrier to block until page is loaded // click Continue if 'This game contains mature content recommended only for ages 18+' if (await page.locator('button:has-text("Continue")').count() > 0) { @@ -187,12 +188,12 @@ try { const notify_game = { title, url, status: 'failed' }; notify_games.push(notify_game); // status is updated below - if (btnText.toLowerCase() == 'in library') { + if (btnText == 'in library') { console.log(' Already in library! Nothing to claim.'); notify_game.status = 'existed'; db.data[user][game_id].status ||= 'existed'; // does not overwrite claimed or failed if (db.data[user][game_id].status.startsWith('failed')) db.data[user][game_id].status = 'manual'; // was failed but now it's claimed - } else if (btnText.toLowerCase() == 'requires base game') { + } else if (btnText == 'requires base game') { console.log(' Requires base game! Nothing to claim.'); notify_game.status = 'requires base game'; db.data[user][game_id].status ||= 'failed:requires-base-game'; @@ -205,7 +206,7 @@ try { urls.push(url); // add add-on itself again } else { // GET console.log(' Not in library yet! Click GET.'); - await page.click('[data-testid="purchase-cta-button"]', { delay: 11 }); // got stuck here without delay (or mouse move), see #75, 1ms was also enough + await purcahseBtn.click({ delay: 11 }); // got stuck here without delay (or mouse move), see #75, 1ms was also enough // click Continue if 'Device not supported. This product is not compatible with your current device.' - avoided by Windows userAgent? page.click('button:has-text("Continue")').catch(_ => { }); // needed since change from Chromium to Firefox? @@ -252,7 +253,7 @@ try { await iframe.locator('button:has-text("Place Order"):not(:has(.payment-loading--loading))').click({ delay: 11 }); // I Agree button is only shown for EU accounts! https://github.com/vogler/free-games-claimer/pull/7#issuecomment-1038964872 - const btnAgree = iframe.locator('button:has-text("I Agree")'); + const btnAgree = iframe.locator('button:has-text("I Accept")'); btnAgree.waitFor().then(() => btnAgree.click()).catch(_ => { }); // EU: wait for and click 'I Agree' try { // context.setDefaultTimeout(100 * 1000); // give time to solve captcha, iframe goes blank after 60s? From 8605b7037707addbd98643bb3e454fedb1951917 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Fri, 2 Aug 2024 12:57:37 +0200 Subject: [PATCH 040/134] pg: fix internal/external locators, closes #355, waitUntilStable 2s -> 5s --- prime-gaming.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index eeface0..b902712 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -101,6 +101,7 @@ try { let v; while (true) { const v2 = await f(); + console.log('waitUntilStable', v2); if (v == v2) break; v = v2; await act(); @@ -109,7 +110,7 @@ try { const scrollUntilStable = async f => waitUntilStable(f, async () => { await page.keyboard.press('End'); // scroll to bottom to show all games await page.waitForLoadState('networkidle'); // wait for all games to be loaded - await page.waitForTimeout(2000); // TODO networkidle wasn't enough to load all already collected games + await page.waitForTimeout(5000); // TODO networkidle wasn't enough to load all already collected games }); await page.click('button[data-type="Game"]'); @@ -118,8 +119,8 @@ try { await scrollUntilStable(() => games.locator('.item-card__action').count()); console.log('Number of already claimed games (total):', await games.locator('p:has-text("Collected")').count()); // can't use .all() since the list of elements via locator will change after click while we iterate over it - const internal = await games.locator('.item-card__action:has([data-a-target="FGWPOffer"])').elementHandles(); - const external = await games.locator('.item-card__action:has([data-a-target="ExternalOfferClaim"])').all(); + const internal = await games.locator('.item-card__action:has(button[data-a-target="FGWPOffer"])').elementHandles(); + const external = await games.locator('.item-card__action:has(a[data-a-target="FGWPOffer"])').all(); // bottom to top: oldest to newest games internal.reverse(); external.reverse(); From eac11e8949c398c870b63d0e3d0d56f6c74e0692 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Fri, 2 Aug 2024 13:06:28 +0200 Subject: [PATCH 041/134] ci/docker: force tag main as latest since many people pull it --- .github/workflows/docker.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a54117c..34c0285 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -34,6 +34,9 @@ jobs: else echo "IMAGE_TAG=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV fi + # TODO the above didn't tag main as latest... probably not available in env.BRANCH right away + echo "${{ env.BRANCH }}" + echo "IMAGE_TAG=latest" >> $GITHUB_ENV - name: Set up QEMU uses: docker/setup-qemu-action@v3 From 23a611a2f11569ed20c189d0d51d45ffa93de403 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Fri, 2 Aug 2024 13:16:54 +0200 Subject: [PATCH 042/134] ci/docker: fix: tag main as latest --- .github/workflows/docker.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 34c0285..5e5adba 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,16 +27,14 @@ jobs: - name: Set environment variables run: | - echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + BRANCH="${GITHUB_REF#refs/heads/}" + echo "BRANCH=$BRANCH" >> $GITHUB_ENV echo "NOW=$(date -R)" >> $GITHUB_ENV # date -Iseconds; date +'%Y-%m-%dT%H:%M:%S' - if [[ "${{ env.BRANCH }}" == "main" ]]; then + if [[ "$BRANCH" == "main" ]]; then echo "IMAGE_TAG=latest" >> $GITHUB_ENV else - echo "IMAGE_TAG=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + echo "IMAGE_TAG=$BRANCH" >> $GITHUB_ENV fi - # TODO the above didn't tag main as latest... probably not available in env.BRANCH right away - echo "${{ env.BRANCH }}" - echo "IMAGE_TAG=latest" >> $GITHUB_ENV - name: Set up QEMU uses: docker/setup-qemu-action@v3 From c87deb393eec26b78d7a30bded8859c183ebb278 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Fri, 2 Aug 2024 14:02:33 +0200 Subject: [PATCH 043/134] pg: DLC: forgot to await scrollUntilStable, closes #356 --- prime-gaming.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prime-gaming.js b/prime-gaming.js index b902712..88ae542 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -352,7 +352,7 @@ try { await loot.waitFor(); process.stdout.write('Loading all DLCs on page...'); - scrollUntilStable(() => loot.locator('[data-a-target="item-card"]').count()) + await scrollUntilStable(() => loot.locator('[data-a-target="item-card"]').count()) console.log('\nNumber of already claimed DLC:', await loot.locator('p:has-text("Collected")').count()); From eafb2316f71d0cc548c4263be74c1818114ffc5b Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 28 Aug 2024 02:31:47 +0200 Subject: [PATCH 044/134] pg: login now has Continue button after email --- prime-gaming.js | 1 + 1 file changed, 1 insertion(+) diff --git a/prime-gaming.js b/prime-gaming.js index 88ae542..7d0d0d2 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -53,6 +53,7 @@ try { const password = email && (cfg.pg_password || await prompt({ type: 'password', message: 'Enter password' })); if (email && password) { await page.fill('[name=email]', email); + await page.click('input[type="submit"]'); await page.fill('[name=password]', password); await page.check('[name=rememberMe]'); await page.click('input[type="submit"]'); From c8e06404906d44395a00fdbdfecd208f2c052a38 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 29 Aug 2024 12:46:28 +0200 Subject: [PATCH 045/134] eg: #371: dump HTML in case of EULA popup to find new locator https://github.com/vogler/free-games-claimer/issues/371 --- epic-games.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index ff8f3e0..fbf5732 100644 --- a/epic-games.js +++ b/epic-games.js @@ -215,8 +215,10 @@ try { page.click('button:has-text("Yes, buy now")').catch(_ => { }); // Accept End User License Agreement (only needed once) - page.locator('input#agree').waitFor().then(async () => { + page.locator(':has-text("end user license agreement")').waitFor().then(async () => { console.log(' Accept End User License Agreement (only needed once)'); + console.log(page.innerHTML); + console.log('Please report the HTML above here: https://github.com/vogler/free-games-claimer/issues/371'); await page.locator('input#agree').check(); // TODO Bundle: got stuck here await page.locator('button:has-text("Accept")').click(); }).catch(_ => { }); From 1f4af79e0eff56dc42bd3a8611c530a0ec606aaf Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 29 Aug 2024 13:23:45 +0200 Subject: [PATCH 046/134] pg: fix loading all games by 2*PageDown + checking height instead of End + checking count..., #357 --- prime-gaming.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index 7d0d0d2..adfdbd4 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -108,16 +108,22 @@ try { await act(); } }; - const scrollUntilStable = async f => waitUntilStable(f, async () => { - await page.keyboard.press('End'); // scroll to bottom to show all games + const scrollUntilStable = async f => await waitUntilStable(f, async () => { + // await page.keyboard.press('End'); // scroll to bottom to show all games + // loading all games became flaky; see https://github.com/vogler/free-games-claimer/issues/357 + await page.keyboard.press('PageDown'); // scrolling to straight to the bottom started to skip loading some games await page.waitForLoadState('networkidle'); // wait for all games to be loaded - await page.waitForTimeout(5000); // TODO networkidle wasn't enough to load all already collected games + await page.waitForTimeout(3000); // TODO networkidle wasn't enough to load all already collected games + // do it again since once wasn't enough... + await page.keyboard.press('PageDown'); + await page.waitForTimeout(3000); }); await page.click('button[data-type="Game"]'); const games = page.locator('div[data-a-target="offer-list-FGWP_FULL"]'); await games.waitFor(); - await scrollUntilStable(() => games.locator('.item-card__action').count()); + // await scrollUntilStable(() => games.locator('.item-card__action').count()); // number of games + await scrollUntilStable(() => page.evaluate(() => document.querySelector('.tw-full-width').scrollHeight)); // height may change during loading while number of games is still the same? console.log('Number of already claimed games (total):', await games.locator('p:has-text("Collected")').count()); // can't use .all() since the list of elements via locator will change after click while we iterate over it const internal = await games.locator('.item-card__action:has(button[data-a-target="FGWPOffer"])').elementHandles(); From 7279ba06e8b50b3cbafbbb51d440b8aaff6bddd7 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 29 Aug 2024 19:48:28 +0200 Subject: [PATCH 047/134] eg: change back to purchase-cta-button from 'aside button', fixes #374 --- epic-games.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/epic-games.js b/epic-games.js index fbf5732..f15d393 100644 --- a/epic-games.js +++ b/epic-games.js @@ -156,8 +156,8 @@ try { for (const url of urls) { if (cfg.time) console.time('claim game'); await page.goto(url); // , { waitUntil: 'domcontentloaded' }); - const purcahseBtn = page.locator('aside button').first(); - const btnText = (await purcahseBtn.innerText()).toLowerCase(); // barrier to block until page is loaded + const purchaseBtn = page.locator('button[data-testid="purchase-cta-button"]').first(); + const btnText = (await purchaseBtn.innerText()).toLowerCase(); // barrier to block until page is loaded // click Continue if 'This game contains mature content recommended only for ages 18+' if (await page.locator('button:has-text("Continue")').count() > 0) { @@ -179,6 +179,7 @@ try { if (await page.locator('span:text-is("About Bundle")').count()) { // console.log(' This is a bundle containing: TODO'); title = (await page.locator('span:has-text("Buy"):left-of([data-testid="purchase-cta-button"])').first().innerText()).replace('Buy ', ''); + // h1 first didn't exist for bundles but now it does... However h1 would e.g. be 'Fallout® Classic Collection' instead of 'Fallout Classic Collection' } else { title = await page.locator('h1').first().innerText(); } @@ -206,7 +207,7 @@ try { urls.push(url); // add add-on itself again } else { // GET console.log(' Not in library yet! Click GET.'); - await purcahseBtn.click({ delay: 11 }); // got stuck here without delay (or mouse move), see #75, 1ms was also enough + await purchaseBtn.click({ delay: 11 }); // got stuck here without delay (or mouse move), see #75, 1ms was also enough // click Continue if 'Device not supported. This product is not compatible with your current device.' - avoided by Windows userAgent? page.click('button:has-text("Continue")').catch(_ => { }); // needed since change from Chromium to Firefox? From 292aadae3c5f4b7ec084dec28129e26312d8a48a Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 29 Aug 2024 20:06:59 +0200 Subject: [PATCH 048/134] eg: list games included in a bundle --- epic-games.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/epic-games.js b/epic-games.js index f15d393..155e9ee 100644 --- a/epic-games.js +++ b/epic-games.js @@ -176,16 +176,22 @@ try { } let title; + let bundle_includes; if (await page.locator('span:text-is("About Bundle")').count()) { - // console.log(' This is a bundle containing: TODO'); title = (await page.locator('span:has-text("Buy"):left-of([data-testid="purchase-cta-button"])').first().innerText()).replace('Buy ', ''); // h1 first didn't exist for bundles but now it does... However h1 would e.g. be 'Fallout® Classic Collection' instead of 'Fallout Classic Collection' + try { + bundle_includes = await Promise.all((await page.locator('.product-card-top-row h5').all()).map(b => b.innerText())); + } catch (e) { + console.error('Failed to get "Bundle Includes":', e); + } } else { title = await page.locator('h1').first().innerText(); } const game_id = page.url().split('/').pop(); db.data[user][game_id] ||= { title, time: datetime(), url: page.url() }; // this will be set on the initial run only! console.log('Current free game:', title); + if (bundle_includes) console.log(' This bundle includes:', bundle_includes); const notify_game = { title, url, status: 'failed' }; notify_games.push(notify_game); // status is updated below @@ -220,7 +226,7 @@ try { console.log(' Accept End User License Agreement (only needed once)'); console.log(page.innerHTML); console.log('Please report the HTML above here: https://github.com/vogler/free-games-claimer/issues/371'); - await page.locator('input#agree').check(); // TODO Bundle: got stuck here + await page.locator('input#agree').check(); // TODO Bundle: got stuck here; likely unrelated to bundle and locator just changed: https://github.com/vogler/free-games-claimer/issues/371 await page.locator('button:has-text("Accept")').click(); }).catch(_ => { }); From fef5b97e3b70d3387233e612d8ed6709437d9cd4 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 29 Aug 2024 20:23:43 +0200 Subject: [PATCH 049/134] eg: wait for purchaseBtn, without it didn't detect bundle as already claimed --- epic-games.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epic-games.js b/epic-games.js index 155e9ee..d8784f8 100644 --- a/epic-games.js +++ b/epic-games.js @@ -157,6 +157,7 @@ try { if (cfg.time) console.time('claim game'); await page.goto(url); // , { waitUntil: 'domcontentloaded' }); const purchaseBtn = page.locator('button[data-testid="purchase-cta-button"]').first(); + await purchaseBtn.waitFor(); const btnText = (await purchaseBtn.innerText()).toLowerCase(); // barrier to block until page is loaded // click Continue if 'This game contains mature content recommended only for ages 18+' @@ -212,7 +213,7 @@ try { urls.push(baseUrl); // add base game to the list of games to claim urls.push(url); // add add-on itself again } else { // GET - console.log(' Not in library yet! Click GET.'); + console.log(' Not in library yet! Click', btnText); await purchaseBtn.click({ delay: 11 }); // got stuck here without delay (or mouse move), see #75, 1ms was also enough // click Continue if 'Device not supported. This product is not compatible with your current device.' - avoided by Windows userAgent? @@ -281,7 +282,7 @@ try { console.error(' Failed to challenge captcha, please try again later.'); await notify('epic-games: failed to challenge captcha. Please check.'); }).catch(_ => { }); - await page.locator('text=Thanks for your order!').waitFor({ state: 'attached' }); // TODO Bundle: got stuck here + await page.locator('text=Thanks for your order!').waitFor({ state: 'attached' }); // TODO Bundle: got stuck here, but normal game now as well db.data[user][game_id].status = 'claimed'; db.data[user][game_id].time = datetime(); // claimed time overwrites failed/dryrun time console.log(' Claimed successfully!'); From c8cf7362fa2ff92386eee4dc847784d95d7f5195 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Sun, 1 Sep 2024 01:20:45 +0200 Subject: [PATCH 050/134] eg: wait for purchaseBtn to have some text, fixes #375 --- epic-games.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index d8784f8..f853380 100644 --- a/epic-games.js +++ b/epic-games.js @@ -156,7 +156,7 @@ try { for (const url of urls) { if (cfg.time) console.time('claim game'); await page.goto(url); // , { waitUntil: 'domcontentloaded' }); - const purchaseBtn = page.locator('button[data-testid="purchase-cta-button"]').first(); + const purchaseBtn = page.locator('button[data-testid="purchase-cta-button"] >> :has-text("e"), :has-text("i")').first(); // when loading, the button text is empty -> need to wait for some text {'get', 'in library', 'requires base game'} -> just wait for e or i to not be too specific; :text-matches("\w+") somehow didn't work - https://github.com/vogler/free-games-claimer/issues/375 await purchaseBtn.waitFor(); const btnText = (await purchaseBtn.innerText()).toLowerCase(); // barrier to block until page is loaded From c5a7a10ca35de6cc54cd16c424ef81af8609a30d Mon Sep 17 00:00:00 2001 From: Samuel Rounce Date: Sat, 28 Sep 2024 18:34:39 +0100 Subject: [PATCH 051/134] fix: docker-entrypoint.sh uses safe shebang Shebangs should use /usr/bin/env to locate the interpreter. Setting a path directly to the interpreter itself tends to be brittle and prone to breaking. --- docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 679acc6..5837164 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eo pipefail # exit on error, error on any fail in pipe (not just last cmd); add -x to print each cmd; see gist bash_strict_mode.md From d5072a62c090ab637af98da524f0a37268f25638 Mon Sep 17 00:00:00 2001 From: AgentTechnoman <46273498+AgentTechnoman@users.noreply.github.com> Date: Thu, 19 Dec 2024 16:46:18 -0700 Subject: [PATCH 052/134] Fix gog error per @jordyamc https://github.com/vogler/free-games-claimer/issues/398#issuecomment-2487274414 --- gog.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gog.js b/gog.js index 0688626..c4d5078 100644 --- a/gog.js +++ b/gog.js @@ -99,7 +99,8 @@ try { console.log('Currently no free giveaway!'); } else { const text = await page.locator('.giveaway__content-header').innerText(); - const title = text.match(/Claim (.*) and don't miss the/)[1]; + const match_all = text.match(/Claim (.*) and don't miss the|Success! (.*) was added to/); + const title = match_all[1] ? match_all[1] : match_all[2]; const url = await banner.locator('a').first().getAttribute('href'); console.log(`Current free game: ${title} - ${url}`); db.data[user][title] ||= { title, time: datetime(), url }; From b3ab8f7830ba6a2f6785812b086134798c55b4da Mon Sep 17 00:00:00 2001 From: NeoMod Date: Wed, 1 Jan 2025 15:31:04 +0100 Subject: [PATCH 053/134] Fixed missing game link in notification for epic-games on captcha halt This fixes the "game link" missing from notification when checking Epic Games Store and encountering a captcha, as per #259 should have been but instead wasn't. Issue was identified in #402 comment by "vttc08" (https://github.com/vogler/free-games-claimer/issues/402#issuecomment-2510818082) I also added the missing notification for "Game Already in Library" for Epic Games Store, since I felt it is useful because it provides an easy way to know if the script is working or not during scheduled usage. This also provided the opportunity to check if the game url link was handled properly outside "Discord": I have added a commented option where one could activate the "Already in Library" notification that will also provide the game url link for easy verification. --- epic-games.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index f853380..5ac6839 100644 --- a/epic-games.js +++ b/epic-games.js @@ -198,6 +198,8 @@ try { if (btnText == 'in library') { console.log(' Already in library! Nothing to claim.'); + //await notify(`Game Already in Library! Follow is a test link:.\n Game link ${url}`); // Decomment this line if you want to also test if a link is beeing sent correctly in a notification. The "already in library" notification was missing, I find it usefull. + await notify(`Game Already in Library!`); // decomment the previous line and comment this one if you also want to test for proper link-handling via notification. notify_game.status = 'existed'; db.data[user][game_id].status ||= 'existed'; // does not overwrite claimed or failed if (db.data[user][game_id].status.startsWith('failed')) db.data[user][game_id].status = 'manual'; // was failed but now it's claimed @@ -271,7 +273,7 @@ try { captcha.waitFor().then(async () => { // don't await, since element may not be shown // console.info(' Got hcaptcha challenge! NopeCHA extension will likely solve it.') console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); - await notify(`epic-games: got captcha challenge right before claim of ${title}. Use VNC to solve it manually.`); // TODO could even create purchase URL, see https://github.com/vogler/free-games-claimer/pull/130 + await notify(`epic-games: got captcha challenge.\n Game link ${url}`);// FIXED: Game link was not sent, probably error with html formatting? Anyway, the link is automatically parsed. TODO could even create purchase URL, see https://github.com/vogler/free-games-claimer/pull/130 // await page.waitForTimeout(2000); // const p = path.resolve(cfg.dir.screenshots, 'epic-games', 'captcha', `${filenamify(datetime())}.png`); // await captcha.screenshot({ path: p }); From 9e87ce58ac2899e58d771c6894e6d3f2a166d75d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 13:17:13 +0000 Subject: [PATCH 054/134] Add renovate.json --- renovate.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..5db72dd --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ] +} From 4a018c20e930b1945872804af67265253d50790f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 13:22:40 +0000 Subject: [PATCH 055/134] fix(deps): update dependency dotenv to v16.4.7 --- package-lock.json | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index e6f66b2..30fd170 100644 --- a/package-lock.json +++ b/package-lock.json @@ -512,10 +512,9 @@ } }, "node_modules/dotenv": { - "version": "16.4.5", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", - "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", - "license": "BSD-2-Clause", + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", "engines": { "node": ">=12" }, @@ -2052,9 +2051,9 @@ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==" }, "dotenv": { - "version": "16.4.5", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", - "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==" + "version": "16.4.7", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", + "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==" }, "enquirer": { "version": "2.4.1", From fed03428f3efff42ddd1fcc4a0adc2b25a405c6b Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 5 Mar 2025 15:07:37 +0100 Subject: [PATCH 056/134] try super-linter https://github.com/marketplace/actions/super-linter#get-started --- .github/workflows/lint.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..792d1d4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,33 @@ +--- +name: Lint + +on: # yamllint disable-line rule:truthy + push: null + pull_request: null + +permissions: {} + +jobs: + build: + name: Lint + runs-on: ubuntu-latest + + permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # super-linter needs the full git history to get the + # list of files that changed across commits + fetch-depth: 0 + + - name: Super-linter + uses: super-linter/super-linter@v7.3.0 # x-release-please-version + env: + # To report GitHub Actions status checks + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d76c03ed6aff7d2fe4eac4d44903e982aef9dcfc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 14:08:28 +0000 Subject: [PATCH 057/134] chore(deps): update dependency eslint to v9.21.0 --- package-lock.json | 534 ++++++++++++++++++++-------------------------- 1 file changed, 226 insertions(+), 308 deletions(-) diff --git a/package-lock.json b/package-lock.json index e6f66b2..1205edc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,35 +51,45 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/config-array": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.16.0.tgz", - "integrity": "sha512-/jmuSd74i4Czf1XXn7wGRWZCuyaUZ330NH1Bek0Pplatt4Sy1S5haN21SCLLdbeKslQ+S0wEJ+++v5YibSi+Lg==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", + "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "@eslint/object-schema": "^2.1.4", + "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", - "minimatch": "^3.0.5" + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", + "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.15" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", + "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", "dev": true, - "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -99,25 +109,58 @@ } }, "node_modules/@eslint/js": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.5.0.tgz", - "integrity": "sha512-A7+AOT2ICkodvtsWnxZP4Xxk3NbZ3VMHd8oihydLRGrJgqqdEz1qSeEgXYyT/Cu8h1TWWsQRejIx48mtjZ5y1w==", + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.21.0.tgz", + "integrity": "sha512-BqStZ3HX8Yz6LvsF5ByXYrtigrV5AXADWLAGc7PH/1SxOb7/FIYYMszZZWiUou/GB9P2lXWk2SV4d+Z8h0nknw==", "dev": true, - "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/object-schema": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", "dev": true, - "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", + "integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", + "dev": true, + "dependencies": { + "@eslint/core": "^0.12.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -145,41 +188,6 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/@otplib/core": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/@otplib/core/-/core-12.0.1.tgz", @@ -274,11 +282,10 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", - "dev": true, - "license": "MIT" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true }, "node_modules/@types/json-schema": { "version": "7.0.15", @@ -293,11 +300,10 @@ "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" }, "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", "dev": true, - "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -469,9 +475,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -548,28 +554,31 @@ } }, "node_modules/eslint": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.5.0.tgz", - "integrity": "sha512-+NAOZFrW/jFTS3dASCGBxX1pkFD0/fsO+hfAkJ4TyYKwgsXZbqzrw+seCYFCcPCYXvnD67tAnglU7GQTz6kcVw==", + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.21.0.tgz", + "integrity": "sha512-KjeihdFqTPhOMXTt7StsDxriV4n66ueuF/jfPNC3j/lduHwr/ijDwJMsF+wyMJethgiKi5wniIE243vi07d3pg==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/config-array": "^0.16.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.5.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.2", + "@eslint/core": "^0.12.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "9.21.0", + "@eslint/plugin-kit": "^0.2.7", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.0", - "@nodelib/fs.walk": "^1.2.8", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.1", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.0.1", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -579,15 +588,11 @@ "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" @@ -597,14 +602,21 @@ }, "funding": { "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, "node_modules/eslint-scope": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz", - "integrity": "sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -628,6 +640,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/@humanwhocodes/retry": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", + "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", + "dev": true, + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -645,11 +670,10 @@ } }, "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -658,15 +682,14 @@ } }, "node_modules/espree": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz", - "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.11.3", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.0.0" + "eslint-visitor-keys": "^4.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -676,11 +699,10 @@ } }, "node_modules/espree/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -752,15 +774,6 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", @@ -990,15 +1003,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -1452,26 +1456,6 @@ } } }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -1482,16 +1466,6 @@ "node": ">=4" } }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -1506,29 +1480,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/shallow-clone": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-0.1.2.tgz", @@ -1629,12 +1580,6 @@ "node": ">=8" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, "node_modules/thirty-two": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/thirty-two/-/thirty-two-1.0.2.tgz", @@ -1722,26 +1667,35 @@ } }, "@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true }, "@eslint/config-array": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.16.0.tgz", - "integrity": "sha512-/jmuSd74i4Czf1XXn7wGRWZCuyaUZ330NH1Bek0Pplatt4Sy1S5haN21SCLLdbeKslQ+S0wEJ+++v5YibSi+Lg==", + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", + "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", "dev": true, "requires": { - "@eslint/object-schema": "^2.1.4", + "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", - "minimatch": "^3.0.5" + "minimatch": "^3.1.2" + } + }, + "@eslint/core": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", + "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.15" } }, "@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", + "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -1756,17 +1710,43 @@ } }, "@eslint/js": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.5.0.tgz", - "integrity": "sha512-A7+AOT2ICkodvtsWnxZP4Xxk3NbZ3VMHd8oihydLRGrJgqqdEz1qSeEgXYyT/Cu8h1TWWsQRejIx48mtjZ5y1w==", + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.21.0.tgz", + "integrity": "sha512-BqStZ3HX8Yz6LvsF5ByXYrtigrV5AXADWLAGc7PH/1SxOb7/FIYYMszZZWiUou/GB9P2lXWk2SV4d+Z8h0nknw==", "dev": true }, "@eslint/object-schema": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz", - "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==", + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", "dev": true }, + "@eslint/plugin-kit": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", + "integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", + "dev": true, + "requires": { + "@eslint/core": "^0.12.0", + "levn": "^0.4.1" + } + }, + "@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true + }, + "@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "requires": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + } + }, "@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -1779,32 +1759,6 @@ "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", "dev": true }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, "@otplib/core": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/@otplib/core/-/core-12.0.1.tgz", @@ -1886,9 +1840,9 @@ } }, "@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "@types/json-schema": { @@ -1903,9 +1857,9 @@ "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" }, "acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", "dev": true }, "acorn-jsx": { @@ -2023,9 +1977,9 @@ } }, "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -2072,27 +2026,31 @@ "dev": true }, "eslint": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.5.0.tgz", - "integrity": "sha512-+NAOZFrW/jFTS3dASCGBxX1pkFD0/fsO+hfAkJ4TyYKwgsXZbqzrw+seCYFCcPCYXvnD67tAnglU7GQTz6kcVw==", + "version": "9.21.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.21.0.tgz", + "integrity": "sha512-KjeihdFqTPhOMXTt7StsDxriV4n66ueuF/jfPNC3j/lduHwr/ijDwJMsF+wyMJethgiKi5wniIE243vi07d3pg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/config-array": "^0.16.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.5.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.2", + "@eslint/core": "^0.12.0", + "@eslint/eslintrc": "^3.3.0", + "@eslint/js": "9.21.0", + "@eslint/plugin-kit": "^0.2.7", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.3.0", - "@nodelib/fs.walk": "^1.2.8", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.0.1", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.0.1", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -2102,17 +2060,19 @@ "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "dependencies": { + "@humanwhocodes/retry": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", + "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", + "dev": true + }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -2124,17 +2084,17 @@ } }, "eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true } } }, "eslint-scope": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.0.1.tgz", - "integrity": "sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", "dev": true, "requires": { "esrecurse": "^4.3.0", @@ -2148,20 +2108,20 @@ "dev": true }, "espree": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz", - "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "requires": { - "acorn": "^8.11.3", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.0.0" + "eslint-visitor-keys": "^4.2.0" }, "dependencies": { "eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true } } @@ -2214,15 +2174,6 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, "file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", @@ -2386,12 +2337,6 @@ "is-extglob": "^2.1.1" } }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true - }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -2688,24 +2633,12 @@ "puppeteer-extra-plugin-user-data-dir": "^2.4.1" } }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -2714,15 +2647,6 @@ "glob": "^7.1.3" } }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, "shallow-clone": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-0.1.2.tgz", @@ -2790,12 +2714,6 @@ "has-flag": "^4.0.0" } }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, "thirty-two": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/thirty-two/-/thirty-two-1.0.2.tgz", From 041605dcf70911c637da8d225146e30dad3acace Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 14:08:35 +0000 Subject: [PATCH 058/134] fix(deps): update dependency chalk to v5.4.1 --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index e6f66b2..03b750e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -403,9 +403,9 @@ } }, "node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", + "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -1978,9 +1978,9 @@ "dev": true }, "chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==" + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", + "integrity": "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==" }, "clone-deep": { "version": "0.2.4", From d6666aed034ef84bfdc2b3240d70df29d5b30ece Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 5 Mar 2025 15:17:34 +0100 Subject: [PATCH 059/134] super-linter: use slim version --- .github/workflows/lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 792d1d4..951e26d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ ---- +# https://github.com/marketplace/actions/super-linter#get-started name: Lint on: # yamllint disable-line rule:truthy @@ -27,7 +27,7 @@ jobs: fetch-depth: 0 - name: Super-linter - uses: super-linter/super-linter@v7.3.0 # x-release-please-version + uses: super-linter/super-linter/slim@v7.3.0 # x-release-please-version env: # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From bf2216f73175c74b764a278f48ae9b7331d954ce Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 5 Mar 2025 15:27:00 +0100 Subject: [PATCH 060/134] super-linter: TODO fix-lint-issues --- .github/workflows/lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 951e26d..ab3ad59 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,7 +8,7 @@ on: # yamllint disable-line rule:truthy permissions: {} jobs: - build: + lint: name: Lint runs-on: ubuntu-latest @@ -31,3 +31,5 @@ jobs: env: # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # TODO automatically fix linting issues and commit them for PRs + # fix-lint-issues: # https://github.com/marketplace/actions/super-linter#github-actions-workflow-example-pull-request From 6aa0f9b8177c2962d217bcd6e54caf84b3dded95 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 5 Mar 2025 15:34:03 +0100 Subject: [PATCH 061/134] super-linter: problem matchers included? --- .github/workflows/lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ab3ad59..0ed6b5b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,6 +28,7 @@ jobs: - name: Super-linter uses: super-linter/super-linter/slim@v7.3.0 # x-release-please-version + # TODO need to create problem matchers for each linter? https://github.com/rhysd/actionlint/blob/v1.7.7/docs/usage.md#problem-matchers env: # To report GitHub Actions status checks GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d620ee2731ba66ae293ee69c87559744311a6a37 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 14:46:12 +0000 Subject: [PATCH 062/134] chore(deps): update dependency @stylistic/eslint-plugin-js to v2.13.0 --- package-lock.json | 59 +++++++++++++---------------------------------- 1 file changed, 16 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index 364a707..3870b15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -231,16 +231,13 @@ } }, "node_modules/@stylistic/eslint-plugin-js": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.2.2.tgz", - "integrity": "sha512-Vj2Q1YHVvJw+ThtOvmk5Yx7wZanVrIBRUTT89horLDb4xdP9GA1um9XOYQC6j67VeUC2gjZQnz5/RVJMzaOhtw==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.13.0.tgz", + "integrity": "sha512-GPPDK4+fcbsQD58a3abbng2Dx+jBoxM5cnYjBM4T24WFZRZdlNSKvR19TxP8CPevzMOodQ9QVzNeqWvMXzfJRA==", "dev": true, - "license": "MIT", "dependencies": { - "@types/eslint": "^8.56.10", - "acorn": "^8.11.3", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.0.1" + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -250,11 +247,10 @@ } }, "node_modules/@stylistic/eslint-plugin-js/node_modules/eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, - "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -270,17 +266,6 @@ "@types/ms": "*" } }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -1801,21 +1786,19 @@ } }, "@stylistic/eslint-plugin-js": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.2.2.tgz", - "integrity": "sha512-Vj2Q1YHVvJw+ThtOvmk5Yx7wZanVrIBRUTT89horLDb4xdP9GA1um9XOYQC6j67VeUC2gjZQnz5/RVJMzaOhtw==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.13.0.tgz", + "integrity": "sha512-GPPDK4+fcbsQD58a3abbng2Dx+jBoxM5cnYjBM4T24WFZRZdlNSKvR19TxP8CPevzMOodQ9QVzNeqWvMXzfJRA==", "dev": true, "requires": { - "@types/eslint": "^8.56.10", - "acorn": "^8.11.3", - "eslint-visitor-keys": "^4.0.0", - "espree": "^10.0.1" + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0" }, "dependencies": { "eslint-visitor-keys": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", - "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true } } @@ -1828,16 +1811,6 @@ "@types/ms": "*" } }, - "@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dev": true, - "requires": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, "@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", From cb22abfb2fbc98664da57a33d6ee9195edd51246 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 14:53:57 +0000 Subject: [PATCH 063/134] chore(deps): update dependency @stylistic/eslint-plugin-js to v4 --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 40345b6..e579b4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "puppeteer-extra-plugin-stealth": "^2.11.2" }, "devDependencies": { - "@stylistic/eslint-plugin-js": "^2.2.2", + "@stylistic/eslint-plugin-js": "^4.0.0", "eslint": "^9.5.0" }, "engines": { @@ -231,9 +231,9 @@ } }, "node_modules/@stylistic/eslint-plugin-js": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.13.0.tgz", - "integrity": "sha512-GPPDK4+fcbsQD58a3abbng2Dx+jBoxM5cnYjBM4T24WFZRZdlNSKvR19TxP8CPevzMOodQ9QVzNeqWvMXzfJRA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-4.2.0.tgz", + "integrity": "sha512-MiJr6wvyzMYl/wElmj8Jns8zH7Q1w8XoVtm+WM6yDaTrfxryMyb8n0CMxt82fo42RoLIfxAEtM6tmQVxqhk0/A==", "dev": true, "dependencies": { "eslint-visitor-keys": "^4.2.0", @@ -243,7 +243,7 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "peerDependencies": { - "eslint": ">=8.40.0" + "eslint": ">=9.0.0" } }, "node_modules/@stylistic/eslint-plugin-js/node_modules/eslint-visitor-keys": { @@ -1786,9 +1786,9 @@ } }, "@stylistic/eslint-plugin-js": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.13.0.tgz", - "integrity": "sha512-GPPDK4+fcbsQD58a3abbng2Dx+jBoxM5cnYjBM4T24WFZRZdlNSKvR19TxP8CPevzMOodQ9QVzNeqWvMXzfJRA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-4.2.0.tgz", + "integrity": "sha512-MiJr6wvyzMYl/wElmj8Jns8zH7Q1w8XoVtm+WM6yDaTrfxryMyb8n0CMxt82fo42RoLIfxAEtM6tmQVxqhk0/A==", "dev": true, "requires": { "eslint-visitor-keys": "^4.2.0", diff --git a/package.json b/package.json index 2c64f46..e1e3340 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "puppeteer-extra-plugin-stealth": "^2.11.2" }, "devDependencies": { - "@stylistic/eslint-plugin-js": "^2.2.2", + "@stylistic/eslint-plugin-js": "^4.0.0", "eslint": "^9.5.0" } } From e75975b273a368f99306d57daa5c3b07f4a4443b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Mar 2025 14:54:01 +0000 Subject: [PATCH 064/134] chore(deps): update docker/build-push-action action to v6 --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5e5adba..071585e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -57,7 +57,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 # if: github.event_name != 'pull_request' # still want to build image with: context: . From 3626fc17626f386614c1189f6a20809331065a74 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 5 Mar 2025 16:17:48 +0100 Subject: [PATCH 065/134] fixup #417 --- epic-games.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/epic-games.js b/epic-games.js index 5ac6839..9aa4482 100644 --- a/epic-games.js +++ b/epic-games.js @@ -198,8 +198,7 @@ try { if (btnText == 'in library') { console.log(' Already in library! Nothing to claim.'); - //await notify(`Game Already in Library! Follow is a test link:.\n Game link ${url}`); // Decomment this line if you want to also test if a link is beeing sent correctly in a notification. The "already in library" notification was missing, I find it usefull. - await notify(`Game Already in Library!`); // decomment the previous line and comment this one if you also want to test for proper link-handling via notification. + await notify(`Game already in library: ${url}`); notify_game.status = 'existed'; db.data[user][game_id].status ||= 'existed'; // does not overwrite claimed or failed if (db.data[user][game_id].status.startsWith('failed')) db.data[user][game_id].status = 'manual'; // was failed but now it's claimed @@ -273,7 +272,9 @@ try { captcha.waitFor().then(async () => { // don't await, since element may not be shown // console.info(' Got hcaptcha challenge! NopeCHA extension will likely solve it.') console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); - await notify(`epic-games: got captcha challenge.\n Game link ${url}`);// FIXED: Game link was not sent, probably error with html formatting? Anyway, the link is automatically parsed. TODO could even create purchase URL, see https://github.com/vogler/free-games-claimer/pull/130 + // await notify(`epic-games: got captcha challenge right before claim of ${title}. Use VNC to solve it manually.`); // TODO not all apprise services understand HTML: https://github.com/vogler/free-games-claimer/pull/417 + await notify(`epic-games: got captcha challenge for.\nGame link: ${url}`); + // TODO could even create purchase URL, see https://github.com/vogler/free-games-claimer/pull/130 // await page.waitForTimeout(2000); // const p = path.resolve(cfg.dir.screenshots, 'epic-games', 'captcha', `${filenamify(datetime())}.png`); // await captcha.screenshot({ path: p }); From ea69c76b5016e17cfb58d49764990b6459c99e20 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 11 Mar 2025 10:14:42 +0100 Subject: [PATCH 066/134] eg: fix #449: only notify once if 'Game already in library' --- epic-games.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epic-games.js b/epic-games.js index 9aa4482..f03350f 100644 --- a/epic-games.js +++ b/epic-games.js @@ -190,6 +190,7 @@ try { title = await page.locator('h1').first().innerText(); } const game_id = page.url().split('/').pop(); + const existedInDb = db.data[user][game_id]; db.data[user][game_id] ||= { title, time: datetime(), url: page.url() }; // this will be set on the initial run only! console.log('Current free game:', title); if (bundle_includes) console.log(' This bundle includes:', bundle_includes); @@ -198,7 +199,7 @@ try { if (btnText == 'in library') { console.log(' Already in library! Nothing to claim.'); - await notify(`Game already in library: ${url}`); + if (!existedInDb) await notify(`Game already in library: ${url}`); notify_game.status = 'existed'; db.data[user][game_id].status ||= 'existed'; // does not overwrite claimed or failed if (db.data[user][game_id].status.startsWith('failed')) db.data[user][game_id].status = 'manual'; // was failed but now it's claimed From 8b7018f54c6427532ae65b99829d9cd5a1826b92 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 27 Mar 2025 16:26:40 +0100 Subject: [PATCH 067/134] fix actionlint errors (docker.yml) Double quote to prevent globbing and word splitting --- .github/workflows/docker.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 071585e..6371f4c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,12 +28,12 @@ jobs: name: Set environment variables run: | BRANCH="${GITHUB_REF#refs/heads/}" - echo "BRANCH=$BRANCH" >> $GITHUB_ENV - echo "NOW=$(date -R)" >> $GITHUB_ENV # date -Iseconds; date +'%Y-%m-%dT%H:%M:%S' + echo "BRANCH=$BRANCH" >> "$GITHUB_ENV" + echo "NOW=$(date -R)" >> "$GITHUB_ENV" # date -Iseconds; date +'%Y-%m-%dT%H:%M:%S' if [[ "$BRANCH" == "main" ]]; then - echo "IMAGE_TAG=latest" >> $GITHUB_ENV + echo "IMAGE_TAG=latest" >> "$GITHUB_ENV" else - echo "IMAGE_TAG=$BRANCH" >> $GITHUB_ENV + echo "IMAGE_TAG=$BRANCH" >> "$GITHUB_ENV" fi - name: Set up QEMU From cfe42db805d7082f0f32d095f52e502164f4fc94 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 27 Mar 2025 16:53:27 +0100 Subject: [PATCH 068/134] pg: fix logo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2431c55..e3da438 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Claims free games periodically on - [Epic Games Store](https://www.epicgames.com/store/free-games) -- [Amazon Prime Gaming](https://gaming.amazon.com) +- [Amazon Prime Gaming](https://gaming.amazon.com) - [GOG](https://www.gog.com) - [Unreal Engine (Assets)](https://www.unrealengine.com/marketplace/en-US/assets?count=20&sortBy=effectiveDate&sortDir=DESC&start=0&tag=4910) ([experimental](https://github.com/vogler/free-games-claimer/issues/44), same login as Epic Games) From 787522473fee1b17f89e02da9c729a8fd6d5a1f8 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 27 Mar 2025 16:53:41 +0100 Subject: [PATCH 069/134] readme: logos: vertical-align: middle --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e3da438..cd215eb 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ # free-games-claimer Claims free games periodically on -- [Epic Games Store](https://www.epicgames.com/store/free-games) -- [Amazon Prime Gaming](https://gaming.amazon.com) -- [GOG](https://www.gog.com) -- [Unreal Engine (Assets)](https://www.unrealengine.com/marketplace/en-US/assets?count=20&sortBy=effectiveDate&sortDir=DESC&start=0&tag=4910) ([experimental](https://github.com/vogler/free-games-claimer/issues/44), same login as Epic Games) +- [Epic Games Store](https://www.epicgames.com/store/free-games) +- [Amazon Prime Gaming](https://gaming.amazon.com) +- [GOG](https://www.gog.com) +- [Unreal Engine (Assets)](https://www.unrealengine.com/marketplace/en-US/assets?count=20&sortBy=effectiveDate&sortDir=DESC&start=0&tag=4910) ([experimental](https://github.com/vogler/free-games-claimer/issues/44), same login as Epic Games) Pull requests welcome :) From 041a77d9f6b882a16dcc1186c0bb4f410acb4d7a Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 27 Mar 2025 17:01:18 +0100 Subject: [PATCH 070/134] readme: logos: align: middle - CSS is stripped --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cd215eb..e84224c 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ # free-games-claimer Claims free games periodically on -- [Epic Games Store](https://www.epicgames.com/store/free-games) -- [Amazon Prime Gaming](https://gaming.amazon.com) -- [GOG](https://www.gog.com) -- [Unreal Engine (Assets)](https://www.unrealengine.com/marketplace/en-US/assets?count=20&sortBy=effectiveDate&sortDir=DESC&start=0&tag=4910) ([experimental](https://github.com/vogler/free-games-claimer/issues/44), same login as Epic Games) +- [Epic Games Store](https://www.epicgames.com/store/free-games) +- [Amazon Prime Gaming](https://gaming.amazon.com) +- [GOG](https://www.gog.com) +- [Unreal Engine (Assets)](https://www.unrealengine.com/marketplace/en-US/assets?count=20&sortBy=effectiveDate&sortDir=DESC&start=0&tag=4910) ([experimental](https://github.com/vogler/free-games-claimer/issues/44), same login as Epic Games) Pull requests welcome :) From 90e3400072303f0def90991740323a63dae33afc Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 27 Mar 2025 17:11:30 +0100 Subject: [PATCH 071/134] readme: logos: use GitHub asset upload --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e84224c..17ec854 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ # free-games-claimer Claims free games periodically on -- [Epic Games Store](https://www.epicgames.com/store/free-games) -- [Amazon Prime Gaming](https://gaming.amazon.com) -- [GOG](https://www.gog.com) -- [Unreal Engine (Assets)](https://www.unrealengine.com/marketplace/en-US/assets?count=20&sortBy=effectiveDate&sortDir=DESC&start=0&tag=4910) ([experimental](https://github.com/vogler/free-games-claimer/issues/44), same login as Epic Games) +- [Epic Games Store](https://www.epicgames.com/store/free-games) +- [Amazon Prime Gaming](https://gaming.amazon.com) +- [GOG](https://www.gog.com) +- [Unreal Engine (Assets)](https://www.unrealengine.com/marketplace/en-US/assets?count=20&sortBy=effectiveDate&sortDir=DESC&start=0&tag=4910) ([experimental](https://github.com/vogler/free-games-claimer/issues/44), same login as Epic Games) Pull requests welcome :) From 92cb32ff2dabd622252aa20bfbda63c953ed31a8 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 3 Apr 2025 15:33:00 +0200 Subject: [PATCH 072/134] ae: try fingerprint-injector --- aliexpress.js | 29 +++- package-lock.json | 398 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 1 + 3 files changed, 420 insertions(+), 8 deletions(-) diff --git a/aliexpress.js b/aliexpress.js index c44c673..e2439a4 100644 --- a/aliexpress.js +++ b/aliexpress.js @@ -2,16 +2,35 @@ import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdate import { datetime, filenamify, prompt, handleSIGINT, stealth } from './src/util.js'; import { cfg } from './src/config.js'; +// using https://github.com/apify/fingerprint-suite worked, but has no launchPersistentContext... +// from https://github.com/apify/fingerprint-suite/issues/162 +import { FingerprintInjector } from 'fingerprint-injector'; +import { FingerprintGenerator } from 'fingerprint-generator'; + +const { fingerprint, headers } = new FingerprintGenerator().getFingerprint({ + devices: ["mobile"], + operatingSystems: ["android"], +}); + const context = await firefox.launchPersistentContext(cfg.dir.browser, { headless: cfg.headless, - viewport: { width: cfg.width, height: cfg.height }, + // viewport: { width: cfg.width, height: cfg.height }, locale: 'en-US', // ignore OS locale to be sure to have english text for locators -> done via /en in URL recordVideo: cfg.record ? { dir: 'data/record/', size: { width: cfg.width, height: cfg.height } } : undefined, // will record a .webm video for each page navigated; without size, video would be scaled down to fit 800x800 - recordHar: cfg.record ? { path: `data/record/gog-${filenamify(datetime())}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools + recordHar: cfg.record ? { path: `data/record/aliexpress-${filenamify(datetime())}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools handleSIGINT: false, // have to handle ourselves and call context.close(), otherwise recordings from above won't be saved + userAgent: fingerprint.navigator.userAgent, + viewport: { + width: fingerprint.screen.width, + height: fingerprint.screen.height, + }, + extraHTTPHeaders: { + 'accept-language': headers['accept-language'], + }, }); handleSIGINT(context); -await stealth(context); +// await stealth(context); +await new FingerprintInjector().attachFingerprintToPlaywright(context, { fingerprint, headers }); context.setDefaultTimeout(cfg.debug ? 0 : cfg.timeout); @@ -88,11 +107,11 @@ const merge = async () => { try { // await coins(); await [ - coins, + // coins, // grow, // gogo, // euro, - // merge, + merge, ].reduce((a, f) => a.then(async _ => { await auth(urls[f.name]); await f(); console.log() }), Promise.resolve()); // await page.pause(); diff --git a/package-lock.json b/package-lock.json index e579b4f..dd57aa8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "cross-env": "^7.0.3", "dotenv": "^16.4.5", "enquirer": "^2.4.1", + "fingerprint-injector": "^2.1.52", "lowdb": "^7.0.1", "otplib": "^12.0.1", "playwright-firefox": "^1.45.0", @@ -230,6 +231,18 @@ "@otplib/plugin-thirty-two": "^12.0.1" } }, + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, "node_modules/@stylistic/eslint-plugin-js": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-4.2.0.tgz", @@ -306,6 +319,15 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/adm-zip": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz", + "integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==", + "license": "MIT", + "engines": { + "node": ">=12.0" + } + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -383,16 +405,67 @@ "concat-map": "0.0.1" } }, + "node_modules/browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, + "node_modules/caniuse-lite": { + "version": "1.0.30001709", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001709.tgz", + "integrity": "sha512-NgL3vUTnDrPCZ3zTahp4fsugQ4dc7EKTSzwQDPEel6DMoMnfH2jhry9n2Zm8onbSR+f/QtKHFOA+iAQu4kbtWA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, "node_modules/chalk": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.4.1.tgz", @@ -502,6 +575,21 @@ "node": ">=0.10.0" } }, + "node_modules/dot-prop": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "license": "MIT", + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/dotenv": { "version": "16.4.7", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", @@ -513,6 +601,12 @@ "url": "https://dotenvx.com" } }, + "node_modules/electron-to-chromium": { + "version": "1.5.130", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.130.tgz", + "integrity": "sha512-Ou2u7L9j2XLZbhqzyX0jWDj6gA8D3jIfVzt4rikLf3cGBa0VdReuFimBKS9tQJA4+XpeCxj1NoWlfBXzbMa9IA==", + "license": "ISC" + }, "node_modules/enquirer": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", @@ -525,6 +619,15 @@ "node": ">=8.6" } }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -787,6 +890,45 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/fingerprint-generator": { + "version": "2.1.63", + "resolved": "https://registry.npmjs.org/fingerprint-generator/-/fingerprint-generator-2.1.63.tgz", + "integrity": "sha512-9ud3dO2aD0wKc9/zEAletQZ/iPuGqTwmkA7Y33OeOv/N+OvTM6OStxXbNLCsGSD7jUYe4ei/TK9uXwiQntbZGA==", + "license": "Apache-2.0", + "dependencies": { + "generative-bayesian-network": "^2.1.63", + "header-generator": "^2.1.63", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/fingerprint-injector": { + "version": "2.1.63", + "resolved": "https://registry.npmjs.org/fingerprint-injector/-/fingerprint-injector-2.1.63.tgz", + "integrity": "sha512-OZpxOKi4iyU2hzqXuJDddb5ayfLgWJvnaDwWAExC5/P+XuXbAMf9cLIOAEQ3B2SnAbXUXZw6k8vQqeg6vSrWIA==", + "license": "Apache-2.0", + "dependencies": { + "fingerprint-generator": "^2.1.63", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "playwright": "^1.22.2", + "puppeteer": ">= 9.x" + }, + "peerDependenciesMeta": { + "playwright": { + "optional": true + }, + "puppeteer": { + "optional": true + } + } + }, "node_modules/flat-cache": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", @@ -845,6 +987,16 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "node_modules/generative-bayesian-network": { + "version": "2.1.63", + "resolved": "https://registry.npmjs.org/generative-bayesian-network/-/generative-bayesian-network-2.1.63.tgz", + "integrity": "sha512-nH1t4R9nlWSmvFoI4DEcpXd0+yoGZcySVuUBkXhR09/Mf7O9AWFmR8lWqVGIoxpBS0WRNpV/qj4swKGGQAxAPQ==", + "license": "Apache-2.0", + "dependencies": { + "adm-zip": "^0.5.9", + "tslib": "^2.4.0" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -903,6 +1055,21 @@ "node": ">=8" } }, + "node_modules/header-generator": { + "version": "2.1.63", + "resolved": "https://registry.npmjs.org/header-generator/-/header-generator-2.1.63.tgz", + "integrity": "sha512-dicAWZb/zXmI3fPuCw1Ra1sTTC9x9cc5EOhwugmI/keXnRc3BzxDQTGHge+MeAdqhpo2ZOFTEV6u08lXJUA2uQ==", + "license": "Apache-2.0", + "dependencies": { + "browserslist": "^4.21.1", + "generative-bayesian-network": "^2.1.63", + "ow": "^0.28.1", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", @@ -987,6 +1154,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -1112,6 +1288,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.", + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -1188,6 +1371,12 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "license": "MIT" + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1223,6 +1412,25 @@ "@otplib/preset-v11": "^12.0.1" } }, + "node_modules/ow": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz", + "integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==", + "license": "MIT", + "dependencies": { + "@sindresorhus/is": "^4.2.0", + "callsites": "^3.1.0", + "dot-prop": "^6.0.1", + "lodash.isequal": "^4.5.0", + "vali-date": "^1.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -1291,6 +1499,12 @@ "node": ">=8" } }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, "node_modules/playwright-core": { "version": "1.45.0", "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.0.tgz", @@ -1572,6 +1786,12 @@ "node": ">=0.2.6" } }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -1592,6 +1812,36 @@ "node": ">= 10.0.0" } }, + "node_modules/update-browserslist-db": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -1602,6 +1852,15 @@ "punycode": "^2.1.0" } }, + "node_modules/vali-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", + "integrity": "sha512-sgECfZthyaCKW10N0fm27cg8HYTFK5qMWgypqkXMQ4Wbl/zZKx7xZICgcoxIIE+WFAP/MBL2EFwC/YvLxw3Zeg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -1785,6 +2044,11 @@ "@otplib/plugin-thirty-two": "^12.0.1" } }, + "@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==" + }, "@stylistic/eslint-plugin-js": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-4.2.0.tgz", @@ -1841,6 +2105,11 @@ "dev": true, "requires": {} }, + "adm-zip": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz", + "integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==" + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -1897,11 +2166,26 @@ "concat-map": "0.0.1" } }, + "browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "requires": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + }, + "caniuse-lite": { + "version": "1.0.30001709", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001709.tgz", + "integrity": "sha512-NgL3vUTnDrPCZ3zTahp4fsugQ4dc7EKTSzwQDPEel6DMoMnfH2jhry9n2Zm8onbSR+f/QtKHFOA+iAQu4kbtWA==" }, "chalk": { "version": "5.4.1", @@ -1977,11 +2261,24 @@ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==" }, + "dot-prop": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", + "requires": { + "is-obj": "^2.0.0" + } + }, "dotenv": { "version": "16.4.7", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==" }, + "electron-to-chromium": { + "version": "1.5.130", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.130.tgz", + "integrity": "sha512-Ou2u7L9j2XLZbhqzyX0jWDj6gA8D3jIfVzt4rikLf3cGBa0VdReuFimBKS9tQJA4+XpeCxj1NoWlfBXzbMa9IA==" + }, "enquirer": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", @@ -1991,6 +2288,11 @@ "strip-ansi": "^6.0.1" } }, + "escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==" + }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -2165,6 +2467,25 @@ "path-exists": "^4.0.0" } }, + "fingerprint-generator": { + "version": "2.1.63", + "resolved": "https://registry.npmjs.org/fingerprint-generator/-/fingerprint-generator-2.1.63.tgz", + "integrity": "sha512-9ud3dO2aD0wKc9/zEAletQZ/iPuGqTwmkA7Y33OeOv/N+OvTM6OStxXbNLCsGSD7jUYe4ei/TK9uXwiQntbZGA==", + "requires": { + "generative-bayesian-network": "^2.1.63", + "header-generator": "^2.1.63", + "tslib": "^2.4.0" + } + }, + "fingerprint-injector": { + "version": "2.1.63", + "resolved": "https://registry.npmjs.org/fingerprint-injector/-/fingerprint-injector-2.1.63.tgz", + "integrity": "sha512-OZpxOKi4iyU2hzqXuJDddb5ayfLgWJvnaDwWAExC5/P+XuXbAMf9cLIOAEQ3B2SnAbXUXZw6k8vQqeg6vSrWIA==", + "requires": { + "fingerprint-generator": "^2.1.63", + "tslib": "^2.4.0" + } + }, "flat-cache": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", @@ -2209,6 +2530,15 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "generative-bayesian-network": { + "version": "2.1.63", + "resolved": "https://registry.npmjs.org/generative-bayesian-network/-/generative-bayesian-network-2.1.63.tgz", + "integrity": "sha512-nH1t4R9nlWSmvFoI4DEcpXd0+yoGZcySVuUBkXhR09/Mf7O9AWFmR8lWqVGIoxpBS0WRNpV/qj4swKGGQAxAPQ==", + "requires": { + "adm-zip": "^0.5.9", + "tslib": "^2.4.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -2248,6 +2578,17 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "header-generator": { + "version": "2.1.63", + "resolved": "https://registry.npmjs.org/header-generator/-/header-generator-2.1.63.tgz", + "integrity": "sha512-dicAWZb/zXmI3fPuCw1Ra1sTTC9x9cc5EOhwugmI/keXnRc3BzxDQTGHge+MeAdqhpo2ZOFTEV6u08lXJUA2uQ==", + "requires": { + "browserslist": "^4.21.1", + "generative-bayesian-network": "^2.1.63", + "ow": "^0.28.1", + "tslib": "^2.4.0" + } + }, "ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", @@ -2309,6 +2650,11 @@ "is-extglob": "^2.1.1" } }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -2404,6 +2750,11 @@ "p-locate": "^5.0.0" } }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" + }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -2463,6 +2814,11 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==" + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -2495,6 +2851,18 @@ "@otplib/preset-v11": "^12.0.1" } }, + "ow": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz", + "integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==", + "requires": { + "@sindresorhus/is": "^4.2.0", + "callsites": "^3.1.0", + "dot-prop": "^6.0.1", + "lodash.isequal": "^4.5.0", + "vali-date": "^1.0.0" + } + }, "p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -2538,6 +2906,11 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, + "picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + }, "playwright-core": { "version": "1.45.0", "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.0.tgz", @@ -2691,6 +3064,11 @@ "resolved": "https://registry.npmjs.org/thirty-two/-/thirty-two-1.0.2.tgz", "integrity": "sha512-OEI0IWCe+Dw46019YLl6V10Us5bi574EvlJEOcAkB29IzQ/mYD1A6RyNHLjZPiHCmuodxvgF6U+vZO1L15lxVA==" }, + "tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -2705,6 +3083,15 @@ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" }, + "update-browserslist-db": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "requires": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + } + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -2714,6 +3101,11 @@ "punycode": "^2.1.0" } }, + "vali-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", + "integrity": "sha512-sgECfZthyaCKW10N0fm27cg8HYTFK5qMWgypqkXMQ4Wbl/zZKx7xZICgcoxIIE+WFAP/MBL2EFwC/YvLxw3Zeg==" + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index e1e3340..95027a2 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "cross-env": "^7.0.3", "dotenv": "^16.4.5", "enquirer": "^2.4.1", + "fingerprint-injector": "^2.1.52", "lowdb": "^7.0.1", "otplib": "^12.0.1", "playwright-firefox": "^1.45.0", From 0fefcc47b7271eff6997ff06aa58fcc90f39e682 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 15 Apr 2025 17:08:34 +0200 Subject: [PATCH 073/134] pg: skipBasedOnTime if days left > PG_TIMELEFT --- prime-gaming.js | 36 +++++++++++++++++++----------------- src/config.js | 2 +- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index adfdbd4..7ef528b 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -131,23 +131,25 @@ try { // bottom to top: oldest to newest games internal.reverse(); external.reverse(); - const checkTimeLeft = async url => { - // console.log(' Checking time left for game:', url); - const check = async p => { - console.log(' ', await p.locator('.availability-date').innerText()); - const dueDateOrg = await p.locator('.availability-date .tw-bold').innerText(); - const dueDate = datetime(new Date(Date.parse(dueDateOrg + ' 17:00'))); - console.log(' Due date:', dueDate); - }; - if (page.url() == url) { - await check(page); - } else { - const p = await context.newPage(); + const sameOrNewPage = async url => new Promise(async (resolve, _reject) => { + const isNew = page.url() != url; + let p = page; + if (isNew) { + p = await context.newPage(); await p.goto(url, { waitUntil: 'domcontentloaded' }); - await check(p); - p.close(); } - }; + resolve([p, isNew]); + }); + const skipBasedOnTime = async url => { + // console.log(' Checking time left for game:', url); + const [p, isNew] = await sameOrNewPage(url); + const dueDateOrg = await p.locator('.availability-date .tw-bold').innerText(); + const dueDate = new Date(Date.parse(dueDateOrg + ' 17:00')); + const daysLeft = (dueDate.getTime() - Date.now())/1000/60/60/24; + console.log(' ', await p.locator('.availability-date').innerText(), '->', daysLeft.toFixed(2)); + if (isNew) await p.close(); + return daysLeft > cfg.pg_timeLeft; + } console.log('Number of free unclaimed games (Prime Gaming):', internal.length); // claim games in internal store for (const card of internal) { @@ -156,7 +158,7 @@ try { const slug = await (await card.$('a')).getAttribute('href'); const url = 'https://gaming.amazon.com' + slug.split('?')[0]; console.log('Current free game:', title); - if (cfg.pg_timeLeft) await checkTimeLeft(url); + if (cfg.pg_timeLeft && await skipBasedOnTime(url)) continue; if (cfg.dryrun) continue; if (cfg.interactive && !await confirm()) continue; await (await card.$('.tw-button:has-text("Claim")')).click(); @@ -184,7 +186,7 @@ try { const item_text = await page.innerText('[data-a-target="DescriptionItemDetails"]'); const store = item_text.toLowerCase().replace(/.* on /, '').slice(0, -1); console.log(' External store:', store); - if (cfg.pg_timeLeft) await checkTimeLeft(url); + if (cfg.pg_timeLeft && await skipBasedOnTime(url)) continue; if (cfg.dryrun) continue; if (cfg.interactive && !await confirm()) continue; await Promise.any([page.click('[data-a-target="buy-box"] .tw-button:has-text("Get game")'), page.click('[data-a-target="buy-box"] .tw-button:has-text("Claim")'), page.click('.tw-button:has-text("Complete Claim")'), page.waitForSelector('div:has-text("Link game account")'), page.waitForSelector('.thank-you-title:has-text("Success")')]); // waits for navigation diff --git a/src/config.js b/src/config.js index 4a384b8..a8b1817 100644 --- a/src/config.js +++ b/src/config.js @@ -49,5 +49,5 @@ export const cfg = { pg_redeem: process.env.PG_REDEEM == '1', // prime-gaming: redeem keys on external stores lg_email: process.env.LG_EMAIL || process.env.PG_EMAIL || process.env.EMAIL, // prime-gaming: external: legacy-games: email to use for redeeming pg_claimdlc: process.env.PG_CLAIMDLC == '1', // prime-gaming: claim in-game content - pg_timeLeft: process.env.PG_TIMELEFT == '1', // prime-gaming: list time left to claim + pg_timeLeft: Number(process.env.PG_TIMELEFT), // prime-gaming: check time left to claim and skip game if there are more than PG_TIMELEFT days left to claim it }; From 04d1b7ea9e95af8f3e569397c53bb9ff591ddb4a Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 15 Apr 2025 17:22:21 +0200 Subject: [PATCH 074/134] pg: fix auto-login; rememberMe was removed --- prime-gaming.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prime-gaming.js b/prime-gaming.js index 7ef528b..3077717 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -55,7 +55,7 @@ try { await page.fill('[name=email]', email); await page.click('input[type="submit"]'); await page.fill('[name=password]', password); - await page.check('[name=rememberMe]'); + // await page.check('[name=rememberMe]'); // no longer exists await page.click('input[type="submit"]'); page.waitForURL('**/ap/signin**').then(async () => { // check for wrong credentials const error = await page.locator('.a-alert-content').first().innerText(); From 726db4527be872e01ffa9b0a66df02c188fa3cd4 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 15 Apr 2025 17:26:27 +0200 Subject: [PATCH 075/134] Current free game title in blue --- epic-games.js | 3 ++- gog.js | 3 ++- prime-gaming.js | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/epic-games.js b/epic-games.js index f03350f..4db1e75 100644 --- a/epic-games.js +++ b/epic-games.js @@ -1,5 +1,6 @@ import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdated playwright-extra import { authenticator } from 'otplib'; +import chalk from 'chalk'; import path from 'path'; import { existsSync, writeFileSync, appendFileSync } from 'fs'; import { resolve, jsonDb, datetime, stealth, filenamify, prompt, notify, html_game_list, handleSIGINT } from './src/util.js'; @@ -192,7 +193,7 @@ try { const game_id = page.url().split('/').pop(); const existedInDb = db.data[user][game_id]; db.data[user][game_id] ||= { title, time: datetime(), url: page.url() }; // this will be set on the initial run only! - console.log('Current free game:', title); + console.log('Current free game:', chalk.blue(title)); if (bundle_includes) console.log(' This bundle includes:', bundle_includes); const notify_game = { title, url, status: 'failed' }; notify_games.push(notify_game); // status is updated below diff --git a/gog.js b/gog.js index c4d5078..6269fc2 100644 --- a/gog.js +++ b/gog.js @@ -1,4 +1,5 @@ import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdated playwright-extra +import chalk from 'chalk'; import { resolve, jsonDb, datetime, filenamify, prompt, notify, html_game_list, handleSIGINT } from './src/util.js'; import { cfg } from './src/config.js'; @@ -102,7 +103,7 @@ try { const match_all = text.match(/Claim (.*) and don't miss the|Success! (.*) was added to/); const title = match_all[1] ? match_all[1] : match_all[2]; const url = await banner.locator('a').first().getAttribute('href'); - console.log(`Current free game: ${title} - ${url}`); + console.log(`Current free game: ${chalk.blue(title)} - ${url}`); db.data[user][title] ||= { title, time: datetime(), url }; if (cfg.dryrun) process.exit(1); // await page.locator('#giveaway:not(.is-loading)').waitFor(); // otherwise screenshot is sometimes with loading indicator instead of game title; #TODO fix, skipped due to timeout, see #240 diff --git a/prime-gaming.js b/prime-gaming.js index 3077717..a425ebe 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -150,14 +150,14 @@ try { if (isNew) await p.close(); return daysLeft > cfg.pg_timeLeft; } - console.log('Number of free unclaimed games (Prime Gaming):', internal.length); + console.log('\nNumber of free unclaimed games (Prime Gaming):', internal.length); // claim games in internal store for (const card of internal) { await card.scrollIntoViewIfNeeded(); const title = await (await card.$('.item-card-details__body__primary')).innerText(); const slug = await (await card.$('a')).getAttribute('href'); const url = 'https://gaming.amazon.com' + slug.split('?')[0]; - console.log('Current free game:', title); + console.log('Current free game:', chalk.blue(title)); if (cfg.pg_timeLeft && await skipBasedOnTime(url)) continue; if (cfg.dryrun) continue; if (cfg.interactive && !await confirm()) continue; @@ -168,7 +168,7 @@ try { // console.log('Image:', img); await card.screenshot({ path: screenshot('internal', `${filenamify(title)}.png`) }); } - console.log('Number of free unclaimed games (external stores):', external.length); + console.log('\nNumber of free unclaimed games (external stores):', external.length); // claim games in external/linked stores. Linked: origin.com, epicgames.com; Redeem-key: gog.com, legacygames.com, microsoft const external_info = []; for (const card of external) { // need to get data incl. URLs in this loop and then navigate in another, otherwise .all() would update after coming back and .elementHandles() like above would lead to error due to page navigation: elementHandle.$: Protocol error (Page.adoptNode) @@ -180,7 +180,7 @@ try { } // external_info = [ { title: 'Fallout 76 (XBOX)', url: 'https://gaming.amazon.com/fallout-76-xbox-fgwp/dp/amzn1.pg.item.9fe17d7b-b6c2-4f58-b494-cc4e79528d0b?ingress=amzn&ref_=SM_Fallout76XBOX_S01_FGWP_CRWN' } ]; for (const { title, url } of external_info) { - console.log('Current free game:', title); // , url); + console.log('Current free game:', chalk.blue(title)); // , url); await page.goto(url, { waitUntil: 'domcontentloaded' }); if (cfg.debug) await page.pause(); const item_text = await page.innerText('[data-a-target="DescriptionItemDetails"]'); From dee47d22184614a2856c354a65cc5cfc694e9d46 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 15 Apr 2025 17:27:21 +0200 Subject: [PATCH 076/134] pg: redeem gog: detect captcha --- prime-gaming.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/prime-gaming.js b/prime-gaming.js index a425ebe..dada15f 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -258,10 +258,14 @@ try { const r2 = page2.waitForResponse(r => r.request().method() == 'POST' && r.url().startsWith('https://redeem.gog.com/')); await page2.click('[type="submit"]'); // click Redeem const r2t = await (await r2).text(); + const reason2 = JSON.parse(r2t).reason; if (r2t == '{}') { redeem_action = 'redeemed'; console.log(' Redeemed successfully.'); db.data[user][title].status = 'claimed and redeemed'; + } else if (reason2?.includes('captcha')) { + redeem_action = 'redeem (got captcha)'; + console.error(' Got captcha; could not redeem!'); } else { console.debug(` Response 2: ${r2t}`); console.log(' Unknown Response 2 - please report in https://github.com/vogler/free-games-claimer/issues/5'); @@ -271,7 +275,7 @@ try { console.error(` Redeem on ${store} is experimental!`); // await page2.pause(); if (page2.url().startsWith('https://login.')) { - console.error(' Not logged in! Use the browser to login manually. Waiting for 60s.'); + console.error(' Not logged in! Please redeem the code above manually. You can now login in the browser for next time. Waiting for 60s.'); await page2.waitForTimeout(60 * 1000); redeem_action = 'redeem (login)'; } else { @@ -308,6 +312,7 @@ try { } } } else if (store == 'legacy games') { + // await page2.pause(); await page2.fill('[name=coupon_code]', code); await page2.fill('[name=email]', cfg.lg_email); await page2.fill('[name=email_validate]', cfg.lg_email); From 3e13e9fba858aeb5e5eff6144e0a6ddc28350c10 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 20:29:21 +0000 Subject: [PATCH 077/134] chore(deps): update super-linter/super-linter action to v7.4.0 --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0ed6b5b..02ca3cb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,7 +27,7 @@ jobs: fetch-depth: 0 - name: Super-linter - uses: super-linter/super-linter/slim@v7.3.0 # x-release-please-version + uses: super-linter/super-linter/slim@v7.4.0 # x-release-please-version # TODO need to create problem matchers for each linter? https://github.com/rhysd/actionlint/blob/v1.7.7/docs/usage.md#problem-matchers env: # To report GitHub Actions status checks From 5cfe57870a21382a6ce3607934f21f1368115016 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Tue, 13 May 2025 23:43:29 +0200 Subject: [PATCH 078/134] note on git describe for version --- src/version.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/version.js b/src/version.js index 7f875cf..bfcd12a 100644 --- a/src/version.js +++ b/src/version.js @@ -42,6 +42,11 @@ const gh = await (await fetch('https://api.github.com/repos/vogler/free-games-cl log('Local commit:', sha, new Date(date)); log('Online commit:', gh.sha, new Date(gh.commit.committer.date)); +// git describe --all --long --dirty +// --> heads/main-0-gdee47d2-dirty +// git describe --tags --long --dirty +// --> v1.7-35-gdee47d2-dirty + if (sha == gh.sha) { log('Running the latest version!'); } else { From 97ef14f5146ff27686a9c9c430aa82629e22c479 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 14 May 2025 00:18:22 +0200 Subject: [PATCH 079/134] uncommited steam-games.js from 2024-09-24 - WIP just saves all games and their stats --- steam-games.js | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 steam-games.js diff --git a/steam-games.js b/steam-games.js new file mode 100644 index 0000000..9b307fc --- /dev/null +++ b/steam-games.js @@ -0,0 +1,73 @@ +import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdated playwright-extra +import { jsonDb, prompt } from './src/util.js'; +import { cfg } from './src/config.js'; + +const db = await jsonDb('steam-games.json', {}); + +const user = cfg.steam_id || await prompt({ message: 'Enter Steam community id ("View my profile", then copy from URL)' }); + +// using https://github.com/apify/fingerprint-suite worked, but has no launchPersistentContext... +// from https://github.com/apify/fingerprint-suite/issues/162 +import { FingerprintInjector } from 'fingerprint-injector'; +import { FingerprintGenerator } from 'fingerprint-generator'; + +const { fingerprint, headers } = new FingerprintGenerator().getFingerprint({ + devices: ["desktop"], + operatingSystems: ["windows"], +}); + +const context = await firefox.launchPersistentContext(cfg.dir.browser, { + headless: cfg.headless, + // viewport: { width: cfg.width, height: cfg.height }, + locale: 'en-US', // ignore OS locale to be sure to have english text for locators -> done via /en in URL + userAgent: fingerprint.navigator.userAgent, + viewport: { + width: fingerprint.screen.width, + height: fingerprint.screen.height, + }, + extraHTTPHeaders: { + 'accept-language': headers['accept-language'], + }, +}); +// await stealth(context); +await new FingerprintInjector().attachFingerprintToPlaywright(context, { fingerprint, headers }); + +context.setDefaultTimeout(cfg.debug ? 0 : cfg.timeout); + +const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist + +try { + await page.goto(`https://steamcommunity.com/id/${user}/games?tab=all`); + const games = page.locator('div[data-featuretarget="gameslist-root"] > div.Panel > div.Panel > div'); + await games.last().waitFor(); + await page.keyboard.press('End'); + await page.waitForLoadState('networkidle'); + console.log('All Games:', await games.count()); + for (const game of await games.all()) { + const title = await game.locator('span a').innerText(); + let time, last, achievements, size; + const ltime = game.locator('span:has-text("total played")'); + if (await ltime.count()) time = (await ltime.first().innerText()).split('\n')[1]; + const llast = game.locator('span:has-text("last played")'); + if (await llast.count()) last = (await llast.first().innerText()).split('\n')[1]; + const lachievements = game.locator('a:has-text("achievements") + span'); + if (await lachievements.count()) achievements = (await lachievements.first().innerText()).split('\n'); + const lsize = game.locator('span:has(+ button)'); + if (await lsize.count()) size = await lsize.first().innerText(); + const url = await game.locator('a').first().getAttribute('href'); + const img = await game.locator('img').first().getAttribute('src'); + const stat = { title, time, last, achievements, size, url, img }; + console.log(stat); + db.data[title] = stat; + } + + // await page.pause(); +} catch (error) { + process.exitCode ||= 1; + console.error('--- Exception:'); + console.error(error); // .toString()? +} finally { + await db.write(); // write out json db +} +if (page.video()) console.log('Recorded video:', await page.video().path()); +await context.close(); From 6aea18836dd47683bba7e6ca54ebc09c1397f5b6 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 14 May 2025 00:30:39 +0200 Subject: [PATCH 080/134] enquirer: esc is fine, but after first prompt SIGINT will be ignore; onRawSIGINT keeps process running -> switch to inquirer --- test/sigint-enquirer-raw-keeps-running.js | 21 +++++++++++++++++++++ test/sigint-enquirer-raw.js | 17 +++++++++-------- test/sigint-enquirer-simple.js | 5 +++++ 3 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 test/sigint-enquirer-raw-keeps-running.js diff --git a/test/sigint-enquirer-raw-keeps-running.js b/test/sigint-enquirer-raw-keeps-running.js new file mode 100644 index 0000000..23d9983 --- /dev/null +++ b/test/sigint-enquirer-raw-keeps-running.js @@ -0,0 +1,21 @@ +// open issue: prevents handleSIGINT() to work if prompt is cancelled with Ctrl-C instead of Escape: https://github.com/enquirer/enquirer/issues/372 +function onRawSIGINT(fn) { + const { stdin, stdout } = process; + stdin.setRawMode(true); + stdin.resume(); + stdin.on('data', data => { + const key = data.toString('utf-8'); + if (key === '\u0003') { // ctrl + c + fn(); + } else { + stdout.write(key); + } + }); +} +console.log(1) +onRawSIGINT(() => { + console.log('raw'); process.exit(1); +}); +console.log(2) + +// onRawSIGINT workaround for enquirer keeps the process from exiting here... diff --git a/test/sigint-enquirer-raw.js b/test/sigint-enquirer-raw.js index 0a95892..e6b538d 100644 --- a/test/sigint-enquirer-raw.js +++ b/test/sigint-enquirer-raw.js @@ -1,10 +1,10 @@ // https://github.com/enquirer/enquirer/issues/372 -import { prompt } from '../src/util.js'; +import { prompt, handleSIGINT } from '../src/util.js'; -const handleSIGINT = () => process.on('SIGINT', () => { // e.g. when killed by Ctrl-C - console.log('\nInterrupted by SIGINT. Exit!'); - process.exitCode = 130; -}); +// const handleSIGINT = () => process.on('SIGINT', () => { // e.g. when killed by Ctrl-C +// console.log('\nInterrupted by SIGINT. Exit!'); +// process.exitCode = 130; +// }); handleSIGINT(); function onRawSIGINT(fn) { @@ -20,15 +20,16 @@ function onRawSIGINT(fn) { } }); } -onRawSIGINT(() => { - console.log('raw'); process.exit(1); -}); +// onRawSIGINT(() => { +// console.log('raw'); process.exit(1); +// }); console.log('hello'); console.error('hello error'); try { let i = 'foo'; i = await prompt(); // SIGINT no longer handled if this is executed + i = await prompt(); // SIGINT no longer handled if this is executed // handleSIGINT(); console.log('value:', i); setTimeout(() => console.log('timeout 3s'), 3000); diff --git a/test/sigint-enquirer-simple.js b/test/sigint-enquirer-simple.js index 13e7d02..25f13ee 100644 --- a/test/sigint-enquirer-simple.js +++ b/test/sigint-enquirer-simple.js @@ -13,3 +13,8 @@ await enquirer.prompt({ name: 'username', message: 'What is your username?', }); +await enquirer.prompt({ + type: 'input', + name: 'username', + message: 'What is your username 2?', +}); From a5ce5ec81615cb4d344a31553a2b23028e9ac451 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 14 May 2025 00:46:37 +0200 Subject: [PATCH 081/134] fix CodeQL alerts 5-7 https://github.com/vogler/free-games-claimer/security/code-scanning/5 https://github.com/vogler/free-games-claimer/security/code-scanning/6 https://github.com/vogler/free-games-claimer/security/code-scanning/7 --- .github/workflows/docker.yml | 3 +++ .github/workflows/sonar.yml | 7 ++++++- aliexpress.js | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6371f4c..722206a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,6 +17,9 @@ on: branches: - "main" # only PRs against main +permissions: + contents: read + jobs: docker: runs-on: ubuntu-latest diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index eb4ad62..29f81c6 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -1,3 +1,5 @@ +name: Sonar + on: # Trigger analysis when pushing in main or pull requests, and when creating a pull request. push: @@ -5,7 +7,10 @@ on: - main pull_request: types: [opened, synchronize, reopened] -name: Sonar + +permissions: + contents: read + jobs: sonarcloud: runs-on: ubuntu-latest diff --git a/aliexpress.js b/aliexpress.js index e2439a4..52e75a0 100644 --- a/aliexpress.js +++ b/aliexpress.js @@ -40,7 +40,7 @@ const auth = async (url) => { console.log('auth', url); await page.goto(url, { waitUntil: 'domcontentloaded' }); // redirects to https://login.aliexpress.com/?return_url=https%3A%2F%2Fwww.aliexpress.com%2Fp%2Fcoin-pc-index%2Findex.html - await Promise.any([page.waitForURL(/.*login.aliexpress.com.*/).then(async () => { + await Promise.any([page.waitForURL(/.*login\.aliexpress.com.*/).then(async () => { // manual login console.error('Not logged in! Will wait for 120s for you to login...'); // await page.waitForTimeout(120*1000); From 7c8682ac91b2c2a193dad4190972d2d1d5ccc592 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 14 May 2025 01:31:04 +0200 Subject: [PATCH 082/134] build docker image for each branch/PR? --- .github/workflows/docker.yml | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 722206a..360e72a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,24 +2,20 @@ name: Build and push Docker image (amd64, arm64 to hub.docker.com and ghcr.io) on: workflow_dispatch: # allow manual trigger - # https://github.com/orgs/community/discussions/26276 - push: - branches: - - "main" - - "v*" - tags: - - "v*" - paths: # ignore changes to certain files + push: # build for each branch + # branches: ["main"] + paths: # ignore changes to .md files - '**' - '!*.md' # - '!.github/**' - pull_request: # runs when opened/reopned or when the head branch is updated, see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request - branches: - - "main" # only PRs against main + pull_request: # runs when opened/reopned or when the head branch is updated permissions: contents: read +env: + BRANCH: ${{ github.head_ref || github.ref_name }} # head_ref/base_ref are only set for PRs, for branches ref_name will be used + jobs: docker: runs-on: ubuntu-latest @@ -30,13 +26,11 @@ jobs: - name: Set environment variables run: | - BRANCH="${GITHUB_REF#refs/heads/}" - echo "BRANCH=$BRANCH" >> "$GITHUB_ENV" - echo "NOW=$(date -R)" >> "$GITHUB_ENV" # date -Iseconds; date +'%Y-%m-%dT%H:%M:%S' + echo "NOW=$(date -R)" >> $GITHUB_ENV # date -Iseconds; date +'%Y-%m-%dT%H:%M:%S' if [[ "$BRANCH" == "main" ]]; then - echo "IMAGE_TAG=latest" >> "$GITHUB_ENV" + echo "IMAGE_TAG=latest" >> $GITHUB_ENV else - echo "IMAGE_TAG=$BRANCH" >> "$GITHUB_ENV" + echo "IMAGE_TAG=$BRANCH" >> $GITHUB_ENV fi - name: Set up QEMU @@ -47,7 +41,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 - if: github.event_name != 'pull_request' # TODO if DOCKERHUB_* are set? + if: ${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -61,16 +55,15 @@ jobs: - name: Build and push uses: docker/build-push-action@v6 - # if: github.event_name != 'pull_request' # still want to build image + if: ${{ env.IMAGE_TAG != '' }} with: context: . - push: ${{ github.event_name != 'pull_request' }} # TODO push for forks? + push: ${{ secrets.DOCKERHUB_USERNAME != '' }} build-args: | COMMIT=${{ github.sha }} BRANCH=${{ env.BRANCH }} NOW=${{ env.NOW }} - platforms: linux/amd64,linux/arm64 # ,linux/arm/v7 - # TODO docker tag only if DOCKERHUB_* are set? + platforms: linux/amd64,linux/arm64 tags: | ${{ secrets.DOCKERHUB_USERNAME }}/free-games-claimer:${{env.IMAGE_TAG}} ghcr.io/${{ github.actor }}/free-games-claimer:${{env.IMAGE_TAG}} From 4ce0d44b793a2298374a4cb4ffc6014f56dee366 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 14 May 2025 01:44:14 +0200 Subject: [PATCH 083/134] can't check secrets in if expr... --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 360e72a..26ce96d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -41,7 +41,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 - if: ${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }} + # if: ${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }} # does not work: Unrecognized named-value: 'secrets' - https://www.cloudtruth.com/blog/skipping-jobs-in-github-actions-when-secrets-are-unavailable-securely-inject-configuration-secrets-into-github with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} From bf0c9032cc4fc5a27e5366c0770992cc01a79e4b Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Wed, 14 May 2025 01:59:37 +0200 Subject: [PATCH 084/134] need 'packages: write' permission for ghcr.io --- .github/workflows/docker.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 26ce96d..2c42006 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -12,6 +12,7 @@ on: permissions: contents: read + packages: write env: BRANCH: ${{ github.head_ref || github.ref_name }} # head_ref/base_ref are only set for PRs, for branches ref_name will be used From 0a4cac35717722b51b4d795f3a4fd8c3eaa2da16 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Thu, 15 May 2025 23:51:49 +0200 Subject: [PATCH 085/134] ncu -u --- package-lock.json | 1998 ++++++++++++++++++++++++++++++++++++++++----- package.json | 12 +- 2 files changed, 1814 insertions(+), 196 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd57aa8..9ab1fff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,19 +9,19 @@ "version": "1.4.0", "license": "AGPL-3.0-only", "dependencies": { - "chalk": "^5.3.0", + "chalk": "^5.4.1", "cross-env": "^7.0.3", - "dotenv": "^16.4.5", + "dotenv": "^16.5.0", "enquirer": "^2.4.1", - "fingerprint-injector": "^2.1.52", + "fingerprint-injector": "^2.1.66", "lowdb": "^7.0.1", "otplib": "^12.0.1", - "playwright-firefox": "^1.45.0", + "playwright-firefox": "^1.52.0", "puppeteer-extra-plugin-stealth": "^2.11.2" }, "devDependencies": { - "@stylistic/eslint-plugin-js": "^4.0.0", - "eslint": "^9.5.0" + "@stylistic/eslint-plugin-js": "^4.2.0", + "eslint": "^9.26.0" }, "engines": { "node": ">=17" @@ -61,10 +61,11 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", - "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz", + "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", @@ -74,11 +75,22 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@eslint/core": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", - "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", + "node_modules/@eslint/config-helpers": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.2.tgz", + "integrity": "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==", "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz", + "integrity": "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==", + "dev": true, + "license": "Apache-2.0", "dependencies": { "@types/json-schema": "^7.0.15" }, @@ -87,10 +99,11 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", - "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -110,10 +123,11 @@ } }, "node_modules/@eslint/js": { - "version": "9.21.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.21.0.tgz", - "integrity": "sha512-BqStZ3HX8Yz6LvsF5ByXYrtigrV5AXADWLAGc7PH/1SxOb7/FIYYMszZZWiUou/GB9P2lXWk2SV4d+Z8h0nknw==", + "version": "9.26.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.26.0.tgz", + "integrity": "sha512-I9XlJawFdSMvWjDt6wksMCrgns5ggLNfFwFvnShsleWruvXM514Qxk8V246efTw+eo9JABvVz+u3q2RiAowKxQ==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -123,17 +137,19 @@ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", - "integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz", + "integrity": "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.12.0", + "@eslint/core": "^0.13.0", "levn": "^0.4.1" }, "engines": { @@ -189,6 +205,28 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.11.3.tgz", + "integrity": "sha512-rmOWVRUbUJD7iSvJugjUbFZshTAuJ48MXoZ80Osx1GM0K/H1w7rSEvmw8m6vdWxNASgtaHIhAgre4H/E9GJiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "express": "^5.0.1", + "express-rate-limit": "^7.5.0", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.23.8", + "zod-to-json-schema": "^3.24.1" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@otplib/core": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/@otplib/core/-/core-12.0.1.tgz", @@ -272,9 +310,10 @@ } }, "node_modules/@types/debug": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.8.tgz", - "integrity": "sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "license": "MIT", "dependencies": { "@types/ms": "*" } @@ -293,9 +332,24 @@ "license": "MIT" }, "node_modules/@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } }, "node_modules/acorn": { "version": "8.14.1", @@ -387,6 +441,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -396,6 +451,27 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/body-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", + "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.0", + "http-errors": "^2.0.0", + "iconv-lite": "^0.6.3", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.0", + "type-is": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -406,9 +482,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", - "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "version": "4.24.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.5.tgz", + "integrity": "sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==", "funding": [ { "type": "opencollective", @@ -425,10 +501,10 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001688", - "electron-to-chromium": "^1.5.73", + "caniuse-lite": "^1.0.30001716", + "electron-to-chromium": "^1.5.149", "node-releases": "^2.0.19", - "update-browserslist-db": "^1.1.1" + "update-browserslist-db": "^1.1.3" }, "bin": { "browserslist": "cli.js" @@ -437,6 +513,47 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -447,9 +564,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001709", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001709.tgz", - "integrity": "sha512-NgL3vUTnDrPCZ3zTahp4fsugQ4dc7EKTSzwQDPEel6DMoMnfH2jhry9n2Zm8onbSR+f/QtKHFOA+iAQu4kbtWA==", + "version": "1.0.30001717", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001717.tgz", + "integrity": "sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw==", "funding": [ { "type": "opencollective", @@ -481,6 +598,7 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-0.2.4.tgz", "integrity": "sha512-we+NuQo2DHhSl+DP6jlUiAhyAjBQrYnpOk15rN6c6JSPScjiCLh8IbSU+VTcph6YS3o7mASE8a0+gbZ7ChLpgg==", + "license": "MIT", "dependencies": { "for-own": "^0.1.3", "is-plain-object": "^2.0.1", @@ -515,6 +633,63 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "node_modules/content-disposition": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", + "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/cross-env": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", @@ -546,11 +721,12 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -571,10 +747,21 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/dot-prop": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", @@ -591,9 +778,10 @@ } }, "node_modules/dotenv": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", - "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==", + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", + "integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==", + "license": "BSD-2-Clause", "engines": { "node": ">=12" }, @@ -601,12 +789,44 @@ "url": "https://dotenvx.com" } }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true, + "license": "MIT" + }, "node_modules/electron-to-chromium": { - "version": "1.5.130", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.130.tgz", - "integrity": "sha512-Ou2u7L9j2XLZbhqzyX0jWDj6gA8D3jIfVzt4rikLf3cGBa0VdReuFimBKS9tQJA4+XpeCxj1NoWlfBXzbMa9IA==", + "version": "1.5.150", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.150.tgz", + "integrity": "sha512-rOOkP2ZUMx1yL4fCxXQKDHQ8ZXwisb2OycOQVKHgvB3ZI4CvehOd4y2tfnnLDieJ3Zs1RL1Dlp3cMkyIn7nnXA==", "license": "ISC" }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/enquirer": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", @@ -619,6 +839,39 @@ "node": ">=8.6" } }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -628,6 +881,13 @@ "node": ">=6" } }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true, + "license": "MIT" + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -641,21 +901,24 @@ } }, "node_modules/eslint": { - "version": "9.21.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.21.0.tgz", - "integrity": "sha512-KjeihdFqTPhOMXTt7StsDxriV4n66ueuF/jfPNC3j/lduHwr/ijDwJMsF+wyMJethgiKi5wniIE243vi07d3pg==", + "version": "9.26.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.26.0.tgz", + "integrity": "sha512-Hx0MOjPh6uK9oq9nVsATZKE/Wlbai7KFjfCuw9UHaguDW3x+HF0O5nIi3ud39TWgrTjTO5nHxmL3R1eANinWHQ==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.19.2", - "@eslint/core": "^0.12.0", - "@eslint/eslintrc": "^3.3.0", - "@eslint/js": "9.21.0", - "@eslint/plugin-kit": "^0.2.7", + "@eslint/config-array": "^0.20.0", + "@eslint/config-helpers": "^0.2.1", + "@eslint/core": "^0.13.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.26.0", + "@eslint/plugin-kit": "^0.2.8", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", + "@modelcontextprotocol/sdk": "^1.8.0", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", @@ -663,7 +926,7 @@ "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.2.0", + "eslint-scope": "^8.3.0", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", "esquery": "^1.5.0", @@ -679,7 +942,8 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3" + "optionator": "^0.9.3", + "zod": "^3.24.2" }, "bin": { "eslint": "bin/eslint.js" @@ -700,10 +964,11 @@ } }, "node_modules/eslint-scope": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", - "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", + "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -841,6 +1106,98 @@ "node": ">=0.10.0" } }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.2.tgz", + "integrity": "sha512-6RxOBZ/cYgd8usLwsEl+EC09Au/9BcmCKYF2/xbml6DNczf7nv0MQb+7BA2F+li6//I+28VNlQR37XfQtcAJuA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/express": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", + "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.0", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-rate-limit": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.0.tgz", + "integrity": "sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": "^4.11 || 5 || ^5.0.0-beta.1" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -874,6 +1231,24 @@ "node": ">=16.0.0" } }, + "node_modules/finalhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", + "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -891,13 +1266,13 @@ } }, "node_modules/fingerprint-generator": { - "version": "2.1.63", - "resolved": "https://registry.npmjs.org/fingerprint-generator/-/fingerprint-generator-2.1.63.tgz", - "integrity": "sha512-9ud3dO2aD0wKc9/zEAletQZ/iPuGqTwmkA7Y33OeOv/N+OvTM6OStxXbNLCsGSD7jUYe4ei/TK9uXwiQntbZGA==", + "version": "2.1.66", + "resolved": "https://registry.npmjs.org/fingerprint-generator/-/fingerprint-generator-2.1.66.tgz", + "integrity": "sha512-2CvoY+OPcCOWkoIMQim80uNH+ED1+2rM9QXIcSih7ovBMLOmyr3Sp9IOtfccd05QlGDzulU2M9Oav8jOgTlCBA==", "license": "Apache-2.0", "dependencies": { - "generative-bayesian-network": "^2.1.63", - "header-generator": "^2.1.63", + "generative-bayesian-network": "^2.1.66", + "header-generator": "^2.1.66", "tslib": "^2.4.0" }, "engines": { @@ -905,12 +1280,12 @@ } }, "node_modules/fingerprint-injector": { - "version": "2.1.63", - "resolved": "https://registry.npmjs.org/fingerprint-injector/-/fingerprint-injector-2.1.63.tgz", - "integrity": "sha512-OZpxOKi4iyU2hzqXuJDddb5ayfLgWJvnaDwWAExC5/P+XuXbAMf9cLIOAEQ3B2SnAbXUXZw6k8vQqeg6vSrWIA==", + "version": "2.1.66", + "resolved": "https://registry.npmjs.org/fingerprint-injector/-/fingerprint-injector-2.1.66.tgz", + "integrity": "sha512-h5llsoG0xoDeEo2czjzvo1niEU0xgCMwhs5/jtAxiBf7IiP/wW1Is3DJMEB+4V4PwIvqNQqLlnD07X23D7tErA==", "license": "Apache-2.0", "dependencies": { - "fingerprint-generator": "^2.1.63", + "fingerprint-generator": "^2.1.66", "tslib": "^2.4.0" }, "engines": { @@ -954,6 +1329,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -962,6 +1338,7 @@ "version": "0.1.5", "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", "integrity": "sha512-SKmowqGTJoPzLO1T0BBJpkfp3EMacCMOuH40hOUbrbzElVktk4DioXVM99QkLCyKoiuOmyjgcWMpVz2xjE7LZw==", + "license": "MIT", "dependencies": { "for-in": "^1.0.1" }, @@ -969,10 +1346,31 @@ "node": ">=0.10.0" } }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -985,22 +1383,74 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/generative-bayesian-network": { - "version": "2.1.63", - "resolved": "https://registry.npmjs.org/generative-bayesian-network/-/generative-bayesian-network-2.1.63.tgz", - "integrity": "sha512-nH1t4R9nlWSmvFoI4DEcpXd0+yoGZcySVuUBkXhR09/Mf7O9AWFmR8lWqVGIoxpBS0WRNpV/qj4swKGGQAxAPQ==", + "version": "2.1.66", + "resolved": "https://registry.npmjs.org/generative-bayesian-network/-/generative-bayesian-network-2.1.66.tgz", + "integrity": "sha512-gbBsyaaEJj/LHp3473TQrMDdcKiRzI8Sn2CbcG/lwONZkp0n9/ChC1mjzcbZQtHHCuqjn+JouSSbzLeepUMbuw==", "license": "Apache-2.0", "dependencies": { "adm-zip": "^0.5.9", "tslib": "^2.4.0" } }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -1041,10 +1491,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" }, "node_modules/has-flag": { "version": "4.0.0", @@ -1055,14 +1519,40 @@ "node": ">=8" } }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/header-generator": { - "version": "2.1.63", - "resolved": "https://registry.npmjs.org/header-generator/-/header-generator-2.1.63.tgz", - "integrity": "sha512-dicAWZb/zXmI3fPuCw1Ra1sTTC9x9cc5EOhwugmI/keXnRc3BzxDQTGHge+MeAdqhpo2ZOFTEV6u08lXJUA2uQ==", + "version": "2.1.66", + "resolved": "https://registry.npmjs.org/header-generator/-/header-generator-2.1.66.tgz", + "integrity": "sha512-g0jd79o0CyzyK0Jega4pAG1eJhykhPNfBLpOnUINtX2YkToVvRSBZ+B2wtmIjqwKHXK8DNWxylKuXnZmLs1yMQ==", "license": "Apache-2.0", "dependencies": { "browserslist": "^4.21.1", - "generative-bayesian-network": "^2.1.63", + "generative-bayesian-network": "^2.1.66", "ow": "^0.28.1", "tslib": "^2.4.0" }, @@ -1070,10 +1560,40 @@ "node": ">=16.0.0" } }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "license": "MIT", "engines": { @@ -1081,9 +1601,9 @@ } }, "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1110,6 +1630,8 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -1118,17 +1640,30 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.10" + } }, "node_modules/is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "license": "MIT" }, "node_modules/is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1167,6 +1702,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "license": "MIT", "dependencies": { "isobject": "^3.0.1" }, @@ -1174,6 +1710,13 @@ "node": ">=0.10.0" } }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "dev": true, + "license": "MIT" + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -1183,6 +1726,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1224,6 +1768,7 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "license": "MIT", "dependencies": { "universalify": "^2.0.0" }, @@ -1245,6 +1790,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "license": "MIT", "dependencies": { "is-buffer": "^1.1.5" }, @@ -1256,6 +1802,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", "integrity": "sha512-RE2g0b5VGZsOCFOCgP7omTRYFqydmZkBwl5oNnQ1lDYC57uyO9KqNnNVxT7COSHTxrRCWVcAVOcbjk+tvh/rgQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1316,10 +1863,31 @@ "url": "https://github.com/sponsors/typicode" } }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/merge-deep": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.3.tgz", "integrity": "sha512-qtmzAS6t6grwEkNrunqTBdn0qKwFgNWvlxUbAV8es9M7Ot1EbyApytCnvE0jALPa46ZpKDUo527kKiaWplmlFA==", + "license": "MIT", "dependencies": { "arr-union": "^3.1.0", "clone-deep": "^0.2.4", @@ -1329,6 +1897,42 @@ "node": ">=0.10.0" } }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", + "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1344,6 +1948,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/mixin-object/-/mixin-object-2.0.1.tgz", "integrity": "sha512-ALGF1Jt9ouehcaXaHhn6t1yGWRqGaHkPFndtFVHfZXOvkIZ/yoGaSi0AHVTafb3ZBGg4dr/bDwnaEKqCXzchMA==", + "license": "MIT", "dependencies": { "for-in": "^0.1.3", "is-extendable": "^0.1.1" @@ -1356,14 +1961,16 @@ "version": "0.1.8", "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.8.tgz", "integrity": "sha512-F0to7vbBSHP8E3l6dCjxNOLuSFAACIxFy3UehTUlG7svlXi37HHsDkyVcHo0Pq8QwrE+pXvWSVX3ZT1T9wAZ9g==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" }, "node_modules/natural-compare": { "version": "1.4.0", @@ -1371,16 +1978,63 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/node-releases": { "version": "2.0.19", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", "license": "MIT" }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", "dependencies": { "wrappy": "1" } @@ -1474,6 +2128,16 @@ "node": ">=6" } }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -1487,6 +2151,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1499,16 +2164,36 @@ "node": ">=8" } }, + "node_modules/path-to-regexp": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "license": "ISC" }, + "node_modules/pkce-challenge": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.0.tgz", + "integrity": "sha512-ueGLflrrnvwB3xuo/uGob5pd5FN7l0MsLf0Z87o/UQmRtwjvfylfc9MurIxRAWywCYTgrvpXBcqjV4OfCYGCIQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16.20.0" + } + }, "node_modules/playwright-core": { - "version": "1.45.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.0.tgz", - "integrity": "sha512-lZmHlFQ0VYSpAs43dRq1/nJ9G/6SiTI7VPqidld9TDefL9tX87bTKExWZZUF5PeRyqtXqd8fQi2qmfIedkwsNQ==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.52.0.tgz", + "integrity": "sha512-l2osTgLXSMeuLZOML9qYODUQoPPnUsKsb5/P6LJ2e6uPKXUdPK5WYhN4z03G+YNbWmGDY4YENauNu4ZKczreHg==", "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" @@ -1518,13 +2203,13 @@ } }, "node_modules/playwright-firefox": { - "version": "1.45.0", - "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.45.0.tgz", - "integrity": "sha512-JmGESfFR8xTjAYQzECYO00yBbSSnu4dBImsrmJVeOXTvT+i9p1dpVUaxKz6lTFMI/xzYROqB4E4Km8NBiOgslw==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.52.0.tgz", + "integrity": "sha512-x4niD4HHffaYNmz0XwgXqvf7NUhCmAbcpa+DX16kAacd+6T8cwf+W/+Q0S+VLsYpQ2BJowR2HuJanO1Ge1Phzg==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.45.0" + "playwright-core": "1.52.0" }, "bin": { "playwright": "cli.js" @@ -1542,6 +2227,20 @@ "node": ">= 0.8.0" } }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -1556,6 +2255,7 @@ "version": "3.2.3", "resolved": "https://registry.npmjs.org/puppeteer-extra-plugin/-/puppeteer-extra-plugin-3.2.3.tgz", "integrity": "sha512-6RNy0e6pH8vaS3akPIKGg28xcryKscczt4wIl0ePciZENGE2yoaQJNd17UiEbdmh5/6WW6dPcfRWT9lxBwCi2Q==", + "license": "MIT", "dependencies": { "@types/debug": "^4.1.0", "debug": "^4.1.1", @@ -1581,6 +2281,7 @@ "version": "2.11.2", "resolved": "https://registry.npmjs.org/puppeteer-extra-plugin-stealth/-/puppeteer-extra-plugin-stealth-2.11.2.tgz", "integrity": "sha512-bUemM5XmTj9i2ZerBzsk2AN5is0wHMNE6K0hXBzBXOzP5m5G3Wl0RHhiqKeHToe/uIH8AoZiGhc1tCkLZQPKTQ==", + "license": "MIT", "dependencies": { "debug": "^4.1.1", "puppeteer-extra-plugin": "^3.2.3", @@ -1606,6 +2307,7 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/puppeteer-extra-plugin-user-data-dir/-/puppeteer-extra-plugin-user-data-dir-2.4.1.tgz", "integrity": "sha512-kH1GnCcqEDoBXO7epAse4TBPJh9tEpVEK/vkedKfjOVOhZAvLkHGc9swMs5ChrJbRnf8Hdpug6TJlEuimXNQ+g==", + "license": "MIT", "dependencies": { "debug": "^4.1.1", "fs-extra": "^10.0.0", @@ -1632,6 +2334,7 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/puppeteer-extra-plugin-user-preferences/-/puppeteer-extra-plugin-user-preferences-2.4.1.tgz", "integrity": "sha512-i1oAZxRbc1bk8MZufKCruCEC3CCafO9RKMkkodZltI4OqibLFXF3tj6HZ4LZ9C5vCXZjYcDWazgtY69mnmrQ9A==", + "license": "MIT", "dependencies": { "debug": "^4.1.1", "deepmerge": "^4.2.2", @@ -1654,6 +2357,48 @@ } } }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", + "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.6.3", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -1668,6 +2413,8 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -1678,10 +2425,102 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "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" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/send": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", + "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.5", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "mime-types": "^3.0.1", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/serve-static": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", + "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true, + "license": "ISC" + }, "node_modules/shallow-clone": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-0.1.2.tgz", "integrity": "sha512-J1zdXCky5GmNnuauESROVu31MQSnLoYvlyEn6j2Ztk6Q5EHFIhxkMhYcv6vuDzl2XEzoRr856QwzMgWM/TmZgw==", + "license": "MIT", "dependencies": { "is-extendable": "^0.1.1", "kind-of": "^2.0.1", @@ -1696,6 +2535,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-2.0.1.tgz", "integrity": "sha512-0u8i1NZ/mg0b+W3MGGw5I7+6Eib2nx72S/QvXa0hYjEkjTknYmEYQJwGu3mLC0BrhtJjtQafTkyRUQ75Kx0LVg==", + "license": "MIT", "dependencies": { "is-buffer": "^1.0.2" }, @@ -1707,6 +2547,7 @@ "version": "0.2.7", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", "integrity": "sha512-gkX52wvU/R8DVMMt78ATVPFMJqfW8FPz1GZ1sVHBVQHmu/WvhIWE4cE1GBzhJNFicDeYhnwp6Rl35BcAIM3YOQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1730,6 +2571,92 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/steno": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/steno/-/steno-4.0.2.tgz", @@ -1786,6 +2713,16 @@ "node": ">=0.2.6" } }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -1804,14 +2741,40 @@ "node": ">= 0.8.0" } }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "dev": true, + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "license": "MIT", "engines": { "node": ">= 10.0.0" } }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/update-browserslist-db": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", @@ -1861,6 +2824,16 @@ "node": ">=0.10.0" } }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -1878,7 +2851,8 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" }, "node_modules/yocto-queue": { "version": "0.1.0", @@ -1891,6 +2865,26 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zod": { + "version": "3.24.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.4.tgz", + "integrity": "sha512-OdqJE9UDRPwWsrHjLN2F8bPxvwJBK22EHLWtanu0LSYr5YqzsaaW3RMgmjwr8Rypg5k+meEJdSPXJZXE/yqOMg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-json-schema": { + "version": "3.24.5", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.5.tgz", + "integrity": "sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g==", + "dev": true, + "license": "ISC", + "peerDependencies": { + "zod": "^3.24.1" + } } }, "dependencies": { @@ -1916,9 +2910,9 @@ "dev": true }, "@eslint/config-array": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", - "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz", + "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==", "dev": true, "requires": { "@eslint/object-schema": "^2.1.6", @@ -1926,19 +2920,25 @@ "minimatch": "^3.1.2" } }, + "@eslint/config-helpers": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.2.tgz", + "integrity": "sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==", + "dev": true + }, "@eslint/core": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", - "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz", + "integrity": "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==", "dev": true, "requires": { "@types/json-schema": "^7.0.15" } }, "@eslint/eslintrc": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", - "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -1953,9 +2953,9 @@ } }, "@eslint/js": { - "version": "9.21.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.21.0.tgz", - "integrity": "sha512-BqStZ3HX8Yz6LvsF5ByXYrtigrV5AXADWLAGc7PH/1SxOb7/FIYYMszZZWiUou/GB9P2lXWk2SV4d+Z8h0nknw==", + "version": "9.26.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.26.0.tgz", + "integrity": "sha512-I9XlJawFdSMvWjDt6wksMCrgns5ggLNfFwFvnShsleWruvXM514Qxk8V246efTw+eo9JABvVz+u3q2RiAowKxQ==", "dev": true }, "@eslint/object-schema": { @@ -1965,12 +2965,12 @@ "dev": true }, "@eslint/plugin-kit": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", - "integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz", + "integrity": "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==", "dev": true, "requires": { - "@eslint/core": "^0.12.0", + "@eslint/core": "^0.13.0", "levn": "^0.4.1" } }, @@ -2002,6 +3002,24 @@ "integrity": "sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==", "dev": true }, + "@modelcontextprotocol/sdk": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.11.3.tgz", + "integrity": "sha512-rmOWVRUbUJD7iSvJugjUbFZshTAuJ48MXoZ80Osx1GM0K/H1w7rSEvmw8m6vdWxNASgtaHIhAgre4H/E9GJiYQ==", + "dev": true, + "requires": { + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "express": "^5.0.1", + "express-rate-limit": "^7.5.0", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.23.8", + "zod-to-json-schema": "^3.24.1" + } + }, "@otplib/core": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/@otplib/core/-/core-12.0.1.tgz", @@ -2068,9 +3086,9 @@ } }, "@types/debug": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.8.tgz", - "integrity": "sha512-/vPO1EPOs306Cvhwv7KfVfYvOJqA/S/AXjaHQiJboCZzcNDb+TIJFN9/2C9DZ//ijSKWioNyUxD792QmDJ+HKQ==", + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", "requires": { "@types/ms": "*" } @@ -2088,9 +3106,19 @@ "dev": true }, "@types/ms": { - "version": "0.7.31", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", - "integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==" + }, + "accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "dev": true, + "requires": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + } }, "acorn": { "version": "8.14.1", @@ -2157,6 +3185,23 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "body-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", + "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==", + "dev": true, + "requires": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.0", + "http-errors": "^2.0.0", + "iconv-lite": "^0.6.3", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.0", + "type-is": "^2.0.0" + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -2167,14 +3212,40 @@ } }, "browserslist": { - "version": "4.24.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", - "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "version": "4.24.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.5.tgz", + "integrity": "sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==", "requires": { - "caniuse-lite": "^1.0.30001688", - "electron-to-chromium": "^1.5.73", + "caniuse-lite": "^1.0.30001716", + "electron-to-chromium": "^1.5.149", "node-releases": "^2.0.19", - "update-browserslist-db": "^1.1.1" + "update-browserslist-db": "^1.1.3" + } + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true + }, + "call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" } }, "callsites": { @@ -2183,9 +3254,9 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "caniuse-lite": { - "version": "1.0.30001709", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001709.tgz", - "integrity": "sha512-NgL3vUTnDrPCZ3zTahp4fsugQ4dc7EKTSzwQDPEel6DMoMnfH2jhry9n2Zm8onbSR+f/QtKHFOA+iAQu4kbtWA==" + "version": "1.0.30001717", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001717.tgz", + "integrity": "sha512-auPpttCq6BDEG8ZAuHJIplGw6GODhjw+/11e7IjpnYCxZcW/ONgPs0KVBJ0d1bY3e2+7PRe5RCLyP+PfwVgkYw==" }, "chalk": { "version": "5.4.1", @@ -2224,6 +3295,43 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, + "content-disposition": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", + "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", + "dev": true, + "requires": { + "safe-buffer": "5.2.1" + } + }, + "content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true + }, + "cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "dev": true + }, + "cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "dev": true + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, "cross-env": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", @@ -2243,11 +3351,11 @@ } }, "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", "requires": { - "ms": "2.1.2" + "ms": "^2.1.3" } }, "deep-is": { @@ -2261,6 +3369,12 @@ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==" }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true + }, "dot-prop": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", @@ -2270,14 +3384,37 @@ } }, "dotenv": { - "version": "16.4.7", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz", - "integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==" + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.5.0.tgz", + "integrity": "sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==" + }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true }, "electron-to-chromium": { - "version": "1.5.130", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.130.tgz", - "integrity": "sha512-Ou2u7L9j2XLZbhqzyX0jWDj6gA8D3jIfVzt4rikLf3cGBa0VdReuFimBKS9tQJA4+XpeCxj1NoWlfBXzbMa9IA==" + "version": "1.5.150", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.150.tgz", + "integrity": "sha512-rOOkP2ZUMx1yL4fCxXQKDHQ8ZXwisb2OycOQVKHgvB3ZI4CvehOd4y2tfnnLDieJ3Zs1RL1Dlp3cMkyIn7nnXA==" + }, + "encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true }, "enquirer": { "version": "2.4.1", @@ -2288,11 +3425,38 @@ "strip-ansi": "^6.0.1" } }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, "escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==" }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true + }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -2300,21 +3464,23 @@ "dev": true }, "eslint": { - "version": "9.21.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.21.0.tgz", - "integrity": "sha512-KjeihdFqTPhOMXTt7StsDxriV4n66ueuF/jfPNC3j/lduHwr/ijDwJMsF+wyMJethgiKi5wniIE243vi07d3pg==", + "version": "9.26.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.26.0.tgz", + "integrity": "sha512-Hx0MOjPh6uK9oq9nVsATZKE/Wlbai7KFjfCuw9UHaguDW3x+HF0O5nIi3ud39TWgrTjTO5nHxmL3R1eANinWHQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.19.2", - "@eslint/core": "^0.12.0", - "@eslint/eslintrc": "^3.3.0", - "@eslint/js": "9.21.0", - "@eslint/plugin-kit": "^0.2.7", + "@eslint/config-array": "^0.20.0", + "@eslint/config-helpers": "^0.2.1", + "@eslint/core": "^0.13.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.26.0", + "@eslint/plugin-kit": "^0.2.8", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", + "@modelcontextprotocol/sdk": "^1.8.0", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", @@ -2322,7 +3488,7 @@ "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.2.0", + "eslint-scope": "^8.3.0", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", "esquery": "^1.5.0", @@ -2338,7 +3504,8 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3" + "optionator": "^0.9.3", + "zod": "^3.24.2" }, "dependencies": { "@humanwhocodes/retry": { @@ -2366,9 +3533,9 @@ } }, "eslint-scope": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", - "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", + "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", "dev": true, "requires": { "esrecurse": "^4.3.0", @@ -2430,6 +3597,69 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "dev": true + }, + "eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "dev": true, + "requires": { + "eventsource-parser": "^3.0.1" + } + }, + "eventsource-parser": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.2.tgz", + "integrity": "sha512-6RxOBZ/cYgd8usLwsEl+EC09Au/9BcmCKYF2/xbml6DNczf7nv0MQb+7BA2F+li6//I+28VNlQR37XfQtcAJuA==", + "dev": true + }, + "express": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", + "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", + "dev": true, + "requires": { + "accepts": "^2.0.0", + "body-parser": "^2.2.0", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + } + }, + "express-rate-limit": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.0.tgz", + "integrity": "sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==", + "dev": true, + "requires": {} + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2457,6 +3687,20 @@ "flat-cache": "^4.0.0" } }, + "finalhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", + "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", + "dev": true, + "requires": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + } + }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2468,21 +3712,21 @@ } }, "fingerprint-generator": { - "version": "2.1.63", - "resolved": "https://registry.npmjs.org/fingerprint-generator/-/fingerprint-generator-2.1.63.tgz", - "integrity": "sha512-9ud3dO2aD0wKc9/zEAletQZ/iPuGqTwmkA7Y33OeOv/N+OvTM6OStxXbNLCsGSD7jUYe4ei/TK9uXwiQntbZGA==", + "version": "2.1.66", + "resolved": "https://registry.npmjs.org/fingerprint-generator/-/fingerprint-generator-2.1.66.tgz", + "integrity": "sha512-2CvoY+OPcCOWkoIMQim80uNH+ED1+2rM9QXIcSih7ovBMLOmyr3Sp9IOtfccd05QlGDzulU2M9Oav8jOgTlCBA==", "requires": { - "generative-bayesian-network": "^2.1.63", - "header-generator": "^2.1.63", + "generative-bayesian-network": "^2.1.66", + "header-generator": "^2.1.66", "tslib": "^2.4.0" } }, "fingerprint-injector": { - "version": "2.1.63", - "resolved": "https://registry.npmjs.org/fingerprint-injector/-/fingerprint-injector-2.1.63.tgz", - "integrity": "sha512-OZpxOKi4iyU2hzqXuJDddb5ayfLgWJvnaDwWAExC5/P+XuXbAMf9cLIOAEQ3B2SnAbXUXZw6k8vQqeg6vSrWIA==", + "version": "2.1.66", + "resolved": "https://registry.npmjs.org/fingerprint-injector/-/fingerprint-injector-2.1.66.tgz", + "integrity": "sha512-h5llsoG0xoDeEo2czjzvo1niEU0xgCMwhs5/jtAxiBf7IiP/wW1Is3DJMEB+4V4PwIvqNQqLlnD07X23D7tErA==", "requires": { - "fingerprint-generator": "^2.1.63", + "fingerprint-generator": "^2.1.66", "tslib": "^2.4.0" } }, @@ -2515,6 +3759,18 @@ "for-in": "^1.0.1" } }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true + }, + "fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "dev": true + }, "fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -2530,15 +3786,49 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, "generative-bayesian-network": { - "version": "2.1.63", - "resolved": "https://registry.npmjs.org/generative-bayesian-network/-/generative-bayesian-network-2.1.63.tgz", - "integrity": "sha512-nH1t4R9nlWSmvFoI4DEcpXd0+yoGZcySVuUBkXhR09/Mf7O9AWFmR8lWqVGIoxpBS0WRNpV/qj4swKGGQAxAPQ==", + "version": "2.1.66", + "resolved": "https://registry.npmjs.org/generative-bayesian-network/-/generative-bayesian-network-2.1.66.tgz", + "integrity": "sha512-gbBsyaaEJj/LHp3473TQrMDdcKiRzI8Sn2CbcG/lwONZkp0n9/ChC1mjzcbZQtHHCuqjn+JouSSbzLeepUMbuw==", "requires": { "adm-zip": "^0.5.9", "tslib": "^2.4.0" } }, + "get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, + "get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "requires": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -2567,6 +3857,12 @@ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true + }, "graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2578,27 +3874,64 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, "header-generator": { - "version": "2.1.63", - "resolved": "https://registry.npmjs.org/header-generator/-/header-generator-2.1.63.tgz", - "integrity": "sha512-dicAWZb/zXmI3fPuCw1Ra1sTTC9x9cc5EOhwugmI/keXnRc3BzxDQTGHge+MeAdqhpo2ZOFTEV6u08lXJUA2uQ==", + "version": "2.1.66", + "resolved": "https://registry.npmjs.org/header-generator/-/header-generator-2.1.66.tgz", + "integrity": "sha512-g0jd79o0CyzyK0Jega4pAG1eJhykhPNfBLpOnUINtX2YkToVvRSBZ+B2wtmIjqwKHXK8DNWxylKuXnZmLs1yMQ==", "requires": { "browserslist": "^4.21.1", - "generative-bayesian-network": "^2.1.63", + "generative-bayesian-network": "^2.1.66", "ow": "^0.28.1", "tslib": "^2.4.0" } }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, "ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true }, "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -2625,6 +3958,12 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true + }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", @@ -2663,6 +4002,12 @@ "isobject": "^3.0.1" } }, + "is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -2769,6 +4114,18 @@ "steno": "^4.0.2" } }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true + }, + "media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "dev": true + }, "merge-deep": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/merge-deep/-/merge-deep-3.0.3.tgz", @@ -2779,6 +4136,27 @@ "kind-of": "^3.0.2" } }, + "merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "dev": true + }, + "mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "dev": true + }, + "mime-types": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", + "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", + "dev": true, + "requires": { + "mime-db": "^1.54.0" + } + }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -2804,9 +4182,9 @@ } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "natural-compare": { "version": "1.4.0", @@ -2814,11 +4192,38 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, + "negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "dev": true + }, "node-releases": { "version": "2.0.19", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==" }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true + }, + "object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true + }, + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -2890,6 +4295,12 @@ "callsites": "^3.0.0" } }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -2906,22 +4317,34 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, + "path-to-regexp": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "dev": true + }, "picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" }, + "pkce-challenge": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.0.tgz", + "integrity": "sha512-ueGLflrrnvwB3xuo/uGob5pd5FN7l0MsLf0Z87o/UQmRtwjvfylfc9MurIxRAWywCYTgrvpXBcqjV4OfCYGCIQ==", + "dev": true + }, "playwright-core": { - "version": "1.45.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.45.0.tgz", - "integrity": "sha512-lZmHlFQ0VYSpAs43dRq1/nJ9G/6SiTI7VPqidld9TDefL9tX87bTKExWZZUF5PeRyqtXqd8fQi2qmfIedkwsNQ==" + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.52.0.tgz", + "integrity": "sha512-l2osTgLXSMeuLZOML9qYODUQoPPnUsKsb5/P6LJ2e6uPKXUdPK5WYhN4z03G+YNbWmGDY4YENauNu4ZKczreHg==" }, "playwright-firefox": { - "version": "1.45.0", - "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.45.0.tgz", - "integrity": "sha512-JmGESfFR8xTjAYQzECYO00yBbSSnu4dBImsrmJVeOXTvT+i9p1dpVUaxKz6lTFMI/xzYROqB4E4Km8NBiOgslw==", + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/playwright-firefox/-/playwright-firefox-1.52.0.tgz", + "integrity": "sha512-x4niD4HHffaYNmz0XwgXqvf7NUhCmAbcpa+DX16kAacd+6T8cwf+W/+Q0S+VLsYpQ2BJowR2HuJanO1Ge1Phzg==", "requires": { - "playwright-core": "1.45.0" + "playwright-core": "1.52.0" } }, "prelude-ls": { @@ -2930,6 +4353,16 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, "punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -2978,6 +4411,33 @@ "puppeteer-extra-plugin-user-data-dir": "^2.4.1" } }, + "qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "dev": true, + "requires": { + "side-channel": "^1.1.0" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true + }, + "raw-body": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", + "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", + "dev": true, + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.6.3", + "unpipe": "1.0.0" + } + }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -2992,6 +4452,68 @@ "glob": "^7.1.3" } }, + "router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "dev": true, + "requires": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "send": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", + "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", + "dev": true, + "requires": { + "debug": "^4.3.5", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "mime-types": "^3.0.1", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.1" + } + }, + "serve-static": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", + "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", + "dev": true, + "requires": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + } + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, "shallow-clone": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-0.1.2.tgz", @@ -3031,6 +4553,60 @@ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, + "side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + } + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true + }, "steno": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/steno/-/steno-4.0.2.tgz", @@ -3064,6 +4640,12 @@ "resolved": "https://registry.npmjs.org/thirty-two/-/thirty-two-1.0.2.tgz", "integrity": "sha512-OEI0IWCe+Dw46019YLl6V10Us5bi574EvlJEOcAkB29IzQ/mYD1A6RyNHLjZPiHCmuodxvgF6U+vZO1L15lxVA==" }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true + }, "tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -3078,10 +4660,27 @@ "prelude-ls": "^1.2.1" } }, + "type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "dev": true, + "requires": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + } + }, "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true }, "update-browserslist-db": { "version": "1.1.3", @@ -3106,6 +4705,12 @@ "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", "integrity": "sha512-sgECfZthyaCKW10N0fm27cg8HYTFK5qMWgypqkXMQ4Wbl/zZKx7xZICgcoxIIE+WFAP/MBL2EFwC/YvLxw3Zeg==" }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -3124,6 +4729,19 @@ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true + }, + "zod": { + "version": "3.24.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.4.tgz", + "integrity": "sha512-OdqJE9UDRPwWsrHjLN2F8bPxvwJBK22EHLWtanu0LSYr5YqzsaaW3RMgmjwr8Rypg5k+meEJdSPXJZXE/yqOMg==", + "dev": true + }, + "zod-to-json-schema": { + "version": "3.24.5", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.5.tgz", + "integrity": "sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g==", + "dev": true, + "requires": {} } } } diff --git a/package.json b/package.json index 95027a2..0487277 100644 --- a/package.json +++ b/package.json @@ -20,18 +20,18 @@ "node": ">=17" }, "dependencies": { - "chalk": "^5.3.0", + "chalk": "^5.4.1", "cross-env": "^7.0.3", - "dotenv": "^16.4.5", + "dotenv": "^16.5.0", "enquirer": "^2.4.1", - "fingerprint-injector": "^2.1.52", + "fingerprint-injector": "^2.1.66", "lowdb": "^7.0.1", "otplib": "^12.0.1", - "playwright-firefox": "^1.45.0", + "playwright-firefox": "^1.52.0", "puppeteer-extra-plugin-stealth": "^2.11.2" }, "devDependencies": { - "@stylistic/eslint-plugin-js": "^4.0.0", - "eslint": "^9.5.0" + "@stylistic/eslint-plugin-js": "^4.2.0", + "eslint": "^9.26.0" } } From 6adc7e529a63dddc74663e5b5903adabd651b5f5 Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Fri, 16 May 2025 00:05:48 +0200 Subject: [PATCH 086/134] disable Renovate for now --- renovate.json | 1 + 1 file changed, 1 insertion(+) diff --git a/renovate.json b/renovate.json index 5db72dd..ecfd5ff 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,6 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "enabled": false, "extends": [ "config:recommended" ] From cea5b11c955cc7fd49dcf9e6ddcf924b922a7e8f Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Fri, 16 May 2025 00:06:39 +0200 Subject: [PATCH 087/134] mv renovate.json .github/ --- renovate.json => .github/renovate.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename renovate.json => .github/renovate.json (100%) diff --git a/renovate.json b/.github/renovate.json similarity index 100% rename from renovate.json rename to .github/renovate.json From 991e0a1449ab7b931be467ee00c459b2679e1eca Mon Sep 17 00:00:00 2001 From: Ralf Vogler Date: Fri, 16 May 2025 00:14:10 +0200 Subject: [PATCH 088/134] docker: only build branches main, dev Otherwise branches will accumulate in 'Recent tagged image version' https://github.com/vogler/free-games-claimer/pkgs/container/free-games-claimer --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2c42006..8c12487 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,9 +1,9 @@ name: Build and push Docker image (amd64, arm64 to hub.docker.com and ghcr.io) on: - workflow_dispatch: # allow manual trigger - push: # build for each branch - # branches: ["main"] + workflow_dispatch: # allows manual trigger + push: # push on branch + branches: [main, dev] paths: # ignore changes to .md files - '**' - '!*.md' From faf22aafb1db5c51af6bbad32abc2be2ad1274a3 Mon Sep 17 00:00:00 2001 From: nocci Date: Mon, 29 Dec 2025 11:41:09 +0000 Subject: [PATCH 089/134] =?UTF-8?q?=F0=9F=90=9B=20fix(prime-gaming):=20upd?= =?UTF-8?q?ate=20URL=20and=20selectors=20for=20claims?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - change URL_CLAIM to point to new Luna claims home - update selectors for sign-in and user verification - improve handling of cookies acceptance ✨ feat(prime-gaming): enhance game claiming logic - add support for new layout and game list detection - implement flexible scrolling for loading all game cards - refine logic for internal and external game claims - improve store identification for external claims ♻️ refactor(prime-gaming): modularize game tab and list location - extract functions for opening games tab and locating games list - enhance code readability and maintainability 🐛 fix(prime-gaming): handle dynamic selectors for availability dates - support multiple selectors for availability date detection - improve error handling and logging for missing elements --- prime-gaming.js | 156 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 125 insertions(+), 31 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index dada15f..8e755b8 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -7,7 +7,7 @@ import { cfg } from './src/config.js'; const screenshot = (...a) => resolve(cfg.dir.screenshots, 'prime-gaming', ...a); // const URL_LOGIN = 'https://www.amazon.de/ap/signin'; // wrong. needs some session args to be valid? -const URL_CLAIM = 'https://gaming.amazon.com/home'; +const URL_CLAIM = 'https://luna.amazon.com/claims/home'; console.log(datetime(), 'started checking prime-gaming'); @@ -40,9 +40,14 @@ let user; try { await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); // default 'load' takes forever // need to wait for some elements to exist before checking if signed in or accepting cookies: - await Promise.any(['button:has-text("Sign in")', '[data-a-target="user-dropdown-first-name-text"]'].map(s => page.waitForSelector(s))); + await Promise.any([ + 'button:has-text("Sign in")', + 'button:has-text("Anmelden")', + '[data-a-target="user-dropdown-first-name-text"]', + '[data-testid="user-dropdown-first-name-text"]', + ].map(s => page.waitForSelector(s))); page.click('[aria-label="Cookies usage disclaimer banner"] button:has-text("Accept Cookies")').catch(_ => { }); // to not waste screen space when non-headless, TODO does not work reliably, need to wait for something else first? - while (await page.locator('button:has-text("Sign in")').count() > 0) { + while (await page.locator('button:has-text("Sign in"), button:has-text("Anmelden")').count() > 0) { console.error('Not signed in anymore.'); await page.click('button:has-text("Sign in")'); if (!cfg.debug) context.setDefaultTimeout(cfg.login_timeout); // give user some extra time to log in @@ -85,7 +90,7 @@ try { await page.waitForURL('https://gaming.amazon.com/home?signedIn=true'); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); } - user = await page.locator('[data-a-target="user-dropdown-first-name-text"]').first().innerText(); + user = await page.locator('[data-a-target="user-dropdown-first-name-text"], [data-testid="user-dropdown-first-name-text"]').first().innerText(); console.log(`Signed in as ${user}`); // await page.click('button[aria-label="User dropdown and more options"]'); // const twitch = await page.locator('[data-a-target="TwitchDisplayName"]').first().innerText(); @@ -119,15 +124,83 @@ try { await page.waitForTimeout(3000); }); - await page.click('button[data-type="Game"]'); - const games = page.locator('div[data-a-target="offer-list-FGWP_FULL"]'); - await games.waitFor(); - // await scrollUntilStable(() => games.locator('.item-card__action').count()); // number of games - await scrollUntilStable(() => page.evaluate(() => document.querySelector('.tw-full-width').scrollHeight)); // height may change during loading while number of games is still the same? - console.log('Number of already claimed games (total):', await games.locator('p:has-text("Collected")').count()); - // can't use .all() since the list of elements via locator will change after click while we iterate over it - const internal = await games.locator('.item-card__action:has(button[data-a-target="FGWPOffer"])').elementHandles(); - const external = await games.locator('.item-card__action:has(a[data-a-target="FGWPOffer"])').all(); + const openGamesTab = async () => { + const selectors = [ + 'button[data-type="Game"]', // old layout + 'button:has-text("Games")', + '[data-test-selector="category-picker"] button:has-text("Games")', + '[data-testid="category-picker"] button:has-text("Games")', + ]; + for (const sel of selectors) { + const btn = page.locator(sel).first(); + if (await btn.count()) { + await btn.click(); + return; + } + } + // New Luna claims home already shows games list + }; + + await openGamesTab(); + + const locateGamesList = async () => { + const selectors = [ + 'div[data-a-target="offer-list-FGWP_FULL"]', // old layout + '[data-testid="offer-list"]', + '[data-test-selector="offer-list"]', + 'section:has(h2:has-text("Games with Prime"))', + 'section:has(h2:has-text("Games"))', + ]; + for (const sel of selectors) { + const loc = page.locator(sel).first(); + if (await loc.count()) return loc; + } + return null; + }; + + const games = await locateGamesList(); + // Load all cards (old and new layout) by scrolling the container or the page + if (games) await scrollUntilStable(() => games.evaluate(el => el.scrollHeight).catch(() => 0)); + await scrollUntilStable(() => page.evaluate(() => document.scrollingElement?.scrollHeight ?? 0)); + + const cards = []; + const anchorClaims = page.locator('a[href*="/claims/"][href*="amzn1.pg.item"]'); + if (await anchorClaims.count()) { + const hrefs = [...new Set(await anchorClaims.evaluateAll(anchors => anchors.map(a => a.getAttribute('href')).filter(Boolean)))]; + for (const href of hrefs) { + let url = href; + if (url.startsWith('/')) url = 'https://luna.amazon.com' + url; + const title = url.split('/claims/')[1]?.split('/')[0] || (await anchorClaims.first().innerText()) || 'Unknown title'; + cards.push({ kind: 'external', title, url }); + } + } + + if (!cards.length && games) { + const cardLocator = games.locator([ + '[data-testid="offer-card"]', + '[data-test-selector="offer-card"]', + '.item-card__action', + ].join(',')); + if (await cardLocator.count() === 0) { + console.log('No games found in list.'); + } else { + for (const handle of await cardLocator.elementHandles()) { + const text = (await handle.textContent() || '').toLowerCase(); + if (text.includes('collected')) continue; // skip already claimed + const title = await (await handle.$('h3, h4, [data-testid="item-card-title"], [data-test-selector="item-card-title"], .item-card-details__body__primary'))?.innerText() || 'Unknown title'; + const linkEl = await handle.$('a[href]'); + let url = linkEl && await linkEl.getAttribute('href'); + if (url?.startsWith('/')) url = 'https://gaming.amazon.com' + url; + const hasLinkClaim = await handle.$('a:has-text("Claim"), a:has-text("Get"), a:has-text("Details")'); + const hasButtonClaim = await handle.$('button:has-text("Claim"), button:has-text("Get"), button:has-text("Get game"), button:has-text("Play")'); + if (hasLinkClaim) cards.push({ kind: 'external', title, url }); + else if (hasButtonClaim) cards.push({ kind: 'internal', title, url, handle }); + } + } + } + + const internal = cards.filter(c => c.kind == 'internal'); + const external = cards.filter(c => c.kind == 'external'); // bottom to top: oldest to newest games internal.reverse(); external.reverse(); @@ -143,39 +216,41 @@ try { const skipBasedOnTime = async url => { // console.log(' Checking time left for game:', url); const [p, isNew] = await sameOrNewPage(url); - const dueDateOrg = await p.locator('.availability-date .tw-bold').innerText(); + const dueDateLoc = p.locator('.availability-date .tw-bold, [data-testid="availability-end-date"], [data-test-selector="availability-end-date"]'); + if (!await dueDateLoc.count()) { + if (isNew) await p.close(); + return false; + } + const dueDateOrg = await dueDateLoc.first().innerText(); const dueDate = new Date(Date.parse(dueDateOrg + ' 17:00')); const daysLeft = (dueDate.getTime() - Date.now())/1000/60/60/24; - console.log(' ', await p.locator('.availability-date').innerText(), '->', daysLeft.toFixed(2)); + const availabilityText = await p.locator('.availability-date, [data-testid="availability-end-date"], [data-test-selector="availability-end-date"]').first().innerText().catch(() => dueDateOrg); + console.log(' ', availabilityText, '->', daysLeft.toFixed(2)); if (isNew) await p.close(); return daysLeft > cfg.pg_timeLeft; } console.log('\nNumber of free unclaimed games (Prime Gaming):', internal.length); // claim games in internal store for (const card of internal) { - await card.scrollIntoViewIfNeeded(); - const title = await (await card.$('.item-card-details__body__primary')).innerText(); - const slug = await (await card.$('a')).getAttribute('href'); - const url = 'https://gaming.amazon.com' + slug.split('?')[0]; + await card.handle.scrollIntoViewIfNeeded(); + const title = card.title; + const url = card.url; console.log('Current free game:', chalk.blue(title)); - if (cfg.pg_timeLeft && await skipBasedOnTime(url)) continue; + if (cfg.pg_timeLeft && url && await skipBasedOnTime(url)) continue; if (cfg.dryrun) continue; if (cfg.interactive && !await confirm()) continue; - await (await card.$('.tw-button:has-text("Claim")')).click(); + await card.handle.locator('.tw-button:has-text("Claim"), .tw-button:has-text("Get"), button:has-text("Claim"), button:has-text("Get")').first().click(); db.data[user][title] ||= { title, time: datetime(), url, store: 'internal' }; notify_games.push({ title, status: 'claimed', url }); - // const img = await (await card.$('img.tw-image')).getAttribute('src'); - // console.log('Image:', img); - await card.screenshot({ path: screenshot('internal', `${filenamify(title)}.png`) }); + await card.handle.screenshot({ path: screenshot('internal', `${filenamify(title)}.png`) }); } console.log('\nNumber of free unclaimed games (external stores):', external.length); // claim games in external/linked stores. Linked: origin.com, epicgames.com; Redeem-key: gog.com, legacygames.com, microsoft const external_info = []; for (const card of external) { // need to get data incl. URLs in this loop and then navigate in another, otherwise .all() would update after coming back and .elementHandles() like above would lead to error due to page navigation: elementHandle.$: Protocol error (Page.adoptNode) - const title = await card.locator('.item-card-details__body__primary').innerText(); - const slug = await card.locator('a:has-text("Claim")').first().getAttribute('href'); - const url = 'https://gaming.amazon.com' + slug.split('?')[0]; - // await (await card.$('text=Claim')).click(); // goes to URL of game, no need to wait + const title = card.title; + const url = card.url ? card.url.split('?')[0] : undefined; + if (!url) continue; external_info.push({ title, url }); } // external_info = [ { title: 'Fallout 76 (XBOX)', url: 'https://gaming.amazon.com/fallout-76-xbox-fgwp/dp/amzn1.pg.item.9fe17d7b-b6c2-4f58-b494-cc4e79528d0b?ingress=amzn&ref_=SM_Fallout76XBOX_S01_FGWP_CRWN' } ]; @@ -183,13 +258,32 @@ try { console.log('Current free game:', chalk.blue(title)); // , url); await page.goto(url, { waitUntil: 'domcontentloaded' }); if (cfg.debug) await page.pause(); - const item_text = await page.innerText('[data-a-target="DescriptionItemDetails"]'); - const store = item_text.toLowerCase().replace(/.* on /, '').slice(0, -1); + let store = 'unknown'; + const detailLoc = page.locator('[data-a-target="DescriptionItemDetails"], [data-testid="DescriptionItemDetails"]'); + if (await detailLoc.count()) { + const item_text = await detailLoc.first().innerText(); + store = item_text.toLowerCase().replace(/.* on /, '').slice(0, -1); + } else if (url.includes('/claims/')) { + const slug = url.split('/claims/')[1]?.split('/')[0] || ''; + if (slug.includes('gog')) store = 'gog.com'; + else if (slug.includes('epic')) store = 'epic-games'; + else if (slug.includes('origin')) store = 'origin'; + else if (slug.includes('xbox') || slug.includes('microsoft')) store = 'microsoft store'; + else if (slug.includes('legacy')) store = 'legacy games'; + } console.log(' External store:', store); if (cfg.pg_timeLeft && await skipBasedOnTime(url)) continue; if (cfg.dryrun) continue; if (cfg.interactive && !await confirm()) continue; - await Promise.any([page.click('[data-a-target="buy-box"] .tw-button:has-text("Get game")'), page.click('[data-a-target="buy-box"] .tw-button:has-text("Claim")'), page.click('.tw-button:has-text("Complete Claim")'), page.waitForSelector('div:has-text("Link game account")'), page.waitForSelector('.thank-you-title:has-text("Success")')]); // waits for navigation + await Promise.any([ + page.click('[data-a-target="buy-box"] .tw-button:has-text("Get game")'), + page.click('[data-a-target="buy-box"] .tw-button:has-text("Claim")'), + page.click('.tw-button:has-text("Complete Claim")'), + page.click('[data-a-target="buy-box_call-to-action-text"]'), + page.click('p[data-a-target="buy-box_call-to-action-text"]'), + page.waitForSelector('div:has-text("Link game account")'), + page.waitForSelector('.thank-you-title:has-text("Success")'), + ]); // waits for navigation db.data[user][title] ||= { title, time: datetime(), url, store }; const notify_game = { title, url }; notify_games.push(notify_game); // status is updated below From 76f578e2e6edd24d1ea374ab9736ec92c598a475 Mon Sep 17 00:00:00 2001 From: nocci Date: Mon, 29 Dec 2025 14:15:22 +0000 Subject: [PATCH 090/134] =?UTF-8?q?=E2=9C=A8=20feat(auth):=20enhance=20aut?= =?UTF-8?q?omatic=20login=20and=20MFA=20handling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add handleMFA function for improved two-step verification - implement direct login page handling with automatic sign-in 🐛 fix(claim): improve game claim process and duplicate prevention - normalize claim URLs and deduplicate by URL - fix various selectors for claim buttons and handle different languages - prevent duplicate game claims by checking existing records ♻️ refactor(utils): improve code readability and maintainability - extract normalizeClaimUrl function for URL handling - restructure logic for claim and notification processes 🌐 i18n(claim): add support for game claim text in German - handle German text for claim buttons and status checks --- prime-gaming.js | 230 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 199 insertions(+), 31 deletions(-) diff --git a/prime-gaming.js b/prime-gaming.js index 8e755b8..dc39bba 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -37,8 +37,53 @@ await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO wo const notify_games = []; let user; +const handleMFA = async p => { + const otpField = p.locator('#auth-mfa-otpcode, input[name=otpCode]'); + if (!await otpField.count()) return false; + console.log('Two-Step Verification - enter the One Time Password (OTP), e.g. generated by your Authenticator App'); + await p.locator('#auth-mfa-remember-device, [name=rememberDevice]').check().catch(_ => {}); + const otp = cfg.pg_otpkey && authenticator.generate(cfg.pg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them + await otpField.first().pressSequentially(otp.toString()); + await p.locator('input[type="submit"], button[type="submit"]').first().click(); + return true; +}; + try { await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); // default 'load' takes forever + const handleDirectLoginPage = async () => { + if (!page.url().includes('/ap/signin')) return false; + console.log('On Amazon login page (redirect). Trying to sign in automatically.'); + if (!cfg.debug) context.setDefaultTimeout(cfg.login_timeout); + const email = cfg.pg_email || await prompt({ message: 'Enter email' }); + const password = email && (cfg.pg_password || await prompt({ type: 'password', message: 'Enter password' })); + if (email && password) { + await page.fill('[name=email]', email); + await page.click('input[type="submit"]'); + await page.fill('[name=password]', password); + await page.click('input[type="submit"]'); + await handleMFA(page).catch(_ => {}); + page.waitForURL('**/ap/signin**').then(async () => { // check for wrong credentials + const error = await page.locator('.a-alert-content').first().innerText(); + if (!error.trim.length) return; + console.error('Login error:', error); + await notify(`prime-gaming: login: ${error}`); + await context.close(); // finishes potential recording + process.exit(1); + }); + await page.waitForURL(/luna\.amazon\.com\/claims\/.*signedIn=true/); + if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); + return true; + } else { + console.log('Waiting for manual login on redirect page.'); + if (cfg.headless) { + console.log('Run `SHOW=1 node prime-gaming` to login in the opened browser.'); + await context.close(); // finishes potential recording + process.exit(1); + } + return true; + } + }; + await handleDirectLoginPage(); // need to wait for some elements to exist before checking if signed in or accepting cookies: await Promise.any([ 'button:has-text("Sign in")', @@ -70,14 +115,7 @@ try { await context.close(); // finishes potential recording process.exit(1); }); - // handle MFA, but don't await it - page.waitForURL('**/ap/mfa**').then(async () => { - console.log('Two-Step Verification - enter the One Time Password (OTP), e.g. generated by your Authenticator App'); - await page.check('[name=rememberDevice]'); - const otp = cfg.pg_otpkey && authenticator.generate(cfg.pg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them - await page.locator('input[name=otpCode]').pressSequentially(otp.toString()); - await page.click('input[type="submit"]'); - }).catch(_ => { }); + handleMFA(page).catch(_ => {}); } else { console.log('Waiting for you to login in the browser.'); await notify('prime-gaming: no longer signed in and not enough options set for automatic login.'); @@ -128,6 +166,7 @@ try { const selectors = [ 'button[data-type="Game"]', // old layout 'button:has-text("Games")', + 'button:has-text("Games einlösen")', '[data-test-selector="category-picker"] button:has-text("Games")', '[data-testid="category-picker"] button:has-text("Games")', ]; @@ -138,6 +177,15 @@ try { return; } } + // New Luna claims home: try the filter/CTA button with embedded

+ const gamesTitle = page.locator('p.offer-filters__button__title:has-text("Games"), p.offer-filters__button__title:has-text("einlösen")'); + if (await gamesTitle.count()) { + const btn = gamesTitle.first().locator('xpath=ancestor::button[1]'); + if (await btn.count()) { + await btn.click(); + return; + } + } // New Luna claims home already shows games list }; @@ -163,15 +211,38 @@ try { if (games) await scrollUntilStable(() => games.evaluate(el => el.scrollHeight).catch(() => 0)); await scrollUntilStable(() => page.evaluate(() => document.scrollingElement?.scrollHeight ?? 0)); + const normalizeClaimUrl = url => { + if (!url) return { url, key: null }; + const m = url.match(/(https?:\/\/[^/]+)?(\/claims\/[^?#]+)/); + if (!m) return { url, key: url }; + const path = m[2]; + const slug = path.split('/')[2]; + return { url: 'https://luna.amazon.com' + path, key: slug || path }; + }; + const cards = []; + // New layout: direct claim buttons on cards (FGWPOffer) with "Spiel aktivieren"/"Claim" + const fgwps = page.locator('[data-a-target="FGWPOffer"]'); + if (await fgwps.count()) { + for (const handle of await fgwps.elementHandles()) { + const href = await handle.getAttribute('href'); + const { url, key } = normalizeClaimUrl(href?.startsWith('/') ? href : href || ''); + const title = + await handle.$eval('p[title], span[title]', el => el.getAttribute('title')).catch(() => null) || + await handle.$eval('p, span', el => el.textContent).catch(() => null) || + key || + 'Unknown title'; + cards.push({ kind: 'external', title, url, key }); + } + } + const anchorClaims = page.locator('a[href*="/claims/"][href*="amzn1.pg.item"]'); if (await anchorClaims.count()) { const hrefs = [...new Set(await anchorClaims.evaluateAll(anchors => anchors.map(a => a.getAttribute('href')).filter(Boolean)))]; for (const href of hrefs) { - let url = href; - if (url.startsWith('/')) url = 'https://luna.amazon.com' + url; - const title = url.split('/claims/')[1]?.split('/')[0] || (await anchorClaims.first().innerText()) || 'Unknown title'; - cards.push({ kind: 'external', title, url }); + const { url, key } = normalizeClaimUrl(href); + const title = key || (await anchorClaims.first().innerText()) || 'Unknown title'; + cards.push({ kind: 'external', title, url, key }); } } @@ -190,17 +261,28 @@ try { const title = await (await handle.$('h3, h4, [data-testid="item-card-title"], [data-test-selector="item-card-title"], .item-card-details__body__primary'))?.innerText() || 'Unknown title'; const linkEl = await handle.$('a[href]'); let url = linkEl && await linkEl.getAttribute('href'); - if (url?.startsWith('/')) url = 'https://gaming.amazon.com' + url; + if (url?.startsWith('/')) url = 'https://luna.amazon.com' + url; + const { url: normUrl, key } = normalizeClaimUrl(url); const hasLinkClaim = await handle.$('a:has-text("Claim"), a:has-text("Get"), a:has-text("Details")'); const hasButtonClaim = await handle.$('button:has-text("Claim"), button:has-text("Get"), button:has-text("Get game"), button:has-text("Play")'); - if (hasLinkClaim) cards.push({ kind: 'external', title, url }); - else if (hasButtonClaim) cards.push({ kind: 'internal', title, url, handle }); + const hasGermanCTA = await handle.$(':is(button,p,a):has-text("Spiel aktivieren"), :is(button,p,a):has-text("Spiel holen")'); + if (hasLinkClaim || hasGermanCTA) cards.push({ kind: 'external', title, url: normUrl, key }); + else if (hasButtonClaim) cards.push({ kind: 'internal', title, url: normUrl, key, handle }); } } } - const internal = cards.filter(c => c.kind == 'internal'); - const external = cards.filter(c => c.kind == 'external'); + // dedup by URL to avoid duplicates from multiple selectors + const seenUrl = new Set(); + const uniq = cards.filter(c => { + const key = c.key || c.url || c.title; + if (seenUrl.has(key)) return false; + seenUrl.add(key); + return true; + }); + + const internal = uniq.filter(c => c.kind == 'internal'); + const external = uniq.filter(c => c.kind == 'external'); // bottom to top: oldest to newest games internal.reverse(); external.reverse(); @@ -254,9 +336,46 @@ try { external_info.push({ title, url }); } // external_info = [ { title: 'Fallout 76 (XBOX)', url: 'https://gaming.amazon.com/fallout-76-xbox-fgwp/dp/amzn1.pg.item.9fe17d7b-b6c2-4f58-b494-cc4e79528d0b?ingress=amzn&ref_=SM_Fallout76XBOX_S01_FGWP_CRWN' } ]; + + const clickCTA = async p => { + const candidates = [ + p.locator('button[data-a-target="buy-box_call-to-action"]').first(), + p.locator('[data-a-target="buy-box_call-to-action"]').first(), + p.locator('[data-a-target="buy-box"] .tw-button:has-text("Get game")').first(), + p.locator('[data-a-target="buy-box"] .tw-button:has-text("Claim")').first(), + p.locator('.tw-button:has-text("Complete Claim")').first(), + p.locator('[data-a-target="buy-box_call-to-action-text"]').first().locator('xpath=ancestor::button[1]'), + p.locator('.tw-button:has-text("Spiel holen"), .tw-button:has-text("Spiel aktivieren")').first(), + p.locator('p:has-text("Spiel holen"), p:has-text("Spiel aktivieren")').first().locator('xpath=ancestor::button[1]'), + ]; + for (const c of candidates) { + if (await c.count()) { + try { + await c.waitFor({ state: 'visible', timeout: 5000 }); + if (!await c.isEnabled()) { + await c.evaluate(el => { el.disabled = false; el.removeAttribute('disabled'); el.click(); }); + } else { + await c.click(); + } + return true; + } catch (_) { + // try next candidate + } + } + } + return false; + }; + for (const { title, url } of external_info) { console.log('Current free game:', chalk.blue(title)); // , url); + const existing = db.data[user]?.[title]; + if (existing && existing.status && !existing.status.startsWith('failed')) { + console.log(` Already recorded as ${existing.status}, skipping.`); + notify_games.push({ title, url, status: 'existed' }); + continue; + } await page.goto(url, { waitUntil: 'domcontentloaded' }); + await page.waitForSelector('[data-a-target="buy-box"]', { timeout: 10000 }).catch(_ => {}); if (cfg.debug) await page.pause(); let store = 'unknown'; const detailLoc = page.locator('[data-a-target="DescriptionItemDetails"], [data-testid="DescriptionItemDetails"]'); @@ -270,23 +389,59 @@ try { else if (slug.includes('origin')) store = 'origin'; else if (slug.includes('xbox') || slug.includes('microsoft')) store = 'microsoft store'; else if (slug.includes('legacy')) store = 'legacy games'; + const lunaPlay = await page.locator('[data-a-target="LunaOffer"], button[data-a-target="LunaOffer"], button:has-text("Spielen")').count(); + if (store == 'unknown' && lunaPlay) store = 'luna'; } console.log(' External store:', store); + const notify_game = { title, url }; + notify_games.push(notify_game); // status is updated below + // Already collected? skip + const collectedLoc = page.locator('[data-a-target="ClaimStateQuantityAndDateContent"], [data-a-target="ClaimStateClaimCodeContent"]:has-text("Collected"), [data-a-target="ClaimStateVendorContent"], [data-a-target="ClaimStateViewDetailsAndInstructions"]'); + const collectedText = page.getByText(/You collected this on/i); + const collectedEpic = page.getByText(/Sent to your Epic Games Store library/i); + const collectedBanner = page.locator('p.tw-c-text-alert-success:has-text("Collected"), p.tw-c-text-alert-success:has-text("Collected this")'); + const collectedSuccessIcon = page.locator('[data-a-target="ItemCardDetailSuccessStatus"], .claim-state__success-icon'); + const disabledCTA = page.locator('[data-a-target="buy-box_call-to-action"][disabled], button[disabled]:has-text("Get game")'); + const collectedAny = await Promise.all([ + collectedLoc.count(), + collectedBanner.count(), + collectedText.count(), + collectedEpic.count(), + collectedSuccessIcon.count(), + disabledCTA.count(), + ]).then(([a, b, c, d, e, f]) => a + b + c + d + e + f > 0); + if (collectedAny) { + console.log(' Already collected, skipping.'); + notify_game.status = 'existed'; + db.data[user][title] ||= { title, time: datetime(), url, store, status: 'existed' }; + continue; + } + // Disabled CTA (e.g., needs linking or not available) + if (await disabledCTA.count()) { + if (store !== 'epic-games') { + console.log(' CTA is disabled, skipping (likely needs linking/not available).'); + notify_game.status = 'disabled'; + db.data[user][title] ||= { title, time: datetime(), url, store, status: 'disabled' }; + continue; + } else { + console.log(' CTA disabled for epic-games, will still try to link/claim.'); + } + } + if (store == 'luna') { + console.log(' Luna cloud title detected, skipping code redemption.'); + notify_game.status = 'luna (play)'; + db.data[user][title] ||= { title, time: datetime(), url, store: 'luna', status: 'luna (play)' }; + continue; + } if (cfg.pg_timeLeft && await skipBasedOnTime(url)) continue; if (cfg.dryrun) continue; if (cfg.interactive && !await confirm()) continue; + await clickCTA(page); await Promise.any([ - page.click('[data-a-target="buy-box"] .tw-button:has-text("Get game")'), - page.click('[data-a-target="buy-box"] .tw-button:has-text("Claim")'), - page.click('.tw-button:has-text("Complete Claim")'), - page.click('[data-a-target="buy-box_call-to-action-text"]'), - page.click('p[data-a-target="buy-box_call-to-action-text"]'), - page.waitForSelector('div:has-text("Link game account")'), - page.waitForSelector('.thank-you-title:has-text("Success")'), - ]); // waits for navigation + page.waitForSelector('.thank-you-title:has-text("Success")', { timeout: cfg.timeout }).catch(_ => {}), + page.waitForSelector('div:has-text("Link game account")', { timeout: cfg.timeout }).catch(_ => {}), + ]).catch(_ => {}); db.data[user][title] ||= { title, time: datetime(), url, store }; - const notify_game = { title, url }; - notify_games.push(notify_game); // status is updated below if (await page.locator('div:has-text("Link game account")').count() // TODO still needed? epic games store just has 'Link account' as the button text now. || await page.locator('div:has-text("Link account")').count()) { console.error(' Account linking is required to claim this offer!'); @@ -308,7 +463,21 @@ try { 'legacy games': 'https://www.legacygames.com/primedeal', }; if (store in redeem) { // did not work for linked origin: && !await page.locator('div:has-text("Successfully Claimed")').count() - const code = await Promise.any([page.inputValue('input[type="text"]'), page.textContent('[data-a-target="ClaimStateClaimCodeContent"]').then(s => s.replace('Your code: ', ''))]); // input: Legacy Games; text: gog.com + let code; + try { + // ensure CTA was clicked in case code is behind it + await clickCTA(page).catch(_ => {}); + code = await Promise.any([ + page.inputValue('input[type="text"]'), + page.textContent('[data-a-target="ClaimStateClaimCodeContent"]').then(s => s.replace('Your code: ', '')), + ]); + } catch (_) { + console.error(' Could not find claim code on page (timeout). Please check manually.'); + db.data[user][title].status = 'claimed (code not found)'; + notify_game.status = 'claimed (code not found)'; + await page.screenshot({ path: screenshot('external', `${filenamify(title)}_nocode.png`), fullPage: true }).catch(_ => {}); + continue; + } console.log(' Code to redeem game:', chalk.blue(code)); if (store == 'legacy games') { // may be different URL like https://legacygames.com/primeday/puzzleoftheyear/ redeem[store] = await (await page.$('li:has-text("Click here") a')).getAttribute('href'); // full text: Click here to enter your redemption code. @@ -441,11 +610,10 @@ try { // await page.pause(); } await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); - await page.click('button[data-type="Game"]'); + page.click('button[data-type="Game"]').catch(_ => {}); - if (notify_games.length) { // make screenshot of all games if something was claimed + if (notify_games.length && games) { // make screenshot of all games if something was claimed and list exists const p = screenshot(`${filenamify(datetime())}.png`); - // await page.screenshot({ path: p, fullPage: true }); // fullPage does not make a difference since scroll not on body but on some element await scrollUntilStable(() => games.locator('.item-card__action').count()); const viewportSize = page.viewportSize(); // current viewport size await page.setViewportSize({ ...viewportSize, height: 3000 }); // increase height, otherwise element screenshot is cut off at the top and bottom From a21dced86ec47540efc722cb43ce900343509bc7 Mon Sep 17 00:00:00 2001 From: nocci Date: Mon, 29 Dec 2025 14:31:25 +0000 Subject: [PATCH 091/134] =?UTF-8?q?=F0=9F=93=A6=20build(ci):=20add=20build?= =?UTF-8?q?-and-push=20workflow=20for=20docker=20images?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - create a new CI workflow to automate image building and pushing - trigger workflow on push to main branch - include steps for checkout, login, build, and push docker images --- .forgejo/workflows/build.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .forgejo/workflows/build.yml diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..97fa8a0 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -0,0 +1,26 @@ +name: build-and-push + +on: + push: + branches: + - main + +jobs: + docker: + runs-on: self-hosted + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to registry + run: echo "${{ secrets.REG_TOKEN }}" | docker login "${{ secrets.REGISTRY }}" -u "${{ secrets.REG_USER }}" --password-stdin + + - name: Build image + run: | + docker build -t "${{ secrets.REGISTRY_IMAGE }}:${{ github.sha }}" \ + -t "${{ secrets.REGISTRY_IMAGE }}:latest" . + + - name: Push image + run: | + docker push "${{ secrets.REGISTRY_IMAGE }}:${{ github.sha }}" + docker push "${{ secrets.REGISTRY_IMAGE }}:latest" From 6f778d71ac751dec0f079739141a48c4d11ebf1d Mon Sep 17 00:00:00 2001 From: nocci Date: Mon, 29 Dec 2025 14:33:14 +0000 Subject: [PATCH 092/134] =?UTF-8?q?=F0=9F=93=9D=20docs(README):=20add=20in?= =?UTF-8?q?structions=20for=20building=20images=20in=20Forgejo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - include steps for building and pushing Docker images using Forgejo - provide details on setting Forgejo secrets and using self-hosted runners --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 17ec854..5e0ab4d 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,14 @@ _This currently gives you a captcha challenge for epic-games. Until [issue #183] This will run `node epic-games; node prime-gaming; node gog` - if you only want to claim games for one of the stores, you can override the default command by appending e.g. `node epic-games` at the end of the `docker run` command, or if you want several `bash -c "node epic-games.js; node gog.js"`. Data (including json files with claimed games, codes to redeem, screenshots) is stored in the Docker volume `fgc`. +### Eigene Images aus Forgejo bauen +Falls du den Fork in einer selbst gehosteten Forgejo-Instanz pflegst: + +- Der Workflow `.forgejo/workflows/build.yml` baut/pusht das Docker-Image auf `push` nach `main`. +- Setze in Forgejo die Secrets `REGISTRY`, `REGISTRY_IMAGE`, `REG_USER`, `REG_TOKEN` (PAT mit Paket-Push). +- Self-hosted Runner mit Docker muss registriert sein (`runs-on: self-hosted`). +- Danach kannst du das Image ziehen, z.B.: `docker pull $REGISTRY_IMAGE:latest`. +

I want to run without Docker or develop locally. From bde0f34a80e8f59dce8b6b8e74b5e5286fda3320 Mon Sep 17 00:00:00 2001 From: nocci Date: Mon, 29 Dec 2025 14:36:18 +0000 Subject: [PATCH 093/134] =?UTF-8?q?=F0=9F=93=9D=20docs(README):=20simplify?= =?UTF-8?q?=20and=20update=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - remove detailed setup instructions and history - add quick-start guide for Docker and Docker Compose - update CI and configuration sections - streamline language and formatting for clarity --- README.md | 300 +++++++++++++++--------------------------------------- 1 file changed, 80 insertions(+), 220 deletions(-) diff --git a/README.md b/README.md index 5e0ab4d..be82e97 100644 --- a/README.md +++ b/README.md @@ -1,232 +1,92 @@ -

-logo-free-games-claimer -

+Free Games Claimer (Fork) +========================== -[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=vogler_free-games-claimer&metric=code_smells)](https://sonarcloud.io/project/overview?id=vogler_free-games-claimer) -# free-games-claimer +Automates claiming of free games for: +- Epic Games Store (and Epic-linked assets) +- Amazon Prime Gaming / Luna claims (incl. external stores like GOG, Legacy, Microsoft) +- GOG giveaways +- Optional extras: Steam stats, AliExpress dailies (experimental) -Claims free games periodically on -- [Epic Games Store](https://www.epicgames.com/store/free-games) -- [Amazon Prime Gaming](https://gaming.amazon.com) -- [GOG](https://www.gog.com) -- [Unreal Engine (Assets)](https://www.unrealengine.com/marketplace/en-US/assets?count=20&sortBy=effectiveDate&sortDir=DESC&start=0&tag=4910) ([experimental](https://github.com/vogler/free-games-claimer/issues/44), same login as Epic Games) - +This fork adds a Forgejo CI pipeline and instructions for running the pre-built image from your own registry. -Pull requests welcome :) +Requirements +------------ +- Docker or Podman (empfohlen) **oder** Node.js ≥ 20 zum lokalen Lauf +- (Optional) Python `apprise` für Benachrichtigungen: `pip install apprise` +- Für Playwright: Linux-Desktop-Abhängigkeiten sind im Container enthalten; lokal ggf. `npm install` zieht Firefox mit. -![Telegram Screenshot](https://user-images.githubusercontent.com/493741/214667078-eb5c1877-2bdd-40c1-b94e-4a50d6852c06.png) - -_Works on Windows/macOS/Linux._ - -Raspberry Pi (3, 4, Zero 2): [requires 64-bit OS](https://github.com/vogler/free-games-claimer/issues/3) like Raspberry Pi OS or Ubuntu (Raspbian won't work since it's 32-bit). - -## How to run -Easy option: [install Docker](https://docs.docker.com/get-docker/) (or [podman](https://podman-desktop.io/)) and run this command in a terminal: +Schnellstart (Docker Run) +------------------------- ``` -docker run --rm -it -p 6080:6080 -v fgc:/fgc/data --pull=always ghcr.io/vogler/free-games-claimer +docker run --rm -it \ + -p 6080:6080 \ + -v fgc:/fgc/data \ + -e SHOW=1 \ + :latest \ + node prime-gaming.js +``` +- `` z. B. `git.sky-net.it/nocci/free-games-claimer` +- Ports 6080/5900: noVNC/VNC (nur nötig mit `SHOW=1`) +- Daten/Configs landen in Volume `fgc` unter `/fgc/data` + +Docker Compose Beispiel +----------------------- +```yaml +services: + fgc: + image: :latest + container_name: fgc + environment: + - SHOW=1 # Browser sichtbar via VNC/noVNC + # - PG_EMAIL=... + # - PG_PASSWORD=... + # - PG_OTPKEY=... + volumes: + - fgc:/fgc/data + ports: + - "6080:6080" # noVNC + # - "5900:5900" # VNC optional + command: bash -c "node epic-games; node prime-gaming; node gog" +volumes: + fgc: ``` -_This currently gives you a captcha challenge for epic-games. Until [issue #183](https://github.com/vogler/free-games-claimer/issues/183) is fixed, it is recommended to just run `node epic-games` without docker (see below)._ +CI / eigenes Image +------------------ +- Workflow: `.forgejo/workflows/build.yml` baut/pusht auf `push` nach `main`. +- Secrets in Forgejo setzen: + - `REGISTRY` (z. B. `git.sky-net.it`) + - `REGISTRY_IMAGE` (z. B. `git.sky-net.it/nocci/free-games-claimer`) + - `REG_USER`, `REG_TOKEN` (PAT mit Paket-Push) +- Self-hosted Runner mit Docker-Access (`runs-on: self-hosted`) wird benötigt. -This will run `node epic-games; node prime-gaming; node gog` - if you only want to claim games for one of the stores, you can override the default command by appending e.g. `node epic-games` at the end of the `docker run` command, or if you want several `bash -c "node epic-games.js; node gog.js"`. -Data (including json files with claimed games, codes to redeem, screenshots) is stored in the Docker volume `fgc`. +Konfiguration (Umgebungsvariablen) +---------------------------------- +Typische Optionen: +- `SHOW=0/1` (0 = headless, 1 = UI) +- `WIDTH`, `HEIGHT` (Browsergröße) +- `TIMEOUT`, `LOGIN_TIMEOUT` (Sek.) +- Login: `EMAIL`, `PASSWORD` global; spezifisch `EG_EMAIL`, `EG_PASSWORD`, `EG_OTPKEY`, `PG_EMAIL`, `PG_PASSWORD`, `PG_OTPKEY`, `GOG_EMAIL`, `GOG_PASSWORD` +- Prime-Gaming: `PG_REDEEM=1` (Keys automatisch einlösen, experimentell), `PG_CLAIMDLC=1`, `PG_TIMELEFT=` zum Überspringen mit langer Restzeit +- Screenshots: `SCREENSHOTS_DIR` (Standard `data/screenshots`) +- Notifications: `NOTIFY='...'` (Apprise-URL), optional `NOTIFY_TITLE` -### Eigene Images aus Forgejo bauen -Falls du den Fork in einer selbst gehosteten Forgejo-Instanz pflegst: +Du kannst eine `data/config.env` anlegen; sie wird per dotenv geladen und überschreibt nichts, was bereits in der Umgebung gesetzt ist. -- Der Workflow `.forgejo/workflows/build.yml` baut/pusht das Docker-Image auf `push` nach `main`. -- Setze in Forgejo die Secrets `REGISTRY`, `REGISTRY_IMAGE`, `REG_USER`, `REG_TOKEN` (PAT mit Paket-Push). -- Self-hosted Runner mit Docker muss registriert sein (`runs-on: self-hosted`). -- Danach kannst du das Image ziehen, z.B.: `docker pull $REGISTRY_IMAGE:latest`. +Lokal ohne Docker +----------------- +``` +npm install +SHOW=0 PG_EMAIL=... PG_PASSWORD=... PG_OTPKEY=... node prime-gaming.js +``` +- Playwright lädt Firefox beim `npm install` in `~/.cache/ms-playwright`. +- Für sichtbaren Browser `SHOW=1` (GUI/Xvfb nötig). -
- I want to run without Docker or develop locally. +Persistenz & Ausgaben +--------------------- +- Daten & Status: `data/*.json` (pro Store) +- Browserprofil: `data/browser` +- Screenshots: `data/screenshots//` +- Optionale Videos/HAR: `RECORD=1` → `data/record/` -1. [Install Node.js](https://nodejs.org/en/download) -2. Clone/download this repository and `cd` into it in a terminal -3. Run `npm install` -4. Run `pip install apprise` (or use [pipx](https://github.com/pypa/pipx) if you have [problems](https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3)) to install [apprise](https://github.com/caronc/apprise) if you want notifications -5. To get updates: `git pull; npm install` -6. Run `node epic-games`, `node prime-gaming`, `node gog`... - -During `npm install` Playwright will download its Firefox to a cache in home ([doc](https://playwright.dev/docs/browsers#managing-browser-binaries)). -If you are missing some dependencies for the browser on your system, you can use `sudo npx playwright install firefox --with-deps`. - -If you don't want to use Docker for quasi-headless mode, you could run inside a virtual machine, on a server, or you wake your PC at night to avoid being interrupted. -
- -## Usage -All scripts start an automated Firefox instance, either with the browser GUI shown or hidden (*headless mode*). By default, you won't see any browser open on your host system. - -- When running inside Docker, the browser will be shown only inside the container. You can open http://localhost:6080 to interact with the browser running inside the container via noVNC (or use other VNC clients on port 5900). -- When running the scripts outside of Docker, the browser will be hidden by default; you can use `SHOW=1 ...` to show the UI (see options below). - -When running the first time, you have to login for each store you want to claim games on. -You can login indirectly via the terminal or directly in the browser. The scripts will wait until you are successfully logged in. - -There will be prompts in the terminal asking you to enter email, password, and afterwards some OTP (one time password / security code) if you have 2FA/MFA (two-/multi-factor authentication) enabled. If you want to login yourself via the browser, you can press escape in the terminal to skip the prompts. - -After login, the script will continue claiming the current games. If it still waits after you are already logged in, you can restart it (and open an issue). If you run the scripts regularly, you should not have to login again. - -### Configuration / Options -Options are set via [environment variables](https://kinsta.com/knowledgebase/what-is-an-environment-variable/) which allow for flexible configuration. - -TODO: ~~On the first run, the script will guide you through configuration and save all settings to `data/config.env`. You can edit this file directly or run `node fgc config` to run the configuration assistant again.~~ - -Available options/variables and their default values: - -| Option | Default | Description | -|--------------- |--------- |------------------------------------------------------------------------ | -| SHOW | 1 | Show browser if 1. Default for Docker, not shown when running outside. | -| WIDTH | 1280 | Width of the opened browser (and of screen for VNC in Docker). | -| HEIGHT | 1280 | Height of the opened browser (and of screen for VNC in Docker). | -| VNC_PASSWORD | | VNC password for Docker. No password used by default! | -| NOTIFY | | Notification services to use (Pushover, Slack, Telegram...), see below. [Apprise](https://github.com/caronc/apprise) | -| NOTIFY_TITLE | | Optional title for notifications, e.g. for Pushover. | -| BROWSER_DIR | data/browser | Directory for browser profile, e.g. for multiple accounts. | -| TIMEOUT | 60 | Timeout for any page action. Should be fine even on slow machines. | -| LOGIN_TIMEOUT | 180 | Timeout for login in seconds. Will wait twice (prompt + manual login). | -| EMAIL | | Default email for any login. | -| PASSWORD | | Default password for any login. | -| EG_EMAIL | | Epic Games email for login. Overrides EMAIL. | -| EG_PASSWORD | | Epic Games password for login. Overrides PASSWORD. | -| EG_OTPKEY | | Epic Games MFA OTP key. | -| EG_PARENTALPIN | | Epic Games Parental Controls PIN. | -| PG_EMAIL | | Prime Gaming email for login. Overrides EMAIL. | -| PG_PASSWORD | | Prime Gaming password for login. Overrides PASSWORD. | -| PG_OTPKEY | | Prime Gaming MFA OTP key. | -| PG_REDEEM | 0 | Prime Gaming: try to redeem keys on external stores ([experimental](https://github.com/vogler/free-games-claimer/issues/5)). | -| PG_CLAIMDLC | 0 | Prime Gaming: try to claim DLCs ([experimental](https://github.com/vogler/free-games-claimer/issues/55)). | -| GOG_EMAIL | | GOG email for login. Overrides EMAIL. | -| GOG_PASSWORD | | GOG password for login. Overrides PASSWORD. | -| GOG_NEWSLETTER | 0 | Do not unsubscribe from newsletter after claiming a game if 1. | -| LG_EMAIL | | Legacy Games: email to use for redeeming (if not set, defaults to PG_EMAIL) | - -See `src/config.js` for all options. - -#### How to set options -You can add options directly in the command or put them in a file to load. - -##### Docker -You can pass variables using `-e VAR=VAL`, for example `docker run -e EMAIL=foo@bar.baz -e NOTIFY='tgram://bottoken/ChatID' ...` or using `--env-file fgc.env` where `fgc.env` is a file on your host system (see [docs](https://docs.docker.com/engine/reference/commandline/run/#env)). You can also `docker cp` your configuration file to `/fgc/data/config.env` in the `fgc` volume to store it with the rest of the data instead of on the host ([example](https://github.com/moby/moby/issues/25245#issuecomment-365980572)). -If you are using [docker compose](https://docs.docker.com/compose/environment-variables/) (or Portainer etc.), you can put options in the `environment:` section. - -##### Without Docker -On Linux/macOS you can prefix the variables you want to set, for example `EMAIL=foo@bar.baz SHOW=1 node epic-games` will show the browser and skip asking you for your login email. On Windows you have to use `set`, [example](https://github.com/vogler/free-games-claimer/issues/314). -You can also put options in `data/config.env` which will be loaded by [dotenv](https://github.com/motdotla/dotenv). - -### Notifications -The scripts will try to send notifications for successfully claimed games and any errors like needing to log in or encountered captchas (should not happen). - -[apprise](https://github.com/caronc/apprise) is used for notifications and offers many services including Pushover, Slack, Telegram, SMS, Email, desktop and custom notifications. -You just need to set `NOTIFY` to the notification services you want to use, e.g. `NOTIFY='mailto://myemail:mypass@gmail.com' 'pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b'` - refer to their list of services and [examples](https://github.com/caronc/apprise#command-line-usage). - -### Automatic login, two-factor authentication -If you set the options for email, password and OTP key, there will be no prompts and logins should happen automatically. This is optional since all stores should stay logged in since cookies are refreshed. -To get the OTP key, it is easiest to follow the store's guide for adding an authenticator app. You should also scan the shown QR code with your favorite app to have an alternative method for 2FA. - -- **Epic Games**: visit [password & security](https://www.epicgames.com/account/password), enable 'third-party authenticator app', copy the 'Manual Entry Key' and use it to set `EG_OTPKEY`. -- **Prime Gaming**: visit Amazon 'Your Account › Login & security', 2-step verification › Manage › Add new app › Can't scan the barcode, copy the bold key and use it to set `PG_OTPKEY` -- **GOG**: only offers OTP via email - - -Beware that storing passwords and OTP keys as clear text may be a security risk. Use a unique/generated password! TODO: maybe at least offer to base64 encode for storage. - -### Epic Games Store -Run `node epic-games` (locally or in Docker). - -### Amazon Prime Gaming -Run `node prime-gaming` (locally or in Docker). - -Claiming the Amazon Games works out-of-the-box, however, for games on external stores you need to either link your account or redeem a key. - -- Stores that require account linking: Epic Games, Battle.net, Origin. -- Stores that require redeeming a key: GOG.com, Microsoft Games, Legacy Games. - - Keys and URLs are printed to the console, included in notifications and saved in `data/prime-gaming.json`. A screenshot of the page with the key is also saved to `data/screenshots`. - [TODO](https://github.com/vogler/free-games-claimer/issues/5): ~~redeem keys on external stores.~~ - - - - -### Run periodically -#### How often? -Epic Games usually has two free games *every week*, before Christmas every day. -Prime Gaming has new games *every month* or more often during Prime days. -GOG usually has one new game every couples of weeks. -Unreal Engine has new assets to claim *every first Tuesday of a month*. - - -It is safe to run the scripts every day. - -#### How to schedule? -The container/scripts will claim currently available games and then exit. -If you want it to run regularly, you have to schedule the runs yourself: - -- Linux/macOS: `crontab -e` ([example](https://github.com/vogler/free-games-claimer/discussions/56)) -- macOS: [launchd](https://stackoverflow.com/questions/132955/how-do-i-set-a-task-to-run-every-so-often) -- Windows: [task scheduler](https://active-directory-wp.com/docs/Usage/How_to_add_a_cron_job_on_Windows/Scheduled_tasks_and_cron_jobs_on_Windows/index.html) ([example](https://github.com/vogler/free-games-claimer/wiki/%5BHowTo%5D-Schedule-runs-on-Windows)), [other options](https://stackoverflow.com/questions/132971/what-is-the-windows-version-of-cron), or just put the command in a `.bat` file in Autostart if you restart often... -- any OS: use a process manager like [pm2](https://pm2.keymetrics.io/docs/usage/restart-strategies/) -- Docker Compose `command: bash -c "node epic-games; node prime-gaming; node gog; echo sleeping; sleep 1d"` additionally add `restart: unless-stopped` to it. - -TODO: ~~add some server-mode where the script just keeps running and claims games e.g. every day.~~ - -### Problems? - -Check the open [issues](https://github.com/vogler/free-games-claimer/issues) and comment there or open a new issue. - -If you're a developer, you can use `PWDEBUG=1 ...` to [inspect](https://playwright.dev/docs/inspector) which opens a debugger where you can step through the script. - - -## History/DevLog -
- Click to expand - -Tried [epicgames-freebies-claimer](https://github.com/Revadike/epicgames-freebies-claimer), but had problems since epicgames introduced hcaptcha (see [issue](https://github.com/Revadike/epicgames-freebies-claimer/issues/172)). - -Played around with puppeteer before, now trying newer https://playwright.dev which is pretty similar. -Playwright Inspector and `codegen` to generate scripts are nice, but failed to generate the right code for clicking a button in an iframe. - -Added [main.spec.ts](https://github.com/vogler/epicgames-claimer/commit/e5ce7916ab6329cfc7134677c4d89c2b3fa3ba97#diff-d18d03e9c407a20e05fbf03cbd6f9299857740544fb6b50d6a70b9c6fbc35831) which was the test script generated by `npx playwright codegen` with manual fix for clicking buttons in the created iframe. Can be executed by `npx playwright test`. The test runner has options `--debug` and `--timeout` and can execute typescript which is nice. However, this only worked up to the button 'I Agree', and then showed an hcaptcha. - -Added [main.captcha.js](https://github.com/vogler/epicgames-claimer/commit/e5ce7916ab6329cfc7134677c4d89c2b3fa3ba97#diff-d18d03e9c407a20e05fbf03cbd6f9299857740544fb6b50d6a70b9c6fbc35831) which uses beta of `playwright-extra@next` and `@extra/recaptcha@next` (from [comment on puppeteer-extra](https://github.com/berstend/puppeteer-extra/pull/303#issuecomment-775277480)). -However, `playwright-extra` seems to be old and missing `:has-text` selector (fixed [here](https://github.com/vogler/epicgames-claimer/commit/ba97a0e840b65f4476cca18e28d8461b0c703420)) and `page.frameLocator`, so the script did not run without adjustments. -Also, solving via [2captcha](https://2captcha.com?from=13225256) is a paid service which takes time and may be unreliable. - - -Added [main.stealth.js](https://github.com/vogler/epicgames-claimer/commit/64d0ba8ce71baec3947d1b64acd567befcb39340#diff-f70d3bd29df4a343f11062a97063953173491ce30fe34f69a0fc52517adbf342) which uses the stealth plugin without `playwright-extra` wrapper but up-to-date `playwright` (from [comment](https://github.com/berstend/puppeteer-extra/issues/454#issuecomment-917437212)). -The listed evasions are enough to not show an hcaptcha. Script claimed game successfully in non-headless mode. - -Removed `main.captcha.js`. -Using Playwright Test (`main.spec.ts`) instead of Library (`main.stealth.js`) has the advantage of free CLI like `--debug` and `--timeout`. - - -Button selectors should preferably use text in order to be more stable against changes in the DOM. - -Renamed repository from epicgames-claimer to free-games-claimer since a script for Amazon Prime Gaming was also added. Removed all old scripts in favor of just `epic-games.js` and `prime-gaming.js`. - -epic games: `headless` mode gets hcaptcha challenge. More details/references in [issue](https://github.com/vogler/free-games-claimer/issues/2). - -https://github.com/vogler/free-games-claimer/pull/11 introduced a Dockerfile for running non-headless inside the container via xvfb which makes it headless for the host running the container. - -v1.0 Standalone scripts node epic-games and node prime-gaming using Chromium. - -Changed to Firefox for all scripts since Chromium led to captchas. Claiming then also worked in headless mode without Docker. - -Added options via env vars, configurable in `data/config.env`. - -Added OTP generation via otplib for automatic login, even with 2FA. - -Added notifications via [apprise](https://github.com/caronc/apprise). -
- -[![Star History Chart](https://api.star-history.com/svg?repos=vogler/free-games-claimer&type=Date)](https://star-history.com/#vogler/free-games-claimer&Date) - - -![Alt](https://repobeats.axiom.co/api/embed/a1c5e6e420d90e0d6b34c1285e92a69a44138faa.svg "Repobeats analytics image") - ---- - -Logo with smaller aspect ratio (for Telegram bot etc.): 👾 - [emojipedia](https://emojipedia.org/alien-monster/) - -![logo-fgc](https://user-images.githubusercontent.com/493741/214589922-093d6557-6393-421c-b577-da58ff3671bc.png) +Tipp: Bei Captchas oder Erst-Login `SHOW=1` nutzen und einmal manuell einloggen; Cookies bleiben im Profil. Notifications via `NOTIFY` helfen bei Fehlermeldungen (z. B. Captcha, Login).*** From eba07721ca09a04c0c95e2f9672f87d084c6ee15 Mon Sep 17 00:00:00 2001 From: nocci Date: Mon, 29 Dec 2025 14:38:54 +0000 Subject: [PATCH 094/134] =?UTF-8?q?=F0=9F=93=9D=20docs(README):=20update?= =?UTF-8?q?=20instructions=20and=20clarify=20configurations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - update registry image references to point to `git.sky-net.it/nocci/free-games-claimer` - improve clarity on Docker and Docker Compose examples - translate German sections into English for wider accessibility - add detailed explanations for environment variables and configurations - enhance quickstart and CI instructions for better understanding --- README.md | 83 +++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index be82e97..8ccf31c 100644 --- a/README.md +++ b/README.md @@ -3,41 +3,40 @@ Free Games Claimer (Fork) Automates claiming of free games for: - Epic Games Store (and Epic-linked assets) -- Amazon Prime Gaming / Luna claims (incl. external stores like GOG, Legacy, Microsoft) +- Amazon Prime Gaming / Luna claims (including external stores like GOG, Legacy, Microsoft) - GOG giveaways - Optional extras: Steam stats, AliExpress dailies (experimental) -This fork adds a Forgejo CI pipeline and instructions for running the pre-built image from your own registry. +This fork adds a Forgejo CI pipeline and instructions for running the pre-built image from the registry at `git.sky-net.it/nocci/free-games-claimer`. Requirements ------------ -- Docker or Podman (empfohlen) **oder** Node.js ≥ 20 zum lokalen Lauf -- (Optional) Python `apprise` für Benachrichtigungen: `pip install apprise` -- Für Playwright: Linux-Desktop-Abhängigkeiten sind im Container enthalten; lokal ggf. `npm install` zieht Firefox mit. +- Docker or Podman (recommended), or Node.js ≥ 20 for local runs +- Optional notifications: `pip install apprise` +- Playwright dependencies are baked into the container; locally, `npm install` downloads Firefox. -Schnellstart (Docker Run) -------------------------- +Quickstart (Docker Run) +----------------------- ``` docker run --rm -it \ -p 6080:6080 \ -v fgc:/fgc/data \ -e SHOW=1 \ - :latest \ + git.sky-net.it/nocci/free-games-claimer:latest \ node prime-gaming.js ``` -- `` z. B. `git.sky-net.it/nocci/free-games-claimer` -- Ports 6080/5900: noVNC/VNC (nur nötig mit `SHOW=1`) -- Daten/Configs landen in Volume `fgc` unter `/fgc/data` +- Ports 6080/5900: noVNC/VNC (only needed with `SHOW=1`) +- Data/configs are stored in volume `fgc` under `/fgc/data` -Docker Compose Beispiel ------------------------ +Docker Compose Example +---------------------- ```yaml services: fgc: - image: :latest + image: git.sky-net.it/nocci/free-games-claimer:latest container_name: fgc environment: - - SHOW=1 # Browser sichtbar via VNC/noVNC + - SHOW=1 # show browser via VNC/noVNC # - PG_EMAIL=... # - PG_PASSWORD=... # - PG_OTPKEY=... @@ -51,42 +50,42 @@ volumes: fgc: ``` -CI / eigenes Image ------------------- -- Workflow: `.forgejo/workflows/build.yml` baut/pusht auf `push` nach `main`. -- Secrets in Forgejo setzen: - - `REGISTRY` (z. B. `git.sky-net.it`) - - `REGISTRY_IMAGE` (z. B. `git.sky-net.it/nocci/free-games-claimer`) - - `REG_USER`, `REG_TOKEN` (PAT mit Paket-Push) -- Self-hosted Runner mit Docker-Access (`runs-on: self-hosted`) wird benötigt. +CI / Build Your Own Image +------------------------- +- Workflow: `.forgejo/workflows/build.yml` builds/pushes on `push` to `main`. +- Secrets needed in Forgejo: + - `REGISTRY` (e.g., `git.sky-net.it`) + - `REGISTRY_IMAGE` (e.g., `git.sky-net.it/nocci/free-games-claimer`) + - `REG_USER`, `REG_TOKEN` (PAT with package push) +- Requires a self-hosted runner with Docker access (`runs-on: self-hosted`). -Konfiguration (Umgebungsvariablen) ----------------------------------- -Typische Optionen: +Configuration (Environment Variables) +------------------------------------- +Common options: - `SHOW=0/1` (0 = headless, 1 = UI) -- `WIDTH`, `HEIGHT` (Browsergröße) -- `TIMEOUT`, `LOGIN_TIMEOUT` (Sek.) -- Login: `EMAIL`, `PASSWORD` global; spezifisch `EG_EMAIL`, `EG_PASSWORD`, `EG_OTPKEY`, `PG_EMAIL`, `PG_PASSWORD`, `PG_OTPKEY`, `GOG_EMAIL`, `GOG_PASSWORD` -- Prime-Gaming: `PG_REDEEM=1` (Keys automatisch einlösen, experimentell), `PG_CLAIMDLC=1`, `PG_TIMELEFT=` zum Überspringen mit langer Restzeit -- Screenshots: `SCREENSHOTS_DIR` (Standard `data/screenshots`) -- Notifications: `NOTIFY='...'` (Apprise-URL), optional `NOTIFY_TITLE` +- `WIDTH`, `HEIGHT` (browser size) +- `TIMEOUT`, `LOGIN_TIMEOUT` (seconds) +- Login: `EMAIL`, `PASSWORD` global; per store `EG_EMAIL`, `EG_PASSWORD`, `EG_OTPKEY`, `PG_EMAIL`, `PG_PASSWORD`, `PG_OTPKEY`, `GOG_EMAIL`, `GOG_PASSWORD` +- Prime Gaming: `PG_REDEEM=1` (auto-redeem keys, experimental), `PG_CLAIMDLC=1`, `PG_TIMELEFT=` to skip long-remaining offers +- Screenshots: `SCREENSHOTS_DIR` (default `data/screenshots`) +- Notifications: `NOTIFY='...'` (Apprise URL), optional `NOTIFY_TITLE` -Du kannst eine `data/config.env` anlegen; sie wird per dotenv geladen und überschreibt nichts, was bereits in der Umgebung gesetzt ist. +You can place a `data/config.env`; it is loaded via dotenv and is overridden by explicitly set environment variables. -Lokal ohne Docker ------------------ +Local Run Without Docker +------------------------ ``` npm install SHOW=0 PG_EMAIL=... PG_PASSWORD=... PG_OTPKEY=... node prime-gaming.js ``` -- Playwright lädt Firefox beim `npm install` in `~/.cache/ms-playwright`. -- Für sichtbaren Browser `SHOW=1` (GUI/Xvfb nötig). +- Playwright downloads Firefox to `~/.cache/ms-playwright`. +- Use `SHOW=1` for a visible browser (requires GUI/Xvfb). -Persistenz & Ausgaben +Persistence & Outputs --------------------- -- Daten & Status: `data/*.json` (pro Store) -- Browserprofil: `data/browser` +- Data/status: `data/*.json` (per store) +- Browser profile: `data/browser` - Screenshots: `data/screenshots//` -- Optionale Videos/HAR: `RECORD=1` → `data/record/` +- Optional videos/HAR: `RECORD=1` → `data/record/` -Tipp: Bei Captchas oder Erst-Login `SHOW=1` nutzen und einmal manuell einloggen; Cookies bleiben im Profil. Notifications via `NOTIFY` helfen bei Fehlermeldungen (z. B. Captcha, Login).*** +Tip: For captchas or first-time login, run with `SHOW=1` and log in once; cookies stay in the profile. Notifications via `NOTIFY` help surface errors (e.g., captcha, login). From eb5b9bbb6e8890e51072c2a592dd14d45a469d83 Mon Sep 17 00:00:00 2001 From: nocci Date: Mon, 29 Dec 2025 15:01:55 +0000 Subject: [PATCH 095/134] =?UTF-8?q?=F0=9F=91=B7=20ci(build):=20enhance=20d?= =?UTF-8?q?ocker=20build=20process=20with=20buildx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add Docker Buildx setup for advanced build capabilities - update build step to use buildx for multi-platform support --- .forgejo/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 97fa8a0..3aa7b56 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -9,6 +9,9 @@ jobs: docker: runs-on: self-hosted steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Checkout uses: actions/checkout@v4 @@ -17,8 +20,9 @@ jobs: - name: Build image run: | - docker build -t "${{ secrets.REGISTRY_IMAGE }}:${{ github.sha }}" \ - -t "${{ secrets.REGISTRY_IMAGE }}:latest" . + docker buildx build --load \ + -t "${{ secrets.REGISTRY_IMAGE }}:${{ github.sha }}" \ + -t "${{ secrets.REGISTRY_IMAGE }}:latest" . - name: Push image run: | From 0a729d0cbfa562f6913bbe2d7a0085e2da07ab72 Mon Sep 17 00:00:00 2001 From: nocci Date: Mon, 29 Dec 2025 15:08:00 +0000 Subject: [PATCH 096/134] =?UTF-8?q?=F0=9F=94=A7=20chore(workflow):=20simpl?= =?UTF-8?q?ify=20docker=20image=20tagging=20and=20pushing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - remove specific sha tag from build and push steps - streamline workflow by focusing on latest tag --- .forgejo/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 3aa7b56..cb83fb0 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -21,10 +21,8 @@ jobs: - name: Build image run: | docker buildx build --load \ - -t "${{ secrets.REGISTRY_IMAGE }}:${{ github.sha }}" \ -t "${{ secrets.REGISTRY_IMAGE }}:latest" . - name: Push image run: | - docker push "${{ secrets.REGISTRY_IMAGE }}:${{ github.sha }}" docker push "${{ secrets.REGISTRY_IMAGE }}:latest" From 9d79f9ac7851f8d4dabdb0cb0e5bc1dd3cc29525 Mon Sep 17 00:00:00 2001 From: nocci Date: Mon, 29 Dec 2025 15:54:41 +0000 Subject: [PATCH 097/134] =?UTF-8?q?=F0=9F=93=9D=20docs(README):=20update?= =?UTF-8?q?=20configuration=20and=20remove=20CI=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - remove outdated CI/build instructions - add new environment variable options for configuration 🐛 fix(util): handle notification errors gracefully - resolve promise instead of rejecting on notification errors - prevent whole run from failing due to notification issues --- README.md | 16 +++++++--------- src/util.js | 3 ++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8ccf31c..16ac157 100644 --- a/README.md +++ b/README.md @@ -50,15 +50,6 @@ volumes: fgc: ``` -CI / Build Your Own Image -------------------------- -- Workflow: `.forgejo/workflows/build.yml` builds/pushes on `push` to `main`. -- Secrets needed in Forgejo: - - `REGISTRY` (e.g., `git.sky-net.it`) - - `REGISTRY_IMAGE` (e.g., `git.sky-net.it/nocci/free-games-claimer`) - - `REG_USER`, `REG_TOKEN` (PAT with package push) -- Requires a self-hosted runner with Docker access (`runs-on: self-hosted`). - Configuration (Environment Variables) ------------------------------------- Common options: @@ -69,6 +60,13 @@ Common options: - Prime Gaming: `PG_REDEEM=1` (auto-redeem keys, experimental), `PG_CLAIMDLC=1`, `PG_TIMELEFT=` to skip long-remaining offers - Screenshots: `SCREENSHOTS_DIR` (default `data/screenshots`) - Notifications: `NOTIFY='...'` (Apprise URL), optional `NOTIFY_TITLE` +- Browser profile: `BROWSER_DIR` (default `data/browser`) +- Recording: `RECORD=1` to save videos/HAR to `data/record/` +- Debugging: `DEBUG=1` (opens Playwright inspector), `DEBUG_NETWORK=1` (logs requests), `TIME=1` (prints timings) +- Dry run / Interaction: `DRYRUN=1` (do not claim), `INTERACTIVE=1` (ask before claiming), `HEADLESS` is derived from `SHOW`/`DEBUG` +- Directories: `SCREENSHOTS_DIR`, `BROWSER_DIR`, `DATA_DIR` (prefix for data; default under `data/`) +- VNC/noVNC: `VNC_PASSWORD` (for Docker entrypoint), `NOVNC_PORT`/`VNC_PORT` (Docker) +- General timeouts: `TIMEOUT` (per action), `LOGIN_TIMEOUT` (extra time for login) You can place a `data/config.env`; it is loaded via dotenv and is overridden by explicitly set environment variables. diff --git a/src/util.js b/src/util.js index 308952d..49424f8 100644 --- a/src/util.js +++ b/src/util.js @@ -125,7 +125,8 @@ export const notify = html => new Promise((resolve, reject) => { if (error.message.includes('command not found')) { console.info('Run `pip install apprise`. See https://github.com/vogler/free-games-claimer#notifications'); } - return reject(error); + // don't fail the whole run on notification errors + return resolve(); } if (stderr) console.error(`stderr: ${stderr}`); if (stdout) console.log(`stdout: ${stdout}`); From e39cca93c23fe1412ca1bdecbbeda45843bd060f Mon Sep 17 00:00:00 2001 From: nocci Date: Mon, 29 Dec 2025 17:19:39 +0100 Subject: [PATCH 098/134] better README.md --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 16ac157..248995e 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,9 @@ Free Games Claimer (Fork) ========================== Automates claiming of free games for: -- Epic Games Store (and Epic-linked assets) -- Amazon Prime Gaming / Luna claims (including external stores like GOG, Legacy, Microsoft) +- Amazon Luna Gaming / Luna claims (including external stores like GOG, Epic Games, Legacy Games ) - GOG giveaways -- Optional extras: Steam stats, AliExpress dailies (experimental) - -This fork adds a Forgejo CI pipeline and instructions for running the pre-built image from the registry at `git.sky-net.it/nocci/free-games-claimer`. +- Optional extras: Steam stats, AliExpress dailies (not implemated yet) Requirements ------------ From 0e5303da623e186951c8ff01614f688ca09bcd16 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 11:02:01 +0000 Subject: [PATCH 099/134] =?UTF-8?q?=F0=9F=91=B7=20ci(workflow):=20add=20li?= =?UTF-8?q?nt=20job=20to=20build=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - introduce lint job in build.yml for code quality checks - ensure lint job runs before docker job - setup Node.js and install dependencies for ESLint --- .forgejo/workflows/build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index cb83fb0..c15f8c5 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -6,7 +6,22 @@ on: - main jobs: + lint: + runs-on: self-hosted + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install dependencies + run: npm ci + - name: Run ESLint + run: npm run lint + docker: + needs: lint runs-on: self-hosted steps: - name: Set up Docker Buildx From d40a577f4778669c10e644f582aa2cd0012af490 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 12:38:03 +0000 Subject: [PATCH 100/134] =?UTF-8?q?=F0=9F=91=B7=20ci(build):=20add=20Sonar?= =?UTF-8?q?Qube=20scan=20to=20build=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - introduce SonarQube scanning step for code quality analysis - update workflow dependencies and execution order 🐛 fix(auth): improve error handling and code formatting - remove unused imports and fix code indentation - enhance error handling with improved catch blocks 💄 style(general): standardize code formatting and style consistency - update various files to ensure consistent code style - adjust indentation and whitespace for readability --- .forgejo/workflows/build.yml | 25 ++++++++++- aliexpress.js | 30 ++++++++----- prime-gaming.js | 54 ++++++++++++----------- src/util.js | 8 ++-- steam-games.js | 10 ++--- test/sigint-enquirer-raw-keeps-running.js | 4 +- test/sigint-enquirer-raw.js | 26 +++++------ 7 files changed, 95 insertions(+), 62 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index c15f8c5..882e541 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -20,9 +20,32 @@ jobs: - name: Run ESLint run: npm run lint - docker: + sonar: needs: lint runs-on: self-hosted + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: SonarQube Scan + env: + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + docker run --rm \ + -e SONAR_HOST_URL="$SONAR_HOST_URL" \ + -e SONAR_TOKEN="$SONAR_TOKEN" \ + -v "$PWD:/usr/src" \ + -w /usr/src \ + sonarsource/sonar-scanner-cli \ + sonar-scanner \ + -Dsonar.host.url="$SONAR_HOST_URL" \ + -Dsonar.login="$SONAR_TOKEN" + + docker: + needs: [lint, sonar] + runs-on: self-hosted steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/aliexpress.js b/aliexpress.js index 52e75a0..6d654d3 100644 --- a/aliexpress.js +++ b/aliexpress.js @@ -1,5 +1,5 @@ import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdated playwright-extra -import { datetime, filenamify, prompt, handleSIGINT, stealth } from './src/util.js'; +import { datetime, filenamify, prompt, handleSIGINT } from './src/util.js'; import { cfg } from './src/config.js'; // using https://github.com/apify/fingerprint-suite worked, but has no launchPersistentContext... @@ -8,8 +8,8 @@ import { FingerprintInjector } from 'fingerprint-injector'; import { FingerprintGenerator } from 'fingerprint-generator'; const { fingerprint, headers } = new FingerprintGenerator().getFingerprint({ - devices: ["mobile"], - operatingSystems: ["android"], + devices: ['mobile'], + operatingSystems: ['android'], }); const context = await firefox.launchPersistentContext(cfg.dir.browser, { @@ -21,11 +21,11 @@ const context = await firefox.launchPersistentContext(cfg.dir.browser, { handleSIGINT: false, // have to handle ourselves and call context.close(), otherwise recordings from above won't be saved userAgent: fingerprint.navigator.userAgent, viewport: { - width: fingerprint.screen.width, - height: fingerprint.screen.height, + width: fingerprint.screen.width, + height: fingerprint.screen.height, }, extraHTTPHeaders: { - 'accept-language': headers['accept-language'], + 'accept-language': headers['accept-language'], }, }); handleSIGINT(context); @@ -36,7 +36,7 @@ context.setDefaultTimeout(cfg.debug ? 0 : cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist -const auth = async (url) => { +const auth = async url => { console.log('auth', url); await page.goto(url, { waitUntil: 'domcontentloaded' }); // redirects to https://login.aliexpress.com/?return_url=https%3A%2F%2Fwww.aliexpress.com%2Fp%2Fcoin-pc-index%2Findex.html @@ -45,7 +45,7 @@ const auth = async (url) => { console.error('Not logged in! Will wait for 120s for you to login...'); // await page.waitForTimeout(120*1000); // or try automated - page.locator('span:has-text("Switch account")').click().catch(_ => {}); // sometimes no longer logged in, but previous user/email is pre-selected -> in this case we want to go back to the classic login + page.locator('span:has-text("Switch account")').click().catch(() => {}); // sometimes no longer logged in, but previous user/email is pre-selected -> in this case we want to go back to the classic login const login = page.locator('.login-container'); const email = cfg.ae_email || await prompt({ message: 'Enter email' }); const emailInput = login.locator('input[label="Email or phone number"]'); @@ -58,11 +58,11 @@ const auth = async (url) => { await login.locator('input[label="Password"]').fill(password); await login.locator('button:has-text("Sign in")').click(); const error = login.locator('.error-text'); - error.waitFor().then(async _ => console.error('Login error:', await error.innerText())); + error.waitFor().then(async () => console.error('Login error:', await error.innerText())); await page.waitForURL(url); // await page.addLocatorHandler(page.getByRole('button', { name: 'Accept cookies' }), btn => btn.click()); - page.getByRole('button', { name: 'Accept cookies' }).click().then(_ => console.log('Accepted cookies')).catch(_ => { }); - }), page.locator('#nav-user-account').waitFor()]).catch(_ => {}); + page.getByRole('button', { name: 'Accept cookies' }).click().then(() => console.log('Accepted cookies')).catch(() => { }); + }), page.locator('#nav-user-account').waitFor()]).catch(() => {}); // await page.locator('#nav-user-account').hover(); // console.log('Logged in as:', await page.locator('.welcome-name').innerText()); @@ -80,6 +80,7 @@ const urls = { merge: 'https://m.aliexpress.com/p/merge-market/index.html', }; +/* eslint-disable no-unused-vars */ const coins = async () => { // await auth(urls.coins); await Promise.any([page.locator('.checkin-button').click(), page.locator('.addcoin').waitFor()]); @@ -103,6 +104,7 @@ const euro = async () => { const merge = async () => { await page.pause(); }; +/* eslint-enable no-unused-vars */ try { // await coins(); @@ -112,7 +114,11 @@ try { // gogo, // euro, merge, - ].reduce((a, f) => a.then(async _ => { await auth(urls[f.name]); await f(); console.log() }), Promise.resolve()); + ].reduce((a, f) => a.then(async () => { + await auth(urls[f.name]); + await f(); + console.log(); + }), Promise.resolve()); // await page.pause(); } catch (error) { diff --git a/prime-gaming.js b/prime-gaming.js index dc39bba..0c982bd 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -41,7 +41,7 @@ const handleMFA = async p => { const otpField = p.locator('#auth-mfa-otpcode, input[name=otpCode]'); if (!await otpField.count()) return false; console.log('Two-Step Verification - enter the One Time Password (OTP), e.g. generated by your Authenticator App'); - await p.locator('#auth-mfa-remember-device, [name=rememberDevice]').check().catch(_ => {}); + await p.locator('#auth-mfa-remember-device, [name=rememberDevice]').check().catch(() => {}); const otp = cfg.pg_otpkey && authenticator.generate(cfg.pg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them await otpField.first().pressSequentially(otp.toString()); await p.locator('input[type="submit"], button[type="submit"]').first().click(); @@ -61,7 +61,7 @@ try { await page.click('input[type="submit"]'); await page.fill('[name=password]', password); await page.click('input[type="submit"]'); - await handleMFA(page).catch(_ => {}); + await handleMFA(page).catch(() => {}); page.waitForURL('**/ap/signin**').then(async () => { // check for wrong credentials const error = await page.locator('.a-alert-content').first().innerText(); if (!error.trim.length) return; @@ -91,7 +91,7 @@ try { '[data-a-target="user-dropdown-first-name-text"]', '[data-testid="user-dropdown-first-name-text"]', ].map(s => page.waitForSelector(s))); - page.click('[aria-label="Cookies usage disclaimer banner"] button:has-text("Accept Cookies")').catch(_ => { }); // to not waste screen space when non-headless, TODO does not work reliably, need to wait for something else first? + page.click('[aria-label="Cookies usage disclaimer banner"] button:has-text("Accept Cookies")').catch(() => { }); // to not waste screen space when non-headless, TODO does not work reliably, need to wait for something else first? while (await page.locator('button:has-text("Sign in"), button:has-text("Anmelden")').count() > 0) { console.error('Not signed in anymore.'); await page.click('button:has-text("Sign in")'); @@ -115,7 +115,7 @@ try { await context.close(); // finishes potential recording process.exit(1); }); - handleMFA(page).catch(_ => {}); + handleMFA(page).catch(() => {}); } else { console.log('Waiting for you to login in the browser.'); await notify('prime-gaming: no longer signed in and not enough options set for automatic login.'); @@ -209,7 +209,7 @@ try { const games = await locateGamesList(); // Load all cards (old and new layout) by scrolling the container or the page if (games) await scrollUntilStable(() => games.evaluate(el => el.scrollHeight).catch(() => 0)); - await scrollUntilStable(() => page.evaluate(() => document.scrollingElement?.scrollHeight ?? 0)); + await scrollUntilStable(() => page.evaluate(() => globalThis.document?.scrollingElement?.scrollHeight ?? 0)); const normalizeClaimUrl = url => { if (!url) return { url, key: null }; @@ -241,7 +241,7 @@ try { const hrefs = [...new Set(await anchorClaims.evaluateAll(anchors => anchors.map(a => a.getAttribute('href')).filter(Boolean)))]; for (const href of hrefs) { const { url, key } = normalizeClaimUrl(href); - const title = key || (await anchorClaims.first().innerText()) || 'Unknown title'; + const title = key || await anchorClaims.first().innerText() || 'Unknown title'; cards.push({ kind: 'external', title, url, key }); } } @@ -286,15 +286,15 @@ try { // bottom to top: oldest to newest games internal.reverse(); external.reverse(); - const sameOrNewPage = async url => new Promise(async (resolve, _reject) => { + const sameOrNewPage = async url => { const isNew = page.url() != url; let p = page; if (isNew) { p = await context.newPage(); await p.goto(url, { waitUntil: 'domcontentloaded' }); } - resolve([p, isNew]); - }); + return [p, isNew]; + }; const skipBasedOnTime = async url => { // console.log(' Checking time left for game:', url); const [p, isNew] = await sameOrNewPage(url); @@ -305,12 +305,12 @@ try { } const dueDateOrg = await dueDateLoc.first().innerText(); const dueDate = new Date(Date.parse(dueDateOrg + ' 17:00')); - const daysLeft = (dueDate.getTime() - Date.now())/1000/60/60/24; + const daysLeft = (dueDate.getTime() - Date.now()) / 1000 / 60 / 60 / 24; const availabilityText = await p.locator('.availability-date, [data-testid="availability-end-date"], [data-test-selector="availability-end-date"]').first().innerText().catch(() => dueDateOrg); console.log(' ', availabilityText, '->', daysLeft.toFixed(2)); if (isNew) await p.close(); return daysLeft > cfg.pg_timeLeft; - } + }; console.log('\nNumber of free unclaimed games (Prime Gaming):', internal.length); // claim games in internal store for (const card of internal) { @@ -353,12 +353,16 @@ try { try { await c.waitFor({ state: 'visible', timeout: 5000 }); if (!await c.isEnabled()) { - await c.evaluate(el => { el.disabled = false; el.removeAttribute('disabled'); el.click(); }); + await c.evaluate(el => { + el.disabled = false; + el.removeAttribute('disabled'); + el.click(); + }); } else { await c.click(); } return true; - } catch (_) { + } catch { // try next candidate } } @@ -375,7 +379,7 @@ try { continue; } await page.goto(url, { waitUntil: 'domcontentloaded' }); - await page.waitForSelector('[data-a-target="buy-box"]', { timeout: 10000 }).catch(_ => {}); + await page.waitForSelector('[data-a-target="buy-box"]', { timeout: 10000 }).catch(() => {}); if (cfg.debug) await page.pause(); let store = 'unknown'; const detailLoc = page.locator('[data-a-target="DescriptionItemDetails"], [data-testid="DescriptionItemDetails"]'); @@ -438,9 +442,9 @@ try { if (cfg.interactive && !await confirm()) continue; await clickCTA(page); await Promise.any([ - page.waitForSelector('.thank-you-title:has-text("Success")', { timeout: cfg.timeout }).catch(_ => {}), - page.waitForSelector('div:has-text("Link game account")', { timeout: cfg.timeout }).catch(_ => {}), - ]).catch(_ => {}); + page.waitForSelector('.thank-you-title:has-text("Success")', { timeout: cfg.timeout }).catch(() => {}), + page.waitForSelector('div:has-text("Link game account")', { timeout: cfg.timeout }).catch(() => {}), + ]).catch(() => {}); db.data[user][title] ||= { title, time: datetime(), url, store }; if (await page.locator('div:has-text("Link game account")').count() // TODO still needed? epic games store just has 'Link account' as the button text now. || await page.locator('div:has-text("Link account")').count()) { @@ -466,16 +470,16 @@ try { let code; try { // ensure CTA was clicked in case code is behind it - await clickCTA(page).catch(_ => {}); + await clickCTA(page).catch(() => {}); code = await Promise.any([ page.inputValue('input[type="text"]'), page.textContent('[data-a-target="ClaimStateClaimCodeContent"]').then(s => s.replace('Your code: ', '')), ]); - } catch (_) { + } catch { console.error(' Could not find claim code on page (timeout). Please check manually.'); db.data[user][title].status = 'claimed (code not found)'; notify_game.status = 'claimed (code not found)'; - await page.screenshot({ path: screenshot('external', `${filenamify(title)}_nocode.png`), fullPage: true }).catch(_ => {}); + await page.screenshot({ path: screenshot('external', `${filenamify(title)}_nocode.png`), fullPage: true }).catch(() => {}); continue; } console.log(' Code to redeem game:', chalk.blue(code)); @@ -563,7 +567,7 @@ try { if (j?.events?.cart.length && j.events.cart[0]?.data?.reason == 'UserAlreadyOwnsContent') { redeem_action = 'already redeemed'; console.error(' error: UserAlreadyOwnsContent'); - } else if (true) { // TODO what's returned on success? + } else { // TODO what's returned on success? redeem_action = 'redeemed'; db.data[user][title].status = 'claimed and redeemed?'; console.log(' Redeemed successfully? Please report if not in https://github.com/vogler/free-games-claimer/issues/5'); @@ -610,7 +614,7 @@ try { // await page.pause(); } await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); - page.click('button[data-type="Game"]').catch(_ => {}); + page.click('button[data-type="Game"]').catch(() => {}); if (notify_games.length && games) { // make screenshot of all games if something was claimed and list exists const p = screenshot(`${filenamify(datetime())}.png`); @@ -628,7 +632,7 @@ try { await loot.waitFor(); process.stdout.write('Loading all DLCs on page...'); - await scrollUntilStable(() => loot.locator('[data-a-target="item-card"]').count()) + await scrollUntilStable(() => loot.locator('[data-a-target="item-card"]').count()); console.log('\nNumber of already claimed DLC:', await loot.locator('p:has-text("Collected")').count()); @@ -657,7 +661,7 @@ try { // most games have a button 'Get in-game content' // epic-games: Fall Guys: Claim -> Continue -> Go to Epic Games (despite account linked and logged into epic-games) -> not tied to account but via some cookie? await Promise.any([page.click('.tw-button:has-text("Get in-game content")'), page.click('.tw-button:has-text("Claim your gift")'), page.click('.tw-button:has-text("Claim")').then(() => page.click('button:has-text("Continue")'))]); - page.click('button:has-text("Continue")').catch(_ => { }); + page.click('button:has-text("Continue")').catch(() => { }); const linkAccountButton = page.locator('[data-a-target="LinkAccountButton"]'); let unlinked_store; if (await linkAccountButton.count()) { @@ -674,7 +678,7 @@ try { dlc_unlinked[unlinked_store] ??= []; dlc_unlinked[unlinked_store].push(title); } else { - const code = await page.inputValue('input[type="text"]').catch(_ => undefined); + const code = await page.inputValue('input[type="text"]').catch(() => undefined); console.log(' Code to redeem game:', chalk.blue(code)); db.data[user][title].code = code; db.data[user][title].status = 'claimed'; diff --git a/src/util.js b/src/util.js index 49424f8..8ba63a3 100644 --- a/src/util.js +++ b/src/util.js @@ -96,21 +96,21 @@ const timeoutPlugin = timeout => enquirer => { // cancel prompt after timeout ms prompt.hint = () => 'timeout'; prompt.cancel(); }, timeout); - prompt.on('submit', _ => clearTimeout(t)); - prompt.on('cancel', _ => clearTimeout(t)); + prompt.on('submit', () => clearTimeout(t)); + prompt.on('cancel', () => clearTimeout(t)); }); }; enquirer.use(timeoutPlugin(cfg.login_timeout)); // TODO may not want to have this timeout for all prompts; better extend Prompt and add a timeout prompt option // single prompt that just returns the non-empty value instead of an object // @ts-ignore -export const prompt = o => enquirer.prompt({ name: 'name', type: 'input', message: 'Enter value', ...o }).then(r => r.name).catch(_ => {}); +export const prompt = o => enquirer.prompt({ name: 'name', type: 'input', message: 'Enter value', ...o }).then(r => r.name).catch(() => {}); export const confirm = o => prompt({ type: 'confirm', message: 'Continue?', ...o }); // notifications via apprise CLI import { execFile } from 'child_process'; import { cfg } from './config.js'; -export const notify = html => new Promise((resolve, reject) => { +export const notify = html => new Promise(resolve => { if (!cfg.notify) { if (cfg.debug) console.debug('notify: NOTIFY is not set!'); return resolve(); diff --git a/steam-games.js b/steam-games.js index 9b307fc..ed54253 100644 --- a/steam-games.js +++ b/steam-games.js @@ -12,8 +12,8 @@ import { FingerprintInjector } from 'fingerprint-injector'; import { FingerprintGenerator } from 'fingerprint-generator'; const { fingerprint, headers } = new FingerprintGenerator().getFingerprint({ - devices: ["desktop"], - operatingSystems: ["windows"], + devices: ['desktop'], + operatingSystems: ['windows'], }); const context = await firefox.launchPersistentContext(cfg.dir.browser, { @@ -22,11 +22,11 @@ const context = await firefox.launchPersistentContext(cfg.dir.browser, { locale: 'en-US', // ignore OS locale to be sure to have english text for locators -> done via /en in URL userAgent: fingerprint.navigator.userAgent, viewport: { - width: fingerprint.screen.width, - height: fingerprint.screen.height, + width: fingerprint.screen.width, + height: fingerprint.screen.height, }, extraHTTPHeaders: { - 'accept-language': headers['accept-language'], + 'accept-language': headers['accept-language'], }, }); // await stealth(context); diff --git a/test/sigint-enquirer-raw-keeps-running.js b/test/sigint-enquirer-raw-keeps-running.js index 23d9983..ccb3081 100644 --- a/test/sigint-enquirer-raw-keeps-running.js +++ b/test/sigint-enquirer-raw-keeps-running.js @@ -12,10 +12,10 @@ function onRawSIGINT(fn) { } }); } -console.log(1) +console.log(1); onRawSIGINT(() => { console.log('raw'); process.exit(1); }); -console.log(2) +console.log(2); // onRawSIGINT workaround for enquirer keeps the process from exiting here... diff --git a/test/sigint-enquirer-raw.js b/test/sigint-enquirer-raw.js index e6b538d..c85ee0d 100644 --- a/test/sigint-enquirer-raw.js +++ b/test/sigint-enquirer-raw.js @@ -7,19 +7,19 @@ import { prompt, handleSIGINT } from '../src/util.js'; // }); handleSIGINT(); -function onRawSIGINT(fn) { - const { stdin, stdout } = process; - stdin.setRawMode(true); - stdin.resume(); - stdin.on('data', data => { - const key = data.toString('utf-8'); - if (key === '\u0003') { // ctrl + c - fn(); - } else { - stdout.write(key); - } - }); -} +// function onRawSIGINT(fn) { +// const { stdin, stdout } = process; +// stdin.setRawMode(true); +// stdin.resume(); +// stdin.on('data', data => { +// const key = data.toString('utf-8'); +// if (key === '\u0003') { // ctrl + c +// fn(); +// } else { +// stdout.write(key); +// } +// }); +// } // onRawSIGINT(() => { // console.log('raw'); process.exit(1); // }); From 5b1d966c6e7569658ff9f5920a4ab383ce954905 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 12:40:06 +0000 Subject: [PATCH 101/134] =?UTF-8?q?=F0=9F=91=B7=20ci(build):=20enhance=20s?= =?UTF-8?q?onar=20scanner=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - extract project key from properties file for dynamic setup - add projectBaseDir to sonar scanner command for accurate analysis --- .forgejo/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 882e541..a251a62 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -33,6 +33,7 @@ jobs: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | + PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r') docker run --rm \ -e SONAR_HOST_URL="$SONAR_HOST_URL" \ -e SONAR_TOKEN="$SONAR_TOKEN" \ @@ -41,7 +42,9 @@ jobs: sonarsource/sonar-scanner-cli \ sonar-scanner \ -Dsonar.host.url="$SONAR_HOST_URL" \ - -Dsonar.login="$SONAR_TOKEN" + -Dsonar.token="$SONAR_TOKEN" \ + -Dsonar.projectKey="${PROJECT_KEY:-free-games-claimer}" \ + -Dsonar.projectBaseDir=/usr/src docker: needs: [lint, sonar] From 56ca1f63d4a7894d79ad80d1736380d03ae732af Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 12:42:36 +0000 Subject: [PATCH 102/134] =?UTF-8?q?=F0=9F=91=B7=20ci(build):=20enhance=20s?= =?UTF-8?q?onar=20project=20key=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add SONAR_PROJECT_KEY environment variable for flexibility - fallback to default or file-based project key if not set --- .forgejo/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index a251a62..d2aa8e0 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -32,8 +32,13 @@ jobs: env: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} run: | - PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r') + PROJECT_KEY="${SONAR_PROJECT_KEY}" + if [ -z "$PROJECT_KEY" ] && [ -f sonar-project.properties ]; then + PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r') + fi + PROJECT_KEY=${PROJECT_KEY:-free-games-claimer} docker run --rm \ -e SONAR_HOST_URL="$SONAR_HOST_URL" \ -e SONAR_TOKEN="$SONAR_TOKEN" \ From 8626fa5a0f856c66c9cc5b16ad71ef1db80864e2 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 12:57:44 +0000 Subject: [PATCH 103/134] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(build):?= =?UTF-8?q?=20enhance=20sonar=20scanner=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - set default host url for sonar scanner to ensure consistency - add sonar.sources and sonar.scm.provider for improved analysis --- .forgejo/workflows/build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index d2aa8e0..501cf33 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -34,21 +34,24 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} run: | + HOST_URL=${SONAR_HOST_URL:-https://sonata.cyber77.de} PROJECT_KEY="${SONAR_PROJECT_KEY}" if [ -z "$PROJECT_KEY" ] && [ -f sonar-project.properties ]; then PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r') fi PROJECT_KEY=${PROJECT_KEY:-free-games-claimer} docker run --rm \ - -e SONAR_HOST_URL="$SONAR_HOST_URL" \ + -e SONAR_HOST_URL="$HOST_URL" \ -e SONAR_TOKEN="$SONAR_TOKEN" \ -v "$PWD:/usr/src" \ -w /usr/src \ sonarsource/sonar-scanner-cli \ sonar-scanner \ - -Dsonar.host.url="$SONAR_HOST_URL" \ + -Dsonar.host.url="$HOST_URL" \ -Dsonar.token="$SONAR_TOKEN" \ -Dsonar.projectKey="${PROJECT_KEY:-free-games-claimer}" \ + -Dsonar.sources=. \ + -Dsonar.scm.provider=git \ -Dsonar.projectBaseDir=/usr/src docker: From e11d40bdda5f2628229ec3456ac3faad77ecc1e8 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 13:01:14 +0000 Subject: [PATCH 104/134] =?UTF-8?q?=F0=9F=91=B7=20ci(build):=20enforce=20s?= =?UTF-8?q?onar=20host=20url=20secret=20presence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - update HOST_URL to require SONAR_HOST_URL secret for enhanced security configuration - improve error handling by ensuring critical secrets are set --- .forgejo/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 501cf33..b1cbd6d 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -34,7 +34,7 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} run: | - HOST_URL=${SONAR_HOST_URL:-https://sonata.cyber77.de} + HOST_URL=${SONAR_HOST_URL:?SONAR_HOST_URL secret not set} PROJECT_KEY="${SONAR_PROJECT_KEY}" if [ -z "$PROJECT_KEY" ] && [ -f sonar-project.properties ]; then PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r') From 608b6b87cdce748043cc17b36fdd1846f9a64972 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 13:02:52 +0000 Subject: [PATCH 105/134] =?UTF-8?q?=F0=9F=91=B7=20ci(build):=20simplify=20?= =?UTF-8?q?sonar=20project=20key=20retrieval?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - remove redundant conditional logic for project key extraction - enforce mandatory SONAR_PROJECT_KEY secret for consistency - change sonar.scm.provider to 'none' for improved configuration --- .forgejo/workflows/build.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index b1cbd6d..a2e5c5e 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -35,11 +35,7 @@ jobs: SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} run: | HOST_URL=${SONAR_HOST_URL:?SONAR_HOST_URL secret not set} - PROJECT_KEY="${SONAR_PROJECT_KEY}" - if [ -z "$PROJECT_KEY" ] && [ -f sonar-project.properties ]; then - PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r') - fi - PROJECT_KEY=${PROJECT_KEY:-free-games-claimer} + PROJECT_KEY=${SONAR_PROJECT_KEY:?SONAR_PROJECT_KEY secret not set} docker run --rm \ -e SONAR_HOST_URL="$HOST_URL" \ -e SONAR_TOKEN="$SONAR_TOKEN" \ @@ -49,9 +45,9 @@ jobs: sonar-scanner \ -Dsonar.host.url="$HOST_URL" \ -Dsonar.token="$SONAR_TOKEN" \ - -Dsonar.projectKey="${PROJECT_KEY:-free-games-claimer}" \ + -Dsonar.projectKey="$PROJECT_KEY" \ -Dsonar.sources=. \ - -Dsonar.scm.provider=git \ + -Dsonar.scm.provider=none \ -Dsonar.projectBaseDir=/usr/src docker: From 02972a04d46978da59adf6d9de6f1a9f65611d26 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 13:05:40 +0000 Subject: [PATCH 106/134] =?UTF-8?q?=F0=9F=90=9B=20fix(ci):=20handle=20miss?= =?UTF-8?q?ing=20sonar=20project=20key=20gracefully?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - set default empty value for PROJECT_KEY variable - add fallback to read sonar-project.properties if secret is not provided - exit with error if PROJECT_KEY is still unset after checks --- .forgejo/workflows/build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index a2e5c5e..636aff9 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -35,7 +35,14 @@ jobs: SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} run: | HOST_URL=${SONAR_HOST_URL:?SONAR_HOST_URL secret not set} - PROJECT_KEY=${SONAR_PROJECT_KEY:?SONAR_PROJECT_KEY secret not set} + PROJECT_KEY=${SONAR_PROJECT_KEY:-} + if [ -z "$PROJECT_KEY" ] && [ -f sonar-project.properties ]; then + PROJECT_KEY=$(grep -E '^sonar.projectKey=' sonar-project.properties | cut -d= -f2 | tr -d '\r') + fi + if [ -z "$PROJECT_KEY" ]; then + echo "SONAR_PROJECT_KEY secret not set and no sonar-project.properties entry found" >&2 + exit 1 + fi docker run --rm \ -e SONAR_HOST_URL="$HOST_URL" \ -e SONAR_TOKEN="$SONAR_TOKEN" \ @@ -44,7 +51,6 @@ jobs: sonarsource/sonar-scanner-cli \ sonar-scanner \ -Dsonar.host.url="$HOST_URL" \ - -Dsonar.token="$SONAR_TOKEN" \ -Dsonar.projectKey="$PROJECT_KEY" \ -Dsonar.sources=. \ -Dsonar.scm.provider=none \ From 405660e0f2def741f7029a61f23f3081234d6f52 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 13:06:49 +0000 Subject: [PATCH 107/134] =?UTF-8?q?=F0=9F=90=9B=20fix(ci):=20adjust=20sona?= =?UTF-8?q?r=20scm=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - change sonar.scm.provider to sonar.scm.disabled for compatibility --- .forgejo/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 636aff9..31abf10 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -53,7 +53,7 @@ jobs: -Dsonar.host.url="$HOST_URL" \ -Dsonar.projectKey="$PROJECT_KEY" \ -Dsonar.sources=. \ - -Dsonar.scm.provider=none \ + -Dsonar.scm.disabled=true \ -Dsonar.projectBaseDir=/usr/src docker: From 6c4eb948fc2a2d6976f2f318375092b59485a0fe Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 13:08:44 +0000 Subject: [PATCH 108/134] alles jut --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 248995e..a8fae1f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ Free Games Claimer (Fork) ========================== +[![Quality Gate Status](https://sonata.cyber77.de/api/project_badges/measure?project=free-games-claimer&metric=alert_status&token=sqb_99c83edf82a1331f0c649f8a5b698b4ec8f9a965)](https://sonata.cyber77.de/dashboard?id=free-games-claimer) + Automates claiming of free games for: - Amazon Luna Gaming / Luna claims (including external stores like GOG, Epic Games, Legacy Games ) - GOG giveaways From 25fb2d983812044cd341cd3441dc827b56aed46b Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 13:19:36 +0000 Subject: [PATCH 109/134] chore: remove github workflows and configs --- .github/FUNDING.yml | 13 ------- .github/dependabot.yml | 28 -------------- .github/renovate.json | 7 ---- .github/workflows/docker.yml | 72 ------------------------------------ .github/workflows/lint.yml | 36 ------------------ .github/workflows/sonar.yml | 42 --------------------- 6 files changed, 198 deletions(-) delete mode 100644 .github/FUNDING.yml delete mode 100644 .github/dependabot.yml delete mode 100644 .github/renovate.json delete mode 100644 .github/workflows/docker.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/sonar.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 9a0d965..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,13 +0,0 @@ -# These are supported funding model platforms - -github: vogler # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: fgc # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: vogler # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: vogler # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -custom: ["https://www.buymeacoffee.com/vogler", "https://paypal.me/voglerr"] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 1b47972..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,28 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - package-ecosystem: "npm" - directory: "/" - schedule: - interval: "weekly" - # commit-message: - # prefix: "npm" - # include: "scope" - - package-ecosystem: "docker" - directory: "/" - schedule: - interval: "weekly" - # commit-message: - # prefix: "docker" - # include: "scope" - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - # commit-message: - # prefix: "github-actions" - # include: "scope" diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index ecfd5ff..0000000 --- a/.github/renovate.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "enabled": false, - "extends": [ - "config:recommended" - ] -} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 8c12487..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Build and push Docker image (amd64, arm64 to hub.docker.com and ghcr.io) - -on: - workflow_dispatch: # allows manual trigger - push: # push on branch - branches: [main, dev] - paths: # ignore changes to .md files - - '**' - - '!*.md' - # - '!.github/**' - pull_request: # runs when opened/reopned or when the head branch is updated - -permissions: - contents: read - packages: write - -env: - BRANCH: ${{ github.head_ref || github.ref_name }} # head_ref/base_ref are only set for PRs, for branches ref_name will be used - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Set environment variables - run: | - echo "NOW=$(date -R)" >> $GITHUB_ENV # date -Iseconds; date +'%Y-%m-%dT%H:%M:%S' - if [[ "$BRANCH" == "main" ]]; then - echo "IMAGE_TAG=latest" >> $GITHUB_ENV - else - echo "IMAGE_TAG=$BRANCH" >> $GITHUB_ENV - fi - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - # if: ${{ secrets.DOCKERHUB_USERNAME != '' && secrets.DOCKERHUB_TOKEN != '' }} # does not work: Unrecognized named-value: 'secrets' - https://www.cloudtruth.com/blog/skipping-jobs-in-github-actions-when-secrets-are-unavailable-securely-inject-configuration-secrets-into-github - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} # actor is user that opened PR, was repository_owner before - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v6 - if: ${{ env.IMAGE_TAG != '' }} - with: - context: . - push: ${{ secrets.DOCKERHUB_USERNAME != '' }} - build-args: | - COMMIT=${{ github.sha }} - BRANCH=${{ env.BRANCH }} - NOW=${{ env.NOW }} - platforms: linux/amd64,linux/arm64 - tags: | - ${{ secrets.DOCKERHUB_USERNAME }}/free-games-claimer:${{env.IMAGE_TAG}} - ghcr.io/${{ github.actor }}/free-games-claimer:${{env.IMAGE_TAG}} - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 02ca3cb..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,36 +0,0 @@ -# https://github.com/marketplace/actions/super-linter#get-started -name: Lint - -on: # yamllint disable-line rule:truthy - push: null - pull_request: null - -permissions: {} - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - - permissions: - contents: read - packages: read - # To report GitHub Actions status checks - statuses: write - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - # super-linter needs the full git history to get the - # list of files that changed across commits - fetch-depth: 0 - - - name: Super-linter - uses: super-linter/super-linter/slim@v7.4.0 # x-release-please-version - # TODO need to create problem matchers for each linter? https://github.com/rhysd/actionlint/blob/v1.7.7/docs/usage.md#problem-matchers - env: - # To report GitHub Actions status checks - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # TODO automatically fix linting issues and commit them for PRs - # fix-lint-issues: # https://github.com/marketplace/actions/super-linter#github-actions-workflow-example-pull-request diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml deleted file mode 100644 index 29f81c6..0000000 --- a/.github/workflows/sonar.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Sonar - -on: - # Trigger analysis when pushing in main or pull requests, and when creating a pull request. - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] - -permissions: - contents: read - -jobs: - sonarcloud: - runs-on: ubuntu-latest - steps: - - - uses: actions/checkout@v4 - with: - # Disabling shallow clone is recommended for improving relevancy of reporting. Otherwise sonarcloud will show a warning. - fetch-depth: 0 - - - uses: actions/setup-node@v4 - with: - cache: 'npm' - - - name: Install dev dependencies which includde ESLint + plugins - run: npm install --only=dev - - - name: Run ESLint - continue-on-error: true - run: npx eslint . -f json -o eslint_report.json - - - name: Fix ESLint paths - run: sed -i 's+/home/runner/work/free-games-claimer/free-games-claimer+/github/workspace+g' eslint_report.json - - - name: SonarCloud Scan - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 2a4653062a9664ae836ce521a63d9efd319bda58 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 13:22:54 +0000 Subject: [PATCH 110/134] ci: make sonar scan pick up sources --- .forgejo/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 31abf10..f90d5ef 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -43,6 +43,11 @@ jobs: echo "SONAR_PROJECT_KEY secret not set and no sonar-project.properties entry found" >&2 exit 1 fi + echo "Sonar project key: $PROJECT_KEY" + echo "Listing workspace:" + ls -la + echo "Sample files:" + find . -maxdepth 2 -type f | head -n 20 docker run --rm \ -e SONAR_HOST_URL="$HOST_URL" \ -e SONAR_TOKEN="$SONAR_TOKEN" \ @@ -53,6 +58,7 @@ jobs: -Dsonar.host.url="$HOST_URL" \ -Dsonar.projectKey="$PROJECT_KEY" \ -Dsonar.sources=. \ + -Dsonar.inclusions=**/*.js \ -Dsonar.scm.disabled=true \ -Dsonar.projectBaseDir=/usr/src From 00b36a65b1a921c158357ff04a8193ac9cf36a44 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 13:25:17 +0000 Subject: [PATCH 111/134] ci: quote sonar inclusions to avoid shell glob --- .forgejo/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index f90d5ef..e37f5bf 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -58,7 +58,7 @@ jobs: -Dsonar.host.url="$HOST_URL" \ -Dsonar.projectKey="$PROJECT_KEY" \ -Dsonar.sources=. \ - -Dsonar.inclusions=**/*.js \ + "-Dsonar.inclusions=**/*.js" \ -Dsonar.scm.disabled=true \ -Dsonar.projectBaseDir=/usr/src From 94be980c955b44339e0898bebce31c0c6b50accb Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 14:22:07 +0000 Subject: [PATCH 112/134] ci: debug sonar scanner mount and remove extra inclusions --- .forgejo/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index e37f5bf..e229218 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -48,6 +48,8 @@ jobs: ls -la echo "Sample files:" find . -maxdepth 2 -type f | head -n 20 + echo "Check files inside scanner container:" + docker run --rm -v "$PWD:/usr/src" -w /usr/src alpine sh -c "ls -la /usr/src | head && find /usr/src -maxdepth 2 -type f -name '*.js' | head -n 20" docker run --rm \ -e SONAR_HOST_URL="$HOST_URL" \ -e SONAR_TOKEN="$SONAR_TOKEN" \ @@ -58,7 +60,6 @@ jobs: -Dsonar.host.url="$HOST_URL" \ -Dsonar.projectKey="$PROJECT_KEY" \ -Dsonar.sources=. \ - "-Dsonar.inclusions=**/*.js" \ -Dsonar.scm.disabled=true \ -Dsonar.projectBaseDir=/usr/src From b5e9111039af8d7968edd5d0d8d9d2cd476ec6d6 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 14:23:43 +0000 Subject: [PATCH 113/134] ci: mount workspace explicitly for sonar scanner --- .forgejo/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index e229218..e7abefc 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -34,6 +34,7 @@ jobs: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }} run: | + WORKDIR=${GITHUB_WORKSPACE:-$PWD} HOST_URL=${SONAR_HOST_URL:?SONAR_HOST_URL secret not set} PROJECT_KEY=${SONAR_PROJECT_KEY:-} if [ -z "$PROJECT_KEY" ] && [ -f sonar-project.properties ]; then @@ -49,19 +50,19 @@ jobs: echo "Sample files:" find . -maxdepth 2 -type f | head -n 20 echo "Check files inside scanner container:" - docker run --rm -v "$PWD:/usr/src" -w /usr/src alpine sh -c "ls -la /usr/src | head && find /usr/src -maxdepth 2 -type f -name '*.js' | head -n 20" + docker run --rm -v "$WORKDIR:/project" -w /project alpine sh -c "pwd; ls -la . | head && find . -maxdepth 2 -type f -name '*.js' | head -n 20" docker run --rm \ -e SONAR_HOST_URL="$HOST_URL" \ -e SONAR_TOKEN="$SONAR_TOKEN" \ - -v "$PWD:/usr/src" \ - -w /usr/src \ + -v "$WORKDIR:/project" \ + -w /project \ sonarsource/sonar-scanner-cli \ sonar-scanner \ -Dsonar.host.url="$HOST_URL" \ -Dsonar.projectKey="$PROJECT_KEY" \ -Dsonar.sources=. \ -Dsonar.scm.disabled=true \ - -Dsonar.projectBaseDir=/usr/src + -Dsonar.projectBaseDir=/project docker: needs: [lint, sonar] From f82c158a6b0b5d49046c7abfdb33572057e84ea2 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 14:27:12 +0000 Subject: [PATCH 114/134] ci: run sonar-scanner locally instead of docker --- .forgejo/workflows/build.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index e7abefc..5c14708 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -28,6 +28,12 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install Sonar Scanner (npm) + run: npm install -g sonarqube-scanner - name: SonarQube Scan env: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} @@ -49,20 +55,14 @@ jobs: ls -la echo "Sample files:" find . -maxdepth 2 -type f | head -n 20 - echo "Check files inside scanner container:" - docker run --rm -v "$WORKDIR:/project" -w /project alpine sh -c "pwd; ls -la . | head && find . -maxdepth 2 -type f -name '*.js' | head -n 20" - docker run --rm \ - -e SONAR_HOST_URL="$HOST_URL" \ - -e SONAR_TOKEN="$SONAR_TOKEN" \ - -v "$WORKDIR:/project" \ - -w /project \ - sonarsource/sonar-scanner-cli \ - sonar-scanner \ - -Dsonar.host.url="$HOST_URL" \ - -Dsonar.projectKey="$PROJECT_KEY" \ - -Dsonar.sources=. \ - -Dsonar.scm.disabled=true \ - -Dsonar.projectBaseDir=/project + echo "Running local sonar-scanner..." + sonar-scanner \ + -Dsonar.host.url="$HOST_URL" \ + -Dsonar.login="$SONAR_TOKEN" \ + -Dsonar.projectKey="$PROJECT_KEY" \ + -Dsonar.sources=. \ + -Dsonar.scm.disabled=true \ + -Dsonar.projectBaseDir="$WORKDIR" docker: needs: [lint, sonar] From e4b1f60a662895d98b70a929b04e41df81dd2ed1 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 14:31:17 +0000 Subject: [PATCH 115/134] chore: use execFile for git commands in version check --- src/version.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/version.js b/src/version.js index bfcd12a..cd054d8 100644 --- a/src/version.js +++ b/src/version.js @@ -1,15 +1,15 @@ // check if running the latest version import { log } from 'console'; -import { exec } from 'child_process'; +import { execFile } from 'child_process'; -const execp = cmd => new Promise((resolve, reject) => { - exec(cmd, (error, stdout, stderr) => { +const runGit = (...args) => new Promise((resolve, reject) => { + execFile('git', args, { cwd: process.cwd() }, (error, stdout, stderr) => { if (stderr) console.error(`stderr: ${stderr}`); // if (stdout) console.log(`stdout: ${stdout}`); if (error) { console.log(`error: ${error.message}`); - if (error.message.includes('command not found')) { + if (error.code === 'ENOENT' || error.message.includes('command not found')) { console.info('Install git to check for updates!'); } return reject(error); @@ -29,8 +29,8 @@ if (process.env.NOVNC_PORT) { date = process.env.NOW; } else { log('Not running inside Docker.'); - sha = await execp('git rev-parse HEAD'); - date = await execp('git show -s --format=%cD'); // same as format as `date -R` (RFC2822) + sha = await runGit('rev-parse', 'HEAD'); + date = await runGit('show', '-s', '--format=%cD'); // same as format as `date -R` (RFC2822) // date = await execp('git show -s --format=%ch'); // %ch is same as --date=human (short/relative) } From 9e2bc89ff23a65a7a7b4b1d6df8683c51e46e025 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 14:36:41 +0000 Subject: [PATCH 116/134] chore: clean up util notify/prompt lint findings --- src/util.js | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/util.js b/src/util.js index 8ba63a3..0709e21 100644 --- a/src/util.js +++ b/src/util.js @@ -19,7 +19,9 @@ export const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); export const datetimeUTC = (d = new Date()) => d.toISOString().replace('T', ' ').replace('Z', ''); // same as datetimeUTC() but for local timezone, e.g., UTC + 2h for the above in DE export const datetime = (d = new Date()) => datetimeUTC(new Date(d.getTime() - d.getTimezoneOffset() * 60000)); -export const filenamify = s => s.replaceAll(':', '.').replace(/[^a-z0-9 _\-.]/gi, '_'); // alternative: https://www.npmjs.com/package/filenamify - On Unix-like systems, / is reserved. On Windows, <>:"/\|?* along with trailing periods are reserved. +export const filenamify = s => s + .replaceAll(':', '.') + .replaceAll(/[^a-z0-9 _\-.]/gi, '_'); // alternative: https://www.npmjs.com/package/filenamify - On Unix-like systems, / is reserved. On Windows, <>:"/\|?* along with trailing periods are reserved. export const handleSIGINT = (context = null) => process.on('SIGINT', async () => { // e.g. when killed by Ctrl-C console.error('\nInterrupted by SIGINT. Exit!'); // Exception shows where the script was:\n'); // killed before catch in docker... @@ -90,24 +92,28 @@ export const stealth = async context => { // alternative inquirer is big (node_modules 29MB, enquirer 9.7MB, prompts 9.8MB, none 9.4MB) and slower // open issue: prevents handleSIGINT() to work if prompt is cancelled with Ctrl-C instead of Escape: https://github.com/enquirer/enquirer/issues/372 import Enquirer from 'enquirer'; const enquirer = new Enquirer(); -const timeoutPlugin = timeout => enquirer => { // cancel prompt after timeout ms - enquirer.on('prompt', prompt => { +const timeoutPlugin = defaultTimeout => enquirer => { // cancel prompt after timeout ms; can be disabled per prompt via options.timeout = 0 + const onPrompt = prompt => { + const effectiveTimeout = prompt.options?.timeout ?? defaultTimeout; + if (!effectiveTimeout) return; const t = setTimeout(() => { prompt.hint = () => 'timeout'; prompt.cancel(); - }, timeout); - prompt.on('submit', () => clearTimeout(t)); - prompt.on('cancel', () => clearTimeout(t)); - }); + }, effectiveTimeout); + const clear = () => clearTimeout(t); + prompt.on('submit', clear); + prompt.on('cancel', clear); + }; + enquirer.on('prompt', onPrompt); }; -enquirer.use(timeoutPlugin(cfg.login_timeout)); // TODO may not want to have this timeout for all prompts; better extend Prompt and add a timeout prompt option +enquirer.use(timeoutPlugin(cfg.login_timeout)); // single prompt that just returns the non-empty value instead of an object // @ts-ignore export const prompt = o => enquirer.prompt({ name: 'name', type: 'input', message: 'Enter value', ...o }).then(r => r.name).catch(() => {}); export const confirm = o => prompt({ type: 'confirm', message: 'Continue?', ...o }); // notifications via apprise CLI -import { execFile } from 'child_process'; +import { execFile } from 'node:child_process'; import { cfg } from './config.js'; export const notify = html => new Promise(resolve => { @@ -115,10 +121,9 @@ export const notify = html => new Promise(resolve => { if (cfg.debug) console.debug('notify: NOTIFY is not set!'); return resolve(); } - // const cmd = `apprise '${cfg.notify}' ${title} -i html -b '${html}'`; // this had problems if e.g. ' was used in arg; could have `npm i shell-escape`, but instead using safer execFile which takes args as array instead of exec which spawned a shell to execute the command const args = [cfg.notify, '-i', 'html', '-b', `'${html}'`]; - if (cfg.notify_title) args.push(...['-t', cfg.notify_title]); - if (cfg.debug) console.debug(`apprise ${args.map(a => `'${a}'`).join(' ')}`); // this also doesn't escape, but it's just for info + if (cfg.notify_title) args.push('-t', cfg.notify_title); + if (cfg.debug) console.debug(`apprise ${args.join(' ')}`); // this also doesn't escape, but it's just for info execFile('apprise', args, (error, stdout, stderr) => { if (error) { console.log(`error: ${error.message}`); From 69282c63d5f38b020e4de89404b381f44239fa35 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 14:54:14 +0000 Subject: [PATCH 117/134] Address Sonar warnings and harden runtime --- Dockerfile | 17 ++++++++++++++--- aliexpress.js | 2 +- prime-gaming.js | 4 +++- src/util.js | 5 +++-- src/version.js | 6 ++++-- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index a8c5e24..bd737ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,8 @@ RUN apt-get update \ /var/lib/apt/lists/* \ /var/tmp/* +RUN useradd -ms /bin/bash fgc + # RUN node --version # RUN npm --version @@ -61,10 +63,16 @@ RUN npm install # From 1.38 Playwright will no longer install browser automatically for playwright, but apparently still for playwright-firefox: https://github.com/microsoft/playwright/releases/tag/v1.38.0 # RUN npx playwright install firefox -COPY . . +# Only copy the files we actually need in the image to avoid accidentally adding secrets. +COPY *.js ./ +COPY eslint.config.js jsconfig.json sonar-project.properties ./ +COPY src ./src +COPY test ./test +COPY docker-entrypoint.sh ./ # Shell scripts need Linux line endings. On Windows, git might be configured to check out dos/CRLF line endings, so we convert them for those people in case they want to build the image. They could also use --config core.autocrlf=input RUN dos2unix ./*.sh && chmod +x ./*.sh +RUN chown -R fgc:fgc /fgc COPY docker-entrypoint.sh /usr/local/bin/ ARG COMMIT="" @@ -87,8 +95,9 @@ LABEL org.opencontainers.image.title="free-games-claimer" \ # Configure VNC via environment variables: ENV VNC_PORT 5900 ENV NOVNC_PORT 6080 -EXPOSE 5900 -EXPOSE 6080 +# Ports are not exposed by default; publish explicitly with -p when you really need GUI access. +# EXPOSE 5900 +# EXPOSE 6080 # Configure Xvfb via environment variables: ENV WIDTH 1920 @@ -98,6 +107,8 @@ ENV DEPTH 24 # Show browser instead of running headless ENV SHOW 1 +USER fgc + # Script to setup display server & VNC is always executed. ENTRYPOINT ["docker-entrypoint.sh"] # Default command to run. This is replaced by appending own command, e.g. `docker run ... node prime-gaming` to only run this script. diff --git a/aliexpress.js b/aliexpress.js index 6d654d3..f10dc46 100644 --- a/aliexpress.js +++ b/aliexpress.js @@ -40,7 +40,7 @@ const auth = async url => { console.log('auth', url); await page.goto(url, { waitUntil: 'domcontentloaded' }); // redirects to https://login.aliexpress.com/?return_url=https%3A%2F%2Fwww.aliexpress.com%2Fp%2Fcoin-pc-index%2Findex.html - await Promise.any([page.waitForURL(/.*login\.aliexpress.com.*/).then(async () => { + await Promise.any([page.waitForURL(url => url.includes('login.aliexpress.com')).then(async () => { // manual login console.error('Not logged in! Will wait for 120s for you to login...'); // await page.waitForTimeout(120*1000); diff --git a/prime-gaming.js b/prime-gaming.js index 0c982bd..00e8466 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -385,7 +385,9 @@ try { const detailLoc = page.locator('[data-a-target="DescriptionItemDetails"], [data-testid="DescriptionItemDetails"]'); if (await detailLoc.count()) { const item_text = await detailLoc.first().innerText(); - store = item_text.toLowerCase().replace(/.* on /, '').slice(0, -1); + const lower = item_text.toLowerCase(); + const onPos = lower.lastIndexOf(' on '); + if (onPos >= 0) store = lower.slice(onPos + 4).replace(/[.!]$/, ''); } else if (url.includes('/claims/')) { const slug = url.split('/claims/')[1]?.split('/')[0] || ''; if (slug.includes('gog')) store = 'gog.com'; diff --git a/src/util.js b/src/util.js index 0709e21..df6a29a 100644 --- a/src/util.js +++ b/src/util.js @@ -121,10 +121,11 @@ export const notify = html => new Promise(resolve => { if (cfg.debug) console.debug('notify: NOTIFY is not set!'); return resolve(); } + const appriseBin = process.env.APPRISE_BIN || '/usr/local/bin/apprise'; const args = [cfg.notify, '-i', 'html', '-b', `'${html}'`]; if (cfg.notify_title) args.push('-t', cfg.notify_title); - if (cfg.debug) console.debug(`apprise ${args.join(' ')}`); // this also doesn't escape, but it's just for info - execFile('apprise', args, (error, stdout, stderr) => { + if (cfg.debug) console.debug(`${appriseBin} ${args.join(' ')}`); // this also doesn't escape, but it's just for info + execFile(appriseBin, args, (error, stdout, stderr) => { if (error) { console.log(`error: ${error.message}`); if (error.message.includes('command not found')) { diff --git a/src/version.js b/src/version.js index cd054d8..b5cf838 100644 --- a/src/version.js +++ b/src/version.js @@ -1,10 +1,12 @@ // check if running the latest version import { log } from 'console'; -import { execFile } from 'child_process'; +import { execFile } from 'node:child_process'; + +const gitBin = process.env.GIT_BIN || '/usr/bin/git'; const runGit = (...args) => new Promise((resolve, reject) => { - execFile('git', args, { cwd: process.cwd() }, (error, stdout, stderr) => { + execFile(gitBin, args, { cwd: process.cwd() }, (error, stdout, stderr) => { if (stderr) console.error(`stderr: ${stderr}`); // if (stdout) console.log(`stdout: ${stdout}`); if (error) { From 37ffd0954526b204735a150f637d7d2732c94f88 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 14:56:50 +0000 Subject: [PATCH 118/134] Refactor prompt timeout plugin to reduce nesting --- src/util.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/util.js b/src/util.js index df6a29a..dab047f 100644 --- a/src/util.js +++ b/src/util.js @@ -92,19 +92,22 @@ export const stealth = async context => { // alternative inquirer is big (node_modules 29MB, enquirer 9.7MB, prompts 9.8MB, none 9.4MB) and slower // open issue: prevents handleSIGINT() to work if prompt is cancelled with Ctrl-C instead of Escape: https://github.com/enquirer/enquirer/issues/372 import Enquirer from 'enquirer'; const enquirer = new Enquirer(); -const timeoutPlugin = defaultTimeout => enquirer => { // cancel prompt after timeout ms; can be disabled per prompt via options.timeout = 0 - const onPrompt = prompt => { - const effectiveTimeout = prompt.options?.timeout ?? defaultTimeout; - if (!effectiveTimeout) return; - const t = setTimeout(() => { - prompt.hint = () => 'timeout'; - prompt.cancel(); - }, effectiveTimeout); - const clear = () => clearTimeout(t); - prompt.on('submit', clear); - prompt.on('cancel', clear); - }; - enquirer.on('prompt', onPrompt); +const timeoutHint = () => 'timeout'; +const cancelPromptWithHint = prompt => { + prompt.hint = timeoutHint; + prompt.cancel(); +}; +const applyPromptTimeout = (prompt, timeout) => { + if (!timeout) return; + const timer = setTimeout(cancelPromptWithHint, timeout, prompt); + const clearTimer = () => clearTimeout(timer); + prompt.on('submit', clearTimer); + prompt.on('cancel', clearTimer); +}; +// cancel prompt after timeout ms; can be disabled per prompt via options.timeout = 0 +const timeoutPlugin = defaultTimeout => enquirerInstance => { + const onPrompt = prompt => applyPromptTimeout(prompt, prompt.options?.timeout ?? defaultTimeout); + enquirerInstance.on('prompt', onPrompt); }; enquirer.use(timeoutPlugin(cfg.login_timeout)); // single prompt that just returns the non-empty value instead of an object From 405e80185140928bdecf2eb477876a7595cf8a5a Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 15:39:11 +0000 Subject: [PATCH 119/134] Clean Sonar findings: merge RUNs, drop commented code, update node imports --- Dockerfile | 10 ++++---- aliexpress.js | 17 -------------- epic-games.js | 4 ++-- src/migrate.js | 2 +- src/version.js | 18 ++------------- test/notify.js | 61 ++++++++++++++++++++++++++----------------------- unrealengine.js | 4 ++-- 7 files changed, 44 insertions(+), 72 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd737ae..d5f53da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,13 +45,12 @@ RUN apt-get update \ /var/lib/apt/lists/* \ /var/tmp/* -RUN useradd -ms /bin/bash fgc - # RUN node --version # RUN npm --version -RUN ln -s /usr/share/novnc/vnc_auto.html /usr/share/novnc/index.html -RUN pip install apprise +RUN useradd -ms /bin/bash fgc \ + && ln -s /usr/share/novnc/vnc_auto.html /usr/share/novnc/index.html \ + && pip install apprise WORKDIR /fgc COPY package*.json ./ @@ -71,8 +70,7 @@ COPY test ./test COPY docker-entrypoint.sh ./ # Shell scripts need Linux line endings. On Windows, git might be configured to check out dos/CRLF line endings, so we convert them for those people in case they want to build the image. They could also use --config core.autocrlf=input -RUN dos2unix ./*.sh && chmod +x ./*.sh -RUN chown -R fgc:fgc /fgc +RUN dos2unix ./*.sh && chmod +x ./*.sh && chown -R fgc:fgc /fgc COPY docker-entrypoint.sh /usr/local/bin/ ARG COMMIT="" diff --git a/aliexpress.js b/aliexpress.js index f10dc46..a28cf8a 100644 --- a/aliexpress.js +++ b/aliexpress.js @@ -14,7 +14,6 @@ const { fingerprint, headers } = new FingerprintGenerator().getFingerprint({ const context = await firefox.launchPersistentContext(cfg.dir.browser, { headless: cfg.headless, - // viewport: { width: cfg.width, height: cfg.height }, locale: 'en-US', // ignore OS locale to be sure to have english text for locators -> done via /en in URL recordVideo: cfg.record ? { dir: 'data/record/', size: { width: cfg.width, height: cfg.height } } : undefined, // will record a .webm video for each page navigated; without size, video would be scaled down to fit 800x800 recordHar: cfg.record ? { path: `data/record/aliexpress-${filenamify(datetime())}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools @@ -29,7 +28,6 @@ const context = await firefox.launchPersistentContext(cfg.dir.browser, { }, }); handleSIGINT(context); -// await stealth(context); await new FingerprintInjector().attachFingerprintToPlaywright(context, { fingerprint, headers }); context.setDefaultTimeout(cfg.debug ? 0 : cfg.timeout); @@ -41,10 +39,7 @@ const auth = async url => { await page.goto(url, { waitUntil: 'domcontentloaded' }); // redirects to https://login.aliexpress.com/?return_url=https%3A%2F%2Fwww.aliexpress.com%2Fp%2Fcoin-pc-index%2Findex.html await Promise.any([page.waitForURL(url => url.includes('login.aliexpress.com')).then(async () => { - // manual login console.error('Not logged in! Will wait for 120s for you to login...'); - // await page.waitForTimeout(120*1000); - // or try automated page.locator('span:has-text("Switch account")').click().catch(() => {}); // sometimes no longer logged in, but previous user/email is pre-selected -> in this case we want to go back to the classic login const login = page.locator('.login-container'); const email = cfg.ae_email || await prompt({ message: 'Enter email' }); @@ -60,12 +55,8 @@ const auth = async url => { const error = login.locator('.error-text'); error.waitFor().then(async () => console.error('Login error:', await error.innerText())); await page.waitForURL(url); - // await page.addLocatorHandler(page.getByRole('button', { name: 'Accept cookies' }), btn => btn.click()); page.getByRole('button', { name: 'Accept cookies' }).click().then(() => console.log('Accepted cookies')).catch(() => { }); }), page.locator('#nav-user-account').waitFor()]).catch(() => {}); - - // await page.locator('#nav-user-account').hover(); - // console.log('Logged in as:', await page.locator('.welcome-name').innerText()); }; // copied URLs from AliExpress app on tablet which has menu for the used webview @@ -82,7 +73,6 @@ const urls = { /* eslint-disable no-unused-vars */ const coins = async () => { - // await auth(urls.coins); await Promise.any([page.locator('.checkin-button').click(), page.locator('.addcoin').waitFor()]); console.log('Coins:', await page.locator('.mycoin-content-right-money').innerText()); console.log('Streak:', await page.locator('.title-box').innerText()); @@ -107,20 +97,13 @@ const merge = async () => { /* eslint-enable no-unused-vars */ try { - // await coins(); await [ - // coins, - // grow, - // gogo, - // euro, merge, ].reduce((a, f) => a.then(async () => { await auth(urls[f.name]); await f(); console.log(); }), Promise.resolve()); - - // await page.pause(); } catch (error) { process.exitCode ||= 1; console.error('--- Exception:'); diff --git a/epic-games.js b/epic-games.js index 4db1e75..b12b35a 100644 --- a/epic-games.js +++ b/epic-games.js @@ -1,8 +1,8 @@ import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdated playwright-extra import { authenticator } from 'otplib'; import chalk from 'chalk'; -import path from 'path'; -import { existsSync, writeFileSync, appendFileSync } from 'fs'; +import path from 'node:path'; +import { existsSync, writeFileSync, appendFileSync } from 'node:fs'; import { resolve, jsonDb, datetime, stealth, filenamify, prompt, notify, html_game_list, handleSIGINT } from './src/util.js'; import { cfg } from './src/config.js'; diff --git a/src/migrate.js b/src/migrate.js index b2db945..80abc9d 100644 --- a/src/migrate.js +++ b/src/migrate.js @@ -1,4 +1,4 @@ -import { existsSync } from 'fs'; +import { existsSync } from 'node:fs'; import { Low } from 'lowdb'; import { JSONFile } from 'lowdb/node'; import { datetime } from './util.js'; diff --git a/src/version.js b/src/version.js index b5cf838..5f61351 100644 --- a/src/version.js +++ b/src/version.js @@ -1,6 +1,4 @@ -// check if running the latest version - -import { log } from 'console'; +import { log } from 'node:console'; import { execFile } from 'node:child_process'; const gitBin = process.env.GIT_BIN || '/usr/bin/git'; @@ -20,10 +18,7 @@ const runGit = (...args) => new Promise((resolve, reject) => { }); }); -// const git_main = () => readFileSync('.git/refs/heads/main').toString().trim(); - let sha, date; -// if (existsSync('/.dockerenv')) { // did not work if (process.env.NOVNC_PORT) { log('Running inside Docker.'); ['COMMIT', 'BRANCH', 'NOW'].forEach(v => log(` ${v}:`, process.env[v])); @@ -33,22 +28,13 @@ if (process.env.NOVNC_PORT) { log('Not running inside Docker.'); sha = await runGit('rev-parse', 'HEAD'); date = await runGit('show', '-s', '--format=%cD'); // same as format as `date -R` (RFC2822) - // date = await execp('git show -s --format=%ch'); // %ch is same as --date=human (short/relative) } -const gh = await (await fetch('https://api.github.com/repos/vogler/free-games-claimer/commits/main', { - // headers: { accept: 'application/vnd.github.VERSION.sha' } -})).json(); -// log(gh); +const gh = await (await fetch('https://api.github.com/repos/vogler/free-games-claimer/commits/main')).json(); log('Local commit:', sha, new Date(date)); log('Online commit:', gh.sha, new Date(gh.commit.committer.date)); -// git describe --all --long --dirty -// --> heads/main-0-gdee47d2-dirty -// git describe --tags --long --dirty -// --> v1.7-35-gdee47d2-dirty - if (sha == gh.sha) { log('Running the latest version!'); } else { diff --git a/test/notify.js b/test/notify.js index 6d89086..b97994d 100644 --- a/test/notify.js +++ b/test/notify.js @@ -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:
${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: `redeem H97S6FB38FA6D09DEA on gog.com`, url: URL_CLAIM }, + { title: 'Beat Cop', status: `redeem BMKM8558EC55F7B38F on gog.com`, url: URL_CLAIM }, + { title: 'Dishonored 2', status: `redeem 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: `redeem H97S6FB38FA6D09DEA on gog.com`, url: URL_CLAIM }, - { title: 'Beat Cop', status: `redeem BMKM8558EC55F7B38F on gog.com`, url: URL_CLAIM }, - { title: 'Dishonored 2', status: `redeem NNEK0987AB20DFBF8F on gog.com`, url: URL_CLAIM }, - ]; - notify(`prime-gaming:
${html_game_list(notify_games)}`); -} - -if (false) { - await delay(1000); - const notify_games = [ - { title: 'Haven Park', status: 'claimed', url: URL_CLAIM }, - ]; - notify(`gog:
${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}:
${html_game_list(scenario.games)}`); } diff --git a/unrealengine.js b/unrealengine.js index 2bb8ee9..4f4de4b 100644 --- a/unrealengine.js +++ b/unrealengine.js @@ -3,8 +3,8 @@ import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdated playwright-extra import { authenticator } from 'otplib'; -import path from 'path'; -import { writeFileSync } from 'fs'; +import path from 'node:path'; +import { writeFileSync } from 'node:fs'; import { resolve, jsonDb, datetime, stealth, filenamify, prompt, notify, html_game_list, handleSIGINT } from './src/util.js'; import { cfg } from './src/config.js'; From 397871b0122cb3e7817523e61d4365ac8893a29f Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 15:47:28 +0000 Subject: [PATCH 120/134] Further clean Sonar: merge base RUN, strip comments, node imports --- Dockerfile | 10 ++-------- gog.js | 5 ----- src/version.js | 1 - steam-games.js | 3 --- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index d5f53da..a3dcbc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,6 @@ RUN apt-get update \ novnc websockify \ dos2unix \ python3-pip \ - # && npx playwright install-deps firefox \ - && apt-get install --no-install-recommends -y \ libgtk-3-0 \ libasound2 \ libxcomposite1 \ @@ -43,12 +41,8 @@ RUN apt-get update \ /usr/share/doc/* \ /var/cache/* \ /var/lib/apt/lists/* \ - /var/tmp/* - -# RUN node --version -# RUN npm --version - -RUN useradd -ms /bin/bash fgc \ + /var/tmp/* \ + && useradd -ms /bin/bash fgc \ && ln -s /usr/share/novnc/vnc_auto.html /usr/share/novnc/index.html \ && pip install apprise diff --git a/gog.js b/gog.js index 6269fc2..67da726 100644 --- a/gog.js +++ b/gog.js @@ -32,7 +32,6 @@ if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it -// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent)); const notify_games = []; let user; @@ -42,7 +41,6 @@ try { await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); // default 'load' takes forever - // page.click('#CybotCookiebotDialogBodyLevelButtonLevelOptinAllowAll').catch(_ => { }); // does not work reliably, solved by setting CookieConsent above const signIn = page.locator('a:has-text("Sign in")').first(); await Promise.any([signIn.waitFor(), page.waitForSelector('#menuUsername')]); while (await signIn.isVisible()) { @@ -71,12 +69,9 @@ try { await iframe.locator('#second_step_authentication_send').click(); await page.waitForTimeout(1000); // TODO still needed with wait for username below? }).catch(_ => { }); - // iframe.locator('iframe[title=reCAPTCHA]').waitFor().then(() => { - // iframe.locator('.g-recaptcha').waitFor().then(() => { iframe.locator('text=Invalid captcha').waitFor().then(() => { console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); notify('gog: got captcha during login. Please check.'); - // TODO solve reCAPTCHA? }).catch(_ => { }); await page.waitForSelector('#menuUsername'); } else { diff --git a/src/version.js b/src/version.js index 5f61351..f838d8f 100644 --- a/src/version.js +++ b/src/version.js @@ -6,7 +6,6 @@ const gitBin = process.env.GIT_BIN || '/usr/bin/git'; const runGit = (...args) => new Promise((resolve, reject) => { execFile(gitBin, args, { cwd: process.cwd() }, (error, stdout, stderr) => { if (stderr) console.error(`stderr: ${stderr}`); - // if (stdout) console.log(`stdout: ${stdout}`); if (error) { console.log(`error: ${error.message}`); if (error.code === 'ENOENT' || error.message.includes('command not found')) { diff --git a/steam-games.js b/steam-games.js index ed54253..b23fd31 100644 --- a/steam-games.js +++ b/steam-games.js @@ -18,7 +18,6 @@ const { fingerprint, headers } = new FingerprintGenerator().getFingerprint({ const context = await firefox.launchPersistentContext(cfg.dir.browser, { headless: cfg.headless, - // viewport: { width: cfg.width, height: cfg.height }, locale: 'en-US', // ignore OS locale to be sure to have english text for locators -> done via /en in URL userAgent: fingerprint.navigator.userAgent, viewport: { @@ -29,7 +28,6 @@ const context = await firefox.launchPersistentContext(cfg.dir.browser, { 'accept-language': headers['accept-language'], }, }); -// await stealth(context); await new FingerprintInjector().attachFingerprintToPlaywright(context, { fingerprint, headers }); context.setDefaultTimeout(cfg.debug ? 0 : cfg.timeout); @@ -61,7 +59,6 @@ try { db.data[title] = stat; } - // await page.pause(); } catch (error) { process.exitCode ||= 1; console.error('--- Exception:'); From 5f919039ab00328c2e02a51f1972b11a42591692 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 16:08:59 +0000 Subject: [PATCH 121/134] Clean Sonar issues in store scripts --- epic-games.js | 151 ++++++++++++++++++------------------ gog.js | 39 +++++----- prime-gaming.js | 69 ++++++++-------- src/migrate.js | 1 - test/sigint-enquirer-raw.js | 25 +----- unrealengine.js | 74 +++++++++--------- 6 files changed, 172 insertions(+), 187 deletions(-) diff --git a/epic-games.js b/epic-games.js index b12b35a..8253881 100644 --- a/epic-games.js +++ b/epic-games.js @@ -29,17 +29,13 @@ if (existsSync(browserPrefs)) { const context = await firefox.launchPersistentContext(cfg.dir.browser, { headless: cfg.headless, viewport: { width: cfg.width, height: cfg.height }, - userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0', // see replace of Headless in util.newStealthContext. TODO Windows UA enough to avoid 'device not supported'? update if browser is updated? - // userAgent firefox (macOS): Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0 - // userAgent firefox (docker): Mozilla/5.0 (X11; Linux aarch64; rv:109.0) Gecko/20100101 Firefox/115.0 + userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0', // Windows UA avoids "device not supported"; update when browser version changes locale: 'en-US', // ignore OS locale to be sure to have english text for locators recordVideo: cfg.record ? { dir: 'data/record/', size: { width: cfg.width, height: cfg.height } } : undefined, // will record a .webm video for each page navigated; without size, video would be scaled down to fit 800x800 recordHar: cfg.record ? { path: `data/record/eg-${filenamify(datetime())}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools handleSIGINT: false, // have to handle ourselves and call context.close(), otherwise recordings from above won't be saved // user settings for firefox have to be put in $BROWSER_DIR/user.js - args: [ // https://wiki.mozilla.org/Firefox/CommandLineOptions - // '-kiosk', - ], + args: [], // https://wiki.mozilla.org/Firefox/CommandLineOptions }); handleSIGINT(context); @@ -50,7 +46,7 @@ await stealth(context); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist -await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it +await page.setViewportSize({ width: cfg.width, height: cfg.height }); // workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it // some debug info about the page (screen dimensions, user agent, platform) // eslint-disable-next-line no-undef @@ -76,8 +72,6 @@ try { if (cfg.time) console.timeEnd('startup'); if (cfg.time) console.time('login'); - // page.click('button:has-text("Accept All Cookies")').catch(_ => { }); // Not needed anymore since we set the cookie above. Clicking this did not always work since the message was animated in too slowly. - while (await page.locator('egs-navigation').getAttribute('isloggedin') != 'true') { console.error('Not signed in anymore. Please login in the browser or here in the terminal.'); if (cfg.novnc_port) console.info(`Open http://localhost:${cfg.novnc_port} to login inside the docker container.`); @@ -98,16 +92,20 @@ try { const email = cfg.eg_email || await prompt({ message: 'Enter email' }); if (!email) await notifyBrowserLogin(); else { - // await page.click('text=Sign in with Epic Games'); - page.waitForSelector('.h_captcha_challenge iframe').then(async () => { - console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); - await notify('epic-games: got captcha during login. Please check.'); - }).catch(_ => { }); - page.waitForSelector('p:has-text("Incorrect response.")').then(async () => { - console.error('Incorrect response for captcha!'); - }).catch(_ => { }); + void (async () => { + try { + await page.waitForSelector('.h_captcha_challenge iframe', { timeout: 15000 }); + console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); + await notify('epic-games: got captcha during login. Please check.'); + } catch {} + })(); + void (async () => { + try { + await page.waitForSelector('p:has-text("Incorrect response.")', { timeout: 15000 }); + console.error('Incorrect response for captcha!'); + } catch {} + })(); await page.fill('#email', email); - // await page.click('button[type="submit"]'); login was split in two steps for some time, now email and password are on the same form again const password = email && (cfg.eg_password || await prompt({ type: 'password', message: 'Enter password' })); if (!password) await notifyBrowserLogin(); else { @@ -115,18 +113,22 @@ try { await page.click('button[type="submit"]'); } const error = page.locator('#form-error-message'); - error.waitFor().then(async () => { - console.error('Login error:', await error.innerText()); - console.log('Please login in the browser!'); - }).catch(_ => { }); - // handle MFA, but don't await it - page.waitForURL('**/id/login/mfa**').then(async () => { - console.log('Enter the security code to continue - This appears to be a new device, browser or location. A security code has been sent to your email address at ...'); - // TODO locator for text (email or app?) - const otp = cfg.eg_otpkey && authenticator.generate(cfg.eg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them - await page.locator('input[name="code-input-0"]').pressSequentially(otp.toString()); - await page.click('button[type="submit"]'); - }).catch(_ => { }); + void (async () => { + try { + await error.waitFor({ timeout: 15000 }); + console.error('Login error:', await error.innerText()); + console.log('Please login in the browser!'); + } catch {} + })(); + void (async () => { + try { + await page.waitForURL('**/id/login/mfa**', { timeout: cfg.login_timeout }); + console.log('Enter the security code to continue - This appears to be a new device, browser or location. A security code has been sent to your email address at ...'); + const otp = cfg.eg_otpkey && authenticator.generate(cfg.eg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them + await page.locator('input[name="code-input-0"]').pressSequentially(otp.toString()); + await page.click('button[type="submit"]'); + } catch {} + })(); } await page.waitForURL(URL_CLAIM); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); @@ -141,7 +143,7 @@ try { const game_loc = page.locator('a:has(span:text-is("Free Now"))'); await game_loc.last().waitFor().catch(_ => { // rarely there are no free games available -> catch Timeout - // TODO would be better to wait for alternative like 'coming soon' instead of waiting for timeout + // waiting for timeout; alternative would be waiting for "coming soon" // see https://github.com/vogler/free-games-claimer/issues/210#issuecomment-1727420943 console.error('Seems like currently there are no free games available in your region...'); // urls below should then be an empty list @@ -208,36 +210,31 @@ try { console.log(' Requires base game! Nothing to claim.'); notify_game.status = 'requires base game'; db.data[user][game_id].status ||= 'failed:requires-base-game'; - // TODO claim base game if it is free + // if base game is free, add to queue as well const baseUrl = 'https://store.epicgames.com' + await page.locator('a:has-text("Overview")').getAttribute('href'); console.log(' Base game:', baseUrl); // await page.click('a:has-text("Overview")'); - // TODO handle this via function call for base game above since this will never terminate if DRYRUN=1 + // re-add original add-on to queue after base game urls.push(baseUrl); // add base game to the list of games to claim urls.push(url); // add add-on itself again } else { // GET console.log(' Not in library yet! Click', btnText); await purchaseBtn.click({ delay: 11 }); // got stuck here without delay (or mouse move), see #75, 1ms was also enough - // click Continue if 'Device not supported. This product is not compatible with your current device.' - avoided by Windows userAgent? - page.click('button:has-text("Continue")').catch(_ => { }); // needed since change from Chromium to Firefox? - - // click 'Yes, buy now' if 'This edition contains something you already have. Still interested?' - page.click('button:has-text("Yes, buy now")').catch(_ => { }); - // Accept End User License Agreement (only needed once) - page.locator(':has-text("end user license agreement")').waitFor().then(async () => { - console.log(' Accept End User License Agreement (only needed once)'); - console.log(page.innerHTML); - console.log('Please report the HTML above here: https://github.com/vogler/free-games-claimer/issues/371'); - await page.locator('input#agree').check(); // TODO Bundle: got stuck here; likely unrelated to bundle and locator just changed: https://github.com/vogler/free-games-claimer/issues/371 - await page.locator('button:has-text("Accept")').click(); - }).catch(_ => { }); + void (async () => { + try { + await page.locator(':has-text("end user license agreement")').waitFor({ timeout: 10000 }); + console.log(' Accept End User License Agreement (only needed once)'); + await page.locator('input#agree').check(); + await page.locator('button:has-text("Accept")').click(); + } catch {} + })(); // it then creates an iframe for the purchase - await page.waitForSelector('#webPurchaseContainer iframe'); // TODO needed? + await page.waitForSelector('#webPurchaseContainer iframe'); const iframe = page.frameLocator('#webPurchaseContainer iframe'); - // skip game if unavailable in region, https://github.com/vogler/free-games-claimer/issues/46 TODO check games for account's region + // skip game if unavailable in region, https://github.com/vogler/free-games-claimer/issues/46 if (await iframe.locator(':has-text("unavailable in your region")').count() > 0) { console.error(' This product is unavailable in your region!'); db.data[user][game_id].status = notify_game.status = 'unavailable-in-region'; @@ -245,14 +242,17 @@ try { continue; } - iframe.locator('.payment-pin-code').waitFor().then(async () => { - if (!cfg.eg_parentalpin) { - console.error(' EG_PARENTALPIN not set. Need to enter Parental Control PIN manually.'); - notify('epic-games: EG_PARENTALPIN not set. Need to enter Parental Control PIN manually.'); - } - await iframe.locator('input.payment-pin-code__input').first().pressSequentially(cfg.eg_parentalpin); - await iframe.locator('button:has-text("Continue")').click({ delay: 11 }); - }).catch(_ => { }); + void (async () => { + try { + await iframe.locator('.payment-pin-code').waitFor({ timeout: 10000 }); + if (!cfg.eg_parentalpin) { + console.error(' EG_PARENTALPIN not set. Need to enter Parental Control PIN manually.'); + notify('epic-games: EG_PARENTALPIN not set. Need to enter Parental Control PIN manually.'); + } + await iframe.locator('input.payment-pin-code__input').first().pressSequentially(cfg.eg_parentalpin); + await iframe.locator('button:has-text("Continue")').click({ delay: 11 }); + } catch {} + })(); if (cfg.debug) await page.pause(); if (cfg.dryrun) { @@ -267,27 +267,30 @@ try { // I Agree button is only shown for EU accounts! https://github.com/vogler/free-games-claimer/pull/7#issuecomment-1038964872 const btnAgree = iframe.locator('button:has-text("I Accept")'); - btnAgree.waitFor().then(() => btnAgree.click()).catch(_ => { }); // EU: wait for and click 'I Agree' + void (async () => { + try { + await btnAgree.waitFor({ timeout: 10000 }); + await btnAgree.click(); + } catch {} + })(); // EU: wait for and click 'I Agree' try { // context.setDefaultTimeout(100 * 1000); // give time to solve captcha, iframe goes blank after 60s? const captcha = iframe.locator('#h_captcha_challenge_checkout_free_prod iframe'); - captcha.waitFor().then(async () => { // don't await, since element may not be shown - // console.info(' Got hcaptcha challenge! NopeCHA extension will likely solve it.') - console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); - // await notify(`epic-games: got captcha challenge right before claim of ${title}. Use VNC to solve it manually.`); // TODO not all apprise services understand HTML: https://github.com/vogler/free-games-claimer/pull/417 - await notify(`epic-games: got captcha challenge for.\nGame link: ${url}`); - // TODO could even create purchase URL, see https://github.com/vogler/free-games-claimer/pull/130 - // await page.waitForTimeout(2000); - // const p = path.resolve(cfg.dir.screenshots, 'epic-games', 'captcha', `${filenamify(datetime())}.png`); - // await captcha.screenshot({ path: p }); - // console.info(' Saved a screenshot of hcaptcha challenge to', p); - // console.error(' Got hcaptcha challenge. To avoid it, get a link from https://www.hcaptcha.com/accessibility'); // TODO save this link in config and visit it daily to set accessibility cookie to avoid captcha challenge? - }).catch(_ => { }); // may time out if not shown - iframe.locator('.payment__errors:has-text("Failed to challenge captcha, please try again later.")').waitFor().then(async () => { - console.error(' Failed to challenge captcha, please try again later.'); - await notify('epic-games: failed to challenge captcha. Please check.'); - }).catch(_ => { }); - await page.locator('text=Thanks for your order!').waitFor({ state: 'attached' }); // TODO Bundle: got stuck here, but normal game now as well + void (async () => { + try { + await captcha.waitFor({ timeout: 10000 }); + console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); + await notify(`epic-games: got captcha challenge for.\nGame link: ${url}`); + } catch {} + })(); // may time out if not shown + void (async () => { + try { + await iframe.locator('.payment__errors:has-text("Failed to challenge captcha, please try again later.")').waitFor({ timeout: 10000 }); + console.error(' Failed to challenge captcha, please try again later.'); + await notify('epic-games: failed to challenge captcha. Please check.'); + } catch {} + })(); + await page.locator('text=Thanks for your order!').waitFor({ state: 'attached' }); db.data[user][game_id].status = 'claimed'; db.data[user][game_id].time = datetime(); // claimed time overwrites failed/dryrun time console.log(' Claimed successfully!'); diff --git a/gog.js b/gog.js index 67da726..9b8b2b8 100644 --- a/gog.js +++ b/gog.js @@ -31,7 +31,7 @@ handleSIGINT(context); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist -await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it +await page.setViewportSize({ width: cfg.width, height: cfg.height }); // workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it const notify_games = []; let user; @@ -47,7 +47,7 @@ try { console.error('Not signed in anymore.'); await signIn.click(); // it then creates an iframe for the login - await page.waitForSelector('#GalaxyAccountsFrameContainer iframe'); // TODO needed? + await page.waitForSelector('#GalaxyAccountsFrameContainer iframe'); const iframe = page.frameLocator('#GalaxyAccountsFrameContainer iframe'); if (!cfg.debug) context.setDefaultTimeout(cfg.login_timeout); // give user some extra time to log in console.info(`Login timeout is ${cfg.login_timeout / 1000} seconds!`); @@ -60,19 +60,24 @@ try { await iframe.locator('#login_username').fill(email); await iframe.locator('#login_password').fill(password); await iframe.locator('#login_login').click(); - // handle MFA, but don't await it - iframe.locator('form[name=second_step_authentication]').waitFor().then(async () => { - console.log('Two-Step Verification - Enter security code'); - console.log(await iframe.locator('.form__description').innerText()); - const otp = await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 4 || 'The code must be 4 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them - await iframe.locator('#second_step_authentication_token_letter_1').pressSequentially(otp.toString(), { delay: 10 }); - await iframe.locator('#second_step_authentication_send').click(); - await page.waitForTimeout(1000); // TODO still needed with wait for username below? - }).catch(_ => { }); - iframe.locator('text=Invalid captcha').waitFor().then(() => { - console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); - notify('gog: got captcha during login. Please check.'); - }).catch(_ => { }); + void (async () => { + try { + await iframe.locator('form[name=second_step_authentication]').waitFor({ timeout: 15000 }); + console.log('Two-Step Verification - Enter security code'); + console.log(await iframe.locator('.form__description').innerText()); + const otp = await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 4 || 'The code must be 4 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them + await iframe.locator('#second_step_authentication_token_letter_1').pressSequentially(otp.toString(), { delay: 10 }); + await iframe.locator('#second_step_authentication_send').click(); + await page.waitForTimeout(1000); + } catch {} + })(); + void (async () => { + try { + await iframe.locator('text=Invalid captcha').waitFor({ timeout: 15000 }); + console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); + notify('gog: got captcha during login. Please check.'); + } catch {} + })(); await page.waitForSelector('#menuUsername'); } else { console.log('Waiting for you to login in the browser.'); @@ -101,11 +106,9 @@ try { console.log(`Current free game: ${chalk.blue(title)} - ${url}`); db.data[user][title] ||= { title, time: datetime(), url }; if (cfg.dryrun) process.exit(1); - // await page.locator('#giveaway:not(.is-loading)').waitFor(); // otherwise screenshot is sometimes with loading indicator instead of game title; #TODO fix, skipped due to timeout, see #240 await banner.screenshot({ path: screenshot(`${filenamify(title)}.png`) }); // overwrites every time - only keep first? - // await banner.getByRole('button', { name: 'Add to library' }).click(); - // instead of clicking the button, we visit the auto-claim URL which gives as a JSON response which is easier than checking the state of a button + // instead of clicking the button, visit the auto-claim URL which gives a JSON response await page.goto('https://www.gog.com/giveaway/claim'); const response = await page.innerText('body'); // console.log(response); diff --git a/prime-gaming.js b/prime-gaming.js index 00e8466..c881f79 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -6,7 +6,6 @@ import { cfg } from './src/config.js'; const screenshot = (...a) => resolve(cfg.dir.screenshots, 'prime-gaming', ...a); -// const URL_LOGIN = 'https://www.amazon.de/ap/signin'; // wrong. needs some session args to be valid? const URL_CLAIM = 'https://luna.amazon.com/claims/home'; console.log(datetime(), 'started checking prime-gaming'); @@ -25,14 +24,12 @@ const context = await firefox.launchPersistentContext(cfg.dir.browser, { handleSIGINT(context); -// TODO test if needed await stealth(context); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist -await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it -// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent)); +await page.setViewportSize({ width: cfg.width, height: cfg.height }); // workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it const notify_games = []; let user; @@ -62,14 +59,18 @@ try { await page.fill('[name=password]', password); await page.click('input[type="submit"]'); await handleMFA(page).catch(() => {}); - page.waitForURL('**/ap/signin**').then(async () => { // check for wrong credentials + try { + await page.waitForURL('**/ap/signin**'); const error = await page.locator('.a-alert-content').first().innerText(); - if (!error.trim.length) return; - console.error('Login error:', error); - await notify(`prime-gaming: login: ${error}`); - await context.close(); // finishes potential recording - process.exit(1); - }); + if (error.trim().length) { + console.error('Login error:', error); + await notify(`prime-gaming: login: ${error}`); + await context.close(); // finishes potential recording + process.exit(1); + } + } catch { + // if navigation succeeded, continue + } await page.waitForURL(/luna\.amazon\.com\/claims\/.*signedIn=true/); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); return true; @@ -91,7 +92,7 @@ try { '[data-a-target="user-dropdown-first-name-text"]', '[data-testid="user-dropdown-first-name-text"]', ].map(s => page.waitForSelector(s))); - page.click('[aria-label="Cookies usage disclaimer banner"] button:has-text("Accept Cookies")').catch(() => { }); // to not waste screen space when non-headless, TODO does not work reliably, need to wait for something else first? + page.click('[aria-label="Cookies usage disclaimer banner"] button:has-text("Accept Cookies")').catch(() => { }); // to not waste screen space when non-headless; could be flaky while (await page.locator('button:has-text("Sign in"), button:has-text("Anmelden")').count() > 0) { console.error('Not signed in anymore.'); await page.click('button:has-text("Sign in")'); @@ -105,16 +106,19 @@ try { await page.fill('[name=email]', email); await page.click('input[type="submit"]'); await page.fill('[name=password]', password); - // await page.check('[name=rememberMe]'); // no longer exists await page.click('input[type="submit"]'); - page.waitForURL('**/ap/signin**').then(async () => { // check for wrong credentials + try { + await page.waitForURL('**/ap/signin**'); const error = await page.locator('.a-alert-content').first().innerText(); - if (!error.trim.length) return; - console.error('Login error:', error); - await notify(`prime-gaming: login: ${error}`); - await context.close(); // finishes potential recording - process.exit(1); - }); + if (error.trim().length) { + console.error('Login error:', error); + await notify(`prime-gaming: login: ${error}`); + await context.close(); // finishes potential recording + process.exit(1); + } + } catch { + // navigation ok + } handleMFA(page).catch(() => {}); } else { console.log('Waiting for you to login in the browser.'); @@ -130,9 +134,6 @@ try { } user = await page.locator('[data-a-target="user-dropdown-first-name-text"], [data-testid="user-dropdown-first-name-text"]').first().innerText(); console.log(`Signed in as ${user}`); - // await page.click('button[aria-label="User dropdown and more options"]'); - // const twitch = await page.locator('[data-a-target="TwitchDisplayName"]').first().innerText(); - // console.log(`Twitch user name is ${twitch}`); db.data[user] ||= {}; if (await page.getByRole('button', { name: 'Try Prime' }).count()) { @@ -156,7 +157,7 @@ try { // loading all games became flaky; see https://github.com/vogler/free-games-claimer/issues/357 await page.keyboard.press('PageDown'); // scrolling to straight to the bottom started to skip loading some games await page.waitForLoadState('networkidle'); // wait for all games to be loaded - await page.waitForTimeout(3000); // TODO networkidle wasn't enough to load all already collected games + await page.waitForTimeout(3000); // extra wait to load all already collected games // do it again since once wasn't enough... await page.keyboard.press('PageDown'); await page.waitForTimeout(3000); @@ -372,9 +373,9 @@ try { for (const { title, url } of external_info) { console.log('Current free game:', chalk.blue(title)); // , url); - const existing = db.data[user]?.[title]; - if (existing && existing.status && !existing.status.startsWith('failed')) { - console.log(` Already recorded as ${existing.status}, skipping.`); + const existingStatus = db.data[user]?.[title]?.status; + if (existingStatus && !existingStatus.startsWith('failed')) { + console.log(` Already recorded as ${existingStatus}, skipping.`); notify_games.push({ title, url, status: 'existed' }); continue; } @@ -448,21 +449,21 @@ try { page.waitForSelector('div:has-text("Link game account")', { timeout: cfg.timeout }).catch(() => {}), ]).catch(() => {}); db.data[user][title] ||= { title, time: datetime(), url, store }; - if (await page.locator('div:has-text("Link game account")').count() // TODO still needed? epic games store just has 'Link account' as the button text now. + if (await page.locator('div:has-text("Link game account")').count() // epic games store also shows "Link account" || await page.locator('div:has-text("Link account")').count()) { console.error(' Account linking is required to claim this offer!'); notify_game.status = `failed: need account linking for ${store}`; db.data[user][title].status = 'failed: need account linking'; // await page.pause(); // await page.click('[data-a-target="LinkAccountModal"] [data-a-target="LinkAccountButton"]'); - // TODO login for epic games also needed if already logged in + // login for epic games also needed if already logged in // wait for https://www.epicgames.com/id/authorize?redirect_uri=https%3A%2F%2Fservice.link.amazon.gg... // await page.click('button[aria-label="Allow"]'); } else { db.data[user][title].status = 'claimed'; // print code if there is one const redeem = { - // 'origin': 'https://www.origin.com/redeem', // TODO still needed or now only via account linking? + // 'origin': 'https://www.origin.com/redeem', // kept for legacy flows; current path uses account linking 'gog.com': 'https://www.gog.com/redeem', 'microsoft store': 'https://account.microsoft.com/billing/redeem', xbox: 'https://account.microsoft.com/billing/redeem', @@ -519,7 +520,7 @@ try { } else if (reason == 'code_not_found') { redeem_action = 'redeem (not found)'; console.error(' Code was not found!'); - } else { // TODO not logged in? need valid unused code to test. + } else { // unknown state; keep info log for later analysis redeem_action = 'redeemed?'; // console.log(' Redeemed successfully? Please report your Responses (if new) in https://github.com/vogler/free-games-claimer/issues/5'); console.debug(` Response 1: ${r1t}`); @@ -569,12 +570,12 @@ try { if (j?.events?.cart.length && j.events.cart[0]?.data?.reason == 'UserAlreadyOwnsContent') { redeem_action = 'already redeemed'; console.error(' error: UserAlreadyOwnsContent'); - } else { // TODO what's returned on success? + } else { // success path not seen yet; log below if needed redeem_action = 'redeemed'; db.data[user][title].status = 'claimed and redeemed?'; console.log(' Redeemed successfully? Please report if not in https://github.com/vogler/free-games-claimer/issues/5'); } - } else { // TODO find out other responses + } else { // other responses; keep info log for analysis redeem_action = 'unknown'; console.debug(` Response: ${rt}`); console.log(' Redeemed successfully? Please report your Response from above (if it is new) in https://github.com/vogler/free-games-claimer/issues/5'); @@ -672,7 +673,7 @@ try { const match = unlinked_store.match(/Link (.*) account/); if (match && match.length == 2) unlinked_store = match[1]; } else if (await page.locator('text=Link game account').count()) { // epic-games only? - console.error(' Missing account linking (epic-games specific button?):', await page.locator('button[data-a-target="gms-cta"]').innerText()); // TODO needed? + console.error(' Missing account linking (epic-games specific button?):', await page.locator('button[data-a-target="gms-cta"]').innerText()); // track account-linking UI drift unlinked_store = 'epic-games'; } if (unlinked_store) { diff --git a/src/migrate.js b/src/migrate.js index 80abc9d..e28e88d 100644 --- a/src/migrate.js +++ b/src/migrate.js @@ -18,7 +18,6 @@ const datetime_UTCtoLocalTimezone = async file => { db.data[user][game].time = time2; } } - // console.log(db.data); await db.write(); // write out json db }; diff --git a/test/sigint-enquirer-raw.js b/test/sigint-enquirer-raw.js index c85ee0d..baf1e1c 100644 --- a/test/sigint-enquirer-raw.js +++ b/test/sigint-enquirer-raw.js @@ -1,36 +1,13 @@ // https://github.com/enquirer/enquirer/issues/372 import { prompt, handleSIGINT } from '../src/util.js'; -// const handleSIGINT = () => process.on('SIGINT', () => { // e.g. when killed by Ctrl-C -// console.log('\nInterrupted by SIGINT. Exit!'); -// process.exitCode = 130; -// }); handleSIGINT(); -// function onRawSIGINT(fn) { -// const { stdin, stdout } = process; -// stdin.setRawMode(true); -// stdin.resume(); -// stdin.on('data', data => { -// const key = data.toString('utf-8'); -// if (key === '\u0003') { // ctrl + c -// fn(); -// } else { -// stdout.write(key); -// } -// }); -// } -// onRawSIGINT(() => { -// console.log('raw'); process.exit(1); -// }); - console.log('hello'); console.error('hello error'); try { - let i = 'foo'; + let i = await prompt(); // SIGINT no longer handled if this is executed i = await prompt(); // SIGINT no longer handled if this is executed - i = await prompt(); // SIGINT no longer handled if this is executed - // handleSIGINT(); console.log('value:', i); setTimeout(() => console.log('timeout 3s'), 3000); } catch (e) { diff --git a/unrealengine.js b/unrealengine.js index 4f4de4b..8fe84b8 100644 --- a/unrealengine.js +++ b/unrealengine.js @@ -1,6 +1,3 @@ -// TODO This is mostly a copy of epic-games.js -// New assets to claim every first Tuesday of a month. - import { firefox } from 'playwright-firefox'; // stealth plugin needs no outdated playwright-extra import { authenticator } from 'otplib'; import path from 'node:path'; @@ -21,8 +18,7 @@ const db = await jsonDb('unrealengine.json', {}); const context = await firefox.launchPersistentContext(cfg.dir.browser, { headless: cfg.headless, viewport: { width: cfg.width, height: cfg.height }, - userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36', // see replace of Headless in util.newStealthContext. TODO Windows UA enough to avoid 'device not supported'? update if browser is updated? - // userAgent for firefox: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0 + userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36', // Windows UA avoids "device not supported"; update when browser version changes locale: 'en-US', // ignore OS locale to be sure to have english text for locators recordVideo: cfg.record ? { dir: 'data/record/', size: { width: cfg.width, height: cfg.height } } : undefined, // will record a .webm video for each page navigated; without size, video would be scaled down to fit 800x800 recordHar: cfg.record ? { path: `data/record/ue-${filenamify(datetime())}.har` } : undefined, // will record a HAR file with network requests and responses; can be imported in Chrome devtools @@ -36,8 +32,7 @@ await stealth(context); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist -await page.setViewportSize({ width: cfg.width, height: cfg.height }); // TODO workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it -// console.debug('userAgent:', await page.evaluate(() => navigator.userAgent)); +await page.setViewportSize({ width: cfg.width, height: cfg.height }); // workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it const notify_games = []; let user; @@ -60,23 +55,26 @@ try { const email = cfg.eg_email || await prompt({ message: 'Enter email' }); const password = email && (cfg.eg_password || await prompt({ type: 'password', message: 'Enter password' })); if (email && password) { - // await page.click('text=Sign in with Epic Games'); await page.fill('#email', email); await page.click('button[type="submit"]'); await page.fill('#password', password); await page.click('button[type="submit"]'); - page.waitForSelector('#h_captcha_challenge_login_prod iframe').then(() => { - console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); - notify('unrealengine: got captcha during login. Please check.'); - }).catch(_ => { }); - // handle MFA, but don't await it - page.waitForURL('**/id/login/mfa**').then(async () => { - console.log('Enter the security code to continue - This appears to be a new device, browser or location. A security code has been sent to your email address at ...'); - // TODO locator for text (email or app?) - const otp = cfg.eg_otpkey && authenticator.generate(cfg.eg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them - await page.locator('input[name="code-input-0"]').pressSequentially(otp.toString()); - await page.click('button[type="submit"]'); - }).catch(_ => { }); + void (async () => { + try { + await page.waitForSelector('#h_captcha_challenge_login_prod iframe', { timeout: 15000 }); + console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); + notify('unrealengine: got captcha during login. Please check.'); + } catch {} + })(); + void (async () => { + try { + await page.waitForURL('**/id/login/mfa**', { timeout: cfg.login_timeout }); + console.log('Enter the security code to continue - This appears to be a new device, browser or location. A security code has been sent to your email address at ...'); + const otp = cfg.eg_otpkey && authenticator.generate(cfg.eg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them + await page.locator('input[name="code-input-0"]').pressSequentially(otp.toString()); + await page.click('button[type="submit"]'); + } catch {} + })(); } else { console.log('Waiting for you to login in the browser.'); await notify('unrealengine: no longer signed in and not enough options set for automatic login.'); @@ -135,18 +133,19 @@ try { notify('unrealengine: ' + err); process.exit(1); } - // await page.pause(); console.log('Click shopping cart'); await page.locator('.shopping-cart').click(); - // await page.waitForTimeout(2000); await page.locator('button.checkout').click(); console.log('Click checkout'); // maybe: Accept End User License Agreement - page.locator('[name=accept-label]').check().then(() => { - console.log('Accept End User License Agreement'); - page.locator('span:text-is("Accept")').click(); // otherwise matches 'Accept All Cookies' - }).catch(_ => { }); - await page.waitForSelector('#webPurchaseContainer iframe'); // TODO needed? + void (async () => { + try { + await page.locator('[name=accept-label]').check({ timeout: 10000 }); + console.log('Accept End User License Agreement'); + await page.locator('span:text-is("Accept")').click(); // otherwise matches 'Accept All Cookies' + } catch {} + })(); + await page.waitForSelector('#webPurchaseContainer iframe'); const iframe = page.frameLocator('#webPurchaseContainer iframe'); if (cfg.debug) await page.pause(); @@ -161,14 +160,21 @@ try { // I Agree button is only shown for EU accounts! https://github.com/vogler/free-games-claimer/pull/7#issuecomment-1038964872 const btnAgree = iframe.locator('button:has-text("I Agree")'); - btnAgree.waitFor().then(() => btnAgree.click()).catch(_ => { }); // EU: wait for and click 'I Agree' + void (async () => { + try { + await btnAgree.waitFor({ timeout: 10000 }); + await btnAgree.click(); + } catch {} + })(); // EU: wait for and click 'I Agree' try { // context.setDefaultTimeout(100 * 1000); // give time to solve captcha, iframe goes blank after 60s? const captcha = iframe.locator('#h_captcha_challenge_checkout_free_prod iframe'); - captcha.waitFor().then(async () => { // don't await, since element may not be shown - // console.info(' Got hcaptcha challenge! NopeCHA extension will likely solve it.') - console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); - }).catch(_ => { }); // may time out if not shown + void (async () => { + try { + await captcha.waitFor({ timeout: 10000 }); + console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); + } catch {} + })(); // may time out if not shown await page.waitForSelector('text=Thank you'); for (const id of ids) { db.data[user][id].status = 'claimed'; @@ -176,16 +182,12 @@ try { } notify_games.forEach(g => g.status == 'failed' && (g.status = 'claimed')); console.log('Claimed successfully!'); - // context.setDefaultTimeout(cfg.timeout); } catch (e) { console.log(e); - // console.error(' Failed to claim! Try again if NopeCHA timed out. Click the extension to see if you ran out of credits (refill after 24h). To avoid captchas try to get a new IP or set a cookie from https://www.hcaptcha.com/accessibility'); console.error(' Failed to claim! To avoid captchas try to get a new IP address.'); await page.screenshot({ path: screenshot('failed', `${filenamify(datetime())}.png`), fullPage: true }); - // db.data[user][id].status = 'failed'; notify_games.forEach(g => g.status = 'failed'); } - // notify_game.status = db.data[user][game_id].status; // claimed or failed if (notify_games.length) await page.screenshot({ path: screenshot(`${filenamify(datetime())}.png`), fullPage: false }); // fullPage is quite long... console.log('Done'); From 3fd861f134011233e3ef820e82e1defcf4d83467 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 16:13:15 +0000 Subject: [PATCH 122/134] Fix eslint no-empty and clean tests --- epic-games.js | 36 +++++++++++++++++++++++++++--------- gog.js | 8 ++++++-- test/notify.js | 1 - unrealengine.js | 20 +++++++++++++++----- 4 files changed, 48 insertions(+), 17 deletions(-) diff --git a/epic-games.js b/epic-games.js index 8253881..22a9113 100644 --- a/epic-games.js +++ b/epic-games.js @@ -97,13 +97,17 @@ try { await page.waitForSelector('.h_captcha_challenge iframe', { timeout: 15000 }); console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); await notify('epic-games: got captcha during login. Please check.'); - } catch {} + } catch (e) { + return; + } })(); void (async () => { try { await page.waitForSelector('p:has-text("Incorrect response.")', { timeout: 15000 }); console.error('Incorrect response for captcha!'); - } catch {} + } catch (e) { + return; + } })(); await page.fill('#email', email); const password = email && (cfg.eg_password || await prompt({ type: 'password', message: 'Enter password' })); @@ -118,7 +122,9 @@ try { await error.waitFor({ timeout: 15000 }); console.error('Login error:', await error.innerText()); console.log('Please login in the browser!'); - } catch {} + } catch (e) { + return; + } })(); void (async () => { try { @@ -127,7 +133,9 @@ try { const otp = cfg.eg_otpkey && authenticator.generate(cfg.eg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them await page.locator('input[name="code-input-0"]').pressSequentially(otp.toString()); await page.click('button[type="submit"]'); - } catch {} + } catch (e) { + return; + } })(); } await page.waitForURL(URL_CLAIM); @@ -228,7 +236,9 @@ try { console.log(' Accept End User License Agreement (only needed once)'); await page.locator('input#agree').check(); await page.locator('button:has-text("Accept")').click(); - } catch {} + } catch (e) { + return; + } })(); // it then creates an iframe for the purchase @@ -251,7 +261,9 @@ try { } await iframe.locator('input.payment-pin-code__input').first().pressSequentially(cfg.eg_parentalpin); await iframe.locator('button:has-text("Continue")').click({ delay: 11 }); - } catch {} + } catch (e) { + return; + } })(); if (cfg.debug) await page.pause(); @@ -271,7 +283,9 @@ try { try { await btnAgree.waitFor({ timeout: 10000 }); await btnAgree.click(); - } catch {} + } catch (e) { + return; + } })(); // EU: wait for and click 'I Agree' try { // context.setDefaultTimeout(100 * 1000); // give time to solve captcha, iframe goes blank after 60s? @@ -281,14 +295,18 @@ try { await captcha.waitFor({ timeout: 10000 }); console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); await notify(`epic-games: got captcha challenge for.\nGame link: ${url}`); - } catch {} + } catch (e) { + return; + } })(); // may time out if not shown void (async () => { try { await iframe.locator('.payment__errors:has-text("Failed to challenge captcha, please try again later.")').waitFor({ timeout: 10000 }); console.error(' Failed to challenge captcha, please try again later.'); await notify('epic-games: failed to challenge captcha. Please check.'); - } catch {} + } catch (e) { + return; + } })(); await page.locator('text=Thanks for your order!').waitFor({ state: 'attached' }); db.data[user][game_id].status = 'claimed'; diff --git a/gog.js b/gog.js index 9b8b2b8..2f83d6b 100644 --- a/gog.js +++ b/gog.js @@ -69,14 +69,18 @@ try { await iframe.locator('#second_step_authentication_token_letter_1').pressSequentially(otp.toString(), { delay: 10 }); await iframe.locator('#second_step_authentication_send').click(); await page.waitForTimeout(1000); - } catch {} + } catch (e) { + return; + } })(); void (async () => { try { await iframe.locator('text=Invalid captcha').waitFor({ timeout: 15000 }); console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); notify('gog: got captcha during login. Please check.'); - } catch {} + } catch (e) { + return; + } })(); await page.waitForSelector('#menuUsername'); } else { diff --git a/test/notify.js b/test/notify.js index b97994d..c5709a9 100644 --- a/test/notify.js +++ b/test/notify.js @@ -1,4 +1,3 @@ -/* eslint-disable no-constant-condition */ import { delay, html_game_list, notify } from '../src/util.js'; import { cfg } from '../src/config.js'; diff --git a/unrealengine.js b/unrealengine.js index 8fe84b8..fe93460 100644 --- a/unrealengine.js +++ b/unrealengine.js @@ -64,7 +64,9 @@ try { await page.waitForSelector('#h_captcha_challenge_login_prod iframe', { timeout: 15000 }); console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); notify('unrealengine: got captcha during login. Please check.'); - } catch {} + } catch (e) { + return; + } })(); void (async () => { try { @@ -73,7 +75,9 @@ try { const otp = cfg.eg_otpkey && authenticator.generate(cfg.eg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them await page.locator('input[name="code-input-0"]').pressSequentially(otp.toString()); await page.click('button[type="submit"]'); - } catch {} + } catch (e) { + return; + } })(); } else { console.log('Waiting for you to login in the browser.'); @@ -143,7 +147,9 @@ try { await page.locator('[name=accept-label]').check({ timeout: 10000 }); console.log('Accept End User License Agreement'); await page.locator('span:text-is("Accept")').click(); // otherwise matches 'Accept All Cookies' - } catch {} + } catch (e) { + return; + } })(); await page.waitForSelector('#webPurchaseContainer iframe'); const iframe = page.frameLocator('#webPurchaseContainer iframe'); @@ -164,7 +170,9 @@ try { try { await btnAgree.waitFor({ timeout: 10000 }); await btnAgree.click(); - } catch {} + } catch (e) { + return; + } })(); // EU: wait for and click 'I Agree' try { // context.setDefaultTimeout(100 * 1000); // give time to solve captcha, iframe goes blank after 60s? @@ -173,7 +181,9 @@ try { try { await captcha.waitFor({ timeout: 10000 }); console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); - } catch {} + } catch (e) { + return; + } })(); // may time out if not shown await page.waitForSelector('text=Thank you'); for (const id of ids) { From 52895fd991e2fdb826778f4405fa57a765ce08ef Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 16:15:14 +0000 Subject: [PATCH 123/134] Fix eslint no-unused-vars in async handlers --- epic-games.js | 18 +++++++++--------- gog.js | 4 ++-- unrealengine.js | 26 +++++++++++++------------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/epic-games.js b/epic-games.js index 22a9113..bbf000c 100644 --- a/epic-games.js +++ b/epic-games.js @@ -97,7 +97,7 @@ try { await page.waitForSelector('.h_captcha_challenge iframe', { timeout: 15000 }); console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); await notify('epic-games: got captcha during login. Please check.'); - } catch (e) { + } catch { return; } })(); @@ -105,7 +105,7 @@ try { try { await page.waitForSelector('p:has-text("Incorrect response.")', { timeout: 15000 }); console.error('Incorrect response for captcha!'); - } catch (e) { + } catch { return; } })(); @@ -122,7 +122,7 @@ try { await error.waitFor({ timeout: 15000 }); console.error('Login error:', await error.innerText()); console.log('Please login in the browser!'); - } catch (e) { + } catch { return; } })(); @@ -133,7 +133,7 @@ try { const otp = cfg.eg_otpkey && authenticator.generate(cfg.eg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them await page.locator('input[name="code-input-0"]').pressSequentially(otp.toString()); await page.click('button[type="submit"]'); - } catch (e) { + } catch { return; } })(); @@ -236,7 +236,7 @@ try { console.log(' Accept End User License Agreement (only needed once)'); await page.locator('input#agree').check(); await page.locator('button:has-text("Accept")').click(); - } catch (e) { + } catch { return; } })(); @@ -261,7 +261,7 @@ try { } await iframe.locator('input.payment-pin-code__input').first().pressSequentially(cfg.eg_parentalpin); await iframe.locator('button:has-text("Continue")').click({ delay: 11 }); - } catch (e) { + } catch { return; } })(); @@ -283,7 +283,7 @@ try { try { await btnAgree.waitFor({ timeout: 10000 }); await btnAgree.click(); - } catch (e) { + } catch { return; } })(); // EU: wait for and click 'I Agree' @@ -295,7 +295,7 @@ try { await captcha.waitFor({ timeout: 10000 }); console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); await notify(`epic-games: got captcha challenge for.\nGame link: ${url}`); - } catch (e) { + } catch { return; } })(); // may time out if not shown @@ -304,7 +304,7 @@ try { await iframe.locator('.payment__errors:has-text("Failed to challenge captcha, please try again later.")').waitFor({ timeout: 10000 }); console.error(' Failed to challenge captcha, please try again later.'); await notify('epic-games: failed to challenge captcha. Please check.'); - } catch (e) { + } catch { return; } })(); diff --git a/gog.js b/gog.js index 2f83d6b..5f0abad 100644 --- a/gog.js +++ b/gog.js @@ -69,7 +69,7 @@ try { await iframe.locator('#second_step_authentication_token_letter_1').pressSequentially(otp.toString(), { delay: 10 }); await iframe.locator('#second_step_authentication_send').click(); await page.waitForTimeout(1000); - } catch (e) { + } catch { return; } })(); @@ -78,7 +78,7 @@ try { await iframe.locator('text=Invalid captcha').waitFor({ timeout: 15000 }); console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); notify('gog: got captcha during login. Please check.'); - } catch (e) { + } catch { return; } })(); diff --git a/unrealengine.js b/unrealengine.js index fe93460..ad6ed68 100644 --- a/unrealengine.js +++ b/unrealengine.js @@ -64,7 +64,7 @@ try { await page.waitForSelector('#h_captcha_challenge_login_prod iframe', { timeout: 15000 }); console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); notify('unrealengine: got captcha during login. Please check.'); - } catch (e) { + } catch { return; } })(); @@ -75,7 +75,7 @@ try { const otp = cfg.eg_otpkey && authenticator.generate(cfg.eg_otpkey) || await prompt({ type: 'text', message: 'Enter two-factor sign in code', validate: n => n.toString().length == 6 || 'The code must be 6 digits!' }); // can't use type: 'number' since it strips away leading zeros and codes sometimes have them await page.locator('input[name="code-input-0"]').pressSequentially(otp.toString()); await page.click('button[type="submit"]'); - } catch (e) { + } catch { return; } })(); @@ -142,15 +142,15 @@ try { await page.locator('button.checkout').click(); console.log('Click checkout'); // maybe: Accept End User License Agreement - void (async () => { - try { - await page.locator('[name=accept-label]').check({ timeout: 10000 }); - console.log('Accept End User License Agreement'); - await page.locator('span:text-is("Accept")').click(); // otherwise matches 'Accept All Cookies' - } catch (e) { - return; - } - })(); + void (async () => { + try { + await page.locator('[name=accept-label]').check({ timeout: 10000 }); + console.log('Accept End User License Agreement'); + await page.locator('span:text-is("Accept")').click(); // otherwise matches 'Accept All Cookies' + } catch { + return; + } + })(); await page.waitForSelector('#webPurchaseContainer iframe'); const iframe = page.frameLocator('#webPurchaseContainer iframe'); @@ -170,7 +170,7 @@ try { try { await btnAgree.waitFor({ timeout: 10000 }); await btnAgree.click(); - } catch (e) { + } catch { return; } })(); // EU: wait for and click 'I Agree' @@ -181,7 +181,7 @@ try { try { await captcha.waitFor({ timeout: 10000 }); console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); - } catch (e) { + } catch { return; } })(); // may time out if not shown From bab4359977fa5efeeea33c5e9da07363cab538de Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 16:16:29 +0000 Subject: [PATCH 124/134] Fix indentation in unrealengine eslint --- unrealengine.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/unrealengine.js b/unrealengine.js index ad6ed68..1098a28 100644 --- a/unrealengine.js +++ b/unrealengine.js @@ -142,15 +142,15 @@ try { await page.locator('button.checkout').click(); console.log('Click checkout'); // maybe: Accept End User License Agreement - void (async () => { - try { - await page.locator('[name=accept-label]').check({ timeout: 10000 }); - console.log('Accept End User License Agreement'); - await page.locator('span:text-is("Accept")').click(); // otherwise matches 'Accept All Cookies' - } catch { - return; - } - })(); + void (async () => { + try { + await page.locator('[name=accept-label]').check({ timeout: 10000 }); + console.log('Accept End User License Agreement'); + await page.locator('span:text-is("Accept")').click(); // otherwise matches 'Accept All Cookies' + } catch { + return; + } + })(); await page.waitForSelector('#webPurchaseContainer iframe'); const iframe = page.frameLocator('#webPurchaseContainer iframe'); From b9aa6e007305395432bd08c53f970c1cd36eddd9 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 16:19:53 +0000 Subject: [PATCH 125/134] Use sonar.token instead of deprecated sonar.login --- .forgejo/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 5c14708..f42dbff 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -58,7 +58,7 @@ jobs: echo "Running local sonar-scanner..." sonar-scanner \ -Dsonar.host.url="$HOST_URL" \ - -Dsonar.login="$SONAR_TOKEN" \ + -Dsonar.token="$SONAR_TOKEN" \ -Dsonar.projectKey="$PROJECT_KEY" \ -Dsonar.sources=. \ -Dsonar.scm.disabled=true \ From 7ffc454e479dbcd7a8d03fb6ebe00c19a19f073c Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 16:45:17 +0000 Subject: [PATCH 126/134] Clean up Sonar issues and lint warnings --- epic-games.js | 75 ++++++++++++++++++------------- eslint.config.js | 2 +- gog.js | 13 +++--- prime-gaming.js | 90 +++++++++++++++++++++---------------- test/sigint-enquirer-raw.js | 6 +-- unrealengine.js | 27 ++++++----- 6 files changed, 124 insertions(+), 89 deletions(-) diff --git a/epic-games.js b/epic-games.js index bbf000c..d7eb80d 100644 --- a/epic-games.js +++ b/epic-games.js @@ -48,9 +48,18 @@ if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); const page = context.pages().length ? context.pages()[0] : await context.newPage(); // should always exist await page.setViewportSize({ width: cfg.width, height: cfg.height }); // workaround for https://github.com/vogler/free-games-claimer/issues/277 until Playwright fixes it -// some debug info about the page (screen dimensions, user agent, platform) -// eslint-disable-next-line no-undef -if (cfg.debug) console.debug(await page.evaluate(() => [(({ width, height, availWidth, availHeight }) => ({ width, height, availWidth, availHeight }))(window.screen), navigator.userAgent, navigator.platform, navigator.vendor])); // deconstruct screen needed since `window.screen` prints {}, `window.screen.toString()` '[object Screen]', and can't use some pick function without defining it on `page` +// some debug info about the page (screen dimensions, user agent) +if (cfg.debug) { + // eslint-disable-next-line no-undef + const debugInfo = await page.evaluate(() => { + const { width, height, availWidth, availHeight } = window.screen; + return { + screen: { width, height, availWidth, availHeight }, + userAgent: navigator.userAgent, + }; + }); + console.debug(debugInfo); +} if (cfg.debug_network) { // const filter = _ => true; const filter = r => r.url().includes('store.epicgames.com'); @@ -90,9 +99,8 @@ try { } }; const email = cfg.eg_email || await prompt({ message: 'Enter email' }); - if (!email) await notifyBrowserLogin(); - else { - void (async () => { + if (email) { + const watchCaptchaChallenge = async () => { try { await page.waitForSelector('.h_captcha_challenge iframe', { timeout: 15000 }); console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); @@ -100,24 +108,25 @@ try { } catch { return; } - })(); - void (async () => { + }; + const watchCaptchaIncorrect = async () => { try { await page.waitForSelector('p:has-text("Incorrect response.")', { timeout: 15000 }); console.error('Incorrect response for captcha!'); } catch { return; } - })(); + }; + watchCaptchaChallenge(); + watchCaptchaIncorrect(); await page.fill('#email', email); - const password = email && (cfg.eg_password || await prompt({ type: 'password', message: 'Enter password' })); - if (!password) await notifyBrowserLogin(); - else { + const password = cfg.eg_password || await prompt({ type: 'password', message: 'Enter password' }); + if (password) { await page.fill('#password', password); await page.click('button[type="submit"]'); - } + } else await notifyBrowserLogin(); const error = page.locator('#form-error-message'); - void (async () => { + const watchLoginError = async () => { try { await error.waitFor({ timeout: 15000 }); console.error('Login error:', await error.innerText()); @@ -125,8 +134,8 @@ try { } catch { return; } - })(); - void (async () => { + }; + const watchMfaStep = async () => { try { await page.waitForURL('**/id/login/mfa**', { timeout: cfg.login_timeout }); console.log('Enter the security code to continue - This appears to be a new device, browser or location. A security code has been sent to your email address at ...'); @@ -136,8 +145,10 @@ try { } catch { return; } - })(); - } + }; + watchLoginError(); + watchMfaStep(); + } else await notifyBrowserLogin(); await page.waitForURL(URL_CLAIM); if (!cfg.debug) context.setDefaultTimeout(cfg.timeout); } @@ -223,14 +234,13 @@ try { console.log(' Base game:', baseUrl); // await page.click('a:has-text("Overview")'); // re-add original add-on to queue after base game - urls.push(baseUrl); // add base game to the list of games to claim - urls.push(url); // add add-on itself again + urls.push(baseUrl, url); // add base game to the list of games to claim and re-add add-on itself } else { // GET console.log(' Not in library yet! Click', btnText); await purchaseBtn.click({ delay: 11 }); // got stuck here without delay (or mouse move), see #75, 1ms was also enough // Accept End User License Agreement (only needed once) - void (async () => { + const acceptEulaIfShown = async () => { try { await page.locator(':has-text("end user license agreement")').waitFor({ timeout: 10000 }); console.log(' Accept End User License Agreement (only needed once)'); @@ -239,7 +249,8 @@ try { } catch { return; } - })(); + }; + acceptEulaIfShown(); // it then creates an iframe for the purchase await page.waitForSelector('#webPurchaseContainer iframe'); @@ -252,7 +263,7 @@ try { continue; } - void (async () => { + const enterParentalPinIfNeeded = async () => { try { await iframe.locator('.payment-pin-code').waitFor({ timeout: 10000 }); if (!cfg.eg_parentalpin) { @@ -264,7 +275,8 @@ try { } catch { return; } - })(); + }; + enterParentalPinIfNeeded(); if (cfg.debug) await page.pause(); if (cfg.dryrun) { @@ -279,18 +291,19 @@ try { // I Agree button is only shown for EU accounts! https://github.com/vogler/free-games-claimer/pull/7#issuecomment-1038964872 const btnAgree = iframe.locator('button:has-text("I Accept")'); - void (async () => { + const acceptIfRequired = async () => { try { await btnAgree.waitFor({ timeout: 10000 }); await btnAgree.click(); } catch { return; } - })(); // EU: wait for and click 'I Agree' + }; // EU: wait for and click 'I Agree' + acceptIfRequired(); try { // context.setDefaultTimeout(100 * 1000); // give time to solve captcha, iframe goes blank after 60s? const captcha = iframe.locator('#h_captcha_challenge_checkout_free_prod iframe'); - void (async () => { + const watchCaptchaChallenge = async () => { try { await captcha.waitFor({ timeout: 10000 }); console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); @@ -298,8 +311,8 @@ try { } catch { return; } - })(); // may time out if not shown - void (async () => { + }; // may time out if not shown + const watchCaptchaFailure = async () => { try { await iframe.locator('.payment__errors:has-text("Failed to challenge captcha, please try again later.")').waitFor({ timeout: 10000 }); console.error(' Failed to challenge captcha, please try again later.'); @@ -307,7 +320,9 @@ try { } catch { return; } - })(); + }; + watchCaptchaChallenge(); + watchCaptchaFailure(); await page.locator('text=Thanks for your order!').waitFor({ state: 'attached' }); db.data[user][game_id].status = 'claimed'; db.data[user][game_id].time = datetime(); // claimed time overwrites failed/dryrun time diff --git a/eslint.config.js b/eslint.config.js index 48b1cbc..3c99bf5 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -11,7 +11,7 @@ export default [ { ignores: ['data/**'], }, - js.configs.recommended, // TODO still needed? + js.configs.recommended, { // files: ['*.js'], languageOptions: { diff --git a/gog.js b/gog.js index 5f0abad..767fec1 100644 --- a/gog.js +++ b/gog.js @@ -60,7 +60,7 @@ try { await iframe.locator('#login_username').fill(email); await iframe.locator('#login_password').fill(password); await iframe.locator('#login_login').click(); - void (async () => { + const handleTwoFactor = async () => { try { await iframe.locator('form[name=second_step_authentication]').waitFor({ timeout: 15000 }); console.log('Two-Step Verification - Enter security code'); @@ -72,8 +72,8 @@ try { } catch { return; } - })(); - void (async () => { + }; + const watchInvalidCaptcha = async () => { try { await iframe.locator('text=Invalid captcha').waitFor({ timeout: 15000 }); console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); @@ -81,7 +81,9 @@ try { } catch { return; } - })(); + }; + handleTwoFactor(); + watchInvalidCaptcha(); await page.waitForSelector('#menuUsername'); } else { console.log('Waiting for you to login in the browser.'); @@ -100,7 +102,8 @@ try { db.data[user] ||= {}; const banner = page.locator('#giveaway'); - if (!await banner.count()) { + const hasGiveaway = await banner.count(); + if (!hasGiveaway) { console.log('Currently no free giveaway!'); } else { const text = await page.locator('.giveaway__content-header').innerText(); diff --git a/prime-gaming.js b/prime-gaming.js index c881f79..47d7c70 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -92,7 +92,11 @@ try { '[data-a-target="user-dropdown-first-name-text"]', '[data-testid="user-dropdown-first-name-text"]', ].map(s => page.waitForSelector(s))); - page.click('[aria-label="Cookies usage disclaimer banner"] button:has-text("Accept Cookies")').catch(() => { }); // to not waste screen space when non-headless; could be flaky + try { + await page.click('[aria-label="Cookies usage disclaimer banner"] button:has-text("Accept Cookies")'); // to not waste screen space when non-headless; could be flaky + } catch { + // ignore if banner not present + } while (await page.locator('button:has-text("Sign in"), button:has-text("Anmelden")').count() > 0) { console.error('Not signed in anymore.'); await page.click('button:has-text("Sign in")'); @@ -119,7 +123,11 @@ try { } catch { // navigation ok } - handleMFA(page).catch(() => {}); + try { + await handleMFA(page); + } catch { + // ignore MFA watcher errors + } } else { console.log('Waiting for you to login in the browser.'); await notify('prime-gaming: no longer signed in and not enough options set for automatic login.'); @@ -297,7 +305,6 @@ try { return [p, isNew]; }; const skipBasedOnTime = async url => { - // console.log(' Checking time left for game:', url); const [p, isNew] = await sameOrNewPage(url); const dueDateLoc = p.locator('.availability-date .tw-bold, [data-testid="availability-end-date"], [data-test-selector="availability-end-date"]'); if (!await dueDateLoc.count()) { @@ -321,7 +328,10 @@ try { console.log('Current free game:', chalk.blue(title)); if (cfg.pg_timeLeft && url && await skipBasedOnTime(url)) continue; if (cfg.dryrun) continue; - if (cfg.interactive && !await confirm()) continue; + if (cfg.interactive) { + const confirmed = await confirm(); + if (!confirmed) continue; + } await card.handle.locator('.tw-button:has-text("Claim"), .tw-button:has-text("Get"), button:has-text("Claim"), button:has-text("Get")').first().click(); db.data[user][title] ||= { title, time: datetime(), url, store: 'internal' }; notify_games.push({ title, status: 'claimed', url }); @@ -336,8 +346,6 @@ try { if (!url) continue; external_info.push({ title, url }); } - // external_info = [ { title: 'Fallout 76 (XBOX)', url: 'https://gaming.amazon.com/fallout-76-xbox-fgwp/dp/amzn1.pg.item.9fe17d7b-b6c2-4f58-b494-cc4e79528d0b?ingress=amzn&ref_=SM_Fallout76XBOX_S01_FGWP_CRWN' } ]; - const clickCTA = async p => { const candidates = [ p.locator('button[data-a-target="buy-box_call-to-action"]').first(), @@ -353,14 +361,14 @@ try { if (await c.count()) { try { await c.waitFor({ state: 'visible', timeout: 5000 }); - if (!await c.isEnabled()) { + const enabled = await c.isEnabled(); + if (enabled) await c.click(); + else { await c.evaluate(el => { el.disabled = false; el.removeAttribute('disabled'); el.click(); }); - } else { - await c.click(); } return true; } catch { @@ -442,7 +450,10 @@ try { } if (cfg.pg_timeLeft && await skipBasedOnTime(url)) continue; if (cfg.dryrun) continue; - if (cfg.interactive && !await confirm()) continue; + if (cfg.interactive) { + const confirmed = await confirm(); + if (!confirmed) continue; + } await clickCTA(page); await Promise.any([ page.waitForSelector('.thank-you-title:has-text("Success")', { timeout: cfg.timeout }).catch(() => {}), @@ -499,13 +510,9 @@ try { const page2 = await context.newPage(); await page2.goto(redeem[store], { waitUntil: 'domcontentloaded' }); if (store == 'gog.com') { - // await page.goto(`https://redeem.gog.com/v1/bonusCodes/${code}`); // {"reason":"Invalid or no captcha"} await page2.fill('#codeInput', code); - // wait for responses before clicking on Continue and then Redeem - // first there are requests with OPTIONS and GET to https://redeem.gog.com/v1/bonusCodes/XYZ?language=de-DE const r1 = page2.waitForResponse(r => r.request().method() == 'GET' && r.url().startsWith('https://redeem.gog.com/')); await page2.click('[type="submit"]'); // click Continue - // console.log(await page2.locator('.warning-message').innerText()); // does not exist if there is no warning const r1t = await (await r1).text(); const reason = JSON.parse(r1t).reason; // {"reason":"Invalid or no captcha"} @@ -520,14 +527,12 @@ try { } else if (reason == 'code_not_found') { redeem_action = 'redeem (not found)'; console.error(' Code was not found!'); - } else { // unknown state; keep info log for later analysis - redeem_action = 'redeemed?'; - // console.log(' Redeemed successfully? Please report your Responses (if new) in https://github.com/vogler/free-games-claimer/issues/5'); - console.debug(` Response 1: ${r1t}`); - // then after the click on Redeem there is a POST request which should return {} if claimed successfully - const r2 = page2.waitForResponse(r => r.request().method() == 'POST' && r.url().startsWith('https://redeem.gog.com/')); - await page2.click('[type="submit"]'); // click Redeem - const r2t = await (await r2).text(); + } else { // unknown state; keep info log for later analysis + redeem_action = 'redeemed?'; + console.debug(` Response 1: ${r1t}`); + const r2 = page2.waitForResponse(r => r.request().method() == 'POST' && r.url().startsWith('https://redeem.gog.com/')); + await page2.click('[type="submit"]'); // click Redeem + const r2t = await (await r2).text(); const reason2 = JSON.parse(r2t).reason; if (r2t == '{}') { redeem_action = 'redeemed'; @@ -543,7 +548,6 @@ try { } } else if (store == 'microsoft store' || store == 'xbox') { console.error(` Redeem on ${store} is experimental!`); - // await page2.pause(); if (page2.url().startsWith('https://login.')) { console.error(' Not logged in! Please redeem the code above manually. You can now login in the browser for next time. Waiting for 60s.'); await page2.waitForTimeout(60 * 1000); @@ -554,9 +558,7 @@ try { await input.waitFor(); await input.fill(code); const r = page2.waitForResponse(r => r.url().startsWith('https://cart.production.store-web.dynamics.com/v1.0/Redeem/PrepareRedeem')); - // console.log(await page2.locator('.redeem_code_error').innerText()); const rt = await (await r).text(); - // {"code":"NotFound","data":[],"details":[],"innererror":{"code":"TokenNotFound",... const j = JSON.parse(rt); const reason = j?.events?.cart.length && j.events.cart[0]?.data?.reason; if (reason == 'TokenNotFound') { @@ -582,14 +584,12 @@ try { } } } else if (store == 'legacy games') { - // await page2.pause(); await page2.fill('[name=coupon_code]', code); await page2.fill('[name=email]', cfg.lg_email); await page2.fill('[name=email_validate]', cfg.lg_email); await page2.uncheck('[name=newsletter_sub]'); await page2.click('[type="submit"]'); try { - // await page2.waitForResponse(r => r.url().startsWith('https://promo.legacygames.com/promotion-processing/order-management.php')); // status code 302 await page2.waitForSelector('h2:has-text("Thanks for redeeming")'); redeem_action = 'redeemed'; db.data[user][title].status = 'claimed and redeemed'; @@ -609,15 +609,16 @@ try { } else { notify_game.status = `claimed on ${store}`; db.data[user][title].status = 'claimed'; - } - // save screenshot of potential code just in case - await page.screenshot({ path: screenshot('external', `${filenamify(title)}.png`), fullPage: true }); - // console.info(' Saved a screenshot of page to', p); } - // await page.pause(); + await page.screenshot({ path: screenshot('external', `${filenamify(title)}.png`), fullPage: true }); + } } await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); - page.click('button[data-type="Game"]').catch(() => {}); + try { + await page.click('button[data-type="Game"]'); + } catch { + // ignore if filter already selected + } if (notify_games.length && games) { // make screenshot of all games if something was claimed and list exists const p = screenshot(`${filenamify(datetime())}.png`); @@ -663,15 +664,28 @@ try { await page.goto(url, { waitUntil: 'domcontentloaded' }); // most games have a button 'Get in-game content' // epic-games: Fall Guys: Claim -> Continue -> Go to Epic Games (despite account linked and logged into epic-games) -> not tied to account but via some cookie? - await Promise.any([page.click('.tw-button:has-text("Get in-game content")'), page.click('.tw-button:has-text("Claim your gift")'), page.click('.tw-button:has-text("Claim")').then(() => page.click('button:has-text("Continue")'))]); - page.click('button:has-text("Continue")').catch(() => { }); + const claimOptions = [ + page.click('.tw-button:has-text("Get in-game content")'), + page.click('.tw-button:has-text("Claim your gift")'), + (async () => { + await page.click('.tw-button:has-text("Claim")'); + await page.click('button:has-text("Continue")').catch(() => {}); + })(), + ]; + await Promise.any(claimOptions); + try { + await page.click('button:has-text("Continue")'); + } catch { + // continue button not always present + } const linkAccountButton = page.locator('[data-a-target="LinkAccountButton"]'); let unlinked_store; if (await linkAccountButton.count()) { unlinked_store = await linkAccountButton.first().getAttribute('aria-label'); console.debug(' LinkAccountButton label:', unlinked_store); - const match = unlinked_store.match(/Link (.*) account/); - if (match && match.length == 2) unlinked_store = match[1]; + const match = unlinked_store?.match(/Link (.*) account/); + const extracted = match?.[1]; + if (extracted) unlinked_store = extracted; } else if (await page.locator('text=Link game account').count()) { // epic-games only? console.error(' Missing account linking (epic-games specific button?):', await page.locator('button[data-a-target="gms-cta"]').innerText()); // track account-linking UI drift unlinked_store = 'epic-games'; @@ -685,9 +699,7 @@ try { console.log(' Code to redeem game:', chalk.blue(code)); db.data[user][title].code = code; db.data[user][title].status = 'claimed'; - // notify_game.status = `${redeem_action} ${code} on ${store}`; } - // await page.pause(); } catch (error) { console.error(error); } finally { diff --git a/test/sigint-enquirer-raw.js b/test/sigint-enquirer-raw.js index baf1e1c..f9f365c 100644 --- a/test/sigint-enquirer-raw.js +++ b/test/sigint-enquirer-raw.js @@ -6,9 +6,9 @@ handleSIGINT(); console.log('hello'); console.error('hello error'); try { - let i = await prompt(); // SIGINT no longer handled if this is executed - i = await prompt(); // SIGINT no longer handled if this is executed - console.log('value:', i); + const first = await prompt(); // SIGINT no longer handled if this is executed + const second = await prompt(); // SIGINT no longer handled if this is executed + console.log('values:', first, second); setTimeout(() => console.log('timeout 3s'), 3000); } catch (e) { process.exitCode ||= 1; diff --git a/unrealengine.js b/unrealengine.js index 1098a28..6eb7d79 100644 --- a/unrealengine.js +++ b/unrealengine.js @@ -59,7 +59,7 @@ try { await page.click('button[type="submit"]'); await page.fill('#password', password); await page.click('button[type="submit"]'); - void (async () => { + const watchCaptchaDuringLogin = async () => { try { await page.waitForSelector('#h_captcha_challenge_login_prod iframe', { timeout: 15000 }); console.error('Got a captcha during login (likely due to too many attempts)! You may solve it in the browser, get a new IP or try again in a few hours.'); @@ -67,8 +67,8 @@ try { } catch { return; } - })(); - void (async () => { + }; + const watchMfa = async () => { try { await page.waitForURL('**/id/login/mfa**', { timeout: cfg.login_timeout }); console.log('Enter the security code to continue - This appears to be a new device, browser or location. A security code has been sent to your email address at ...'); @@ -78,7 +78,9 @@ try { } catch { return; } - })(); + }; + watchCaptchaDuringLogin(); + watchMfa(); } else { console.log('Waiting for you to login in the browser.'); await notify('unrealengine: no longer signed in and not enough options set for automatic login.'); @@ -125,7 +127,7 @@ try { } ids.push(id); } - if (!ids.length) { + if (ids.length === 0) { console.log('Nothing to claim'); } else { await page.waitForTimeout(2000); @@ -142,7 +144,7 @@ try { await page.locator('button.checkout').click(); console.log('Click checkout'); // maybe: Accept End User License Agreement - void (async () => { + const acceptEulaIfPresent = async () => { try { await page.locator('[name=accept-label]').check({ timeout: 10000 }); console.log('Accept End User License Agreement'); @@ -150,7 +152,8 @@ try { } catch { return; } - })(); + }; + acceptEulaIfPresent(); await page.waitForSelector('#webPurchaseContainer iframe'); const iframe = page.frameLocator('#webPurchaseContainer iframe'); @@ -166,25 +169,27 @@ try { // I Agree button is only shown for EU accounts! https://github.com/vogler/free-games-claimer/pull/7#issuecomment-1038964872 const btnAgree = iframe.locator('button:has-text("I Agree")'); - void (async () => { + const acceptIfRequired = async () => { try { await btnAgree.waitFor({ timeout: 10000 }); await btnAgree.click(); } catch { return; } - })(); // EU: wait for and click 'I Agree' + }; // EU: wait for and click 'I Agree' + acceptIfRequired(); try { // context.setDefaultTimeout(100 * 1000); // give time to solve captcha, iframe goes blank after 60s? const captcha = iframe.locator('#h_captcha_challenge_checkout_free_prod iframe'); - void (async () => { + const watchCaptchaChallenge = async () => { try { await captcha.waitFor({ timeout: 10000 }); console.error(' Got hcaptcha challenge! Lost trust due to too many login attempts? You can solve the captcha in the browser or get a new IP address.'); } catch { return; } - })(); // may time out if not shown + }; // may time out if not shown + watchCaptchaChallenge(); await page.waitForSelector('text=Thank you'); for (const id of ids) { db.data[user][id].status = 'claimed'; From a477bb332791a7190fc686a82b6f9f65812abbc8 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 16:47:46 +0000 Subject: [PATCH 127/134] Fix lint: guard browser globals and normalize indentation --- epic-games.js | 2 +- prime-gaming.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/epic-games.js b/epic-games.js index d7eb80d..941383f 100644 --- a/epic-games.js +++ b/epic-games.js @@ -50,7 +50,7 @@ await page.setViewportSize({ width: cfg.width, height: cfg.height }); // workaro // some debug info about the page (screen dimensions, user agent) if (cfg.debug) { - // eslint-disable-next-line no-undef + /* global window, navigator */ const debugInfo = await page.evaluate(() => { const { width, height, availWidth, availHeight } = window.screen; return { diff --git a/prime-gaming.js b/prime-gaming.js index 47d7c70..a09cbca 100644 --- a/prime-gaming.js +++ b/prime-gaming.js @@ -527,12 +527,12 @@ try { } else if (reason == 'code_not_found') { redeem_action = 'redeem (not found)'; console.error(' Code was not found!'); - } else { // unknown state; keep info log for later analysis - redeem_action = 'redeemed?'; - console.debug(` Response 1: ${r1t}`); - const r2 = page2.waitForResponse(r => r.request().method() == 'POST' && r.url().startsWith('https://redeem.gog.com/')); - await page2.click('[type="submit"]'); // click Redeem - const r2t = await (await r2).text(); + } else { // unknown state; keep info log for later analysis + redeem_action = 'redeemed?'; + console.debug(` Response 1: ${r1t}`); + const r2 = page2.waitForResponse(r => r.request().method() == 'POST' && r.url().startsWith('https://redeem.gog.com/')); + await page2.click('[type="submit"]'); // click Redeem + const r2t = await (await r2).text(); const reason2 = JSON.parse(r2t).reason; if (r2t == '{}') { redeem_action = 'redeemed'; @@ -609,8 +609,8 @@ try { } else { notify_game.status = `claimed on ${store}`; db.data[user][title].status = 'claimed'; - } - await page.screenshot({ path: screenshot('external', `${filenamify(title)}.png`), fullPage: true }); + } + await page.screenshot({ path: screenshot('external', `${filenamify(title)}.png`), fullPage: true }); } } await page.goto(URL_CLAIM, { waitUntil: 'domcontentloaded' }); From e3e6a6f36c12a02c65154c450115c998302f0651 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 16:54:42 +0000 Subject: [PATCH 128/134] Handle unwritable browser volume in entrypoint --- docker-entrypoint.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 5837164..33a76e6 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -16,13 +16,17 @@ rm -f /fgc/data/browser/SingletonLock # Since this file has to be in the volume (data/browser), we can't do this in Dockerfile. mkdir -p /fgc/data/browser # fix for 'Incorrect response' after solving a captcha correctly - https://github.com/vogler/free-games-claimer/issues/261#issuecomment-1868385830 -# echo 'user_pref("privacy.resistFingerprinting", true);' > /fgc/data/browser/user.js -cat << EOT > /fgc/data/browser/user.js +# Only write the prefs file when the volume is writable (container runs as non-root). +if [ -w /fgc/data/browser ]; then + cat << EOT > /fgc/data/browser/user.js user_pref("privacy.resistFingerprinting", true); // user_pref("privacy.resistFingerprinting.letterboxing", true); // user_pref("browser.contentblocking.category", "strict"); // user_pref("webgl.disabled", true); EOT +else + echo "Warning: /fgc/data/browser is not writable; skipping user.js creation." +fi # TODO disable session restore message? # Remove X server display lock, fix for `docker compose up` which reuses container which made it fail after initial run, https://github.com/vogler/free-games-claimer/issues/31 From 6f2e1e5b22493dceaf4455be8b19e5680704d312 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 16:58:22 +0000 Subject: [PATCH 129/134] Make browser prefs creation non-fatal when unwritable --- docker-entrypoint.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 33a76e6..42de464 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -10,22 +10,24 @@ echo "Build: $NOW" # When running in docker and then killing it, on the next run chromium displayed a dialog to unlock the profile which made the script time out. # Maybe due to changed hostname of container or due to how the docker container kills playwright - didn't check. # https://bugs.chromium.org/p/chromium/issues/detail?id=367048 -rm -f /fgc/data/browser/SingletonLock +rm -f /fgc/data/browser/SingletonLock 2>/dev/null || true # Firefox preferences are stored in $BROWSER_DIR/pref.js and can be overridden by a file user.js # Since this file has to be in the volume (data/browser), we can't do this in Dockerfile. mkdir -p /fgc/data/browser # fix for 'Incorrect response' after solving a captcha correctly - https://github.com/vogler/free-games-claimer/issues/261#issuecomment-1868385830 # Only write the prefs file when the volume is writable (container runs as non-root). -if [ -w /fgc/data/browser ]; then - cat << EOT > /fgc/data/browser/user.js +if [ -w /fgc/data/browser ] && ( [ ! -e /fgc/data/browser/user.js ] || [ -w /fgc/data/browser/user.js ] ); then + if ! cat << 'EOT' > /fgc/data/browser/user.js; then + echo "Warning: failed to write /fgc/data/browser/user.js (permission issue?)." >&2 + fi user_pref("privacy.resistFingerprinting", true); // user_pref("privacy.resistFingerprinting.letterboxing", true); // user_pref("browser.contentblocking.category", "strict"); // user_pref("webgl.disabled", true); EOT else - echo "Warning: /fgc/data/browser is not writable; skipping user.js creation." + echo "Warning: /fgc/data/browser not writable; skipping user.js creation." fi # TODO disable session restore message? From 4d835013cce7951ab988802082ca1d88fd85a0e6 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 17:05:01 +0000 Subject: [PATCH 130/134] Skip browser prefs when volume is read-only --- docker-entrypoint.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 42de464..183905e 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -17,10 +17,9 @@ rm -f /fgc/data/browser/SingletonLock 2>/dev/null || true mkdir -p /fgc/data/browser # fix for 'Incorrect response' after solving a captcha correctly - https://github.com/vogler/free-games-claimer/issues/261#issuecomment-1868385830 # Only write the prefs file when the volume is writable (container runs as non-root). -if [ -w /fgc/data/browser ] && ( [ ! -e /fgc/data/browser/user.js ] || [ -w /fgc/data/browser/user.js ] ); then - if ! cat << 'EOT' > /fgc/data/browser/user.js; then - echo "Warning: failed to write /fgc/data/browser/user.js (permission issue?)." >&2 - fi +if touch /fgc/data/browser/.write-test 2>/dev/null; then + rm -f /fgc/data/browser/.write-test 2>/dev/null || true + cat << 'EOT' > /fgc/data/browser/user.js 2>/dev/null || echo "Warning: failed to write /fgc/data/browser/user.js (permission issue?)." >&2 user_pref("privacy.resistFingerprinting", true); // user_pref("privacy.resistFingerprinting.letterboxing", true); // user_pref("browser.contentblocking.category", "strict"); From cfc1e0ee123cf28e07c63b0cf0e00755154cfac3 Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 17:10:53 +0000 Subject: [PATCH 131/134] Harden entrypoint: skip user.js on RO volume and auto-install browsers --- docker-entrypoint.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 183905e..f18201d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -17,9 +17,8 @@ rm -f /fgc/data/browser/SingletonLock 2>/dev/null || true mkdir -p /fgc/data/browser # fix for 'Incorrect response' after solving a captcha correctly - https://github.com/vogler/free-games-claimer/issues/261#issuecomment-1868385830 # Only write the prefs file when the volume is writable (container runs as non-root). -if touch /fgc/data/browser/.write-test 2>/dev/null; then - rm -f /fgc/data/browser/.write-test 2>/dev/null || true - cat << 'EOT' > /fgc/data/browser/user.js 2>/dev/null || echo "Warning: failed to write /fgc/data/browser/user.js (permission issue?)." >&2 +if [ -w /fgc/data/browser ] && { [ ! -e /fgc/data/browser/user.js ] || [ -w /fgc/data/browser/user.js ] || rm -f /fgc/data/browser/user.js 2>/dev/null; }; then + cat << 'EOT' > /fgc/data/browser/user.js user_pref("privacy.resistFingerprinting", true); // user_pref("privacy.resistFingerprinting.letterboxing", true); // user_pref("browser.contentblocking.category", "strict"); @@ -57,4 +56,11 @@ echo "VNC is running on port $VNC_PORT ($pwt)" websockify -D --web "/usr/share/novnc/" $NOVNC_PORT "localhost:$VNC_PORT" 2>/dev/null 1>&2 & echo "noVNC (VNC via browser) is running on http://localhost:$NOVNC_PORT" echo + +# Ensure Playwright browsers are available (chromium + firefox). +if [ ! -x /home/fgc/.cache/ms-playwright/firefox-1482/firefox/firefox ] || ! ls /home/fgc/.cache/ms-playwright/chromium-*/*/chrome >/dev/null 2>&1; then + echo "Playwright browsers missing; installing..." + npx playwright install chromium firefox || echo "Warning: failed to install Playwright browsers" >&2 +fi + exec tini -g -- "$@" # https://github.com/krallin/tini/issues/8 node/playwright respond to signals like ctrl-c, but unsure about zombie processes From 949206dbf25f8f509ce283b31d549e76a85a99cb Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 17:21:53 +0000 Subject: [PATCH 132/134] Ensure /tmp/.X11-unix exists with sane perms --- docker-entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index f18201d..870d4c9 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -34,6 +34,12 @@ fi # ls -l /tmp/.X11-unix/ rm -f /tmp/.X1-lock +# Ensure X11 socket dir exists with sane ownership/permissions. +mkdir -p /tmp/.X11-unix +if [ "$(stat -c %U /tmp/.X11-unix 2>/dev/null)" != "root" ]; then + chown root:root /tmp/.X11-unix 2>/dev/null || chmod 1777 /tmp/.X11-unix +fi + # 6000+SERVERNUM is the TCP port Xvfb is listening on: # SERVERNUM=$(echo "$DISPLAY" | sed 's/:\([0-9][0-9]*\).*/\1/') From 8ebb57a7067f06f5ba35cc31974f7e798b7d9fdb Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 17:27:28 +0000 Subject: [PATCH 133/134] Add missing Playwright deps and clear Firefox locks on start --- Dockerfile | 3 +++ docker-entrypoint.sh | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index a3dcbc9..cac91cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,9 @@ RUN apt-get update \ libgdk-pixbuf-2.0-0 \ libdbus-glib-1-2 \ libxcursor1 \ + libnss3 \ + libnspr4 \ + libgbm1 \ && apt-get autoremove -y \ && apt-get clean \ && rm -rf \ diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 870d4c9..b5f5863 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -15,6 +15,8 @@ rm -f /fgc/data/browser/SingletonLock 2>/dev/null || true # Firefox preferences are stored in $BROWSER_DIR/pref.js and can be overridden by a file user.js # Since this file has to be in the volume (data/browser), we can't do this in Dockerfile. mkdir -p /fgc/data/browser +# clean up stale firefox locks that can trigger "already running" +rm -f /fgc/data/browser/parent.lock /fgc/data/browser/lock /fgc/data/browser/.parentlock 2>/dev/null || true # fix for 'Incorrect response' after solving a captcha correctly - https://github.com/vogler/free-games-claimer/issues/261#issuecomment-1868385830 # Only write the prefs file when the volume is writable (container runs as non-root). if [ -w /fgc/data/browser ] && { [ ! -e /fgc/data/browser/user.js ] || [ -w /fgc/data/browser/user.js ] || rm -f /fgc/data/browser/user.js 2>/dev/null; }; then From 67afeead600a0e4d165ed52406faa8eceb48012e Mon Sep 17 00:00:00 2001 From: nocci Date: Tue, 30 Dec 2025 17:36:31 +0000 Subject: [PATCH 134/134] chore: chown /fgc/data on start so fgc can write bind-mount --- docker-entrypoint.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b5f5863..e604e7c 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -6,6 +6,11 @@ echo "Version: https://github.com/vogler/free-games-claimer/tree/${COMMIT}" [ ! -z $BRANCH ] && [ $BRANCH != "main" ] && echo "Branch: ${BRANCH}" echo "Build: $NOW" +# Ensure writable data dir for fgc when host bind-mount is owned by root. +if [ "$(id -u)" -eq 0 ]; then + chown -R 1000:1000 /fgc/data 2>/dev/null || true +fi + # Remove chromium profile lock. # When running in docker and then killing it, on the next run chromium displayed a dialog to unlock the profile which made the script time out. # Maybe due to changed hostname of container or due to how the docker container kills playwright - didn't check.