@runa-ai/runa-cli 0.5.71 → 0.6.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/build-BXUJKYHC.js +1730 -0
- package/dist/cache-H63JKFYH.js +112 -0
- package/dist/check-6AB5NGWK.js +207 -0
- package/dist/chunk-22CS6EMA.js +31 -0
- package/dist/chunk-3FDQW524.js +544 -0
- package/dist/chunk-5NKWR4FF.js +254 -0
- package/dist/chunk-6AALH2ED.js +121 -0
- package/dist/chunk-6Y3LAUGL.js +35 -0
- package/dist/chunk-7QV7U6NI.js +62 -0
- package/dist/chunk-AAIE4F2U.js +140 -0
- package/dist/chunk-CCKG5R4Y.js +59 -0
- package/dist/chunk-CE3DEYFT.js +480 -0
- package/dist/chunk-DRSUEMAK.js +123 -0
- package/dist/chunk-GOGRLQNP.js +12 -0
- package/dist/chunk-HD74F6W2.js +460 -0
- package/dist/chunk-HKUWEGUX.js +36 -0
- package/dist/chunk-HPYJPB5Y.js +408 -0
- package/dist/chunk-IBVVGH6X.js +33 -0
- package/dist/chunk-II7VYQEM.js +179 -0
- package/dist/chunk-JMJP4A47.js +204 -0
- package/dist/chunk-JQXOVCOP.js +574 -0
- package/dist/chunk-JT5SUTWE.js +9 -0
- package/dist/chunk-KWX3JHCY.js +85 -0
- package/dist/chunk-M47WJJVS.js +71 -0
- package/dist/chunk-MNPMZERI.js +194 -0
- package/dist/chunk-MXRWBNIY.js +74 -0
- package/dist/chunk-NPSRD26F.js +149 -0
- package/dist/chunk-P7U52PBY.js +1149 -0
- package/dist/chunk-QDF7QXBL.js +67 -0
- package/dist/chunk-RRGQCUKT.js +48 -0
- package/dist/chunk-RZLYEO4U.js +219 -0
- package/dist/chunk-TYIAD6SB.js +74 -0
- package/dist/chunk-UU55OH7P.js +42 -0
- package/dist/chunk-UWWSAPDR.js +31 -0
- package/dist/chunk-VM3IWOT5.js +458 -0
- package/dist/chunk-VRXHCR5K.js +42 -0
- package/dist/chunk-XJBQINSA.js +351 -0
- package/dist/chunk-ZZOXM6Q4.js +8 -0
- package/dist/ci-V3PIG2GI.js +8322 -0
- package/dist/cli/index.d.ts +7 -1
- package/dist/cli/requested-command.d.ts +8 -0
- package/dist/cli-GFRZCJQR.js +661 -0
- package/dist/commands/build/actors/db-sync.d.ts +2 -0
- package/dist/commands/build/actors/static-checks.d.ts +7 -6
- package/dist/commands/build/contract.d.ts +30 -30
- package/dist/commands/build/machine-dry-run.d.ts +3 -0
- package/dist/commands/build/machine-e2e-meta.d.ts +120 -0
- package/dist/commands/build/machine.d.ts +22 -22
- package/dist/commands/build/types.d.ts +2 -4
- package/dist/commands/ci/machine/contract.d.ts +26 -26
- package/dist/commands/ci/machine/formatters/sections/final-comment.d.ts +1 -5
- package/dist/commands/ci/machine/formatters/sections/format-helpers.d.ts +5 -0
- package/dist/commands/ci/machine/formatters/sections/index.d.ts +2 -2
- package/dist/commands/ci/machine/machine-execution-helpers.d.ts +40 -0
- package/dist/commands/ci/machine/machine-state-helpers.d.ts +14 -0
- package/dist/commands/ci/machine/machine.d.ts +12 -12
- package/dist/commands/ci/machine/types.d.ts +0 -5
- package/dist/commands/ci/utils/ci-summary.d.ts +15 -15
- package/dist/commands/ci/utils/execa-helpers.d.ts +1 -0
- package/dist/commands/db/apply/actors/idempotent-actors.d.ts +34 -0
- package/dist/commands/db/apply/actors/lock-actors.d.ts +16 -0
- package/dist/commands/db/apply/actors/pg-schema-diff-actors.d.ts +31 -0
- package/dist/commands/db/apply/actors/seed-actors.d.ts +11 -0
- package/dist/commands/db/apply/actors/shared.d.ts +9 -0
- package/dist/commands/db/apply/actors.d.ts +16 -65
- package/dist/commands/db/apply/contract.d.ts +8 -1
- package/dist/commands/db/apply/helpers/data-compatibility-checker.d.ts +3 -4
- package/dist/commands/db/apply/helpers/data-integrity-verifier.d.ts +37 -0
- package/dist/commands/db/apply/helpers/fresh-db-handler.d.ts +34 -0
- package/dist/commands/db/apply/helpers/hazard-handler.d.ts +60 -0
- package/dist/commands/db/apply/helpers/idempotent-object-registry.d.ts +96 -0
- package/dist/commands/db/apply/helpers/idempotent-transaction.d.ts +20 -0
- package/dist/commands/db/apply/helpers/index.d.ts +7 -1
- package/dist/commands/db/apply/helpers/partition-validator.d.ts +2 -15
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts +18 -162
- package/dist/commands/db/apply/helpers/pg-schema-diff-patterns.d.ts +55 -0
- package/dist/commands/db/apply/helpers/pg-schema-diff-version.d.ts +50 -0
- package/dist/commands/db/apply/helpers/plan-validator.d.ts +30 -10
- package/dist/commands/db/apply/helpers/rbac-password-manager.d.ts +34 -0
- package/dist/commands/db/apply/helpers/retry-logic.d.ts +16 -2
- package/dist/commands/db/apply/helpers/shadow-db-manager.d.ts +1 -1
- package/dist/commands/db/apply/helpers/sql-utils.d.ts +26 -0
- package/dist/commands/db/apply/machine.d.ts +52 -1
- package/dist/commands/db/commands/db-apply.d.ts +18 -0
- package/dist/commands/db/commands/db-sync/boundary-classifier.d.ts +21 -0
- package/dist/commands/db/commands/db-sync/plan-hazard-analyzer.d.ts +13 -0
- package/dist/commands/db/commands/db-sync/risk-reporter.d.ts +19 -0
- package/dist/commands/db/commands/db-sync/sql-parser.d.ts +25 -0
- package/dist/commands/db/commands/db-sync/types.d.ts +47 -0
- package/dist/commands/db/commands/db-sync.d.ts +14 -0
- package/dist/commands/db/sync/contract.d.ts +6 -2
- package/dist/commands/db/sync/machine.d.ts +2 -1
- package/dist/commands/db/types.d.ts +2 -0
- package/dist/commands/db/utils/boundary-policy/rule-compiler.d.ts +11 -0
- package/dist/commands/db/utils/boundary-policy/types.d.ts +105 -0
- package/dist/commands/db/utils/boundary-policy/validation.d.ts +20 -0
- package/dist/commands/db/utils/boundary-policy-runtime.d.ts +28 -0
- package/dist/commands/db/utils/boundary-policy.d.ts +5 -0
- package/dist/commands/db/utils/idempotent-risk-context.d.ts +29 -0
- package/dist/commands/db/utils/preflight-check.d.ts +14 -0
- package/dist/commands/db/utils/preflight-checks/domain-naming-checks.d.ts +106 -0
- package/dist/commands/db/utils/preflight-checks/orphan-checks.d.ts +36 -0
- package/dist/commands/db/utils/preflight-checks/schema-risk-checks.d.ts +22 -0
- package/dist/commands/db/utils/preflight-checks/supabase-checks.d.ts +55 -0
- package/dist/commands/db/utils/risk-detector-loader.d.ts +8 -0
- package/dist/commands/db/utils/schema-precheck-budget.d.ts +17 -0
- package/dist/commands/db/utils/sql-boundary-parser.d.ts +12 -0
- package/dist/commands/db/utils/sql-file-collector.d.ts +8 -0
- package/dist/commands/db/utils/sql-filename-parser.d.ts +20 -0
- package/dist/commands/db/utils/sql-table-extractor-ast.d.ts +19 -0
- package/dist/commands/db/utils/sql-table-extractor-regex.d.ts +50 -0
- package/dist/commands/db/utils/sql-table-extractor-rls.d.ts +13 -0
- package/dist/commands/db/utils/sql-table-extractor.d.ts +79 -1
- package/dist/commands/db/utils/table-registry-introspection.d.ts +68 -0
- package/dist/commands/db/utils/table-registry.d.ts +3 -38
- package/dist/commands/dev/actors/app-lifecycle.d.ts +18 -0
- package/dist/commands/dev/actors/index.d.ts +7 -2
- package/dist/commands/dev/actors/process-check.d.ts +12 -0
- package/dist/commands/dev/actors/shared.d.ts +15 -0
- package/dist/commands/dev/contract.d.ts +2 -2
- package/dist/commands/dev/machine.d.ts +7 -31
- package/dist/commands/env/commands/env-pull/auth.d.ts +13 -0
- package/dist/commands/env/commands/env-pull/dotenv-files.d.ts +14 -0
- package/dist/commands/env/commands/env-pull/security.d.ts +12 -0
- package/dist/commands/env/commands/env-pull/service.d.ts +8 -0
- package/dist/commands/env/commands/env-pull/shared.d.ts +79 -0
- package/dist/commands/env/commands/setup/types.d.ts +1 -1
- package/dist/commands/env/constants/local-supabase.d.ts +2 -0
- package/dist/commands/template-check/contract.d.ts +6 -6
- package/dist/commands/template-check/machine.d.ts +2 -2
- package/dist/commands/template-check/types.d.ts +0 -4
- package/dist/commands/template-check/utils/diff-analyzer.d.ts +0 -4
- package/dist/config/env.d.ts +4 -4
- package/dist/config-loader-GT3HAQ7U.js +7 -0
- package/dist/db-HR7CREX2.js +15913 -0
- package/dist/dev-A7RW6XQV.js +873 -0
- package/dist/env-B47Z4747.js +2624 -0
- package/dist/env-HMMRSYCI.js +7 -0
- package/dist/env-files-K2C7O7L5.js +8 -0
- package/dist/error-handler-4EYSDOSE.js +460 -0
- package/dist/hotfix-CULKKMGS.js +1477 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +48 -42912
- package/dist/init-ELK5QCWR.js +632 -0
- package/dist/inject-test-attrs-Y5UD5P7Q.js +36 -0
- package/dist/internal/machines/snapshot-helpers.d.ts +6 -0
- package/dist/lib/sql-comment-utils.d.ts +25 -0
- package/dist/license-OB7GVJQ2.js +468 -0
- package/dist/link-C43JRZWY.js +60 -0
- package/dist/manifest-2NOQ2IMK.js +32 -0
- package/dist/prepare-32DOVHTE.js +250 -0
- package/dist/risk-detector-BXUY2WKS.js +6 -0
- package/dist/risk-detector-core-O7I7SPR7.js +166 -0
- package/dist/risk-detector-plpgsql-SGMVKYJP.js +1856 -0
- package/dist/sdk-XK6HQU7S.js +348 -0
- package/dist/services-7VK5KZTO.js +177 -0
- package/dist/session-SFW5QSXZ.js +142 -0
- package/dist/signal-handler-DO3OANW5.js +6 -0
- package/dist/status-IJ4ZWHMX.js +95 -0
- package/dist/telemetry-FN7V727Y.js +94 -0
- package/dist/template-check-PNG5NQ5H.js +1933 -0
- package/dist/test-QYXE5UVW.js +626 -0
- package/dist/test-gen-QPWOIEHU.js +89 -0
- package/dist/ui-RJAMCWUI.js +331 -0
- package/dist/upgrade-3SLWVNAC.js +625 -0
- package/dist/utils/config-loader.d.ts +0 -3
- package/dist/validate-SM4PXPS7.js +55 -0
- package/dist/validators/risk-detector-content-risks.d.ts +13 -0
- package/dist/validators/risk-detector-core.d.ts +25 -0
- package/dist/validators/risk-detector-patterns.d.ts +15 -0
- package/dist/validators/risk-detector-plpgsql-expression-resolver.d.ts +22 -0
- package/dist/validators/risk-detector-plpgsql-parser.d.ts +5 -0
- package/dist/validators/risk-detector-plpgsql-tokenizer.d.ts +18 -0
- package/dist/validators/risk-detector-plpgsql.d.ts +9 -0
- package/dist/validators/risk-detector-text-utils.d.ts +6 -0
- package/dist/validators/risk-detector-types.d.ts +16 -0
- package/dist/validators/risk-detector.d.ts +7 -26
- package/dist/vuln-check-TYQNEFS7.js +122 -0
- package/dist/vuln-checker-2QXGN5YT.js +2950 -0
- package/dist/watch-UCDVOQAH.js +911 -0
- package/dist/workflow-ZB5Q2PFY.js +898 -0
- package/package.json +4 -1
- package/dist/cli/contract-mode.d.ts.map +0 -1
- package/dist/cli/contract-output.d.ts.map +0 -1
- package/dist/cli/early-flags.d.ts.map +0 -1
- package/dist/cli/error-handler.d.ts.map +0 -1
- package/dist/cli/exec.d.ts.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/json-output.d.ts.map +0 -1
- package/dist/cli/non-interactive.d.ts.map +0 -1
- package/dist/cli/output-format.d.ts.map +0 -1
- package/dist/cli/signal-handler.d.ts.map +0 -1
- package/dist/commands/build/actors/build.d.ts.map +0 -1
- package/dist/commands/build/actors/clean.d.ts.map +0 -1
- package/dist/commands/build/actors/db-sync.d.ts.map +0 -1
- package/dist/commands/build/actors/index.d.ts.map +0 -1
- package/dist/commands/build/actors/manifest.d.ts.map +0 -1
- package/dist/commands/build/actors/setup.d.ts.map +0 -1
- package/dist/commands/build/actors/static-checks.d.ts.map +0 -1
- package/dist/commands/build/actors/validate.d.ts.map +0 -1
- package/dist/commands/build/commands/build.d.ts.map +0 -1
- package/dist/commands/build/contract.d.ts.map +0 -1
- package/dist/commands/build/guards.d.ts.map +0 -1
- package/dist/commands/build/index.d.ts.map +0 -1
- package/dist/commands/build/machine.d.ts.map +0 -1
- package/dist/commands/build/types.d.ts.map +0 -1
- package/dist/commands/cache.d.ts.map +0 -1
- package/dist/commands/check/commands/check.d.ts.map +0 -1
- package/dist/commands/check/index.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-checks.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-layer-content.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-pr-capabilities.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-apply.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-db-operations.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-github.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-types.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-utils.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-prod-workflow.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-resolvers.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-static.d.ts.map +0 -1
- package/dist/commands/ci/commands/ci-supabase-local.d.ts.map +0 -1
- package/dist/commands/ci/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/app-build.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/app-start.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/build-and-playwright.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/playwright-install.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/build/static-checks.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/apply-seeds.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/collect-schema-stats.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/pgtap-install.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/production-preview.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/pull-production.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/reset.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/schema-stats.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/setup-roles.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/db/sync-schema.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/finalize/github.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/finalize/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/finalize/summary.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/local.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/pr-common.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/setup/pr-local.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/test/capabilities.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/test/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/actors/test/run-layers.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/ci-local.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/ci-pr.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/machine-runner.d.ts.map +0 -1
- package/dist/commands/ci/machine/commands/runtime-env.d.ts.map +0 -1
- package/dist/commands/ci/machine/contract.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/github-comment-types.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/github-comment.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/final-comment.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/format-helpers.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/progress-comment.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/sections/schema-matrix.d.ts.map +0 -1
- package/dist/commands/ci/machine/formatters/summary.d.ts.map +0 -1
- package/dist/commands/ci/machine/guards.d.ts.map +0 -1
- package/dist/commands/ci/machine/helpers.d.ts.map +0 -1
- package/dist/commands/ci/machine/index.d.ts.map +0 -1
- package/dist/commands/ci/machine/machine.d.ts.map +0 -1
- package/dist/commands/ci/machine/types.d.ts.map +0 -1
- package/dist/commands/ci/utils/ai-report.d.ts.map +0 -1
- package/dist/commands/ci/utils/app-process.d.ts.map +0 -1
- package/dist/commands/ci/utils/app-runtime.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-config.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-env-schema.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-logging.d.ts.map +0 -1
- package/dist/commands/ci/utils/ci-summary.d.ts.map +0 -1
- package/dist/commands/ci/utils/config-readers.d.ts.map +0 -1
- package/dist/commands/ci/utils/db-url-utils.d.ts.map +0 -1
- package/dist/commands/ci/utils/e2e-auth-setup.d.ts.map +0 -1
- package/dist/commands/ci/utils/env-security.d.ts.map +0 -1
- package/dist/commands/ci/utils/execa-helpers.d.ts.map +0 -1
- package/dist/commands/ci/utils/exit-code-computation.d.ts.map +0 -1
- package/dist/commands/ci/utils/github-api.d.ts.map +0 -1
- package/dist/commands/ci/utils/github.d.ts.map +0 -1
- package/dist/commands/ci/utils/index.d.ts.map +0 -1
- package/dist/commands/ci/utils/pgtap-installer.d.ts.map +0 -1
- package/dist/commands/ci/utils/rls-verification.d.ts.map +0 -1
- package/dist/commands/ci/utils/schema-operations.d.ts.map +0 -1
- package/dist/commands/ci/utils/seed-operations.d.ts.map +0 -1
- package/dist/commands/ci/utils/test-parallel.d.ts.map +0 -1
- package/dist/commands/ci/utils/timestamp-invariants.d.ts.map +0 -1
- package/dist/commands/ci/utils/workflow-idempotency.d.ts.map +0 -1
- package/dist/commands/db/apply/actors.d.ts.map +0 -1
- package/dist/commands/db/apply/contract.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/advisory-lock.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/data-compatibility-checker.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/index.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/partition-acl-cleaner.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/partition-prefilter.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/partition-validator.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/pg-schema-diff-helpers.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/plan-validator.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/retry-logic.d.ts.map +0 -1
- package/dist/commands/db/apply/helpers/shadow-db-manager.d.ts.map +0 -1
- package/dist/commands/db/apply/index.d.ts.map +0 -1
- package/dist/commands/db/apply/machine.d.ts.map +0 -1
- package/dist/commands/db/commands/db-apply.d.ts.map +0 -1
- package/dist/commands/db/commands/db-audit.d.ts.map +0 -1
- package/dist/commands/db/commands/db-backup.d.ts.map +0 -1
- package/dist/commands/db/commands/db-cleanup.d.ts.map +0 -1
- package/dist/commands/db/commands/db-derive-role-passwords.d.ts.map +0 -1
- package/dist/commands/db/commands/db-derive-urls.d.ts.map +0 -1
- package/dist/commands/db/commands/db-diagram.d.ts.map +0 -1
- package/dist/commands/db/commands/db-drizzle.d.ts.map +0 -1
- package/dist/commands/db/commands/db-extension.d.ts.map +0 -1
- package/dist/commands/db/commands/db-generate-password.d.ts.map +0 -1
- package/dist/commands/db/commands/db-lifecycle.d.ts.map +0 -1
- package/dist/commands/db/commands/db-rollback.d.ts.map +0 -1
- package/dist/commands/db/commands/db-schema.d.ts.map +0 -1
- package/dist/commands/db/commands/db-seed-metadata.d.ts.map +0 -1
- package/dist/commands/db/commands/db-seed-verify.d.ts.map +0 -1
- package/dist/commands/db/commands/db-seed.d.ts.map +0 -1
- package/dist/commands/db/commands/db-snapshot.d.ts.map +0 -1
- package/dist/commands/db/commands/db-stack.d.ts.map +0 -1
- package/dist/commands/db/commands/db-stats.d.ts.map +0 -1
- package/dist/commands/db/commands/db-sync.d.ts.map +0 -1
- package/dist/commands/db/commands/db-test.d.ts.map +0 -1
- package/dist/commands/db/constants.d.ts.map +0 -1
- package/dist/commands/db/extension-registry.d.ts.map +0 -1
- package/dist/commands/db/index.d.ts.map +0 -1
- package/dist/commands/db/preflight/actors.d.ts.map +0 -1
- package/dist/commands/db/preflight/contract.d.ts.map +0 -1
- package/dist/commands/db/preflight/index.d.ts.map +0 -1
- package/dist/commands/db/sync/actors.d.ts.map +0 -1
- package/dist/commands/db/sync/contract.d.ts.map +0 -1
- package/dist/commands/db/sync/index.d.ts.map +0 -1
- package/dist/commands/db/sync/machine.d.ts.map +0 -1
- package/dist/commands/db/types.d.ts.map +0 -1
- package/dist/commands/db/utils/db-target.d.ts.map +0 -1
- package/dist/commands/db/utils/db-url-builder.d.ts.map +0 -1
- package/dist/commands/db/utils/error-handlers.d.ts.map +0 -1
- package/dist/commands/db/utils/import-impact-analyzer.d.ts.map +0 -1
- package/dist/commands/db/utils/preflight-check.d.ts.map +0 -1
- package/dist/commands/db/utils/psql.d.ts.map +0 -1
- package/dist/commands/db/utils/schema-detector.d.ts.map +0 -1
- package/dist/commands/db/utils/schema-sync.d.ts.map +0 -1
- package/dist/commands/db/utils/script-runner.d.ts.map +0 -1
- package/dist/commands/db/utils/seed-manager.d.ts.map +0 -1
- package/dist/commands/db/utils/semantic-mapper.d.ts.map +0 -1
- package/dist/commands/db/utils/sql-table-extractor.d.ts.map +0 -1
- package/dist/commands/db/utils/stack-detector.d.ts.map +0 -1
- package/dist/commands/db/utils/table-registry.d.ts.map +0 -1
- package/dist/commands/db/utils/table-source-classifier.d.ts.map +0 -1
- package/dist/commands/dev/actors/index.d.ts.map +0 -1
- package/dist/commands/dev/commands/dev.d.ts.map +0 -1
- package/dist/commands/dev/contract.d.ts.map +0 -1
- package/dist/commands/dev/guards.d.ts.map +0 -1
- package/dist/commands/dev/helpers/stale-process-detector.d.ts.map +0 -1
- package/dist/commands/dev/machine.d.ts.map +0 -1
- package/dist/commands/dev/types.d.ts.map +0 -1
- package/dist/commands/env/commands/env-check.d.ts.map +0 -1
- package/dist/commands/env/commands/env-encrypt.d.ts.map +0 -1
- package/dist/commands/env/commands/env-pull.d.ts.map +0 -1
- package/dist/commands/env/commands/env-setup.d.ts.map +0 -1
- package/dist/commands/env/commands/env-sync.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/action.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/auth.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/file-export.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/github-api.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/helpers.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/index.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/parsers.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/prompts.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/supabase-api.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/types.d.ts.map +0 -1
- package/dist/commands/env/commands/setup/vercel-api.d.ts.map +0 -1
- package/dist/commands/env/constants/local-supabase.d.ts.map +0 -1
- package/dist/commands/env/index.d.ts.map +0 -1
- package/dist/commands/hotfix/actors.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-complete.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-create.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-deploy.d.ts.map +0 -1
- package/dist/commands/hotfix/commands/hotfix-status.d.ts.map +0 -1
- package/dist/commands/hotfix/contract.d.ts.map +0 -1
- package/dist/commands/hotfix/index.d.ts.map +0 -1
- package/dist/commands/hotfix/machine.d.ts.map +0 -1
- package/dist/commands/hotfix/metadata.d.ts.map +0 -1
- package/dist/commands/hotfix/utils/hotfix-machine-helper.d.ts.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/action.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/commands/inject-test-attrs.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/contract.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/detection-diagnostics.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/formatter.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/index.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/manifest-generator.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/processor-utils.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/processor.d.ts.map +0 -1
- package/dist/commands/inject-test-attrs/types.d.ts.map +0 -1
- package/dist/commands/link.d.ts.map +0 -1
- package/dist/commands/manifest/index.d.ts.map +0 -1
- package/dist/commands/prepare/commands/prepare.d.ts.map +0 -1
- package/dist/commands/prepare/index.d.ts.map +0 -1
- package/dist/commands/sdk/commands/publish.d.ts.map +0 -1
- package/dist/commands/sdk/index.d.ts.map +0 -1
- package/dist/commands/services/index.d.ts.map +0 -1
- package/dist/commands/session/index.d.ts.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/telemetry.d.ts.map +0 -1
- package/dist/commands/template-check/actors/compare.d.ts.map +0 -1
- package/dist/commands/template-check/actors/discover.d.ts.map +0 -1
- package/dist/commands/template-check/actors/index.d.ts.map +0 -1
- package/dist/commands/template-check/actors/report.d.ts.map +0 -1
- package/dist/commands/template-check/commands/template-check.d.ts.map +0 -1
- package/dist/commands/template-check/config.d.ts.map +0 -1
- package/dist/commands/template-check/contract.d.ts.map +0 -1
- package/dist/commands/template-check/index.d.ts.map +0 -1
- package/dist/commands/template-check/machine.d.ts.map +0 -1
- package/dist/commands/template-check/types.d.ts.map +0 -1
- package/dist/commands/template-check/utils/diff-analyzer.d.ts.map +0 -1
- package/dist/commands/template-check/utils/normalizer.d.ts.map +0 -1
- package/dist/commands/template-check/utils/path-mapping.d.ts.map +0 -1
- package/dist/commands/test/commands/test-db.d.ts.map +0 -1
- package/dist/commands/test/commands/test-e2e.d.ts.map +0 -1
- package/dist/commands/test/commands/test-fast.d.ts.map +0 -1
- package/dist/commands/test/commands/test-integration.d.ts.map +0 -1
- package/dist/commands/test/commands/test-layer.d.ts.map +0 -1
- package/dist/commands/test/commands/test-owasp-generate.d.ts.map +0 -1
- package/dist/commands/test/commands/test-service.d.ts.map +0 -1
- package/dist/commands/test/commands/test-static.d.ts.map +0 -1
- package/dist/commands/test/commands/test.d.ts.map +0 -1
- package/dist/commands/test/index.d.ts.map +0 -1
- package/dist/commands/test-gen.d.ts.map +0 -1
- package/dist/commands/ui.d.ts.map +0 -1
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/validate.d.ts.map +0 -1
- package/dist/commands/vuln-check.d.ts.map +0 -1
- package/dist/commands/watch.d.ts.map +0 -1
- package/dist/commands/workflow/commands/deploy-production.d.ts.map +0 -1
- package/dist/commands/workflow/commands/final-status.d.ts.map +0 -1
- package/dist/commands/workflow/commands/log.d.ts.map +0 -1
- package/dist/commands/workflow/commands/notify.d.ts.map +0 -1
- package/dist/commands/workflow/commands/paths.d.ts.map +0 -1
- package/dist/commands/workflow/commands/sync.d.ts.map +0 -1
- package/dist/commands/workflow/commands/validate.d.ts.map +0 -1
- package/dist/commands/workflow/commands/verify-credentials.d.ts.map +0 -1
- package/dist/commands/workflow/index.d.ts.map +0 -1
- package/dist/commands/workflow/types.d.ts.map +0 -1
- package/dist/config/env-files.d.ts.map +0 -1
- package/dist/config/env.d.ts.map +0 -1
- package/dist/constants/versions.d.ts.map +0 -1
- package/dist/contracts/envelope.d.ts.map +0 -1
- package/dist/errors/catalog.d.ts.map +0 -1
- package/dist/errors/exit-codes.d.ts.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/incremental/affected-tests.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/internal/machines/index.d.ts.map +0 -1
- package/dist/internal/machines/machine-runner.d.ts.map +0 -1
- package/dist/internal/machines/snapshot-helpers.d.ts.map +0 -1
- package/dist/internal/machines/types.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/dependency-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/rls-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/secret-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/analyzers/typescript-analyzer.d.ts.map +0 -1
- package/dist/internal/vuln-checker/config/loader.d.ts.map +0 -1
- package/dist/internal/vuln-checker/constants.d.ts.map +0 -1
- package/dist/internal/vuln-checker/ignore/matcher.d.ts.map +0 -1
- package/dist/internal/vuln-checker/index.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/console-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/json-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/markdown-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/reporters/sarif-reporter.d.ts.map +0 -1
- package/dist/internal/vuln-checker/security/path-validation.d.ts.map +0 -1
- package/dist/internal/vuln-checker/types.d.ts.map +0 -1
- package/dist/notifiers/desktop-notifier.d.ts.map +0 -1
- package/dist/ui/components/db-panel.d.ts.map +0 -1
- package/dist/ui/components/status-bar.d.ts.map +0 -1
- package/dist/ui/components/test-panel.d.ts.map +0 -1
- package/dist/ui/dashboard.d.ts.map +0 -1
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/utils/config-loader.d.ts.map +0 -1
- package/dist/utils/config-updater.d.ts.map +0 -1
- package/dist/utils/diagnostics.d.ts.map +0 -1
- package/dist/utils/dotenvx.d.ts.map +0 -1
- package/dist/utils/env-local-bridge.d.ts.map +0 -1
- package/dist/utils/execution-plan.d.ts.map +0 -1
- package/dist/utils/github-output-security.d.ts.map +0 -1
- package/dist/utils/help-system.d.ts.map +0 -1
- package/dist/utils/license/admin-auth.d.ts.map +0 -1
- package/dist/utils/license/allowlist-checker.d.ts.map +0 -1
- package/dist/utils/license/ci-detector.d.ts.map +0 -1
- package/dist/utils/license/index.d.ts.map +0 -1
- package/dist/utils/license/owner-resolver.d.ts.map +0 -1
- package/dist/utils/license/types.d.ts.map +0 -1
- package/dist/utils/license/validate-owner.d.ts.map +0 -1
- package/dist/utils/path-security.d.ts.map +0 -1
- package/dist/utils/port-allocator.d.ts.map +0 -1
- package/dist/utils/secure-exec.d.ts.map +0 -1
- package/dist/utils/template-fetcher.d.ts.map +0 -1
- package/dist/utils/type-guards.d.ts.map +0 -1
- package/dist/utils/vercel-project.d.ts.map +0 -1
- package/dist/utils/workspace-detector.d.ts.map +0 -1
- package/dist/validators/risk-detector.d.ts.map +0 -1
- package/dist/validators/schema-validator.d.ts.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/watchers/schema-watcher.d.ts.map +0 -1
- package/dist/watchers/test-watcher.d.ts.map +0 -1
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
4
|
+
import { spawnSync, execFileSync } from 'child_process';
|
|
5
|
+
import { execa } from 'execa';
|
|
6
|
+
import { existsSync, readFileSync, readdirSync } from 'fs';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
import { isIP } from 'net';
|
|
9
|
+
|
|
10
|
+
createRequire(import.meta.url);
|
|
11
|
+
|
|
12
|
+
// src/commands/db/utils/psql.ts
|
|
13
|
+
init_esm_shims();
|
|
14
|
+
function parsePostgresUrl(url) {
|
|
15
|
+
const u = new URL(url);
|
|
16
|
+
const host = u.hostname;
|
|
17
|
+
const port = u.port || "5432";
|
|
18
|
+
const user = u.username || "postgres";
|
|
19
|
+
const password = u.password || void 0;
|
|
20
|
+
const database = u.pathname.replace(/^\//, "") || "postgres";
|
|
21
|
+
return { host, port, user, database, password };
|
|
22
|
+
}
|
|
23
|
+
function buildPsqlArgs(conn, options) {
|
|
24
|
+
const args = ["-X", "-h", conn.host, "-p", conn.port, "-U", conn.user, "-d", conn.database];
|
|
25
|
+
if (options?.onErrorStop !== false) {
|
|
26
|
+
args.splice(1, 0, "-v", "ON_ERROR_STOP=1");
|
|
27
|
+
}
|
|
28
|
+
return args;
|
|
29
|
+
}
|
|
30
|
+
function buildPsqlEnv(conn) {
|
|
31
|
+
if (!conn.password) return { ...process.env };
|
|
32
|
+
return { ...process.env, PGPASSWORD: conn.password };
|
|
33
|
+
}
|
|
34
|
+
function psqlSyncQuery(params) {
|
|
35
|
+
const conn = parsePostgresUrl(params.databaseUrl);
|
|
36
|
+
const args = buildPsqlArgs(conn, { onErrorStop: false });
|
|
37
|
+
const result = spawnSync("psql", [...args, "-t", "-c", params.sql], {
|
|
38
|
+
encoding: "utf-8",
|
|
39
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
40
|
+
env: buildPsqlEnv(conn),
|
|
41
|
+
timeout: params.timeout ?? 1e4
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
status: result.status,
|
|
45
|
+
stdout: result.stdout || "",
|
|
46
|
+
stderr: result.stderr || ""
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function psqlSyncFile(params) {
|
|
50
|
+
const conn = parsePostgresUrl(params.databaseUrl);
|
|
51
|
+
const args = buildPsqlArgs(conn, { onErrorStop: params.onErrorStop ?? true });
|
|
52
|
+
const result = spawnSync("psql", [...args, "-f", params.filePath], {
|
|
53
|
+
encoding: "utf-8",
|
|
54
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
55
|
+
env: buildPsqlEnv(conn)
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
status: result.status,
|
|
59
|
+
stdout: result.stdout || "",
|
|
60
|
+
stderr: result.stderr || ""
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
async function psqlQuery(params) {
|
|
64
|
+
const conn = parsePostgresUrl(params.databaseUrl);
|
|
65
|
+
const args = buildPsqlArgs(conn);
|
|
66
|
+
if (params.mode === "scalar") {
|
|
67
|
+
const { stdout: stdout2 } = await execa("psql", [...args, "-A", "-t", "-c", params.sql], {
|
|
68
|
+
env: buildPsqlEnv(conn),
|
|
69
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
70
|
+
});
|
|
71
|
+
return stdout2.trim();
|
|
72
|
+
}
|
|
73
|
+
const { stdout } = await execa("psql", [...args, "-A", "-t", "-c", params.sql], {
|
|
74
|
+
env: buildPsqlEnv(conn),
|
|
75
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
76
|
+
});
|
|
77
|
+
return stdout.trim();
|
|
78
|
+
}
|
|
79
|
+
async function psqlExec(params) {
|
|
80
|
+
const conn = parsePostgresUrl(params.databaseUrl);
|
|
81
|
+
const args = buildPsqlArgs(conn);
|
|
82
|
+
await execa("psql", [...args, "-c", params.sql], {
|
|
83
|
+
env: buildPsqlEnv(conn),
|
|
84
|
+
stdio: "inherit"
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// src/lib/sql-comment-utils.ts
|
|
89
|
+
init_esm_shims();
|
|
90
|
+
var DOLLAR_TAG_PATTERN = /^\$([a-zA-Z_][a-zA-Z0-9_]*)?\$/;
|
|
91
|
+
function isOutsideAllQuotes(state) {
|
|
92
|
+
return !state.inSingleQuote && !state.inDoubleQuote && !state.inDollarQuote;
|
|
93
|
+
}
|
|
94
|
+
function tryConsumeLineComment(content, state) {
|
|
95
|
+
if (!isOutsideAllQuotes(state)) return false;
|
|
96
|
+
if (content[state.i] !== "-" || content[state.i + 1] !== "-") return false;
|
|
97
|
+
while (state.i < content.length && content[state.i] !== "\n") {
|
|
98
|
+
state.result += " ";
|
|
99
|
+
state.i += 1;
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
function tryConsumeBlockComment(content, state) {
|
|
104
|
+
if (!isOutsideAllQuotes(state)) return false;
|
|
105
|
+
if (content[state.i] !== "/" || content[state.i + 1] !== "*") return false;
|
|
106
|
+
let depth = 1;
|
|
107
|
+
state.result += " ";
|
|
108
|
+
state.i += 2;
|
|
109
|
+
while (state.i < content.length && depth > 0) {
|
|
110
|
+
const current = content[state.i] ?? "";
|
|
111
|
+
const next = content[state.i + 1] ?? "";
|
|
112
|
+
if (current === "/" && next === "*") {
|
|
113
|
+
depth += 1;
|
|
114
|
+
state.result += " ";
|
|
115
|
+
state.i += 2;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (current === "*" && next === "/") {
|
|
119
|
+
depth -= 1;
|
|
120
|
+
state.result += " ";
|
|
121
|
+
state.i += 2;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
state.result += current === "\n" ? "\n" : " ";
|
|
125
|
+
state.i += 1;
|
|
126
|
+
}
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
function tryConsumeDollarQuoteDelimiter(content, state) {
|
|
130
|
+
if (state.inSingleQuote || state.inDoubleQuote) return false;
|
|
131
|
+
if (content[state.i] !== "$") return false;
|
|
132
|
+
if (state.inDollarQuote) {
|
|
133
|
+
const closeTag = `$${state.dollarTag}$`;
|
|
134
|
+
if (content.slice(state.i).startsWith(closeTag)) {
|
|
135
|
+
state.result += closeTag;
|
|
136
|
+
state.i += closeTag.length;
|
|
137
|
+
state.inDollarQuote = false;
|
|
138
|
+
state.dollarTag = "";
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
const tagMatch = content.slice(state.i).match(DOLLAR_TAG_PATTERN);
|
|
144
|
+
if (!tagMatch) return false;
|
|
145
|
+
state.inDollarQuote = true;
|
|
146
|
+
state.dollarTag = tagMatch[1] ?? "";
|
|
147
|
+
state.result += tagMatch[0];
|
|
148
|
+
state.i += tagMatch[0].length;
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
function consumeEQuotedString(content, state) {
|
|
152
|
+
state.result += content[state.i] ?? "";
|
|
153
|
+
state.result += "'";
|
|
154
|
+
state.i += 2;
|
|
155
|
+
while (state.i < content.length) {
|
|
156
|
+
const current = content[state.i] ?? "";
|
|
157
|
+
const next = content[state.i + 1] ?? "";
|
|
158
|
+
if (current === "\\" && state.i + 1 < content.length) {
|
|
159
|
+
state.result += current;
|
|
160
|
+
state.result += next;
|
|
161
|
+
state.i += 2;
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
if (current === "'") {
|
|
165
|
+
if (next === "'") {
|
|
166
|
+
state.result += "''";
|
|
167
|
+
state.i += 2;
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
state.result += current;
|
|
171
|
+
state.i += 1;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
state.result += current;
|
|
175
|
+
state.i += 1;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function tryConsumeEQuotedString(content, state) {
|
|
179
|
+
if (!isOutsideAllQuotes(state)) return false;
|
|
180
|
+
const current = content[state.i] ?? "";
|
|
181
|
+
const next = content[state.i + 1] ?? "";
|
|
182
|
+
if (current !== "E" && current !== "e" || next !== "'") return false;
|
|
183
|
+
consumeEQuotedString(content, state);
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
function tryToggleSingleQuote(content, state) {
|
|
187
|
+
if (state.inDoubleQuote || state.inDollarQuote) return false;
|
|
188
|
+
if (content[state.i] !== "'") return false;
|
|
189
|
+
if (state.inSingleQuote && content[state.i + 1] === "'") {
|
|
190
|
+
state.result += "''";
|
|
191
|
+
state.i += 2;
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
state.inSingleQuote = !state.inSingleQuote;
|
|
195
|
+
state.result += "'";
|
|
196
|
+
state.i += 1;
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
function tryToggleDoubleQuote(content, state) {
|
|
200
|
+
if (state.inSingleQuote || state.inDollarQuote) return false;
|
|
201
|
+
if (content[state.i] !== '"') return false;
|
|
202
|
+
if (state.inDoubleQuote && content[state.i + 1] === '"') {
|
|
203
|
+
state.result += '""';
|
|
204
|
+
state.i += 2;
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
state.inDoubleQuote = !state.inDoubleQuote;
|
|
208
|
+
state.result += '"';
|
|
209
|
+
state.i += 1;
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
function stripSqlComments(content) {
|
|
213
|
+
const state = {
|
|
214
|
+
i: 0,
|
|
215
|
+
result: "",
|
|
216
|
+
inSingleQuote: false,
|
|
217
|
+
inDoubleQuote: false,
|
|
218
|
+
inDollarQuote: false,
|
|
219
|
+
dollarTag: ""
|
|
220
|
+
};
|
|
221
|
+
while (state.i < content.length) {
|
|
222
|
+
if (tryConsumeLineComment(content, state)) continue;
|
|
223
|
+
if (tryConsumeBlockComment(content, state)) continue;
|
|
224
|
+
if (tryConsumeDollarQuoteDelimiter(content, state)) continue;
|
|
225
|
+
if (tryConsumeEQuotedString(content, state)) continue;
|
|
226
|
+
if (tryToggleSingleQuote(content, state)) continue;
|
|
227
|
+
if (tryToggleDoubleQuote(content, state)) continue;
|
|
228
|
+
state.result += content[state.i] ?? "";
|
|
229
|
+
state.i += 1;
|
|
230
|
+
}
|
|
231
|
+
return state.result;
|
|
232
|
+
}
|
|
233
|
+
function blankDollarQuotedBodies(content) {
|
|
234
|
+
let result = "";
|
|
235
|
+
let i = 0;
|
|
236
|
+
while (i < content.length) {
|
|
237
|
+
const handled = consumeDollarQuotedBody(content, i);
|
|
238
|
+
if (!handled) {
|
|
239
|
+
result += content[i] ?? "";
|
|
240
|
+
i += 1;
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
result += handled.value;
|
|
244
|
+
i = handled.next;
|
|
245
|
+
}
|
|
246
|
+
return result;
|
|
247
|
+
}
|
|
248
|
+
function parseDollarTagAt(content, index) {
|
|
249
|
+
if (content[index] !== "$") return null;
|
|
250
|
+
const tagMatch = content.slice(index).match(DOLLAR_TAG_PATTERN);
|
|
251
|
+
return tagMatch ? tagMatch[0] : null;
|
|
252
|
+
}
|
|
253
|
+
function blankRangePreservingNewlines(content, start, end) {
|
|
254
|
+
let result = "";
|
|
255
|
+
for (let i = start; i < end; i += 1) {
|
|
256
|
+
result += content[i] === "\n" ? "\n" : " ";
|
|
257
|
+
}
|
|
258
|
+
return result;
|
|
259
|
+
}
|
|
260
|
+
function consumeDollarQuotedBody(content, index) {
|
|
261
|
+
const openTag = parseDollarTagAt(content, index);
|
|
262
|
+
if (!openTag) return null;
|
|
263
|
+
const bodyStart = index + openTag.length;
|
|
264
|
+
const closeIdx = content.indexOf(openTag, bodyStart);
|
|
265
|
+
if (closeIdx < 0) {
|
|
266
|
+
return {
|
|
267
|
+
value: `${openTag}${blankRangePreservingNewlines(content, bodyStart, content.length)}`,
|
|
268
|
+
next: content.length
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
value: `${openTag}${blankRangePreservingNewlines(content, bodyStart, closeIdx)}${openTag}`,
|
|
273
|
+
next: closeIdx + openTag.length
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// src/commands/db/utils/schema-detector.ts
|
|
278
|
+
init_esm_shims();
|
|
279
|
+
var EXCLUDED_SCHEMAS = /* @__PURE__ */ new Set([
|
|
280
|
+
// PostgreSQL system
|
|
281
|
+
"pg_catalog",
|
|
282
|
+
"information_schema",
|
|
283
|
+
"pg_toast",
|
|
284
|
+
// Supabase services
|
|
285
|
+
"auth",
|
|
286
|
+
"storage",
|
|
287
|
+
"realtime",
|
|
288
|
+
"pgsodium",
|
|
289
|
+
"pgsodium_masks",
|
|
290
|
+
// Supabase extensions
|
|
291
|
+
"extensions",
|
|
292
|
+
"graphql",
|
|
293
|
+
"graphql_public",
|
|
294
|
+
"net",
|
|
295
|
+
"vault",
|
|
296
|
+
// Supabase internal
|
|
297
|
+
"supabase_functions",
|
|
298
|
+
"supabase_migrations",
|
|
299
|
+
"pgbouncer",
|
|
300
|
+
"cron"
|
|
301
|
+
]);
|
|
302
|
+
var IDENTIFIER_PATTERN = "[A-Za-z_][A-Za-z0-9_]*";
|
|
303
|
+
var SQL_IDENTIFIER = `(?:"(?:[^"]|"")*"|${IDENTIFIER_PATTERN})`;
|
|
304
|
+
var CREATE_SCHEMA_PATTERN = new RegExp(
|
|
305
|
+
`^\\s*CREATE\\s+SCHEMA\\s+(?:IF\\s+NOT\\s+EXISTS\\s+)?(${SQL_IDENTIFIER})`,
|
|
306
|
+
"gim"
|
|
307
|
+
);
|
|
308
|
+
function collectSchemaSqlFiles(schemasDir) {
|
|
309
|
+
const entries = readdirSync(schemasDir, { withFileTypes: true });
|
|
310
|
+
const files = [];
|
|
311
|
+
for (const entry of entries) {
|
|
312
|
+
const filePath = join(schemasDir, entry.name);
|
|
313
|
+
if (entry.isDirectory()) {
|
|
314
|
+
files.push(...collectSchemaSqlFiles(filePath));
|
|
315
|
+
} else if (entry.isFile() && filePath.endsWith(".sql")) {
|
|
316
|
+
files.push(filePath);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return files;
|
|
320
|
+
}
|
|
321
|
+
function unquoteIdentifier(identifier) {
|
|
322
|
+
const trimmed = identifier.trim();
|
|
323
|
+
if (trimmed.startsWith('"') && trimmed.endsWith('"')) {
|
|
324
|
+
return trimmed.slice(1, -1).replace(/""/g, '"');
|
|
325
|
+
}
|
|
326
|
+
return trimmed;
|
|
327
|
+
}
|
|
328
|
+
function detectAppSchemas(schemasDir, verbose) {
|
|
329
|
+
const schemas = /* @__PURE__ */ new Set(["public"]);
|
|
330
|
+
if (!existsSync(schemasDir)) {
|
|
331
|
+
return Array.from(schemas);
|
|
332
|
+
}
|
|
333
|
+
const files = collectSchemaSqlFiles(schemasDir).sort();
|
|
334
|
+
for (const file of files) {
|
|
335
|
+
const content = readFileSync(file, "utf-8");
|
|
336
|
+
const contentWithoutComments = stripSqlComments(content);
|
|
337
|
+
CREATE_SCHEMA_PATTERN.lastIndex = 0;
|
|
338
|
+
const matches = contentWithoutComments.matchAll(CREATE_SCHEMA_PATTERN);
|
|
339
|
+
for (const match of Array.from(matches)) {
|
|
340
|
+
const schemaNameRaw = unquoteIdentifier(match[1] ?? "");
|
|
341
|
+
if (!schemaNameRaw) {
|
|
342
|
+
continue;
|
|
343
|
+
}
|
|
344
|
+
const schemaName = schemaNameRaw.toLowerCase();
|
|
345
|
+
if (!EXCLUDED_SCHEMAS.has(schemaName)) {
|
|
346
|
+
schemas.add(schemaName);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
const result = Array.from(schemas).sort();
|
|
351
|
+
if (verbose) {
|
|
352
|
+
console.log(` \u2192 Detected app schemas: ${result.join(", ")}`);
|
|
353
|
+
}
|
|
354
|
+
return result;
|
|
355
|
+
}
|
|
356
|
+
var VALID_PG_IDENTIFIER = /^[a-zA-Z_][a-zA-Z0-9_]{0,62}$/;
|
|
357
|
+
function formatSchemasForSql(schemas) {
|
|
358
|
+
return schemas.map((s) => {
|
|
359
|
+
if (!VALID_PG_IDENTIFIER.test(s)) {
|
|
360
|
+
throw new Error(`Invalid schema name "${s}": must be a valid PostgreSQL identifier`);
|
|
361
|
+
}
|
|
362
|
+
return `'${s.replace(/'/g, "''")}'`;
|
|
363
|
+
}).join(", ");
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// src/commands/ci/utils/db-url-utils.ts
|
|
367
|
+
init_esm_shims();
|
|
368
|
+
function resolveHostToIPv4(hostname) {
|
|
369
|
+
const ipVersion = isIP(hostname);
|
|
370
|
+
if (ipVersion === 4) return hostname;
|
|
371
|
+
if (ipVersion === 6) return null;
|
|
372
|
+
try {
|
|
373
|
+
const output = execFileSync("getent", ["ahostsv4", hostname], {
|
|
374
|
+
encoding: "utf-8",
|
|
375
|
+
timeout: 5e3,
|
|
376
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
377
|
+
});
|
|
378
|
+
const firstLine = output.split("\n").find((l) => l.trim().length > 0);
|
|
379
|
+
if (!firstLine) return null;
|
|
380
|
+
const ip = firstLine.trim().split(/\s+/u)[0] ?? "";
|
|
381
|
+
return isIP(ip) === 4 ? ip : null;
|
|
382
|
+
} catch {
|
|
383
|
+
return null;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
function normalizeDatabaseUrlForDdl(databaseUrl) {
|
|
387
|
+
try {
|
|
388
|
+
const url = new URL(databaseUrl);
|
|
389
|
+
const port = url.port ? Number(url.port) : void 0;
|
|
390
|
+
if (port === 6543) url.port = "5432";
|
|
391
|
+
if (url.searchParams.has("pgbouncer")) url.searchParams.delete("pgbouncer");
|
|
392
|
+
if (process.env.CI === "true") {
|
|
393
|
+
const ipv4 = resolveHostToIPv4(url.hostname);
|
|
394
|
+
if (ipv4) {
|
|
395
|
+
url.hostname = ipv4;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
return url.toString();
|
|
399
|
+
} catch {
|
|
400
|
+
return databaseUrl;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function parseBoolish(value) {
|
|
404
|
+
return value === "t" || value === "true" || value === "1";
|
|
405
|
+
}
|
|
406
|
+
function isIPv6Only(hostname) {
|
|
407
|
+
const ipVersion = isIP(hostname);
|
|
408
|
+
if (ipVersion === 4) return false;
|
|
409
|
+
if (ipVersion === 6) return true;
|
|
410
|
+
const ipv4 = resolveHostToIPv4(hostname);
|
|
411
|
+
if (ipv4) return false;
|
|
412
|
+
try {
|
|
413
|
+
const output = execFileSync("getent", ["ahosts", hostname], {
|
|
414
|
+
encoding: "utf-8",
|
|
415
|
+
timeout: 5e3,
|
|
416
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
417
|
+
});
|
|
418
|
+
return output.trim().length > 0;
|
|
419
|
+
} catch {
|
|
420
|
+
return false;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
function appendIpv4AddonGuidance(error) {
|
|
424
|
+
return `${error}
|
|
425
|
+
|
|
426
|
+
\u{1F4A1} **\u89E3\u6C7A\u7B56**: Supabase IPv4 Add-on \u3092\u6709\u52B9\u5316\u3057\u3066\u304F\u3060\u3055\u3044 ($4/month)
|
|
427
|
+
Supabase Dashboard \u2192 Project Settings \u2192 Add-ons \u2192 IPv4 Add-on
|
|
428
|
+
(GitHub Actions \u306F IPv6 \u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093)`;
|
|
429
|
+
}
|
|
430
|
+
function appendConnectionRefusedGuidance(error) {
|
|
431
|
+
return `${error}
|
|
432
|
+
|
|
433
|
+
\u{1F4A1} **\u78BA\u8A8D\u4E8B\u9805**:
|
|
434
|
+
1. DATABASE_URL \u304C Direct URL (port 5432) \u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\u304B\uFF1F
|
|
435
|
+
2. Supabase \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u304C\u7A3C\u50CD\u4E2D\u3067\u3059\u304B\uFF1F`;
|
|
436
|
+
}
|
|
437
|
+
function appendAuthFailureGuidance(error) {
|
|
438
|
+
return `${error}
|
|
439
|
+
|
|
440
|
+
\u{1F4A1} **\u78BA\u8A8D\u4E8B\u9805**:
|
|
441
|
+
1. DATABASE_URL \u306E\u30D1\u30B9\u30EF\u30FC\u30C9\u304C\u6B63\u3057\u3044\u3067\u3059\u304B\uFF1F
|
|
442
|
+
2. Supabase Database Settings \u3067\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u30EA\u30BB\u30C3\u30C8\u3067\u304D\u307E\u3059`;
|
|
443
|
+
}
|
|
444
|
+
function isIpv6ConnectionError(error) {
|
|
445
|
+
return error.includes("Network is unreachable") || error.includes("IPv6");
|
|
446
|
+
}
|
|
447
|
+
function hasIpv6AddressPattern(error) {
|
|
448
|
+
return /\([0-9a-f:]+\)/i.test(error);
|
|
449
|
+
}
|
|
450
|
+
function canDetectIpv6OnlyFromUrl(databaseUrl) {
|
|
451
|
+
try {
|
|
452
|
+
const url = new URL(databaseUrl);
|
|
453
|
+
return isIPv6Only(url.hostname);
|
|
454
|
+
} catch {
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function shouldShowIpv4AddonGuidance(error, databaseUrl) {
|
|
459
|
+
if (!isIpv6ConnectionError(error)) {
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
if (databaseUrl && canDetectIpv6OnlyFromUrl(databaseUrl)) {
|
|
463
|
+
return true;
|
|
464
|
+
}
|
|
465
|
+
return hasIpv6AddressPattern(error);
|
|
466
|
+
}
|
|
467
|
+
function enhanceConnectionError(error, databaseUrl) {
|
|
468
|
+
if (shouldShowIpv4AddonGuidance(error, databaseUrl)) {
|
|
469
|
+
return appendIpv4AddonGuidance(error);
|
|
470
|
+
}
|
|
471
|
+
if (error.includes("Connection refused") || error.includes("connection refused")) {
|
|
472
|
+
return appendConnectionRefusedGuidance(error);
|
|
473
|
+
}
|
|
474
|
+
if (error.includes("password authentication failed") || error.includes("FATAL: password")) {
|
|
475
|
+
return appendAuthFailureGuidance(error);
|
|
476
|
+
}
|
|
477
|
+
return error;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export { blankDollarQuotedBodies, buildPsqlArgs, buildPsqlEnv, detectAppSchemas, enhanceConnectionError, formatSchemasForSql, normalizeDatabaseUrlForDdl, parseBoolish, parsePostgresUrl, psqlExec, psqlQuery, psqlSyncFile, psqlSyncQuery, stripSqlComments };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
4
|
+
import { existsSync, realpathSync } from 'fs';
|
|
5
|
+
import { resolve, sep, isAbsolute, relative, normalize } from 'path';
|
|
6
|
+
|
|
7
|
+
createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// src/utils/path-security.ts
|
|
10
|
+
init_esm_shims();
|
|
11
|
+
function safeRealpath(targetPath) {
|
|
12
|
+
try {
|
|
13
|
+
if (existsSync(targetPath)) {
|
|
14
|
+
return realpathSync(targetPath);
|
|
15
|
+
}
|
|
16
|
+
return targetPath;
|
|
17
|
+
} catch {
|
|
18
|
+
return targetPath;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
var SHELL_METACHARACTERS = /[|;`$&<>]/;
|
|
22
|
+
function isControlChar(charCode) {
|
|
23
|
+
return charCode <= 31 || charCode === 127;
|
|
24
|
+
}
|
|
25
|
+
function hasNoDangerousChars(userPath) {
|
|
26
|
+
if (SHELL_METACHARACTERS.test(userPath)) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
for (let i = 0; i < userPath.length; i++) {
|
|
30
|
+
if (isControlChar(userPath.charCodeAt(i))) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
function containsPathTraversal(userPath) {
|
|
37
|
+
const normalized = normalize(userPath);
|
|
38
|
+
if (normalized.includes("..")) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
if (normalized.startsWith("/") || normalized.startsWith("\\")) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
function validateSafePath(userPath, baseDir) {
|
|
47
|
+
if (!userPath || userPath.trim() === "") {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
if (!hasNoDangerousChars(userPath)) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
if (containsPathTraversal(userPath)) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
const absoluteBase = resolve(baseDir);
|
|
57
|
+
const absolutePath = resolve(baseDir, userPath);
|
|
58
|
+
const realBase = safeRealpath(absoluteBase);
|
|
59
|
+
const realPath = safeRealpath(absolutePath);
|
|
60
|
+
const relativePath = relative(realBase, realPath);
|
|
61
|
+
if (relativePath.startsWith("..") || isAbsolute(relativePath)) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
function resolveSafePath(baseDir, userPath) {
|
|
67
|
+
if (!validateSafePath(userPath, baseDir)) {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`Invalid path: '${userPath}' is not allowed. Path must be relative and within the base directory.`
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
return resolve(baseDir, userPath);
|
|
73
|
+
}
|
|
74
|
+
function filterSafePaths(paths, baseDir, logger) {
|
|
75
|
+
return paths.filter((p) => {
|
|
76
|
+
const safe = validateSafePath(p, baseDir);
|
|
77
|
+
if (!safe && logger) {
|
|
78
|
+
logger.warn(`Rejected unsafe path: '${p}'`);
|
|
79
|
+
}
|
|
80
|
+
return safe;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
var MAX_DIRECTORY_TRAVERSAL_DEPTH = 10;
|
|
84
|
+
var SAFE_ENV_SUFFIX_PATTERN = /^[a-zA-Z0-9._-]+$/;
|
|
85
|
+
function validateEnvSuffix(suffix) {
|
|
86
|
+
if (!suffix || suffix.trim() === "") {
|
|
87
|
+
throw new Error("Environment suffix cannot be empty");
|
|
88
|
+
}
|
|
89
|
+
if (suffix.includes("..") || suffix.includes("/") || suffix.includes("\\")) {
|
|
90
|
+
throw new Error(`Environment suffix '${suffix}' contains path traversal sequences`);
|
|
91
|
+
}
|
|
92
|
+
if (!SAFE_ENV_SUFFIX_PATTERN.test(suffix)) {
|
|
93
|
+
throw new Error(
|
|
94
|
+
`Environment suffix '${suffix}' contains invalid characters. Only alphanumeric, dots, hyphens, and underscores are allowed.`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function isPathContained(basePath, targetPath) {
|
|
99
|
+
const normalizedBase = resolve(basePath);
|
|
100
|
+
const normalizedTarget = resolve(targetPath);
|
|
101
|
+
const realBase = safeRealpath(normalizedBase);
|
|
102
|
+
const realTarget = safeRealpath(normalizedTarget);
|
|
103
|
+
return realTarget === realBase || realTarget.startsWith(realBase + sep);
|
|
104
|
+
}
|
|
105
|
+
function validateUserFilePath(filePath, baseDir) {
|
|
106
|
+
if (!filePath || filePath.trim() === "") {
|
|
107
|
+
throw new Error("File path cannot be empty");
|
|
108
|
+
}
|
|
109
|
+
if (!hasNoDangerousChars(filePath)) {
|
|
110
|
+
throw new Error(
|
|
111
|
+
"File path contains dangerous characters. Shell metacharacters and control characters are not allowed."
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
const resolvedPath = isAbsolute(filePath) ? resolve(filePath) : resolve(baseDir, filePath);
|
|
115
|
+
if (!isPathContained(baseDir, resolvedPath)) {
|
|
116
|
+
throw new Error(
|
|
117
|
+
"File path resolves outside the allowed directory. Path must be within the project root."
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
return resolvedPath;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { MAX_DIRECTORY_TRAVERSAL_DEPTH, filterSafePaths, isPathContained, resolveSafePath, validateEnvSuffix, validateUserFilePath };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module';
|
|
3
|
+
import { init_esm_shims } from './chunk-VRXHCR5K.js';
|
|
4
|
+
|
|
5
|
+
createRequire(import.meta.url);
|
|
6
|
+
|
|
7
|
+
// src/version.ts
|
|
8
|
+
init_esm_shims();
|
|
9
|
+
var CLI_VERSION = "0.6.0";
|
|
10
|
+
var HAS_ADMIN_COMMAND = false;
|
|
11
|
+
|
|
12
|
+
export { CLI_VERSION, HAS_ADMIN_COMMAND };
|