@catladder/cli 0.0.0-test4 → 1.0.0
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.
- package/.nvmrc +1 -1
- package/bin/catenv +3 -0
- package/bin/catladder +1 -1
- package/dist/apps/catenv/catenv.d.ts +2 -0
- package/dist/apps/catenv/catenv.js +135 -0
- package/dist/apps/catenv/catenv.js.map +1 -0
- package/dist/apps/cli/cli.d.ts +2 -0
- package/dist/apps/cli/cli.js +81 -0
- package/dist/apps/cli/cli.js.map +1 -0
- package/dist/apps/cli/commands/general/index.d.ts +4 -0
- package/dist/apps/cli/commands/general/index.js +274 -0
- package/dist/apps/cli/commands/general/index.js.map +1 -0
- package/dist/apps/cli/commands/general/namespaceAutoCompletion.d.ts +3 -0
- package/dist/apps/cli/commands/general/namespaceAutoCompletion.js +56 -0
- package/dist/apps/cli/commands/general/namespaceAutoCompletion.js.map +1 -0
- package/dist/apps/cli/commands/general/portForward.d.ts +3 -0
- package/dist/apps/cli/commands/general/portForward.js +98 -0
- package/dist/apps/cli/commands/general/portForward.js.map +1 -0
- package/dist/apps/cli/commands/mongodb/index.d.ts +3 -0
- package/dist/apps/cli/commands/mongodb/index.js +53 -0
- package/dist/apps/cli/commands/mongodb/index.js.map +1 -0
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.d.ts +3 -0
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js +190 -0
- package/dist/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +1 -0
- package/dist/apps/cli/commands/mongodb/projectMongoGetShell.d.ts +3 -0
- package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js +96 -0
- package/dist/apps/cli/commands/mongodb/projectMongoGetShell.js.map +1 -0
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.d.ts +3 -0
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js +105 -0
- package/dist/apps/cli/commands/mongodb/projectMongoPortForward.js.map +1 -0
- package/dist/apps/cli/commands/mongodb/utils/index.d.ts +13 -0
- package/dist/apps/cli/commands/mongodb/utils/index.js +167 -0
- package/dist/apps/cli/commands/mongodb/utils/index.js.map +1 -0
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js +128 -0
- package/dist/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -0
- package/dist/apps/cli/commands/project/commandConfigSecrets.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandConfigSecrets.js +254 -0
- package/dist/apps/cli/commands/project/commandConfigSecrets.js.map +1 -0
- package/dist/apps/cli/commands/project/commandCopyDB.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandCopyDB.js +102 -0
- package/dist/apps/cli/commands/project/commandCopyDB.js.map +1 -0
- package/dist/apps/cli/commands/project/commandDeletePods.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandDeletePods.js +119 -0
- package/dist/apps/cli/commands/project/commandDeletePods.js.map +1 -0
- package/dist/apps/cli/commands/project/commandDeleteProject.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandDeleteProject.js +97 -0
- package/dist/apps/cli/commands/project/commandDeleteProject.js.map +1 -0
- package/dist/apps/cli/commands/project/commandEnvVars.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandEnvVars.js +74 -0
- package/dist/apps/cli/commands/project/commandEnvVars.js.map +1 -0
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js +58 -0
- package/dist/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +1 -0
- package/dist/apps/cli/commands/project/commandGetShell.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandGetShell.js +92 -0
- package/dist/apps/cli/commands/project/commandGetShell.js.map +1 -0
- package/dist/apps/cli/commands/project/commandGitlabCi.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandGitlabCi.js +185 -0
- package/dist/apps/cli/commands/project/commandGitlabCi.js.map +1 -0
- package/dist/apps/cli/commands/project/commandInitGitlab.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandInitGitlab.js +245 -0
- package/dist/apps/cli/commands/project/commandInitGitlab.js.map +1 -0
- package/dist/apps/cli/commands/project/commandInitProject.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandInitProject.js +345 -0
- package/dist/apps/cli/commands/project/commandInitProject.js.map +1 -0
- package/dist/apps/cli/commands/project/commandListPods.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandListPods.js +78 -0
- package/dist/apps/cli/commands/project/commandListPods.js.map +1 -0
- package/dist/apps/cli/commands/project/commandMigrateHelm3.d.ts +7 -0
- package/dist/apps/cli/commands/project/commandMigrateHelm3.js +113 -0
- package/dist/apps/cli/commands/project/commandMigrateHelm3.js.map +1 -0
- package/dist/apps/cli/commands/project/commandNamespace.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandNamespace.js +70 -0
- package/dist/apps/cli/commands/project/commandNamespace.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenCostDashboard.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenCostDashboard.js +83 -0
- package/dist/apps/cli/commands/project/commandOpenCostDashboard.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenDashboard.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenDashboard.js +92 -0
- package/dist/apps/cli/commands/project/commandOpenDashboard.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenEnv.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenEnv.js +80 -0
- package/dist/apps/cli/commands/project/commandOpenEnv.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenGit.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenGit.js +56 -0
- package/dist/apps/cli/commands/project/commandOpenGit.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenGrafana.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenGrafana.js +83 -0
- package/dist/apps/cli/commands/project/commandOpenGrafana.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js +99 -0
- package/dist/apps/cli/commands/project/commandOpenGrafanaPod.js.map +1 -0
- package/dist/apps/cli/commands/project/commandOpenLogs.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandOpenLogs.js +87 -0
- package/dist/apps/cli/commands/project/commandOpenLogs.js.map +1 -0
- package/dist/apps/cli/commands/project/commandPauseProject.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandPauseProject.js +97 -0
- package/dist/apps/cli/commands/project/commandPauseProject.js.map +1 -0
- package/dist/apps/cli/commands/project/commandPortForward.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandPortForward.js +106 -0
- package/dist/apps/cli/commands/project/commandPortForward.js.map +1 -0
- package/dist/apps/cli/commands/project/commandReloadConfig.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandReloadConfig.js +62 -0
- package/dist/apps/cli/commands/project/commandReloadConfig.js.map +1 -0
- package/dist/apps/cli/commands/project/commandTriggerCronjob.d.ts +3 -0
- package/dist/apps/cli/commands/project/commandTriggerCronjob.js +144 -0
- package/dist/apps/cli/commands/project/commandTriggerCronjob.js.map +1 -0
- package/dist/apps/cli/commands/project/index.d.ts +3 -0
- package/dist/apps/cli/commands/project/index.js +97 -0
- package/dist/apps/cli/commands/project/index.js.map +1 -0
- package/dist/apps/cli/commands/project/utils/autocompletions.d.ts +3 -0
- package/dist/apps/cli/commands/project/utils/autocompletions.js +96 -0
- package/dist/apps/cli/commands/project/utils/autocompletions.js.map +1 -0
- package/dist/apps/cli/commands/project/utils/ensureCluster.d.ts +1 -0
- package/dist/apps/cli/commands/project/utils/ensureCluster.js +84 -0
- package/dist/apps/cli/commands/project/utils/ensureCluster.js.map +1 -0
- package/dist/apps/cli/commands/project/utils/ensureNamespace.d.ts +1 -0
- package/dist/apps/cli/commands/project/utils/ensureNamespace.js +92 -0
- package/dist/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -0
- package/dist/apps/cli/commands/project/utils/showProjectBanner.d.ts +2 -0
- package/dist/apps/cli/commands/project/utils/showProjectBanner.js +58 -0
- package/dist/apps/cli/commands/project/utils/showProjectBanner.js.map +1 -0
- package/dist/apps/cli/commands/shared/index.d.ts +2 -0
- package/dist/apps/cli/commands/shared/index.js +72 -0
- package/dist/apps/cli/commands/shared/index.js.map +1 -0
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.d.ts +3 -0
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js +131 -0
- package/dist/apps/cli/commands/theStuffThatReallyMatters/index.js.map +1 -0
- package/dist/apps/cli/config/writeConfig.d.ts +5 -0
- package/dist/apps/cli/config/writeConfig.js +104 -0
- package/dist/apps/cli/config/writeConfig.js.map +1 -0
- package/dist/apps/cli/utils/getGoogleAuthUserNumber.d.ts +1 -0
- package/dist/apps/cli/utils/getGoogleAuthUserNumber.js +69 -0
- package/dist/apps/cli/utils/getGoogleAuthUserNumber.js.map +1 -0
- package/dist/apps/cli/verify/index.d.ts +2 -0
- package/dist/apps/cli/verify/index.js +90 -0
- package/dist/apps/cli/verify/index.js.map +1 -0
- package/dist/apps/cli/verify/migration/fromv2.d.ts +3 -0
- package/dist/apps/cli/verify/migration/fromv2.js +322 -0
- package/dist/apps/cli/verify/migration/fromv2.js.map +1 -0
- package/dist/apps/cli/verify/migration/migrateSecrets.d.ts +4 -0
- package/dist/apps/cli/verify/migration/migrateSecrets.js +88 -0
- package/dist/apps/cli/verify/migration/migrateSecrets.js.map +1 -0
- package/dist/apps/cli/verify/migration/oldGitlabCi.d.ts +17 -0
- package/dist/apps/cli/verify/migration/oldGitlabCi.js +26 -0
- package/dist/apps/cli/verify/migration/oldGitlabCi.js.map +1 -0
- package/dist/catenv.d.ts +1 -0
- package/dist/catenv.js +8 -0
- package/dist/catenv.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +13 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/clusters.d.ts +14 -0
- package/dist/config/clusters.js +72 -0
- package/dist/config/clusters.js.map +1 -0
- package/dist/config/constants.d.ts +4 -0
- package/dist/config/constants.js +8 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/config/getProjectConfig.d.ts +21 -0
- package/dist/config/getProjectConfig.js +212 -0
- package/dist/config/getProjectConfig.js.map +1 -0
- package/dist/k8sApi/index.d.ts +5 -0
- package/dist/k8sApi/index.js +11 -0
- package/dist/k8sApi/index.js.map +1 -0
- package/dist/packageInfos.d.ts +2 -0
- package/dist/packageInfos.js +6 -0
- package/dist/packageInfos.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/types.d.ts +18 -0
- package/dist/types/types.js +3 -0
- package/dist/types/types.js.map +1 -0
- package/dist/utils/cluster.d.ts +12 -0
- package/dist/utils/cluster.js +100 -0
- package/dist/utils/cluster.js.map +1 -0
- package/dist/utils/dashboardToken.d.ts +2 -0
- package/dist/utils/dashboardToken.js +89 -0
- package/dist/utils/dashboardToken.js.map +1 -0
- package/dist/utils/editAsFile.d.ts +1 -0
- package/dist/utils/editAsFile.js +85 -0
- package/dist/utils/editAsFile.js.map +1 -0
- package/dist/utils/files.d.ts +2 -0
- package/dist/utils/files.js +83 -0
- package/dist/utils/files.js.map +1 -0
- package/dist/utils/formatEnvVars.d.ts +2 -0
- package/dist/utils/formatEnvVars.js +10 -0
- package/dist/utils/formatEnvVars.js.map +1 -0
- package/dist/utils/getEditor.d.ts +4 -0
- package/dist/utils/getEditor.js +70 -0
- package/dist/utils/getEditor.js.map +1 -0
- package/dist/utils/gitlab.d.ts +21 -0
- package/dist/utils/gitlab.js +258 -0
- package/dist/utils/gitlab.js.map +1 -0
- package/dist/utils/log.d.ts +1 -0
- package/dist/utils/log.js +14 -0
- package/dist/utils/log.js.map +1 -0
- package/dist/utils/passwordstore/index.d.ts +8 -0
- package/dist/utils/passwordstore/index.js +378 -0
- package/dist/utils/passwordstore/index.js.map +1 -0
- package/dist/utils/portForward.d.ts +4 -0
- package/dist/utils/portForward.js +116 -0
- package/dist/utils/portForward.js.map +1 -0
- package/dist/utils/preferences/index.d.ts +3 -0
- package/dist/utils/preferences/index.js +119 -0
- package/dist/utils/preferences/index.js.map +1 -0
- package/dist/utils/projects/index.d.ts +8 -0
- package/dist/utils/projects/index.js +150 -0
- package/dist/utils/projects/index.js.map +1 -0
- package/dist/utils/promise.d.ts +2 -0
- package/dist/utils/promise.js +62 -0
- package/dist/utils/promise.js.map +1 -0
- package/dist/utils/shell.d.ts +1 -0
- package/dist/utils/shell.js +81 -0
- package/dist/utils/shell.js.map +1 -0
- package/package.json +10 -11
- package/src/apps/catenv/catenv.ts +48 -27
- package/src/apps/{shell/shell.ts → cli/cli.ts} +12 -2
- package/src/apps/{shell → cli}/commands/general/index.ts +1 -1
- package/src/apps/{shell → cli}/commands/general/namespaceAutoCompletion.ts +0 -0
- package/src/apps/{shell → cli}/commands/general/portForward.ts +1 -1
- package/src/apps/{shell → cli}/commands/mongodb/index.ts +1 -1
- package/src/apps/{shell → cli}/commands/mongodb/projectMongoDestroyMember.ts +18 -18
- package/src/apps/{shell → cli}/commands/mongodb/projectMongoGetShell.ts +12 -10
- package/src/apps/{shell → cli}/commands/mongodb/projectMongoPortForward.ts +13 -8
- package/src/apps/{shell → cli}/commands/mongodb/utils/index.ts +9 -8
- package/src/apps/{shell → cli}/commands/project/commandCloudSqlProxy.ts +23 -17
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +204 -0
- package/src/apps/{shell → cli}/commands/project/commandCopyDB.ts +22 -23
- package/src/apps/{shell → cli}/commands/project/commandDeletePods.ts +8 -9
- package/src/apps/{shell → cli}/commands/project/commandDeleteProject.ts +7 -8
- package/src/apps/cli/commands/project/commandEnvVars.ts +15 -0
- package/src/apps/{shell → cli}/commands/project/commandGetMyTotalWorktime.ts +2 -2
- package/src/apps/{shell → cli}/commands/project/commandGetShell.ts +10 -10
- package/src/apps/{shell → cli}/commands/project/commandGitlabCi.ts +1 -1
- package/src/apps/cli/commands/project/commandInitGitlab.ts +203 -0
- package/src/apps/{shell → cli}/commands/project/commandInitProject.ts +14 -6
- package/src/apps/cli/commands/project/commandListPods.ts +18 -0
- package/src/apps/{shell → cli}/commands/project/commandMigrateHelm3.ts +16 -7
- package/src/apps/cli/commands/project/commandNamespace.ts +14 -0
- package/src/apps/{shell → cli}/commands/project/commandOpenCostDashboard.ts +10 -7
- package/src/apps/cli/commands/project/commandOpenDashboard.ts +45 -0
- package/src/apps/cli/commands/project/commandOpenEnv.ts +22 -0
- package/src/apps/{shell → cli}/commands/project/commandOpenGit.ts +1 -1
- package/src/apps/{shell → cli}/commands/project/commandOpenGrafana.ts +7 -7
- package/src/apps/{shell → cli}/commands/project/commandOpenGrafanaPod.ts +9 -10
- package/src/apps/{shell → cli}/commands/project/commandOpenLogs.ts +7 -7
- package/src/apps/{shell → cli}/commands/project/commandPauseProject.ts +9 -7
- package/src/apps/{shell → cli}/commands/project/commandPortForward.ts +8 -8
- package/src/apps/cli/commands/project/commandReloadConfig.ts +12 -0
- package/src/apps/{shell → cli}/commands/project/commandTriggerCronjob.ts +7 -7
- package/src/apps/{shell → cli}/commands/project/index.ts +4 -3
- package/src/apps/cli/commands/project/utils/autocompletions.ts +26 -0
- package/src/apps/cli/commands/project/utils/ensureCluster.ts +37 -0
- package/src/apps/{shell → cli}/commands/project/utils/ensureNamespace.ts +2 -3
- package/src/apps/cli/commands/project/utils/showProjectBanner.ts +11 -0
- package/src/apps/{shell → cli}/commands/shared/index.ts +0 -0
- package/src/apps/{shell → cli}/commands/theStuffThatReallyMatters/index.ts +11 -11
- package/src/apps/cli/config/writeConfig.ts +69 -0
- package/src/apps/{shell → cli}/utils/getGoogleAuthUserNumber.ts +0 -0
- package/src/apps/cli/verify/index.ts +34 -0
- package/src/apps/cli/verify/migration/fromv2.ts +242 -0
- package/src/apps/cli/verify/migration/migrateSecrets.ts +37 -0
- package/src/apps/cli/verify/migration/oldGitlabCi.ts +43 -0
- package/src/catenv.ts +3 -0
- package/src/cli.ts +8 -0
- package/src/config/getProjectConfig.ts +118 -0
- package/src/types/types.ts +0 -2
- package/src/utils/cluster.ts +15 -2
- package/src/utils/editAsFile.ts +31 -0
- package/src/utils/files.ts +6 -2
- package/src/utils/gitlab.ts +126 -32
- package/src/utils/passwordstore/index.ts +19 -21
- package/src/utils/preferences/index.ts +6 -3
- package/src/utils/projects/index.ts +14 -134
- package/tsconfig.json +3 -7
- package/bin/catenv.sh +0 -1
- package/src/apps/shell/commands/project/commandConfigSecrets.ts +0 -245
- package/src/apps/shell/commands/project/commandEnvVars.ts +0 -17
- package/src/apps/shell/commands/project/commandInitGitlab.ts +0 -157
- package/src/apps/shell/commands/project/commandListPods.ts +0 -21
- package/src/apps/shell/commands/project/commandNamespace.ts +0 -12
- package/src/apps/shell/commands/project/commandOpenDashboard.ts +0 -27
- package/src/apps/shell/commands/project/commandOpenEnv.ts +0 -18
- package/src/apps/shell/commands/project/commandVariables.ts +0 -13
- package/src/apps/shell/commands/project/utils/autocompletions.ts +0 -7
- package/src/apps/shell/commands/project/utils/ensureCluster.ts +0 -31
- package/src/apps/shell/commands/project/utils/monorepo.ts +0 -45
- package/src/index.ts +0 -17
|
@@ -0,0 +1,258 @@
|
|
|
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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
+
if (ar || !(i in from)) {
|
|
41
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
+
ar[i] = from[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
exports.__esModule = true;
|
|
51
|
+
exports.upsertAllVariables = exports.getAllVariables = exports.getProjectInfo = exports.doGitlabRequest = exports.getGitlabToken = exports.setupGitlabToken = exports.hasGitlabToken = void 0;
|
|
52
|
+
var child_process_promise_1 = require("child-process-promise");
|
|
53
|
+
var pipeline_1 = require("@catladder/pipeline");
|
|
54
|
+
var lodash_1 = require("lodash");
|
|
55
|
+
var memoizee_1 = __importDefault(require("memoizee"));
|
|
56
|
+
var node_fetch_1 = __importDefault(require("node-fetch"));
|
|
57
|
+
var open_1 = __importDefault(require("open"));
|
|
58
|
+
var preferences_1 = require("./preferences");
|
|
59
|
+
var TOKEN_KEY = "gitlab-personal-access-token";
|
|
60
|
+
var hasGitlabToken = function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
61
|
+
switch (_a.label) {
|
|
62
|
+
case 0: return [4 /*yield*/, (0, preferences_1.hasPreference)(TOKEN_KEY)];
|
|
63
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
64
|
+
}
|
|
65
|
+
}); }); };
|
|
66
|
+
exports.hasGitlabToken = hasGitlabToken;
|
|
67
|
+
var setupGitlabToken = function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
68
|
+
var shouldContinue, personalToken;
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
switch (_a.label) {
|
|
71
|
+
case 0:
|
|
72
|
+
vorpal.log("");
|
|
73
|
+
vorpal.log("☝ in order to access the api, we need a personal access token");
|
|
74
|
+
vorpal.log("Its best to create one specifically for catladder");
|
|
75
|
+
vorpal.log("");
|
|
76
|
+
vorpal.log("☝ we open up the settings page for you!");
|
|
77
|
+
vorpal.log("");
|
|
78
|
+
return [4 /*yield*/, vorpal.prompt({
|
|
79
|
+
"default": true,
|
|
80
|
+
message: "Ok",
|
|
81
|
+
name: "shouldContinue",
|
|
82
|
+
type: "prompt"
|
|
83
|
+
})];
|
|
84
|
+
case 1:
|
|
85
|
+
shouldContinue = (_a.sent()).shouldContinue;
|
|
86
|
+
(0, open_1["default"])("https://git.panter.ch/-/profile/personal_access_tokens");
|
|
87
|
+
vorpal.log("Please type in gitlab's personal access token");
|
|
88
|
+
return [4 /*yield*/, vorpal.prompt({
|
|
89
|
+
type: "string",
|
|
90
|
+
name: "personalToken",
|
|
91
|
+
"default": "",
|
|
92
|
+
message: "Your personal access token "
|
|
93
|
+
})];
|
|
94
|
+
case 2:
|
|
95
|
+
personalToken = (_a.sent()).personalToken;
|
|
96
|
+
if (!personalToken) return [3 /*break*/, 4];
|
|
97
|
+
return [4 /*yield*/, (0, preferences_1.setPreference)(TOKEN_KEY, personalToken)];
|
|
98
|
+
case 3:
|
|
99
|
+
_a.sent();
|
|
100
|
+
_a.label = 4;
|
|
101
|
+
case 4: return [2 /*return*/];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}); };
|
|
105
|
+
exports.setupGitlabToken = setupGitlabToken;
|
|
106
|
+
var getGitlabToken = function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
107
|
+
return __generator(this, function (_a) {
|
|
108
|
+
switch (_a.label) {
|
|
109
|
+
case 0: return [4 /*yield*/, (0, exports.hasGitlabToken)()];
|
|
110
|
+
case 1:
|
|
111
|
+
if (!!(_a.sent())) return [3 /*break*/, 3];
|
|
112
|
+
if (!vorpal) {
|
|
113
|
+
console.error("⚠️ gitlab token missing, please run catladder to set it up");
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
116
|
+
return [4 /*yield*/, (0, exports.setupGitlabToken)(vorpal)];
|
|
117
|
+
case 2:
|
|
118
|
+
_a.sent();
|
|
119
|
+
_a.label = 3;
|
|
120
|
+
case 3: return [2 /*return*/, (0, preferences_1.getPreference)(TOKEN_KEY)];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}); };
|
|
124
|
+
exports.getGitlabToken = getGitlabToken;
|
|
125
|
+
var doGitlabRequest = function (vorpal, path, data, update) {
|
|
126
|
+
if (data === void 0) { data = undefined; }
|
|
127
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
128
|
+
var rootToken, method, result, _a, _b, _c, _d, _e;
|
|
129
|
+
return __generator(this, function (_f) {
|
|
130
|
+
switch (_f.label) {
|
|
131
|
+
case 0: return [4 /*yield*/, (0, exports.getGitlabToken)(vorpal)];
|
|
132
|
+
case 1:
|
|
133
|
+
rootToken = _f.sent();
|
|
134
|
+
method = data ? (update ? "PUT" : "POST") : "GET";
|
|
135
|
+
return [4 /*yield*/, (0, node_fetch_1["default"])("https://git.panter.ch/api/v4/".concat(path), {
|
|
136
|
+
method: method,
|
|
137
|
+
headers: {
|
|
138
|
+
"Content-Type": "application/json",
|
|
139
|
+
"Private-Token": rootToken
|
|
140
|
+
},
|
|
141
|
+
body: JSON.stringify(data)
|
|
142
|
+
})];
|
|
143
|
+
case 2:
|
|
144
|
+
result = _f.sent();
|
|
145
|
+
if (result.status >= 200 && result.status < 400) {
|
|
146
|
+
return [2 /*return*/, result.json()];
|
|
147
|
+
}
|
|
148
|
+
_a = Error.bind;
|
|
149
|
+
_c = (_b = "Could not send request to gitlab api ".concat(path, ": ").concat(result.status, " \"").concat(result.statusText, "\".\nResponse: ")).concat;
|
|
150
|
+
_e = (_d = JSON).stringify;
|
|
151
|
+
return [4 /*yield*/, result.json()];
|
|
152
|
+
case 3: throw new (_a.apply(Error, [void 0, _c.apply(_b, [_e.apply(_d, [_f.sent(), null, 2])])]))();
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
exports.doGitlabRequest = doGitlabRequest;
|
|
158
|
+
var getProjectInfo = function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
159
|
+
var gitRemoteOriginUrl, projectPath, project;
|
|
160
|
+
return __generator(this, function (_a) {
|
|
161
|
+
switch (_a.label) {
|
|
162
|
+
case 0: return [4 /*yield*/, (0, child_process_promise_1.exec)("git config --get remote.origin.url")];
|
|
163
|
+
case 1:
|
|
164
|
+
gitRemoteOriginUrl = (_a.sent()).stdout.trim();
|
|
165
|
+
projectPath = /(https:\/\/|git@)git\.panter\.ch[:/](.*)\.git/g.exec(gitRemoteOriginUrl);
|
|
166
|
+
return [4 /*yield*/, (0, exports.doGitlabRequest)(vorpal, "projects/".concat(encodeURIComponent(projectPath[2])))];
|
|
167
|
+
case 2:
|
|
168
|
+
project = _a.sent();
|
|
169
|
+
return [2 /*return*/, project];
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}); };
|
|
173
|
+
exports.getProjectInfo = getProjectInfo;
|
|
174
|
+
exports.getAllVariables = (0, memoizee_1["default"])(function (vorpal) { return __awaiter(void 0, void 0, void 0, function () {
|
|
175
|
+
var id, all, result, page;
|
|
176
|
+
return __generator(this, function (_a) {
|
|
177
|
+
switch (_a.label) {
|
|
178
|
+
case 0: return [4 /*yield*/, (0, exports.getProjectInfo)(vorpal)];
|
|
179
|
+
case 1:
|
|
180
|
+
id = (_a.sent()).id;
|
|
181
|
+
all = [];
|
|
182
|
+
page = 1;
|
|
183
|
+
_a.label = 2;
|
|
184
|
+
case 2: return [4 /*yield*/, (0, exports.doGitlabRequest)(vorpal,
|
|
185
|
+
// 100 is max page size
|
|
186
|
+
"projects/".concat(id, "/variables?per_page=100&page=").concat(page))];
|
|
187
|
+
case 3:
|
|
188
|
+
result = _a.sent();
|
|
189
|
+
page++;
|
|
190
|
+
all = __spreadArray(__spreadArray([], all, true), result, true);
|
|
191
|
+
_a.label = 4;
|
|
192
|
+
case 4:
|
|
193
|
+
if ((result === null || result === void 0 ? void 0 : result.length) > 0) return [3 /*break*/, 2];
|
|
194
|
+
_a.label = 5;
|
|
195
|
+
case 5: return [2 /*return*/, all];
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}); }, { promise: true });
|
|
199
|
+
var createVariable = function (vorpal, projectId, key, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
200
|
+
return __generator(this, function (_a) {
|
|
201
|
+
switch (_a.label) {
|
|
202
|
+
case 0: return [4 /*yield*/, (0, exports.doGitlabRequest)(vorpal, "projects/".concat(projectId, "/variables"), {
|
|
203
|
+
key: key,
|
|
204
|
+
value: value
|
|
205
|
+
})];
|
|
206
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}); };
|
|
210
|
+
var updateVariable = function (vorpal, projectId, key, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
211
|
+
return __generator(this, function (_a) {
|
|
212
|
+
switch (_a.label) {
|
|
213
|
+
case 0: return [4 /*yield*/, (0, exports.doGitlabRequest)(vorpal, "projects/".concat(projectId, "/variables/").concat(key), {
|
|
214
|
+
value: value
|
|
215
|
+
}, true)];
|
|
216
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}); };
|
|
220
|
+
var upsertAllVariables = function (vorpal, variables, env, componentName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
221
|
+
var id, _i, _a, _b, key, value, fullKey, valueSanitized, e_1;
|
|
222
|
+
return __generator(this, function (_c) {
|
|
223
|
+
switch (_c.label) {
|
|
224
|
+
case 0: return [4 /*yield*/, (0, exports.getProjectInfo)(vorpal)];
|
|
225
|
+
case 1:
|
|
226
|
+
id = (_c.sent()).id;
|
|
227
|
+
_i = 0, _a = Object.entries(variables !== null && variables !== void 0 ? variables : {});
|
|
228
|
+
_c.label = 2;
|
|
229
|
+
case 2:
|
|
230
|
+
if (!(_i < _a.length)) return [3 /*break*/, 9];
|
|
231
|
+
_b = _a[_i], key = _b[0], value = _b[1];
|
|
232
|
+
fullKey = (0, pipeline_1.getSecretVarName)(env, componentName, key);
|
|
233
|
+
valueSanitized = (0, lodash_1.isObject)(value) ? JSON.stringify(value) : "".concat(value);
|
|
234
|
+
_c.label = 3;
|
|
235
|
+
case 3:
|
|
236
|
+
_c.trys.push([3, 5, 7, 8]);
|
|
237
|
+
return [4 /*yield*/, updateVariable(vorpal, id, fullKey, valueSanitized)];
|
|
238
|
+
case 4:
|
|
239
|
+
_c.sent();
|
|
240
|
+
return [3 /*break*/, 8];
|
|
241
|
+
case 5:
|
|
242
|
+
e_1 = _c.sent();
|
|
243
|
+
return [4 /*yield*/, createVariable(vorpal, id, fullKey, valueSanitized)];
|
|
244
|
+
case 6:
|
|
245
|
+
_c.sent();
|
|
246
|
+
return [3 /*break*/, 8];
|
|
247
|
+
case 7:
|
|
248
|
+
exports.getAllVariables.clear();
|
|
249
|
+
return [7 /*endfinally*/];
|
|
250
|
+
case 8:
|
|
251
|
+
_i++;
|
|
252
|
+
return [3 /*break*/, 2];
|
|
253
|
+
case 9: return [2 /*return*/];
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
}); };
|
|
257
|
+
exports.upsertAllVariables = upsertAllVariables;
|
|
258
|
+
//# sourceMappingURL=gitlab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlab.js","sourceRoot":"","sources":["../../src/utils/gitlab.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,gDAAuD;AACvD,iCAAkC;AAClC,sDAAgC;AAChC,0DAA+B;AAC/B,8CAAwB;AAExB,6CAA4E;AAE5E,IAAM,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,EAAE,EAAE,EAAE,OAAO,EAAE,cAAc,CAAC,EAAA;;gBAAzD,SAAyD,CAAC;;;gBAE1D,uBAAe,CAAC,KAAK,EAAE,CAAC;;;gBARD,IAA+B,CAAA;;;;;KAW3D,CAAC;AAnBW,QAAA,kBAAkB,sBAmB7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const logError: (cmd: any, message: string, additionalMessage?: any) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.logError = void 0;
|
|
4
|
+
var logError = function (cmd, message, additionalMessage) {
|
|
5
|
+
cmd.log("");
|
|
6
|
+
cmd.log("[ERROR] \uD83D\uDE40 :".concat(message));
|
|
7
|
+
cmd.log("");
|
|
8
|
+
if (additionalMessage) {
|
|
9
|
+
cmd.log(additionalMessage);
|
|
10
|
+
cmd.log("");
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
exports.logError = logError;
|
|
14
|
+
//# sourceMappingURL=log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":";;;AAAO,IAAM,QAAQ,GAAG,UACtB,GAAQ,EACR,OAAe,EACf,iBAAuB;IAEvB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACZ,GAAG,CAAC,GAAG,CAAC,gCAAe,OAAO,CAAE,CAAC,CAAC;IAClC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACZ,IAAI,iBAAiB,EAAE;QACrB,GAAG,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC3B,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;KACb;AACH,CAAC,CAAC;AAZW,QAAA,QAAQ,YAYnB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const getCollection: (collectionName: string) => Promise<any>;
|
|
2
|
+
export declare const getOrganization: (organizationName: string) => Promise<any>;
|
|
3
|
+
export declare const hasBitwarden: () => any;
|
|
4
|
+
export declare const readPass: (path: string) => Promise<any>;
|
|
5
|
+
export declare const syncBitwarden: (force?: boolean) => Promise<void>;
|
|
6
|
+
export declare const insertPass: (path: string, content: string) => Promise<void>;
|
|
7
|
+
export declare const trashItem: (path: string) => Promise<any>;
|
|
8
|
+
export declare const editPass: (path: string) => Promise<void>;
|