@catladder/cli 0.0.0-test7 → 0.0.0-waitfor-deploy-e64a33ba

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 (303) hide show
  1. package/.nvmrc +1 -1
  2. package/README.md +6 -3
  3. package/bin/catenv +3 -0
  4. package/bin/catladder +1 -1
  5. package/dist/apps/catenv/catenv.d.ts +5 -0
  6. package/dist/apps/catenv/catenv.js +143 -0
  7. package/dist/apps/catenv/catenv.js.map +1 -0
  8. package/dist/apps/cli/cli.d.ts +2 -0
  9. package/dist/apps/cli/cli.js +81 -0
  10. package/dist/apps/cli/cli.js.map +1 -0
  11. package/dist/apps/cli/commands/general/index.d.ts +4 -0
  12. package/dist/apps/cli/commands/general/index.js +216 -0
  13. package/dist/apps/cli/commands/general/index.js.map +1 -0
  14. package/dist/apps/cli/commands/general/namespaceAutoCompletion.d.ts +3 -0
  15. package/dist/apps/cli/commands/general/namespaceAutoCompletion.js +56 -0
  16. package/dist/apps/cli/commands/general/namespaceAutoCompletion.js.map +1 -0
  17. package/dist/apps/cli/commands/general/portForward.d.ts +3 -0
  18. package/dist/apps/cli/commands/general/portForward.js +97 -0
  19. package/dist/apps/cli/commands/general/portForward.js.map +1 -0
  20. package/dist/apps/cli/commands/mongodb/index.d.ts +3 -0
  21. package/dist/apps/cli/commands/mongodb/index.js +53 -0
  22. package/dist/apps/cli/commands/mongodb/index.js.map +1 -0
  23. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +3 -0
  24. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js +190 -0
  25. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +1 -0
  26. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +3 -0
  27. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js +96 -0
  28. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js.map +1 -0
  29. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +3 -0
  30. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js +105 -0
  31. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js.map +1 -0
  32. package/dist/apps/cli/commands/mongodb/utils/index.d.ts +13 -0
  33. package/dist/apps/cli/commands/mongodb/utils/index.js +167 -0
  34. package/dist/apps/cli/commands/mongodb/utils/index.js.map +1 -0
  35. package/dist/apps/cli/commands/project/commandCloudSqlProxy.d.ts +3 -0
  36. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +137 -0
  37. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -0
  38. package/dist/apps/cli/commands/project/commandConfigSecrets.d.ts +4 -0
  39. package/dist/apps/cli/commands/project/commandConfigSecrets.js +320 -0
  40. package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -0
  41. package/dist/apps/cli/commands/project/commandCopyDB.d.ts +3 -0
  42. package/dist/apps/cli/commands/project/commandCopyDB.js +102 -0
  43. package/dist/apps/cli/commands/project/commandCopyDB.js.map +1 -0
  44. package/dist/apps/cli/commands/project/commandDeletePods.d.ts +3 -0
  45. package/dist/apps/cli/commands/project/commandDeletePods.js +120 -0
  46. package/dist/apps/cli/commands/project/commandDeletePods.js.map +1 -0
  47. package/dist/apps/cli/commands/project/commandDeleteProject.d.ts +3 -0
  48. package/dist/apps/cli/commands/project/commandDeleteProject.js +97 -0
  49. package/dist/apps/cli/commands/project/commandDeleteProject.js.map +1 -0
  50. package/dist/apps/cli/commands/project/commandEnvVars.d.ts +3 -0
  51. package/dist/apps/cli/commands/project/commandEnvVars.js +74 -0
  52. package/dist/apps/cli/commands/project/commandEnvVars.js.map +1 -0
  53. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +3 -0
  54. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js +58 -0
  55. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +1 -0
  56. package/dist/apps/cli/commands/project/commandGetShell.d.ts +3 -0
  57. package/dist/apps/cli/commands/project/commandGetShell.js +92 -0
  58. package/dist/apps/cli/commands/project/commandGetShell.js.map +1 -0
  59. package/dist/apps/cli/commands/project/commandGitlabCi.d.ts +3 -0
  60. package/dist/apps/cli/commands/project/commandGitlabCi.js +185 -0
  61. package/dist/apps/cli/commands/project/commandGitlabCi.js.map +1 -0
  62. package/dist/apps/cli/commands/project/commandInitProject.old.d.ts +3 -0
  63. package/dist/apps/cli/commands/project/commandInitProject.old.js +345 -0
  64. package/dist/apps/cli/commands/project/commandInitProject.old.js.map +1 -0
  65. package/dist/apps/cli/commands/project/commandListPods.d.ts +3 -0
  66. package/dist/apps/cli/commands/project/commandListPods.js +78 -0
  67. package/dist/apps/cli/commands/project/commandListPods.js.map +1 -0
  68. package/dist/apps/cli/commands/project/commandMigrateHelm3.d.ts +7 -0
  69. package/dist/apps/cli/commands/project/commandMigrateHelm3.js +113 -0
  70. package/dist/apps/cli/commands/project/commandMigrateHelm3.js.map +1 -0
  71. package/dist/apps/cli/commands/project/commandNamespace.d.ts +3 -0
  72. package/dist/apps/cli/commands/project/commandNamespace.js +70 -0
  73. package/dist/apps/cli/commands/project/commandNamespace.js.map +1 -0
  74. package/dist/apps/cli/commands/project/commandOpenCostDashboard.d.ts +3 -0
  75. package/dist/apps/cli/commands/project/commandOpenCostDashboard.js +83 -0
  76. package/dist/apps/cli/commands/project/commandOpenCostDashboard.js.map +1 -0
  77. package/dist/apps/cli/commands/project/commandOpenDashboard.d.ts +3 -0
  78. package/dist/apps/cli/commands/project/commandOpenDashboard.js +85 -0
  79. package/dist/apps/cli/commands/project/commandOpenDashboard.js.map +1 -0
  80. package/dist/apps/cli/commands/project/commandOpenEnv.d.ts +3 -0
  81. package/dist/apps/cli/commands/project/commandOpenEnv.js +80 -0
  82. package/dist/apps/cli/commands/project/commandOpenEnv.js.map +1 -0
  83. package/dist/apps/cli/commands/project/commandOpenGit.d.ts +3 -0
  84. package/dist/apps/cli/commands/project/commandOpenGit.js +61 -0
  85. package/dist/apps/cli/commands/project/commandOpenGit.js.map +1 -0
  86. package/dist/apps/cli/commands/project/commandOpenGrafana.d.ts +3 -0
  87. package/dist/apps/cli/commands/project/commandOpenGrafana.js +83 -0
  88. package/dist/apps/cli/commands/project/commandOpenGrafana.js.map +1 -0
  89. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.d.ts +3 -0
  90. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js +99 -0
  91. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js.map +1 -0
  92. package/dist/apps/cli/commands/project/commandOpenLogs.d.ts +3 -0
  93. package/dist/apps/cli/commands/project/commandOpenLogs.js +87 -0
  94. package/dist/apps/cli/commands/project/commandOpenLogs.js.map +1 -0
  95. package/dist/apps/cli/commands/project/commandPauseProject.d.ts +3 -0
  96. package/dist/apps/cli/commands/project/commandPauseProject.js +97 -0
  97. package/dist/apps/cli/commands/project/commandPauseProject.js.map +1 -0
  98. package/dist/apps/cli/commands/project/commandPortForward.d.ts +3 -0
  99. package/dist/apps/cli/commands/project/commandPortForward.js +106 -0
  100. package/dist/apps/cli/commands/project/commandPortForward.js.map +1 -0
  101. package/dist/apps/cli/commands/project/commandSetup.d.ts +3 -0
  102. package/dist/apps/cli/commands/project/commandSetup.js +58 -0
  103. package/dist/apps/cli/commands/project/commandSetup.js.map +1 -0
  104. package/dist/apps/cli/commands/project/commandTriggerCronjob.d.ts +3 -0
  105. package/dist/apps/cli/commands/project/commandTriggerCronjob.js +144 -0
  106. package/dist/apps/cli/commands/project/commandTriggerCronjob.js.map +1 -0
  107. package/dist/apps/cli/commands/project/index.d.ts +3 -0
  108. package/dist/apps/cli/commands/project/index.js +94 -0
  109. package/dist/apps/cli/commands/project/index.js.map +1 -0
  110. package/dist/apps/cli/commands/project/setup/index.d.ts +2 -0
  111. package/dist/apps/cli/commands/project/setup/index.js +103 -0
  112. package/dist/apps/cli/commands/project/setup/index.js.map +1 -0
  113. package/dist/apps/cli/commands/project/setup/setupAccessTokens.d.ts +2 -0
  114. package/dist/apps/cli/commands/project/setup/setupAccessTokens.js +115 -0
  115. package/dist/apps/cli/commands/project/setup/setupAccessTokens.js.map +1 -0
  116. package/dist/apps/cli/commands/project/setup/setupContext.d.ts +3 -0
  117. package/dist/apps/cli/commands/project/setup/setupContext.js +74 -0
  118. package/dist/apps/cli/commands/project/setup/setupContext.js.map +1 -0
  119. package/dist/apps/cli/commands/project/setup/setupKubernetes.d.ts +3 -0
  120. package/dist/apps/cli/commands/project/setup/setupKubernetes.js +132 -0
  121. package/dist/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -0
  122. package/dist/apps/cli/commands/project/utils/autocompletions.d.ts +3 -0
  123. package/dist/apps/cli/commands/project/utils/autocompletions.js +96 -0
  124. package/dist/apps/cli/commands/project/utils/autocompletions.js.map +1 -0
  125. package/dist/apps/cli/commands/project/utils/ensureCluster.d.ts +1 -0
  126. package/dist/apps/cli/commands/project/utils/ensureCluster.js +84 -0
  127. package/dist/apps/cli/commands/project/utils/ensureCluster.js.map +1 -0
  128. package/dist/apps/cli/commands/project/utils/ensureNamespace.d.ts +2 -0
  129. package/dist/apps/cli/commands/project/utils/ensureNamespace.js +104 -0
  130. package/dist/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -0
  131. package/dist/apps/cli/commands/project/utils/showProjectBanner.d.ts +2 -0
  132. package/dist/apps/cli/commands/project/utils/showProjectBanner.js +58 -0
  133. package/dist/apps/cli/commands/project/utils/showProjectBanner.js.map +1 -0
  134. package/dist/apps/cli/commands/shared/index.d.ts +3 -0
  135. package/dist/apps/cli/commands/shared/index.js +70 -0
  136. package/dist/apps/cli/commands/shared/index.js.map +1 -0
  137. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +3 -0
  138. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js +101 -0
  139. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js.map +1 -0
  140. package/dist/apps/cli/config/writeConfig.d.ts +5 -0
  141. package/dist/apps/cli/config/writeConfig.js +106 -0
  142. package/dist/apps/cli/config/writeConfig.js.map +1 -0
  143. package/dist/apps/cli/utils/getGoogleAuthUserNumber.d.ts +1 -0
  144. package/dist/apps/cli/utils/getGoogleAuthUserNumber.js +69 -0
  145. package/dist/apps/cli/utils/getGoogleAuthUserNumber.js.map +1 -0
  146. package/dist/apps/cli/verify/index.d.ts +2 -0
  147. package/dist/apps/cli/verify/index.js +94 -0
  148. package/dist/apps/cli/verify/index.js.map +1 -0
  149. package/dist/apps/cli/verify/migration/fromv2.d.ts +4 -0
  150. package/dist/apps/cli/verify/migration/fromv2.js +347 -0
  151. package/dist/apps/cli/verify/migration/fromv2.js.map +1 -0
  152. package/dist/apps/cli/verify/migration/migrateSecrets.d.ts +4 -0
  153. package/dist/apps/cli/verify/migration/migrateSecrets.js +88 -0
  154. package/dist/apps/cli/verify/migration/migrateSecrets.js.map +1 -0
  155. package/dist/apps/cli/verify/migration/oldGitlabCi.d.ts +18 -0
  156. package/dist/apps/cli/verify/migration/oldGitlabCi.js +30 -0
  157. package/dist/apps/cli/verify/migration/oldGitlabCi.js.map +1 -0
  158. package/dist/catenv.d.ts +1 -0
  159. package/dist/catenv.js +15 -0
  160. package/dist/catenv.js.map +1 -0
  161. package/dist/cli.d.ts +1 -0
  162. package/dist/cli.js +15 -0
  163. package/dist/cli.js.map +1 -0
  164. package/dist/config/constants.d.ts +3 -0
  165. package/dist/config/constants.js +7 -0
  166. package/dist/config/constants.js.map +1 -0
  167. package/dist/config/getProjectConfig.d.ts +24 -0
  168. package/dist/config/getProjectConfig.js +259 -0
  169. package/dist/config/getProjectConfig.js.map +1 -0
  170. package/dist/k8sApi/index.d.ts +8 -0
  171. package/dist/k8sApi/index.js +29 -0
  172. package/dist/k8sApi/index.js.map +1 -0
  173. package/dist/packageInfos.d.ts +2 -0
  174. package/dist/packageInfos.js +6 -0
  175. package/dist/packageInfos.js.map +1 -0
  176. package/dist/tsconfig.tsbuildinfo +1 -0
  177. package/dist/types/types.d.ts +18 -0
  178. package/dist/types/types.js +3 -0
  179. package/dist/types/types.js.map +1 -0
  180. package/dist/utils/cluster.d.ts +3 -0
  181. package/dist/utils/cluster.js +73 -0
  182. package/dist/utils/cluster.js.map +1 -0
  183. package/dist/utils/editAsFile.d.ts +1 -0
  184. package/dist/utils/editAsFile.js +85 -0
  185. package/dist/utils/editAsFile.js.map +1 -0
  186. package/dist/utils/files.d.ts +2 -0
  187. package/dist/utils/files.js +83 -0
  188. package/dist/utils/files.js.map +1 -0
  189. package/dist/utils/getEditor.d.ts +4 -0
  190. package/dist/utils/getEditor.js +70 -0
  191. package/dist/utils/getEditor.js.map +1 -0
  192. package/dist/utils/gitlab.d.ts +22 -0
  193. package/dist/utils/gitlab.js +278 -0
  194. package/dist/utils/gitlab.js.map +1 -0
  195. package/dist/utils/log.d.ts +1 -0
  196. package/dist/utils/log.js +14 -0
  197. package/dist/utils/log.js.map +1 -0
  198. package/dist/utils/passwordstore/index.d.ts +8 -0
  199. package/dist/utils/passwordstore/index.js +378 -0
  200. package/dist/utils/passwordstore/index.js.map +1 -0
  201. package/dist/utils/portForward.d.ts +4 -0
  202. package/dist/utils/portForward.js +116 -0
  203. package/dist/utils/portForward.js.map +1 -0
  204. package/dist/utils/preferences/index.d.ts +3 -0
  205. package/dist/utils/preferences/index.js +119 -0
  206. package/dist/utils/preferences/index.js.map +1 -0
  207. package/dist/utils/projects/index.d.ts +8 -0
  208. package/dist/utils/projects/index.js +153 -0
  209. package/dist/utils/projects/index.js.map +1 -0
  210. package/dist/utils/promise.d.ts +2 -0
  211. package/dist/utils/promise.js +62 -0
  212. package/dist/utils/promise.js.map +1 -0
  213. package/dist/utils/shell.d.ts +1 -0
  214. package/dist/utils/shell.js +81 -0
  215. package/dist/utils/shell.js.map +1 -0
  216. package/package.json +16 -21
  217. package/src/apps/catenv/catenv.ts +55 -27
  218. package/src/apps/{shell/shell.ts → cli/cli.ts} +10 -2
  219. package/src/apps/{shell → cli}/commands/general/index.ts +7 -46
  220. package/src/apps/{shell → cli}/commands/general/namespaceAutoCompletion.ts +0 -0
  221. package/src/apps/{shell → cli}/commands/general/portForward.ts +3 -2
  222. package/src/apps/{shell → cli}/commands/mongodb/index.ts +1 -1
  223. package/src/apps/{shell → cli}/commands/mongodb/projectMongoDestroyMember.ts +18 -18
  224. package/src/apps/{shell → cli}/commands/mongodb/projectMongoGetShell.ts +12 -10
  225. package/src/apps/{shell → cli}/commands/mongodb/projectMongoPortForward.ts +13 -8
  226. package/src/apps/{shell → cli}/commands/mongodb/utils/index.ts +9 -8
  227. package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +88 -0
  228. package/src/apps/cli/commands/project/commandConfigSecrets.ts +220 -0
  229. package/src/apps/{shell → cli}/commands/project/commandCopyDB.ts +24 -26
  230. package/src/apps/{shell → cli}/commands/project/commandDeletePods.ts +10 -10
  231. package/src/apps/{shell → cli}/commands/project/commandDeleteProject.ts +7 -8
  232. package/src/apps/cli/commands/project/commandEnvVars.ts +15 -0
  233. package/src/apps/{shell → cli}/commands/project/commandGetMyTotalWorktime.ts +2 -2
  234. package/src/apps/{shell → cli}/commands/project/commandGetShell.ts +10 -10
  235. package/src/apps/{shell → cli}/commands/project/commandGitlabCi.ts +1 -1
  236. package/src/apps/{shell/commands/project/commandInitProject.ts → cli/commands/project/commandInitProject.old.ts} +14 -6
  237. package/src/apps/cli/commands/project/commandListPods.ts +18 -0
  238. package/src/apps/{shell → cli}/commands/project/commandMigrateHelm3.ts +16 -7
  239. package/src/apps/cli/commands/project/commandNamespace.ts +14 -0
  240. package/src/apps/{shell → cli}/commands/project/commandOpenCostDashboard.ts +10 -7
  241. package/src/apps/cli/commands/project/commandOpenDashboard.ts +48 -0
  242. package/src/apps/cli/commands/project/commandOpenEnv.ts +22 -0
  243. package/src/apps/{shell → cli}/commands/project/commandOpenGit.ts +3 -3
  244. package/src/apps/{shell → cli}/commands/project/commandOpenGrafana.ts +7 -7
  245. package/src/apps/{shell → cli}/commands/project/commandOpenGrafanaPod.ts +9 -10
  246. package/src/apps/cli/commands/project/commandOpenLogs.ts +52 -0
  247. package/src/apps/{shell → cli}/commands/project/commandPauseProject.ts +9 -7
  248. package/src/apps/{shell → cli}/commands/project/commandPortForward.ts +8 -8
  249. package/src/apps/cli/commands/project/commandSetup.ts +12 -0
  250. package/src/apps/{shell → cli}/commands/project/commandTriggerCronjob.ts +10 -10
  251. package/src/apps/{shell → cli}/commands/project/index.ts +6 -7
  252. package/src/apps/cli/commands/project/setup/index.ts +42 -0
  253. package/src/apps/cli/commands/project/setup/setupAccessTokens.ts +72 -0
  254. package/src/apps/cli/commands/project/setup/setupContext.ts +37 -0
  255. package/src/apps/cli/commands/project/setup/setupKubernetes.ts +112 -0
  256. package/src/apps/cli/commands/project/utils/autocompletions.ts +26 -0
  257. package/src/apps/cli/commands/project/utils/ensureCluster.ts +42 -0
  258. package/src/apps/cli/commands/project/utils/ensureNamespace.ts +56 -0
  259. package/src/apps/cli/commands/project/utils/showProjectBanner.ts +11 -0
  260. package/src/apps/cli/commands/shared/index.ts +36 -0
  261. package/src/apps/{shell → cli}/commands/theStuffThatReallyMatters/index.ts +7 -26
  262. package/src/apps/cli/config/writeConfig.ts +71 -0
  263. package/src/apps/{shell → cli}/utils/getGoogleAuthUserNumber.ts +0 -0
  264. package/src/apps/cli/verify/index.ts +30 -0
  265. package/src/apps/cli/verify/migration/fromv2.ts +264 -0
  266. package/src/apps/cli/verify/migration/migrateSecrets.ts +37 -0
  267. package/src/apps/cli/verify/migration/oldGitlabCi.ts +48 -0
  268. package/src/catenv.ts +11 -0
  269. package/src/cli.ts +9 -0
  270. package/src/config/constants.ts +0 -1
  271. package/src/config/getProjectConfig.ts +160 -0
  272. package/src/k8sApi/index.ts +22 -6
  273. package/src/types/types.ts +0 -2
  274. package/src/utils/cluster.ts +6 -15
  275. package/src/utils/editAsFile.ts +31 -0
  276. package/src/utils/files.ts +6 -2
  277. package/src/utils/gitlab.ts +144 -34
  278. package/src/utils/passwordstore/index.ts +19 -21
  279. package/src/utils/preferences/index.ts +6 -3
  280. package/src/utils/projects/index.ts +18 -137
  281. package/tsconfig.json +3 -7
  282. package/bin/catenv.sh +0 -1
  283. package/src/apps/shell/commands/project/commandCloudSqlProxy.ts +0 -65
  284. package/src/apps/shell/commands/project/commandConfigSecrets.ts +0 -245
  285. package/src/apps/shell/commands/project/commandEnvVars.ts +0 -17
  286. package/src/apps/shell/commands/project/commandInitGitlab.ts +0 -157
  287. package/src/apps/shell/commands/project/commandListPods.ts +0 -21
  288. package/src/apps/shell/commands/project/commandNamespace.ts +0 -12
  289. package/src/apps/shell/commands/project/commandOpenDashboard.ts +0 -27
  290. package/src/apps/shell/commands/project/commandOpenEnv.ts +0 -18
  291. package/src/apps/shell/commands/project/commandOpenLogs.ts +0 -23
  292. package/src/apps/shell/commands/project/commandVariables.ts +0 -13
  293. package/src/apps/shell/commands/project/utils/autocompletions.ts +0 -7
  294. package/src/apps/shell/commands/project/utils/ensureCluster.ts +0 -31
  295. package/src/apps/shell/commands/project/utils/ensureNamespace.ts +0 -32
  296. package/src/apps/shell/commands/project/utils/monorepo.ts +0 -45
  297. package/src/apps/shell/commands/shared/index.ts +0 -31
  298. package/src/config/clusters.ts +0 -45
  299. package/src/index.ts +0 -17
  300. package/src/types/git-repo-name.d.ts +0 -1
  301. package/src/types/yawn-yaml.d.ts +0 -1
  302. package/src/utils/dashboardToken.ts +0 -20
  303. package/src/utils/formatEnvVars.ts +0 -7
