checkly 5.3.1 → 5.4.0-prerelease-6249ef2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/index.js +125 -132
- package/dist/auth/index.js.map +1 -1
- package/dist/commands/authCommand.js +1 -1
- package/dist/commands/authCommand.js.map +1 -1
- package/dist/commands/baseCommand.d.ts +2 -0
- package/dist/commands/baseCommand.js +7 -9
- package/dist/commands/baseCommand.js.map +1 -1
- package/dist/commands/deploy.js +55 -57
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/destroy.js +15 -16
- package/dist/commands/destroy.js.map +1 -1
- package/dist/commands/env/add.js +28 -29
- package/dist/commands/env/add.js.map +1 -1
- package/dist/commands/env/ls.js +2 -2
- package/dist/commands/env/ls.js.map +1 -1
- package/dist/commands/env/pull.js +17 -17
- package/dist/commands/env/pull.js.map +1 -1
- package/dist/commands/env/rm.js +17 -18
- package/dist/commands/env/rm.js.map +1 -1
- package/dist/commands/env/update.js +29 -30
- package/dist/commands/env/update.js.map +1 -1
- package/dist/commands/help.js +2 -2
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/import/apply.d.ts +14 -0
- package/dist/commands/import/apply.js +157 -0
- package/dist/commands/import/apply.js.map +1 -0
- package/dist/commands/import/cancel.d.ts +11 -0
- package/dist/commands/import/cancel.js +119 -0
- package/dist/commands/import/cancel.js.map +1 -0
- package/dist/commands/import/commit.d.ts +14 -0
- package/dist/commands/import/commit.js +141 -0
- package/dist/commands/import/commit.js.map +1 -0
- package/dist/commands/import/plan.d.ts +20 -0
- package/dist/commands/import/plan.js +1237 -0
- package/dist/commands/import/plan.js.map +1 -0
- package/dist/commands/login.js +38 -48
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +9 -9
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/runtimes.js +2 -2
- package/dist/commands/runtimes.js.map +1 -1
- package/dist/commands/switch.js +9 -9
- package/dist/commands/switch.js.map +1 -1
- package/dist/commands/sync-playwright.js +7 -7
- package/dist/commands/sync-playwright.js.map +1 -1
- package/dist/commands/test.js +107 -111
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/trigger.js +74 -78
- package/dist/commands/trigger.js.map +1 -1
- package/dist/commands/whoami.js +2 -2
- package/dist/commands/whoami.js.map +1 -1
- package/dist/constructs/alert-channel-codegen.d.ts +35 -0
- package/dist/constructs/alert-channel-codegen.js +98 -0
- package/dist/constructs/alert-channel-codegen.js.map +1 -0
- package/dist/constructs/alert-channel-subscription-codegen.d.ts +11 -0
- package/dist/constructs/alert-channel-subscription-codegen.js +23 -0
- package/dist/constructs/alert-channel-subscription-codegen.js.map +1 -0
- package/dist/constructs/alert-channel-subscription.js +5 -1
- package/dist/constructs/alert-channel-subscription.js.map +1 -1
- package/dist/constructs/alert-channel.d.ts +17 -3
- package/dist/constructs/alert-channel.js +15 -4
- package/dist/constructs/alert-channel.js.map +1 -1
- package/dist/constructs/alert-escalation-policy-codegen.d.ts +4 -0
- package/dist/constructs/alert-escalation-policy-codegen.js +59 -0
- package/dist/constructs/alert-escalation-policy-codegen.js.map +1 -0
- package/dist/constructs/alert-escalation-policy.js +8 -9
- package/dist/constructs/alert-escalation-policy.js.map +1 -1
- package/dist/constructs/api-check-codegen.d.ts +21 -0
- package/dist/constructs/api-check-codegen.js +163 -0
- package/dist/constructs/api-check-codegen.js.map +1 -0
- package/dist/constructs/api-check.js +9 -0
- package/dist/constructs/api-check.js.map +1 -1
- package/dist/constructs/browser-check-codegen.d.ts +14 -0
- package/dist/constructs/browser-check-codegen.js +48 -0
- package/dist/constructs/browser-check-codegen.js.map +1 -0
- package/dist/constructs/browser-check.js +12 -6
- package/dist/constructs/browser-check.js.map +1 -1
- package/dist/constructs/check-codegen.d.ts +42 -0
- package/dist/constructs/check-codegen.js +208 -0
- package/dist/constructs/check-codegen.js.map +1 -0
- package/dist/constructs/check-group-codegen.d.ts +45 -0
- package/dist/constructs/check-group-codegen.js +266 -0
- package/dist/constructs/check-group-codegen.js.map +1 -0
- package/dist/constructs/check-group.d.ts +21 -8
- package/dist/constructs/check-group.js +65 -15
- package/dist/constructs/check-group.js.map +1 -1
- package/dist/constructs/check.d.ts +8 -8
- package/dist/constructs/check.js +31 -14
- package/dist/constructs/check.js.map +1 -1
- package/dist/constructs/construct-codegen.d.ts +39 -0
- package/dist/constructs/construct-codegen.js +100 -0
- package/dist/constructs/construct-codegen.js.map +1 -0
- package/dist/constructs/construct.js +5 -1
- package/dist/constructs/construct.js.map +1 -1
- package/dist/constructs/dashboard-codegen.d.ts +29 -0
- package/dist/constructs/dashboard-codegen.js +108 -0
- package/dist/constructs/dashboard-codegen.js.map +1 -0
- package/dist/constructs/dashboard.js +23 -1
- package/dist/constructs/dashboard.js.map +1 -1
- package/dist/constructs/email-alert-channel-codegen.d.ts +13 -0
- package/dist/constructs/email-alert-channel-codegen.js +38 -0
- package/dist/constructs/email-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/email-alert-channel.js +1 -0
- package/dist/constructs/email-alert-channel.js.map +1 -1
- package/dist/constructs/frequency-codegen.d.ts +4 -0
- package/dist/constructs/frequency-codegen.js +49 -0
- package/dist/constructs/frequency-codegen.js.map +1 -0
- package/dist/constructs/frequency.js +17 -15
- package/dist/constructs/frequency.js.map +1 -1
- package/dist/constructs/heartbeat-check-codegen.d.ts +11 -0
- package/dist/constructs/heartbeat-check-codegen.js +33 -0
- package/dist/constructs/heartbeat-check-codegen.js.map +1 -0
- package/dist/constructs/heartbeat-check.js +1 -0
- package/dist/constructs/heartbeat-check.js.map +1 -1
- package/dist/constructs/incidentio-alert-channel-codegen.d.ts +13 -0
- package/dist/constructs/incidentio-alert-channel-codegen.js +89 -0
- package/dist/constructs/incidentio-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/incidentio-alert-channel.d.ts +6 -0
- package/dist/constructs/incidentio-alert-channel.js +17 -16
- package/dist/constructs/incidentio-alert-channel.js.map +1 -1
- package/dist/constructs/internal/assertion-codegen.d.ts +4 -0
- package/dist/constructs/internal/assertion-codegen.js +141 -0
- package/dist/constructs/internal/assertion-codegen.js.map +1 -0
- package/dist/constructs/internal/assertion.js +7 -4
- package/dist/constructs/internal/assertion.js.map +1 -1
- package/dist/constructs/internal/codegen/codegen.d.ts +9 -0
- package/dist/constructs/internal/codegen/codegen.js +14 -0
- package/dist/constructs/internal/codegen/codegen.js.map +1 -0
- package/dist/constructs/internal/codegen/context.d.ts +62 -0
- package/dist/constructs/internal/codegen/context.js +445 -0
- package/dist/constructs/internal/codegen/context.js.map +1 -0
- package/dist/constructs/internal/codegen/index.d.ts +4 -0
- package/dist/constructs/internal/codegen/index.js +13 -0
- package/dist/constructs/internal/codegen/index.js.map +1 -0
- package/dist/constructs/internal/codegen/safety.d.ts +2 -0
- package/dist/constructs/internal/codegen/safety.js +7 -0
- package/dist/constructs/internal/codegen/safety.js.map +1 -0
- package/dist/constructs/internal/codegen/snippet.d.ts +12 -0
- package/dist/constructs/internal/codegen/snippet.js +48 -0
- package/dist/constructs/internal/codegen/snippet.js.map +1 -0
- package/dist/constructs/key-value-pair-codegen.d.ts +4 -0
- package/dist/constructs/key-value-pair-codegen.js +39 -0
- package/dist/constructs/key-value-pair-codegen.js.map +1 -0
- package/dist/constructs/maintenance-window-codegen.d.ts +14 -0
- package/dist/constructs/maintenance-window-codegen.js +57 -0
- package/dist/constructs/maintenance-window-codegen.js.map +1 -0
- package/dist/constructs/maintenance-window.js +8 -1
- package/dist/constructs/maintenance-window.js.map +1 -1
- package/dist/constructs/msteams-alert-channel-codegen.d.ts +13 -0
- package/dist/constructs/msteams-alert-channel-codegen.js +75 -0
- package/dist/constructs/msteams-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/msteams-alert-channel.d.ts +6 -0
- package/dist/constructs/msteams-alert-channel.js +14 -13
- package/dist/constructs/msteams-alert-channel.js.map +1 -1
- package/dist/constructs/multi-step-check-codegen.d.ts +13 -0
- package/dist/constructs/multi-step-check-codegen.js +39 -0
- package/dist/constructs/multi-step-check-codegen.js.map +1 -0
- package/dist/constructs/multi-step-check.js +8 -8
- package/dist/constructs/multi-step-check.js.map +1 -1
- package/dist/constructs/opsgenie-alert-channel-codegen.d.ts +16 -0
- package/dist/constructs/opsgenie-alert-channel-codegen.js +41 -0
- package/dist/constructs/opsgenie-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/opsgenie-alert-channel.js +4 -0
- package/dist/constructs/opsgenie-alert-channel.js.map +1 -1
- package/dist/constructs/pagerduty-alert-channel-codegen.d.ts +15 -0
- package/dist/constructs/pagerduty-alert-channel-codegen.js +53 -0
- package/dist/constructs/pagerduty-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/pagerduty-alert-channel.js +3 -0
- package/dist/constructs/pagerduty-alert-channel.js.map +1 -1
- package/dist/constructs/phone-call-alert-channel-codegen.d.ts +14 -0
- package/dist/constructs/phone-call-alert-channel-codegen.js +46 -0
- package/dist/constructs/phone-call-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/phone-call-alert-channel.js +2 -0
- package/dist/constructs/phone-call-alert-channel.js.map +1 -1
- package/dist/constructs/playwright-config-codegen.d.ts +4 -0
- package/dist/constructs/playwright-config-codegen.js +9 -0
- package/dist/constructs/playwright-config-codegen.js.map +1 -0
- package/dist/constructs/private-location-check-assignment-codegen.d.ts +10 -0
- package/dist/constructs/private-location-check-assignment-codegen.js +18 -0
- package/dist/constructs/private-location-check-assignment-codegen.js.map +1 -0
- package/dist/constructs/private-location-check-assignment.js +3 -1
- package/dist/constructs/private-location-check-assignment.js.map +1 -1
- package/dist/constructs/private-location-codegen.d.ts +15 -0
- package/dist/constructs/private-location-codegen.js +51 -0
- package/dist/constructs/private-location-codegen.js.map +1 -0
- package/dist/constructs/private-location-group-assignment-codegen.d.ts +10 -0
- package/dist/constructs/private-location-group-assignment-codegen.js +18 -0
- package/dist/constructs/private-location-group-assignment-codegen.js.map +1 -0
- package/dist/constructs/private-location-group-assignment.js +3 -1
- package/dist/constructs/private-location-group-assignment.js.map +1 -1
- package/dist/constructs/private-location.d.ts +8 -4
- package/dist/constructs/private-location.js +14 -4
- package/dist/constructs/private-location.js.map +1 -1
- package/dist/constructs/project.d.ts +10 -0
- package/dist/constructs/project.js +74 -18
- package/dist/constructs/project.js.map +1 -1
- package/dist/constructs/ref-codegen.d.ts +3 -0
- package/dist/constructs/ref-codegen.js +15 -0
- package/dist/constructs/ref-codegen.js.map +1 -0
- package/dist/constructs/ref.js +1 -0
- package/dist/constructs/ref.js.map +1 -1
- package/dist/constructs/retry-strategy-codegen.d.ts +4 -0
- package/dist/constructs/retry-strategy-codegen.js +69 -0
- package/dist/constructs/retry-strategy-codegen.js.map +1 -0
- package/dist/constructs/retry-strategy.js +8 -9
- package/dist/constructs/retry-strategy.js.map +1 -1
- package/dist/constructs/slack-alert-channel-codegen.d.ts +14 -0
- package/dist/constructs/slack-alert-channel-codegen.js +46 -0
- package/dist/constructs/slack-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/slack-alert-channel.js +2 -0
- package/dist/constructs/slack-alert-channel.js.map +1 -1
- package/dist/constructs/sms-alert-channel-codegen.d.ts +14 -0
- package/dist/constructs/sms-alert-channel-codegen.js +46 -0
- package/dist/constructs/sms-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/sms-alert-channel.js +2 -0
- package/dist/constructs/sms-alert-channel.js.map +1 -1
- package/dist/constructs/status-page-codegen.d.ts +23 -0
- package/dist/constructs/status-page-codegen.js +71 -0
- package/dist/constructs/status-page-codegen.js.map +1 -0
- package/dist/constructs/status-page-service-codegen.d.ts +12 -0
- package/dist/constructs/status-page-service-codegen.js +44 -0
- package/dist/constructs/status-page-service-codegen.js.map +1 -0
- package/dist/constructs/status-page-service.d.ts +10 -0
- package/dist/constructs/status-page-service.js +21 -2
- package/dist/constructs/status-page-service.js.map +1 -1
- package/dist/constructs/status-page.js +15 -9
- package/dist/constructs/status-page.js.map +1 -1
- package/dist/constructs/tcp-check-codegen.d.ts +15 -0
- package/dist/constructs/tcp-check-codegen.js +69 -0
- package/dist/constructs/tcp-check-codegen.js.map +1 -0
- package/dist/constructs/tcp-check.js +3 -0
- package/dist/constructs/tcp-check.js.map +1 -1
- package/dist/constructs/telegram-alert-channel-codegen.d.ts +13 -0
- package/dist/constructs/telegram-alert-channel-codegen.js +105 -0
- package/dist/constructs/telegram-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/telegram-alert-channel.d.ts +6 -0
- package/dist/constructs/telegram-alert-channel.js +8 -4
- package/dist/constructs/telegram-alert-channel.js.map +1 -1
- package/dist/constructs/webhook-alert-channel-codegen.d.ts +34 -0
- package/dist/constructs/webhook-alert-channel-codegen.js +152 -0
- package/dist/constructs/webhook-alert-channel-codegen.js.map +1 -0
- package/dist/constructs/webhook-alert-channel.js +8 -0
- package/dist/constructs/webhook-alert-channel.js.map +1 -1
- package/dist/help/help-extension.js +1 -2
- package/dist/help/help-extension.js.map +1 -1
- package/dist/helpers/command-style.d.ts +18 -0
- package/dist/helpers/command-style.js +87 -0
- package/dist/helpers/command-style.js.map +1 -0
- package/dist/helpers/wrap.d.ts +6 -0
- package/dist/helpers/wrap.js +53 -0
- package/dist/helpers/wrap.js.map +1 -0
- package/dist/loader/index.d.ts +6 -0
- package/dist/loader/index.js +21 -0
- package/dist/loader/index.js.map +1 -0
- package/dist/loader/jiti.d.ts +27 -0
- package/dist/loader/jiti.js +63 -0
- package/dist/loader/jiti.js.map +1 -0
- package/dist/loader/loader.d.ts +29 -0
- package/dist/loader/loader.js +32 -0
- package/dist/loader/loader.js.map +1 -0
- package/dist/loader/match.d.ts +15 -0
- package/dist/loader/match.js +47 -0
- package/dist/loader/match.js.map +1 -0
- package/dist/loader/mixed.d.ts +7 -0
- package/dist/loader/mixed.js +39 -0
- package/dist/loader/mixed.js.map +1 -0
- package/dist/loader/native.d.ts +10 -0
- package/dist/loader/native.js +36 -0
- package/dist/loader/native.js.map +1 -0
- package/dist/loader/ts-node.d.ts +25 -0
- package/dist/loader/ts-node.js +85 -0
- package/dist/loader/ts-node.js.map +1 -0
- package/dist/playwright/playwright-config-loader.d.ts +1 -1
- package/dist/playwright/playwright-config-loader.js +7 -4
- package/dist/playwright/playwright-config-loader.js.map +1 -1
- package/dist/playwright/playwright-config-template.js +1 -0
- package/dist/playwright/playwright-config-template.js.map +1 -1
- package/dist/reporters/abstract-list.js +10 -6
- package/dist/reporters/abstract-list.js.map +1 -1
- package/dist/reporters/github.js +13 -6
- package/dist/reporters/github.js.map +1 -1
- package/dist/reporters/json.js +7 -4
- package/dist/reporters/json.js.map +1 -1
- package/dist/reporters/list.js +4 -6
- package/dist/reporters/list.js.map +1 -1
- package/dist/reporters/util.js +15 -20
- package/dist/reporters/util.js.map +1 -1
- package/dist/rest/accounts.js +1 -0
- package/dist/rest/accounts.js.map +1 -1
- package/dist/rest/api.js +3 -5
- package/dist/rest/api.js.map +1 -1
- package/dist/rest/assets.js +1 -0
- package/dist/rest/assets.js.map +1 -1
- package/dist/rest/checkly-storage.js +1 -0
- package/dist/rest/checkly-storage.js.map +1 -1
- package/dist/rest/environment-variables.js +1 -0
- package/dist/rest/environment-variables.js.map +1 -1
- package/dist/rest/heartbeat-checks.js +1 -0
- package/dist/rest/heartbeat-checks.js.map +1 -1
- package/dist/rest/locations.js +1 -0
- package/dist/rest/locations.js.map +1 -1
- package/dist/rest/private-locations.js +1 -0
- package/dist/rest/private-locations.js.map +1 -1
- package/dist/rest/projects.d.ts +69 -1
- package/dist/rest/projects.js +76 -4
- package/dist/rest/projects.js.map +1 -1
- package/dist/rest/runtimes.js +1 -0
- package/dist/rest/runtimes.js.map +1 -1
- package/dist/rest/test-sessions.js +1 -0
- package/dist/rest/test-sessions.js.map +1 -1
- package/dist/rest/users.js +1 -0
- package/dist/rest/users.js.map +1 -1
- package/dist/services/abstract-check-runner.js +10 -0
- package/dist/services/abstract-check-runner.js.map +1 -1
- package/dist/services/check-parser/collector.js +6 -4
- package/dist/services/check-parser/collector.js.map +1 -1
- package/dist/services/check-parser/errors.js +4 -0
- package/dist/services/check-parser/errors.js.map +1 -1
- package/dist/services/check-parser/package-files/extension.js +2 -0
- package/dist/services/check-parser/package-files/extension.js.map +1 -1
- package/dist/services/check-parser/package-files/jsconfig-json-file.js +5 -22
- package/dist/services/check-parser/package-files/jsconfig-json-file.js.map +1 -1
- package/dist/services/check-parser/package-files/json-source-file.d.ts +1 -1
- package/dist/services/check-parser/package-files/json-source-file.js +5 -17
- package/dist/services/check-parser/package-files/json-source-file.js.map +1 -1
- package/dist/services/check-parser/package-files/loader.js +2 -1
- package/dist/services/check-parser/package-files/loader.js.map +1 -1
- package/dist/services/check-parser/package-files/lookup.js +3 -17
- package/dist/services/check-parser/package-files/lookup.js.map +1 -1
- package/dist/services/check-parser/package-files/package-json-file.d.ts +14 -1
- package/dist/services/check-parser/package-files/package-json-file.js +87 -19
- package/dist/services/check-parser/package-files/package-json-file.js.map +1 -1
- package/dist/services/check-parser/package-files/package-manager.d.ts +91 -0
- package/dist/services/check-parser/package-files/package-manager.js +321 -0
- package/dist/services/check-parser/package-files/package-manager.js.map +1 -0
- package/dist/services/check-parser/package-files/paths.js +39 -0
- package/dist/services/check-parser/package-files/paths.js.map +1 -1
- package/dist/services/check-parser/package-files/resolver.d.ts +6 -3
- package/dist/services/check-parser/package-files/resolver.js +58 -50
- package/dist/services/check-parser/package-files/resolver.js.map +1 -1
- package/dist/services/check-parser/package-files/source-file.d.ts +1 -1
- package/dist/services/check-parser/package-files/source-file.js +8 -17
- package/dist/services/check-parser/package-files/source-file.js.map +1 -1
- package/dist/services/check-parser/package-files/tsconfig-json-file.js +16 -27
- package/dist/services/check-parser/package-files/tsconfig-json-file.js.map +1 -1
- package/dist/services/check-parser/parser.js +18 -11
- package/dist/services/check-parser/parser.js.map +1 -1
- package/dist/services/checkly-config-codegen.d.ts +4 -0
- package/dist/services/checkly-config-codegen.js +196 -0
- package/dist/services/checkly-config-codegen.js.map +1 -0
- package/dist/services/checkly-config-loader.d.ts +6 -2
- package/dist/services/checkly-config-loader.js +27 -12
- package/dist/services/checkly-config-loader.js.map +1 -1
- package/dist/services/config.js +5 -6
- package/dist/services/config.js.map +1 -1
- package/dist/services/project-parser.js +5 -12
- package/dist/services/project-parser.js.map +1 -1
- package/dist/services/snapshot-service.js +2 -2
- package/dist/services/snapshot-service.js.map +1 -1
- package/dist/services/test-filters.js +1 -1
- package/dist/services/test-filters.js.map +1 -1
- package/dist/services/test-runner.js +12 -5
- package/dist/services/test-runner.js.map +1 -1
- package/dist/services/trigger-runner.js +12 -5
- package/dist/services/trigger-runner.js.map +1 -1
- package/dist/services/util.d.ts +0 -1
- package/dist/services/util.js +12 -107
- package/dist/services/util.js.map +1 -1
- package/dist/sourcegen/args.d.ts +7 -0
- package/dist/sourcegen/args.js +26 -0
- package/dist/sourcegen/args.js.map +1 -0
- package/dist/sourcegen/argsbuilder.d.ts +22 -0
- package/dist/sourcegen/argsbuilder.js +111 -0
- package/dist/sourcegen/argsbuilder.js.map +1 -0
- package/dist/sourcegen/array.d.ts +8 -0
- package/dist/sourcegen/array.js +32 -0
- package/dist/sourcegen/array.js.map +1 -0
- package/dist/sourcegen/arraybuilder.d.ts +21 -0
- package/dist/sourcegen/arraybuilder.js +109 -0
- package/dist/sourcegen/arraybuilder.js.map +1 -0
- package/dist/sourcegen/boolean.d.ts +7 -0
- package/dist/sourcegen/boolean.js +22 -0
- package/dist/sourcegen/boolean.js.map +1 -0
- package/dist/sourcegen/case.d.ts +9 -0
- package/dist/sourcegen/case.js +107 -0
- package/dist/sourcegen/case.js.map +1 -0
- package/dist/sourcegen/comment.d.ts +32 -0
- package/dist/sourcegen/comment.js +124 -0
- package/dist/sourcegen/comment.js.map +1 -0
- package/dist/sourcegen/decl.d.ts +43 -0
- package/dist/sourcegen/decl.js +95 -0
- package/dist/sourcegen/decl.js.map +1 -0
- package/dist/sourcegen/declbuilder.d.ts +14 -0
- package/dist/sourcegen/declbuilder.js +39 -0
- package/dist/sourcegen/declbuilder.js.map +1 -0
- package/dist/sourcegen/expr.d.ts +39 -0
- package/dist/sourcegen/expr.js +86 -0
- package/dist/sourcegen/expr.js.map +1 -0
- package/dist/sourcegen/exprbuilder.d.ts +13 -0
- package/dist/sourcegen/exprbuilder.js +54 -0
- package/dist/sourcegen/exprbuilder.js.map +1 -0
- package/dist/sourcegen/identifier.d.ts +12 -0
- package/dist/sourcegen/identifier.js +27 -0
- package/dist/sourcegen/identifier.js.map +1 -0
- package/dist/sourcegen/index.d.ts +22 -0
- package/dist/sourcegen/index.js +76 -0
- package/dist/sourcegen/index.js.map +1 -0
- package/dist/sourcegen/null.d.ts +5 -0
- package/dist/sourcegen/null.js +11 -0
- package/dist/sourcegen/null.js.map +1 -0
- package/dist/sourcegen/number.d.ts +7 -0
- package/dist/sourcegen/number.js +22 -0
- package/dist/sourcegen/number.js.map +1 -0
- package/dist/sourcegen/object.d.ts +28 -0
- package/dist/sourcegen/object.js +88 -0
- package/dist/sourcegen/object.js.map +1 -0
- package/dist/sourcegen/objectbuilder.d.ts +25 -0
- package/dist/sourcegen/objectbuilder.js +127 -0
- package/dist/sourcegen/objectbuilder.js.map +1 -0
- package/dist/sourcegen/output.d.ts +14 -0
- package/dist/sourcegen/output.js +85 -0
- package/dist/sourcegen/output.js.map +1 -0
- package/dist/sourcegen/program.d.ts +55 -0
- package/dist/sourcegen/program.js +284 -0
- package/dist/sourcegen/program.js.map +1 -0
- package/dist/sourcegen/string.d.ts +8 -0
- package/dist/sourcegen/string.js +28 -0
- package/dist/sourcegen/string.js.map +1 -0
- package/dist/sourcegen/undefined.d.ts +5 -0
- package/dist/sourcegen/undefined.js +11 -0
- package/dist/sourcegen/undefined.js.map +1 -0
- package/dist/sourcegen/unknown.d.ts +2 -0
- package/dist/sourcegen/unknown.js +40 -0
- package/dist/sourcegen/unknown.js.map +1 -0
- package/dist/sourcegen/value.d.ts +4 -0
- package/dist/sourcegen/value.js +7 -0
- package/dist/sourcegen/value.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/util/index.d.ts +9 -0
- package/dist/util/index.js +27 -0
- package/dist/util/index.js.map +1 -0
- package/oclif.manifest.json +173 -1
- package/package.json +14 -37
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Context = exports.FilePath = exports.FriendVariableLocator = exports.GeneratedVariableLocator = exports.VariableLocator = exports.MissingContextVariableMappingError = void 0;
|
|
27
|
+
const node_path_1 = __importStar(require("node:path"));
|
|
28
|
+
const sourcegen_1 = require("../../../sourcegen");
|
|
29
|
+
const snippet_1 = require("./snippet");
|
|
30
|
+
class MissingContextVariableMappingError extends Error {
|
|
31
|
+
}
|
|
32
|
+
exports.MissingContextVariableMappingError = MissingContextVariableMappingError;
|
|
33
|
+
class VariableLocator {
|
|
34
|
+
id;
|
|
35
|
+
filePath;
|
|
36
|
+
constructor(id, filePath) {
|
|
37
|
+
this.id = id;
|
|
38
|
+
this.filePath = filePath;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.VariableLocator = VariableLocator;
|
|
42
|
+
class GeneratedVariableLocator extends VariableLocator {
|
|
43
|
+
file;
|
|
44
|
+
constructor(id, file) {
|
|
45
|
+
super(id, file.path);
|
|
46
|
+
this.file = file;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.GeneratedVariableLocator = GeneratedVariableLocator;
|
|
50
|
+
class FriendVariableLocator extends VariableLocator {
|
|
51
|
+
}
|
|
52
|
+
exports.FriendVariableLocator = FriendVariableLocator;
|
|
53
|
+
const CHECKLY_IMPORT_FILENAME_TAG_PREFIX = 'checkly-import-filename:';
|
|
54
|
+
const splitExt = (filePath) => {
|
|
55
|
+
const { dir, base } = node_path_1.default.parse(filePath);
|
|
56
|
+
// Remove all extensions even if there are multiple.
|
|
57
|
+
const index = base.indexOf('.');
|
|
58
|
+
return index !== -1
|
|
59
|
+
? [node_path_1.default.join(dir, base.slice(0, index)), base.slice(index)]
|
|
60
|
+
: [filePath, ''];
|
|
61
|
+
};
|
|
62
|
+
class FilePath {
|
|
63
|
+
fullPath;
|
|
64
|
+
constructor(fullPath) {
|
|
65
|
+
this.fullPath = fullPath;
|
|
66
|
+
}
|
|
67
|
+
get extless() {
|
|
68
|
+
const [value] = splitExt(this.fullPath);
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
exports.FilePath = FilePath;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a usable variable name from a fixed base component and a variable
|
|
75
|
+
* name component.
|
|
76
|
+
*
|
|
77
|
+
* In order to keep variable names short and sensible, the base component
|
|
78
|
+
* may or may not be included in the final result if its value is deemed
|
|
79
|
+
* redundant.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* formatVariable('group', 'Website Group') === 'websiteGroup'
|
|
83
|
+
* formatVariable('group', 'Production') === 'productionGroup'
|
|
84
|
+
* formatVariable('alert', 'ops email') === 'opsEmailAlert'
|
|
85
|
+
* formatVariable('location', 'Office Rack #12') === 'officeRack12Location'
|
|
86
|
+
* @param base Fixed base component
|
|
87
|
+
* @param name Variable component
|
|
88
|
+
* @returns Formatted variable name
|
|
89
|
+
*/
|
|
90
|
+
function formatVariable(base, name) {
|
|
91
|
+
let prefix = (0, sourcegen_1.cased)(name, 'camelCase');
|
|
92
|
+
// Even camelcased, the prefix may start with a number. Get rid of it.
|
|
93
|
+
if (/^[0-9]+/.test(prefix)) {
|
|
94
|
+
prefix = prefix.replace(/^[0-9]+/, '');
|
|
95
|
+
prefix = (0, sourcegen_1.cased)(prefix, 'camelCase');
|
|
96
|
+
}
|
|
97
|
+
// Allow pretty long variables but set a hard limit. Limit does not include
|
|
98
|
+
// the suffix.
|
|
99
|
+
if (prefix.length > 64) {
|
|
100
|
+
prefix = prefix.slice(0, 64);
|
|
101
|
+
}
|
|
102
|
+
// The name might consist of characters that all get stripped out. If so,
|
|
103
|
+
// just use the base.
|
|
104
|
+
if (prefix === '') {
|
|
105
|
+
return (0, sourcegen_1.cased)(base, 'camelCase');
|
|
106
|
+
}
|
|
107
|
+
// Maybe the resource name already starts with the base. Can happen if the
|
|
108
|
+
// resource name is "Group #123" and base is "group", which would result in
|
|
109
|
+
// "group123Group" if the normal suffix was added. Instead, don't add the
|
|
110
|
+
// suffix.
|
|
111
|
+
if (prefix.startsWith(base)) {
|
|
112
|
+
return prefix;
|
|
113
|
+
}
|
|
114
|
+
const suffix = (0, sourcegen_1.cased)(base, 'PascalCase');
|
|
115
|
+
// Maybe the resource name already includes the base. For example,
|
|
116
|
+
// if the resource name is "My Group" and the base "group", that would
|
|
117
|
+
// then result in "myGroupGroup" which is weird. If so skip the suffix.
|
|
118
|
+
if (prefix.endsWith(suffix)) {
|
|
119
|
+
return prefix;
|
|
120
|
+
}
|
|
121
|
+
return prefix + suffix;
|
|
122
|
+
}
|
|
123
|
+
class Context {
|
|
124
|
+
#alertChannelVariablesByPhysicalId = new Map();
|
|
125
|
+
#alertChannelFriendVariablesByPhysicalId = new Map();
|
|
126
|
+
#checkAlertChannelPhysicalIdsByPhysicalId = new Map();
|
|
127
|
+
#checkPrivateLocationPhysicalIdsByPhysicalId = new Map();
|
|
128
|
+
#checkGroupAlertChannelPhysicalIdsByPhysicalId = new Map();
|
|
129
|
+
#checkGroupPrivateLocationPhysicalIdsByPhysicalId = new Map();
|
|
130
|
+
#checkGroupVariablesByPhysicalId = new Map();
|
|
131
|
+
#checkGroupFriendVariablesByPhysicalId = new Map();
|
|
132
|
+
#privateLocationVariablesByPhysicalId = new Map();
|
|
133
|
+
#privateLocationFriendVariablesByPhysicalId = new Map();
|
|
134
|
+
#statusPageServiceVariablesByPhysicalId = new Map();
|
|
135
|
+
#statusPageServiceFriendVariablesByPhysicalId = new Map();
|
|
136
|
+
#knownSecrets = new Set();
|
|
137
|
+
#knownFilePaths = new Map();
|
|
138
|
+
#filePathContentKeys = new Map();
|
|
139
|
+
#auxiliarySnippetFilesByPhysicalId = new Map();
|
|
140
|
+
#auxiliarySnippetFilesByFilename = new Map();
|
|
141
|
+
#reservedIdentifiersByFilePath = new Map();
|
|
142
|
+
#reserveIdentifierForLocator(filePath, locator) {
|
|
143
|
+
const fileVariables = this.#reservedIdentifiersByFilePath.get(filePath)
|
|
144
|
+
?? new Map();
|
|
145
|
+
this.#reservedIdentifiersByFilePath.set(filePath, fileVariables);
|
|
146
|
+
const name = locator.id.value;
|
|
147
|
+
// First use? Let it through.
|
|
148
|
+
const existingLocator = fileVariables.get(name);
|
|
149
|
+
if (existingLocator === undefined) {
|
|
150
|
+
fileVariables.set(name, locator);
|
|
151
|
+
return locator.id;
|
|
152
|
+
}
|
|
153
|
+
// If we're reserving an identifier for the same locator as earlier, let
|
|
154
|
+
// it through. The same identifier will work for our purposes.
|
|
155
|
+
if (existingLocator === locator) {
|
|
156
|
+
return locator.id;
|
|
157
|
+
}
|
|
158
|
+
// Nth use? Try to find the next available number, keeping in mind the
|
|
159
|
+
// possibility that someone may have separately reserved a variable with
|
|
160
|
+
// the same counter value at the end, which can happen if the base
|
|
161
|
+
// variable name includes a number.
|
|
162
|
+
//
|
|
163
|
+
// Starts counting from 2 (first use has no counter appended).
|
|
164
|
+
for (let nth = 2;; nth += 1) {
|
|
165
|
+
const newName = `${name}${nth}`;
|
|
166
|
+
const existingLocator = fileVariables.get(newName);
|
|
167
|
+
if (existingLocator === undefined) {
|
|
168
|
+
fileVariables.set(newName, locator);
|
|
169
|
+
return new sourcegen_1.IdentifierValue(newName);
|
|
170
|
+
}
|
|
171
|
+
if (existingLocator === locator) {
|
|
172
|
+
return new sourcegen_1.IdentifierValue(newName);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
filePath(parent, hint, options) {
|
|
177
|
+
let filename = (0, sourcegen_1.cased)(hint, options?.case ?? 'kebab-case');
|
|
178
|
+
if (options?.tags !== undefined) {
|
|
179
|
+
for (const tag of options.tags) {
|
|
180
|
+
if (tag.startsWith(CHECKLY_IMPORT_FILENAME_TAG_PREFIX)) {
|
|
181
|
+
filename = tag.slice(CHECKLY_IMPORT_FILENAME_TAG_PREFIX.length);
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const [base, ext] = splitExt(filename);
|
|
187
|
+
const parts = [parent];
|
|
188
|
+
if (options?.isolate) {
|
|
189
|
+
parts.push(base);
|
|
190
|
+
}
|
|
191
|
+
parts.push(filename);
|
|
192
|
+
let candidate = node_path_1.default.join(...parts);
|
|
193
|
+
do {
|
|
194
|
+
let counter = this.#knownFilePaths.get(candidate) ?? 0;
|
|
195
|
+
let satisfied = true;
|
|
196
|
+
// If we wanted a unique match and this isn't the first time we've seen
|
|
197
|
+
// the candidate, we're not satisfied.
|
|
198
|
+
if (counter !== 0 && options?.unique) {
|
|
199
|
+
satisfied = false;
|
|
200
|
+
}
|
|
201
|
+
// A content key attempts to differentiate between files based on a
|
|
202
|
+
// representative value of their contents. If we've previously found
|
|
203
|
+
// the candidate path but it had a different content key, we're
|
|
204
|
+
// not satisfied, even if a unique match was not requested.
|
|
205
|
+
if (options?.contentKey !== undefined) {
|
|
206
|
+
const currentKey = this.#filePathContentKeys.get(candidate);
|
|
207
|
+
if (currentKey !== undefined) {
|
|
208
|
+
if (currentKey !== options.contentKey) {
|
|
209
|
+
satisfied = false;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
this.#filePathContentKeys.set(candidate, options.contentKey);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (!satisfied || counter === 0) {
|
|
217
|
+
counter += 1;
|
|
218
|
+
}
|
|
219
|
+
this.#knownFilePaths.set(candidate, counter);
|
|
220
|
+
if (satisfied) {
|
|
221
|
+
return new FilePath(candidate);
|
|
222
|
+
}
|
|
223
|
+
parts.pop();
|
|
224
|
+
const nthBase = base + '-' + counter;
|
|
225
|
+
if (options?.isolate) {
|
|
226
|
+
parts.pop();
|
|
227
|
+
parts.push(nthBase);
|
|
228
|
+
}
|
|
229
|
+
parts.push(nthBase + ext);
|
|
230
|
+
candidate = node_path_1.default.join(...parts);
|
|
231
|
+
// eslint-disable-next-line no-constant-condition
|
|
232
|
+
} while (true);
|
|
233
|
+
}
|
|
234
|
+
importVariable(locator, file) {
|
|
235
|
+
const reservedVariable = this.#reserveIdentifierForLocator(file.path, locator);
|
|
236
|
+
file.namedImport(locator.id.value, locator.file.path, {
|
|
237
|
+
relativeTo: (0, node_path_1.dirname)(file.path),
|
|
238
|
+
alias: reservedVariable === locator.id ? undefined : reservedVariable.value,
|
|
239
|
+
});
|
|
240
|
+
return reservedVariable;
|
|
241
|
+
}
|
|
242
|
+
importFriendVariable(locator, file) {
|
|
243
|
+
const reservedVariable = this.#reserveIdentifierForLocator(file.path, locator);
|
|
244
|
+
file.namedImport(locator.id.value, locator.filePath, {
|
|
245
|
+
relativeTo: (0, node_path_1.dirname)(file.path),
|
|
246
|
+
alias: reservedVariable === locator.id ? undefined : reservedVariable.value,
|
|
247
|
+
});
|
|
248
|
+
return reservedVariable;
|
|
249
|
+
}
|
|
250
|
+
registerCheckGroup(physicalId, name, file) {
|
|
251
|
+
const preferredId = new sourcegen_1.IdentifierValue(formatVariable('group', name));
|
|
252
|
+
const locator = new GeneratedVariableLocator(preferredId, file);
|
|
253
|
+
locator.id = this.#reserveIdentifierForLocator(file.path, locator);
|
|
254
|
+
this.#checkGroupVariablesByPhysicalId.set(physicalId, locator);
|
|
255
|
+
return locator;
|
|
256
|
+
}
|
|
257
|
+
lookupCheckGroup(physicalId) {
|
|
258
|
+
const locator = this.#checkGroupVariablesByPhysicalId.get(physicalId);
|
|
259
|
+
if (locator === undefined) {
|
|
260
|
+
throw new MissingContextVariableMappingError();
|
|
261
|
+
}
|
|
262
|
+
return locator;
|
|
263
|
+
}
|
|
264
|
+
registerFriendCheckGroup(physicalId, friend) {
|
|
265
|
+
const id = new sourcegen_1.IdentifierValue(friend.exportName);
|
|
266
|
+
const locator = new FriendVariableLocator(id, friend.filePath);
|
|
267
|
+
this.#checkGroupFriendVariablesByPhysicalId.set(physicalId, locator);
|
|
268
|
+
return locator;
|
|
269
|
+
}
|
|
270
|
+
lookupFriendCheckGroup(physicalId) {
|
|
271
|
+
const locator = this.#checkGroupFriendVariablesByPhysicalId.get(physicalId);
|
|
272
|
+
if (locator === undefined) {
|
|
273
|
+
throw new MissingContextVariableMappingError();
|
|
274
|
+
}
|
|
275
|
+
return locator;
|
|
276
|
+
}
|
|
277
|
+
registerAlertChannel(physicalId, name, file) {
|
|
278
|
+
const preferredId = new sourcegen_1.IdentifierValue(formatVariable('alert', name));
|
|
279
|
+
const locator = new GeneratedVariableLocator(preferredId, file);
|
|
280
|
+
locator.id = this.#reserveIdentifierForLocator(file.path, locator);
|
|
281
|
+
this.#alertChannelVariablesByPhysicalId.set(physicalId, locator);
|
|
282
|
+
return locator;
|
|
283
|
+
}
|
|
284
|
+
lookupAlertChannel(physicalId) {
|
|
285
|
+
const locator = this.#alertChannelVariablesByPhysicalId.get(physicalId);
|
|
286
|
+
if (locator === undefined) {
|
|
287
|
+
throw new MissingContextVariableMappingError();
|
|
288
|
+
}
|
|
289
|
+
return locator;
|
|
290
|
+
}
|
|
291
|
+
registerFriendAlertChannel(physicalId, friend) {
|
|
292
|
+
const id = new sourcegen_1.IdentifierValue(friend.exportName);
|
|
293
|
+
const locator = new FriendVariableLocator(id, friend.filePath);
|
|
294
|
+
this.#alertChannelFriendVariablesByPhysicalId.set(physicalId, locator);
|
|
295
|
+
return locator;
|
|
296
|
+
}
|
|
297
|
+
lookupFriendAlertChannel(physicalId) {
|
|
298
|
+
const locator = this.#alertChannelFriendVariablesByPhysicalId.get(physicalId);
|
|
299
|
+
if (locator === undefined) {
|
|
300
|
+
throw new MissingContextVariableMappingError();
|
|
301
|
+
}
|
|
302
|
+
return locator;
|
|
303
|
+
}
|
|
304
|
+
registerPrivateLocation(physicalId, name, file) {
|
|
305
|
+
const preferredId = new sourcegen_1.IdentifierValue(formatVariable('location', name));
|
|
306
|
+
const locator = new GeneratedVariableLocator(preferredId, file);
|
|
307
|
+
locator.id = this.#reserveIdentifierForLocator(file.path, locator);
|
|
308
|
+
this.#privateLocationVariablesByPhysicalId.set(physicalId, locator);
|
|
309
|
+
return locator;
|
|
310
|
+
}
|
|
311
|
+
lookupPrivateLocation(physicalId) {
|
|
312
|
+
const locator = this.#privateLocationVariablesByPhysicalId.get(physicalId);
|
|
313
|
+
if (locator === undefined) {
|
|
314
|
+
throw new MissingContextVariableMappingError();
|
|
315
|
+
}
|
|
316
|
+
return locator;
|
|
317
|
+
}
|
|
318
|
+
registerFriendPrivateLocation(physicalId, friend) {
|
|
319
|
+
const id = new sourcegen_1.IdentifierValue(friend.exportName);
|
|
320
|
+
const locator = new FriendVariableLocator(id, friend.filePath);
|
|
321
|
+
this.#privateLocationFriendVariablesByPhysicalId.set(physicalId, locator);
|
|
322
|
+
return locator;
|
|
323
|
+
}
|
|
324
|
+
lookupFriendPrivateLocation(physicalId) {
|
|
325
|
+
const locator = this.#privateLocationFriendVariablesByPhysicalId.get(physicalId);
|
|
326
|
+
if (locator === undefined) {
|
|
327
|
+
throw new MissingContextVariableMappingError();
|
|
328
|
+
}
|
|
329
|
+
return locator;
|
|
330
|
+
}
|
|
331
|
+
registerPrivateLocationGroupAssignment(privateLocationPhysicalId, groupPhysicalId) {
|
|
332
|
+
const all = this.#checkGroupPrivateLocationPhysicalIdsByPhysicalId.get(groupPhysicalId) ?? [];
|
|
333
|
+
all.push(privateLocationPhysicalId);
|
|
334
|
+
this.#checkGroupPrivateLocationPhysicalIdsByPhysicalId.set(groupPhysicalId, all);
|
|
335
|
+
}
|
|
336
|
+
lookupCheckGroupPrivateLocations(groupPhysicalId) {
|
|
337
|
+
const ids = this.#checkGroupPrivateLocationPhysicalIdsByPhysicalId.get(groupPhysicalId);
|
|
338
|
+
if (ids === undefined) {
|
|
339
|
+
throw new MissingContextVariableMappingError();
|
|
340
|
+
}
|
|
341
|
+
return ids;
|
|
342
|
+
}
|
|
343
|
+
registerPrivateLocationCheckAssignment(privateLocationPhysicalId, checkPhysicalId) {
|
|
344
|
+
const all = this.#checkPrivateLocationPhysicalIdsByPhysicalId.get(checkPhysicalId) ?? [];
|
|
345
|
+
all.push(privateLocationPhysicalId);
|
|
346
|
+
this.#checkPrivateLocationPhysicalIdsByPhysicalId.set(checkPhysicalId, all);
|
|
347
|
+
}
|
|
348
|
+
lookupCheckPrivateLocations(checkPhysicalId) {
|
|
349
|
+
const ids = this.#checkPrivateLocationPhysicalIdsByPhysicalId.get(checkPhysicalId);
|
|
350
|
+
if (ids === undefined) {
|
|
351
|
+
throw new MissingContextVariableMappingError();
|
|
352
|
+
}
|
|
353
|
+
return ids;
|
|
354
|
+
}
|
|
355
|
+
registerAlertChannelCheckSubscription(alertChannelPhysicalId, checkPhysicalId) {
|
|
356
|
+
const all = this.#checkAlertChannelPhysicalIdsByPhysicalId.get(checkPhysicalId) ?? [];
|
|
357
|
+
all.push(alertChannelPhysicalId);
|
|
358
|
+
this.#checkAlertChannelPhysicalIdsByPhysicalId.set(checkPhysicalId, all);
|
|
359
|
+
}
|
|
360
|
+
lookupCheckAlertChannels(checkPhysicalId) {
|
|
361
|
+
const ids = this.#checkAlertChannelPhysicalIdsByPhysicalId.get(checkPhysicalId);
|
|
362
|
+
if (ids === undefined) {
|
|
363
|
+
throw new MissingContextVariableMappingError();
|
|
364
|
+
}
|
|
365
|
+
return ids;
|
|
366
|
+
}
|
|
367
|
+
registerAlertChannelGroupSubscription(alertChannelPhysicalId, groupPhysicalId) {
|
|
368
|
+
const all = this.#checkGroupAlertChannelPhysicalIdsByPhysicalId.get(groupPhysicalId) ?? [];
|
|
369
|
+
all.push(alertChannelPhysicalId);
|
|
370
|
+
this.#checkGroupAlertChannelPhysicalIdsByPhysicalId.set(groupPhysicalId, all);
|
|
371
|
+
}
|
|
372
|
+
lookupCheckGroupAlertChannels(groupPhysicalId) {
|
|
373
|
+
const ids = this.#checkGroupAlertChannelPhysicalIdsByPhysicalId.get(groupPhysicalId);
|
|
374
|
+
if (ids === undefined) {
|
|
375
|
+
throw new MissingContextVariableMappingError();
|
|
376
|
+
}
|
|
377
|
+
return ids;
|
|
378
|
+
}
|
|
379
|
+
registerStatusPageService(physicalId, name, file) {
|
|
380
|
+
const preferredId = new sourcegen_1.IdentifierValue(formatVariable('service', name));
|
|
381
|
+
const locator = new GeneratedVariableLocator(preferredId, file);
|
|
382
|
+
locator.id = this.#reserveIdentifierForLocator(file.path, locator);
|
|
383
|
+
this.#statusPageServiceVariablesByPhysicalId.set(physicalId, locator);
|
|
384
|
+
return locator;
|
|
385
|
+
}
|
|
386
|
+
lookupStatusPageService(physicalId) {
|
|
387
|
+
const locator = this.#statusPageServiceVariablesByPhysicalId.get(physicalId);
|
|
388
|
+
if (locator === undefined) {
|
|
389
|
+
throw new MissingContextVariableMappingError();
|
|
390
|
+
}
|
|
391
|
+
return locator;
|
|
392
|
+
}
|
|
393
|
+
registerFriendStatusPageService(physicalId, friend) {
|
|
394
|
+
const id = new sourcegen_1.IdentifierValue(friend.exportName);
|
|
395
|
+
const locator = new FriendVariableLocator(id, friend.filePath);
|
|
396
|
+
this.#statusPageServiceFriendVariablesByPhysicalId.set(physicalId, locator);
|
|
397
|
+
return locator;
|
|
398
|
+
}
|
|
399
|
+
lookupFriendStatusPageService(physicalId) {
|
|
400
|
+
const locator = this.#statusPageServiceFriendVariablesByPhysicalId.get(physicalId);
|
|
401
|
+
if (locator === undefined) {
|
|
402
|
+
throw new MissingContextVariableMappingError();
|
|
403
|
+
}
|
|
404
|
+
return locator;
|
|
405
|
+
}
|
|
406
|
+
registerKnownSecret(name) {
|
|
407
|
+
if (this.#knownSecrets.has(name)) {
|
|
408
|
+
return false;
|
|
409
|
+
}
|
|
410
|
+
this.#knownSecrets.add(name);
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
registerAuxiliarySnippetFile(physicalId, snippetFile) {
|
|
414
|
+
this.#auxiliarySnippetFilesByPhysicalId.set(physicalId, snippetFile);
|
|
415
|
+
this.#auxiliarySnippetFilesByFilename.set(snippetFile.basename, snippetFile);
|
|
416
|
+
}
|
|
417
|
+
lookupAuxiliarySnippetFile(physicalId) {
|
|
418
|
+
return this.#auxiliarySnippetFilesByPhysicalId.get(physicalId);
|
|
419
|
+
}
|
|
420
|
+
findScriptSnippetFiles(content) {
|
|
421
|
+
const files = new Set();
|
|
422
|
+
const filenames = (0, snippet_1.parseSnippetDependencies)(content);
|
|
423
|
+
for (const filename of filenames) {
|
|
424
|
+
const { name } = node_path_1.default.parse(filename);
|
|
425
|
+
const candidates = [
|
|
426
|
+
name,
|
|
427
|
+
filename,
|
|
428
|
+
`${name}.ts`,
|
|
429
|
+
`${name}.js`,
|
|
430
|
+
`${filename}.ts`,
|
|
431
|
+
`${filename}.js`,
|
|
432
|
+
];
|
|
433
|
+
for (const candidate of candidates) {
|
|
434
|
+
const match = this.#auxiliarySnippetFilesByFilename.get(candidate);
|
|
435
|
+
if (match !== undefined) {
|
|
436
|
+
files.add(match);
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
return [...files];
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
exports.Context = Context;
|
|
445
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/constructs/internal/codegen/context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAyC;AAEzC,kDAAsF;AAEtF,uCAAoD;AAGpD,MAAa,kCAAmC,SAAQ,KAAK;CAAG;AAAhE,gFAAgE;AAEhE,MAAsB,eAAe;IACnC,EAAE,CAAiB;IACnB,QAAQ,CAAQ;IAEhB,YAAa,EAAmB,EAAE,QAAgB;QAChD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;QACZ,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;CACF;AARD,0CAQC;AAED,MAAa,wBAAyB,SAAQ,eAAe;IAC3D,IAAI,CAAe;IAEnB,YAAa,EAAmB,EAAE,IAAmB;QACnD,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF;AAPD,4DAOC;AAED,MAAa,qBAAsB,SAAQ,eAAe;CACzD;AADD,sDACC;AAED,MAAM,kCAAkC,GAAG,0BAA0B,CAAA;AAUrE,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAAoB,EAAE;IACtD,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GA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AAQ;gBACR,GAAG,IAAI,KAAK;gBACZ,GAAG,IAAI,KAAK;gBACZ,GAAG,QAAQ,KAAK;gBAChB,GAAG,QAAQ,KAAK;aACjB,CAAA;YAED,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;gBACnC,MAAM,KAAK,GAAG,IAAI,CAAC,gCAAgC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;gBAClE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;oBACxB,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;oBAChB,MAAK;gBACP,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,KAAK,CAAC,CAAA;IACnB,CAAC;CACF;AAhZD,0BAgZC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateScript = exports.ImportSafetyViolation = exports.MissingContextVariableMappingError = exports.Context = exports.Codegen = void 0;
|
|
4
|
+
var codegen_1 = require("./codegen");
|
|
5
|
+
Object.defineProperty(exports, "Codegen", { enumerable: true, get: function () { return codegen_1.Codegen; } });
|
|
6
|
+
var context_1 = require("./context");
|
|
7
|
+
Object.defineProperty(exports, "Context", { enumerable: true, get: function () { return context_1.Context; } });
|
|
8
|
+
Object.defineProperty(exports, "MissingContextVariableMappingError", { enumerable: true, get: function () { return context_1.MissingContextVariableMappingError; } });
|
|
9
|
+
var safety_1 = require("./safety");
|
|
10
|
+
Object.defineProperty(exports, "ImportSafetyViolation", { enumerable: true, get: function () { return safety_1.ImportSafetyViolation; } });
|
|
11
|
+
var snippet_1 = require("./snippet");
|
|
12
|
+
Object.defineProperty(exports, "validateScript", { enumerable: true, get: function () { return snippet_1.validateScript; } });
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/constructs/internal/codegen/index.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,qCAAuE;AAA9D,kGAAA,OAAO,OAAA;AAAE,6HAAA,kCAAkC,OAAA;AACpD,mCAAgD;AAAvC,+GAAA,qBAAqB,OAAA;AAC9B,qCAA0C;AAAjC,yGAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safety.js","sourceRoot":"","sources":["../../../../src/constructs/internal/codegen/safety.ts"],"names":[],"mappings":";;;AAAA,MAAa,qBAAsB,SAAQ,KAAK;CAAG;AAAnD,sDAAmD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class UnsupportedScriptError extends Error {
|
|
2
|
+
}
|
|
3
|
+
export interface Snippet {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
script: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function isSafeSnippetFilename(name: string): boolean;
|
|
9
|
+
export declare function isSnippet(resource: any): resource is Snippet;
|
|
10
|
+
export declare function snippetUsesHandlebarsSyntax(script: string): boolean;
|
|
11
|
+
export declare function validateScript(content: string): void;
|
|
12
|
+
export declare function parseSnippetDependencies(content: string): string[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseSnippetDependencies = exports.validateScript = exports.snippetUsesHandlebarsSyntax = exports.isSnippet = exports.isSafeSnippetFilename = exports.UnsupportedScriptError = void 0;
|
|
4
|
+
const parser_1 = require("../../../services/check-parser/parser");
|
|
5
|
+
class UnsupportedScriptError extends Error {
|
|
6
|
+
}
|
|
7
|
+
exports.UnsupportedScriptError = UnsupportedScriptError;
|
|
8
|
+
function isSafeSnippetFilename(name) {
|
|
9
|
+
// These are the characters the backend supports.
|
|
10
|
+
return /^[\w-]+$/.test(name);
|
|
11
|
+
}
|
|
12
|
+
exports.isSafeSnippetFilename = isSafeSnippetFilename;
|
|
13
|
+
function isSnippet(resource) {
|
|
14
|
+
if (typeof resource.id !== 'number') {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
if (typeof resource.name !== 'string') {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
if (typeof resource.script !== 'string') {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
validateScript(resource.script);
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
exports.isSnippet = isSnippet;
|
|
27
|
+
function snippetUsesHandlebarsSyntax(script) {
|
|
28
|
+
return script.includes('{{>') || script.includes('{{#');
|
|
29
|
+
}
|
|
30
|
+
exports.snippetUsesHandlebarsSyntax = snippetUsesHandlebarsSyntax;
|
|
31
|
+
function validateScript(content) {
|
|
32
|
+
if (snippetUsesHandlebarsSyntax(content)) {
|
|
33
|
+
throw new UnsupportedScriptError(`Conversion from legacy handlebars syntax is not supported.`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.validateScript = validateScript;
|
|
37
|
+
const SNIPPET_PATH_PREFIX = './snippets/';
|
|
38
|
+
function parseSnippetDependencies(content) {
|
|
39
|
+
const { module: { dependencies }, error } = parser_1.Parser.parseDependencies('__placeholder.ts', content);
|
|
40
|
+
if (error) {
|
|
41
|
+
throw new Error(`Failed to parse '${SNIPPET_PATH_PREFIX}...' dependencies: ${error}`, { cause: error });
|
|
42
|
+
}
|
|
43
|
+
return dependencies
|
|
44
|
+
.filter(value => value.startsWith(SNIPPET_PATH_PREFIX))
|
|
45
|
+
.map(value => value.slice(SNIPPET_PATH_PREFIX.length));
|
|
46
|
+
}
|
|
47
|
+
exports.parseSnippetDependencies = parseSnippetDependencies;
|
|
48
|
+
//# sourceMappingURL=snippet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippet.js","sourceRoot":"","sources":["../../../../src/constructs/internal/codegen/snippet.ts"],"names":[],"mappings":";;;AAAA,kEAA8D;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EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;IACzG,CAAC;IAED,OAAO,YAAY;SAChB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;SACtD,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAA;AAC1D,CAAC;AAbD,4DAaC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { GeneratedFile, Program, Value } from '../sourcegen';
|
|
2
|
+
import { Context } from './internal/codegen';
|
|
3
|
+
import KeyValuePair from './key-value-pair';
|
|
4
|
+
export declare function valueForKeyValuePair(program: Program, genfile: GeneratedFile, context: Context, kv: KeyValuePair): Value;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.valueForKeyValuePair = void 0;
|
|
4
|
+
const sourcegen_1 = require("../sourcegen");
|
|
5
|
+
function valueForKeyValuePair(program, genfile, context, kv) {
|
|
6
|
+
return (0, sourcegen_1.object)(builder => {
|
|
7
|
+
builder.string('key', kv.key);
|
|
8
|
+
if (kv.secret !== true) {
|
|
9
|
+
builder.string('value', kv.value);
|
|
10
|
+
}
|
|
11
|
+
if (kv.locked === true) {
|
|
12
|
+
builder.boolean('locked', kv.locked);
|
|
13
|
+
}
|
|
14
|
+
if (kv.secret === true) {
|
|
15
|
+
const secretVariable = (0, sourcegen_1.ident)(kv.key, {
|
|
16
|
+
format: 'SCREAMING_SNAKE_CASE',
|
|
17
|
+
});
|
|
18
|
+
if (context.registerKnownSecret(secretVariable.value)) {
|
|
19
|
+
const secretsFile = program.generatedSupportFile('secrets');
|
|
20
|
+
secretsFile.namedImport('secret', 'checkly/util');
|
|
21
|
+
secretsFile.section((0, sourcegen_1.decl)(secretVariable, builder => {
|
|
22
|
+
builder.variable((0, sourcegen_1.expr)((0, sourcegen_1.ident)('secret'), builder => {
|
|
23
|
+
builder.call(builder => {
|
|
24
|
+
builder.string(secretVariable.value);
|
|
25
|
+
});
|
|
26
|
+
}));
|
|
27
|
+
builder.export();
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
genfile.namedImport(secretVariable.value, 'secrets', {
|
|
31
|
+
relativeToSelf: true,
|
|
32
|
+
});
|
|
33
|
+
builder.value('value', secretVariable);
|
|
34
|
+
builder.boolean('secret', true);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
exports.valueForKeyValuePair = valueForKeyValuePair;
|
|
39
|
+
//# sourceMappingURL=key-value-pair-codegen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-value-pair-codegen.js","sourceRoot":"","sources":["../../src/constructs/key-value-pair-codegen.ts"],"names":[],"mappings":";;;AAAA,4CAAuF;AAIvF,SAAgB,oBAAoB,CAClC,OAAgB,EAChB,OAAsB,EACtB,OAAgB,EAChB,EAAgB;IAEhB,OAAO,IAAA,kBAAM,EAAC,OAAO,CAAC,EAAE;QACtB,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,CAAA;QAE7B,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YACvB,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;QACnC,CAAC;QAED,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YACvB,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,CAAA;QACtC,CAAC;QAED,IAAI,EAAE,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YACvB,MAAM,cAAc,GAAG,IAAA,iBAAK,EAAC,EAAE,CAAC,GAAG,EAAE;gBACnC,MAAM,EAAE,sBAAsB;aAC/B,CAAC,CAAA;YAEF,IAAI,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;gBACtD,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAA;gBAE3D,WAAW,CAAC,WAAW,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;gBAEjD,WAAW,CAAC,OAAO,CAAC,IAAA,gBAAI,EAAC,cAAc,EAAE,OAAO,CAAC,EAAE;oBACjD,OAAO,CAAC,QAAQ,CAAC,IAAA,gBAAI,EAAC,IAAA,iBAAK,EAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE;wBAC/C,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;4BACrB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;wBACtC,CAAC,CAAC,CAAA;oBACJ,CAAC,CAAC,CAAC,CAAA;oBAEH,OAAO,CAAC,MAAM,EAAE,CAAA;gBAClB,CAAC,CAAC,CAAC,CAAA;YACL,CAAC;YAED,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE;gBACnD,cAAc,EAAE,IAAI;aACrB,CAAC,CAAA;YAEF,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAA;YAEtC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;QACjC,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AA/CD,oDA+CC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Codegen, Context } from './internal/codegen';
|
|
2
|
+
export interface MaintenanceWindowResource {
|
|
3
|
+
name: string;
|
|
4
|
+
tags: Array<string>;
|
|
5
|
+
startsAt: string;
|
|
6
|
+
endsAt: string;
|
|
7
|
+
repeatInterval?: number | null;
|
|
8
|
+
repeatUnit?: string;
|
|
9
|
+
repeatEndsAt?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class MaintenanceWindowCodegen extends Codegen<MaintenanceWindowResource> {
|
|
12
|
+
describe(resource: MaintenanceWindowResource): string;
|
|
13
|
+
gencode(logicalId: string, resource: MaintenanceWindowResource, context: Context): void;
|
|
14
|
+
}
|