botversion-sdk 2.2.2 → 2.3.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.
Files changed (1203) hide show
  1. package/core.js +56 -0
  2. package/index.js +62 -495
  3. package/package.json +18 -5
  4. package/register.js +19 -0
  5. package/{bin → scanner-sdk/bin}/scan-backend.js +17 -0
  6. package/scanner-sdk/index.js +525 -0
  7. package/{interceptor.js → scanner-sdk/interceptor.js} +55 -9
  8. package/scanner-sdk/node_modules/.bin/jsesc +16 -0
  9. package/scanner-sdk/node_modules/.bin/jsesc.cmd +17 -0
  10. package/scanner-sdk/node_modules/.bin/jsesc.ps1 +28 -0
  11. package/scanner-sdk/node_modules/.bin/mime +16 -0
  12. package/scanner-sdk/node_modules/.bin/mime.cmd +17 -0
  13. package/scanner-sdk/node_modules/.bin/mime.ps1 +28 -0
  14. package/scanner-sdk/node_modules/.bin/parser +16 -0
  15. package/scanner-sdk/node_modules/.bin/parser.cmd +17 -0
  16. package/scanner-sdk/node_modules/.bin/parser.ps1 +28 -0
  17. package/scanner-sdk/node_modules/.package-lock.json +1031 -0
  18. package/scanner-sdk/node_modules/@babel/code-frame/LICENSE +22 -0
  19. package/scanner-sdk/node_modules/@babel/code-frame/README.md +19 -0
  20. package/scanner-sdk/node_modules/@babel/code-frame/lib/index.js +217 -0
  21. package/scanner-sdk/node_modules/@babel/code-frame/lib/index.js.map +1 -0
  22. package/scanner-sdk/node_modules/@babel/code-frame/package.json +32 -0
  23. package/scanner-sdk/node_modules/@babel/generator/LICENSE +22 -0
  24. package/scanner-sdk/node_modules/@babel/generator/README.md +19 -0
  25. package/scanner-sdk/node_modules/@babel/generator/lib/buffer.js +244 -0
  26. package/scanner-sdk/node_modules/@babel/generator/lib/buffer.js.map +1 -0
  27. package/scanner-sdk/node_modules/@babel/generator/lib/generators/base.js +86 -0
  28. package/scanner-sdk/node_modules/@babel/generator/lib/generators/base.js.map +1 -0
  29. package/scanner-sdk/node_modules/@babel/generator/lib/generators/classes.js +215 -0
  30. package/scanner-sdk/node_modules/@babel/generator/lib/generators/classes.js.map +1 -0
  31. package/scanner-sdk/node_modules/@babel/generator/lib/generators/deprecated.js +73 -0
  32. package/scanner-sdk/node_modules/@babel/generator/lib/generators/deprecated.js.map +1 -0
  33. package/scanner-sdk/node_modules/@babel/generator/lib/generators/expressions.js +309 -0
  34. package/scanner-sdk/node_modules/@babel/generator/lib/generators/expressions.js.map +1 -0
  35. package/scanner-sdk/node_modules/@babel/generator/lib/generators/flow.js +658 -0
  36. package/scanner-sdk/node_modules/@babel/generator/lib/generators/flow.js.map +1 -0
  37. package/scanner-sdk/node_modules/@babel/generator/lib/generators/index.js +128 -0
  38. package/scanner-sdk/node_modules/@babel/generator/lib/generators/index.js.map +1 -0
  39. package/scanner-sdk/node_modules/@babel/generator/lib/generators/jsx.js +124 -0
  40. package/scanner-sdk/node_modules/@babel/generator/lib/generators/jsx.js.map +1 -0
  41. package/scanner-sdk/node_modules/@babel/generator/lib/generators/methods.js +207 -0
  42. package/scanner-sdk/node_modules/@babel/generator/lib/generators/methods.js.map +1 -0
  43. package/scanner-sdk/node_modules/@babel/generator/lib/generators/modules.js +290 -0
  44. package/scanner-sdk/node_modules/@babel/generator/lib/generators/modules.js.map +1 -0
  45. package/scanner-sdk/node_modules/@babel/generator/lib/generators/statements.js +297 -0
  46. package/scanner-sdk/node_modules/@babel/generator/lib/generators/statements.js.map +1 -0
  47. package/scanner-sdk/node_modules/@babel/generator/lib/generators/template-literals.js +38 -0
  48. package/scanner-sdk/node_modules/@babel/generator/lib/generators/template-literals.js.map +1 -0
  49. package/scanner-sdk/node_modules/@babel/generator/lib/generators/types.js +183 -0
  50. package/scanner-sdk/node_modules/@babel/generator/lib/generators/types.js.map +1 -0
  51. package/scanner-sdk/node_modules/@babel/generator/lib/generators/typescript.js +726 -0
  52. package/scanner-sdk/node_modules/@babel/generator/lib/generators/typescript.js.map +1 -0
  53. package/scanner-sdk/node_modules/@babel/generator/lib/index.js +108 -0
  54. package/scanner-sdk/node_modules/@babel/generator/lib/index.js.map +1 -0
  55. package/scanner-sdk/node_modules/@babel/generator/lib/node/index.js +81 -0
  56. package/scanner-sdk/node_modules/@babel/generator/lib/node/index.js.map +1 -0
  57. package/scanner-sdk/node_modules/@babel/generator/lib/node/parentheses.js +298 -0
  58. package/scanner-sdk/node_modules/@babel/generator/lib/node/parentheses.js.map +1 -0
  59. package/scanner-sdk/node_modules/@babel/generator/lib/nodes.js +19 -0
  60. package/scanner-sdk/node_modules/@babel/generator/lib/nodes.js.map +1 -0
  61. package/scanner-sdk/node_modules/@babel/generator/lib/printer.js +782 -0
  62. package/scanner-sdk/node_modules/@babel/generator/lib/printer.js.map +1 -0
  63. package/scanner-sdk/node_modules/@babel/generator/lib/source-map.js +86 -0
  64. package/scanner-sdk/node_modules/@babel/generator/lib/source-map.js.map +1 -0
  65. package/scanner-sdk/node_modules/@babel/generator/lib/token-map.js +195 -0
  66. package/scanner-sdk/node_modules/@babel/generator/lib/token-map.js.map +1 -0
  67. package/scanner-sdk/node_modules/@babel/generator/package.json +39 -0
  68. package/scanner-sdk/node_modules/@babel/helper-globals/LICENSE +22 -0
  69. package/scanner-sdk/node_modules/@babel/helper-globals/README.md +19 -0
  70. package/scanner-sdk/node_modules/@babel/helper-globals/data/browser-upper.json +911 -0
  71. package/scanner-sdk/node_modules/@babel/helper-globals/data/builtin-lower.json +15 -0
  72. package/scanner-sdk/node_modules/@babel/helper-globals/data/builtin-upper.json +51 -0
  73. package/scanner-sdk/node_modules/@babel/helper-globals/package.json +32 -0
  74. package/scanner-sdk/node_modules/@babel/helper-string-parser/LICENSE +22 -0
  75. package/scanner-sdk/node_modules/@babel/helper-string-parser/README.md +19 -0
  76. package/scanner-sdk/node_modules/@babel/helper-string-parser/lib/index.js +295 -0
  77. package/scanner-sdk/node_modules/@babel/helper-string-parser/lib/index.js.map +1 -0
  78. package/scanner-sdk/node_modules/@babel/helper-string-parser/package.json +31 -0
  79. package/scanner-sdk/node_modules/@babel/helper-validator-identifier/LICENSE +22 -0
  80. package/scanner-sdk/node_modules/@babel/helper-validator-identifier/README.md +19 -0
  81. package/scanner-sdk/node_modules/@babel/helper-validator-identifier/lib/identifier.js +70 -0
  82. package/scanner-sdk/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -0
  83. package/scanner-sdk/node_modules/@babel/helper-validator-identifier/lib/index.js +57 -0
  84. package/scanner-sdk/node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -0
  85. package/scanner-sdk/node_modules/@babel/helper-validator-identifier/lib/keyword.js +35 -0
  86. package/scanner-sdk/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +1 -0
  87. package/scanner-sdk/node_modules/@babel/helper-validator-identifier/package.json +31 -0
  88. package/scanner-sdk/node_modules/@babel/parser/CHANGELOG.md +1073 -0
  89. package/scanner-sdk/node_modules/@babel/parser/LICENSE +19 -0
  90. package/scanner-sdk/node_modules/@babel/parser/README.md +19 -0
  91. package/scanner-sdk/node_modules/@babel/parser/bin/babel-parser.js +15 -0
  92. package/scanner-sdk/node_modules/@babel/parser/lib/index.js +14599 -0
  93. package/scanner-sdk/node_modules/@babel/parser/lib/index.js.map +1 -0
  94. package/scanner-sdk/node_modules/@babel/parser/package.json +50 -0
  95. package/scanner-sdk/node_modules/@babel/parser/typings/babel-parser.d.ts +262 -0
  96. package/scanner-sdk/node_modules/@babel/template/LICENSE +22 -0
  97. package/scanner-sdk/node_modules/@babel/template/README.md +19 -0
  98. package/scanner-sdk/node_modules/@babel/template/lib/builder.js +69 -0
  99. package/scanner-sdk/node_modules/@babel/template/lib/builder.js.map +1 -0
  100. package/scanner-sdk/node_modules/@babel/template/lib/formatters.js +61 -0
  101. package/scanner-sdk/node_modules/@babel/template/lib/formatters.js.map +1 -0
  102. package/scanner-sdk/node_modules/@babel/template/lib/index.js +23 -0
  103. package/scanner-sdk/node_modules/@babel/template/lib/index.js.map +1 -0
  104. package/scanner-sdk/node_modules/@babel/template/lib/literal.js +69 -0
  105. package/scanner-sdk/node_modules/@babel/template/lib/literal.js.map +1 -0
  106. package/scanner-sdk/node_modules/@babel/template/lib/options.js +73 -0
  107. package/scanner-sdk/node_modules/@babel/template/lib/options.js.map +1 -0
  108. package/scanner-sdk/node_modules/@babel/template/lib/parse.js +163 -0
  109. package/scanner-sdk/node_modules/@babel/template/lib/parse.js.map +1 -0
  110. package/scanner-sdk/node_modules/@babel/template/lib/populate.js +138 -0
  111. package/scanner-sdk/node_modules/@babel/template/lib/populate.js.map +1 -0
  112. package/scanner-sdk/node_modules/@babel/template/lib/string.js +20 -0
  113. package/scanner-sdk/node_modules/@babel/template/lib/string.js.map +1 -0
  114. package/scanner-sdk/node_modules/@babel/template/package.json +27 -0
  115. package/scanner-sdk/node_modules/@babel/traverse/LICENSE +22 -0
  116. package/scanner-sdk/node_modules/@babel/traverse/README.md +19 -0
  117. package/scanner-sdk/node_modules/@babel/traverse/lib/cache.js +37 -0
  118. package/scanner-sdk/node_modules/@babel/traverse/lib/cache.js.map +1 -0
  119. package/scanner-sdk/node_modules/@babel/traverse/lib/context.js +125 -0
  120. package/scanner-sdk/node_modules/@babel/traverse/lib/context.js.map +1 -0
  121. package/scanner-sdk/node_modules/@babel/traverse/lib/hub.js +19 -0
  122. package/scanner-sdk/node_modules/@babel/traverse/lib/hub.js.map +1 -0
  123. package/scanner-sdk/node_modules/@babel/traverse/lib/index.js +87 -0
  124. package/scanner-sdk/node_modules/@babel/traverse/lib/index.js.map +1 -0
  125. package/scanner-sdk/node_modules/@babel/traverse/lib/path/ancestry.js +139 -0
  126. package/scanner-sdk/node_modules/@babel/traverse/lib/path/ancestry.js.map +1 -0
  127. package/scanner-sdk/node_modules/@babel/traverse/lib/path/comments.js +52 -0
  128. package/scanner-sdk/node_modules/@babel/traverse/lib/path/comments.js.map +1 -0
  129. package/scanner-sdk/node_modules/@babel/traverse/lib/path/context.js +254 -0
  130. package/scanner-sdk/node_modules/@babel/traverse/lib/path/context.js.map +1 -0
  131. package/scanner-sdk/node_modules/@babel/traverse/lib/path/conversion.js +608 -0
  132. package/scanner-sdk/node_modules/@babel/traverse/lib/path/conversion.js.map +1 -0
  133. package/scanner-sdk/node_modules/@babel/traverse/lib/path/evaluation.js +373 -0
  134. package/scanner-sdk/node_modules/@babel/traverse/lib/path/evaluation.js.map +1 -0
  135. package/scanner-sdk/node_modules/@babel/traverse/lib/path/family.js +346 -0
  136. package/scanner-sdk/node_modules/@babel/traverse/lib/path/family.js.map +1 -0
  137. package/scanner-sdk/node_modules/@babel/traverse/lib/path/index.js +288 -0
  138. package/scanner-sdk/node_modules/@babel/traverse/lib/path/index.js.map +1 -0
  139. package/scanner-sdk/node_modules/@babel/traverse/lib/path/inference/index.js +149 -0
  140. package/scanner-sdk/node_modules/@babel/traverse/lib/path/inference/index.js.map +1 -0
  141. package/scanner-sdk/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js +151 -0
  142. package/scanner-sdk/node_modules/@babel/traverse/lib/path/inference/inferer-reference.js.map +1 -0
  143. package/scanner-sdk/node_modules/@babel/traverse/lib/path/inference/inferers.js +207 -0
  144. package/scanner-sdk/node_modules/@babel/traverse/lib/path/inference/inferers.js.map +1 -0
  145. package/scanner-sdk/node_modules/@babel/traverse/lib/path/inference/util.js +28 -0
  146. package/scanner-sdk/node_modules/@babel/traverse/lib/path/inference/util.js.map +1 -0
  147. package/scanner-sdk/node_modules/@babel/traverse/lib/path/introspection.js +395 -0
  148. package/scanner-sdk/node_modules/@babel/traverse/lib/path/introspection.js.map +1 -0
  149. package/scanner-sdk/node_modules/@babel/traverse/lib/path/lib/hoister.js +172 -0
  150. package/scanner-sdk/node_modules/@babel/traverse/lib/path/lib/hoister.js.map +1 -0
  151. package/scanner-sdk/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js +38 -0
  152. package/scanner-sdk/node_modules/@babel/traverse/lib/path/lib/removal-hooks.js.map +1 -0
  153. package/scanner-sdk/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js +162 -0
  154. package/scanner-sdk/node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js.map +1 -0
  155. package/scanner-sdk/node_modules/@babel/traverse/lib/path/lib/virtual-types.js +26 -0
  156. package/scanner-sdk/node_modules/@babel/traverse/lib/path/lib/virtual-types.js.map +1 -0
  157. package/scanner-sdk/node_modules/@babel/traverse/lib/path/modification.js +229 -0
  158. package/scanner-sdk/node_modules/@babel/traverse/lib/path/modification.js.map +1 -0
  159. package/scanner-sdk/node_modules/@babel/traverse/lib/path/removal.js +67 -0
  160. package/scanner-sdk/node_modules/@babel/traverse/lib/path/removal.js.map +1 -0
  161. package/scanner-sdk/node_modules/@babel/traverse/lib/path/replacement.js +264 -0
  162. package/scanner-sdk/node_modules/@babel/traverse/lib/path/replacement.js.map +1 -0
  163. package/scanner-sdk/node_modules/@babel/traverse/lib/scope/binding.js +84 -0
  164. package/scanner-sdk/node_modules/@babel/traverse/lib/scope/binding.js.map +1 -0
  165. package/scanner-sdk/node_modules/@babel/traverse/lib/scope/index.js +1018 -0
  166. package/scanner-sdk/node_modules/@babel/traverse/lib/scope/index.js.map +1 -0
  167. package/scanner-sdk/node_modules/@babel/traverse/lib/scope/lib/renamer.js +132 -0
  168. package/scanner-sdk/node_modules/@babel/traverse/lib/scope/lib/renamer.js.map +1 -0
  169. package/scanner-sdk/node_modules/@babel/traverse/lib/scope/traverseForScope.js +66 -0
  170. package/scanner-sdk/node_modules/@babel/traverse/lib/scope/traverseForScope.js.map +1 -0
  171. package/scanner-sdk/node_modules/@babel/traverse/lib/traverse-node.js +137 -0
  172. package/scanner-sdk/node_modules/@babel/traverse/lib/traverse-node.js.map +1 -0
  173. package/scanner-sdk/node_modules/@babel/traverse/lib/types.js +3 -0
  174. package/scanner-sdk/node_modules/@babel/traverse/lib/types.js.map +1 -0
  175. package/scanner-sdk/node_modules/@babel/traverse/lib/visitors.js +252 -0
  176. package/scanner-sdk/node_modules/@babel/traverse/lib/visitors.js.map +1 -0
  177. package/scanner-sdk/node_modules/@babel/traverse/node_modules/debug/LICENSE +20 -0
  178. package/scanner-sdk/node_modules/@babel/traverse/node_modules/debug/README.md +481 -0
  179. package/scanner-sdk/node_modules/@babel/traverse/node_modules/debug/package.json +64 -0
  180. package/scanner-sdk/node_modules/@babel/traverse/node_modules/debug/src/browser.js +272 -0
  181. package/scanner-sdk/node_modules/@babel/traverse/node_modules/debug/src/common.js +292 -0
  182. package/scanner-sdk/node_modules/@babel/traverse/node_modules/debug/src/index.js +10 -0
  183. package/scanner-sdk/node_modules/@babel/traverse/node_modules/debug/src/node.js +263 -0
  184. package/scanner-sdk/node_modules/@babel/traverse/node_modules/ms/index.js +162 -0
  185. package/scanner-sdk/node_modules/@babel/traverse/node_modules/ms/license.md +21 -0
  186. package/scanner-sdk/node_modules/@babel/traverse/node_modules/ms/package.json +38 -0
  187. package/scanner-sdk/node_modules/@babel/traverse/node_modules/ms/readme.md +59 -0
  188. package/scanner-sdk/node_modules/@babel/traverse/package.json +35 -0
  189. package/scanner-sdk/node_modules/@babel/traverse/tsconfig.overrides.json +6 -0
  190. package/scanner-sdk/node_modules/@babel/types/LICENSE +22 -0
  191. package/scanner-sdk/node_modules/@babel/types/README.md +19 -0
  192. package/scanner-sdk/node_modules/@babel/types/lib/asserts/assertNode.js +16 -0
  193. package/scanner-sdk/node_modules/@babel/types/lib/asserts/assertNode.js.map +1 -0
  194. package/scanner-sdk/node_modules/@babel/types/lib/asserts/generated/index.js +1251 -0
  195. package/scanner-sdk/node_modules/@babel/types/lib/asserts/generated/index.js.map +1 -0
  196. package/scanner-sdk/node_modules/@babel/types/lib/ast-types/generated/index.js +3 -0
  197. package/scanner-sdk/node_modules/@babel/types/lib/ast-types/generated/index.js.map +1 -0
  198. package/scanner-sdk/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js +18 -0
  199. package/scanner-sdk/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map +1 -0
  200. package/scanner-sdk/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js +31 -0
  201. package/scanner-sdk/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js.map +1 -0
  202. package/scanner-sdk/node_modules/@babel/types/lib/builders/generated/index.js +29 -0
  203. package/scanner-sdk/node_modules/@babel/types/lib/builders/generated/index.js.map +1 -0
  204. package/scanner-sdk/node_modules/@babel/types/lib/builders/generated/lowercase.js +2902 -0
  205. package/scanner-sdk/node_modules/@babel/types/lib/builders/generated/lowercase.js.map +1 -0
  206. package/scanner-sdk/node_modules/@babel/types/lib/builders/generated/uppercase.js +272 -0
  207. package/scanner-sdk/node_modules/@babel/types/lib/builders/generated/uppercase.js.map +1 -0
  208. package/scanner-sdk/node_modules/@babel/types/lib/builders/productions.js +12 -0
  209. package/scanner-sdk/node_modules/@babel/types/lib/builders/productions.js.map +1 -0
  210. package/scanner-sdk/node_modules/@babel/types/lib/builders/react/buildChildren.js +24 -0
  211. package/scanner-sdk/node_modules/@babel/types/lib/builders/react/buildChildren.js.map +1 -0
  212. package/scanner-sdk/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js +22 -0
  213. package/scanner-sdk/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js.map +1 -0
  214. package/scanner-sdk/node_modules/@babel/types/lib/builders/validateNode.js +21 -0
  215. package/scanner-sdk/node_modules/@babel/types/lib/builders/validateNode.js.map +1 -0
  216. package/scanner-sdk/node_modules/@babel/types/lib/clone/clone.js +12 -0
  217. package/scanner-sdk/node_modules/@babel/types/lib/clone/clone.js.map +1 -0
  218. package/scanner-sdk/node_modules/@babel/types/lib/clone/cloneDeep.js +12 -0
  219. package/scanner-sdk/node_modules/@babel/types/lib/clone/cloneDeep.js.map +1 -0
  220. package/scanner-sdk/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js +12 -0
  221. package/scanner-sdk/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js.map +1 -0
  222. package/scanner-sdk/node_modules/@babel/types/lib/clone/cloneNode.js +107 -0
  223. package/scanner-sdk/node_modules/@babel/types/lib/clone/cloneNode.js.map +1 -0
  224. package/scanner-sdk/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js +12 -0
  225. package/scanner-sdk/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js.map +1 -0
  226. package/scanner-sdk/node_modules/@babel/types/lib/comments/addComment.js +15 -0
  227. package/scanner-sdk/node_modules/@babel/types/lib/comments/addComment.js.map +1 -0
  228. package/scanner-sdk/node_modules/@babel/types/lib/comments/addComments.js +22 -0
  229. package/scanner-sdk/node_modules/@babel/types/lib/comments/addComments.js.map +1 -0
  230. package/scanner-sdk/node_modules/@babel/types/lib/comments/inheritInnerComments.js +12 -0
  231. package/scanner-sdk/node_modules/@babel/types/lib/comments/inheritInnerComments.js.map +1 -0
  232. package/scanner-sdk/node_modules/@babel/types/lib/comments/inheritLeadingComments.js +12 -0
  233. package/scanner-sdk/node_modules/@babel/types/lib/comments/inheritLeadingComments.js.map +1 -0
  234. package/scanner-sdk/node_modules/@babel/types/lib/comments/inheritTrailingComments.js +12 -0
  235. package/scanner-sdk/node_modules/@babel/types/lib/comments/inheritTrailingComments.js.map +1 -0
  236. package/scanner-sdk/node_modules/@babel/types/lib/comments/inheritsComments.js +17 -0
  237. package/scanner-sdk/node_modules/@babel/types/lib/comments/inheritsComments.js.map +1 -0
  238. package/scanner-sdk/node_modules/@babel/types/lib/comments/removeComments.js +15 -0
  239. package/scanner-sdk/node_modules/@babel/types/lib/comments/removeComments.js.map +1 -0
  240. package/scanner-sdk/node_modules/@babel/types/lib/constants/generated/index.js +60 -0
  241. package/scanner-sdk/node_modules/@babel/types/lib/constants/generated/index.js.map +1 -0
  242. package/scanner-sdk/node_modules/@babel/types/lib/constants/index.js +31 -0
  243. package/scanner-sdk/node_modules/@babel/types/lib/constants/index.js.map +1 -0
  244. package/scanner-sdk/node_modules/@babel/types/lib/converters/ensureBlock.js +14 -0
  245. package/scanner-sdk/node_modules/@babel/types/lib/converters/ensureBlock.js.map +1 -0
  246. package/scanner-sdk/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +65 -0
  247. package/scanner-sdk/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map +1 -0
  248. package/scanner-sdk/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js +14 -0
  249. package/scanner-sdk/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js.map +1 -0
  250. package/scanner-sdk/node_modules/@babel/types/lib/converters/toBlock.js +29 -0
  251. package/scanner-sdk/node_modules/@babel/types/lib/converters/toBlock.js.map +1 -0
  252. package/scanner-sdk/node_modules/@babel/types/lib/converters/toComputedKey.js +14 -0
  253. package/scanner-sdk/node_modules/@babel/types/lib/converters/toComputedKey.js.map +1 -0
  254. package/scanner-sdk/node_modules/@babel/types/lib/converters/toExpression.js +28 -0
  255. package/scanner-sdk/node_modules/@babel/types/lib/converters/toExpression.js.map +1 -0
  256. package/scanner-sdk/node_modules/@babel/types/lib/converters/toIdentifier.js +25 -0
  257. package/scanner-sdk/node_modules/@babel/types/lib/converters/toIdentifier.js.map +1 -0
  258. package/scanner-sdk/node_modules/@babel/types/lib/converters/toKeyAlias.js +38 -0
  259. package/scanner-sdk/node_modules/@babel/types/lib/converters/toKeyAlias.js.map +1 -0
  260. package/scanner-sdk/node_modules/@babel/types/lib/converters/toSequenceExpression.js +19 -0
  261. package/scanner-sdk/node_modules/@babel/types/lib/converters/toSequenceExpression.js.map +1 -0
  262. package/scanner-sdk/node_modules/@babel/types/lib/converters/toStatement.js +39 -0
  263. package/scanner-sdk/node_modules/@babel/types/lib/converters/toStatement.js.map +1 -0
  264. package/scanner-sdk/node_modules/@babel/types/lib/converters/valueToNode.js +89 -0
  265. package/scanner-sdk/node_modules/@babel/types/lib/converters/valueToNode.js.map +1 -0
  266. package/scanner-sdk/node_modules/@babel/types/lib/definitions/core.js +1725 -0
  267. package/scanner-sdk/node_modules/@babel/types/lib/definitions/core.js.map +1 -0
  268. package/scanner-sdk/node_modules/@babel/types/lib/definitions/deprecated-aliases.js +11 -0
  269. package/scanner-sdk/node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map +1 -0
  270. package/scanner-sdk/node_modules/@babel/types/lib/definitions/experimental.js +124 -0
  271. package/scanner-sdk/node_modules/@babel/types/lib/definitions/experimental.js.map +1 -0
  272. package/scanner-sdk/node_modules/@babel/types/lib/definitions/flow.js +495 -0
  273. package/scanner-sdk/node_modules/@babel/types/lib/definitions/flow.js.map +1 -0
  274. package/scanner-sdk/node_modules/@babel/types/lib/definitions/index.js +106 -0
  275. package/scanner-sdk/node_modules/@babel/types/lib/definitions/index.js.map +1 -0
  276. package/scanner-sdk/node_modules/@babel/types/lib/definitions/jsx.js +157 -0
  277. package/scanner-sdk/node_modules/@babel/types/lib/definitions/jsx.js.map +1 -0
  278. package/scanner-sdk/node_modules/@babel/types/lib/definitions/misc.js +31 -0
  279. package/scanner-sdk/node_modules/@babel/types/lib/definitions/misc.js.map +1 -0
  280. package/scanner-sdk/node_modules/@babel/types/lib/definitions/placeholders.js +27 -0
  281. package/scanner-sdk/node_modules/@babel/types/lib/definitions/placeholders.js.map +1 -0
  282. package/scanner-sdk/node_modules/@babel/types/lib/definitions/typescript.js +528 -0
  283. package/scanner-sdk/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -0
  284. package/scanner-sdk/node_modules/@babel/types/lib/definitions/utils.js +296 -0
  285. package/scanner-sdk/node_modules/@babel/types/lib/definitions/utils.js.map +1 -0
  286. package/scanner-sdk/node_modules/@babel/types/lib/index-legacy.d.ts +2797 -0
  287. package/scanner-sdk/node_modules/@babel/types/lib/index.d.ts +3617 -0
  288. package/scanner-sdk/node_modules/@babel/types/lib/index.js +582 -0
  289. package/scanner-sdk/node_modules/@babel/types/lib/index.js.flow +2650 -0
  290. package/scanner-sdk/node_modules/@babel/types/lib/index.js.map +1 -0
  291. package/scanner-sdk/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js +15 -0
  292. package/scanner-sdk/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js.map +1 -0
  293. package/scanner-sdk/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +65 -0
  294. package/scanner-sdk/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map +1 -0
  295. package/scanner-sdk/node_modules/@babel/types/lib/modifications/inherits.js +28 -0
  296. package/scanner-sdk/node_modules/@babel/types/lib/modifications/inherits.js.map +1 -0
  297. package/scanner-sdk/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js +17 -0
  298. package/scanner-sdk/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js.map +1 -0
  299. package/scanner-sdk/node_modules/@babel/types/lib/modifications/removeProperties.js +24 -0
  300. package/scanner-sdk/node_modules/@babel/types/lib/modifications/removeProperties.js.map +1 -0
  301. package/scanner-sdk/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js +14 -0
  302. package/scanner-sdk/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js.map +1 -0
  303. package/scanner-sdk/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +66 -0
  304. package/scanner-sdk/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map +1 -0
  305. package/scanner-sdk/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js +48 -0
  306. package/scanner-sdk/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js.map +1 -0
  307. package/scanner-sdk/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +102 -0
  308. package/scanner-sdk/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map +1 -0
  309. package/scanner-sdk/node_modules/@babel/types/lib/retrievers/getFunctionName.js +63 -0
  310. package/scanner-sdk/node_modules/@babel/types/lib/retrievers/getFunctionName.js.map +1 -0
  311. package/scanner-sdk/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js +13 -0
  312. package/scanner-sdk/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js.map +1 -0
  313. package/scanner-sdk/node_modules/@babel/types/lib/traverse/traverse.js +50 -0
  314. package/scanner-sdk/node_modules/@babel/types/lib/traverse/traverse.js.map +1 -0
  315. package/scanner-sdk/node_modules/@babel/types/lib/traverse/traverseFast.js +40 -0
  316. package/scanner-sdk/node_modules/@babel/types/lib/traverse/traverseFast.js.map +1 -0
  317. package/scanner-sdk/node_modules/@babel/types/lib/utils/deprecationWarning.js +44 -0
  318. package/scanner-sdk/node_modules/@babel/types/lib/utils/deprecationWarning.js.map +1 -0
  319. package/scanner-sdk/node_modules/@babel/types/lib/utils/inherit.js +13 -0
  320. package/scanner-sdk/node_modules/@babel/types/lib/utils/inherit.js.map +1 -0
  321. package/scanner-sdk/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +40 -0
  322. package/scanner-sdk/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -0
  323. package/scanner-sdk/node_modules/@babel/types/lib/utils/shallowEqual.js +17 -0
  324. package/scanner-sdk/node_modules/@babel/types/lib/utils/shallowEqual.js.map +1 -0
  325. package/scanner-sdk/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js +13 -0
  326. package/scanner-sdk/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js.map +1 -0
  327. package/scanner-sdk/node_modules/@babel/types/lib/validators/generated/index.js +2797 -0
  328. package/scanner-sdk/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -0
  329. package/scanner-sdk/node_modules/@babel/types/lib/validators/is.js +27 -0
  330. package/scanner-sdk/node_modules/@babel/types/lib/validators/is.js.map +1 -0
  331. package/scanner-sdk/node_modules/@babel/types/lib/validators/isBinding.js +27 -0
  332. package/scanner-sdk/node_modules/@babel/types/lib/validators/isBinding.js.map +1 -0
  333. package/scanner-sdk/node_modules/@babel/types/lib/validators/isBlockScoped.js +13 -0
  334. package/scanner-sdk/node_modules/@babel/types/lib/validators/isBlockScoped.js.map +1 -0
  335. package/scanner-sdk/node_modules/@babel/types/lib/validators/isImmutable.js +21 -0
  336. package/scanner-sdk/node_modules/@babel/types/lib/validators/isImmutable.js.map +1 -0
  337. package/scanner-sdk/node_modules/@babel/types/lib/validators/isLet.js +13 -0
  338. package/scanner-sdk/node_modules/@babel/types/lib/validators/isLet.js.map +1 -0
  339. package/scanner-sdk/node_modules/@babel/types/lib/validators/isNode.js +12 -0
  340. package/scanner-sdk/node_modules/@babel/types/lib/validators/isNode.js.map +1 -0
  341. package/scanner-sdk/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +57 -0
  342. package/scanner-sdk/node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map +1 -0
  343. package/scanner-sdk/node_modules/@babel/types/lib/validators/isPlaceholderType.js +15 -0
  344. package/scanner-sdk/node_modules/@babel/types/lib/validators/isPlaceholderType.js.map +1 -0
  345. package/scanner-sdk/node_modules/@babel/types/lib/validators/isReferenced.js +96 -0
  346. package/scanner-sdk/node_modules/@babel/types/lib/validators/isReferenced.js.map +1 -0
  347. package/scanner-sdk/node_modules/@babel/types/lib/validators/isScope.js +18 -0
  348. package/scanner-sdk/node_modules/@babel/types/lib/validators/isScope.js.map +1 -0
  349. package/scanner-sdk/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +14 -0
  350. package/scanner-sdk/node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map +1 -0
  351. package/scanner-sdk/node_modules/@babel/types/lib/validators/isType.js +17 -0
  352. package/scanner-sdk/node_modules/@babel/types/lib/validators/isType.js.map +1 -0
  353. package/scanner-sdk/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +13 -0
  354. package/scanner-sdk/node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map +1 -0
  355. package/scanner-sdk/node_modules/@babel/types/lib/validators/isValidIdentifier.js +18 -0
  356. package/scanner-sdk/node_modules/@babel/types/lib/validators/isValidIdentifier.js.map +1 -0
  357. package/scanner-sdk/node_modules/@babel/types/lib/validators/isVar.js +15 -0
  358. package/scanner-sdk/node_modules/@babel/types/lib/validators/isVar.js.map +1 -0
  359. package/scanner-sdk/node_modules/@babel/types/lib/validators/matchesPattern.js +44 -0
  360. package/scanner-sdk/node_modules/@babel/types/lib/validators/matchesPattern.js.map +1 -0
  361. package/scanner-sdk/node_modules/@babel/types/lib/validators/react/isCompatTag.js +11 -0
  362. package/scanner-sdk/node_modules/@babel/types/lib/validators/react/isCompatTag.js.map +1 -0
  363. package/scanner-sdk/node_modules/@babel/types/lib/validators/react/isReactComponent.js +11 -0
  364. package/scanner-sdk/node_modules/@babel/types/lib/validators/react/isReactComponent.js.map +1 -0
  365. package/scanner-sdk/node_modules/@babel/types/lib/validators/validate.js +42 -0
  366. package/scanner-sdk/node_modules/@babel/types/lib/validators/validate.js.map +1 -0
  367. package/scanner-sdk/node_modules/@babel/types/package.json +39 -0
  368. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/LICENSE +19 -0
  369. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/README.md +227 -0
  370. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs +292 -0
  371. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map +6 -0
  372. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js +358 -0
  373. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map +6 -0
  374. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +88 -0
  375. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts +32 -0
  376. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +12 -0
  377. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts +43 -0
  378. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/package.json +67 -0
  379. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts +614 -0
  380. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/src/set-array.ts +82 -0
  381. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts +16 -0
  382. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/src/types.ts +61 -0
  383. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts +89 -0
  384. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map +1 -0
  385. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts +89 -0
  386. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map +1 -0
  387. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts +33 -0
  388. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map +1 -0
  389. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts +33 -0
  390. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map +1 -0
  391. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts +13 -0
  392. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map +1 -0
  393. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts +13 -0
  394. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map +1 -0
  395. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/types.d.cts +44 -0
  396. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map +1 -0
  397. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/types.d.mts +44 -0
  398. package/scanner-sdk/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map +1 -0
  399. package/scanner-sdk/node_modules/@jridgewell/resolve-uri/LICENSE +19 -0
  400. package/scanner-sdk/node_modules/@jridgewell/resolve-uri/README.md +40 -0
  401. package/scanner-sdk/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs +232 -0
  402. package/scanner-sdk/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map +1 -0
  403. package/scanner-sdk/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js +240 -0
  404. package/scanner-sdk/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map +1 -0
  405. package/scanner-sdk/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts +4 -0
  406. package/scanner-sdk/node_modules/@jridgewell/resolve-uri/package.json +69 -0
  407. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/LICENSE +19 -0
  408. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/README.md +264 -0
  409. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +423 -0
  410. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +6 -0
  411. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +464 -0
  412. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +6 -0
  413. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/package.json +63 -0
  414. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts +345 -0
  415. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts +111 -0
  416. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/src/strings.ts +65 -0
  417. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts +55 -0
  418. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts +50 -0
  419. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map +1 -0
  420. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts +50 -0
  421. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map +1 -0
  422. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts +9 -0
  423. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map +1 -0
  424. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts +9 -0
  425. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map +1 -0
  426. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts +16 -0
  427. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map +1 -0
  428. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts +16 -0
  429. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map +1 -0
  430. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts +7 -0
  431. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map +1 -0
  432. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts +7 -0
  433. package/scanner-sdk/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map +1 -0
  434. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/LICENSE +19 -0
  435. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/README.md +348 -0
  436. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +493 -0
  437. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +6 -0
  438. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +559 -0
  439. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +6 -0
  440. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/package.json +67 -0
  441. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/src/binary-search.ts +115 -0
  442. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/src/by-source.ts +41 -0
  443. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts +192 -0
  444. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/src/resolve.ts +16 -0
  445. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/src/sort.ts +45 -0
  446. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts +23 -0
  447. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts +8 -0
  448. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts +502 -0
  449. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/src/types.ts +114 -0
  450. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts +33 -0
  451. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map +1 -0
  452. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts +33 -0
  453. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map +1 -0
  454. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts +4 -0
  455. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map +1 -0
  456. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts +4 -0
  457. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map +1 -0
  458. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts +9 -0
  459. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map +1 -0
  460. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts +9 -0
  461. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map +1 -0
  462. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts +4 -0
  463. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map +1 -0
  464. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts +4 -0
  465. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map +1 -0
  466. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/sort.d.cts +4 -0
  467. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map +1 -0
  468. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/sort.d.mts +4 -0
  469. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map +1 -0
  470. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts +17 -0
  471. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map +1 -0
  472. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts +17 -0
  473. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map +1 -0
  474. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts +5 -0
  475. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map +1 -0
  476. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts +5 -0
  477. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map +1 -0
  478. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts +80 -0
  479. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map +1 -0
  480. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts +80 -0
  481. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map +1 -0
  482. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/types.d.cts +107 -0
  483. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map +1 -0
  484. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/types.d.mts +107 -0
  485. package/scanner-sdk/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map +1 -0
  486. package/scanner-sdk/node_modules/accepts/HISTORY.md +243 -0
  487. package/scanner-sdk/node_modules/accepts/LICENSE +23 -0
  488. package/scanner-sdk/node_modules/accepts/README.md +140 -0
  489. package/scanner-sdk/node_modules/accepts/index.js +238 -0
  490. package/scanner-sdk/node_modules/accepts/package.json +47 -0
  491. package/scanner-sdk/node_modules/array-flatten/LICENSE +21 -0
  492. package/scanner-sdk/node_modules/array-flatten/README.md +43 -0
  493. package/scanner-sdk/node_modules/array-flatten/array-flatten.js +64 -0
  494. package/scanner-sdk/node_modules/array-flatten/package.json +39 -0
  495. package/scanner-sdk/node_modules/body-parser/HISTORY.md +680 -0
  496. package/scanner-sdk/node_modules/body-parser/LICENSE +23 -0
  497. package/scanner-sdk/node_modules/body-parser/README.md +476 -0
  498. package/scanner-sdk/node_modules/body-parser/index.js +156 -0
  499. package/scanner-sdk/node_modules/body-parser/lib/read.js +205 -0
  500. package/scanner-sdk/node_modules/body-parser/lib/types/json.js +247 -0
  501. package/scanner-sdk/node_modules/body-parser/lib/types/raw.js +101 -0
  502. package/scanner-sdk/node_modules/body-parser/lib/types/text.js +121 -0
  503. package/scanner-sdk/node_modules/body-parser/lib/types/urlencoded.js +300 -0
  504. package/scanner-sdk/node_modules/body-parser/package.json +55 -0
  505. package/scanner-sdk/node_modules/bytes/History.md +97 -0
  506. package/scanner-sdk/node_modules/bytes/LICENSE +23 -0
  507. package/scanner-sdk/node_modules/bytes/Readme.md +152 -0
  508. package/scanner-sdk/node_modules/bytes/index.js +170 -0
  509. package/scanner-sdk/node_modules/bytes/package.json +42 -0
  510. package/scanner-sdk/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
  511. package/scanner-sdk/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  512. package/scanner-sdk/node_modules/call-bind-apply-helpers/.nycrc +9 -0
  513. package/scanner-sdk/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  514. package/scanner-sdk/node_modules/call-bind-apply-helpers/LICENSE +21 -0
  515. package/scanner-sdk/node_modules/call-bind-apply-helpers/README.md +62 -0
  516. package/scanner-sdk/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  517. package/scanner-sdk/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
  518. package/scanner-sdk/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  519. package/scanner-sdk/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
  520. package/scanner-sdk/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  521. package/scanner-sdk/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
  522. package/scanner-sdk/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  523. package/scanner-sdk/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
  524. package/scanner-sdk/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
  525. package/scanner-sdk/node_modules/call-bind-apply-helpers/index.js +15 -0
  526. package/scanner-sdk/node_modules/call-bind-apply-helpers/package.json +85 -0
  527. package/scanner-sdk/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  528. package/scanner-sdk/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  529. package/scanner-sdk/node_modules/call-bind-apply-helpers/test/index.js +63 -0
  530. package/scanner-sdk/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  531. package/scanner-sdk/node_modules/call-bound/.eslintrc +13 -0
  532. package/scanner-sdk/node_modules/call-bound/.github/FUNDING.yml +12 -0
  533. package/scanner-sdk/node_modules/call-bound/.nycrc +9 -0
  534. package/scanner-sdk/node_modules/call-bound/CHANGELOG.md +42 -0
  535. package/scanner-sdk/node_modules/call-bound/LICENSE +21 -0
  536. package/scanner-sdk/node_modules/call-bound/README.md +53 -0
  537. package/scanner-sdk/node_modules/call-bound/index.d.ts +94 -0
  538. package/scanner-sdk/node_modules/call-bound/index.js +19 -0
  539. package/scanner-sdk/node_modules/call-bound/package.json +99 -0
  540. package/scanner-sdk/node_modules/call-bound/test/index.js +61 -0
  541. package/scanner-sdk/node_modules/call-bound/tsconfig.json +10 -0
  542. package/scanner-sdk/node_modules/content-disposition/HISTORY.md +60 -0
  543. package/scanner-sdk/node_modules/content-disposition/LICENSE +22 -0
  544. package/scanner-sdk/node_modules/content-disposition/README.md +142 -0
  545. package/scanner-sdk/node_modules/content-disposition/index.js +458 -0
  546. package/scanner-sdk/node_modules/content-disposition/package.json +44 -0
  547. package/scanner-sdk/node_modules/content-type/HISTORY.md +29 -0
  548. package/scanner-sdk/node_modules/content-type/LICENSE +22 -0
  549. package/scanner-sdk/node_modules/content-type/README.md +94 -0
  550. package/scanner-sdk/node_modules/content-type/index.js +225 -0
  551. package/scanner-sdk/node_modules/content-type/package.json +42 -0
  552. package/scanner-sdk/node_modules/cookie/LICENSE +24 -0
  553. package/scanner-sdk/node_modules/cookie/README.md +317 -0
  554. package/scanner-sdk/node_modules/cookie/SECURITY.md +25 -0
  555. package/scanner-sdk/node_modules/cookie/index.js +335 -0
  556. package/scanner-sdk/node_modules/cookie/package.json +44 -0
  557. package/scanner-sdk/node_modules/cookie-signature/History.md +42 -0
  558. package/scanner-sdk/node_modules/cookie-signature/Readme.md +42 -0
  559. package/scanner-sdk/node_modules/cookie-signature/index.js +51 -0
  560. package/scanner-sdk/node_modules/cookie-signature/package.json +18 -0
  561. package/scanner-sdk/node_modules/debug/.coveralls.yml +1 -0
  562. package/scanner-sdk/node_modules/debug/.eslintrc +11 -0
  563. package/scanner-sdk/node_modules/debug/.travis.yml +14 -0
  564. package/scanner-sdk/node_modules/debug/CHANGELOG.md +362 -0
  565. package/scanner-sdk/node_modules/debug/LICENSE +19 -0
  566. package/scanner-sdk/node_modules/debug/Makefile +50 -0
  567. package/scanner-sdk/node_modules/debug/README.md +312 -0
  568. package/scanner-sdk/node_modules/debug/component.json +19 -0
  569. package/scanner-sdk/node_modules/debug/karma.conf.js +70 -0
  570. package/scanner-sdk/node_modules/debug/node.js +1 -0
  571. package/scanner-sdk/node_modules/debug/package.json +49 -0
  572. package/scanner-sdk/node_modules/debug/src/browser.js +185 -0
  573. package/scanner-sdk/node_modules/debug/src/debug.js +202 -0
  574. package/scanner-sdk/node_modules/debug/src/index.js +10 -0
  575. package/scanner-sdk/node_modules/debug/src/inspector-log.js +15 -0
  576. package/scanner-sdk/node_modules/debug/src/node.js +248 -0
  577. package/scanner-sdk/node_modules/depd/History.md +103 -0
  578. package/scanner-sdk/node_modules/depd/LICENSE +22 -0
  579. package/scanner-sdk/node_modules/depd/Readme.md +280 -0
  580. package/scanner-sdk/node_modules/depd/index.js +538 -0
  581. package/scanner-sdk/node_modules/depd/lib/browser/index.js +77 -0
  582. package/scanner-sdk/node_modules/depd/package.json +45 -0
  583. package/scanner-sdk/node_modules/destroy/LICENSE +23 -0
  584. package/scanner-sdk/node_modules/destroy/README.md +63 -0
  585. package/scanner-sdk/node_modules/destroy/index.js +209 -0
  586. package/scanner-sdk/node_modules/destroy/package.json +48 -0
  587. package/scanner-sdk/node_modules/dotenv/CHANGELOG.md +520 -0
  588. package/scanner-sdk/node_modules/dotenv/LICENSE +23 -0
  589. package/scanner-sdk/node_modules/dotenv/README-es.md +411 -0
  590. package/scanner-sdk/node_modules/dotenv/README.md +645 -0
  591. package/scanner-sdk/node_modules/dotenv/SECURITY.md +1 -0
  592. package/scanner-sdk/node_modules/dotenv/config.d.ts +1 -0
  593. package/scanner-sdk/node_modules/dotenv/config.js +9 -0
  594. package/scanner-sdk/node_modules/dotenv/lib/cli-options.js +17 -0
  595. package/scanner-sdk/node_modules/dotenv/lib/env-options.js +28 -0
  596. package/scanner-sdk/node_modules/dotenv/lib/main.d.ts +162 -0
  597. package/scanner-sdk/node_modules/dotenv/lib/main.js +386 -0
  598. package/scanner-sdk/node_modules/dotenv/package.json +62 -0
  599. package/scanner-sdk/node_modules/dunder-proto/.eslintrc +5 -0
  600. package/scanner-sdk/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
  601. package/scanner-sdk/node_modules/dunder-proto/.nycrc +13 -0
  602. package/scanner-sdk/node_modules/dunder-proto/CHANGELOG.md +24 -0
  603. package/scanner-sdk/node_modules/dunder-proto/LICENSE +21 -0
  604. package/scanner-sdk/node_modules/dunder-proto/README.md +54 -0
  605. package/scanner-sdk/node_modules/dunder-proto/get.d.ts +5 -0
  606. package/scanner-sdk/node_modules/dunder-proto/get.js +30 -0
  607. package/scanner-sdk/node_modules/dunder-proto/package.json +76 -0
  608. package/scanner-sdk/node_modules/dunder-proto/set.d.ts +5 -0
  609. package/scanner-sdk/node_modules/dunder-proto/set.js +35 -0
  610. package/scanner-sdk/node_modules/dunder-proto/test/get.js +34 -0
  611. package/scanner-sdk/node_modules/dunder-proto/test/index.js +4 -0
  612. package/scanner-sdk/node_modules/dunder-proto/test/set.js +50 -0
  613. package/scanner-sdk/node_modules/dunder-proto/tsconfig.json +9 -0
  614. package/scanner-sdk/node_modules/ee-first/LICENSE +22 -0
  615. package/scanner-sdk/node_modules/ee-first/README.md +80 -0
  616. package/scanner-sdk/node_modules/ee-first/index.js +95 -0
  617. package/scanner-sdk/node_modules/ee-first/package.json +29 -0
  618. package/scanner-sdk/node_modules/encodeurl/LICENSE +22 -0
  619. package/scanner-sdk/node_modules/encodeurl/README.md +109 -0
  620. package/scanner-sdk/node_modules/encodeurl/index.js +60 -0
  621. package/scanner-sdk/node_modules/encodeurl/package.json +40 -0
  622. package/scanner-sdk/node_modules/es-define-property/.eslintrc +13 -0
  623. package/scanner-sdk/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  624. package/scanner-sdk/node_modules/es-define-property/.nycrc +9 -0
  625. package/scanner-sdk/node_modules/es-define-property/CHANGELOG.md +29 -0
  626. package/scanner-sdk/node_modules/es-define-property/LICENSE +21 -0
  627. package/scanner-sdk/node_modules/es-define-property/README.md +49 -0
  628. package/scanner-sdk/node_modules/es-define-property/index.d.ts +3 -0
  629. package/scanner-sdk/node_modules/es-define-property/index.js +14 -0
  630. package/scanner-sdk/node_modules/es-define-property/package.json +81 -0
  631. package/scanner-sdk/node_modules/es-define-property/test/index.js +56 -0
  632. package/scanner-sdk/node_modules/es-define-property/tsconfig.json +10 -0
  633. package/scanner-sdk/node_modules/es-errors/.eslintrc +5 -0
  634. package/scanner-sdk/node_modules/es-errors/.github/FUNDING.yml +12 -0
  635. package/scanner-sdk/node_modules/es-errors/CHANGELOG.md +40 -0
  636. package/scanner-sdk/node_modules/es-errors/LICENSE +21 -0
  637. package/scanner-sdk/node_modules/es-errors/README.md +55 -0
  638. package/scanner-sdk/node_modules/es-errors/eval.d.ts +3 -0
  639. package/scanner-sdk/node_modules/es-errors/eval.js +4 -0
  640. package/scanner-sdk/node_modules/es-errors/index.d.ts +3 -0
  641. package/scanner-sdk/node_modules/es-errors/index.js +4 -0
  642. package/scanner-sdk/node_modules/es-errors/package.json +80 -0
  643. package/scanner-sdk/node_modules/es-errors/range.d.ts +3 -0
  644. package/scanner-sdk/node_modules/es-errors/range.js +4 -0
  645. package/scanner-sdk/node_modules/es-errors/ref.d.ts +3 -0
  646. package/scanner-sdk/node_modules/es-errors/ref.js +4 -0
  647. package/scanner-sdk/node_modules/es-errors/syntax.d.ts +3 -0
  648. package/scanner-sdk/node_modules/es-errors/syntax.js +4 -0
  649. package/scanner-sdk/node_modules/es-errors/test/index.js +19 -0
  650. package/scanner-sdk/node_modules/es-errors/tsconfig.json +49 -0
  651. package/scanner-sdk/node_modules/es-errors/type.d.ts +3 -0
  652. package/scanner-sdk/node_modules/es-errors/type.js +4 -0
  653. package/scanner-sdk/node_modules/es-errors/uri.d.ts +3 -0
  654. package/scanner-sdk/node_modules/es-errors/uri.js +4 -0
  655. package/scanner-sdk/node_modules/es-object-atoms/.eslintrc +16 -0
  656. package/scanner-sdk/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  657. package/scanner-sdk/node_modules/es-object-atoms/CHANGELOG.md +37 -0
  658. package/scanner-sdk/node_modules/es-object-atoms/LICENSE +21 -0
  659. package/scanner-sdk/node_modules/es-object-atoms/README.md +63 -0
  660. package/scanner-sdk/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  661. package/scanner-sdk/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  662. package/scanner-sdk/node_modules/es-object-atoms/ToObject.d.ts +7 -0
  663. package/scanner-sdk/node_modules/es-object-atoms/ToObject.js +10 -0
  664. package/scanner-sdk/node_modules/es-object-atoms/index.d.ts +3 -0
  665. package/scanner-sdk/node_modules/es-object-atoms/index.js +4 -0
  666. package/scanner-sdk/node_modules/es-object-atoms/isObject.d.ts +3 -0
  667. package/scanner-sdk/node_modules/es-object-atoms/isObject.js +6 -0
  668. package/scanner-sdk/node_modules/es-object-atoms/package.json +80 -0
  669. package/scanner-sdk/node_modules/es-object-atoms/test/index.js +38 -0
  670. package/scanner-sdk/node_modules/es-object-atoms/tsconfig.json +6 -0
  671. package/scanner-sdk/node_modules/escape-html/LICENSE +24 -0
  672. package/scanner-sdk/node_modules/escape-html/Readme.md +43 -0
  673. package/scanner-sdk/node_modules/escape-html/index.js +78 -0
  674. package/scanner-sdk/node_modules/escape-html/package.json +24 -0
  675. package/scanner-sdk/node_modules/etag/HISTORY.md +83 -0
  676. package/scanner-sdk/node_modules/etag/LICENSE +22 -0
  677. package/scanner-sdk/node_modules/etag/README.md +159 -0
  678. package/scanner-sdk/node_modules/etag/index.js +131 -0
  679. package/scanner-sdk/node_modules/etag/package.json +47 -0
  680. package/scanner-sdk/node_modules/express/History.md +3667 -0
  681. package/scanner-sdk/node_modules/express/LICENSE +24 -0
  682. package/scanner-sdk/node_modules/express/Readme.md +260 -0
  683. package/scanner-sdk/node_modules/express/index.js +11 -0
  684. package/scanner-sdk/node_modules/express/lib/application.js +661 -0
  685. package/scanner-sdk/node_modules/express/lib/express.js +116 -0
  686. package/scanner-sdk/node_modules/express/lib/middleware/init.js +43 -0
  687. package/scanner-sdk/node_modules/express/lib/middleware/query.js +47 -0
  688. package/scanner-sdk/node_modules/express/lib/request.js +525 -0
  689. package/scanner-sdk/node_modules/express/lib/response.js +1179 -0
  690. package/scanner-sdk/node_modules/express/lib/router/index.js +673 -0
  691. package/scanner-sdk/node_modules/express/lib/router/layer.js +181 -0
  692. package/scanner-sdk/node_modules/express/lib/router/route.js +230 -0
  693. package/scanner-sdk/node_modules/express/lib/utils.js +303 -0
  694. package/scanner-sdk/node_modules/express/lib/view.js +182 -0
  695. package/scanner-sdk/node_modules/express/package.json +102 -0
  696. package/scanner-sdk/node_modules/finalhandler/HISTORY.md +216 -0
  697. package/scanner-sdk/node_modules/finalhandler/LICENSE +22 -0
  698. package/scanner-sdk/node_modules/finalhandler/README.md +147 -0
  699. package/scanner-sdk/node_modules/finalhandler/SECURITY.md +25 -0
  700. package/scanner-sdk/node_modules/finalhandler/index.js +341 -0
  701. package/scanner-sdk/node_modules/finalhandler/package.json +47 -0
  702. package/scanner-sdk/node_modules/forwarded/HISTORY.md +21 -0
  703. package/scanner-sdk/node_modules/forwarded/LICENSE +22 -0
  704. package/scanner-sdk/node_modules/forwarded/README.md +57 -0
  705. package/scanner-sdk/node_modules/forwarded/index.js +90 -0
  706. package/scanner-sdk/node_modules/forwarded/package.json +45 -0
  707. package/scanner-sdk/node_modules/fresh/HISTORY.md +70 -0
  708. package/scanner-sdk/node_modules/fresh/LICENSE +23 -0
  709. package/scanner-sdk/node_modules/fresh/README.md +119 -0
  710. package/scanner-sdk/node_modules/fresh/index.js +137 -0
  711. package/scanner-sdk/node_modules/fresh/package.json +46 -0
  712. package/scanner-sdk/node_modules/function-bind/.eslintrc +21 -0
  713. package/scanner-sdk/node_modules/function-bind/.github/FUNDING.yml +12 -0
  714. package/scanner-sdk/node_modules/function-bind/.github/SECURITY.md +3 -0
  715. package/scanner-sdk/node_modules/function-bind/.nycrc +13 -0
  716. package/scanner-sdk/node_modules/function-bind/CHANGELOG.md +136 -0
  717. package/scanner-sdk/node_modules/function-bind/LICENSE +20 -0
  718. package/scanner-sdk/node_modules/function-bind/README.md +46 -0
  719. package/scanner-sdk/node_modules/function-bind/implementation.js +84 -0
  720. package/scanner-sdk/node_modules/function-bind/index.js +5 -0
  721. package/scanner-sdk/node_modules/function-bind/package.json +87 -0
  722. package/scanner-sdk/node_modules/function-bind/test/.eslintrc +9 -0
  723. package/scanner-sdk/node_modules/function-bind/test/index.js +252 -0
  724. package/scanner-sdk/node_modules/get-intrinsic/.eslintrc +42 -0
  725. package/scanner-sdk/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  726. package/scanner-sdk/node_modules/get-intrinsic/.nycrc +9 -0
  727. package/scanner-sdk/node_modules/get-intrinsic/CHANGELOG.md +186 -0
  728. package/scanner-sdk/node_modules/get-intrinsic/LICENSE +21 -0
  729. package/scanner-sdk/node_modules/get-intrinsic/README.md +71 -0
  730. package/scanner-sdk/node_modules/get-intrinsic/index.js +378 -0
  731. package/scanner-sdk/node_modules/get-intrinsic/package.json +97 -0
  732. package/scanner-sdk/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  733. package/scanner-sdk/node_modules/get-proto/.eslintrc +10 -0
  734. package/scanner-sdk/node_modules/get-proto/.github/FUNDING.yml +12 -0
  735. package/scanner-sdk/node_modules/get-proto/.nycrc +9 -0
  736. package/scanner-sdk/node_modules/get-proto/CHANGELOG.md +21 -0
  737. package/scanner-sdk/node_modules/get-proto/LICENSE +21 -0
  738. package/scanner-sdk/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  739. package/scanner-sdk/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
  740. package/scanner-sdk/node_modules/get-proto/README.md +50 -0
  741. package/scanner-sdk/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  742. package/scanner-sdk/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  743. package/scanner-sdk/node_modules/get-proto/index.d.ts +5 -0
  744. package/scanner-sdk/node_modules/get-proto/index.js +27 -0
  745. package/scanner-sdk/node_modules/get-proto/package.json +81 -0
  746. package/scanner-sdk/node_modules/get-proto/test/index.js +68 -0
  747. package/scanner-sdk/node_modules/get-proto/tsconfig.json +9 -0
  748. package/scanner-sdk/node_modules/gopd/.eslintrc +16 -0
  749. package/scanner-sdk/node_modules/gopd/.github/FUNDING.yml +12 -0
  750. package/scanner-sdk/node_modules/gopd/CHANGELOG.md +45 -0
  751. package/scanner-sdk/node_modules/gopd/LICENSE +21 -0
  752. package/scanner-sdk/node_modules/gopd/README.md +40 -0
  753. package/scanner-sdk/node_modules/gopd/gOPD.d.ts +1 -0
  754. package/scanner-sdk/node_modules/gopd/gOPD.js +4 -0
  755. package/scanner-sdk/node_modules/gopd/index.d.ts +5 -0
  756. package/scanner-sdk/node_modules/gopd/index.js +15 -0
  757. package/scanner-sdk/node_modules/gopd/package.json +77 -0
  758. package/scanner-sdk/node_modules/gopd/test/index.js +36 -0
  759. package/scanner-sdk/node_modules/gopd/tsconfig.json +9 -0
  760. package/scanner-sdk/node_modules/has-symbols/.eslintrc +11 -0
  761. package/scanner-sdk/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  762. package/scanner-sdk/node_modules/has-symbols/.nycrc +9 -0
  763. package/scanner-sdk/node_modules/has-symbols/CHANGELOG.md +91 -0
  764. package/scanner-sdk/node_modules/has-symbols/LICENSE +21 -0
  765. package/scanner-sdk/node_modules/has-symbols/README.md +46 -0
  766. package/scanner-sdk/node_modules/has-symbols/index.d.ts +3 -0
  767. package/scanner-sdk/node_modules/has-symbols/index.js +14 -0
  768. package/scanner-sdk/node_modules/has-symbols/package.json +111 -0
  769. package/scanner-sdk/node_modules/has-symbols/shams.d.ts +3 -0
  770. package/scanner-sdk/node_modules/has-symbols/shams.js +45 -0
  771. package/scanner-sdk/node_modules/has-symbols/test/index.js +22 -0
  772. package/scanner-sdk/node_modules/has-symbols/test/shams/core-js.js +29 -0
  773. package/scanner-sdk/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  774. package/scanner-sdk/node_modules/has-symbols/test/tests.js +58 -0
  775. package/scanner-sdk/node_modules/has-symbols/tsconfig.json +10 -0
  776. package/scanner-sdk/node_modules/hasown/.eslintrc +5 -0
  777. package/scanner-sdk/node_modules/hasown/.github/FUNDING.yml +12 -0
  778. package/scanner-sdk/node_modules/hasown/.nycrc +13 -0
  779. package/scanner-sdk/node_modules/hasown/CHANGELOG.md +40 -0
  780. package/scanner-sdk/node_modules/hasown/LICENSE +21 -0
  781. package/scanner-sdk/node_modules/hasown/README.md +40 -0
  782. package/scanner-sdk/node_modules/hasown/index.d.ts +3 -0
  783. package/scanner-sdk/node_modules/hasown/index.js +8 -0
  784. package/scanner-sdk/node_modules/hasown/package.json +92 -0
  785. package/scanner-sdk/node_modules/hasown/tsconfig.json +6 -0
  786. package/scanner-sdk/node_modules/http-errors/HISTORY.md +186 -0
  787. package/scanner-sdk/node_modules/http-errors/LICENSE +23 -0
  788. package/scanner-sdk/node_modules/http-errors/README.md +169 -0
  789. package/scanner-sdk/node_modules/http-errors/index.js +290 -0
  790. package/scanner-sdk/node_modules/http-errors/package.json +54 -0
  791. package/scanner-sdk/node_modules/iconv-lite/Changelog.md +162 -0
  792. package/scanner-sdk/node_modules/iconv-lite/LICENSE +21 -0
  793. package/scanner-sdk/node_modules/iconv-lite/README.md +156 -0
  794. package/scanner-sdk/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
  795. package/scanner-sdk/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
  796. package/scanner-sdk/node_modules/iconv-lite/encodings/index.js +22 -0
  797. package/scanner-sdk/node_modules/iconv-lite/encodings/internal.js +188 -0
  798. package/scanner-sdk/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  799. package/scanner-sdk/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  800. package/scanner-sdk/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
  801. package/scanner-sdk/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  802. package/scanner-sdk/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  803. package/scanner-sdk/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  804. package/scanner-sdk/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  805. package/scanner-sdk/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  806. package/scanner-sdk/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  807. package/scanner-sdk/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
  808. package/scanner-sdk/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  809. package/scanner-sdk/node_modules/iconv-lite/encodings/utf16.js +177 -0
  810. package/scanner-sdk/node_modules/iconv-lite/encodings/utf7.js +290 -0
  811. package/scanner-sdk/node_modules/iconv-lite/lib/bom-handling.js +52 -0
  812. package/scanner-sdk/node_modules/iconv-lite/lib/extend-node.js +217 -0
  813. package/scanner-sdk/node_modules/iconv-lite/lib/index.d.ts +24 -0
  814. package/scanner-sdk/node_modules/iconv-lite/lib/index.js +153 -0
  815. package/scanner-sdk/node_modules/iconv-lite/lib/streams.js +121 -0
  816. package/scanner-sdk/node_modules/iconv-lite/package.json +46 -0
  817. package/scanner-sdk/node_modules/inherits/LICENSE +16 -0
  818. package/scanner-sdk/node_modules/inherits/README.md +42 -0
  819. package/scanner-sdk/node_modules/inherits/inherits.js +9 -0
  820. package/scanner-sdk/node_modules/inherits/inherits_browser.js +27 -0
  821. package/scanner-sdk/node_modules/inherits/package.json +29 -0
  822. package/scanner-sdk/node_modules/ipaddr.js/LICENSE +19 -0
  823. package/scanner-sdk/node_modules/ipaddr.js/README.md +233 -0
  824. package/scanner-sdk/node_modules/ipaddr.js/ipaddr.min.js +1 -0
  825. package/scanner-sdk/node_modules/ipaddr.js/lib/ipaddr.js +673 -0
  826. package/scanner-sdk/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +68 -0
  827. package/scanner-sdk/node_modules/ipaddr.js/package.json +35 -0
  828. package/scanner-sdk/node_modules/js-tokens/CHANGELOG.md +151 -0
  829. package/scanner-sdk/node_modules/js-tokens/LICENSE +21 -0
  830. package/scanner-sdk/node_modules/js-tokens/README.md +240 -0
  831. package/scanner-sdk/node_modules/js-tokens/index.js +23 -0
  832. package/scanner-sdk/node_modules/js-tokens/package.json +30 -0
  833. package/scanner-sdk/node_modules/jsesc/LICENSE-MIT.txt +20 -0
  834. package/scanner-sdk/node_modules/jsesc/README.md +422 -0
  835. package/scanner-sdk/node_modules/jsesc/bin/jsesc +148 -0
  836. package/scanner-sdk/node_modules/jsesc/jsesc.js +337 -0
  837. package/scanner-sdk/node_modules/jsesc/man/jsesc.1 +94 -0
  838. package/scanner-sdk/node_modules/jsesc/package.json +56 -0
  839. package/scanner-sdk/node_modules/math-intrinsics/.eslintrc +16 -0
  840. package/scanner-sdk/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  841. package/scanner-sdk/node_modules/math-intrinsics/CHANGELOG.md +24 -0
  842. package/scanner-sdk/node_modules/math-intrinsics/LICENSE +21 -0
  843. package/scanner-sdk/node_modules/math-intrinsics/README.md +50 -0
  844. package/scanner-sdk/node_modules/math-intrinsics/abs.d.ts +1 -0
  845. package/scanner-sdk/node_modules/math-intrinsics/abs.js +4 -0
  846. package/scanner-sdk/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  847. package/scanner-sdk/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  848. package/scanner-sdk/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  849. package/scanner-sdk/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  850. package/scanner-sdk/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  851. package/scanner-sdk/node_modules/math-intrinsics/constants/maxValue.js +5 -0
  852. package/scanner-sdk/node_modules/math-intrinsics/floor.d.ts +1 -0
  853. package/scanner-sdk/node_modules/math-intrinsics/floor.js +4 -0
  854. package/scanner-sdk/node_modules/math-intrinsics/isFinite.d.ts +3 -0
  855. package/scanner-sdk/node_modules/math-intrinsics/isFinite.js +12 -0
  856. package/scanner-sdk/node_modules/math-intrinsics/isInteger.d.ts +3 -0
  857. package/scanner-sdk/node_modules/math-intrinsics/isInteger.js +16 -0
  858. package/scanner-sdk/node_modules/math-intrinsics/isNaN.d.ts +1 -0
  859. package/scanner-sdk/node_modules/math-intrinsics/isNaN.js +6 -0
  860. package/scanner-sdk/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  861. package/scanner-sdk/node_modules/math-intrinsics/isNegativeZero.js +6 -0
  862. package/scanner-sdk/node_modules/math-intrinsics/max.d.ts +1 -0
  863. package/scanner-sdk/node_modules/math-intrinsics/max.js +4 -0
  864. package/scanner-sdk/node_modules/math-intrinsics/min.d.ts +1 -0
  865. package/scanner-sdk/node_modules/math-intrinsics/min.js +4 -0
  866. package/scanner-sdk/node_modules/math-intrinsics/mod.d.ts +3 -0
  867. package/scanner-sdk/node_modules/math-intrinsics/mod.js +9 -0
  868. package/scanner-sdk/node_modules/math-intrinsics/package.json +86 -0
  869. package/scanner-sdk/node_modules/math-intrinsics/pow.d.ts +1 -0
  870. package/scanner-sdk/node_modules/math-intrinsics/pow.js +4 -0
  871. package/scanner-sdk/node_modules/math-intrinsics/round.d.ts +1 -0
  872. package/scanner-sdk/node_modules/math-intrinsics/round.js +4 -0
  873. package/scanner-sdk/node_modules/math-intrinsics/sign.d.ts +3 -0
  874. package/scanner-sdk/node_modules/math-intrinsics/sign.js +11 -0
  875. package/scanner-sdk/node_modules/math-intrinsics/test/index.js +192 -0
  876. package/scanner-sdk/node_modules/math-intrinsics/tsconfig.json +3 -0
  877. package/scanner-sdk/node_modules/media-typer/HISTORY.md +22 -0
  878. package/scanner-sdk/node_modules/media-typer/LICENSE +22 -0
  879. package/scanner-sdk/node_modules/media-typer/README.md +81 -0
  880. package/scanner-sdk/node_modules/media-typer/index.js +270 -0
  881. package/scanner-sdk/node_modules/media-typer/package.json +26 -0
  882. package/scanner-sdk/node_modules/merge-descriptors/HISTORY.md +21 -0
  883. package/scanner-sdk/node_modules/merge-descriptors/LICENSE +23 -0
  884. package/scanner-sdk/node_modules/merge-descriptors/README.md +49 -0
  885. package/scanner-sdk/node_modules/merge-descriptors/index.js +60 -0
  886. package/scanner-sdk/node_modules/merge-descriptors/package.json +39 -0
  887. package/scanner-sdk/node_modules/methods/HISTORY.md +29 -0
  888. package/scanner-sdk/node_modules/methods/LICENSE +24 -0
  889. package/scanner-sdk/node_modules/methods/README.md +51 -0
  890. package/scanner-sdk/node_modules/methods/index.js +69 -0
  891. package/scanner-sdk/node_modules/methods/package.json +36 -0
  892. package/scanner-sdk/node_modules/mime/CHANGELOG.md +164 -0
  893. package/scanner-sdk/node_modules/mime/LICENSE +21 -0
  894. package/scanner-sdk/node_modules/mime/README.md +90 -0
  895. package/scanner-sdk/node_modules/mime/cli.js +8 -0
  896. package/scanner-sdk/node_modules/mime/mime.js +108 -0
  897. package/scanner-sdk/node_modules/mime/package.json +44 -0
  898. package/scanner-sdk/node_modules/mime/src/build.js +53 -0
  899. package/scanner-sdk/node_modules/mime/src/test.js +60 -0
  900. package/scanner-sdk/node_modules/mime/types.json +1 -0
  901. package/scanner-sdk/node_modules/mime-db/HISTORY.md +507 -0
  902. package/scanner-sdk/node_modules/mime-db/LICENSE +23 -0
  903. package/scanner-sdk/node_modules/mime-db/README.md +100 -0
  904. package/scanner-sdk/node_modules/mime-db/db.json +8519 -0
  905. package/scanner-sdk/node_modules/mime-db/index.js +12 -0
  906. package/scanner-sdk/node_modules/mime-db/package.json +60 -0
  907. package/scanner-sdk/node_modules/mime-types/HISTORY.md +397 -0
  908. package/scanner-sdk/node_modules/mime-types/LICENSE +23 -0
  909. package/scanner-sdk/node_modules/mime-types/README.md +113 -0
  910. package/scanner-sdk/node_modules/mime-types/index.js +188 -0
  911. package/scanner-sdk/node_modules/mime-types/package.json +44 -0
  912. package/scanner-sdk/node_modules/ms/index.js +152 -0
  913. package/scanner-sdk/node_modules/ms/license.md +21 -0
  914. package/scanner-sdk/node_modules/ms/package.json +37 -0
  915. package/scanner-sdk/node_modules/ms/readme.md +51 -0
  916. package/scanner-sdk/node_modules/negotiator/HISTORY.md +108 -0
  917. package/scanner-sdk/node_modules/negotiator/LICENSE +24 -0
  918. package/scanner-sdk/node_modules/negotiator/README.md +203 -0
  919. package/scanner-sdk/node_modules/negotiator/index.js +82 -0
  920. package/scanner-sdk/node_modules/negotiator/lib/charset.js +169 -0
  921. package/scanner-sdk/node_modules/negotiator/lib/encoding.js +184 -0
  922. package/scanner-sdk/node_modules/negotiator/lib/language.js +179 -0
  923. package/scanner-sdk/node_modules/negotiator/lib/mediaType.js +294 -0
  924. package/scanner-sdk/node_modules/negotiator/package.json +42 -0
  925. package/scanner-sdk/node_modules/object-inspect/.eslintrc +53 -0
  926. package/scanner-sdk/node_modules/object-inspect/.github/FUNDING.yml +12 -0
  927. package/scanner-sdk/node_modules/object-inspect/.nycrc +13 -0
  928. package/scanner-sdk/node_modules/object-inspect/CHANGELOG.md +424 -0
  929. package/scanner-sdk/node_modules/object-inspect/LICENSE +21 -0
  930. package/scanner-sdk/node_modules/object-inspect/example/all.js +23 -0
  931. package/scanner-sdk/node_modules/object-inspect/example/circular.js +6 -0
  932. package/scanner-sdk/node_modules/object-inspect/example/fn.js +5 -0
  933. package/scanner-sdk/node_modules/object-inspect/example/inspect.js +10 -0
  934. package/scanner-sdk/node_modules/object-inspect/index.js +544 -0
  935. package/scanner-sdk/node_modules/object-inspect/package-support.json +20 -0
  936. package/scanner-sdk/node_modules/object-inspect/package.json +105 -0
  937. package/scanner-sdk/node_modules/object-inspect/readme.markdown +84 -0
  938. package/scanner-sdk/node_modules/object-inspect/test/bigint.js +58 -0
  939. package/scanner-sdk/node_modules/object-inspect/test/browser/dom.js +15 -0
  940. package/scanner-sdk/node_modules/object-inspect/test/circular.js +16 -0
  941. package/scanner-sdk/node_modules/object-inspect/test/deep.js +12 -0
  942. package/scanner-sdk/node_modules/object-inspect/test/element.js +53 -0
  943. package/scanner-sdk/node_modules/object-inspect/test/err.js +48 -0
  944. package/scanner-sdk/node_modules/object-inspect/test/fakes.js +29 -0
  945. package/scanner-sdk/node_modules/object-inspect/test/fn.js +76 -0
  946. package/scanner-sdk/node_modules/object-inspect/test/global.js +17 -0
  947. package/scanner-sdk/node_modules/object-inspect/test/has.js +15 -0
  948. package/scanner-sdk/node_modules/object-inspect/test/holes.js +15 -0
  949. package/scanner-sdk/node_modules/object-inspect/test/indent-option.js +271 -0
  950. package/scanner-sdk/node_modules/object-inspect/test/inspect.js +139 -0
  951. package/scanner-sdk/node_modules/object-inspect/test/lowbyte.js +12 -0
  952. package/scanner-sdk/node_modules/object-inspect/test/number.js +58 -0
  953. package/scanner-sdk/node_modules/object-inspect/test/quoteStyle.js +26 -0
  954. package/scanner-sdk/node_modules/object-inspect/test/toStringTag.js +40 -0
  955. package/scanner-sdk/node_modules/object-inspect/test/undef.js +12 -0
  956. package/scanner-sdk/node_modules/object-inspect/test/values.js +261 -0
  957. package/scanner-sdk/node_modules/object-inspect/test-core-js.js +26 -0
  958. package/scanner-sdk/node_modules/object-inspect/util.inspect.js +1 -0
  959. package/scanner-sdk/node_modules/on-finished/HISTORY.md +98 -0
  960. package/scanner-sdk/node_modules/on-finished/LICENSE +23 -0
  961. package/scanner-sdk/node_modules/on-finished/README.md +162 -0
  962. package/scanner-sdk/node_modules/on-finished/index.js +234 -0
  963. package/scanner-sdk/node_modules/on-finished/package.json +39 -0
  964. package/scanner-sdk/node_modules/parseurl/HISTORY.md +58 -0
  965. package/scanner-sdk/node_modules/parseurl/LICENSE +24 -0
  966. package/scanner-sdk/node_modules/parseurl/README.md +133 -0
  967. package/scanner-sdk/node_modules/parseurl/index.js +158 -0
  968. package/scanner-sdk/node_modules/parseurl/package.json +40 -0
  969. package/scanner-sdk/node_modules/path-to-regexp/LICENSE +21 -0
  970. package/scanner-sdk/node_modules/path-to-regexp/Readme.md +35 -0
  971. package/scanner-sdk/node_modules/path-to-regexp/index.js +158 -0
  972. package/scanner-sdk/node_modules/path-to-regexp/package.json +30 -0
  973. package/scanner-sdk/node_modules/picocolors/LICENSE +15 -0
  974. package/scanner-sdk/node_modules/picocolors/README.md +21 -0
  975. package/scanner-sdk/node_modules/picocolors/package.json +25 -0
  976. package/scanner-sdk/node_modules/picocolors/picocolors.browser.js +4 -0
  977. package/scanner-sdk/node_modules/picocolors/picocolors.d.ts +5 -0
  978. package/scanner-sdk/node_modules/picocolors/picocolors.js +75 -0
  979. package/scanner-sdk/node_modules/picocolors/types.d.ts +51 -0
  980. package/scanner-sdk/node_modules/proxy-addr/HISTORY.md +161 -0
  981. package/scanner-sdk/node_modules/proxy-addr/LICENSE +22 -0
  982. package/scanner-sdk/node_modules/proxy-addr/README.md +139 -0
  983. package/scanner-sdk/node_modules/proxy-addr/index.js +327 -0
  984. package/scanner-sdk/node_modules/proxy-addr/package.json +47 -0
  985. package/scanner-sdk/node_modules/qs/.editorconfig +46 -0
  986. package/scanner-sdk/node_modules/qs/.github/FUNDING.yml +12 -0
  987. package/scanner-sdk/node_modules/qs/.github/SECURITY.md +11 -0
  988. package/scanner-sdk/node_modules/qs/.github/THREAT_MODEL.md +78 -0
  989. package/scanner-sdk/node_modules/qs/.nycrc +13 -0
  990. package/scanner-sdk/node_modules/qs/CHANGELOG.md +644 -0
  991. package/scanner-sdk/node_modules/qs/LICENSE.md +29 -0
  992. package/scanner-sdk/node_modules/qs/README.md +740 -0
  993. package/scanner-sdk/node_modules/qs/dist/qs.js +141 -0
  994. package/scanner-sdk/node_modules/qs/eslint.config.mjs +56 -0
  995. package/scanner-sdk/node_modules/qs/lib/formats.js +23 -0
  996. package/scanner-sdk/node_modules/qs/lib/index.js +11 -0
  997. package/scanner-sdk/node_modules/qs/lib/parse.js +371 -0
  998. package/scanner-sdk/node_modules/qs/lib/stringify.js +356 -0
  999. package/scanner-sdk/node_modules/qs/lib/utils.js +340 -0
  1000. package/scanner-sdk/node_modules/qs/package.json +94 -0
  1001. package/scanner-sdk/node_modules/qs/test/empty-keys-cases.js +267 -0
  1002. package/scanner-sdk/node_modules/qs/test/parse.js +1512 -0
  1003. package/scanner-sdk/node_modules/qs/test/stringify.js +1310 -0
  1004. package/scanner-sdk/node_modules/qs/test/utils.js +397 -0
  1005. package/scanner-sdk/node_modules/range-parser/HISTORY.md +56 -0
  1006. package/scanner-sdk/node_modules/range-parser/LICENSE +23 -0
  1007. package/scanner-sdk/node_modules/range-parser/README.md +84 -0
  1008. package/scanner-sdk/node_modules/range-parser/index.js +162 -0
  1009. package/scanner-sdk/node_modules/range-parser/package.json +44 -0
  1010. package/scanner-sdk/node_modules/raw-body/LICENSE +22 -0
  1011. package/scanner-sdk/node_modules/raw-body/README.md +223 -0
  1012. package/scanner-sdk/node_modules/raw-body/index.d.ts +87 -0
  1013. package/scanner-sdk/node_modules/raw-body/index.js +336 -0
  1014. package/scanner-sdk/node_modules/raw-body/package.json +47 -0
  1015. package/scanner-sdk/node_modules/safe-buffer/LICENSE +21 -0
  1016. package/scanner-sdk/node_modules/safe-buffer/README.md +584 -0
  1017. package/scanner-sdk/node_modules/safe-buffer/index.d.ts +187 -0
  1018. package/scanner-sdk/node_modules/safe-buffer/index.js +65 -0
  1019. package/scanner-sdk/node_modules/safe-buffer/package.json +51 -0
  1020. package/scanner-sdk/node_modules/safer-buffer/LICENSE +21 -0
  1021. package/scanner-sdk/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  1022. package/scanner-sdk/node_modules/safer-buffer/Readme.md +156 -0
  1023. package/scanner-sdk/node_modules/safer-buffer/dangerous.js +58 -0
  1024. package/scanner-sdk/node_modules/safer-buffer/package.json +34 -0
  1025. package/scanner-sdk/node_modules/safer-buffer/safer.js +77 -0
  1026. package/scanner-sdk/node_modules/safer-buffer/tests.js +406 -0
  1027. package/scanner-sdk/node_modules/send/HISTORY.md +538 -0
  1028. package/scanner-sdk/node_modules/send/LICENSE +23 -0
  1029. package/scanner-sdk/node_modules/send/README.md +327 -0
  1030. package/scanner-sdk/node_modules/send/SECURITY.md +24 -0
  1031. package/scanner-sdk/node_modules/send/index.js +1142 -0
  1032. package/scanner-sdk/node_modules/send/node_modules/ms/index.js +162 -0
  1033. package/scanner-sdk/node_modules/send/node_modules/ms/license.md +21 -0
  1034. package/scanner-sdk/node_modules/send/node_modules/ms/package.json +38 -0
  1035. package/scanner-sdk/node_modules/send/node_modules/ms/readme.md +59 -0
  1036. package/scanner-sdk/node_modules/send/package.json +62 -0
  1037. package/scanner-sdk/node_modules/serve-static/HISTORY.md +493 -0
  1038. package/scanner-sdk/node_modules/serve-static/LICENSE +25 -0
  1039. package/scanner-sdk/node_modules/serve-static/README.md +257 -0
  1040. package/scanner-sdk/node_modules/serve-static/index.js +209 -0
  1041. package/scanner-sdk/node_modules/serve-static/package.json +42 -0
  1042. package/scanner-sdk/node_modules/setprototypeof/LICENSE +13 -0
  1043. package/scanner-sdk/node_modules/setprototypeof/README.md +31 -0
  1044. package/scanner-sdk/node_modules/setprototypeof/index.d.ts +2 -0
  1045. package/scanner-sdk/node_modules/setprototypeof/index.js +17 -0
  1046. package/scanner-sdk/node_modules/setprototypeof/package.json +38 -0
  1047. package/scanner-sdk/node_modules/setprototypeof/test/index.js +24 -0
  1048. package/scanner-sdk/node_modules/side-channel/.editorconfig +9 -0
  1049. package/scanner-sdk/node_modules/side-channel/.eslintrc +12 -0
  1050. package/scanner-sdk/node_modules/side-channel/.github/FUNDING.yml +12 -0
  1051. package/scanner-sdk/node_modules/side-channel/.nycrc +13 -0
  1052. package/scanner-sdk/node_modules/side-channel/CHANGELOG.md +110 -0
  1053. package/scanner-sdk/node_modules/side-channel/LICENSE +21 -0
  1054. package/scanner-sdk/node_modules/side-channel/README.md +61 -0
  1055. package/scanner-sdk/node_modules/side-channel/index.d.ts +14 -0
  1056. package/scanner-sdk/node_modules/side-channel/index.js +43 -0
  1057. package/scanner-sdk/node_modules/side-channel/package.json +85 -0
  1058. package/scanner-sdk/node_modules/side-channel/test/index.js +104 -0
  1059. package/scanner-sdk/node_modules/side-channel/tsconfig.json +9 -0
  1060. package/scanner-sdk/node_modules/side-channel-list/.editorconfig +9 -0
  1061. package/scanner-sdk/node_modules/side-channel-list/.eslintrc +11 -0
  1062. package/scanner-sdk/node_modules/side-channel-list/.github/FUNDING.yml +12 -0
  1063. package/scanner-sdk/node_modules/side-channel-list/.nycrc +13 -0
  1064. package/scanner-sdk/node_modules/side-channel-list/CHANGELOG.md +15 -0
  1065. package/scanner-sdk/node_modules/side-channel-list/LICENSE +21 -0
  1066. package/scanner-sdk/node_modules/side-channel-list/README.md +62 -0
  1067. package/scanner-sdk/node_modules/side-channel-list/index.d.ts +13 -0
  1068. package/scanner-sdk/node_modules/side-channel-list/index.js +113 -0
  1069. package/scanner-sdk/node_modules/side-channel-list/list.d.ts +14 -0
  1070. package/scanner-sdk/node_modules/side-channel-list/package.json +77 -0
  1071. package/scanner-sdk/node_modules/side-channel-list/test/index.js +104 -0
  1072. package/scanner-sdk/node_modules/side-channel-list/tsconfig.json +9 -0
  1073. package/scanner-sdk/node_modules/side-channel-map/.editorconfig +9 -0
  1074. package/scanner-sdk/node_modules/side-channel-map/.eslintrc +11 -0
  1075. package/scanner-sdk/node_modules/side-channel-map/.github/FUNDING.yml +12 -0
  1076. package/scanner-sdk/node_modules/side-channel-map/.nycrc +13 -0
  1077. package/scanner-sdk/node_modules/side-channel-map/CHANGELOG.md +22 -0
  1078. package/scanner-sdk/node_modules/side-channel-map/LICENSE +21 -0
  1079. package/scanner-sdk/node_modules/side-channel-map/README.md +62 -0
  1080. package/scanner-sdk/node_modules/side-channel-map/index.d.ts +15 -0
  1081. package/scanner-sdk/node_modules/side-channel-map/index.js +68 -0
  1082. package/scanner-sdk/node_modules/side-channel-map/package.json +80 -0
  1083. package/scanner-sdk/node_modules/side-channel-map/test/index.js +114 -0
  1084. package/scanner-sdk/node_modules/side-channel-map/tsconfig.json +9 -0
  1085. package/scanner-sdk/node_modules/side-channel-weakmap/.editorconfig +9 -0
  1086. package/scanner-sdk/node_modules/side-channel-weakmap/.eslintrc +12 -0
  1087. package/scanner-sdk/node_modules/side-channel-weakmap/.github/FUNDING.yml +12 -0
  1088. package/scanner-sdk/node_modules/side-channel-weakmap/.nycrc +13 -0
  1089. package/scanner-sdk/node_modules/side-channel-weakmap/CHANGELOG.md +28 -0
  1090. package/scanner-sdk/node_modules/side-channel-weakmap/LICENSE +21 -0
  1091. package/scanner-sdk/node_modules/side-channel-weakmap/README.md +62 -0
  1092. package/scanner-sdk/node_modules/side-channel-weakmap/index.d.ts +15 -0
  1093. package/scanner-sdk/node_modules/side-channel-weakmap/index.js +84 -0
  1094. package/scanner-sdk/node_modules/side-channel-weakmap/package.json +87 -0
  1095. package/scanner-sdk/node_modules/side-channel-weakmap/test/index.js +114 -0
  1096. package/scanner-sdk/node_modules/side-channel-weakmap/tsconfig.json +9 -0
  1097. package/scanner-sdk/node_modules/statuses/HISTORY.md +87 -0
  1098. package/scanner-sdk/node_modules/statuses/LICENSE +23 -0
  1099. package/scanner-sdk/node_modules/statuses/README.md +139 -0
  1100. package/scanner-sdk/node_modules/statuses/codes.json +65 -0
  1101. package/scanner-sdk/node_modules/statuses/index.js +146 -0
  1102. package/scanner-sdk/node_modules/statuses/package.json +49 -0
  1103. package/scanner-sdk/node_modules/toidentifier/HISTORY.md +9 -0
  1104. package/scanner-sdk/node_modules/toidentifier/LICENSE +21 -0
  1105. package/scanner-sdk/node_modules/toidentifier/README.md +61 -0
  1106. package/scanner-sdk/node_modules/toidentifier/index.js +32 -0
  1107. package/scanner-sdk/node_modules/toidentifier/package.json +38 -0
  1108. package/scanner-sdk/node_modules/type-is/HISTORY.md +259 -0
  1109. package/scanner-sdk/node_modules/type-is/LICENSE +23 -0
  1110. package/scanner-sdk/node_modules/type-is/README.md +170 -0
  1111. package/scanner-sdk/node_modules/type-is/index.js +266 -0
  1112. package/scanner-sdk/node_modules/type-is/package.json +45 -0
  1113. package/scanner-sdk/node_modules/unpipe/HISTORY.md +4 -0
  1114. package/scanner-sdk/node_modules/unpipe/LICENSE +22 -0
  1115. package/scanner-sdk/node_modules/unpipe/README.md +43 -0
  1116. package/scanner-sdk/node_modules/unpipe/index.js +69 -0
  1117. package/scanner-sdk/node_modules/unpipe/package.json +27 -0
  1118. package/scanner-sdk/node_modules/utils-merge/LICENSE +20 -0
  1119. package/scanner-sdk/node_modules/utils-merge/README.md +34 -0
  1120. package/scanner-sdk/node_modules/utils-merge/index.js +23 -0
  1121. package/scanner-sdk/node_modules/utils-merge/package.json +40 -0
  1122. package/scanner-sdk/node_modules/vary/HISTORY.md +39 -0
  1123. package/scanner-sdk/node_modules/vary/LICENSE +22 -0
  1124. package/scanner-sdk/node_modules/vary/README.md +101 -0
  1125. package/scanner-sdk/node_modules/vary/index.js +149 -0
  1126. package/scanner-sdk/node_modules/vary/package.json +43 -0
  1127. package/scanner-sdk/package-lock.json +1046 -0
  1128. package/scanner-sdk/package.json +25 -0
  1129. package/scanner-sdk/scan/adonis.js +177 -0
  1130. package/scanner-sdk/scan/express-files.js +326 -0
  1131. package/scanner-sdk/scan/express-static.js +292 -0
  1132. package/scanner-sdk/scan/express.js +217 -0
  1133. package/scanner-sdk/scan/fastify.js +1162 -0
  1134. package/scanner-sdk/scan/field-extractors.js +779 -0
  1135. package/scanner-sdk/scan/frontend.js +563 -0
  1136. package/scanner-sdk/scan/hapi.js +997 -0
  1137. package/scanner-sdk/scan/koa.js +250 -0
  1138. package/scanner-sdk/scan/nest-source.js +918 -0
  1139. package/scanner-sdk/scan/nestjs.js +660 -0
  1140. package/scanner-sdk/scan/nextjs.js +322 -0
  1141. package/scanner-sdk/scan/nuxt-value-types.js +521 -0
  1142. package/scanner-sdk/scan/nuxt.js +462 -0
  1143. package/scanner-sdk/scan/remix-routes.js +261 -0
  1144. package/scanner-sdk/scan/remix.js +348 -0
  1145. package/scanner-sdk/scan/response-shape.js +415 -0
  1146. package/scanner-sdk/scan/route-calls.js +663 -0
  1147. package/scanner-sdk/scan/route-segments.js +378 -0
  1148. package/scanner-sdk/scan/sveltekit-body.js +491 -0
  1149. package/scanner-sdk/scan/sveltekit-reply.js +328 -0
  1150. package/scanner-sdk/scan/sveltekit.js +149 -0
  1151. package/scanner-sdk/scan/text-utils.js +517 -0
  1152. package/scanner-sdk/scanner.js +52 -0
  1153. package/undo/bin/scan.js +23 -0
  1154. package/undo/index.js +104 -0
  1155. package/undo/lib/action-id.js +38 -0
  1156. package/undo/lib/capture-guard.js +8 -0
  1157. package/undo/lib/capture-mongo.js +341 -0
  1158. package/undo/lib/capture-mssql.js +901 -0
  1159. package/undo/lib/capture-mysql.js +909 -0
  1160. package/undo/lib/capture-prisma-mongo.js +297 -0
  1161. package/undo/lib/capture-prisma.js +900 -0
  1162. package/undo/lib/capture-sql.js +656 -0
  1163. package/undo/lib/capture-sqlite.js +933 -0
  1164. package/undo/lib/gate.js +190 -0
  1165. package/undo/lib/hooks/better-sqlite3.js +198 -0
  1166. package/undo/lib/hooks/mongodb.js +124 -0
  1167. package/undo/lib/hooks/mssql.js +209 -0
  1168. package/undo/lib/hooks/mysql2.js +148 -0
  1169. package/undo/lib/hooks/pg.js +156 -0
  1170. package/undo/lib/hooks/prisma.js +335 -0
  1171. package/undo/lib/hooks/sqlite3.js +310 -0
  1172. package/undo/lib/loader-watch.js +64 -0
  1173. package/undo/lib/log.js +34 -0
  1174. package/undo/lib/mssql-run.js +95 -0
  1175. package/undo/lib/prisma-structure.js +397 -0
  1176. package/undo/lib/report.js +50 -0
  1177. package/undo/lib/requester.js +33 -0
  1178. package/undo/lib/scanner.js +400 -0
  1179. package/undo/lib/schema-reader.js +129 -0
  1180. package/undo/lib/setup-check.js +294 -0
  1181. package/undo/lib/snapshot-crypto.js +96 -0
  1182. package/undo/lib/snapshot-sql.js +180 -0
  1183. package/undo/lib/snapshot-store-mongo.js +154 -0
  1184. package/undo/lib/snapshot-store-prisma-mongo.js +192 -0
  1185. package/undo/lib/snapshot-store-sqlite.js +140 -0
  1186. package/undo/lib/snapshot-store.js +272 -0
  1187. package/undo/lib/sql-classify-mssql.js +230 -0
  1188. package/undo/lib/sql-classify-mysql.js +167 -0
  1189. package/undo/lib/sql-classify.js +169 -0
  1190. package/undo/lib/sqlite-sql.js +357 -0
  1191. package/undo/lib/tagger.js +333 -0
  1192. package/undo/lib/undo-mongo.js +248 -0
  1193. package/undo/lib/undo-mssql.js +389 -0
  1194. package/undo/lib/undo-mysql.js +297 -0
  1195. package/undo/lib/undo-pg.js +248 -0
  1196. package/undo/lib/undo-prisma-mongo.js +263 -0
  1197. package/undo/lib/undo-prisma.js +404 -0
  1198. package/undo/lib/undo-route.js +197 -0
  1199. package/undo/lib/undo-sqlite.js +332 -0
  1200. package/undo/register.js +7 -0
  1201. package/scanner.js +0 -2719
  1202. /package/{bin → scanner-sdk/bin}/scan-frontend.js +0 -0
  1203. /package/{client.js → scanner-sdk/client.js} +0 -0
