@contrast/agent-bundle 5.42.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.
Files changed (468) hide show
  1. package/README.md +1 -10
  2. package/node_modules/@contrast/agent/README.md +1 -10
  3. package/node_modules/@contrast/agent/package.json +12 -12
  4. package/node_modules/@contrast/agent-swc-plugin/package.json +3 -3
  5. package/node_modules/@contrast/agentify/lib/rewrite-hooks.js +3 -3
  6. package/node_modules/@contrast/agentify/lib/utils.js +13 -7
  7. package/node_modules/@contrast/agentify/package.json +17 -17
  8. package/node_modules/@contrast/architecture-components/package.json +6 -6
  9. package/node_modules/@contrast/assess/lib/dataflow/propagation/install/ejs/template.js +1 -1
  10. package/node_modules/@contrast/assess/lib/dataflow/propagation/install/pug/index.js +1 -1
  11. package/node_modules/@contrast/assess/lib/dataflow/sinks/install/http/server-response.js +1 -12
  12. package/node_modules/@contrast/assess/lib/dataflow/sinks/install/restify.js +1 -1
  13. package/node_modules/@contrast/assess/lib/dataflow/sources/install/http.js +1 -1
  14. package/node_modules/@contrast/assess/lib/dataflow/tracker.js +1 -1
  15. package/node_modules/@contrast/assess/lib/get-source-context.js +1 -1
  16. package/node_modules/@contrast/assess/lib/response-scanning/install/http.js +0 -12
  17. package/node_modules/@contrast/assess/package.json +14 -14
  18. package/node_modules/@contrast/code-events/binding.gyp +1 -1
  19. package/node_modules/@contrast/code-events/package.json +11 -9
  20. package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi108.node +0 -0
  21. package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi115.node +0 -0
  22. package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/@contrast+code-events.abi127.node +0 -0
  23. package/node_modules/@contrast/code-events/prebuilds/darwin-x64+arm64/{@contrast+code-events.abi93.node → @contrast+code-events.abi137.node} +0 -0
  24. package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi108.armv8.node +0 -0
  25. package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi115.armv8.node +0 -0
  26. package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi127.armv8.node +0 -0
  27. package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi137.armv8.node +0 -0
  28. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi108.glibc.node +0 -0
  29. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi108.musl.node +0 -0
  30. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi115.glibc.node +0 -0
  31. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi115.musl.node +0 -0
  32. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi127.glibc.node +0 -0
  33. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi127.musl.node +0 -0
  34. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi137.glibc.node +0 -0
  35. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi137.musl.node +0 -0
  36. package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi108.node +0 -0
  37. package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi115.node +0 -0
  38. package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi127.node +0 -0
  39. package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi137.node +0 -0
  40. package/node_modules/@contrast/common/lib/constants.d.ts +1 -1
  41. package/node_modules/@contrast/common/lib/constants.js +1 -1
  42. package/node_modules/@contrast/common/lib/index.js +15 -15
  43. package/node_modules/@contrast/common/lib/primordials.d.ts +22 -20
  44. package/node_modules/@contrast/common/lib/types.d.ts +18 -6
  45. package/node_modules/@contrast/common/package.json +2 -2
  46. package/node_modules/@contrast/config/lib/options.js +29 -4
  47. package/node_modules/@contrast/config/package.json +4 -4
  48. package/node_modules/@contrast/core/lib/app-info.js +53 -74
  49. package/node_modules/@contrast/core/lib/index.d.ts +17 -1
  50. package/node_modules/@contrast/core/lib/sensitive-data-masking/index.js +33 -5
  51. package/node_modules/@contrast/core/package.json +10 -9
  52. package/node_modules/@contrast/deadzones/package.json +6 -6
  53. package/node_modules/@contrast/dep-hooks/lib/export-handler-registry.d.ts +17 -13
  54. package/node_modules/@contrast/dep-hooks/lib/export-handler-registry.js +16 -4
  55. package/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.d.ts +2 -2
  56. package/node_modules/@contrast/dep-hooks/lib/export-hook-descriptor.js +2 -3
  57. package/node_modules/@contrast/dep-hooks/lib/handler-invoker.d.ts +6 -6
  58. package/node_modules/@contrast/dep-hooks/lib/handler-invoker.js +0 -1
  59. package/node_modules/@contrast/dep-hooks/lib/helpers.d.ts +0 -7
  60. package/node_modules/@contrast/dep-hooks/lib/helpers.js +2 -18
  61. package/node_modules/@contrast/dep-hooks/lib/index.d.ts +17 -12
  62. package/node_modules/@contrast/dep-hooks/lib/index.js +5 -3
  63. package/node_modules/@contrast/dep-hooks/lib/package-finder.d.ts +2 -1
  64. package/node_modules/@contrast/dep-hooks/lib/package-finder.js +6 -6
  65. package/node_modules/@contrast/dep-hooks/package.json +4 -3
  66. package/node_modules/@contrast/distringuish/package.json +7 -6
  67. package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi108.node +0 -0
  68. package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi115.node +0 -0
  69. package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/@contrast+distringuish.abi127.node +0 -0
  70. package/node_modules/@contrast/distringuish/prebuilds/darwin-x64+arm64/{@contrast+distringuish.abi93.node → @contrast+distringuish.abi137.node} +0 -0
  71. package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi108.armv8.node +0 -0
  72. package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi115.armv8.node +0 -0
  73. package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi127.armv8.node +0 -0
  74. package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi137.armv8.node +0 -0
  75. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi108.glibc.node +0 -0
  76. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi108.musl.node +0 -0
  77. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi115.glibc.node +0 -0
  78. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi115.musl.node +0 -0
  79. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi127.glibc.node +0 -0
  80. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi127.musl.node +0 -0
  81. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi137.glibc.node +0 -0
  82. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi137.musl.node +0 -0
  83. package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi108.node +0 -0
  84. package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi115.node +0 -0
  85. package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi127.node +0 -0
  86. package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi137.node +0 -0
  87. package/node_modules/@contrast/esm-hooks/lib/debug-methods.mjs +4 -4
  88. package/node_modules/@contrast/esm-hooks/lib/get-file-type.mjs +2 -9
  89. package/node_modules/@contrast/esm-hooks/lib/hooks.mjs +0 -2
  90. package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/fs/promises.mjs +2 -0
  91. package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/fs.mjs +3 -0
  92. package/node_modules/@contrast/esm-hooks/lib/redirects/builtin/util.mjs +1 -0
  93. package/node_modules/@contrast/esm-hooks/package.json +7 -7
  94. package/node_modules/@contrast/fn-inspect/package.json +9 -5
  95. package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi108.node +0 -0
  96. package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi115.node +0 -0
  97. package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/@contrast+fn-inspect.abi127.node +0 -0
  98. package/node_modules/@contrast/fn-inspect/prebuilds/darwin-x64+arm64/{@contrast+fn-inspect.abi93.node → @contrast+fn-inspect.abi137.node} +0 -0
  99. package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi108.armv8.node +0 -0
  100. package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi115.armv8.node +0 -0
  101. package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi127.armv8.node +0 -0
  102. package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi137.armv8.node +0 -0
  103. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi108.glibc.node +0 -0
  104. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi108.musl.node +0 -0
  105. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi115.glibc.node +0 -0
  106. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi115.musl.node +0 -0
  107. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi127.glibc.node +0 -0
  108. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi127.musl.node +0 -0
  109. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi137.glibc.node +0 -0
  110. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/{@contrast+fn-inspect.abi93.musl.node → @contrast+fn-inspect.abi137.musl.node} +0 -0
  111. package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi108.node +0 -0
  112. package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi115.node +0 -0
  113. package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi127.node +0 -0
  114. package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi137.node +0 -0
  115. package/node_modules/@contrast/instrumentation/lib/http2.js +0 -11
  116. package/node_modules/@contrast/instrumentation/package.json +6 -6
  117. package/node_modules/@contrast/library-analysis/lib/install/library-reporting/dep.json +312 -224
  118. package/node_modules/@contrast/library-analysis/package.json +6 -6
  119. package/node_modules/@contrast/logger/lib/index.js +18 -8
  120. package/node_modules/@contrast/logger/lib/serializers.js +5 -5
  121. package/node_modules/@contrast/logger/lib/utils.d.ts +0 -6
  122. package/node_modules/@contrast/logger/package.json +4 -4
  123. package/node_modules/@contrast/metrics/lib/index.d.ts +6 -6
  124. package/node_modules/@contrast/metrics/lib/index.js +0 -1
  125. package/node_modules/@contrast/metrics/package.json +7 -7
  126. package/node_modules/@contrast/patcher/package.json +3 -3
  127. package/node_modules/@contrast/perf/package.json +7 -4
  128. package/node_modules/@contrast/protect/lib/hardening/handlers.js +37 -21
  129. package/node_modules/@contrast/protect/lib/index.d.ts +3 -2
  130. package/node_modules/@contrast/protect/lib/index.js +9 -2
  131. package/node_modules/@contrast/protect/lib/input-analysis/handlers.js +275 -233
  132. package/node_modules/@contrast/protect/lib/input-analysis/install/http.js +3 -4
  133. package/node_modules/@contrast/protect/lib/input-tracing/{handlers/index.js → handlers.js} +15 -15
  134. package/node_modules/@contrast/protect/lib/input-tracing/index.js +0 -1
  135. package/node_modules/@contrast/protect/lib/make-source-context.js +5 -7
  136. package/node_modules/@contrast/protect/lib/policy.js +130 -95
  137. package/node_modules/@contrast/protect/lib/semantic-analysis/handlers.js +19 -18
  138. package/node_modules/@contrast/protect/package.json +12 -12
  139. package/node_modules/@contrast/reporter/lib/index.js +1 -1
  140. package/node_modules/@contrast/reporter/lib/reporters/base.d.ts +0 -1
  141. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.d.ts +4 -2
  142. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/index.js +14 -14
  143. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.d.ts +43 -6
  144. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/application-activity/translations.js +262 -429
  145. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/server-inventory.d.ts +3 -3
  146. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/index.js +17 -7
  147. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/endpoints/traces/translations.js +12 -13
  148. package/node_modules/@contrast/reporter/lib/reporters/contrast-ui/utils.js +6 -7
  149. package/node_modules/@contrast/reporter/lib/reporters/file.js +1 -1
  150. package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.d.ts +2 -3
  151. package/node_modules/@contrast/reporter/lib/reporters/security-logger/index.js +72 -86
  152. package/node_modules/@contrast/reporter/lib/reporters/security-logger/messages.js +6 -7
  153. package/node_modules/@contrast/reporter/lib/validators.js +0 -1
  154. package/node_modules/@contrast/reporter/node_modules/sonic-boom/.husky/pre-commit +2 -2
  155. package/node_modules/@contrast/reporter/node_modules/sonic-boom/.taprc +5 -0
  156. package/node_modules/@contrast/reporter/node_modules/sonic-boom/README.md +2 -4
  157. package/node_modules/@contrast/reporter/node_modules/sonic-boom/bench.js +5 -36
  158. package/node_modules/@contrast/reporter/node_modules/sonic-boom/index.js +56 -300
  159. package/node_modules/@contrast/reporter/node_modules/sonic-boom/package.json +12 -7
  160. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test.js +1684 -0
  161. package/node_modules/@contrast/reporter/node_modules/sonic-boom/types/index.d.ts +1 -2
  162. package/node_modules/@contrast/reporter/package.json +10 -10
  163. package/node_modules/@contrast/rewriter/lib/index.js +5 -43
  164. package/node_modules/@contrast/rewriter/package.json +8 -8
  165. package/node_modules/@contrast/route-coverage/lib/install/express/express5.js +0 -5
  166. package/node_modules/@contrast/route-coverage/lib/install/restify.js +1 -1
  167. package/node_modules/@contrast/route-coverage/package.json +10 -10
  168. package/node_modules/@contrast/scopes/package.json +6 -6
  169. package/node_modules/@contrast/sec-obs/lib/traces/http.js +1 -1
  170. package/node_modules/@contrast/sec-obs/lib/traces/http.test.js +1 -1
  171. package/node_modules/@contrast/sec-obs/package.json +10 -10
  172. package/node_modules/@contrast/sources/lib/index.js +1 -1
  173. package/node_modules/@contrast/sources/lib/index.test.js +0 -26
  174. package/node_modules/@contrast/sources/package.json +3 -3
  175. package/node_modules/@contrast/telemetry/package.json +6 -6
  176. package/node_modules/@opentelemetry/semantic-conventions/README.md +3 -2
  177. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.d.ts +4350 -2882
  178. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +4350 -2882
  179. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js.map +1 -1
  180. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.d.ts +136 -0
  181. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js +154 -0
  182. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js.map +1 -0
  183. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.d.ts +713 -141
  184. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +713 -141
  185. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js.map +1 -1
  186. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.d.ts +2 -0
  187. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js +2 -0
  188. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js.map +1 -1
  189. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.d.ts +1 -0
  190. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js +1 -0
  191. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js.map +1 -1
  192. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.d.ts +7 -1
  193. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +7 -1
  194. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js.map +1 -1
  195. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.d.ts +5 -0
  196. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js +23 -0
  197. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js.map +1 -0
  198. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.d.ts +1 -1
  199. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +1 -1
  200. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js.map +1 -1
  201. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.d.ts +4350 -2882
  202. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +4350 -2882
  203. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js.map +1 -1
  204. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.d.ts +136 -0
  205. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js +154 -0
  206. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js.map +1 -0
  207. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.d.ts +713 -141
  208. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +713 -141
  209. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js.map +1 -1
  210. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.d.ts +2 -0
  211. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js +2 -0
  212. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js.map +1 -1
  213. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.d.ts +1 -0
  214. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js +1 -0
  215. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js.map +1 -1
  216. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.d.ts +7 -1
  217. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +7 -1
  218. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js.map +1 -1
  219. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.d.ts +5 -0
  220. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js +23 -0
  221. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js.map +1 -0
  222. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.d.ts +1 -1
  223. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +1 -1
  224. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js.map +1 -1
  225. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.d.ts +4350 -2882
  226. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +4354 -2883
  227. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js.map +1 -1
  228. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.d.ts +136 -0
  229. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js +157 -0
  230. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js.map +1 -0
  231. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.d.ts +713 -141
  232. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +720 -147
  233. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js.map +1 -1
  234. package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.d.ts +2 -0
  235. package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js +2 -0
  236. package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js.map +1 -1
  237. package/node_modules/@opentelemetry/semantic-conventions/build/src/index.d.ts +1 -0
  238. package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js +1 -0
  239. package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js.map +1 -1
  240. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.d.ts +7 -1
  241. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +10 -4
  242. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js.map +1 -1
  243. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.d.ts +5 -0
  244. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js +26 -0
  245. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js.map +1 -0
  246. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.d.ts +1 -1
  247. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +1 -1
  248. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js.map +1 -1
  249. package/node_modules/@opentelemetry/semantic-conventions/package.json +6 -7
  250. package/node_modules/@swc/core/README.md +5 -0
  251. package/node_modules/@swc/core/binding.d.ts +2 -2
  252. package/node_modules/@swc/core/index.d.ts +5 -4
  253. package/node_modules/@swc/core/index.js +2 -2
  254. package/node_modules/@swc/core/package.json +12 -12
  255. package/node_modules/@swc/core-darwin-arm64/package.json +1 -1
  256. package/node_modules/@swc/core-darwin-arm64/swc.darwin-arm64.node +0 -0
  257. package/node_modules/@swc/core-darwin-x64/package.json +1 -1
  258. package/node_modules/@swc/core-darwin-x64/swc.darwin-x64.node +0 -0
  259. package/node_modules/@swc/core-linux-arm64-gnu/package.json +1 -1
  260. package/node_modules/@swc/core-linux-arm64-gnu/swc.linux-arm64-gnu.node +0 -0
  261. package/node_modules/@swc/core-linux-arm64-musl/package.json +1 -1
  262. package/node_modules/@swc/core-linux-arm64-musl/swc.linux-arm64-musl.node +0 -0
  263. package/node_modules/@swc/core-linux-x64-gnu/package.json +1 -1
  264. package/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
  265. package/node_modules/@swc/core-linux-x64-musl/package.json +1 -1
  266. package/node_modules/@swc/core-linux-x64-musl/swc.linux-x64-musl.node +0 -0
  267. package/node_modules/@swc/core-win32-arm64-msvc/package.json +1 -1
  268. package/node_modules/@swc/core-win32-arm64-msvc/swc.win32-arm64-msvc.node +0 -0
  269. package/node_modules/@swc/core-win32-x64-msvc/package.json +1 -1
  270. package/node_modules/@swc/core-win32-x64-msvc/swc.win32-x64-msvc.node +0 -0
  271. package/node_modules/@swc/types/index.d.ts +14 -5
  272. package/node_modules/@swc/types/package.json +2 -2
  273. package/node_modules/@types/node/README.md +1 -1
  274. package/node_modules/@types/node/buffer.d.ts +1 -1
  275. package/node_modules/@types/node/child_process.d.ts +26 -122
  276. package/node_modules/@types/node/crypto.d.ts +44 -10
  277. package/node_modules/@types/node/dns.d.ts +5 -0
  278. package/node_modules/@types/node/fs/promises.d.ts +41 -26
  279. package/node_modules/@types/node/fs.d.ts +52 -35
  280. package/node_modules/@types/node/globals.d.ts +148 -347
  281. package/node_modules/@types/node/http.d.ts +29 -5
  282. package/node_modules/@types/node/https.d.ts +5 -0
  283. package/node_modules/@types/node/index.d.ts +7 -2
  284. package/node_modules/@types/node/inspector.d.ts +187 -4089
  285. package/node_modules/@types/node/inspector.generated.d.ts +4052 -0
  286. package/node_modules/@types/node/module.d.ts +1 -0
  287. package/node_modules/@types/node/net.d.ts +21 -0
  288. package/node_modules/@types/node/package.json +3 -3
  289. package/node_modules/@types/node/sqlite.d.ts +34 -0
  290. package/node_modules/@types/node/test.d.ts +104 -0
  291. package/node_modules/@types/node/tls.d.ts +32 -0
  292. package/node_modules/@types/node/ts5.6/index.d.ts +7 -2
  293. package/node_modules/@types/node/ts5.7/index.d.ts +7 -2
  294. package/node_modules/@types/node/url.d.ts +19 -5
  295. package/node_modules/@types/node/util.d.ts +6 -4
  296. package/node_modules/@types/node/vm.d.ts +73 -10
  297. package/node_modules/@types/node/wasi.d.ts +21 -0
  298. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  299. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  300. package/node_modules/@types/node/{dom-events.d.ts → web-globals/events.d.ts} +47 -52
  301. package/node_modules/@types/node/web-globals/fetch.d.ts +50 -0
  302. package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  303. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  304. package/node_modules/@types/node/worker_threads.d.ts +51 -3
  305. package/node_modules/axios/CHANGELOG.md +58 -0
  306. package/node_modules/axios/README.md +87 -10
  307. package/node_modules/axios/dist/axios.js +355 -289
  308. package/node_modules/axios/dist/axios.js.map +1 -1
  309. package/node_modules/axios/dist/axios.min.js +2 -2
  310. package/node_modules/axios/dist/axios.min.js.map +1 -1
  311. package/node_modules/axios/dist/browser/axios.cjs +286 -213
  312. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  313. package/node_modules/axios/dist/esm/axios.js +286 -213
  314. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  315. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  316. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  317. package/node_modules/axios/dist/node/axios.cjs +377 -213
  318. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  319. package/node_modules/axios/index.d.cts +12 -5
  320. package/node_modules/axios/index.d.ts +13 -4
  321. package/node_modules/axios/lib/adapters/adapters.js +6 -4
  322. package/node_modules/axios/lib/adapters/fetch.js +221 -162
  323. package/node_modules/axios/lib/adapters/http.js +18 -0
  324. package/node_modules/axios/lib/adapters/xhr.js +11 -8
  325. package/node_modules/axios/lib/core/Axios.js +0 -2
  326. package/node_modules/axios/lib/core/AxiosError.js +10 -3
  327. package/node_modules/axios/lib/core/dispatchRequest.js +1 -1
  328. package/node_modules/axios/lib/defaults/index.js +1 -1
  329. package/node_modules/axios/lib/env/data.js +1 -1
  330. package/node_modules/axios/lib/helpers/buildURL.js +1 -3
  331. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +73 -0
  332. package/node_modules/axios/lib/helpers/resolveConfig.js +13 -9
  333. package/node_modules/axios/lib/utils.js +5 -3
  334. package/node_modules/axios/package.json +18 -12
  335. package/node_modules/balanced-match/.github/FUNDING.yml +2 -0
  336. package/node_modules/balanced-match/LICENSE.md +21 -0
  337. package/node_modules/balanced-match/README.md +97 -0
  338. package/node_modules/balanced-match/index.js +62 -0
  339. package/node_modules/balanced-match/package.json +48 -0
  340. package/node_modules/brace-expansion/.github/FUNDING.yml +2 -0
  341. package/node_modules/brace-expansion/LICENSE +21 -0
  342. package/node_modules/brace-expansion/README.md +135 -0
  343. package/node_modules/brace-expansion/index.js +203 -0
  344. package/node_modules/brace-expansion/package.json +49 -0
  345. package/node_modules/detect-libc/lib/detect-libc.js +59 -13
  346. package/node_modules/detect-libc/lib/elf.js +39 -0
  347. package/node_modules/detect-libc/lib/filesystem.js +18 -8
  348. package/node_modules/detect-libc/package.json +3 -2
  349. package/node_modules/minimatch/LICENSE +15 -0
  350. package/node_modules/minimatch/README.md +454 -0
  351. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts +2 -0
  352. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map +1 -0
  353. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
  354. package/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map +1 -0
  355. package/node_modules/minimatch/dist/commonjs/ast.d.ts +20 -0
  356. package/node_modules/minimatch/dist/commonjs/ast.d.ts.map +1 -0
  357. package/node_modules/minimatch/dist/commonjs/ast.js +592 -0
  358. package/node_modules/minimatch/dist/commonjs/ast.js.map +1 -0
  359. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts +8 -0
  360. package/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map +1 -0
  361. package/node_modules/minimatch/dist/commonjs/brace-expressions.js +152 -0
  362. package/node_modules/minimatch/dist/commonjs/brace-expressions.js.map +1 -0
  363. package/node_modules/minimatch/dist/commonjs/escape.d.ts +12 -0
  364. package/node_modules/minimatch/dist/commonjs/escape.d.ts.map +1 -0
  365. package/node_modules/minimatch/dist/commonjs/escape.js +22 -0
  366. package/node_modules/minimatch/dist/commonjs/escape.js.map +1 -0
  367. package/node_modules/minimatch/dist/commonjs/index.d.ts +94 -0
  368. package/node_modules/minimatch/dist/commonjs/index.d.ts.map +1 -0
  369. package/node_modules/minimatch/dist/commonjs/index.js +1017 -0
  370. package/node_modules/minimatch/dist/commonjs/index.js.map +1 -0
  371. package/node_modules/minimatch/dist/commonjs/package.json +3 -0
  372. package/node_modules/minimatch/dist/commonjs/unescape.d.ts +17 -0
  373. package/node_modules/minimatch/dist/commonjs/unescape.d.ts.map +1 -0
  374. package/node_modules/minimatch/dist/commonjs/unescape.js +24 -0
  375. package/node_modules/minimatch/dist/commonjs/unescape.js.map +1 -0
  376. package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts +2 -0
  377. package/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map +1 -0
  378. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
  379. package/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map +1 -0
  380. package/node_modules/minimatch/dist/esm/ast.d.ts +20 -0
  381. package/node_modules/minimatch/dist/esm/ast.d.ts.map +1 -0
  382. package/node_modules/minimatch/dist/esm/ast.js +588 -0
  383. package/node_modules/minimatch/dist/esm/ast.js.map +1 -0
  384. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts +8 -0
  385. package/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map +1 -0
  386. package/node_modules/minimatch/dist/esm/brace-expressions.js +148 -0
  387. package/node_modules/minimatch/dist/esm/brace-expressions.js.map +1 -0
  388. package/node_modules/minimatch/dist/esm/escape.d.ts +12 -0
  389. package/node_modules/minimatch/dist/esm/escape.d.ts.map +1 -0
  390. package/node_modules/minimatch/dist/esm/escape.js +18 -0
  391. package/node_modules/minimatch/dist/esm/escape.js.map +1 -0
  392. package/node_modules/minimatch/dist/esm/index.d.ts +94 -0
  393. package/node_modules/minimatch/dist/esm/index.d.ts.map +1 -0
  394. package/node_modules/minimatch/dist/esm/index.js +1001 -0
  395. package/node_modules/minimatch/dist/esm/index.js.map +1 -0
  396. package/node_modules/minimatch/dist/esm/package.json +3 -0
  397. package/node_modules/minimatch/dist/esm/unescape.d.ts +17 -0
  398. package/node_modules/minimatch/dist/esm/unescape.d.ts.map +1 -0
  399. package/node_modules/minimatch/dist/esm/unescape.js +20 -0
  400. package/node_modules/minimatch/dist/esm/unescape.js.map +1 -0
  401. package/node_modules/minimatch/package.json +82 -0
  402. package/node_modules/node-abi/LICENSE +21 -0
  403. package/node_modules/node-abi/README.md +54 -0
  404. package/node_modules/node-abi/abi_registry.json +408 -0
  405. package/node_modules/node-abi/getNextTarget.js +13 -0
  406. package/node_modules/node-abi/index.js +161 -0
  407. package/node_modules/node-abi/package.json +46 -0
  408. package/node_modules/node-addon-api/README.md +25 -249
  409. package/node_modules/node-addon-api/common.gypi +1 -0
  410. package/node_modules/node-addon-api/index.js +2 -0
  411. package/node_modules/node-addon-api/napi-inl.h +592 -166
  412. package/node_modules/node-addon-api/napi.h +167 -59
  413. package/node_modules/node-addon-api/node_addon_api.gyp +10 -0
  414. package/node_modules/node-addon-api/noexcept.gypi +1 -1
  415. package/node_modules/node-addon-api/package.json +13 -13
  416. package/node_modules/node-addon-api/tools/conversion.js +1 -1
  417. package/node_modules/protobufjs/dist/light/protobuf.js +2 -2
  418. package/node_modules/protobufjs/dist/light/protobuf.min.js +2 -2
  419. package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  420. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  421. package/node_modules/protobufjs/dist/protobuf.js +2 -2
  422. package/node_modules/protobufjs/dist/protobuf.min.js +2 -2
  423. package/node_modules/protobufjs/google/protobuf/descriptor.json +2 -2
  424. package/node_modules/protobufjs/google/protobuf/descriptor.proto +2 -1
  425. package/node_modules/protobufjs/package.json +1 -1
  426. package/node_modules/undici-types/diagnostics-channel.d.ts +9 -0
  427. package/node_modules/undici-types/dispatcher.d.ts +3 -2
  428. package/node_modules/undici-types/env-http-proxy-agent.d.ts +2 -1
  429. package/node_modules/undici-types/eventsource.d.ts +3 -3
  430. package/node_modules/undici-types/fetch.d.ts +1 -0
  431. package/node_modules/undici-types/handlers.d.ts +1 -1
  432. package/node_modules/undici-types/mock-client.d.ts +2 -0
  433. package/node_modules/undici-types/mock-interceptor.d.ts +2 -0
  434. package/node_modules/undici-types/mock-pool.d.ts +2 -0
  435. package/node_modules/undici-types/package.json +1 -1
  436. package/node_modules/undici-types/retry-handler.d.ts +9 -0
  437. package/node_modules/undici-types/webidl.d.ts +29 -15
  438. package/node_modules/undici-types/websocket.d.ts +3 -1
  439. package/package.json +3 -3
  440. package/node_modules/@contrast/code-events/prebuilds/linux-arm64/@contrast+code-events.abi93.armv8.node +0 -0
  441. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi93.glibc.node +0 -0
  442. package/node_modules/@contrast/code-events/prebuilds/linux-x64/@contrast+code-events.abi93.musl.node +0 -0
  443. package/node_modules/@contrast/code-events/prebuilds/win32-x64/@contrast+code-events.abi93.node +0 -0
  444. package/node_modules/@contrast/core/lib/sensitive-data-masking/protect-listener.js +0 -111
  445. package/node_modules/@contrast/distringuish/prebuilds/linux-arm64/@contrast+distringuish.abi93.armv8.node +0 -0
  446. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi93.glibc.node +0 -0
  447. package/node_modules/@contrast/distringuish/prebuilds/linux-x64/@contrast+distringuish.abi93.musl.node +0 -0
  448. package/node_modules/@contrast/distringuish/prebuilds/win32-x64/@contrast+distringuish.abi93.node +0 -0
  449. package/node_modules/@contrast/fn-inspect/prebuilds/linux-arm64/@contrast+fn-inspect.abi93.armv8.node +0 -0
  450. package/node_modules/@contrast/fn-inspect/prebuilds/linux-x64/@contrast+fn-inspect.abi93.glibc.node +0 -0
  451. package/node_modules/@contrast/fn-inspect/prebuilds/win32-x64/@contrast+fn-inspect.abi93.node +0 -0
  452. package/node_modules/@contrast/perf/lib/index.test.js +0 -547
  453. package/node_modules/@contrast/perf/lib/tsconfig.json +0 -31
  454. package/node_modules/@contrast/protect/lib/input-tracing/install/spdy.js +0 -63
  455. package/node_modules/@contrast/reporter/node_modules/sonic-boom/.taprc.yaml +0 -11
  456. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/destroy.test.js +0 -49
  457. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/end.test.js +0 -98
  458. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/flush-sync.test.js +0 -140
  459. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/flush.test.js +0 -419
  460. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/fsync.test.js +0 -63
  461. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/helper.js +0 -42
  462. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/minlength.test.js +0 -35
  463. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/mode.test.js +0 -116
  464. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/reopen.test.js +0 -239
  465. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/retry.test.js +0 -414
  466. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/sync.test.js +0 -261
  467. package/node_modules/@contrast/reporter/node_modules/sonic-boom/test/write.test.js +0 -465
  468. package/node_modules/node-addon-api/tools/eslint-format.js +0 -79
