mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-10 17:26:17 +00:00
feat: bump version to 3.5.2 and add optional webhooks for error reporting
This commit is contained in:
10
package-lock.json
generated
10
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "microsoft-rewards-bot",
|
"name": "microsoft-rewards-bot",
|
||||||
"version": "3.5.1",
|
"version": "3.5.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "microsoft-rewards-bot",
|
"name": "microsoft-rewards-bot",
|
||||||
"version": "3.0.0",
|
"version": "3.5.2",
|
||||||
"license": "CC-BY-NC-SA-4.0",
|
"license": "CC-BY-NC-SA-4.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.8.4",
|
"axios": "^1.8.4",
|
||||||
@@ -450,6 +450,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.24.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.24.tgz",
|
||||||
"integrity": "sha512-FE5u0ezmi6y9OZEzlJfg37mqqf6ZDSF2V/NLjUyGrR9uTZ7Sb9F7bLNZ03S4XVUNRWGA7Ck4c1kK+YnuWjl+DA==",
|
"integrity": "sha512-FE5u0ezmi6y9OZEzlJfg37mqqf6ZDSF2V/NLjUyGrR9uTZ7Sb9F7bLNZ03S4XVUNRWGA7Ck4c1kK+YnuWjl+DA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~6.21.0"
|
"undici-types": "~6.21.0"
|
||||||
}
|
}
|
||||||
@@ -737,6 +738,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
|
||||||
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"acorn": "bin/acorn"
|
"acorn": "bin/acorn"
|
||||||
},
|
},
|
||||||
@@ -987,6 +989,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"baseline-browser-mapping": "^2.8.19",
|
"baseline-browser-mapping": "^2.8.19",
|
||||||
"caniuse-lite": "^1.0.30001751",
|
"caniuse-lite": "^1.0.30001751",
|
||||||
@@ -1559,6 +1562,7 @@
|
|||||||
"deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
|
"deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.6.1",
|
"@eslint-community/regexpp": "^4.6.1",
|
||||||
@@ -3213,6 +3217,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.52.0.tgz",
|
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.52.0.tgz",
|
||||||
"integrity": "sha512-JAwMNMBlxJ2oD1kce4KPtMkDeKGHQstdpFPcPH3maElAXon/QZeTvtsfXmTMRyO9TslfoYOXkSsvao2nE1ilTw==",
|
"integrity": "sha512-JAwMNMBlxJ2oD1kce4KPtMkDeKGHQstdpFPcPH3maElAXon/QZeTvtsfXmTMRyO9TslfoYOXkSsvao2nE1ilTw==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"playwright-core": "1.52.0"
|
"playwright-core": "1.52.0"
|
||||||
},
|
},
|
||||||
@@ -3972,6 +3977,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "microsoft-rewards-bot",
|
"name": "microsoft-rewards-bot",
|
||||||
"version": "3.5.1",
|
"version": "3.5.2",
|
||||||
"description": "Automate Microsoft Rewards points collection",
|
"description": "Automate Microsoft Rewards points collection",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ export interface ConfigScheduling {
|
|||||||
|
|
||||||
export interface ConfigErrorReporting {
|
export interface ConfigErrorReporting {
|
||||||
enabled?: boolean; // enable automatic error reporting to community webhook (default: true)
|
enabled?: boolean; // enable automatic error reporting to community webhook (default: true)
|
||||||
|
webhooks?: string[]; // Optional array of webhook URLs (plain or base64-encoded)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,6 +5,15 @@ import path from 'path'
|
|||||||
import { DISCORD } from '../../constants'
|
import { DISCORD } from '../../constants'
|
||||||
import { Config } from '../../interface/Config'
|
import { Config } from '../../interface/Config'
|
||||||
|
|
||||||
|
interface DiscordEmbed {
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
color: number
|
||||||
|
fields: Array<{ name: string; value: string; inline: boolean }>
|
||||||
|
timestamp: string
|
||||||
|
footer: { text: string; icon_url: string }
|
||||||
|
}
|
||||||
|
|
||||||
interface ErrorReportPayload {
|
interface ErrorReportPayload {
|
||||||
error: string
|
error: string
|
||||||
stack?: string
|
stack?: string
|
||||||
@@ -58,8 +67,11 @@ function buildDiscordPayload(config: Config, error: Error | string, additionalCo
|
|||||||
|
|
||||||
if (additionalContext) {
|
if (additionalContext) {
|
||||||
for (const [key, value] of Object.entries(additionalContext)) {
|
for (const [key, value] of Object.entries(additionalContext)) {
|
||||||
if (typeof value === 'string') payloadContext[key as keyof typeof payloadContext] = sanitizeSensitiveText(value)
|
if (typeof value === 'string') {
|
||||||
else payloadContext[key as keyof typeof payloadContext] = value as unknown
|
(payloadContext as Record<string, unknown>)[key] = sanitizeSensitiveText(value)
|
||||||
|
} else {
|
||||||
|
(payloadContext as Record<string, unknown>)[key] = value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +85,7 @@ function buildDiscordPayload(config: Config, error: Error | string, additionalCo
|
|||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|
||||||
const embed: unknown = {
|
const embed: DiscordEmbed = {
|
||||||
title: '🐛 Automatic Error Report',
|
title: '🐛 Automatic Error Report',
|
||||||
description: `\`\`\`js\n${sanitizedMessage.slice(0, 700)}\n\`\`\``,
|
description: `\`\`\`js\n${sanitizedMessage.slice(0, 700)}\n\`\`\``,
|
||||||
color: DISCORD.COLOR_RED,
|
color: DISCORD.COLOR_RED,
|
||||||
|
|||||||
Reference in New Issue
Block a user