envware 1.3.2 → 1.3.3

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.
@@ -16,6 +16,7 @@ const pull_command_1 = require("./commands/pull.command");
16
16
  const request_command_1 = require("./commands/request.command");
17
17
  const approve_command_1 = require("./commands/approve.command");
18
18
  const sync_access_command_1 = require("./commands/sync-access.command");
19
+ const team_command_1 = require("./commands/team.command");
19
20
  const team_invite_command_1 = require("./commands/team-invite.command");
20
21
  const verify_command_1 = require("./commands/verify.command");
21
22
  const envs_command_1 = require("./commands/envs.command");
@@ -43,6 +44,7 @@ exports.AppModule = AppModule = __decorate([
43
44
  request_command_1.RequestCommand,
44
45
  approve_command_1.ApproveCommand,
45
46
  sync_access_command_1.SyncAccessCommand,
47
+ team_command_1.TeamCommand,
46
48
  team_invite_command_1.TeamInviteCommand,
47
49
  verify_command_1.VerifyCommand,
48
50
  envs_command_1.EnvsCommand,
@@ -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,gEAA4D;AAC5D,gEAA4D;AAC5D,wEAAmE;AACnE,wEAAmE;AACnE,8DAA0D;AAC1D,0DAAsD;AACtD,gEAA4D;AAC5D,gEAA4D;AAC5D,8DAA0D;AAC1D,8DAA0D;AAC1D,gEAA4D;AAC5D,0DAAsD;AACtD,0DAAsD;AACtD,wDAAoD;AACpD,8DAA0D;AAC1D,sEAAkE;AA2B3D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IAzBrB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,8BAAa;YACb,4BAAY;YACZ,gCAAc;YACd,0BAAW;YACX,0BAAW;YACX,gCAAc;YACd,gCAAc;YACd,uCAAiB;YACjB,uCAAiB;YACjB,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"}
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,gEAA4D;AAC5D,gEAA4D;AAC5D,wEAAmE;AACnE,0DAAsD;AACtD,wEAAmE;AACnE,8DAA0D;AAC1D,0DAAsD;AACtD,gEAA4D;AAC5D,gEAA4D;AAC5D,8DAA0D;AAC1D,8DAA0D;AAC1D,gEAA4D;AAC5D,0DAAsD;AACtD,0DAAsD;AACtD,wDAAoD;AACpD,8DAA0D;AAC1D,sEAAkE;AA4B3D,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IA1BrB,IAAA,eAAM,EAAC;QACN,SAAS,EAAE;YACT,8BAAa;YACb,4BAAY;YACZ,gCAAc;YACd,0BAAW;YACX,0BAAW;YACX,gCAAc;YACd,gCAAc;YACd,uCAAiB;YACjB,0BAAW;YACX,uCAAiB;YACjB,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
+ export declare class TeamCommand extends CommandRunner {
4
+ private apiService;
5
+ constructor(apiService: ApiService);
6
+ run(passedParams: string[]): Promise<void>;
7
+ private createTeam;
8
+ private listTeams;
9
+ }
@@ -0,0 +1,77 @@
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.TeamCommand = void 0;
16
+ const nest_commander_1 = require("nest-commander");
17
+ const api_service_1 = require("../services/api.service");
18
+ const chalk_1 = __importDefault(require("chalk"));
19
+ let TeamCommand = class TeamCommand extends nest_commander_1.CommandRunner {
20
+ apiService;
21
+ constructor(apiService) {
22
+ super();
23
+ this.apiService = apiService;
24
+ }
25
+ async run(passedParams) {
26
+ const [action, name] = passedParams;
27
+ if (action === 'create') {
28
+ await this.createTeam(name);
29
+ }
30
+ else if (action === 'list') {
31
+ await this.listTeams();
32
+ }
33
+ else {
34
+ console.log(chalk_1.default.yellow('Usage: envw team create <name> | list'));
35
+ }
36
+ }
37
+ async createTeam(name) {
38
+ if (!name) {
39
+ console.log(chalk_1.default.red('Team name is required: envw team create <name>'));
40
+ return;
41
+ }
42
+ try {
43
+ const response = await this.apiService.instance.post('/teams', {
44
+ name,
45
+ });
46
+ const team = response.data;
47
+ console.log(chalk_1.default.green(`✓ Team '${team.name}' created with slug: ${team.slug} 🌸`));
48
+ }
49
+ catch (error) {
50
+ const message = error.response?.data?.error || error.message;
51
+ console.log(chalk_1.default.red('Failed to create team: ' + message));
52
+ }
53
+ }
54
+ async listTeams() {
55
+ try {
56
+ const response = await this.apiService.instance.get('/teams');
57
+ console.log(chalk_1.default.blue('Your teams: 🌸'));
58
+ response.data.forEach((t) => {
59
+ const roleColor = t.role === 'OWNER' ? chalk_1.default.magenta : (t.role === 'ADMIN' ? chalk_1.default.cyan : chalk_1.default.white);
60
+ console.log(`- ${t.name} (${chalk_1.default.gray(t.slug)}) [${roleColor(t.role)}]`);
61
+ });
62
+ }
63
+ catch (error) {
64
+ const message = error.response?.data?.error || error.message;
65
+ console.log(chalk_1.default.red('Failed to list teams: ' + message));
66
+ }
67
+ }
68
+ };
69
+ exports.TeamCommand = TeamCommand;
70
+ exports.TeamCommand = TeamCommand = __decorate([
71
+ (0, nest_commander_1.Command)({
72
+ name: 'team',
73
+ description: 'Manage your teams',
74
+ }),
75
+ __metadata("design:paramtypes", [api_service_1.ApiService])
76
+ ], TeamCommand);
77
+ //# sourceMappingURL=team.command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team.command.js","sourceRoot":"","sources":["../../src/commands/team.command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAwD;AACxD,yDAAqD;AACrD,kDAA0B;AAMnB,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,8BAAa;IACxB;IAApB,YAAoB,UAAsB;QACxC,KAAK,EAAE,CAAC;QADU,eAAU,GAAV,UAAU,CAAY;IAE1C,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,YAAsB;QAC9B,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,YAAY,CAAC;QAEpC,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;YACxB,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;aAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YAC7B,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC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,CAAC,eAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,eAAK,CAAC,IAAI,CAAC,CAAC,CAAC,eAAK,CAAC,KAAK,CAAC,CAAC;gBACvG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,eAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC5E,CAAC,CAAC,CAAC;QACL,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,wBAAwB,GAAG,OAAO,CAAC,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;CACF,CAAA;AArDY,kCAAW;sBAAX,WAAW;IAJvB,IAAA,wBAAO,EAAC;QACP,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,mBAAmB;KACjC,CAAC;qCAEgC,wBAAU;GAD/B,WAAW,CAqDvB"}
@@ -36,7 +36,7 @@ let ApiService = class ApiService {
36
36
  }
37
37
  }
38
38
  if (config.headers) {
39
- config.headers['x-envware-version'] = '1.3.2';
39
+ config.headers['x-envware-version'] = '1.3.3';
40
40
  }
41
41
  return config;
42
42
  });