envware 1.2.7 → 1.2.9

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/README.md CHANGED
@@ -58,6 +58,7 @@ npx envware pull
58
58
  - `backup`: Create an encrypted local JSON backup of all owned projects.
59
59
  - `restore`: Restore secrets from a local backup file.
60
60
  - `keys`: Manage your authorized devices and SSH keys.
61
+ - `nuke`: Permanently delete your account and all data.
61
62
  - `status`: Check your plan and usage.
62
63
  - `upgrade`: Upgrade to Premium for higher limits.
63
64
 
@@ -23,6 +23,7 @@ const status_command_1 = require("./commands/status.command");
23
23
  const backup_command_1 = require("./commands/backup.command");
24
24
  const restore_command_1 = require("./commands/restore.command");
25
25
  const keys_command_1 = require("./commands/keys.command");
26
+ const nuke_command_1 = require("./commands/nuke.command");
26
27
  const api_service_1 = require("./services/api.service");
27
28
  const config_service_1 = require("./services/config.service");
28
29
  const encryption_service_1 = require("./services/encryption.service");
@@ -47,6 +48,7 @@ exports.AppModule = AppModule = __decorate([
47
48
  backup_command_1.BackupCommand,
48
49
  restore_command_1.RestoreCommand,
49
50
  keys_command_1.KeysCommand,
51
+ nuke_command_1.NukeCommand,
50
52
  api_service_1.ApiService,
51
53
  config_service_1.ConfigService,
52
54
  encryption_service_1.EncryptionService,
@@ -1 +1 @@
1
- {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,8DAA0D;AAC1D,4DAAwD;AACxD,gEAA4D;AAC5D,0DAAsD;AACtD,0DAAsD;AACtD,4DAAwD;AACxD,8DAA0D;AAC1D,8DAA0D;AAC1D,0DAAsD;AACtD,gEAA4D;AAC5D,gEAA4D;AAC5D,8DAA0D;AAC1D,8DAA0D;AAC1D,gEAA4D;AAC5D,0DAAsD;AACtD,wDAAoD;AACpD,8DAA0D;AAC1D,sEAAkE;AAwB3D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAtBrB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,8BAAa;YACb,4BAAY;YACZ,gCAAc;YACd,0BAAW;YACX,0BAAW;YACX,4BAAY;YACZ,8BAAa;YACb,8BAAa;YACb,0BAAW;YACX,gCAAc;YACd,gCAAc;YACd,8BAAa;YACb,8BAAa;YACb,gCAAc;YACd,0BAAW;YACX,wBAAU;YACV,8BAAa;YACb,sCAAiB;SAClB;KACF,CAAC;GACW,SAAS,CAAG"}
1
+ {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,8DAA0D;AAC1D,4DAAwD;AACxD,gEAA4D;AAC5D,0DAAsD;AACtD,0DAAsD;AACtD,4DAAwD;AACxD,8DAA0D;AAC1D,8DAA0D;AAC1D,0DAAsD;AACtD,gEAA4D;AAC5D,gEAA4D;AAC5D,8DAA0D;AAC1D,8DAA0D;AAC1D,gEAA4D;AAC5D,0DAAsD;AACtD,0DAAsD;AACtD,wDAAoD;AACpD,8DAA0D;AAC1D,sEAAkE;AAyB3D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAvBrB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,8BAAa;YACb,4BAAY;YACZ,gCAAc;YACd,0BAAW;YACX,0BAAW;YACX,4BAAY;YACZ,8BAAa;YACb,8BAAa;YACb,0BAAW;YACX,gCAAc;YACd,gCAAc;YACd,8BAAa;YACb,8BAAa;YACb,gCAAc;YACd,0BAAW;YACX,0BAAW;YACX,wBAAU;YACV,8BAAa;YACb,sCAAiB;SAClB;KACF,CAAC;GACW,SAAS,CAAG"}
@@ -0,0 +1,9 @@
1
+ import { CommandRunner } from 'nest-commander';
2
+ import { ApiService } from '../services/api.service';
3
+ import { ConfigService } from '../services/config.service';
4
+ export declare class NukeCommand extends CommandRunner {
5
+ private apiService;
6
+ private configService;
7
+ constructor(apiService: ApiService, configService: ConfigService);
8
+ run(): Promise<void>;
9
+ }
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.NukeCommand = void 0;
16
+ const nest_commander_1 = require("nest-commander");
17
+ const api_service_1 = require("../services/api.service");
18
+ const config_service_1 = require("../services/config.service");
19
+ const chalk_1 = __importDefault(require("chalk"));
20
+ const inquirer_1 = __importDefault(require("inquirer"));
21
+ let NukeCommand = class NukeCommand extends nest_commander_1.CommandRunner {
22
+ apiService;
23
+ configService;
24
+ constructor(apiService, configService) {
25
+ super();
26
+ this.apiService = apiService;
27
+ this.configService = configService;
28
+ }
29
+ async run() {
30
+ console.log(chalk_1.default.red.bold('\n⚠️ DANGER ZONE ⚠️'));
31
+ console.log(chalk_1.default.red('This action is irreversible. All your projects, secrets, and authorized keys will be deleted forever.\n'));
32
+ const { confirmEmail } = await inquirer_1.default.prompt([
33
+ {
34
+ type: 'input',
35
+ name: 'confirmEmail',
36
+ message: 'To confirm, please type your email address:',
37
+ },
38
+ ]);
39
+ const { data: me } = await this.apiService.instance.get('/auth/me');
40
+ if (confirmEmail !== me.email) {
41
+ console.log(chalk_1.default.yellow('\nVerification failed. The email provided does not match your account. Action cancelled. 🌸'));
42
+ return;
43
+ }
44
+ const { finalConsent } = await inquirer_1.default.prompt([
45
+ {
46
+ type: 'confirm',
47
+ name: 'finalConsent',
48
+ message: chalk_1.default.red.bold('Are you ABSOLUTELY sure? There is no "undo" button.'),
49
+ default: false,
50
+ },
51
+ ]);
52
+ if (!finalConsent) {
53
+ console.log(chalk_1.default.yellow('\nPhew! That was close. Account is safe. 🌸'));
54
+ return;
55
+ }
56
+ try {
57
+ console.log(chalk_1.default.gray('\nNuking account from orbit... 🚀💥'));
58
+ await this.apiService.instance.delete('/auth/me');
59
+ this.configService.delete('token');
60
+ console.log(chalk_1.default.green('\n✔ Your account and all data have been deleted. We are sorry to see you go. 🌸'));
61
+ console.log(chalk_1.default.gray('Goodbye, traveler.\n'));
62
+ }
63
+ catch (error) {
64
+ const message = error.response?.data?.error || error.message;
65
+ console.log(chalk_1.default.red('\nFailed to delete account: ' + message));
66
+ }
67
+ }
68
+ };
69
+ exports.NukeCommand = NukeCommand;
70
+ exports.NukeCommand = NukeCommand = __decorate([
71
+ (0, nest_commander_1.Command)({ name: 'nuke', description: 'Permanently delete your account and all associated data' }),
72
+ __metadata("design:paramtypes", [api_service_1.ApiService,
73
+ config_service_1.ConfigService])
74
+ ], NukeCommand);
75
+ //# sourceMappingURL=nuke.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nuke.command.js","sourceRoot":"","sources":["../../src/commands/nuke.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAwD;AACxD,yDAAqD;AACrD,+DAA2D;AAC3D,kDAA0B;AAC1B,wDAAgC;AAGzB,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,8BAAa;IAElC;IACA;IAFV,YACU,UAAsB,EACtB,aAA4B;QAEpC,KAAK,EAAE,CAAC;QAHA,eAAU,GAAV,UAAU,CAAY;QACtB,kBAAa,GAAb,aAAa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lD,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAEnC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,iFAAiF,CAAC,CAAC,CAAC;YAC5G,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAElD,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC;YAC7D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,8BAA8B,GAAG,OAAO,CAAC,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;CACF,CAAA;AAxDY,kCAAW;sBAAX,WAAW;IADvB,IAAA,wBAAO,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;qCAG1E,wBAAU;QACP,8BAAa;GAH3B,WAAW,CAwDvB"}
@@ -1,7 +1,9 @@
1
1
  import { CommandRunner } from 'nest-commander';
2
2
  import { ApiService } from '../services/api.service';
3
+ import { PushCommand } from './push.command';
3
4
  export declare class VerifyCommand extends CommandRunner {
4
5
  private apiService;
5
- constructor(apiService: ApiService);
6
+ private pushCommand;
7
+ constructor(apiService: ApiService, pushCommand: PushCommand);
6
8
  run(passedParams: string[]): Promise<void>;
7
9
  }
@@ -15,13 +15,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.VerifyCommand = void 0;
16
16
  const nest_commander_1 = require("nest-commander");
17
17
  const api_service_1 = require("../services/api.service");
18
+ const push_command_1 = require("./push.command");
18
19
  const chalk_1 = __importDefault(require("chalk"));
19
20
  const inquirer_1 = __importDefault(require("inquirer"));
20
21
  let VerifyCommand = class VerifyCommand extends nest_commander_1.CommandRunner {
21
22
  apiService;
22
- constructor(apiService) {
23
+ pushCommand;
24
+ constructor(apiService, pushCommand) {
23
25
  super();
24
26
  this.apiService = apiService;
27
+ this.pushCommand = pushCommand;
25
28
  }
26
29
  async run(passedParams) {
27
30
  let [code] = passedParams;
@@ -38,8 +41,10 @@ let VerifyCommand = class VerifyCommand extends nest_commander_1.CommandRunner {
38
41
  try {
39
42
  const response = await this.apiService.instance.post('/secrets/public-key/verify', { code });
40
43
  if (response.data.success) {
41
- console.log(chalk_1.default.green('✔ SSH Key verified and updated successfully!'));
42
- console.log(chalk_1.default.blue('You can now use your new key for all operations.'));
44
+ console.log(chalk_1.default.green('✔ SSH Key verified and updated successfully! 🌸'));
45
+ console.log(chalk_1.default.blue('Your device is now authorized.\n'));
46
+ console.log(chalk_1.default.magenta('Resuming your push operation... 🚀'));
47
+ await this.pushCommand.run([], { env: '.env' });
43
48
  }
44
49
  }
45
50
  catch (error) {
@@ -54,6 +59,7 @@ exports.VerifyCommand = VerifyCommand = __decorate([
54
59
  name: 'verify',
55
60
  description: 'Verify a new SSH key using the code sent to your email',
56
61
  }),
57
- __metadata("design:paramtypes", [api_service_1.ApiService])
62
+ __metadata("design:paramtypes", [api_service_1.ApiService,
63
+ push_command_1.PushCommand])
58
64
  ], VerifyCommand);
59
65
  //# sourceMappingURL=verify.command.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verify.command.js","sourceRoot":"","sources":["../../src/commands/verify.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAwD;AACxD,yDAAqD;AACrD,kDAA0B;AAC1B,wDAAgC;AAMzB,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,8BAAa;IAC1B;IAApB,YAAoB,UAAsB;QACxC,KAAK,EAAE,CAAC;QADU,eAAU,GAAV,UAAU,CAAY;IAE1C,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,YAAsB;QAC9B,IAAI,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC;QAE1B,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,MAAM,GAAG,MAAM,kBAA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