@catladder/cli 1.0.4 → 1.0.5

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 (209) hide show
  1. package/dist/apps/catenv/catenv.d.ts +2 -0
  2. package/dist/apps/catenv/catenv.js +135 -0
  3. package/dist/apps/catenv/catenv.js.map +1 -0
  4. package/dist/apps/cli/cli.d.ts +2 -0
  5. package/dist/apps/cli/cli.js +81 -0
  6. package/dist/apps/cli/cli.js.map +1 -0
  7. package/dist/apps/cli/commands/general/index.d.ts +4 -0
  8. package/dist/apps/cli/commands/general/index.js +274 -0
  9. package/dist/apps/cli/commands/general/index.js.map +1 -0
  10. package/dist/apps/cli/commands/general/namespaceAutoCompletion.d.ts +3 -0
  11. package/dist/apps/cli/commands/general/namespaceAutoCompletion.js +56 -0
  12. package/dist/apps/cli/commands/general/namespaceAutoCompletion.js.map +1 -0
  13. package/dist/apps/cli/commands/general/portForward.d.ts +3 -0
  14. package/dist/apps/cli/commands/general/portForward.js +98 -0
  15. package/dist/apps/cli/commands/general/portForward.js.map +1 -0
  16. package/dist/apps/cli/commands/mongodb/index.d.ts +3 -0
  17. package/dist/apps/cli/commands/mongodb/index.js +53 -0
  18. package/dist/apps/cli/commands/mongodb/index.js.map +1 -0
  19. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +3 -0
  20. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js +190 -0
  21. package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +1 -0
  22. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +3 -0
  23. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js +96 -0
  24. package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js.map +1 -0
  25. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +3 -0
  26. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js +105 -0
  27. package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js.map +1 -0
  28. package/dist/apps/cli/commands/mongodb/utils/index.d.ts +13 -0
  29. package/dist/apps/cli/commands/mongodb/utils/index.js +167 -0
  30. package/dist/apps/cli/commands/mongodb/utils/index.js.map +1 -0
  31. package/dist/apps/cli/commands/project/commandCloudSqlProxy.d.ts +3 -0
  32. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +128 -0
  33. package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -0
  34. package/dist/apps/cli/commands/project/commandConfigSecrets.d.ts +3 -0
  35. package/dist/apps/cli/commands/project/commandConfigSecrets.js +254 -0
  36. package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -0
  37. package/dist/apps/cli/commands/project/commandCopyDB.d.ts +3 -0
  38. package/dist/apps/cli/commands/project/commandCopyDB.js +102 -0
  39. package/dist/apps/cli/commands/project/commandCopyDB.js.map +1 -0
  40. package/dist/apps/cli/commands/project/commandDeletePods.d.ts +3 -0
  41. package/dist/apps/cli/commands/project/commandDeletePods.js +119 -0
  42. package/dist/apps/cli/commands/project/commandDeletePods.js.map +1 -0
  43. package/dist/apps/cli/commands/project/commandDeleteProject.d.ts +3 -0
  44. package/dist/apps/cli/commands/project/commandDeleteProject.js +97 -0
  45. package/dist/apps/cli/commands/project/commandDeleteProject.js.map +1 -0
  46. package/dist/apps/cli/commands/project/commandEnvVars.d.ts +3 -0
  47. package/dist/apps/cli/commands/project/commandEnvVars.js +74 -0
  48. package/dist/apps/cli/commands/project/commandEnvVars.js.map +1 -0
  49. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +3 -0
  50. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js +58 -0
  51. package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +1 -0
  52. package/dist/apps/cli/commands/project/commandGetShell.d.ts +3 -0
  53. package/dist/apps/cli/commands/project/commandGetShell.js +92 -0
  54. package/dist/apps/cli/commands/project/commandGetShell.js.map +1 -0
  55. package/dist/apps/cli/commands/project/commandGitlabCi.d.ts +3 -0
  56. package/dist/apps/cli/commands/project/commandGitlabCi.js +185 -0
  57. package/dist/apps/cli/commands/project/commandGitlabCi.js.map +1 -0
  58. package/dist/apps/cli/commands/project/commandInitGitlab.d.ts +3 -0
  59. package/dist/apps/cli/commands/project/commandInitGitlab.js +245 -0
  60. package/dist/apps/cli/commands/project/commandInitGitlab.js.map +1 -0
  61. package/dist/apps/cli/commands/project/commandInitProject.d.ts +3 -0
  62. package/dist/apps/cli/commands/project/commandInitProject.js +345 -0
  63. package/dist/apps/cli/commands/project/commandInitProject.js.map +1 -0
  64. package/dist/apps/cli/commands/project/commandListPods.d.ts +3 -0
  65. package/dist/apps/cli/commands/project/commandListPods.js +78 -0
  66. package/dist/apps/cli/commands/project/commandListPods.js.map +1 -0
  67. package/dist/apps/cli/commands/project/commandMigrateHelm3.d.ts +7 -0
  68. package/dist/apps/cli/commands/project/commandMigrateHelm3.js +113 -0
  69. package/dist/apps/cli/commands/project/commandMigrateHelm3.js.map +1 -0
  70. package/dist/apps/cli/commands/project/commandNamespace.d.ts +3 -0
  71. package/dist/apps/cli/commands/project/commandNamespace.js +70 -0
  72. package/dist/apps/cli/commands/project/commandNamespace.js.map +1 -0
  73. package/dist/apps/cli/commands/project/commandOpenCostDashboard.d.ts +3 -0
  74. package/dist/apps/cli/commands/project/commandOpenCostDashboard.js +83 -0
  75. package/dist/apps/cli/commands/project/commandOpenCostDashboard.js.map +1 -0
  76. package/dist/apps/cli/commands/project/commandOpenDashboard.d.ts +3 -0
  77. package/dist/apps/cli/commands/project/commandOpenDashboard.js +92 -0
  78. package/dist/apps/cli/commands/project/commandOpenDashboard.js.map +1 -0
  79. package/dist/apps/cli/commands/project/commandOpenEnv.d.ts +3 -0
  80. package/dist/apps/cli/commands/project/commandOpenEnv.js +80 -0
  81. package/dist/apps/cli/commands/project/commandOpenEnv.js.map +1 -0
  82. package/dist/apps/cli/commands/project/commandOpenGit.d.ts +3 -0
  83. package/dist/apps/cli/commands/project/commandOpenGit.js +56 -0
  84. package/dist/apps/cli/commands/project/commandOpenGit.js.map +1 -0
  85. package/dist/apps/cli/commands/project/commandOpenGrafana.d.ts +3 -0
  86. package/dist/apps/cli/commands/project/commandOpenGrafana.js +83 -0
  87. package/dist/apps/cli/commands/project/commandOpenGrafana.js.map +1 -0
  88. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.d.ts +3 -0
  89. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js +99 -0
  90. package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js.map +1 -0
  91. package/dist/apps/cli/commands/project/commandOpenLogs.d.ts +3 -0
  92. package/dist/apps/cli/commands/project/commandOpenLogs.js +87 -0
  93. package/dist/apps/cli/commands/project/commandOpenLogs.js.map +1 -0
  94. package/dist/apps/cli/commands/project/commandPauseProject.d.ts +3 -0
  95. package/dist/apps/cli/commands/project/commandPauseProject.js +97 -0
  96. package/dist/apps/cli/commands/project/commandPauseProject.js.map +1 -0
  97. package/dist/apps/cli/commands/project/commandPortForward.d.ts +3 -0
  98. package/dist/apps/cli/commands/project/commandPortForward.js +106 -0
  99. package/dist/apps/cli/commands/project/commandPortForward.js.map +1 -0
  100. package/dist/apps/cli/commands/project/commandReloadConfig.d.ts +3 -0
  101. package/dist/apps/cli/commands/project/commandReloadConfig.js +62 -0
  102. package/dist/apps/cli/commands/project/commandReloadConfig.js.map +1 -0
  103. package/dist/apps/cli/commands/project/commandTriggerCronjob.d.ts +3 -0
  104. package/dist/apps/cli/commands/project/commandTriggerCronjob.js +144 -0
  105. package/dist/apps/cli/commands/project/commandTriggerCronjob.js.map +1 -0
  106. package/dist/apps/cli/commands/project/index.d.ts +3 -0
  107. package/dist/apps/cli/commands/project/index.js +97 -0
  108. package/dist/apps/cli/commands/project/index.js.map +1 -0
  109. package/dist/apps/cli/commands/project/utils/autocompletions.d.ts +3 -0
  110. package/dist/apps/cli/commands/project/utils/autocompletions.js +96 -0
  111. package/dist/apps/cli/commands/project/utils/autocompletions.js.map +1 -0
  112. package/dist/apps/cli/commands/project/utils/ensureCluster.d.ts +1 -0
  113. package/dist/apps/cli/commands/project/utils/ensureCluster.js +84 -0
  114. package/dist/apps/cli/commands/project/utils/ensureCluster.js.map +1 -0
  115. package/dist/apps/cli/commands/project/utils/ensureNamespace.d.ts +1 -0
  116. package/dist/apps/cli/commands/project/utils/ensureNamespace.js +92 -0
  117. package/dist/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -0
  118. package/dist/apps/cli/commands/project/utils/showProjectBanner.d.ts +2 -0
  119. package/dist/apps/cli/commands/project/utils/showProjectBanner.js +58 -0
  120. package/dist/apps/cli/commands/project/utils/showProjectBanner.js.map +1 -0
  121. package/dist/apps/cli/commands/shared/index.d.ts +2 -0
  122. package/dist/apps/cli/commands/shared/index.js +72 -0
  123. package/dist/apps/cli/commands/shared/index.js.map +1 -0
  124. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +3 -0
  125. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js +131 -0
  126. package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js.map +1 -0
  127. package/dist/apps/cli/config/writeConfig.d.ts +5 -0
  128. package/dist/apps/cli/config/writeConfig.js +104 -0
  129. package/dist/apps/cli/config/writeConfig.js.map +1 -0
  130. package/dist/apps/cli/utils/getGoogleAuthUserNumber.d.ts +1 -0
  131. package/dist/apps/cli/utils/getGoogleAuthUserNumber.js +69 -0
  132. package/dist/apps/cli/utils/getGoogleAuthUserNumber.js.map +1 -0
  133. package/dist/apps/cli/verify/index.d.ts +2 -0
  134. package/dist/apps/cli/verify/index.js +90 -0
  135. package/dist/apps/cli/verify/index.js.map +1 -0
  136. package/dist/apps/cli/verify/migration/fromv2.d.ts +3 -0
  137. package/dist/apps/cli/verify/migration/fromv2.js +322 -0
  138. package/dist/apps/cli/verify/migration/fromv2.js.map +1 -0
  139. package/dist/apps/cli/verify/migration/migrateSecrets.d.ts +4 -0
  140. package/dist/apps/cli/verify/migration/migrateSecrets.js +88 -0
  141. package/dist/apps/cli/verify/migration/migrateSecrets.js.map +1 -0
  142. package/dist/apps/cli/verify/migration/oldGitlabCi.d.ts +17 -0
  143. package/dist/apps/cli/verify/migration/oldGitlabCi.js +26 -0
  144. package/dist/apps/cli/verify/migration/oldGitlabCi.js.map +1 -0
  145. package/dist/catenv.d.ts +1 -0
  146. package/dist/catenv.js +8 -0
  147. package/dist/catenv.js.map +1 -0
  148. package/dist/cli.d.ts +1 -0
  149. package/dist/cli.js +13 -0
  150. package/dist/cli.js.map +1 -0
  151. package/dist/config/clusters.d.ts +14 -0
  152. package/dist/config/clusters.js +72 -0
  153. package/dist/config/clusters.js.map +1 -0
  154. package/dist/config/constants.d.ts +4 -0
  155. package/dist/config/constants.js +8 -0
  156. package/dist/config/constants.js.map +1 -0
  157. package/dist/config/getProjectConfig.d.ts +21 -0
  158. package/dist/config/getProjectConfig.js +212 -0
  159. package/dist/config/getProjectConfig.js.map +1 -0
  160. package/dist/k8sApi/index.d.ts +5 -0
  161. package/dist/k8sApi/index.js +11 -0
  162. package/dist/k8sApi/index.js.map +1 -0
  163. package/dist/packageInfos.d.ts +2 -0
  164. package/dist/packageInfos.js +6 -0
  165. package/dist/packageInfos.js.map +1 -0
  166. package/dist/tsconfig.tsbuildinfo +1 -0
  167. package/dist/types/types.d.ts +18 -0
  168. package/dist/types/types.js +3 -0
  169. package/dist/types/types.js.map +1 -0
  170. package/dist/utils/cluster.d.ts +12 -0
  171. package/dist/utils/cluster.js +100 -0
  172. package/dist/utils/cluster.js.map +1 -0
  173. package/dist/utils/editAsFile.d.ts +1 -0
  174. package/dist/utils/editAsFile.js +85 -0
  175. package/dist/utils/editAsFile.js.map +1 -0
  176. package/dist/utils/files.d.ts +2 -0
  177. package/dist/utils/files.js +83 -0
  178. package/dist/utils/files.js.map +1 -0
  179. package/dist/utils/formatEnvVars.d.ts +2 -0
  180. package/dist/utils/formatEnvVars.js +10 -0
  181. package/dist/utils/formatEnvVars.js.map +1 -0
  182. package/dist/utils/getEditor.d.ts +4 -0
  183. package/dist/utils/getEditor.js +70 -0
  184. package/dist/utils/getEditor.js.map +1 -0
  185. package/dist/utils/gitlab.d.ts +21 -0
  186. package/dist/utils/gitlab.js +258 -0
  187. package/dist/utils/gitlab.js.map +1 -0
  188. package/dist/utils/log.d.ts +1 -0
  189. package/dist/utils/log.js +14 -0
  190. package/dist/utils/log.js.map +1 -0
  191. package/dist/utils/passwordstore/index.d.ts +8 -0
  192. package/dist/utils/passwordstore/index.js +378 -0
  193. package/dist/utils/passwordstore/index.js.map +1 -0
  194. package/dist/utils/portForward.d.ts +4 -0
  195. package/dist/utils/portForward.js +116 -0
  196. package/dist/utils/portForward.js.map +1 -0
  197. package/dist/utils/preferences/index.d.ts +3 -0
  198. package/dist/utils/preferences/index.js +119 -0
  199. package/dist/utils/preferences/index.js.map +1 -0
  200. package/dist/utils/projects/index.d.ts +8 -0
  201. package/dist/utils/projects/index.js +150 -0
  202. package/dist/utils/projects/index.js.map +1 -0
  203. package/dist/utils/promise.d.ts +2 -0
  204. package/dist/utils/promise.js +62 -0
  205. package/dist/utils/promise.js.map +1 -0
  206. package/dist/utils/shell.d.ts +1 -0
  207. package/dist/utils/shell.js +81 -0
  208. package/dist/utils/shell.js.map +1 -0
  209. package/package.json +2 -2