package/scanner.js DELETED
@@ -1,2719 +0,0 @@
1
- // botversion-sdk/scanner.js
2
- "use strict";
3
-
4
- /**
5
- * Scans an Express app object and extracts all registered routes
6
- */
7
- function scanExpressRoutes(app, cwd) {
8
- const endpoints = [];
9
- const seen = new Set();
10
-
11
- // Build body map from ALL files upfront
12
- const bodyMap = cwd ? buildBodyMap(cwd) : {};
13
-
14
- if (app) {
15
- if (app.lazyrouter) app.lazyrouter();
16
- const router = app._router || app.router || (app.stack ? app : null);
17
- if (router) {
18
- const stack = router.stack || [];
19
- extractRoutes(stack, "", endpoints, seen, bodyMap);
20
- }
21
- }
22
-
23
- // ALSO scan all JS/TS files statically for route definitions
24
- if (cwd) {
25
- const allFiles = scanAllExpressFiles(cwd);
26
- for (const file of allFiles) {
27
- const fileEndpoints = scanExpressFileStatically(file, seen);
28
- endpoints.push(...fileEndpoints);
29
- }
30
- }
31
-
32
- return endpoints;
33
- }
34
-
35
- function scanExpressFileStatically(filePath, seen) {
36
- const fs = require("fs");
37
- const endpoints = [];
38
-
39
- let content;
40
- try {
41
- content = fs.readFileSync(filePath, "utf8");
42
- } catch {
43
- return endpoints;
44
- }
45
-
46
- // Match patterns like:
47
- // app.get('/path', ...)
48
- // router.post('/path', ...)
49
- // app.all('/curd.php', ...)
50
- const routePattern =
51
- /\.(get|post|put|delete|patch|all)\s*\(\s*['"`]([^'"`]+)['"`]/gi;
52
-
53
- let match;
54
- while ((match = routePattern.exec(content)) !== null) {
55
- const method = match[1].toUpperCase();
56
- const routePath = match[2];
57
-
58
- // Skip middleware patterns
59
- if (routePath.includes("*")) continue;
60
-
61
- const key = method + ":" + routePath;
62
- if (seen.has(key)) continue;
63
- seen.add(key);
64
-
65
- const effectiveMethod = method === "ALL" ? "GET" : method;
66
- const needsBody = ["POST", "PUT", "PATCH"].includes(effectiveMethod);
67
- const bodyFields = needsBody ? extractBodyFieldsFromFile(content) : null;
68
-
69
- // GET inputs come from the query string; read them from this route's own code
70
- const queryFields =
71
- effectiveMethod === "GET"
72
- ? extractQueryFieldsFromFile(
73
- sliceRouteSegment(content, match.index, routePattern.source),
74
- )
75
- : null;
76
-
77
- const routeParamMap = buildRouteParamMap(routePath, []);
78
-
79
- endpoints.push({
80
- method: effectiveMethod,
81
- path: routePath,
82
- description: "",
83
- requestBody: bodyFields || queryFields,
84
- routeParamMap: routeParamMap,
85
- responseBody: extractResponseFieldsForRoute(
86
- content,
87
- match.index,
88
- routePattern.source,
89
- ),
90
- detectedBy: "static-scan-file",
91
- });
92
- }
93
-
94
- return endpoints;
95
- }
96
-
97
- /**
98
- * Recursively walks Express router stack and pulls out route layers
99
- *
100
- * Each layer in the stack is one of:
101
- * - a route layer → layer.route exists, has .path and .methods
102
- * - a router layer → layer.name === 'router', has its own .handle.stack
103
- * - middleware → everything else (body-parser, cors, etc.) — skip these
104
- */
105
- function extractRoutes(stack, prefix, endpoints, seen, bodyMap) {
106
- prefix = prefix || "";
107
-
108
- stack.forEach(function (layer) {
109
- // ── Route layer (app.get / app.post / etc.) ──────────────────────────
110
- if (layer.route) {
111
- var routePath = prefix + (layer.route.path || "");
112
- var methods = Object.keys(layer.route.methods).filter(function (m) {
113
- return layer.route.methods[m] === true;
114
- });
115
-
116
- methods.forEach(function (method) {
117
- method = method.toUpperCase();
118
- if (method === "_ALL") return;
119
-
120
- var key = method + ":" + routePath;
121
- if (seen.has(key)) return;
122
- seen.add(key);
123
-
124
- const needsBody = ["POST", "PUT", "PATCH"].includes(method);
125
- let requestBody = null;
126
-
127
- if (needsBody) {
128
- // Strategy 1: scan inline handler directly via fn.toString() — most accurate
129
- for (const handler of layer.route.stack) {
130
- const fn = handler.handle || handler;
131
- const fnStr = fn.toString();
132
- const fields = extractBodyFieldsFromFile(fnStr);
133
- if (fields) {
134
- requestBody = fields;
135
- break;
136
- }
137
- }
138
-
139
- // Strategy 2: fall back to bodyMap using handler name
140
- if (!requestBody) {
141
- const handlerName = extractHandlerName(layer);
142
- if (handlerName && bodyMap[handlerName]) {
143
- requestBody = bodyMap[handlerName];
144
- }
145
- }
146
- }
147
-
148
- // GET inputs come from the query string, so read them from the handler code
149
- if (method === "GET") {
150
- requestBody = extractQueryFieldsFromHandlers(layer.route.stack);
151
- }
152
-
153
- const routeParamMap = buildRouteParamMap(routePath, []);
154
-
155
- endpoints.push({
156
- method: method,
157
- path: routePath,
158
- description: "",
159
- requestBody: requestBody,
160
- responseBody: extractResponseFieldsFromHandlers(
161
- layer.route.stack,
162
- method,
163
- ),
164
- routeParamMap: routeParamMap,
165
- detectedBy: "static-scan",
166
- });
167
- });
168
- return;
169
- }
170
-
171
- // ── Nested router layer (app.use('/prefix', router)) ─────────────────
172
- if (layer.name === "router" && layer.handle && layer.handle.stack) {
173
- // Extract the mount path from the regexp
174
- var mountPath = prefix + regexpToPath(layer.regexp, layer.keys);
175
- extractRoutes(layer.handle.stack, mountPath, endpoints, seen, bodyMap);
176
- return;
177
- }
178
-
179
- // ── Everything else is middleware — skip ─────────────────────────────
180
- });
181
- }
182
-
183
- /**
184
- * Scans Next.js API routes from the pages/api directory
185
- */
186
- function scanNextJsRoutes(pagesDir) {
187
- const fs = require("fs");
188
- const path = require("path");
189
- const endpoints = [];
190
-
191
- const apiDir = path.join(pagesDir, "api");
192
-
193
- if (!fs.existsSync(apiDir)) {
194
- return endpoints;
195
- }
196
-
197
- function walkDir(dir, prefix) {
198
- prefix = prefix || "/api";
199
- const files = fs.readdirSync(dir);
200
-
201
- files.forEach(function (file) {
202
- const fullPath = path.join(dir, file);
203
- const stat = fs.statSync(fullPath);
204
-
205
- if (stat.isDirectory()) {
206
- walkDir(fullPath, prefix + "/" + file);
207
- return;
208
- }
209
-
210
- if (!/\.(js|ts)$/.test(file)) return;
211
- if (file.startsWith("_")) return;
212
- // test files and type-declaration files are never endpoints
213
- if (/\.(test|spec|d)\.(js|ts)$/.test(file)) return;
214
-
215
- const routeName = file.replace(/\.(js|ts)$/, "");
216
- const routePath =
217
- routeName === "index" ? prefix : prefix + "/" + routeName;
218
- const normalizedPath = routePath.replace(/\[([^\]]+)\]/g, ":$1");
219
-
220
- const fileContent = fs.readFileSync(fullPath, "utf8");
221
- // adapter files (tRPC): the real endpoints are the procedures behind them, learned from live traffic
222
- if (/\bcreateNextApiHandler\b|@trpc\/server\/adapters/.test(fileContent))
223
- return;
224
- const methods = detectMethodsFromFile(fullPath);
225
-
226
- methods.forEach(function (method) {
227
- // In files that handle several methods, read only this method's own code
228
- // (the whole file is used when the methods cannot be told apart)
229
- const methodCode =
230
- getMethodSegment(fileContent, method, methods, "pages") ||
231
- fileContent;
232
- // Body methods fall back to the whole file if their own code has no fields
233
- const bodyFields =
234
- method === "GET"
235
- ? null
236
- : extractBodyFieldsFromFile(methodCode) ||
237
- (method !== "DELETE"
238
- ? extractBodyFieldsFromFile(fileContent)
239
- : null);
240
- const queryFields = extractQueryFieldsFromFile(methodCode);
241
-
242
- // GET inputs come from the query string; only this method's own code is read
243
- const getQueryFields =
244
- method === "GET"
245
- ? removePathParamFields(
246
- extractQueryFieldsFromFile(
247
- getMethodSegment(fileContent, "GET", methods, "pages") || "",
248
- ),
249
- normalizedPath,
250
- )
251
- : null;
252
-
253
- // For DELETE with no body fields, query params are the input
254
- const effectiveRequestBody =
255
- bodyFields ||
256
- (method === "DELETE" && queryFields ? queryFields : null) ||
257
- getQueryFields;
258
-
259
- const routeParamMap = buildRouteParamMap(normalizedPath, []);
260
-
261
- endpoints.push({
262
- method: method,
263
- path: normalizedPath,
264
- description: "",
265
- requestBody: effectiveRequestBody,
266
- responseBody: extractResponseFieldsForMethod(
267
- fileContent,
268
- method,
269
- methods,
270
- "pages",
271
- ),
272
- routeParamMap: routeParamMap,
273
- detectedBy: "static-scan",
274
- });
275
- });
276
- });
277
- }
278
-
279
- walkDir(apiDir);
280
- return endpoints;
281
- }
282
-
283
- /**
284
- * Reads a file and detects which HTTP methods it handles
285
- */
286
- // Matches any variable that holds the request method (req.method, method, httpMethod, ...)
287
- const METHOD_REF =
288
- "[\\w$.?]*[mM]ethod[\\w$]*(?:\\s*\\.\\s*toUpperCase\\s*\\(\\s*\\))?";
289
- const HTTP_METHOD_NAMES = ["GET", "POST", "PUT", "DELETE", "PATCH"];
290
-
291
- // Reads which HTTP methods a pages-style route file handles, whatever the variable is called
292
- function detectMethodsFromFile(filePath) {
293
- try {
294
- const fs = require("fs");
295
- const content = fs.readFileSync(filePath, "utf8");
296
- const detected = new Set();
297
-
298
- HTTP_METHOD_NAMES.forEach(function (m) {
299
- const patterns = [
300
- // method === "X" / method !== "X"
301
- new RegExp(
302
- METHOD_REF + "\\s*(?:===?|!==?)\\s*['\"`]" + m + "['\"`]",
303
- "i",
304
- ),
305
- // "X" === method
306
- new RegExp(
307
- "['\"`]" + m + "['\"`]\\s*(?:===?|!==?)\\s*" + METHOD_REF,
308
- "i",
309
- ),
310
- // switch (...) { case "X": }
311
- new RegExp("case\\s*['\"`]" + m + "['\"`]", "i"),
312
- ];
313
- if (
314
- patterns.some(function (p) {
315
- return p.test(content);
316
- })
317
- ) {
318
- detected.add(m);
319
- }
320
- });
321
-
322
- // ["GET", "POST"].includes(method)
323
- const includesRe = new RegExp(
324
- "\\[([^\\]]*)\\]\\s*\\.includes\\s*\\(\\s*" + METHOD_REF,
325
- "gi",
326
- );
327
- for (const found of content.matchAll(includesRe)) {
328
- HTTP_METHOD_NAMES.forEach(function (m) {
329
- if (new RegExp("['\"`]" + m + "['\"`]", "i").test(found[1])) {
330
- detected.add(m);
331
- }
332
- });
333
- }
334
-
335
- // no recognizable method check means the file is treated as GET-only
336
- if (detected.size === 0) {
337
- return ["GET"];
338
- }
339
- return Array.from(detected);
340
- } catch (e) {
341
- return ["GET", "POST"];
342
- }
343
- }
344
-
345
- /**
346
- * Extract :param names from a path like /users/:id/posts/:postId
347
- */
348
- function extractPathParams(routePath) {
349
- const params = [];
350
- const matches = routePath.match(/:([a-zA-Z_][a-zA-Z0-9_]*)/g);
351
- if (matches) {
352
- matches.forEach(function (m) {
353
- params.push(m.replace(":", ""));
354
- });
355
- }
356
- return params;
357
- }
358
-
359
- /**
360
- * Build a simple schema object from param names
361
- */
362
- function buildParamSchema(params) {
363
- const schema = {};
364
- params.forEach(function (p) {
365
- schema[p] = "string";
366
- });
367
- return schema;
368
- }
369
-
370
- function inferFieldType(fieldName, content) {
371
- const arrayPatterns = [
372
- new RegExp(
373
- `${fieldName}\\s*\\.\\s*(map|filter|forEach|push|reduce|find|some|every|includes|join|slice|splice|length)\\b`,
374
- ),
375
- new RegExp(`Array\\.isArray\\s*\\(\\s*${fieldName}\\s*\\)`),
376
- new RegExp(`for\\s*\\(.*of\\s+${fieldName}\\b`),
377
- new RegExp(`\\[\\s*\\.\\.\\.${fieldName}\\s*\\]`),
378
- ];
379
- if (arrayPatterns.some((p) => p.test(content))) return "array";
380
-
381
- const numberPatterns = [
382
- new RegExp(`${fieldName}\\s*[+\\-*/%]\\s*\\d`),
383
- new RegExp(`parseInt\\s*\\(\\s*${fieldName}`),
384
- new RegExp(`parseFloat\\s*\\(\\s*${fieldName}`),
385
- new RegExp(`Number\\s*\\(\\s*${fieldName}`),
386
- ];
387
- if (numberPatterns.some((p) => p.test(content))) return "number";
388
-
389
- const boolPatterns = [
390
- new RegExp(`${fieldName}\\s*===?\\s*(true|false)`),
391
- new RegExp(`(true|false)\\s*===?\\s*${fieldName}`),
392
- new RegExp(`Boolean\\s*\\(\\s*${fieldName}`),
393
- new RegExp(`typeof\\s+${fieldName}\\s*!==?\\s*["']boolean["']`),
394
- new RegExp(`typeof\\s+${fieldName}\\s*===?\\s*["']boolean["']`),
395
- ];
396
- if (boolPatterns.some((p) => p.test(content))) return "boolean";
397
-
398
- return "string";
399
- }
400
-
401
- function extractBodyFieldsFromFile(content) {
402
- const fields = new Set();
403
-
404
- // Pattern 1
405
- const destructureMatches = content.matchAll(
406
- /const\s*\{([^}]+)\}\s*=\s*req\.body/g,
407
- );
408
- for (const destructureMatch of destructureMatches) {
409
- destructureMatch[1].split(",").forEach(function (f) {
410
- const clean = f.trim().split(":")[0].trim();
411
- if (clean) fields.add(clean);
412
- });
413
- }
414
-
415
- // Pattern 2
416
- const dotMatches = content.matchAll(/req\.body\.([a-zA-Z_][a-zA-Z0-9_]*)/g);
417
- for (const match of dotMatches) {
418
- fields.add(match[1]);
419
- }
420
-
421
- // Pattern 3
422
- const bodyDotMatches = content.matchAll(/body\.([a-zA-Z_][a-zA-Z0-9_]*)/g);
423
- for (const match of bodyDotMatches) {
424
- fields.add(match[1]);
425
- }
426
-
427
- // Pattern 4 — only if variable name is clearly body-related
428
- const bodyVarMatch = content.match(/const\s+(\w+)\s*=\s*req\.body/);
429
- if (bodyVarMatch) {
430
- const varName = bodyVarMatch[1];
431
- const isSafeVarName =
432
- /^(body|payload|input|data|requestBody|reqBody|bodyData)$/.test(varName);
433
- if (isSafeVarName) {
434
- const varMatches = content.matchAll(
435
- new RegExp(`${varName}\\.([a-zA-Z_][a-zA-Z0-9_]*)`, "g"),
436
- );
437
- for (const match of varMatches) {
438
- fields.add(match[1]);
439
- }
440
- }
441
- }
442
-
443
- // Pattern 5 — optional chaining req.body?.name
444
- const optionalMatches = content.matchAll(
445
- /req\.body\?\.([a-zA-Z_][a-zA-Z0-9_]*)/g,
446
- );
447
- for (const match of optionalMatches) {
448
- fields.add(match[1]);
449
- }
450
-
451
- if (fields.size === 0) return null;
452
-
453
- const properties = {};
454
- fields.forEach(function (field) {
455
- const type = inferFieldType(field, content);
456
- properties[field] =
457
- type === "array"
458
- ? { type: "array", items: { type: "object" } }
459
- : { type };
460
- });
461
-
462
- return { type: "object", properties };
463
- }
464
-
465
- function scanNextJsAppRoutes(appDir) {
466
- const fs = require("fs");
467
- const path = require("path");
468
- const endpoints = [];
469
-
470
- const apiDir = path.join(appDir, "api");
471
- if (!fs.existsSync(apiDir)) {
472
- return endpoints;
473
- }
474
-
475
- function walkDir(dir, routePath) {
476
- routePath = routePath || "/api";
477
- const files = fs.readdirSync(dir);
478
-
479
- files.forEach(function (file) {
480
- const fullPath = path.join(dir, file);
481
- const stat = fs.statSync(fullPath);
482
-
483
- if (stat.isDirectory()) {
484
- // Convert [param] → :param
485
- const segment = file.replace(/\[([^\]]+)\]/g, ":$1");
486
- walkDir(fullPath, routePath + "/" + segment);
487
- return;
488
- }
489
-
490
- // Only process route.ts / route.js
491
- if (!/^route\.(js|ts)$/.test(file)) return;
492
-
493
- const content = fs.readFileSync(fullPath, "utf8");
494
- const methods = detectAppRouterMethods(content);
495
-
496
- methods.forEach(function (method) {
497
- // In files that handle several methods, read only this method's own code
498
- // (the whole file is used when the methods cannot be told apart)
499
- const methodCode =
500
- getMethodSegment(content, method, methods, "app") || content;
501
- // Body methods fall back to the whole file if their own code has no fields
502
- const bodyFields =
503
- method === "GET"
504
- ? null
505
- : extractAppRouterBodyFields(methodCode) ||
506
- (method !== "DELETE"
507
- ? extractAppRouterBodyFields(content)
508
- : null);
509
- const queryFields = extractQueryFieldsFromFile(methodCode);
510
-
511
- const routeParamMap = buildRouteParamMap(routePath, []);
512
-
513
- endpoints.push({
514
- method: method,
515
- path: routePath,
516
- description: "",
517
- requestBody:
518
- bodyFields ||
519
- (method === "DELETE" && queryFields ? queryFields : null) ||
520
- (method === "GET"
521
- ? removePathParamFields(
522
- extractQueryFieldsFromFile(
523
- getMethodSegment(content, "GET", methods, "app") || "",
524
- ),
525
- routePath,
526
- )
527
- : null),
528
- responseBody: extractResponseFieldsForMethod(
529
- content,
530
- method,
531
- methods,
532
- "app",
533
- ),
534
- routeParamMap: routeParamMap,
535
- detectedBy: "static-scan",
536
- });
537
- });
538
- });
539
- }
540
-
541
- walkDir(apiDir);
542
- return endpoints;
543
- }
544
-
545
- // Reads every common way a route file exports its HTTP handlers (function, const, re-export, destructured)
546
- function detectAppRouterMethods(content) {
547
- const HTTP_METHODS = ["GET", "POST", "PUT", "DELETE", "PATCH"];
548
- const methods = HTTP_METHODS.filter(function (m) {
549
- return [
550
- new RegExp("export\\s+(?:async\\s+)?function\\s+" + m + "\\b"),
551
- new RegExp("export\\s+(?:const|let|var)\\s+" + m + "\\b"),
552
- new RegExp("export\\s*\\{[^}]*\\b" + m + "\\b[^}]*\\}"),
553
- new RegExp(
554
- "export\\s+(?:const|let|var)\\s*\\{[^}]*\\b" + m + "\\b[^}]*\\}",
555
- ),
556
- ].some(function (re) {
557
- return re.test(content);
558
- });
559
- });
560
- return methods.length > 0 ? methods : ["GET"];
561
- }
562
-
563
- function extractAppRouterBodyFields(content) {
564
- const fields = new Set();
565
-
566
- // Pattern 1: const { userId, tokens } = await request.json()
567
- const destructureMatches = content.matchAll(
568
- /const\s*\{([^}]+)\}\s*=\s*await\s+\w+\.json\(\)/g,
569
- );
570
- for (const match of destructureMatches) {
571
- match[1].split(",").forEach(function (f) {
572
- const clean = f.trim().split(":")[0].trim();
573
- if (clean) fields.add(clean);
574
- });
575
- }
576
-
577
- // Pattern 2: const body = await request.json() then body.userId
578
- const bodyVarMatch = content.match(
579
- /const\s+(\w+)\s*=\s*await\s+\w+\.json\(\)/,
580
- );
581
- if (bodyVarMatch) {
582
- const varName = bodyVarMatch[1];
583
- const varMatches = content.matchAll(
584
- new RegExp(`${varName}\\.([a-zA-Z_][a-zA-Z0-9_]*)`, "g"),
585
- );
586
- for (const match of varMatches) {
587
- fields.add(match[1]);
588
- }
589
- }
590
-
591
- // Pattern 3: (await request.json()).userId
592
- const inlineMatches = content.matchAll(
593
- /\(await\s+\w+\.json\(\)\)\.([a-zA-Z_][a-zA-Z0-9_]*)/g,
594
- );
595
- for (const match of inlineMatches) {
596
- fields.add(match[1]);
597
- }
598
-
599
- if (fields.size === 0) return null;
600
-
601
- const properties = {};
602
- fields.forEach(function (field) {
603
- const type = inferFieldType(field, content);
604
- properties[field] =
605
- type === "array"
606
- ? { type: "array", items: { type: "object" } }
607
- : { type };
608
- });
609
-
610
- return { type: "object", properties };
611
- }
612
-
613
- function buildRouteParamMap(routePath, segments) {
614
- const paramMap = {};
615
- const parts = routePath.split("/").filter(Boolean);
616
-
617
- for (let i = 0; i < parts.length; i++) {
618
- const part = parts[i];
619
-
620
- // Skip catch-all [...slug] and optional [[...slug]]
621
- if (/^\[?\[\.\.\./.test(part)) continue;
622
-
623
- // Check if this segment is a dynamic param
624
- // Handles both Next.js style [id] and Express style :id
625
- const nextParamMatch = part.match(/^\[([^\]]+)\]$/);
626
- const expressParamMatch = part.match(/^:([a-zA-Z_][a-zA-Z0-9_]*)$/);
627
- const paramMatch = nextParamMatch || expressParamMatch;
628
- if (!paramMatch) continue;
629
-
630
- const paramName = paramMatch[1];
631
-
632
- // If param already has a descriptive name like [projectId], use it as-is
633
- if (paramName !== "id" && paramName !== "slug" && paramName !== "param") {
634
- paramMap[paramName] = paramName;
635
- continue;
636
- }
637
-
638
- // If param is just [id], look at the parent folder name to figure out type
639
- // e.g. projects/[id] → projectId
640
- const parentSegment = parts[i - 1];
641
- if (parentSegment) {
642
- // Remove any dynamic brackets from parent if it's also a param
643
- const cleanParent = parentSegment.replace(/^\[([^\]]+)\]$/, "$1");
644
- // Singularize simple plural names: projects → project, users → user
645
- const singular = cleanParent.replace(/ies$/, "y").replace(/s$/, "");
646
- paramMap[paramName] = singular + "Id";
647
- } else {
648
- // No parent segment, just call it "id"
649
- paramMap[paramName] = "id";
650
- }
651
- }
652
-
653
- return paramMap;
654
- }
655
-
656
- function extractQueryFieldsFromFile(content) {
657
- const fields = new Set();
658
- const NAME = /^[A-Za-z_$][\w$.-]*$/;
659
- const addField = function (raw) {
660
- const name = String(raw).trim().split(":")[0].split("=")[0].trim();
661
- if (name && NAME.test(name)) fields.add(name);
662
- };
663
-
664
- // const { id, page = 1 } = req.query
665
- const destructureRe =
666
- /(?:const|let|var)\s*\{([^}]+)\}\s*=\s*(?:await\s+)?(?:req|request|ctx(?:\.request)?)\.query\b/g;
667
- for (const m of String(content).matchAll(destructureRe)) {
668
- m[1].split(",").forEach(addField);
669
- }
670
-
671
- // req.query.id / req.query?.id
672
- const dotRe =
673
- /(?:req|request|ctx(?:\.request)?)\.query(?:\?\.|\.)([A-Za-z_$][\w$]*)/g;
674
- for (const m of String(content).matchAll(dotRe)) addField(m[1]);
675
-
676
- // req.query["id"]
677
- const bracketRe =
678
- /(?:req|request|ctx(?:\.request)?)\.query\s*\??\.?\[\s*['"`]([^'"`]+)['"`]\s*\]/g;
679
- for (const m of String(content).matchAll(bracketRe)) addField(m[1]);
680
-
681
- // url.searchParams.get("id") / nextUrl.searchParams.get("id")
682
- const searchParamsRe =
683
- /searchParams\s*\??\.\s*(?:get|getAll|has)\s*\(\s*['"`]([^'"`]+)['"`]/g;
684
- for (const m of String(content).matchAll(searchParamsRe)) addField(m[1]);
685
-
686
- if (fields.size === 0) return null;
687
-
688
- const properties = {};
689
- fields.forEach(function (field) {
690
- properties[field] = { type: "string" };
691
- });
692
-
693
- return { type: "object", properties };
694
- }
695
-
696
- // Drops fields that are really path params (Next.js Pages puts [id] into req.query too)
697
- function removePathParamFields(schema, routePath) {
698
- if (!schema || !schema.properties) return null;
699
- const pathParams = new Set(extractPathParams(routePath));
700
- const properties = {};
701
- Object.keys(schema.properties).forEach(function (k) {
702
- if (!pathParams.has(k)) properties[k] = schema.properties[k];
703
- });
704
- return Object.keys(properties).length > 0
705
- ? { type: "object", properties }
706
- : null;
707
- }
708
-
709
- // Returns only the code belonging to one HTTP method in a multi-method file.
710
- // Returns null when it cannot be told apart, so no guess is made.
711
- function getMethodSegment(content, method, allMethods, style) {
712
- if (!allMethods || allMethods.length < 2) return content;
713
- const markers = [];
714
- allMethods.forEach(function (m) {
715
- const index = findStaticMethodMarkerIndex(content, style, m);
716
- if (index !== -1) markers.push({ method: m, index: index });
717
- });
718
- const own = markers.find(function (x) {
719
- return x.method === method;
720
- });
721
- if (!own) return null;
722
- if (style === "app") {
723
- const handlerCode = findStaticHandlerCode(content, own.index);
724
- if (handlerCode) return handlerCode;
725
- }
726
- markers.sort(function (a, b) {
727
- return a.index - b.index;
728
- });
729
- const pos = markers.indexOf(own);
730
- const end =
731
- pos + 1 < markers.length ? markers[pos + 1].index : content.length;
732
- return content.slice(own.index, end);
733
- }
734
-
735
- // The code from one route definition (app.get(...), router.get(...)) up to the next one
736
- function sliceRouteSegment(content, startIndex, routePatternSource) {
737
- try {
738
- const re = new RegExp(routePatternSource, "gi");
739
- let end = content.length;
740
- let hit;
741
- while ((hit = re.exec(content)) !== null) {
742
- if (hit.index > startIndex) {
743
- end = hit.index;
744
- break;
745
- }
746
- }
747
- return content.slice(startIndex, end);
748
- } catch (e) {
749
- return "";
750
- }
751
- }
752
-
753
- // For live Express routes: reads query fields from every handler's source code
754
- function extractQueryFieldsFromHandlers(stack) {
755
- try {
756
- const merged = {};
757
- for (const layer of stack) {
758
- const fn = layer.handle || layer;
759
- if (typeof fn !== "function") continue;
760
- const fields = extractQueryFieldsFromFile(
761
- Function.prototype.toString.call(fn),
762
- );
763
- if (fields) Object.assign(merged, fields.properties);
764
- }
765
- return Object.keys(merged).length > 0
766
- ? { type: "object", properties: merged }
767
- : null;
768
- } catch (e) {
769
- return null;
770
- }
771
- }
772
-
773
- /**
774
- * Convert Express regexp back to a mount path string
775
- * Used for nested routers (app.use('/api', router))
776
- */
777
- function regexpToPath(regexp, keys) {
778
- if (!regexp) return "";
779
-
780
- // Express 4.x stores the original path string directly
781
- if (regexp.source === "^\\/?(?=\\/|$)") return "";
782
-
783
- try {
784
- var src = regexp.source;
785
-
786
- // Remove anchors and cleanup
787
- src = src
788
- .replace(/^\^/, "")
789
- .replace(/\\\//g, "/")
790
- .replace(/\/\?\(\?=\/\|\$\)$/, "")
791
- .replace(/\/\?\$?$/, "")
792
- .replace(/\(\?:\(\[\^\/\]\+\?\)\)/g, function (_, i) {
793
- return keys && keys[i] ? ":" + keys[i].name : ":param";
794
- });
795
-
796
- // Clean up any remaining regex artifacts
797
- src = src.replace(/\(\?:/g, "").replace(/\)/g, "");
798
-
799
- if (!src || src === "/") return "";
800
- if (!src.startsWith("/")) src = "/" + src;
801
-
802
- return src;
803
- } catch (e) {
804
- return "";
805
- }
806
- }
807
-
808
- function scanAllExpressFiles(cwd) {
809
- const fs = require("fs");
810
- const path = require("path");
811
-
812
- const SKIP_DIRS = [
813
- "node_modules",
814
- ".git",
815
- ".next",
816
- "dist",
817
- "build",
818
- ".cache",
819
- "coverage",
820
- "out",
821
- ];
822
-
823
- const routeFiles = [];
824
-
825
- function walk(dir, depth) {
826
- if (depth > 4) return;
827
-
828
- let entries;
829
- try {
830
- entries = fs.readdirSync(dir);
831
- } catch {
832
- return;
833
- }
834
-
835
- for (const entry of entries) {
836
- if (SKIP_DIRS.includes(entry)) continue;
837
-
838
- const fullPath = path.join(dir, entry);
839
- let stat;
840
- try {
841
- stat = fs.statSync(fullPath);
842
- } catch {
843
- continue;
844
- }
845
-
846
- if (stat.isDirectory()) {
847
- walk(fullPath, depth + 1);
848
- } else if (/\.(js|ts)$/.test(entry)) {
849
- try {
850
- const content = fs.readFileSync(fullPath, "utf8");
851
- // Check if file contains Express route definitions
852
- const isExpressFile =
853
- content.includes("express()") ||
854
- content.includes("express.Router()") ||
855
- content.includes("Router()") ||
856
- // Match only route-like patterns: app.get('/...) or router.post('/...)
857
- /(?:app|router|server)\.(get|post|put|delete|patch|all)\s*\(\s*['"`]\//.test(
858
- content,
859
- );
860
-
861
- if (isExpressFile) {
862
- routeFiles.push(fullPath);
863
- }
864
- } catch {
865
- continue;
866
- }
867
- }
868
- }
869
- }
870
-
871
- walk(cwd, 0);
872
- return routeFiles;
873
- }
874
-
875
- function buildBodyMap(cwd) {
876
- const fs = require("fs");
877
- const path = require("path");
878
- const bodyMap = {}; // { functionName: { type: "object", properties: {...} } }
879
-
880
- const SKIP_DIRS = [
881
- "node_modules",
882
- ".git",
883
- ".next",
884
- "dist",
885
- "build",
886
- ".cache",
887
- "coverage",
888
- "out",
889
- ];
890
-
891
- function walk(dir, depth) {
892
- if (depth > 4) return;
893
- let entries;
894
- try {
895
- entries = fs.readdirSync(dir);
896
- } catch {
897
- return;
898
- }
899
-
900
- for (const entry of entries) {
901
- if (SKIP_DIRS.includes(entry)) continue;
902
- const fullPath = path.join(dir, entry);
903
- let stat;
904
- try {
905
- stat = fs.statSync(fullPath);
906
- } catch {
907
- continue;
908
- }
909
-
910
- if (stat.isDirectory()) {
911
- walk(fullPath, depth + 1);
912
- continue;
913
- }
914
-
915
- if (!/\.(js|ts)$/.test(entry)) continue;
916
-
917
- let content;
918
- try {
919
- content = fs.readFileSync(fullPath, "utf8");
920
- } catch {
921
- continue;
922
- }
923
-
924
- // Skip files with no req.body at all
925
- // Split file into individual function chunks more reliably
926
- // by finding each function and extracting a reasonable chunk after it
927
-
928
- const fnPatterns = [
929
- // function loginUser(req, res) {
930
- /(?:export\s+)?(?:async\s+)?function\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*\([^)]*\)\s*\{/g,
931
- // const loginUser = async (req, res) => {
932
- /const\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(?:async\s*)?\([^)]*\)\s*=>\s*\{/g,
933
- // exports.loginUser = async (req, res) => {
934
- /exports\.([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(?:async\s*)?\([^)]*\)\s*=>\s*\{/g,
935
- // export const loginUser = async (req, res) => {
936
- /export\s+const\s+([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*(?:async\s*)?\([^)]*\)\s*=>\s*\{/g,
937
- ];
938
-
939
- // Map every function name in this file to the whole file's body fields.
940
- // Brace-counting is unreliable across JS/TS variations, so we use
941
- // file-level field extraction here. Per-function accuracy is handled
942
- // at runtime by Strategy 2 (fn.toString()) in extractRoutes.
943
- const fileFields = extractBodyFieldsFromFile(content);
944
- if (fileFields) {
945
- const fnNames = new Set();
946
- for (const pattern of fnPatterns) {
947
- pattern.lastIndex = 0; // reset regex state before each use
948
- let m;
949
- while ((m = pattern.exec(content)) !== null) fnNames.add(m[1]);
950
- }
951
- for (const name of fnNames) {
952
- if (!bodyMap[name]) {
953
- // don't overwrite a more precise entry
954
- bodyMap[name] = fileFields;
955
- }
956
- }
957
- }
958
- }
959
- }
960
-
961
- walk(cwd, 0);
962
- return bodyMap;
963
- }
964
-
965
- function extractHandlerName(layer) {
966
- const handlers = layer.route.stack.map((h) => h.handle || h);
967
-
968
- const SKIP_NAMES = new Set([
969
- "anonymous",
970
- "",
971
- "bound dispatch",
972
- "middleware",
973
- "protect",
974
- "admin",
975
- "auth",
976
- "verify",
977
- "validate",
978
- "isAuth",
979
- "isAdmin",
980
- "checkAuth",
981
- "authenticate",
982
- ]);
983
-
984
- // Try from last to first, skip known middleware names
985
- for (let i = handlers.length - 1; i >= 0; i--) {
986
- const fn = handlers[i];
987
- const name = fn.name || "";
988
- if (name && !SKIP_NAMES.has(name) && !name.startsWith("bound ")) {
989
- return name;
990
- }
991
- }
992
- return null;
993
- }
994
-
995
- function convertNextJsSegment(segment) {
996
- // Skip catch-all [...slug] and optional [[...slug]]
997
- if (/^\[?\[\.\.\./.test(segment)) return null;
998
- // Convert [projectId] → :projectId (Next.js / Nuxt / SvelteKit)
999
- if (/^\[([^\]]+)\]$/.test(segment))
1000
- return segment.replace(/^\[([^\]]+)\]$/, ":$1");
1001
- // Convert $projectId → :projectId (Remix)
1002
- if (/^\$([a-zA-Z_][a-zA-Z0-9_]*)$/.test(segment))
1003
- return segment.replace(/^\$/, ":");
1004
- return segment;
1005
- }
1006
-
1007
- function extractParamPositions(segments) {
1008
- const paramMap = {};
1009
- segments.forEach(function (segment, index) {
1010
- if (segment && segment.startsWith(":")) {
1011
- const paramName = segment.slice(1);
1012
- paramMap[paramName] = index;
1013
- }
1014
- });
1015
- return paramMap;
1016
- }
1017
-
1018
- function scanConfigBasedRoutes(cwd) {
1019
- const fs = require("fs");
1020
- const path = require("path");
1021
- const patterns = [];
1022
- const seen = new Set();
1023
-
1024
- const filesToCheck = [
1025
- // React Router
1026
- path.join(cwd, "src", "App.jsx"),
1027
- path.join(cwd, "src", "App.tsx"),
1028
- path.join(cwd, "src", "App.js"),
1029
- path.join(cwd, "src", "router.jsx"),
1030
- path.join(cwd, "src", "router.tsx"),
1031
- path.join(cwd, "src", "router.js"),
1032
- path.join(cwd, "src", "routes.jsx"),
1033
- path.join(cwd, "src", "routes.tsx"),
1034
- path.join(cwd, "src", "routes.js"),
1035
- path.join(cwd, "src", "Router.jsx"),
1036
- path.join(cwd, "src", "Router.tsx"),
1037
- // Vue Router
1038
- path.join(cwd, "src", "router", "index.js"),
1039
- path.join(cwd, "src", "router", "index.ts"),
1040
- path.join(cwd, "src", "router.js"),
1041
- path.join(cwd, "src", "router.ts"),
1042
- // Angular
1043
- path.join(cwd, "src", "app", "app-routing.module.ts"),
1044
- path.join(cwd, "src", "app", "app.routes.ts"),
1045
- // TanStack Router
1046
- path.join(cwd, "src", "routes.tsx"),
1047
- path.join(cwd, "src", "routeTree.gen.ts"),
1048
- path.join(cwd, "src", "router.tsx"),
1049
- ];
1050
-
1051
- // Also scan any file named *routes* or *router* anywhere in src/
1052
- const srcDir = path.join(cwd, "src");
1053
- if (fs.existsSync(srcDir)) {
1054
- function findRouteFiles(dir, depth) {
1055
- if (depth > 3) return;
1056
- let entries;
1057
- try {
1058
- entries = fs.readdirSync(dir);
1059
- } catch {
1060
- return;
1061
- }
1062
- for (const entry of entries) {
1063
- if (["node_modules", ".git", "dist", "build"].includes(entry)) continue;
1064
- const fullPath = path.join(dir, entry);
1065
- let stat;
1066
- try {
1067
- stat = fs.statSync(fullPath);
1068
- } catch {
1069
- continue;
1070
- }
1071
- if (stat.isDirectory()) {
1072
- findRouteFiles(fullPath, depth + 1);
1073
- } else if (
1074
- /\.(js|ts|jsx|tsx)$/.test(entry) &&
1075
- /route|router/i.test(entry) &&
1076
- !filesToCheck.includes(fullPath)
1077
- ) {
1078
- filesToCheck.push(fullPath);
1079
- }
1080
- }
1081
- }
1082
- findRouteFiles(srcDir, 0);
1083
- }
1084
-
1085
- for (const filePath of filesToCheck) {
1086
- if (!fs.existsSync(filePath)) continue;
1087
-
1088
- let content;
1089
- try {
1090
- content = fs.readFileSync(filePath, "utf8");
1091
- } catch {
1092
- continue;
1093
- }
1094
-
1095
- // Pattern 1 — React Router JSX: <Route path="/:projectId/dashboard" />
1096
- const jsxRouteMatches = content.matchAll(
1097
- /<Route[^>]+path=["']([^"']+)["']/g,
1098
- );
1099
- for (const match of jsxRouteMatches) {
1100
- addConfigPattern(match[1], seen, patterns);
1101
- }
1102
-
1103
- // Pattern 2 — React Router / Vue Router object: { path: '/:projectId/dashboard' }
1104
- const objectRouteMatches = content.matchAll(/path\s*:\s*["']([^"']+)["']/g);
1105
- for (const match of objectRouteMatches) {
1106
- addConfigPattern(match[1], seen, patterns);
1107
- }
1108
-
1109
- // Pattern 3 — Angular: { path: ':projectId/dashboard' }
1110
- const angularRouteMatches = content.matchAll(
1111
- /\{\s*path\s*:\s*["']([^"']+)["']/g,
1112
- );
1113
- for (const match of angularRouteMatches) {
1114
- addConfigPattern(match[1], seen, patterns);
1115
- }
1116
-
1117
- // Pattern 4 — TanStack Router: createRoute({ path: '/dashboard/:id' })
1118
- const tanstackMatches = content.matchAll(
1119
- /createRoute\s*\(\s*\{[^}]*path\s*:\s*["']([^"']+)["']/g,
1120
- );
1121
- for (const match of tanstackMatches) {
1122
- addConfigPattern(match[1], seen, patterns);
1123
- }
1124
-
1125
- // Pattern 5 — TanStack Router file-based: createFileRoute('/dashboard/$id')
1126
- const tanstackFileMatches = content.matchAll(
1127
- /createFileRoute\s*\(\s*["']([^"']+)["']/g,
1128
- );
1129
- for (const match of tanstackFileMatches) {
1130
- // Convert TanStack $param to :param
1131
- const normalized = match[1].replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)/g, ":$1");
1132
- addConfigPattern(normalized, seen, patterns);
1133
- }
1134
-
1135
- // Pattern 6 — Vue Router with children
1136
- const vueChildrenMatches = content.matchAll(
1137
- /children\s*:\s*\[[^\]]*path\s*:\s*["']([^"']+)["']/g,
1138
- );
1139
- for (const match of vueChildrenMatches) {
1140
- addConfigPattern(match[1], seen, patterns);
1141
- }
1142
- }
1143
-
1144
- return patterns;
1145
- }
1146
-
1147
- function addConfigPattern(routePath, seen, patterns) {
1148
- // Skip empty, wildcard and catch-all routes
1149
- if (!routePath || routePath === "*" || routePath === "**") return;
1150
- // Skip routes with no dynamic params
1151
- if (!routePath.includes(":") && !routePath.includes("$")) return;
1152
-
1153
- // Normalize — ensure leading slash
1154
- const normalized = routePath.startsWith("/") ? routePath : "/" + routePath;
1155
-
1156
- if (seen.has(normalized)) return;
1157
- seen.add(normalized);
1158
-
1159
- // Extract params and their positions
1160
- const segments = normalized.split("/").filter(Boolean);
1161
- const paramMap = {};
1162
- segments.forEach(function (segment, index) {
1163
- if (segment.startsWith(":")) {
1164
- paramMap[segment.slice(1)] = index;
1165
- }
1166
- });
1167
-
1168
- if (Object.keys(paramMap).length === 0) return;
1169
-
1170
- patterns.push({ pattern: normalized, params: paramMap });
1171
- }
1172
-
1173
- function findAllFrontendDirs(cwd) {
1174
- const fs = require("fs");
1175
- const path = require("path");
1176
-
1177
- const FRONTEND_INDICATORS = [
1178
- "next.config.js",
1179
- "next.config.ts",
1180
- "react-router.config.ts",
1181
- "react-router.config.js",
1182
- "vite.config.ts",
1183
- "vite.config.js",
1184
- "nuxt.config.ts",
1185
- "nuxt.config.js",
1186
- "svelte.config.js",
1187
- "svelte.config.ts",
1188
- "remix.config.js",
1189
- "remix.config.ts",
1190
- "angular.json",
1191
- "astro.config.mjs",
1192
- "astro.config.ts",
1193
- "astro.config.js",
1194
- "app.config.ts",
1195
- "qwik.config.ts",
1196
- ];
1197
-
1198
- const SKIP_DIRS = new Set([
1199
- "node_modules",
1200
- ".git",
1201
- "dist",
1202
- "build",
1203
- ".next",
1204
- ".nuxt",
1205
- "coverage",
1206
- ]);
1207
-
1208
- const found = [];
1209
-
1210
- function isFrontendDir(dir) {
1211
- // Check 1 — indicator files (most reliable)
1212
- const hasIndicator = FRONTEND_INDICATORS.some(function (indicator) {
1213
- try {
1214
- return fs.existsSync(path.join(dir, indicator));
1215
- } catch {
1216
- return false;
1217
- }
1218
- });
1219
- if (hasIndicator) return true;
1220
-
1221
- // Check 2 — fallback: check package.json for frontend frameworks
1222
- try {
1223
- const pkgPath = path.join(dir, "package.json");
1224
- if (fs.existsSync(pkgPath)) {
1225
- const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
1226
- const deps = Object.assign(
1227
- {},
1228
- pkg.dependencies || {},
1229
- pkg.devDependencies || {},
1230
- );
1231
- const frontendPackages = [
1232
- "react",
1233
- "vue",
1234
- "angular",
1235
- "@angular/core",
1236
- "svelte",
1237
- "solid-js",
1238
- "preact",
1239
- "nuxt",
1240
- "@remix-run/react",
1241
- "next",
1242
- "@sveltejs/kit",
1243
- "astro",
1244
- "gatsby",
1245
- "@solidjs/start",
1246
- "@builder.io/qwik",
1247
- "@builder.io/qwik-city",
1248
- ];
1249
- if (
1250
- frontendPackages.some(function (p) {
1251
- return deps[p];
1252
- })
1253
- ) {
1254
- return true;
1255
- }
1256
- }
1257
- } catch {
1258
- // silent fail
1259
- }
1260
-
1261
- return false;
1262
- }
1263
-
1264
- // Always check cwd itself first
1265
- if (isFrontendDir(cwd)) {
1266
- found.push(cwd);
1267
- }
1268
-
1269
- // ── Step 1: Scan subfolders inside cwd ──────────────────────────────
1270
- let cwdEntries;
1271
- try {
1272
- cwdEntries = fs.readdirSync(cwd);
1273
- } catch {
1274
- cwdEntries = [];
1275
- }
1276
-
1277
- for (const entry of cwdEntries) {
1278
- if (SKIP_DIRS.has(entry)) continue;
1279
-
1280
- const sub = path.join(cwd, entry);
1281
- let stat;
1282
- try {
1283
- stat = fs.statSync(sub);
1284
- } catch {
1285
- continue;
1286
- }
1287
- if (!stat.isDirectory()) continue;
1288
-
1289
- // Level 1 — direct subfolders of cwd
1290
- if (isFrontendDir(sub) && !found.includes(sub)) {
1291
- found.push(sub);
1292
- }
1293
-
1294
- // Level 2 — one level deeper (e.g. packages/apps/frontend)
1295
- let subEntries;
1296
- try {
1297
- subEntries = fs.readdirSync(sub);
1298
- } catch {
1299
- continue;
1300
- }
1301
-
1302
- for (const subEntry of subEntries) {
1303
- if (SKIP_DIRS.has(subEntry)) continue;
1304
- const subSub = path.join(sub, subEntry);
1305
- let subStat;
1306
- try {
1307
- subStat = fs.statSync(subSub);
1308
- } catch {
1309
- continue;
1310
- }
1311
- if (!subStat.isDirectory()) continue;
1312
- if (isFrontendDir(subSub) && !found.includes(subSub)) {
1313
- found.push(subSub);
1314
- }
1315
- }
1316
- }
1317
-
1318
- // Note: we intentionally do NOT walk up to sibling folders (e.g. a
1319
- // separate frontend/ folder next to backend/) anymore. That only worked
1320
- // in local dev monorepos where both folders live on the same disk. In
1321
- // production, frontend and backend are frequently on completely separate
1322
- // servers, so there is nothing to find outside cwd. If this install has
1323
- // no frontend, classification (in index.js) reports that to the
1324
- // dashboard instead of guessing at a folder that may not exist here.
1325
-
1326
- // If nothing found, fall back to cwd
1327
- if (found.length === 0) {
1328
- found.push(cwd);
1329
- }
1330
-
1331
- return found;
1332
- }
1333
-
1334
- function scanFrontendRoutes(cwd) {
1335
- const fs = require("fs");
1336
- const path = require("path");
1337
- const patterns = [];
1338
- const seen = new Set();
1339
-
1340
- const candidateDirs = findAllFrontendDirs(cwd);
1341
-
1342
- function walkDir(dir, routeSegments) {
1343
- if (!fs.existsSync(dir)) return;
1344
- let entries;
1345
- try {
1346
- entries = fs.readdirSync(dir);
1347
- } catch {
1348
- return;
1349
- }
1350
-
1351
- entries.forEach(function (file) {
1352
- const fullPath = path.join(dir, file);
1353
- let stat;
1354
- try {
1355
- stat = fs.statSync(fullPath);
1356
- } catch {
1357
- return;
1358
- }
1359
-
1360
- if (stat.isDirectory()) {
1361
- if (file === "api") return;
1362
- if (file.startsWith("_")) return;
1363
- if (/^\(.*\)$/.test(file)) {
1364
- walkDir(fullPath, routeSegments);
1365
- return;
1366
- }
1367
- const segment = convertNextJsSegment(file);
1368
- if (!segment) return;
1369
- walkDir(fullPath, routeSegments.concat(segment));
1370
- return;
1371
- }
1372
-
1373
- if (!/\.(js|ts|jsx|tsx|vue|svelte|astro)$/.test(file)) return;
1374
- if (file.startsWith("_")) return;
1375
-
1376
- const routeName = file.replace(/\.(js|ts|jsx|tsx|vue|svelte|astro)$/, "");
1377
-
1378
- if (
1379
- ["layout", "loading", "error", "template", "not-found"].includes(
1380
- routeName,
1381
- )
1382
- )
1383
- return;
1384
-
1385
- if (routeName.startsWith("+") && routeName !== "+page") return;
1386
-
1387
- const isRemixRoute =
1388
- routeName.includes(".") && !routeName.startsWith("+");
1389
- let finalSegments;
1390
-
1391
- if (isRemixRoute) {
1392
- const remixSegments = routeName
1393
- .split(".")
1394
- .map((s) => convertNextJsSegment(s) || s);
1395
- finalSegments = routeSegments.concat(remixSegments);
1396
- } else if (
1397
- routeName === "index" ||
1398
- routeName === "page" ||
1399
- routeName === "+page"
1400
- ) {
1401
- finalSegments = routeSegments;
1402
- } else {
1403
- finalSegments = routeSegments.concat(
1404
- convertNextJsSegment(routeName) || routeName,
1405
- );
1406
- }
1407
-
1408
- const pattern = "/" + finalSegments.filter(Boolean).join("/");
1409
- if (seen.has(pattern)) return;
1410
- seen.add(pattern);
1411
-
1412
- const paramMap = extractParamPositions(finalSegments);
1413
- if (Object.keys(paramMap).length === 0) return;
1414
-
1415
- patterns.push({ pattern, params: paramMap });
1416
- });
1417
- }
1418
-
1419
- for (const candidate of candidateDirs) {
1420
- const dirsToScan = [
1421
- // Next.js
1422
- path.join(candidate, "pages"),
1423
- path.join(candidate, "src", "pages"),
1424
- path.join(candidate, "app"),
1425
- path.join(candidate, "src", "app"),
1426
- // React Router / Remix
1427
- path.join(candidate, "src", "routes"),
1428
- path.join(candidate, "routes"),
1429
- path.join(candidate, "app", "routes"),
1430
- // SvelteKit
1431
- path.join(candidate, "src", "routes"),
1432
- // Nuxt
1433
- path.join(candidate, "pages"),
1434
- path.join(candidate, "src", "pages"),
1435
- // Astro
1436
- path.join(candidate, "src", "pages"),
1437
- ];
1438
-
1439
- dirsToScan.forEach(function (dir) {
1440
- if (fs.existsSync(dir)) {
1441
- walkDir(dir, []);
1442
- }
1443
- });
1444
-
1445
- const configPatterns = scanConfigBasedRoutes(candidate);
1446
- configPatterns.forEach(function (p) {
1447
- if (!seen.has(p.pattern)) {
1448
- seen.add(p.pattern);
1449
- patterns.push(p);
1450
- }
1451
- });
1452
- }
1453
-
1454
- return patterns;
1455
- }
1456
-
1457
- /**
1458
- * Scans Fastify routes from the codebase statically
1459
- * Handles:
1460
- * - fastify.get('/path', handler)
1461
- * - fastify.post('/path', handler)
1462
- * - fastify.route({ method: 'GET', url: '/path' })
1463
- * - fastify.register(plugin, { prefix: '/api' })
1464
- */
1465
- function scanFastifyRoutes(cwd) {
1466
- const fs = require("fs");
1467
- const path = require("path");
1468
- const endpoints = [];
1469
- const seen = new Set();
1470
-
1471
- const SKIP_DIRS = [
1472
- "node_modules",
1473
- ".git",
1474
- ".next",
1475
- "dist",
1476
- "build",
1477
- ".cache",
1478
- "coverage",
1479
- "out",
1480
- ];
1481
-
1482
- // Build body map from all files upfront
1483
- const bodyMap = cwd ? buildBodyMap(cwd) : {};
1484
-
1485
- function walk(dir, depth) {
1486
- if (depth > 4) return;
1487
- let entries;
1488
- try {
1489
- entries = fs.readdirSync(dir);
1490
- } catch {
1491
- return;
1492
- }
1493
-
1494
- for (const entry of entries) {
1495
- if (SKIP_DIRS.includes(entry)) continue;
1496
- const fullPath = path.join(dir, entry);
1497
- let stat;
1498
- try {
1499
- stat = fs.statSync(fullPath);
1500
- } catch {
1501
- continue;
1502
- }
1503
-
1504
- if (stat.isDirectory()) {
1505
- walk(fullPath, depth + 1);
1506
- continue;
1507
- }
1508
-
1509
- if (!/\.(js|ts)$/.test(entry)) continue;
1510
-
1511
- let content;
1512
- try {
1513
- content = fs.readFileSync(fullPath, "utf8");
1514
- } catch {
1515
- continue;
1516
- }
1517
-
1518
- // Only process files that look like Fastify route files
1519
- const isFastifyFile =
1520
- content.includes("fastify") ||
1521
- content.includes("Fastify") ||
1522
- /\.(get|post|put|delete|patch|route)\s*\(/.test(content);
1523
-
1524
- if (!isFastifyFile) continue;
1525
-
1526
- // Pattern 1 — fastify.get('/path', handler)
1527
- // Pattern 2 — fastify.post('/path', handler)
1528
- const shorthandPattern =
1529
- /(?:fastify|app|server|router)\.(get|post|put|delete|patch)\s*\(\s*['"`]([^'"`]+)['"`]/gi;
1530
-
1531
- let match;
1532
- while ((match = shorthandPattern.exec(content)) !== null) {
1533
- const method = match[1].toUpperCase();
1534
- const routePath = match[2];
1535
- if (routePath.includes("*")) continue;
1536
-
1537
- const key = method + ":" + routePath;
1538
- if (seen.has(key)) continue;
1539
- seen.add(key);
1540
-
1541
- const needsBody = ["POST", "PUT", "PATCH"].includes(method);
1542
- const bodyFields = needsBody
1543
- ? extractBodyFieldsFromFile(content)
1544
- : null;
1545
- const routeParamMap = buildRouteParamMap(routePath, []);
1546
-
1547
- endpoints.push({
1548
- method,
1549
- path: routePath,
1550
- description: "",
1551
- requestBody: bodyFields,
1552
- routeParamMap,
1553
- detectedBy: "static-scan-fastify",
1554
- });
1555
- }
1556
-
1557
- // Pattern 3 — fastify.route({ method: 'GET', url: '/path' })
1558
- const routeObjectPattern =
1559
- /\.route\s*\(\s*\{[^}]*method\s*:\s*['"`]([^'"`]+)['"`][^}]*url\s*:\s*['"`]([^'"`]+)['"`]/gi;
1560
-
1561
- while ((match = routeObjectPattern.exec(content)) !== null) {
1562
- const method = match[1].toUpperCase();
1563
- const routePath = match[2];
1564
- if (routePath.includes("*")) continue;
1565
-
1566
- const key = method + ":" + routePath;
1567
- if (seen.has(key)) continue;
1568
- seen.add(key);
1569
-
1570
- const needsBody = ["POST", "PUT", "PATCH"].includes(method);
1571
- const bodyFields = needsBody
1572
- ? extractBodyFieldsFromFile(content)
1573
- : null;
1574
- const routeParamMap = buildRouteParamMap(routePath, []);
1575
-
1576
- endpoints.push({
1577
- method,
1578
- path: routePath,
1579
- description: "",
1580
- requestBody: bodyFields,
1581
- routeParamMap,
1582
- detectedBy: "static-scan-fastify",
1583
- });
1584
- }
1585
-
1586
- // Pattern 4 — fastify.route({ method: ['GET', 'POST'], url: '/path' })
1587
- // handles array of methods
1588
- const routeArrayPattern =
1589
- /\.route\s*\(\s*\{[^}]*method\s*:\s*\[([^\]]+)\][^}]*url\s*:\s*['"`]([^'"`]+)['"`]/gi;
1590
-
1591
- while ((match = routeArrayPattern.exec(content)) !== null) {
1592
- const methodsRaw = match[1];
1593
- const routePath = match[2];
1594
- if (routePath.includes("*")) continue;
1595
-
1596
- const methods = methodsRaw
1597
- .split(",")
1598
- .map((m) => m.trim().replace(/['"`]/g, "").toUpperCase())
1599
- .filter(Boolean);
1600
-
1601
- for (const method of methods) {
1602
- const key = method + ":" + routePath;
1603
- if (seen.has(key)) continue;
1604
- seen.add(key);
1605
-
1606
- const needsBody = ["POST", "PUT", "PATCH"].includes(method);
1607
- const bodyFields = needsBody
1608
- ? extractBodyFieldsFromFile(content)
1609
- : null;
1610
- const routeParamMap = buildRouteParamMap(routePath, []);
1611
-
1612
- endpoints.push({
1613
- method,
1614
- path: routePath,
1615
- description: "",
1616
- requestBody: bodyFields,
1617
- routeParamMap,
1618
- detectedBy: "static-scan-fastify",
1619
- });
1620
- }
1621
- }
1622
- }
1623
- }
1624
-
1625
- walk(cwd, 0);
1626
- return endpoints;
1627
- }
1628
-
1629
- /**
1630
- * Scans NestJS routes from the codebase statically
1631
- * Handles:
1632
- * - @Controller('/users')
1633
- * - @Get('/path')
1634
- * - @Post('/path')
1635
- * - @Put('/path')
1636
- * - @Delete('/path')
1637
- * - @Patch('/path')
1638
- */
1639
- function scanNestJsRoutes(cwd) {
1640
- const fs = require("fs");
1641
- const path = require("path");
1642
- const endpoints = [];
1643
- const seen = new Set();
1644
-
1645
- const SKIP_DIRS = [
1646
- "node_modules",
1647
- ".git",
1648
- ".next",
1649
- "dist",
1650
- "build",
1651
- ".cache",
1652
- "coverage",
1653
- "out",
1654
- ];
1655
-
1656
- function walk(dir, depth) {
1657
- if (depth > 4) return;
1658
- let entries;
1659
- try {
1660
- entries = fs.readdirSync(dir);
1661
- } catch {
1662
- return;
1663
- }
1664
-
1665
- for (const entry of entries) {
1666
- if (SKIP_DIRS.includes(entry)) continue;
1667
- const fullPath = path.join(dir, entry);
1668
- let stat;
1669
- try {
1670
- stat = fs.statSync(fullPath);
1671
- } catch {
1672
- continue;
1673
- }
1674
-
1675
- if (stat.isDirectory()) {
1676
- walk(fullPath, depth + 1);
1677
- continue;
1678
- }
1679
-
1680
- if (!/\.(ts|js)$/.test(entry)) continue;
1681
-
1682
- let content;
1683
- try {
1684
- content = fs.readFileSync(fullPath, "utf8");
1685
- } catch {
1686
- continue;
1687
- }
1688
-
1689
- // Only process files that look like NestJS controller files
1690
- const isNestFile =
1691
- content.includes("@Controller") ||
1692
- content.includes("@Get(") ||
1693
- content.includes("@Post(") ||
1694
- content.includes("@Put(") ||
1695
- content.includes("@Delete(") ||
1696
- content.includes("@Patch(");
1697
-
1698
- if (!isNestFile) continue;
1699
-
1700
- // Extract controller prefix — @Controller('/users') or @Controller('users')
1701
- let controllerPrefix = "";
1702
- const controllerMatch = content.match(
1703
- /@Controller\s*\(\s*['"`]([^'"`]*)['"`]\s*\)/,
1704
- );
1705
- if (controllerMatch) {
1706
- controllerPrefix = controllerMatch[1].startsWith("/")
1707
- ? controllerMatch[1]
1708
- : "/" + controllerMatch[1];
1709
- }
1710
-
1711
- // Extract all method decorators
1712
- const methodPattern =
1713
- /@(Get|Post|Put|Delete|Patch)\s*\(\s*['"`]?([^'"`\s\)]*?)['"`]?\s*\)/gi;
1714
-
1715
- let match;
1716
- while ((match = methodPattern.exec(content)) !== null) {
1717
- const method = match[1].toUpperCase();
1718
- const methodPath = match[2] || "";
1719
-
1720
- const routeFull =
1721
- controllerPrefix +
1722
- (methodPath
1723
- ? methodPath.startsWith("/")
1724
- ? methodPath
1725
- : "/" + methodPath
1726
- : "");
1727
-
1728
- const normalizedPath = routeFull.replace(
1729
- /:([a-zA-Z_][a-zA-Z0-9_]*)/g,
1730
- ":$1",
1731
- );
1732
-
1733
- const key = method + ":" + normalizedPath;
1734
- if (seen.has(key)) continue;
1735
- seen.add(key);
1736
-
1737
- const needsBody = ["POST", "PUT", "PATCH"].includes(method);
1738
- const bodyFields = needsBody
1739
- ? extractBodyFieldsFromFile(content)
1740
- : null;
1741
- const routeParamMap = buildRouteParamMap(normalizedPath, []);
1742
-
1743
- endpoints.push({
1744
- method,
1745
- path: normalizedPath,
1746
- description: "",
1747
- requestBody: bodyFields,
1748
- routeParamMap,
1749
- detectedBy: "static-scan-nestjs",
1750
- });
1751
- }
1752
- }
1753
- }
1754
-
1755
- walk(cwd, 0);
1756
- return endpoints;
1757
- }
1758
-
1759
- /**
1760
- * Scans Koa routes from the codebase statically
1761
- * Handles:
1762
- * - router.get('/path', handler)
1763
- * - router.post('/path', handler)
1764
- * - router.put('/path', handler)
1765
- * - router.delete('/path', handler)
1766
- * - router.patch('/path', handler)
1767
- */
1768
- function scanKoaRoutes(cwd) {
1769
- const fs = require("fs");
1770
- const path = require("path");
1771
- const endpoints = [];
1772
- const seen = new Set();
1773
-
1774
- const SKIP_DIRS = [
1775
- "node_modules",
1776
- ".git",
1777
- ".next",
1778
- "dist",
1779
- "build",
1780
- ".cache",
1781
- "coverage",
1782
- "out",
1783
- ];
1784
-
1785
- function walk(dir, depth) {
1786
- if (depth > 4) return;
1787
- let entries;
1788
- try {
1789
- entries = fs.readdirSync(dir);
1790
- } catch {
1791
- return;
1792
- }
1793
-
1794
- for (const entry of entries) {
1795
- if (SKIP_DIRS.includes(entry)) continue;
1796
- const fullPath = path.join(dir, entry);
1797
- let stat;
1798
- try {
1799
- stat = fs.statSync(fullPath);
1800
- } catch {
1801
- continue;
1802
- }
1803
-
1804
- if (stat.isDirectory()) {
1805
- walk(fullPath, depth + 1);
1806
- continue;
1807
- }
1808
-
1809
- if (!/\.(js|ts)$/.test(entry)) continue;
1810
-
1811
- let content;
1812
- try {
1813
- content = fs.readFileSync(fullPath, "utf8");
1814
- } catch {
1815
- continue;
1816
- }
1817
-
1818
- // Only process files that look like Koa route files
1819
- const isKoaFile =
1820
- content.includes("koa-router") ||
1821
- content.includes("@koa/router") ||
1822
- content.includes("new Router()") ||
1823
- /router\.(get|post|put|delete|patch)\s*\(/.test(content);
1824
-
1825
- if (!isKoaFile) continue;
1826
-
1827
- const routePattern =
1828
- /router\.(get|post|put|delete|patch)\s*\(\s*['"`]([^'"`]+)['"`]/gi;
1829
-
1830
- let match;
1831
- while ((match = routePattern.exec(content)) !== null) {
1832
- const method = match[1].toUpperCase();
1833
- const routePath = match[2];
1834
- if (routePath.includes("*")) continue;
1835
-
1836
- const key = method + ":" + routePath;
1837
- if (seen.has(key)) continue;
1838
- seen.add(key);
1839
-
1840
- const needsBody = ["POST", "PUT", "PATCH"].includes(method);
1841
- const bodyFields = needsBody
1842
- ? extractBodyFieldsFromFile(content)
1843
- : null;
1844
- const routeParamMap = buildRouteParamMap(routePath, []);
1845
-
1846
- endpoints.push({
1847
- method,
1848
- path: routePath,
1849
- description: "",
1850
- requestBody: bodyFields,
1851
- routeParamMap,
1852
- detectedBy: "static-scan-koa",
1853
- });
1854
- }
1855
- }
1856
- }
1857
-
1858
- walk(cwd, 0);
1859
- return endpoints;
1860
- }
1861
-
1862
- /**
1863
- * Scans Hapi routes from the codebase statically
1864
- * Handles:
1865
- * - server.route({ method: 'GET', path: '/path', handler })
1866
- * - server.route([{ method: 'POST', path: '/path', handler }])
1867
- */
1868
- function scanHapiRoutes(cwd) {
1869
- const fs = require("fs");
1870
- const path = require("path");
1871
- const endpoints = [];
1872
- const seen = new Set();
1873
-
1874
- const SKIP_DIRS = [
1875
- "node_modules",
1876
- ".git",
1877
- ".next",
1878
- "dist",
1879
- "build",
1880
- ".cache",
1881
- "coverage",
1882
- "out",
1883
- ];
1884
-
1885
- function walk(dir, depth) {
1886
- if (depth > 4) return;
1887
- let entries;
1888
- try {
1889
- entries = fs.readdirSync(dir);
1890
- } catch {
1891
- return;
1892
- }
1893
-
1894
- for (const entry of entries) {
1895
- if (SKIP_DIRS.includes(entry)) continue;
1896
- const fullPath = path.join(dir, entry);
1897
- let stat;
1898
- try {
1899
- stat = fs.statSync(fullPath);
1900
- } catch {
1901
- continue;
1902
- }
1903
-
1904
- if (stat.isDirectory()) {
1905
- walk(fullPath, depth + 1);
1906
- continue;
1907
- }
1908
-
1909
- if (!/\.(js|ts)$/.test(entry)) continue;
1910
-
1911
- let content;
1912
- try {
1913
- content = fs.readFileSync(fullPath, "utf8");
1914
- } catch {
1915
- continue;
1916
- }
1917
-
1918
- const isHapiFile =
1919
- content.includes("@hapi/hapi") ||
1920
- content.includes("require('hapi')") ||
1921
- content.includes('require("hapi")') ||
1922
- content.includes("server.route(");
1923
-
1924
- if (!isHapiFile) continue;
1925
-
1926
- // Pattern — method and path can be in any order inside the object
1927
- const routePattern =
1928
- /server\.route\s*\(\s*\{[^}]*method\s*:\s*['"`]([^'"`]+)['"`][^}]*path\s*:\s*['"`]([^'"`]+)['"`]/gi;
1929
-
1930
- let match;
1931
- while ((match = routePattern.exec(content)) !== null) {
1932
- const method = match[1].toUpperCase();
1933
- const routePath = match[2];
1934
- if (routePath.includes("*")) continue;
1935
-
1936
- const key = method + ":" + routePath;
1937
- if (seen.has(key)) continue;
1938
- seen.add(key);
1939
-
1940
- const needsBody = ["POST", "PUT", "PATCH"].includes(method);
1941
- const bodyFields = needsBody
1942
- ? extractBodyFieldsFromFile(content)
1943
- : null;
1944
- const routeParamMap = buildRouteParamMap(routePath, []);
1945
-
1946
- endpoints.push({
1947
- method,
1948
- path: routePath,
1949
- description: "",
1950
- requestBody: bodyFields,
1951
- routeParamMap,
1952
- detectedBy: "static-scan-hapi",
1953
- });
1954
- }
1955
- }
1956
- }
1957
-
1958
- walk(cwd, 0);
1959
- return endpoints;
1960
- }
1961
-
1962
- /**
1963
- * Scans AdonisJS routes from the codebase statically
1964
- * Handles:
1965
- * - Route.get('/path', handler)
1966
- * - Route.post('/path', handler)
1967
- * - router.get('/path', handler)
1968
- * - router.post('/path', handler)
1969
- */
1970
- function scanAdonisRoutes(cwd) {
1971
- const fs = require("fs");
1972
- const path = require("path");
1973
- const endpoints = [];
1974
- const seen = new Set();
1975
-
1976
- const SKIP_DIRS = [
1977
- "node_modules",
1978
- ".git",
1979
- ".next",
1980
- "dist",
1981
- "build",
1982
- ".cache",
1983
- "coverage",
1984
- "out",
1985
- ];
1986
-
1987
- function walk(dir, depth) {
1988
- if (depth > 4) return;
1989
- let entries;
1990
- try {
1991
- entries = fs.readdirSync(dir);
1992
- } catch {
1993
- return;
1994
- }
1995
-
1996
- for (const entry of entries) {
1997
- if (SKIP_DIRS.includes(entry)) continue;
1998
- const fullPath = path.join(dir, entry);
1999
- let stat;
2000
- try {
2001
- stat = fs.statSync(fullPath);
2002
- } catch {
2003
- continue;
2004
- }
2005
-
2006
- if (stat.isDirectory()) {
2007
- walk(fullPath, depth + 1);
2008
- continue;
2009
- }
2010
-
2011
- if (!/\.(js|ts)$/.test(entry)) continue;
2012
-
2013
- let content;
2014
- try {
2015
- content = fs.readFileSync(fullPath, "utf8");
2016
- } catch {
2017
- continue;
2018
- }
2019
-
2020
- const isAdonisFile =
2021
- content.includes("@adonisjs") ||
2022
- content.includes("Route.get") ||
2023
- content.includes("Route.post") ||
2024
- /(?:Route|router)\.(get|post|put|delete|patch)\s*\(/.test(content);
2025
-
2026
- if (!isAdonisFile) continue;
2027
-
2028
- const routePattern =
2029
- /(?:Route|router)\.(get|post|put|delete|patch)\s*\(\s*['"`]([^'"`]+)['"`]/gi;
2030
-
2031
- let match;
2032
- while ((match = routePattern.exec(content)) !== null) {
2033
- const method = match[1].toUpperCase();
2034
- const routePath = match[2];
2035
- if (routePath.includes("*")) continue;
2036
-
2037
- const key = method + ":" + routePath;
2038
- if (seen.has(key)) continue;
2039
- seen.add(key);
2040
-
2041
- const needsBody = ["POST", "PUT", "PATCH"].includes(method);
2042
- const bodyFields = needsBody
2043
- ? extractBodyFieldsFromFile(content)
2044
- : null;
2045
- const routeParamMap = buildRouteParamMap(routePath, []);
2046
-
2047
- endpoints.push({
2048
- method,
2049
- path: routePath,
2050
- description: "",
2051
- requestBody: bodyFields,
2052
- routeParamMap,
2053
- detectedBy: "static-scan-adonis",
2054
- });
2055
- }
2056
- }
2057
- }
2058
-
2059
- walk(cwd, 0);
2060
- return endpoints;
2061
- }
2062
-
2063
- /**
2064
- * Scans Nuxt server API routes
2065
- * Handles file-based routing in server/api/ folder
2066
- * e.g. server/api/users.get.ts → GET /api/users
2067
- * e.g. server/api/users/[id].delete.ts → DELETE /api/users/:id
2068
- */
2069
- function scanNuxtServerRoutes(cwd) {
2070
- const fs = require("fs");
2071
- const path = require("path");
2072
- const endpoints = [];
2073
- const seen = new Set();
2074
-
2075
- const possibleDirs = [
2076
- path.join(cwd, "server", "api"),
2077
- path.join(cwd, "src", "server", "api"),
2078
- ];
2079
-
2080
- function walkDir(dir, routePath) {
2081
- if (!fs.existsSync(dir)) return;
2082
- let entries;
2083
- try {
2084
- entries = fs.readdirSync(dir);
2085
- } catch {
2086
- return;
2087
- }
2088
-
2089
- entries.forEach(function (file) {
2090
- const fullPath = path.join(dir, file);
2091
- let stat;
2092
- try {
2093
- stat = fs.statSync(fullPath);
2094
- } catch {
2095
- return;
2096
- }
2097
-
2098
- if (stat.isDirectory()) {
2099
- const segment = file.replace(/\[([^\]]+)\]/g, ":$1");
2100
- walkDir(fullPath, routePath + "/" + segment);
2101
- return;
2102
- }
2103
-
2104
- if (!/\.(js|ts)$/.test(file)) return;
2105
-
2106
- // Nuxt convention: users.get.ts or users.post.ts or just users.ts
2107
- // Strip extension first
2108
- let fileName = file.replace(/\.(js|ts)$/, "");
2109
-
2110
- // Check if method is embedded in filename like users.get or [id].delete
2111
- const methodMatch = fileName.match(/\.?(get|post|put|delete|patch)$/i);
2112
- let method = null;
2113
- if (methodMatch) {
2114
- method = methodMatch[1].toUpperCase();
2115
- fileName = fileName.replace(/\.?(get|post|put|delete|patch)$/i, "");
2116
- }
2117
-
2118
- // Convert [id] to :id
2119
- fileName = fileName.replace(/\[([^\]]+)\]/g, ":$1");
2120
-
2121
- const finalPath =
2122
- fileName === "index" ? routePath : routePath + "/" + fileName;
2123
-
2124
- const methods = method ? [method] : ["GET"];
2125
-
2126
- methods.forEach(function (m) {
2127
- const key = m + ":" + finalPath;
2128
- if (seen.has(key)) return;
2129
- seen.add(key);
2130
-
2131
- const routeParamMap = buildRouteParamMap(finalPath, []);
2132
-
2133
- endpoints.push({
2134
- method: m,
2135
- path: finalPath,
2136
- description: "",
2137
- requestBody: null,
2138
- routeParamMap,
2139
- detectedBy: "static-scan-nuxt",
2140
- });
2141
- });
2142
- });
2143
- }
2144
-
2145
- for (const dir of possibleDirs) {
2146
- walkDir(dir, "/api");
2147
- }
2148
-
2149
- return endpoints;
2150
- }
2151
-
2152
- /**
2153
- * Scans SvelteKit server routes
2154
- * Handles +server.js / +server.ts files in src/routes/
2155
- * e.g. src/routes/api/users/+server.ts with export function GET() → GET /api/users
2156
- */
2157
- function scanSvelteKitServerRoutes(cwd) {
2158
- const fs = require("fs");
2159
- const path = require("path");
2160
- const endpoints = [];
2161
- const seen = new Set();
2162
-
2163
- const possibleDirs = [
2164
- path.join(cwd, "src", "routes"),
2165
- path.join(cwd, "routes"),
2166
- ];
2167
-
2168
- function walkDir(dir, routePath) {
2169
- if (!fs.existsSync(dir)) return;
2170
- let entries;
2171
- try {
2172
- entries = fs.readdirSync(dir);
2173
- } catch {
2174
- return;
2175
- }
2176
-
2177
- entries.forEach(function (file) {
2178
- const fullPath = path.join(dir, file);
2179
- let stat;
2180
- try {
2181
- stat = fs.statSync(fullPath);
2182
- } catch {
2183
- return;
2184
- }
2185
-
2186
- if (stat.isDirectory()) {
2187
- // Convert (group) folders — these are layout groups, not route segments
2188
- if (/^\(.*\)$/.test(file)) {
2189
- walkDir(fullPath, routePath);
2190
- return;
2191
- }
2192
- // Convert [param] to :param
2193
- const segment = file.replace(/\[([^\]]+)\]/g, ":$1");
2194
- walkDir(fullPath, routePath + "/" + segment);
2195
- return;
2196
- }
2197
-
2198
- // Only process +server.js or +server.ts files
2199
- if (!/^\+server\.(js|ts)$/.test(file)) return;
2200
-
2201
- let content;
2202
- try {
2203
- content = fs.readFileSync(fullPath, "utf8");
2204
- } catch {
2205
- return;
2206
- }
2207
-
2208
- // Detect exported HTTP methods
2209
- const methods = detectAppRouterMethods(content);
2210
-
2211
- methods.forEach(function (method) {
2212
- const key = method + ":" + routePath;
2213
- if (seen.has(key)) return;
2214
- seen.add(key);
2215
-
2216
- const needsBody = ["POST", "PUT", "PATCH"].includes(method);
2217
- const bodyFields = needsBody
2218
- ? extractBodyFieldsFromFile(content)
2219
- : null;
2220
- const routeParamMap = buildRouteParamMap(routePath, []);
2221
-
2222
- endpoints.push({
2223
- method,
2224
- path: routePath || "/",
2225
- description: "",
2226
- requestBody: bodyFields,
2227
- routeParamMap,
2228
- detectedBy: "static-scan-sveltekit",
2229
- });
2230
- });
2231
- });
2232
- }
2233
-
2234
- for (const dir of possibleDirs) {
2235
- walkDir(dir, "");
2236
- }
2237
-
2238
- return endpoints;
2239
- }
2240
-
2241
- /**
2242
- * Scans Remix server routes
2243
- * Handles loader (GET) and action (POST/PUT/DELETE/PATCH) exports
2244
- * in app/routes/ folder
2245
- * e.g. app/routes/projects.$id.tsx with export async function loader() → GET /projects/:id
2246
- */
2247
- function scanRemixServerRoutes(cwd) {
2248
- const fs = require("fs");
2249
- const path = require("path");
2250
- const endpoints = [];
2251
- const seen = new Set();
2252
-
2253
- const possibleDirs = [
2254
- path.join(cwd, "app", "routes"),
2255
- path.join(cwd, "routes"),
2256
- ];
2257
-
2258
- function walkDir(dir, prefix) {
2259
- if (!fs.existsSync(dir)) return;
2260
- let entries;
2261
- try {
2262
- entries = fs.readdirSync(dir);
2263
- } catch {
2264
- return;
2265
- }
2266
-
2267
- entries.forEach(function (file) {
2268
- const fullPath = path.join(dir, file);
2269
- let stat;
2270
- try {
2271
- stat = fs.statSync(fullPath);
2272
- } catch {
2273
- return;
2274
- }
2275
-
2276
- if (stat.isDirectory()) {
2277
- walkDir(fullPath, prefix + "/" + file);
2278
- return;
2279
- }
2280
-
2281
- if (!/\.(js|ts|jsx|tsx)$/.test(file)) return;
2282
-
2283
- let content;
2284
- try {
2285
- content = fs.readFileSync(fullPath, "utf8");
2286
- } catch {
2287
- return;
2288
- }
2289
-
2290
- // Only process files that have loader or action exports
2291
- const hasLoader = /export\s+(?:async\s+)?function\s+loader\b/.test(
2292
- content,
2293
- );
2294
- const hasAction = /export\s+(?:async\s+)?function\s+action\b/.test(
2295
- content,
2296
- );
2297
-
2298
- if (!hasLoader && !hasAction) return;
2299
-
2300
- // Convert Remix filename convention to route path
2301
- // projects.$id.tsx → /projects/:id
2302
- // _index.tsx → /
2303
- let fileName = file.replace(/\.(js|ts|jsx|tsx)$/, "");
2304
- if (fileName === "_index") fileName = "";
2305
-
2306
- const routePath =
2307
- (prefix + "/" + fileName)
2308
- .replace(/\.\$/g, "/:") // .$param → /:param
2309
- .replace(/\./g, "/") // remaining dots → slashes
2310
- .replace(/\/+/g, "/") // clean double slashes
2311
- .replace(/\/$/, "") || "/";
2312
-
2313
- if (hasLoader) {
2314
- const key = "GET:" + routePath;
2315
- if (!seen.has(key)) {
2316
- seen.add(key);
2317
- endpoints.push({
2318
- method: "GET",
2319
- path: routePath,
2320
- description: "",
2321
- requestBody: null,
2322
- routeParamMap: buildRouteParamMap(routePath, []),
2323
- detectedBy: "static-scan-remix",
2324
- });
2325
- }
2326
- }
2327
-
2328
- if (hasAction) {
2329
- // action handles POST/PUT/DELETE/PATCH — default to POST
2330
- // try to detect specific method from content
2331
- const actionMethods = ["POST", "PUT", "DELETE", "PATCH"].filter((m) =>
2332
- new RegExp(`request\\.method\\s*===?\\s*['"]${m}['"]`).test(content),
2333
- );
2334
-
2335
- const methodsToAdd =
2336
- actionMethods.length > 0 ? actionMethods : ["POST"];
2337
-
2338
- methodsToAdd.forEach(function (method) {
2339
- const key = method + ":" + routePath;
2340
- if (seen.has(key)) return;
2341
- seen.add(key);
2342
-
2343
- const bodyFields = extractBodyFieldsFromFile(content);
2344
- endpoints.push({
2345
- method,
2346
- path: routePath,
2347
- description: "",
2348
- requestBody: bodyFields,
2349
- routeParamMap: buildRouteParamMap(routePath, []),
2350
- detectedBy: "static-scan-remix",
2351
- });
2352
- });
2353
- }
2354
- });
2355
- }
2356
-
2357
- for (const dir of possibleDirs) {
2358
- walkDir(dir, "");
2359
- }
2360
-
2361
- return endpoints;
2362
- }
2363
-
2364
- // ─── Static response-shape guessing ───────────────────────────────────────────
2365
- // Best-effort: reads field names from reply objects written out directly in the code
2366
- // (e.g. res.json({ id, name })). Replies built from variables are left empty on purpose;
2367
- // real runtime replies fill those in later and replace any guess made here.
2368
- const MAX_STATIC_RESPONSE_FIELDS = 50;
2369
- const MAX_STATIC_LITERAL_LENGTH = 6000;
2370
-
2371
- const STATIC_REPLY_PATTERN =
2372
- /\b(?:res|resp|response|reply|NextResponse|Response)\s*(?:\.\s*(?:status|code)\s*\(\s*(\d{3})\s*\))?\s*\.\s*(?:json|send)\s*\(\s*\{|\bctx\.body\s*=\s*\{|\bh\.response\s*\(\s*\{/g;
2373
-
2374
- // Returns the index of the closing quote of the string starting at "start" (-1 if not found)
2375
- function skipStaticString(text, start, limit) {
2376
- const quote = text[start];
2377
- for (let i = start + 1; i < limit; i++) {
2378
- const ch = text[i];
2379
- if (ch === "\\") {
2380
- i++;
2381
- continue;
2382
- }
2383
- if (ch === quote) return i;
2384
- if (quote === "`" && ch === "$" && text[i + 1] === "{") {
2385
- let depth = 1;
2386
- i += 2;
2387
- for (; i < limit && depth > 0; i++) {
2388
- const c = text[i];
2389
- if (c === '"' || c === "'" || c === "`") {
2390
- i = skipStaticString(text, i, limit);
2391
- if (i === -1) return -1;
2392
- continue;
2393
- }
2394
- if (c === "{") depth++;
2395
- else if (c === "}") depth--;
2396
- }
2397
- i--;
2398
- continue;
2399
- }
2400
- if (quote !== "`" && ch === "\n") return -1;
2401
- }
2402
- return -1;
2403
- }
2404
-
2405
- // Returns the index of the "}" that closes the "{" at openIndex (null if it cannot be matched safely)
2406
- function findStaticClosingBrace(text, openIndex) {
2407
- let depth = 0;
2408
- const limit = Math.min(text.length, openIndex + MAX_STATIC_LITERAL_LENGTH);
2409
- for (let i = openIndex; i < limit; i++) {
2410
- const ch = text[i];
2411
- const next = text[i + 1];
2412
- if (ch === "/" && next === "/") {
2413
- const nl = text.indexOf("\n", i);
2414
- if (nl === -1) return null;
2415
- i = nl;
2416
- continue;
2417
- }
2418
- if (ch === "/" && next === "*") {
2419
- const end = text.indexOf("*/", i + 2);
2420
- if (end === -1) return null;
2421
- i = end + 1;
2422
- continue;
2423
- }
2424
- if (ch === '"' || ch === "'" || ch === "`") {
2425
- i = skipStaticString(text, i, limit);
2426
- if (i === -1) return null;
2427
- continue;
2428
- }
2429
- if (ch === "{" || ch === "[" || ch === "(") depth++;
2430
- else if (ch === "}" || ch === "]" || ch === ")") {
2431
- depth--;
2432
- if (depth === 0) return ch === "}" ? i : null;
2433
- if (depth < 0) return null;
2434
- }
2435
- }
2436
- return null;
2437
- }
2438
-
2439
- // Splits the inside of an object literal on top-level commas (comments removed)
2440
- function splitStaticEntries(inner) {
2441
- const entries = [];
2442
- let current = "";
2443
- let depth = 0;
2444
- for (let i = 0; i < inner.length; i++) {
2445
- const ch = inner[i];
2446
- const next = inner[i + 1];
2447
- if (ch === "/" && next === "/") {
2448
- const nl = inner.indexOf("\n", i);
2449
- if (nl === -1) break;
2450
- i = nl;
2451
- continue;
2452
- }
2453
- if (ch === "/" && next === "*") {
2454
- const end = inner.indexOf("*/", i + 2);
2455
- if (end === -1) break;
2456
- i = end + 1;
2457
- continue;
2458
- }
2459
- if (ch === '"' || ch === "'" || ch === "`") {
2460
- const end = skipStaticString(inner, i, inner.length);
2461
- if (end === -1) return null;
2462
- current += inner.slice(i, end + 1);
2463
- i = end;
2464
- continue;
2465
- }
2466
- if (ch === "{" || ch === "[" || ch === "(") depth++;
2467
- else if (ch === "}" || ch === "]" || ch === ")") depth--;
2468
- if (ch === "," && depth === 0) {
2469
- entries.push(current.trim());
2470
- current = "";
2471
- continue;
2472
- }
2473
- current += ch;
2474
- }
2475
- if (current.trim()) entries.push(current.trim());
2476
- return entries;
2477
- }
2478
-
2479
- // Reads one "key: value" or shorthand "key" entry; spreads, computed keys and methods are skipped
2480
- function parseStaticEntry(entry) {
2481
- if (!entry || entry.startsWith("...") || entry.startsWith("[")) return null;
2482
- let m = entry.match(
2483
- /^(?:"([^"]+)"|'([^']+)'|([A-Za-z_$][\w$]*))\s*:\s*([\s\S]+)$/,
2484
- );
2485
- if (m) return { key: m[1] || m[2] || m[3], value: m[4] };
2486
- m = entry.match(/^([A-Za-z_$][\w$]*)$/);
2487
- if (m) return { key: m[1], value: null };
2488
- return null;
2489
- }
2490
-
2491
- // Only literal values reveal their type; anything computed is marked "unknown" instead of guessed
2492
- function guessStaticValueType(valueExpr) {
2493
- const v = String(valueExpr || "").trim();
2494
- if (/^["'`]/.test(v)) return { type: "string" };
2495
- if (/^-?\d+(\.\d+)?$/.test(v)) return { type: "number" };
2496
- if (/^(true|false)$/.test(v)) return { type: "boolean" };
2497
- if (/^\[/.test(v)) return { type: "array", items: { type: "unknown" } };
2498
- if (/^\{/.test(v)) return { type: "object" };
2499
- return { type: "unknown" };
2500
- }
2501
-
2502
- function parseStaticObjectFields(inner) {
2503
- const entries = splitStaticEntries(inner);
2504
- if (!entries) return null;
2505
- const properties = {};
2506
- let count = 0;
2507
- for (const entry of entries) {
2508
- if (count >= MAX_STATIC_RESPONSE_FIELDS) break;
2509
- const parsed = parseStaticEntry(entry);
2510
- if (!parsed) continue;
2511
- properties[parsed.key] =
2512
- parsed.value === null
2513
- ? { type: "unknown" }
2514
- : guessStaticValueType(parsed.value);
2515
- count++;
2516
- }
2517
- const keys = Object.keys(properties);
2518
- if (keys.length === 0) return null;
2519
- if (keys.length === 1 && keys[0] === "error") return null; // looks like an error reply
2520
- // "_source" lets the server replace this guess with a real runtime reply later
2521
- return { type: "object", properties, _source: "static" };
2522
- }
2523
-
2524
- function extractResponseFieldsFromSegment(segment) {
2525
- try {
2526
- if (!segment || typeof segment !== "string") return null;
2527
- const pattern = new RegExp(STATIC_REPLY_PATTERN.source, "g");
2528
- let m;
2529
- while ((m = pattern.exec(segment)) !== null) {
2530
- const status = m[1] ? parseInt(m[1], 10) : 200;
2531
- if (status >= 400) continue;
2532
- const open = m.index + m[0].length - 1;
2533
- const close = findStaticClosingBrace(segment, open);
2534
- if (close === null) continue;
2535
- const after = segment.slice(close + 1, close + 120);
2536
- const afterStatus = after.match(/^\s*,\s*\{[^}]*\bstatus\s*:\s*(\d{3})/);
2537
- if (afterStatus && parseInt(afterStatus[1], 10) >= 400) continue;
2538
- // a status that is not a plain number (variable/expression) cannot be known to be a success
2539
- if (!afterStatus && /^\s*,\s*\{[^}]*\bstatus\b/.test(after)) continue;
2540
- const fields = parseStaticObjectFields(segment.slice(open + 1, close));
2541
- if (fields) return fields;
2542
- }
2543
- } catch (e) {}
2544
- return null;
2545
- }
2546
-
2547
- // Marker that starts one method's code inside a file
2548
- function staticMethodMarker(style, method) {
2549
- if (style === "app") {
2550
- return new RegExp(
2551
- "export\\s+(?:async\\s+)?function\\s+" +
2552
- method +
2553
- "\\b|export\\s+(?:const|let)\\s+" +
2554
- method +
2555
- "\\s*=",
2556
- );
2557
- }
2558
- // handles any variable that holds the request method, not just req.method
2559
- return new RegExp(
2560
- "(?:" +
2561
- METHOD_REF +
2562
- "\\s*===?\\s*['\"]" +
2563
- method +
2564
- "['\"]|case\\s*['\"]" +
2565
- method +
2566
- "['\"])",
2567
- "i",
2568
- );
2569
- }
2570
-
2571
- // Finds where one HTTP method's code starts in a file (-1 if it cannot be told apart).
2572
- // Reads the same method checks that detectMethodsFromFile reads, including the early-exit
2573
- // guard "if (req.method !== 'X') return ..." (code after that guard belongs to X).
2574
- function findStaticMethodMarkerIndex(content, style, method) {
2575
- const direct = staticMethodMarker(style, method).exec(content);
2576
- if (direct) return direct.index;
2577
- if (style === "app") return -1;
2578
-
2579
- // handles any variable that holds the request method, not just req.method
2580
- const guardRe = new RegExp(
2581
- METHOD_REF + "\\s*!==?\\s*['\"]" + method + "['\"]",
2582
- "gi",
2583
- );
2584
- let hit;
2585
- while ((hit = guardRe.exec(content)) !== null) {
2586
- // A guard listing several allowed methods is not specific to one method, so skip it
2587
- const before = content.slice(Math.max(0, hit.index - 60), hit.index);
2588
- const afterStart = hit.index + hit[0].length;
2589
- const after = content.slice(afterStart, afterStart + 60);
2590
- const listsOtherMethods =
2591
- /[\w$.?]*method[\w$]*\s*!==?\s*['"][A-Za-z]+['"]\s*&&\s*$/i.test(
2592
- before,
2593
- ) ||
2594
- /^\s*&&\s*[\w$.?]*method[\w$]*\s*!==?\s*['"][A-Za-z]+['"]/i.test(after);
2595
- if (!listsOtherMethods) return hit.index;
2596
- }
2597
- return -1;
2598
- }
2599
-
2600
- // For "export const GET = wrapper(handlerName)", returns the code of handlerName when it is
2601
- // declared at the top level of the same file (null when it cannot be found, e.g. imported from elsewhere).
2602
- function findStaticHandlerCode(content, markerIndex) {
2603
- const ref =
2604
- /^export\s+(?:const|let|var)\s+[A-Za-z_$][\w$]*\s*(?::[^=]+)?=\s*(?:[A-Za-z_$][\w$.]*\s*\(\s*)*([A-Za-z_$][\w$]*)\s*(?:[,);]|\n|$)/.exec(
2605
- content.slice(markerIndex, markerIndex + 300),
2606
- );
2607
- if (!ref) return null;
2608
- const name = ref[1];
2609
- if (name === "async" || name === "function" || name === "await") return null;
2610
- const safe = name.replace(/[$]/g, "\\$&");
2611
- const declRe = new RegExp(
2612
- "(?:^|\\n)(?:export\\s+)?(?:async\\s+)?function\\s+" +
2613
- safe +
2614
- "\\s*[(<]|(?:^|\\n)(?:export\\s+)?(?:const|let|var)\\s+" +
2615
- safe +
2616
- "\\b[^=\\n]*=",
2617
- );
2618
- const decl = declRe.exec(content);
2619
- if (!decl) return null;
2620
- const bodyStart = decl.index + decl[0].length;
2621
- // the handler's code runs until the next top-level statement
2622
- const next =
2623
- /\n(?:export\s|async\s+function\s|function\s|const\s|let\s|var\s|class\s|interface\s|type\s)/.exec(
2624
- content.slice(bodyStart),
2625
- );
2626
- const end = next ? bodyStart + next.index : content.length;
2627
- return content.slice(decl.index, end);
2628
- }
2629
-
2630
- // For files that handle several HTTP methods: returns only the code that belongs to one method,
2631
- // or null when it cannot be told apart safely (so no guess is made)
2632
- function extractResponseFieldsForMethod(content, method, allMethods, style) {
2633
- try {
2634
- let segment = content;
2635
- if (allMethods && allMethods.length > 1) {
2636
- const markers = [];
2637
- allMethods.forEach(function (m) {
2638
- // Uses the same method checks as method detection, so the file is split consistently
2639
- const index = findStaticMethodMarkerIndex(content, style, m);
2640
- if (index !== -1) markers.push({ method: m, index: index });
2641
- });
2642
- const own = markers.find(function (x) {
2643
- return x.method === method;
2644
- });
2645
- if (!own) return null;
2646
- // handler declared elsewhere in the same file and exported through a wrapper
2647
- if (style === "app") {
2648
- const handlerCode = findStaticHandlerCode(content, own.index);
2649
- if (handlerCode) return extractResponseFieldsFromSegment(handlerCode);
2650
- }
2651
- markers.sort(function (a, b) {
2652
- return a.index - b.index;
2653
- });
2654
- const pos = markers.indexOf(own);
2655
- const end =
2656
- pos + 1 < markers.length ? markers[pos + 1].index : content.length;
2657
- segment = content.slice(own.index, end);
2658
- }
2659
- return extractResponseFieldsFromSegment(segment);
2660
- } catch (e) {
2661
- return null;
2662
- }
2663
- }
2664
-
2665
- // For route definitions in one file (app.get(...), router.post(...)): the code from this route
2666
- // definition up to the next one
2667
- function extractResponseFieldsForRoute(
2668
- content,
2669
- startIndex,
2670
- routePatternSource,
2671
- ) {
2672
- try {
2673
- const re = new RegExp(routePatternSource, "gi");
2674
- let end = content.length;
2675
- let hit;
2676
- while ((hit = re.exec(content)) !== null) {
2677
- if (hit.index > startIndex) {
2678
- end = hit.index;
2679
- break;
2680
- }
2681
- }
2682
- return extractResponseFieldsFromSegment(content.slice(startIndex, end));
2683
- } catch (e) {
2684
- return null;
2685
- }
2686
- }
2687
-
2688
- // For live Express route handlers: reads the handler source, last handler first
2689
- function extractResponseFieldsFromHandlers(stack, method) {
2690
- try {
2691
- for (let i = stack.length - 1; i >= 0; i--) {
2692
- const layer = stack[i];
2693
- if (layer.method && String(layer.method).toUpperCase() !== method)
2694
- continue;
2695
- const fn = layer.handle || layer;
2696
- if (typeof fn !== "function") continue;
2697
- const src = Function.prototype.toString.call(fn);
2698
- const fields = extractResponseFieldsFromSegment(src);
2699
- if (fields) return fields;
2700
- }
2701
- } catch (e) {}
2702
- return null;
2703
- }
2704
-
2705
- module.exports = {
2706
- scanExpressRoutes,
2707
- scanNextJsRoutes,
2708
- scanNextJsAppRoutes,
2709
- extractPathParams,
2710
- scanFrontendRoutes,
2711
- scanFastifyRoutes,
2712
- scanNestJsRoutes,
2713
- scanKoaRoutes,
2714
- scanHapiRoutes,
2715
- scanAdonisRoutes,
2716
- scanNuxtServerRoutes,
2717
- scanSvelteKitServerRoutes,
2718
- scanRemixServerRoutes,
2719
- };