@agilecustoms/envctl 0.27.3 → 0.28.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.
@@ -18,12 +18,12 @@ export class EnvApiClient {
18
18
  }
19
19
  }
20
20
  async createEphemeral(env) {
21
- const res = await this.httpClient.post('/ci/env-ephemeral', env);
22
- return res.token;
21
+ const { token } = await this.httpClient.post('/ci/env-ephemeral', env);
22
+ return token;
23
23
  }
24
24
  async create(env) {
25
- await this.httpClient.post('/ci/env', env);
26
- return { ...env, ephemeral: false, status: EnvStatus.Deploying };
25
+ const { ttl } = await this.httpClient.post('/ci/env', env);
26
+ return { ...env, ephemeral: false, status: EnvStatus.Deploying, ttl };
27
27
  }
28
28
  async setVars(env, vars) {
29
29
  await this.httpClient.post(`/ci/env/${env.key}/vars`, vars);
@@ -34,8 +34,8 @@ export class EnvApiClient {
34
34
  env.status = EnvStatus.Active;
35
35
  }
36
36
  async lockForUpdate(env) {
37
- const res = await this.httpClient.post(`/ci/env/${env.key}/lock-for-update`);
38
- env.status = res.status;
37
+ const { status } = await this.httpClient.post(`/ci/env/${env.key}/lock-for-update`);
38
+ env.status = status;
39
39
  }
40
40
  async delete(env) {
41
41
  let result;
@@ -56,10 +56,10 @@ export class TerraformAdapter {
56
56
  printTime() {
57
57
  const now = new Date();
58
58
  const utc = now.toISOString();
59
- const est = now.toLocaleString('en-US', {
59
+ const edt = now.toLocaleString('en-US', {
60
60
  timeZone: 'America/New_York'
61
61
  });
62
- console.log(`\nTime EST: ${est}, UTC: ${utc}\n`);
62
+ console.log(`\nTime EDT: ${edt}, UTC: ${utc}\n`);
63
63
  }
64
64
  tfArgs(env, cwd) {
65
65
  const varDefs = this.getVarDefs(cwd);
@@ -26,7 +26,16 @@ export class EnvCtl {
26
26
  console.log(`Env ${key} does not exist`);
27
27
  return;
28
28
  }
29
- console.log(`Env ${key} status: ${env.status}`);
29
+ const date = new Date(env.ttl * 1000);
30
+ const expDateTime = date.toLocaleString(undefined, {
31
+ month: 'short',
32
+ day: '2-digit',
33
+ hour: '2-digit',
34
+ minute: '2-digit',
35
+ second: '2-digit',
36
+ hour12: false,
37
+ });
38
+ console.log(`Env ${key} status: ${env.status}, expires at ${expDateTime}`);
30
39
  if (env.kind) {
31
40
  const kind = this.cliHelper.getKind(cwd);
32
41
  if (env.kind !== kind) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agilecustoms/envctl",
3
3
  "description": "node.js CLI client for manage environments",
4
- "version": "0.27.3",
4
+ "version": "0.28.1",
5
5
  "author": "Alex Chekulaev",
6
6
  "type": "module",
7
7
  "bin": {