@agilecustoms/envctl 0.5.0 → 0.6.0

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.
@@ -11,16 +11,16 @@ export class DevEnvClient {
11
11
  async createEphemeralEnv(env) {
12
12
  return await this.send('POST', '/ci/env', env);
13
13
  }
14
- async delete(envId) {
14
+ async delete(account, key) {
15
15
  try {
16
- await this.httpClient.fetch(`/ci/env/${envId}`, {
16
+ await this.httpClient.fetch(`/ci/env/${account}/${key}`, {
17
17
  method: 'DELETE'
18
18
  });
19
19
  }
20
20
  catch (error) {
21
21
  if (error instanceof HttpException) {
22
22
  if (error.statusCode === 404) {
23
- throw new KnownException(`Environment with key ${envId} is not found`);
23
+ throw new KnownException(`Environment ${account}-${key} is not found`);
24
24
  }
25
25
  throw error;
26
26
  }
@@ -40,7 +40,6 @@ export class EnvCtl {
40
40
  }
41
41
  async delete(key) {
42
42
  const account = await this.getAccount();
43
- const envId = `${account}-${key}`;
44
- return this.devEnvClient.delete(envId);
43
+ return this.devEnvClient.delete(account, key);
45
44
  }
46
45
  }
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.5.0",
4
+ "version": "0.6.0",
5
5
  "author": "Alex Chekulaev",
6
6
  "type": "module",
7
7
  "bin": {