From fbbdd370ce1a4fff0fc2c43bfde993d88b7c42cb Mon Sep 17 00:00:00 2001 From: LightZirconite Date: Sun, 9 Nov 2025 11:19:48 +0100 Subject: [PATCH] Fix: Update version number to 2.56.0 in package-lock.json; comment out utility methods in AccountCreator for future use --- package-lock.json | 2 +- src/account-creation/AccountCreator.ts | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5279e12..34eb384 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "microsoft-rewards-bot", - "version": "2.55.0", + "version": "2.56.0", "license": "CC-BY-NC-SA-4.0", "dependencies": { "axios": "^1.8.4", diff --git a/src/account-creation/AccountCreator.ts b/src/account-creation/AccountCreator.ts index 6f5ace6..5bbedb5 100644 --- a/src/account-creation/AccountCreator.ts +++ b/src/account-creation/AccountCreator.ts @@ -32,8 +32,12 @@ export class AccountCreator { /** * UTILITY: Find first visible element from list of selectors * Reserved for future use - simplifies selector fallback logic + * + * Usage example: + * const element = await this.findFirstVisible(['selector1', 'selector2'], 'CONTEXT') + * if (element) await element.click() */ - // eslint-disable-next-line @typescript-eslint/no-unused-vars + /* private async findFirstVisible(selectors: string[], context: string): Promise | null> { for (const selector of selectors) { try { @@ -52,6 +56,7 @@ export class AccountCreator { log(false, 'CREATOR', `[${context}] No visible element found`, 'warn', 'yellow') return null } + */ /** * UTILITY: Retry an async operation with exponential backoff @@ -190,7 +195,17 @@ export class AccountCreator { /** * CRITICAL: Verify page transition was successful * Checks that new elements appeared AND old elements disappeared + * Reserved for future use - can be called for complex page transitions + * + * Usage example: + * const success = await this.verifyPageTransition( + * 'EMAIL_TO_PASSWORD', + * ['input[type="password"]'], + * ['input[type="email"]'] + * ) + * if (!success) return null */ + /* private async verifyPageTransition( context: string, expectedNewSelectors: string[], @@ -263,11 +278,19 @@ export class AccountCreator { return false } } + */ /** * CRITICAL: Verify that a click action was successful * Checks that something changed after the click (URL, visible elements, etc.) + * Reserved for future use - can be called for complex click verifications + * + * Usage example: + * await button.click() + * const success = await this.verifyClickSuccess('BUTTON_CLICK', true, ['div.new-content']) + * if (!success) return null */ + /* private async verifyClickSuccess( context: string, urlShouldChange: boolean = false, @@ -320,6 +343,7 @@ export class AccountCreator { log(false, 'CREATOR', `[${context}] ✅ Click appears successful`, 'log', 'green') return true } + */ private async askQuestion(question: string): Promise { return new Promise((resolve) => {