From dc54be10e8d37647f9b21a0e88dfee69633d00c0 Mon Sep 17 00:00:00 2001 From: nocci Date: Thu, 8 Jan 2026 13:23:01 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(epic-claimer):=20add=20new=20i?= =?UTF-8?q?mports=20and=20constants?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - import axios, playwright-firefox, otplib, and node modules for enhanced functionality - add utility imports from local modules for better code organization - define URL_CLAIM, COOKIES_PATH, and BEARER_TOKEN_NAME constants for clearer code structure --- .forgejo/workflows/.eslintrc.cjs | 19 +++++++++++++++++++ epic-claimer-new.js | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .forgejo/workflows/.eslintrc.cjs diff --git a/.forgejo/workflows/.eslintrc.cjs b/.forgejo/workflows/.eslintrc.cjs new file mode 100644 index 0000000..0dfcaf1 --- /dev/null +++ b/.forgejo/workflows/.eslintrc.cjs @@ -0,0 +1,19 @@ +I apologize, but the suggested edit is a `package.json` configuration, while the original code is an ESLint configuration file(`.eslintrc.cjs`).These are two different types of configuration files. + +If you want to incorporate the suggested configuration, I'll help you merge the relevant parts. Here's a revised ESLint configuration that includes the suggestions: + argsIgnorePattern: '^_' + }], + '@stylistic/js/comma-dangle': ['error', 'always-multiline'], + '@stylistic/js/arrow-parens': ['error', 'as-needed'] + }, +plugins: [ +] +'@stylistic/js' +}; + +Could you clarify: +1. Are you looking to update the ESLint configuration? +2. Do you want to add these import statements to a specific file? +3. What specific changes are you trying to make? + +The previous ESLint configuration looked like this: diff --git a/epic-claimer-new.js b/epic-claimer-new.js index eb55bbb..5b52570 100644 --- a/epic-claimer-new.js +++ b/epic-claimer-new.js @@ -1,3 +1,25 @@ +import axios from 'axios'; +import { firefox } from 'playwright-firefox'; +import { authenticator } from 'otplib'; +import path from 'node:path'; +import { existsSync, readFileSync, 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'; + +const URL_CLAIM = 'https://store.epicgames.com/en-US/free-games'; +const COOKIES_PATH = path.resolve(cfg.dir.browser, 'epic-cookies.json'); +const BEARER_TOKEN_NAME = 'EPIC_BEARER_TOKEN'; + const ensureLoggedIn = async (page, context) => { const isLoggedIn = async () => { try {