feat: Refactor and modularize flow handling for improved maintainability

- Extracted BuyModeHandler, DesktopFlow, MobileFlow, and SummaryReporter into separate modules for better organization and testability.
- Enhanced type safety and added interfaces for various return types in Load, Logger, UserAgent, and flow modules.
- Implemented comprehensive error handling and logging throughout the new modules.
- Added unit tests for DesktopFlow, MobileFlow, and SummaryReporter to ensure functionality and correctness.
- Updated existing utility functions to support new flow structures and improve code clarity.
This commit is contained in:
2025-11-08 12:19:34 +01:00
parent 1ff521f505
commit 8eefd15b80
19 changed files with 1101 additions and 290 deletions

View File

@@ -1,9 +1,9 @@
import Browser from '../browser/Browser'
import { AccountCreator } from './AccountCreator'
import { log } from '../util/Logger'
import { MicrosoftRewardsBot } from '../index'
import { log } from '../util/Logger'
import { AccountCreator } from './AccountCreator'
async function main() {
async function main(): Promise<void> {
// Get referral URL from command line args
const args = process.argv.slice(2)
const referralUrl = args[0] // Optional referral URL