@muhammedaksam/easiarr 0.4.3 → 0.5.1

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.
@@ -45,7 +45,11 @@ export class ProwlarrSetup extends BoxRenderable {
45
45
  const { container: pageContainer, content: contentBox } = createPageLayout(cliRenderer, {
46
46
  title: "Prowlarr Setup",
47
47
  stepInfo: "Configure indexer sync and proxies",
48
- footerHint: "↑↓ Navigate Enter Select Esc Back",
48
+ footerHint: [
49
+ { type: "key", key: "↑↓", value: "Navigate" },
50
+ { type: "key", key: "Enter", value: "Select" },
51
+ { type: "key", key: "Esc", value: "Back" },
52
+ ],
49
53
  })
50
54
  super(cliRenderer, { width: "100%", height: "100%" })
51
55
  this.add(pageContainer)
@@ -34,7 +34,10 @@ export class QBittorrentSetup extends BoxRenderable {
34
34
  const { container: pageContainer, content: contentBox } = createPageLayout(cliRenderer, {
35
35
  title: "qBittorrent Setup",
36
36
  stepInfo: "Configure TRaSH-compliant paths and categories",
37
- footerHint: "Enter Submit Esc Back",
37
+ footerHint: [
38
+ { type: "key", key: "Enter", value: "Submit" },
39
+ { type: "key", key: "Esc", value: "Back" },
40
+ ],
38
41
  })
39
42
  super(cliRenderer, { width: "100%", height: "100%" })
40
43
  this.add(pageContainer)
@@ -106,7 +106,10 @@ export class QuickSetup {
106
106
  private renderWelcome(): void {
107
107
  const { container: page, content } = createPageLayout(this.renderer, {
108
108
  title: "Welcome to easiarr",
109
- footerHint: "Enter Select q Quit",
109
+ footerHint: [
110
+ { type: "key", key: "Enter", value: "Select" },
111
+ { type: "key", key: "q", value: "Quit" },
112
+ ],
110
113
  })
111
114
 
112
115
  // Spacer
@@ -248,7 +251,10 @@ export class QuickSetup {
248
251
 
249
252
  const { container: page, content } = createPageLayout(this.renderer, {
250
253
  title: "About easiarr",
251
- footerHint: "Esc Back q Quit",
254
+ footerHint: [
255
+ { type: "key", key: "Esc", value: "Back" },
256
+ { type: "key", key: "q", value: "Quit" },
257
+ ],
252
258
  })
253
259
 
254
260
  content.add(new TextRenderable(this.renderer, { id: "about-spacer1", content: "" }))
@@ -347,12 +353,16 @@ export class QuickSetup {
347
353
  private renderAppSelection(): void {
348
354
  const title = "Select Apps"
349
355
  const stepInfo = `${title} (${this.selectedApps.size} selected)`
350
- const footerHint = "←→ Tab Enter Toggle q Quit"
356
+ const footerHint = [
357
+ { type: "key", key: "←→", value: "Tab" },
358
+ { type: "key", key: "Enter", value: "Toggle" },
359
+ { type: "key", key: "q", value: "Quit" },
360
+ ] as const
351
361
 
352
362
  const { container: page, content } = createPageLayout(this.renderer, {
353
363
  title: title,
354
364
  stepInfo: stepInfo,
355
- footerHint: footerHint,
365
+ footerHint: [...footerHint],
356
366
  })
357
367
 
358
368
  // Application Selector
@@ -442,7 +452,12 @@ export class QuickSetup {
442
452
  const { container: page, content } = createPageLayout(this.renderer, {
443
453
  title: "System Configuration",
444
454
  stepInfo: `Step 2/${totalSteps}`,
445
- footerHint: "Tab Next Enter Next/Continue Esc Back q Quit",
455
+ footerHint: [
456
+ { type: "key", key: "Tab", value: "Next" },
457
+ { type: "key", key: "Enter", value: "Next/Continue" },
458
+ { type: "key", key: "Esc", value: "Back" },
459
+ { type: "key", key: "q", value: "Quit" },
460
+ ],
446
461
  })
447
462
 
448
463
  // Instructions
@@ -580,7 +595,11 @@ export class QuickSetup {
580
595
  const { container: page, content } = createPageLayout(this.renderer, {
581
596
  title: "VPN Configuration",
582
597
  stepInfo: `Step ${stepNum}/${totalSteps}`,
583
- footerHint: "Enter Select Esc Back q Quit",
598
+ footerHint: [
599
+ { type: "key", key: "Enter", value: "Select" },
600
+ { type: "key", key: "Esc", value: "Back" },
601
+ { type: "key", key: "q", value: "Quit" },
602
+ ],
584
603
  })
585
604
 
586
605
  content.add(
@@ -667,7 +686,12 @@ export class QuickSetup {
667
686
  const { container: page, content } = createPageLayout(this.renderer, {
668
687
  title: "Traefik Configuration",
669
688
  stepInfo: `Step ${stepNum}/${totalSteps}`,
670
- footerHint: "Tab Next Field Enter Continue Esc Back q Quit",
689
+ footerHint: [
690
+ { type: "key", key: "Tab", value: "Next Field" },
691
+ { type: "key", key: "Enter", value: "Continue" },
692
+ { type: "key", key: "Esc", value: "Back" },
693
+ { type: "key", key: "q", value: "Quit" },
694
+ ],
671
695
  })
672
696
 
673
697
  content.add(
@@ -908,7 +932,11 @@ export class QuickSetup {
908
932
  const { container: page, content } = createPageLayout(this.renderer, {
909
933
  title: "Confirm Setup",
910
934
  stepInfo: `Step ${totalSteps}/${totalSteps}`,
911
- footerHint: "Enter Select Esc Back q Quit",
935
+ footerHint: [
936
+ { type: "key", key: "Enter", value: "Select" },
937
+ { type: "key", key: "Esc", value: "Back" },
938
+ { type: "key", key: "q", value: "Quit" },
939
+ ],
912
940
  })
913
941
 
914
942
  content.add(new TextRenderable(this.renderer, { id: "confirm-spacer", content: "" }))
@@ -44,7 +44,12 @@ export class TRaSHProfileSetup extends BoxRenderable {
44
44
  const { container: pageContainer, content: contentBox } = createPageLayout(cliRenderer, {
45
45
  title: "TRaSH Guide Setup",
46
46
  stepInfo: "Configure quality profiles and custom formats",
47
- footerHint: "↑↓ Navigate Space Select Enter Confirm Esc Back",
47
+ footerHint: [
48
+ { type: "key", key: "↑↓", value: "Navigate" },
49
+ { type: "key", key: "Space", value: "Select" },
50
+ { type: "key", key: "Enter", value: "Confirm" },
51
+ { type: "key", key: "Esc", value: "Back" },
52
+ ],
48
53
  })
49
54
  super(cliRenderer, { width: "100%", height: "100%" })
50
55
  this.add(pageContainer)
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Password Utilities
3
+ * Helpers for password validation and transformation
4
+ */
5
+
6
+ /**
7
+ * Ensures a password meets minimum length requirements by repeating it.
8
+ * If the password is already long enough, returns it unchanged.
9
+ *
10
+ * @param password - The original password
11
+ * @param minLength - Minimum required length
12
+ * @returns Password padded to at least minLength characters
13
+ */
14
+ export function ensureMinPasswordLength(password: string, minLength: number): string {
15
+ if (!password || password.length === 0) {
16
+ throw new Error("Password cannot be empty")
17
+ }
18
+
19
+ if (password.length >= minLength) {
20
+ return password
21
+ }
22
+
23
+ // Repeat the password until it meets minimum length
24
+ let extendedPassword = password
25
+ while (extendedPassword.length < minLength) {
26
+ extendedPassword += password
27
+ }
28
+
29
+ // Return exactly minLength characters
30
+ return extendedPassword.slice(0, minLength)
31
+ }
32
+
33
+ /**
34
+ * Validates if a password meets minimum length requirements.
35
+ *
36
+ * @param password - The password to validate
37
+ * @param minLength - Minimum required length
38
+ * @returns true if password meets requirements
39
+ */
40
+ export function isPasswordValid(password: string, minLength: number): boolean {
41
+ return password !== undefined && password !== null && password.length >= minLength
42
+ }