@muhammedaksam/easiarr 0.8.4 → 0.9.0

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.
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Migration: remove cloudflare dns api token
3
+ * Removes the unused CLOUDFLARE_DNS_API_TOKEN from .env
4
+ */
5
+
6
+ import { existsSync, readFileSync, writeFileSync } from "node:fs"
7
+ import { getEnvPath } from "../env"
8
+ import { debugLog } from "../debug"
9
+
10
+ export const name = "remove_cloudflare_dns_api_token"
11
+
12
+ export function up(): boolean {
13
+ debugLog("Migrations", "Running migration: remove_cloudflare_dns_api_token")
14
+
15
+ const envPath = getEnvPath()
16
+ if (!existsSync(envPath)) {
17
+ debugLog("Migrations", ".env file not found, skipping")
18
+ return true
19
+ }
20
+
21
+ const content = readFileSync(envPath, "utf-8")
22
+
23
+ // Check if CLOUDFLARE_DNS_API_TOKEN exists
24
+ if (!content.includes("CLOUDFLARE_DNS_API_TOKEN")) {
25
+ debugLog("Migrations", "CLOUDFLARE_DNS_API_TOKEN not found, skipping")
26
+ return true
27
+ }
28
+
29
+ // Remove the line containing CLOUDFLARE_DNS_API_TOKEN
30
+ const lines = content.split("\n")
31
+ const filtered = lines.filter((line) => !line.startsWith("CLOUDFLARE_DNS_API_TOKEN="))
32
+ const newContent = filtered.join("\n")
33
+
34
+ writeFileSync(envPath, newContent, "utf-8")
35
+ debugLog("Migrations", "Removed CLOUDFLARE_DNS_API_TOKEN from .env")
36
+
37
+ return true
38
+ }
39
+
40
+ export function down(): boolean {
41
+ debugLog("Migrations", "Reverting migration: remove_cloudflare_dns_api_token")
42
+ // No revert needed - the token was unused
43
+ return true
44
+ }
@@ -69,6 +69,30 @@ async function loadMigrations(): Promise<Migration[]> {
69
69
  debugLog("Migrations", `Failed to load migration: ${e}`)
70
70
  }
71
71
 
72
+ try {
73
+ const m1765707135 = await import("./migrations/1765707135_rename_easiarr_status")
74
+ migrations.push({
75
+ timestamp: "1765707135",
76
+ name: m1765707135.name,
77
+ up: m1765707135.up,
78
+ down: m1765707135.down,
79
+ })
80
+ } catch (e) {
81
+ debugLog("Migrations", `Failed to load migration: ${e}`)
82
+ }
83
+
84
+ try {
85
+ const m1765732722 = await import("./migrations/1765732722_remove_cloudflare_dns_api_token")
86
+ migrations.push({
87
+ timestamp: "1765732722",
88
+ name: m1765732722.name,
89
+ up: m1765732722.up,
90
+ down: m1765732722.down,
91
+ })
92
+ } catch (e) {
93
+ debugLog("Migrations", `Failed to load migration: ${e}`)
94
+ }
95
+
72
96
  // Add future migrations here:
73
97
  // const m2 = await import("./migrations/1734xxxxxx_xxx")
74
98
  // migrations.push({ timestamp: "...", name: m2.name, up: m2.up })