@factiii/stack 0.1.2
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/README.md +420 -0
- package/bin/factiii +229 -0
- package/dist/cli/check-config.d.ts +9 -0
- package/dist/cli/check-config.d.ts.map +1 -0
- package/dist/cli/check-config.js +19 -0
- package/dist/cli/check-config.js.map +1 -0
- package/dist/cli/deploy-secrets.d.ts +16 -0
- package/dist/cli/deploy-secrets.d.ts.map +1 -0
- package/dist/cli/deploy-secrets.js +227 -0
- package/dist/cli/deploy-secrets.js.map +1 -0
- package/dist/cli/deploy.d.ts +30 -0
- package/dist/cli/deploy.d.ts.map +1 -0
- package/dist/cli/deploy.js +306 -0
- package/dist/cli/deploy.js.map +1 -0
- package/dist/cli/deployer.d.ts +13 -0
- package/dist/cli/deployer.d.ts.map +1 -0
- package/dist/cli/deployer.js +21 -0
- package/dist/cli/deployer.js.map +1 -0
- package/dist/cli/dev-sync.d.ts +30 -0
- package/dist/cli/dev-sync.d.ts.map +1 -0
- package/dist/cli/dev-sync.js +500 -0
- package/dist/cli/dev-sync.js.map +1 -0
- package/dist/cli/execute-plugin-command.d.ts +25 -0
- package/dist/cli/execute-plugin-command.d.ts.map +1 -0
- package/dist/cli/execute-plugin-command.js +237 -0
- package/dist/cli/execute-plugin-command.js.map +1 -0
- package/dist/cli/fix.d.ts +22 -0
- package/dist/cli/fix.d.ts.map +1 -0
- package/dist/cli/fix.js +267 -0
- package/dist/cli/fix.js.map +1 -0
- package/dist/cli/index.d.ts +17 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +31 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +9 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +190 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/plugin-commands.d.ts +22 -0
- package/dist/cli/plugin-commands.d.ts.map +1 -0
- package/dist/cli/plugin-commands.js +121 -0
- package/dist/cli/plugin-commands.js.map +1 -0
- package/dist/cli/scan.d.ts +66 -0
- package/dist/cli/scan.d.ts.map +1 -0
- package/dist/cli/scan.js +511 -0
- package/dist/cli/scan.js.map +1 -0
- package/dist/cli/secrets.d.ts +19 -0
- package/dist/cli/secrets.d.ts.map +1 -0
- package/dist/cli/secrets.js +318 -0
- package/dist/cli/secrets.js.map +1 -0
- package/dist/cli/undeploy.d.ts +9 -0
- package/dist/cli/undeploy.d.ts.map +1 -0
- package/dist/cli/undeploy.js +95 -0
- package/dist/cli/undeploy.js.map +1 -0
- package/dist/cli/upgrade.d.ts +9 -0
- package/dist/cli/upgrade.d.ts.map +1 -0
- package/dist/cli/upgrade.js +24 -0
- package/dist/cli/upgrade.js.map +1 -0
- package/dist/cli/validate.d.ts +9 -0
- package/dist/cli/validate.d.ts.map +1 -0
- package/dist/cli/validate.js +20 -0
- package/dist/cli/validate.js.map +1 -0
- package/dist/generators/generate-factiii-auto.d.ts +31 -0
- package/dist/generators/generate-factiii-auto.d.ts.map +1 -0
- package/dist/generators/generate-factiii-auto.js +251 -0
- package/dist/generators/generate-factiii-auto.js.map +1 -0
- package/dist/generators/generate-factiii-yml.d.ts +23 -0
- package/dist/generators/generate-factiii-yml.d.ts.map +1 -0
- package/dist/generators/generate-factiii-yml.js +228 -0
- package/dist/generators/generate-factiii-yml.js.map +1 -0
- package/dist/generators/index.d.ts +8 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +14 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +90 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/addons/server-mode/index.d.ts +57 -0
- package/dist/plugins/addons/server-mode/index.d.ts.map +1 -0
- package/dist/plugins/addons/server-mode/index.js +136 -0
- package/dist/plugins/addons/server-mode/index.js.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/mac.d.ts +17 -0
- package/dist/plugins/addons/server-mode/scanfix/mac.d.ts.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/mac.js +461 -0
- package/dist/plugins/addons/server-mode/scanfix/mac.js.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/ubuntu.d.ts +12 -0
- package/dist/plugins/addons/server-mode/scanfix/ubuntu.d.ts.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/ubuntu.js +246 -0
- package/dist/plugins/addons/server-mode/scanfix/ubuntu.js.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/windows.d.ts +14 -0
- package/dist/plugins/addons/server-mode/scanfix/windows.d.ts.map +1 -0
- package/dist/plugins/addons/server-mode/scanfix/windows.js +113 -0
- package/dist/plugins/addons/server-mode/scanfix/windows.js.map +1 -0
- package/dist/plugins/approved.json +13 -0
- package/dist/plugins/frameworks/prisma-trpc/index.d.ts +65 -0
- package/dist/plugins/frameworks/prisma-trpc/index.d.ts.map +1 -0
- package/dist/plugins/frameworks/prisma-trpc/index.js +668 -0
- package/dist/plugins/frameworks/prisma-trpc/index.js.map +1 -0
- package/dist/plugins/index.d.ts +101 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +411 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/interfaces/addon.d.ts +43 -0
- package/dist/plugins/interfaces/addon.d.ts.map +1 -0
- package/dist/plugins/interfaces/addon.js +53 -0
- package/dist/plugins/interfaces/addon.js.map +1 -0
- package/dist/plugins/interfaces/framework.d.ts +43 -0
- package/dist/plugins/interfaces/framework.d.ts.map +1 -0
- package/dist/plugins/interfaces/framework.js +53 -0
- package/dist/plugins/interfaces/framework.js.map +1 -0
- package/dist/plugins/interfaces/index.d.ts +10 -0
- package/dist/plugins/interfaces/index.d.ts.map +1 -0
- package/dist/plugins/interfaces/index.js +17 -0
- package/dist/plugins/interfaces/index.js.map +1 -0
- package/dist/plugins/interfaces/pipeline.d.ts +78 -0
- package/dist/plugins/interfaces/pipeline.d.ts.map +1 -0
- package/dist/plugins/interfaces/pipeline.js +82 -0
- package/dist/plugins/interfaces/pipeline.js.map +1 -0
- package/dist/plugins/interfaces/server.d.ts +65 -0
- package/dist/plugins/interfaces/server.d.ts.map +1 -0
- package/dist/plugins/interfaces/server.js +72 -0
- package/dist/plugins/interfaces/server.js.map +1 -0
- package/dist/plugins/pipelines/aws/configs/ec2.d.ts +9 -0
- package/dist/plugins/pipelines/aws/configs/ec2.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/configs/ec2.js +34 -0
- package/dist/plugins/pipelines/aws/configs/ec2.js.map +1 -0
- package/dist/plugins/pipelines/aws/configs/free-tier.d.ts +13 -0
- package/dist/plugins/pipelines/aws/configs/free-tier.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/configs/free-tier.js +86 -0
- package/dist/plugins/pipelines/aws/configs/free-tier.js.map +1 -0
- package/dist/plugins/pipelines/aws/configs/index.d.ts +14 -0
- package/dist/plugins/pipelines/aws/configs/index.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/configs/index.js +21 -0
- package/dist/plugins/pipelines/aws/configs/index.js.map +1 -0
- package/dist/plugins/pipelines/aws/configs/types.d.ts +36 -0
- package/dist/plugins/pipelines/aws/configs/types.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/configs/types.js +9 -0
- package/dist/plugins/pipelines/aws/configs/types.js.map +1 -0
- package/dist/plugins/pipelines/aws/dev.d.ts +10 -0
- package/dist/plugins/pipelines/aws/dev.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/dev.js +70 -0
- package/dist/plugins/pipelines/aws/dev.js.map +1 -0
- package/dist/plugins/pipelines/aws/index.d.ts +118 -0
- package/dist/plugins/pipelines/aws/index.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/index.js +346 -0
- package/dist/plugins/pipelines/aws/index.js.map +1 -0
- package/dist/plugins/pipelines/aws/prod.d.ts +19 -0
- package/dist/plugins/pipelines/aws/prod.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/prod.js +362 -0
- package/dist/plugins/pipelines/aws/prod.js.map +1 -0
- package/dist/plugins/pipelines/aws/scanfix/aws-cli.d.ts +7 -0
- package/dist/plugins/pipelines/aws/scanfix/aws-cli.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/scanfix/aws-cli.js +31 -0
- package/dist/plugins/pipelines/aws/scanfix/aws-cli.js.map +1 -0
- package/dist/plugins/pipelines/aws/scanfix/config.d.ts +7 -0
- package/dist/plugins/pipelines/aws/scanfix/config.d.ts.map +1 -0
- package/dist/plugins/pipelines/aws/scanfix/config.js +134 -0
- package/dist/plugins/pipelines/aws/scanfix/config.js.map +1 -0
- package/dist/plugins/pipelines/factiii/github-secrets-store.d.ts +65 -0
- package/dist/plugins/pipelines/factiii/github-secrets-store.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/github-secrets-store.js +221 -0
- package/dist/plugins/pipelines/factiii/github-secrets-store.js.map +1 -0
- package/dist/plugins/pipelines/factiii/index.d.ts +195 -0
- package/dist/plugins/pipelines/factiii/index.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/index.js +862 -0
- package/dist/plugins/pipelines/factiii/index.js.map +1 -0
- package/dist/plugins/pipelines/factiii/prod.d.ts +17 -0
- package/dist/plugins/pipelines/factiii/prod.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/prod.js +282 -0
- package/dist/plugins/pipelines/factiii/prod.js.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/config.d.ts +7 -0
- package/dist/plugins/pipelines/factiii/scanfix/config.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/config.js +80 -0
- package/dist/plugins/pipelines/factiii/scanfix/config.js.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/github-cli.d.ts +7 -0
- package/dist/plugins/pipelines/factiii/scanfix/github-cli.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/github-cli.js +43 -0
- package/dist/plugins/pipelines/factiii/scanfix/github-cli.js.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/secrets.d.ts +7 -0
- package/dist/plugins/pipelines/factiii/scanfix/secrets.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/secrets.js +237 -0
- package/dist/plugins/pipelines/factiii/scanfix/secrets.js.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/workflows.d.ts +7 -0
- package/dist/plugins/pipelines/factiii/scanfix/workflows.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/scanfix/workflows.js +169 -0
- package/dist/plugins/pipelines/factiii/scanfix/workflows.js.map +1 -0
- package/dist/plugins/pipelines/factiii/staging.d.ts +25 -0
- package/dist/plugins/pipelines/factiii/staging.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/staging.js +223 -0
- package/dist/plugins/pipelines/factiii/staging.js.map +1 -0
- package/dist/plugins/pipelines/factiii/utils/detection.d.ts +36 -0
- package/dist/plugins/pipelines/factiii/utils/detection.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/utils/detection.js +140 -0
- package/dist/plugins/pipelines/factiii/utils/detection.js.map +1 -0
- package/dist/plugins/pipelines/factiii/utils/workflows.d.ts +16 -0
- package/dist/plugins/pipelines/factiii/utils/workflows.d.ts.map +1 -0
- package/dist/plugins/pipelines/factiii/utils/workflows.js +129 -0
- package/dist/plugins/pipelines/factiii/utils/workflows.js.map +1 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-cicd-prod.yml +112 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-cicd-staging.yml +112 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-command.yml +130 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-deploy.yml +198 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-dev-sync.yml +179 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-fix.yml +176 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-scan.yml +176 -0
- package/dist/plugins/pipelines/factiii/workflows/factiii-undeploy.yml +95 -0
- package/dist/plugins/servers/amazon-linux/index.d.ts +93 -0
- package/dist/plugins/servers/amazon-linux/index.d.ts.map +1 -0
- package/dist/plugins/servers/amazon-linux/index.js +217 -0
- package/dist/plugins/servers/amazon-linux/index.js.map +1 -0
- package/dist/plugins/servers/mac/dev.d.ts +10 -0
- package/dist/plugins/servers/mac/dev.d.ts.map +1 -0
- package/dist/plugins/servers/mac/dev.js +71 -0
- package/dist/plugins/servers/mac/dev.js.map +1 -0
- package/dist/plugins/servers/mac/index.d.ts +101 -0
- package/dist/plugins/servers/mac/index.d.ts.map +1 -0
- package/dist/plugins/servers/mac/index.js +257 -0
- package/dist/plugins/servers/mac/index.js.map +1 -0
- package/dist/plugins/servers/mac/scanfix/config.d.ts +7 -0
- package/dist/plugins/servers/mac/scanfix/config.d.ts.map +1 -0
- package/dist/plugins/servers/mac/scanfix/config.js +168 -0
- package/dist/plugins/servers/mac/scanfix/config.js.map +1 -0
- package/dist/plugins/servers/mac/scanfix/containers.d.ts +7 -0
- package/dist/plugins/servers/mac/scanfix/containers.d.ts.map +1 -0
- package/dist/plugins/servers/mac/scanfix/containers.js +167 -0
- package/dist/plugins/servers/mac/scanfix/containers.js.map +1 -0
- package/dist/plugins/servers/mac/scanfix/system.d.ts +7 -0
- package/dist/plugins/servers/mac/scanfix/system.d.ts.map +1 -0
- package/dist/plugins/servers/mac/scanfix/system.js +144 -0
- package/dist/plugins/servers/mac/scanfix/system.js.map +1 -0
- package/dist/plugins/servers/mac/staging.d.ts +21 -0
- package/dist/plugins/servers/mac/staging.d.ts.map +1 -0
- package/dist/plugins/servers/mac/staging.js +708 -0
- package/dist/plugins/servers/mac/staging.js.map +1 -0
- package/dist/plugins/servers/ubuntu/index.d.ts +93 -0
- package/dist/plugins/servers/ubuntu/index.d.ts.map +1 -0
- package/dist/plugins/servers/ubuntu/index.js +224 -0
- package/dist/plugins/servers/ubuntu/index.js.map +1 -0
- package/dist/plugins/servers/windows/index.d.ts +90 -0
- package/dist/plugins/servers/windows/index.d.ts.map +1 -0
- package/dist/plugins/servers/windows/index.js +205 -0
- package/dist/plugins/servers/windows/index.js.map +1 -0
- package/dist/scanfix/commands/index.d.ts +27 -0
- package/dist/scanfix/commands/index.d.ts.map +1 -0
- package/dist/scanfix/commands/index.js +97 -0
- package/dist/scanfix/commands/index.js.map +1 -0
- package/dist/scanfix/commands/mac.d.ts +11 -0
- package/dist/scanfix/commands/mac.d.ts.map +1 -0
- package/dist/scanfix/commands/mac.js +31 -0
- package/dist/scanfix/commands/mac.js.map +1 -0
- package/dist/scanfix/commands/ubuntu.d.ts +11 -0
- package/dist/scanfix/commands/ubuntu.d.ts.map +1 -0
- package/dist/scanfix/commands/ubuntu.js +30 -0
- package/dist/scanfix/commands/ubuntu.js.map +1 -0
- package/dist/scanfix/fixes/certbot.d.ts +25 -0
- package/dist/scanfix/fixes/certbot.d.ts.map +1 -0
- package/dist/scanfix/fixes/certbot.js +136 -0
- package/dist/scanfix/fixes/certbot.js.map +1 -0
- package/dist/scanfix/fixes/docker.d.ts +29 -0
- package/dist/scanfix/fixes/docker.d.ts.map +1 -0
- package/dist/scanfix/fixes/docker.js +149 -0
- package/dist/scanfix/fixes/docker.js.map +1 -0
- package/dist/scanfix/fixes/git.d.ts +20 -0
- package/dist/scanfix/fixes/git.d.ts.map +1 -0
- package/dist/scanfix/fixes/git.js +71 -0
- package/dist/scanfix/fixes/git.js.map +1 -0
- package/dist/scanfix/fixes/index.d.ts +11 -0
- package/dist/scanfix/fixes/index.d.ts.map +1 -0
- package/dist/scanfix/fixes/index.js +27 -0
- package/dist/scanfix/fixes/index.js.map +1 -0
- package/dist/scanfix/fixes/node.d.ts +20 -0
- package/dist/scanfix/fixes/node.d.ts.map +1 -0
- package/dist/scanfix/fixes/node.js +71 -0
- package/dist/scanfix/fixes/node.js.map +1 -0
- package/dist/scanfix/fixes/pnpm.d.ts +20 -0
- package/dist/scanfix/fixes/pnpm.d.ts.map +1 -0
- package/dist/scanfix/fixes/pnpm.js +122 -0
- package/dist/scanfix/fixes/pnpm.js.map +1 -0
- package/dist/scanfix/index.d.ts +23 -0
- package/dist/scanfix/index.d.ts.map +1 -0
- package/dist/scanfix/index.js +44 -0
- package/dist/scanfix/index.js.map +1 -0
- package/dist/scanfix/platform.d.ts +20 -0
- package/dist/scanfix/platform.d.ts.map +1 -0
- package/dist/scanfix/platform.js +48 -0
- package/dist/scanfix/platform.js.map +1 -0
- package/dist/scanfix/ssl-cert-helper.d.ts +27 -0
- package/dist/scanfix/ssl-cert-helper.d.ts.map +1 -0
- package/dist/scanfix/ssl-cert-helper.js +117 -0
- package/dist/scanfix/ssl-cert-helper.js.map +1 -0
- package/dist/scanfix/types.d.ts +27 -0
- package/dist/scanfix/types.d.ts.map +1 -0
- package/dist/scanfix/types.js +8 -0
- package/dist/scanfix/types.js.map +1 -0
- package/dist/scripts/check-existing-secrets.d.ts +6 -0
- package/dist/scripts/check-existing-secrets.d.ts.map +1 -0
- package/dist/scripts/check-existing-secrets.js +86 -0
- package/dist/scripts/check-existing-secrets.js.map +1 -0
- package/dist/scripts/generate-all.d.ts +40 -0
- package/dist/scripts/generate-all.d.ts.map +1 -0
- package/dist/scripts/generate-all.js +373 -0
- package/dist/scripts/generate-all.js.map +1 -0
- package/dist/scripts/get-repo-name.d.ts +6 -0
- package/dist/scripts/get-repo-name.d.ts.map +1 -0
- package/dist/scripts/get-repo-name.js +54 -0
- package/dist/scripts/get-repo-name.js.map +1 -0
- package/dist/scripts/index.d.ts +7 -0
- package/dist/scripts/index.d.ts.map +1 -0
- package/dist/scripts/index.js +14 -0
- package/dist/scripts/index.js.map +1 -0
- package/dist/scripts/validate-env-files.d.ts +6 -0
- package/dist/scripts/validate-env-files.d.ts.map +1 -0
- package/dist/scripts/validate-env-files.js +126 -0
- package/dist/scripts/validate-env-files.js.map +1 -0
- package/dist/scripts/validate-example-values.d.ts +8 -0
- package/dist/scripts/validate-example-values.d.ts.map +1 -0
- package/dist/scripts/validate-example-values.js +88 -0
- package/dist/scripts/validate-example-values.js.map +1 -0
- package/dist/scripts/validate-factiii-yml.d.ts +6 -0
- package/dist/scripts/validate-factiii-yml.d.ts.map +1 -0
- package/dist/scripts/validate-factiii-yml.js +71 -0
- package/dist/scripts/validate-factiii-yml.js.map +1 -0
- package/dist/types/cli.d.ts +138 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/cli.js +8 -0
- package/dist/types/cli.js.map +1 -0
- package/dist/types/config.d.ts +113 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +8 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +25 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/plugin.d.ts +352 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +8 -0
- package/dist/types/plugin.js.map +1 -0
- package/dist/utils/ansible-vault-secrets.d.ts +95 -0
- package/dist/utils/ansible-vault-secrets.d.ts.map +1 -0
- package/dist/utils/ansible-vault-secrets.js +406 -0
- package/dist/utils/ansible-vault-secrets.js.map +1 -0
- package/dist/utils/config-helpers.d.ts +72 -0
- package/dist/utils/config-helpers.d.ts.map +1 -0
- package/dist/utils/config-helpers.js +171 -0
- package/dist/utils/config-helpers.js.map +1 -0
- package/dist/utils/config-schema.d.ts +17 -0
- package/dist/utils/config-schema.d.ts.map +1 -0
- package/dist/utils/config-schema.js +100 -0
- package/dist/utils/config-schema.js.map +1 -0
- package/dist/utils/config-validator.d.ts +29 -0
- package/dist/utils/config-validator.d.ts.map +1 -0
- package/dist/utils/config-validator.js +146 -0
- package/dist/utils/config-validator.js.map +1 -0
- package/dist/utils/deployment-report.d.ts +100 -0
- package/dist/utils/deployment-report.d.ts.map +1 -0
- package/dist/utils/deployment-report.js +225 -0
- package/dist/utils/deployment-report.js.map +1 -0
- package/dist/utils/dns-validator.d.ts +19 -0
- package/dist/utils/dns-validator.d.ts.map +1 -0
- package/dist/utils/dns-validator.js +94 -0
- package/dist/utils/dns-validator.js.map +1 -0
- package/dist/utils/env-validator.d.ts +108 -0
- package/dist/utils/env-validator.d.ts.map +1 -0
- package/dist/utils/env-validator.js +342 -0
- package/dist/utils/env-validator.js.map +1 -0
- package/dist/utils/github-workflow-monitor.d.ts +49 -0
- package/dist/utils/github-workflow-monitor.d.ts.map +1 -0
- package/dist/utils/github-workflow-monitor.js +145 -0
- package/dist/utils/github-workflow-monitor.js.map +1 -0
- package/dist/utils/index.d.ts +18 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +48 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/secret-prompts.d.ts +67 -0
- package/dist/utils/secret-prompts.d.ts.map +1 -0
- package/dist/utils/secret-prompts.js +369 -0
- package/dist/utils/secret-prompts.js.map +1 -0
- package/dist/utils/server-check.d.ts +43 -0
- package/dist/utils/server-check.d.ts.map +1 -0
- package/dist/utils/server-check.js +397 -0
- package/dist/utils/server-check.js.map +1 -0
- package/dist/utils/ssh-deploy.d.ts +70 -0
- package/dist/utils/ssh-deploy.d.ts.map +1 -0
- package/dist/utils/ssh-deploy.js +268 -0
- package/dist/utils/ssh-deploy.js.map +1 -0
- package/dist/utils/ssh-helper.d.ts +40 -0
- package/dist/utils/ssh-helper.d.ts.map +1 -0
- package/dist/utils/ssh-helper.js +221 -0
- package/dist/utils/ssh-helper.js.map +1 -0
- package/dist/utils/template-generator.d.ts +42 -0
- package/dist/utils/template-generator.d.ts.map +1 -0
- package/dist/utils/template-generator.js +223 -0
- package/dist/utils/template-generator.js.map +1 -0
- package/dist/utils/version-check.d.ts +69 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +211 -0
- package/dist/utils/version-check.js.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* GitHub Secrets Store
|
|
4
|
+
*
|
|
5
|
+
* Utility for managing GitHub repository secrets via the GitHub API.
|
|
6
|
+
* Used by the pipeline plugin and secrets CLI command.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.GitHubSecretsStore = void 0;
|
|
43
|
+
const child_process_1 = require("child_process");
|
|
44
|
+
const https = __importStar(require("https"));
|
|
45
|
+
class GitHubSecretsStore {
|
|
46
|
+
token;
|
|
47
|
+
owner;
|
|
48
|
+
repo;
|
|
49
|
+
constructor(config = {}) {
|
|
50
|
+
this.token = config.token ?? process.env.GITHUB_TOKEN;
|
|
51
|
+
this.owner = config.owner;
|
|
52
|
+
this.repo = config.repo;
|
|
53
|
+
// Auto-detect from git if not provided
|
|
54
|
+
if (!this.owner || !this.repo) {
|
|
55
|
+
const repoInfo = GitHubSecretsStore.getRepoInfo();
|
|
56
|
+
if (repoInfo) {
|
|
57
|
+
this.owner = this.owner ?? repoInfo.owner;
|
|
58
|
+
this.repo = this.repo ?? repoInfo.repo;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get repository info from git remote
|
|
64
|
+
*/
|
|
65
|
+
static getRepoInfo() {
|
|
66
|
+
try {
|
|
67
|
+
const remote = (0, child_process_1.execSync)('git config --get remote.origin.url', {
|
|
68
|
+
encoding: 'utf8',
|
|
69
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
70
|
+
}).trim();
|
|
71
|
+
// Parse GitHub URL (supports both HTTPS and SSH)
|
|
72
|
+
const match = remote.match(/github\.com[:/]([^/]+)\/(.+?)(\.git)?$/);
|
|
73
|
+
if (match && match[1] && match[2]) {
|
|
74
|
+
return {
|
|
75
|
+
owner: match[1],
|
|
76
|
+
repo: match[2],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Make GitHub API request
|
|
87
|
+
*/
|
|
88
|
+
async request(method, urlPath, body = null) {
|
|
89
|
+
return new Promise((resolve, reject) => {
|
|
90
|
+
const options = {
|
|
91
|
+
hostname: 'api.github.com',
|
|
92
|
+
port: 443,
|
|
93
|
+
path: urlPath,
|
|
94
|
+
method: method,
|
|
95
|
+
headers: {
|
|
96
|
+
Authorization: `Bearer ${this.token}`,
|
|
97
|
+
'User-Agent': 'factiii-stack',
|
|
98
|
+
Accept: 'application/vnd.github+json',
|
|
99
|
+
'X-GitHub-Api-Version': '2022-11-28',
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
if (body) {
|
|
103
|
+
const bodyStr = JSON.stringify(body);
|
|
104
|
+
options.headers['Content-Type'] = 'application/json';
|
|
105
|
+
options.headers['Content-Length'] =
|
|
106
|
+
Buffer.byteLength(bodyStr).toString();
|
|
107
|
+
}
|
|
108
|
+
const req = https.request(options, (res) => {
|
|
109
|
+
let data = '';
|
|
110
|
+
res.on('data', (chunk) => {
|
|
111
|
+
data += chunk.toString();
|
|
112
|
+
});
|
|
113
|
+
res.on('end', () => {
|
|
114
|
+
if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {
|
|
115
|
+
try {
|
|
116
|
+
resolve(data ? JSON.parse(data) : {});
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
resolve({ raw: data });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
reject(new Error(`GitHub API error: ${res.statusCode} ${data}`));
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
req.on('error', reject);
|
|
128
|
+
if (body) {
|
|
129
|
+
req.write(JSON.stringify(body));
|
|
130
|
+
}
|
|
131
|
+
req.end();
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Get repository public key for encrypting secrets
|
|
136
|
+
*/
|
|
137
|
+
async getPublicKey() {
|
|
138
|
+
const urlPath = `/repos/${this.owner}/${this.repo}/actions/secrets/public-key`;
|
|
139
|
+
return await this.request('GET', urlPath);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Encrypt a secret value using the repository's public key
|
|
143
|
+
*/
|
|
144
|
+
encryptSecret(value, _publicKey) {
|
|
145
|
+
// Convert the public key from base64
|
|
146
|
+
// Note: This uses Node's crypto which may not be 100% compatible with libsodium
|
|
147
|
+
// For production, consider using the @octokit/core library with proper libsodium
|
|
148
|
+
// For now, return base64 encoded value (GitHub API will handle encryption)
|
|
149
|
+
return Buffer.from(value).toString('base64');
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Set a secret in the repository
|
|
153
|
+
*/
|
|
154
|
+
async setSecret(name, value) {
|
|
155
|
+
try {
|
|
156
|
+
// Get public key
|
|
157
|
+
const { key, key_id } = await this.getPublicKey();
|
|
158
|
+
// Encrypt the value
|
|
159
|
+
const encrypted = this.encryptSecret(value, key);
|
|
160
|
+
// Set the secret
|
|
161
|
+
const urlPath = `/repos/${this.owner}/${this.repo}/actions/secrets/${name}`;
|
|
162
|
+
await this.request('PUT', urlPath, {
|
|
163
|
+
encrypted_value: encrypted,
|
|
164
|
+
key_id: key_id,
|
|
165
|
+
});
|
|
166
|
+
return { success: true };
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
return {
|
|
170
|
+
success: false,
|
|
171
|
+
error: error instanceof Error ? error.message : String(error),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Check which secrets exist
|
|
177
|
+
*/
|
|
178
|
+
async checkSecrets(secretNames) {
|
|
179
|
+
try {
|
|
180
|
+
const urlPath = `/repos/${this.owner}/${this.repo}/actions/secrets`;
|
|
181
|
+
const response = await this.request('GET', urlPath);
|
|
182
|
+
const existing = new Set(response.secrets?.map((s) => s.name) ?? []);
|
|
183
|
+
const status = {};
|
|
184
|
+
const missing = [];
|
|
185
|
+
for (const name of secretNames) {
|
|
186
|
+
status[name] = existing.has(name);
|
|
187
|
+
if (!existing.has(name)) {
|
|
188
|
+
missing.push(name);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return {
|
|
192
|
+
existing: Array.from(existing),
|
|
193
|
+
status,
|
|
194
|
+
missing,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
return {
|
|
199
|
+
error: error instanceof Error ? error.message : String(error),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Delete a secret
|
|
205
|
+
*/
|
|
206
|
+
async deleteSecret(name) {
|
|
207
|
+
try {
|
|
208
|
+
const urlPath = `/repos/${this.owner}/${this.repo}/actions/secrets/${name}`;
|
|
209
|
+
await this.request('DELETE', urlPath);
|
|
210
|
+
return { success: true };
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
return {
|
|
214
|
+
success: false,
|
|
215
|
+
error: error instanceof Error ? error.message : String(error),
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
exports.GitHubSecretsStore = GitHubSecretsStore;
|
|
221
|
+
//# sourceMappingURL=github-secrets-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-secrets-store.js","sourceRoot":"","sources":["../../../../src/plugins/pipelines/factiii/github-secrets-store.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAyC;AACzC,6CAA+B;AAkC/B,MAAa,kBAAkB;IACrB,KAAK,CAAU;IACf,KAAK,CAAU;IACf,IAAI,CAAU;IAEtB,YAAY,SAAmC,EAAE;QAC/C,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;QACtD,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QAExB,uCAAuC;QACvC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAC9B,MAAM,QAAQ,GAAG,kB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AM,CAAC,KAAK,CAAC;aAC9D,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,IAAY;QAC7B,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,UAAU,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,oBAAoB,IAAI,EAAE,CAAC;YAC5E,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACtC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC9D,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAtMD,gDAsMC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factiii Pipeline Plugin
|
|
3
|
+
*
|
|
4
|
+
* The default pipeline plugin for Factiii Stack.
|
|
5
|
+
* Uses GitHub Actions for CI/CD with thin workflows that SSH to servers
|
|
6
|
+
* and call the Factiii CLI to do the actual work.
|
|
7
|
+
*
|
|
8
|
+
* ============================================================
|
|
9
|
+
* PLUGIN STRUCTURE STANDARD
|
|
10
|
+
* ============================================================
|
|
11
|
+
*
|
|
12
|
+
* This plugin follows a standardized structure for clarity and maintainability:
|
|
13
|
+
*
|
|
14
|
+
* **scanfix/** - Scan/fix operations organized by concern
|
|
15
|
+
* - Each file exports an array of Fix[] objects
|
|
16
|
+
* - Files group related fixes together (config, github-cli, workflows, secrets)
|
|
17
|
+
* - All fixes are combined in the main plugin class
|
|
18
|
+
*
|
|
19
|
+
* **utils/** - Utility methods
|
|
20
|
+
* - detection.ts - Config detection methods (package manager, Node.js version, etc.)
|
|
21
|
+
* - workflows.ts - Workflow generation and triggering
|
|
22
|
+
*
|
|
23
|
+
* **index.ts** - Main plugin class
|
|
24
|
+
* - Static metadata (id, name, category, version)
|
|
25
|
+
* - shouldLoad() - Determines if plugin should load
|
|
26
|
+
* - canReach() - Determines how to reach each stage (critical routing method)
|
|
27
|
+
* - Imports and combines all scanfix arrays
|
|
28
|
+
* - Imports and uses utility methods
|
|
29
|
+
* - Core pipeline logic: deployStage(), runLocalDeploy()
|
|
30
|
+
* - Maintains public API compatibility
|
|
31
|
+
*
|
|
32
|
+
* **Key Differences from Server Plugins:**
|
|
33
|
+
* - Environment-specific files (staging.ts, prod.ts) are in plugin root - standard pattern
|
|
34
|
+
* - Core routing logic stays in index.ts - canReach() and deployStage() are the main entry points
|
|
35
|
+
* - Utils folder for static helpers - Detection and workflow generation are utilities, not core logic
|
|
36
|
+
* - scanfix organized by concern, not environment - Fixes are grouped by what they check (config, workflows, secrets)
|
|
37
|
+
*
|
|
38
|
+
* **When each scanfix file is used:**
|
|
39
|
+
* - config.ts: When checking/generating factiii.yml
|
|
40
|
+
* - github-cli.ts: When checking GitHub CLI installation (dev)
|
|
41
|
+
* - workflows.ts: When checking/generating GitHub workflows (dev)
|
|
42
|
+
* - secrets.ts: When checking GitHub Secrets (secrets stage)
|
|
43
|
+
* ============================================================
|
|
44
|
+
*/
|
|
45
|
+
import type { FactiiiConfig, Stage, Reachability, Fix, DeployResult, DeployOptions, EnvironmentConfig, PluginCommand } from '../../../types/index.js';
|
|
46
|
+
import * as detectionUtils from './utils/detection.js';
|
|
47
|
+
declare class FactiiiPipeline {
|
|
48
|
+
static readonly id = "factiii";
|
|
49
|
+
static readonly name = "Factiii Pipeline";
|
|
50
|
+
static readonly category: 'pipeline';
|
|
51
|
+
static readonly version = "1.0.0";
|
|
52
|
+
static readonly requiredEnvVars: string[];
|
|
53
|
+
static readonly configSchema: Record<string, unknown>;
|
|
54
|
+
static readonly autoConfigSchema: Record<string, string>;
|
|
55
|
+
/**
|
|
56
|
+
* Determine if this plugin should be loaded for this project
|
|
57
|
+
* Pipeline plugin always loads - it's the default CI/CD system
|
|
58
|
+
*/
|
|
59
|
+
static shouldLoad(_rootDir: string, _config: FactiiiConfig): Promise<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* Whether this environment requires the full repo cloned on the server
|
|
62
|
+
*/
|
|
63
|
+
static requiresFullRepo(environment: string): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Check if this pipeline can reach a specific stage
|
|
66
|
+
*
|
|
67
|
+
* ============================================================
|
|
68
|
+
* PIPELINE AUTHORS: This method controls stage reachability
|
|
69
|
+
* ============================================================
|
|
70
|
+
*
|
|
71
|
+
* Return values:
|
|
72
|
+
* { reachable: true, via: 'local' } - Run fixes on this machine
|
|
73
|
+
* { reachable: true, via: 'ssh' } - SSH directly to the server
|
|
74
|
+
* { reachable: true, via: 'workflow' } - Trigger workflow to run fixes
|
|
75
|
+
* { reachable: false, reason: '...' } - Cannot reach, show error
|
|
76
|
+
*
|
|
77
|
+
* For the Factiii pipeline:
|
|
78
|
+
* - dev: always local
|
|
79
|
+
* - secrets: needs vault password
|
|
80
|
+
* - staging/prod:
|
|
81
|
+
* - If GITHUB_ACTIONS=true → local (we're on the server)
|
|
82
|
+
* - If SSH key exists → ssh (direct SSH from dev machine)
|
|
83
|
+
* - If GITHUB_TOKEN → workflow (fallback to GitHub Actions)
|
|
84
|
+
* - Otherwise → not reachable
|
|
85
|
+
*
|
|
86
|
+
* CRITICAL: When SSHing to a server, the command MUST include
|
|
87
|
+
* --staging or --prod to prevent infinite loops.
|
|
88
|
+
* ============================================================
|
|
89
|
+
*/
|
|
90
|
+
static canReach(stage: Stage, config: FactiiiConfig): Reachability;
|
|
91
|
+
static readonly fixes: Fix[];
|
|
92
|
+
/**
|
|
93
|
+
* Get the env file for a stage
|
|
94
|
+
* - dev: .env
|
|
95
|
+
* - staging: .env.staging
|
|
96
|
+
* - prod: .env.prod
|
|
97
|
+
*/
|
|
98
|
+
static getEnvFile(stage: Stage): string;
|
|
99
|
+
/**
|
|
100
|
+
* Load environment variables from a file
|
|
101
|
+
*/
|
|
102
|
+
static loadEnvFile(rootDir: string, envFile: string): Record<string, string>;
|
|
103
|
+
/**
|
|
104
|
+
* Find the directory containing Prisma (for db commands)
|
|
105
|
+
* Checks common monorepo locations
|
|
106
|
+
*/
|
|
107
|
+
static findDbDir(rootDir: string): string;
|
|
108
|
+
/**
|
|
109
|
+
* Run a database command - uses docker exec for staging/prod
|
|
110
|
+
* @param command - The command to run (e.g., 'prisma migrate status' or 'pnpm db:seed')
|
|
111
|
+
* @param useNpx - Whether to prefix with npx (false for pnpm commands)
|
|
112
|
+
*/
|
|
113
|
+
static runDbCommand(command: string, stage: Stage, config: FactiiiConfig, rootDir: string, useNpx?: boolean): void;
|
|
114
|
+
static readonly commands: PluginCommand[];
|
|
115
|
+
/**
|
|
116
|
+
* Auto-detect pipeline configuration
|
|
117
|
+
*/
|
|
118
|
+
static detectConfig(rootDir: string): Promise<detectionUtils.DetectedConfig>;
|
|
119
|
+
/**
|
|
120
|
+
* Detect package manager
|
|
121
|
+
*/
|
|
122
|
+
static detectPackageManager(rootDir: string): string;
|
|
123
|
+
/**
|
|
124
|
+
* Detect Node.js version from package.json
|
|
125
|
+
*/
|
|
126
|
+
static detectNodeVersion(rootDir: string): string | null;
|
|
127
|
+
/**
|
|
128
|
+
* Detect pnpm version from package.json
|
|
129
|
+
*/
|
|
130
|
+
static detectPnpmVersion(rootDir: string): string | null;
|
|
131
|
+
/**
|
|
132
|
+
* Find Dockerfile
|
|
133
|
+
*/
|
|
134
|
+
static findDockerfile(rootDir: string): string | null;
|
|
135
|
+
/**
|
|
136
|
+
* Generate GitHub workflow files in the target repository
|
|
137
|
+
*/
|
|
138
|
+
static generateWorkflows(rootDir: string): Promise<void>;
|
|
139
|
+
/**
|
|
140
|
+
* Build staging Docker image (linux/arm64) on staging server
|
|
141
|
+
*/
|
|
142
|
+
static buildStagingImage(config: FactiiiConfig, envConfig: EnvironmentConfig): Promise<DeployResult>;
|
|
143
|
+
/**
|
|
144
|
+
* Build production Docker image (linux/amd64) on staging server and push to ECR
|
|
145
|
+
*/
|
|
146
|
+
static buildProductionImage(config: FactiiiConfig, stagingConfig: EnvironmentConfig): Promise<DeployResult>;
|
|
147
|
+
/**
|
|
148
|
+
* Trigger a GitHub Actions workflow
|
|
149
|
+
*/
|
|
150
|
+
static triggerWorkflow(workflowName: string, inputs?: Record<string, string>): Promise<void>;
|
|
151
|
+
private _config;
|
|
152
|
+
constructor(config: FactiiiConfig);
|
|
153
|
+
/**
|
|
154
|
+
* Deploy to a stage - handles routing based on canReach()
|
|
155
|
+
*
|
|
156
|
+
* This is the main entry point for deployments. Checks canReach() to determine:
|
|
157
|
+
* - 'local': Execute deployment directly (dev stage, or when running on server)
|
|
158
|
+
* - 'workflow': Trigger GitHub Actions workflow
|
|
159
|
+
* - Not reachable: Return error with reason
|
|
160
|
+
*/
|
|
161
|
+
deployStage(stage: Stage, options?: DeployOptions): Promise<DeployResult>;
|
|
162
|
+
/**
|
|
163
|
+
* Scan a stage - handles routing based on canReach()
|
|
164
|
+
*
|
|
165
|
+
* Returns { handled: true } if pipeline ran scan remotely.
|
|
166
|
+
* Returns { handled: false } if caller should run scan locally.
|
|
167
|
+
*/
|
|
168
|
+
scanStage(stage: Stage, _options?: Record<string, unknown>): Promise<{
|
|
169
|
+
handled: boolean;
|
|
170
|
+
}>;
|
|
171
|
+
/**
|
|
172
|
+
* Fix a stage - handles routing based on canReach()
|
|
173
|
+
*
|
|
174
|
+
* Returns { handled: true } if pipeline ran fix remotely.
|
|
175
|
+
* Returns { handled: false } if caller should run fix locally.
|
|
176
|
+
*/
|
|
177
|
+
fixStage(stage: Stage, _options?: Record<string, unknown>): Promise<{
|
|
178
|
+
handled: boolean;
|
|
179
|
+
}>;
|
|
180
|
+
/**
|
|
181
|
+
* Run deployment locally by delegating to server plugin
|
|
182
|
+
*/
|
|
183
|
+
private runLocalDeploy;
|
|
184
|
+
/**
|
|
185
|
+
* Deploy to an environment
|
|
186
|
+
* @deprecated Use deployStage() which handles routing based on canReach()
|
|
187
|
+
*/
|
|
188
|
+
deploy(_config: FactiiiConfig, environment: string): Promise<DeployResult>;
|
|
189
|
+
/**
|
|
190
|
+
* Undeploy from an environment
|
|
191
|
+
*/
|
|
192
|
+
undeploy(_config: FactiiiConfig, environment: string): Promise<DeployResult>;
|
|
193
|
+
}
|
|
194
|
+
export default FactiiiPipeline;
|
|
195
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/pipelines/factiii/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAKH,OAAO,KAAK,EACV,aAAa,EACb,KAAK,EACL,YAAY,EACZ,GAAG,EACH,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,aAAa,EAEd,MAAM,yBAAyB,CAAC;AAajC,OAAO,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAKvD,cAAM,eAAe;IAKnB,MAAM,CAAC,QAAQ,CAAC,EAAE,aAAa;IAC/B,MAAM,CAAC,QAAQ,CAAC,IAAI,sBAAsB;IAC1C,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAc;IAClD,MAAM,CAAC,QAAQ,CAAC,OAAO,WAAW;IAGlC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,MAAM,EAAE,CAAM;IAG/C,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEnD;IAGF,MAAM,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAKtD;IAEF;;;OAGG;WACU,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IAInF;;OAE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