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
package/dist/formatters/usage.js
CHANGED
|
@@ -1,273 +1,313 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
for (const meter of metrics.meters) {
|
|
7
|
-
if (meter.meterType === 'CHECK_RUN')
|
|
8
|
-
return meter.measures;
|
|
9
|
-
}
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
export function aiInvocationMeasures(metrics) {
|
|
13
|
-
for (const meter of metrics.meters) {
|
|
14
|
-
if (meter.meterType === 'AI_INVOCATION')
|
|
15
|
-
return meter.measures;
|
|
16
|
-
}
|
|
17
|
-
return undefined;
|
|
2
|
+
import { shellJoin, shellQuote } from '../services/shell.js';
|
|
3
|
+
import { heading, renderAdaptiveTable, renderCommandHints, renderDetailFields, } from './render.js';
|
|
4
|
+
function number(value) {
|
|
5
|
+
return value == null ? '-' : value.toLocaleString('en-US', { maximumFractionDigits: 4 });
|
|
18
6
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
7
|
+
function percent(value) {
|
|
8
|
+
return value === null ? '-' : `${value.toLocaleString('en-US', { maximumFractionDigits: 2 })}%`;
|
|
21
9
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
return dash(format);
|
|
25
|
-
return Number.isInteger(value)
|
|
26
|
-
? value.toLocaleString('en-US')
|
|
27
|
-
: value.toLocaleString('en-US', { maximumFractionDigits: 2 });
|
|
10
|
+
function dateRange(period) {
|
|
11
|
+
return period === null ? '-' : `${period.from} to ${period.to}`;
|
|
28
12
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
return dash(format);
|
|
32
|
-
return `${value.toLocaleString('en-US', { maximumFractionDigits: 2 })}%`;
|
|
13
|
+
function section(title, body, format, level = 2) {
|
|
14
|
+
return `${heading(title, level, format)}\n\n${body}`;
|
|
33
15
|
}
|
|
34
|
-
function
|
|
35
|
-
|
|
16
|
+
function namedId(id, names) {
|
|
17
|
+
if (id === undefined)
|
|
18
|
+
return '-';
|
|
19
|
+
const name = names?.get(id);
|
|
20
|
+
return name && name !== id ? `${name} (${id})` : id;
|
|
36
21
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
22
|
+
export function formatUsageTermsList(terms, format) {
|
|
23
|
+
if (terms.length === 0)
|
|
24
|
+
return 'No usage terms found.';
|
|
25
|
+
const columns = [
|
|
26
|
+
{ header: 'Name', minWidth: 15, maxWidth: 40, value: term => term.name },
|
|
27
|
+
{ header: 'ID', minWidth: 38, truncate: false, value: term => term.id },
|
|
28
|
+
{ header: 'Contract start', value: term => term.contractStartDate },
|
|
29
|
+
{ header: 'Contract end', value: term => term.contractEndDate },
|
|
30
|
+
{ header: 'Usage start', value: term => term.usageStartDate },
|
|
31
|
+
{ header: 'Credit budget', align: 'right', value: term => number(term.creditBudget) },
|
|
32
|
+
{ header: 'Package model', value: term => term.packageModel ?? '-' },
|
|
33
|
+
{ header: 'Accounts', align: 'right', value: term => String(term.accounts.length) },
|
|
34
|
+
];
|
|
35
|
+
return renderAdaptiveTable(columns, terms, format);
|
|
39
36
|
}
|
|
40
|
-
function
|
|
41
|
-
if (
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
function formatPricingRule(rule, format, level) {
|
|
38
|
+
if (rule === null)
|
|
39
|
+
return 'Pricing rule unavailable.';
|
|
40
|
+
switch (rule.method) {
|
|
41
|
+
case 'per_unit': {
|
|
42
|
+
const fields = [
|
|
43
|
+
{ label: 'Method', value: value => value.method },
|
|
44
|
+
{ label: 'Quantity', value: value => number(value.quantity) },
|
|
45
|
+
{ label: 'Unit', value: value => value.unit },
|
|
46
|
+
{ label: 'Credits', value: value => number(value.credits) },
|
|
47
|
+
{ label: 'Included quantity', value: value => number(value.included?.quantity) },
|
|
48
|
+
{ label: 'Included period', value: value => value.included?.period ?? '-' },
|
|
49
|
+
];
|
|
50
|
+
const output = [renderDetailFields('Pricing rule', fields, rule, format, level)];
|
|
51
|
+
if (rule.rates !== undefined) {
|
|
52
|
+
output.push(section('Conditional rates', renderAdaptiveTable([
|
|
53
|
+
{ header: 'Condition', value: rate => rate.when },
|
|
54
|
+
{ header: 'Credits', align: 'right', value: rate => number(rate.credits) },
|
|
55
|
+
], rule.rates, format), format, level === 3 ? 4 : 5));
|
|
56
|
+
}
|
|
57
|
+
return output.join('\n\n');
|
|
58
|
+
}
|
|
59
|
+
case 'per_period':
|
|
60
|
+
return renderDetailFields('Pricing rule', [
|
|
61
|
+
{ label: 'Method', value: value => value.method },
|
|
62
|
+
{ label: 'Period', value: value => value.period },
|
|
63
|
+
{ label: 'Annual credits', value: value => number(value.price.annualCredits) },
|
|
64
|
+
], rule, format, level);
|
|
65
|
+
case 'capacity_blocks_per_period':
|
|
66
|
+
return renderDetailFields('Pricing rule', [
|
|
67
|
+
{ label: 'Method', value: value => value.method },
|
|
68
|
+
{ label: 'Period', value: value => value.period },
|
|
69
|
+
{ label: 'Unit', value: value => value.unit },
|
|
70
|
+
{ label: 'Included quantity', value: value => number(value.included.quantity) },
|
|
71
|
+
{ label: 'Block quantity', value: value => number(value.block.quantity) },
|
|
72
|
+
{ label: 'Annual credits per block', value: value => number(value.block.annualCredits) },
|
|
73
|
+
], rule, format, level);
|
|
74
|
+
default: {
|
|
75
|
+
const exhaustive = rule;
|
|
76
|
+
return exhaustive;
|
|
77
|
+
}
|
|
47
78
|
}
|
|
48
|
-
const labelWidth = Math.max(0, ...entries.map(entry => entry.label.length)) + 3;
|
|
49
|
-
return entries
|
|
50
|
-
.map(entry => `${chalk.dim(padColumn(`${entry.label}:`, labelWidth, 'left', false))}${entry.value}`)
|
|
51
|
-
.join('\n');
|
|
52
79
|
}
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
{ label: 'ID', value: terms => terms.id },
|
|
63
|
-
];
|
|
64
|
-
function buildAccountColumns(format) {
|
|
65
|
-
if (format === 'md') {
|
|
66
|
-
return [
|
|
67
|
-
{ header: 'Name', value: account => account.name },
|
|
68
|
-
{ header: 'ID', value: account => account.id },
|
|
69
|
-
];
|
|
70
|
-
}
|
|
71
|
-
return [
|
|
72
|
-
{ header: 'Name', minWidth: 12, maxWidth: 40, value: account => account.name },
|
|
73
|
-
{ header: 'ID', width: 38, value: account => chalk.dim(account.id) },
|
|
80
|
+
export function formatUsageTermDetail(term, format) {
|
|
81
|
+
const fields = [
|
|
82
|
+
{ label: 'ID', value: value => value.id },
|
|
83
|
+
{ label: 'Contract period', value: value => `${value.contractStartDate} to ${value.contractEndDate}` },
|
|
84
|
+
{ label: 'Usage start date', value: value => value.usageStartDate },
|
|
85
|
+
{ label: 'Credit budget', value: value => number(value.creditBudget) },
|
|
86
|
+
{ label: 'Package model', value: value => value.packageModel ?? '-' },
|
|
87
|
+
{ label: 'Standard credits / unit', value: value => number(value.standardCreditsPerUnit) },
|
|
88
|
+
{ label: 'Premium credits / unit', value: value => number(value.premiumCreditsPerUnit) },
|
|
74
89
|
];
|
|
90
|
+
const output = [renderDetailFields(`Usage term: ${term.name}`, fields, term, format, 1)];
|
|
91
|
+
output.push(section('Accounts', renderAdaptiveTable([
|
|
92
|
+
{ header: 'Name', minWidth: 15, maxWidth: 40, value: account => account.name },
|
|
93
|
+
{ header: 'ID', minWidth: 38, truncate: false, value: account => account.id },
|
|
94
|
+
], term.accounts, format), format));
|
|
95
|
+
if (term.pricingRules === null)
|
|
96
|
+
output.push(section('Pricing rules', 'Pricing rules unavailable.', format));
|
|
97
|
+
else {
|
|
98
|
+
for (const [key, rule] of Object.entries(term.pricingRules)) {
|
|
99
|
+
output.push(section(key, formatPricingRule(rule, format, 3), format));
|
|
100
|
+
}
|
|
101
|
+
if (Object.keys(term.pricingRules).length === 0)
|
|
102
|
+
output.push(section('Pricing rules', 'No pricing rules.', format));
|
|
103
|
+
}
|
|
104
|
+
return output.join('\n\n');
|
|
75
105
|
}
|
|
76
|
-
export function
|
|
77
|
-
|
|
78
|
-
lines.push(renderDetailFields(`Usage terms: ${terms.name}`, termsDetailFields, terms, format));
|
|
79
|
-
lines.push('');
|
|
80
|
-
lines.push(sectionHeading('Accounts', format));
|
|
81
|
-
if (format === 'md')
|
|
82
|
-
lines.push('');
|
|
83
|
-
lines.push(renderAdaptiveTable(buildAccountColumns(format), terms.accounts, format));
|
|
84
|
-
return lines.join('\n');
|
|
85
|
-
}
|
|
86
|
-
// --- Warnings ---
|
|
87
|
-
export function formatUsageWarnings(warnings, format) {
|
|
88
|
-
if (warnings.length === 0)
|
|
106
|
+
export function formatUsageCoverage(coverage, format) {
|
|
107
|
+
if (coverage.gaps.length === 0)
|
|
89
108
|
return '';
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
.map(warning => `${logSymbols.warning} ${chalk.yellow(warning.message)} ${chalk.dim(`(${warning.code})`)}`)
|
|
95
|
-
.join('\n');
|
|
109
|
+
return section('Coverage gaps (credits unavailable)', renderAdaptiveTable([
|
|
110
|
+
{ header: 'From', value: gap => gap.from },
|
|
111
|
+
{ header: 'To', value: gap => gap.to },
|
|
112
|
+
], coverage.gaps, format), format);
|
|
96
113
|
}
|
|
97
|
-
function
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
|
|
114
|
+
function formatCalculation(calculation, index, format, level) {
|
|
115
|
+
const title = `Calculation ${index + 1}`;
|
|
116
|
+
if ('rateCondition' in calculation) {
|
|
117
|
+
return renderDetailFields(title, [
|
|
118
|
+
{ label: 'Rate condition', value: value => value.rateCondition ?? 'Default rate' },
|
|
119
|
+
{ label: 'Measured quantity', value: value => number(value.measuredQuantity) },
|
|
120
|
+
{ label: 'Included quantity', value: value => number(value.includedQuantity) },
|
|
121
|
+
{ label: 'Billable quantity', value: value => number(value.billableQuantity) },
|
|
122
|
+
{ label: 'Credits used', value: value => number(value.creditsUsed) },
|
|
123
|
+
], calculation, format, level);
|
|
124
|
+
}
|
|
125
|
+
if ('scope' in calculation) {
|
|
126
|
+
return renderDetailFields(title, [
|
|
127
|
+
{ label: 'Scope', value: value => value.scope },
|
|
128
|
+
{ label: 'Measured quantity', value: value => number(value.measuredQuantity) },
|
|
129
|
+
{ label: 'Included quantity', value: value => number(value.includedQuantity) },
|
|
130
|
+
{ label: 'Billable block days', value: value => number(value.billableBlockDays) },
|
|
131
|
+
{ label: 'Applied daily credits per block', value: value => number(value.appliedDailyCreditsPerBlock) },
|
|
132
|
+
{ label: 'Proration days per year', value: value => String(value.proration.daysPerYear) },
|
|
133
|
+
{ label: 'Credits used', value: value => number(value.creditsUsed) },
|
|
134
|
+
], calculation, format, level);
|
|
135
|
+
}
|
|
136
|
+
return renderDetailFields(title, [
|
|
137
|
+
{ label: 'Billable resource days', value: value => number(value.billableResourceDays) },
|
|
138
|
+
{ label: 'Applied daily credits', value: value => number(value.appliedDailyCredits) },
|
|
139
|
+
{ label: 'Proration days per year', value: value => String(value.proration.daysPerYear) },
|
|
140
|
+
{ label: 'Credits used', value: value => number(value.creditsUsed) },
|
|
141
|
+
], calculation, format, level);
|
|
103
142
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
label: '
|
|
108
|
-
value:
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
label: 'Progress',
|
|
112
|
-
value: view => {
|
|
113
|
-
const { weeksSinceStart, weeksRemaining } = view.summary.projections;
|
|
114
|
-
return `${weeksSinceStart} weeks since usage start, ${weeksRemaining} remaining`;
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
{ label: 'Credit budget', value: (view, fmt) => (view.terms ? formatNumber(view.terms.creditBudget, fmt) : null) },
|
|
118
|
-
{ label: 'Credits used', value: (view, fmt) => creditsLabel(view.summary.totals, fmt) },
|
|
119
|
-
{ label: 'Remaining credits', value: (view, fmt) => formatNumber(view.summary.projections.remainingCredits, fmt) },
|
|
120
|
-
{ label: 'Usage terms ID', value: view => view.summary.usageTermsId },
|
|
121
|
-
];
|
|
122
|
-
function checkRunEntries(metrics, format) {
|
|
123
|
-
const measures = checkRunMeasures(metrics);
|
|
124
|
-
if (!measures)
|
|
125
|
-
return [{ label: 'Check runs', value: dash(format) }];
|
|
126
|
-
return [
|
|
127
|
-
{ label: 'Total runs', value: formatNumber(measures.totalRuns, format) },
|
|
128
|
-
{ label: 'Final runs', value: formatNumber(measures.finalRuns, format) },
|
|
129
|
-
{ label: 'Retry runs', value: formatNumber(measures.retryRuns, format) },
|
|
130
|
-
{ label: 'Cancelled runs', value: formatNumber(measures.cancelledRuns, format) },
|
|
131
|
-
{ label: 'Degraded runs', value: formatNumber(measures.degradedRuns, format) },
|
|
132
|
-
{ label: 'Failed runs', value: formatNumber(measures.failedRuns, format) },
|
|
133
|
-
{ label: 'Error runs', value: formatNumber(measures.errorRuns, format) },
|
|
134
|
-
{ label: 'Aborted runs', value: formatNumber(measures.abortedRuns, format) },
|
|
135
|
-
{ label: 'Over max response time runs', value: formatNumber(measures.overMaxResponseTimeRuns, format) },
|
|
136
|
-
{ label: 'Multi-step requests', value: formatNumber(measures.multiStepRequests, format) },
|
|
137
|
-
{ label: 'Playwright billable duration', value: formatMs(measures.playwrightBillableDurationMs) },
|
|
138
|
-
{ label: 'Standard billable units', value: formatNumber(measures.standardBillableUnits, format) },
|
|
139
|
-
{ label: 'Premium billable units', value: formatNumber(measures.premiumBillableUnits, format) },
|
|
143
|
+
export function formatUsageSummary(summary, format) {
|
|
144
|
+
const fields = [
|
|
145
|
+
{ label: 'Period', value: value => dateRange(value.period) },
|
|
146
|
+
{ label: 'Usage term IDs', value: value => value.usageTermsIds.join(', ') || '-' },
|
|
147
|
+
{ label: 'Credits used', value: value => number(value.totals.creditsUsed) },
|
|
140
148
|
];
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const measures = aiInvocationMeasures(metrics);
|
|
144
|
-
if (!measures)
|
|
145
|
-
return [{ label: 'Invocations', value: dash(format) }];
|
|
146
|
-
return [
|
|
147
|
-
{ label: 'Invocations', value: formatNumber(measures.invocations, format) },
|
|
148
|
-
{ label: 'Duration', value: formatMs(measures.durationMs) },
|
|
149
|
+
const columns = [
|
|
150
|
+
{ header: 'Period', truncate: false, value: row => dateRange(row.period) },
|
|
149
151
|
];
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
percentAtEnd: window.projectedPercentAtContractEnd,
|
|
158
|
-
weeksUntilExhausted: window.projectedWeeksUntilExhausted,
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
function buildProjectionColumns() {
|
|
152
|
+
if (summary.usageTermsIds.length !== 1) {
|
|
153
|
+
columns.push({ header: 'Usage term ID', minWidth: 38, truncate: false, value: row => row.usageTermsId });
|
|
154
|
+
}
|
|
155
|
+
if (summary.breakdown.some(row => row.accountId !== undefined)) {
|
|
156
|
+
columns.push({ header: 'Account ID', minWidth: 38, truncate: false, value: row => row.accountId ?? '-' });
|
|
157
|
+
}
|
|
158
|
+
columns.push({ header: 'Pricing rule', truncate: false, value: row => row.pricingRuleKey }, { header: 'Credits used', align: 'right', value: row => number(row.creditsUsed) });
|
|
162
159
|
return [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
value: (row, fmt) => formatPercent(row.annualPercent, fmt),
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
header: 'Credits at contract end',
|
|
173
|
-
width: 25,
|
|
174
|
-
align: 'right',
|
|
175
|
-
value: (row, fmt) => formatNumber(row.creditsAtEnd, fmt),
|
|
176
|
-
},
|
|
177
|
-
{ header: '% at contract end', width: 19, align: 'right', value: (row, fmt) => formatPercent(row.percentAtEnd, fmt) },
|
|
178
|
-
{
|
|
179
|
-
header: 'Weeks until exhausted',
|
|
180
|
-
width: 23,
|
|
181
|
-
align: 'right',
|
|
182
|
-
value: (row, fmt) => formatNumber(row.weeksUntilExhausted, fmt),
|
|
183
|
-
},
|
|
184
|
-
];
|
|
185
|
-
}
|
|
186
|
-
export function formatUsageSummary(summary, format, terms) {
|
|
187
|
-
const view = { summary, terms };
|
|
188
|
-
const title = terms ? `Usage: ${terms.name}` : 'Usage summary';
|
|
189
|
-
const { windows } = summary.projections;
|
|
190
|
-
const projectionRows = [
|
|
191
|
-
toProjectionRow('Since usage start', windows.sinceStart),
|
|
192
|
-
toProjectionRow('Last 30 days', windows.last30Days),
|
|
193
|
-
toProjectionRow('Last 7 days', windows.last7Days),
|
|
194
|
-
toProjectionRow('Last 1 day', windows.last1Day),
|
|
195
|
-
];
|
|
196
|
-
// Markdown needs a blank line between a heading and the table that follows it.
|
|
197
|
-
const headingGap = format === 'md' ? [''] : [];
|
|
198
|
-
const lines = [];
|
|
199
|
-
lines.push(renderDetailFields(title, summaryHeaderFields, view, format));
|
|
200
|
-
lines.push('');
|
|
201
|
-
lines.push(sectionHeading('Check runs', format), ...headingGap);
|
|
202
|
-
lines.push(renderMeasureList(checkRunEntries(summary.totals, format), format));
|
|
203
|
-
lines.push('');
|
|
204
|
-
lines.push(sectionHeading('Resolve', format), ...headingGap);
|
|
205
|
-
lines.push(renderMeasureList(resolveEntries(summary.totals, format), format));
|
|
206
|
-
lines.push('');
|
|
207
|
-
lines.push(sectionHeading('Projections (as of today)', format), ...headingGap);
|
|
208
|
-
lines.push(renderAdaptiveTable(buildProjectionColumns(), projectionRows, format));
|
|
209
|
-
return lines.join('\n');
|
|
210
|
-
}
|
|
211
|
-
function periodLabel(row, interval) {
|
|
212
|
-
return interval === 'day' ? row.periodStart : dateRange(row.periodStart, row.periodEnd);
|
|
160
|
+
renderDetailFields('Usage summary', fields, summary, format, 1),
|
|
161
|
+
formatUsageCoverage(summary.coverage, format),
|
|
162
|
+
summary.breakdown.length === 0
|
|
163
|
+
? 'No usage breakdowns for the requested range.'
|
|
164
|
+
: section('Usage breakdown', renderAdaptiveTable(columns, summary.breakdown, format), format),
|
|
165
|
+
].filter(Boolean).join('\n\n');
|
|
213
166
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
167
|
+
const runColumns = [
|
|
168
|
+
{ key: 'totalRuns', header: 'Total runs' },
|
|
169
|
+
{ key: 'finalRuns', header: 'Final runs' },
|
|
170
|
+
{ key: 'retryRuns', header: 'Retry runs' },
|
|
171
|
+
{ key: 'cancelledRuns', header: 'Cancelled runs' },
|
|
172
|
+
{ key: 'degradedRuns', header: 'Degraded runs' },
|
|
173
|
+
{ key: 'failedRuns', header: 'Failed runs' },
|
|
174
|
+
{ key: 'errorRuns', header: 'Error runs' },
|
|
175
|
+
{ key: 'abortedRuns', header: 'Aborted runs' },
|
|
176
|
+
{ key: 'overMaxResponseTimeRuns', header: 'Over max response time runs' },
|
|
177
|
+
];
|
|
178
|
+
export function formatUsageSeries(rows, format, options) {
|
|
179
|
+
if (rows.length === 0)
|
|
180
|
+
return 'No usage rows found for the requested range.';
|
|
181
|
+
const columns = [{
|
|
182
|
+
header: 'Period',
|
|
183
|
+
value: row => options.interval === 'day' ? row.periodStart : `${row.periodStart} to ${row.periodEnd}`,
|
|
184
|
+
}];
|
|
223
185
|
if (options.groupBy.includes('account')) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
186
|
+
columns.push({
|
|
187
|
+
header: 'Account', minWidth: 15, maxWidth: 60,
|
|
188
|
+
value: row => options.names?.accounts.get(row.dimensions.accountId ?? '') ?? '-',
|
|
189
|
+
}, {
|
|
190
|
+
header: 'Account ID', minWidth: 38, truncate: false,
|
|
191
|
+
value: row => row.dimensions.accountId ?? '-',
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
if (options.groupBy.includes('usageTerm')) {
|
|
195
|
+
columns.push({
|
|
196
|
+
header: 'Usage term', minWidth: 15, maxWidth: 60,
|
|
197
|
+
value: row => options.names?.terms.get(row.dimensions.usageTermsId ?? '') ?? '-',
|
|
198
|
+
}, {
|
|
199
|
+
header: 'Usage term ID', minWidth: 38, truncate: false,
|
|
200
|
+
value: row => row.dimensions.usageTermsId ?? '-',
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
if (options.groupBy.includes('pricingRule')) {
|
|
204
|
+
columns.push({ header: 'Pricing rule', value: row => row.dimensions.pricingRuleKey ?? '-' });
|
|
229
205
|
}
|
|
230
206
|
if (options.groupBy.includes('checkType')) {
|
|
231
|
-
columns.push({ header: 'Check type',
|
|
207
|
+
columns.push({ header: 'Check type', value: row => row.dimensions.checkType === null ? 'Unattributed' : row.dimensions.checkType ?? '-' });
|
|
208
|
+
}
|
|
209
|
+
columns.push({ header: 'Credits used', align: 'right', value: row => number(row.creditsUsed) });
|
|
210
|
+
if (options.include.includes('runs') || rows.some(row => row.runs !== undefined)) {
|
|
211
|
+
columns.push(...runColumns.map(({ key, header }) => ({
|
|
212
|
+
header, align: 'right', value: row => number(row.runs?.[key]),
|
|
213
|
+
})));
|
|
214
|
+
}
|
|
215
|
+
const output = [renderAdaptiveTable(columns, rows, format)];
|
|
216
|
+
if (options.include.includes('calculations')) {
|
|
217
|
+
for (const [index, row] of rows.entries()) {
|
|
218
|
+
output.push(section(`Row ${index + 1} calculations (${row.periodStart} to ${row.periodEnd})`, row.contributions.length === 0
|
|
219
|
+
? 'No contributions.'
|
|
220
|
+
: row.contributions.map(contribution => {
|
|
221
|
+
const fields = [
|
|
222
|
+
{ label: 'Usage term', value: value => namedId(value.usageTermsId, options.names?.terms) },
|
|
223
|
+
{ label: 'Pricing rule', value: value => value.pricingRuleKey },
|
|
224
|
+
{ label: 'Period', value: value => dateRange(value.period ?? null) },
|
|
225
|
+
{ label: 'Credits used', value: value => number(value.creditsUsed) },
|
|
226
|
+
];
|
|
227
|
+
return [
|
|
228
|
+
renderDetailFields('Contribution', fields, contribution, format, 3),
|
|
229
|
+
formatPricingRule(contribution.pricingRule ?? null, format, 4),
|
|
230
|
+
contribution.calculations === undefined
|
|
231
|
+
? 'Calculations unavailable.'
|
|
232
|
+
: contribution.calculations.length === 0 ? 'No calculations.' : '',
|
|
233
|
+
...contribution.calculations?.map((value, i) => formatCalculation(value, i, format, 4)) ?? [],
|
|
234
|
+
].filter(Boolean).join('\n\n');
|
|
235
|
+
}).join('\n\n'), format));
|
|
236
|
+
}
|
|
232
237
|
}
|
|
233
|
-
|
|
234
|
-
header: 'Total runs',
|
|
235
|
-
width: 12,
|
|
236
|
-
align: 'right',
|
|
237
|
-
value: (row, fmt) => formatNumber(checkRunMeasures(row)?.totalRuns, fmt),
|
|
238
|
-
}, {
|
|
239
|
-
header: 'Standard units',
|
|
240
|
-
width: 16,
|
|
241
|
-
align: 'right',
|
|
242
|
-
value: (row, fmt) => formatNumber(checkRunMeasures(row)?.standardBillableUnits, fmt),
|
|
243
|
-
}, {
|
|
244
|
-
header: 'Premium units',
|
|
245
|
-
width: 15,
|
|
246
|
-
align: 'right',
|
|
247
|
-
value: (row, fmt) => formatNumber(checkRunMeasures(row)?.premiumBillableUnits, fmt),
|
|
248
|
-
}, { header: 'Credits', width: 10, align: 'right', value: (row, fmt) => formatNumber(row.credits.used, fmt) }, {
|
|
249
|
-
header: '% of budget',
|
|
250
|
-
width: 13,
|
|
251
|
-
align: 'right',
|
|
252
|
-
value: (row, fmt) => formatPercent(row.credits.percentOfBudget, fmt),
|
|
253
|
-
}, {
|
|
254
|
-
header: 'Resolve invocations',
|
|
255
|
-
width: 21,
|
|
256
|
-
align: 'right',
|
|
257
|
-
value: (row, fmt) => formatNumber(aiInvocationMeasures(row)?.invocations, fmt),
|
|
258
|
-
});
|
|
259
|
-
return columns;
|
|
238
|
+
return output.join('\n\n');
|
|
260
239
|
}
|
|
261
|
-
export function
|
|
262
|
-
|
|
240
|
+
export function formatUsageProjections(value, format, term) {
|
|
241
|
+
const fields = [
|
|
242
|
+
{ label: 'Usage term', value: report => term ? `${term.name} (${report.usageTermsId})` : report.usageTermsId },
|
|
243
|
+
{ label: 'As of (completed UTC day)', value: report => report.asOf },
|
|
244
|
+
{ label: 'Period', value: report => dateRange(report.period) },
|
|
245
|
+
{ label: 'Weeks since usage start', value: report => String(report.weeksSinceStart) },
|
|
246
|
+
{ label: 'Weeks remaining', value: report => String(report.weeksRemaining) },
|
|
247
|
+
{ label: 'Credits used', value: report => number(report.creditsUsed) },
|
|
248
|
+
{ label: 'Remaining credits', value: report => number(report.remainingCredits) },
|
|
249
|
+
{ label: 'Budgeted daily credits', value: report => number(report.budgetedDailyCredits) },
|
|
250
|
+
];
|
|
251
|
+
const windowFields = [
|
|
252
|
+
{ label: 'Period', value: window => dateRange(window.period) },
|
|
253
|
+
{ label: 'Observed days', value: window => String(window.observedDays) },
|
|
254
|
+
{ label: 'Credits used', value: window => number(window.creditsUsed) },
|
|
255
|
+
{ label: 'Average daily credits', value: window => number(window.averageDailyCredits) },
|
|
256
|
+
{ label: 'Annual % of budget', value: window => percent(window.projectedAnnualPercentOfBudget) },
|
|
257
|
+
{ label: 'Credits at contract end', value: window => number(window.projectedCreditsAtContractEnd) },
|
|
258
|
+
{ label: 'Remaining credits at contract end', value: window => number(window.projectedRemainingCredits) },
|
|
259
|
+
{ label: '% at contract end', value: window => percent(window.projectedPercentAtContractEnd) },
|
|
260
|
+
{ label: 'Weeks until exhausted', value: window => window.projectedWeeksUntilExhausted === null
|
|
261
|
+
? '-'
|
|
262
|
+
: window.projectedWeeksUntilExhausted.toLocaleString('en-US', { maximumFractionDigits: 2 }) },
|
|
263
|
+
];
|
|
264
|
+
return [
|
|
265
|
+
renderDetailFields('Usage projections', fields, value, format, 1),
|
|
266
|
+
renderDetailFields('Since usage start', windowFields, value.windows.sinceStart, format, 2),
|
|
267
|
+
renderDetailFields('Last 30 days', windowFields, value.windows.last30Days, format, 2),
|
|
268
|
+
renderDetailFields('Last 7 days', windowFields, value.windows.last7Days, format, 2),
|
|
269
|
+
renderDetailFields('Last 1 day', windowFields, value.windows.last1Day, format, 2),
|
|
270
|
+
].join('\n\n');
|
|
271
|
+
}
|
|
272
|
+
export function formatUsagePaginationInfo(count, nextId, noun) {
|
|
273
|
+
return chalk.dim(`Showing ${count} ${noun}${count === 1 ? '' : 's'}${nextId ? ' (more available)' : ''}`);
|
|
263
274
|
}
|
|
264
|
-
export function
|
|
265
|
-
const
|
|
266
|
-
|
|
275
|
+
export function usageListCommand(kind, params, format = 'terminal') {
|
|
276
|
+
const parts = ['checkly', 'account', 'usage', kind];
|
|
277
|
+
const append = (flag, value) => {
|
|
278
|
+
if (value !== undefined)
|
|
279
|
+
parts.push(flag, String(value));
|
|
280
|
+
};
|
|
281
|
+
append('--from', params.from);
|
|
282
|
+
append('--to', params.to);
|
|
283
|
+
append('--limit', params.limit);
|
|
284
|
+
if ('interval' in params)
|
|
285
|
+
append('--interval', params.interval);
|
|
286
|
+
if ('groupBy' in params)
|
|
287
|
+
append('--group-by', params.groupBy?.length ? params.groupBy.join(',') : 'none');
|
|
288
|
+
if ('usageTermsIds' in params)
|
|
289
|
+
for (const id of params.usageTermsIds ?? [])
|
|
290
|
+
append('--usage-terms-id', id);
|
|
291
|
+
if ('accountIds' in params)
|
|
292
|
+
for (const id of params.accountIds ?? [])
|
|
293
|
+
append('--account-id', id);
|
|
294
|
+
if ('pricingRuleKeys' in params)
|
|
295
|
+
for (const key of params.pricingRuleKeys ?? [])
|
|
296
|
+
append('--pricing-rule', key);
|
|
297
|
+
if ('include' in params && params.include?.length)
|
|
298
|
+
append('--include', params.include.join(','));
|
|
299
|
+
if (format === 'md')
|
|
300
|
+
append('--output', 'md');
|
|
301
|
+
return shellJoin(parts);
|
|
267
302
|
}
|
|
268
|
-
export function
|
|
269
|
-
if (
|
|
303
|
+
export function formatUsageNavigationHints(nextId, baseCommand, format) {
|
|
304
|
+
if (nextId === null)
|
|
270
305
|
return '';
|
|
271
|
-
|
|
306
|
+
const command = `${baseCommand} --cursor ${shellQuote(nextId)}`;
|
|
307
|
+
if (format === 'md') {
|
|
308
|
+
const delimiter = '`'.repeat(Math.max(1, ...Array.from(command.matchAll(/`+/g), match => match[0].length + 1)));
|
|
309
|
+
return `Next page: ${delimiter}${command}${delimiter}`;
|
|
310
|
+
}
|
|
311
|
+
return renderCommandHints([{ label: 'Next page', command }], { gap: 1 });
|
|
272
312
|
}
|
|
273
313
|
//# sourceMappingURL=usage.js.map
|