@speedkit/cli 4.51.0-run-control.5 → 4.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +14 -1426
- package/dist/commands/diff.d.ts +1 -7
- package/dist/commands/diff.js +3 -9
- package/dist/commands/login.d.ts +0 -3
- package/dist/commands/login.js +3 -14
- package/dist/commands/onboarding.d.ts +0 -26
- package/dist/commands/onboarding.js +4 -221
- package/dist/commands/origin-request.d.ts +0 -4
- package/dist/commands/origin-request.js +0 -4
- package/dist/services/browser-fetch/device-emulation.d.ts +0 -11
- package/dist/services/browser-fetch/device-emulation.js +0 -14
- package/dist/services/bundler/bundle-service-factory.d.ts +3 -0
- package/dist/services/bundler/bundle-service-factory.js +5 -1
- package/dist/services/bundler/bundle-service.d.ts +10 -1
- package/dist/services/bundler/bundle-service.js +16 -1
- package/dist/services/bundler/error/packjockel-error.d.ts +3 -0
- package/dist/services/bundler/error/packjockel-error.js +3 -0
- package/dist/services/bundler/index.d.ts +1 -0
- package/dist/services/bundler/index.js +1 -0
- package/dist/services/bundler/packjockel-service.d.ts +112 -0
- package/dist/services/bundler/packjockel-service.js +202 -0
- package/dist/services/bundler/spec/packjockel-service.spec.js +186 -0
- package/dist/services/cli/cli-environment-factory.d.ts +0 -3
- package/dist/services/cli/cli-environment-factory.js +0 -1
- package/dist/services/cli/cli-service-build-context.d.ts +0 -3
- package/dist/services/cli/cli-service-factory.js +1 -1
- package/dist/services/cli/cli-service-model.d.ts +10 -29
- package/dist/services/cli/cli-service.d.ts +11 -60
- package/dist/services/cli/cli-service.js +32 -196
- package/dist/services/cli/index.d.ts +0 -2
- package/dist/services/cli/index.js +0 -2
- package/dist/services/cli/spec/cli-service.spec.js +50 -113
- package/dist/services/deploy/checks/activation/customer-approval-check.js +1 -1
- package/dist/services/deploy/checks/pre-deploy/device-detection-changed-check.js +2 -3
- package/dist/services/deploy/checks/pre-deploy/split-change-check.js +2 -3
- package/dist/services/deploy/handler/customer-config-handler.d.ts +9 -0
- package/dist/services/deploy/handler/customer-config-handler.js +41 -6
- package/dist/services/deploy/interface/install.d.ts +7 -1
- package/dist/services/deploy/mr/live-state-check.js +21 -2
- package/dist/services/deploy/policy/auto-deploy-policy.js +2 -0
- package/dist/services/deploy/policy/deploy-policy-model.d.ts +4 -0
- package/dist/services/deploy/policy/deploy-policy-model.js +4 -0
- package/dist/services/deploy/policy/testing-deploy-policy.js +2 -0
- package/dist/services/deploy/spec/handler/customer-config-handler.spec.js +98 -0
- package/dist/services/deploy/spec/mr/live-state-check.spec.js +45 -4
- package/dist/services/deploy/spec/policy/auto-deploy-policy.spec.js +2 -0
- package/dist/services/deploy/spec/policy/testing-deploy-policy.spec.js +3 -1
- package/dist/services/diff/diff-service-build-context.d.ts +0 -12
- package/dist/services/diff/diff-service-build-context.js +1 -45
- package/dist/services/diff/diff-service-factory.d.ts +0 -2
- package/dist/services/diff/diff-service-factory.js +25 -65
- package/dist/services/diff/diff-service.d.ts +0 -11
- package/dist/services/diff/diff-service.js +11 -37
- package/dist/services/diff/page-source.d.ts +0 -12
- package/dist/services/diff/page-source.js +11 -16
- package/dist/services/diff/sinks/tool-diff-sink.d.ts +2 -3
- package/dist/services/diff/sinks/tool-diff-sink.js +2 -3
- package/dist/services/diff/spec/diff-service-build-context.spec.js +0 -19
- package/dist/services/diff/spec/diff-service.spec.js +0 -95
- package/dist/services/document-handler-runtime/document-handler-browser-mock.d.ts +13 -0
- package/dist/services/document-handler-runtime/document-handler-browser-mock.js +69 -0
- package/dist/services/document-handler-runtime/document-handler-server.d.ts +27 -0
- package/dist/services/document-handler-runtime/document-handler-server.js +112 -19
- package/dist/services/document-handler-runtime/spec/document-handler-browser-mock.spec.js +34 -0
- package/dist/services/git/git-repository.d.ts +0 -2
- package/dist/services/git/git-repository.js +0 -6
- package/dist/services/integration-api/customer-config-flags.js +0 -1
- package/dist/services/integration-api/integration-api-model.d.ts +4 -1
- package/dist/services/integration-api/spec/customer-config-file.spec.js +56 -0
- package/dist/services/integration-api/spec/speed-kit-config-file.spec.js +68 -8
- package/dist/services/integration-api/struct/customer-config-file.d.ts +15 -0
- package/dist/services/integration-api/struct/customer-config-file.js +42 -0
- package/dist/services/integration-api/struct/customer-config.d.ts +55 -1
- package/dist/services/integration-api/struct/customer-config.js +70 -3
- package/dist/services/integration-api/struct/speed-kit-config-file.d.ts +11 -4
- package/dist/services/integration-api/struct/speed-kit-config-file.js +31 -10
- package/dist/services/onboarding/browse/browse-service.d.ts +1 -13
- package/dist/services/onboarding/browse/browse-service.js +7 -43
- package/dist/services/onboarding/browser/baqend-response.d.ts +1 -17
- package/dist/services/onboarding/browser/baqend-response.js +0 -23
- package/dist/services/onboarding/browser/emulate-device.d.ts +1 -12
- package/dist/services/onboarding/browser/emulate-device.js +13 -68
- package/dist/services/onboarding/browser/executable/executable-validator.js +2 -4
- package/dist/services/onboarding/browser/extension/extension-bridge.js +3 -5
- package/dist/services/onboarding/browser/extension/extension-downloader.js +8 -17
- package/dist/services/onboarding/browser/extension/extension-validator.js +4 -9
- package/dist/services/onboarding/browser/launch-browser.d.ts +1 -2
- package/dist/services/onboarding/browser/launch-browser.js +1 -6
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.d.ts +2 -0
- package/dist/services/onboarding/config-renderer/speed-kit-install-context.js +29 -8
- package/dist/services/onboarding/dashboard/diff-against-current-page.js +1 -3
- package/dist/services/onboarding/dashboard/index.js +2 -7
- package/dist/services/onboarding/fetch-event-handler.d.ts +5 -24
- package/dist/services/onboarding/fetch-event-handler.js +32 -103
- package/dist/services/onboarding/fetch-events/speed-kit-install-js.js +2 -11
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.d.ts +0 -14
- package/dist/services/onboarding/fetch-events/speed-kit-rum-pi-request.js +0 -30
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.d.ts +3 -14
- package/dist/services/onboarding/fetch-events/speed-kit-service-worker-js.js +10 -29
- package/dist/services/onboarding/file-events/file-watcher.d.ts +4 -43
- package/dist/services/onboarding/file-events/file-watcher.js +21 -119
- package/dist/services/onboarding/inject/inject-service.js +1 -1
- package/dist/services/onboarding/onboarding-model.d.ts +7 -40
- package/dist/services/onboarding/onboarding-model.js +9 -20
- package/dist/services/onboarding/onboarding-service-build-context.d.ts +0 -4
- package/dist/services/onboarding/onboarding-service-build-context.js +1 -7
- package/dist/services/onboarding/onboarding-service-factory.d.ts +1 -17
- package/dist/services/onboarding/onboarding-service-factory.js +35 -152
- package/dist/services/onboarding/onboarding-service.d.ts +1 -40
- package/dist/services/onboarding/onboarding-service.js +23 -139
- package/dist/services/onboarding/request-cache/cache.d.ts +5 -62
- package/dist/services/onboarding/request-cache/cache.js +17 -128
- package/dist/services/onboarding/spec/file-events/file-watcher.spec.js +67 -0
- package/dist/services/onboarding/spec/onboarding-model.spec.js +3 -39
- package/dist/services/onboarding/spec/onboarding-service-factory.spec.js +1 -25
- package/dist/services/onboarding/templates/install-speed-kit-js-template.js +5 -0
- package/dist/services/onboarding/todo-collector.d.ts +2 -7
- package/dist/services/onboarding/todo-collector.js +12 -49
- package/dist/services/onboarding/virtual-orestes-app/index.d.ts +0 -38
- package/dist/services/onboarding/virtual-orestes-app/index.js +27 -113
- package/dist/services/origin-request/asset-variations.d.ts +0 -14
- package/dist/services/origin-request/asset-variations.js +4 -11
- package/dist/services/origin-request/origin-fetcher.d.ts +0 -7
- package/dist/services/origin-request/origin-fetcher.js +5 -43
- package/dist/services/origin-request/origin-request-service-build-context.d.ts +0 -17
- package/dist/services/origin-request/origin-request-service-build-context.js +0 -8
- package/dist/services/origin-request/origin-request-service-factory.d.ts +5 -0
- package/dist/services/origin-request/origin-request-service-factory.js +30 -2
- package/dist/services/origin-request/origin-request-service.d.ts +6 -121
- package/dist/services/origin-request/origin-request-service.js +49 -273
- package/dist/services/origin-request/runtime-config-source.d.ts +0 -6
- package/dist/services/origin-request/runtime-config-source.js +4 -15
- package/dist/services/origin-request/spec/asset-variations.spec.js +0 -20
- package/dist/services/origin-request/spec/origin-request-service.spec.js +6 -329
- package/dist/services/pull/pull-service.js +23 -5
- package/dist/services/query-builder/query-builder-factory.js +3 -3
- package/dist/services/setup/os/tool-registry.js +2 -2
- package/oclif.manifest.json +288 -3409
- package/package.json +3 -20
- package/dist/base/run-control-command.d.ts +0 -15
- package/dist/base/run-control-command.js +0 -20
- package/dist/build-info.json +0 -6
- package/dist/commands/onboarding/browser/click.d.ts +0 -75
- package/dist/commands/onboarding/browser/click.js +0 -19
- package/dist/commands/onboarding/browser/emulate.d.ts +0 -105
- package/dist/commands/onboarding/browser/emulate.js +0 -26
- package/dist/commands/onboarding/browser/navigate.d.ts +0 -75
- package/dist/commands/onboarding/browser/navigate.js +0 -19
- package/dist/commands/onboarding/browser/panel.d.ts +0 -63
- package/dist/commands/onboarding/browser/panel.js +0 -12
- package/dist/commands/onboarding/browser/reinstall-sw.d.ts +0 -63
- package/dist/commands/onboarding/browser/reinstall-sw.js +0 -14
- package/dist/commands/onboarding/browser/reset.d.ts +0 -71
- package/dist/commands/onboarding/browser/reset.js +0 -18
- package/dist/commands/onboarding/browser/screenshot.d.ts +0 -77
- package/dist/commands/onboarding/browser/screenshot.js +0 -19
- package/dist/commands/onboarding/browser/state.d.ts +0 -63
- package/dist/commands/onboarding/browser/state.js +0 -12
- package/dist/commands/onboarding/browser/tabs.d.ts +0 -58
- package/dist/commands/onboarding/browser/tabs.js +0 -16
- package/dist/commands/onboarding/cache/clear.d.ts +0 -58
- package/dist/commands/onboarding/cache/clear.js +0 -12
- package/dist/commands/onboarding/cache/errors.d.ts +0 -58
- package/dist/commands/onboarding/cache/errors.js +0 -12
- package/dist/commands/onboarding/cache/evict.d.ts +0 -62
- package/dist/commands/onboarding/cache/evict.js +0 -15
- package/dist/commands/onboarding/cache/get.d.ts +0 -85
- package/dist/commands/onboarding/cache/get.js +0 -17
- package/dist/commands/onboarding/cache/list.d.ts +0 -58
- package/dist/commands/onboarding/cache/list.js +0 -15
- package/dist/commands/onboarding/cache/prewarm.d.ts +0 -73
- package/dist/commands/onboarding/cache/prewarm.js +0 -20
- package/dist/commands/onboarding/cache/refresh.d.ts +0 -62
- package/dist/commands/onboarding/cache/refresh.js +0 -18
- package/dist/commands/onboarding/cdp.d.ts +0 -81
- package/dist/commands/onboarding/cdp.js +0 -18
- package/dist/commands/onboarding/debug/arm.d.ts +0 -83
- package/dist/commands/onboarding/debug/arm.js +0 -19
- package/dist/commands/onboarding/debug/await.d.ts +0 -71
- package/dist/commands/onboarding/debug/await.js +0 -18
- package/dist/commands/onboarding/debug/disarm.d.ts +0 -63
- package/dist/commands/onboarding/debug/disarm.js +0 -12
- package/dist/commands/onboarding/debug/eval.d.ts +0 -75
- package/dist/commands/onboarding/debug/eval.js +0 -16
- package/dist/commands/onboarding/debug/release.d.ts +0 -63
- package/dist/commands/onboarding/debug/release.js +0 -12
- package/dist/commands/onboarding/debug/resume.d.ts +0 -63
- package/dist/commands/onboarding/debug/resume.js +0 -12
- package/dist/commands/onboarding/debug/status.d.ts +0 -63
- package/dist/commands/onboarding/debug/status.js +0 -12
- package/dist/commands/onboarding/debug/step.d.ts +0 -67
- package/dist/commands/onboarding/debug/step.js +0 -15
- package/dist/commands/onboarding/files/list.d.ts +0 -58
- package/dist/commands/onboarding/files/list.js +0 -12
- package/dist/commands/onboarding/files/read.d.ts +0 -73
- package/dist/commands/onboarding/files/read.js +0 -16
- package/dist/commands/onboarding/files/rebuild.d.ts +0 -63
- package/dist/commands/onboarding/files/rebuild.js +0 -18
- package/dist/commands/onboarding/files/validate.d.ts +0 -58
- package/dist/commands/onboarding/files/validate.js +0 -12
- package/dist/commands/onboarding/fouc.d.ts +0 -77
- package/dist/commands/onboarding/fouc.js +0 -16
- package/dist/commands/onboarding/inject/add.d.ts +0 -89
- package/dist/commands/onboarding/inject/add.js +0 -17
- package/dist/commands/onboarding/inject/clear.d.ts +0 -63
- package/dist/commands/onboarding/inject/clear.js +0 -12
- package/dist/commands/onboarding/inject/list.d.ts +0 -63
- package/dist/commands/onboarding/inject/list.js +0 -12
- package/dist/commands/onboarding/inject/read.d.ts +0 -75
- package/dist/commands/onboarding/inject/read.js +0 -18
- package/dist/commands/onboarding/inject/recipes.d.ts +0 -63
- package/dist/commands/onboarding/inject/recipes.js +0 -12
- package/dist/commands/onboarding/inject/remove.d.ts +0 -67
- package/dist/commands/onboarding/inject/remove.js +0 -15
- package/dist/commands/onboarding/list.d.ts +0 -13
- package/dist/commands/onboarding/list.js +0 -12
- package/dist/commands/onboarding/logs.d.ts +0 -41
- package/dist/commands/onboarding/logs.js +0 -257
- package/dist/commands/onboarding/navwalk.d.ts +0 -95
- package/dist/commands/onboarding/navwalk.js +0 -19
- package/dist/commands/onboarding/response.d.ts +0 -67
- package/dist/commands/onboarding/response.js +0 -18
- package/dist/commands/onboarding/rum/beacons.d.ts +0 -75
- package/dist/commands/onboarding/rum/beacons.js +0 -16
- package/dist/commands/onboarding/rum/get.d.ts +0 -77
- package/dist/commands/onboarding/rum/get.js +0 -18
- package/dist/commands/onboarding/rum/key.d.ts +0 -67
- package/dist/commands/onboarding/rum/key.js +0 -13
- package/dist/commands/onboarding/rum/previous.d.ts +0 -63
- package/dist/commands/onboarding/rum/previous.js +0 -12
- package/dist/commands/onboarding/status.d.ts +0 -13
- package/dist/commands/onboarding/status.js +0 -17
- package/dist/commands/onboarding/stop.d.ts +0 -13
- package/dist/commands/onboarding/stop.js +0 -17
- package/dist/commands/onboarding/todo.d.ts +0 -58
- package/dist/commands/onboarding/todo.js +0 -12
- package/dist/commands/onboarding/viewport.d.ts +0 -101
- package/dist/commands/onboarding/viewport.js +0 -18
- package/dist/commands/onboarding/watch.d.ts +0 -93
- package/dist/commands/onboarding/watch.js +0 -16
- package/dist/commands/spec/onboarding.spec.js +0 -127
- package/dist/services/cli/build-info.d.ts +0 -33
- package/dist/services/cli/build-info.js +0 -63
- package/dist/services/cli/sink.d.ts +0 -47
- package/dist/services/cli/sink.js +0 -31
- package/dist/services/cli/spec/build-identity.spec.js +0 -85
- package/dist/services/cli/spec/build-info.spec.js +0 -10
- package/dist/services/cli/spec/cli-service-log.spec.js +0 -133
- package/dist/services/cli/spec/memory-cli.d.ts +0 -9
- package/dist/services/cli/spec/memory-cli.js +0 -9
- package/dist/services/diff/config-at-ref.d.ts +0 -20
- package/dist/services/diff/config-at-ref.js +0 -33
- package/dist/services/diff/run-runtime-config.d.ts +0 -33
- package/dist/services/diff/run-runtime-config.js +0 -74
- package/dist/services/diff/spec/config-at-ref.spec.js +0 -46
- package/dist/services/diff/spec/run-runtime-config.spec.d.ts +0 -1
- package/dist/services/diff/spec/run-runtime-config.spec.js +0 -87
- package/dist/services/onboarding/browser/answer-dialogs.d.ts +0 -12
- package/dist/services/onboarding/browser/answer-dialogs.js +0 -25
- package/dist/services/onboarding/browser/console-log.d.ts +0 -9
- package/dist/services/onboarding/browser/console-log.js +0 -27
- package/dist/services/onboarding/browser/resume-restarted-workers.d.ts +0 -14
- package/dist/services/onboarding/browser/resume-restarted-workers.js +0 -26
- package/dist/services/onboarding/control/body-inspect.d.ts +0 -24
- package/dist/services/onboarding/control/body-inspect.js +0 -106
- package/dist/services/onboarding/control/browser-session.d.ts +0 -547
- package/dist/services/onboarding/control/browser-session.js +0 -1337
- package/dist/services/onboarding/control/config-validation.d.ts +0 -17
- package/dist/services/onboarding/control/config-validation.js +0 -46
- package/dist/services/onboarding/control/control-protocol.d.ts +0 -1430
- package/dist/services/onboarding/control/control-protocol.js +0 -58
- package/dist/services/onboarding/control/control-server.d.ts +0 -292
- package/dist/services/onboarding/control/control-server.js +0 -1629
- package/dist/services/onboarding/control/debug-session.d.ts +0 -219
- package/dist/services/onboarding/control/debug-session.js +0 -897
- package/dist/services/onboarding/control/fouc.d.ts +0 -23
- package/dist/services/onboarding/control/fouc.js +0 -151
- package/dist/services/onboarding/control/index.d.ts +0 -4
- package/dist/services/onboarding/control/index.js +0 -4
- package/dist/services/onboarding/control/navigate-wait.d.ts +0 -33
- package/dist/services/onboarding/control/navigate-wait.js +0 -56
- package/dist/services/onboarding/control/navwalk.d.ts +0 -65
- package/dist/services/onboarding/control/navwalk.js +0 -248
- package/dist/services/onboarding/control/preload-registry.d.ts +0 -150
- package/dist/services/onboarding/control/preload-registry.js +0 -829
- package/dist/services/onboarding/control/response-explainer.d.ts +0 -24
- package/dist/services/onboarding/control/response-explainer.js +0 -257
- package/dist/services/onboarding/control/rum.d.ts +0 -8
- package/dist/services/onboarding/control/rum.js +0 -220
- package/dist/services/onboarding/control/service-worker-tracker.d.ts +0 -68
- package/dist/services/onboarding/control/service-worker-tracker.js +0 -120
- package/dist/services/onboarding/control/viewport.d.ts +0 -45
- package/dist/services/onboarding/control/viewport.js +0 -344
- package/dist/services/onboarding/control/watch.d.ts +0 -26
- package/dist/services/onboarding/control/watch.js +0 -157
- package/dist/services/onboarding/request-cache/asset-key.d.ts +0 -61
- package/dist/services/onboarding/request-cache/asset-key.js +0 -115
- package/dist/services/onboarding/spec/browser/answer-dialogs.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/answer-dialogs.spec.js +0 -66
- package/dist/services/onboarding/spec/browser/console-log.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/console-log.spec.js +0 -42
- package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/browser/resume-restarted-workers.spec.js +0 -45
- package/dist/services/onboarding/spec/control/browser-session.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/browser-session.spec.js +0 -753
- package/dist/services/onboarding/spec/control/control-server.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/control-server.spec.js +0 -371
- package/dist/services/onboarding/spec/control/debug-session.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/debug-session.spec.js +0 -751
- package/dist/services/onboarding/spec/control/fakes.d.ts +0 -31
- package/dist/services/onboarding/spec/control/fakes.js +0 -67
- package/dist/services/onboarding/spec/control/fouc.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/fouc.spec.js +0 -167
- package/dist/services/onboarding/spec/control/navigate-wait.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/navigate-wait.spec.js +0 -47
- package/dist/services/onboarding/spec/control/navwalk.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/navwalk.spec.js +0 -222
- package/dist/services/onboarding/spec/control/preload-registry.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/preload-registry.spec.js +0 -432
- package/dist/services/onboarding/spec/control/response-explainer.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/response-explainer.spec.js +0 -324
- package/dist/services/onboarding/spec/control/rum.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/rum.spec.js +0 -222
- package/dist/services/onboarding/spec/control/service-worker-tracker.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/service-worker-tracker.spec.js +0 -193
- package/dist/services/onboarding/spec/control/viewport.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/viewport.spec.js +0 -200
- package/dist/services/onboarding/spec/control/watch.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/control/watch.spec.js +0 -187
- package/dist/services/onboarding/spec/fetch-event-handler.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/fetch-event-handler.spec.js +0 -219
- package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/fetch-events/speed-kit-service-worker-js.spec.js +0 -41
- package/dist/services/onboarding/spec/request-cache/cache.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/request-cache/cache.spec.js +0 -107
- package/dist/services/onboarding/spec/todo-collector.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/todo-collector.spec.js +0 -136
- package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.d.ts +0 -1
- package/dist/services/onboarding/spec/virtual-orestes-app/virtual-orestes-app.spec.js +0 -65
- package/dist/services/query-builder/rules/rule-match.d.ts +0 -35
- package/dist/services/query-builder/rules/rule-match.js +0 -70
- package/dist/services/query-builder/spec/rules/rule-match.spec.d.ts +0 -1
- package/dist/services/query-builder/spec/rules/rule-match.spec.js +0 -121
- package/dist/services/run-control/browser/run-browser-contexts.d.ts +0 -557
- package/dist/services/run-control/browser/run-browser-contexts.js +0 -91
- package/dist/services/run-control/browser/run-browser-service-factory.d.ts +0 -5
- package/dist/services/run-control/browser/run-browser-service-factory.js +0 -7
- package/dist/services/run-control/browser/run-browser-service.d.ts +0 -68
- package/dist/services/run-control/browser/run-browser-service.js +0 -206
- package/dist/services/run-control/cache/run-cache-contexts.d.ts +0 -349
- package/dist/services/run-control/cache/run-cache-contexts.js +0 -51
- package/dist/services/run-control/cache/run-cache-service-factory.d.ts +0 -6
- package/dist/services/run-control/cache/run-cache-service-factory.js +0 -12
- package/dist/services/run-control/cache/run-cache-service.d.ts +0 -35
- package/dist/services/run-control/cache/run-cache-service.js +0 -151
- package/dist/services/run-control/control-client.d.ts +0 -36
- package/dist/services/run-control/control-client.js +0 -147
- package/dist/services/run-control/debug/run-debug-contexts.d.ts +0 -416
- package/dist/services/run-control/debug/run-debug-contexts.js +0 -47
- package/dist/services/run-control/debug/run-debug-service-factory.d.ts +0 -5
- package/dist/services/run-control/debug/run-debug-service-factory.js +0 -7
- package/dist/services/run-control/debug/run-debug-service.d.ts +0 -39
- package/dist/services/run-control/debug/run-debug-service.js +0 -164
- package/dist/services/run-control/files/run-files-contexts.d.ts +0 -238
- package/dist/services/run-control/files/run-files-contexts.js +0 -26
- package/dist/services/run-control/files/run-files-service-factory.d.ts +0 -5
- package/dist/services/run-control/files/run-files-service-factory.js +0 -7
- package/dist/services/run-control/files/run-files-service.d.ts +0 -29
- package/dist/services/run-control/files/run-files-service.js +0 -120
- package/dist/services/run-control/index.d.ts +0 -32
- package/dist/services/run-control/index.js +0 -31
- package/dist/services/run-control/inject/run-inject-contexts.d.ts +0 -319
- package/dist/services/run-control/inject/run-inject-contexts.js +0 -38
- package/dist/services/run-control/inject/run-inject-service-factory.d.ts +0 -5
- package/dist/services/run-control/inject/run-inject-service-factory.js +0 -7
- package/dist/services/run-control/inject/run-inject-service.d.ts +0 -31
- package/dist/services/run-control/inject/run-inject-service.js +0 -227
- package/dist/services/run-control/live-run.d.ts +0 -37
- package/dist/services/run-control/live-run.js +0 -56
- package/dist/services/run-control/probe/run-probe-contexts.d.ts +0 -333
- package/dist/services/run-control/probe/run-probe-contexts.js +0 -73
- package/dist/services/run-control/probe/run-probe-service-factory.d.ts +0 -5
- package/dist/services/run-control/probe/run-probe-service-factory.js +0 -7
- package/dist/services/run-control/probe/run-probe-service.d.ts +0 -54
- package/dist/services/run-control/probe/run-probe-service.js +0 -194
- package/dist/services/run-control/rum/run-rum-contexts.d.ts +0 -216
- package/dist/services/run-control/rum/run-rum-contexts.js +0 -34
- package/dist/services/run-control/rum/run-rum-service-factory.d.ts +0 -5
- package/dist/services/run-control/rum/run-rum-service-factory.js +0 -7
- package/dist/services/run-control/rum/run-rum-service.d.ts +0 -36
- package/dist/services/run-control/rum/run-rum-service.js +0 -122
- package/dist/services/run-control/run-answer.d.ts +0 -28
- package/dist/services/run-control/run-answer.js +0 -58
- package/dist/services/run-control/run-control-context.d.ts +0 -102
- package/dist/services/run-control/run-control-context.js +0 -36
- package/dist/services/run-control/run-control-flags.d.ts +0 -12
- package/dist/services/run-control/run-control-flags.js +0 -22
- package/dist/services/run-control/run-control-model.d.ts +0 -9
- package/dist/services/run-control/run-control-model.js +0 -1
- package/dist/services/run-control/run-control-service-factory.d.ts +0 -14
- package/dist/services/run-control/run-control-service-factory.js +0 -26
- package/dist/services/run-control/session/run-session-contexts.d.ts +0 -25
- package/dist/services/run-control/session/run-session-contexts.js +0 -20
- package/dist/services/run-control/session/run-session-service-factory.d.ts +0 -8
- package/dist/services/run-control/session/run-session-service-factory.js +0 -18
- package/dist/services/run-control/session/run-session-service.d.ts +0 -32
- package/dist/services/run-control/session/run-session-service.js +0 -151
- package/dist/services/run-control/spec/browser/run-browser-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/browser/run-browser-service.spec.js +0 -328
- package/dist/services/run-control/spec/cache/run-cache-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/cache/run-cache-service.spec.js +0 -454
- package/dist/services/run-control/spec/debug/run-debug-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/debug/run-debug-service.spec.js +0 -113
- package/dist/services/run-control/spec/files/run-files-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/files/run-files-service.spec.js +0 -234
- package/dist/services/run-control/spec/inject/run-inject-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/inject/run-inject-service.spec.js +0 -251
- package/dist/services/run-control/spec/live-run-fixture.d.ts +0 -32
- package/dist/services/run-control/spec/live-run-fixture.js +0 -109
- package/dist/services/run-control/spec/probe/run-probe-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/probe/run-probe-service.spec.js +0 -108
- package/dist/services/run-control/spec/rum/run-rum-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/rum/run-rum-service.spec.js +0 -47
- package/dist/services/run-control/spec/run-answer.spec.d.ts +0 -1
- package/dist/services/run-control/spec/run-answer.spec.js +0 -57
- package/dist/services/run-control/spec/session/run-session-service.spec.d.ts +0 -1
- package/dist/services/run-control/spec/session/run-session-service.spec.js +0 -150
- package/dist/services/run-log/crash-mirror.d.ts +0 -31
- package/dist/services/run-log/crash-mirror.js +0 -69
- package/dist/services/run-log/index.d.ts +0 -11
- package/dist/services/run-log/index.js +0 -11
- package/dist/services/run-log/jsonl-appender.d.ts +0 -46
- package/dist/services/run-log/jsonl-appender.js +0 -91
- package/dist/services/run-log/log-event-model.d.ts +0 -104
- package/dist/services/run-log/log-event-model.js +0 -56
- package/dist/services/run-log/log-query-service-factory.d.ts +0 -11
- package/dist/services/run-log/log-query-service-factory.js +0 -14
- package/dist/services/run-log/log-query-service.d.ts +0 -59
- package/dist/services/run-log/log-query-service.js +0 -111
- package/dist/services/run-log/log-reader.d.ts +0 -84
- package/dist/services/run-log/log-reader.js +0 -180
- package/dist/services/run-log/log-summary.d.ts +0 -72
- package/dist/services/run-log/log-summary.js +0 -208
- package/dist/services/run-log/redaction.d.ts +0 -34
- package/dist/services/run-log/redaction.js +0 -124
- package/dist/services/run-log/request-log.d.ts +0 -82
- package/dist/services/run-log/request-log.js +0 -69
- package/dist/services/run-log/request-summary.d.ts +0 -76
- package/dist/services/run-log/request-summary.js +0 -0
- package/dist/services/run-log/run-log.d.ts +0 -61
- package/dist/services/run-log/run-log.js +0 -102
- package/dist/services/run-log/spec/log-query-service.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-query-service.spec.js +0 -197
- package/dist/services/run-log/spec/log-reader.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-reader.spec.js +0 -109
- package/dist/services/run-log/spec/log-summary.spec.d.ts +0 -1
- package/dist/services/run-log/spec/log-summary.spec.js +0 -153
- package/dist/services/run-log/spec/redaction.spec.d.ts +0 -1
- package/dist/services/run-log/spec/redaction.spec.js +0 -61
- package/dist/services/run-log/spec/request-log.spec.d.ts +0 -1
- package/dist/services/run-log/spec/request-log.spec.js +0 -101
- package/dist/services/run-log/spec/request-summary.spec.d.ts +0 -1
- package/dist/services/run-log/spec/request-summary.spec.js +0 -171
- package/dist/services/run-log/spec/run-log.spec.d.ts +0 -1
- package/dist/services/run-log/spec/run-log.spec.js +0 -122
- package/dist/services/run-registry/exit-classification.d.ts +0 -39
- package/dist/services/run-registry/exit-classification.js +0 -42
- package/dist/services/run-registry/index.d.ts +0 -3
- package/dist/services/run-registry/index.js +0 -3
- package/dist/services/run-registry/process-identity.d.ts +0 -28
- package/dist/services/run-registry/process-identity.js +0 -80
- package/dist/services/run-registry/run-registry-model.d.ts +0 -128
- package/dist/services/run-registry/run-registry-model.js +0 -16
- package/dist/services/run-registry/run-registry.d.ts +0 -155
- package/dist/services/run-registry/run-registry.js +0 -430
- package/dist/services/run-registry/spec/exit-classification.spec.d.ts +0 -1
- package/dist/services/run-registry/spec/exit-classification.spec.js +0 -82
- package/dist/services/run-registry/spec/run-registry.spec.d.ts +0 -1
- package/dist/services/run-registry/spec/run-registry.spec.js +0 -526
- /package/dist/{commands/spec/onboarding.spec.d.ts → services/bundler/spec/packjockel-service.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/build-identity.spec.d.ts → deploy/spec/handler/customer-config-handler.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/build-info.spec.d.ts → document-handler-runtime/spec/document-handler-browser-mock.spec.d.ts} +0 -0
- /package/dist/services/{cli/spec/cli-service-log.spec.d.ts → integration-api/spec/customer-config-file.spec.d.ts} +0 -0
- /package/dist/services/{diff/spec/config-at-ref.spec.d.ts → onboarding/spec/file-events/file-watcher.spec.d.ts} +0 -0
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
const DEFAULT_INTERVAL_MS = 200;
|
|
2
|
-
/** The shortest tick the sampler takes; a shorter one is raised to it. */
|
|
3
|
-
const MIN_INTERVAL_MS = 20;
|
|
4
|
-
const DEFAULT_DURATION_MS = 15_000;
|
|
5
|
-
/** Long enough for a slow load to finish, short enough to be a tool call. */
|
|
6
|
-
const MAX_DURATION_MS = 120_000;
|
|
7
|
-
/** Samples returned, after collapsing. The rest stay in the count. */
|
|
8
|
-
const MAX_RETURNED = 200;
|
|
9
|
-
/**
|
|
10
|
-
* Sample an expression across a navigation and report what it did.
|
|
11
|
-
*
|
|
12
|
-
* `tools/sk-watch.mjs` promoted. It exists because an intermittent or
|
|
13
|
-
* good-then-broken symptom cannot be caught by a single evaluation — by the
|
|
14
|
-
* time anyone can ask, the page is in whichever state it ended up in. A preload
|
|
15
|
-
* samples from t=0 of the next load and survives the navigation, so the
|
|
16
|
-
* question becomes "what did this value do" rather than "what is it now".
|
|
17
|
-
*
|
|
18
|
-
* Console messages and page exceptions are collected from inside the page
|
|
19
|
-
* rather than over CDP. That keeps the whole capture in one buffer with one
|
|
20
|
-
* clock, and it needs no subscription that would outlive the call. The cost is
|
|
21
|
-
* real and worth stating: messages the *browser* emits rather than the page —
|
|
22
|
-
* a CSP violation, a failed request — are not console calls and do not appear
|
|
23
|
-
* here.
|
|
24
|
-
*/
|
|
25
|
-
export async function runWatch(preloads, reload, options) {
|
|
26
|
-
const intervalMs = Math.max(MIN_INTERVAL_MS, options.intervalMs ?? DEFAULT_INTERVAL_MS);
|
|
27
|
-
const notes = options.intervalMs !== undefined && options.intervalMs < intervalMs
|
|
28
|
-
? [
|
|
29
|
-
`interval ${options.intervalMs}ms raised to ${intervalMs}ms, the shortest the sampler takes`,
|
|
30
|
-
]
|
|
31
|
-
: [];
|
|
32
|
-
const durationMs = Math.min(MAX_DURATION_MS, Math.max(intervalMs, options.durationMs ?? DEFAULT_DURATION_MS));
|
|
33
|
-
await preloads.reserve("watch", watchScript(options.expression, intervalMs));
|
|
34
|
-
try {
|
|
35
|
-
if (options.reload) {
|
|
36
|
-
await reload();
|
|
37
|
-
}
|
|
38
|
-
await delay(durationMs);
|
|
39
|
-
const read = await preloads.read("watch", Number.MAX_SAFE_INTEGER);
|
|
40
|
-
const records = (read.records ?? []).map((record) => record);
|
|
41
|
-
const samples = [];
|
|
42
|
-
const console = [];
|
|
43
|
-
const exceptions = [];
|
|
44
|
-
for (const { t, v } of records) {
|
|
45
|
-
if (v?.k === "console") {
|
|
46
|
-
console.push({ t, level: v.level ?? "log", text: v.text ?? "" });
|
|
47
|
-
}
|
|
48
|
-
else if (v?.k === "exception") {
|
|
49
|
-
exceptions.push({ t, level: "error", text: v.text ?? "" });
|
|
50
|
-
}
|
|
51
|
-
else if (v?.k === "sample") {
|
|
52
|
-
samples.push(v.error === undefined ? { t, v: v.v } : { t, error: v.error });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
const shown = options.full ? samples : transitions(samples);
|
|
56
|
-
return {
|
|
57
|
-
expression: options.expression,
|
|
58
|
-
intervalMs,
|
|
59
|
-
durationMs,
|
|
60
|
-
reloaded: Boolean(options.reload),
|
|
61
|
-
mode: options.full ? "full" : "transitions",
|
|
62
|
-
samples: shown.slice(0, MAX_RETURNED),
|
|
63
|
-
totalSamples: samples.length,
|
|
64
|
-
dropped: read.dropped,
|
|
65
|
-
console: console.slice(0, MAX_RETURNED),
|
|
66
|
-
exceptions: exceptions.slice(0, MAX_RETURNED),
|
|
67
|
-
truncated: shown.length > MAX_RETURNED,
|
|
68
|
-
notes,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
finally {
|
|
72
|
-
// Whatever happened, the sampler does not outlive the call. A watch left
|
|
73
|
-
// running is a timer firing every 200ms in the customer's page for as long
|
|
74
|
-
// as the run lives.
|
|
75
|
-
await preloads.release("watch").catch(() => undefined);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Keep only the ticks where the value changed.
|
|
80
|
-
*
|
|
81
|
-
* A 15-second watch at 200ms is 75 samples of which two usually matter. The
|
|
82
|
-
* first sample is always kept, because "what it started as" is half of what a
|
|
83
|
-
* transition means.
|
|
84
|
-
*/
|
|
85
|
-
function transitions(samples) {
|
|
86
|
-
const kept = [];
|
|
87
|
-
let previous;
|
|
88
|
-
for (const sample of samples) {
|
|
89
|
-
const key = JSON.stringify(sample.error ?? sample.v ?? null);
|
|
90
|
-
if (key !== previous) {
|
|
91
|
-
kept.push(sample);
|
|
92
|
-
previous = key;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
return kept;
|
|
96
|
-
}
|
|
97
|
-
function delay(ms) {
|
|
98
|
-
return new Promise((resolve) => {
|
|
99
|
-
const timer = setTimeout(resolve, ms);
|
|
100
|
-
timer.unref();
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* The sampler, the console wrapper and the error listeners, in one script.
|
|
105
|
-
*
|
|
106
|
-
* All three write through the same `record`, so everything shares one clock and
|
|
107
|
-
* one buffer — which is what makes "the value flipped, and here is the
|
|
108
|
-
* exception thrown half a tick earlier" readable at all.
|
|
109
|
-
*/
|
|
110
|
-
function watchScript(expression, intervalMs) {
|
|
111
|
-
return `
|
|
112
|
-
var take = guard(function () {
|
|
113
|
-
try {
|
|
114
|
-
record({ k: "sample", v: (${expression}) });
|
|
115
|
-
} catch (error) {
|
|
116
|
-
record({ k: "sample", error: String((error && error.message) || error) });
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
take();
|
|
120
|
-
var timer = setInterval(function () {
|
|
121
|
-
if (slot.disabled) { clearInterval(timer); return; }
|
|
122
|
-
take();
|
|
123
|
-
}, ${intervalMs});
|
|
124
|
-
|
|
125
|
-
// Guarded per document rather than per slot: a second watch in the same
|
|
126
|
-
// page must re-install its sampler but must not wrap console twice, which
|
|
127
|
-
// would record every message as many times as watches have run.
|
|
128
|
-
if (!window.__SK_WATCH_TAPPED) {
|
|
129
|
-
window.__SK_WATCH_TAPPED = true;
|
|
130
|
-
["log", "info", "warn", "error", "debug"].forEach(function (level) {
|
|
131
|
-
var original = console[level];
|
|
132
|
-
if (typeof original !== "function") return;
|
|
133
|
-
console[level] = function () {
|
|
134
|
-
try {
|
|
135
|
-
record({
|
|
136
|
-
k: "console",
|
|
137
|
-
level: level,
|
|
138
|
-
text: Array.prototype.slice.call(arguments).map(function (one) {
|
|
139
|
-
return typeof one === "string" ? one : JSON.stringify(summarise(one));
|
|
140
|
-
}).join(" ")
|
|
141
|
-
});
|
|
142
|
-
} catch (ignored) {
|
|
143
|
-
// Recording is best effort; passing the call through is not.
|
|
144
|
-
}
|
|
145
|
-
return original.apply(this, arguments);
|
|
146
|
-
};
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
window.addEventListener("error", function (event) {
|
|
150
|
-
record({ k: "exception", text: String((event && event.message) || "error") });
|
|
151
|
-
});
|
|
152
|
-
window.addEventListener("unhandledrejection", function (event) {
|
|
153
|
-
var reason = event && event.reason;
|
|
154
|
-
record({ k: "exception", text: String((reason && reason.message) || reason) });
|
|
155
|
-
});
|
|
156
|
-
}`;
|
|
157
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The dh-cache is keyed by the full asset request url, which is a Speed Kit
|
|
3
|
-
* asset url with the origin url embedded in its path and the cache variation on
|
|
4
|
-
* a `bqvariation` search parameter:
|
|
5
|
-
*
|
|
6
|
-
* ```
|
|
7
|
-
* https://<app>.app.baqend.com/v1/asset/https://shop.example.com/p?bqvariation=mobile
|
|
8
|
-
* ```
|
|
9
|
-
*
|
|
10
|
-
* That is the right key — it is exactly what the browser asked for — and the
|
|
11
|
-
* wrong thing to show anyone. Decoding it is what lets a reader see
|
|
12
|
-
* `{originUrl, variation}` instead of 120 opaque characters.
|
|
13
|
-
*/
|
|
14
|
-
/** What an absent `bqvariation` means, in the words `buildResponse` uses. */
|
|
15
|
-
export declare const DEFAULT_VARIATION = "default";
|
|
16
|
-
export interface DecodedAssetKey {
|
|
17
|
-
/** The origin url the entry is for, or the key itself if it does not decode. */
|
|
18
|
-
originUrl: string;
|
|
19
|
-
/** The cache variation, or null for the default. */
|
|
20
|
-
variation: string | null;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* The origin url an asset request is for: everything after the asset path, with
|
|
24
|
-
* Speed Kit's own `bq*` parameters removed.
|
|
25
|
-
*
|
|
26
|
-
* Returns null when the key is not an asset url — a caller that cannot decode a
|
|
27
|
-
* key should say so rather than present a mangled one.
|
|
28
|
-
*/
|
|
29
|
-
export declare function assetOriginUrl(key: string): string | null;
|
|
30
|
-
/**
|
|
31
|
-
* The key the dh-cache stores a request under: the request url without
|
|
32
|
-
* {@link BOOKKEEPING_PARAMETERS}.
|
|
33
|
-
*
|
|
34
|
-
* Keyed by the raw url, one page was several entries — `bqpi` counts page
|
|
35
|
-
* impressions, so a page's second request missed its first — and an entry
|
|
36
|
-
* `cache prewarm` built, which carries none of them, was never the one the
|
|
37
|
-
* page read. `bqcv` goes too: a run copies it from the deployed install
|
|
38
|
-
* resource, so it stays the same however the local config changes. A string
|
|
39
|
-
* that is not a url is returned as it is.
|
|
40
|
-
*/
|
|
41
|
-
export declare function cacheKey(requestUri: string): string;
|
|
42
|
-
/** The variation an asset request carries, or null for the default. */
|
|
43
|
-
export declare function assetVariation(key: string): string | null;
|
|
44
|
-
export declare function decodeAssetKey(key: string): DecodedAssetKey;
|
|
45
|
-
/**
|
|
46
|
-
* The asset request url a browser would have sent for this origin url and
|
|
47
|
-
* variation — the key the dh-cache stores an entry under.
|
|
48
|
-
*
|
|
49
|
-
* The inverse of {@link decodeAssetKey}, and it has to agree with it exactly:
|
|
50
|
-
* an entry written under a key no request will ever match is cached and
|
|
51
|
-
* unreachable, which looks from outside like a cache that silently does
|
|
52
|
-
* nothing.
|
|
53
|
-
*
|
|
54
|
-
* The origin url goes in verbatim. Speed Kit strips query parameters in the
|
|
55
|
-
* *service worker*, before an asset request is made at all, so building the
|
|
56
|
-
* request here bypasses that — two urls differing only in a parameter stay two
|
|
57
|
-
* entries even where the worker would have collapsed them. That is the point
|
|
58
|
-
* for anyone comparing them, and a trap for anyone assuming this reproduces
|
|
59
|
-
* what the browser would have asked for.
|
|
60
|
-
*/
|
|
61
|
-
export declare function assetRequestUrl(appDomain: string, originUrl: string, variation?: string): string;
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The dh-cache is keyed by the full asset request url, which is a Speed Kit
|
|
3
|
-
* asset url with the origin url embedded in its path and the cache variation on
|
|
4
|
-
* a `bqvariation` search parameter:
|
|
5
|
-
*
|
|
6
|
-
* ```
|
|
7
|
-
* https://<app>.app.baqend.com/v1/asset/https://shop.example.com/p?bqvariation=mobile
|
|
8
|
-
* ```
|
|
9
|
-
*
|
|
10
|
-
* That is the right key — it is exactly what the browser asked for — and the
|
|
11
|
-
* wrong thing to show anyone. Decoding it is what lets a reader see
|
|
12
|
-
* `{originUrl, variation}` instead of 120 opaque characters.
|
|
13
|
-
*/
|
|
14
|
-
const ASSET_PATH = "app.baqend.com/v1/asset/";
|
|
15
|
-
const VARIATION_PARAMETER = "bqvariation";
|
|
16
|
-
/** What an absent `bqvariation` means, in the words `buildResponse` uses. */
|
|
17
|
-
export const DEFAULT_VARIATION = "default";
|
|
18
|
-
/**
|
|
19
|
-
* The origin url an asset request is for: everything after the asset path, with
|
|
20
|
-
* Speed Kit's own `bq*` parameters removed.
|
|
21
|
-
*
|
|
22
|
-
* Returns null when the key is not an asset url — a caller that cannot decode a
|
|
23
|
-
* key should say so rather than present a mangled one.
|
|
24
|
-
*/
|
|
25
|
-
export function assetOriginUrl(key) {
|
|
26
|
-
let url;
|
|
27
|
-
try {
|
|
28
|
-
url = new URL(key);
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
for (const name of [...url.searchParams.keys()]) {
|
|
34
|
-
if (name.startsWith("bq")) {
|
|
35
|
-
url.searchParams.delete(name);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const [, origin] = url.toString().split(ASSET_PATH);
|
|
39
|
-
return origin ?? null;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Speed Kit's per-request bookkeeping on an asset url: the deployed config and
|
|
43
|
-
* Speed Kit versions, the page-impression counter (with its `;…` suffix), the
|
|
44
|
-
* fetch mode and the debug pass. None of them changes the document the
|
|
45
|
-
* documentHandler builds.
|
|
46
|
-
*/
|
|
47
|
-
const BOOKKEEPING_PARAMETERS = ["bqcv", "bqsk", "bqpi", "bqcache", "bqpass"];
|
|
48
|
-
/**
|
|
49
|
-
* The key the dh-cache stores a request under: the request url without
|
|
50
|
-
* {@link BOOKKEEPING_PARAMETERS}.
|
|
51
|
-
*
|
|
52
|
-
* Keyed by the raw url, one page was several entries — `bqpi` counts page
|
|
53
|
-
* impressions, so a page's second request missed its first — and an entry
|
|
54
|
-
* `cache prewarm` built, which carries none of them, was never the one the
|
|
55
|
-
* page read. `bqcv` goes too: a run copies it from the deployed install
|
|
56
|
-
* resource, so it stays the same however the local config changes. A string
|
|
57
|
-
* that is not a url is returned as it is.
|
|
58
|
-
*/
|
|
59
|
-
export function cacheKey(requestUri) {
|
|
60
|
-
let url;
|
|
61
|
-
try {
|
|
62
|
-
url = new URL(requestUri);
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
return requestUri;
|
|
66
|
-
}
|
|
67
|
-
if (!BOOKKEEPING_PARAMETERS.some((name) => url.searchParams.has(name))) {
|
|
68
|
-
return requestUri;
|
|
69
|
-
}
|
|
70
|
-
for (const name of BOOKKEEPING_PARAMETERS) {
|
|
71
|
-
url.searchParams.delete(name);
|
|
72
|
-
}
|
|
73
|
-
return url.toString();
|
|
74
|
-
}
|
|
75
|
-
/** The variation an asset request carries, or null for the default. */
|
|
76
|
-
export function assetVariation(key) {
|
|
77
|
-
try {
|
|
78
|
-
return new URL(key).searchParams.get(VARIATION_PARAMETER)?.trim() || null;
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
export function decodeAssetKey(key) {
|
|
85
|
-
return {
|
|
86
|
-
originUrl: assetOriginUrl(key) ?? key,
|
|
87
|
-
variation: assetVariation(key),
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* The asset request url a browser would have sent for this origin url and
|
|
92
|
-
* variation — the key the dh-cache stores an entry under.
|
|
93
|
-
*
|
|
94
|
-
* The inverse of {@link decodeAssetKey}, and it has to agree with it exactly:
|
|
95
|
-
* an entry written under a key no request will ever match is cached and
|
|
96
|
-
* unreachable, which looks from outside like a cache that silently does
|
|
97
|
-
* nothing.
|
|
98
|
-
*
|
|
99
|
-
* The origin url goes in verbatim. Speed Kit strips query parameters in the
|
|
100
|
-
* *service worker*, before an asset request is made at all, so building the
|
|
101
|
-
* request here bypasses that — two urls differing only in a parameter stay two
|
|
102
|
-
* entries even where the worker would have collapsed them. That is the point
|
|
103
|
-
* for anyone comparing them, and a trap for anyone assuming this reproduces
|
|
104
|
-
* what the browser would have asked for.
|
|
105
|
-
*/
|
|
106
|
-
export function assetRequestUrl(appDomain, originUrl, variation) {
|
|
107
|
-
const url = new URL(`https://${appDomain}/v1/asset/${originUrl}`);
|
|
108
|
-
// The default carries no parameter, because that is how the worker sends it
|
|
109
|
-
// and `buildResponse` reads its absence as `default`. Writing it explicitly
|
|
110
|
-
// would key the default variation apart from every entry the browser makes.
|
|
111
|
-
if (variation && variation !== DEFAULT_VARIATION) {
|
|
112
|
-
url.searchParams.set(VARIATION_PARAMETER, variation);
|
|
113
|
-
}
|
|
114
|
-
return url.toString();
|
|
115
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "node:events";
|
|
2
|
-
import { expect } from "chai";
|
|
3
|
-
import { describe, it } from "mocha";
|
|
4
|
-
import { answerDialogs } from "../../browser/answer-dialogs.js";
|
|
5
|
-
/** A dialog that records how it was answered. */
|
|
6
|
-
function dialog(type, answers) {
|
|
7
|
-
return {
|
|
8
|
-
type: () => type,
|
|
9
|
-
message: () => `${type} text`,
|
|
10
|
-
accept: async () => void answers.push(`${type}: accepted`),
|
|
11
|
-
dismiss: async () => void answers.push(`${type}: cancelled`),
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
const tick = () => new Promise((resolve) => setImmediate(resolve));
|
|
15
|
-
describe("answerDialogs", () => {
|
|
16
|
-
it("answers every dialog of open and later pages, and logs each", async () => {
|
|
17
|
-
const browser = new EventEmitter();
|
|
18
|
-
const page = Object.assign(new EventEmitter(), {
|
|
19
|
-
url: () => "https://shop.test/",
|
|
20
|
-
});
|
|
21
|
-
const later = Object.assign(new EventEmitter(), {
|
|
22
|
-
url: () => "https://shop.test/2",
|
|
23
|
-
});
|
|
24
|
-
browser.targets = () => [
|
|
25
|
-
{ page: async () => page },
|
|
26
|
-
{ page: async () => null },
|
|
27
|
-
];
|
|
28
|
-
const warnings = [];
|
|
29
|
-
const answers = [];
|
|
30
|
-
answerDialogs(browser, {
|
|
31
|
-
writeWarning: (text) => void warnings.push(text),
|
|
32
|
-
});
|
|
33
|
-
browser.emit("targetcreated", { page: async () => later });
|
|
34
|
-
await tick();
|
|
35
|
-
page.emit("dialog", dialog("alert", answers));
|
|
36
|
-
page.emit("dialog", dialog("confirm", answers));
|
|
37
|
-
later.emit("dialog", dialog("beforeunload", answers));
|
|
38
|
-
later.emit("dialog", dialog("prompt", answers));
|
|
39
|
-
await tick();
|
|
40
|
-
expect(answers).to.deep.equal([
|
|
41
|
-
"alert: accepted",
|
|
42
|
-
"confirm: cancelled",
|
|
43
|
-
"beforeunload: accepted",
|
|
44
|
-
"prompt: cancelled",
|
|
45
|
-
]);
|
|
46
|
-
expect(warnings).to.have.length(4);
|
|
47
|
-
expect(warnings[0]).to.contain('a dialog (alert: "alert text")');
|
|
48
|
-
});
|
|
49
|
-
it("stays quiet when a navigation already closed the dialog", async () => {
|
|
50
|
-
const browser = Object.assign(new EventEmitter(), {
|
|
51
|
-
targets: () => [],
|
|
52
|
-
});
|
|
53
|
-
const page = Object.assign(new EventEmitter(), {
|
|
54
|
-
url: () => "https://shop.test/",
|
|
55
|
-
});
|
|
56
|
-
answerDialogs(browser, { writeWarning: () => undefined });
|
|
57
|
-
browser.emit("targetcreated", { page: async () => page });
|
|
58
|
-
await tick();
|
|
59
|
-
const closed = {
|
|
60
|
-
...dialog("alert", []),
|
|
61
|
-
accept: () => Promise.reject(new Error("No dialog is showing")),
|
|
62
|
-
};
|
|
63
|
-
page.emit("dialog", closed);
|
|
64
|
-
await tick();
|
|
65
|
-
});
|
|
66
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "node:events";
|
|
2
|
-
import { expect } from "chai";
|
|
3
|
-
import { describe, it } from "mocha";
|
|
4
|
-
import { recordConsole } from "../../browser/console-log.js";
|
|
5
|
-
/** A page that emits what a test hands it. */
|
|
6
|
-
function fakePage() {
|
|
7
|
-
const page = new EventEmitter();
|
|
8
|
-
page.url = () => "https://shop.test/c/shoes";
|
|
9
|
-
return page;
|
|
10
|
-
}
|
|
11
|
-
function message(type, text) {
|
|
12
|
-
return {
|
|
13
|
-
type: () => type,
|
|
14
|
-
text: () => text,
|
|
15
|
-
location: () => ({ url: "https://shop.test/app.js" }),
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
describe("recordConsole", () => {
|
|
19
|
-
it("records warnings, errors and uncaught errors in the log only", () => {
|
|
20
|
-
const page = fakePage();
|
|
21
|
-
const logged = [];
|
|
22
|
-
recordConsole(page, {
|
|
23
|
-
logOnly: (...args) => logged.push(args),
|
|
24
|
-
});
|
|
25
|
-
page.emit("console", message("log", "noise"));
|
|
26
|
-
page.emit("console", message("warning", "deprecated"));
|
|
27
|
-
page.emit("console", message("error", "grid is undefined"));
|
|
28
|
-
page.emit("pageerror", new TypeError("x is not a function"));
|
|
29
|
-
expect(logged.map(([level, text]) => `${level} ${text}`)).to.deep.equal([
|
|
30
|
-
"warn deprecated",
|
|
31
|
-
"error grid is undefined",
|
|
32
|
-
"error x is not a function",
|
|
33
|
-
]);
|
|
34
|
-
expect(logged[1][2]).to.deep.equal({
|
|
35
|
-
scope: "console",
|
|
36
|
-
data: {
|
|
37
|
-
page: "https://shop.test/c/shoes",
|
|
38
|
-
source: "https://shop.test/app.js",
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from "node:events";
|
|
2
|
-
import { expect } from "chai";
|
|
3
|
-
import { describe, it } from "mocha";
|
|
4
|
-
import { CDPSessionEvent } from "puppeteer";
|
|
5
|
-
import { resumeRestartedWorkers } from "../../browser/resume-restarted-workers.js";
|
|
6
|
-
/** A CDP session that records what it sends. */
|
|
7
|
-
function session(sent, answer) {
|
|
8
|
-
return Object.assign(new EventEmitter(), {
|
|
9
|
-
send: (method) => {
|
|
10
|
-
sent.push(method);
|
|
11
|
-
return answer();
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
const tick = () => new Promise((resolve) => setImmediate(resolve));
|
|
16
|
-
describe("resumeRestartedWorkers", () => {
|
|
17
|
-
it("resumes a target that Chrome restarted, on every later session", async () => {
|
|
18
|
-
const connection = new EventEmitter();
|
|
19
|
-
let detached = false;
|
|
20
|
-
const browser = {
|
|
21
|
-
target: () => ({
|
|
22
|
-
createCDPSession: async () => ({
|
|
23
|
-
connection: () => connection,
|
|
24
|
-
detach: async () => void (detached = true),
|
|
25
|
-
}),
|
|
26
|
-
}),
|
|
27
|
-
};
|
|
28
|
-
await resumeRestartedWorkers(browser);
|
|
29
|
-
expect(detached).to.equal(true);
|
|
30
|
-
const sent = [];
|
|
31
|
-
const worker = session(sent, async () => ({}));
|
|
32
|
-
const gone = session(sent, () => Promise.reject(new Error("detached")));
|
|
33
|
-
connection.emit(CDPSessionEvent.SessionAttached, worker);
|
|
34
|
-
connection.emit(CDPSessionEvent.SessionAttached, gone);
|
|
35
|
-
worker.emit("Inspector.workerScriptLoaded");
|
|
36
|
-
expect(sent).to.deep.equal([]);
|
|
37
|
-
worker.emit("Inspector.targetReloadedAfterCrash");
|
|
38
|
-
gone.emit("Inspector.targetReloadedAfterCrash");
|
|
39
|
-
await tick();
|
|
40
|
-
expect(sent).to.deep.equal([
|
|
41
|
-
"Runtime.runIfWaitingForDebugger",
|
|
42
|
-
"Runtime.runIfWaitingForDebugger",
|
|
43
|
-
]);
|
|
44
|
-
});
|
|
45
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|