@lvnt/release-radar 1.9.7 → 1.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -494,6 +494,36 @@ bot.onText(/\/mirror(?:\s+(.+))?/, async (msg, match) => {
494
494
  await bot.sendMessage(validatedChatId, `❌ Mirror failed: ${result.error}`);
495
495
  }
496
496
  });
497
+ bot.onText(/\/resetversion(?:\s+(.+))?/, async (msg, match) => {
498
+ if (msg.chat.id.toString() !== validatedChatId)
499
+ return;
500
+ const toolName = match?.[1]?.trim();
501
+ if (!toolName) {
502
+ await bot.sendMessage(validatedChatId, 'Usage: /resetversion <toolname>\nExample: /resetversion Python\n\nThis clears the stored version so the next /check will re-fetch it.');
503
+ return;
504
+ }
505
+ const deleted = storage.deleteVersion(toolName);
506
+ if (deleted) {
507
+ await bot.sendMessage(validatedChatId, `✅ Reset "${toolName}". Run /check to fetch the current version.`);
508
+ }
509
+ else {
510
+ await bot.sendMessage(validatedChatId, `Tool "${toolName}" not found in storage.`);
511
+ }
512
+ });
513
+ bot.onText(/\/resetall/, async (msg) => {
514
+ if (msg.chat.id.toString() !== validatedChatId)
515
+ return;
516
+ const versions = storage.getAllVersions();
517
+ const toolNames = Object.keys(versions);
518
+ if (toolNames.length === 0) {
519
+ await bot.sendMessage(validatedChatId, 'No versions stored.');
520
+ return;
521
+ }
522
+ for (const toolName of toolNames) {
523
+ storage.deleteVersion(toolName);
524
+ }
525
+ await bot.sendMessage(validatedChatId, `✅ Reset ${toolNames.length} tools. Run /check to re-fetch all versions.`);
526
+ });
497
527
  // Start scheduled checks
498
528
  scheduleChecks();
499
529
  const mode = configData.scheduleMode || 'interval';
package/dist/storage.d.ts CHANGED
@@ -15,4 +15,6 @@ export declare class Storage {
15
15
  getMirrorUrl(toolName: string): string | null;
16
16
  setMirrorUrl(toolName: string, url: string): void;
17
17
  getAllMirrorUrls(): Record<string, string>;
18
+ deleteVersion(toolName: string): boolean;
19
+ getAllVersions(): Record<string, string>;
18
20
  }
package/dist/storage.js CHANGED
@@ -53,4 +53,20 @@ export class Storage {
53
53
  const state = this.ensureLoaded();
54
54
  return state.mirrorUrls ?? {};
55
55
  }
56
+ deleteVersion(toolName) {
57
+ const state = this.ensureLoaded();
58
+ if (toolName in state.versions) {
59
+ delete state.versions[toolName];
60
+ if (state.mirrorUrls && toolName in state.mirrorUrls) {
61
+ delete state.mirrorUrls[toolName];
62
+ }
63
+ this.save(state);
64
+ return true;
65
+ }
66
+ return false;
67
+ }
68
+ getAllVersions() {
69
+ const state = this.ensureLoaded();
70
+ return state.versions;
71
+ }
56
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvnt/release-radar",
3
- "version": "1.9.7",
3
+ "version": "1.9.8",
4
4
  "description": "Monitor tool versions and notify via Telegram when updates are detected",
5
5
  "main": "dist/index.js",
6
6
  "bin": {