@catladder/cli 1.0.0 → 1.0.4

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 (218) hide show
  1. package/package.json +4 -11
  2. package/src/apps/cli/cli.ts +0 -2
  3. package/src/apps/cli/commands/project/commandConfigSecrets.ts +9 -5
  4. package/src/apps/cli/verify/migration/fromv2.ts +1 -2
  5. package/dist/apps/catenv/catenv.d.ts +0 -2
  6. package/dist/apps/catenv/catenv.js +0 -135
  7. package/dist/apps/catenv/catenv.js.map +0 -1
  8. package/dist/apps/cli/cli.d.ts +0 -2
  9. package/dist/apps/cli/cli.js +0 -81
  10. package/dist/apps/cli/cli.js.map +0 -1
  11. package/dist/apps/cli/commands/general/index.d.ts +0 -4
  12. package/dist/apps/cli/commands/general/index.js +0 -274
  13. package/dist/apps/cli/commands/general/index.js.map +0 -1
  14. package/dist/apps/cli/commands/general/namespaceAutoCompletion.d.ts +0 -3
  15. package/dist/apps/cli/commands/general/namespaceAutoCompletion.js +0 -56
  16. package/dist/apps/cli/commands/general/namespaceAutoCompletion.js.map +0 -1
  17. package/dist/apps/cli/commands/general/portForward.d.ts +0 -3
  18. package/dist/apps/cli/commands/general/portForward.js +0 -98
  19. package/dist/apps/cli/commands/general/portForward.js.map +0 -1
  20. package/dist/apps/cli/commands/mongodb/index.d.ts +0 -3
  21. package/dist/apps/cli/commands/mongodb/index.js +0 -53
  22. package/dist/apps/cli/commands/mongodb/index.js.map +0 -1
  23. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +0 -3
  24. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js +0 -190
  25. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +0 -1
  26. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +0 -3
  27. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js +0 -96
  28. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js.map +0 -1
  29. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +0 -3
  30. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js +0 -105
  31. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js.map +0 -1
  32. package/dist/apps/cli/commands/mongodb/utils/index.d.ts +0 -13
  33. package/dist/apps/cli/commands/mongodb/utils/index.js +0 -167
  34. package/dist/apps/cli/commands/mongodb/utils/index.js.map +0 -1
  35. package/dist/apps/cli/commands/project/commandCloudSqlProxy.d.ts +0 -3
  36. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +0 -128
  37. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +0 -1
  38. package/dist/apps/cli/commands/project/commandConfigSecrets.d.ts +0 -3
  39. package/dist/apps/cli/commands/project/commandConfigSecrets.js +0 -254
  40. package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +0 -1
  41. package/dist/apps/cli/commands/project/commandCopyDB.d.ts +0 -3
  42. package/dist/apps/cli/commands/project/commandCopyDB.js +0 -102
  43. package/dist/apps/cli/commands/project/commandCopyDB.js.map +0 -1
  44. package/dist/apps/cli/commands/project/commandDeletePods.d.ts +0 -3
  45. package/dist/apps/cli/commands/project/commandDeletePods.js +0 -119
  46. package/dist/apps/cli/commands/project/commandDeletePods.js.map +0 -1
  47. package/dist/apps/cli/commands/project/commandDeleteProject.d.ts +0 -3
  48. package/dist/apps/cli/commands/project/commandDeleteProject.js +0 -97
  49. package/dist/apps/cli/commands/project/commandDeleteProject.js.map +0 -1
  50. package/dist/apps/cli/commands/project/commandEnvVars.d.ts +0 -3
  51. package/dist/apps/cli/commands/project/commandEnvVars.js +0 -74
  52. package/dist/apps/cli/commands/project/commandEnvVars.js.map +0 -1
  53. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +0 -3
  54. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js +0 -58
  55. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +0 -1
  56. package/dist/apps/cli/commands/project/commandGetShell.d.ts +0 -3
  57. package/dist/apps/cli/commands/project/commandGetShell.js +0 -92
  58. package/dist/apps/cli/commands/project/commandGetShell.js.map +0 -1
  59. package/dist/apps/cli/commands/project/commandGitlabCi.d.ts +0 -3
  60. package/dist/apps/cli/commands/project/commandGitlabCi.js +0 -185
  61. package/dist/apps/cli/commands/project/commandGitlabCi.js.map +0 -1
  62. package/dist/apps/cli/commands/project/commandInitGitlab.d.ts +0 -3
  63. package/dist/apps/cli/commands/project/commandInitGitlab.js +0 -245
  64. package/dist/apps/cli/commands/project/commandInitGitlab.js.map +0 -1
  65. package/dist/apps/cli/commands/project/commandInitProject.d.ts +0 -3
  66. package/dist/apps/cli/commands/project/commandInitProject.js +0 -345
  67. package/dist/apps/cli/commands/project/commandInitProject.js.map +0 -1
  68. package/dist/apps/cli/commands/project/commandListPods.d.ts +0 -3
  69. package/dist/apps/cli/commands/project/commandListPods.js +0 -78
  70. package/dist/apps/cli/commands/project/commandListPods.js.map +0 -1
  71. package/dist/apps/cli/commands/project/commandMigrateHelm3.d.ts +0 -7
  72. package/dist/apps/cli/commands/project/commandMigrateHelm3.js +0 -113
  73. package/dist/apps/cli/commands/project/commandMigrateHelm3.js.map +0 -1
  74. package/dist/apps/cli/commands/project/commandNamespace.d.ts +0 -3
  75. package/dist/apps/cli/commands/project/commandNamespace.js +0 -70
  76. package/dist/apps/cli/commands/project/commandNamespace.js.map +0 -1
  77. package/dist/apps/cli/commands/project/commandOpenCostDashboard.d.ts +0 -3
  78. package/dist/apps/cli/commands/project/commandOpenCostDashboard.js +0 -83
  79. package/dist/apps/cli/commands/project/commandOpenCostDashboard.js.map +0 -1
  80. package/dist/apps/cli/commands/project/commandOpenDashboard.d.ts +0 -3
  81. package/dist/apps/cli/commands/project/commandOpenDashboard.js +0 -92
  82. package/dist/apps/cli/commands/project/commandOpenDashboard.js.map +0 -1
  83. package/dist/apps/cli/commands/project/commandOpenEnv.d.ts +0 -3
  84. package/dist/apps/cli/commands/project/commandOpenEnv.js +0 -80
  85. package/dist/apps/cli/commands/project/commandOpenEnv.js.map +0 -1
  86. package/dist/apps/cli/commands/project/commandOpenGit.d.ts +0 -3
  87. package/dist/apps/cli/commands/project/commandOpenGit.js +0 -56
  88. package/dist/apps/cli/commands/project/commandOpenGit.js.map +0 -1
  89. package/dist/apps/cli/commands/project/commandOpenGrafana.d.ts +0 -3
  90. package/dist/apps/cli/commands/project/commandOpenGrafana.js +0 -83
  91. package/dist/apps/cli/commands/project/commandOpenGrafana.js.map +0 -1
  92. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.d.ts +0 -3
  93. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js +0 -99
  94. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js.map +0 -1
  95. package/dist/apps/cli/commands/project/commandOpenLogs.d.ts +0 -3
  96. package/dist/apps/cli/commands/project/commandOpenLogs.js +0 -87
  97. package/dist/apps/cli/commands/project/commandOpenLogs.js.map +0 -1
  98. package/dist/apps/cli/commands/project/commandPauseProject.d.ts +0 -3
  99. package/dist/apps/cli/commands/project/commandPauseProject.js +0 -97
  100. package/dist/apps/cli/commands/project/commandPauseProject.js.map +0 -1
  101. package/dist/apps/cli/commands/project/commandPortForward.d.ts +0 -3
  102. package/dist/apps/cli/commands/project/commandPortForward.js +0 -106
  103. package/dist/apps/cli/commands/project/commandPortForward.js.map +0 -1
  104. package/dist/apps/cli/commands/project/commandReloadConfig.d.ts +0 -3
  105. package/dist/apps/cli/commands/project/commandReloadConfig.js +0 -62
  106. package/dist/apps/cli/commands/project/commandReloadConfig.js.map +0 -1
  107. package/dist/apps/cli/commands/project/commandTriggerCronjob.d.ts +0 -3
  108. package/dist/apps/cli/commands/project/commandTriggerCronjob.js +0 -144
  109. package/dist/apps/cli/commands/project/commandTriggerCronjob.js.map +0 -1
  110. package/dist/apps/cli/commands/project/index.d.ts +0 -3
  111. package/dist/apps/cli/commands/project/index.js +0 -97
  112. package/dist/apps/cli/commands/project/index.js.map +0 -1
  113. package/dist/apps/cli/commands/project/utils/autocompletions.d.ts +0 -3
  114. package/dist/apps/cli/commands/project/utils/autocompletions.js +0 -96
  115. package/dist/apps/cli/commands/project/utils/autocompletions.js.map +0 -1
  116. package/dist/apps/cli/commands/project/utils/ensureCluster.d.ts +0 -1
  117. package/dist/apps/cli/commands/project/utils/ensureCluster.js +0 -84
  118. package/dist/apps/cli/commands/project/utils/ensureCluster.js.map +0 -1
  119. package/dist/apps/cli/commands/project/utils/ensureNamespace.d.ts +0 -1
  120. package/dist/apps/cli/commands/project/utils/ensureNamespace.js +0 -92
  121. package/dist/apps/cli/commands/project/utils/ensureNamespace.js.map +0 -1
  122. package/dist/apps/cli/commands/project/utils/showProjectBanner.d.ts +0 -2
  123. package/dist/apps/cli/commands/project/utils/showProjectBanner.js +0 -58
  124. package/dist/apps/cli/commands/project/utils/showProjectBanner.js.map +0 -1
  125. package/dist/apps/cli/commands/shared/index.d.ts +0 -2
  126. package/dist/apps/cli/commands/shared/index.js +0 -72
  127. package/dist/apps/cli/commands/shared/index.js.map +0 -1
  128. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +0 -3
  129. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js +0 -131
  130. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js.map +0 -1
  131. package/dist/apps/cli/config/writeConfig.d.ts +0 -5
  132. package/dist/apps/cli/config/writeConfig.js +0 -104
  133. package/dist/apps/cli/config/writeConfig.js.map +0 -1
  134. package/dist/apps/cli/utils/getGoogleAuthUserNumber.d.ts +0 -1
  135. package/dist/apps/cli/utils/getGoogleAuthUserNumber.js +0 -69
  136. package/dist/apps/cli/utils/getGoogleAuthUserNumber.js.map +0 -1
  137. package/dist/apps/cli/verify/index.d.ts +0 -2
  138. package/dist/apps/cli/verify/index.js +0 -90
  139. package/dist/apps/cli/verify/index.js.map +0 -1
  140. package/dist/apps/cli/verify/migration/fromv2.d.ts +0 -3
  141. package/dist/apps/cli/verify/migration/fromv2.js +0 -322
  142. package/dist/apps/cli/verify/migration/fromv2.js.map +0 -1
  143. package/dist/apps/cli/verify/migration/migrateSecrets.d.ts +0 -4
  144. package/dist/apps/cli/verify/migration/migrateSecrets.js +0 -88
  145. package/dist/apps/cli/verify/migration/migrateSecrets.js.map +0 -1
  146. package/dist/apps/cli/verify/migration/oldGitlabCi.d.ts +0 -17
  147. package/dist/apps/cli/verify/migration/oldGitlabCi.js +0 -26
  148. package/dist/apps/cli/verify/migration/oldGitlabCi.js.map +0 -1
  149. package/dist/catenv.d.ts +0 -1
  150. package/dist/catenv.js +0 -8
  151. package/dist/catenv.js.map +0 -1
  152. package/dist/cli.d.ts +0 -1
  153. package/dist/cli.js +0 -13
  154. package/dist/cli.js.map +0 -1
  155. package/dist/config/clusters.d.ts +0 -14
  156. package/dist/config/clusters.js +0 -72
  157. package/dist/config/clusters.js.map +0 -1
  158. package/dist/config/constants.d.ts +0 -4
  159. package/dist/config/constants.js +0 -8
  160. package/dist/config/constants.js.map +0 -1
  161. package/dist/config/getProjectConfig.d.ts +0 -21
  162. package/dist/config/getProjectConfig.js +0 -212
  163. package/dist/config/getProjectConfig.js.map +0 -1
  164. package/dist/k8sApi/index.d.ts +0 -5
  165. package/dist/k8sApi/index.js +0 -11
  166. package/dist/k8sApi/index.js.map +0 -1
  167. package/dist/packageInfos.d.ts +0 -2
  168. package/dist/packageInfos.js +0 -6
  169. package/dist/packageInfos.js.map +0 -1
  170. package/dist/tsconfig.tsbuildinfo +0 -1
  171. package/dist/types/types.d.ts +0 -18
  172. package/dist/types/types.js +0 -3
  173. package/dist/types/types.js.map +0 -1
  174. package/dist/utils/cluster.d.ts +0 -12
  175. package/dist/utils/cluster.js +0 -100
  176. package/dist/utils/cluster.js.map +0 -1
  177. package/dist/utils/dashboardToken.d.ts +0 -2
  178. package/dist/utils/dashboardToken.js +0 -89
  179. package/dist/utils/dashboardToken.js.map +0 -1
  180. package/dist/utils/editAsFile.d.ts +0 -1
  181. package/dist/utils/editAsFile.js +0 -85
  182. package/dist/utils/editAsFile.js.map +0 -1
  183. package/dist/utils/files.d.ts +0 -2
  184. package/dist/utils/files.js +0 -83
  185. package/dist/utils/files.js.map +0 -1
  186. package/dist/utils/formatEnvVars.d.ts +0 -2
  187. package/dist/utils/formatEnvVars.js +0 -10
  188. package/dist/utils/formatEnvVars.js.map +0 -1
  189. package/dist/utils/getEditor.d.ts +0 -4
  190. package/dist/utils/getEditor.js +0 -70
  191. package/dist/utils/getEditor.js.map +0 -1
  192. package/dist/utils/gitlab.d.ts +0 -21
  193. package/dist/utils/gitlab.js +0 -258
  194. package/dist/utils/gitlab.js.map +0 -1
  195. package/dist/utils/log.d.ts +0 -1
  196. package/dist/utils/log.js +0 -14
  197. package/dist/utils/log.js.map +0 -1
  198. package/dist/utils/passwordstore/index.d.ts +0 -8
  199. package/dist/utils/passwordstore/index.js +0 -378
  200. package/dist/utils/passwordstore/index.js.map +0 -1
  201. package/dist/utils/portForward.d.ts +0 -4
  202. package/dist/utils/portForward.js +0 -116
  203. package/dist/utils/portForward.js.map +0 -1
  204. package/dist/utils/preferences/index.d.ts +0 -3
  205. package/dist/utils/preferences/index.js +0 -119
  206. package/dist/utils/preferences/index.js.map +0 -1
  207. package/dist/utils/projects/index.d.ts +0 -8
  208. package/dist/utils/projects/index.js +0 -150
  209. package/dist/utils/projects/index.js.map +0 -1
  210. package/dist/utils/promise.d.ts +0 -2
  211. package/dist/utils/promise.js +0 -62
  212. package/dist/utils/promise.js.map +0 -1
  213. package/dist/utils/shell.d.ts +0 -1
  214. package/dist/utils/shell.js +0 -81
  215. package/dist/utils/shell.js.map +0 -1
  216. package/src/types/git-repo-name.d.ts +0 -1
  217. package/src/types/yawn-yaml.d.ts +0 -1
  218. package/src/utils/dashboardToken.ts +0 -20
