bdy 1.23.7-dev-target-commands → 1.23.7-dev

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.
Files changed (252) hide show
  1. package/distTs/README.md +181 -0
  2. package/distTs/package.json +10 -4
  3. package/distTs/src/agent/linux.js +53 -3
  4. package/distTs/src/agent/manager.js +3 -6
  5. package/distTs/src/agent/osx.js +51 -3
  6. package/distTs/src/agent/system.js +400 -21
  7. package/distTs/src/agent/windows.js +4 -7
  8. package/distTs/src/api/client.js +0 -156
  9. package/distTs/src/cliIndex.js +0 -4
  10. package/distTs/src/command/agent/debug.js +2 -2
  11. package/distTs/src/command/agent/install.js +37 -10
  12. package/distTs/src/command/agent/restart.js +2 -2
  13. package/distTs/src/command/agent/run.js +3 -0
  14. package/distTs/src/command/agent/start.js +2 -2
  15. package/distTs/src/command/agent/status.js +19 -0
  16. package/distTs/src/command/agent/stop.js +2 -2
  17. package/distTs/src/command/agent/uninstall.js +5 -8
  18. package/distTs/src/command/agent/update.js +2 -2
  19. package/distTs/src/command/artifact/list.js +6 -1
  20. package/distTs/src/command/artifact/publish.js +3 -1
  21. package/distTs/src/command/distro/route/update.js +1 -1
  22. package/distTs/src/command/distro/update.js +9 -9
  23. package/distTs/src/command/project/get.js +18 -0
  24. package/distTs/src/command/project/set.js +31 -0
  25. package/distTs/src/command/sandbox/get/yaml.js +30 -0
  26. package/distTs/src/command/version.js +13 -5
  27. package/distTs/src/command/vt/scrape.js +193 -0
  28. package/distTs/src/input.js +0 -54
  29. package/distTs/src/logger.js +40 -4
  30. package/distTs/src/texts.js +36 -210
  31. package/distTs/src/utils.js +99 -18
  32. package/node_modules/asn1/Jenkinsfile +65 -0
  33. package/node_modules/asn1/LICENSE +19 -0
  34. package/node_modules/asn1/README.md +50 -0
  35. package/node_modules/asn1/lib/ber/errors.js +13 -0
  36. package/node_modules/asn1/lib/ber/index.js +27 -0
  37. package/node_modules/asn1/lib/ber/reader.js +262 -0
  38. package/node_modules/asn1/lib/ber/types.js +36 -0
  39. package/node_modules/asn1/lib/ber/writer.js +317 -0
  40. package/node_modules/asn1/lib/index.js +20 -0
  41. package/node_modules/asn1/package.json +31 -0
  42. package/node_modules/bcrypt-pbkdf/CONTRIBUTING.md +13 -0
  43. package/node_modules/bcrypt-pbkdf/LICENSE +66 -0
  44. package/node_modules/bcrypt-pbkdf/README.md +45 -0
  45. package/node_modules/bcrypt-pbkdf/index.js +556 -0
  46. package/node_modules/bcrypt-pbkdf/package.json +15 -0
  47. package/node_modules/safer-buffer/LICENSE +21 -0
  48. package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  49. package/node_modules/safer-buffer/Readme.md +156 -0
  50. package/node_modules/safer-buffer/dangerous.js +58 -0
  51. package/node_modules/safer-buffer/package.json +34 -0
  52. package/node_modules/safer-buffer/safer.js +77 -0
  53. package/node_modules/safer-buffer/tests.js +406 -0
  54. package/node_modules/ssh2/.eslintignore +4 -0
  55. package/node_modules/ssh2/.eslintrc.js +5 -0
  56. package/node_modules/ssh2/.github/workflows/ci.yml +110 -0
  57. package/node_modules/ssh2/.github/workflows/lint.yml +27 -0
  58. package/node_modules/ssh2/LICENSE +19 -0
  59. package/node_modules/ssh2/README.md +1529 -0
  60. package/node_modules/ssh2/SFTP.md +413 -0
  61. package/node_modules/ssh2/examples/server-chat.js +238 -0
  62. package/node_modules/ssh2/examples/sftp-server-download-only.js +134 -0
  63. package/node_modules/ssh2/install.js +27 -0
  64. package/node_modules/ssh2/lib/Channel.js +295 -0
  65. package/node_modules/ssh2/lib/agent.js +1123 -0
  66. package/node_modules/ssh2/lib/client.js +2176 -0
  67. package/node_modules/ssh2/lib/http-agents.js +84 -0
  68. package/node_modules/ssh2/lib/index.js +44 -0
  69. package/node_modules/ssh2/lib/keygen.js +582 -0
  70. package/node_modules/ssh2/lib/protocol/Protocol.js +2136 -0
  71. package/node_modules/ssh2/lib/protocol/SFTP.js +4052 -0
  72. package/node_modules/ssh2/lib/protocol/constants.js +356 -0
  73. package/node_modules/ssh2/lib/protocol/crypto/binding.gyp +23 -0
  74. package/node_modules/ssh2/lib/protocol/crypto/poly1305.js +43 -0
  75. package/node_modules/ssh2/lib/protocol/crypto/src/binding.cc +2300 -0
  76. package/node_modules/ssh2/lib/protocol/crypto.js +1602 -0
  77. package/node_modules/ssh2/lib/protocol/handlers.js +16 -0
  78. package/node_modules/ssh2/lib/protocol/handlers.misc.js +1285 -0
  79. package/node_modules/ssh2/lib/protocol/kex.js +1908 -0
  80. package/node_modules/ssh2/lib/protocol/keyParser.js +1484 -0
  81. package/node_modules/ssh2/lib/protocol/node-fs-compat.js +115 -0
  82. package/node_modules/ssh2/lib/protocol/utils.js +356 -0
  83. package/node_modules/ssh2/lib/protocol/zlib.js +255 -0
  84. package/node_modules/ssh2/lib/server.js +1380 -0
  85. package/node_modules/ssh2/lib/utils.js +336 -0
  86. package/node_modules/ssh2/package.json +49 -0
  87. package/node_modules/ssh2/test/common.js +316 -0
  88. package/node_modules/ssh2/test/fixtures/bad_rsa_private_key +26 -0
  89. package/node_modules/ssh2/test/fixtures/https_cert.pem +33 -0
  90. package/node_modules/ssh2/test/fixtures/https_key.pem +52 -0
  91. package/node_modules/ssh2/test/fixtures/id_dsa +12 -0
  92. package/node_modules/ssh2/test/fixtures/id_ecdsa +5 -0
  93. package/node_modules/ssh2/test/fixtures/id_rsa +15 -0
  94. package/node_modules/ssh2/test/fixtures/id_rsa.ppk +26 -0
  95. package/node_modules/ssh2/test/fixtures/id_rsa_enc +30 -0
  96. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa +21 -0
  97. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.pub +1 -0
  98. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.pub.result +7 -0
  99. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa.result +7 -0
  100. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc +22 -0
  101. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.pub +1 -0
  102. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.pub.result +7 -0
  103. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc.result +7 -0
  104. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm +23 -0
  105. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.pub +1 -0
  106. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.pub.result +7 -0
  107. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_dsa_enc_gcm.result +7 -0
  108. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa +9 -0
  109. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.pub +1 -0
  110. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.pub.result +7 -0
  111. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa.result +7 -0
  112. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc +10 -0
  113. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.pub +1 -0
  114. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.pub.result +8 -0
  115. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc.result +7 -0
  116. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm +10 -0
  117. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.pub +1 -0
  118. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.pub.result +8 -0
  119. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ecdsa_enc_gcm.result +7 -0
  120. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519 +7 -0
  121. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.pub +1 -0
  122. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.pub.result +7 -0
  123. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_ed25519.result +7 -0
  124. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa +27 -0
  125. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.pub +1 -0
  126. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.pub.result +7 -0
  127. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa.result +7 -0
  128. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc +28 -0
  129. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.pub +1 -0
  130. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.pub.result +8 -0
  131. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc.result +7 -0
  132. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm +29 -0
  133. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.pub +1 -0
  134. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.pub.result +8 -0
  135. package/node_modules/ssh2/test/fixtures/keyParser/openssh_new_rsa_enc_gcm.result +7 -0
  136. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa +12 -0
  137. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.pub +1 -0
  138. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.pub.result +7 -0
  139. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa.result +7 -0
  140. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc +15 -0
  141. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.pub +1 -0
  142. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.pub.result +8 -0
  143. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_dsa_enc.result +7 -0
  144. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa +5 -0
  145. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.pub +1 -0
  146. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.pub.result +7 -0
  147. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa.result +7 -0
  148. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc +8 -0
  149. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.pub +1 -0
  150. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.pub.result +8 -0
  151. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_ecdsa_enc.result +7 -0
  152. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa +27 -0
  153. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.pub +1 -0
  154. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.pub.result +7 -0
  155. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa.result +7 -0
  156. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc +30 -0
  157. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.pub +1 -0
  158. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.pub.result +8 -0
  159. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc.result +7 -0
  160. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256 +54 -0
  161. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.pub +1 -0
  162. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.pub.result +6 -0
  163. package/node_modules/ssh2/test/fixtures/keyParser/openssh_old_rsa_enc_aes256.result +6 -0
  164. package/node_modules/ssh2/test/fixtures/keyParser/ppk_dsa_enc +17 -0
  165. package/node_modules/ssh2/test/fixtures/keyParser/ppk_dsa_enc.result +7 -0
  166. package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa +26 -0
  167. package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa.result +7 -0
  168. package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa_enc +18 -0
  169. package/node_modules/ssh2/test/fixtures/keyParser/ppk_rsa_enc.result +7 -0
  170. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa.pub +9 -0
  171. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa.pub.result +7 -0
  172. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa2.pub +10 -0
  173. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa2.pub.result +7 -0
  174. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa3.pub +11 -0
  175. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa3.pub.result +7 -0
  176. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa4.pub +11 -0
  177. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa4.pub.result +7 -0
  178. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa5.pub +8 -0
  179. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa5.pub.result +7 -0
  180. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa6.pub +13 -0
  181. package/node_modules/ssh2/test/fixtures/keyParser/rfc4716_rsa6.pub.result +7 -0
  182. package/node_modules/ssh2/test/fixtures/openssh_new_rsa +27 -0
  183. package/node_modules/ssh2/test/fixtures/ssh_host_dsa_key +12 -0
  184. package/node_modules/ssh2/test/fixtures/ssh_host_ecdsa_key +5 -0
  185. package/node_modules/ssh2/test/fixtures/ssh_host_rsa_key +15 -0
  186. package/node_modules/ssh2/test/test-exec.js +578 -0
  187. package/node_modules/ssh2/test/test-integration-openssh.js +486 -0
  188. package/node_modules/ssh2/test/test-keygen.js +60 -0
  189. package/node_modules/ssh2/test/test-misc-client-server.js +1460 -0
  190. package/node_modules/ssh2/test/test-openssh.js +261 -0
  191. package/node_modules/ssh2/test/test-protocol-crypto.js +631 -0
  192. package/node_modules/ssh2/test/test-protocol-keyparser.js +177 -0
  193. package/node_modules/ssh2/test/test-server-hostkeys.js +138 -0
  194. package/node_modules/ssh2/test/test-sftp.js +842 -0
  195. package/node_modules/ssh2/test/test-shell.js +109 -0
  196. package/node_modules/ssh2/test/test-userauth-agent-openssh.js +110 -0
  197. package/node_modules/ssh2/test/test-userauth-agent.js +171 -0
  198. package/node_modules/ssh2/test/test-userauth.js +611 -0
  199. package/node_modules/ssh2/test/test-worker-imports.js +25 -0
  200. package/node_modules/ssh2/test/test.js +20 -0
  201. package/node_modules/ssh2/util/build_pagent.bat +2 -0
  202. package/node_modules/ssh2/util/pagent.c +88 -0
  203. package/node_modules/ssh2/util/pagent.exe +0 -0
  204. package/node_modules/tweetnacl/.npmignore +4 -0
  205. package/node_modules/tweetnacl/AUTHORS.md +28 -0
  206. package/node_modules/tweetnacl/CHANGELOG.md +221 -0
  207. package/node_modules/tweetnacl/LICENSE +24 -0
  208. package/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md +20 -0
  209. package/node_modules/tweetnacl/README.md +459 -0
  210. package/node_modules/tweetnacl/nacl-fast.js +2388 -0
  211. package/node_modules/tweetnacl/nacl-fast.min.js +2 -0
  212. package/node_modules/tweetnacl/nacl.d.ts +98 -0
  213. package/node_modules/tweetnacl/nacl.js +1175 -0
  214. package/node_modules/tweetnacl/nacl.min.js +1 -0
  215. package/node_modules/tweetnacl/package.json +58 -0
  216. package/package.json +10 -4
  217. package/distTs/detect-rules.json +0 -351
  218. package/distTs/src/command/environment/create.js +0 -70
  219. package/distTs/src/command/environment/delete.js +0 -29
  220. package/distTs/src/command/environment/get.js +0 -48
  221. package/distTs/src/command/environment/list.js +0 -44
  222. package/distTs/src/command/environment/resolve.js +0 -22
  223. package/distTs/src/command/environment/update.js +0 -59
  224. package/distTs/src/command/environment.js +0 -20
  225. package/distTs/src/command/pipeline/run/apply.js +0 -62
  226. package/distTs/src/command/target/create.js +0 -33
  227. package/distTs/src/command/target/delete.js +0 -30
  228. package/distTs/src/command/target/exec/command.js +0 -65
  229. package/distTs/src/command/target/exec/kill.js +0 -25
  230. package/distTs/src/command/target/exec/list.js +0 -54
  231. package/distTs/src/command/target/exec/logs.js +0 -25
  232. package/distTs/src/command/target/exec/status.js +0 -41
  233. package/distTs/src/command/target/exec.js +0 -24
  234. package/distTs/src/command/target/get.js +0 -62
  235. package/distTs/src/command/target/list.js +0 -48
  236. package/distTs/src/command/target/scope.js +0 -60
  237. package/distTs/src/command/target/update.js +0 -31
  238. package/distTs/src/command/target.js +0 -22
  239. package/distTs/src/command/yaml/actions/detect.js +0 -268
  240. package/distTs/src/command/yaml/actions/info.js +0 -56
  241. package/distTs/src/command/yaml/actions/list.js +0 -70
  242. package/distTs/src/command/yaml/actions/schema.js +0 -104
  243. package/distTs/src/command/yaml/actions.js +0 -13
  244. package/distTs/src/command/yaml/agents.js +0 -88
  245. package/distTs/src/command/yaml/cache.js +0 -98
  246. package/distTs/src/command/yaml/init.js +0 -110
  247. package/distTs/src/command/yaml/pipeline.js +0 -42
  248. package/distTs/src/command/yaml/render.js +0 -83
  249. package/distTs/src/command/yaml/schemaUtils.js +0 -139
  250. package/distTs/src/command/yaml/validate.js +0 -259
  251. package/distTs/src/command/yaml.js +0 -18
  252. package/distTs/src/diskCache.js +0 -82
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../utils");
7
- const texts_1 = require("../../texts");
8
- const output_1 = __importDefault(require("../../output"));
9
- const input_1 = __importDefault(require("../../input"));
10
- const distro_1 = require("../../types/distro");
11
- const commandEnvironmentList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_ENVIRONMENT_LIST);
12
- commandEnvironmentList.alias('ls');
13
- commandEnvironmentList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
14
- commandEnvironmentList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
15
- commandEnvironmentList.option('--scope <scope>', texts_1.OPT_COMMAND_SCOPE);
16
- commandEnvironmentList.option('--format <text|json>', texts_1.OPTION_FORMAT);
17
- commandEnvironmentList.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_ENVIRONMENT_LIST}`);
18
- commandEnvironmentList.action(async (options) => {
19
- const workspace = input_1.default.restApiWorkspace(options.workspace);
20
- const project = input_1.default.restApiProject(options.project, true);
21
- const scope = input_1.default.scope(project, options.scope);
22
- const client = input_1.default.restApiTokenClient();
23
- const result = await client.getEnvironments(workspace, scope === distro_1.SCOPE.PROJECT ? project : null);
24
- const environments = result.environments || [];
25
- if (options.format === 'json') {
26
- output_1.default.json(environments);
27
- }
28
- else {
29
- if (environments.length === 0) {
30
- output_1.default.exitNormal(texts_1.TXT_ENVIRONMENT_NOT_FOUND);
31
- }
32
- const data = [['NAME', 'IDENTIFIER', 'SCOPE']];
33
- for (const environment of environments) {
34
- data.push([
35
- environment.name || '-',
36
- environment.identifier || '-',
37
- environment.scope || '-',
38
- ]);
39
- }
40
- output_1.default.table(data);
41
- }
42
- output_1.default.exitNormal();
43
- });
44
- exports.default = commandEnvironmentList;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.resolveEnvironmentId = void 0;
7
- const texts_1 = require("../../texts");
8
- const output_1 = __importDefault(require("../../output"));
9
- const input_1 = __importDefault(require("../../input"));
10
- // Shared resolve preamble for commands taking an environment identifier:
11
- // project context from flags/env -> /identifiers -> hash id, exiting on a
12
- // miss. Without a project the identifier resolves as a workspace
13
- // environment; with one, along the project line.
14
- const resolveEnvironmentId = async (client, workspace, identifier, options) => {
15
- const project = input_1.default.restApiProject(options.project, true);
16
- const { environment_id } = await client.getEnvironmentByIdentifier(workspace, identifier, project);
17
- if (!environment_id) {
18
- output_1.default.exitError(texts_1.ERR_ENVIRONMENT_NOT_FOUND);
19
- }
20
- return environment_id;
21
- };
22
- exports.resolveEnvironmentId = resolveEnvironmentId;
@@ -1,59 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../utils");
7
- const texts_1 = require("../../texts");
8
- const input_1 = __importDefault(require("../../input"));
9
- const output_1 = __importDefault(require("../../output"));
10
- const resolve_1 = require("./resolve");
11
- const commandEnvironmentUpdate = (0, utils_1.newCommand)('update', texts_1.DESC_COMMAND_ENVIRONMENT_UPDATE);
12
- commandEnvironmentUpdate.alias('edit');
13
- commandEnvironmentUpdate.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
14
- commandEnvironmentUpdate.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
15
- commandEnvironmentUpdate.option('-n, --name <name>', texts_1.OPTION_ENVIRONMENT_NAME);
16
- commandEnvironmentUpdate.option('--tags <tags>', texts_1.OPTION_ENVIRONMENT_TAGS);
17
- commandEnvironmentUpdate.option('--public-url <url>', texts_1.OPTION_ENVIRONMENT_PUBLIC_URL);
18
- commandEnvironmentUpdate.option('--icon <icon>', texts_1.OPTION_ENVIRONMENT_ICON);
19
- commandEnvironmentUpdate.option('--note <note>', texts_1.OPT_COMMAND_NOTE);
20
- commandEnvironmentUpdate.option('--agent-note <note>', texts_1.OPT_COMMAND_AGENT_NOTE);
21
- commandEnvironmentUpdate.argument('<identifier>', texts_1.OPTION_ENVIRONMENT_IDENTIFIER);
22
- commandEnvironmentUpdate.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_ENVIRONMENT_UPDATE}`);
23
- commandEnvironmentUpdate.action(async (identifier, options) => {
24
- const workspace = input_1.default.restApiWorkspace(options.workspace);
25
- const body = {};
26
- let changed = false;
27
- if (options.name) {
28
- body.name = options.name;
29
- changed = true;
30
- }
31
- if (options.tags !== undefined) {
32
- body.tags = input_1.default.tags(options.tags);
33
- changed = true;
34
- }
35
- if (options.publicUrl !== undefined) {
36
- body.public_url = options.publicUrl;
37
- changed = true;
38
- }
39
- if (options.icon) {
40
- body.icon = options.icon;
41
- changed = true;
42
- }
43
- if (options.note !== undefined) {
44
- body.note = options.note;
45
- changed = true;
46
- }
47
- if (options.agentNote !== undefined) {
48
- body.agent_note = options.agentNote;
49
- changed = true;
50
- }
51
- if (!changed) {
52
- output_1.default.exitError(texts_1.ERR_COMMAND_NO_UPDATE);
53
- }
54
- const client = input_1.default.restApiTokenClient();
55
- const environment_id = await (0, resolve_1.resolveEnvironmentId)(client, workspace, identifier, options);
56
- const result = await client.updateEnvironment(workspace, environment_id, body);
57
- output_1.default.exitSuccess((0, texts_1.TXT_ENVIRONMENT_UPDATED)(result.identifier, result.html_url));
58
- });
59
- exports.default = commandEnvironmentUpdate;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../utils");
7
- const texts_1 = require("../texts");
8
- const list_1 = __importDefault(require("./environment/list"));
9
- const get_1 = __importDefault(require("./environment/get"));
10
- const create_1 = __importDefault(require("./environment/create"));
11
- const update_1 = __importDefault(require("./environment/update"));
12
- const delete_1 = __importDefault(require("./environment/delete"));
13
- const commandEnvironment = (0, utils_1.newCommand)('environment', texts_1.DESC_COMMAND_ENVIRONMENT);
14
- commandEnvironment.alias('env');
15
- commandEnvironment.addCommand(list_1.default);
16
- commandEnvironment.addCommand(get_1.default);
17
- commandEnvironment.addCommand(create_1.default);
18
- commandEnvironment.addCommand(update_1.default);
19
- commandEnvironment.addCommand(delete_1.default);
20
- exports.default = commandEnvironment;
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../../utils");
7
- const texts_1 = require("../../../texts");
8
- const input_1 = __importDefault(require("../../../input"));
9
- const output_1 = __importDefault(require("../../../output"));
10
- const pipeline_1 = require("../../../types/pipeline");
11
- const commandPipelineRunApply = (0, utils_1.newCommand)('apply', texts_1.DESC_COMMAND_PIPELINE_RUN_APPLY);
12
- commandPipelineRunApply.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
13
- commandPipelineRunApply.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
14
- commandPipelineRunApply.option('-n, --no-wait', texts_1.OPTION_PIPELINE_RUN_NO_WAIT);
15
- commandPipelineRunApply.argument('<identifier>', texts_1.OPTION_PIPELINE_RUN_ARGUMENT);
16
- commandPipelineRunApply.argument('<run-id>', texts_1.OPTION_PIPELINE_RUN_ID);
17
- commandPipelineRunApply.argument('<run-action-id>', texts_1.OPTION_PIPELINE_RUN_ACTION_ID);
18
- commandPipelineRunApply.option('-v,--variable <variables...>', texts_1.OPTION_PIPELINE_RUN_VAR);
19
- commandPipelineRunApply.addHelpText('after', texts_1.EXAMPLE_PIPELINE_RUN_APPLY);
20
- commandPipelineRunApply.action(async (identifier, runId, runActionId, options) => {
21
- const workspace = input_1.default.restApiWorkspace(options.workspace);
22
- const project = input_1.default.restApiProject(options.project);
23
- const rid = input_1.default.pipelineRunId(runId);
24
- const variables = input_1.default.pipelineRunVariable(options.variable || [], false);
25
- const client = input_1.default.restApiTokenClient();
26
- const data = await client.getPipelineByIdentifier(workspace, project, identifier);
27
- if (!data || !data.domain) {
28
- output_1.default.exitError(texts_1.ERR_WORKSPACE_NOT_FOUND);
29
- }
30
- if (!data.project_identifier) {
31
- output_1.default.exitError(texts_1.ERR_PROJECT_NOT_FOUND);
32
- }
33
- if (!data.pipeline_id) {
34
- output_1.default.exitError(texts_1.ERR_PIPELINE_NOT_FOUND);
35
- }
36
- const a = await client.getPipelineRunActionExecution(workspace, project, data.pipeline_id, rid, runActionId);
37
- let type;
38
- if (a.status === pipeline_1.PIPELINE_RUN_STATUS.WAITING_FOR_APPLY) {
39
- type = 'APPLY';
40
- }
41
- else if (a.status === pipeline_1.PIPELINE_RUN_STATUS.WAITING_FOR_VT_SESSION) {
42
- type = 'APPROVE_VT';
43
- }
44
- else if (a.status === pipeline_1.PIPELINE_RUN_STATUS.WAITING_FOR_VARIABLES) {
45
- type = 'APPLY_VARIABLES';
46
- }
47
- else if (a.status === pipeline_1.PIPELINE_RUN_STATUS.WAITING_FOR_SETTABLE_VARIABLES) {
48
- type = 'SET_VARIABLES';
49
- }
50
- else {
51
- output_1.default.exitError(texts_1.ERR_CANT_APPLY_ACTION_EXECUTION);
52
- }
53
- const body = {
54
- operation: type,
55
- approve_action_id: runActionId,
56
- variables,
57
- };
58
- await client.pipelineRunApply(workspace, project, data.pipeline_id, rid, body);
59
- const OutputPipeline = require('../../../output/pipeline').default;
60
- await OutputPipeline.runStatus(client, workspace, project, data.pipeline_id, rid, !options.wait);
61
- });
62
- exports.default = commandPipelineRunApply;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../utils");
7
- const texts_1 = require("../../texts");
8
- const output_1 = __importDefault(require("../../output"));
9
- const input_1 = __importDefault(require("../../input"));
10
- const scope_1 = require("./scope");
11
- const commandTargetCreate = (0, utils_1.newCommand)('create', texts_1.DESC_COMMAND_TARGET_CREATE);
12
- commandTargetCreate.alias('add');
13
- commandTargetCreate.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
14
- commandTargetCreate.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
15
- commandTargetCreate.option('--pipeline <identifier>', texts_1.OPTION_TARGET_PIPELINE);
16
- commandTargetCreate.option('--environment <identifier>', texts_1.OPTION_TARGET_ENVIRONMENT);
17
- commandTargetCreate.option('--scope <scope>', texts_1.OPT_COMMAND_TARGET_SCOPE);
18
- commandTargetCreate.option('--yaml <content|@path>', texts_1.OPTION_TARGET_YAML);
19
- commandTargetCreate.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_CREATE}`);
20
- commandTargetCreate.action(async (options) => {
21
- const yaml = input_1.default.restApiYaml(options.yaml);
22
- const workspace = input_1.default.restApiWorkspace(options.workspace);
23
- const project = input_1.default.restApiProject(options.project, true);
24
- const scope = input_1.default.targetScope(project, options.pipeline, options.environment, options.scope);
25
- const client = input_1.default.restApiTokenClient();
26
- const scopeParams = await (0, scope_1.resolveTargetScope)(client, workspace, project, scope, options);
27
- const body = {
28
- yaml: Buffer.from(yaml, 'utf8').toString('base64'),
29
- };
30
- const result = await client.createTargetByYaml(workspace, scopeParams, body);
31
- output_1.default.exitSuccess((0, texts_1.TXT_TARGET_CREATED)(result.identifier, result.html_url));
32
- });
33
- exports.default = commandTargetCreate;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../utils");
7
- const texts_1 = require("../../texts");
8
- const output_1 = __importDefault(require("../../output"));
9
- const input_1 = __importDefault(require("../../input"));
10
- const scope_1 = require("./scope");
11
- const commandTargetDelete = (0, utils_1.newCommand)('delete', texts_1.DESC_COMMAND_TARGET_DELETE);
12
- commandTargetDelete.alias('rm');
13
- commandTargetDelete.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
14
- commandTargetDelete.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
15
- commandTargetDelete.option('--pipeline <identifier>', texts_1.OPTION_TARGET_PIPELINE);
16
- commandTargetDelete.option('--environment <identifier>', texts_1.OPTION_TARGET_ENVIRONMENT);
17
- commandTargetDelete.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
18
- commandTargetDelete.argument('<identifier>', texts_1.OPTION_TARGET_IDENTIFIER);
19
- commandTargetDelete.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_DELETE}`);
20
- commandTargetDelete.action(async (identifier, options) => {
21
- const workspace = input_1.default.restApiWorkspace(options.workspace);
22
- const client = input_1.default.restApiTokenClient();
23
- const target_id = await (0, scope_1.resolveTargetId)(client, workspace, identifier, options);
24
- const confirmed = options.force || (await output_1.default.confirm((0, texts_1.TXT_TARGET_DELETE_CONFIRM)(identifier)));
25
- if (!confirmed)
26
- output_1.default.exitNormal();
27
- await client.deleteTarget(workspace, target_id);
28
- output_1.default.exitSuccess((0, texts_1.TXT_TARGET_DELETED)(identifier));
29
- });
30
- exports.default = commandTargetDelete;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../../utils");
7
- const texts_1 = require("../../../texts");
8
- const output_1 = __importDefault(require("../../../output"));
9
- const input_1 = __importDefault(require("../../../input"));
10
- const scope_1 = require("../scope");
11
- const EXEC_WAIT_MS = 10000;
12
- const commandTargetExecCommand = (0, utils_1.newCommand)('command', texts_1.DESC_COMMAND_TARGET_EXEC);
13
- commandTargetExecCommand.alias('cmd');
14
- commandTargetExecCommand.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
15
- commandTargetExecCommand.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
16
- commandTargetExecCommand.option('--pipeline <identifier>', texts_1.OPTION_TARGET_PIPELINE);
17
- commandTargetExecCommand.option('--environment <identifier>', texts_1.OPTION_TARGET_ENVIRONMENT);
18
- commandTargetExecCommand.option('--wait', texts_1.OPTION_SANDBOX_WAIT);
19
- commandTargetExecCommand.argument('<identifier>', texts_1.OPTION_TARGET_IDENTIFIER);
20
- commandTargetExecCommand.argument('<command>');
21
- commandTargetExecCommand.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_EXEC_COMMAND}`);
22
- commandTargetExecCommand.action(async (identifier, command, options) => {
23
- output_1.default.handleSignals();
24
- const workspace = input_1.default.restApiWorkspace(options.workspace);
25
- const client = input_1.default.restApiTokenClient();
26
- const target_id = await (0, scope_1.resolveTargetId)(client, workspace, identifier, options);
27
- let exec = await client.executeTargetCommand(workspace, target_id, {
28
- command,
29
- });
30
- const execId = exec.execution_id;
31
- output_1.default.gray((0, texts_1.TXT_TARGET_EXEC_ID)(execId));
32
- if (!options.wait) {
33
- output_1.default.exitSuccess((0, texts_1.TXT_TARGET_EXEC_BACKGROUND)(execId));
34
- }
35
- let offset = 0;
36
- const printLog = async () => {
37
- for (;;) {
38
- const log = await client.getTargetExecLog(workspace, execId, offset);
39
- (log.lines || []).forEach((line) => output_1.default.normal(line));
40
- const advanced = log.next_offset !== undefined && log.next_offset > offset;
41
- if (advanced)
42
- offset = log.next_offset;
43
- if (!log.truncated || !advanced)
44
- break;
45
- }
46
- };
47
- do {
48
- if (exec.status === utils_1.TARGET_EXEC_STATUS.INPROGRESS) {
49
- exec = await client.getTargetExec(workspace, execId, EXEC_WAIT_MS);
50
- }
51
- await printLog();
52
- } while (exec.status === utils_1.TARGET_EXEC_STATUS.INPROGRESS);
53
- if (exec.status === utils_1.TARGET_EXEC_STATUS.SUCCESSFUL) {
54
- output_1.default.exitSuccess((0, texts_1.TXT_TARGET_EXEC_SUCCESS)(execId));
55
- }
56
- else if (exec.status === utils_1.TARGET_EXEC_STATUS.CANCELLED) {
57
- output_1.default.exitError((0, texts_1.TXT_TARGET_EXEC_CANCELLED)(execId));
58
- }
59
- else {
60
- if (exec.error_message)
61
- output_1.default.gray(exec.error_message);
62
- output_1.default.exitError((0, texts_1.TXT_TARGET_EXEC_FAILED)(execId, exec.failure_reason));
63
- }
64
- });
65
- exports.default = commandTargetExecCommand;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../../utils");
7
- const texts_1 = require("../../../texts");
8
- const input_1 = __importDefault(require("../../../input"));
9
- const output_1 = __importDefault(require("../../../output"));
10
- const commandTargetExecKill = (0, utils_1.newCommand)('kill', texts_1.DESC_COMMAND_TARGET_EXEC_KILL);
11
- commandTargetExecKill.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
12
- commandTargetExecKill.option('-f, --force', texts_1.OPTION_CONFIRM_FORCE);
13
- commandTargetExecKill.argument('<exec-id>', texts_1.OPTION_TARGET_EXEC_ID);
14
- commandTargetExecKill.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_EXEC_KILL}`);
15
- commandTargetExecKill.action(async (execId, options) => {
16
- const workspace = input_1.default.restApiWorkspace(options.workspace);
17
- const client = input_1.default.restApiTokenClient();
18
- const confirmed = options.force ||
19
- (await output_1.default.confirm((0, texts_1.TXT_TARGET_EXEC_KILL_CONFIRM)(execId)));
20
- if (!confirmed)
21
- output_1.default.exitNormal();
22
- await client.cancelTargetExec(workspace, execId);
23
- output_1.default.exitSuccess((0, texts_1.TXT_TARGET_EXEC_KILLED)(execId));
24
- });
25
- exports.default = commandTargetExecKill;
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../../utils");
7
- const texts_1 = require("../../../texts");
8
- const input_1 = __importDefault(require("../../../input"));
9
- const output_1 = __importDefault(require("../../../output"));
10
- const scope_1 = require("../scope");
11
- const commandTargetExecList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_TARGET_EXEC_LIST);
12
- commandTargetExecList.alias('ls');
13
- commandTargetExecList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
14
- commandTargetExecList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
15
- commandTargetExecList.option('--pipeline <identifier>', texts_1.OPTION_TARGET_PIPELINE);
16
- commandTargetExecList.option('--environment <identifier>', texts_1.OPTION_TARGET_ENVIRONMENT);
17
- commandTargetExecList.option('--limit <n>', texts_1.OPTION_TARGET_EXEC_LIMIT);
18
- commandTargetExecList.option('--format <text|json>', texts_1.OPTION_FORMAT);
19
- commandTargetExecList.argument('<identifier>', texts_1.OPTION_TARGET_IDENTIFIER);
20
- commandTargetExecList.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_EXEC_LIST}`);
21
- commandTargetExecList.action(async (identifier, options) => {
22
- const workspace = input_1.default.restApiWorkspace(options.workspace);
23
- const client = input_1.default.restApiTokenClient();
24
- const target_id = await (0, scope_1.resolveTargetId)(client, workspace, identifier, options);
25
- const limit = options.limit ? parseInt(options.limit, 10) : undefined;
26
- const execs = await client.getTargetExecs(workspace, target_id, limit);
27
- if (options.format === 'json') {
28
- output_1.default.json(execs);
29
- }
30
- else {
31
- if (execs.length === 0) {
32
- output_1.default.exitError(texts_1.ERR_TARGET_NO_EXECS);
33
- }
34
- const data = [
35
- ['EXEC ID', 'STATUS', 'COMMAND', 'STARTED', 'FINISHED', 'EXIT CODE'],
36
- ];
37
- for (const exec of execs) {
38
- data.push([
39
- exec.execution_id || '-',
40
- exec.failure_reason
41
- ? `${exec.status} (${exec.failure_reason})`
42
- : exec.status || '-',
43
- (exec.command || '-').substring(0, 40) +
44
- (exec.command?.length > 40 ? '...' : ''),
45
- exec.started_at || '-',
46
- exec.finished_at || '-',
47
- exec.exit_code !== undefined ? String(exec.exit_code) : '-',
48
- ]);
49
- }
50
- output_1.default.table(data);
51
- }
52
- output_1.default.exitNormal();
53
- });
54
- exports.default = commandTargetExecList;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../../utils");
7
- const texts_1 = require("../../../texts");
8
- const input_1 = __importDefault(require("../../../input"));
9
- const output_1 = __importDefault(require("../../../output"));
10
- const commandTargetExecLogs = (0, utils_1.newCommand)('logs', texts_1.DESC_COMMAND_TARGET_EXEC_LOGS);
11
- commandTargetExecLogs.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
12
- commandTargetExecLogs.option('--offset <n>', texts_1.OPTION_TARGET_EXEC_LOG_OFFSET);
13
- commandTargetExecLogs.option('--limit <n>', texts_1.OPTION_TARGET_EXEC_LOG_LIMIT);
14
- commandTargetExecLogs.argument('<exec-id>', texts_1.OPTION_TARGET_EXEC_ID);
15
- commandTargetExecLogs.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_EXEC_LOGS}`);
16
- commandTargetExecLogs.action(async (execId, options) => {
17
- const workspace = input_1.default.restApiWorkspace(options.workspace);
18
- const client = input_1.default.restApiTokenClient();
19
- const offset = options.offset ? parseInt(options.offset, 10) : undefined;
20
- const limit = options.limit ? parseInt(options.limit, 10) : undefined;
21
- const log = await client.getTargetExecLog(workspace, execId, offset, limit);
22
- (log.lines || []).forEach((line) => output_1.default.normal(line));
23
- output_1.default.exitNormal();
24
- });
25
- exports.default = commandTargetExecLogs;
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../../utils");
7
- const texts_1 = require("../../../texts");
8
- const input_1 = __importDefault(require("../../../input"));
9
- const output_1 = __importDefault(require("../../../output"));
10
- const commandTargetExecStatus = (0, utils_1.newCommand)('status', texts_1.DESC_COMMAND_TARGET_EXEC_STATUS);
11
- commandTargetExecStatus.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
12
- commandTargetExecStatus.option('--format <text|json>', texts_1.OPTION_FORMAT);
13
- commandTargetExecStatus.argument('<exec-id>', texts_1.OPTION_TARGET_EXEC_ID);
14
- commandTargetExecStatus.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_EXEC_STATUS}`);
15
- commandTargetExecStatus.action(async (execId, options) => {
16
- const workspace = input_1.default.restApiWorkspace(options.workspace);
17
- const client = input_1.default.restApiTokenClient();
18
- const exec = await client.getTargetExec(workspace, execId);
19
- if (options.format === 'json') {
20
- output_1.default.json(exec);
21
- }
22
- else {
23
- const data = [
24
- ['Property', 'Value'],
25
- ['Execution ID', exec.execution_id || '-'],
26
- ['Command', exec.command || '-'],
27
- ['Status', exec.status || '-'],
28
- [
29
- 'Exit Code',
30
- exec.exit_code !== undefined ? String(exec.exit_code) : '-',
31
- ],
32
- ['Failure Reason', exec.failure_reason || '-'],
33
- ['Error', exec.error_message || '-'],
34
- ['Started', exec.started_at || '-'],
35
- ['Finished', exec.finished_at || '-'],
36
- ];
37
- output_1.default.table(data);
38
- }
39
- output_1.default.exitNormal();
40
- });
41
- exports.default = commandTargetExecStatus;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../utils");
7
- const texts_1 = require("../../texts");
8
- const command_1 = __importDefault(require("./exec/command"));
9
- const status_1 = __importDefault(require("./exec/status"));
10
- const kill_1 = __importDefault(require("./exec/kill"));
11
- const list_1 = __importDefault(require("./exec/list"));
12
- const logs_1 = __importDefault(require("./exec/logs"));
13
- const commandTargetExec = (0, utils_1.newCommand)('exec', texts_1.DESC_COMMAND_TARGET_EXEC);
14
- commandTargetExec.addCommand(command_1.default);
15
- commandTargetExec.addCommand(status_1.default);
16
- commandTargetExec.addCommand(kill_1.default);
17
- commandTargetExec.addCommand(list_1.default);
18
- commandTargetExec.addCommand(logs_1.default);
19
- commandTargetExec.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_EXEC_COMMAND}
20
- ${texts_1.EXAMPLE_TARGET_EXEC_KILL}
21
- ${texts_1.EXAMPLE_TARGET_EXEC_LIST}
22
- ${texts_1.EXAMPLE_TARGET_EXEC_LOGS}
23
- ${texts_1.EXAMPLE_TARGET_EXEC_STATUS}`);
24
- exports.default = commandTargetExec;
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../utils");
7
- const texts_1 = require("../../texts");
8
- const output_1 = __importDefault(require("../../output"));
9
- const input_1 = __importDefault(require("../../input"));
10
- const scope_1 = require("./scope");
11
- const commandTargetGet = (0, utils_1.newCommand)('get', texts_1.DESC_COMMAND_TARGET_GET);
12
- commandTargetGet.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
13
- commandTargetGet.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
14
- commandTargetGet.option('--pipeline <identifier>', texts_1.OPTION_TARGET_PIPELINE);
15
- commandTargetGet.option('--environment <identifier>', texts_1.OPTION_TARGET_ENVIRONMENT);
16
- commandTargetGet.option('--format <text|json>', texts_1.OPTION_FORMAT);
17
- commandTargetGet.argument('<identifier>', texts_1.OPTION_TARGET_IDENTIFIER);
18
- commandTargetGet.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_GET}`);
19
- commandTargetGet.action(async (identifier, options) => {
20
- const workspace = input_1.default.restApiWorkspace(options.workspace);
21
- const client = input_1.default.restApiTokenClient();
22
- const target_id = await (0, scope_1.resolveTargetId)(client, workspace, identifier, options);
23
- const target = await client.getTarget(workspace, target_id);
24
- if (options.format === 'json') {
25
- output_1.default.json(target);
26
- }
27
- else {
28
- const data = [
29
- ['Field', 'Value'],
30
- ['ID', target.id || '-'],
31
- ['Identifier', target.identifier || '-'],
32
- ['Name', target.name || '-'],
33
- ['Type', target.type || '-'],
34
- ['Scope', (0, scope_1.targetScopeOf)(target)],
35
- ['Tags', (target.tags || []).join(', ') || '-'],
36
- ['Note', target.note || '-'],
37
- ['Agent note', target.agent_note || '-'],
38
- ['Disabled', target.disabled ? 'true' : 'false'],
39
- ];
40
- if (target.project) {
41
- data.push(['Project', target.project.name || '-']);
42
- }
43
- if (target.pipeline) {
44
- data.push([
45
- 'Pipeline',
46
- target.pipeline.identifier || String(target.pipeline.id) || '-',
47
- ]);
48
- }
49
- if (target.environment) {
50
- data.push([
51
- 'Environment',
52
- target.environment.identifier || target.environment.id || '-',
53
- ]);
54
- }
55
- if (target.html_url) {
56
- data.push(['URL', target.html_url]);
57
- }
58
- output_1.default.table(data);
59
- }
60
- output_1.default.exitNormal();
61
- });
62
- exports.default = commandTargetGet;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const utils_1 = require("../../utils");
7
- const texts_1 = require("../../texts");
8
- const output_1 = __importDefault(require("../../output"));
9
- const input_1 = __importDefault(require("../../input"));
10
- const scope_1 = require("./scope");
11
- const commandTargetList = (0, utils_1.newCommand)('list', texts_1.DESC_COMMAND_TARGET_LIST);
12
- commandTargetList.alias('ls');
13
- commandTargetList.option('-w, --workspace <domain>', texts_1.OPTION_REST_API_WORKSPACE);
14
- commandTargetList.option('-p, --project <name>', texts_1.OPTION_REST_API_PROJECT);
15
- commandTargetList.option('--pipeline <identifier>', texts_1.OPTION_TARGET_PIPELINE);
16
- commandTargetList.option('--environment <identifier>', texts_1.OPTION_TARGET_ENVIRONMENT);
17
- commandTargetList.option('--scope <scope>', texts_1.OPT_COMMAND_TARGET_SCOPE);
18
- commandTargetList.option('--format <text|json>', texts_1.OPTION_FORMAT);
19
- commandTargetList.addHelpText('after', `\nEXAMPLES:${texts_1.EXAMPLE_TARGET_LIST}`);
20
- commandTargetList.action(async (options) => {
21
- const workspace = input_1.default.restApiWorkspace(options.workspace);
22
- const project = input_1.default.restApiProject(options.project, true);
23
- const scope = input_1.default.targetScope(project, options.pipeline, options.environment, options.scope);
24
- const client = input_1.default.restApiTokenClient();
25
- const filters = await (0, scope_1.resolveTargetScope)(client, workspace, project, scope, options);
26
- const result = await client.getTargets(workspace, filters);
27
- const targets = result.targets || [];
28
- if (options.format === 'json') {
29
- output_1.default.json(targets);
30
- }
31
- else {
32
- if (targets.length === 0) {
33
- output_1.default.exitNormal(texts_1.TXT_TARGET_NOT_FOUND);
34
- }
35
- const data = [['NAME', 'IDENTIFIER', 'TYPE', 'SCOPE']];
36
- for (const target of targets) {
37
- data.push([
38
- target.name || '-',
39
- target.identifier || '-',
40
- target.type || '-',
41
- (0, scope_1.targetScopeOf)(target),
42
- ]);
43
- }
44
- output_1.default.table(data);
45
- }
46
- output_1.default.exitNormal();
47
- });
48
- exports.default = commandTargetList;