@catladder/cli 0.0.1-bla → 1.0.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.
Files changed (288) hide show
  1. package/.nvmrc +1 -1
  2. package/bin/catenv +3 -0
  3. package/bin/catladder +1 -1
  4. package/dist/apps/catenv/catenv.d.ts +2 -0
  5. package/dist/apps/catenv/catenv.js +135 -0
  6. package/dist/apps/catenv/catenv.js.map +1 -0
  7. package/dist/apps/cli/cli.d.ts +2 -0
  8. package/dist/apps/cli/cli.js +81 -0
  9. package/dist/apps/cli/cli.js.map +1 -0
  10. package/dist/apps/cli/commands/general/index.d.ts +4 -0
  11. package/dist/apps/cli/commands/general/index.js +274 -0
  12. package/dist/apps/cli/commands/general/index.js.map +1 -0
  13. package/dist/apps/cli/commands/general/namespaceAutoCompletion.d.ts +3 -0
  14. package/dist/apps/cli/commands/general/namespaceAutoCompletion.js +56 -0
  15. package/dist/apps/cli/commands/general/namespaceAutoCompletion.js.map +1 -0
  16. package/dist/apps/cli/commands/general/portForward.d.ts +3 -0
  17. package/dist/apps/cli/commands/general/portForward.js +98 -0
  18. package/dist/apps/cli/commands/general/portForward.js.map +1 -0
  19. package/dist/apps/cli/commands/mongodb/index.d.ts +3 -0
  20. package/dist/apps/cli/commands/mongodb/index.js +53 -0
  21. package/dist/apps/cli/commands/mongodb/index.js.map +1 -0
  22. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +3 -0
  23. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js +190 -0
  24. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +1 -0
  25. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +3 -0
  26. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js +96 -0
  27. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js.map +1 -0
  28. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +3 -0
  29. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js +105 -0
  30. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js.map +1 -0
  31. package/dist/apps/cli/commands/mongodb/utils/index.d.ts +13 -0
  32. package/dist/apps/cli/commands/mongodb/utils/index.js +167 -0
  33. package/dist/apps/cli/commands/mongodb/utils/index.js.map +1 -0
  34. package/dist/apps/cli/commands/project/commandCloudSqlProxy.d.ts +3 -0
  35. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +128 -0
  36. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -0
  37. package/dist/apps/cli/commands/project/commandConfigSecrets.d.ts +3 -0
  38. package/dist/apps/cli/commands/project/commandConfigSecrets.js +254 -0
  39. package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -0
  40. package/dist/apps/cli/commands/project/commandCopyDB.d.ts +3 -0
  41. package/dist/apps/cli/commands/project/commandCopyDB.js +102 -0
  42. package/dist/apps/cli/commands/project/commandCopyDB.js.map +1 -0
  43. package/dist/apps/cli/commands/project/commandDeletePods.d.ts +3 -0
  44. package/dist/apps/cli/commands/project/commandDeletePods.js +119 -0
  45. package/dist/apps/cli/commands/project/commandDeletePods.js.map +1 -0
  46. package/dist/apps/cli/commands/project/commandDeleteProject.d.ts +3 -0
  47. package/dist/apps/cli/commands/project/commandDeleteProject.js +97 -0
  48. package/dist/apps/cli/commands/project/commandDeleteProject.js.map +1 -0
  49. package/dist/apps/cli/commands/project/commandEnvVars.d.ts +3 -0
  50. package/dist/apps/cli/commands/project/commandEnvVars.js +74 -0
  51. package/dist/apps/cli/commands/project/commandEnvVars.js.map +1 -0
  52. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +3 -0
  53. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js +58 -0
  54. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +1 -0
  55. package/dist/apps/cli/commands/project/commandGetShell.d.ts +3 -0
  56. package/dist/apps/cli/commands/project/commandGetShell.js +92 -0
  57. package/dist/apps/cli/commands/project/commandGetShell.js.map +1 -0
  58. package/dist/apps/cli/commands/project/commandGitlabCi.d.ts +3 -0
  59. package/dist/apps/cli/commands/project/commandGitlabCi.js +185 -0
  60. package/dist/apps/cli/commands/project/commandGitlabCi.js.map +1 -0
  61. package/dist/apps/cli/commands/project/commandInitGitlab.d.ts +3 -0
  62. package/dist/apps/cli/commands/project/commandInitGitlab.js +245 -0
  63. package/dist/apps/cli/commands/project/commandInitGitlab.js.map +1 -0
  64. package/dist/apps/cli/commands/project/commandInitProject.d.ts +3 -0
  65. package/dist/apps/cli/commands/project/commandInitProject.js +345 -0
  66. package/dist/apps/cli/commands/project/commandInitProject.js.map +1 -0
  67. package/dist/apps/cli/commands/project/commandListPods.d.ts +3 -0
  68. package/dist/apps/cli/commands/project/commandListPods.js +78 -0
  69. package/dist/apps/cli/commands/project/commandListPods.js.map +1 -0
  70. package/dist/apps/cli/commands/project/commandMigrateHelm3.d.ts +7 -0
  71. package/dist/apps/cli/commands/project/commandMigrateHelm3.js +113 -0
  72. package/dist/apps/cli/commands/project/commandMigrateHelm3.js.map +1 -0
  73. package/dist/apps/cli/commands/project/commandNamespace.d.ts +3 -0
  74. package/dist/apps/cli/commands/project/commandNamespace.js +70 -0
  75. package/dist/apps/cli/commands/project/commandNamespace.js.map +1 -0
  76. package/dist/apps/cli/commands/project/commandOpenCostDashboard.d.ts +3 -0
  77. package/dist/apps/cli/commands/project/commandOpenCostDashboard.js +83 -0
  78. package/dist/apps/cli/commands/project/commandOpenCostDashboard.js.map +1 -0
  79. package/dist/apps/cli/commands/project/commandOpenDashboard.d.ts +3 -0
  80. package/dist/apps/cli/commands/project/commandOpenDashboard.js +92 -0
  81. package/dist/apps/cli/commands/project/commandOpenDashboard.js.map +1 -0
  82. package/dist/apps/cli/commands/project/commandOpenEnv.d.ts +3 -0
  83. package/dist/apps/cli/commands/project/commandOpenEnv.js +80 -0
  84. package/dist/apps/cli/commands/project/commandOpenEnv.js.map +1 -0
  85. package/dist/apps/cli/commands/project/commandOpenGit.d.ts +3 -0
  86. package/dist/apps/cli/commands/project/commandOpenGit.js +56 -0
  87. package/dist/apps/cli/commands/project/commandOpenGit.js.map +1 -0
  88. package/dist/apps/cli/commands/project/commandOpenGrafana.d.ts +3 -0
  89. package/dist/apps/cli/commands/project/commandOpenGrafana.js +83 -0
  90. package/dist/apps/cli/commands/project/commandOpenGrafana.js.map +1 -0
  91. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.d.ts +3 -0
  92. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js +99 -0
  93. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js.map +1 -0
  94. package/dist/apps/cli/commands/project/commandOpenLogs.d.ts +3 -0
  95. package/dist/apps/cli/commands/project/commandOpenLogs.js +87 -0
  96. package/dist/apps/cli/commands/project/commandOpenLogs.js.map +1 -0
  97. package/dist/apps/cli/commands/project/commandPauseProject.d.ts +3 -0
  98. package/dist/apps/cli/commands/project/commandPauseProject.js +97 -0
  99. package/dist/apps/cli/commands/project/commandPauseProject.js.map +1 -0
  100. package/dist/apps/cli/commands/project/commandPortForward.d.ts +3 -0
  101. package/dist/apps/cli/commands/project/commandPortForward.js +106 -0
  102. package/dist/apps/cli/commands/project/commandPortForward.js.map +1 -0
  103. package/dist/apps/cli/commands/project/commandReloadConfig.d.ts +3 -0
  104. package/dist/apps/cli/commands/project/commandReloadConfig.js +62 -0
  105. package/dist/apps/cli/commands/project/commandReloadConfig.js.map +1 -0
  106. package/dist/apps/cli/commands/project/commandTriggerCronjob.d.ts +3 -0
  107. package/dist/apps/cli/commands/project/commandTriggerCronjob.js +144 -0
  108. package/dist/apps/cli/commands/project/commandTriggerCronjob.js.map +1 -0
  109. package/dist/apps/cli/commands/project/index.d.ts +3 -0
  110. package/dist/apps/cli/commands/project/index.js +97 -0
  111. package/dist/apps/cli/commands/project/index.js.map +1 -0
  112. package/dist/apps/cli/commands/project/utils/autocompletions.d.ts +3 -0
  113. package/dist/apps/cli/commands/project/utils/autocompletions.js +96 -0
  114. package/dist/apps/cli/commands/project/utils/autocompletions.js.map +1 -0
  115. package/dist/apps/cli/commands/project/utils/ensureCluster.d.ts +1 -0
  116. package/dist/apps/cli/commands/project/utils/ensureCluster.js +84 -0
  117. package/dist/apps/cli/commands/project/utils/ensureCluster.js.map +1 -0
  118. package/dist/apps/cli/commands/project/utils/ensureNamespace.d.ts +1 -0
  119. package/dist/apps/cli/commands/project/utils/ensureNamespace.js +92 -0
  120. package/dist/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -0
  121. package/dist/apps/cli/commands/project/utils/showProjectBanner.d.ts +2 -0
  122. package/dist/apps/cli/commands/project/utils/showProjectBanner.js +58 -0
  123. package/dist/apps/cli/commands/project/utils/showProjectBanner.js.map +1 -0
  124. package/dist/apps/cli/commands/shared/index.d.ts +2 -0
  125. package/dist/apps/cli/commands/shared/index.js +72 -0
  126. package/dist/apps/cli/commands/shared/index.js.map +1 -0
  127. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +3 -0
  128. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js +131 -0
  129. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js.map +1 -0
  130. package/dist/apps/cli/config/writeConfig.d.ts +5 -0
  131. package/dist/apps/cli/config/writeConfig.js +104 -0
  132. package/dist/apps/cli/config/writeConfig.js.map +1 -0
  133. package/dist/apps/cli/utils/getGoogleAuthUserNumber.d.ts +1 -0
  134. package/dist/apps/cli/utils/getGoogleAuthUserNumber.js +69 -0
  135. package/dist/apps/cli/utils/getGoogleAuthUserNumber.js.map +1 -0
  136. package/dist/apps/cli/verify/index.d.ts +2 -0
  137. package/dist/apps/cli/verify/index.js +90 -0
  138. package/dist/apps/cli/verify/index.js.map +1 -0
  139. package/dist/apps/cli/verify/migration/fromv2.d.ts +3 -0
  140. package/dist/apps/cli/verify/migration/fromv2.js +322 -0
  141. package/dist/apps/cli/verify/migration/fromv2.js.map +1 -0
  142. package/dist/apps/cli/verify/migration/migrateSecrets.d.ts +4 -0
  143. package/dist/apps/cli/verify/migration/migrateSecrets.js +88 -0
  144. package/dist/apps/cli/verify/migration/migrateSecrets.js.map +1 -0
  145. package/dist/apps/cli/verify/migration/oldGitlabCi.d.ts +17 -0
  146. package/dist/apps/cli/verify/migration/oldGitlabCi.js +26 -0
  147. package/dist/apps/cli/verify/migration/oldGitlabCi.js.map +1 -0
  148. package/dist/catenv.d.ts +1 -0
  149. package/dist/catenv.js +8 -0
  150. package/dist/catenv.js.map +1 -0
  151. package/dist/cli.d.ts +1 -0
  152. package/dist/cli.js +13 -0
  153. package/dist/cli.js.map +1 -0
  154. package/dist/config/clusters.d.ts +14 -0
  155. package/dist/config/clusters.js +72 -0
  156. package/dist/config/clusters.js.map +1 -0
  157. package/dist/config/constants.d.ts +4 -0
  158. package/dist/config/constants.js +8 -0
  159. package/dist/config/constants.js.map +1 -0
  160. package/dist/config/getProjectConfig.d.ts +21 -0
  161. package/dist/config/getProjectConfig.js +212 -0
  162. package/dist/config/getProjectConfig.js.map +1 -0
  163. package/dist/k8sApi/index.d.ts +5 -0
  164. package/dist/k8sApi/index.js +11 -0
  165. package/dist/k8sApi/index.js.map +1 -0
  166. package/dist/packageInfos.d.ts +2 -0
  167. package/dist/packageInfos.js +6 -0
  168. package/dist/packageInfos.js.map +1 -0
  169. package/dist/tsconfig.tsbuildinfo +1 -0
  170. package/dist/types/types.d.ts +18 -0
  171. package/dist/types/types.js +3 -0
  172. package/dist/types/types.js.map +1 -0
  173. package/dist/utils/cluster.d.ts +12 -0
  174. package/dist/utils/cluster.js +100 -0
  175. package/dist/utils/cluster.js.map +1 -0
  176. package/dist/utils/editAsFile.d.ts +1 -0
  177. package/dist/utils/editAsFile.js +85 -0
  178. package/dist/utils/editAsFile.js.map +1 -0
  179. package/dist/utils/files.d.ts +2 -0
  180. package/dist/utils/files.js +83 -0
  181. package/dist/utils/files.js.map +1 -0
  182. package/dist/utils/formatEnvVars.d.ts +2 -0
  183. package/dist/utils/formatEnvVars.js +10 -0
  184. package/dist/utils/formatEnvVars.js.map +1 -0
  185. package/dist/utils/getEditor.d.ts +4 -0
  186. package/dist/utils/getEditor.js +70 -0
  187. package/dist/utils/getEditor.js.map +1 -0
  188. package/dist/utils/gitlab.d.ts +21 -0
  189. package/dist/utils/gitlab.js +258 -0
  190. package/dist/utils/gitlab.js.map +1 -0
  191. package/dist/utils/log.d.ts +1 -0
  192. package/dist/utils/log.js +14 -0
  193. package/dist/utils/log.js.map +1 -0
  194. package/dist/utils/passwordstore/index.d.ts +8 -0
  195. package/dist/utils/passwordstore/index.js +378 -0
  196. package/dist/utils/passwordstore/index.js.map +1 -0
  197. package/dist/utils/portForward.d.ts +4 -0
  198. package/dist/utils/portForward.js +116 -0
  199. package/dist/utils/portForward.js.map +1 -0
  200. package/dist/utils/preferences/index.d.ts +3 -0
  201. package/dist/utils/preferences/index.js +119 -0
  202. package/dist/utils/preferences/index.js.map +1 -0
  203. package/dist/utils/projects/index.d.ts +8 -0
  204. package/dist/utils/projects/index.js +150 -0
  205. package/dist/utils/projects/index.js.map +1 -0
  206. package/dist/utils/promise.d.ts +2 -0
  207. package/dist/utils/promise.js +62 -0
  208. package/dist/utils/promise.js.map +1 -0
  209. package/dist/utils/shell.d.ts +1 -0
  210. package/dist/utils/shell.js +81 -0
  211. package/dist/utils/shell.js.map +1 -0
  212. package/package.json +12 -20
  213. package/src/apps/catenv/catenv.ts +48 -27
  214. package/src/apps/{shell/shell.ts → cli/cli.ts} +10 -2
  215. package/src/apps/{shell → cli}/commands/general/index.ts +1 -1
  216. package/src/apps/{shell → cli}/commands/general/namespaceAutoCompletion.ts +0 -0
  217. package/src/apps/{shell → cli}/commands/general/portForward.ts +1 -1
  218. package/src/apps/{shell → cli}/commands/mongodb/index.ts +1 -1
  219. package/src/apps/{shell → cli}/commands/mongodb/projectMongoDestroyMember.ts +18 -18
  220. package/src/apps/{shell → cli}/commands/mongodb/projectMongoGetShell.ts +12 -10
  221. package/src/apps/{shell → cli}/commands/mongodb/projectMongoPortForward.ts +13 -8
  222. package/src/apps/{shell → cli}/commands/mongodb/utils/index.ts +9 -8
  223. package/src/apps/{shell → cli}/commands/project/commandCloudSqlProxy.ts +23 -17
  224. package/src/apps/cli/commands/project/commandConfigSecrets.ts +208 -0
  225. package/src/apps/{shell → cli}/commands/project/commandCopyDB.ts +22 -23
  226. package/src/apps/{shell → cli}/commands/project/commandDeletePods.ts +8 -9
  227. package/src/apps/{shell → cli}/commands/project/commandDeleteProject.ts +7 -8
  228. package/src/apps/cli/commands/project/commandEnvVars.ts +15 -0
  229. package/src/apps/{shell → cli}/commands/project/commandGetMyTotalWorktime.ts +2 -2
  230. package/src/apps/{shell → cli}/commands/project/commandGetShell.ts +10 -10
  231. package/src/apps/{shell → cli}/commands/project/commandGitlabCi.ts +1 -1
  232. package/src/apps/cli/commands/project/commandInitGitlab.ts +203 -0
  233. package/src/apps/{shell → cli}/commands/project/commandInitProject.ts +14 -6
  234. package/src/apps/cli/commands/project/commandListPods.ts +18 -0
  235. package/src/apps/{shell → cli}/commands/project/commandMigrateHelm3.ts +16 -7
  236. package/src/apps/cli/commands/project/commandNamespace.ts +14 -0
  237. package/src/apps/{shell → cli}/commands/project/commandOpenCostDashboard.ts +10 -7
  238. package/src/apps/cli/commands/project/commandOpenDashboard.ts +45 -0
  239. package/src/apps/cli/commands/project/commandOpenEnv.ts +22 -0
  240. package/src/apps/{shell → cli}/commands/project/commandOpenGit.ts +1 -1
  241. package/src/apps/{shell → cli}/commands/project/commandOpenGrafana.ts +7 -7
  242. package/src/apps/{shell → cli}/commands/project/commandOpenGrafanaPod.ts +9 -10
  243. package/src/apps/{shell → cli}/commands/project/commandOpenLogs.ts +7 -7
  244. package/src/apps/{shell → cli}/commands/project/commandPauseProject.ts +9 -7
  245. package/src/apps/{shell → cli}/commands/project/commandPortForward.ts +8 -8
  246. package/src/apps/cli/commands/project/commandReloadConfig.ts +12 -0
  247. package/src/apps/{shell → cli}/commands/project/commandTriggerCronjob.ts +7 -7
  248. package/src/apps/{shell → cli}/commands/project/index.ts +4 -3
  249. package/src/apps/cli/commands/project/utils/autocompletions.ts +26 -0
  250. package/src/apps/cli/commands/project/utils/ensureCluster.ts +37 -0
  251. package/src/apps/{shell → cli}/commands/project/utils/ensureNamespace.ts +2 -3
  252. package/src/apps/cli/commands/project/utils/showProjectBanner.ts +11 -0
  253. package/src/apps/{shell → cli}/commands/shared/index.ts +0 -0
  254. package/src/apps/{shell → cli}/commands/theStuffThatReallyMatters/index.ts +11 -11
  255. package/src/apps/cli/config/writeConfig.ts +69 -0
  256. package/src/apps/{shell → cli}/utils/getGoogleAuthUserNumber.ts +0 -0
  257. package/src/apps/cli/verify/index.ts +34 -0
  258. package/src/apps/cli/verify/migration/fromv2.ts +241 -0
  259. package/src/apps/cli/verify/migration/migrateSecrets.ts +37 -0
  260. package/src/apps/cli/verify/migration/oldGitlabCi.ts +43 -0
  261. package/src/catenv.ts +3 -0
  262. package/src/cli.ts +8 -0
  263. package/src/config/getProjectConfig.ts +118 -0
  264. package/src/types/types.ts +0 -2
  265. package/src/utils/cluster.ts +15 -2
  266. package/src/utils/editAsFile.ts +31 -0
  267. package/src/utils/files.ts +6 -2
  268. package/src/utils/gitlab.ts +126 -32
  269. package/src/utils/passwordstore/index.ts +19 -21
  270. package/src/utils/preferences/index.ts +6 -3
  271. package/src/utils/projects/index.ts +14 -134
  272. package/tsconfig.json +3 -7
  273. package/bin/catenv.sh +0 -1
  274. package/src/apps/shell/commands/project/commandConfigSecrets.ts +0 -245
  275. package/src/apps/shell/commands/project/commandEnvVars.ts +0 -17
  276. package/src/apps/shell/commands/project/commandInitGitlab.ts +0 -157
  277. package/src/apps/shell/commands/project/commandListPods.ts +0 -21
  278. package/src/apps/shell/commands/project/commandNamespace.ts +0 -12
  279. package/src/apps/shell/commands/project/commandOpenDashboard.ts +0 -27
  280. package/src/apps/shell/commands/project/commandOpenEnv.ts +0 -18
  281. package/src/apps/shell/commands/project/commandVariables.ts +0 -13
  282. package/src/apps/shell/commands/project/utils/autocompletions.ts +0 -7
  283. package/src/apps/shell/commands/project/utils/ensureCluster.ts +0 -31
  284. package/src/apps/shell/commands/project/utils/monorepo.ts +0 -45
  285. package/src/index.ts +0 -17
  286. package/src/types/git-repo-name.d.ts +0 -1
  287. package/src/types/yawn-yaml.d.ts +0 -1
  288. package/src/utils/dashboardToken.ts +0 -20
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ exports.__esModule = true;
42
+ var cluster_1 = require("../../../../utils/cluster");
43
+ var projects_1 = require("../../../../utils/projects");
44
+ var getGoogleAuthUserNumber_1 = require("../../utils/getGoogleAuthUserNumber");
45
+ var shared_1 = require("../shared");
46
+ var autocompletions_1 = require("./utils/autocompletions");
47
+ var ensureCluster_1 = __importDefault(require("./utils/ensureCluster"));
48
+ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
49
+ var _a, _b;
50
+ return __generator(this, function (_c) {
51
+ switch (_c.label) {
52
+ case 0:
53
+ _b = (_a = vorpal
54
+ .command("project-open-logs <envComponent>", "open google cloud logs (stackdriver logs)"))
55
+ .autocomplete;
56
+ return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
57
+ case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])
58
+ .action(function (_a) {
59
+ var envComponent = _a.envComponent;
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ var clustername, namespace, authGoogleNumber;
62
+ return __generator(this, function (_b) {
63
+ switch (_b.label) {
64
+ case 0: return [4 /*yield*/, ensureCluster_1["default"].call(this, envComponent)];
65
+ case 1:
66
+ _b.sent();
67
+ return [4 /*yield*/, (0, cluster_1.getCurrentConnectedClusterName)()];
68
+ case 2:
69
+ clustername = _b.sent();
70
+ return [4 /*yield*/, (0, projects_1.getProjectNamespace)(envComponent)];
71
+ case 3:
72
+ namespace = _b.sent();
73
+ return [4 /*yield*/, getGoogleAuthUserNumber_1.getGoogleAuthUserNumber.call(this, vorpal)];
74
+ case 4:
75
+ authGoogleNumber = _b.sent();
76
+ return [4 /*yield*/, (0, shared_1.openGoogleCloudLogs)(authGoogleNumber, clustername, namespace)];
77
+ case 5:
78
+ _b.sent();
79
+ return [2 /*return*/];
80
+ }
81
+ });
82
+ });
83
+ })];
84
+ }
85
+ });
86
+ }); });
87
+ //# sourceMappingURL=commandOpenLogs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandOpenLogs.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandOpenLogs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qDAA2E;AAC3E,uDAAiE;AACjE,+EAA8E;AAC9E,oCAAgD;AAChD,2DAA2D;AAC3D,wEAAkD;AAElD,sBAAe,UAAO,MAAc;;;;;gBAClC,KAAA,CAAA,KAAA,MAAM;qBACH,OAAO,CACN,kCAAkC,EAClC,2CAA2C,CAC5C,CAAA;qBACA,YAAY,CAAA;gBAAC,qBAAM,IAAA,kCAAgB,GAAE,EAAA;oBALxC,sBAAA,cAKgB,SAAwB,EAAC;qBACtC,MAAM,CAAC,UAAgB,EAAgB;wBAAd,YAAY,kBAAA;;;;;wCACpC,qBAAM,0BAAa,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,EAAA;;oCAA5C,SAA4C,CAAC;oCACzB,qBAAM,IAAA,wCAA8B,GAAE,EAAA;;oCAApD,WAAW,GAAG,SAAsC;oCACxC,qBAAM,IAAA,8BAAmB,EAAC,YAAY,CAAC,EAAA;;oCAAnD,SAAS,GAAG,SAAuC;oCAChC,qBAAM,iDAAuB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAA;;oCAAnE,gBAAgB,GAAG,SAAgD;oCAEzE,qBAAM,IAAA,4BAAmB,EAAC,gBAAgB,EAAE,WAAW,EAAE,SAAS,CAAC,EAAA;;oCAAnE,SAAmE,CAAC;;;;;iBACrE,CAAC,EAAA;;;KAAA,EAAC"}
@@ -0,0 +1,3 @@
1
+ import Vorpal from "vorpal";
2
+ declare const _default: (vorpal: Vorpal) => Promise<Vorpal.Command>;
3
+ export default _default;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (_) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ exports.__esModule = true;
50
+ var child_process_promise_1 = require("child-process-promise");
51
+ var projects_1 = require("../../../../utils/projects");
52
+ var autocompletions_1 = require("./utils/autocompletions");
53
+ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
54
+ var _a, _b;
55
+ return __generator(this, function (_c) {
56
+ switch (_c.label) {
57
+ case 0:
58
+ _b = (_a = vorpal
59
+ .command("project-pause <envComponent>", "halts all running pods (scales to 0)"))
60
+ .autocomplete;
61
+ return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
62
+ case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])
63
+ .action(function (_a) {
64
+ var envComponent = _a.envComponent;
65
+ return __awaiter(this, void 0, void 0, function () {
66
+ var namespace, shouldContinue, fullCommand, stdout;
67
+ return __generator(this, function (_b) {
68
+ switch (_b.label) {
69
+ case 0: return [4 /*yield*/, (0, projects_1.getProjectNamespace)(envComponent)];
70
+ case 1:
71
+ namespace = _b.sent();
72
+ return [4 /*yield*/, this.prompt({
73
+ type: "confirm",
74
+ name: "shouldContinue",
75
+ message: "This will STOP all running pods in the namespace ".concat(namespace, ". You will need to manually scale back up or re-deploy. Continue? \uD83E\uDD14 ")
76
+ })];
77
+ case 2:
78
+ shouldContinue = (_b.sent()).shouldContinue;
79
+ if (!shouldContinue) {
80
+ return [2 /*return*/];
81
+ }
82
+ fullCommand = "kubectl scale statefulset,deployment --all --replicas=0 --namespace=".concat(namespace);
83
+ return [4 /*yield*/, (0, child_process_promise_1.exec)(fullCommand, {
84
+ env: __assign(__assign({}, process.env), { DEBUG: "" })
85
+ })];
86
+ case 3:
87
+ stdout = (_b.sent()).stdout;
88
+ this.log(stdout);
89
+ return [2 /*return*/];
90
+ }
91
+ });
92
+ });
93
+ })];
94
+ }
95
+ });
96
+ }); });
97
+ //# sourceMappingURL=commandPauseProject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandPauseProject.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandPauseProject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+DAA6C;AAC7C,uDAAiE;AACjE,2DAA2D;AAE3D,sBAAe,UAAO,MAAc;;;;;gBAClC,KAAA,CAAA,KAAA,MAAM;qBACH,OAAO,CACN,8BAA8B,EAC9B,sCAAsC,CACvC,CAAA;qBACA,YAAY,CAAA;gBAAC,qBAAM,IAAA,kCAAgB,GAAE,EAAA;oBALxC,sBAAA,cAKgB,SAAwB,EAAC;qBACtC,MAAM,CAAC,UAAgB,EAAgB;wBAAd,YAAY,kBAAA;;;;;wCAClB,qBAAM,IAAA,8BAAmB,EAAC,YAAY,CAAC,EAAA;;oCAAnD,SAAS,GAAG,SAAuC;oCAC9B,qBAAM,IAAI,CAAC,MAAM,CAAC;4CAC3C,IAAI,EAAE,SAAS;4CACf,IAAI,EAAE,gBAAgB;4CACtB,OAAO,EAAE,2DAAoD,SAAS,oFAAuE;yCAC9I,CAAC,EAAA;;oCAJM,cAAc,GAAK,CAAA,SAIzB,CAAA,eAJoB;oCAMtB,IAAI,CAAC,cAAc,EAAE;wCACnB,sBAAO;qCACR;oCAEK,WAAW,GAAG,8EAAuE,SAAS,CAAE,CAAC;oCACpF,qBAAM,IAAA,4BAAI,EAAC,WAAW,EAAE;4CACzC,GAAG,wBACE,OAAO,CAAC,GAAG,KACd,KAAK,EAAE,EAAE,GACV;yCACF,CAAC,EAAA;;oCALM,MAAM,GAAK,CAAA,SAKjB,CAAA,OALY;oCAMd,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;;;;;iBAClB,CAAC,EAAA;;;KAAA,EAAC"}
@@ -0,0 +1,3 @@
1
+ import Vorpal from "vorpal";
2
+ declare const _default: (vorpal: Vorpal) => Promise<Vorpal.Command>;
3
+ export default _default;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ exports.__esModule = true;
42
+ var log_1 = require("../../../../utils/log");
43
+ var portForward_1 = require("../../../../utils/portForward");
44
+ var projects_1 = require("../../../../utils/projects");
45
+ var autocompletions_1 = require("./utils/autocompletions");
46
+ var ensureCluster_1 = __importDefault(require("./utils/ensureCluster"));
47
+ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
48
+ var _a, _b;
49
+ return __generator(this, function (_c) {
50
+ switch (_c.label) {
51
+ case 0:
52
+ _b = (_a = vorpal
53
+ .command("project-port-forward <envComponent>", "start port-forwarding"))
54
+ .autocomplete;
55
+ return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
56
+ case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])
57
+ .action(function (_a) {
58
+ var envComponent = _a.envComponent;
59
+ return __awaiter(this, void 0, void 0, function () {
60
+ var namespace, podNames, podName, localPort, remotePort;
61
+ return __generator(this, function (_b) {
62
+ switch (_b.label) {
63
+ case 0: return [4 /*yield*/, ensureCluster_1["default"].call(this, envComponent)];
64
+ case 1:
65
+ _b.sent();
66
+ return [4 /*yield*/, (0, projects_1.getProjectNamespace)(envComponent)];
67
+ case 2:
68
+ namespace = _b.sent();
69
+ return [4 /*yield*/, (0, projects_1.getProjectPodNames)(envComponent)];
70
+ case 3:
71
+ podNames = _b.sent();
72
+ if (podNames.length === 0) {
73
+ (0, log_1.logError)(this, "sorry, no pods found");
74
+ return [2 /*return*/];
75
+ }
76
+ return [4 /*yield*/, this.prompt({
77
+ type: "list",
78
+ name: "podName",
79
+ choices: podNames,
80
+ message: "Which pod? 🤔"
81
+ })];
82
+ case 4:
83
+ podName = (_b.sent()).podName;
84
+ return [4 /*yield*/, this.prompt({
85
+ type: "number",
86
+ name: "localPort",
87
+ message: "Local port: "
88
+ })];
89
+ case 5:
90
+ localPort = (_b.sent()).localPort;
91
+ return [4 /*yield*/, this.prompt({
92
+ type: "number",
93
+ name: "remotePort",
94
+ message: "Remote port: "
95
+ })];
96
+ case 6:
97
+ remotePort = (_b.sent()).remotePort;
98
+ return [2 /*return*/, (0, portForward_1.startPortForward)(podName, localPort, remotePort, namespace)];
99
+ }
100
+ });
101
+ });
102
+ })];
103
+ }
104
+ });
105
+ }); });
106
+ //# sourceMappingURL=commandPortForward.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandPortForward.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandPortForward.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAAiD;AACjD,6DAAiE;AACjE,uDAGoC;AACpC,2DAA2D;AAC3D,wEAAkD;AAElD,sBAAe,UAAO,MAAc;;;;;gBAClC,KAAA,CAAA,KAAA,MAAM;qBACH,OAAO,CAAC,qCAAqC,EAAE,uBAAuB,CAAC,CAAA;qBACvE,YAAY,CAAA;gBAAC,qBAAM,IAAA,kCAAgB,GAAE,EAAA;oBAFxC,sBAAA,cAEgB,SAAwB,EAAC;qBACtC,MAAM,CAAC,UAAgB,EAAgB;wBAAd,YAAY,kBAAA;;;;;wCACpC,qBAAM,0BAAa,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,EAAA;;oCAA5C,SAA4C,CAAC;oCAC3B,qBAAM,IAAA,8BAAmB,EAAC,YAAY,CAAC,EAAA;;oCAAnD,SAAS,GAAG,SAAuC;oCACxC,qBAAM,IAAA,6BAAkB,EAAC,YAAY,CAAC,EAAA;;oCAAjD,QAAQ,GAAG,SAAsC;oCACvD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;wCACzB,IAAA,cAAQ,EAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;wCACvC,sBAAO;qCACR;oCACmB,qBAAM,IAAI,CAAC,MAAM,CAAC;4CACpC,IAAI,EAAE,MAAM;4CACZ,IAAI,EAAE,SAAS;4CACf,OAAO,EAAE,QAAQ;4CACjB,OAAO,EAAE,eAAe;yCACzB,CAAC,EAAA;;oCALM,OAAO,GAAK,CAAA,SAKlB,CAAA,QALa;oCAOO,qBAAM,IAAI,CAAC,MAAM,CAAC;4CACtC,IAAI,EAAE,QAAQ;4CACd,IAAI,EAAE,WAAW;4CAEjB,OAAO,EAAE,cAAc;yCACxB,CAAC,EAAA;;oCALM,SAAS,GAAK,CAAA,SAKpB,CAAA,UALe;oCAOM,qBAAM,IAAI,CAAC,MAAM,CAAC;4CACvC,IAAI,EAAE,QAAQ;4CACd,IAAI,EAAE,YAAY;4CAElB,OAAO,EAAE,eAAe;yCACzB,CAAC,EAAA;;oCALM,UAAU,GAAK,CAAA,SAKrB,CAAA,WALgB;oCAOlB,sBAAO,IAAA,8BAAgB,EAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,EAAC;;;;iBACpE,CAAC,EAAA;;;KAAA,EAAC"}
@@ -0,0 +1,3 @@
1
+ import Vorpal from "vorpal";
2
+ declare const _default: (vorpal: Vorpal) => Promise<Vorpal.Command>;
3
+ export default _default;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ exports.__esModule = true;
39
+ var getProjectConfig_1 = require("../../../../config/getProjectConfig");
40
+ var showProjectBanner_1 = require("./utils/showProjectBanner");
41
+ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
42
+ return __generator(this, function (_a) {
43
+ return [2 /*return*/, vorpal
44
+ .command("project-reload-config", "reloads the config")
45
+ .action(function () {
46
+ return __awaiter(this, void 0, void 0, function () {
47
+ return __generator(this, function (_a) {
48
+ switch (_a.label) {
49
+ case 0: return [4 /*yield*/, (0, getProjectConfig_1.reloadConfig)()];
50
+ case 1:
51
+ _a.sent();
52
+ return [4 /*yield*/, (0, showProjectBanner_1.showProjectBanner)(vorpal)];
53
+ case 2:
54
+ _a.sent();
55
+ return [2 /*return*/];
56
+ }
57
+ });
58
+ });
59
+ })];
60
+ });
61
+ }); });
62
+ //# sourceMappingURL=commandReloadConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandReloadConfig.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandReloadConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wEAAmE;AACnE,+DAA8D;AAE9D,sBAAe,UAAO,MAAc;;QAClC,sBAAA,MAAM;iBACH,OAAO,CAAC,uBAAuB,EAAE,oBAAoB,CAAC;iBAEtD,MAAM,CAAC;;;;oCACN,qBAAM,IAAA,+BAAY,GAAE,EAAA;;gCAApB,SAAoB,CAAC;gCACrB,qBAAM,IAAA,qCAAiB,EAAC,MAAM,CAAC,EAAA;;gCAA/B,SAA+B,CAAC;;;;;aACjC,CAAC,EAAA;;KAAA,EAAC"}
@@ -0,0 +1,3 @@
1
+ import Vorpal from "vorpal";
2
+ declare const _default: (vorpal: Vorpal) => Promise<void>;
3
+ export default _default;
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ exports.__esModule = true;
42
+ var client_node_1 = require("@kubernetes/client-node");
43
+ var k8sApi_1 = require("../../../../k8sApi");
44
+ var log_1 = require("../../../../utils/log");
45
+ var namespaceAutoCompletion_1 = require("../general/namespaceAutoCompletion");
46
+ var projects_1 = require("../../../../utils/projects");
47
+ var autocompletions_1 = require("./utils/autocompletions");
48
+ var ensureCluster_1 = __importDefault(require("./utils/ensureCluster"));
49
+ function triggerCronjob(namespace) {
50
+ return __awaiter(this, void 0, void 0, function () {
51
+ var jobs, jobNames, jobName, cronjob, jobSpec, job, metadata, result, e_1;
52
+ return __generator(this, function (_a) {
53
+ switch (_a.label) {
54
+ case 0: return [4 /*yield*/, k8sApi_1.k8sApiBatchBeta.listNamespacedCronJob(namespace)];
55
+ case 1:
56
+ jobs = (_a.sent()).body.items;
57
+ jobNames = jobs.map(function (j) { return j.metadata.name; });
58
+ return [4 /*yield*/, this.prompt({
59
+ type: "list",
60
+ name: "jobName",
61
+ choices: jobNames,
62
+ message: "Which cronjob? 🤔"
63
+ })];
64
+ case 2:
65
+ jobName = (_a.sent()).jobName;
66
+ cronjob = jobs.find(function (j) { return j.metadata.name === jobName; });
67
+ jobSpec = cronjob.spec.jobTemplate.spec;
68
+ job = new client_node_1.V1Job();
69
+ metadata = {
70
+ name: "manual-".concat(Math.round(Date.now() / 1000), "-").concat(cronjob.metadata.name)
71
+ };
72
+ job.metadata = metadata;
73
+ job.spec = jobSpec;
74
+ _a.label = 3;
75
+ case 3:
76
+ _a.trys.push([3, 5, , 6]);
77
+ return [4 /*yield*/, k8sApi_1.k8sApiBatch.createNamespacedJob(namespace, job)];
78
+ case 4:
79
+ result = _a.sent();
80
+ this.log("");
81
+ this.log("yeah, you got a job, man. \uD83D\uDE3A ".concat(result.body.metadata.name));
82
+ this.log("");
83
+ return [3 /*break*/, 6];
84
+ case 5:
85
+ e_1 = _a.sent();
86
+ (0, log_1.logError)(this, "command failed", e_1.body);
87
+ return [3 /*break*/, 6];
88
+ case 6: return [2 /*return*/];
89
+ }
90
+ });
91
+ });
92
+ }
93
+ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
94
+ var _a, _b;
95
+ return __generator(this, function (_c) {
96
+ switch (_c.label) {
97
+ case 0:
98
+ vorpal
99
+ .command("trigger-cronjob <namespace>", "trigger cronjob")
100
+ .autocomplete(namespaceAutoCompletion_1.namespaceAutoCompletion)
101
+ .action(function (_a) {
102
+ var namespace = _a.namespace;
103
+ return __awaiter(this, void 0, void 0, function () {
104
+ return __generator(this, function (_b) {
105
+ switch (_b.label) {
106
+ case 0: return [4 /*yield*/, triggerCronjob.call(this, namespace)];
107
+ case 1:
108
+ _b.sent();
109
+ return [2 /*return*/];
110
+ }
111
+ });
112
+ });
113
+ });
114
+ _b = (_a = vorpal
115
+ .command("project-trigger-cronjob <envComponent>", "trigger cronjob"))
116
+ .autocomplete;
117
+ return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
118
+ case 1:
119
+ _b.apply(_a, [_c.sent()])
120
+ .action(function (_a) {
121
+ var envComponent = _a.envComponent;
122
+ return __awaiter(this, void 0, void 0, function () {
123
+ var namespace;
124
+ return __generator(this, function (_b) {
125
+ switch (_b.label) {
126
+ case 0: return [4 /*yield*/, ensureCluster_1["default"].call(this, envComponent)];
127
+ case 1:
128
+ _b.sent();
129
+ return [4 /*yield*/, (0, projects_1.getProjectNamespace)(envComponent)];
130
+ case 2:
131
+ namespace = _b.sent();
132
+ return [4 /*yield*/, triggerCronjob.call(this, namespace)];
133
+ case 3:
134
+ _b.sent();
135
+ return [2 /*return*/];
136
+ }
137
+ });
138
+ });
139
+ });
140
+ return [2 /*return*/];
141
+ }
142
+ });
143
+ }); });
144
+ //# sourceMappingURL=commandTriggerCronjob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandTriggerCronjob.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandTriggerCronjob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA8D;AAG9D,6CAAkE;AAClE,6CAAiD;AACjD,8EAA6E;AAE7E,uDAAiE;AACjE,2DAA2D;AAC3D,wEAAkD;AAElD,SAAe,cAAc,CAAC,SAAiB;;;;;wBAGzC,qBAAM,wBAAe,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAA;;oBADzC,IAAI,GACjB,CAAA,SAAsD,CAAA,WADrC;oBAGf,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAf,CAAe,CAAC,CAAC;oBAE9B,qBAAM,IAAI,CAAC,MAAM,CAAC;4BACpC,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,SAAS;4BACf,OAAO,EAAE,QAAQ;4BACjB,OAAO,EAAE,mBAAmB;yBAC7B,CAAC,EAAA;;oBALM,OAAO,GAAK,CAAA,SAKlB,CAAA,QALa;oBAOT,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,OAAO,EAA3B,CAA2B,CAAC,CAAC;oBACxD,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;oBAExC,GAAG,GAAG,IAAI,mBAAK,EAAE,CAAC;oBAClB,QAAQ,GAA0B;wBACtC,IAAI,EAAE,iBAAU,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,cAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAE;qBACzE,CAAC;oBAEF,GAAG,CAAC,QAAQ,GAAG,QAAwB,CAAC;oBACxC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC;;;;oBAEF,qBAAM,oBAAW,CAAC,mBAAmB,CAAC,SAAS,EAAE,GAAG,CAAC,EAAA;;oBAA9D,MAAM,GAAG,SAAqD;oBAEpE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;oBACb,IAAI,CAAC,GAAG,CAAC,iDAAgC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAE,CAAC,CAAC;oBACtE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;;;;oBAEb,IAAA,cAAQ,EAAC,IAAI,EAAE,gBAAgB,EAAE,GAAC,CAAC,IAAI,CAAC,CAAC;;;;;;CAE5C;AACD,sBAAe,UAAO,MAAc;;;;;gBAClC,MAAM;qBACH,OAAO,CAAC,6BAA6B,EAAE,iBAAiB,CAAC;qBACzD,YAAY,CAAC,iDAAuB,CAAC;qBACrC,MAAM,CAAC,UAAgB,EAAa;wBAAX,SAAS,eAAA;;;;wCACjC,qBAAM,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,EAAA;;oCAA1C,SAA0C,CAAC;;;;;iBAC5C,CAAC,CAAC;gBACL,KAAA,CAAA,KAAA,MAAM;qBACH,OAAO,CAAC,wCAAwC,EAAE,iBAAiB,CAAC,CAAA;qBACpE,YAAY,CAAA;gBAAC,qBAAM,IAAA,kCAAgB,GAAE,EAAA;;gBAFxC,cAEgB,SAAwB,EAAC;qBACtC,MAAM,CAAC,UAAgB,EAAgB;wBAAd,YAAY,kBAAA;;;;;wCACpC,qBAAM,0BAAa,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,EAAA;;oCAA5C,SAA4C,CAAC;oCAC3B,qBAAM,IAAA,8BAAmB,EAAC,YAAY,CAAC,EAAA;;oCAAnD,SAAS,GAAG,SAAuC;oCACzD,qBAAM,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,EAAA;;oCAA1C,SAA0C,CAAC;;;;;iBAC5C,CAAC,CAAC;;;;KACN,EAAC"}
@@ -0,0 +1,3 @@
1
+ import Vorpal from "vorpal";
2
+ declare const _default: (vorpal: Vorpal) => Promise<void>;
3
+ export default _default;