@@ -0,0 +1,83 @@
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 open_1 = __importDefault(require("open"));
43
+ var portForward_1 = require("../../../../utils/portForward");
44
+ var constants_1 = require("../../../../config/constants");
45
+ var projects_1 = require("../../../../utils/projects");
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-grafana <envComponent>", "open Grafana dashboard for your namespace"))
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 namespace, url;
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, projects_1.getProjectNamespace)(envComponent)];
68
+ case 2:
69
+ namespace = _b.sent();
70
+ url = "http://localhost:".concat(constants_1.GRAFANA_PROXY_LOCAL_PORT, "/grafana/d/at-cost-analysis-namespace2/namespace-utilization-metrics?var-namespace=").concat(namespace);
71
+ return [4 /*yield*/, (0, portForward_1.startPortForward)("deployment/kubecost-cost-analyzer", constants_1.GRAFANA_PROXY_LOCAL_PORT, constants_1.GRAFANA_PROXY_TARGET_PORT, "kubecost")];
72
+ case 3:
73
+ _b.sent();
74
+ (0, open_1["default"])(url);
75
+ return [2 /*return*/];
76
+ }
77
+ });
78
+ });
79
+ })];
80
+ }
81
+ });
82
+ }); });
83
+ //# sourceMappingURL=commandOpenGrafana.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandOpenGrafana.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandOpenGrafana.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAwB;AACxB,6DAAiE;AAEjE,0DAGsC;AAEtC,uDAAiE;AAEjE,2DAA2D;AAC3D,wEAAkD;AAClD,sBAAe,UAAO,MAAc;;;;;gBAClC,KAAA,CAAA,KAAA,MAAM;qBACH,OAAO,CACN,qCAAqC,EACrC,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;oCAC3B,qBAAM,IAAA,8BAAmB,EAAC,YAAY,CAAC,EAAA;;oCAAnD,SAAS,GAAG,SAAuC;oCACnD,GAAG,GAAG,2BAAoB,oCAAwB,gGAAsF,SAAS,CAAE,CAAC;oCAC1J,qBAAM,IAAA,8BAAgB,EACpB,mCAAmC,EACnC,oCAAwB,EACxB,qCAAyB,EACzB,UAAU,CACX,EAAA;;oCALD,SAKC,CAAC;oCACF,IAAA,iBAAI,EAAC,GAAG,CAAC,CAAC;;;;;iBACX,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,99 @@
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 open_1 = __importDefault(require("open"));
43
+ var constants_1 = require("../../../../config/constants");
44
+ var log_1 = require("../../../../utils/log");
45
+ var portForward_1 = require("../../../../utils/portForward");
46
+ var projects_1 = require("../../../../utils/projects");
47
+ var autocompletions_1 = require("./utils/autocompletions");
48
+ var ensureCluster_1 = __importDefault(require("./utils/ensureCluster"));
49
+ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
50
+ var _a, _b;
51
+ return __generator(this, function (_c) {
52
+ switch (_c.label) {
53
+ case 0:
54
+ _b = (_a = vorpal
55
+ .command("project-open-grafana-pod <envComponent>", "open Grafana dashboard for a specific pod"))
56
+ .autocomplete;
57
+ return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
58
+ case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])
59
+ .action(function (_a) {
60
+ var envComponent = _a.envComponent;
61
+ return __awaiter(this, void 0, void 0, function () {
62
+ var podNames, podName, namespace, url;
63
+ return __generator(this, function (_b) {
64
+ switch (_b.label) {
65
+ case 0: return [4 /*yield*/, ensureCluster_1["default"].call(this, envComponent)];
66
+ case 1:
67
+ _b.sent();
68
+ return [4 /*yield*/, (0, projects_1.getProjectPodNames)(envComponent)];
69
+ case 2:
70
+ podNames = _b.sent();
71
+ if (podNames.length === 0) {
72
+ (0, log_1.logError)(this, "sorry, no pods found");
73
+ return [2 /*return*/];
74
+ }
75
+ return [4 /*yield*/, this.prompt({
76
+ type: "list",
77
+ name: "podName",
78
+ choices: podNames,
79
+ message: "Which pod? 🤔"
80
+ })];
81
+ case 3:
82
+ podName = (_b.sent()).podName;
83
+ return [4 /*yield*/, (0, projects_1.getProjectNamespace)(envComponent)];
84
+ case 4:
85
+ namespace = _b.sent();
86
+ url = "http://localhost:".concat(constants_1.GRAFANA_PROXY_LOCAL_PORT, "/grafana/d/at-cost-analysis-pod/pod-cost-and-utilization-metrics?var-namespace=").concat(namespace, "&var-pod=").concat(podName);
87
+ return [4 /*yield*/, (0, portForward_1.startPortForward)("deployment/kubecost-cost-analyzer", constants_1.GRAFANA_PROXY_LOCAL_PORT, constants_1.GRAFANA_PROXY_TARGET_PORT, "kubecost")];
88
+ case 5:
89
+ _b.sent();
90
+ (0, open_1["default"])(url);
91
+ return [2 /*return*/];
92
+ }
93
+ });
94
+ });
95
+ })];
96
+ }
97
+ });
98
+ }); });
99
+ //# sourceMappingURL=commandOpenGrafanaPod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandOpenGrafanaPod.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandOpenGrafanaPod.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAwB;AAExB,0DAGsC;AACtC,6CAAiD;AACjD,6DAAiE;AACjE,uDAGoC;AACpC,2DAA2D;AAC3D,wEAAkD;AAElD,sBAAe,UAAO,MAAc;;;;;gBAClC,KAAA,CAAA,KAAA,MAAM;qBACH,OAAO,CACN,yCAAyC,EACzC,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;oCAC5B,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;oCAMG,qBAAM,IAAA,8BAAmB,EAAC,YAAY,CAAC,EAAA;;oCAAnD,SAAS,GAAG,SAAuC;oCACnD,GAAG,GAAG,2BAAoB,oCAAwB,4FAAkF,SAAS,sBAAY,OAAO,CAAE,CAAC;oCACzK,qBAAM,IAAA,8BAAgB,EACpB,mCAAmC,EACnC,oCAAwB,EACxB,qCAAyB,EACzB,UAAU,CACX,EAAA;;oCALD,SAKC,CAAC;oCACF,IAAA,iBAAI,EAAC,GAAG,CAAC,CAAC;;;;;iBACX,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,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
+ exports.__esModule = true;
39
+ var getProjectConfig_1 = require("../../../../config/getProjectConfig");
40
+ var getGoogleAuthUserNumber_1 = require("../../utils/getGoogleAuthUserNumber");
41
+ var shared_1 = require("../shared");
42
+ var autocompletions_1 = require("./utils/autocompletions");
43
+ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
44
+ var _a, _b;
45
+ return __generator(this, function (_c) {
46
+ switch (_c.label) {
47
+ case 0:
48
+ _b = (_a = vorpal
49
+ .command("project-open-logs <envComponent>", "open google cloud logs (stackdriver logs)"))
50
+ .autocomplete;
51
+ return [4 /*yield*/, (0, autocompletions_1.envAndComponents)()];
52
+ case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])
53
+ .action(function (_a) {
54
+ var envComponent = _a.envComponent;
55
+ return __awaiter(this, void 0, void 0, function () {
56
+ var _b, env, componentName, _c, componentConfig, environment, namespace, authGoogleNumber;
57
+ return __generator(this, function (_d) {
58
+ switch (_d.label) {
59
+ case 0:
60
+ _b = (0, getProjectConfig_1.parseChoice)(envComponent), env = _b.env, componentName = _b.componentName;
61
+ return [4 /*yield*/, (0, getProjectConfig_1.getPipelineContextByChoice)(env, componentName)];
62
+ case 1:
63
+ _c = _d.sent(), componentConfig = _c.componentConfig, environment = _c.environment;
64
+ if (!componentConfig.deploy ||
65
+ componentConfig.deploy.type !== "kubernetes") {
66
+ throw new Error("only kubernetes deployments are supported at the moment");
67
+ }
68
+ if (!componentConfig.deploy.cluster ||
69
+ componentConfig.deploy.cluster.type !== "gcloud") {
70
+ throw new Error("no gcloud custer configured");
71
+ }
72
+ namespace = environment.envVars.KUBE_NAMESPACE;
73
+ return [4 /*yield*/, getGoogleAuthUserNumber_1.getGoogleAuthUserNumber.call(this, vorpal)];
74
+ case 2:
75
+ authGoogleNumber = _d.sent();
76
+ return [4 /*yield*/, (0, shared_1.openGoogleCloudLogs)(componentConfig.deploy.cluster, namespace, authGoogleNumber)];
77
+ case 3:
78
+ _d.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,wEAG6C;AAG7C,+EAA8E;AAC9E,oCAAgD;AAChD,2DAA2D;AAG3D,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;;;;;;oCAC9B,KAAyB,IAAA,8BAAW,EAAC,YAAY,CAAC,EAAhD,GAAG,SAAA,EAAE,aAAa,mBAAA,CAA+B;oCAChB,qBAAM,IAAA,6CAA0B,EACvE,GAAG,EACH,aAAa,CACd,EAAA;;oCAHK,KAAmC,SAGxC,EAHO,eAAe,qBAAA,EAAE,WAAW,iBAAA;oCAKpC,IACE,CAAC,eAAe,CAAC,MAAM;wCACvB,eAAe,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,EAC5C;wCACA,MAAM,IAAI,KAAK,CACb,yDAAyD,CAC1D,CAAC;qCACH;oCAED,IACE,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO;wCAC/B,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ,EAChD;wCACA,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;qCAChD;oCAEK,SAAS,GAAG,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC;oCAE5B,qBAAM,iDAAuB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAA;;oCAAnE,gBAAgB,GAAG,SAAgD;oCAEzE,qBAAM,IAAA,4BAAmB,EACvB,eAAe,CAAC,MAAM,CAAC,OAAO,EAC9B,SAAS,EACT,gBAAgB,CACjB,EAAA;;oCAJD,SAIC,CAAC;;;;;iBACH,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,58 @@
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 setup_1 = require("./setup");
40
+ exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
41
+ return __generator(this, function (_a) {
42
+ return [2 /*return*/, vorpal
43
+ .command("project-setup", "Initializes all environments and creates requires resources, service accounts, etc.")
44
+ .action(function () {
45
+ return __awaiter(this, void 0, void 0, function () {
46
+ return __generator(this, function (_a) {
47
+ switch (_a.label) {
48
+ case 0: return [4 /*yield*/, (0, setup_1.setupProject)(this)];
49
+ case 1:
50
+ _a.sent();
51
+ return [2 /*return*/];
52
+ }
53
+ });
54
+ });
55
+ })];
56
+ });
57
+ }); });
58
+ //# sourceMappingURL=commandSetup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commandSetup.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/project/commandSetup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iCAAuC;AAEvC,sBAAe,UAAO,MAAc;;QAClC,sBAAA,MAAM;iBACH,OAAO,CACN,eAAe,EACf,qFAAqF,CACtF;iBACA,MAAM,CAAC;;;;oCACN,qBAAM,IAAA,oBAAY,EAAC,IAAI,CAAC,EAAA;;gCAAxB,SAAwB,CAAC;;;;;aAC1B,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;