checkly 9.5.0 → 10.0.0-prerelease-4f88d60
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 +10 -0
- package/bin/launch.cjs +12 -0
- package/dist/ai-context/context.js +1 -0
- package/dist/ai-context/context.js.map +1 -1
- package/dist/ai-context/onboarding-boilerplate/checkly-config-template.ts +2 -2
- package/dist/ai-context/public-skills/checkly/SKILL.md +34 -5
- package/dist/ai-context/skills-command/references/communicate.md +8 -5
- package/dist/ai-context/skills-command/references/configure-api-checks.md +1 -9
- package/dist/ai-context/skills-command/references/configure-browser-checks.md +1 -8
- package/dist/ai-context/skills-command/references/configure-check-groups.md +1 -0
- package/dist/ai-context/skills-command/references/configure-dns-monitors.md +1 -9
- package/dist/ai-context/skills-command/references/configure-grpc-monitors.md +24 -0
- package/dist/ai-context/skills-command/references/configure-heartbeat-monitors.md +1 -9
- package/dist/ai-context/skills-command/references/configure-icmp-monitors.md +1 -9
- package/dist/ai-context/skills-command/references/configure-multistep-checks.md +1 -9
- package/dist/ai-context/skills-command/references/configure-playwright-checks.md +2 -2
- package/dist/ai-context/skills-command/references/configure-supporting-constructs.md +6 -2
- package/dist/ai-context/skills-command/references/configure-tcp-monitors.md +1 -10
- package/dist/ai-context/skills-command/references/configure-url-monitors.md +1 -10
- package/dist/ai-context/skills-command/references/configure.md +17 -5
- package/dist/ai-context/skills-command/references/initialize.md +11 -3
- package/dist/ai-context/skills-command/references/investigate-checks.md +1 -1
- package/dist/auth/api-key.d.ts +24 -0
- package/dist/auth/api-key.js +104 -0
- package/dist/auth/api-key.js.map +1 -0
- package/dist/auth/device-flow.d.ts +58 -0
- package/dist/auth/device-flow.js +228 -0
- package/dist/auth/device-flow.js.map +1 -0
- package/dist/auth/index.d.ts +6 -6
- package/dist/auth/index.js +64 -64
- package/dist/auth/index.js.map +1 -1
- package/dist/commands/account/plan.js +1 -1
- package/dist/commands/account/plan.js.map +1 -1
- package/dist/commands/account/usage/projections.d.ts +16 -0
- package/dist/commands/account/usage/projections.js +40 -0
- package/dist/commands/account/usage/projections.js.map +1 -0
- package/dist/commands/account/usage/series.d.ts +7 -3
- package/dist/commands/account/usage/series.js +30 -87
- package/dist/commands/account/usage/series.js.map +1 -1
- package/dist/commands/account/usage/summary.d.ts +4 -1
- package/dist/commands/account/usage/summary.js +19 -27
- package/dist/commands/account/usage/summary.js.map +1 -1
- package/dist/commands/account/usage/term.d.ts +15 -0
- package/dist/commands/account/usage/term.js +32 -0
- package/dist/commands/account/usage/term.js.map +1 -0
- package/dist/commands/account/usage/terms.d.ts +4 -0
- package/dist/commands/account/usage/terms.js +19 -27
- package/dist/commands/account/usage/terms.js.map +1 -1
- package/dist/commands/alert-channels/get.js +2 -1
- package/dist/commands/alert-channels/get.js.map +1 -1
- package/dist/commands/alert-channels/list.js +2 -1
- package/dist/commands/alert-channels/list.js.map +1 -1
- package/dist/commands/alert-channels/logs.js +2 -1
- package/dist/commands/alert-channels/logs.js.map +1 -1
- package/dist/commands/api.js +53 -10
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/assets/download.js +11 -7
- package/dist/commands/assets/download.js.map +1 -1
- package/dist/commands/assets/list.js +2 -3
- package/dist/commands/assets/list.js.map +1 -1
- package/dist/commands/authCommand.d.ts +19 -0
- package/dist/commands/authCommand.js +118 -12
- package/dist/commands/authCommand.js.map +1 -1
- package/dist/commands/baseCommand.d.ts +12 -1
- package/dist/commands/baseCommand.js +24 -5
- package/dist/commands/baseCommand.js.map +1 -1
- package/dist/commands/checks/delete.js +1 -1
- package/dist/commands/checks/delete.js.map +1 -1
- package/dist/commands/checks/run.js +3 -1
- package/dist/commands/checks/run.js.map +1 -1
- package/dist/commands/debug/parse-project.d.ts +1 -0
- package/dist/commands/debug/parse-project.js +5 -2
- package/dist/commands/debug/parse-project.js.map +1 -1
- package/dist/commands/deploy.d.ts +8 -2
- package/dist/commands/deploy.js +735 -274
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/destroy.js +3 -3
- package/dist/commands/destroy.js.map +1 -1
- package/dist/commands/env/add.js +2 -2
- package/dist/commands/env/add.js.map +1 -1
- package/dist/commands/env/ls.js +2 -1
- package/dist/commands/env/ls.js.map +1 -1
- package/dist/commands/env/pull.js +3 -3
- package/dist/commands/env/pull.js.map +1 -1
- package/dist/commands/env/update.js +2 -2
- package/dist/commands/env/update.js.map +1 -1
- package/dist/commands/import/apply.js +12 -10
- package/dist/commands/import/apply.js.map +1 -1
- package/dist/commands/import/cancel.js +4 -4
- package/dist/commands/import/cancel.js.map +1 -1
- package/dist/commands/import/commit.js +11 -9
- package/dist/commands/import/commit.js.map +1 -1
- package/dist/commands/import/plan.js +82 -62
- package/dist/commands/import/plan.js.map +1 -1
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +62 -41
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/login.d.ts +38 -2
- package/dist/commands/login.js +848 -52
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +10 -4
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/pw-test.js +6 -3
- package/dist/commands/pw-test.js.map +1 -1
- package/dist/commands/rca/get.js +1 -1
- package/dist/commands/rca/get.js.map +1 -1
- package/dist/commands/rca/run.js +1 -1
- package/dist/commands/rca/run.js.map +1 -1
- package/dist/commands/skills/index.js +1 -1
- package/dist/commands/skills/index.js.map +1 -1
- package/dist/commands/skills/install.js +12 -12
- package/dist/commands/skills/install.js.map +1 -1
- package/dist/commands/switch.d.ts +10 -1
- package/dist/commands/switch.js +75 -13
- package/dist/commands/switch.js.map +1 -1
- package/dist/commands/sync-playwright.js +5 -10
- package/dist/commands/sync-playwright.js.map +1 -1
- package/dist/commands/test.d.ts +2 -0
- package/dist/commands/test.js +58 -29
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/trigger.d.ts +1 -2
- package/dist/commands/trigger.js +27 -20
- package/dist/commands/trigger.js.map +1 -1
- package/dist/commands/validate.js +1 -0
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/whoami.d.ts +8 -0
- package/dist/commands/whoami.js +57 -6
- package/dist/commands/whoami.js.map +1 -1
- package/dist/constants.d.ts +3 -2
- package/dist/constants.js +8 -1
- package/dist/constants.js.map +1 -1
- package/dist/constructs/alert-channel-codegen.d.ts +6 -1
- package/dist/constructs/alert-channel-codegen.js +12 -6
- package/dist/constructs/alert-channel-codegen.js.map +1 -1
- package/dist/constructs/alert-channel-subscription.d.ts +1 -0
- package/dist/constructs/alert-channel-subscription.js +4 -0
- package/dist/constructs/alert-channel-subscription.js.map +1 -1
- package/dist/constructs/alert-channel.js +8 -5
- package/dist/constructs/alert-channel.js.map +1 -1
- package/dist/constructs/alert-escalation-policy-codegen.d.ts +7 -0
- package/dist/constructs/alert-escalation-policy-codegen.js +25 -8
- package/dist/constructs/alert-escalation-policy-codegen.js.map +1 -1
- package/dist/constructs/api-assertion.d.ts +0 -2
- package/dist/constructs/api-assertion.js +0 -4
- package/dist/constructs/api-assertion.js.map +1 -1
- package/dist/constructs/api-check-bundle.d.ts +4 -124
- package/dist/constructs/api-check-codegen.js +1 -1
- package/dist/constructs/api-check-codegen.js.map +1 -1
- package/dist/constructs/api-check.d.ts +8 -128
- package/dist/constructs/api-check.js +15 -17
- package/dist/constructs/api-check.js.map +1 -1
- package/dist/constructs/api-request-codegen.js +10 -8
- package/dist/constructs/api-request-codegen.js.map +1 -1
- package/dist/constructs/browser-check-bundle.d.ts +11 -125
- package/dist/constructs/browser-check-bundle.js +5 -1
- package/dist/constructs/browser-check-bundle.js.map +1 -1
- package/dist/constructs/browser-check.d.ts +5 -107
- package/dist/constructs/browser-check.js +1 -1
- package/dist/constructs/browser-check.js.map +1 -1
- package/dist/constructs/check-codegen.d.ts +46 -14
- package/dist/constructs/check-codegen.js +118 -34
- package/dist/constructs/check-codegen.js.map +1 -1
- package/dist/constructs/check-group-codegen.js +23 -9
- package/dist/constructs/check-group-codegen.js.map +1 -1
- package/dist/constructs/check-group-v1.d.ts +28 -16
- package/dist/constructs/check-group-v1.js +48 -17
- package/dist/constructs/check-group-v1.js.map +1 -1
- package/dist/constructs/check-group-v2.d.ts +2 -21
- package/dist/constructs/check-group-v2.js +4 -4
- package/dist/constructs/check-group-v2.js.map +1 -1
- package/dist/constructs/check.d.ts +68 -220
- package/dist/constructs/check.js +106 -37
- package/dist/constructs/check.js.map +1 -1
- package/dist/constructs/construct-codegen.d.ts +1 -2
- package/dist/constructs/construct-diagnostics.d.ts +3 -0
- package/dist/constructs/construct-diagnostics.js +11 -0
- package/dist/constructs/construct-diagnostics.js.map +1 -1
- package/dist/constructs/construct.d.ts +30 -4
- package/dist/constructs/construct.js +52 -6
- package/dist/constructs/construct.js.map +1 -1
- package/dist/constructs/dashboard.js +11 -7
- package/dist/constructs/dashboard.js.map +1 -1
- package/dist/constructs/dns-monitor.d.ts +4 -100
- package/dist/constructs/dns-request-codegen.js +1 -1
- package/dist/constructs/dns-request-codegen.js.map +1 -1
- package/dist/constructs/email-alert-channel-codegen.js +1 -1
- package/dist/constructs/email-alert-channel-codegen.js.map +1 -1
- package/dist/constructs/engine.d.ts +4 -2
- package/dist/constructs/engine.js +3 -1
- package/dist/constructs/engine.js.map +1 -1
- package/dist/constructs/frequency-codegen.js +10 -2
- package/dist/constructs/frequency-codegen.js.map +1 -1
- package/dist/constructs/frequency.d.ts +8 -3
- package/dist/constructs/frequency.js +7 -2
- package/dist/constructs/frequency.js.map +1 -1
- package/dist/constructs/grpc-monitor.d.ts +4 -100
- package/dist/constructs/grpc-monitor.js +19 -0
- package/dist/constructs/grpc-monitor.js.map +1 -1
- package/dist/constructs/grpc-request-codegen.js +13 -4
- package/dist/constructs/grpc-request-codegen.js.map +1 -1
- package/dist/constructs/grpc-request.d.ts +23 -0
- package/dist/constructs/heartbeat-monitor.d.ts +2 -1
- package/dist/constructs/heartbeat-monitor.js +2 -2
- package/dist/constructs/heartbeat-monitor.js.map +1 -1
- package/dist/constructs/icmp-monitor.d.ts +4 -100
- package/dist/constructs/icmp-request-codegen.js +1 -1
- package/dist/constructs/icmp-request-codegen.js.map +1 -1
- package/dist/constructs/incidentio-alert-channel-codegen.d.ts +1 -1
- package/dist/constructs/incidentio-alert-channel-codegen.js +14 -8
- package/dist/constructs/incidentio-alert-channel-codegen.js.map +1 -1
- package/dist/constructs/index.d.ts +1 -1
- package/dist/constructs/index.js +1 -1
- package/dist/constructs/index.js.map +1 -1
- package/dist/constructs/internal/assertion-validation.js +1 -2
- package/dist/constructs/internal/assertion-validation.js.map +1 -1
- package/dist/constructs/internal/codegen/context.d.ts +73 -6
- package/dist/constructs/internal/codegen/context.js +78 -6
- package/dist/constructs/internal/codegen/context.js.map +1 -1
- package/dist/constructs/internal/codegen/index.d.ts +3 -1
- package/dist/constructs/internal/codegen/index.js +2 -1
- package/dist/constructs/internal/codegen/index.js.map +1 -1
- package/dist/constructs/internal/codegen/render.d.ts +68 -0
- package/dist/constructs/internal/codegen/render.js +75 -0
- package/dist/constructs/internal/codegen/render.js.map +1 -0
- package/dist/constructs/internal/common-diagnostics.d.ts +1 -2
- package/dist/constructs/internal/common-diagnostics.js +7 -17
- package/dist/constructs/internal/common-diagnostics.js.map +1 -1
- package/dist/constructs/internal/declaring-file.d.ts +39 -0
- package/dist/constructs/internal/declaring-file.js +139 -0
- package/dist/constructs/internal/declaring-file.js.map +1 -0
- package/dist/constructs/internal/default-retry-strategy.d.ts +9 -0
- package/dist/constructs/internal/default-retry-strategy.js +13 -0
- package/dist/constructs/internal/default-retry-strategy.js.map +1 -0
- package/dist/constructs/internal/retry-strategy-defaults.d.ts +13 -0
- package/dist/constructs/internal/retry-strategy-defaults.js +14 -0
- package/dist/constructs/internal/retry-strategy-defaults.js.map +1 -0
- package/dist/constructs/key-value-pair-codegen.d.ts +6 -1
- package/dist/constructs/key-value-pair-codegen.js +24 -3
- package/dist/constructs/key-value-pair-codegen.js.map +1 -1
- package/dist/constructs/maintenance-window-codegen.d.ts +7 -0
- package/dist/constructs/maintenance-window-codegen.js +36 -19
- package/dist/constructs/maintenance-window-codegen.js.map +1 -1
- package/dist/constructs/maintenance-window.d.ts +37 -3
- package/dist/constructs/maintenance-window.js +34 -1
- package/dist/constructs/maintenance-window.js.map +1 -1
- package/dist/constructs/monitor.d.ts +6 -119
- package/dist/constructs/monitor.js +3 -5
- package/dist/constructs/monitor.js.map +1 -1
- package/dist/constructs/msteams-alert-channel-codegen.d.ts +1 -1
- package/dist/constructs/msteams-alert-channel-codegen.js +8 -18
- package/dist/constructs/msteams-alert-channel-codegen.js.map +1 -1
- package/dist/constructs/multi-step-check-bundle.d.ts +4 -109
- package/dist/constructs/multi-step-check.d.ts +4 -100
- package/dist/constructs/opsgenie-alert-channel-codegen.js +1 -1
- package/dist/constructs/opsgenie-alert-channel-codegen.js.map +1 -1
- package/dist/constructs/pagerduty-alert-channel-codegen.js +1 -1
- package/dist/constructs/pagerduty-alert-channel-codegen.js.map +1 -1
- package/dist/constructs/phone-call-alert-channel-codegen.js +1 -1
- package/dist/constructs/phone-call-alert-channel-codegen.js.map +1 -1
- package/dist/constructs/playwright-check-bundle.d.ts +10 -130
- package/dist/constructs/playwright-check-bundle.js +3 -3
- package/dist/constructs/playwright-check-bundle.js.map +1 -1
- package/dist/constructs/playwright-check-codegen.d.ts +85 -0
- package/dist/constructs/playwright-check-codegen.js +212 -0
- package/dist/constructs/playwright-check-codegen.js.map +1 -0
- package/dist/constructs/playwright-check.d.ts +14 -122
- package/dist/constructs/playwright-check.js +17 -51
- package/dist/constructs/playwright-check.js.map +1 -1
- package/dist/constructs/private-location-check-assignment.d.ts +1 -0
- package/dist/constructs/private-location-check-assignment.js +4 -0
- package/dist/constructs/private-location-check-assignment.js.map +1 -1
- package/dist/constructs/private-location-group-assignment.d.ts +1 -0
- package/dist/constructs/private-location-group-assignment.js +4 -0
- package/dist/constructs/private-location-group-assignment.js.map +1 -1
- package/dist/constructs/private-location.js +3 -1
- package/dist/constructs/private-location.js.map +1 -1
- package/dist/constructs/retry-strategy-codegen.d.ts +7 -1
- package/dist/constructs/retry-strategy-codegen.js +41 -32
- package/dist/constructs/retry-strategy-codegen.js.map +1 -1
- package/dist/constructs/retry-strategy.d.ts +0 -4
- package/dist/constructs/retry-strategy.js +5 -8
- package/dist/constructs/retry-strategy.js.map +1 -1
- package/dist/constructs/session.d.ts +38 -1
- package/dist/constructs/session.js +73 -3
- package/dist/constructs/session.js.map +1 -1
- package/dist/constructs/slack-alert-channel-codegen.js +1 -1
- package/dist/constructs/slack-alert-channel-codegen.js.map +1 -1
- package/dist/constructs/slack-app-alert-channel-codegen.js +1 -1
- package/dist/constructs/slack-app-alert-channel-codegen.js.map +1 -1
- package/dist/constructs/sms-alert-channel-codegen.js +1 -1
- package/dist/constructs/sms-alert-channel-codegen.js.map +1 -1
- package/dist/constructs/ssl-monitor.d.ts +4 -142
- package/dist/constructs/ssl-request-codegen.js +4 -3
- package/dist/constructs/ssl-request-codegen.js.map +1 -1
- package/dist/constructs/status-page-v3-automation-rule-codegen.js +5 -4
- package/dist/constructs/status-page-v3-automation-rule-codegen.js.map +1 -1
- package/dist/constructs/status-page-v3-codegen.js +3 -2
- package/dist/constructs/status-page-v3-codegen.js.map +1 -1
- package/dist/constructs/status-page-v3-component-codegen.js +8 -7
- package/dist/constructs/status-page-v3-component-codegen.js.map +1 -1
- package/dist/constructs/tcp-monitor-codegen.js +3 -2
- package/dist/constructs/tcp-monitor-codegen.js.map +1 -1
- package/dist/constructs/tcp-monitor.d.ts +8 -103
- package/dist/constructs/tcp-monitor.js +3 -2
- package/dist/constructs/tcp-monitor.js.map +1 -1
- package/dist/constructs/telegram-alert-channel-codegen.d.ts +1 -1
- package/dist/constructs/telegram-alert-channel-codegen.js +14 -8
- package/dist/constructs/telegram-alert-channel-codegen.js.map +1 -1
- package/dist/constructs/time-zone.d.ts +24 -0
- package/dist/constructs/time-zone.js +455 -0
- package/dist/constructs/time-zone.js.map +1 -0
- package/dist/constructs/traceroute-monitor.d.ts +4 -100
- package/dist/constructs/traceroute-request-codegen.js +2 -2
- package/dist/constructs/traceroute-request-codegen.js.map +1 -1
- package/dist/constructs/url-monitor-codegen.js +1 -1
- package/dist/constructs/url-monitor-codegen.js.map +1 -1
- package/dist/constructs/url-monitor.d.ts +7 -123
- package/dist/constructs/url-monitor.js +3 -0
- package/dist/constructs/url-monitor.js.map +1 -1
- package/dist/constructs/url-request-codegen.js +4 -3
- package/dist/constructs/url-request-codegen.js.map +1 -1
- package/dist/constructs/webhook-alert-channel-codegen.js +3 -3
- package/dist/constructs/webhook-alert-channel-codegen.js.map +1 -1
- package/dist/formatters/check-result-detail.js +0 -185
- package/dist/formatters/check-result-detail.js.map +1 -1
- package/dist/formatters/render.d.ts +2 -1
- package/dist/formatters/render.js +2 -2
- package/dist/formatters/render.js.map +1 -1
- package/dist/formatters/usage.d.ts +18 -12
- package/dist/formatters/usage.js +285 -245
- package/dist/formatters/usage.js.map +1 -1
- package/dist/help/help-extension.js +2 -1
- package/dist/help/help-extension.js.map +1 -1
- package/dist/helpers/accounts.d.ts +28 -0
- package/dist/helpers/accounts.js +50 -0
- package/dist/helpers/accounts.js.map +1 -0
- package/dist/helpers/activate-account.d.ts +13 -0
- package/dist/helpers/activate-account.js +24 -0
- package/dist/helpers/activate-account.js.map +1 -0
- package/dist/helpers/api-fields.js +3 -2
- package/dist/helpers/api-fields.js.map +1 -1
- package/dist/helpers/cli-mode.d.ts +24 -0
- package/dist/helpers/cli-mode.js +64 -8
- package/dist/helpers/cli-mode.js.map +1 -1
- package/dist/helpers/command-preview.d.ts +44 -0
- package/dist/helpers/command-preview.js +29 -9
- package/dist/helpers/command-preview.js.map +1 -1
- package/dist/helpers/command-style.d.ts +1 -0
- package/dist/helpers/command-style.js +51 -37
- package/dist/helpers/command-style.js.map +1 -1
- package/dist/helpers/flags.d.ts +10 -0
- package/dist/helpers/flags.js +18 -0
- package/dist/helpers/flags.js.map +1 -1
- package/dist/helpers/import-plan-selection.d.ts +1 -1
- package/dist/helpers/import-plan-selection.js +8 -20
- package/dist/helpers/import-plan-selection.js.map +1 -1
- package/dist/helpers/invalid-input-error.d.ts +15 -0
- package/dist/helpers/invalid-input-error.js +17 -0
- package/dist/helpers/invalid-input-error.js.map +1 -0
- package/dist/helpers/number.js +4 -3
- package/dist/helpers/number.js.map +1 -1
- package/dist/helpers/onboarding/boilerplate.js +15 -3
- package/dist/helpers/onboarding/boilerplate.js.map +1 -1
- package/dist/helpers/onboarding/index.d.ts +1 -1
- package/dist/helpers/onboarding/index.js +1 -1
- package/dist/helpers/onboarding/index.js.map +1 -1
- package/dist/helpers/onboarding/messages.d.ts +7 -0
- package/dist/helpers/onboarding/messages.js +14 -0
- package/dist/helpers/onboarding/messages.js.map +1 -1
- package/dist/helpers/onboarding/prompt-display.js +2 -2
- package/dist/helpers/onboarding/prompt-display.js.map +1 -1
- package/dist/helpers/onboarding/prompts-helpers.js +3 -1
- package/dist/helpers/onboarding/prompts-helpers.js.map +1 -1
- package/dist/helpers/onboarding/skill-install.js +4 -4
- package/dist/helpers/onboarding/skill-install.js.map +1 -1
- package/dist/helpers/prompts.d.ts +7 -0
- package/dist/helpers/prompts.js +10 -0
- package/dist/helpers/prompts.js.map +1 -0
- package/dist/helpers/result-assets.js +4 -3
- package/dist/helpers/result-assets.js.map +1 -1
- package/dist/helpers/test-helper.d.ts +14 -0
- package/dist/helpers/test-helper.js +33 -3
- package/dist/helpers/test-helper.js.map +1 -1
- package/dist/helpers/usage.d.ts +51 -14
- package/dist/helpers/usage.js +193 -53
- package/dist/helpers/usage.js.map +1 -1
- package/dist/helpers/wrap.js +1 -1
- package/dist/helpers/wrap.js.map +1 -1
- package/dist/messages/common-messages.d.ts +1 -0
- package/dist/messages/common-messages.js +4 -2
- package/dist/messages/common-messages.js.map +1 -1
- package/dist/reporters/abstract-list.d.ts +9 -2
- package/dist/reporters/abstract-list.js +105 -32
- package/dist/reporters/abstract-list.js.map +1 -1
- package/dist/reporters/ci.js +7 -4
- package/dist/reporters/ci.js.map +1 -1
- package/dist/reporters/dot.d.ts +1 -0
- package/dist/reporters/dot.js +19 -7
- package/dist/reporters/dot.js.map +1 -1
- package/dist/reporters/github.d.ts +2 -0
- package/dist/reporters/github.js +29 -4
- package/dist/reporters/github.js.map +1 -1
- package/dist/reporters/json.d.ts +2 -0
- package/dist/reporters/json.js +27 -4
- package/dist/reporters/json.js.map +1 -1
- package/dist/reporters/list.js +10 -8
- package/dist/reporters/list.js.map +1 -1
- package/dist/reporters/reporter.d.ts +1 -0
- package/dist/reporters/reporter.js.map +1 -1
- package/dist/reporters/util.d.ts +5 -2
- package/dist/reporters/util.js +25 -61
- package/dist/reporters/util.js.map +1 -1
- package/dist/rest/analytics.js +0 -4
- package/dist/rest/analytics.js.map +1 -1
- package/dist/rest/api.d.ts +10 -1
- package/dist/rest/api.js +44 -9
- package/dist/rest/api.js.map +1 -1
- package/dist/rest/check-results.d.ts +1 -50
- package/dist/rest/check-results.js.map +1 -1
- package/dist/rest/checkly-storage.d.ts +6 -1
- package/dist/rest/checkly-storage.js +13 -2
- package/dist/rest/checkly-storage.js.map +1 -1
- package/dist/rest/errors.d.ts +19 -0
- package/dist/rest/errors.js +20 -1
- package/dist/rest/errors.js.map +1 -1
- package/dist/rest/projects.d.ts +254 -4
- package/dist/rest/projects.js +208 -17
- package/dist/rest/projects.js.map +1 -1
- package/dist/rest/usage.d.ts +164 -73
- package/dist/rest/usage.js +21 -10
- package/dist/rest/usage.js.map +1 -1
- package/dist/services/abstract-check-runner.d.ts +34 -2
- package/dist/services/abstract-check-runner.js +183 -56
- package/dist/services/abstract-check-runner.js.map +1 -1
- package/dist/services/check-parser/bundler.d.ts +26 -0
- package/dist/services/check-parser/bundler.js +81 -7
- package/dist/services/check-parser/bundler.js.map +1 -1
- package/dist/services/check-parser/cache-hash.d.ts +1 -4
- package/dist/services/check-parser/cache-hash.js.map +1 -1
- package/dist/services/check-parser/package-files/json-text-source-file.d.ts +0 -2
- package/dist/services/check-parser/package-files/json-text-source-file.js +6 -6
- package/dist/services/check-parser/package-files/json-text-source-file.js.map +1 -1
- package/dist/services/check-parser/parser.d.ts +3 -2
- package/dist/services/check-parser/parser.js +31 -40
- package/dist/services/check-parser/parser.js.map +1 -1
- package/dist/services/checkly-config-codegen.js +4 -4
- package/dist/services/checkly-config-codegen.js.map +1 -1
- package/dist/services/checkly-config-loader.d.ts +18 -33
- package/dist/services/checkly-config-loader.js +50 -47
- package/dist/services/checkly-config-loader.js.map +1 -1
- package/dist/services/config.d.ts +42 -1
- package/dist/services/config.js +93 -9
- package/dist/services/config.js.map +1 -1
- package/dist/services/content-hash.d.ts +14 -0
- package/dist/services/content-hash.js +22 -0
- package/dist/services/content-hash.js.map +1 -0
- package/dist/services/deploy-diff/diff-lines.d.ts +52 -0
- package/dist/services/deploy-diff/diff-lines.js +327 -0
- package/dist/services/deploy-diff/diff-lines.js.map +1 -0
- package/dist/services/deploy-diff/double-check.d.ts +9 -0
- package/dist/services/deploy-diff/double-check.js +21 -0
- package/dist/services/deploy-diff/double-check.js.map +1 -0
- package/dist/services/deploy-diff/import-shape.d.ts +171 -0
- package/dist/services/deploy-diff/import-shape.js +633 -0
- package/dist/services/deploy-diff/import-shape.js.map +1 -0
- package/dist/services/deploy-diff/legacy-payload.d.ts +22 -0
- package/dist/services/deploy-diff/legacy-payload.js +51 -0
- package/dist/services/deploy-diff/legacy-payload.js.map +1 -0
- package/dist/services/deploy-diff/plan-summary.d.ts +81 -0
- package/dist/services/deploy-diff/plan-summary.js +262 -0
- package/dist/services/deploy-diff/plan-summary.js.map +1 -0
- package/dist/services/deploy-diff/preview-output.d.ts +63 -0
- package/dist/services/deploy-diff/preview-output.js +403 -0
- package/dist/services/deploy-diff/preview-output.js.map +1 -0
- package/dist/services/deploy-diff/render.d.ts +59 -0
- package/dist/services/deploy-diff/render.js +326 -0
- package/dist/services/deploy-diff/render.js.map +1 -0
- package/dist/services/deploy-diff/shape-changes.d.ts +2 -0
- package/dist/services/deploy-diff/shape-changes.js +48 -0
- package/dist/services/deploy-diff/shape-changes.js.map +1 -0
- package/dist/services/deploy-diff/source-index.d.ts +18 -0
- package/dist/services/deploy-diff/source-index.js +48 -0
- package/dist/services/deploy-diff/source-index.js.map +1 -0
- package/dist/services/deploy-diff/variable-names.d.ts +30 -0
- package/dist/services/deploy-diff/variable-names.js +64 -0
- package/dist/services/deploy-diff/variable-names.js.map +1 -0
- package/dist/services/engine-resolver.js +3 -0
- package/dist/services/engine-resolver.js.map +1 -1
- package/dist/services/engine-rules-loader.d.ts +6 -0
- package/dist/services/engine-rules-loader.js +12 -3
- package/dist/services/engine-rules-loader.js.map +1 -1
- package/dist/services/oxc-parser.d.ts +26 -0
- package/dist/services/oxc-parser.js +70 -0
- package/dist/services/oxc-parser.js.map +1 -0
- package/dist/services/project-cli.d.ts +75 -0
- package/dist/services/project-cli.js +302 -0
- package/dist/services/project-cli.js.map +1 -0
- package/dist/services/project-parser.d.ts +5 -0
- package/dist/services/project-parser.js +25 -13
- package/dist/services/project-parser.js.map +1 -1
- package/dist/services/skills.js +3 -3
- package/dist/services/skills.js.map +1 -1
- package/dist/services/snapshot-service.d.ts +25 -8
- package/dist/services/snapshot-service.js +46 -4
- package/dist/services/snapshot-service.js.map +1 -1
- package/dist/services/socket-client.js +1 -1
- package/dist/services/socket-client.js.map +1 -1
- package/dist/services/test-filters.d.ts +18 -0
- package/dist/services/test-filters.js +10 -0
- package/dist/services/test-filters.js.map +1 -1
- package/dist/services/test-runner.d.ts +1 -1
- package/dist/services/test-runner.js +10 -11
- package/dist/services/test-runner.js.map +1 -1
- package/dist/services/test-session-cancel.d.ts +5 -0
- package/dist/services/test-session-cancel.js +28 -3
- package/dist/services/test-session-cancel.js.map +1 -1
- package/dist/services/trigger-runner.d.ts +1 -1
- package/dist/services/trigger-runner.js +2 -2
- package/dist/services/trigger-runner.js.map +1 -1
- package/dist/services/two-installs.d.ts +39 -0
- package/dist/services/two-installs.js +155 -0
- package/dist/services/two-installs.js.map +1 -0
- package/dist/services/util.d.ts +17 -2
- package/dist/services/util.js +118 -11
- package/dist/services/util.js.map +1 -1
- package/dist/services/write-back/apply-edits.d.ts +29 -0
- package/dist/services/write-back/apply-edits.js +255 -0
- package/dist/services/write-back/apply-edits.js.map +1 -0
- package/dist/services/write-back/helper-edit.d.ts +135 -0
- package/dist/services/write-back/helper-edit.js +343 -0
- package/dist/services/write-back/helper-edit.js.map +1 -0
- package/dist/services/write-back/imports.d.ts +30 -0
- package/dist/services/write-back/imports.js +88 -0
- package/dist/services/write-back/imports.js.map +1 -0
- package/dist/services/write-back/literal-edit.d.ts +183 -0
- package/dist/services/write-back/literal-edit.js +359 -0
- package/dist/services/write-back/literal-edit.js.map +1 -0
- package/dist/services/write-back/output.d.ts +26 -0
- package/dist/services/write-back/output.js +110 -0
- package/dist/services/write-back/output.js.map +1 -0
- package/dist/services/write-back/plan.d.ts +180 -0
- package/dist/services/write-back/plan.js +1046 -0
- package/dist/services/write-back/plan.js.map +1 -0
- package/dist/services/write-back/source-file.d.ts +133 -0
- package/dist/services/write-back/source-file.js +460 -0
- package/dist/services/write-back/source-file.js.map +1 -0
- package/dist/sourcegen/index.d.ts +1 -1
- package/dist/sourcegen/index.js +1 -1
- package/dist/sourcegen/index.js.map +1 -1
- package/dist/sourcegen/program.d.ts +19 -1
- package/dist/sourcegen/program.js +32 -7
- package/dist/sourcegen/program.js.map +1 -1
- package/dist/testing/clear-git-env.d.ts +1 -0
- package/dist/testing/clear-git-env.js +25 -0
- package/dist/testing/clear-git-env.js.map +1 -0
- package/dist/testing/global-setup.d.ts +1 -0
- package/dist/testing/global-setup.js +3 -0
- package/dist/testing/global-setup.js.map +1 -1
- package/oclif.manifest.json +1113 -884
- package/package.json +21 -19
- package/dist/commands/rules.d.ts +0 -9
- package/dist/commands/rules.js +0 -13
- package/dist/commands/rules.js.map +0 -1
- package/dist/constructs/agentic-check-codegen.d.ts +0 -22
- package/dist/constructs/agentic-check-codegen.js +0 -59
- package/dist/constructs/agentic-check-codegen.js.map +0 -1
- package/dist/constructs/agentic-check.d.ts +0 -237
- package/dist/constructs/agentic-check.js +0 -100
- package/dist/constructs/agentic-check.js.map +0 -1
- package/dist/services/check-parser/package-files/json-text-source-file-parser.d.ts +0 -7
- package/dist/services/check-parser/package-files/json-text-source-file-parser.js +0 -47
- package/dist/services/check-parser/package-files/json-text-source-file-parser.js.map +0 -1
- package/dist/services/check-parser/package-files/source-file-parser.d.ts +0 -10
- package/dist/services/check-parser/package-files/source-file-parser.js +0 -13
- package/dist/services/check-parser/package-files/source-file-parser.js.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ProjectSync } from '../../rest/projects.js';
|
|
2
|
+
/**
|
|
3
|
+
* The deploy payload as a Checkly API without the preview endpoint accepts it.
|
|
4
|
+
*
|
|
5
|
+
* `sourceFile`, each snapshot's `sha256` and a Playwright check's
|
|
6
|
+
* `codeBundleSha256` were all added alongside that endpoint. Older deploy
|
|
7
|
+
* schemas reject a key they do not know rather than ignoring it, so a CLI
|
|
8
|
+
* talking to one has to take them back out — otherwise every deploy against
|
|
9
|
+
* such an API fails validation.
|
|
10
|
+
*
|
|
11
|
+
* A snapshot with no storage key is dropped: it describes a file that has not
|
|
12
|
+
* been uploaded, which only a preview accepts, and an older API has no
|
|
13
|
+
* preview. Dropping the entry leaves the check's snapshots as they are rather
|
|
14
|
+
* than failing the deploy.
|
|
15
|
+
*
|
|
16
|
+
* Returns a copy, so the caller can still send the full payload to an API that
|
|
17
|
+
* does support the endpoint.
|
|
18
|
+
*
|
|
19
|
+
* Temporary by design: once every API a supported CLI talks to accepts these
|
|
20
|
+
* fields, this function and its call site go away.
|
|
21
|
+
*/
|
|
22
|
+
export declare function stripUnsupportedDeployFields(payload: ProjectSync): ProjectSync;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { stripContentHashes } from '../snapshot-service.js';
|
|
2
|
+
/**
|
|
3
|
+
* The deploy payload as a Checkly API without the preview endpoint accepts it.
|
|
4
|
+
*
|
|
5
|
+
* `sourceFile`, each snapshot's `sha256` and a Playwright check's
|
|
6
|
+
* `codeBundleSha256` were all added alongside that endpoint. Older deploy
|
|
7
|
+
* schemas reject a key they do not know rather than ignoring it, so a CLI
|
|
8
|
+
* talking to one has to take them back out — otherwise every deploy against
|
|
9
|
+
* such an API fails validation.
|
|
10
|
+
*
|
|
11
|
+
* A snapshot with no storage key is dropped: it describes a file that has not
|
|
12
|
+
* been uploaded, which only a preview accepts, and an older API has no
|
|
13
|
+
* preview. Dropping the entry leaves the check's snapshots as they are rather
|
|
14
|
+
* than failing the deploy.
|
|
15
|
+
*
|
|
16
|
+
* Returns a copy, so the caller can still send the full payload to an API that
|
|
17
|
+
* does support the endpoint.
|
|
18
|
+
*
|
|
19
|
+
* Temporary by design: once every API a supported CLI talks to accepts these
|
|
20
|
+
* fields, this function and its call site go away.
|
|
21
|
+
*/
|
|
22
|
+
export function stripUnsupportedDeployFields(payload) {
|
|
23
|
+
return {
|
|
24
|
+
...payload,
|
|
25
|
+
resources: payload.resources.map(resource => {
|
|
26
|
+
const stripped = { ...resource };
|
|
27
|
+
delete stripped.sourceFile;
|
|
28
|
+
if (stripped.payload === null || typeof stripped.payload !== 'object') {
|
|
29
|
+
return stripped;
|
|
30
|
+
}
|
|
31
|
+
// The content hashes go the same way they do on a run request.
|
|
32
|
+
stripped.payload = stripContentHashes(stripped.payload);
|
|
33
|
+
const snapshots = stripped.payload.snapshots;
|
|
34
|
+
if (Array.isArray(snapshots)) {
|
|
35
|
+
const uploaded = snapshots.filter((snapshot) => typeof snapshot.key === 'string');
|
|
36
|
+
if (uploaded.length || snapshots.length === 0) {
|
|
37
|
+
// An empty array is meaningful — "this check has no snapshots" — and
|
|
38
|
+
// has always been sent, so it is kept as it is. The key is dropped
|
|
39
|
+
// only when every entry had to go, which would otherwise turn "none
|
|
40
|
+
// of these are uploaded yet" into "this check has none".
|
|
41
|
+
stripped.payload.snapshots = uploaded;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
delete stripped.payload.snapshots;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return stripped;
|
|
48
|
+
}),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=legacy-payload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-payload.js","sourceRoot":"","sources":["../../../src/services/deploy-diff/legacy-payload.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE3D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,4BAA4B,CAAE,OAAoB;IAChE,OAAO;QACL,GAAG,OAAO;QACV,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YAC1C,MAAM,QAAQ,GAAuB,EAAE,GAAG,QAAQ,EAAE,CAAA;YACpD,OAAO,QAAQ,CAAC,UAAU,CAAA;YAE1B,IAAI,QAAQ,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;gBACtE,OAAO,QAAQ,CAAA;YACjB,CAAC;YAED,+DAA+D;YAC/D,QAAQ,CAAC,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAEvD,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAA;YAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC7B,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,QAA0B,EAAE,EAAE,CAAC,OAAO,QAAQ,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAA;gBACnG,IAAI,QAAQ,CAAC,MAAM,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAC9C,qEAAqE;oBACrE,mEAAmE;oBACnE,oEAAoE;oBACpE,yDAAyD;oBACzD,QAAQ,CAAC,OAAO,CAAC,SAAS,GAAG,QAAQ,CAAA;gBACvC,CAAC;qBAAM,CAAC;oBACN,OAAO,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAA;gBACnC,CAAC;YACH,CAAC;YAED,OAAO,QAAQ,CAAA;QACjB,CAAC,CAAC;KACH,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { DiffEntry } from '../../rest/projects.js';
|
|
2
|
+
export interface PlanSummaryOptions {
|
|
3
|
+
/** Display names per resource type, for the types a user declares. */
|
|
4
|
+
prettyTypes: Record<string, string>;
|
|
5
|
+
/** Types reported as part of their owning check or group rather than on their own. */
|
|
6
|
+
foldedTypes: readonly string[];
|
|
7
|
+
}
|
|
8
|
+
/** A relation the project does not manage, which this deploy will delete. */
|
|
9
|
+
export declare function isPrunedRelation(entry: DiffEntry): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* True when every change reported on a resource is a relation the project does
|
|
12
|
+
* not manage. Checkly reports those on the owning check or group whether or not
|
|
13
|
+
* the deploy would delete them, and without `--prune-unmanaged-relations` it deletes
|
|
14
|
+
* nothing — so the resource itself is untouched and naming it as an update
|
|
15
|
+
* would describe a write that never happens.
|
|
16
|
+
*/
|
|
17
|
+
export declare function onlyUnmanagedChanges(entry: DiffEntry): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* True for a resource the deploy writes only to set a baseline: Checkly
|
|
20
|
+
* compared it with what is live for want of an earlier planned deploy
|
|
21
|
+
* (`basis: 'live'`) and found nothing to report, or nothing but relations the
|
|
22
|
+
* project does not manage. The write happens whatever was found, and the
|
|
23
|
+
* reported changes are not exhaustive (a secret or content Checkly does not
|
|
24
|
+
* return may differ), so the plan lists the resource; but as a baseline, not
|
|
25
|
+
* as the update a resource with a difference to show is. Relations the
|
|
26
|
+
* project does not manage count for nothing here whether or not the deploy
|
|
27
|
+
* prunes them: pruned, each is deleted on an entry of its own, which the plan
|
|
28
|
+
* lists; not pruned, they are left alone, which the `!` row says.
|
|
29
|
+
*/
|
|
30
|
+
export declare function writtenForBaseline(entry: DiffEntry): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* True when the plan gives the deploy nothing to write: no resource to create,
|
|
33
|
+
* update, delete or detach, and no relation to prune. Relations the project
|
|
34
|
+
* does not manage and is not pruning do not count, since the deploy leaves
|
|
35
|
+
* them alone.
|
|
36
|
+
*/
|
|
37
|
+
export declare function planHasNoChanges(diff: DiffEntry[], options: PlanSummaryOptions): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* One line per resource the deploy would touch, deletions first and in full,
|
|
40
|
+
* for the confirmation prompt and the agent envelope.
|
|
41
|
+
*/
|
|
42
|
+
export declare function planChangeLines(diff: DiffEntry[], options: PlanSummaryOptions): string[];
|
|
43
|
+
/**
|
|
44
|
+
* A resource the plan reports as changed in Checkly since the last planned
|
|
45
|
+
* deploy, which the deploy would overwrite: properties edited in Checkly
|
|
46
|
+
* (`paths`), or the resource deleted there, which the deploy creates again.
|
|
47
|
+
*/
|
|
48
|
+
export interface DriftedResource {
|
|
49
|
+
type: string;
|
|
50
|
+
logicalId: string;
|
|
51
|
+
deleted: boolean;
|
|
52
|
+
paths: string[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The resources the plan reports as changed in Checkly, one per check, group
|
|
56
|
+
* or other declared resource: a relation's drift (an alert channel
|
|
57
|
+
* subscription removed in Checkly, say) is reported on the resource it is
|
|
58
|
+
* folded into. Relations the project does not manage are not drift: they are
|
|
59
|
+
* left alone unless `--prune-unmanaged-relations` asks for them to be deleted.
|
|
60
|
+
*
|
|
61
|
+
* Blind to a resource without a baseline (`basis: 'live'`): Checkly compares
|
|
62
|
+
* it with what is deployed, so code changes and edits made in Checkly look
|
|
63
|
+
* the same. {@link unbaselinedResources} counts those. Also blind to a
|
|
64
|
+
* resource the code removes: Checkly reports no changes on a deletion.
|
|
65
|
+
*/
|
|
66
|
+
export declare function findDrift(diff: readonly DiffEntry[], { foldedTypes }: PlanSummaryOptions): DriftedResource[];
|
|
67
|
+
/**
|
|
68
|
+
* How many declared resources Checkly had no earlier planned deploy to
|
|
69
|
+
* compare with (`basis: 'live'`), which {@link findDrift} cannot check.
|
|
70
|
+
*/
|
|
71
|
+
export declare function unbaselinedResources(diff: readonly DiffEntry[], { foldedTypes }: PlanSummaryOptions): number;
|
|
72
|
+
/** One line per drifted resource, saying what changed in Checkly and what the deploy would do about it. */
|
|
73
|
+
export declare function driftLines(drift: readonly DriftedResource[], options: PlanSummaryOptions): string[];
|
|
74
|
+
/**
|
|
75
|
+
* The plan as the agent envelope carries it: every entry and every changed
|
|
76
|
+
* property, but without the resources' full current state and without the
|
|
77
|
+
* large values the rendered diff needs. Rendering happens in the terminal
|
|
78
|
+
* output; the envelope is there to be read, and it is the same plan, pinned by
|
|
79
|
+
* the same `planToken`.
|
|
80
|
+
*/
|
|
81
|
+
export declare function reducePlanForAgent(diff: DiffEntry[]): DiffEntry[];
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
+
/**
|
|
3
|
+
* Turns a deploy plan into the two forms `confirmOrAbort` needs: the
|
|
4
|
+
* human-readable `changes` lines of its preview, and the machine-readable plan
|
|
5
|
+
* that goes into the agent envelope next to them.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* How many create/update lines the confirmation prompt lists before summing up
|
|
9
|
+
* the rest. A first deploy of a large project would otherwise scroll its own
|
|
10
|
+
* question off the screen. Deletions are never summarized away: they are the
|
|
11
|
+
* part of a plan that loses data, so every one of them is named.
|
|
12
|
+
*/
|
|
13
|
+
const MAX_LISTED_CHANGES = 20;
|
|
14
|
+
/**
|
|
15
|
+
* Largest value the agent envelope carries inline, serialized. Repeating a
|
|
16
|
+
* whole script, response body or environment-variable list in a confirmation
|
|
17
|
+
* envelope helps nobody and can be megabytes; what is left in its place says
|
|
18
|
+
* how long it was.
|
|
19
|
+
*/
|
|
20
|
+
const MAX_INLINE_VALUE = 256;
|
|
21
|
+
/** A relation the project does not manage, which this deploy will delete. */
|
|
22
|
+
export function isPrunedRelation(entry) {
|
|
23
|
+
return entry.action === 'DELETE' && entry.origin === 'unmanaged';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* True when every change reported on a resource is a relation the project does
|
|
27
|
+
* not manage. Checkly reports those on the owning check or group whether or not
|
|
28
|
+
* the deploy would delete them, and without `--prune-unmanaged-relations` it deletes
|
|
29
|
+
* nothing — so the resource itself is untouched and naming it as an update
|
|
30
|
+
* would describe a write that never happens.
|
|
31
|
+
*/
|
|
32
|
+
export function onlyUnmanagedChanges(entry) {
|
|
33
|
+
return (entry.changes?.length ?? 0) > 0 && entry.changes.every(change => change.origin === 'unmanaged');
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* True for a resource the deploy writes only to set a baseline: Checkly
|
|
37
|
+
* compared it with what is live for want of an earlier planned deploy
|
|
38
|
+
* (`basis: 'live'`) and found nothing to report, or nothing but relations the
|
|
39
|
+
* project does not manage. The write happens whatever was found, and the
|
|
40
|
+
* reported changes are not exhaustive (a secret or content Checkly does not
|
|
41
|
+
* return may differ), so the plan lists the resource; but as a baseline, not
|
|
42
|
+
* as the update a resource with a difference to show is. Relations the
|
|
43
|
+
* project does not manage count for nothing here whether or not the deploy
|
|
44
|
+
* prunes them: pruned, each is deleted on an entry of its own, which the plan
|
|
45
|
+
* lists; not pruned, they are left alone, which the `!` row says.
|
|
46
|
+
*/
|
|
47
|
+
export function writtenForBaseline(entry) {
|
|
48
|
+
return entry.basis === 'live' && entry.action === 'UPDATE'
|
|
49
|
+
&& (entry.changes ?? []).every(change => change.origin === 'unmanaged');
|
|
50
|
+
}
|
|
51
|
+
/** A relation reported as part of the check or group it belongs to, not as a resource of its own. */
|
|
52
|
+
function isFolded(entry, foldedTypes) {
|
|
53
|
+
return entry.foldedInto !== undefined || foldedTypes.includes(entry.type);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Entries worth showing: a resource the deploy touches. An `UNCHANGED` entry
|
|
57
|
+
* with no changes of its own is the converged case and says nothing, a relation
|
|
58
|
+
* folded into its parent is already reported there, and a resource whose only
|
|
59
|
+
* reported changes are unmanaged relations is not written either, unless the
|
|
60
|
+
* deploy writes it to set the baseline for later plans.
|
|
61
|
+
*/
|
|
62
|
+
function reportable(entry, { foldedTypes }) {
|
|
63
|
+
// A relation the deploy would delete is reported on its own entry, folded
|
|
64
|
+
// into its parent for display. It is the one folded entry worth a line of its
|
|
65
|
+
// own: nothing else in the plan says which relations are about to go.
|
|
66
|
+
if (isPrunedRelation(entry)) {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
if (isFolded(entry, foldedTypes)) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
// Whether or not the relations are pruned, the resource they hang off is not
|
|
73
|
+
// written: with `--prune-unmanaged-relations` the relation's own entry carries the line.
|
|
74
|
+
// Except when Checkly had no usable state from an earlier planned deploy and
|
|
75
|
+
// compared the resource with what is deployed (`basis: 'live'`): the deploy
|
|
76
|
+
// writes it whatever was found, so it is never "nothing to apply".
|
|
77
|
+
if (onlyUnmanagedChanges(entry) && entry.basis !== 'live') {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
return entry.action !== 'UNCHANGED' || (entry.changes?.length ?? 0) > 0;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* True when the plan gives the deploy nothing to write: no resource to create,
|
|
84
|
+
* update, delete or detach, and no relation to prune. Relations the project
|
|
85
|
+
* does not manage and is not pruning do not count, since the deploy leaves
|
|
86
|
+
* them alone.
|
|
87
|
+
*/
|
|
88
|
+
export function planHasNoChanges(diff, options) {
|
|
89
|
+
return !diff.some(entry => reportable(entry, options));
|
|
90
|
+
}
|
|
91
|
+
function label(entry, { prettyTypes }) {
|
|
92
|
+
return `${prettyTypes[entry.type] ?? entry.type}: ${entry.logicalId}`;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* One line per resource the deploy would touch, deletions first and in full,
|
|
96
|
+
* for the confirmation prompt and the agent envelope.
|
|
97
|
+
*/
|
|
98
|
+
export function planChangeLines(diff, options) {
|
|
99
|
+
const shown = diff.filter(entry => reportable(entry, options));
|
|
100
|
+
const deletions = shown.filter(entry => entry.action === 'DELETE');
|
|
101
|
+
// `DETACHED` is what an API older than the deploy diff calls the same thing.
|
|
102
|
+
const detached = (entry) => entry.action === 'DETACH' || entry.action === 'DETACHED';
|
|
103
|
+
const detachments = shown.filter(detached);
|
|
104
|
+
// What the deploy changes comes first, so that a long first plan does not
|
|
105
|
+
// push its few real edits past the window with resources it only baselines.
|
|
106
|
+
const rest = [
|
|
107
|
+
...shown.filter(entry => entry.action !== 'DELETE' && !detached(entry) && !writtenForBaseline(entry)),
|
|
108
|
+
...shown.filter(writtenForBaseline),
|
|
109
|
+
];
|
|
110
|
+
const lines = [
|
|
111
|
+
...deletions.map(entry => (isPrunedRelation(entry)
|
|
112
|
+
// Not a resource the project declared, so it has no run history to lose;
|
|
113
|
+
// what it names is the check or group it hangs off, when the plan says.
|
|
114
|
+
? `Delete the ${options.prettyTypes[entry.type] ?? entry.type} `
|
|
115
|
+
+ (entry.foldedInto
|
|
116
|
+
? `on ${options.prettyTypes[entry.foldedInto.type] ?? entry.foldedInto.type}: `
|
|
117
|
+
+ `${entry.foldedInto.logicalId}, `
|
|
118
|
+
: `${entry.logicalId}, `)
|
|
119
|
+
+ 'which this project does not manage'
|
|
120
|
+
: `Permanently delete ${label(entry, options)}, losing its run history`)),
|
|
121
|
+
...detachments.map(entry => `Keep ${label(entry, options)} in your Checkly account, managed from the web app`),
|
|
122
|
+
...rest.slice(0, MAX_LISTED_CHANGES).map(entry => {
|
|
123
|
+
const verb = entry.action === 'CREATE'
|
|
124
|
+
? 'Create'
|
|
125
|
+
: writtenForBaseline(entry) ? 'Set a baseline for' : 'Update';
|
|
126
|
+
return `${verb} ${label(entry, options)}`;
|
|
127
|
+
}),
|
|
128
|
+
];
|
|
129
|
+
const hidden = rest.slice(MAX_LISTED_CHANGES);
|
|
130
|
+
const hiddenBaselines = hidden.filter(writtenForBaseline).length;
|
|
131
|
+
const hiddenChanges = hidden.length - hiddenBaselines;
|
|
132
|
+
const summed = [
|
|
133
|
+
...(hiddenChanges > 0 ? [`Create or update ${hiddenChanges} more resource(s)`] : []),
|
|
134
|
+
...(hiddenBaselines > 0 ? [`Set a baseline for ${hiddenBaselines} more resource(s)`] : []),
|
|
135
|
+
];
|
|
136
|
+
if (summed.length > 0) {
|
|
137
|
+
lines.push(`${summed.join(' and ')}; run with --preview to see them all`);
|
|
138
|
+
}
|
|
139
|
+
return lines;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Whether the deploy would overwrite a value changed in Checkly. A path both
|
|
143
|
+
* sides moved is settled when the code now holds what Checkly holds (the
|
|
144
|
+
* user copied the edit into the code), and Checkly can still report it then.
|
|
145
|
+
* A secret or a change reported by cause alone carries no comparable values,
|
|
146
|
+
* so it counts.
|
|
147
|
+
*/
|
|
148
|
+
function overwritesRemoteChange(change) {
|
|
149
|
+
if (change.origin === 'remote') {
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
if (change.origin !== 'both') {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
return change.secret === true || change.cause !== undefined || !isDeepStrictEqual(change.after, change.remote?.after);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The resources the plan reports as changed in Checkly, one per check, group
|
|
159
|
+
* or other declared resource: a relation's drift (an alert channel
|
|
160
|
+
* subscription removed in Checkly, say) is reported on the resource it is
|
|
161
|
+
* folded into. Relations the project does not manage are not drift: they are
|
|
162
|
+
* left alone unless `--prune-unmanaged-relations` asks for them to be deleted.
|
|
163
|
+
*
|
|
164
|
+
* Blind to a resource without a baseline (`basis: 'live'`): Checkly compares
|
|
165
|
+
* it with what is deployed, so code changes and edits made in Checkly look
|
|
166
|
+
* the same. {@link unbaselinedResources} counts those. Also blind to a
|
|
167
|
+
* resource the code removes: Checkly reports no changes on a deletion.
|
|
168
|
+
*/
|
|
169
|
+
export function findDrift(diff, { foldedTypes }) {
|
|
170
|
+
const byResource = new Map();
|
|
171
|
+
for (const entry of diff) {
|
|
172
|
+
const remotePaths = (entry.changes ?? [])
|
|
173
|
+
.filter(overwritesRemoteChange)
|
|
174
|
+
.map(change => change.path);
|
|
175
|
+
// Checkly marks a creation `remote` when the resource the last deploy
|
|
176
|
+
// wrote was deleted in Checkly since.
|
|
177
|
+
const recreated = entry.action === 'CREATE' && entry.origin === 'remote';
|
|
178
|
+
if (remotePaths.length === 0 && !recreated) {
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
const owner = entry.foldedInto ?? entry;
|
|
182
|
+
const key = `${owner.type}:${owner.logicalId}`;
|
|
183
|
+
const resource = byResource.get(key)
|
|
184
|
+
?? { type: owner.type, logicalId: owner.logicalId, deleted: false, paths: [] };
|
|
185
|
+
byResource.set(key, resource);
|
|
186
|
+
if (recreated && !isFolded(entry, foldedTypes)) {
|
|
187
|
+
resource.deleted = true;
|
|
188
|
+
}
|
|
189
|
+
else if (recreated) {
|
|
190
|
+
// A relation has no path on its owner; its type says what was removed.
|
|
191
|
+
resource.paths.push(entry.type);
|
|
192
|
+
}
|
|
193
|
+
resource.paths.push(...remotePaths);
|
|
194
|
+
}
|
|
195
|
+
return [...byResource.values()]
|
|
196
|
+
.map(resource => ({ ...resource, paths: [...new Set(resource.paths)] }))
|
|
197
|
+
.sort((a, b) => a.type.localeCompare(b.type) || a.logicalId.localeCompare(b.logicalId));
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* How many declared resources Checkly had no earlier planned deploy to
|
|
201
|
+
* compare with (`basis: 'live'`), which {@link findDrift} cannot check.
|
|
202
|
+
*/
|
|
203
|
+
export function unbaselinedResources(diff, { foldedTypes }) {
|
|
204
|
+
return diff.filter(entry => entry.basis === 'live' && !isFolded(entry, foldedTypes)).length;
|
|
205
|
+
}
|
|
206
|
+
/** One line per drifted resource, saying what changed in Checkly and what the deploy would do about it. */
|
|
207
|
+
export function driftLines(drift, options) {
|
|
208
|
+
return drift.map(resource => {
|
|
209
|
+
const name = `${options.prettyTypes[resource.type] ?? resource.type}: ${resource.logicalId}`;
|
|
210
|
+
return resource.deleted
|
|
211
|
+
? `${name} was deleted in Checkly; this deploy would create it again`
|
|
212
|
+
: `${name} was changed in Checkly (${resource.paths.join(', ')}); this deploy would overwrite it`;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* A value small enough to carry, or `{ $omitted: <length> }` in its place.
|
|
217
|
+
*/
|
|
218
|
+
function reduceValue(value) {
|
|
219
|
+
if (value === null || value === undefined || typeof value === 'boolean' || typeof value === 'number') {
|
|
220
|
+
return value;
|
|
221
|
+
}
|
|
222
|
+
// Not only strings: a leaf can be a whole collection (a check group's
|
|
223
|
+
// environment variables, a status page's cards), and one of those holding a
|
|
224
|
+
// large value would otherwise go into the envelope in full.
|
|
225
|
+
const size = typeof value === 'string' ? value.length : JSON.stringify(value)?.length ?? 0;
|
|
226
|
+
return size > MAX_INLINE_VALUE ? { $omitted: size } : value;
|
|
227
|
+
}
|
|
228
|
+
function reduceChange(change) {
|
|
229
|
+
return {
|
|
230
|
+
...change,
|
|
231
|
+
...'before' in change ? { before: reduceValue(change.before) } : {},
|
|
232
|
+
...'after' in change ? { after: reduceValue(change.after) } : {},
|
|
233
|
+
...change.remote !== undefined
|
|
234
|
+
? {
|
|
235
|
+
remote: {
|
|
236
|
+
...'before' in change.remote ? { before: reduceValue(change.remote.before) } : {},
|
|
237
|
+
...'after' in change.remote ? { after: reduceValue(change.remote.after) } : {},
|
|
238
|
+
},
|
|
239
|
+
}
|
|
240
|
+
: {},
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* The plan as the agent envelope carries it: every entry and every changed
|
|
245
|
+
* property, but without the resources' full current state and without the
|
|
246
|
+
* large values the rendered diff needs. Rendering happens in the terminal
|
|
247
|
+
* output; the envelope is there to be read, and it is the same plan, pinned by
|
|
248
|
+
* the same `planToken`.
|
|
249
|
+
*/
|
|
250
|
+
export function reducePlanForAgent(diff) {
|
|
251
|
+
return diff.map(entry => {
|
|
252
|
+
const reduced = { ...entry };
|
|
253
|
+
// The rule table is applied to `before`; without the state, it is dead weight.
|
|
254
|
+
delete reduced.before;
|
|
255
|
+
delete reduced.redactions;
|
|
256
|
+
if (entry.changes !== undefined) {
|
|
257
|
+
reduced.changes = entry.changes.map(reduceChange);
|
|
258
|
+
}
|
|
259
|
+
return reduced;
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=plan-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-summary.js","sourceRoot":"","sources":["../../../src/services/deploy-diff/plan-summary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAI7C;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAE7B;;;;;GAKG;AACH,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAS5B,6EAA6E;AAC7E,MAAM,UAAU,gBAAgB,CAAE,KAAgB;IAChD,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,CAAA;AAClE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAE,KAAgB;IACpD,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,OAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC,CAAA;AAC1G,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAE,KAAgB;IAClD,OAAO,K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D,OAAO,OAAO,CAAA;IAChB,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Project } from '../../constructs/index.js';
|
|
2
|
+
import type { DeployResourceSync, DiffEntry } from '../../rest/projects.js';
|
|
3
|
+
import { type RenderedLine } from './render.js';
|
|
4
|
+
/**
|
|
5
|
+
* The text `checkly deploy` prints for a plan: what `--preview` shows, what
|
|
6
|
+
* `--output` prints after a deploy, and what a deploy refused for a stale plan
|
|
7
|
+
* prints in its place. Shaped like a plan: an overview of every touched
|
|
8
|
+
* resource with a marker per action, the construct diff of each updated
|
|
9
|
+
* resource, and the totals. The markers carry the meaning; colour is for a
|
|
10
|
+
* terminal and chalk drops it for a pipe or under `NO_COLOR`.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum ResourceDeployStatus {
|
|
13
|
+
UPDATE = "UPDATE",
|
|
14
|
+
CREATE = "CREATE",
|
|
15
|
+
DELETE = "DELETE",
|
|
16
|
+
DETACH = "DETACH",
|
|
17
|
+
DETACHED = "DETACHED",
|
|
18
|
+
UNCHANGED = "UNCHANGED"
|
|
19
|
+
}
|
|
20
|
+
/** How a resource type reads when there is no construct to name it by (a deleted resource, a relation). */
|
|
21
|
+
export declare const PRETTY_RESOURCE_TYPES: Record<string, string>;
|
|
22
|
+
export declare const NON_REPORTED_TYPES: string[];
|
|
23
|
+
export interface PreviewOutputInput {
|
|
24
|
+
/** The heading line; none when the lines that follow name the deploy already. */
|
|
25
|
+
heading?: {
|
|
26
|
+
title: string;
|
|
27
|
+
projectName: string;
|
|
28
|
+
accountName?: string;
|
|
29
|
+
};
|
|
30
|
+
diff: DiffEntry[];
|
|
31
|
+
/** The plan was carried out: the totals read as what happened, not what would. */
|
|
32
|
+
done?: boolean;
|
|
33
|
+
project: Project;
|
|
34
|
+
/** Print each resource's name and id under its row. */
|
|
35
|
+
verbose?: boolean;
|
|
36
|
+
/** Whether this deploy deletes the relations it does not manage. */
|
|
37
|
+
pruneRelations?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The preview plan with each changed resource's deployed state, and the
|
|
40
|
+
* local payload it was computed for: with these, every updated resource
|
|
41
|
+
* prints the diff of its construct as deployed against as in code.
|
|
42
|
+
*/
|
|
43
|
+
rendering?: {
|
|
44
|
+
plan: DiffEntry[];
|
|
45
|
+
local: DeployResourceSync[];
|
|
46
|
+
};
|
|
47
|
+
/** Printed with the command that deploys exactly this plan. */
|
|
48
|
+
planToken?: string;
|
|
49
|
+
}
|
|
50
|
+
export declare const MARKER: {
|
|
51
|
+
create: string;
|
|
52
|
+
update: string;
|
|
53
|
+
delete: string;
|
|
54
|
+
detach: string;
|
|
55
|
+
prune: string;
|
|
56
|
+
warn: string;
|
|
57
|
+
skip: string;
|
|
58
|
+
/** Written once to set the baseline; nothing differs that the comparison can show. */
|
|
59
|
+
baseline: string;
|
|
60
|
+
};
|
|
61
|
+
export declare function formatPreview(input: PreviewOutputInput): string;
|
|
62
|
+
/** One rendered line with its marker and colour; a nested line sits two columns further in. */
|
|
63
|
+
export declare function styled(line: RenderedLine): string;
|