diff --git a/package-lock.json b/package-lock.json index f83387c..f8d1b48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "microsoft-rewards-bot", - "version": "3.5.6", + "version": "3.5.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "microsoft-rewards-bot", - "version": "3.5.6", + "version": "3.5.7", "license": "CC-BY-NC-SA-4.0", "dependencies": { "axios": "^1.8.4", diff --git a/package.json b/package.json index 9d52fa8..5e1b49c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "microsoft-rewards-bot", - "version": "3.5.6", + "version": "3.5.7", "description": "Automate Microsoft Rewards points collection", "private": true, "main": "index.js", diff --git a/test-error-reporting.ps1 b/test-error-reporting.ps1 deleted file mode 100644 index 6dabaff..0000000 --- a/test-error-reporting.ps1 +++ /dev/null @@ -1,64 +0,0 @@ -# Test Error Reporting Vercel API - -Write-Host "Testing Vercel Error Reporting System..." -ForegroundColor Cyan -Write-Host "" - -$apiUrl = "https://light-rewards-bot.vercel.app/api/report-error" -$timestamp = [DateTime]::UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ") - -$payload = @{ - error = "Test error from PowerShell script" - stack = "at testFunction (test.ts:42:10)`n at main (index.ts:100:5)" - context = @{ - version = "3.5.6" - platform = "win32" - arch = "x64" - nodeVersion = "v22.0.0" - timestamp = $timestamp - botMode = "TEST" - } -} | ConvertTo-Json -Depth 10 - -Write-Host "Sending test error report..." -ForegroundColor Yellow -Write-Host "Endpoint: $apiUrl" -ForegroundColor Gray -Write-Host "" - -try { - $response = Invoke-RestMethod -Uri $apiUrl -Method Post -Body $payload -ContentType "application/json" -TimeoutSec 15 - - Write-Host "SUCCESS!" -ForegroundColor Green - Write-Host "" - Write-Host "Response:" -ForegroundColor Cyan - $response | ConvertTo-Json -Depth 5 | Write-Host -ForegroundColor White - Write-Host "" - Write-Host "Error report sent successfully!" -ForegroundColor Green - Write-Host "Check your Discord channel for the error report" -ForegroundColor Green - -} catch { - Write-Host "FAILED!" -ForegroundColor Red - Write-Host "" - Write-Host "Error Details:" -ForegroundColor Yellow - Write-Host $_.Exception.Message -ForegroundColor Red - - if ($_.Exception.Response) { - $statusCode = [int]$_.Exception.Response.StatusCode - Write-Host "HTTP Status: $statusCode" -ForegroundColor Yellow - - try { - $reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream()) - $responseBody = $reader.ReadToEnd() - $reader.Close() - Write-Host "Response Body: $responseBody" -ForegroundColor Gray - } catch { - Write-Host "Could not read response body" -ForegroundColor Gray - } - } - - Write-Host "" - Write-Host "Common issues:" -ForegroundColor Yellow - Write-Host " 1. DISCORD_ERROR_WEBHOOK_URL not set in Vercel" -ForegroundColor Gray - Write-Host " 2. Webhook URL invalid or deleted" -ForegroundColor Gray - Write-Host " 3. Vercel deployment not finished" -ForegroundColor Gray -} - -Write-Host "" diff --git a/test-security.ps1 b/test-security.ps1 deleted file mode 100644 index f34c2ac..0000000 --- a/test-security.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -# Test Error Reporting Security - -Write-Host "Testing Discord mention sanitization..." -ForegroundColor Cyan -Write-Host "" - -$apiUrl = "https://light-rewards-bot.vercel.app/api/report-error" - -# Test avec des mentions Discord malveillantes -$payload = @{ - error = "Test @everyone @here error with <@123456789> user mention" - stack = "at testFunction <@&987654321> role mention`n at main <#555555555> channel" - context = @{ - version = "3.5.6" - platform = "win32" - arch = "x64" - nodeVersion = "v22.0.0" - timestamp = [DateTime]::UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ") - botMode = "SECURITY_TEST" - } -} | ConvertTo-Json -Depth 10 - -Write-Host "Payload with malicious mentions:" -ForegroundColor Yellow -Write-Host $payload -ForegroundColor Gray -Write-Host "" - -try { - $response = Invoke-RestMethod -Uri $apiUrl -Method Post -Body $payload -ContentType "application/json" -TimeoutSec 15 - - Write-Host "SUCCESS - Sanitization applied!" -ForegroundColor Green - Write-Host "" - Write-Host "Check Discord - mentions should be neutralized:" -ForegroundColor Cyan - Write-Host " @everyone -> @everyone" -ForegroundColor Gray - Write-Host " @here -> @here" -ForegroundColor Gray - Write-Host " <@123456789> -> @user" -ForegroundColor Gray - Write-Host " <@&987654321> -> @role" -ForegroundColor Gray - Write-Host " <#555555555> -> #channel" -ForegroundColor Gray - -} catch { - Write-Host "FAILED!" -ForegroundColor Red - Write-Host $_.Exception.Message -ForegroundColor Red -} - -Write-Host ""