@catladder/cli 1.164.0 → 1.165.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/dist/bundles/catci/index.js +2 -2
- package/dist/bundles/catenv/index.js +3 -3
- package/dist/bundles/cli/index.js +23 -18
- package/dist/cli/src/apps/catci/catci.js +19 -91
- package/dist/cli/src/apps/catci/catci.js.map +1 -1
- package/dist/cli/src/apps/catci/commands/security/auditDocument.js +73 -79
- package/dist/cli/src/apps/catci/commands/security/auditDocument.js.map +1 -1
- package/dist/cli/src/apps/catci/commands/security/commands.js +94 -169
- package/dist/cli/src/apps/catci/commands/security/commands.js.map +1 -1
- package/dist/cli/src/apps/catci/commands/security/createSecurityAuditMergeRequest.js +42 -102
- package/dist/cli/src/apps/catci/commands/security/createSecurityAuditMergeRequest.js.map +1 -1
- package/dist/cli/src/apps/catci/commands/security/evaluateSecurityAudit.js +19 -67
- package/dist/cli/src/apps/catci/commands/security/evaluateSecurityAudit.js.map +1 -1
- package/dist/cli/src/apps/catenv/catenv.js +18 -64
- package/dist/cli/src/apps/catenv/catenv.js.map +1 -1
- package/dist/cli/src/apps/catenv/printVariables.js +36 -123
- package/dist/cli/src/apps/catenv/printVariables.js.map +1 -1
- package/dist/cli/src/apps/catenv/utils.js +26 -112
- package/dist/cli/src/apps/catenv/utils.js.map +1 -1
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js +28 -132
- package/dist/cli/src/apps/catenv/writeDotEnvFiles.js.map +1 -1
- package/dist/cli/src/apps/catenv/writeEnvDTs.js +49 -150
- package/dist/cli/src/apps/catenv/writeEnvDTs.js.map +1 -1
- package/dist/cli/src/apps/cli/cli.js +31 -76
- package/dist/cli/src/apps/cli/cli.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/cloudSQL/commandRestoreDb.js +106 -180
- package/dist/cli/src/apps/cli/commands/cloudSQL/commandRestoreDb.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/cloudSQL/index.js +4 -43
- package/dist/cli/src/apps/cli/commands/cloudSQL/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/general/index.js +67 -191
- package/dist/cli/src/apps/cli/commands/general/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/general/namespaceAutoCompletion.js +4 -49
- package/dist/cli/src/apps/cli/commands/general/namespaceAutoCompletion.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/general/portForward.js +36 -93
- package/dist/cli/src/apps/cli/commands/general/portForward.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/index.js +8 -47
- package/dist/cli/src/apps/cli/commands/mongodb/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoDestroyMember.js +86 -183
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoDestroyMember.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoGetShell.js +30 -90
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoGetShell.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoPortForward.js +50 -114
- package/dist/cli/src/apps/cli/commands/mongodb/projectMongoPortForward.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/mongodb/utils/index.js +58 -192
- package/dist/cli/src/apps/cli/commands/mongodb/utils/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js +118 -197
- package/dist/cli/src/apps/cli/commands/project/cloudSql/commandProjectRestoreDb.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js +81 -160
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.js +134 -397
- package/dist/cli/src/apps/cli/commands/project/commandConfigSecrets.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandDeletePods.js +40 -140
- package/dist/cli/src/apps/cli/commands/project/commandDeletePods.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandDeleteProject.js +23 -92
- package/dist/cli/src/apps/cli/commands/project/commandDeleteProject.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandEnvVars.js +10 -71
- package/dist/cli/src/apps/cli/commands/project/commandEnvVars.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandGetMyTotalWorktime.js +7 -54
- package/dist/cli/src/apps/cli/commands/project/commandGetMyTotalWorktime.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandGetShell.js +27 -89
- package/dist/cli/src/apps/cli/commands/project/commandGetShell.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandGitlabCi.js +65 -180
- package/dist/cli/src/apps/cli/commands/project/commandGitlabCi.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandListPods.js +13 -72
- package/dist/cli/src/apps/cli/commands/project/commandListPods.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandMigrateHelm3.js +38 -104
- package/dist/cli/src/apps/cli/commands/project/commandMigrateHelm3.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandNamespace.js +8 -67
- package/dist/cli/src/apps/cli/commands/project/commandNamespace.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenCostDashboard.js +16 -77
- package/dist/cli/src/apps/cli/commands/project/commandOpenCostDashboard.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenDashboard.js +18 -81
- package/dist/cli/src/apps/cli/commands/project/commandOpenDashboard.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenEnv.js +14 -74
- package/dist/cli/src/apps/cli/commands/project/commandOpenEnv.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenGit.js +6 -53
- package/dist/cli/src/apps/cli/commands/project/commandOpenGit.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenGrafana.js +16 -77
- package/dist/cli/src/apps/cli/commands/project/commandOpenGrafana.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenGrafanaPod.js +28 -93
- package/dist/cli/src/apps/cli/commands/project/commandOpenGrafanaPod.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandOpenLogs.js +11 -71
- package/dist/cli/src/apps/cli/commands/project/commandOpenLogs.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandPauseProject.js +23 -92
- package/dist/cli/src/apps/cli/commands/project/commandPauseProject.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandPortForward.js +71 -163
- package/dist/cli/src/apps/cli/commands/project/commandPortForward.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.js +6 -55
- package/dist/cli/src/apps/cli/commands/project/commandRenewToken.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandSecretsClearBackups.js +17 -112
- package/dist/cli/src/apps/cli/commands/project/commandSecretsClearBackups.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandSecurityEvaluate.js +15 -66
- package/dist/cli/src/apps/cli/commands/project/commandSecurityEvaluate.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandSetup.js +6 -55
- package/dist/cli/src/apps/cli/commands/project/commandSetup.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandTriggerCronjob.js +47 -135
- package/dist/cli/src/apps/cli/commands/project/commandTriggerCronjob.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/index.js +54 -93
- package/dist/cli/src/apps/cli/commands/project/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/index.js +39 -127
- package/dist/cli/src/apps/cli/commands/project/setup/index.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupAccessTokens.js +35 -100
- package/dist/cli/src/apps/cli/commands/project/setup/setupAccessTokens.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js +52 -129
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js +19 -68
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js +106 -147
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupTopic.js +7 -80
- package/dist/cli/src/apps/cli/commands/project/setup/setupTopic.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/autocompletions.js +16 -105
- package/dist/cli/src/apps/cli/commands/project/utils/autocompletions.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.js +28 -79
- package/dist/cli/src/apps/cli/commands/project/utils/ensureCluster.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js +32 -89
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/showProjectBanner.js +9 -53
- package/dist/cli/src/apps/cli/commands/project/utils/showProjectBanner.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/theStuffThatReallyMatters/index.js +26 -92
- package/dist/cli/src/apps/cli/commands/theStuffThatReallyMatters/index.js.map +1 -1
- package/dist/cli/src/apps/cli/utils/getGoogleAuthUserNumber.js +13 -62
- package/dist/cli/src/apps/cli/utils/getGoogleAuthUserNumber.js.map +1 -1
- package/dist/cli/src/apps/cli/verify/index.js +10 -62
- package/dist/cli/src/apps/cli/verify/index.js.map +1 -1
- package/dist/cli/src/catci.js +1 -1
- package/dist/cli/src/catci.js.map +1 -1
- package/dist/cli/src/catenv.js +8 -8
- package/dist/cli/src/catenv.js.map +1 -1
- package/dist/cli/src/cli.js +1 -1
- package/dist/cli/src/cli.js.map +1 -1
- package/dist/cli/src/config/getProjectConfig.js +118 -278
- package/dist/cli/src/config/getProjectConfig.js.map +1 -1
- package/dist/cli/src/config/parseChoice.js +3 -19
- package/dist/cli/src/config/parseChoice.js.map +1 -1
- package/dist/cli/src/gcloud/artifactsRegistry.js +10 -54
- package/dist/cli/src/gcloud/artifactsRegistry.js.map +1 -1
- package/dist/cli/src/gcloud/cloudRun/getCloudRunDomainSuffix.js +21 -60
- package/dist/cli/src/gcloud/cloudRun/getCloudRunDomainSuffix.js.map +1 -1
- package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js +12 -57
- package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js.map +1 -1
- package/dist/cli/src/gcloud/cloudSql/copyDb.js +30 -56
- package/dist/cli/src/gcloud/cloudSql/copyDb.js.map +1 -1
- package/dist/cli/src/gcloud/cloudSql/startProxy.js +41 -123
- package/dist/cli/src/gcloud/cloudSql/startProxy.js.map +1 -1
- package/dist/cli/src/gcloud/enableServices.js +6 -82
- package/dist/cli/src/gcloud/enableServices.js.map +1 -1
- package/dist/cli/src/gcloud/openDashboard.js +12 -95
- package/dist/cli/src/gcloud/openDashboard.js.map +1 -1
- package/dist/cli/src/gcloud/serviceAccounts.js +63 -186
- package/dist/cli/src/gcloud/serviceAccounts.js.map +1 -1
- package/dist/cli/src/k8sApi/index.js +9 -9
- package/dist/cli/src/k8sApi/index.js.map +1 -1
- package/dist/cli/src/kubernetes/index.js +20 -81
- package/dist/cli/src/kubernetes/index.js.map +1 -1
- package/dist/cli/src/kubernetes/openKubernetesDashboards.js +32 -86
- package/dist/cli/src/kubernetes/openKubernetesDashboards.js.map +1 -1
- package/dist/cli/src/kubernetes/portForward.js +5 -50
- package/dist/cli/src/kubernetes/portForward.js.map +1 -1
- package/dist/cli/src/packageInfos.js +2 -2
- package/dist/cli/src/packageInfos.js.map +1 -1
- package/dist/cli/src/utils/boxWithAscii.js +6 -6
- package/dist/cli/src/utils/boxWithAscii.js.map +1 -1
- package/dist/cli/src/utils/cluster.js +8 -61
- package/dist/cli/src/utils/cluster.js.map +1 -1
- package/dist/cli/src/utils/editAsFile.js +21 -75
- package/dist/cli/src/utils/editAsFile.js.map +1 -1
- package/dist/cli/src/utils/files.js +11 -57
- package/dist/cli/src/utils/files.js.map +1 -1
- package/dist/cli/src/utils/getEditor.js +15 -71
- package/dist/cli/src/utils/getEditor.js.map +1 -1
- package/dist/cli/src/utils/gitlab.js +176 -466
- package/dist/cli/src/utils/gitlab.js.map +1 -1
- package/dist/cli/src/utils/log.js +2 -2
- package/dist/cli/src/utils/log.js.map +1 -1
- package/dist/cli/src/utils/portForwards.js +32 -120
- package/dist/cli/src/utils/portForwards.js.map +1 -1
- package/dist/cli/src/utils/preferences/index.js +27 -108
- package/dist/cli/src/utils/preferences/index.js.map +1 -1
- package/dist/cli/src/utils/projects/index.js +28 -116
- package/dist/cli/src/utils/projects/index.js.map +1 -1
- package/dist/cli/src/utils/promise.js +4 -55
- package/dist/cli/src/utils/promise.js.map +1 -1
- package/dist/cli/src/utils/shell.js +19 -75
- package/dist/cli/src/utils/shell.js.map +1 -1
- package/dist/pipeline/src/bash/BashExpression.js +20 -52
- package/dist/pipeline/src/bash/BashExpression.js.map +1 -1
- package/dist/pipeline/src/bash/bashExpressionPerPipelineType.js +1 -1
- package/dist/pipeline/src/bash/bashExpressionPerPipelineType.js.map +1 -1
- package/dist/pipeline/src/bash/bashYaml.js +13 -10
- package/dist/pipeline/src/bash/bashYaml.js.map +1 -1
- package/dist/pipeline/src/bash/getInjectVarsScript.js +5 -27
- package/dist/pipeline/src/bash/getInjectVarsScript.js.map +1 -1
- package/dist/pipeline/src/bash/replaceAsync.js +29 -79
- package/dist/pipeline/src/bash/replaceAsync.js.map +1 -1
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js +29 -60
- package/dist/pipeline/src/build/artifacts/createBuildJobArtifact.js.map +1 -1
- package/dist/pipeline/src/build/base/createAppBuildJob.js +40 -72
- package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/pipeline/src/build/base/createArtifactsConfig.js +11 -40
- package/dist/pipeline/src/build/base/createArtifactsConfig.js.map +1 -1
- package/dist/pipeline/src/build/base/index.js +36 -62
- package/dist/pipeline/src/build/base/index.js.map +1 -1
- package/dist/pipeline/src/build/base/writeBuildInfo.js +2 -2
- package/dist/pipeline/src/build/base/writeBuildInfo.js.map +1 -1
- package/dist/pipeline/src/build/base/writeDotEnv.js +13 -36
- package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
- package/dist/pipeline/src/build/custom/buildJob.js +8 -33
- package/dist/pipeline/src/build/custom/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/custom/index.js +4 -29
- package/dist/pipeline/src/build/custom/index.js.map +1 -1
- package/dist/pipeline/src/build/custom/testJob.js +41 -50
- package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
- package/dist/pipeline/src/build/docker.js +72 -104
- package/dist/pipeline/src/build/docker.js.map +1 -1
- package/dist/pipeline/src/build/index.js +17 -17
- package/dist/pipeline/src/build/index.js.map +1 -1
- package/dist/pipeline/src/build/node/buildJob.js +24 -45
- package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/node/cache.js +31 -54
- package/dist/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/pipeline/src/build/node/index.js +9 -34
- package/dist/pipeline/src/build/node/index.js.map +1 -1
- package/dist/pipeline/src/build/node/meteor.js +16 -40
- package/dist/pipeline/src/build/node/meteor.js.map +1 -1
- package/dist/pipeline/src/build/node/testJob.js +69 -66
- package/dist/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/pipeline/src/build/node/yarn.js +35 -51
- package/dist/pipeline/src/build/node/yarn.js.map +1 -1
- package/dist/pipeline/src/build/rails/build.js +22 -57
- package/dist/pipeline/src/build/rails/build.js.map +1 -1
- package/dist/pipeline/src/build/rails/index.js +4 -29
- package/dist/pipeline/src/build/rails/index.js.map +1 -1
- package/dist/pipeline/src/build/rails/test.js +60 -66
- package/dist/pipeline/src/build/rails/test.js.map +1 -1
- package/dist/pipeline/src/build/sbom.js +12 -12
- package/dist/pipeline/src/build/sbom.js.map +1 -1
- package/dist/pipeline/src/build/types.js +2 -6
- package/dist/pipeline/src/build/types.js.map +1 -1
- package/dist/pipeline/src/config/configruedEnvs.js +18 -47
- package/dist/pipeline/src/config/configruedEnvs.js.map +1 -1
- package/dist/pipeline/src/config/readConfig.js +26 -101
- package/dist/pipeline/src/config/readConfig.js.map +1 -1
- package/dist/pipeline/src/context/createAllComponentsContext.js +16 -63
- package/dist/pipeline/src/context/createAllComponentsContext.js.map +1 -1
- package/dist/pipeline/src/context/createComponentContext.js +93 -170
- package/dist/pipeline/src/context/createComponentContext.js.map +1 -1
- package/dist/pipeline/src/context/createWorkspaceContext.js +30 -80
- package/dist/pipeline/src/context/createWorkspaceContext.js.map +1 -1
- package/dist/pipeline/src/context/getBuildInfoVariables.js +12 -31
- package/dist/pipeline/src/context/getBuildInfoVariables.js.map +1 -1
- package/dist/pipeline/src/context/getEnvConfig.js +4 -4
- package/dist/pipeline/src/context/getEnvConfig.js.map +1 -1
- package/dist/pipeline/src/context/getEnvType.js +2 -2
- package/dist/pipeline/src/context/getEnvType.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironment.js +17 -64
- package/dist/pipeline/src/context/getEnvironment.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentContext.js +21 -22
- package/dist/pipeline/src/context/getEnvironmentContext.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.js +109 -169
- package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/pipeline/src/context/getLabels.js +12 -15
- package/dist/pipeline/src/context/getLabels.js.map +1 -1
- package/dist/pipeline/src/context/getReviewSlug.js +7 -7
- package/dist/pipeline/src/context/getReviewSlug.js.map +1 -1
- package/dist/pipeline/src/context/resolveReferences.js +51 -172
- package/dist/pipeline/src/context/resolveReferences.js.map +1 -1
- package/dist/pipeline/src/context/transformJobOnlyVars.js +22 -69
- package/dist/pipeline/src/context/transformJobOnlyVars.js.map +1 -1
- package/dist/pipeline/src/context/utils/envVars.js +13 -39
- package/dist/pipeline/src/context/utils/envVars.js.map +1 -1
- package/dist/pipeline/src/deploy/base/deploy.js +60 -82
- package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
- package/dist/pipeline/src/deploy/base/index.js +11 -34
- package/dist/pipeline/src/deploy/base/index.js.map +1 -1
- package/dist/pipeline/src/deploy/base/rollback.js +11 -15
- package/dist/pipeline/src/deploy/base/rollback.js.map +1 -1
- package/dist/pipeline/src/deploy/base/stop.js +11 -15
- package/dist/pipeline/src/deploy/base/stop.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js +41 -64
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/cleanup.js +8 -33
- package/dist/pipeline/src/deploy/cloudRun/cleanup.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js +25 -30
- package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js +92 -136
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js +44 -61
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js +25 -53
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +36 -47
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js +22 -39
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js +27 -33
- package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/volumes.js +7 -34
- package/dist/pipeline/src/deploy/cloudRun/createJobs/volumes.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/index.js +38 -75
- package/dist/pipeline/src/deploy/cloudRun/index.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/createArgsString.js +14 -42
- package/dist/pipeline/src/deploy/cloudRun/utils/createArgsString.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/database.js +14 -30
- package/dist/pipeline/src/deploy/cloudRun/utils/database.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +5 -5
- package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.js +1 -3
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/jobName.js +1 -3
- package/dist/pipeline/src/deploy/cloudRun/utils/jobName.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.js +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudSql/utils.js +4 -4
- package/dist/pipeline/src/deploy/cloudSql/utils.js.map +1 -1
- package/dist/pipeline/src/deploy/custom/deployJob.js +18 -37
- package/dist/pipeline/src/deploy/custom/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/custom/index.js +4 -4
- package/dist/pipeline/src/deploy/custom/index.js.map +1 -1
- package/dist/pipeline/src/deploy/dockerTag/deployJob.js +16 -48
- package/dist/pipeline/src/deploy/dockerTag/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/dockerTag/index.js +4 -4
- package/dist/pipeline/src/deploy/dockerTag/index.js.map +1 -1
- package/dist/pipeline/src/deploy/index.js +4 -4
- package/dist/pipeline/src/deploy/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/additionalSecretKeys.js +6 -7
- package/dist/pipeline/src/deploy/kubernetes/additionalSecretKeys.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js +13 -13
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js +64 -72
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/index.js +21 -47
- package/dist/pipeline/src/deploy/kubernetes/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js +13 -36
- package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js +23 -60
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/mongodb.js +38 -48
- package/dist/pipeline/src/deploy/kubernetes/mongodb.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js +15 -17
- package/dist/pipeline/src/deploy/kubernetes/processSecretsAsFiles.js.map +1 -1
- package/dist/pipeline/src/deploy/sbom.js +9 -11
- package/dist/pipeline/src/deploy/sbom.js.map +1 -1
- package/dist/pipeline/src/deploy/types/index.js +1 -5
- package/dist/pipeline/src/deploy/types/index.js.map +1 -1
- package/dist/pipeline/src/deploy/utils.js +7 -7
- package/dist/pipeline/src/deploy/utils.js.map +1 -1
- package/dist/pipeline/src/packageInfos.js +2 -2
- package/dist/pipeline/src/packageInfos.js.map +1 -1
- package/dist/pipeline/src/pipeline/createAllJobs.js +39 -132
- package/dist/pipeline/src/pipeline/createAllJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/createChildPipeline.js +24 -71
- package/dist/pipeline/src/pipeline/createChildPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.js +18 -62
- package/dist/pipeline/src/pipeline/createJobsForComponent.js.map +1 -1
- package/dist/pipeline/src/pipeline/createJobsForWorkspace.js +3 -3
- package/dist/pipeline/src/pipeline/createJobsForWorkspace.js.map +1 -1
- package/dist/pipeline/src/pipeline/createMainPipeline.js +57 -141
- package/dist/pipeline/src/pipeline/createMainPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js +43 -137
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js.map +1 -1
- package/dist/pipeline/src/pipeline/getPipelineStages.js +8 -31
- package/dist/pipeline/src/pipeline/getPipelineStages.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js +150 -216
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/createGitlabPipeline.js +14 -26
- package/dist/pipeline/src/pipeline/gitlab/createGitlabPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.js +11 -11
- package/dist/pipeline/src/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.js +8 -9
- package/dist/pipeline/src/pipeline/gitlab/gitlabReleaseJobs.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/sortGitLabJobDefProps.js +11 -20
- package/dist/pipeline/src/pipeline/gitlab/sortGitLabJobDefProps.js.map +1 -1
- package/dist/pipeline/src/pipeline/packageManager.js +59 -133
- package/dist/pipeline/src/pipeline/packageManager.js.map +1 -1
- package/dist/pipeline/src/pipeline/yarn/yarnUtils.js +30 -120
- package/dist/pipeline/src/pipeline/yarn/yarnUtils.js.map +1 -1
- package/dist/pipeline/src/runner/index.js +2 -4
- package/dist/pipeline/src/runner/index.js.map +1 -1
- package/dist/pipeline/src/types/config.js +4 -28
- package/dist/pipeline/src/types/config.js.map +1 -1
- package/dist/pipeline/src/types/context.js +2 -2
- package/dist/pipeline/src/types/context.js.map +1 -1
- package/dist/pipeline/src/utils/gitlab.js +19 -42
- package/dist/pipeline/src/utils/gitlab.js.map +1 -1
- package/dist/pipeline/src/utils/index.js +6 -34
- package/dist/pipeline/src/utils/index.js.map +1 -1
- package/dist/pipeline/src/utils/jsonParse.js +2 -2
- package/dist/pipeline/src/utils/jsonParse.js.map +1 -1
- package/dist/pipeline/src/utils/removeUndefined.js +1 -22
- package/dist/pipeline/src/utils/removeUndefined.js.map +1 -1
- package/dist/pipeline/src/utils/writeFiles.js +17 -68
- package/dist/pipeline/src/utils/writeFiles.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/tsconfig.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../../../../../src/apps/catci/commands/security/commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../../../../../src/apps/catci/commands/security/commands.ts"],"names":[],"mappings":";;AACA,mEAGiC;AACjC,0CAAyC;AACzC,uFAG2C;AAC3C,iDAAqD;AAErD,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAE5C,mBAAyB,MAAc;IACrC,YAAY,CAAC,MAAM,CAAC,CAAC;IACrB,eAAe,CAAC,MAAM,CAAC,CAAC;IACxB,aAAa,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAJD,4BAIC;AAID,SAAS,gBAAgB,CACvB,IAA8D;IAE9D,OAAO,KAAK,EAAE,IAAiB,EAAE,EAAE;QACjC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,MAAc;IACxC,MAAM;SACH,OAAO,CACN,wEAAwE,EACxE;;8DAEwD,0DAAwB;;;;;CAKrF,CACI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AAG,MAAM,IAAA,iEAA+B,EAAC;YACnD,GAAG;YACH,UAAU;YACV,SAAS;YACT,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC;SACzB,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;YACnB,OAAO,CAAC,KAAK,CACX,kDAAkD,MAAM,CAAC,KAAK,EAAE,CACjE,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,mDAAmD,CAAC,CAAC;YACjE,OAAO,CAAC,GAAG,CACT,0DAA0D,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CACjF,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CACH,CAAC;AACN,CAAC"}
|
|
@@ -1,112 +1,52 @@
|
|
|
1
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 (g && (g = 0, op[0] && (_ = 0)), _) 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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
3
|
exports.createSecurityAuditMergeRequest = exports.SECURITY_AUDIT_FILE_NAME = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
4
|
+
const ts_results_es_1 = require("ts-results-es");
|
|
5
|
+
const auditDocument_1 = require("./auditDocument");
|
|
42
6
|
function makeDatedBranchName(branchName) {
|
|
43
|
-
|
|
44
|
-
return
|
|
7
|
+
const date = new Date().toISOString().slice(0, -5).replaceAll(/[:.T]/g, "-");
|
|
8
|
+
return `${branchName}-${date}`;
|
|
45
9
|
}
|
|
46
|
-
|
|
10
|
+
const MR_TITLE = "Draft: chore(security): add security audit document";
|
|
47
11
|
exports.SECURITY_AUDIT_FILE_NAME = "SECURITY.md";
|
|
48
|
-
function createSecurityAuditMergeRequest(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
existingMr = mrs.value[0];
|
|
66
|
-
if (existingMr)
|
|
67
|
-
return [2 /*return*/, (0, ts_results_es_1.Err)("open merge request with security audit already exists: ".concat(existingMr.web_url))];
|
|
68
|
-
auditTemplate = ts_results_es_1.Result.wrap(function () { return (0, auditDocument_1.makeTemplate)(); }).mapErr(function () { return "could not make security audit template document"; });
|
|
69
|
-
if (auditTemplate.isErr())
|
|
70
|
-
return [2 /*return*/, auditTemplate];
|
|
71
|
-
return [4 /*yield*/, ts_results_es_1.Result.wrapAsync(function () {
|
|
72
|
-
return api.Branches.create(projectId, makeDatedBranchName("chore/security-audit"), mainBranch);
|
|
73
|
-
})];
|
|
74
|
-
case 2:
|
|
75
|
-
branch = (_c.sent()).mapErr(function (e) {
|
|
76
|
-
console.log(e);
|
|
77
|
-
return "could not create branch";
|
|
78
|
-
});
|
|
79
|
-
if (branch.isErr())
|
|
80
|
-
return [2 /*return*/, branch];
|
|
81
|
-
return [4 /*yield*/, ts_results_es_1.Result.wrapAsync(function () {
|
|
82
|
-
return api.Commits.create(projectId, branch.value.name, "chore(security): add empty security audit document template", [
|
|
83
|
-
{
|
|
84
|
-
action: "create",
|
|
85
|
-
filePath: exports.SECURITY_AUDIT_FILE_NAME,
|
|
86
|
-
content: auditTemplate.value,
|
|
87
|
-
encoding: "text",
|
|
88
|
-
},
|
|
89
|
-
]);
|
|
90
|
-
})];
|
|
91
|
-
case 3:
|
|
92
|
-
commit = (_c.sent()).mapErr(function () { return "could not create commit"; });
|
|
93
|
-
if (commit.isErr())
|
|
94
|
-
return [2 /*return*/, commit];
|
|
95
|
-
return [4 /*yield*/, ts_results_es_1.Result.wrapAsync(function () {
|
|
96
|
-
return api.MergeRequests.create(projectId, branch.value.name, mainBranch, MR_TITLE, {
|
|
97
|
-
description: "Please follow and update security audit document in `".concat(exports.SECURITY_AUDIT_FILE_NAME, "`."),
|
|
98
|
-
assigneeId: userId,
|
|
99
|
-
squash: true,
|
|
100
|
-
labels: "security-audit",
|
|
101
|
-
removeSourceBranch: true,
|
|
102
|
-
});
|
|
103
|
-
})];
|
|
104
|
-
case 4:
|
|
105
|
-
mr = (_c.sent()).mapErr(function () { return "could not create merge request"; });
|
|
106
|
-
return [2 /*return*/, mr];
|
|
107
|
-
}
|
|
108
|
-
});
|
|
12
|
+
async function createSecurityAuditMergeRequest({ projectId, mainBranch, userId, api, }) {
|
|
13
|
+
const mrs = (await ts_results_es_1.Result.wrapAsync(() => api.MergeRequests.all({
|
|
14
|
+
state: "opened",
|
|
15
|
+
wip: "yes",
|
|
16
|
+
labels: "security-audit",
|
|
17
|
+
}))).mapErr(() => `could not search for existing merge requests`);
|
|
18
|
+
if (mrs.isErr())
|
|
19
|
+
return mrs;
|
|
20
|
+
const existingMr = mrs.value[0];
|
|
21
|
+
if (existingMr)
|
|
22
|
+
return (0, ts_results_es_1.Err)(`open merge request with security audit already exists: ${existingMr.web_url}`);
|
|
23
|
+
const auditTemplate = ts_results_es_1.Result.wrap(() => (0, auditDocument_1.makeTemplate)()).mapErr(() => "could not make security audit template document");
|
|
24
|
+
if (auditTemplate.isErr())
|
|
25
|
+
return auditTemplate;
|
|
26
|
+
const branch = (await ts_results_es_1.Result.wrapAsync(() => api.Branches.create(projectId, makeDatedBranchName("chore/security-audit"), mainBranch))).mapErr((e) => {
|
|
27
|
+
console.log(e);
|
|
28
|
+
return "could not create branch";
|
|
109
29
|
});
|
|
30
|
+
if (branch.isErr())
|
|
31
|
+
return branch;
|
|
32
|
+
const commit = (await ts_results_es_1.Result.wrapAsync(() => api.Commits.create(projectId, branch.value.name, "chore(security): add empty security audit document template", [
|
|
33
|
+
{
|
|
34
|
+
action: "create",
|
|
35
|
+
filePath: exports.SECURITY_AUDIT_FILE_NAME,
|
|
36
|
+
content: auditTemplate.value,
|
|
37
|
+
encoding: "text",
|
|
38
|
+
},
|
|
39
|
+
]))).mapErr(() => "could not create commit");
|
|
40
|
+
if (commit.isErr())
|
|
41
|
+
return commit;
|
|
42
|
+
const mr = (await ts_results_es_1.Result.wrapAsync(() => api.MergeRequests.create(projectId, branch.value.name, mainBranch, MR_TITLE, {
|
|
43
|
+
description: `Please follow and update security audit document in \`${exports.SECURITY_AUDIT_FILE_NAME}\`.`,
|
|
44
|
+
assigneeId: userId,
|
|
45
|
+
squash: true,
|
|
46
|
+
labels: "security-audit",
|
|
47
|
+
removeSourceBranch: true,
|
|
48
|
+
}))).mapErr(() => "could not create merge request");
|
|
49
|
+
return mr;
|
|
110
50
|
}
|
|
111
51
|
exports.createSecurityAuditMergeRequest = createSecurityAuditMergeRequest;
|
|
112
52
|
//# sourceMappingURL=createSecurityAuditMergeRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSecurityAuditMergeRequest.js","sourceRoot":"","sources":["../../../../../../../src/apps/catci/commands/security/createSecurityAuditMergeRequest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createSecurityAuditMergeRequest.js","sourceRoot":"","sources":["../../../../../../../src/apps/catci/commands/security/createSecurityAuditMergeRequest.ts"],"names":[],"mappings":";;;AACA,iDAA4C;AAC5C,mDAA+C;AAE/C,SAAS,mBAAmB,CAAC,UAAkB;IAC7C,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,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O,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACf,OAAO,yBAAkC,CAAC;IAC5C,CAAC,CAAC,CAAC;IACH,IAAI,MAAM,CAAC,KAAK,EAAE;QAAE,OAAO,MAAM,CAAC;IAElC,MAAM,MAAM,GAAG,CACb,MAAM,sBAAM,CAAC,SAAS,CAAC,GAAG,EAAE,CAC1B,GAAG,CAAC,OAAO,CAAC,MAAM,CAChB,SAAS,EACT,MAAM,CAAC,KAAK,CAAC,IAAI,EACjB,6DAA6D,EAC7D;QACE;YACE,MAAM,EAAE,QAAQ;YAChB,QAAQ,EAAE,gCAAwB;YAClC,OAAO,EAAE,aAAa,CAAC,KAAK;YAC5B,QAAQ,EAAE,MAAM;SACjB;KACF,CACF,CACF,CACF,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,yBAAkC,CAAC,CAAC;IACnD,IAAI,MAAM,CAAC,KAAK,EAAE;QAAE,OAAO,MAAM,CAAC;IAElC,MAAM,EAAE,GAAG,CACT,MAAM,sBAAM,CAAC,SAAS,CAAC,GAAG,EAAE,CAC1B,GAAG,CAAC,aAAa,CAAC,MAAM,CACtB,SAAS,EACT,MAAM,CAAC,KAAK,CAAC,IAAI,EACjB,UAAU,EACV,QAAQ,EACR;QACE,WAAW,EAAE,yDAAyD,gCAAwB,KAAK;QACnG,UAAU,EAAE,MAAM;QAClB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,gBAAgB;QACxB,kBAAkB,EAAE,IAAI;KACzB,CACF,CACF,CACF,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,gCAAyC,CAAC,CAAC;IAE1D,OAAO,EAAE,CAAC;AACZ,CAAC;AArFD,0EAqFC"}
|
|
@@ -1,76 +1,28 @@
|
|
|
1
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 (g && (g = 0, op[0] && (_ = 0)), _) 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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
3
|
exports.makeSecurityAuditOverview = exports.evaluateSecurityAudit = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
function evaluateSecurityAudit(
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var filePath, docData, doc;
|
|
53
|
-
return __generator(this, function (_a) {
|
|
54
|
-
switch (_a.label) {
|
|
55
|
-
case 0:
|
|
56
|
-
filePath = (0, path_1.join)(path, createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME);
|
|
57
|
-
return [4 /*yield*/, (0, promises_1.readFile)(filePath)];
|
|
58
|
-
case 1:
|
|
59
|
-
docData = _a.sent();
|
|
60
|
-
doc = docData.toString("utf-8");
|
|
61
|
-
return [2 /*return*/, (0, auditDocument_1.evaluateDocument)(doc)];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}); })];
|
|
65
|
-
case 1: return [2 /*return*/, (_c.sent()).mapErr(function (e) { return "could not evaluate ".concat(createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME, ": ").concat(e); })];
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
});
|
|
4
|
+
const ts_results_es_1 = require("ts-results-es");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const promises_1 = require("fs/promises");
|
|
7
|
+
const createSecurityAuditMergeRequest_1 = require("./createSecurityAuditMergeRequest");
|
|
8
|
+
const auditDocument_1 = require("./auditDocument");
|
|
9
|
+
async function evaluateSecurityAudit({ path }) {
|
|
10
|
+
return (await ts_results_es_1.Result.wrapAsync(async () => {
|
|
11
|
+
const filePath = (0, path_1.join)(path, createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME);
|
|
12
|
+
const docData = await (0, promises_1.readFile)(filePath);
|
|
13
|
+
const doc = docData.toString("utf-8");
|
|
14
|
+
return (0, auditDocument_1.evaluateDocument)(doc);
|
|
15
|
+
})).mapErr((e) => `could not evaluate ${createSecurityAuditMergeRequest_1.SECURITY_AUDIT_FILE_NAME}: ${e}`);
|
|
69
16
|
}
|
|
70
17
|
exports.evaluateSecurityAudit = evaluateSecurityAudit;
|
|
71
18
|
function makeSecurityAuditOverview(evaluation) {
|
|
72
|
-
|
|
73
|
-
return
|
|
19
|
+
const ratingToEmo = (r) => (r < 33 ? "🟥" : r < 66 ? "🟨" : "🟩");
|
|
20
|
+
return `Project security posture overview:
|
|
21
|
+
🧐 Total topics: ${evaluation.score.totalTopics}
|
|
22
|
+
🔒 Secured topics: ${evaluation.score.securedTopics}
|
|
23
|
+
📢 Answered topics: ${evaluation.score.answeredTopics}
|
|
24
|
+
❔ Unknown topics: ${evaluation.score.unknownTopics}
|
|
25
|
+
📊 Rating: ${ratingToEmo(evaluation.score.rating)} ${evaluation.score.rating}/100`;
|
|
74
26
|
}
|
|
75
27
|
exports.makeSecurityAuditOverview = makeSecurityAuditOverview;
|
|
76
28
|
//# sourceMappingURL=evaluateSecurityAudit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluateSecurityAudit.js","sourceRoot":"","sources":["../../../../../../../src/apps/catci/commands/security/evaluateSecurityAudit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evaluateSecurityAudit.js","sourceRoot":"","sources":["../../../../../../../src/apps/catci/commands/security/evaluateSecurityAudit.ts"],"names":[],"mappings":";;;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|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 (g && (g = 0, op[0] && (_ = 0)), _) 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 };
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const getProjectConfig_1 = require("../../config/getProjectConfig");
|
|
4
|
+
const printVariables_1 = require("./printVariables");
|
|
5
|
+
const writeDotEnvFiles_1 = require("./writeDotEnvFiles");
|
|
6
|
+
const writeEnvDTs_1 = require("./writeEnvDTs");
|
|
7
|
+
const pipeline_1 = require("../../../../pipeline/src/index.js");
|
|
8
|
+
exports.default = async (choice) => {
|
|
9
|
+
const config = await (0, getProjectConfig_1.getProjectConfig)();
|
|
10
|
+
if (!config) {
|
|
11
|
+
return;
|
|
36
12
|
}
|
|
13
|
+
await Promise.all([
|
|
14
|
+
config.pipelineType
|
|
15
|
+
? (0, pipeline_1.generatePipelineFiles)(config, config.pipelineType, "local")
|
|
16
|
+
: undefined,
|
|
17
|
+
(0, writeDotEnvFiles_1.writeDotEnvFiles)(config, choice),
|
|
18
|
+
(0, writeEnvDTs_1.writeDTsFiles)(config, choice),
|
|
19
|
+
(0, printVariables_1.printVariables)(config, choice),
|
|
20
|
+
]);
|
|
37
21
|
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var getProjectConfig_1 = require("../../config/getProjectConfig");
|
|
40
|
-
var printVariables_1 = require("./printVariables");
|
|
41
|
-
var writeDotEnvFiles_1 = require("./writeDotEnvFiles");
|
|
42
|
-
var writeEnvDTs_1 = require("./writeEnvDTs");
|
|
43
|
-
var pipeline_1 = require("../../../../pipeline/src/index.js");
|
|
44
|
-
exports.default = (function (choice) { return __awaiter(void 0, void 0, void 0, function () {
|
|
45
|
-
var config;
|
|
46
|
-
return __generator(this, function (_a) {
|
|
47
|
-
switch (_a.label) {
|
|
48
|
-
case 0: return [4 /*yield*/, (0, getProjectConfig_1.getProjectConfig)()];
|
|
49
|
-
case 1:
|
|
50
|
-
config = _a.sent();
|
|
51
|
-
if (!config) {
|
|
52
|
-
return [2 /*return*/];
|
|
53
|
-
}
|
|
54
|
-
return [4 /*yield*/, Promise.all([
|
|
55
|
-
config.pipelineType
|
|
56
|
-
? (0, pipeline_1.generatePipelineFiles)(config, config.pipelineType, "local")
|
|
57
|
-
: undefined,
|
|
58
|
-
(0, writeDotEnvFiles_1.writeDotEnvFiles)(config, choice),
|
|
59
|
-
(0, writeEnvDTs_1.writeDTsFiles)(config, choice),
|
|
60
|
-
(0, printVariables_1.printVariables)(config, choice),
|
|
61
|
-
])];
|
|
62
|
-
case 2:
|
|
63
|
-
_a.sent();
|
|
64
|
-
return [2 /*return*/];
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}); });
|
|
68
22
|
//# sourceMappingURL=catenv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catenv.js","sourceRoot":"","sources":["../../../../../src/apps/catenv/catenv.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"catenv.js","sourceRoot":"","sources":["../../../../../src/apps/catenv/catenv.ts"],"names":[],"mappings":";;AAAA,oEAAiE;AACjE,qDAAkD;AAElD,yDAAsD;AACtD,+CAA8C;AAC9C,kDAA4D;AAE5D,kBAAe,KAAK,EAAE,MAAe,EAAE,EAAE;IACvC,MAAM,MAAM,GAAG,MAAM,IAAA,mCAAgB,GAAE,CAAC;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IAED,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,MAAM,CAAC,YAAY;YACjB,CAAC,CAAC,IAAA,gCAAqB,EAAC,MAAM,EAAE,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC;YAC7D,CAAC,CAAC,SAAS;QACb,IAAA,mCAAgB,EAAC,MAAM,EAAE,MAAM,CAAC;QAEhC,IAAA,2BAAa,EAAC,MAAM,EAAE,MAAM,CAAC;QAE7B,IAAA,+BAAc,EAAC,MAAM,EAAE,MAAM,CAAC;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1,131 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.printVariables = void 0;
|
|
4
|
+
const getProjectConfig_1 = require("../../config/getProjectConfig");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const getAllVariablesToPrint = async (config, choice) => {
|
|
7
|
+
const { env, currentComponent } = await (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice);
|
|
8
|
+
if (currentComponent) {
|
|
9
|
+
// don't print vars if dotenv is enabled
|
|
10
|
+
if (config.components[currentComponent].dotEnv) {
|
|
11
|
+
return {};
|
|
8
12
|
}
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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 (g && (g = 0, op[0] && (_ = 0)), _) 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;
|
|
13
|
+
return await (0, getProjectConfig_1.getEnvVarsResolved)(null, env, currentComponent);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
// when in a monorep and not in a subapp, merge all env vars.
|
|
17
|
+
// this is not 100% correct, but better than not exporting any vars at all
|
|
18
|
+
// so we also add prefixed variants
|
|
19
|
+
return await Object.keys(config.components).reduce(async (acc, componentName) => {
|
|
20
|
+
// don't print vars if dotenv is enabled
|
|
21
|
+
if (config.components[componentName].dotEnv) {
|
|
22
|
+
return await acc;
|
|
43
23
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
24
|
+
const subappvars = await (0, getProjectConfig_1.getEnvVarsResolved)(null, env, componentName);
|
|
25
|
+
delete subappvars["_ALL_ENV_VAR_KEYS"];
|
|
26
|
+
return {
|
|
27
|
+
...(await acc),
|
|
28
|
+
...subappvars,
|
|
29
|
+
// also add prefixed variants in case
|
|
30
|
+
...Object.fromEntries(Object.entries(subappvars).map(([key, value]) => [
|
|
31
|
+
`${(0, utils_1.sanitizeEnvVarName)(componentName.toUpperCase())}_${key}`,
|
|
32
|
+
value,
|
|
33
|
+
])),
|
|
34
|
+
};
|
|
35
|
+
}, Promise.resolve({}));
|
|
47
36
|
}
|
|
48
37
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var i = m.call(o), r, ar = [], e;
|
|
53
|
-
try {
|
|
54
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
55
|
-
}
|
|
56
|
-
catch (error) { e = { error: error }; }
|
|
57
|
-
finally {
|
|
58
|
-
try {
|
|
59
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
60
|
-
}
|
|
61
|
-
finally { if (e) throw e.error; }
|
|
62
|
-
}
|
|
63
|
-
return ar;
|
|
38
|
+
const printVariables = async (config, choice) => {
|
|
39
|
+
const variables = await getAllVariablesToPrint(config, choice);
|
|
40
|
+
console.log(makeExportKeyValuestring(variables));
|
|
64
41
|
};
|
|
65
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
-
exports.printVariables = void 0;
|
|
67
|
-
var getProjectConfig_1 = require("../../config/getProjectConfig");
|
|
68
|
-
var utils_1 = require("./utils");
|
|
69
|
-
var getAllVariablesToPrint = function (config, choice) { return __awaiter(void 0, void 0, void 0, function () {
|
|
70
|
-
var _a, env, currentComponent;
|
|
71
|
-
return __generator(this, function (_b) {
|
|
72
|
-
switch (_b.label) {
|
|
73
|
-
case 0: return [4 /*yield*/, (0, utils_1.getCurrentComponentAndEnvFromChoice)(config, choice)];
|
|
74
|
-
case 1:
|
|
75
|
-
_a = _b.sent(), env = _a.env, currentComponent = _a.currentComponent;
|
|
76
|
-
if (!currentComponent) return [3 /*break*/, 3];
|
|
77
|
-
// don't print vars if dotenv is enabled
|
|
78
|
-
if (config.components[currentComponent].dotEnv) {
|
|
79
|
-
return [2 /*return*/, {}];
|
|
80
|
-
}
|
|
81
|
-
return [4 /*yield*/, (0, getProjectConfig_1.getEnvVarsResolved)(null, env, currentComponent)];
|
|
82
|
-
case 2: return [2 /*return*/, _b.sent()];
|
|
83
|
-
case 3: return [4 /*yield*/, Object.keys(config.components).reduce(function (acc, componentName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
84
|
-
var subappvars, _a;
|
|
85
|
-
return __generator(this, function (_b) {
|
|
86
|
-
switch (_b.label) {
|
|
87
|
-
case 0:
|
|
88
|
-
if (!config.components[componentName].dotEnv) return [3 /*break*/, 2];
|
|
89
|
-
return [4 /*yield*/, acc];
|
|
90
|
-
case 1: return [2 /*return*/, _b.sent()];
|
|
91
|
-
case 2: return [4 /*yield*/, (0, getProjectConfig_1.getEnvVarsResolved)(null, env, componentName)];
|
|
92
|
-
case 3:
|
|
93
|
-
subappvars = _b.sent();
|
|
94
|
-
delete subappvars["_ALL_ENV_VAR_KEYS"];
|
|
95
|
-
_a = [{}];
|
|
96
|
-
return [4 /*yield*/, acc];
|
|
97
|
-
case 4: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_b.sent())])), subappvars]), Object.fromEntries(Object.entries(subappvars).map(function (_a) {
|
|
98
|
-
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
99
|
-
return [
|
|
100
|
-
"".concat((0, utils_1.sanitizeEnvVarName)(componentName.toUpperCase()), "_").concat(key),
|
|
101
|
-
value,
|
|
102
|
-
];
|
|
103
|
-
}))])];
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
}); }, Promise.resolve({}))];
|
|
107
|
-
case 4:
|
|
108
|
-
// when in a monorep and not in a subapp, merge all env vars.
|
|
109
|
-
// this is not 100% correct, but better than not exporting any vars at all
|
|
110
|
-
// so we also add prefixed variants
|
|
111
|
-
return [2 /*return*/, _b.sent()];
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}); };
|
|
115
|
-
var printVariables = function (config, choice) { return __awaiter(void 0, void 0, void 0, function () {
|
|
116
|
-
var variables;
|
|
117
|
-
return __generator(this, function (_a) {
|
|
118
|
-
switch (_a.label) {
|
|
119
|
-
case 0: return [4 /*yield*/, getAllVariablesToPrint(config, choice)];
|
|
120
|
-
case 1:
|
|
121
|
-
variables = _a.sent();
|
|
122
|
-
console.log(makeExportKeyValuestring(variables));
|
|
123
|
-
return [2 /*return*/];
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}); };
|
|
127
42
|
exports.printVariables = printVariables;
|
|
128
|
-
|
|
129
|
-
return (0, utils_1.makeKeyValueString)(variables, "export ");
|
|
130
|
-
};
|
|
43
|
+
const makeExportKeyValuestring = (variables) => (0, utils_1.makeKeyValueString)(variables, "export ");
|
|
131
44
|
//# sourceMappingURL=printVariables.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printVariables.js","sourceRoot":"","sources":["../../../../../src/apps/catenv/printVariables.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"printVariables.js","sourceRoot":"","sources":["../../../../../src/apps/catenv/printVariables.ts"],"names":[],"mappings":";;;AACA,oEAAmE;AAEnE,mCAIiB;AAEjB,MAAM,sBAAsB,GAAG,KAAK,EAAE,MAAc,EAAE,MAAe,EAAE,EAAE;IACvE,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,MAAM,IAAA,2CAAmC,EACzE,MAAM,EACN,MAAM,CACP,CAAC;IAEF,IAAI,gBAAgB,EAAE,CAAC;QACrB,wCAAwC;QACxC,IAAI,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,CAAC;YAC/C,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,MAAM,IAAA,qCAAkB,EAAC,IAAI,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAC/D,CAAC;SAAM,CAAC;QACN,6DAA6D;QAC7D,0EAA0E;QAC1E,mCAAmC;QACnC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAChD,KAAK,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE;YAC3B,wCAAwC;YACxC,IAAI,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,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