slnodejs 6.1.415 → 6.1.429
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/browser-agent/dist/browser-agent-all.js +1 -1
- package/browser-agent/dist/browser-agent-all.min.js +1 -1
- package/browser-agent/package.json +1 -1
- package/package.json +2 -2
- package/tsOutputs/api.js +32 -86
- package/tsOutputs/build-scanner/ast-utils.js +11 -11
- package/tsOutputs/build-scanner/ast-utils.js.map +1 -1
- package/tsOutputs/build-scanner/build-diff-process.js +35 -16
- package/tsOutputs/build-scanner/build-diff-process.js.map +1 -1
- package/tsOutputs/build-scanner/cia.js +2 -2
- package/tsOutputs/build-scanner/cia.js.map +1 -1
- package/tsOutputs/build-scanner/default-values-resolver.js +5 -7
- package/tsOutputs/build-scanner/default-values-resolver.js.map +1 -1
- package/tsOutputs/build-scanner/diagnostic/build-scan-diagnosis.js +101 -159
- package/tsOutputs/build-scanner/diagnostic/build-scan-diagnosis.js.map +1 -1
- package/tsOutputs/build-scanner/diagnostic/none-diagnosis.js +23 -55
- package/tsOutputs/build-scanner/diagnostic/none-diagnosis.js.map +1 -1
- package/tsOutputs/build-scanner/file-and-folder-utils.js +3 -3
- package/tsOutputs/build-scanner/file-and-folder-utils.js.map +1 -1
- package/tsOutputs/build-scanner/file-system/actual-file.js +3 -3
- package/tsOutputs/build-scanner/file-system/actual-file.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js +56 -60
- package/tsOutputs/build-scanner/instrumentation/browser-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/content-instrumenter.js +9 -10
- package/tsOutputs/build-scanner/instrumentation/content-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/files-instrumenter.js +80 -124
- package/tsOutputs/build-scanner/instrumentation/files-instrumenter.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/instrumentation-utils.js +3 -3
- package/tsOutputs/build-scanner/instrumentation/instrumentation-utils.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/instrumented-file-size-reducer.js +4 -4
- package/tsOutputs/build-scanner/instrumentation/instrumented-file-size-reducer.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/instrumenter-spawn.js +15 -50
- package/tsOutputs/build-scanner/instrumentation/process-pool/instrumenter-spawn.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js +84 -141
- package/tsOutputs/build-scanner/instrumentation/process-pool/process-pool.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/split-by-transform-stream.js +15 -34
- package/tsOutputs/build-scanner/instrumentation/process-pool/split-by-transform-stream.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/process-pool/stop-by-condition-transform-stream.js +9 -27
- package/tsOutputs/build-scanner/instrumentation/process-pool/stop-by-condition-transform-stream.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/copy-as-is-strategy.js +8 -10
- package/tsOutputs/build-scanner/instrumentation/strategies/copy-as-is-strategy.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/js-instrumnetation-strategy.js +22 -54
- package/tsOutputs/build-scanner/instrumentation/strategies/js-instrumnetation-strategy.js.map +1 -1
- package/tsOutputs/build-scanner/instrumentation/strategies/markup-instrumnetation-strategy.js +55 -107
- package/tsOutputs/build-scanner/instrumentation/strategies/markup-instrumnetation-strategy.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/file-signature.js +5 -6
- package/tsOutputs/build-scanner/js_diff/file-signature.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/files-mapping.js +6 -6
- package/tsOutputs/build-scanner/js_diff/files-mapping.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/generated-file-signature.js +3 -3
- package/tsOutputs/build-scanner/js_diff/generated-file-signature.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/guess-method-location.js +26 -27
- package/tsOutputs/build-scanner/js_diff/guess-method-location.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/method-signature.js +1 -1
- package/tsOutputs/build-scanner/js_diff/method-signature.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/sl-mapper.js +28 -79
- package/tsOutputs/build-scanner/js_diff/sl-mapper.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/source-data-enricher.js +3 -2
- package/tsOutputs/build-scanner/js_diff/source-data-enricher.js.map +1 -1
- package/tsOutputs/build-scanner/js_diff/source-files-notifier.js +1 -1
- package/tsOutputs/build-scanner/js_diff/source-files-notifier.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js +76 -149
- package/tsOutputs/build-scanner/mappings/ensure-files-handler.service.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/file-element-utils.js +9 -9
- package/tsOutputs/build-scanner/mappings/file-element-utils.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/file-enricher.js +71 -100
- package/tsOutputs/build-scanner/mappings/file-enricher.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/file-path-fixer.js +106 -0
- package/tsOutputs/build-scanner/mappings/file-path-fixer.js.map +1 -0
- package/tsOutputs/build-scanner/mappings/files-container.js +89 -0
- package/tsOutputs/build-scanner/mappings/files-container.js.map +1 -0
- package/tsOutputs/build-scanner/mappings/files-data-container.js +18 -23
- package/tsOutputs/build-scanner/mappings/files-data-container.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/source-path-mapper.js +15 -45
- package/tsOutputs/build-scanner/mappings/source-path-mapper.js.map +1 -1
- package/tsOutputs/build-scanner/markup-files-parser.js +1 -1
- package/tsOutputs/build-scanner/markup-files-parser.js.map +1 -1
- package/tsOutputs/build-scanner/scm/scm-file-fixer.js +27 -0
- package/tsOutputs/build-scanner/scm/scm-file-fixer.js.map +1 -0
- package/tsOutputs/build-scanner/scm/scm-files-container.js +9 -45
- package/tsOutputs/build-scanner/scm/scm-files-container.js.map +1 -1
- package/tsOutputs/build-scanner/sl-config-cia-cli.js +1 -1
- package/tsOutputs/build-scanner/sl-config-cia-cli.js.map +1 -1
- package/tsOutputs/build-scanner/utils.js +5 -5
- package/tsOutputs/build-scanner/utils.js.map +1 -1
- package/tsOutputs/cli-parse/agent-instance-data.js +2 -2
- package/tsOutputs/cli-parse/agent-instance-data.js.map +1 -1
- package/tsOutputs/cli-parse/child-process-wrapper.js +26 -60
- package/tsOutputs/cli-parse/child-process-wrapper.js.map +1 -1
- package/tsOutputs/cli-parse/cli.js +72 -191
- package/tsOutputs/cli-parse/cli.js.map +1 -1
- package/tsOutputs/cli-parse/constants/constants.js +9 -9
- package/tsOutputs/cli-parse/constants/constants.js.map +1 -1
- package/tsOutputs/cli-parse/custom-commander.js +17 -18
- package/tsOutputs/cli-parse/custom-commander.js.map +1 -1
- package/tsOutputs/cli-parse/executors/base-executor.js +121 -236
- package/tsOutputs/cli-parse/executors/base-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/build-args-dto.js +10 -11
- package/tsOutputs/cli-parse/executors/build-args-dto.js.map +1 -1
- package/tsOutputs/cli-parse/executors/build-end-executor.js +34 -92
- package/tsOutputs/cli-parse/executors/build-end-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/build-executor.js +64 -133
- package/tsOutputs/cli-parse/executors/build-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/config-executor.js +35 -92
- package/tsOutputs/cli-parse/executors/config-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/base-data.js +29 -39
- package/tsOutputs/cli-parse/executors/dry-run/base-data.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/build-mapping-data.js +92 -177
- package/tsOutputs/cli-parse/executors/dry-run/build-mapping-data.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js +110 -194
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-validation.js +49 -83
- package/tsOutputs/cli-parse/executors/dry-run/dry-run-validation.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js +55 -113
- package/tsOutputs/cli-parse/executors/dry-run/footprints-data.js.map +1 -1
- package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js +24 -25
- package/tsOutputs/cli-parse/executors/dry-run/helper-methods.js.map +1 -1
- package/tsOutputs/cli-parse/executors/end-execution-executor.js +16 -64
- package/tsOutputs/cli-parse/executors/end-execution-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/integration-build-components-executor.js +29 -82
- package/tsOutputs/cli-parse/executors/integration-build-components-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/integration-build-delete-components-executor.js +12 -59
- package/tsOutputs/cli-parse/executors/integration-build-delete-components-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/integration-build-update-components-executor.js +9 -58
- package/tsOutputs/cli-parse/executors/integration-build-update-components-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/mocha-executor.js +41 -101
- package/tsOutputs/cli-parse/executors/mocha-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/nyc-report-executor.js +24 -83
- package/tsOutputs/cli-parse/executors/nyc-report-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/pr-config-executor.js +15 -63
- package/tsOutputs/cli-parse/executors/pr-config-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/run-executor.js +23 -75
- package/tsOutputs/cli-parse/executors/run-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/start-execution-executor.js +16 -64
- package/tsOutputs/cli-parse/executors/start-execution-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/test-executions-executor.js +9 -63
- package/tsOutputs/cli-parse/executors/test-executions-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/test-listener-executor.js +47 -117
- package/tsOutputs/cli-parse/executors/test-listener-executor.js.map +1 -1
- package/tsOutputs/cli-parse/executors/upload-report-executor.js +23 -71
- package/tsOutputs/cli-parse/executors/upload-report-executor.js.map +1 -1
- package/tsOutputs/cli-parse/utils.js +10 -10
- package/tsOutputs/cli-parse/utils.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-events-controller.js +146 -251
- package/tsOutputs/common/agent-events/agent-events-controller.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-events-guard.js +12 -15
- package/tsOutputs/common/agent-events/agent-events-guard.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-instance-info-builder.js +22 -24
- package/tsOutputs/common/agent-events/agent-instance-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/agent-start-info-builder.js +7 -8
- package/tsOutputs/common/agent-events/agent-start-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/browser-info-builder.js +9 -10
- package/tsOutputs/common/agent-events/browser-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/ci-info-builder.js +12 -13
- package/tsOutputs/common/agent-events/ci-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/cockpit-notifier.js +38 -87
- package/tsOutputs/common/agent-events/cockpit-notifier.js.map +1 -1
- package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js +10 -27
- package/tsOutputs/common/agent-events/dry-run-agent-events-controller.js.map +1 -1
- package/tsOutputs/common/agent-events/machine-info-builder.js +21 -22
- package/tsOutputs/common/agent-events/machine-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/no-op-agent-events-controller.js +30 -84
- package/tsOutputs/common/agent-events/no-op-agent-events-controller.js.map +1 -1
- package/tsOutputs/common/agent-events/nodejs-env-info-builder.js +7 -8
- package/tsOutputs/common/agent-events/nodejs-env-info-builder.js.map +1 -1
- package/tsOutputs/common/agent-events/sensitive-data-filter.js +3 -4
- package/tsOutputs/common/agent-events/sensitive-data-filter.js.map +1 -1
- package/tsOutputs/common/agent-instance-data.js +23 -28
- package/tsOutputs/common/agent-instance-data.js.map +1 -1
- package/tsOutputs/common/cli-progress.js +16 -19
- package/tsOutputs/common/cli-progress.js.map +1 -1
- package/tsOutputs/common/config-process/config-loader.js +23 -24
- package/tsOutputs/common/config-process/config-loader.js.map +1 -1
- package/tsOutputs/common/config-process/config-system.js +104 -131
- package/tsOutputs/common/config-process/config-system.js.map +1 -1
- package/tsOutputs/common/config-process/config.js +52 -73
- package/tsOutputs/common/config-process/config.js.map +1 -1
- package/tsOutputs/common/config-process/index.js +38 -57
- package/tsOutputs/common/config-process/index.js.map +1 -1
- package/tsOutputs/common/config-process/no-op-config-process.js +9 -29
- package/tsOutputs/common/config-process/no-op-config-process.js.map +1 -1
- package/tsOutputs/common/constants/constants.js +19 -25
- package/tsOutputs/common/constants/constants.js.map +1 -1
- package/tsOutputs/common/constants/sl-env-vars.js +125 -131
- package/tsOutputs/common/constants/sl-env-vars.js.map +1 -1
- package/tsOutputs/common/coverage-elements/file-element.js +66 -103
- package/tsOutputs/common/coverage-elements/file-element.js.map +1 -1
- package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js +28 -47
- package/tsOutputs/common/coverage-elements/istanbul-unique-id-converter.js.map +1 -1
- package/tsOutputs/common/coverage-elements/new-id-resolver.js +17 -17
- package/tsOutputs/common/coverage-elements/new-id-resolver.js.map +1 -1
- package/tsOutputs/common/coverage-elements/original-module-loader.js +71 -79
- package/tsOutputs/common/coverage-elements/original-module-loader.js.map +1 -1
- package/tsOutputs/common/coverage-elements/unique-id-converter.js +90 -110
- package/tsOutputs/common/coverage-elements/unique-id-converter.js.map +1 -1
- package/tsOutputs/common/environment-data-service.js +10 -11
- package/tsOutputs/common/environment-data-service.js.map +1 -1
- package/tsOutputs/common/events-process/events-creator.js +20 -32
- package/tsOutputs/common/events-process/events-creator.js.map +1 -1
- package/tsOutputs/common/events-process/index.js +97 -186
- package/tsOutputs/common/events-process/index.js.map +1 -1
- package/tsOutputs/common/footprints-process/collection-interval.js +10 -11
- package/tsOutputs/common/footprints-process/collection-interval.js.map +1 -1
- package/tsOutputs/common/footprints-process/footprints-service-proxy.js +21 -22
- package/tsOutputs/common/footprints-process/footprints-service-proxy.js.map +1 -1
- package/tsOutputs/common/footprints-process/index.js +68 -102
- package/tsOutputs/common/footprints-process/index.js.map +1 -1
- package/tsOutputs/common/footprints-process/istanbul-to-footprints-contract.js +2 -5
- package/tsOutputs/common/footprints-process/istanbul-to-footprints-contract.js.map +1 -1
- package/tsOutputs/common/footprints-process/istanbul-to-footprints.js +160 -162
- package/tsOutputs/common/footprints-process/istanbul-to-footprints.js.map +1 -1
- package/tsOutputs/common/footprints-process/production-footprints-handler.js +103 -156
- package/tsOutputs/common/footprints-process/production-footprints-handler.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js +30 -48
- package/tsOutputs/common/footprints-process-v6/base-browser-hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/browser-footprints-buffer.js +7 -25
- package/tsOutputs/common/footprints-process-v6/browser-footprints-buffer.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js +13 -14
- package/tsOutputs/common/footprints-process-v6/buffer-size-helper.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js +14 -32
- package/tsOutputs/common/footprints-process-v6/collector-footprints-buffer.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/collector-footprints-process.js +43 -109
- package/tsOutputs/common/footprints-process-v6/collector-footprints-process.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/contracts.js +2 -5
- package/tsOutputs/common/footprints-process-v6/contracts.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/footprints-buffer.js +55 -78
- package/tsOutputs/common/footprints-process-v6/footprints-buffer.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/hits-collector.js +89 -129
- package/tsOutputs/common/footprints-process-v6/hits-collector.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/hits-converter.js +70 -78
- package/tsOutputs/common/footprints-process-v6/hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/index.js +204 -347
- package/tsOutputs/common/footprints-process-v6/index.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/location-formatter.js +2 -2
- package/tsOutputs/common/footprints-process-v6/location-formatter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/relative-path-resolver.js +10 -11
- package/tsOutputs/common/footprints-process-v6/relative-path-resolver.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-browser-hits-converter.js +5 -25
- package/tsOutputs/common/footprints-process-v6/remote-browser-hits-converter.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js +6 -57
- package/tsOutputs/common/footprints-process-v6/remote-footprints-process.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/remote-hits-collector.js +7 -27
- package/tsOutputs/common/footprints-process-v6/remote-hits-collector.js.map +1 -1
- package/tsOutputs/common/footprints-process-v6/source-map-data.js +14 -15
- package/tsOutputs/common/footprints-process-v6/source-map-data.js.map +1 -1
- package/tsOutputs/common/http/backend-proxy.js +222 -321
- package/tsOutputs/common/http/backend-proxy.js.map +1 -1
- package/tsOutputs/common/http/contracts.js +40 -116
- package/tsOutputs/common/http/contracts.js.map +1 -1
- package/tsOutputs/common/http/dry-run-proxy.js +68 -111
- package/tsOutputs/common/http/dry-run-proxy.js.map +1 -1
- package/tsOutputs/common/http/entities-mapper.js +6 -9
- package/tsOutputs/common/http/entities-mapper.js.map +1 -1
- package/tsOutputs/common/http/http-client.js +76 -86
- package/tsOutputs/common/http/http-client.js.map +1 -1
- package/tsOutputs/common/http/sl-routes.js +119 -122
- package/tsOutputs/common/http/sl-routes.js.map +1 -1
- package/tsOutputs/common/ignored-files-handler.js +48 -49
- package/tsOutputs/common/ignored-files-handler.js.map +1 -1
- package/tsOutputs/common/logger.js +66 -88
- package/tsOutputs/common/logger.js.map +1 -1
- package/tsOutputs/common/messages-formatter.js +9 -14
- package/tsOutputs/common/messages-formatter.js.map +1 -1
- package/tsOutputs/common/no-op-state-tracker.js +14 -37
- package/tsOutputs/common/no-op-state-tracker.js.map +1 -1
- package/tsOutputs/common/queue.js +18 -36
- package/tsOutputs/common/queue.js.map +1 -1
- package/tsOutputs/common/scm/git-cloner.js +30 -94
- package/tsOutputs/common/scm/git-cloner.js.map +1 -1
- package/tsOutputs/common/scm/git-format-builder.js +24 -25
- package/tsOutputs/common/scm/git-format-builder.js.map +1 -1
- package/tsOutputs/common/scm/git.js +192 -327
- package/tsOutputs/common/scm/git.js.map +1 -1
- package/tsOutputs/common/scm/none.js +58 -110
- package/tsOutputs/common/scm/none.js.map +1 -1
- package/tsOutputs/common/scm/scm-factory.js +6 -9
- package/tsOutputs/common/scm/scm-factory.js.map +1 -1
- package/tsOutputs/common/short-name-to-file-mapper.js +30 -33
- package/tsOutputs/common/short-name-to-file-mapper.js.map +1 -1
- package/tsOutputs/common/source-map-handler.js +76 -98
- package/tsOutputs/common/source-map-handler.js.map +1 -1
- package/tsOutputs/common/source-map-reader.js +35 -36
- package/tsOutputs/common/source-map-reader.js.map +1 -1
- package/tsOutputs/common/source-maps-utils.js +8 -11
- package/tsOutputs/common/source-maps-utils.js.map +1 -1
- package/tsOutputs/common/state-tracker-fpv6.js +15 -37
- package/tsOutputs/common/state-tracker-fpv6.js.map +1 -1
- package/tsOutputs/common/state-tracker.js +124 -212
- package/tsOutputs/common/state-tracker.js.map +1 -1
- package/tsOutputs/common/system-date.js +3 -3
- package/tsOutputs/common/system-date.js.map +1 -1
- package/tsOutputs/common/utils/abstract-data-builder.js +8 -9
- package/tsOutputs/common/utils/abstract-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/build-session-data-builder.js +25 -79
- package/tsOutputs/common/utils/build-session-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/dependency-utils.js +13 -16
- package/tsOutputs/common/utils/dependency-utils.js.map +1 -1
- package/tsOutputs/common/utils/env-var-parsing.js +10 -14
- package/tsOutputs/common/utils/env-var-parsing.js.map +1 -1
- package/tsOutputs/common/utils/files-utils.js +16 -19
- package/tsOutputs/common/utils/files-utils.js.map +1 -1
- package/tsOutputs/common/utils/process-utils.js +12 -25
- package/tsOutputs/common/utils/process-utils.js.map +1 -1
- package/tsOutputs/common/utils/test-runner-build-session-data-builder.js +16 -62
- package/tsOutputs/common/utils/test-runner-build-session-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/test-utils/mock-server-utils/mock-server-proxy.js +120 -192
- package/tsOutputs/common/utils/test-utils/mock-server-utils/mock-server-proxy.js.map +1 -1
- package/tsOutputs/common/utils/timer-utils.js +4 -7
- package/tsOutputs/common/utils/timer-utils.js.map +1 -1
- package/tsOutputs/common/utils/token-data-builder.js +30 -50
- package/tsOutputs/common/utils/token-data-builder.js.map +1 -1
- package/tsOutputs/common/utils/validation-utils.js +7 -10
- package/tsOutputs/common/utils/validation-utils.js.map +1 -1
- package/tsOutputs/common/uuid.js +7 -10
- package/tsOutputs/common/uuid.js.map +1 -1
- package/tsOutputs/common/v8-utils.js +12 -50
- package/tsOutputs/common/v8-utils.js.map +1 -1
- package/tsOutputs/common/watchdog.js +35 -56
- package/tsOutputs/common/watchdog.js.map +1 -1
- package/tsOutputs/mocha-reporter/index.js +12 -12
- package/tsOutputs/mocha-reporter/index.js.map +1 -1
- package/tsOutputs/mocha-reporter/otel-agent.js +47 -118
- package/tsOutputs/mocha-reporter/otel-agent.js.map +1 -1
- package/tsOutputs/test-listener/SlNodeJsProxy.js +34 -35
- package/tsOutputs/test-listener/SlNodeJsProxy.js.map +1 -1
- package/tsOutputs/test-listener/UserMessageHelper.js +14 -19
- package/tsOutputs/test-listener/UserMessageHelper.js.map +1 -1
- package/tsOutputs/test-listener/agent-loader.js +42 -59
- package/tsOutputs/test-listener/agent-loader.js.map +1 -1
- package/tsOutputs/test-listener/agent.js +93 -150
- package/tsOutputs/test-listener/agent.js.map +1 -1
- package/tsOutputs/test-listener/api.js +36 -70
- package/tsOutputs/test-listener/api.js.map +1 -1
- package/tsOutputs/test-listener/base-proxy.js +25 -27
- package/tsOutputs/test-listener/base-proxy.js.map +1 -1
- package/tsOutputs/test-listener/bootstrap.js +6 -6
- package/tsOutputs/test-listener/bootstrap.js.map +1 -1
- package/tsOutputs/test-listener/child-process-patcher.js +10 -10
- package/tsOutputs/test-listener/child-process-patcher.js.map +1 -1
- package/tsOutputs/test-listener/cli.js +27 -30
- package/tsOutputs/test-listener/cli.js.map +1 -1
- package/tsOutputs/test-listener/coloring/http-coloring.js +30 -33
- package/tsOutputs/test-listener/coloring/http-coloring.js.map +1 -1
- package/tsOutputs/test-listener/coloring/listening-port.js +14 -17
- package/tsOutputs/test-listener/coloring/listening-port.js.map +1 -1
- package/tsOutputs/test-listener/command-line-arg-parser.js +12 -15
- package/tsOutputs/test-listener/command-line-arg-parser.js.map +1 -1
- package/tsOutputs/test-listener/config-process/config-loader.js +21 -22
- package/tsOutputs/test-listener/config-process/config-loader.js.map +1 -1
- package/tsOutputs/test-listener/config-process/config-system.js +100 -127
- package/tsOutputs/test-listener/config-process/config-system.js.map +1 -1
- package/tsOutputs/test-listener/config-process/index.js +38 -57
- package/tsOutputs/test-listener/config-process/index.js.map +1 -1
- package/tsOutputs/test-listener/config.js +38 -59
- package/tsOutputs/test-listener/config.js.map +1 -1
- package/tsOutputs/test-listener/entities/BasicConfigurationData.js +37 -64
- package/tsOutputs/test-listener/entities/BasicConfigurationData.js.map +1 -1
- package/tsOutputs/test-listener/entities/build-scanner/ConfigModeData.js +17 -42
- package/tsOutputs/test-listener/entities/build-scanner/ConfigModeData.js.map +1 -1
- package/tsOutputs/test-listener/entities/build-scanner/ScanModeData.js +19 -45
- package/tsOutputs/test-listener/entities/build-scanner/ScanModeData.js.map +1 -1
- package/tsOutputs/test-listener/environment-data-service.js +10 -11
- package/tsOutputs/test-listener/environment-data-service.js.map +1 -1
- package/tsOutputs/test-listener/execution-process/entities-mapper.js +11 -14
- package/tsOutputs/test-listener/execution-process/entities-mapper.js.map +1 -1
- package/tsOutputs/test-listener/execution-process/execution-service-proxy.js +54 -72
- package/tsOutputs/test-listener/execution-process/execution-service-proxy.js.map +1 -1
- package/tsOutputs/test-listener/execution-process/index.js +26 -26
- package/tsOutputs/test-listener/execution-process/index.js.map +1 -1
- package/tsOutputs/test-listener/factory.js +140 -175
- package/tsOutputs/test-listener/factory.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/footprints-service-proxy.js +17 -34
- package/tsOutputs/test-listener/footprints-process/footprints-service-proxy.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/index.js +53 -58
- package/tsOutputs/test-listener/footprints-process/index.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-base.js +49 -50
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-base.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-v3.js +98 -117
- package/tsOutputs/test-listener/footprints-process/istanbul-to-footprints-v3.js.map +1 -1
- package/tsOutputs/test-listener/footprints-process/ts-node-hits-collector.js +57 -141
- package/tsOutputs/test-listener/footprints-process/ts-node-hits-collector.js.map +1 -1
- package/tsOutputs/test-listener/integrations/SlGulp.js +25 -26
- package/tsOutputs/test-listener/integrations/SlGulp.js.map +1 -1
- package/tsOutputs/test-listener/logs-process/index.js +30 -35
- package/tsOutputs/test-listener/logs-process/index.js.map +1 -1
- package/tsOutputs/test-listener/logs-process/log-service-proxy.js +8 -25
- package/tsOutputs/test-listener/logs-process/log-service-proxy.js.map +1 -1
- package/tsOutputs/test-listener/nyc-report-executor-fpv6.js +53 -110
- package/tsOutputs/test-listener/nyc-report-executor-fpv6.js.map +1 -1
- package/tsOutputs/test-listener/nyc-report-executor.js +48 -85
- package/tsOutputs/test-listener/nyc-report-executor.js.map +1 -1
- package/tsOutputs/test-listener/otel-agent-loader.js +30 -33
- package/tsOutputs/test-listener/otel-agent-loader.js.map +1 -1
- package/tsOutputs/test-listener/queue.js +18 -36
- package/tsOutputs/test-listener/queue.js.map +1 -1
- package/tsOutputs/test-listener/remote-agent.js +97 -223
- package/tsOutputs/test-listener/remote-agent.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/AppNameResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/AppNameResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/ArgumentResolver.js +11 -12
- package/tsOutputs/test-listener/resolvers/ArgumentResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/BuildResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildSessionIdFileResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/BuildSessionIdFileResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/BuildSessionIdResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/BuildSessionIdResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/ProxyResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/ProxyResolver.js.map +1 -1
- package/tsOutputs/test-listener/resolvers/TokenResolver.js +8 -25
- package/tsOutputs/test-listener/resolvers/TokenResolver.js.map +1 -1
- package/tsOutputs/test-listener/state-tracker-process/index.js +54 -74
- package/tsOutputs/test-listener/state-tracker-process/index.js.map +1 -1
- package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js +18 -37
- package/tsOutputs/test-listener/state-tracker-process/state-tracker-proxy.js.map +1 -1
- package/tsOutputs/test-listener/test-recommendation-handler.js +66 -109
- package/tsOutputs/test-listener/test-recommendation-handler.js.map +1 -1
- package/tsOutputs/test-listener/upload-report-handler.js +33 -35
- package/tsOutputs/test-listener/upload-report-handler.js.map +1 -1
- package/tsOutputs/test-listener/utils.js +13 -14
- package/tsOutputs/test-listener/utils.js.map +1 -1
- package/tsOutputs/test-listener/uuid.js +7 -10
- package/tsOutputs/test-listener/uuid.js.map +1 -1
- package/tsOutputs/test-listener/wait-for-multiple-callbacks.js +17 -19
- package/tsOutputs/test-listener/wait-for-multiple-callbacks.js.map +1 -1
- package/tsOutputs/test-listener/watchdog.js +32 -51
- package/tsOutputs/test-listener/watchdog.js.map +1 -1
- package/tsOutputs/build-scanner/mappings/scm-file-fixer.js +0 -96
- package/tsOutputs/build-scanner/mappings/scm-file-fixer.js.map +0 -1
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -19,57 +8,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
19
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
9
|
});
|
|
21
10
|
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
50
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
51
|
-
if (ar || !(i in from)) {
|
|
52
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
53
|
-
ar[i] = from[i];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
57
|
-
};
|
|
58
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
12
|
exports.AgentEventsController = void 0;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
13
|
+
const agent_events_contracts_1 = require("./agent-events-contracts");
|
|
14
|
+
const agent_instance_info_builder_1 = require("./agent-instance-info-builder");
|
|
15
|
+
const machine_info_builder_1 = require("./machine-info-builder");
|
|
16
|
+
const nodejs_env_info_builder_1 = require("./nodejs-env-info-builder");
|
|
17
|
+
const agent_start_info_builder_1 = require("./agent-start-info-builder");
|
|
18
|
+
const ci_info_builder_1 = require("./ci-info-builder");
|
|
19
|
+
const backend_proxy_1 = require("../http/backend-proxy");
|
|
20
|
+
const validation_utils_1 = require("../utils/validation-utils");
|
|
21
|
+
const watchdog_1 = require("../watchdog");
|
|
22
|
+
const system_date_1 = require("../system-date");
|
|
23
|
+
const browser_info_builder_1 = require("./browser-info-builder");
|
|
24
|
+
class AgentEventsController {
|
|
25
|
+
constructor(agentConfig, agentInstanceData, logger, backendProxy, tool, tags) {
|
|
73
26
|
this.active = false;
|
|
74
27
|
validation_utils_1.ValidationUtils.verifyNotNullOrEmpty(agentConfig, 'agentConfig');
|
|
75
28
|
validation_utils_1.ValidationUtils.verifyNotNullOrEmpty(agentInstanceData, 'agentInstanceData');
|
|
@@ -84,242 +37,184 @@ var AgentEventsController = /** @class */ (function () {
|
|
|
84
37
|
this.initWatchdog();
|
|
85
38
|
this.submittedEventsMap = new Map();
|
|
86
39
|
}
|
|
87
|
-
|
|
88
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (this.startRequestStatus !== StartRequestStatus.SUCCEED) {
|
|
101
|
-
this._logger.info('Agent start event failed to submit - ping events will not be sent');
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
this._pingWatchdog.start();
|
|
105
|
-
}
|
|
106
|
-
return [2 /*return*/];
|
|
107
|
-
}
|
|
108
|
-
});
|
|
40
|
+
submitAgentStartedEvent(packageJsonFile) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
this.active = true;
|
|
43
|
+
this.startRequestStatus = StartRequestStatus.PENDING;
|
|
44
|
+
const event = this.buildAgentStartEvent(packageJsonFile || {});
|
|
45
|
+
const result = yield this.submitAgentEventRequest(event);
|
|
46
|
+
this.startRequestStatus = result ? StartRequestStatus.SUCCEED : StartRequestStatus.FAILED;
|
|
47
|
+
if (this.startRequestStatus !== StartRequestStatus.SUCCEED) {
|
|
48
|
+
this._logger.info('Agent start event failed to submit - ping events will not be sent');
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this._pingWatchdog.start();
|
|
52
|
+
}
|
|
109
53
|
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
_a.sent();
|
|
133
|
-
this._logger.info("Submitted '".concat(request.events.length, "' events successfully"));
|
|
134
|
-
return [2 /*return*/, true];
|
|
135
|
-
case 3:
|
|
136
|
-
e_1 = _a.sent();
|
|
137
|
-
this._logger.warn("Failed to submit '".concat(request.events.length, "' events. Error ").concat(e_1));
|
|
138
|
-
return [2 /*return*/, false];
|
|
139
|
-
case 4: return [2 /*return*/];
|
|
140
|
-
}
|
|
141
|
-
});
|
|
54
|
+
}
|
|
55
|
+
submitAgentEventRequest(event) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
if (!this.active) {
|
|
58
|
+
this._logger.debug('Agent not active - not submitting event');
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
const request = {
|
|
62
|
+
agentId: this._agentInstanceData.agentId,
|
|
63
|
+
events: Array.isArray(event) ? event : [event],
|
|
64
|
+
appName: this._agentConfig.appName.value,
|
|
65
|
+
buildSessionId: this._agentConfig.buildSessionId.value
|
|
66
|
+
};
|
|
67
|
+
try {
|
|
68
|
+
yield this.backendProxy.submitAgentEvent(request);
|
|
69
|
+
this._logger.info(`Submitted '${request.events.length}' events successfully`);
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
this._logger.warn(`Failed to submit '${request.events.length}' events. Error ${e}`);
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
142
76
|
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
77
|
+
}
|
|
78
|
+
buildAgentStartEvent(packageJsonFile) {
|
|
79
|
+
const agentInstanceInfoBuilder = new agent_instance_info_builder_1.AgentInstanceInfoBuilder(this);
|
|
80
|
+
const machineInfoBuilder = new machine_info_builder_1.MachineInfoBuilder();
|
|
81
|
+
const dependencies = Object.assign(Object.assign({}, packageJsonFile.dependencies), packageJsonFile.devDependencies);
|
|
82
|
+
const nodejsEnvInfoBuilder = this.agentInstanceData.technology === agent_events_contracts_1.Technology.BROWSER ? new browser_info_builder_1.BrowserInfoBuilder() : new nodejs_env_info_builder_1.NodejsEnvInfoBuilder(this.agentInstanceData, dependencies);
|
|
83
|
+
const ciInfoBuilder = new ci_info_builder_1.CiInfoBuilder();
|
|
84
|
+
const agentStartInfoBuilder = new agent_start_info_builder_1.AgentStartInfoBuilder(agentInstanceInfoBuilder, machineInfoBuilder, nodejsEnvInfoBuilder, ciInfoBuilder);
|
|
85
|
+
const agentStartInfo = agentStartInfoBuilder.build();
|
|
152
86
|
return this.buildEvent(agent_events_contracts_1.AgentEventCode.AGENT_STARTED, agentStartInfo);
|
|
153
|
-
}
|
|
154
|
-
|
|
87
|
+
}
|
|
88
|
+
buildAgentShutdownEvent() {
|
|
155
89
|
return this.buildEvent(agent_events_contracts_1.AgentEventCode.AGENT_SHUTDOWN);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
case 1: return [4 /*yield*/, this.submitAgentEventRequest(event)];
|
|
179
|
-
case 2:
|
|
180
|
-
result = _a.sent();
|
|
181
|
-
this.active = false;
|
|
182
|
-
return [2 /*return*/, result];
|
|
183
|
-
case 3: return [2 /*return*/];
|
|
184
|
-
}
|
|
185
|
-
});
|
|
90
|
+
}
|
|
91
|
+
submitAgentShutdownEvent() {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
this.shutDownRetries++;
|
|
94
|
+
if (this.startRequestStatus == StartRequestStatus.FAILED) {
|
|
95
|
+
this._logger.debug('Agent start not submitted - not sending shut down events');
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (this.shutDownRetries > AgentEventsController.MAX_SHUTDOWN_RETRIES) {
|
|
99
|
+
this._logger.debug('Stop trying to send shutdown event after 60 seconds ');
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
this._pingWatchdog.stop();
|
|
103
|
+
const event = this.buildAgentShutdownEvent();
|
|
104
|
+
if (this.startRequestStatus == StartRequestStatus.PENDING) {
|
|
105
|
+
setTimeout(() => this.submitAgentShutdownEvent.call(this), 1000);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
const result = yield this.submitAgentEventRequest(event);
|
|
109
|
+
this.active = false;
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
186
112
|
});
|
|
187
|
-
}
|
|
113
|
+
}
|
|
188
114
|
// Not happens if start event failed to submit
|
|
189
|
-
|
|
115
|
+
submitPingEvent() {
|
|
190
116
|
return this.submitEvent(agent_events_contracts_1.AgentEventCode.AGENT_PING, { agentInfo: { labId: this.agentConfig.labId.value } });
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
var _this = this;
|
|
117
|
+
}
|
|
118
|
+
submitEvent(code, data) {
|
|
194
119
|
this.submittedEventsMap.set(code, true);
|
|
195
|
-
this._logger.debug(
|
|
196
|
-
|
|
197
|
-
this.submitAgentEventRequest(event).then(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
};
|
|
201
|
-
AgentEventsController.prototype.submitEventOnce = function (code) {
|
|
120
|
+
this._logger.debug(`About to send event with code '${code}', current time: ${(0, system_date_1.getSystemDateValueOf)()}`);
|
|
121
|
+
const event = this.buildEvent(code, data);
|
|
122
|
+
this.submitAgentEventRequest(event).then(() => this._logger.debug(`Event with code '${code}' submitted successfully`));
|
|
123
|
+
}
|
|
124
|
+
submitEventOnce(code) {
|
|
202
125
|
if (!this.submittedEventsMap.get(code)) {
|
|
203
126
|
this.submitEvent(code);
|
|
204
127
|
}
|
|
205
|
-
}
|
|
128
|
+
}
|
|
206
129
|
// Not happens if start event failed to submit
|
|
207
|
-
|
|
130
|
+
submitGenericMessage(message) {
|
|
208
131
|
this.sendMessage(message, agent_events_contracts_1.AgentEventCode.GENERIC_MESSAGE);
|
|
209
|
-
}
|
|
210
|
-
|
|
132
|
+
}
|
|
133
|
+
submitWarning(message) {
|
|
211
134
|
this.sendMessage(message, agent_events_contracts_1.AgentEventCode.WARN);
|
|
212
|
-
}
|
|
213
|
-
|
|
135
|
+
}
|
|
136
|
+
submitError(message) {
|
|
214
137
|
this.sendMessage(message, agent_events_contracts_1.AgentEventCode.GENERIC_ERROR);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
var _this = this;
|
|
138
|
+
}
|
|
139
|
+
submitErrorsBatch(messages) {
|
|
218
140
|
if (!messages || !messages.length) {
|
|
219
141
|
return;
|
|
220
142
|
}
|
|
221
|
-
|
|
222
|
-
this.submitAgentEventRequest(events).then(
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
Object.defineProperty(AgentEventsController.prototype, "agentConfig", {
|
|
247
|
-
get: function () {
|
|
248
|
-
return this._agentConfig;
|
|
249
|
-
},
|
|
250
|
-
enumerable: false,
|
|
251
|
-
configurable: true
|
|
252
|
-
});
|
|
253
|
-
Object.defineProperty(AgentEventsController.prototype, "logger", {
|
|
254
|
-
get: function () {
|
|
255
|
-
return this._logger;
|
|
256
|
-
},
|
|
257
|
-
enumerable: false,
|
|
258
|
-
configurable: true
|
|
259
|
-
});
|
|
260
|
-
Object.defineProperty(AgentEventsController.prototype, "tools", {
|
|
261
|
-
get: function () {
|
|
262
|
-
return this._tools;
|
|
263
|
-
},
|
|
264
|
-
enumerable: false,
|
|
265
|
-
configurable: true
|
|
266
|
-
});
|
|
267
|
-
AgentEventsController.prototype.resolveTags = function () {
|
|
143
|
+
const events = messages.map(msg => this.buildEvent(agent_events_contracts_1.AgentEventCode.GENERIC_ERROR, msg));
|
|
144
|
+
this.submitAgentEventRequest(events).then(() => this.logger.debug(`'${events.length}' events were submitted successfully`));
|
|
145
|
+
}
|
|
146
|
+
sendMessage(message, code) {
|
|
147
|
+
this.logger.debug(`About to send message '${message}' with code '${code}', current time: ${(0, system_date_1.getSystemDateValueOf)()}`);
|
|
148
|
+
const messageEvent = this.buildEvent(code, message);
|
|
149
|
+
this.submitAgentEventRequest(messageEvent).then(() => this.logger.debug('Message submitted successfully'));
|
|
150
|
+
}
|
|
151
|
+
submitConfigChanged() {
|
|
152
|
+
const messageEvent = this.buildEvent(agent_events_contracts_1.AgentEventCode.AGENT_CONFIG_CHANGED, this._agentConfig.toJsonObject());
|
|
153
|
+
this.submitAgentEventRequest(messageEvent).then(() => this.logger.debug('Config changed event submitted successfully'));
|
|
154
|
+
}
|
|
155
|
+
get watchdog() {
|
|
156
|
+
return this._pingWatchdog;
|
|
157
|
+
}
|
|
158
|
+
get agentConfig() {
|
|
159
|
+
return this._agentConfig;
|
|
160
|
+
}
|
|
161
|
+
get logger() {
|
|
162
|
+
return this._logger;
|
|
163
|
+
}
|
|
164
|
+
get tools() {
|
|
165
|
+
return this._tools;
|
|
166
|
+
}
|
|
167
|
+
resolveTags() {
|
|
268
168
|
return this._tags || [];
|
|
269
|
-
}
|
|
270
|
-
|
|
169
|
+
}
|
|
170
|
+
addTags(tags) {
|
|
271
171
|
if (!tags)
|
|
272
172
|
return;
|
|
273
|
-
this._tags =
|
|
274
|
-
}
|
|
275
|
-
|
|
173
|
+
this._tags = [...(this._tags || []), ...(tags || [])];
|
|
174
|
+
}
|
|
175
|
+
addTool(tollInfo) {
|
|
276
176
|
if (!tollInfo)
|
|
277
177
|
return;
|
|
278
178
|
this._tools = this._tools || [];
|
|
279
179
|
this._tools.push(tollInfo);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
|
|
180
|
+
}
|
|
181
|
+
createBackendProxy() {
|
|
182
|
+
const httpConfig = {
|
|
283
183
|
token: this._agentConfig.token.value,
|
|
284
184
|
proxy: this._agentConfig.proxy.value,
|
|
285
185
|
server: this._agentConfig.server.value,
|
|
286
186
|
compressRequests: this._agentConfig.gzip.value
|
|
287
187
|
};
|
|
288
188
|
return new backend_proxy_1.BackendProxy(this._agentInstanceData, httpConfig, this._logger);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
189
|
+
}
|
|
190
|
+
initWatchdog() {
|
|
191
|
+
const watchdogOptions = { interval: AgentEventsController.PING_INTERVAL, name: 'AgentEventsWatchdog', autoReset: true, unref: true };
|
|
192
|
+
const timers = this.getTimers();
|
|
293
193
|
this._pingWatchdog = new watchdog_1.Watchdog(watchdogOptions, timers);
|
|
294
194
|
this._pingWatchdog.on('alarm', this.submitPingEvent.bind(this));
|
|
295
|
-
}
|
|
296
|
-
|
|
195
|
+
}
|
|
196
|
+
getTimers() {
|
|
297
197
|
if (this._agentInstanceData.technology === agent_events_contracts_1.Technology.BROWSER) {
|
|
298
198
|
return { setTimeout: setTimeout.bind(window), clearTimeout: clearTimeout.bind(window) };
|
|
299
199
|
}
|
|
300
200
|
else {
|
|
301
201
|
return { setTimeout: setTimeout, clearTimeout: clearTimeout };
|
|
302
202
|
}
|
|
303
|
-
}
|
|
304
|
-
|
|
203
|
+
}
|
|
204
|
+
buildEvent(type, data) {
|
|
305
205
|
return {
|
|
306
206
|
type: type,
|
|
307
207
|
utcTimestamp_ms: (0, system_date_1.getSystemDateValueOf)(),
|
|
308
208
|
data: data
|
|
309
209
|
};
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
enumerable: false,
|
|
316
|
-
configurable: true
|
|
317
|
-
});
|
|
318
|
-
AgentEventsController.PING_INTERVAL = 2 * 60 * 1000; // 2 Minutes.
|
|
319
|
-
AgentEventsController.MAX_SHUTDOWN_RETRIES = 60;
|
|
320
|
-
return AgentEventsController;
|
|
321
|
-
}());
|
|
210
|
+
}
|
|
211
|
+
get agentInstanceData() {
|
|
212
|
+
return this._agentInstanceData;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
322
215
|
exports.AgentEventsController = AgentEventsController;
|
|
216
|
+
AgentEventsController.PING_INTERVAL = 2 * 60 * 1000; // 2 Minutes.
|
|
217
|
+
AgentEventsController.MAX_SHUTDOWN_RETRIES = 60;
|
|
323
218
|
var StartRequestStatus;
|
|
324
219
|
(function (StartRequestStatus) {
|
|
325
220
|
StartRequestStatus["FAILED"] = "failed";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-events-controller.js","sourceRoot":"","sources":["../../../common/agent-events/agent-events-controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-events-controller.js","sourceRoot":"","sources":["../../../common/agent-events/agent-events-controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qEASkC;AAClC,+EAAuE;AACvE,iEAA0D;AAC1D,uEAA+D;AAC/D,yEAAiE;AACjE,uDAAgD;AAChD,yDAAmD;AAEnD,gEAA0D;AAC1D,0CAAsD;AACtD,gDAAoD;AAGpD,iEAA0D;AAE1D,MAAa,qBAAqB;IAgB9B,YAAY,WAAwB,EAAE,iBAAoC,EAAE,MAAc,EAAE,YAA2B,EAAE,IAAgB,EAAE,IAAiB;QAJpJ,WAAM,GAAG,KAAK,CAAC;QAKnB,kCAAe,CAAC,oBAAoB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QACjE,kCAAe,CAAC,oBAAoB,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;QAC7E,kCAAe,CAAC,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACvD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,kBAAkB,GAAG,iBAAiB,CAAC;QAC5C,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC9D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAClB,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAC;IACxC,CAAC;IAEY,uBAAuB,CAAC,eAAqB;;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I,EAAE,IAAI;YACV,eAAe,EAAE,IAAA,kCAAoB,GAAE;YACvC,IAAI,EAAE,IAAI;SACb,CAAC;IACN,CAAC;IAED,IAAI,iBAAiB;QACjB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;;AArOL,sDAsOC;AArO2B,mCAAa,GAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAC7C,0CAAoB,GAAI,EAAE,CAAC;AAsOvD,IAAK,kBAIJ;AAJD,WAAK,kBAAkB;IACnB,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;AACvB,CAAC,EAJI,kBAAkB,KAAlB,kBAAkB,QAItB"}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AgentEventsGuard = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var currentTime = (0, system_date_1.getSystemDateValueOf)();
|
|
11
|
-
var lastCallTime = AgentEventsGuard.EVENT_CODE_TO_LAST_CALL.get(eventCode);
|
|
4
|
+
const system_date_1 = require("../system-date");
|
|
5
|
+
const cockpit_notifier_1 = require("./cockpit-notifier");
|
|
6
|
+
class AgentEventsGuard {
|
|
7
|
+
static notifyIfNeeded(eventCode, data) {
|
|
8
|
+
const currentTime = (0, system_date_1.getSystemDateValueOf)();
|
|
9
|
+
const lastCallTime = AgentEventsGuard.EVENT_CODE_TO_LAST_CALL.get(eventCode);
|
|
12
10
|
if (!lastCallTime || currentTime - lastCallTime >= AgentEventsGuard.DEFAULT_FIVE_MIN_BUFFER) {
|
|
13
11
|
cockpit_notifier_1.CockpitNotifier.sendEvent(eventCode, data);
|
|
14
12
|
AgentEventsGuard.EVENT_CODE_TO_LAST_CALL.set(eventCode, currentTime);
|
|
15
13
|
}
|
|
16
|
-
}
|
|
14
|
+
}
|
|
17
15
|
// Added for tests
|
|
18
|
-
|
|
16
|
+
static init() {
|
|
19
17
|
AgentEventsGuard.EVENT_CODE_TO_LAST_CALL = new Map();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
AgentEventsGuard.EVENT_CODE_TO_LAST_CALL = new Map();
|
|
23
|
-
return AgentEventsGuard;
|
|
24
|
-
}());
|
|
18
|
+
}
|
|
19
|
+
}
|
|
25
20
|
exports.AgentEventsGuard = AgentEventsGuard;
|
|
21
|
+
AgentEventsGuard.DEFAULT_FIVE_MIN_BUFFER = 5 * 60 * 1000;
|
|
22
|
+
AgentEventsGuard.EVENT_CODE_TO_LAST_CALL = new Map();
|
|
26
23
|
//# sourceMappingURL=agent-events-guard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-events-guard.js","sourceRoot":"","sources":["../../../common/agent-events/agent-events-guard.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"agent-events-guard.js","sourceRoot":"","sources":["../../../common/agent-events/agent-events-guard.ts"],"names":[],"mappings":";;;AAAA,gDAAsD;AACtD,yDAAqD;AAGrD,MAAa,gBAAgB;IAIlB,MAAM,CAAC,cAAc,CAAC,SAAiB,EAAE,IAAS;QACrD,MAAM,WAAW,GAAG,IAAA,kCAAoB,GAAE,CAAC;QAC3C,MAAM,YAAY,GAAG,gBAAgB,CAAC,uBAAuB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7E,IAAI,CAAC,YAAY,IAAI,WAAW,GAAG,YAAY,IAAI,gBAAgB,CAAC,uBAAuB,EAAE;YAC3F,kCAAe,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YAC3C,gBAAgB,CAAC,uBAAuB,CAAC,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;SACtE;IACH,CAAC;IAGH,kBAAkB;IACX,MAAM,CAAC,IAAI;QACd,gBAAgB,CAAC,uBAAuB,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzE,CAAC;;AAjBL,4CAkBC;AAjBkB,wCAAuB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AACxC,wCAAuB,GAAG,IAAI,GAAG,EAAkB,CAAC"}
|