@@ -0,0 +1,592 @@
1
+ "use strict";
2
+ // parse a single path portion
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AST = void 0;
5
+ const brace_expressions_js_1 = require("./brace-expressions.js");
6
+ const unescape_js_1 = require("./unescape.js");
7
+ const types = new Set(['!', '?', '+', '*', '@']);
8
+ const isExtglobType = (c) => types.has(c);
9
+ // Patterns that get prepended to bind to the start of either the
10
+ // entire string, or just a single path portion, to prevent dots
11
+ // and/or traversal patterns, when needed.
12
+ // Exts don't need the ^ or / bit, because the root binds that already.
13
+ const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
14
+ const startNoDot = '(?!\\.)';
15
+ // characters that indicate a start of pattern needs the "no dots" bit,
16
+ // because a dot *might* be matched. ( is not in the list, because in
17
+ // the case of a child extglob, it will handle the prevention itself.
18
+ const addPatternStart = new Set(['[', '.']);
19
+ // cases where traversal is A-OK, no dot prevention needed
20
+ const justDots = new Set(['..', '.']);
21
+ const reSpecials = new Set('().*{}+?[]^$\\!');
22
+ const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
23
+ // any single thing other than /
24
+ const qmark = '[^/]';
25
+ // * => any number of characters
26
+ const star = qmark + '*?';
27
+ // use + when we need to ensure that *something* matches, because the * is
28
+ // the only thing in the path portion.
29
+ const starNoEmpty = qmark + '+?';
30
+ // remove the \ chars that we added if we end up doing a nonmagic compare
31
+ // const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
32
+ class AST {
33
+ type;
34
+ #root;
35
+ #hasMagic;
36
+ #uflag = false;
37
+ #parts = [];
38
+ #parent;
39
+ #parentIndex;
40
+ #negs;
41
+ #filledNegs = false;
42
+ #options;
43
+ #toString;
44
+ // set to true if it's an extglob with no children
45
+ // (which really means one child of '')
46
+ #emptyExt = false;
47
+ constructor(type, parent, options = {}) {
48
+ this.type = type;
49
+ // extglobs are inherently magical
50
+ if (type)
51
+ this.#hasMagic = true;
52
+ this.#parent = parent;
53
+ this.#root = this.#parent ? this.#parent.#root : this;
54
+ this.#options = this.#root === this ? options : this.#root.#options;
55
+ this.#negs = this.#root === this ? [] : this.#root.#negs;
56
+ if (type === '!' && !this.#root.#filledNegs)
57
+ this.#negs.push(this);
58
+ this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
59
+ }
60
+ get hasMagic() {
61
+ /* c8 ignore start */
62
+ if (this.#hasMagic !== undefined)
63
+ return this.#hasMagic;
64
+ /* c8 ignore stop */
65
+ for (const p of this.#parts) {
66
+ if (typeof p === 'string')
67
+ continue;
68
+ if (p.type || p.hasMagic)
69
+ return (this.#hasMagic = true);
70
+ }
71
+ // note: will be undefined until we generate the regexp src and find out
72
+ return this.#hasMagic;
73
+ }
74
+ // reconstructs the pattern
75
+ toString() {
76
+ if (this.#toString !== undefined)
77
+ return this.#toString;
78
+ if (!this.type) {
79
+ return (this.#toString = this.#parts.map(p => String(p)).join(''));
80
+ }
81
+ else {
82
+ return (this.#toString =
83
+ this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')');
84
+ }
85
+ }
86
+ #fillNegs() {
87
+ /* c8 ignore start */
88
+ if (this !== this.#root)
89
+ throw new Error('should only call on root');
90
+ if (this.#filledNegs)
91
+ return this;
92
+ /* c8 ignore stop */
93
+ // call toString() once to fill this out
94
+ this.toString();
95
+ this.#filledNegs = true;
96
+ let n;
97
+ while ((n = this.#negs.pop())) {
98
+ if (n.type !== '!')
99
+ continue;
100
+ // walk up the tree, appending everthing that comes AFTER parentIndex
101
+ let p = n;
102
+ let pp = p.#parent;
103
+ while (pp) {
104
+ for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
105
+ for (const part of n.#parts) {
106
+ /* c8 ignore start */
107
+ if (typeof part === 'string') {
108
+ throw new Error('string part in extglob AST??');
109
+ }
110
+ /* c8 ignore stop */
111
+ part.copyIn(pp.#parts[i]);
112
+ }
113
+ }
114
+ p = pp;
115
+ pp = p.#parent;
116
+ }
117
+ }
118
+ return this;
119
+ }
120
+ push(...parts) {
121
+ for (const p of parts) {
122
+ if (p === '')
123
+ continue;
124
+ /* c8 ignore start */
125
+ if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) {
126
+ throw new Error('invalid part: ' + p);
127
+ }
128
+ /* c8 ignore stop */
129
+ this.#parts.push(p);
130
+ }
131
+ }
132
+ toJSON() {
133
+ const ret = this.type === null
134
+ ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON()))
135
+ : [this.type, ...this.#parts.map(p => p.toJSON())];
136
+ if (this.isStart() && !this.type)
137
+ ret.unshift([]);
138
+ if (this.isEnd() &&
139
+ (this === this.#root ||
140
+ (this.#root.#filledNegs && this.#parent?.type === '!'))) {
141
+ ret.push({});
142
+ }
143
+ return ret;
144
+ }
145
+ isStart() {
146
+ if (this.#root === this)
147
+ return true;
148
+ // if (this.type) return !!this.#parent?.isStart()
149
+ if (!this.#parent?.isStart())
150
+ return false;
151
+ if (this.#parentIndex === 0)
152
+ return true;
153
+ // if everything AHEAD of this is a negation, then it's still the "start"
154
+ const p = this.#parent;
155
+ for (let i = 0; i < this.#parentIndex; i++) {
156
+ const pp = p.#parts[i];
157
+ if (!(pp instanceof AST && pp.type === '!')) {
158
+ return false;
159
+ }
160
+ }
161
+ return true;
162
+ }
163
+ isEnd() {
164
+ if (this.#root === this)
165
+ return true;
166
+ if (this.#parent?.type === '!')
167
+ return true;
168
+ if (!this.#parent?.isEnd())
169
+ return false;
170
+ if (!this.type)
171
+ return this.#parent?.isEnd();
172
+ // if not root, it'll always have a parent
173
+ /* c8 ignore start */
174
+ const pl = this.#parent ? this.#parent.#parts.length : 0;
175
+ /* c8 ignore stop */
176
+ return this.#parentIndex === pl - 1;
177
+ }
178
+ copyIn(part) {
179
+ if (typeof part === 'string')
180
+ this.push(part);
181
+ else
182
+ this.push(part.clone(this));
183
+ }
184
+ clone(parent) {
185
+ const c = new AST(this.type, parent);
186
+ for (const p of this.#parts) {
187
+ c.copyIn(p);
188
+ }
189
+ return c;
190
+ }
191
+ static #parseAST(str, ast, pos, opt) {
192
+ let escaping = false;
193
+ let inBrace = false;
194
+ let braceStart = -1;
195
+ let braceNeg = false;
196
+ if (ast.type === null) {
197
+ // outside of a extglob, append until we find a start
198
+ let i = pos;
199
+ let acc = '';
200
+ while (i < str.length) {
201
+ const c = str.charAt(i++);
202
+ // still accumulate escapes at this point, but we do ignore
203
+ // starts that are escaped
204
+ if (escaping || c === '\\') {
205
+ escaping = !escaping;
206
+ acc += c;
207
+ continue;
208
+ }
209
+ if (inBrace) {
210
+ if (i === braceStart + 1) {
211
+ if (c === '^' || c === '!') {
212
+ braceNeg = true;
213
+ }
214
+ }
215
+ else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
216
+ inBrace = false;
217
+ }
218
+ acc += c;
219
+ continue;
220
+ }
221
+ else if (c === '[') {
222
+ inBrace = true;
223
+ braceStart = i;
224
+ braceNeg = false;
225
+ acc += c;
226
+ continue;
227
+ }
228
+ if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') {
229
+ ast.push(acc);
230
+ acc = '';
231
+ const ext = new AST(c, ast);
232
+ i = AST.#parseAST(str, ext, i, opt);
233
+ ast.push(ext);
234
+ continue;
235
+ }
236
+ acc += c;
237
+ }
238
+ ast.push(acc);
239
+ return i;
240
+ }
241
+ // some kind of extglob, pos is at the (
242
+ // find the next | or )
243
+ let i = pos + 1;
244
+ let part = new AST(null, ast);
245
+ const parts = [];
246
+ let acc = '';
247
+ while (i < str.length) {
248
+ const c = str.charAt(i++);
249
+ // still accumulate escapes at this point, but we do ignore
250
+ // starts that are escaped
251
+ if (escaping || c === '\\') {
252
+ escaping = !escaping;
253
+ acc += c;
254
+ continue;
255
+ }
256
+ if (inBrace) {
257
+ if (i === braceStart + 1) {
258
+ if (c === '^' || c === '!') {
259
+ braceNeg = true;
260
+ }
261
+ }
262
+ else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
263
+ inBrace = false;
264
+ }
265
+ acc += c;
266
+ continue;
267
+ }
268
+ else if (c === '[') {
269
+ inBrace = true;
270
+ braceStart = i;
271
+ braceNeg = false;
272
+ acc += c;
273
+ continue;
274
+ }
275
+ if (isExtglobType(c) && str.charAt(i) === '(') {
276
+ part.push(acc);
277
+ acc = '';
278
+ const ext = new AST(c, part);
279
+ part.push(ext);
280
+ i = AST.#parseAST(str, ext, i, opt);
281
+ continue;
282
+ }
283
+ if (c === '|') {
284
+ part.push(acc);
285
+ acc = '';
286
+ parts.push(part);
287
+ part = new AST(null, ast);
288
+ continue;
289
+ }
290
+ if (c === ')') {
291
+ if (acc === '' && ast.#parts.length === 0) {
292
+ ast.#emptyExt = true;
293
+ }
294
+ part.push(acc);
295
+ acc = '';
296
+ ast.push(...parts, part);
297
+ return i;
298
+ }
299
+ acc += c;
300
+ }
301
+ // unfinished extglob
302
+ // if we got here, it was a malformed extglob! not an extglob, but
303
+ // maybe something else in there.
304
+ ast.type = null;
305
+ ast.#hasMagic = undefined;
306
+ ast.#parts = [str.substring(pos - 1)];
307
+ return i;
308
+ }
309
+ static fromGlob(pattern, options = {}) {
310
+ const ast = new AST(null, undefined, options);
311
+ AST.#parseAST(pattern, ast, 0, options);
312
+ return ast;
313
+ }
314
+ // returns the regular expression if there's magic, or the unescaped
315
+ // string if not.
316
+ toMMPattern() {
317
+ // should only be called on root
318
+ /* c8 ignore start */
319
+ if (this !== this.#root)
320
+ return this.#root.toMMPattern();
321
+ /* c8 ignore stop */
322
+ const glob = this.toString();
323
+ const [re, body, hasMagic, uflag] = this.toRegExpSource();
324
+ // if we're in nocase mode, and not nocaseMagicOnly, then we do
325
+ // still need a regular expression if we have to case-insensitively
326
+ // match capital/lowercase characters.
327
+ const anyMagic = hasMagic ||
328
+ this.#hasMagic ||
329
+ (this.#options.nocase &&
330
+ !this.#options.nocaseMagicOnly &&
331
+ glob.toUpperCase() !== glob.toLowerCase());
332
+ if (!anyMagic) {
333
+ return body;
334
+ }
335
+ const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
336
+ return Object.assign(new RegExp(`^${re}$`, flags), {
337
+ _src: re,
338
+ _glob: glob,
339
+ });
340
+ }
341
+ get options() {
342
+ return this.#options;
343
+ }
344
+ // returns the string match, the regexp source, whether there's magic
345
+ // in the regexp (so a regular expression is required) and whether or
346
+ // not the uflag is needed for the regular expression (for posix classes)
347
+ // TODO: instead of injecting the start/end at this point, just return
348
+ // the BODY of the regexp, along with the start/end portions suitable
349
+ // for binding the start/end in either a joined full-path makeRe context
350
+ // (where we bind to (^|/), or a standalone matchPart context (where
351
+ // we bind to ^, and not /). Otherwise slashes get duped!
352
+ //
353
+ // In part-matching mode, the start is:
354
+ // - if not isStart: nothing
355
+ // - if traversal possible, but not allowed: ^(?!\.\.?$)
356
+ // - if dots allowed or not possible: ^
357
+ // - if dots possible and not allowed: ^(?!\.)
358
+ // end is:
359
+ // - if not isEnd(): nothing
360
+ // - else: $
361
+ //
362
+ // In full-path matching mode, we put the slash at the START of the
363
+ // pattern, so start is:
364
+ // - if first pattern: same as part-matching mode
365
+ // - if not isStart(): nothing
366
+ // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
367
+ // - if dots allowed or not possible: /
368
+ // - if dots possible and not allowed: /(?!\.)
369
+ // end is:
370
+ // - if last pattern, same as part-matching mode
371
+ // - else nothing
372
+ //
373
+ // Always put the (?:$|/) on negated tails, though, because that has to be
374
+ // there to bind the end of the negated pattern portion, and it's easier to
375
+ // just stick it in now rather than try to inject it later in the middle of
376
+ // the pattern.
377
+ //
378
+ // We can just always return the same end, and leave it up to the caller
379
+ // to know whether it's going to be used joined or in parts.
380
+ // And, if the start is adjusted slightly, can do the same there:
381
+ // - if not isStart: nothing
382
+ // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
383
+ // - if dots allowed or not possible: (?:/|^)
384
+ // - if dots possible and not allowed: (?:/|^)(?!\.)
385
+ //
386
+ // But it's better to have a simpler binding without a conditional, for
387
+ // performance, so probably better to return both start options.
388
+ //
389
+ // Then the caller just ignores the end if it's not the first pattern,
390
+ // and the start always gets applied.
391
+ //
392
+ // But that's always going to be $ if it's the ending pattern, or nothing,
393
+ // so the caller can just attach $ at the end of the pattern when building.
394
+ //
395
+ // So the todo is:
396
+ // - better detect what kind of start is needed
397
+ // - return both flavors of starting pattern
398
+ // - attach $ at the end of the pattern when creating the actual RegExp
399
+ //
400
+ // Ah, but wait, no, that all only applies to the root when the first pattern
401
+ // is not an extglob. If the first pattern IS an extglob, then we need all
402
+ // that dot prevention biz to live in the extglob portions, because eg
403
+ // +(*|.x*) can match .xy but not .yx.
404
+ //
405
+ // So, return the two flavors if it's #root and the first child is not an
406
+ // AST, otherwise leave it to the child AST to handle it, and there,
407
+ // use the (?:^|/) style of start binding.
408
+ //
409
+ // Even simplified further:
410
+ // - Since the start for a join is eg /(?!\.) and the start for a part
411
+ // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
412
+ // or start or whatever) and prepend ^ or / at the Regexp construction.
413
+ toRegExpSource(allowDot) {
414
+ const dot = allowDot ?? !!this.#options.dot;
415
+ if (this.#root === this)
416
+ this.#fillNegs();
417
+ if (!this.type) {
418
+ const noEmpty = this.isStart() && this.isEnd();
419
+ const src = this.#parts
420
+ .map(p => {
421
+ const [re, _, hasMagic, uflag] = typeof p === 'string'
422
+ ? AST.#parseGlob(p, this.#hasMagic, noEmpty)
423
+ : p.toRegExpSource(allowDot);
424
+ this.#hasMagic = this.#hasMagic || hasMagic;
425
+ this.#uflag = this.#uflag || uflag;
426
+ return re;
427
+ })
428
+ .join('');
429
+ let start = '';
430
+ if (this.isStart()) {
431
+ if (typeof this.#parts[0] === 'string') {
432
+ // this is the string that will match the start of the pattern,
433
+ // so we need to protect against dots and such.
434
+ // '.' and '..' cannot match unless the pattern is that exactly,
435
+ // even if it starts with . or dot:true is set.
436
+ const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
437
+ if (!dotTravAllowed) {
438
+ const aps = addPatternStart;
439
+ // check if we have a possibility of matching . or ..,
440
+ // and prevent that.
441
+ const needNoTrav =
442
+ // dots are allowed, and the pattern starts with [ or .
443
+ (dot && aps.has(src.charAt(0))) ||
444
+ // the pattern starts with \., and then [ or .
445
+ (src.startsWith('\\.') && aps.has(src.charAt(2))) ||
446
+ // the pattern starts with \.\., and then [ or .
447
+ (src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
448
+ // no need to prevent dots if it can't match a dot, or if a
449
+ // sub-pattern will be preventing it anyway.
450
+ const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
451
+ start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : '';
452
+ }
453
+ }
454
+ }
455
+ // append the "end of path portion" pattern to negation tails
456
+ let end = '';
457
+ if (this.isEnd() &&
458
+ this.#root.#filledNegs &&
459
+ this.#parent?.type === '!') {
460
+ end = '(?:$|\\/)';
461
+ }
462
+ const final = start + src + end;
463
+ return [
464
+ final,
465
+ (0, unescape_js_1.unescape)(src),
466
+ (this.#hasMagic = !!this.#hasMagic),
467
+ this.#uflag,
468
+ ];
469
+ }
470
+ // We need to calculate the body *twice* if it's a repeat pattern
471
+ // at the start, once in nodot mode, then again in dot mode, so a
472
+ // pattern like *(?) can match 'x.y'
473
+ const repeated = this.type === '*' || this.type === '+';
474
+ // some kind of extglob
475
+ const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
476
+ let body = this.#partsToRegExp(dot);
477
+ if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
478
+ // invalid extglob, has to at least be *something* present, if it's
479
+ // the entire path portion.
480
+ const s = this.toString();
481
+ this.#parts = [s];
482
+ this.type = null;
483
+ this.#hasMagic = undefined;
484
+ return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
485
+ }
486
+ // XXX abstract out this map method
487
+ let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot
488
+ ? ''
489
+ : this.#partsToRegExp(true);
490
+ if (bodyDotAllowed === body) {
491
+ bodyDotAllowed = '';
492
+ }
493
+ if (bodyDotAllowed) {
494
+ body = `(?:${body})(?:${bodyDotAllowed})*?`;
495
+ }
496
+ // an empty !() is exactly equivalent to a starNoEmpty
497
+ let final = '';
498
+ if (this.type === '!' && this.#emptyExt) {
499
+ final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
500
+ }
501
+ else {
502
+ const close = this.type === '!'
503
+ ? // !() must match something,but !(x) can match ''
504
+ '))' +
505
+ (this.isStart() && !dot && !allowDot ? startNoDot : '') +
506
+ star +
507
+ ')'
508
+ : this.type === '@'
509
+ ? ')'
510
+ : this.type === '?'
511
+ ? ')?'
512
+ : this.type === '+' && bodyDotAllowed
513
+ ? ')'
514
+ : this.type === '*' && bodyDotAllowed
515
+ ? `)?`
516
+ : `)${this.type}`;
517
+ final = start + body + close;
518
+ }
519
+ return [
520
+ final,
521
+ (0, unescape_js_1.unescape)(body),
522
+ (this.#hasMagic = !!this.#hasMagic),
523
+ this.#uflag,
524
+ ];
525
+ }
526
+ #partsToRegExp(dot) {
527
+ return this.#parts
528
+ .map(p => {
529
+ // extglob ASTs should only contain parent ASTs
530
+ /* c8 ignore start */
531
+ if (typeof p === 'string') {
532
+ throw new Error('string type in extglob ast??');
533
+ }
534
+ /* c8 ignore stop */
535
+ // can ignore hasMagic, because extglobs are already always magic
536
+ const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
537
+ this.#uflag = this.#uflag || uflag;
538
+ return re;
539
+ })
540
+ .filter(p => !(this.isStart() && this.isEnd()) || !!p)
541
+ .join('|');
542
+ }
543
+ static #parseGlob(glob, hasMagic, noEmpty = false) {
544
+ let escaping = false;
545
+ let re = '';
546
+ let uflag = false;
547
+ for (let i = 0; i < glob.length; i++) {
548
+ const c = glob.charAt(i);
549
+ if (escaping) {
550
+ escaping = false;
551
+ re += (reSpecials.has(c) ? '\\' : '') + c;
552
+ continue;
553
+ }
554
+ if (c === '\\') {
555
+ if (i === glob.length - 1) {
556
+ re += '\\\\';
557
+ }
558
+ else {
559
+ escaping = true;
560
+ }
561
+ continue;
562
+ }
563
+ if (c === '[') {
564
+ const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i);
565
+ if (consumed) {
566
+ re += src;
567
+ uflag = uflag || needUflag;
568
+ i += consumed - 1;
569
+ hasMagic = hasMagic || magic;
570
+ continue;
571
+ }
572
+ }
573
+ if (c === '*') {
574
+ if (noEmpty && glob === '*')
575
+ re += starNoEmpty;
576
+ else
577
+ re += star;
578
+ hasMagic = true;
579
+ continue;
580
+ }
581
+ if (c === '?') {
582
+ re += qmark;
583
+ hasMagic = true;
584
+ continue;
585
+ }
586
+ re += regExpEscape(c);
587
+ }
588
+ return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag];
589
+ }
590
+ }
591
+ exports.AST = AST;
592
+ //# sourceMappingURL=ast.js.map