@@ -0,0 +1,100 @@
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.connectToCluster = exports.getAllClusterNames = exports.getAllClusters = exports.getClusterByName = exports.getClusterByFullName = exports.getCurrentConnectedClusterName = exports.getCurrentContext = void 0;
43
+ var child_process_promise_1 = require("child-process-promise");
44
+ var lodash_1 = require("lodash");
45
+ var clusters_1 = __importDefault(require("../config/clusters"));
46
+ var getCurrentContext = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
47
+ switch (_a.label) {
48
+ case 0: return [4 /*yield*/, (0, child_process_promise_1.exec)("kubectl config current-context")];
49
+ case 1: return [2 /*return*/, (_a.sent()).stdout.trim()];
50
+ }
51
+ }); }); };
52
+ exports.getCurrentContext = getCurrentContext;
53
+ var getCurrentConnectedClusterName = function () { return __awaiter(void 0, void 0, void 0, function () {
54
+ var currentContext;
55
+ return __generator(this, function (_a) {
56
+ switch (_a.label) {
57
+ case 0: return [4 /*yield*/, (0, exports.getCurrentContext)()];
58
+ case 1:
59
+ currentContext = _a.sent();
60
+ return [2 /*return*/, (0, lodash_1.findKey)(clusters_1["default"], { fullName: currentContext })];
61
+ }
62
+ });
63
+ }); };
64
+ exports.getCurrentConnectedClusterName = getCurrentConnectedClusterName;
65
+ var getClusterByFullName = function (fullName) {
66
+ var found = Object.entries((0, exports.getAllClusters)()).find(function (_a) {
67
+ var config = _a[1];
68
+ return config.fullName === fullName;
69
+ });
70
+ if (found) {
71
+ return { name: found[0], cluster: found[1] };
72
+ }
73
+ else {
74
+ return null;
75
+ }
76
+ };
77
+ exports.getClusterByFullName = getClusterByFullName;
78
+ var getClusterByName = function (name) { return (0, exports.getAllClusters)()[name]; };
79
+ exports.getClusterByName = getClusterByName;
80
+ var getAllClusters = function () {
81
+ return clusters_1["default"];
82
+ };
83
+ exports.getAllClusters = getAllClusters;
84
+ var getAllClusterNames = function () { return Object.keys(clusters_1["default"]); };
85
+ exports.getAllClusterNames = getAllClusterNames;
86
+ var connectToCluster = function (clusterName) { return __awaiter(void 0, void 0, void 0, function () {
87
+ var connect;
88
+ return __generator(this, function (_a) {
89
+ switch (_a.label) {
90
+ case 0:
91
+ connect = (0, exports.getClusterByName)(clusterName).connect;
92
+ return [4 /*yield*/, connect()];
93
+ case 1:
94
+ _a.sent();
95
+ return [2 /*return*/];
96
+ }
97
+ });
98
+ }); };
99
+ exports.connectToCluster = connectToCluster;
100
+ //# sourceMappingURL=cluster.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cluster.js","sourceRoot":"","sources":["../../src/utils/cluster.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,iCAAiC;AACjC,gEAA0C;AACnC,IAAM,iBAAiB,GAAG;;gBAC9B,qBAAM,IAAA,4BAAI,EAAC,gCAAgC,CAAC,EAAA;gBAA7C,sBAAA,CAAC,SAA4C,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAA;;SAAA,CAAC;AADlD,QAAA,iBAAiB,qBACiC;AAExD,IAAM,8BAA8B,GAAG;;;;oBACrB,qBAAM,IAAA,yBAAiB,GAAE,EAAA;;gBAA1C,cAAc,GAAG,SAAyB;gBAChD,sBAAO,IAAA,gBAAO,EAAC,qBAAQ,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC,EAAC;;;KACxD,CAAC;AAHW,QAAA,8BAA8B,kCAGzC;AAEK,IAAM,oBAAoB,GAAG,UAAC,QAAgB;IACnD,IAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,IAAA,sBAAc,GAAE,CAAC,CAAC,IAAI,CACjD,UAAC,EAAU;YAAP,MAAM,QAAA;QAAM,OAAA,MAAM,CAAC,QAAQ,KAAK,QAAQ;IAA5B,CAA4B,CAC7C,CAAC;IACF,IAAI,KAAK,EAAE;QACT,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9C;SAAM;QACL,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAC;AATW,QAAA,oBAAoB,wBAS/B;AAEK,IAAM,gBAAgB,GAAG,UAAC,IAAY,IAAK,OAAA,IAAA,sBAAc,GAAE,CAAC,IAAI,CAAC,EAAtB,CAAsB,CAAC;AAA5D,QAAA,gBAAgB,oBAA4C;AAElE,IAAM,cAAc,GAAG;IAC5B,OAAO,qBAAQ,CAAC;AAClB,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB;AAEK,IAAM,kBAAkB,GAAG,cAAM,OAAA,MAAM,CAAC,IAAI,CAAC,qBAAQ,CAAC,EAArB,CAAqB,CAAC;AAAjD,QAAA,kBAAkB,sBAA+B;AAEvD,IAAM,gBAAgB,GAAG,UAAO,WAAmB;;;;;gBAChD,OAAO,GAAK,IAAA,wBAAgB,EAAC,WAAW,CAAC,QAAlC,CAAmC;gBAClD,qBAAM,OAAO,EAAE,EAAA;;gBAAf,SAAe,CAAC;;;;KACjB,CAAC;AAHW,QAAA,gBAAgB,oBAG3B"}
@@ -0,0 +1 @@
1
+ export declare const editAsFile: <T>(inObject: T, preamble?: string) => Promise<T>;
@@ -0,0 +1,85 @@
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.editAsFile = void 0;
43
+ var tmp_promise_1 = require("tmp-promise");
44
+ var js_yaml_1 = require("js-yaml");
45
+ var fs_extra_1 = require("fs-extra");
46
+ var getEditor_1 = __importDefault(require("./getEditor"));
47
+ var editAsFile = function (inObject, preamble) { return __awaiter(void 0, void 0, void 0, function () {
48
+ var fullPreamble, asString, newContent;
49
+ return __generator(this, function (_a) {
50
+ switch (_a.label) {
51
+ case 0:
52
+ fullPreamble = preamble
53
+ ? "#\n# ".concat(preamble.split("\n").join("\n# "), "\n#\n\n")
54
+ : "\n";
55
+ asString = fullPreamble + (0, js_yaml_1.dump)(inObject, { noRefs: true });
56
+ return [4 /*yield*/, (0, tmp_promise_1.withFile)(function (_a) {
57
+ var tmpFilePath = _a.path;
58
+ return __awaiter(void 0, void 0, void 0, function () {
59
+ var _b;
60
+ return __generator(this, function (_c) {
61
+ switch (_c.label) {
62
+ case 0: return [4 /*yield*/, (0, fs_extra_1.writeFile)(tmpFilePath, asString)];
63
+ case 1:
64
+ _c.sent();
65
+ return [4 /*yield*/, (0, getEditor_1["default"])()];
66
+ case 2: return [4 /*yield*/, (_c.sent()).open(tmpFilePath)];
67
+ case 3:
68
+ _c.sent();
69
+ _b = js_yaml_1.load;
70
+ return [4 /*yield*/, (0, fs_extra_1.readFile)(tmpFilePath)];
71
+ case 4:
72
+ newContent = _b.apply(void 0, [(_c.sent()).toString("utf-8")]);
73
+ return [2 /*return*/];
74
+ }
75
+ });
76
+ });
77
+ }, { postfix: ".yml" })];
78
+ case 1:
79
+ _a.sent();
80
+ return [2 /*return*/, newContent];
81
+ }
82
+ });
83
+ }); };
84
+ exports.editAsFile = editAsFile;
85
+ //# sourceMappingURL=editAsFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editAsFile.js","sourceRoot":"","sources":["../../src/utils/editAsFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAuC;AACvC,mCAAqC;AAErC,qCAA+C;AAC/C,0DAAoC;AAE7B,IAAM,UAAU,GAAG,UACxB,QAAW,EACX,QAAiB;;;;;gBAEX,YAAY,GAAG,QAAQ;oBAC3B,CAAC,CAAC,eACF,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,YAGpC;oBACG,CAAC,CAAC,IAAI,CAAC;gBACH,QAAQ,GAAG,YAAY,GAAG,IAAA,cAAI,EAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;gBAGjE,qBAAM,IAAA,sBAAQ,EACZ,UAAO,EAAqB;4BAAb,WAAW,UAAA;;;;;4CACxB,qBAAM,IAAA,oBAAS,EAAC,WAAW,EAAE,QAAQ,CAAC,EAAA;;wCAAtC,SAAsC,CAAC;wCAChC,qBAAM,IAAA,sBAAS,GAAE,EAAA;4CAAxB,qBAAM,CAAC,SAAiB,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,EAAA;;wCAA3C,SAA2C,CAAC;wCAC/B,KAAA,cAAI,CAAA;wCAAE,qBAAM,IAAA,mBAAQ,EAAC,WAAW,CAAC,EAAA;;wCAA9C,UAAU,GAAG,kBAAK,CAAC,SAA2B,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAM,CAAC;;;;;qBACzE,EACD,EAAE,OAAO,EAAE,MAAM,EAAE,CACpB,EAAA;;gBAPD,SAOC,CAAC;gBAEF,sBAAO,UAAU,EAAC;;;KACnB,CAAC;AAxBW,QAAA,UAAU,cAwBrB"}
@@ -0,0 +1,2 @@
1
+ export declare const readFileOrError: (filePath: string) => Promise<any[]>;
2
+ export declare const readYaml: <T = Record<string, any>>(filename: string) => Promise<T>;
@@ -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
+ exports.readYaml = exports.readFileOrError = void 0;
43
+ var fs_extra_1 = __importDefault(require("fs-extra"));
44
+ var js_yaml_1 = __importDefault(require("js-yaml"));
45
+ var readFile = function (file) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
46
+ return [2 /*return*/, fs_extra_1["default"].readFile(file, { encoding: "utf-8" })];
47
+ }); }); };
48
+ var readFileOrError = function (filePath) { return __awaiter(void 0, void 0, void 0, function () {
49
+ var file, e_1;
50
+ return __generator(this, function (_a) {
51
+ switch (_a.label) {
52
+ case 0:
53
+ _a.trys.push([0, 2, , 3]);
54
+ return [4 /*yield*/, readFile(filePath)];
55
+ case 1:
56
+ file = _a.sent();
57
+ return [2 /*return*/, [null, file]];
58
+ case 2:
59
+ e_1 = _a.sent();
60
+ return [2 /*return*/, [e_1]];
61
+ case 3: return [2 /*return*/];
62
+ }
63
+ });
64
+ }); };
65
+ exports.readFileOrError = readFileOrError;
66
+ var readYaml = function (filename) { return __awaiter(void 0, void 0, void 0, function () {
67
+ var _a, _b, e_2;
68
+ return __generator(this, function (_c) {
69
+ switch (_c.label) {
70
+ case 0:
71
+ _c.trys.push([0, 2, , 3]);
72
+ _b = (_a = js_yaml_1["default"]).load;
73
+ return [4 /*yield*/, readFile(filename)];
74
+ case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])];
75
+ case 2:
76
+ e_2 = _c.sent();
77
+ return [2 /*return*/, null];
78
+ case 3: return [2 /*return*/];
79
+ }
80
+ });
81
+ }); };
82
+ exports.readYaml = readYaml;
83
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/utils/files.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAA0B;AAC1B,oDAA2B;AAE3B,IAAM,QAAQ,GAAG,UAAO,IAAY;IAClC,sBAAA,qBAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAA;SAAA,CAAC;AAEpC,IAAM,eAAe,GAAG,UAAO,QAAgB;;;;;;gBAErC,qBAAM,QAAQ,CAAC,QAAQ,CAAC,EAAA;;gBAA/B,IAAI,GAAG,SAAwB;gBACrC,sBAAO,CAAC,IAAI,EAAE,IAAI,CAAC,EAAC;;;gBAEpB,sBAAO,CAAC,GAAC,CAAC,EAAC;;;;KAEd,CAAC;AAPW,QAAA,eAAe,mBAO1B;AAEK,IAAM,QAAQ,GAAG,UAAgC,QAAgB;;;;;;gBAE7D,KAAA,CAAA,KAAA,oBAAI,CAAA,CAAC,IAAI,CAAA;gBAAC,qBAAM,QAAQ,CAAC,QAAQ,CAAC,EAAA;oBAAzC,sBAAO,cAAU,SAAwB,EAAM,EAAC;;;gBAEhD,sBAAO,IAAI,EAAC;;;;KAEf,CAAC;AANW,QAAA,QAAQ,YAMnB"}
@@ -0,0 +1,2 @@
1
+ declare const _default: (envVars?: {}) => {};
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ var lodash_1 = require("lodash");
4
+ exports["default"] = (function (envVars) {
5
+ if (envVars === void 0) { envVars = {}; }
6
+ return (0, lodash_1.mapValues)(envVars, function (value) {
7
+ return (0, lodash_1.isObject)(value) ? JSON.stringify(value) : "".concat(value);
8
+ });
9
+ });
10
+ //# sourceMappingURL=formatEnvVars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatEnvVars.js","sourceRoot":"","sources":["../../src/utils/formatEnvVars.ts"],"names":[],"mappings":";;AAAA,iCAA6C;AAE7C,sBAAe,UAAC,OAAY;IAAZ,wBAAA,EAAA,YAAY;IAC1B,OAAO,IAAA,kBAAS,EAAC,OAAO,EAAE,UAAA,KAAK;QAC7B,OAAA,IAAA,iBAAQ,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAG,KAAK,CAAE;IAApD,CAAoD,CACrD,CAAC;AACJ,CAAC,EAAC"}
@@ -0,0 +1,4 @@
1
+ declare const _default: () => Promise<{
2
+ open: (path: string) => Promise<void>;
3
+ }>;
4
+ export default _default;
@@ -0,0 +1,70 @@
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
+ /* eslint-disable @typescript-eslint/no-var-requires */
43
+ var child_process_promise_1 = require("child-process-promise");
44
+ var command_exists_promise_1 = __importDefault(require("command-exists-promise"));
45
+ var cmd;
46
+ exports["default"] = (function () { return __awaiter(void 0, void 0, void 0, function () {
47
+ return __generator(this, function (_a) {
48
+ switch (_a.label) {
49
+ case 0:
50
+ if (!!cmd) return [3 /*break*/, 2];
51
+ return [4 /*yield*/, (0, command_exists_promise_1["default"])("code")];
52
+ case 1:
53
+ cmd = (_a.sent()) ? "code --wait" : "vim";
54
+ _a.label = 2;
55
+ case 2: return [2 /*return*/, {
56
+ open: function (path) { return __awaiter(void 0, void 0, void 0, function () {
57
+ return __generator(this, function (_a) {
58
+ switch (_a.label) {
59
+ case 0: return [4 /*yield*/, (0, child_process_promise_1.spawn)("".concat(cmd, " ").concat(path), { shell: true, stdio: "inherit" })];
60
+ case 1:
61
+ _a.sent();
62
+ return [2 /*return*/];
63
+ }
64
+ });
65
+ }); }
66
+ }];
67
+ }
68
+ });
69
+ }); });
70
+ //# sourceMappingURL=getEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEditor.js","sourceRoot":"","sources":["../../src/utils/getEditor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,+DAA8C;AAC9C,kFAAmD;AAEnD,IAAI,GAAW,CAAC;AAChB,sBAAe;;;;qBACT,CAAC,GAAG,EAAJ,wBAAI;gBACC,qBAAM,IAAA,mCAAa,EAAC,MAAM,CAAC,EAAA;;gBAAlC,GAAG,GAAG,CAAC,SAA2B,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC;;oBAG9D,sBAAO;oBACL,IAAI,EAAE,UAAO,IAAY;;;wCACvB,qBAAM,IAAA,6BAAK,EAAC,UAAG,GAAG,cAAI,IAAI,CAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,EAAA;;oCAAhE,SAAgE,CAAC;;;;yBAClE;iBACF,EAAC;;;KACH,EAAC"}
@@ -0,0 +1,21 @@
1
+ import memoizee from "memoizee";
2
+ import { CommandInstance } from "vorpal";
3
+ export declare const hasGitlabToken: () => Promise<boolean>;
4
+ export declare const setupGitlabToken: (vorpal: CommandInstance) => Promise<void>;
5
+ export declare const getGitlabToken: (vorpal: CommandInstance) => Promise<string>;
6
+ export declare const doGitlabRequest: <T = any>(vorpal: CommandInstance, path: string, data?: any, update?: boolean) => Promise<T>;
7
+ export declare const getProjectInfo: (vorpal: CommandInstance) => Promise<{
8
+ id: string;
9
+ web_url: string;
10
+ }>;
11
+ declare type GitlabVariable = {
12
+ variable_type: string;
13
+ key: string;
14
+ value: string;
15
+ protected: boolean;
16
+ masked: boolean;
17
+ environment_scope: string;
18
+ };
19
+ export declare const getAllVariables: ((vorpal: CommandInstance) => Promise<Array<GitlabVariable>>) & memoizee.Memoized<(vorpal: CommandInstance) => Promise<Array<GitlabVariable>>>;
20
+ export declare const upsertAllVariables: (vorpal: CommandInstance, variables: Record<string, any>, env: string, componentName: string) => Promise<void>;
21
+ export {};