@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,324 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { describe, it } from "mocha";
|
|
3
|
-
import { explainResponse, hasAssetList, } from "../../control/response-explainer.js";
|
|
4
|
-
function rule(pattern, source, subject = "pathname", extra = {}) {
|
|
5
|
-
return {
|
|
6
|
-
conditions: [{ subject, patterns: [{ kind: "string", value: pattern }] }],
|
|
7
|
-
matchesNothing: false,
|
|
8
|
-
criteriaOutsideTheUrl: [],
|
|
9
|
-
ruleSetVersion: 1,
|
|
10
|
-
source,
|
|
11
|
-
...extra,
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function sets(partial = {}) {
|
|
15
|
-
return {
|
|
16
|
-
blacklist: [],
|
|
17
|
-
disabledScopes: [],
|
|
18
|
-
disabledSites: [],
|
|
19
|
-
enabledSites: [],
|
|
20
|
-
plugins: [],
|
|
21
|
-
ruleSetVersion: 1,
|
|
22
|
-
stripQueryParams: [],
|
|
23
|
-
whitelist: [],
|
|
24
|
-
...partial,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
const URL_UNDER_TEST = new URL("https://www.shop.de/checkout/");
|
|
28
|
-
describe("explainResponse — the rule verdict", () => {
|
|
29
|
-
it("should include a url no set objects to", () => {
|
|
30
|
-
const { rules } = explainResponse({ url: URL_UNDER_TEST, rules: sets() });
|
|
31
|
-
expect(rules.decision).to.equal("included");
|
|
32
|
-
expect(rules.decidedBy).to.equal(null);
|
|
33
|
-
});
|
|
34
|
-
it("should let disabledScopes decide before anything else", () => {
|
|
35
|
-
// It is not a rule set at all — it is the paths the service worker never
|
|
36
|
-
// claims — so nothing downstream of it runs, and naming a later set as the
|
|
37
|
-
// cause would send a reader to edit the wrong line.
|
|
38
|
-
const { rules } = explainResponse({
|
|
39
|
-
url: URL_UNDER_TEST,
|
|
40
|
-
rules: sets({
|
|
41
|
-
disabledScopes: [rule("/checkout", "disabledScopes[0]")],
|
|
42
|
-
blacklist: [rule("/checkout", "blacklist[0]")],
|
|
43
|
-
}),
|
|
44
|
-
});
|
|
45
|
-
expect(rules.decision).to.equal("excluded");
|
|
46
|
-
expect(rules.decidedBy).to.equal("disabledScopes");
|
|
47
|
-
});
|
|
48
|
-
it("should exclude a page no enabledSites entry covers", () => {
|
|
49
|
-
const { rules } = explainResponse({
|
|
50
|
-
url: URL_UNDER_TEST,
|
|
51
|
-
rules: sets({ enabledSites: [rule("/shoes", "enabledSites[0]")] }),
|
|
52
|
-
});
|
|
53
|
-
expect(rules.decision).to.equal("excluded");
|
|
54
|
-
expect(rules.decidedBy).to.equal("enabledSites");
|
|
55
|
-
// The set matched nothing, so there is no rule to name — the explanation
|
|
56
|
-
// has to say that rather than printing an empty list.
|
|
57
|
-
expect(rules.enabledSites).to.deep.equal([]);
|
|
58
|
-
});
|
|
59
|
-
it("should not read an absent enabledSites as excluding everything", () => {
|
|
60
|
-
// An empty set means "every page", and the opposite reading would report
|
|
61
|
-
// every url on a perfectly ordinary config as excluded.
|
|
62
|
-
const { rules } = explainResponse({ url: URL_UNDER_TEST, rules: sets() });
|
|
63
|
-
expect(rules.decision).to.equal("included");
|
|
64
|
-
expect(rules.enabledSitesConfigured).to.equal(false);
|
|
65
|
-
});
|
|
66
|
-
it("should name the blacklist entry that excluded it", () => {
|
|
67
|
-
const { rules } = explainResponse({
|
|
68
|
-
url: URL_UNDER_TEST,
|
|
69
|
-
rules: sets({
|
|
70
|
-
blacklist: [
|
|
71
|
-
rule("/nope", "blacklist[0]"),
|
|
72
|
-
rule("/checkout", "blacklist[1]"),
|
|
73
|
-
],
|
|
74
|
-
}),
|
|
75
|
-
});
|
|
76
|
-
expect(rules.decidedBy).to.equal("blacklist");
|
|
77
|
-
expect(rules.blacklist).to.deep.equal(["blacklist[1]"]);
|
|
78
|
-
});
|
|
79
|
-
it("should exclude a url a configured whitelist does not cover", () => {
|
|
80
|
-
const { rules } = explainResponse({
|
|
81
|
-
url: URL_UNDER_TEST,
|
|
82
|
-
rules: sets({ whitelist: [rule("/shoes", "whitelist[0]")] }),
|
|
83
|
-
});
|
|
84
|
-
expect(rules.decidedBy).to.equal("whitelist");
|
|
85
|
-
expect(rules.whitelistConfigured).to.equal(true);
|
|
86
|
-
});
|
|
87
|
-
it("should report a rule it cannot fully evaluate rather than trust it", () => {
|
|
88
|
-
const { rules, notes } = explainResponse({
|
|
89
|
-
url: URL_UNDER_TEST,
|
|
90
|
-
rules: sets({
|
|
91
|
-
blacklist: [
|
|
92
|
-
rule("/checkout", "blacklist[0]", "pathname", {
|
|
93
|
-
criteriaOutsideTheUrl: ["cookie"],
|
|
94
|
-
}),
|
|
95
|
-
],
|
|
96
|
-
}),
|
|
97
|
-
});
|
|
98
|
-
expect(rules.uncertain).to.deep.equal(["blacklist[0]"]);
|
|
99
|
-
expect(notes.join(" ")).to.contain("outside the url");
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
describe("explainResponse — what was observed", () => {
|
|
103
|
-
it("should not claim a serving source for a url it did not watch", () => {
|
|
104
|
-
// The common case: asked about a url that is not the page in front of it.
|
|
105
|
-
// Reporting the current page's RUM against another url would be the exact
|
|
106
|
-
// confident wrong answer this tool exists to prevent.
|
|
107
|
-
const result = explainResponse({ url: URL_UNDER_TEST, rules: sets() });
|
|
108
|
-
expect(result.servedFrom).to.equal("unknown");
|
|
109
|
-
expect(result.notes.join(" ")).to.contain("not the page in front of");
|
|
110
|
-
});
|
|
111
|
-
it("should explain an origin-served page, and why its change detection is empty", () => {
|
|
112
|
-
const result = explainResponse({
|
|
113
|
-
url: URL_UNDER_TEST,
|
|
114
|
-
rules: sets(),
|
|
115
|
-
page: {
|
|
116
|
-
url: URL_UNDER_TEST.href,
|
|
117
|
-
responseSource: "Origin",
|
|
118
|
-
responseCause: "SwBooting",
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
expect(result.servedFrom).to.equal("origin");
|
|
122
|
-
expect(result.explanation).to.contain("SwBooting");
|
|
123
|
-
expect(result.notes.join(" ")).to.contain("dynamic fetcher never runs");
|
|
124
|
-
expect(result.notes.join(" ")).to.contain("not a broken config");
|
|
125
|
-
});
|
|
126
|
-
it("should call a cached serve what it is", () => {
|
|
127
|
-
const result = explainResponse({
|
|
128
|
-
url: URL_UNDER_TEST,
|
|
129
|
-
rules: sets(),
|
|
130
|
-
page: {
|
|
131
|
-
url: URL_UNDER_TEST.href,
|
|
132
|
-
responseSource: "SwCache",
|
|
133
|
-
responseCause: "Hit",
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
|
-
expect(result.servedFrom).to.equal("cache");
|
|
137
|
-
});
|
|
138
|
-
// F18. `servedFrom` used to be `responseSource === "Origin" ? "origin" :
|
|
139
|
-
// "cache"`, which made `cache` the answer for fourteen of Speed Kit's fifteen
|
|
140
|
-
// sources. A bfcached page that had originally come from the origin therefore
|
|
141
|
-
// read as cached, and skipped the whole origin branch of the explanation and
|
|
142
|
-
// its notes — the one place that says why change detection is empty.
|
|
143
|
-
describe("servedFrom across the response sources", () => {
|
|
144
|
-
const served = (responseSource, responseCause) => explainResponse({
|
|
145
|
-
url: URL_UNDER_TEST,
|
|
146
|
-
rules: sets(),
|
|
147
|
-
page: { url: URL_UNDER_TEST.href, responseSource, responseCause },
|
|
148
|
-
});
|
|
149
|
-
it("should read a bfcache hit as where the bytes first came from", () => {
|
|
150
|
-
const result = served("BfCache", "Origin");
|
|
151
|
-
expect(result.servedFrom).to.equal("origin");
|
|
152
|
-
expect(result.replayedFromBfCache).to.equal(true);
|
|
153
|
-
// The point of the fix: the origin branch has to fire for it.
|
|
154
|
-
expect(result.notes.join(" ")).to.contain("dynamic fetcher never runs");
|
|
155
|
-
expect(result.notes.join(" ")).to.contain("back/forward cache");
|
|
156
|
-
});
|
|
157
|
-
it("should read a bfcached asset-api hit as cached", () => {
|
|
158
|
-
const result = served("BfCache", "AssetAPI");
|
|
159
|
-
expect(result.servedFrom).to.equal("cache");
|
|
160
|
-
expect(result.replayedFromBfCache).to.equal(true);
|
|
161
|
-
});
|
|
162
|
-
it("should not guess when a bfcache hit names no cause", () => {
|
|
163
|
-
expect(served("BfCache").servedFrom).to.equal("unknown");
|
|
164
|
-
});
|
|
165
|
-
it("should call a generated response neither cached nor origin-served", () => {
|
|
166
|
-
const result = served("Generated", "ClientError-404");
|
|
167
|
-
expect(result.servedFrom).to.equal("generated");
|
|
168
|
-
expect(result.explanation).to.contain("generated this response itself");
|
|
169
|
-
// It never reached the origin, so the change-detection note would be a
|
|
170
|
-
// lie here — that note is only true of an origin-served page.
|
|
171
|
-
expect(result.notes.join(" ")).to.not.contain("dynamic fetcher never runs");
|
|
172
|
-
});
|
|
173
|
-
it("should recognise every source Speed Kit serves from as cached", () => {
|
|
174
|
-
for (const source of [
|
|
175
|
-
"AssetAPI",
|
|
176
|
-
"Shield",
|
|
177
|
-
"Storage",
|
|
178
|
-
"Edge",
|
|
179
|
-
"Collapsed",
|
|
180
|
-
"PendingAsset",
|
|
181
|
-
"Stream",
|
|
182
|
-
"MissingCachingHeader",
|
|
183
|
-
"SwCache",
|
|
184
|
-
"SDN",
|
|
185
|
-
"Prerender",
|
|
186
|
-
"Recompress",
|
|
187
|
-
]) {
|
|
188
|
-
expect(served(source).servedFrom, source).to.equal("cache");
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
// The default must not be `cache`. Speed Kit adds sources, and a build that
|
|
192
|
-
// does not know one should say so rather than pick the friendlier answer.
|
|
193
|
-
it("should refuse to classify a source it does not know", () => {
|
|
194
|
-
const result = served("SomethingNewInSpeedKit");
|
|
195
|
-
expect(result.servedFrom).to.equal("unknown");
|
|
196
|
-
expect(result.explanation).to.contain("does not recognise");
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
it("should say a body with no asset list breaks change detection", () => {
|
|
200
|
-
// The cached side of the comparison is not read from the DOM — the DH bakes
|
|
201
|
-
// it in. Without that call the comparison returns early, which reads
|
|
202
|
-
// exactly like "no changes" and is not the same thing.
|
|
203
|
-
const result = explainResponse({
|
|
204
|
-
url: URL_UNDER_TEST,
|
|
205
|
-
rules: sets(),
|
|
206
|
-
cache: {
|
|
207
|
-
key: "k",
|
|
208
|
-
status: 200,
|
|
209
|
-
variation: null,
|
|
210
|
-
contentType: "text/html",
|
|
211
|
-
bytes: 100,
|
|
212
|
-
assetList: false,
|
|
213
|
-
},
|
|
214
|
-
});
|
|
215
|
-
expect(result.notes.join(" ")).to.contain("setAssetList(");
|
|
216
|
-
expect(result.notes.join(" ")).to.contain("returns early");
|
|
217
|
-
});
|
|
218
|
-
it("should stay quiet about the asset list when it is there", () => {
|
|
219
|
-
const result = explainResponse({
|
|
220
|
-
url: URL_UNDER_TEST,
|
|
221
|
-
rules: sets(),
|
|
222
|
-
cache: {
|
|
223
|
-
key: "k",
|
|
224
|
-
status: 200,
|
|
225
|
-
variation: null,
|
|
226
|
-
contentType: "text/html",
|
|
227
|
-
bytes: 100,
|
|
228
|
-
assetList: true,
|
|
229
|
-
},
|
|
230
|
-
});
|
|
231
|
-
expect(result.notes.join(" ")).to.not.contain("setAssetList(");
|
|
232
|
-
});
|
|
233
|
-
it("should say plainly when nothing has been cached yet", () => {
|
|
234
|
-
const result = explainResponse({ url: URL_UNDER_TEST, rules: sets() });
|
|
235
|
-
expect(result.explanation).to.contain("Nothing has been cached");
|
|
236
|
-
});
|
|
237
|
-
it("should lead with the rule verdict even when the page was observed", () => {
|
|
238
|
-
// A url the rules exclude was always going to come from origin. Explaining
|
|
239
|
-
// it as an origin serve sends the reader to look at the origin.
|
|
240
|
-
const result = explainResponse({
|
|
241
|
-
url: URL_UNDER_TEST,
|
|
242
|
-
rules: sets({ blacklist: [rule("/checkout", "blacklist[0]")] }),
|
|
243
|
-
page: {
|
|
244
|
-
url: URL_UNDER_TEST.href,
|
|
245
|
-
responseSource: "Origin",
|
|
246
|
-
responseCause: "SwBooting",
|
|
247
|
-
},
|
|
248
|
-
});
|
|
249
|
-
expect(result.explanation).to.contain("does not handle this url");
|
|
250
|
-
expect(result.explanation).to.contain("blacklist[0]");
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
describe("explainResponse — judged as a navigation", () => {
|
|
254
|
-
// The runtime splits on the request kind: `Application.checkWhitelist`
|
|
255
|
-
// returns before `enabledSites` for anything that is not a navigate request,
|
|
256
|
-
// and `disabledSites` is gated the same way. Reading every set against every
|
|
257
|
-
// url answered "excluded by enabledSites" for a script the runtime excludes
|
|
258
|
-
// by `whitelist` — and, where the whitelist carries no content type, for one
|
|
259
|
-
// it accelerates.
|
|
260
|
-
it("should not count a rule restricted to another content type", () => {
|
|
261
|
-
// A whitelist of script rules leaves a navigation unwhitelisted, which is
|
|
262
|
-
// an exclusion: the runtime asks `whitelist.matches(request, contentType)`
|
|
263
|
-
// and a script rule does not match a document.
|
|
264
|
-
const { rules } = explainResponse({
|
|
265
|
-
url: URL_UNDER_TEST,
|
|
266
|
-
rules: sets({
|
|
267
|
-
whitelist: [
|
|
268
|
-
rule("www.shop.de", "whitelist[0]", "host", {
|
|
269
|
-
contentTypes: ["script"],
|
|
270
|
-
}),
|
|
271
|
-
],
|
|
272
|
-
}),
|
|
273
|
-
});
|
|
274
|
-
expect(rules.whitelist).to.deep.equal([]);
|
|
275
|
-
expect(rules.decision).to.equal("excluded");
|
|
276
|
-
expect(rules.decidedBy).to.equal("whitelist");
|
|
277
|
-
});
|
|
278
|
-
it("should count a rule restricted to navigations", () => {
|
|
279
|
-
const { rules } = explainResponse({
|
|
280
|
-
url: URL_UNDER_TEST,
|
|
281
|
-
rules: sets({
|
|
282
|
-
whitelist: [
|
|
283
|
-
rule("www.shop.de", "whitelist[0]", "host", {
|
|
284
|
-
contentTypes: ["navigate"],
|
|
285
|
-
}),
|
|
286
|
-
],
|
|
287
|
-
}),
|
|
288
|
-
});
|
|
289
|
-
expect(rules.whitelist).to.deep.equal(["whitelist[0]"]);
|
|
290
|
-
expect(rules.decision).to.equal("included");
|
|
291
|
-
});
|
|
292
|
-
it("should count a rule that names no content type at all", () => {
|
|
293
|
-
const { rules } = explainResponse({
|
|
294
|
-
url: URL_UNDER_TEST,
|
|
295
|
-
rules: sets({ whitelist: [rule("www.shop.de", "whitelist[0]", "host")] }),
|
|
296
|
-
});
|
|
297
|
-
expect(rules.whitelist).to.deep.equal(["whitelist[0]"]);
|
|
298
|
-
});
|
|
299
|
-
it("should state the assumption rather than leave a reader to supply it", () => {
|
|
300
|
-
const result = explainResponse({ url: URL_UNDER_TEST, rules: sets() });
|
|
301
|
-
expect(result.rules.appliesAs).to.equal("navigate");
|
|
302
|
-
expect(result.rules.navigationOnlySets).to.deep.equal([
|
|
303
|
-
"enabledSites",
|
|
304
|
-
"disabledSites",
|
|
305
|
-
]);
|
|
306
|
-
expect(result.notes.join(" ")).to.contain("Judged as a navigation");
|
|
307
|
-
});
|
|
308
|
-
it("should say so plainly when a navigation-only set decided", () => {
|
|
309
|
-
// The reader is one step from asking the same question about a script, and
|
|
310
|
-
// enabledSites would not exclude it.
|
|
311
|
-
const result = explainResponse({
|
|
312
|
-
url: URL_UNDER_TEST,
|
|
313
|
-
rules: sets({ enabledSites: [rule("/nothing", "enabledSites[0]")] }),
|
|
314
|
-
});
|
|
315
|
-
expect(result.rules.decidedBy).to.equal("enabledSites");
|
|
316
|
-
expect(result.notes.join(" ")).to.contain("pages only");
|
|
317
|
-
});
|
|
318
|
-
});
|
|
319
|
-
describe("hasAssetList", () => {
|
|
320
|
-
it("should find the documentHandler's baked-in call", () => {
|
|
321
|
-
expect(hasAssetList('<script>setAssetList(["a.js"])</script>')).to.equal(true);
|
|
322
|
-
expect(hasAssetList("<html><body>nothing</body></html>")).to.equal(false);
|
|
323
|
-
});
|
|
324
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { expect } from "chai";
|
|
2
|
-
import { describe, it } from "mocha";
|
|
3
|
-
import { NoPageError } from "../../control/browser-session.js";
|
|
4
|
-
import { readRum } from "../../control/rum.js";
|
|
5
|
-
/**
|
|
6
|
-
* A page that answers expressions by matching on what they mention.
|
|
7
|
-
*
|
|
8
|
-
* Crude on purpose: the thing under test is which expression gets sent and how
|
|
9
|
-
* its answer is reported, not Speed Kit's own behaviour.
|
|
10
|
-
*/
|
|
11
|
-
function page(answers) {
|
|
12
|
-
const sent = [];
|
|
13
|
-
return {
|
|
14
|
-
sent,
|
|
15
|
-
available: true,
|
|
16
|
-
url: () => answers.url ?? "https://shop.example.com/p",
|
|
17
|
-
async evaluate(expression) {
|
|
18
|
-
sent.push(expression);
|
|
19
|
-
if (expression.includes("present:")) {
|
|
20
|
-
return {
|
|
21
|
-
present: answers.present ?? true,
|
|
22
|
-
trackedData: answers.trackedData ?? true,
|
|
23
|
-
rumController: answers.rumController ?? true,
|
|
24
|
-
impression: answers.impression ?? true,
|
|
25
|
-
dataByKey: answers.dataByKey ?? true,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
if (expression.includes("sendCollapsed")) {
|
|
29
|
-
return (answers.flushable ?? true);
|
|
30
|
-
}
|
|
31
|
-
if (expression.includes("getDataByKey")) {
|
|
32
|
-
// The real snippet reads it off currentRumImpression, and returns a
|
|
33
|
-
// tagged result so a missing method is not mistaken for a missing value.
|
|
34
|
-
if (!expression.includes("currentRumImpression")) {
|
|
35
|
-
throw new Error("getDataByKey must be read from currentRumImpression, not the controller");
|
|
36
|
-
}
|
|
37
|
-
return { status: "ok", value: answers.byKey };
|
|
38
|
-
}
|
|
39
|
-
if (expression.includes("getPreviousRumImpression")) {
|
|
40
|
-
return (answers.previous ?? null);
|
|
41
|
-
}
|
|
42
|
-
return (answers.data ?? null);
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
describe("readRum", () => {
|
|
47
|
-
it("should report sent-only data as sent-only", async () => {
|
|
48
|
-
const result = await readRum(page({ data: { navigateId: "n1", ttfb: 12 } }), {});
|
|
49
|
-
// The flag is the point: without it "nothing was tracked" and "it has not
|
|
50
|
-
// been sent yet" look identical while meaning opposite things.
|
|
51
|
-
expect(result.flushed).to.equal(false);
|
|
52
|
-
expect(result.available).to.equal(true);
|
|
53
|
-
expect(result.keys).to.deep.equal(["navigateId", "ttfb"]);
|
|
54
|
-
});
|
|
55
|
-
it("should flush first when asked, and say that it did", async () => {
|
|
56
|
-
const target = page({ data: { navigateId: "n1" } });
|
|
57
|
-
const result = await readRum(target, { flush: true });
|
|
58
|
-
expect(result.flushed).to.equal(true);
|
|
59
|
-
expect(target.sent.some((sent) => sent.includes("sendCollapsed"))).to.equal(true);
|
|
60
|
-
});
|
|
61
|
-
it("should not flush for a single key, because that path already sees unsent", async () => {
|
|
62
|
-
const target = page({ byKey: ["a", "b"] });
|
|
63
|
-
const result = await readRum(target, { key: "customDimension" });
|
|
64
|
-
expect(result.value).to.deep.equal(["a", "b"]);
|
|
65
|
-
expect(result.mergesUnsent).to.equal(true);
|
|
66
|
-
expect(result.flushed).to.equal(false);
|
|
67
|
-
// Forcing a send would end the impression being measured.
|
|
68
|
-
expect(target.sent.some((sent) => sent.includes("sendCollapsed"))).to.equal(false);
|
|
69
|
-
});
|
|
70
|
-
it("should read getDataByKey off the impression, not the controller", async () => {
|
|
71
|
-
// It is a method of RumImpression. Reading it off rumController returns
|
|
72
|
-
// undefined on every build, and the old guard turned that into a bare null
|
|
73
|
-
// — so the tool answered "your dimension did not land" for every field,
|
|
74
|
-
// which is the worst answer it could possibly give.
|
|
75
|
-
const target = page({ byKey: "home" });
|
|
76
|
-
const result = await readRum(target, { key: "pageType" });
|
|
77
|
-
expect(result.value).to.equal("home");
|
|
78
|
-
expect(target.sent.some((sent) => sent.includes("currentRumImpression"))).to.equal(true);
|
|
79
|
-
});
|
|
80
|
-
it("should say the method is missing rather than call the value absent", async () => {
|
|
81
|
-
const result = await readRum(page({ dataByKey: false }), {
|
|
82
|
-
key: "pageType",
|
|
83
|
-
});
|
|
84
|
-
// The two were indistinguishable before — both came back as null.
|
|
85
|
-
expect(result.available).to.equal(false);
|
|
86
|
-
expect(result.reason).to.contain("no getDataByKey");
|
|
87
|
-
});
|
|
88
|
-
it("should say when there is no impression yet", async () => {
|
|
89
|
-
const result = await readRum(page({ impression: false }), {
|
|
90
|
-
key: "pageType",
|
|
91
|
-
});
|
|
92
|
-
expect(result.available).to.equal(false);
|
|
93
|
-
expect(result.reason).to.contain("no current page impression");
|
|
94
|
-
});
|
|
95
|
-
it("should read the previous impression, which on an SPA is the hard nav", async () => {
|
|
96
|
-
const result = await readRum(page({ previous: { navigateId: "n0" } }), {
|
|
97
|
-
previous: true,
|
|
98
|
-
});
|
|
99
|
-
expect(result.ofPreviousImpression).to.equal(true);
|
|
100
|
-
expect(result.data).to.deep.equal({ navigateId: "n0" });
|
|
101
|
-
});
|
|
102
|
-
it("should say there is no previous impression rather than fail", async () => {
|
|
103
|
-
const result = await readRum(page({ previous: null }), { previous: true });
|
|
104
|
-
expect(result.available).to.equal(true);
|
|
105
|
-
expect(result.data).to.equal(null);
|
|
106
|
-
});
|
|
107
|
-
it("should name the cause when Speed Kit is not on the page at all", async () => {
|
|
108
|
-
const result = await readRum(page({ present: false, trackedData: false }), {});
|
|
109
|
-
expect(result.available).to.equal(false);
|
|
110
|
-
expect(result.reason).to.contain("no window.SpeedKit");
|
|
111
|
-
});
|
|
112
|
-
it("should distinguish stripped globals from an absent Speed Kit", async () => {
|
|
113
|
-
// A customer whose own JS removes the globals after merge — a
|
|
114
|
-
// customer-specific anomaly, not anything general about SSR.
|
|
115
|
-
const result = await readRum(page({ present: true, trackedData: false }), {});
|
|
116
|
-
expect(result.available).to.equal(false);
|
|
117
|
-
expect(result.reason).to.contain("strips the globals");
|
|
118
|
-
});
|
|
119
|
-
it("should lead with booting rather than with a conclusion", async () => {
|
|
120
|
-
// The old wording opened "SpeedKit is not on this page" and hedged
|
|
121
|
-
// afterwards, so a reader mid-page-load was handed the conclusion first and
|
|
122
|
-
// the true cause second. A page still loading is the commonest case and the
|
|
123
|
-
// only one that resolves itself, so it goes first.
|
|
124
|
-
const absent = await readRum(page({ present: false, trackedData: false }), {});
|
|
125
|
-
const half = await readRum(page({ present: true, trackedData: false }), {});
|
|
126
|
-
for (const result of [absent, half]) {
|
|
127
|
-
const booting = result.reason.indexOf("booting");
|
|
128
|
-
expect(booting, result.reason).to.be.greaterThan(-1);
|
|
129
|
-
// Ahead of every other cause the same sentence offers.
|
|
130
|
-
for (const later of [
|
|
131
|
-
"served from origin",
|
|
132
|
-
"not be installed",
|
|
133
|
-
"older build",
|
|
134
|
-
"strips the globals",
|
|
135
|
-
]) {
|
|
136
|
-
const at = result.reason.indexOf(later);
|
|
137
|
-
if (at !== -1)
|
|
138
|
-
expect(at, `${later} in: ${result.reason}`).to.be.greaterThan(booting);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
it("should offer booting as a cause when the globals are half-built", async () => {
|
|
143
|
-
// `window.SpeedKit` up, `getTrackedData` not attached yet — ordinary a few
|
|
144
|
-
// hundred ms into a load. This branch used to offer only "an older build"
|
|
145
|
-
// and "the customer strips globals", both wrong and neither hedged.
|
|
146
|
-
const result = await readRum(page({ present: true, trackedData: false }), {});
|
|
147
|
-
expect(result.reason).to.contain("still be booting");
|
|
148
|
-
});
|
|
149
|
-
it("should report the probe's measurements, not only its inference", async () => {
|
|
150
|
-
// The probe reads five booleans and the reason can describe one. A caller
|
|
151
|
-
// telling "absent" from "half-built" should not have to parse prose.
|
|
152
|
-
const result = await readRum(page({
|
|
153
|
-
present: true,
|
|
154
|
-
trackedData: false,
|
|
155
|
-
rumController: true,
|
|
156
|
-
impression: false,
|
|
157
|
-
dataByKey: false,
|
|
158
|
-
}), {});
|
|
159
|
-
expect(result.globals).to.deep.equal({
|
|
160
|
-
present: true,
|
|
161
|
-
trackedData: false,
|
|
162
|
-
rumController: true,
|
|
163
|
-
impression: false,
|
|
164
|
-
dataByKey: false,
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
it("should report globals on a refusal that comes from the probe too", async () => {
|
|
168
|
-
const result = await readRum(page({ impression: false }), {
|
|
169
|
-
key: "pageType",
|
|
170
|
-
});
|
|
171
|
-
expect(result.available).to.equal(false);
|
|
172
|
-
expect(result.reason).to.contain("no current page impression");
|
|
173
|
-
expect(result.globals?.impression).to.equal(false);
|
|
174
|
-
expect(result.globals?.present).to.equal(true);
|
|
175
|
-
});
|
|
176
|
-
it("should return only the keys asked for", async () => {
|
|
177
|
-
const result = await readRum(page({ data: { a: 1, b: 2, c: 3 } }), {
|
|
178
|
-
keys: ["a", "c"],
|
|
179
|
-
});
|
|
180
|
-
expect(result.data).to.deep.equal({ a: 1, c: 3 });
|
|
181
|
-
expect(result.notTracked).to.equal(undefined);
|
|
182
|
-
});
|
|
183
|
-
it("should answer null for a key that is not there, and name it", async () => {
|
|
184
|
-
// This assertion used to read `{ a: 1, c: 3 }` for a request that also
|
|
185
|
-
// asked for `missing`: six keys in, five out, nothing said about the
|
|
186
|
-
// sixth. Three test sessions reported it and none could tell from the
|
|
187
|
-
// payload alone which key had gone.
|
|
188
|
-
const result = await readRum(page({ data: { a: 1, b: 2, c: 3 } }), {
|
|
189
|
-
keys: ["a", "c", "missing"],
|
|
190
|
-
});
|
|
191
|
-
expect(result.data).to.deep.equal({ a: 1, c: 3, missing: null });
|
|
192
|
-
expect(result.notTracked).to.deep.equal(["missing"]);
|
|
193
|
-
});
|
|
194
|
-
it("should keep the order the caller asked in", async () => {
|
|
195
|
-
const result = await readRum(page({ data: { a: 1, b: 2, c: 3 } }), {
|
|
196
|
-
keys: ["c", "nope", "a"],
|
|
197
|
-
});
|
|
198
|
-
expect(Object.keys(result.data ?? {})).to.deep.equal(["c", "nope", "a"]);
|
|
199
|
-
});
|
|
200
|
-
it("should say nothing about tracking when no keys were asked for", async () => {
|
|
201
|
-
const result = await readRum(page({ data: { a: 1 } }), {});
|
|
202
|
-
expect(result.data).to.deep.equal({ a: 1 });
|
|
203
|
-
expect(result.notTracked).to.equal(undefined);
|
|
204
|
-
});
|
|
205
|
-
it("should let a no-page error through as itself", async () => {
|
|
206
|
-
const dead = {
|
|
207
|
-
available: false,
|
|
208
|
-
url: () => null,
|
|
209
|
-
evaluate: () => {
|
|
210
|
-
throw new NoPageError();
|
|
211
|
-
},
|
|
212
|
-
};
|
|
213
|
-
let thrown;
|
|
214
|
-
try {
|
|
215
|
-
await readRum(dead, {});
|
|
216
|
-
}
|
|
217
|
-
catch (error) {
|
|
218
|
-
thrown = error;
|
|
219
|
-
}
|
|
220
|
-
expect(thrown).to.be.instanceOf(NoPageError);
|
|
221
|
-
});
|
|
222
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|