@contrast/agent-bundle 5.41.0 → 5.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -10
- package/node_modules/@contrast/agent/README.md +1 -10
- package/node_modules/@contrast/agent/package.json +13 -12
- package/node_modules/@contrast/agent-swc-plugin/package.json +3 -3
- package/node_modules/@contrast/agentify/lib/rewrite-hooks.js +3 -3
- package/node_modules/@contrast/agentify/lib/utils.js +13 -7
- package/node_modules/@contrast/agentify/package.json +17 -17
- package/node_modules/@contrast/architecture-components/package.json +6 -6
- package/node_modules/@contrast/assess/lib/dataflow/propagation/install/ejs/template.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/propagation/install/pug/index.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sinks/install/http/server-response.js +1 -12
- package/node_modules/@contrast/assess/lib/dataflow/sinks/install/restify.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/sources/install/http.js +1 -1
- package/node_modules/@contrast/assess/lib/dataflow/tracker.js +1 -1
- package/node_modules/@contrast/assess/lib/get-source-context.js +1 -1
- package/node_modules/@contrast/assess/lib/response-scanning/install/http.js +0 -12
- package/node_modules/@contrast/assess/package.json +14 -14
- package/node_modules/@contrast/code-events/binding.gyp +1 -1
- package/node_modules/@contrast/code-events/package.json +11 -9
- package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi108.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi115.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi127.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/{@contrast+code-events.abi93.node → @contrast+code-events.abi137.node} +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi108.armv8.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi115.armv8.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi127.armv8.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi137.armv8.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi108.glibc.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi108.musl.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi115.glibc.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi115.musl.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi127.glibc.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi127.musl.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi137.glibc.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi137.musl.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi108.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi115.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi127.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi137.node +0 -0
- package/node_modules/@contrast/common/lib/constants.d.ts +1 -1
- package/node_modules/@contrast/common/lib/constants.js +1 -1
- package/node_modules/@contrast/common/lib/index.js +15 -15
- package/node_modules/@contrast/common/lib/primordials.d.ts +22 -20
- package/node_modules/@contrast/common/lib/types.d.ts +18 -6
- package/node_modules/@contrast/common/package.json +2 -2
- package/node_modules/@contrast/config/lib/options.js +29 -4
- package/node_modules/@contrast/config/package.json +4 -4
- package/node_modules/@contrast/core/lib/app-info.js +53 -74
- package/node_modules/@contrast/core/lib/index.d.ts +17 -1
- package/node_modules/@contrast/core/lib/sensitive-data-masking/index.js +33 -5
- package/node_modules/@contrast/core/package.json +10 -9
- package/node_modules/@contrast/deadzones/package.json +6 -6
- package/node_modules/@contrast/dep-hooks/lib/export-handler-registry.d.ts +17 -13
- package/node_modules/@contrast/dep-hooks/lib/export-handler-registry.js +16 -4
- package/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.d.ts +2 -2
- package/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.js +2 -3
- package/node_modules/@contrast/dep-hooks/lib/handler-invoker.d.ts +6 -6
- package/node_modules/@contrast/dep-hooks/lib/handler-invoker.js +0 -1
- package/node_modules/@contrast/dep-hooks/lib/helpers.d.ts +0 -7
- package/node_modules/@contrast/dep-hooks/lib/helpers.js +2 -18
- package/node_modules/@contrast/dep-hooks/lib/index.d.ts +17 -12
- package/node_modules/@contrast/dep-hooks/lib/index.js +5 -3
- package/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +2 -1
- package/node_modules/@contrast/dep-hooks/lib/package-finder.js +6 -6
- package/node_modules/@contrast/dep-hooks/package.json +4 -3
- package/node_modules/@contrast/distringuish/package.json +7 -6
- package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi108.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi115.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi127.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/{@contrast+distringuish.abi93.node → @contrast+distringuish.abi137.node} +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi108.armv8.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi115.armv8.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi127.armv8.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi137.armv8.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi108.glibc.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi108.musl.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi115.glibc.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi115.musl.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi127.glibc.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi127.musl.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi137.glibc.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi137.musl.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi108.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi115.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi127.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi137.node +0 -0
- package/node_modules/@contrast/esm-hooks/lib/debug-methods.mjs +4 -4
- package/node_modules/@contrast/esm-hooks/lib/get-file-type.mjs +2 -9
- package/node_modules/@contrast/esm-hooks/lib/hooks.mjs +0 -2
- package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/fs/promises.mjs +2 -0
- package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/fs.mjs +3 -0
- package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/util.mjs +1 -0
- package/node_modules/@contrast/esm-hooks/package.json +7 -7
- package/node_modules/@contrast/fn-inspect/package.json +9 -5
- package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi108.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi115.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi127.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/{@contrast+fn-inspect.abi93.node → @contrast+fn-inspect.abi137.node} +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi108.armv8.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi115.armv8.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi127.armv8.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi137.armv8.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi108.glibc.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi108.musl.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi115.glibc.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi115.musl.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi127.glibc.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi127.musl.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi137.glibc.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/{@contrast+fn-inspect.abi93.musl.node → @contrast+fn-inspect.abi137.musl.node} +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi108.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi115.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi127.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi137.node +0 -0
- package/node_modules/@contrast/instrumentation/lib/http2.js +0 -11
- package/node_modules/@contrast/instrumentation/package.json +6 -6
- package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +312 -224
- package/node_modules/@contrast/library-analysis/package.json +6 -6
- package/node_modules/@contrast/logger/lib/index.js +18 -8
- package/node_modules/@contrast/logger/lib/serializers.js +5 -5
- package/node_modules/@contrast/logger/lib/utils.d.ts +0 -6
- package/node_modules/@contrast/logger/package.json +4 -4
- package/node_modules/@contrast/metrics/lib/index.d.ts +6 -6
- package/node_modules/@contrast/metrics/lib/index.js +0 -1
- package/node_modules/@contrast/metrics/package.json +7 -7
- package/node_modules/@contrast/patcher/package.json +3 -3
- package/node_modules/@contrast/perf/package.json +7 -4
- package/node_modules/@contrast/protect/lib/hardening/handlers.js +37 -21
- package/node_modules/@contrast/protect/lib/index.d.ts +3 -2
- package/node_modules/@contrast/protect/lib/index.js +9 -2
- package/node_modules/@contrast/protect/lib/input-analysis/handlers.js +275 -233
- package/node_modules/@contrast/protect/lib/input-analysis/install/http.js +3 -4
- package/node_modules/@contrast/protect/lib/input-tracing/{handlers/index.js → handlers.js} +15 -15
- package/node_modules/@contrast/protect/lib/input-tracing/index.js +0 -1
- package/node_modules/@contrast/protect/lib/make-source-context.js +5 -7
- package/node_modules/@contrast/protect/lib/policy.js +130 -95
- package/node_modules/@contrast/protect/lib/semantic-analysis/handlers.js +19 -18
- package/node_modules/@contrast/protect/package.json +12 -12
- package/node_modules/@contrast/reporter/lib/index.js +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/base.d.ts +0 -1
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.d.ts +4 -2
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.js +14 -14
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.d.ts +43 -6
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +262 -429
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/server-inventory.d.ts +3 -3
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.d.ts +11 -11
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +93 -93
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +12 -13
- package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/utils.js +6 -7
- package/node_modules/@contrast/reporter/lib/reporters/file.js +1 -1
- package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.d.ts +2 -3
- package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.js +72 -86
- package/node_modules/@contrast/reporter/lib/reporters/security-logger/messages.js +6 -7
- package/node_modules/@contrast/reporter/lib/validators.js +0 -1
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/.husky/pre-commit +2 -2
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/.taprc +5 -0
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/README.md +2 -4
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/bench.js +5 -36
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/index.js +56 -300
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/package.json +12 -7
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test.js +1684 -0
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/types/index.d.ts +1 -2
- package/node_modules/@contrast/reporter/package.json +10 -10
- package/node_modules/@contrast/rewriter/lib/index.js +5 -43
- package/node_modules/@contrast/rewriter/package.json +8 -8
- package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +0 -5
- package/node_modules/@contrast/route-coverage/lib/install/hapi.js +9 -2
- package/node_modules/@contrast/route-coverage/lib/install/restify.js +1 -1
- package/node_modules/@contrast/route-coverage/package.json +10 -10
- package/node_modules/@contrast/scopes/package.json +6 -6
- package/node_modules/@contrast/sec-obs/lib/traces/http.js +1 -1
- package/node_modules/@contrast/sec-obs/lib/traces/http.test.js +1 -1
- package/node_modules/@contrast/sec-obs/package.json +10 -10
- package/node_modules/@contrast/sources/lib/index.js +1 -1
- package/node_modules/@contrast/sources/lib/index.test.js +0 -26
- package/node_modules/@contrast/sources/package.json +3 -3
- package/node_modules/@contrast/telemetry/package.json +6 -6
- package/node_modules/@opentelemetry/semantic-conventions/README.md +3 -2
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.d.ts +4350 -2882
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +4350 -2882
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.d.ts +136 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js +154 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js.map +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.d.ts +713 -141
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +713 -141
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.d.ts +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.d.ts +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.d.ts +7 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +7 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.d.ts +5 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js +23 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js.map +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.d.ts +4350 -2882
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +4350 -2882
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.d.ts +136 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js +154 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js.map +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.d.ts +713 -141
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +713 -141
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.d.ts +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.d.ts +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.d.ts +7 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +7 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.d.ts +5 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js +23 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js.map +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.d.ts +4350 -2882
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +4354 -2883
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.d.ts +136 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js +157 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js.map +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.d.ts +713 -141
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +720 -147
- package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.d.ts +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js +2 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index.d.ts +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.d.ts +7 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +10 -4
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.d.ts +5 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js +26 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js.map +1 -0
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.d.ts +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js.map +1 -1
- package/node_modules/@opentelemetry/semantic-conventions/package.json +6 -7
- package/node_modules/@swc/core/README.md +5 -0
- package/node_modules/@swc/core/binding.d.ts +2 -2
- package/node_modules/@swc/core/index.d.ts +5 -4
- package/node_modules/@swc/core/index.js +2 -2
- package/node_modules/@swc/core/package.json +12 -12
- package/node_modules/@swc/core-darwin-arm64/package.json +1 -1
- package/node_modules/@swc/core-darwin-arm64/swc.darwin-arm64.node +0 -0
- package/node_modules/@swc/core-darwin-x64/package.json +1 -1
- package/node_modules/@swc/core-darwin-x64/swc.darwin-x64.node +0 -0
- package/node_modules/@swc/core-linux-arm64-gnu/package.json +1 -1
- package/node_modules/@swc/core-linux-arm64-gnu/swc.linux-arm64-gnu.node +0 -0
- package/node_modules/@swc/core-linux-arm64-musl/package.json +1 -1
- package/node_modules/@swc/core-linux-arm64-musl/swc.linux-arm64-musl.node +0 -0
- package/node_modules/@swc/core-linux-x64-gnu/package.json +1 -1
- package/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
- package/node_modules/@swc/core-linux-x64-musl/package.json +1 -1
- package/node_modules/@swc/core-linux-x64-musl/swc.linux-x64-musl.node +0 -0
- package/node_modules/@swc/core-win32-arm64-msvc/package.json +1 -1
- package/node_modules/@swc/core-win32-arm64-msvc/swc.win32-arm64-msvc.node +0 -0
- package/node_modules/@swc/core-win32-x64-msvc/package.json +1 -1
- package/node_modules/@swc/core-win32-x64-msvc/swc.win32-x64-msvc.node +0 -0
- package/node_modules/@swc/types/index.d.ts +15 -5
- package/node_modules/@swc/types/package.json +2 -2
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.d.ts +1 -1
- package/node_modules/@types/node/child_process.d.ts +26 -122
- package/node_modules/@types/node/crypto.d.ts +61 -11
- package/node_modules/@types/node/dns.d.ts +5 -0
- package/node_modules/@types/node/fs/promises.d.ts +48 -29
- package/node_modules/@types/node/fs.d.ts +52 -37
- package/node_modules/@types/node/globals.d.ts +148 -347
- package/node_modules/@types/node/http.d.ts +29 -5
- package/node_modules/@types/node/http2.d.ts +13 -11
- package/node_modules/@types/node/https.d.ts +5 -0
- package/node_modules/@types/node/index.d.ts +7 -2
- package/node_modules/@types/node/inspector.d.ts +187 -3985
- package/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/node_modules/@types/node/module.d.ts +25 -0
- package/node_modules/@types/node/net.d.ts +21 -0
- package/node_modules/@types/node/package.json +4 -9
- package/node_modules/@types/node/perf_hooks.d.ts +14 -0
- package/node_modules/@types/node/repl.d.ts +11 -1
- package/node_modules/@types/node/sqlite.d.ts +34 -1
- package/node_modules/@types/node/stream/web.d.ts +4 -0
- package/node_modules/@types/node/stream.d.ts +17 -6
- package/node_modules/@types/node/test.d.ts +120 -1
- package/node_modules/@types/node/timers.d.ts +0 -2
- package/node_modules/@types/node/tls.d.ts +32 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +7 -2
- package/node_modules/@types/node/ts5.7/index.d.ts +7 -2
- package/node_modules/@types/node/url.d.ts +20 -6
- package/node_modules/@types/node/util.d.ts +12 -6
- package/node_modules/@types/node/vm.d.ts +73 -10
- package/node_modules/@types/node/wasi.d.ts +21 -0
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/{dom-events.d.ts → web-globals/events.d.ts} +47 -52
- package/node_modules/@types/node/web-globals/fetch.d.ts +50 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +63 -3
- package/node_modules/@types/node/zlib.d.ts +8 -2
- package/node_modules/axios/CHANGELOG.md +58 -0
- package/node_modules/axios/README.md +87 -10
- package/node_modules/axios/dist/axios.js +355 -289
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +286 -213
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +286 -213
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +377 -213
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +12 -5
- package/node_modules/axios/index.d.ts +13 -4
- package/node_modules/axios/lib/adapters/adapters.js +6 -4
- package/node_modules/axios/lib/adapters/fetch.js +221 -162
- package/node_modules/axios/lib/adapters/http.js +18 -0
- package/node_modules/axios/lib/adapters/xhr.js +11 -8
- package/node_modules/axios/lib/core/Axios.js +0 -2
- package/node_modules/axios/lib/core/AxiosError.js +10 -3
- package/node_modules/axios/lib/core/dispatchRequest.js +1 -1
- package/node_modules/axios/lib/defaults/index.js +1 -1
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/buildURL.js +1 -3
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +73 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +13 -9
- package/node_modules/axios/lib/utils.js +5 -3
- package/node_modules/axios/package.json +18 -12
- package/node_modules/balanced-match/.github/FUNDING.yml +2 -0
- package/node_modules/balanced-match/LICENSE.md +21 -0
- package/node_modules/balanced-match/README.md +97 -0
- package/node_modules/balanced-match/index.js +62 -0
- package/node_modules/balanced-match/package.json +48 -0
- package/node_modules/brace-expansion/.github/FUNDING.yml +2 -0
- package/node_modules/brace-expansion/LICENSE +21 -0
- package/node_modules/brace-expansion/README.md +135 -0
- package/node_modules/brace-expansion/index.js +203 -0
- package/node_modules/brace-expansion/package.json +49 -0
- package/node_modules/detect-libc/lib/detect-libc.js +59 -13
- package/node_modules/detect-libc/lib/elf.js +39 -0
- package/node_modules/detect-libc/lib/filesystem.js +18 -8
- package/node_modules/detect-libc/package.json +3 -2
- package/node_modules/minimatch/LICENSE +15 -0
- package/node_modules/minimatch/README.md +454 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/ast.d.ts +20 -0
- package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/ast.js +592 -0
- package/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js +152 -0
- package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts +12 -0
- package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/escape.js +22 -0
- package/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts +94 -0
- package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/index.js +1017 -0
- package/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
- package/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts +17 -0
- package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js +24 -0
- package/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
- package/node_modules/minimatch/dist/esm/ast.d.ts +20 -0
- package/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/ast.js +588 -0
- package/node_modules/minimatch/dist/esm/ast.js.map +1 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.js +148 -0
- package/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts +12 -0
- package/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/escape.js +18 -0
- package/node_modules/minimatch/dist/esm/escape.js.map +1 -0
- package/node_modules/minimatch/dist/esm/index.d.ts +94 -0
- package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/index.js +1001 -0
- package/node_modules/minimatch/dist/esm/index.js.map +1 -0
- package/node_modules/minimatch/dist/esm/package.json +3 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts +17 -0
- package/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
- package/node_modules/minimatch/dist/esm/unescape.js +20 -0
- package/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
- package/node_modules/minimatch/package.json +82 -0
- package/node_modules/node-abi/LICENSE +21 -0
- package/node_modules/node-abi/README.md +54 -0
- package/node_modules/node-abi/abi_registry.json +408 -0
- package/node_modules/node-abi/getNextTarget.js +13 -0
- package/node_modules/node-abi/index.js +161 -0
- package/node_modules/node-abi/package.json +46 -0
- package/node_modules/node-addon-api/README.md +25 -249
- package/node_modules/node-addon-api/common.gypi +1 -0
- package/node_modules/node-addon-api/index.js +2 -0
- package/node_modules/node-addon-api/napi-inl.h +592 -166
- package/node_modules/node-addon-api/napi.h +167 -59
- package/node_modules/node-addon-api/node_addon_api.gyp +10 -0
- package/node_modules/node-addon-api/noexcept.gypi +1 -1
- package/node_modules/node-addon-api/package.json +13 -13
- package/node_modules/node-addon-api/tools/conversion.js +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/light/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.min.js +2 -2
- package/node_modules/protobufjs/google/protobuf/descriptor.json +2 -2
- package/node_modules/protobufjs/google/protobuf/descriptor.proto +2 -1
- package/node_modules/protobufjs/package.json +1 -1
- package/node_modules/undici-types/agent.d.ts +4 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +6 -3
- package/node_modules/undici-types/diagnostics-channel.d.ts +9 -0
- package/node_modules/undici-types/dispatcher.d.ts +3 -2
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +2 -1
- package/node_modules/undici-types/eventsource.d.ts +3 -3
- package/node_modules/undici-types/fetch.d.ts +1 -0
- package/node_modules/undici-types/handlers.d.ts +1 -1
- package/node_modules/undici-types/mock-agent.d.ts +3 -0
- package/node_modules/undici-types/mock-client.d.ts +2 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +2 -0
- package/node_modules/undici-types/mock-pool.d.ts +2 -0
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/pool.d.ts +2 -0
- package/node_modules/undici-types/proxy-agent.d.ts +1 -0
- package/node_modules/undici-types/retry-handler.d.ts +9 -0
- package/node_modules/undici-types/webidl.d.ts +29 -15
- package/node_modules/undici-types/websocket.d.ts +3 -1
- package/node_modules/yaml/README.md +2 -20
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +1 -1
- package/node_modules/yaml/dist/stringify/stringifyString.js +1 -1
- package/node_modules/yaml/package.json +2 -1
- package/package.json +4 -3
- package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi93.armv8.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi93.glibc.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi93.musl.node +0 -0
- package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi93.node +0 -0
- package/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +0 -111
- package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi93.armv8.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi93.glibc.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi93.musl.node +0 -0
- package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi93.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi93.armv8.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi93.glibc.node +0 -0
- package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi93.node +0 -0
- package/node_modules/@contrast/perf/lib/index.test.js +0 -547
- package/node_modules/@contrast/perf/lib/tsconfig.json +0 -31
- package/node_modules/@contrast/protect/lib/input-tracing/install/spdy.js +0 -63
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/.taprc.yaml +0 -11
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/destroy.test.js +0 -49
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/end.test.js +0 -98
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/flush-sync.test.js +0 -140
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/flush.test.js +0 -419
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/fsync.test.js +0 -63
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/helper.js +0 -42
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/minlength.test.js +0 -35
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/mode.test.js +0 -116
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/reopen.test.js +0 -239
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/retry.test.js +0 -414
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/sync.test.js +0 -261
- package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/write.test.js +0 -465
- package/node_modules/@types/node/ts5.1/compatibility/disposable.d.ts +0 -12
- package/node_modules/@types/node/ts5.1/index.d.ts +0 -98
- package/node_modules/node-addon-api/tools/eslint-format.js +0 -79
|
@@ -1,547 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { EventEmitter } = require('node:events');
|
|
4
|
-
const Perf = require('.');
|
|
5
|
-
|
|
6
|
-
const { expect } = require('chai');
|
|
7
|
-
|
|
8
|
-
describe('perf', function () {
|
|
9
|
-
describe('Perf class', function () {
|
|
10
|
-
it('constructs a new instance with a prefix', function() {
|
|
11
|
-
const perf = new Perf('test');
|
|
12
|
-
expect(perf).instanceOf(Perf);
|
|
13
|
-
expect(perf).property('prefix', 'test');
|
|
14
|
-
expect(perf).property('timings')
|
|
15
|
-
.instanceOf(Map);
|
|
16
|
-
expect(Perf.all.get('test')).equal(perf.timings);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('constructs a new instance without a prefix', function() {
|
|
20
|
-
const perf = new Perf();
|
|
21
|
-
expect(perf).instanceOf(Perf);
|
|
22
|
-
expect(perf).property('prefix', '');
|
|
23
|
-
expect(perf).property('timings')
|
|
24
|
-
.instanceOf(Map);
|
|
25
|
-
expect(Perf.all.get('')).equal(perf.timings);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// can't test this dynamically because it's set at load time. should
|
|
29
|
-
// it be dynamic? should it be per-instance?
|
|
30
|
-
// ['0', 'not-one', ''].forEach(setting => {
|
|
31
|
-
// const bool = setting === '1';
|
|
32
|
-
// it(`isEnabled is ${bool} when CSI_PERF is ${setting}`, function() {
|
|
33
|
-
// process.env.CSI_PERF = setting;
|
|
34
|
-
// //const perf = new Perf();
|
|
35
|
-
// expect(Perf.isEnabled).equal(setting === '1');
|
|
36
|
-
// });
|
|
37
|
-
// });
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
describe('wrapInit functions', function () {
|
|
41
|
-
let perf;
|
|
42
|
-
beforeEach(function() {
|
|
43
|
-
Perf.isEnabled = false;
|
|
44
|
-
Perf.all.clear();
|
|
45
|
-
perf = new Perf('wrap-test');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('wrapInit returns the original function when Perf is not enabled', function() {
|
|
49
|
-
Perf.isEnabled = false;
|
|
50
|
-
function init() {
|
|
51
|
-
return {
|
|
52
|
-
install() {
|
|
53
|
-
return 'i-am-install';
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
const wrapped = perf.wrapInit(init, 'tag');
|
|
58
|
-
expect(wrapped).equal(init);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('wrapInit returns a wrapped function when Perf is enabled', async function() {
|
|
62
|
-
Perf.isEnabled = true;
|
|
63
|
-
|
|
64
|
-
async function install() {
|
|
65
|
-
return 'i-am-install';
|
|
66
|
-
}
|
|
67
|
-
function init() {
|
|
68
|
-
return {
|
|
69
|
-
install
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// wrap init
|
|
74
|
-
const wrapped = perf.wrapInit(init, 'tag');
|
|
75
|
-
expect(wrapped).not.equal(init);
|
|
76
|
-
expect(wrapped).instanceOf(Function);
|
|
77
|
-
|
|
78
|
-
// invoke the wrapped function
|
|
79
|
-
const result = wrapped();
|
|
80
|
-
expect(result.install).not.equal(install);
|
|
81
|
-
expect(result.install).instanceOf(Function);
|
|
82
|
-
|
|
83
|
-
// invoke install (an async function)
|
|
84
|
-
let installResult = result.install();
|
|
85
|
-
expect(installResult).instanceOf(Promise);
|
|
86
|
-
installResult = await installResult;
|
|
87
|
-
expect(installResult).equal('i-am-install');
|
|
88
|
-
|
|
89
|
-
expect(Perf.all.get('wrap-test')).equal(perf.timings);
|
|
90
|
-
expect(perf.timings.size).equal(2);
|
|
91
|
-
expect(perf.timings.get('wrap-test:tag:init')).instanceOf(Array)
|
|
92
|
-
.length(2);
|
|
93
|
-
expect(perf.timings.get('wrap-test:tag:install')).instanceOf(Array)
|
|
94
|
-
.length(2);
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
describe('wrapReporter functions', function() {
|
|
99
|
-
let perf;
|
|
100
|
-
beforeEach(function() {
|
|
101
|
-
Perf.isEnabled = false;
|
|
102
|
-
Perf.all.clear();
|
|
103
|
-
perf = new Perf('wrap-test');
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('wrapReporter returns original class when Perf not enabled', function() {
|
|
107
|
-
Perf.isEnabled = false;
|
|
108
|
-
class Reporter {
|
|
109
|
-
constructor() { }
|
|
110
|
-
get() { }
|
|
111
|
-
post() { }
|
|
112
|
-
put() { }
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const wrapped = new Perf().wrapReporter(Reporter);
|
|
116
|
-
expect(wrapped).equal(Reporter);
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it('wrapReporter returns a subclass when Perf is enabled', async function() {
|
|
120
|
-
Perf.isEnabled = true;
|
|
121
|
-
class Reporter {
|
|
122
|
-
constructor() { }
|
|
123
|
-
|
|
124
|
-
/* eslint-disable */
|
|
125
|
-
async get() { return 'i-am-get'; }
|
|
126
|
-
async post() { return 'i-am-post'; }
|
|
127
|
-
async put() { return 'i-am-put'; }
|
|
128
|
-
/* eslint-enable */
|
|
129
|
-
}
|
|
130
|
-
const wrapped = perf.wrapReporter(Reporter);
|
|
131
|
-
expect(wrapped).not.equal(Reporter);
|
|
132
|
-
expect(wrapped).instanceOf(Function);
|
|
133
|
-
|
|
134
|
-
const reporter = new wrapped();
|
|
135
|
-
expect(reporter).instanceOf(Reporter);
|
|
136
|
-
|
|
137
|
-
for (const method of ['get', 'post', 'put']) {
|
|
138
|
-
expect(reporter[method]).instanceOf(Function);
|
|
139
|
-
let result = reporter[method]();
|
|
140
|
-
expect(result).instanceOf(Promise);
|
|
141
|
-
result = await result;
|
|
142
|
-
expect(result).equal(`i-am-${method}`);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
expect(Perf.all.get('wrap-test')).equal(perf.timings);
|
|
146
|
-
expect(perf.timings.size).equal(3);
|
|
147
|
-
expect(perf.timings.get('wrap-test:Reporter:get')).instanceOf(Array)
|
|
148
|
-
.length(2);
|
|
149
|
-
expect(perf.timings.get('wrap-test:Reporter:post')).instanceOf(Array)
|
|
150
|
-
.length(2);
|
|
151
|
-
expect(perf.timings.get('wrap-test:Reporter:put')).instanceOf(Array)
|
|
152
|
-
.length(2);
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
describe('wrapPinoInstance functions', function() {
|
|
157
|
-
let perf;
|
|
158
|
-
beforeEach(function() {
|
|
159
|
-
Perf.isEnabled = false;
|
|
160
|
-
Perf.all.clear();
|
|
161
|
-
perf = new Perf('wrap-test');
|
|
162
|
-
});
|
|
163
|
-
it('wrapPinoInstance returns original when Perf not enabled', function() {
|
|
164
|
-
Perf.isEnabled = false;
|
|
165
|
-
const pino = {
|
|
166
|
-
info() { },
|
|
167
|
-
warn() { },
|
|
168
|
-
error() { },
|
|
169
|
-
trace() { },
|
|
170
|
-
debug() { },
|
|
171
|
-
fatal() { },
|
|
172
|
-
};
|
|
173
|
-
const wrapped = perf.wrapPinoInstance(pino);
|
|
174
|
-
expect(wrapped).equal(pino);
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
it('wrapPinoInstance wraps instance when Perf is enabled', function() {
|
|
178
|
-
Perf.isEnabled = true;
|
|
179
|
-
/* eslint-disable */
|
|
180
|
-
const originals = {
|
|
181
|
-
info() { return 'i-am-info' },
|
|
182
|
-
warn() { return 'i-am-warn' },
|
|
183
|
-
error() { return 'i-am-error' },
|
|
184
|
-
trace() { return 'i-am-trace' },
|
|
185
|
-
debug() { return 'i-am-debug' },
|
|
186
|
-
fatal() { return 'i-am-fatal' },
|
|
187
|
-
};
|
|
188
|
-
/* eslint-enable */
|
|
189
|
-
|
|
190
|
-
const pino = {
|
|
191
|
-
info: originals.info,
|
|
192
|
-
warn: originals.warn,
|
|
193
|
-
error: originals.error,
|
|
194
|
-
trace: originals.trace,
|
|
195
|
-
debug: originals.debug,
|
|
196
|
-
fatal: originals.fatal,
|
|
197
|
-
};
|
|
198
|
-
const wrapped = perf.wrapPinoInstance(pino);
|
|
199
|
-
expect(wrapped).instanceOf(Object);
|
|
200
|
-
|
|
201
|
-
for (const method of ['info', 'warn', 'error', 'trace', 'debug', 'fatal']) {
|
|
202
|
-
expect(wrapped[method]).instanceOf(Function);
|
|
203
|
-
expect(wrapped[method]).not.equal(originals[method]);
|
|
204
|
-
expect(wrapped[method]()).equal(`i-am-${method}`);
|
|
205
|
-
const result = wrapped[method]();
|
|
206
|
-
expect(result).equal(`i-am-${method}`);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
expect(Perf.all.get('wrap-test')).equal(perf.timings);
|
|
210
|
-
expect(perf.timings.size).equal(6);
|
|
211
|
-
for (const method of ['info', 'warn', 'error', 'trace', 'debug', 'fatal']) {
|
|
212
|
-
expect(perf.timings.get(`pino:${method}`)).instanceOf(Array)
|
|
213
|
-
.length(2);
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
});
|
|
217
|
-
|
|
218
|
-
describe('wrapEmitter functions', function() {
|
|
219
|
-
let perf;
|
|
220
|
-
let emitter;
|
|
221
|
-
beforeEach(function() {
|
|
222
|
-
Perf.isEnabled = false;
|
|
223
|
-
Perf.all.clear();
|
|
224
|
-
perf = new Perf('wrap-emitter-test');
|
|
225
|
-
emitter = new EventEmitter();
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
it('wrapEmitter returns the original function when Perf is not enabled', function() {
|
|
229
|
-
Perf.isEnabled = false;
|
|
230
|
-
const wrapped = perf.wrapEmitter(emitter, 'messages');
|
|
231
|
-
expect(wrapped).equal(emitter);
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
it('wrapEmitter returns a wrapped function when Perf is enabled', async function() {
|
|
235
|
-
Perf.isEnabled = true;
|
|
236
|
-
const perfName = 'emitter';
|
|
237
|
-
perf = new Perf(perfName);
|
|
238
|
-
|
|
239
|
-
const calls = [];
|
|
240
|
-
function handler(event, ...args) {
|
|
241
|
-
calls.push([event, ...args]);
|
|
242
|
-
return 'i-am-handler';
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const originalEmitter = emitter;
|
|
246
|
-
const originalOn = emitter.on;
|
|
247
|
-
|
|
248
|
-
const tag = 'messages';
|
|
249
|
-
|
|
250
|
-
const wrapped = perf.wrapEmitter(emitter, tag);
|
|
251
|
-
expect(wrapped.on).not.equal(originalOn);
|
|
252
|
-
expect(wrapped).instanceOf(EventEmitter);
|
|
253
|
-
expect(emitter).equal(originalEmitter);
|
|
254
|
-
|
|
255
|
-
wrapped.on('event-one', handler);
|
|
256
|
-
wrapped.on('event-two', handler);
|
|
257
|
-
|
|
258
|
-
wrapped.emit('event-one', 1, 'one');
|
|
259
|
-
wrapped.emit('event-two', 2, 'two');
|
|
260
|
-
|
|
261
|
-
expect(calls).deep.equal([
|
|
262
|
-
[1, 'one'],
|
|
263
|
-
[2, 'two'],
|
|
264
|
-
]);
|
|
265
|
-
|
|
266
|
-
/* eslint-disable newline-per-chained-call */
|
|
267
|
-
expect(Perf.all.get(perfName)).equal(perf.timings);
|
|
268
|
-
expect(perf.timings.size).equal(2);
|
|
269
|
-
|
|
270
|
-
const eventOneTimings = perf.timings.get(`${perfName}:${tag}:on:event-one`);
|
|
271
|
-
expect(eventOneTimings).an('array').length(2);
|
|
272
|
-
expect(eventOneTimings[0]).equal(1); // count
|
|
273
|
-
expect(eventOneTimings[1]).a('bigint');
|
|
274
|
-
|
|
275
|
-
const eventTwoTimings = perf.timings.get(`${perfName}:${tag}:on:event-two`);
|
|
276
|
-
expect(eventTwoTimings).an('array').length(2);
|
|
277
|
-
expect(eventTwoTimings[0]).equal(1); // count
|
|
278
|
-
expect(eventTwoTimings[1]).a('bigint');
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
describe('wrap sync and async functions', function() {
|
|
283
|
-
let perf;
|
|
284
|
-
beforeEach(function() {
|
|
285
|
-
Perf.isEnabled = false;
|
|
286
|
-
Perf.all.clear();
|
|
287
|
-
perf = new Perf('wrap-test');
|
|
288
|
-
});
|
|
289
|
-
|
|
290
|
-
for (const enabled of [true, false]) {
|
|
291
|
-
it(`wrapSync wraps original function when Perf is ${enabled ? 'enabled' : 'disabled'}`, function() {
|
|
292
|
-
Perf.isEnabled = enabled;
|
|
293
|
-
const original = function xyzzy() {
|
|
294
|
-
return 'i-am-original';
|
|
295
|
-
};
|
|
296
|
-
const wrapped = perf.wrapSync(original, 'tag');
|
|
297
|
-
expect(wrapped).not.equal(original);
|
|
298
|
-
|
|
299
|
-
const result = wrapped();
|
|
300
|
-
expect(result).equal('i-am-original');
|
|
301
|
-
|
|
302
|
-
expect(Perf.all.get('wrap-test')).equal(perf.timings);
|
|
303
|
-
expect(perf.timings.size).equal(1);
|
|
304
|
-
expect(perf.timings.get('wrap-test:tag:xyzzy')).instanceOf(Array)
|
|
305
|
-
.length(2);
|
|
306
|
-
});
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
for (const enabled of [true, false]) {
|
|
310
|
-
it(`wrapAsync wraps original function when Perf is ${enabled ? 'enabled' : 'disabled'}`, async function() {
|
|
311
|
-
Perf.isEnabled = enabled;
|
|
312
|
-
const original = async function xyzzy() {
|
|
313
|
-
return new Promise(resolve => setTimeout(() => resolve('i-am-original'), 10));
|
|
314
|
-
};
|
|
315
|
-
const wrapped = perf.wrapAsync(original, 'tag');
|
|
316
|
-
expect(wrapped).not.equal(original);
|
|
317
|
-
|
|
318
|
-
const result = await wrapped();
|
|
319
|
-
expect(result).equal('i-am-original');
|
|
320
|
-
|
|
321
|
-
expect(Perf.all.get('wrap-test')).equal(perf.timings);
|
|
322
|
-
expect(perf.timings.size).equal(1);
|
|
323
|
-
expect(perf.timings.get('wrap-test:tag:xyzzy')).instanceOf(Array)
|
|
324
|
-
.length(2);
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
describe('Perf map functions', function() {
|
|
331
|
-
let perf;
|
|
332
|
-
|
|
333
|
-
before(function() {
|
|
334
|
-
Perf.all.clear();
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
beforeEach(function() {
|
|
338
|
-
perf = new Perf('map-test');
|
|
339
|
-
});
|
|
340
|
-
afterEach(function() {
|
|
341
|
-
//console.log(Perf.all);
|
|
342
|
-
});
|
|
343
|
-
|
|
344
|
-
// record, recordExcluding
|
|
345
|
-
it('records a timing', function() {
|
|
346
|
-
const start = process.hrtime.bigint();
|
|
347
|
-
perf.record('record', start);
|
|
348
|
-
expect(Perf.all.get('map-test')).equal(perf.timings);
|
|
349
|
-
expect(perf.timings.get('record')).instanceOf(Array)
|
|
350
|
-
.length(2);
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
it('records a timing excluding a delta time', function() {
|
|
354
|
-
const start = process.hrtime.bigint();
|
|
355
|
-
perf.recordExcluding('recordExcluding', start, 100_000n);
|
|
356
|
-
expect(Perf.all.get('map-test')).equal(perf.timings);
|
|
357
|
-
expect(perf.timings.get('recordExcluding')).instanceOf(Array)
|
|
358
|
-
.length(2);
|
|
359
|
-
// it's a bit gross to force it negative, but allows testing
|
|
360
|
-
// that the supplied value was subtracted.
|
|
361
|
-
const [_, delta] = perf.timings.get('recordExcluding');
|
|
362
|
-
//expect(Number(n)).equal(1);
|
|
363
|
-
// .lt(0n) works but .gt(-100_000n) throws "expected -82267 to be a
|
|
364
|
-
// number or date", so convert the bigint.
|
|
365
|
-
expect(Number(delta)).lt(0).gt(-100_000); // eslint-disable-line
|
|
366
|
-
//console.log(n, delta);
|
|
367
|
-
});
|
|
368
|
-
});
|
|
369
|
-
|
|
370
|
-
describe('Collected stats', function() {
|
|
371
|
-
before(function() {
|
|
372
|
-
Perf.all.clear();
|
|
373
|
-
});
|
|
374
|
-
|
|
375
|
-
it('calculates stats when done', function() {
|
|
376
|
-
let fn;
|
|
377
|
-
const perf = new Perf('stats-test', { hrtime: () => fn() });
|
|
378
|
-
|
|
379
|
-
for (let i = 0; i < 10; i++) {
|
|
380
|
-
fn = function() {
|
|
381
|
-
return BigInt(i * 1_000_000);
|
|
382
|
-
};
|
|
383
|
-
perf.record('stats', 0n);
|
|
384
|
-
}
|
|
385
|
-
const stats = perf.getStats(perf.timings);
|
|
386
|
-
|
|
387
|
-
expect(stats).instanceOf(Map);
|
|
388
|
-
expect(stats.size).equal(1);
|
|
389
|
-
expect(stats.get('stats')).deep.equal({
|
|
390
|
-
n: 10,
|
|
391
|
-
totalMicros: 45_000,
|
|
392
|
-
mean: 4500,
|
|
393
|
-
});
|
|
394
|
-
});
|
|
395
|
-
|
|
396
|
-
it('calculates streaming stats', function() {
|
|
397
|
-
let fn;
|
|
398
|
-
const perf = new Perf('streaming-test', { streaming: true, hrtime: () => fn() });
|
|
399
|
-
for (let i = 0; i < 10; i++) {
|
|
400
|
-
fn = function() {
|
|
401
|
-
return BigInt(i * 1_000_000);
|
|
402
|
-
};
|
|
403
|
-
perf.record('streaming', 0n);
|
|
404
|
-
}
|
|
405
|
-
const stats = perf.getStats();
|
|
406
|
-
|
|
407
|
-
expect(stats).instanceOf(Map);
|
|
408
|
-
expect(stats.size).equal(1);
|
|
409
|
-
const streamingStats = stats.get('streaming');
|
|
410
|
-
expect(streamingStats.n).equal(10);
|
|
411
|
-
expect(streamingStats.totalMicros).equal(45_000n);
|
|
412
|
-
expect(streamingStats.mean).equal(4500);
|
|
413
|
-
expect(streamingStats.min).equal(0n);
|
|
414
|
-
expect(streamingStats.max).equal(9000n);
|
|
415
|
-
// verified with https://www.standarddeviationcalculator.io/
|
|
416
|
-
expect(streamingStats.popStddev).equal(2872.28);
|
|
417
|
-
expect(streamingStats.sampleStddev).equal(3027.65);
|
|
418
|
-
});
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
describe('test prototype', function() {
|
|
422
|
-
const instances = [];
|
|
423
|
-
const values = {
|
|
424
|
-
'instance-0': [10, 20, 30],
|
|
425
|
-
'instance-1': [100, 200, 300],
|
|
426
|
-
'instance-2': [1000, 2000, 3000],
|
|
427
|
-
'streaming': [10000, 20000, 30000],
|
|
428
|
-
};
|
|
429
|
-
let firstMark;
|
|
430
|
-
before(async function() {
|
|
431
|
-
Perf.all.clear();
|
|
432
|
-
const prefixes = Object.keys(values);
|
|
433
|
-
for (let i = 0; i < 4; i++) {
|
|
434
|
-
const prefix = prefixes[i];
|
|
435
|
-
const options = {
|
|
436
|
-
streaming: prefix === 'streaming',
|
|
437
|
-
hrtime: () => BigInt(values[prefix].shift())
|
|
438
|
-
};
|
|
439
|
-
instances.push(new Perf(prefix, options));
|
|
440
|
-
for (let j = 0; j < 3; j++) {
|
|
441
|
-
instances[i].record('test', 0n);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
|
|
446
|
-
it('dumps some stuff', function() {
|
|
447
|
-
// make a bunch of perf instances
|
|
448
|
-
const i0 = instances[0].timings;
|
|
449
|
-
const i1 = instances[1].timings;
|
|
450
|
-
const i2 = instances[2].timings;
|
|
451
|
-
const i3 = instances[3].timings;
|
|
452
|
-
|
|
453
|
-
expect(i0).deep.equal(new Map([['test', [3, 60n]]]));
|
|
454
|
-
expect(i1).deep.equal(new Map([['test', [3, 600n]]]));
|
|
455
|
-
expect(i2).deep.equal(new Map([['test', [3, 6000n]]]));
|
|
456
|
-
// maybe Perf should expose RunningStats?
|
|
457
|
-
expect(i3).instanceOf(Map);
|
|
458
|
-
expect(i3.size).equal(1);
|
|
459
|
-
const i3stats = i3.get('test');
|
|
460
|
-
expect(i3stats).property('n', 3);
|
|
461
|
-
expect(i3stats).property('totalMicros', 60n); // it's been converted to microseconds.
|
|
462
|
-
|
|
463
|
-
Perf.mark('listening');
|
|
464
|
-
|
|
465
|
-
expect(Perf.marks.get('listening')).instanceOf(Map);
|
|
466
|
-
const mark0 = Perf.marks.get('listening').get('instance-0');
|
|
467
|
-
const mark1 = Perf.marks.get('listening').get('instance-1');
|
|
468
|
-
const mark2 = Perf.marks.get('listening').get('instance-2');
|
|
469
|
-
const mark3 = Perf.marks.get('listening').get('streaming');
|
|
470
|
-
|
|
471
|
-
expect(mark0).deep.equal(new Map([['test', [3, 60n]]]));
|
|
472
|
-
expect(mark1).deep.equal(new Map([['test', [3, 600n]]]));
|
|
473
|
-
expect(mark2).deep.equal(new Map([['test', [3, 6000n]]]));
|
|
474
|
-
|
|
475
|
-
const s3 = mark3.get('test');
|
|
476
|
-
expect(s3).property('n', 3);
|
|
477
|
-
expect(s3).property('totalMicros', 60n);
|
|
478
|
-
|
|
479
|
-
/* eslint-disable */
|
|
480
|
-
expect(i0).instanceOf(Map).property('size', 0);
|
|
481
|
-
expect(i1).instanceOf(Map).property('size', 0);
|
|
482
|
-
expect(i2).instanceOf(Map).property('size', 0);
|
|
483
|
-
expect(i3).instanceOf(Map).property('size', 0);
|
|
484
|
-
/* eslint-enable */
|
|
485
|
-
|
|
486
|
-
});
|
|
487
|
-
|
|
488
|
-
it('gets the same answer for the streaming stats', async function() {
|
|
489
|
-
// duplicate the existing listening stats
|
|
490
|
-
firstMark = new Map(Perf.marks.get('listening'));
|
|
491
|
-
const firstMarkMaps = {};
|
|
492
|
-
for (const [prefix, data] of firstMark) {
|
|
493
|
-
firstMarkMaps[prefix] = new Map(data);
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
// add two more perf measurements
|
|
497
|
-
const values = {
|
|
498
|
-
'instance-0': [40, 50],
|
|
499
|
-
'instance-1': [400, 500],
|
|
500
|
-
'instance-2': [4000, 5000],
|
|
501
|
-
'streaming': [40000, 50000],
|
|
502
|
-
};
|
|
503
|
-
const prefixes = Object.keys(values);
|
|
504
|
-
for (let i = 0; i < 4; i++) {
|
|
505
|
-
const prefix = prefixes[i];
|
|
506
|
-
instances[i].hrtime = { bigint: () => BigInt(values[prefix].shift()) };
|
|
507
|
-
for (let j = 0; j < 2; j++) {
|
|
508
|
-
instances[i].record('test', 0n);
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
expect(Perf.marks.get('listening')).instanceOf(Map);
|
|
513
|
-
const all0 = Perf.all.get('instance-0');
|
|
514
|
-
const all1 = Perf.all.get('instance-1');
|
|
515
|
-
const all2 = Perf.all.get('instance-2');
|
|
516
|
-
const all3 = Perf.all.get('streaming');
|
|
517
|
-
|
|
518
|
-
expect(all0).deep.equal(new Map([['test', [2, 90n]]]));
|
|
519
|
-
expect(all1).deep.equal(new Map([['test', [2, 900n]]]));
|
|
520
|
-
expect(all2).deep.equal(new Map([['test', [2, 9000n]]]));
|
|
521
|
-
|
|
522
|
-
let s3 = all3.get('test');
|
|
523
|
-
expect(s3).property('n', 2);
|
|
524
|
-
expect(s3).property('totalMicros', 90n);
|
|
525
|
-
|
|
526
|
-
// ask for another mark of the same prefix. it should merge non-streaming
|
|
527
|
-
// and *not* replace streaming stats.
|
|
528
|
-
Perf.mark('listening');
|
|
529
|
-
|
|
530
|
-
/* eslint-disable */
|
|
531
|
-
expect(Perf.marks.get('listening')).instanceOf(Map);
|
|
532
|
-
const mark0 = Perf.marks.get('listening').get('instance-0');
|
|
533
|
-
const mark1 = Perf.marks.get('listening').get('instance-1');
|
|
534
|
-
const mark2 = Perf.marks.get('listening').get('instance-2');
|
|
535
|
-
const mark3 = Perf.marks.get('listening').get('streaming');
|
|
536
|
-
/* eslint-enable */
|
|
537
|
-
|
|
538
|
-
// simple stats are aggregated
|
|
539
|
-
expect(mark0).deep.equal(new Map([['test', [5, 150n]]]));
|
|
540
|
-
expect(mark1).deep.equal(new Map([['test', [5, 1500n]]]));
|
|
541
|
-
expect(mark2).deep.equal(new Map([['test', [5, 15000n]]]));
|
|
542
|
-
// streaming stats don't change
|
|
543
|
-
s3 = mark3.get('test');
|
|
544
|
-
expect(s3).property('n', 3);
|
|
545
|
-
expect(s3).property('totalMicros', 60n);
|
|
546
|
-
});
|
|
547
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@tsconfig/node16/tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
// Enable constraints that allow a TypeScript project to be used with project references.
|
|
5
|
-
// See more: https://www.typescriptlang.org/tsconfig#composite
|
|
6
|
-
// We need this in all of our modules.
|
|
7
|
-
"composite": true,
|
|
8
|
-
// Tells TypeScript to read JS files, as
|
|
9
|
-
// normally they are ignored as source files
|
|
10
|
-
"allowJs": true,
|
|
11
|
-
"rootDir": "./",
|
|
12
|
-
// Generate d.ts files
|
|
13
|
-
"declaration": true,
|
|
14
|
-
// This compiler run should
|
|
15
|
-
// only output d.ts files
|
|
16
|
-
"emitDeclarationOnly": true,
|
|
17
|
-
// Types should go into this directory.
|
|
18
|
-
// Removing this would place the .d.ts files
|
|
19
|
-
// next to the .js files
|
|
20
|
-
"outDir": "../types",
|
|
21
|
-
// go to js file when using IDE functions like
|
|
22
|
-
// "Go to Definition" in VSCode
|
|
23
|
-
"declarationMap": true
|
|
24
|
-
},
|
|
25
|
-
"references": [
|
|
26
|
-
{
|
|
27
|
-
"path": "../../common/src/tsconfig.json"
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
"exclude": ["../types", "**/*.spec.*", "**/*.test.*"]
|
|
31
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright: 2025 Contrast Security, Inc
|
|
3
|
-
* Contact: support@contrastsecurity.com
|
|
4
|
-
* License: Commercial
|
|
5
|
-
|
|
6
|
-
* NOTICE: This Software and the patented inventions embodied within may only be
|
|
7
|
-
* used as part of Contrast Security’s commercial offerings. Even though it is
|
|
8
|
-
* made available through public repositories, use of this Software is subject to
|
|
9
|
-
* the applicable End User Licensing Agreement found at
|
|
10
|
-
* https://www.contrastsecurity.com/enduser-terms-0317a or as otherwise agreed
|
|
11
|
-
* between Contrast Security and the End User. The Software may not be reverse
|
|
12
|
-
* engineered, modified, repackaged, sold, redistributed or otherwise used in a
|
|
13
|
-
* way not consistent with the End User License Agreement.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
'use strict';
|
|
17
|
-
|
|
18
|
-
const { patchType } = require('../constants');
|
|
19
|
-
|
|
20
|
-
module.exports = function(core) {
|
|
21
|
-
const {
|
|
22
|
-
scopes: { instrumentation },
|
|
23
|
-
patcher,
|
|
24
|
-
depHooks,
|
|
25
|
-
protect,
|
|
26
|
-
protect: { inputTracing }
|
|
27
|
-
} = core;
|
|
28
|
-
|
|
29
|
-
function install() {
|
|
30
|
-
depHooks.resolve({ name: 'spdy', version: '<5' }, spdy => {
|
|
31
|
-
const name = 'spdy.response.end';
|
|
32
|
-
patcher.patch(spdy.response, 'end', {
|
|
33
|
-
name,
|
|
34
|
-
patchType,
|
|
35
|
-
pre({ args, obj: response, hooked }) {
|
|
36
|
-
if (instrumentation.isLocked()) return;
|
|
37
|
-
|
|
38
|
-
const sourceContext = protect.getSourceContext();
|
|
39
|
-
|
|
40
|
-
if (!sourceContext) return;
|
|
41
|
-
|
|
42
|
-
const value = args[0]?.toString();
|
|
43
|
-
if (!value) return;
|
|
44
|
-
|
|
45
|
-
const sinkContext = {
|
|
46
|
-
name,
|
|
47
|
-
value,
|
|
48
|
-
stacktraceOpts: { constructorOpt: hooked },
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
response.spdyStream.once('finish', () => response.emit('finish'));
|
|
52
|
-
inputTracing.handleReflectedXss(sourceContext, sinkContext);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const spdyInstrumentation = inputTracing.spdyInstrumentation = {
|
|
59
|
-
install
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
return spdyInstrumentation;
|
|
63
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const fs = require('fs')
|
|
4
|
-
const SonicBoom = require('../')
|
|
5
|
-
const { file, runTests } = require('./helper')
|
|
6
|
-
|
|
7
|
-
runTests(buildTests)
|
|
8
|
-
|
|
9
|
-
function buildTests (test, sync) {
|
|
10
|
-
// Reset the umask for testing
|
|
11
|
-
process.umask(0o000)
|
|
12
|
-
|
|
13
|
-
test('destroy', (t) => {
|
|
14
|
-
t.plan(5)
|
|
15
|
-
|
|
16
|
-
const dest = file()
|
|
17
|
-
const fd = fs.openSync(dest, 'w')
|
|
18
|
-
const stream = new SonicBoom({ fd, sync })
|
|
19
|
-
|
|
20
|
-
t.ok(stream.write('hello world\n'))
|
|
21
|
-
stream.destroy()
|
|
22
|
-
t.throws(() => { stream.write('hello world\n') })
|
|
23
|
-
|
|
24
|
-
fs.readFile(dest, 'utf8', function (err, data) {
|
|
25
|
-
t.error(err)
|
|
26
|
-
t.equal(data, 'hello world\n')
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
stream.on('finish', () => {
|
|
30
|
-
t.fail('finish emitted')
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
stream.on('close', () => {
|
|
34
|
-
t.pass('close emitted')
|
|
35
|
-
})
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
test('destroy while opening', (t) => {
|
|
39
|
-
t.plan(1)
|
|
40
|
-
|
|
41
|
-
const dest = file()
|
|
42
|
-
const stream = new SonicBoom({ dest })
|
|
43
|
-
|
|
44
|
-
stream.destroy()
|
|
45
|
-
stream.on('close', () => {
|
|
46
|
-
t.pass('close emitted')
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
}
|