@contrast/agent-bundle 5.42.0 → 5.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -10
- package/node_modules/@contrast/agent/README.md +1 -10
- package/node_modules/@contrast/agent/package.json +12 -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/handler.js +21 -24
- 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 +11 -22
- package/node_modules/@contrast/assess/lib/index.js +1 -1
- package/node_modules/@contrast/assess/lib/make-source-context.js +5 -10
- package/node_modules/@contrast/assess/lib/policy.js +400 -0
- package/node_modules/@contrast/assess/lib/response-scanning/handlers/index.js +10 -14
- package/node_modules/@contrast/assess/lib/response-scanning/install/http.js +0 -12
- package/node_modules/@contrast/assess/lib/session-configuration/handlers.js +1 -1
- 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 +37 -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 +269 -238
- 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.js +17 -7
- 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/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 +14 -5
- package/node_modules/@swc/types/package.json +2 -2
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/assert/strict.d.ts +105 -2
- package/node_modules/@types/node/assert.d.ts +119 -95
- 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 +161 -17
- package/node_modules/@types/node/dns.d.ts +5 -0
- package/node_modules/@types/node/events.d.ts +79 -33
- package/node_modules/@types/node/fs/promises.d.ts +41 -26
- package/node_modules/@types/node/fs.d.ts +276 -35
- package/node_modules/@types/node/globals.d.ts +148 -347
- package/node_modules/@types/node/http.d.ts +57 -8
- 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 -4089
- package/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/node_modules/@types/node/module.d.ts +1 -0
- package/node_modules/@types/node/net.d.ts +21 -0
- package/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/node/sqlite.d.ts +34 -0
- package/node_modules/@types/node/test.d.ts +106 -23
- 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 +25 -6
- package/node_modules/@types/node/util.d.ts +11 -4
- 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} +49 -51
- 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 +84 -50
- package/node_modules/@types/node/zlib.d.ts +6 -0
- 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 +0 -4
- package/node_modules/undici-types/client.d.ts +0 -2
- package/node_modules/undici-types/diagnostics-channel.d.ts +9 -0
- package/node_modules/undici-types/dispatcher.d.ts +3 -8
- 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/h2c-client.d.ts +0 -2
- package/node_modules/undici-types/handlers.d.ts +1 -1
- package/node_modules/undici-types/index.d.ts +3 -1
- package/node_modules/undici-types/mock-client.d.ts +2 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +2 -1
- 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/retry-handler.d.ts +9 -0
- package/node_modules/undici-types/snapshot-agent.d.ts +107 -0
- package/node_modules/undici-types/webidl.d.ts +29 -15
- package/node_modules/undici-types/websocket.d.ts +3 -1
- package/package.json +3 -3
- package/node_modules/@contrast/assess/lib/get-policy.js +0 -336
- 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/node-addon-api/tools/eslint-format.js +0 -79
|
@@ -7,15 +7,11 @@ const path = require('path')
|
|
|
7
7
|
const sleep = require('atomic-sleep')
|
|
8
8
|
|
|
9
9
|
const BUSY_WRITE_TIMEOUT = 100
|
|
10
|
-
const kEmptyBuffer = Buffer.allocUnsafe(0)
|
|
11
10
|
|
|
12
11
|
// 16 KB. Don't write more than docker buffer size.
|
|
13
12
|
// https://github.com/moby/moby/blob/513ec73831269947d38a644c278ce3cac36783b2/daemon/logger/copier.go#L13
|
|
14
13
|
const MAX_WRITE = 16 * 1024
|
|
15
14
|
|
|
16
|
-
const kContentModeBuffer = 'buffer'
|
|
17
|
-
const kContentModeUtf8 = 'utf8'
|
|
18
|
-
|
|
19
15
|
function openFile (file, sonic) {
|
|
20
16
|
sonic._opening = true
|
|
21
17
|
sonic._writing = true
|
|
@@ -42,8 +38,6 @@ function openFile (file, sonic) {
|
|
|
42
38
|
return
|
|
43
39
|
}
|
|
44
40
|
|
|
45
|
-
const reopening = sonic._reopening
|
|
46
|
-
|
|
47
41
|
sonic.fd = fd
|
|
48
42
|
sonic.file = file
|
|
49
43
|
sonic._reopening = false
|
|
@@ -56,15 +50,13 @@ function openFile (file, sonic) {
|
|
|
56
50
|
sonic.emit('ready')
|
|
57
51
|
}
|
|
58
52
|
|
|
59
|
-
if (sonic.
|
|
53
|
+
if (sonic._reopening) {
|
|
60
54
|
return
|
|
61
55
|
}
|
|
62
56
|
|
|
63
57
|
// start
|
|
64
|
-
if (
|
|
65
|
-
sonic
|
|
66
|
-
} else if (reopening) {
|
|
67
|
-
process.nextTick(() => sonic.emit('drain'))
|
|
58
|
+
if (!sonic._writing && sonic._len > sonic.minLength && !sonic.destroyed) {
|
|
59
|
+
actualWrite(sonic)
|
|
68
60
|
}
|
|
69
61
|
}
|
|
70
62
|
|
|
@@ -95,19 +87,18 @@ function SonicBoom (opts) {
|
|
|
95
87
|
return new SonicBoom(opts)
|
|
96
88
|
}
|
|
97
89
|
|
|
98
|
-
let { fd, dest, minLength, maxLength, maxWrite, sync, append = true, mkdir, retryEAGAIN, fsync
|
|
90
|
+
let { fd, dest, minLength, maxLength, maxWrite, sync, append = true, mode, mkdir, retryEAGAIN, fsync } = opts || {}
|
|
99
91
|
|
|
100
92
|
fd = fd || dest
|
|
101
93
|
|
|
94
|
+
this._bufs = []
|
|
102
95
|
this._len = 0
|
|
103
96
|
this.fd = -1
|
|
104
|
-
this._bufs = []
|
|
105
|
-
this._lens = []
|
|
106
97
|
this._writing = false
|
|
98
|
+
this._writingBuf = ''
|
|
107
99
|
this._ending = false
|
|
108
100
|
this._reopening = false
|
|
109
101
|
this._asyncDrainScheduled = false
|
|
110
|
-
this._flushPending = false
|
|
111
102
|
this._hwm = Math.max(minLength || 0, 16387)
|
|
112
103
|
this.file = null
|
|
113
104
|
this.destroyed = false
|
|
@@ -115,35 +106,12 @@ function SonicBoom (opts) {
|
|
|
115
106
|
this.maxLength = maxLength || 0
|
|
116
107
|
this.maxWrite = maxWrite || MAX_WRITE
|
|
117
108
|
this.sync = sync || false
|
|
118
|
-
this.writable = true
|
|
119
109
|
this._fsync = fsync || false
|
|
120
110
|
this.append = append || false
|
|
121
111
|
this.mode = mode
|
|
122
112
|
this.retryEAGAIN = retryEAGAIN || (() => true)
|
|
123
113
|
this.mkdir = mkdir || false
|
|
124
114
|
|
|
125
|
-
let fsWriteSync
|
|
126
|
-
let fsWrite
|
|
127
|
-
if (contentMode === kContentModeBuffer) {
|
|
128
|
-
this._writingBuf = kEmptyBuffer
|
|
129
|
-
this.write = writeBuffer
|
|
130
|
-
this.flush = flushBuffer
|
|
131
|
-
this.flushSync = flushBufferSync
|
|
132
|
-
this._actualWrite = actualWriteBuffer
|
|
133
|
-
fsWriteSync = () => fs.writeSync(this.fd, this._writingBuf)
|
|
134
|
-
fsWrite = () => fs.write(this.fd, this._writingBuf, this.release)
|
|
135
|
-
} else if (contentMode === undefined || contentMode === kContentModeUtf8) {
|
|
136
|
-
this._writingBuf = ''
|
|
137
|
-
this.write = write
|
|
138
|
-
this.flush = flush
|
|
139
|
-
this.flushSync = flushSync
|
|
140
|
-
this._actualWrite = actualWrite
|
|
141
|
-
fsWriteSync = () => fs.writeSync(this.fd, this._writingBuf, 'utf8')
|
|
142
|
-
fsWrite = () => fs.write(this.fd, this._writingBuf, 'utf8', this.release)
|
|
143
|
-
} else {
|
|
144
|
-
throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`)
|
|
145
|
-
}
|
|
146
|
-
|
|
147
115
|
if (typeof fd === 'number') {
|
|
148
116
|
this.fd = fd
|
|
149
117
|
process.nextTick(() => this.emit('ready'))
|
|
@@ -158,7 +126,7 @@ function SonicBoom (opts) {
|
|
|
158
126
|
|
|
159
127
|
this.release = (err, n) => {
|
|
160
128
|
if (err) {
|
|
161
|
-
if (
|
|
129
|
+
if (err.code === 'EAGAIN' && this.retryEAGAIN(err, this._writingBuf.length, this._len - this._writingBuf.length)) {
|
|
162
130
|
if (this.sync) {
|
|
163
131
|
// This error code should not happen in sync mode, because it is
|
|
164
132
|
// not using the underlining operating system asynchronous functions.
|
|
@@ -172,7 +140,9 @@ function SonicBoom (opts) {
|
|
|
172
140
|
}
|
|
173
141
|
} else {
|
|
174
142
|
// Let's give the destination some time to process the chunk.
|
|
175
|
-
setTimeout(
|
|
143
|
+
setTimeout(() => {
|
|
144
|
+
fs.write(this.fd, this._writingBuf, 'utf8', this.release)
|
|
145
|
+
}, BUSY_WRITE_TIMEOUT)
|
|
176
146
|
}
|
|
177
147
|
} else {
|
|
178
148
|
this._writing = false
|
|
@@ -183,23 +153,34 @@ function SonicBoom (opts) {
|
|
|
183
153
|
}
|
|
184
154
|
|
|
185
155
|
this.emit('write', n)
|
|
186
|
-
|
|
187
|
-
this._len
|
|
188
|
-
|
|
156
|
+
|
|
157
|
+
this._len -= n
|
|
158
|
+
// In case of multi-byte characters, the length of the written buffer
|
|
159
|
+
// may be different from the length of the string. Let's make sure
|
|
160
|
+
// we do not have an accumulated string with a negative length.
|
|
161
|
+
// This also mean that ._len is not precise, but it's not a problem as some
|
|
162
|
+
// writes might be triggered earlier than ._minLength.
|
|
163
|
+
if (this._len < 0) {
|
|
164
|
+
this._len = 0
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// TODO if we have a multi-byte character in the buffer, we need to
|
|
168
|
+
// n might not be the same as this._writingBuf.length, so we might loose
|
|
169
|
+
// characters here. The solution to this problem is to use a Buffer for _writingBuf.
|
|
170
|
+
this._writingBuf = this._writingBuf.slice(n)
|
|
189
171
|
|
|
190
172
|
if (this._writingBuf.length) {
|
|
191
173
|
if (!this.sync) {
|
|
192
|
-
|
|
174
|
+
fs.write(this.fd, this._writingBuf, 'utf8', this.release)
|
|
193
175
|
return
|
|
194
176
|
}
|
|
195
177
|
|
|
196
178
|
try {
|
|
197
179
|
do {
|
|
198
|
-
const n =
|
|
199
|
-
|
|
200
|
-
this.
|
|
201
|
-
|
|
202
|
-
} while (this._writingBuf.length)
|
|
180
|
+
const n = fs.writeSync(this.fd, this._writingBuf, 'utf8')
|
|
181
|
+
this._len -= n
|
|
182
|
+
this._writingBuf = this._writingBuf.slice(n)
|
|
183
|
+
} while (this._writingBuf)
|
|
203
184
|
} catch (err) {
|
|
204
185
|
this.release(err)
|
|
205
186
|
return
|
|
@@ -216,10 +197,10 @@ function SonicBoom (opts) {
|
|
|
216
197
|
this._reopening = false
|
|
217
198
|
this.reopen()
|
|
218
199
|
} else if (len > this.minLength) {
|
|
219
|
-
this
|
|
200
|
+
actualWrite(this)
|
|
220
201
|
} else if (this._ending) {
|
|
221
202
|
if (len > 0) {
|
|
222
|
-
this
|
|
203
|
+
actualWrite(this)
|
|
223
204
|
} else {
|
|
224
205
|
this._writing = false
|
|
225
206
|
actualClose(this)
|
|
@@ -244,25 +225,6 @@ function SonicBoom (opts) {
|
|
|
244
225
|
})
|
|
245
226
|
}
|
|
246
227
|
|
|
247
|
-
/**
|
|
248
|
-
* Release the writingBuf after fs.write n bytes data
|
|
249
|
-
* @param {string | Buffer} writingBuf - currently writing buffer, usually be instance._writingBuf.
|
|
250
|
-
* @param {number} len - currently buffer length, usually be instance._len.
|
|
251
|
-
* @param {number} n - number of bytes fs already written
|
|
252
|
-
* @returns {{writingBuf: string | Buffer, len: number}} released writingBuf and length
|
|
253
|
-
*/
|
|
254
|
-
function releaseWritingBuf (writingBuf, len, n) {
|
|
255
|
-
// if Buffer.byteLength is equal to n, that means writingBuf contains no multi-byte character
|
|
256
|
-
if (typeof writingBuf === 'string' && Buffer.byteLength(writingBuf) !== n) {
|
|
257
|
-
// Since the fs.write callback parameter `n` means how many bytes the passed of string
|
|
258
|
-
// We calculate the original string length for avoiding the multi-byte character issue
|
|
259
|
-
n = Buffer.from(writingBuf).subarray(0, n).toString().length
|
|
260
|
-
}
|
|
261
|
-
len = Math.max(len - n, 0)
|
|
262
|
-
writingBuf = writingBuf.slice(n)
|
|
263
|
-
return { writingBuf, len }
|
|
264
|
-
}
|
|
265
|
-
|
|
266
228
|
function emitDrain (sonic) {
|
|
267
229
|
const hasListeners = sonic.listenerCount('drain') > 0
|
|
268
230
|
if (!hasListeners) return
|
|
@@ -272,19 +234,7 @@ function emitDrain (sonic) {
|
|
|
272
234
|
|
|
273
235
|
inherits(SonicBoom, EventEmitter)
|
|
274
236
|
|
|
275
|
-
function
|
|
276
|
-
if (bufs.length === 0) {
|
|
277
|
-
return kEmptyBuffer
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
if (bufs.length === 1) {
|
|
281
|
-
return bufs[0]
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
return Buffer.concat(bufs, len)
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
function write (data) {
|
|
237
|
+
SonicBoom.prototype.write = function (data) {
|
|
288
238
|
if (this.destroyed) {
|
|
289
239
|
throw new Error('SonicBoom destroyed')
|
|
290
240
|
}
|
|
@@ -309,96 +259,18 @@ function write (data) {
|
|
|
309
259
|
this._len = len
|
|
310
260
|
|
|
311
261
|
if (!this._writing && this._len >= this.minLength) {
|
|
312
|
-
this
|
|
262
|
+
actualWrite(this)
|
|
313
263
|
}
|
|
314
264
|
|
|
315
265
|
return this._len < this._hwm
|
|
316
266
|
}
|
|
317
267
|
|
|
318
|
-
function
|
|
268
|
+
SonicBoom.prototype.flush = function () {
|
|
319
269
|
if (this.destroyed) {
|
|
320
270
|
throw new Error('SonicBoom destroyed')
|
|
321
271
|
}
|
|
322
272
|
|
|
323
|
-
|
|
324
|
-
const bufs = this._bufs
|
|
325
|
-
const lens = this._lens
|
|
326
|
-
|
|
327
|
-
if (this.maxLength && len > this.maxLength) {
|
|
328
|
-
this.emit('drop', data)
|
|
329
|
-
return this._len < this._hwm
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
if (
|
|
333
|
-
bufs.length === 0 ||
|
|
334
|
-
lens[lens.length - 1] + data.length > this.maxWrite
|
|
335
|
-
) {
|
|
336
|
-
bufs.push([data])
|
|
337
|
-
lens.push(data.length)
|
|
338
|
-
} else {
|
|
339
|
-
bufs[bufs.length - 1].push(data)
|
|
340
|
-
lens[lens.length - 1] += data.length
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
this._len = len
|
|
344
|
-
|
|
345
|
-
if (!this._writing && this._len >= this.minLength) {
|
|
346
|
-
this._actualWrite()
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
return this._len < this._hwm
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
function callFlushCallbackOnDrain (cb) {
|
|
353
|
-
this._flushPending = true
|
|
354
|
-
const onDrain = () => {
|
|
355
|
-
// only if _fsync is false to avoid double fsync
|
|
356
|
-
if (!this._fsync) {
|
|
357
|
-
fs.fsync(this.fd, (err) => {
|
|
358
|
-
this._flushPending = false
|
|
359
|
-
cb(err)
|
|
360
|
-
})
|
|
361
|
-
} else {
|
|
362
|
-
this._flushPending = false
|
|
363
|
-
cb()
|
|
364
|
-
}
|
|
365
|
-
this.off('error', onError)
|
|
366
|
-
}
|
|
367
|
-
const onError = (err) => {
|
|
368
|
-
this._flushPending = false
|
|
369
|
-
cb(err)
|
|
370
|
-
this.off('drain', onDrain)
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
this.once('drain', onDrain)
|
|
374
|
-
this.once('error', onError)
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
function flush (cb) {
|
|
378
|
-
if (cb != null && typeof cb !== 'function') {
|
|
379
|
-
throw new Error('flush cb must be a function')
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
if (this.destroyed) {
|
|
383
|
-
const error = new Error('SonicBoom destroyed')
|
|
384
|
-
if (cb) {
|
|
385
|
-
cb(error)
|
|
386
|
-
return
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
throw error
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
if (this.minLength <= 0) {
|
|
393
|
-
cb?.()
|
|
394
|
-
return
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
if (cb) {
|
|
398
|
-
callFlushCallbackOnDrain.call(this, cb)
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
if (this._writing) {
|
|
273
|
+
if (this._writing || this.minLength <= 0) {
|
|
402
274
|
return
|
|
403
275
|
}
|
|
404
276
|
|
|
@@ -406,43 +278,7 @@ function flush (cb) {
|
|
|
406
278
|
this._bufs.push('')
|
|
407
279
|
}
|
|
408
280
|
|
|
409
|
-
this
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
function flushBuffer (cb) {
|
|
413
|
-
if (cb != null && typeof cb !== 'function') {
|
|
414
|
-
throw new Error('flush cb must be a function')
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
if (this.destroyed) {
|
|
418
|
-
const error = new Error('SonicBoom destroyed')
|
|
419
|
-
if (cb) {
|
|
420
|
-
cb(error)
|
|
421
|
-
return
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
throw error
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
if (this.minLength <= 0) {
|
|
428
|
-
cb?.()
|
|
429
|
-
return
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
if (cb) {
|
|
433
|
-
callFlushCallbackOnDrain.call(this, cb)
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
if (this._writing) {
|
|
437
|
-
return
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
if (this._bufs.length === 0) {
|
|
441
|
-
this._bufs.push([])
|
|
442
|
-
this._lens.push(0)
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
this._actualWrite()
|
|
281
|
+
actualWrite(this)
|
|
446
282
|
}
|
|
447
283
|
|
|
448
284
|
SonicBoom.prototype.reopen = function (file) {
|
|
@@ -465,9 +301,6 @@ SonicBoom.prototype.reopen = function (file) {
|
|
|
465
301
|
throw new Error('Unable to reopen a file descriptor, you must pass a file to SonicBoom')
|
|
466
302
|
}
|
|
467
303
|
|
|
468
|
-
if (file) {
|
|
469
|
-
this.file = file
|
|
470
|
-
}
|
|
471
304
|
this._reopening = true
|
|
472
305
|
|
|
473
306
|
if (this._writing) {
|
|
@@ -485,7 +318,7 @@ SonicBoom.prototype.reopen = function (file) {
|
|
|
485
318
|
}
|
|
486
319
|
})
|
|
487
320
|
|
|
488
|
-
openFile(this.file, this)
|
|
321
|
+
openFile(file || this.file, this)
|
|
489
322
|
}
|
|
490
323
|
|
|
491
324
|
SonicBoom.prototype.end = function () {
|
|
@@ -511,13 +344,13 @@ SonicBoom.prototype.end = function () {
|
|
|
511
344
|
}
|
|
512
345
|
|
|
513
346
|
if (this._len > 0 && this.fd >= 0) {
|
|
514
|
-
this
|
|
347
|
+
actualWrite(this)
|
|
515
348
|
} else {
|
|
516
349
|
actualClose(this)
|
|
517
350
|
}
|
|
518
351
|
}
|
|
519
352
|
|
|
520
|
-
function
|
|
353
|
+
SonicBoom.prototype.flushSync = function () {
|
|
521
354
|
if (this.destroyed) {
|
|
522
355
|
throw new Error('SonicBoom destroyed')
|
|
523
356
|
}
|
|
@@ -531,66 +364,13 @@ function flushSync () {
|
|
|
531
364
|
this._writingBuf = ''
|
|
532
365
|
}
|
|
533
366
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
if (buf.length <= 0) {
|
|
537
|
-
buf = this._bufs[0]
|
|
538
|
-
}
|
|
539
|
-
try {
|
|
540
|
-
const n = fs.writeSync(this.fd, buf, 'utf8')
|
|
541
|
-
const releasedBufObj = releaseWritingBuf(buf, this._len, n)
|
|
542
|
-
buf = releasedBufObj.writingBuf
|
|
543
|
-
this._len = releasedBufObj.len
|
|
544
|
-
if (buf.length <= 0) {
|
|
545
|
-
this._bufs.shift()
|
|
546
|
-
}
|
|
547
|
-
} catch (err) {
|
|
548
|
-
const shouldRetry = err.code === 'EAGAIN' || err.code === 'EBUSY'
|
|
549
|
-
if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) {
|
|
550
|
-
throw err
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
sleep(BUSY_WRITE_TIMEOUT)
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
try {
|
|
558
|
-
fs.fsyncSync(this.fd)
|
|
559
|
-
} catch {
|
|
560
|
-
// Skip the error. The fd might not support fsync.
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
function flushBufferSync () {
|
|
565
|
-
if (this.destroyed) {
|
|
566
|
-
throw new Error('SonicBoom destroyed')
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
if (this.fd < 0) {
|
|
570
|
-
throw new Error('sonic boom is not ready yet')
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
if (!this._writing && this._writingBuf.length > 0) {
|
|
574
|
-
this._bufs.unshift([this._writingBuf])
|
|
575
|
-
this._writingBuf = kEmptyBuffer
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
let buf = kEmptyBuffer
|
|
579
|
-
while (this._bufs.length || buf.length) {
|
|
580
|
-
if (buf.length <= 0) {
|
|
581
|
-
buf = mergeBuf(this._bufs[0], this._lens[0])
|
|
582
|
-
}
|
|
367
|
+
while (this._bufs.length) {
|
|
368
|
+
const buf = this._bufs[0]
|
|
583
369
|
try {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
this._len = Math.max(this._len - n, 0)
|
|
587
|
-
if (buf.length <= 0) {
|
|
588
|
-
this._bufs.shift()
|
|
589
|
-
this._lens.shift()
|
|
590
|
-
}
|
|
370
|
+
this._len -= fs.writeSync(this.fd, buf, 'utf8')
|
|
371
|
+
this._bufs.shift()
|
|
591
372
|
} catch (err) {
|
|
592
|
-
|
|
593
|
-
if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) {
|
|
373
|
+
if (err.code !== 'EAGAIN' || !this.retryEAGAIN(err, buf.length, this._len - buf.length)) {
|
|
594
374
|
throw err
|
|
595
375
|
}
|
|
596
376
|
|
|
@@ -606,37 +386,20 @@ SonicBoom.prototype.destroy = function () {
|
|
|
606
386
|
actualClose(this)
|
|
607
387
|
}
|
|
608
388
|
|
|
609
|
-
function actualWrite () {
|
|
610
|
-
const release =
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
if (this.sync) {
|
|
615
|
-
try {
|
|
616
|
-
const written = fs.writeSync(this.fd, this._writingBuf, 'utf8')
|
|
617
|
-
release(null, written)
|
|
618
|
-
} catch (err) {
|
|
619
|
-
release(err)
|
|
620
|
-
}
|
|
621
|
-
} else {
|
|
622
|
-
fs.write(this.fd, this._writingBuf, 'utf8', release)
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
function actualWriteBuffer () {
|
|
627
|
-
const release = this.release
|
|
628
|
-
this._writing = true
|
|
629
|
-
this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift())
|
|
389
|
+
function actualWrite (sonic) {
|
|
390
|
+
const release = sonic.release
|
|
391
|
+
sonic._writing = true
|
|
392
|
+
sonic._writingBuf = sonic._writingBuf || sonic._bufs.shift() || ''
|
|
630
393
|
|
|
631
|
-
if (
|
|
394
|
+
if (sonic.sync) {
|
|
632
395
|
try {
|
|
633
|
-
const written = fs.writeSync(
|
|
396
|
+
const written = fs.writeSync(sonic.fd, sonic._writingBuf, 'utf8')
|
|
634
397
|
release(null, written)
|
|
635
398
|
} catch (err) {
|
|
636
399
|
release(err)
|
|
637
400
|
}
|
|
638
401
|
} else {
|
|
639
|
-
fs.write(
|
|
402
|
+
fs.write(sonic.fd, sonic._writingBuf, 'utf8', release)
|
|
640
403
|
}
|
|
641
404
|
}
|
|
642
405
|
|
|
@@ -648,18 +411,11 @@ function actualClose (sonic) {
|
|
|
648
411
|
|
|
649
412
|
sonic.destroyed = true
|
|
650
413
|
sonic._bufs = []
|
|
651
|
-
sonic._lens = []
|
|
652
|
-
|
|
653
|
-
fs.fsync(sonic.fd, closeWrapped)
|
|
654
414
|
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
fs.close(sonic.fd, done)
|
|
660
|
-
} else {
|
|
661
|
-
done()
|
|
662
|
-
}
|
|
415
|
+
if (sonic.fd !== 1 && sonic.fd !== 2) {
|
|
416
|
+
fs.close(sonic.fd, done)
|
|
417
|
+
} else {
|
|
418
|
+
setImmediate(done)
|
|
663
419
|
}
|
|
664
420
|
|
|
665
421
|
function done (err) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sonic-boom",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Extremely fast utf8 only stream implementation",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"types": "types/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"test": "npm run test:types && standard &&
|
|
10
|
-
"test:unit": "tap",
|
|
9
|
+
"test": "npm run test:types && standard && tap test.js",
|
|
10
|
+
"test:unit": "tap test.js",
|
|
11
11
|
"test:types": "tsc && tsd && ts-node types/tests/test.ts",
|
|
12
12
|
"prepare": "husky install"
|
|
13
13
|
},
|
|
@@ -31,19 +31,24 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/pinojs/sonic-boom#readme",
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/node": "^
|
|
34
|
+
"@types/node": "^18.0.0",
|
|
35
35
|
"fastbench": "^1.0.1",
|
|
36
|
-
"husky": "^
|
|
36
|
+
"husky": "^8.0.1",
|
|
37
37
|
"proxyquire": "^2.1.3",
|
|
38
38
|
"standard": "^17.0.0",
|
|
39
39
|
"tap": "^16.2.0",
|
|
40
|
-
"tsd": "^0.
|
|
41
|
-
"typescript": "^
|
|
40
|
+
"tsd": "^0.22.0",
|
|
41
|
+
"typescript": "^4.7.2",
|
|
42
42
|
"ts-node": "^10.8.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"atomic-sleep": "^1.0.0"
|
|
46
46
|
},
|
|
47
|
+
"husky": {
|
|
48
|
+
"hooks": {
|
|
49
|
+
"pre-commit": "npm test"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
47
52
|
"tsd": {
|
|
48
53
|
"directory": "./types"
|
|
49
54
|
}
|