@catladder/cli 0.0.0-main-d74691dd → 0.0.0-main-b29ca0c2
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 +1 -0
- package/bin/catladder +1 -1
- package/bin/debugCatenv +1 -0
- package/dist/apps/catenv/catenv.js +130 -35
- package/dist/apps/catenv/catenv.js.map +1 -1
- package/dist/apps/cli/cli.d.ts +2 -0
- package/dist/apps/cli/cli.js +82 -0
- package/dist/apps/cli/cli.js.map +1 -0
- package/dist/apps/{shell → cli}/commands/general/index.d.ts +1 -1
- package/dist/apps/cli/commands/general/index.js +274 -0
- package/dist/apps/cli/commands/general/index.js.map +1 -0
- package/dist/apps/{shell → cli}/commands/general/namespaceAutoCompletion.d.ts +0 -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/{shell → cli}/commands/mongodb/utils/index.d.ts +0 -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 +217 -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/{shell → cli}/commands/project/commandMigrateHelm3.d.ts +1 -1
- 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/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 +95 -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/{shell → cli}/commands/project/utils/ensureCluster.d.ts +0 -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/{shell → cli}/commands/project/utils/ensureNamespace.d.ts +0 -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/{shell → cli}/commands/shared/index.d.ts +0 -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/{shell → cli}/utils/getGoogleAuthUserNumber.d.ts +0 -0
- package/dist/apps/cli/utils/getGoogleAuthUserNumber.js +69 -0
- package/dist/apps/cli/utils/getGoogleAuthUserNumber.js.map +1 -0
- package/dist/{index.d.ts → catenv.d.ts} +0 -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.js +57 -9
- package/dist/config/clusters.js.map +1 -1
- package/dist/config/constants.js +1 -1
- package/dist/config/getProjectConfig.d.ts +11 -7
- package/dist/config/getProjectConfig.js +166 -61
- package/dist/config/getProjectConfig.js.map +1 -1
- package/dist/k8sApi/index.js +5 -5
- package/dist/k8sApi/index.js.map +1 -1
- package/dist/packageInfos.js +3 -3
- package/dist/packageInfos.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types.js +1 -1
- package/dist/utils/cluster.js +79 -19
- package/dist/utils/cluster.js.map +1 -1
- package/dist/utils/dashboardToken.js +80 -15
- package/dist/utils/dashboardToken.js.map +1 -1
- package/dist/utils/editAsFile.d.ts +1 -1
- package/dist/utils/editAsFile.js +78 -15
- package/dist/utils/editAsFile.js.map +1 -1
- package/dist/utils/files.js +70 -16
- package/dist/utils/files.js.map +1 -1
- package/dist/utils/formatEnvVars.js +8 -5
- package/dist/utils/formatEnvVars.js.map +1 -1
- package/dist/utils/getEditor.js +64 -14
- package/dist/utils/getEditor.js.map +1 -1
- package/dist/utils/gitlab.d.ts +2 -1
- package/dist/utils/gitlab.js +194 -79
- package/dist/utils/gitlab.js.map +1 -1
- package/dist/utils/log.js +3 -3
- package/dist/utils/log.js.map +1 -1
- package/dist/utils/passwordstore/index.js +362 -154
- package/dist/utils/passwordstore/index.js.map +1 -1
- package/dist/utils/portForward.js +103 -34
- package/dist/utils/portForward.js.map +1 -1
- package/dist/utils/preferences/index.js +110 -28
- package/dist/utils/preferences/index.js.map +1 -1
- package/dist/utils/projects/index.js +136 -40
- package/dist/utils/projects/index.js.map +1 -1
- package/dist/utils/promise.js +56 -5
- package/dist/utils/promise.js.map +1 -1
- package/dist/utils/shell.js +75 -19
- package/dist/utils/shell.js.map +1 -1
- package/package.json +9 -10
- package/src/apps/catenv/catenv.ts +16 -5
- package/src/apps/{shell/shell.ts → cli/cli.ts} +2 -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 +3 -3
- package/src/apps/{shell → cli}/commands/mongodb/projectMongoGetShell.ts +3 -3
- package/src/apps/{shell → cli}/commands/mongodb/projectMongoPortForward.ts +3 -3
- package/src/apps/{shell → cli}/commands/mongodb/utils/index.ts +0 -0
- package/src/apps/{shell → cli}/commands/project/commandCloudSqlProxy.ts +7 -7
- package/src/apps/cli/commands/project/commandConfigSecrets.ts +161 -0
- package/src/apps/{shell → cli}/commands/project/commandCopyDB.ts +9 -5
- package/src/apps/{shell → cli}/commands/project/commandDeletePods.ts +3 -3
- package/src/apps/{shell → cli}/commands/project/commandDeleteProject.ts +3 -3
- 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 +3 -3
- package/src/apps/{shell → cli}/commands/project/commandGitlabCi.ts +1 -1
- package/src/apps/{shell → cli}/commands/project/commandInitGitlab.ts +3 -3
- package/src/apps/{shell → cli}/commands/project/commandInitProject.ts +2 -2
- package/src/apps/{shell → cli}/commands/project/commandListPods.ts +3 -3
- package/src/apps/{shell → cli}/commands/project/commandMigrateHelm3.ts +11 -5
- package/src/apps/{shell → cli}/commands/project/commandNamespace.ts +3 -3
- package/src/apps/{shell → cli}/commands/project/commandOpenCostDashboard.ts +3 -3
- package/src/apps/{shell → cli}/commands/project/commandOpenDashboard.ts +12 -6
- 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 +3 -3
- package/src/apps/{shell → cli}/commands/project/commandOpenGrafanaPod.ts +4 -5
- package/src/apps/{shell → cli}/commands/project/commandOpenLogs.ts +3 -3
- package/src/apps/{shell → cli}/commands/project/commandPauseProject.ts +3 -3
- package/src/apps/{shell → cli}/commands/project/commandPortForward.ts +3 -3
- package/src/apps/{shell → cli}/commands/project/commandTriggerCronjob.ts +3 -3
- package/src/apps/{shell → cli}/commands/project/index.ts +1 -1
- package/src/apps/cli/commands/project/utils/autocompletions.ts +26 -0
- package/src/apps/{shell → cli}/commands/project/utils/ensureCluster.ts +6 -2
- package/src/apps/{shell → cli}/commands/project/utils/ensureNamespace.ts +0 -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/{shell → cli}/utils/getGoogleAuthUserNumber.ts +0 -0
- package/src/catenv.ts +3 -0
- package/src/cli.ts +8 -0
- package/src/config/getProjectConfig.ts +48 -40
- package/src/utils/editAsFile.ts +12 -2
- package/src/utils/gitlab.ts +14 -10
- package/src/utils/projects/index.ts +2 -1
- package/tsconfig.json +2 -2
- package/bin/catenv.sh +0 -1
- package/dist/apps/shell/commands/general/index.js +0 -104
- package/dist/apps/shell/commands/general/index.js.map +0 -1
- package/dist/apps/shell/commands/general/namespaceAutoCompletion.js +0 -11
- package/dist/apps/shell/commands/general/namespaceAutoCompletion.js.map +0 -1
- package/dist/apps/shell/commands/general/portForward.d.ts +0 -3
- package/dist/apps/shell/commands/general/portForward.js +0 -42
- package/dist/apps/shell/commands/general/portForward.js.map +0 -1
- package/dist/apps/shell/commands/mongodb/index.d.ts +0 -3
- package/dist/apps/shell/commands/mongodb/index.js +0 -14
- package/dist/apps/shell/commands/mongodb/index.js.map +0 -1
- package/dist/apps/shell/commands/mongodb/projectMongoDestroyMember.d.ts +0 -3
- package/dist/apps/shell/commands/mongodb/projectMongoDestroyMember.js +0 -93
- package/dist/apps/shell/commands/mongodb/projectMongoDestroyMember.js.map +0 -1
- package/dist/apps/shell/commands/mongodb/projectMongoGetShell.d.ts +0 -3
- package/dist/apps/shell/commands/mongodb/projectMongoGetShell.js +0 -36
- package/dist/apps/shell/commands/mongodb/projectMongoGetShell.js.map +0 -1
- package/dist/apps/shell/commands/mongodb/projectMongoPortForward.d.ts +0 -3
- package/dist/apps/shell/commands/mongodb/projectMongoPortForward.js +0 -43
- package/dist/apps/shell/commands/mongodb/projectMongoPortForward.js.map +0 -1
- package/dist/apps/shell/commands/mongodb/utils/index.js +0 -61
- package/dist/apps/shell/commands/mongodb/utils/index.js.map +0 -1
- package/dist/apps/shell/commands/project/commandCloudSqlProxy.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandCloudSqlProxy.js +0 -47
- package/dist/apps/shell/commands/project/commandCloudSqlProxy.js.map +0 -1
- package/dist/apps/shell/commands/project/commandConfigSecrets.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandConfigSecrets.js +0 -96
- package/dist/apps/shell/commands/project/commandConfigSecrets.js.map +0 -1
- package/dist/apps/shell/commands/project/commandCopyDB.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandCopyDB.js +0 -67
- package/dist/apps/shell/commands/project/commandCopyDB.js.map +0 -1
- package/dist/apps/shell/commands/project/commandDeletePods.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandDeletePods.js +0 -45
- package/dist/apps/shell/commands/project/commandDeletePods.js.map +0 -1
- package/dist/apps/shell/commands/project/commandDeleteProject.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandDeleteProject.js +0 -28
- package/dist/apps/shell/commands/project/commandDeleteProject.js.map +0 -1
- package/dist/apps/shell/commands/project/commandEnvVars.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandEnvVars.js +0 -12
- package/dist/apps/shell/commands/project/commandEnvVars.js.map +0 -1
- package/dist/apps/shell/commands/project/commandGetMyTotalWorktime.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandGetMyTotalWorktime.js +0 -11
- package/dist/apps/shell/commands/project/commandGetMyTotalWorktime.js.map +0 -1
- package/dist/apps/shell/commands/project/commandGetShell.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandGetShell.js +0 -30
- package/dist/apps/shell/commands/project/commandGetShell.js.map +0 -1
- package/dist/apps/shell/commands/project/commandGitlabCi.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandGitlabCi.js +0 -86
- package/dist/apps/shell/commands/project/commandGitlabCi.js.map +0 -1
- package/dist/apps/shell/commands/project/commandInitGitlab.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandInitGitlab.js +0 -142
- package/dist/apps/shell/commands/project/commandInitGitlab.js.map +0 -1
- package/dist/apps/shell/commands/project/commandInitProject.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandInitProject.js +0 -253
- package/dist/apps/shell/commands/project/commandInitProject.js.map +0 -1
- package/dist/apps/shell/commands/project/commandListPods.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandListPods.js +0 -19
- package/dist/apps/shell/commands/project/commandListPods.js.map +0 -1
- package/dist/apps/shell/commands/project/commandMigrateHelm3.js +0 -45
- package/dist/apps/shell/commands/project/commandMigrateHelm3.js.map +0 -1
- package/dist/apps/shell/commands/project/commandNamespace.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandNamespace.js +0 -11
- package/dist/apps/shell/commands/project/commandNamespace.js.map +0 -1
- package/dist/apps/shell/commands/project/commandOpenCostDashboard.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandOpenCostDashboard.js +0 -22
- package/dist/apps/shell/commands/project/commandOpenCostDashboard.js.map +0 -1
- package/dist/apps/shell/commands/project/commandOpenDashboard.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandOpenDashboard.js +0 -28
- package/dist/apps/shell/commands/project/commandOpenDashboard.js.map +0 -1
- package/dist/apps/shell/commands/project/commandOpenEnv.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandOpenEnv.js +0 -19
- package/dist/apps/shell/commands/project/commandOpenEnv.js.map +0 -1
- package/dist/apps/shell/commands/project/commandOpenGit.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandOpenGit.js +0 -9
- package/dist/apps/shell/commands/project/commandOpenGit.js.map +0 -1
- package/dist/apps/shell/commands/project/commandOpenGrafana.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandOpenGrafana.js +0 -22
- package/dist/apps/shell/commands/project/commandOpenGrafana.js.map +0 -1
- package/dist/apps/shell/commands/project/commandOpenGrafanaPod.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandOpenGrafanaPod.js +0 -34
- package/dist/apps/shell/commands/project/commandOpenGrafanaPod.js.map +0 -1
- package/dist/apps/shell/commands/project/commandOpenLogs.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandOpenLogs.js +0 -22
- package/dist/apps/shell/commands/project/commandOpenLogs.js.map +0 -1
- package/dist/apps/shell/commands/project/commandPauseProject.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandPauseProject.js +0 -28
- package/dist/apps/shell/commands/project/commandPauseProject.js.map +0 -1
- package/dist/apps/shell/commands/project/commandPortForward.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandPortForward.js +0 -40
- package/dist/apps/shell/commands/project/commandPortForward.js.map +0 -1
- package/dist/apps/shell/commands/project/commandTriggerCronjob.d.ts +0 -3
- package/dist/apps/shell/commands/project/commandTriggerCronjob.js +0 -56
- package/dist/apps/shell/commands/project/commandTriggerCronjob.js.map +0 -1
- package/dist/apps/shell/commands/project/index.d.ts +0 -3
- package/dist/apps/shell/commands/project/index.js +0 -56
- package/dist/apps/shell/commands/project/index.js.map +0 -1
- package/dist/apps/shell/commands/project/utils/autocompletions.d.ts +0 -1
- package/dist/apps/shell/commands/project/utils/autocompletions.js +0 -6
- package/dist/apps/shell/commands/project/utils/autocompletions.js.map +0 -1
- package/dist/apps/shell/commands/project/utils/ensureCluster.js +0 -32
- package/dist/apps/shell/commands/project/utils/ensureCluster.js.map +0 -1
- package/dist/apps/shell/commands/project/utils/ensureNamespace.js +0 -39
- package/dist/apps/shell/commands/project/utils/ensureNamespace.js.map +0 -1
- package/dist/apps/shell/commands/shared/index.js +0 -22
- package/dist/apps/shell/commands/shared/index.js.map +0 -1
- package/dist/apps/shell/commands/theStuffThatReallyMatters/index.d.ts +0 -3
- package/dist/apps/shell/commands/theStuffThatReallyMatters/index.js +0 -51
- package/dist/apps/shell/commands/theStuffThatReallyMatters/index.js.map +0 -1
- package/dist/apps/shell/shell.d.ts +0 -2
- package/dist/apps/shell/shell.js +0 -38
- package/dist/apps/shell/shell.js.map +0 -1
- package/dist/apps/shell/utils/getGoogleAuthUserNumber.js +0 -20
- package/dist/apps/shell/utils/getGoogleAuthUserNumber.js.map +0 -1
- package/dist/index.js +0 -21
- package/dist/index.js.map +0 -1
- package/src/apps/shell/commands/project/commandConfigSecrets.ts +0 -114
- package/src/apps/shell/commands/project/commandEnvVars.ts +0 -14
- package/src/apps/shell/commands/project/commandOpenEnv.ts +0 -18
- package/src/apps/shell/commands/project/utils/autocompletions.ts +0 -3
- package/src/index.ts +0 -17
|
@@ -1,173 +1,381 @@
|
|
|
1
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
|
+
};
|
|
2
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
51
|
};
|
|
5
|
-
|
|
52
|
+
exports.__esModule = true;
|
|
6
53
|
exports.readPassEnvVars = exports.editPass = exports.insertPass = exports.syncBitwarden = exports.readPass = exports.hasBitwarden = exports.getOrganization = exports.getCollection = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
promise.childProcess.stdout.on("data", (d) => (session = d.toString("utf-8")));
|
|
38
|
-
await promise;
|
|
39
|
-
await (0, preferences_1.setPreference)("bwsession", session);
|
|
40
|
-
await (0, exports.syncBitwarden)(true); // needs syncing to work properly afterwards
|
|
41
|
-
};
|
|
42
|
-
const execBitwardenCommand = async (command) => {
|
|
43
|
-
if (!(await (0, preferences_1.hasPreference)("bwsession"))) {
|
|
44
|
-
await loginBitwarden();
|
|
45
|
-
}
|
|
46
|
-
const session = await (0, preferences_1.getPreference)("bwsession");
|
|
47
|
-
const fullCommand = `BW_SESSION='${session}' bw ${command} --raw --nointeraction`;
|
|
48
|
-
if (DEBUG) {
|
|
49
|
-
console.log(fullCommand);
|
|
50
|
-
console.time(fullCommand);
|
|
51
|
-
}
|
|
52
|
-
try {
|
|
53
|
-
const { stdout } = await (0, child_process_promise_1.exec)(fullCommand);
|
|
54
|
-
if (DEBUG) {
|
|
55
|
-
console.timeEnd(fullCommand);
|
|
56
|
-
}
|
|
57
|
-
if (!stdout) {
|
|
58
|
-
return null;
|
|
54
|
+
var child_process_promise_1 = require("child-process-promise");
|
|
55
|
+
var command_exists_promise_1 = __importDefault(require("command-exists-promise"));
|
|
56
|
+
var dayjs_1 = __importDefault(require("dayjs"));
|
|
57
|
+
var fs_extra_1 = require("fs-extra");
|
|
58
|
+
var js_yaml_1 = __importDefault(require("js-yaml"));
|
|
59
|
+
var tmp_promise_1 = require("tmp-promise");
|
|
60
|
+
var formatEnvVars_1 = __importDefault(require("../formatEnvVars"));
|
|
61
|
+
var getEditor_1 = __importDefault(require("../getEditor"));
|
|
62
|
+
var preferences_1 = require("../preferences");
|
|
63
|
+
var DEBUG = false;
|
|
64
|
+
var unlockBitwarden = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
65
|
+
var promise, session;
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
switch (_a.label) {
|
|
68
|
+
case 0:
|
|
69
|
+
console.error("");
|
|
70
|
+
console.error("# Bitwarden is locked, please unlock:");
|
|
71
|
+
console.error("");
|
|
72
|
+
promise = (0, child_process_promise_1.spawn)("bw", ["unlock", "--raw"], {
|
|
73
|
+
stdio: ["inherit", "pipe", "inherit"]
|
|
74
|
+
});
|
|
75
|
+
session = null;
|
|
76
|
+
promise.childProcess.stdout.on("data", function (d) { return (session = d.toString("utf-8")); });
|
|
77
|
+
return [4 /*yield*/, promise];
|
|
78
|
+
case 1:
|
|
79
|
+
_a.sent();
|
|
80
|
+
return [4 /*yield*/, (0, preferences_1.setPreference)("bwsession", session)];
|
|
81
|
+
case 2:
|
|
82
|
+
_a.sent();
|
|
83
|
+
return [2 /*return*/];
|
|
59
84
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
});
|
|
86
|
+
}); };
|
|
87
|
+
var loginBitwarden = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
+
var promise, session;
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
switch (_a.label) {
|
|
91
|
+
case 0:
|
|
92
|
+
console.error("");
|
|
93
|
+
console.error("# Please login to Bitwarden:");
|
|
94
|
+
console.error("");
|
|
95
|
+
promise = (0, child_process_promise_1.spawn)("bw", ["login", "--raw"], {
|
|
96
|
+
stdio: ["inherit", "pipe", "inherit"]
|
|
97
|
+
});
|
|
98
|
+
session = null;
|
|
99
|
+
promise.childProcess.stdout.on("data", function (d) { return (session = d.toString("utf-8")); });
|
|
100
|
+
return [4 /*yield*/, promise];
|
|
101
|
+
case 1:
|
|
102
|
+
_a.sent();
|
|
103
|
+
return [4 /*yield*/, (0, preferences_1.setPreference)("bwsession", session)];
|
|
104
|
+
case 2:
|
|
105
|
+
_a.sent();
|
|
106
|
+
return [4 /*yield*/, (0, exports.syncBitwarden)(true)];
|
|
107
|
+
case 3:
|
|
108
|
+
_a.sent(); // needs syncing to work properly afterwards
|
|
109
|
+
return [2 /*return*/];
|
|
78
110
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
111
|
+
});
|
|
112
|
+
}); };
|
|
113
|
+
var execBitwardenCommand = function (command) { return __awaiter(void 0, void 0, void 0, function () {
|
|
114
|
+
var session, fullCommand, stdout, e_1, isLocked, notLoggedIn;
|
|
115
|
+
return __generator(this, function (_a) {
|
|
116
|
+
switch (_a.label) {
|
|
117
|
+
case 0: return [4 /*yield*/, (0, preferences_1.hasPreference)("bwsession")];
|
|
118
|
+
case 1:
|
|
119
|
+
if (!!(_a.sent())) return [3 /*break*/, 3];
|
|
120
|
+
return [4 /*yield*/, loginBitwarden()];
|
|
121
|
+
case 2:
|
|
122
|
+
_a.sent();
|
|
123
|
+
_a.label = 3;
|
|
124
|
+
case 3: return [4 /*yield*/, (0, preferences_1.getPreference)("bwsession")];
|
|
125
|
+
case 4:
|
|
126
|
+
session = _a.sent();
|
|
127
|
+
fullCommand = "BW_SESSION='".concat(session, "' bw ").concat(command, " --raw --nointeraction");
|
|
128
|
+
if (DEBUG) {
|
|
129
|
+
console.log(fullCommand);
|
|
130
|
+
console.time(fullCommand);
|
|
131
|
+
}
|
|
132
|
+
_a.label = 5;
|
|
133
|
+
case 5:
|
|
134
|
+
_a.trys.push([5, 7, , 13]);
|
|
135
|
+
return [4 /*yield*/, (0, child_process_promise_1.exec)(fullCommand)];
|
|
136
|
+
case 6:
|
|
137
|
+
stdout = (_a.sent()).stdout;
|
|
138
|
+
if (DEBUG) {
|
|
139
|
+
console.timeEnd(fullCommand);
|
|
140
|
+
}
|
|
141
|
+
if (!stdout) {
|
|
142
|
+
return [2 /*return*/, null];
|
|
143
|
+
}
|
|
144
|
+
try {
|
|
145
|
+
return [2 /*return*/, JSON.parse(stdout)];
|
|
146
|
+
}
|
|
147
|
+
catch (e) {
|
|
148
|
+
// no json
|
|
149
|
+
return [2 /*return*/, stdout];
|
|
150
|
+
}
|
|
151
|
+
return [3 /*break*/, 13];
|
|
152
|
+
case 7:
|
|
153
|
+
e_1 = _a.sent();
|
|
154
|
+
isLocked = e_1.toString().includes("Vault is locked");
|
|
155
|
+
notLoggedIn = e_1.toString().includes("You are not logged in");
|
|
156
|
+
if (!isLocked) return [3 /*break*/, 9];
|
|
157
|
+
return [4 /*yield*/, unlockBitwarden()];
|
|
158
|
+
case 8:
|
|
159
|
+
_a.sent();
|
|
160
|
+
return [2 /*return*/, execBitwardenCommand(command)];
|
|
161
|
+
case 9:
|
|
162
|
+
if (!notLoggedIn) return [3 /*break*/, 11];
|
|
163
|
+
return [4 /*yield*/, loginBitwarden()];
|
|
164
|
+
case 10:
|
|
165
|
+
_a.sent();
|
|
166
|
+
return [2 /*return*/, execBitwardenCommand(command)];
|
|
167
|
+
case 11:
|
|
168
|
+
console.error(e_1);
|
|
169
|
+
console.log("wooops", e_1.message);
|
|
170
|
+
_a.label = 12;
|
|
171
|
+
case 12: return [3 /*break*/, 13];
|
|
172
|
+
case 13: return [2 /*return*/];
|
|
82
173
|
}
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
return
|
|
87
|
-
|
|
174
|
+
});
|
|
175
|
+
}); };
|
|
176
|
+
var getCollection = function (collectionName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
177
|
+
return __generator(this, function (_a) {
|
|
178
|
+
return [2 /*return*/, execBitwardenCommand("get collection ".concat(collectionName))];
|
|
179
|
+
});
|
|
180
|
+
}); };
|
|
88
181
|
exports.getCollection = getCollection;
|
|
89
|
-
|
|
90
|
-
return
|
|
91
|
-
|
|
182
|
+
var getOrganization = function (organizationName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
183
|
+
return __generator(this, function (_a) {
|
|
184
|
+
return [2 /*return*/, execBitwardenCommand("get organization ".concat(organizationName))];
|
|
185
|
+
});
|
|
186
|
+
}); };
|
|
92
187
|
exports.getOrganization = getOrganization;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
188
|
+
var catladderCollectionId;
|
|
189
|
+
var getCatladderCollectionId = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
192
|
+
case 0:
|
|
193
|
+
if (!!catladderCollectionId) return [3 /*break*/, 2];
|
|
194
|
+
return [4 /*yield*/, (0, exports.getCollection)("catladder")];
|
|
195
|
+
case 1:
|
|
196
|
+
catladderCollectionId = (_a.sent()).id;
|
|
197
|
+
_a.label = 2;
|
|
198
|
+
case 2: return [2 /*return*/, catladderCollectionId];
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}); };
|
|
202
|
+
var panterOrganizationId;
|
|
203
|
+
var getPanterOrganizationId = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
204
|
+
return __generator(this, function (_a) {
|
|
205
|
+
switch (_a.label) {
|
|
206
|
+
case 0:
|
|
207
|
+
if (!!panterOrganizationId) return [3 /*break*/, 2];
|
|
208
|
+
return [4 /*yield*/, (0, exports.getOrganization)("Panter AG")];
|
|
209
|
+
case 1:
|
|
210
|
+
panterOrganizationId = (_a.sent()).id;
|
|
211
|
+
_a.label = 2;
|
|
212
|
+
case 2: return [2 /*return*/, panterOrganizationId];
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}); };
|
|
216
|
+
var encode = function (data) {
|
|
217
|
+
return Buffer.from(JSON.stringify(data)).toString("base64");
|
|
106
218
|
};
|
|
107
|
-
|
|
108
|
-
const hasBitwarden = () => (0, command_exists_promise_1.default)("bw");
|
|
219
|
+
var hasBitwarden = function () { return (0, command_exists_promise_1["default"])("bw"); };
|
|
109
220
|
exports.hasBitwarden = hasBitwarden;
|
|
110
|
-
|
|
111
|
-
return
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
221
|
+
var getItem = function (path) { return __awaiter(void 0, void 0, void 0, function () {
|
|
222
|
+
return __generator(this, function (_a) {
|
|
223
|
+
return [2 /*return*/, execBitwardenCommand("get item ".concat(path))];
|
|
224
|
+
});
|
|
225
|
+
}); };
|
|
226
|
+
var readPass = function (path) { return __awaiter(void 0, void 0, void 0, function () {
|
|
227
|
+
var result;
|
|
228
|
+
var _a;
|
|
229
|
+
return __generator(this, function (_b) {
|
|
230
|
+
switch (_b.label) {
|
|
231
|
+
case 0: return [4 /*yield*/, getItem(path)];
|
|
232
|
+
case 1:
|
|
233
|
+
result = _b.sent();
|
|
234
|
+
return [2 /*return*/, result.notes || ((_a = result.login) === null || _a === void 0 ? void 0 : _a.password)];
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}); };
|
|
117
238
|
exports.readPass = readPass;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
239
|
+
var update = function (type, itemId, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
240
|
+
var result;
|
|
241
|
+
return __generator(this, function (_a) {
|
|
242
|
+
switch (_a.label) {
|
|
243
|
+
case 0: return [4 /*yield*/, execBitwardenCommand("edit ".concat(type, " ").concat(itemId, " ").concat(encode(value)))];
|
|
244
|
+
case 1:
|
|
245
|
+
result = _a.sent();
|
|
246
|
+
return [2 /*return*/, result];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}); };
|
|
250
|
+
var MAX_SYNC_AGE_IN_MINUTES = 30;
|
|
251
|
+
var syncBitwarden = function (force) {
|
|
252
|
+
if (force === void 0) { force = true; }
|
|
253
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
254
|
+
var lastSync, _a;
|
|
255
|
+
return __generator(this, function (_b) {
|
|
256
|
+
switch (_b.label) {
|
|
257
|
+
case 0: return [4 /*yield*/, (0, preferences_1.hasPreference)("bwLastSync")];
|
|
258
|
+
case 1:
|
|
259
|
+
if (!(_b.sent())) return [3 /*break*/, 3];
|
|
260
|
+
return [4 /*yield*/, (0, preferences_1.getPreference)("bwLastSync")];
|
|
261
|
+
case 2:
|
|
262
|
+
_a = _b.sent();
|
|
263
|
+
return [3 /*break*/, 4];
|
|
264
|
+
case 3:
|
|
265
|
+
_a = null;
|
|
266
|
+
_b.label = 4;
|
|
267
|
+
case 4:
|
|
268
|
+
lastSync = _a;
|
|
269
|
+
if (!(force ||
|
|
270
|
+
!lastSync ||
|
|
271
|
+
(0, dayjs_1["default"])().diff(lastSync, "minutes") >= MAX_SYNC_AGE_IN_MINUTES)) return [3 /*break*/, 7];
|
|
272
|
+
return [4 /*yield*/, execBitwardenCommand("sync")];
|
|
273
|
+
case 5:
|
|
274
|
+
_b.sent();
|
|
275
|
+
return [4 /*yield*/, (0, preferences_1.setPreference)("bwLastSync", new Date().toISOString())];
|
|
276
|
+
case 6:
|
|
277
|
+
_b.sent();
|
|
278
|
+
return [3 /*break*/, 7];
|
|
279
|
+
case 7: return [2 /*return*/];
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
});
|
|
136
283
|
};
|
|
137
284
|
exports.syncBitwarden = syncBitwarden;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
285
|
+
var insertPass = function (path, content) { return __awaiter(void 0, void 0, void 0, function () {
|
|
286
|
+
var value, result;
|
|
287
|
+
var _a;
|
|
288
|
+
return __generator(this, function (_b) {
|
|
289
|
+
switch (_b.label) {
|
|
290
|
+
case 0:
|
|
291
|
+
_a = {
|
|
292
|
+
type: 2,
|
|
293
|
+
secureNote: { type: 0 },
|
|
294
|
+
name: path,
|
|
295
|
+
notes: content
|
|
296
|
+
};
|
|
297
|
+
return [4 /*yield*/, getCatladderCollectionId()];
|
|
298
|
+
case 1:
|
|
299
|
+
value = (_a.collectionIds = [_b.sent()],
|
|
300
|
+
_a);
|
|
301
|
+
return [4 /*yield*/, execBitwardenCommand("create item ".concat(encode(value)))];
|
|
302
|
+
case 2:
|
|
303
|
+
result = _b.sent();
|
|
304
|
+
return [4 /*yield*/, share(result.id)];
|
|
305
|
+
case 3:
|
|
306
|
+
_b.sent();
|
|
307
|
+
return [2 /*return*/];
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}); };
|
|
149
311
|
exports.insertPass = insertPass;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
312
|
+
var share = function (itemId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
313
|
+
var _a, _b, _c, _d, _e, _f;
|
|
314
|
+
return __generator(this, function (_g) {
|
|
315
|
+
switch (_g.label) {
|
|
316
|
+
case 0:
|
|
317
|
+
_a = execBitwardenCommand;
|
|
318
|
+
_d = (_c = "share ".concat(itemId, " ")).concat;
|
|
319
|
+
return [4 /*yield*/, getPanterOrganizationId()];
|
|
320
|
+
case 1:
|
|
321
|
+
_e = (_b = _d.apply(_c, [_g.sent(), " "])).concat;
|
|
322
|
+
_f = encode;
|
|
323
|
+
return [4 /*yield*/, getCatladderCollectionId()];
|
|
324
|
+
case 2: return [2 /*return*/, _a.apply(void 0, [_e.apply(_b, [_f.apply(void 0, [[
|
|
325
|
+
_g.sent()
|
|
326
|
+
]])])])];
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
}); };
|
|
330
|
+
var editPass = function (path) { return __awaiter(void 0, void 0, void 0, function () {
|
|
331
|
+
var item;
|
|
332
|
+
return __generator(this, function (_a) {
|
|
333
|
+
switch (_a.label) {
|
|
334
|
+
case 0: return [4 /*yield*/, getItem(path)];
|
|
335
|
+
case 1:
|
|
336
|
+
item = _a.sent();
|
|
337
|
+
return [4 /*yield*/, (0, tmp_promise_1.withFile)(function (_a) {
|
|
338
|
+
var tmpFilePath = _a.path;
|
|
339
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
340
|
+
var newContent;
|
|
341
|
+
return __generator(this, function (_b) {
|
|
342
|
+
switch (_b.label) {
|
|
343
|
+
case 0: return [4 /*yield*/, (0, fs_extra_1.writeFile)(tmpFilePath, item.notes)];
|
|
344
|
+
case 1:
|
|
345
|
+
_b.sent();
|
|
346
|
+
return [4 /*yield*/, (0, getEditor_1["default"])()];
|
|
347
|
+
case 2: return [4 /*yield*/, (_b.sent()).open(tmpFilePath)];
|
|
348
|
+
case 3:
|
|
349
|
+
_b.sent();
|
|
350
|
+
return [4 /*yield*/, (0, fs_extra_1.readFile)(tmpFilePath)];
|
|
351
|
+
case 4:
|
|
352
|
+
newContent = (_b.sent()).toString("utf-8");
|
|
353
|
+
return [4 /*yield*/, update("item", item.id, __assign(__assign({}, item), { notes: newContent }))];
|
|
354
|
+
case 5:
|
|
355
|
+
_b.sent();
|
|
356
|
+
return [2 /*return*/];
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
});
|
|
360
|
+
}, { postfix: ".yml" })];
|
|
361
|
+
case 2:
|
|
362
|
+
_a.sent();
|
|
363
|
+
return [2 /*return*/];
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}); };
|
|
165
367
|
exports.editPass = editPass;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
368
|
+
var readPassEnvVars = function (path) { return __awaiter(void 0, void 0, void 0, function () {
|
|
369
|
+
var yamlstring;
|
|
370
|
+
return __generator(this, function (_a) {
|
|
371
|
+
switch (_a.label) {
|
|
372
|
+
case 0: return [4 /*yield*/, (0, exports.readPass)(path)];
|
|
373
|
+
case 1:
|
|
374
|
+
yamlstring = _a.sent();
|
|
375
|
+
// if a value is an object, we convert it to strings
|
|
376
|
+
return [2 /*return*/, (0, formatEnvVars_1["default"])(js_yaml_1["default"].load(yamlstring))];
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
}); };
|
|
172
380
|
exports.readPassEnvVars = readPassEnvVars;
|
|
173
381
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/passwordstore/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/passwordstore/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAoD;AACpD,kFAAmD;AACnD,gDAA0B;AAE1B,qCAA+C;AAC/C,oDAA2B;AAC3B,2CAAuC;AACvC,mEAA6C;AAC7C,2DAAqC;AACrC,8CAA6E;AAE7E,IAAM,KAAK,GAAG,KAAK,CAAC;AAEpB,IAAM,eAAe,GAAG;;;;;gBACtB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAClB,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;gBACvD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACZ,OAAO,GAAG,IAAA,6BAAK,EAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE;oBAC/C,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC;iBACtC,CAAC,CAAC;gBACC,OAAO,GAAG,IAAI,CAAC;gBACnB,OAAO,CAAC,YA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