package/package.json CHANGED
@@ -16,29 +16,22 @@
16
16
  "catladder": "./bin/catladder"
17
17
  },
18
18
  "dependencies": {
19
- "@bitwarden/cli": "^1.8.0",
20
- "@catladder/pipeline": "1.0.0",
19
+ "@catladder/pipeline": "1.0.4",
21
20
  "@kubernetes/client-node": "^0.16.1",
22
21
  "child-process-promise": "^2.2.1",
23
- "clipboardy": "^2.2.0",
24
22
  "command-exists-promise": "^2.0.2",
25
23
  "common-tags": "^1.8.0",
26
24
  "dayjs": "^1.10.4",
27
25
  "fs-extra": "^7.0.1",
28
- "git-repo-name": "^1.0.1",
29
26
  "gitlab": "^4.4.1",
30
27
  "js-yaml": "^3.12.0",
31
- "lodash": "^4.17.11",
28
+ "lodash": "^4.17.21",
32
29
  "memoizee": "^0.4.14",
33
30
  "node-fetch": "^2.3.0",
34
31
  "open": "^8.4.0",
35
- "open-editor": "^2.0.1",
36
- "open-in-editor": "^2.2.0",
37
32
  "tmp-promise": "^2.0.2",
38
33
  "update-notifier": "^2.5.0",
39
- "vorpal": "^1.12.0",
40
- "yargs": "^13.2.4",
41
- "yawn-yaml": "^1.3.4"
34
+ "vorpal": "^1.12.0"
42
35
  },
