favacli 0.0.11 → 0.0.12

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.
@@ -4,6 +4,7 @@ declare class SetServerUrlCommand extends BaseCommand {
4
4
  static usage: import("clipanion").Usage;
5
5
  requireTwoFaLib: boolean;
6
6
  serverUrl: string;
7
+ force: boolean | undefined;
7
8
  exec(): Promise<{
8
9
  success: boolean;
9
10
  }>;
@@ -5,6 +5,9 @@ class SetServerUrlCommand extends BaseCommand {
5
5
  super(...arguments);
6
6
  this.requireTwoFaLib = true;
7
7
  this.serverUrl = Option.String({ required: true });
8
+ this.force = Option.Boolean('--force', {
9
+ description: 'Set serverUrl even if connection fails',
10
+ });
8
11
  }
9
12
  static { this.paths = [['sync', 'setServerUrl']]; }
10
13
  static { this.usage = BaseCommand.Usage({
@@ -12,7 +15,7 @@ class SetServerUrlCommand extends BaseCommand {
12
15
  description: 'Set the server URL for syncing',
13
16
  details: `
14
17
  This command sets the URL of the server that will be used for syncing.
15
-
18
+
16
19
  The server URL must be provided as an argument.
17
20
  `,
18
21
  examples: [
@@ -20,7 +23,7 @@ class SetServerUrlCommand extends BaseCommand {
20
23
  ],
21
24
  }); }
22
25
  async exec() {
23
- await this.twoFaLib.setSyncServerUrl(this.serverUrl);
26
+ await this.twoFaLib.setSyncServerUrl(this.serverUrl, this.force);
24
27
  return { success: true };
25
28
  }
26
29
  }
@@ -3,6 +3,7 @@ declare class VaultDeleteCommand extends BaseCommand {
3
3
  static paths: string[][];
4
4
  requireTwoFaLib: boolean;
5
5
  static usage: import("clipanion").Usage;
6
+ force: boolean | undefined;
6
7
  exec(): Promise<{
7
8
  success: boolean;
8
9
  cancelled: boolean;
@@ -1,10 +1,14 @@
1
1
  import fs from 'node:fs/promises';
2
+ import { Option } from 'clipanion';
2
3
  import { confirm } from '@inquirer/prompts';
3
4
  import BaseCommand from '../../BaseCommand.mjs';
4
5
  class VaultDeleteCommand extends BaseCommand {
5
6
  constructor() {
6
7
  super(...arguments);
7
8
  this.requireTwoFaLib = false;
9
+ this.force = Option.Boolean('--force', {
10
+ description: 'Delete the vault without confirmation',
11
+ });
8
12
  }
9
13
  static { this.paths = [['vault', 'delete']]; }
10
14
  static { this.usage = BaseCommand.Usage({
@@ -17,13 +21,15 @@ class VaultDeleteCommand extends BaseCommand {
17
21
  examples: [['Delete the current vault', 'vault delete']],
18
22
  }); }
19
23
  async exec() {
20
- const shouldDelete = await confirm({
21
- message: 'Are you sure you want to delete the vault? This action cannot be undone.',
22
- default: false,
23
- });
24
- if (!shouldDelete) {
25
- this.output('Vault deletion cancelled.\n');
26
- return { success: false, cancelled: true };
24
+ if (!this.force) {
25
+ const shouldDelete = await confirm({
26
+ message: 'Are you sure you want to delete the vault? This action cannot be undone.',
27
+ default: false,
28
+ });
29
+ if (!shouldDelete) {
30
+ this.output('Vault deletion cancelled.\n');
31
+ return { success: false, cancelled: true };
32
+ }
27
33
  }
28
34
  await fs.rm(this.settings.vaultLocation);
29
35
  this.output('Vault deleted successfully.\n');
package/build/main.mjs CHANGED
@@ -16,7 +16,7 @@ const [, , ...args] = process.argv;
16
16
  const cli = new Cli({
17
17
  binaryLabel: 'FavaCli',
18
18
  binaryName: `favacli`,
19
- binaryVersion: '0.0.11',
19
+ binaryVersion: '0.0.12',
20
20
  });
21
21
  cli.register(VaultCreateCommand);
22
22
  cli.register(VaultDeleteCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "favacli",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "author": "",
@@ -10,7 +10,7 @@
10
10
  "bufferutil": "^4.0.8",
11
11
  "clipanion": "^4.0.0-rc.4",
12
12
  "env-paths": "^3.0.0",
13
- "favalib": "^0.0.2",
13
+ "favalib": "^0.0.3",
14
14
  "keytar": "^7.9.0",
15
15
  "node-loader": "^2.0.0",
16
16
  "ts-loader": "^9.5.1",