43
36
  "engines": {
44
37
  "node": ">=12.0.0"
@@ -60,5 +53,5 @@
60
53
  "eslint": "^8.7.0",
61
54
  "typescript": "^4.5.4"
62
55
  },
63
- "version": "1.0.0"
56
+ "version": "1.0.4"
64
57
  }
@@ -1,5 +1,4 @@
1
1
  import Vorpal from "vorpal";
2
- import { config } from "yargs";
3
2
  // tslint:disable-next-line:no-var-requires
4
3
  import packageInfos from "../../packageInfos";
5
4
  import { stopAllPortForwards } from "../../utils/portForward";
@@ -8,7 +7,6 @@ import mongodb from "./commands/mongodb";
8
7
  import project from "./commands/project";
9
8
  import theStuffThatReallyMatters from "./commands/theStuffThatReallyMatters";
10
9
 
11
- import { getProjectConfig } from "../../config/getProjectConfig";
12
10
  import { verify } from "./verify";
13
11
  import { showProjectBanner } from "./commands/project/utils/showProjectBanner";
14
12
 
@@ -34,10 +34,14 @@ const resolveJson = (v: Record<string, Record<string, string>>) =>
34
34
  ];
35
35
  })
36
36
  );
37
- const getEnvVarsToEdit = async (env: string, componentName: string) => {
37
+ const getEnvVarsToEdit = async (
38
+ instance: CommandInstance,
39
+ env: string,
40
+ componentName: string
41
+ ) => {
38
42
  const { secretEnvVarKeys } = await getEnvironment(env, componentName);
39
43
 
40
- const allEnvVars = await getEnvVars(this, env, componentName);
44
+ const allEnvVars = await getEnvVars(instance, env, componentName);
41
45
  return Object.fromEntries(
42
46
  secretEnvVarKeys.map((key) => [key, allEnvVars[key]])
43
47
  );
@@ -51,7 +55,7 @@ const doItFor = async (
51
55
  await Promise.all(
52
56
  components.map(async (componentName) => [
53
57
  componentName,
54
- await getEnvVarsToEdit(env, componentName),
58
+ await getEnvVarsToEdit(instance, env, componentName),
55
59
  ])
56
60
  )
57
61
  );
@@ -110,7 +114,7 @@ const doItFor = async (
110
114
 
111
115
  for (const componentName of components) {
112
116
  await upsertAllVariables(
113
- this,
117
+ instance,
114
118
  valuesToEdit[componentName],
115
119
  env,
116
120
  componentName
@@ -126,7 +130,7 @@ const doItFor = async (
126
130
  context.componentConfig.deploy.values?.cloudsql?.enabled
127
131
  ) {
128
132
  await upsertAllVariables(
129
- this,
133
+ instance,
130
134
  {
131
135
  cloudsqlProxyCredentials: await readPass(
132
136
  GOOGLE_CLOUD_SQL_PASS_PATH
@@ -15,7 +15,6 @@ import {
15
15
  import { isEmpty } from "lodash";
16
16
  import { join } from "path";
17
17
  import Vorpal from "vorpal";
18
- import { string } from "yargs";
19
18
  import {
20
19
  getGitlabCi,
21
20
  getGitlabCiFilePath,
@@ -87,7 +86,7 @@ export const migrateV2 = async (vorpal: Vorpal) => {
87
86
  CUSTOMER_NAME,
88
87
  APP_NAME,
89
88
  COMPONENT_NAME,
90
- APP_DIR,
89
+ APP_DIR = ".",
91
90
  CLUSTER_NAME,
92
91
  STAGING_ENABLED,
93
92
  } = gitlabCi.variables;
@@ -1,2 +0,0 @@
1
- declare const _default: () => Promise<void>;
2
- export default _default;
@@ -1,135 +0,0 @@
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 getProjectConfig_1 = require("../../config/getProjectConfig");
51
- var projects_1 = require("../../utils/projects");
52
- var path_1 = require("path");
53
- var getCurrentComponentName = function (components) { return __awaiter(void 0, void 0, void 0, function () {
54
- var gitRoot, currentDir;
55
- return __generator(this, function (_a) {
56
- switch (_a.label) {
57
- case 0: return [4 /*yield*/, (0, projects_1.getGitRoot)()];
58
- case 1:
59
- gitRoot = _a.sent();
60
- currentDir = process.cwd();
61
- return [2 /*return*/, Object.keys(components).find(function (c) {
62
- return currentDir.startsWith((0, path_1.join)(gitRoot, components[c].dir));
63
- })];
64
- }
65
- });
66
- }); };
67
- var sanitizeEnvVarName = function (name) { return name.replace(/[\s\-.]+/g, "_"); };
68
- var getAllVariablesToPrint = function (config) { return __awaiter(void 0, void 0, void 0, function () {
69
- var components, currentComponent, variables;
70
- return __generator(this, function (_a) {
71
- switch (_a.label) {
72
- case 0:
73
- components = config.components;
74
- return [4 /*yield*/, getCurrentComponentName(components)];
75
- case 1:
76
- currentComponent = _a.sent();
77
- variables = {};
78
- if (!currentComponent) return [3 /*break*/, 3];
79
- return [4 /*yield*/, (0, getProjectConfig_1.getEnvVars)(null, "local", currentComponent)];
80
- case 2:
81
- variables = _a.sent();
82
- return [3 /*break*/, 5];
83
- case 3: return [4 /*yield*/, Object.keys(components).reduce(function (acc, componentName) { return __awaiter(void 0, void 0, void 0, function () {
84
- var subappvars, _a;
85
- return __generator(this, function (_b) {
86
- switch (_b.label) {
87
- case 0: return [4 /*yield*/, (0, getProjectConfig_1.getEnvVars)(null, "local", componentName)];
88
- case 1:
89
- subappvars = _b.sent();
90
- _a = [{}];
91
- return [4 /*yield*/, acc];
92
- case 2: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_b.sent())])), subappvars]), Object.fromEntries(Object.entries(subappvars).map(function (_a) {
93
- var key = _a[0], value = _a[1];
94
- return [
95
- "".concat(sanitizeEnvVarName(componentName.toUpperCase()), "_").concat(key),
96
- value,
97
- ];
98
- }))])];
99
- }
100
- });
101
- }); }, {})];
102
- case 4:
103
- // when in a monorep and not in a subapp, merge all env vars.
104
- // this is not 100% correct, but better than not exporting any vars at all
105
- // so we also add prefixed variants
106
- variables = _a.sent();
107
- _a.label = 5;
108
- case 5: return [2 /*return*/, variables];
109
- }
110
- });
111
- }); };
112
- exports["default"] = (function () { return __awaiter(void 0, void 0, void 0, function () {
113
- var config, variables;
114
- return __generator(this, function (_a) {
115
- switch (_a.label) {
116
- case 0: return [4 /*yield*/, (0, getProjectConfig_1.getProjectConfig)()];
117
- case 1:
118
- config = _a.sent();
119
- if (!config) {
120
- return [2 /*return*/];
121
- }
122
- return [4 /*yield*/, getAllVariablesToPrint(config)];
123
- case 2:
124
- variables = _a.sent();
125
- console.log(Object.entries(variables)
126
- .map(function (_a) {
127
- var key = _a[0], value = _a[1];
128
- return "export ".concat(key, "='").concat(value, "'");
129
- })
130
- .join("\n"));
131
- return [2 /*return*/];
132
- }
133
- });
134
- }); });
135
- //# sourceMappingURL=catenv.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"catenv.js","sourceRoot":"","sources":["../../../src/apps/catenv/catenv.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kEAA6E;AAC7E,iDAAkD;AAClD,6BAA4B;AAC5B,IAAM,uBAAuB,GAAG,UAC9B,UAA2C;;;;oBAE3B,qBAAM,IAAA,qBAAU,GAAE,EAAA;;gBAA5B,OAAO,GAAG,SAAkB;gBAC5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E;4CAC3D,KAAK;yCACN;oCAHgD,CAGhD,CAAC,CACH,IACD;;;qBACH,EACD,EAAE,CACH,EAAA;;gBAnBD,6DAA6D;gBAC7D,0EAA0E;gBAC1E,mCAAmC;gBACnC,SAAS,GAAG,SAgBX,CAAC;;oBAEJ,sBAAO,SAAS,EAAC;;;KAClB,CAAC;AACF,sBAAe;;;;oBACE,qBAAM,IAAA,mCAAgB,GAAE,EAAA;;gBAAjC,MAAM,GAAG,SAAwB;gBACvC,IAAI,CAAC,MAAM,EAAE;oBACX,sBAAO;iBACR;gBAEiB,qBAAM,sBAAsB,CAAC,MAAM,CAAC,EAAA;;gBAAhD,SAAS,GAAG,SAAoC;gBAEtD,OAAO,CAAC,GAAG,CACT,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;qBACtB,GAAG,CAAC,UAAC,EAAY;wBAAX,GAAG,QAAA,EAAE,KAAK,QAAA;oBAAM,OAAA,iBAAU,GAAG,eAAK,KAAK,MAAG;gBAA1B,CAA0B,CAAC;qBACjD,IAAI,CAAC,IAAI,CAAC,CACd,CAAC;;;;KACH,EAAC"}
@@ -1,2 +0,0 @@
1
- declare const _default: () => Promise<void>;
2
- export default _default;
@@ -1,81 +0,0 @@
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 vorpal_1 = __importDefault(require("vorpal"));
43
- // tslint:disable-next-line:no-var-requires
44
- var packageInfos_1 = __importDefault(require("../../packageInfos"));
45
- var portForward_1 = require("../../utils/portForward");
46
- var general_1 = __importDefault(require("./commands/general"));
47
- var mongodb_1 = __importDefault(require("./commands/mongodb"));
48
- var project_1 = __importDefault(require("./commands/project"));
49
- var theStuffThatReallyMatters_1 = __importDefault(require("./commands/theStuffThatReallyMatters"));
50
- var verify_1 = require("./verify");
51
- var showProjectBanner_1 = require("./commands/project/utils/showProjectBanner");
52
- exports["default"] = (function () { return __awaiter(void 0, void 0, void 0, function () {
53
- var vorpal, welcomeMessage;
54
- return __generator(this, function (_a) {
55
- switch (_a.label) {
56
- case 0:
57
- vorpal = new vorpal_1["default"]();
58
- welcomeMessage = "catladder 2022 \uD83D\uDE3B version ".concat(packageInfos_1["default"].version);
59
- vorpal
60
- .delimiter("catladder $") // emoji messes with cursor :-( https://github.com/dthree/vorpal/issues/332
61
- .history("catladder")
62
- .show()
63
- .log("")
64
- .log(welcomeMessage)
65
- .log("");
66
- return [4 /*yield*/, (0, showProjectBanner_1.showProjectBanner)(vorpal)];
67
- case 1:
68
- _a.sent();
69
- (0, verify_1.verify)(vorpal);
70
- (0, general_1["default"])(vorpal);
71
- (0, project_1["default"])(vorpal);
72
- (0, mongodb_1["default"])(vorpal);
73
- (0, theStuffThatReallyMatters_1["default"])(vorpal);
74
- process.on("exit", function () {
75
- (0, portForward_1.stopAllPortForwards)();
76
- });
77
- return [2 /*return*/];
78
- }
79
- });
80
- }); });
81
- //# sourceMappingURL=cli.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/apps/cli/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA4B;AAE5B,2CAA2C;AAC3C,oEAA8C;AAC9C,uDAA8D;AAC9D,+DAAyC;AACzC,+DAAyC;AACzC,+DAAyC;AACzC,mGAA6E;AAG7E,mCAAkC;AAClC,gFAA+E;AAE/E,sBAAe;;;;;gBACP,MAAM,GAAG,IAAI,mBAAM,EAAE,CAAC;gBAEtB,cAAc,GAAG,8CAA6B,yBAAY,CAAC,OAAO,CAAE,CAAC;gBAE3E,MAAM;qBACH,SAAS,CAAC,aAAa,CAAC,CAAC,2EAA2E;qBACpG,OAAO,CAAC,WAAW,CAAC;qBACpB,IAAI,EAAE;qBACN,GAAG,CAAC,EAAE,CAAC;qBACP,GAAG,CAAC,cAAc,CAAC;qBACnB,GAAG,CAAC,EAAE,CAAC,CAAC;gBAEX,qBAAM,IAAA,qCAAiB,EAAC,MAAM,CAAC,EAAA;;gBAA/B,SAA+B,CAAC;gBAEhC,IAAA,eAAM,EAAC,MAAM,CAAC,CAAC;gBAEf,IAAA,oBAAO,EAAC,MAAM,CAAC,CAAC;gBAChB,IAAA,oBAAO,EAAC,MAAM,CAAC,CAAC;gBAChB,IAAA,oBAAO,EAAC,MAAM,CAAC,CAAC;gBAChB,IAAA,sCAAyB,EAAC,MAAM,CAAC,CAAC;gBAElC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE;oBACjB,IAAA,iCAAmB,GAAE,CAAC;gBACxB,CAAC,CAAC,CAAC;;;;KACJ,EAAC"}
@@ -1,4 +0,0 @@
1
- import Vorpal from "vorpal";
2
- export declare const getAllNamespacesNames: () => Promise<string[]>;
3
- declare const _default: (vorpal: Vorpal) => Promise<void>;
4
- export default _default;
@@ -1,274 +0,0 @@
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
- exports.getAllNamespacesNames = void 0;
43
- var memoizee_1 = __importDefault(require("memoizee"));
44
- var k8sApi_1 = __importDefault(require("../../../../k8sApi"));
45
- var cluster_1 = require("../../../../utils/cluster");
46
- var log_1 = require("../../../../utils/log");
47
- var passwordstore_1 = require("../../../../utils/passwordstore");
48
- var portForward_1 = require("../../../../utils/portForward");
49
- var shell_1 = require("../../../../utils/shell");
50
- var getGoogleAuthUserNumber_1 = require("../../utils/getGoogleAuthUserNumber");
51
- var shared_1 = require("../shared");
52
- var namespaceAutoCompletion_1 = require("./namespaceAutoCompletion");
53
- var portForward_2 = __importDefault(require("./portForward"));
54
- var getAllNamespaces = (0, memoizee_1["default"])(function () { return __awaiter(void 0, void 0, void 0, function () {
55
- var res;
56
- return __generator(this, function (_a) {
57
- switch (_a.label) {
58
- case 0: return [4 /*yield*/, k8sApi_1["default"].listNamespace()];
59
- case 1:
60
- res = _a.sent();
61
- return [2 /*return*/, res.body.items];
62
- }
63
- });
64
- }); }, { maxAge: 30000, promise: true });
65
- var getAllNamespacesNames = function () { return __awaiter(void 0, void 0, void 0, function () {
66
- var namespaces;
67
- return __generator(this, function (_a) {
68
- switch (_a.label) {
69
- case 0: return [4 /*yield*/, getAllNamespaces()];
70
- case 1:
71
- namespaces = _a.sent();
72
- return [2 /*return*/, namespaces.map(function (n) { return n.metadata.name; })];
73
- }
74
- });
75
- }); };
76
- exports.getAllNamespacesNames = getAllNamespacesNames;
77
- exports["default"] = (function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
78
- return __generator(this, function (_a) {
79
- vorpal
80
- .command("connect-cluster <clustername>")
81
- .autocomplete((0, cluster_1.getAllClusterNames)())
82
- .action(function (_a) {
83
- var clustername = _a.clustername;
84
- return __awaiter(this, void 0, void 0, function () {
85
- return __generator(this, function (_b) {
86
- switch (_b.label) {
87
- case 0:
88
- this.log("connecting to ".concat(clustername));
89
- return [4 /*yield*/, (0, cluster_1.connectToCluster)(clustername)];
90
- case 1:
91
- _b.sent();
92
- return [2 /*return*/];
93
- }
94
- });
95
- });
96
- });
97
- vorpal.command("current-context").action(function () {
98
- return __awaiter(this, void 0, void 0, function () {
99
- var _a;
100
- return __generator(this, function (_b) {
101
- switch (_b.label) {
102
- case 0:
103
- _a = this.log;
104
- return [4 /*yield*/, (0, cluster_1.getCurrentContext)()];
105
- case 1:
106
- _a.apply(this, [_b.sent()]);
107
- return [2 /*return*/];
108
- }
109
- });
110
- });
111
- });
112
- vorpal
113
- .command("list-namespaces", "list all namespaces")
114
- .action(function () {
115
- return __awaiter(this, void 0, void 0, function () {
116
- var namespaces;
117
- return __generator(this, function (_a) {
118
- switch (_a.label) {
119
- case 0: return [4 /*yield*/, (0, exports.getAllNamespacesNames)()];
120
- case 1:
121
- namespaces = _a.sent();
122
- this.log(namespaces.join("\n"));
123
- return [2 /*return*/];
124
- }
125
- });
126
- });
127
- });
128
- vorpal
129
- .command("list-secrets <namespace>", "show secrets")
130
- .autocomplete(namespaceAutoCompletion_1.namespaceAutoCompletion)
131
- .action(function (_a) {
132
- var namespace = _a.namespace;
133
- return __awaiter(this, void 0, void 0, function () {
134
- var res;
135
- return __generator(this, function (_b) {
136
- switch (_b.label) {
137
- case 0: return [4 /*yield*/, k8sApi_1["default"].listNamespacedSecret(namespace)];
138
- case 1:
139
- res = _b.sent();
140
- this.log(res.body.items.map(function (n) { return n.metadata.name; }).join("\n"));
141
- return [2 /*return*/];
142
- }
143
- });
144
- });
145
- });
146
- vorpal.command("bw-sync", "force sync bitwarden").action(function () {
147
- return __awaiter(this, void 0, void 0, function () {
148
- return __generator(this, function (_a) {
149
- switch (_a.label) {
150
- case 0: return [4 /*yield*/, (0, passwordstore_1.syncBitwarden)(true)];
151
- case 1:
152
- _a.sent();
153
- this.log("done");
154
- return [2 /*return*/];
155
- }
156
- });
157
- });
158
- });
159
- vorpal
160
- .command("list-pods <namespace>", "list all pods of namespace")
161
- .autocomplete(namespaceAutoCompletion_1.namespaceAutoCompletion)
162
- .action(function (_a) {
163
- var namespace = _a.namespace;
164
- return __awaiter(this, void 0, void 0, function () {
165
- var res;
166
- return __generator(this, function (_b) {
167
- switch (_b.label) {
168
- case 0: return [4 /*yield*/, k8sApi_1["default"].listNamespacedPod(namespace)];
169
- case 1:
170
- res = _b.sent();
171
- this.log(res.body.items.map(function (n) { return n.metadata.name; }).join("\n"));
172
- return [2 /*return*/];
173
- }
174
- });
175
- });
176
- });
177
- vorpal
178
- .command("stop-portforward <name>", "stop a running port forward")
179
- .autocomplete({ data: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
180
- return [2 /*return*/, (0, portForward_1.getAllRunningPortForwards)()];
181
- }); }); } })
182
- .action(function (_a) {
183
- var name = _a.name;
184
- return __awaiter(this, void 0, void 0, function () {
185
- return __generator(this, function (_b) {
186
- (0, portForward_1.stopPortForward)(name.trim());
187
- return [2 /*return*/];
188
- });
189
- });
190
- });
191
- vorpal
192
- .command("open-dashboard <namespace>", "open kubernetes dashboard")
193
- .autocomplete(namespaceAutoCompletion_1.namespaceAutoCompletion)
194
- .action(function (_a) {
195
- var namespace = _a.namespace;
196
- return __awaiter(this, void 0, void 0, function () {
197
- var clustername, authGoogleNumber;
198
- return __generator(this, function (_b) {
199
- switch (_b.label) {
200
- case 0: return [4 /*yield*/, (0, cluster_1.getCurrentConnectedClusterName)()];
201
- case 1:
202
- clustername = _b.sent();
203
- return [4 /*yield*/, getGoogleAuthUserNumber_1.getGoogleAuthUserNumber.call(this, vorpal)];
204
- case 2:
205
- authGoogleNumber = _b.sent();
206
- return [4 /*yield*/, (0, shared_1.openGoogleCloudKubernetesDashboard)(authGoogleNumber, clustername, namespace)];
207
- case 3:
208
- _b.sent();
209
- return [2 /*return*/];
210
- }
211
- });
212
- });
213
- });
214
- vorpal
215
- .command("open-logs <namespace>", "open google cloud logs (stackdriver stuff)")
216
- .autocomplete(namespaceAutoCompletion_1.namespaceAutoCompletion)
217
- .action(function (_a) {
218
- var namespace = _a.namespace;
219
- return __awaiter(this, void 0, void 0, function () {
220
- var clustername, authGoogleNumber;
221
- return __generator(this, function (_b) {
222
- switch (_b.label) {
223
- case 0: return [4 /*yield*/, (0, cluster_1.getCurrentConnectedClusterName)()];
224
- case 1:
225
- clustername = _b.sent();
226
- return [4 /*yield*/, getGoogleAuthUserNumber_1.getGoogleAuthUserNumber.call(this, vorpal)];
227
- case 2:
228
- authGoogleNumber = _b.sent();
229
- return [4 /*yield*/, (0, shared_1.openGoogleCloudLogs)(authGoogleNumber, clustername, namespace)];
230
- case 3:
231
- _b.sent();
232
- return [2 /*return*/];
233
- }
234
- });
235
- });
236
- });
237
- vorpal
238
- .command("get-shell <namespace>", "get a shell to a pod in the environment")
239
- .autocomplete(namespaceAutoCompletion_1.namespaceAutoCompletion)
240
- .action(function (_a) {
241
- var namespace = _a.namespace;
242
- return __awaiter(this, void 0, void 0, function () {
243
- var res, podNames, podName;
244
- return __generator(this, function (_b) {
245
- switch (_b.label) {
246
- case 0: return [4 /*yield*/, k8sApi_1["default"].listNamespacedPod(namespace)];
247
- case 1:
248
- res = _b.sent();
249
- if (res.body.items.length === 0) {
250
- (0, log_1.logError)(this, "sorry, no pods found");
251
- return [2 /*return*/];
252
- }
253
- podNames = res.body.items.map(function (i) { return i.metadata.name; });
254
- return [4 /*yield*/, this.prompt({
255
- type: "list",
256
- name: "podName",
257
- choices: podNames,
258
- message: "Which pod? 🤔"
259
- })];
260
- case 2:
261
- podName = (_b.sent()).podName;
262
- return [4 /*yield*/, (0, shell_1.getShell)(namespace, podName)];
263
- case 3:
264
- _b.sent();
265
- return [2 /*return*/];
266
- }
267
- });
268
- });
269
- });
270
- (0, portForward_2["default"])(vorpal);
271
- return [2 /*return*/];
272
- });
273
- }); });
274
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/apps/cli/commands/general/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAgC;AAEhC,8DAAwC;AACxC,qDAKmC;AACnC,6CAAiD;AACjD,iEAAgE;AAChE,6DAGuC;AACvC,iDAAmD;AACnD,+EAA8E;AAC9E,oCAGmB;AACnB,qEAAoE;AACpE,8DAAwC;AAExC,IAAM,gBAAgB,GAAG,IAAA,qBAAQ,EAC/B;;;;oBACc,qBAAM,mBAAM,CAAC,aAAa,EAAE,EAAA;;gBAAlC,GAAG,GAAG,SAA4B;gBACxC,sBAAO,GAAG,CAAC,IAAI,CAAC,KAAK,EAAC;;;KACvB,EACD,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,E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