@redocly/respect-core 0.0.0-snapshot.1739898268

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 (423) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +25 -0
  3. package/lib/arazzo-schema.d.ts +2385 -0
  4. package/lib/arazzo-schema.d.ts.map +1 -0
  5. package/lib/arazzo-schema.js +372 -0
  6. package/lib/arazzo-schema.js.map +1 -0
  7. package/lib/handlers/generate.d.ts +3 -0
  8. package/lib/handlers/generate.d.ts.map +1 -0
  9. package/lib/handlers/generate.js +18 -0
  10. package/lib/handlers/generate.js.map +1 -0
  11. package/lib/handlers/index.d.ts +3 -0
  12. package/lib/handlers/index.d.ts.map +1 -0
  13. package/lib/handlers/index.js +19 -0
  14. package/lib/handlers/index.js.map +1 -0
  15. package/lib/handlers/run.d.ts +2 -0
  16. package/lib/handlers/run.d.ts.map +1 -0
  17. package/lib/handlers/run.js +67 -0
  18. package/lib/handlers/run.js.map +1 -0
  19. package/lib/index.d.ts +2 -0
  20. package/lib/index.d.ts.map +1 -0
  21. package/lib/index.js +7 -0
  22. package/lib/index.js.map +1 -0
  23. package/lib/modules/checks/checks.d.ts +9 -0
  24. package/lib/modules/checks/checks.d.ts.map +1 -0
  25. package/lib/modules/checks/checks.js +12 -0
  26. package/lib/modules/checks/checks.js.map +1 -0
  27. package/lib/modules/checks/index.d.ts +3 -0
  28. package/lib/modules/checks/index.d.ts.map +1 -0
  29. package/lib/modules/checks/index.js +19 -0
  30. package/lib/modules/checks/index.js.map +1 -0
  31. package/lib/modules/checks/severity.d.ts +9 -0
  32. package/lib/modules/checks/severity.d.ts.map +1 -0
  33. package/lib/modules/checks/severity.js +29 -0
  34. package/lib/modules/checks/severity.js.map +1 -0
  35. package/lib/modules/cli-output/calculate-tests-passed.d.ts +3 -0
  36. package/lib/modules/cli-output/calculate-tests-passed.d.ts.map +1 -0
  37. package/lib/modules/cli-output/calculate-tests-passed.js +67 -0
  38. package/lib/modules/cli-output/calculate-tests-passed.js.map +1 -0
  39. package/lib/modules/cli-output/display-checks.d.ts +3 -0
  40. package/lib/modules/cli-output/display-checks.d.ts.map +1 -0
  41. package/lib/modules/cli-output/display-checks.js +86 -0
  42. package/lib/modules/cli-output/display-checks.js.map +1 -0
  43. package/lib/modules/cli-output/display-errors.d.ts +3 -0
  44. package/lib/modules/cli-output/display-errors.d.ts.map +1 -0
  45. package/lib/modules/cli-output/display-errors.js +45 -0
  46. package/lib/modules/cli-output/display-errors.js.map +1 -0
  47. package/lib/modules/cli-output/display-files-summary-table.d.ts +11 -0
  48. package/lib/modules/cli-output/display-files-summary-table.d.ts.map +1 -0
  49. package/lib/modules/cli-output/display-files-summary-table.js +100 -0
  50. package/lib/modules/cli-output/display-files-summary-table.js.map +1 -0
  51. package/lib/modules/cli-output/display-summary.d.ts +7 -0
  52. package/lib/modules/cli-output/display-summary.d.ts.map +1 -0
  53. package/lib/modules/cli-output/display-summary.js +75 -0
  54. package/lib/modules/cli-output/display-summary.js.map +1 -0
  55. package/lib/modules/cli-output/index.d.ts +9 -0
  56. package/lib/modules/cli-output/index.d.ts.map +1 -0
  57. package/lib/modules/cli-output/index.js +25 -0
  58. package/lib/modules/cli-output/index.js.map +1 -0
  59. package/lib/modules/cli-output/json-logs.d.ts +3 -0
  60. package/lib/modules/cli-output/json-logs.d.ts.map +1 -0
  61. package/lib/modules/cli-output/json-logs.js +27 -0
  62. package/lib/modules/cli-output/json-logs.js.map +1 -0
  63. package/lib/modules/cli-output/mask-secrets.d.ts +5 -0
  64. package/lib/modules/cli-output/mask-secrets.d.ts.map +1 -0
  65. package/lib/modules/cli-output/mask-secrets.js +34 -0
  66. package/lib/modules/cli-output/mask-secrets.js.map +1 -0
  67. package/lib/modules/cli-output/verbose-logs.d.ts +3 -0
  68. package/lib/modules/cli-output/verbose-logs.d.ts.map +1 -0
  69. package/lib/modules/cli-output/verbose-logs.js +24 -0
  70. package/lib/modules/cli-output/verbose-logs.js.map +1 -0
  71. package/lib/modules/config-parser/get-value-from-context.d.ts +12 -0
  72. package/lib/modules/config-parser/get-value-from-context.d.ts.map +1 -0
  73. package/lib/modules/config-parser/get-value-from-context.js +183 -0
  74. package/lib/modules/config-parser/get-value-from-context.js.map +1 -0
  75. package/lib/modules/config-parser/handle-request-body-replacements.d.ts +3 -0
  76. package/lib/modules/config-parser/handle-request-body-replacements.d.ts.map +1 -0
  77. package/lib/modules/config-parser/handle-request-body-replacements.js +24 -0
  78. package/lib/modules/config-parser/handle-request-body-replacements.js.map +1 -0
  79. package/lib/modules/config-parser/index.d.ts +8 -0
  80. package/lib/modules/config-parser/index.d.ts.map +1 -0
  81. package/lib/modules/config-parser/index.js +24 -0
  82. package/lib/modules/config-parser/index.js.map +1 -0
  83. package/lib/modules/config-parser/map-header-params-and-cookie-to-object.d.ts +6 -0
  84. package/lib/modules/config-parser/map-header-params-and-cookie-to-object.d.ts.map +1 -0
  85. package/lib/modules/config-parser/map-header-params-and-cookie-to-object.js +22 -0
  86. package/lib/modules/config-parser/map-header-params-and-cookie-to-object.js.map +1 -0
  87. package/lib/modules/config-parser/parse-parameters.d.ts +10 -0
  88. package/lib/modules/config-parser/parse-parameters.d.ts.map +1 -0
  89. package/lib/modules/config-parser/parse-parameters.js +48 -0
  90. package/lib/modules/config-parser/parse-parameters.js.map +1 -0
  91. package/lib/modules/config-parser/parse-request-body.d.ts +8 -0
  92. package/lib/modules/config-parser/parse-request-body.d.ts.map +1 -0
  93. package/lib/modules/config-parser/parse-request-body.js +149 -0
  94. package/lib/modules/config-parser/parse-request-body.js.map +1 -0
  95. package/lib/modules/config-parser/resolve-reusable-component.d.ts +3 -0
  96. package/lib/modules/config-parser/resolve-reusable-component.d.ts.map +1 -0
  97. package/lib/modules/config-parser/resolve-reusable-component.js +8 -0
  98. package/lib/modules/config-parser/resolve-reusable-component.js.map +1 -0
  99. package/lib/modules/config-parser/resolve-reusable-object-reference.d.ts +5 -0
  100. package/lib/modules/config-parser/resolve-reusable-object-reference.d.ts.map +1 -0
  101. package/lib/modules/config-parser/resolve-reusable-object-reference.js +20 -0
  102. package/lib/modules/config-parser/resolve-reusable-object-reference.js.map +1 -0
  103. package/lib/modules/description-parser/bundle-openapi.d.ts +2 -0
  104. package/lib/modules/description-parser/bundle-openapi.d.ts.map +1 -0
  105. package/lib/modules/description-parser/bundle-openapi.js +41 -0
  106. package/lib/modules/description-parser/bundle-openapi.js.map +1 -0
  107. package/lib/modules/description-parser/extract-first-example.d.ts +2 -0
  108. package/lib/modules/description-parser/extract-first-example.d.ts.map +1 -0
  109. package/lib/modules/description-parser/extract-first-example.js +10 -0
  110. package/lib/modules/description-parser/extract-first-example.js.map +1 -0
  111. package/lib/modules/description-parser/get-operation-by-id.d.ts +3 -0
  112. package/lib/modules/description-parser/get-operation-by-id.d.ts.map +1 -0
  113. package/lib/modules/description-parser/get-operation-by-id.js +56 -0
  114. package/lib/modules/description-parser/get-operation-by-id.js.map +1 -0
  115. package/lib/modules/description-parser/get-operation-by-path.d.ts +7 -0
  116. package/lib/modules/description-parser/get-operation-by-path.d.ts.map +1 -0
  117. package/lib/modules/description-parser/get-operation-by-path.js +44 -0
  118. package/lib/modules/description-parser/get-operation-by-path.js.map +1 -0
  119. package/lib/modules/description-parser/get-operation-from-description.d.ts +18 -0
  120. package/lib/modules/description-parser/get-operation-from-description.d.ts.map +1 -0
  121. package/lib/modules/description-parser/get-operation-from-description.js +26 -0
  122. package/lib/modules/description-parser/get-operation-from-description.js.map +1 -0
  123. package/lib/modules/description-parser/get-request-body-schema.d.ts +3 -0
  124. package/lib/modules/description-parser/get-request-body-schema.d.ts.map +1 -0
  125. package/lib/modules/description-parser/get-request-body-schema.js +12 -0
  126. package/lib/modules/description-parser/get-request-body-schema.js.map +1 -0
  127. package/lib/modules/description-parser/get-request-data-from-openapi.d.ts +9 -0
  128. package/lib/modules/description-parser/get-request-data-from-openapi.d.ts.map +1 -0
  129. package/lib/modules/description-parser/get-request-data-from-openapi.js +63 -0
  130. package/lib/modules/description-parser/get-request-data-from-openapi.js.map +1 -0
  131. package/lib/modules/description-parser/get-response-schema.d.ts +6 -0
  132. package/lib/modules/description-parser/get-response-schema.d.ts.map +1 -0
  133. package/lib/modules/description-parser/get-response-schema.js +10 -0
  134. package/lib/modules/description-parser/get-response-schema.js.map +1 -0
  135. package/lib/modules/description-parser/index.d.ts +10 -0
  136. package/lib/modules/description-parser/index.d.ts.map +1 -0
  137. package/lib/modules/description-parser/index.js +26 -0
  138. package/lib/modules/description-parser/index.js.map +1 -0
  139. package/lib/modules/description-parser/remove-write-only-properties.d.ts +3 -0
  140. package/lib/modules/description-parser/remove-write-only-properties.d.ts.map +1 -0
  141. package/lib/modules/description-parser/remove-write-only-properties.js +41 -0
  142. package/lib/modules/description-parser/remove-write-only-properties.js.map +1 -0
  143. package/lib/modules/faker.d.ts +42 -0
  144. package/lib/modules/faker.d.ts.map +1 -0
  145. package/lib/modules/faker.js +36 -0
  146. package/lib/modules/faker.js.map +1 -0
  147. package/lib/modules/flow-runner/call-api-and-analyze-results.d.ts +30 -0
  148. package/lib/modules/flow-runner/call-api-and-analyze-results.d.ts.map +1 -0
  149. package/lib/modules/flow-runner/call-api-and-analyze-results.js +100 -0
  150. package/lib/modules/flow-runner/call-api-and-analyze-results.js.map +1 -0
  151. package/lib/modules/flow-runner/context/create-runtime-expression-ctx.d.ts +7 -0
  152. package/lib/modules/flow-runner/context/create-runtime-expression-ctx.d.ts.map +1 -0
  153. package/lib/modules/flow-runner/context/create-runtime-expression-ctx.js +56 -0
  154. package/lib/modules/flow-runner/context/create-runtime-expression-ctx.js.map +1 -0
  155. package/lib/modules/flow-runner/context/create-test-context.d.ts +5 -0
  156. package/lib/modules/flow-runner/context/create-test-context.d.ts.map +1 -0
  157. package/lib/modules/flow-runner/context/create-test-context.js +88 -0
  158. package/lib/modules/flow-runner/context/create-test-context.js.map +1 -0
  159. package/lib/modules/flow-runner/context/index.d.ts +5 -0
  160. package/lib/modules/flow-runner/context/index.d.ts.map +1 -0
  161. package/lib/modules/flow-runner/context/index.js +21 -0
  162. package/lib/modules/flow-runner/context/index.js.map +1 -0
  163. package/lib/modules/flow-runner/context/set-public-steps.d.ts +3 -0
  164. package/lib/modules/flow-runner/context/set-public-steps.d.ts.map +1 -0
  165. package/lib/modules/flow-runner/context/set-public-steps.js +11 -0
  166. package/lib/modules/flow-runner/context/set-public-steps.js.map +1 -0
  167. package/lib/modules/flow-runner/context/set-public-workflows.d.ts +7 -0
  168. package/lib/modules/flow-runner/context/set-public-workflows.d.ts.map +1 -0
  169. package/lib/modules/flow-runner/context/set-public-workflows.js +29 -0
  170. package/lib/modules/flow-runner/context/set-public-workflows.js.map +1 -0
  171. package/lib/modules/flow-runner/error-message-matcher.d.ts +4 -0
  172. package/lib/modules/flow-runner/error-message-matcher.d.ts.map +1 -0
  173. package/lib/modules/flow-runner/error-message-matcher.js +11 -0
  174. package/lib/modules/flow-runner/error-message-matcher.js.map +1 -0
  175. package/lib/modules/flow-runner/get-server-url.d.ts +12 -0
  176. package/lib/modules/flow-runner/get-server-url.d.ts.map +1 -0
  177. package/lib/modules/flow-runner/get-server-url.js +67 -0
  178. package/lib/modules/flow-runner/get-server-url.js.map +1 -0
  179. package/lib/modules/flow-runner/get-test-description-from-file.d.ts +20 -0
  180. package/lib/modules/flow-runner/get-test-description-from-file.d.ts.map +1 -0
  181. package/lib/modules/flow-runner/get-test-description-from-file.js +75 -0
  182. package/lib/modules/flow-runner/get-test-description-from-file.js.map +1 -0
  183. package/lib/modules/flow-runner/get-workflows-to-run.d.ts +3 -0
  184. package/lib/modules/flow-runner/get-workflows-to-run.d.ts.map +1 -0
  185. package/lib/modules/flow-runner/get-workflows-to-run.js +50 -0
  186. package/lib/modules/flow-runner/get-workflows-to-run.js.map +1 -0
  187. package/lib/modules/flow-runner/index.d.ts +16 -0
  188. package/lib/modules/flow-runner/index.d.ts.map +1 -0
  189. package/lib/modules/flow-runner/index.js +32 -0
  190. package/lib/modules/flow-runner/index.js.map +1 -0
  191. package/lib/modules/flow-runner/inputs/format-cli-inputs.d.ts +2 -0
  192. package/lib/modules/flow-runner/inputs/format-cli-inputs.d.ts.map +1 -0
  193. package/lib/modules/flow-runner/inputs/format-cli-inputs.js +45 -0
  194. package/lib/modules/flow-runner/inputs/format-cli-inputs.js.map +1 -0
  195. package/lib/modules/flow-runner/inputs/index.d.ts +3 -0
  196. package/lib/modules/flow-runner/inputs/index.d.ts.map +1 -0
  197. package/lib/modules/flow-runner/inputs/index.js +19 -0
  198. package/lib/modules/flow-runner/inputs/index.js.map +1 -0
  199. package/lib/modules/flow-runner/inputs/map-input-values-to-schema.d.ts +7 -0
  200. package/lib/modules/flow-runner/inputs/map-input-values-to-schema.d.ts.map +1 -0
  201. package/lib/modules/flow-runner/inputs/map-input-values-to-schema.js +29 -0
  202. package/lib/modules/flow-runner/inputs/map-input-values-to-schema.js.map +1 -0
  203. package/lib/modules/flow-runner/outputs/index.d.ts +2 -0
  204. package/lib/modules/flow-runner/outputs/index.d.ts.map +1 -0
  205. package/lib/modules/flow-runner/outputs/index.js +18 -0
  206. package/lib/modules/flow-runner/outputs/index.js.map +1 -0
  207. package/lib/modules/flow-runner/outputs/print-message.d.ts +7 -0
  208. package/lib/modules/flow-runner/outputs/print-message.d.ts.map +1 -0
  209. package/lib/modules/flow-runner/outputs/print-message.js +17 -0
  210. package/lib/modules/flow-runner/outputs/print-message.js.map +1 -0
  211. package/lib/modules/flow-runner/prepare-request.d.ts +15 -0
  212. package/lib/modules/flow-runner/prepare-request.d.ts.map +1 -0
  213. package/lib/modules/flow-runner/prepare-request.js +166 -0
  214. package/lib/modules/flow-runner/prepare-request.js.map +1 -0
  215. package/lib/modules/flow-runner/read-env-variables.d.ts +2 -0
  216. package/lib/modules/flow-runner/read-env-variables.d.ts.map +1 -0
  217. package/lib/modules/flow-runner/read-env-variables.js +44 -0
  218. package/lib/modules/flow-runner/read-env-variables.js.map +1 -0
  219. package/lib/modules/flow-runner/resolve-running-workflows.d.ts +2 -0
  220. package/lib/modules/flow-runner/resolve-running-workflows.d.ts.map +1 -0
  221. package/lib/modules/flow-runner/resolve-running-workflows.js +25 -0
  222. package/lib/modules/flow-runner/resolve-running-workflows.js.map +1 -0
  223. package/lib/modules/flow-runner/run-step.d.ts +12 -0
  224. package/lib/modules/flow-runner/run-step.d.ts.map +1 -0
  225. package/lib/modules/flow-runner/run-step.js +250 -0
  226. package/lib/modules/flow-runner/run-step.js.map +1 -0
  227. package/lib/modules/flow-runner/runner.d.ts +11 -0
  228. package/lib/modules/flow-runner/runner.d.ts.map +1 -0
  229. package/lib/modules/flow-runner/runner.js +225 -0
  230. package/lib/modules/flow-runner/runner.js.map +1 -0
  231. package/lib/modules/flow-runner/schema/index.d.ts +2 -0
  232. package/lib/modules/flow-runner/schema/index.d.ts.map +1 -0
  233. package/lib/modules/flow-runner/schema/index.js +18 -0
  234. package/lib/modules/flow-runner/schema/index.js.map +1 -0
  235. package/lib/modules/flow-runner/schema/schema-checker.d.ts +7 -0
  236. package/lib/modules/flow-runner/schema/schema-checker.d.ts.map +1 -0
  237. package/lib/modules/flow-runner/schema/schema-checker.js +124 -0
  238. package/lib/modules/flow-runner/schema/schema-checker.js.map +1 -0
  239. package/lib/modules/flow-runner/success-criteria/check-success-criteria.d.ts +8 -0
  240. package/lib/modules/flow-runner/success-criteria/check-success-criteria.d.ts.map +1 -0
  241. package/lib/modules/flow-runner/success-criteria/check-success-criteria.js +97 -0
  242. package/lib/modules/flow-runner/success-criteria/check-success-criteria.js.map +1 -0
  243. package/lib/modules/flow-runner/success-criteria/index.d.ts +3 -0
  244. package/lib/modules/flow-runner/success-criteria/index.d.ts.map +1 -0
  245. package/lib/modules/flow-runner/success-criteria/index.js +19 -0
  246. package/lib/modules/flow-runner/success-criteria/index.js.map +1 -0
  247. package/lib/modules/flow-runner/success-criteria/validate-success-criteria.d.ts +6 -0
  248. package/lib/modules/flow-runner/success-criteria/validate-success-criteria.d.ts.map +1 -0
  249. package/lib/modules/flow-runner/success-criteria/validate-success-criteria.js +63 -0
  250. package/lib/modules/flow-runner/success-criteria/validate-success-criteria.js.map +1 -0
  251. package/lib/modules/runtime-expressions/abnf-parser.d.ts +15 -0
  252. package/lib/modules/runtime-expressions/abnf-parser.d.ts.map +1 -0
  253. package/lib/modules/runtime-expressions/abnf-parser.js +2012 -0
  254. package/lib/modules/runtime-expressions/abnf-parser.js.map +1 -0
  255. package/lib/modules/runtime-expressions/evaluate.d.ts +9 -0
  256. package/lib/modules/runtime-expressions/evaluate.d.ts.map +1 -0
  257. package/lib/modules/runtime-expressions/evaluate.js +169 -0
  258. package/lib/modules/runtime-expressions/evaluate.js.map +1 -0
  259. package/lib/modules/runtime-expressions/index.d.ts +2 -0
  260. package/lib/modules/runtime-expressions/index.d.ts.map +1 -0
  261. package/lib/modules/runtime-expressions/index.js +18 -0
  262. package/lib/modules/runtime-expressions/index.js.map +1 -0
  263. package/lib/modules/runtime-expressions/lint.d.ts +2 -0
  264. package/lib/modules/runtime-expressions/lint.d.ts.map +1 -0
  265. package/lib/modules/runtime-expressions/lint.js +13 -0
  266. package/lib/modules/runtime-expressions/lint.js.map +1 -0
  267. package/lib/modules/runtime-expressions/replace-json-pointers.d.ts +2 -0
  268. package/lib/modules/runtime-expressions/replace-json-pointers.d.ts.map +1 -0
  269. package/lib/modules/runtime-expressions/replace-json-pointers.js +62 -0
  270. package/lib/modules/runtime-expressions/replace-json-pointers.js.map +1 -0
  271. package/lib/modules/test-config-generator/cleanup-test-description.d.ts +16 -0
  272. package/lib/modules/test-config-generator/cleanup-test-description.d.ts.map +1 -0
  273. package/lib/modules/test-config-generator/cleanup-test-description.js +28 -0
  274. package/lib/modules/test-config-generator/cleanup-test-description.js.map +1 -0
  275. package/lib/modules/test-config-generator/generate-example-value.d.ts +3 -0
  276. package/lib/modules/test-config-generator/generate-example-value.d.ts.map +1 -0
  277. package/lib/modules/test-config-generator/generate-example-value.js +17 -0
  278. package/lib/modules/test-config-generator/generate-example-value.js.map +1 -0
  279. package/lib/modules/test-config-generator/generate-test-config.d.ts +7 -0
  280. package/lib/modules/test-config-generator/generate-test-config.d.ts.map +1 -0
  281. package/lib/modules/test-config-generator/generate-test-config.js +117 -0
  282. package/lib/modules/test-config-generator/generate-test-config.js.map +1 -0
  283. package/lib/modules/test-config-generator/generate-test-data-from-json-schema.d.ts +2 -0
  284. package/lib/modules/test-config-generator/generate-test-data-from-json-schema.d.ts.map +1 -0
  285. package/lib/modules/test-config-generator/generate-test-data-from-json-schema.js +42 -0
  286. package/lib/modules/test-config-generator/generate-test-data-from-json-schema.js.map +1 -0
  287. package/lib/modules/test-config-generator/index.d.ts +5 -0
  288. package/lib/modules/test-config-generator/index.d.ts.map +1 -0
  289. package/lib/modules/test-config-generator/index.js +21 -0
  290. package/lib/modules/test-config-generator/index.js.map +1 -0
  291. package/lib/types.d.ts +241 -0
  292. package/lib/types.d.ts.map +1 -0
  293. package/lib/types.js +3 -0
  294. package/lib/types.js.map +1 -0
  295. package/lib/utils/ajv-errors.d.ts +3 -0
  296. package/lib/utils/ajv-errors.d.ts.map +1 -0
  297. package/lib/utils/ajv-errors.js +28 -0
  298. package/lib/utils/ajv-errors.js.map +1 -0
  299. package/lib/utils/api-fetcher.d.ts +27 -0
  300. package/lib/utils/api-fetcher.d.ts.map +1 -0
  301. package/lib/utils/api-fetcher.js +243 -0
  302. package/lib/utils/api-fetcher.js.map +1 -0
  303. package/lib/utils/check-circular-refs-in-schema.d.ts +2 -0
  304. package/lib/utils/check-circular-refs-in-schema.d.ts.map +1 -0
  305. package/lib/utils/check-circular-refs-in-schema.js +13 -0
  306. package/lib/utils/check-circular-refs-in-schema.js.map +1 -0
  307. package/lib/utils/clean-colors.d.ts +2 -0
  308. package/lib/utils/clean-colors.d.ts.map +1 -0
  309. package/lib/utils/clean-colors.js +8 -0
  310. package/lib/utils/clean-colors.js.map +1 -0
  311. package/lib/utils/cli-outputs.d.ts +18 -0
  312. package/lib/utils/cli-outputs.d.ts.map +1 -0
  313. package/lib/utils/cli-outputs.js +70 -0
  314. package/lib/utils/cli-outputs.js.map +1 -0
  315. package/lib/utils/delay.d.ts +2 -0
  316. package/lib/utils/delay.d.ts.map +1 -0
  317. package/lib/utils/delay.js +8 -0
  318. package/lib/utils/delay.js.map +1 -0
  319. package/lib/utils/env.d.ts +3 -0
  320. package/lib/utils/env.d.ts.map +1 -0
  321. package/lib/utils/env.js +13 -0
  322. package/lib/utils/env.js.map +1 -0
  323. package/lib/utils/file.d.ts +2 -0
  324. package/lib/utils/file.d.ts.map +1 -0
  325. package/lib/utils/file.js +7 -0
  326. package/lib/utils/file.js.map +1 -0
  327. package/lib/utils/get-nested-value.d.ts +2 -0
  328. package/lib/utils/get-nested-value.d.ts.map +1 -0
  329. package/lib/utils/get-nested-value.js +16 -0
  330. package/lib/utils/get-nested-value.js.map +1 -0
  331. package/lib/utils/get-reunite-url.d.ts +2 -0
  332. package/lib/utils/get-reunite-url.d.ts.map +1 -0
  333. package/lib/utils/get-reunite-url.js +18 -0
  334. package/lib/utils/get-reunite-url.js.map +1 -0
  335. package/lib/utils/har-logs/create-har-log.d.ts +2 -0
  336. package/lib/utils/har-logs/create-har-log.d.ts.map +1 -0
  337. package/lib/utils/har-logs/create-har-log.js +28 -0
  338. package/lib/utils/har-logs/create-har-log.js.map +1 -0
  339. package/lib/utils/har-logs/helpers/add-headers.d.ts +2 -0
  340. package/lib/utils/har-logs/helpers/add-headers.d.ts.map +1 -0
  341. package/lib/utils/har-logs/helpers/add-headers.js +20 -0
  342. package/lib/utils/har-logs/helpers/add-headers.js.map +1 -0
  343. package/lib/utils/har-logs/helpers/build-headers.d.ts +10 -0
  344. package/lib/utils/har-logs/helpers/build-headers.d.ts.map +1 -0
  345. package/lib/utils/har-logs/helpers/build-headers.js +35 -0
  346. package/lib/utils/har-logs/helpers/build-headers.js.map +1 -0
  347. package/lib/utils/har-logs/helpers/build-params.d.ts +2 -0
  348. package/lib/utils/har-logs/helpers/build-params.d.ts.map +1 -0
  349. package/lib/utils/har-logs/helpers/build-params.js +44 -0
  350. package/lib/utils/har-logs/helpers/build-params.js.map +1 -0
  351. package/lib/utils/har-logs/helpers/build-request-cookies.d.ts +2 -0
  352. package/lib/utils/har-logs/helpers/build-request-cookies.d.ts.map +1 -0
  353. package/lib/utils/har-logs/helpers/build-request-cookies.js +44 -0
  354. package/lib/utils/har-logs/helpers/build-request-cookies.js.map +1 -0
  355. package/lib/utils/har-logs/helpers/build-response-cookies.d.ts +2 -0
  356. package/lib/utils/har-logs/helpers/build-response-cookies.d.ts.map +1 -0
  357. package/lib/utils/har-logs/helpers/build-response-cookies.js +66 -0
  358. package/lib/utils/har-logs/helpers/build-response-cookies.js.map +1 -0
  359. package/lib/utils/har-logs/helpers/get-agent.d.ts +2 -0
  360. package/lib/utils/har-logs/helpers/get-agent.d.ts.map +1 -0
  361. package/lib/utils/har-logs/helpers/get-agent.js +115 -0
  362. package/lib/utils/har-logs/helpers/get-agent.js.map +1 -0
  363. package/lib/utils/har-logs/helpers/get-duration.d.ts +2 -0
  364. package/lib/utils/har-logs/helpers/get-duration.d.ts.map +1 -0
  365. package/lib/utils/har-logs/helpers/get-duration.js +9 -0
  366. package/lib/utils/har-logs/helpers/get-duration.js.map +1 -0
  367. package/lib/utils/har-logs/helpers/get-input-url.d.ts +2 -0
  368. package/lib/utils/har-logs/helpers/get-input-url.d.ts.map +1 -0
  369. package/lib/utils/har-logs/helpers/get-input-url.js +8 -0
  370. package/lib/utils/har-logs/helpers/get-input-url.js.map +1 -0
  371. package/lib/utils/har-logs/helpers/handle-request.d.ts +9 -0
  372. package/lib/utils/har-logs/helpers/handle-request.d.ts.map +1 -0
  373. package/lib/utils/har-logs/helpers/handle-request.js +202 -0
  374. package/lib/utils/har-logs/helpers/handle-request.js.map +1 -0
  375. package/lib/utils/har-logs/index.d.ts +3 -0
  376. package/lib/utils/har-logs/index.d.ts.map +1 -0
  377. package/lib/utils/har-logs/index.js +19 -0
  378. package/lib/utils/har-logs/index.js.map +1 -0
  379. package/lib/utils/har-logs/with-har.d.ts +6 -0
  380. package/lib/utils/har-logs/with-har.d.ts.map +1 -0
  381. package/lib/utils/har-logs/with-har.js +216 -0
  382. package/lib/utils/har-logs/with-har.js.map +1 -0
  383. package/lib/utils/is-empty.d.ts +2 -0
  384. package/lib/utils/is-empty.d.ts.map +1 -0
  385. package/lib/utils/is-empty.js +16 -0
  386. package/lib/utils/is-empty.js.map +1 -0
  387. package/lib/utils/is-json.d.ts +2 -0
  388. package/lib/utils/is-json.d.ts.map +1 -0
  389. package/lib/utils/is-json.js +13 -0
  390. package/lib/utils/is-json.js.map +1 -0
  391. package/lib/utils/is-url.d.ts +2 -0
  392. package/lib/utils/is-url.d.ts.map +1 -0
  393. package/lib/utils/is-url.js +16 -0
  394. package/lib/utils/is-url.js.map +1 -0
  395. package/lib/utils/logger/logger.d.ts +16 -0
  396. package/lib/utils/logger/logger.d.ts.map +1 -0
  397. package/lib/utils/logger/logger.js +33 -0
  398. package/lib/utils/logger/logger.js.map +1 -0
  399. package/lib/utils/mtls/create-mtls-client.d.ts +4 -0
  400. package/lib/utils/mtls/create-mtls-client.d.ts.map +1 -0
  401. package/lib/utils/mtls/create-mtls-client.js +22 -0
  402. package/lib/utils/mtls/create-mtls-client.js.map +1 -0
  403. package/lib/utils/mtls/resolve-mtls-certificates.d.ts +7 -0
  404. package/lib/utils/mtls/resolve-mtls-certificates.d.ts.map +1 -0
  405. package/lib/utils/mtls/resolve-mtls-certificates.js +69 -0
  406. package/lib/utils/mtls/resolve-mtls-certificates.js.map +1 -0
  407. package/lib/utils/sort.d.ts +2 -0
  408. package/lib/utils/sort.d.ts.map +1 -0
  409. package/lib/utils/sort.js +29 -0
  410. package/lib/utils/sort.js.map +1 -0
  411. package/lib/utils/time.d.ts +2 -0
  412. package/lib/utils/time.d.ts.map +1 -0
  413. package/lib/utils/time.js +10 -0
  414. package/lib/utils/time.js.map +1 -0
  415. package/lib/utils/url.d.ts +2 -0
  416. package/lib/utils/url.d.ts.map +1 -0
  417. package/lib/utils/url.js +9 -0
  418. package/lib/utils/url.js.map +1 -0
  419. package/lib/utils/yaml.d.ts +5 -0
  420. package/lib/utils/yaml.d.ts.map +1 -0
  421. package/lib/utils/yaml.js +23 -0
  422. package/lib/utils/yaml.js.map +1 -0
  423. package/package.json +68 -0
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.maskSecrets = maskSecrets;
4
+ exports.containsSecret = containsSecret;
5
+ function maskSecrets(target, secretValues) {
6
+ const maskValue = () => '*'.repeat(8);
7
+ if (typeof target === 'string') {
8
+ let maskedString = target;
9
+ secretValues.forEach((secret) => {
10
+ maskedString = maskedString.split(secret).join('*'.repeat(secret.length));
11
+ });
12
+ return maskedString;
13
+ }
14
+ const masked = JSON.parse(JSON.stringify(target));
15
+ const maskIfContainsSecret = (value) => {
16
+ return containsSecret(value, secretValues) ? maskValue() : value;
17
+ };
18
+ const maskRecursive = (current) => {
19
+ for (const key in current) {
20
+ if (typeof current[key] === 'string') {
21
+ current[key] = maskIfContainsSecret(current[key]);
22
+ }
23
+ else if (typeof current[key] === 'object' && current[key] !== null) {
24
+ maskRecursive(current[key]);
25
+ }
26
+ }
27
+ };
28
+ maskRecursive(masked);
29
+ return masked;
30
+ }
31
+ function containsSecret(value, secretValues) {
32
+ return Array.from(secretValues).some((secret) => value.includes(secret));
33
+ }
34
+ //# sourceMappingURL=mask-secrets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-secrets.js","sourceRoot":"","sources":["../../../src/modules/cli-output/mask-secrets.ts"],"names":[],"mappings":";;AAAA,kCA4BC;AAED,wCAEC;AAhCD,SAAgB,WAAW,CAAC,MAAqC,EAAE,YAAyB;IAC1F,MAAM,SAAS,GAAG,GAAW,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAE9C,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,IAAI,YAAY,G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,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { VerboseLog } from '../../types';
2
+ export declare function getVerboseLogs({ headerParams, path, method, host, body, statusCode, responseTime, }: VerboseLog): VerboseLog;
3
+ //# sourceMappingURL=verbose-logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verbose-logs.d.ts","sourceRoot":"","sources":["../../../src/modules/cli-output/verbose-logs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,GACb,EAAE,UAAU,GAAG,UAAU,CAwBzB"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getVerboseLogs = getVerboseLogs;
4
+ function getVerboseLogs({ headerParams, path, method, host, body, statusCode, responseTime, }) {
5
+ const verboseLogs = {
6
+ path,
7
+ method,
8
+ host,
9
+ };
10
+ if (headerParams && Object.keys(headerParams).length > 0) {
11
+ verboseLogs.headerParams = headerParams;
12
+ }
13
+ if (body && Object.keys(body).length > 0) {
14
+ verboseLogs.body = body;
15
+ }
16
+ if (statusCode) {
17
+ verboseLogs.statusCode = statusCode;
18
+ }
19
+ if (responseTime) {
20
+ verboseLogs.responseTime = responseTime;
21
+ }
22
+ return verboseLogs;
23
+ }
24
+ //# sourceMappingURL=verbose-logs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verbose-logs.js","sourceRoot":"","sources":["../../../src/modules/cli-output/verbose-logs.ts"],"names":[],"mappings":";;AAEA,wCAgCC;AAhCD,SAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,GACD;IACX,MAAM,WAAW,GAAe;QAC9B,IAAI;QACJ,MAAM;QACN,IAAI;KACL,CAAC;IAEF,IAAI,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,WAAW,CAAC,YAAY,GAAG,YAAY,CAAC;IAC1C,CAAC;IAED,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzC,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,IAAI,UAAU,EAAE,CAAC;QACf,WAAW,CAAC,UAAU,GAAG,UAAU,CAAC;IACtC,CAAC;IAED,IAAI,YAAY,EAAE,CAAC;QACjB,WAAW,CAAC,YAAY,GAAG,YAAY,CAAC;IAC1C,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { RuntimeExpressionContext, TestContext } from '../../types';
2
+ export interface ParsedParameters {
3
+ queryParams: Record<string, string>;
4
+ pathParams: Record<string, string | number>;
5
+ headerParams: Record<string, string>;
6
+ }
7
+ export declare function getValueFromContext(value: any, ctx: TestContext | RuntimeExpressionContext): any;
8
+ export declare function replaceFakerVariablesInString(input: string, ctx: TestContext | RuntimeExpressionContext): any;
9
+ export declare function getFakeData(pointer: string, ctx: TestContext | RuntimeExpressionContext): any;
10
+ export declare function parseJson(objectToResolve: any, ctx: TestContext | RuntimeExpressionContext): any;
11
+ export declare function resolvePath(path?: string, pathParams?: Record<string, string | number | boolean>): string | undefined;
12
+ //# sourceMappingURL=get-value-from-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-value-from-context.d.ts","sourceRoot":"","sources":["../../../src/modules/config-parser/get-value-from-context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAAY,MAAM,aAAa,CAAC;AAInF,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAC5C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAMD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,GAAG,wBAAwB,GAAG,GAAG,CAyBhG;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,WAAW,GAAG,wBAAwB,OAa5C;AA6GD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,wBAAwB,GAAG,GAAG,CAqB7F;AAwBD,wBAAgB,SAAS,CAAC,eAAe,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,GAAG,wBAAwB,GAAG,GAAG,CAEhG;AAED,wBAAgB,WAAW,CACzB,IAAI,CAAC,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GACrD,MAAM,GAAG,SAAS,CAWpB"}
@@ -0,0 +1,183 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getValueFromContext = getValueFromContext;
4
+ exports.replaceFakerVariablesInString = replaceFakerVariablesInString;
5
+ exports.getFakeData = getFakeData;
6
+ exports.parseJson = parseJson;
7
+ exports.resolvePath = resolvePath;
8
+ const colorette_1 = require("colorette");
9
+ const node_vm_1 = require("node:vm");
10
+ const logger_1 = require("../../utils/logger/logger");
11
+ const logger = logger_1.DefaultLogger.getInstance();
12
+ const hasCurlyBraces = (input) => {
13
+ return /\{.*?\}/.test(input);
14
+ };
15
+ function getValueFromContext(value, ctx) {
16
+ if (!value)
17
+ return value;
18
+ if (typeof value === 'object') {
19
+ for (const key in value) {
20
+ value[key] = getValueFromContext(value[key], ctx);
21
+ }
22
+ return value;
23
+ }
24
+ if (typeof value === 'number' || typeof value === 'boolean') {
25
+ return value;
26
+ }
27
+ if (value.toString().startsWith('$faker.')) {
28
+ return getFakeData(value.slice(1), ctx);
29
+ }
30
+ if (hasCurlyBraces(value)) {
31
+ // multiple variables in string => {$var1} {$var2}
32
+ return replaceVariablesInString(value, ctx);
33
+ }
34
+ else {
35
+ // single variable in string => $var1
36
+ return resolveValue(value, ctx);
37
+ }
38
+ }
39
+ function replaceFakerVariablesInString(input, ctx) {
40
+ const startIndex = input.indexOf('{');
41
+ if (startIndex !== -1) {
42
+ const substringAfterFirstBrace = input.substring(startIndex + 1);
43
+ const fakerFunction = substringAfterFirstBrace.slice(0, -1);
44
+ const fakerValue = getFakeData(fakerFunction.slice(1), ctx);
45
+ return fakerValue && input.replace(/{(.*)}/, fakerValue);
46
+ }
47
+ else {
48
+ return input;
49
+ }
50
+ }
51
+ function replaceVariablesInString(input, ctx) {
52
+ // Regular expression to match content inside ${...}
53
+ const regex = /\{\$(\{[^{}]*\}|[^{}])*\}/g;
54
+ let result = input;
55
+ // Replace each match with its interpolated value
56
+ result = result.replace(regex, (match, _code) => {
57
+ return interpolate(match, ctx);
58
+ });
59
+ return result;
60
+ }
61
+ function interpolate(part, ctx) {
62
+ if (!part.includes('$'))
63
+ return part;
64
+ if (part.includes('$faker.')) {
65
+ return replaceFakerVariablesInString(part, ctx);
66
+ }
67
+ const value = getFrom(ctx)(removeFigureBrackets(part));
68
+ return value !== undefined ? value : '';
69
+ }
70
+ const resolveValue = (value, ctx) => {
71
+ if (!value)
72
+ return value;
73
+ const path = value.toString();
74
+ if (!path.includes('$')) {
75
+ return value;
76
+ }
77
+ // if path has $file('...') syntax, return the path but trim the $file(' and ')
78
+ if (path.startsWith('$file(') && path.endsWith(')')) {
79
+ return path.slice(7, -2);
80
+ }
81
+ // $sourceDescriptions.<name>.workflows.<workflowId>
82
+ if (path.startsWith('$sourceDescriptions.') && path.includes('.workflows.')) {
83
+ const parts = path.split('.');
84
+ const sourceDescriptionName = parts[1];
85
+ const workflowId = parts[3];
86
+ if (!sourceDescriptionName || !workflowId) {
87
+ return undefined;
88
+ }
89
+ const sourceDescriptions = getFrom(ctx)('$sourceDescriptions');
90
+ if (!sourceDescriptions[sourceDescriptionName]) {
91
+ return undefined;
92
+ }
93
+ return sourceDescriptions[sourceDescriptionName].workflows.find((workflow) => workflow.workflowId === workflowId);
94
+ }
95
+ if (path && path.trim().startsWith('faker.')) {
96
+ return getFakeData(path, ctx);
97
+ }
98
+ return path
99
+ ? getFrom(ctx)(replaceSquareBrackets(path))
100
+ : path.replace(/\$\{([^}]+)}/g, (_, path) => getFrom(ctx)(replaceSquareBrackets(path)));
101
+ };
102
+ function removeFigureBrackets(input) {
103
+ return input.replace(/\{(.*)\}/, '$1');
104
+ }
105
+ function replaceSquareBrackets(input) {
106
+ return input.replace(/\['(.*?)'\]/g, '.$1');
107
+ }
108
+ const getFrom = ($, originalPointer = '') => (pointer) => {
109
+ if (!originalPointer) {
110
+ originalPointer = pointer; // Store the first pointer only during the initial call
111
+ }
112
+ if (!pointer)
113
+ return $;
114
+ const [key, ...rest] = pointer.split('.');
115
+ if (!$) {
116
+ throw Error(`Cannot get ${(0, colorette_1.red)(key)} from ${(0, colorette_1.red)(originalPointer)}`);
117
+ }
118
+ if ($?.[key] === undefined) {
119
+ const reason = ` Undefined ${(0, colorette_1.red)(key)} at ${(0, colorette_1.red)(originalPointer)}.`;
120
+ const additionalInfo = Object.keys($).length
121
+ ? `Did you mean to use another key? Available keys:\n${Object.keys($).join(', ')}.\n`
122
+ : '';
123
+ const errorMessage = `${reason} ${additionalInfo}`;
124
+ throw Error(errorMessage);
125
+ }
126
+ return getFrom($[key], originalPointer)(rest.join('.'));
127
+ };
128
+ function getFakeData(pointer, ctx) {
129
+ const segments = pointer.split('.');
130
+ const fakerContext = { ctx: { faker: ctx.$faker } };
131
+ try {
132
+ (0, node_vm_1.createContext)(fakerContext);
133
+ const escapedSegments = segments
134
+ .map((segment) => segment.trim())
135
+ .map((segment, idx) =>
136
+ // Dumb function check (if ends by ')'), if function goes first dont need to put '.',
137
+ // if goes second and so on - must be prepended by '.', like ["escaped-field"].func()
138
+ segment.endsWith(')') ? `${idx == 0 ? '' : '.'}${segment}` : `["${segment}"]`)
139
+ .join('');
140
+ return (0, node_vm_1.runInContext)(`ctx${escapedSegments}`, fakerContext);
141
+ }
142
+ catch (err) {
143
+ logger.error((0, colorette_1.red)(err.toString()));
144
+ return undefined;
145
+ }
146
+ }
147
+ function modifyJSON(value, ctx) {
148
+ if (typeof value === 'string') {
149
+ if (value)
150
+ return getValueFromContext(value, ctx);
151
+ }
152
+ if (typeof value === 'string' ||
153
+ typeof value === 'number' ||
154
+ typeof value === 'boolean' ||
155
+ typeof value === 'undefined' ||
156
+ value === null)
157
+ return;
158
+ for (const i in value) {
159
+ if (typeof value[i] === 'string') {
160
+ if (value[i])
161
+ value[i] = getValueFromContext(value[i], ctx);
162
+ }
163
+ else {
164
+ modifyJSON(value[i], ctx);
165
+ }
166
+ }
167
+ }
168
+ function parseJson(objectToResolve, ctx) {
169
+ return modifyJSON(objectToResolve, ctx) || objectToResolve;
170
+ }
171
+ function resolvePath(path, pathParams) {
172
+ if (!path)
173
+ return;
174
+ const paramsWithBraces = {};
175
+ for (const param in pathParams) {
176
+ paramsWithBraces[`{${param}}`] = String(pathParams[param]);
177
+ }
178
+ return path
179
+ .split(/(\{[a-zA-Z0-9_.-]+\}+)/g)
180
+ .map((key) => (paramsWithBraces[key] ? paramsWithBraces[key] : key))
181
+ .join('');
182
+ }
183
+ //# sourceMappingURL=get-value-from-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-value-from-context.js","sourceRoot":"","sources":["../../../src/modules/config-parser/get-value-from-context.ts"],"names":[],"mappings":";;AAkBA,kDAyBC;AAED,sEAeC;AA6GD,kCAqBC;AAwBD,8BAEC;AAED,kCAcC;AAxOD,yCAAgC;AAChC,qC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EAAE,CAAC;QAC/B,gBAAgB,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,IAAI;SACR,KAAK,CAAC,yBAAyB,CAAC;SAChC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;SACnE,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type Replacement } from '../../types';
2
+ export declare function handlePayloadReplacements(payload: object, replacements: Replacement[]): void;
3
+ //# sourceMappingURL=handle-request-body-replacements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-request-body-replacements.d.ts","sourceRoot":"","sources":["../../../src/modules/config-parser/handle-request-body-replacements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,QAoBrF"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handlePayloadReplacements = handlePayloadReplacements;
4
+ const JsonPointerLib = require('json-pointer');
5
+ function handlePayloadReplacements(payload, replacements) {
6
+ for (const replacement of replacements) {
7
+ const { target, value } = replacement;
8
+ if (typeof target !== 'string') {
9
+ throw new Error(`Invalid JSON Pointer: ${target}`);
10
+ }
11
+ try {
12
+ // Get the current value using JSON Pointer
13
+ const currentValue = JsonPointerLib.get(payload, target);
14
+ if (currentValue !== undefined) {
15
+ // Replace the value using JSON Pointer
16
+ JsonPointerLib.set(payload, target, value);
17
+ }
18
+ }
19
+ catch {
20
+ throw new Error(`Invalid JSON Pointer: ${target}`);
21
+ }
22
+ }
23
+ }
24
+ //# sourceMappingURL=handle-request-body-replacements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-request-body-replacements.js","sourceRoot":"","sources":["../../../src/modules/config-parser/handle-request-body-replacements.ts"],"names":[],"mappings":";;AAIA,8DAoBC;AAtBD,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE/C,SAAgB,yBAAyB,CAAC,OAAe,EAAE,YAA2B;IACpF,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACvC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,CAAC;QAEtC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,yBAAyB,MAAM,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,IAAI,CAAC;YACH,2CAA2C;YAC3C,MAAM,YAAY,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAEzD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;gBAC/B,uCAAuC;gBACvC,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,yBAAyB,MAAM,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ export * from './get-value-from-context';
2
+ export * from './parse-parameters';
3
+ export * from './parse-request-body';
4
+ export * from './handle-request-body-replacements';
5
+ export * from './resolve-reusable-object-reference';
6
+ export * from './resolve-reusable-component';
7
+ export * from './map-header-params-and-cookie-to-object';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/config-parser/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0CAA0C,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./get-value-from-context"), exports);
18
+ __exportStar(require("./parse-parameters"), exports);
19
+ __exportStar(require("./parse-request-body"), exports);
20
+ __exportStar(require("./handle-request-body-replacements"), exports);
21
+ __exportStar(require("./resolve-reusable-object-reference"), exports);
22
+ __exportStar(require("./resolve-reusable-component"), exports);
23
+ __exportStar(require("./map-header-params-and-cookie-to-object"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/config-parser/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,qDAAmC;AACnC,uDAAqC;AACrC,qEAAmD;AACnD,sEAAoD;AACpD,+DAA6C;AAC7C,2EAAyD"}
@@ -0,0 +1,6 @@
1
+ export declare function mapHeaderParamsAndCookieToObject(headerParams: {
2
+ [key: string]: string;
3
+ }): {
4
+ [key: string]: string;
5
+ };
6
+ //# sourceMappingURL=map-header-params-and-cookie-to-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-header-params-and-cookie-to-object.d.ts","sourceRoot":"","sources":["../../../src/modules/config-parser/map-header-params-and-cookie-to-object.ts"],"names":[],"mappings":"AAAA,wBAAgB,gCAAgC,CAAC,YAAY,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG;IACzF,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAkBA"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapHeaderParamsAndCookieToObject = mapHeaderParamsAndCookieToObject;
4
+ function mapHeaderParamsAndCookieToObject(headerParams) {
5
+ const headerParamsWithMappedCookies = {};
6
+ for (const [key, value] of Object.entries(headerParams)) {
7
+ if (key.toLowerCase() === 'cookie') {
8
+ const cookies = value.split(';');
9
+ for (const cookie of cookies) {
10
+ const [cookieKey, cookieValue] = cookie.split('=');
11
+ if (cookieKey && cookieValue) {
12
+ headerParamsWithMappedCookies[cookieKey.trim()] = cookieValue.trim();
13
+ }
14
+ }
15
+ }
16
+ else {
17
+ headerParamsWithMappedCookies[key] = value;
18
+ }
19
+ }
20
+ return headerParamsWithMappedCookies;
21
+ }
22
+ //# sourceMappingURL=map-header-params-and-cookie-to-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-header-params-and-cookie-to-object.js","sourceRoot":"","sources":["../../../src/modules/config-parser/map-header-params-and-cookie-to-object.ts"],"names":[],"mappings":";;AAAA,4EAoBC;AApBD,SAAgB,gCAAgC,CAAC,YAAuC;IAGtF,MAAM,6BAA6B,GAA8B,EAAE,CAAC;IAEpE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACxD,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,QAAQ,EAAE,CAAC;YACnC,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACjC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC7B,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACnD,IAAI,SAAS,IAAI,WAAW,EAAE,CAAC;oBAC7B,6BAA6B,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;gBACvE,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,6BAA6B,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,OAAO,6BAA6B,CAAC;AACvC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { AdditionalParameterProperties } from '../../types';
2
+ export type ParameterWithIn = {
3
+ in: 'header' | 'query' | 'path' | 'cookie';
4
+ name: string;
5
+ value: string | number | boolean;
6
+ } & AdditionalParameterProperties;
7
+ export type ParameterWithoutIn = Omit<ParameterWithIn, 'in'>;
8
+ export declare function isParameterWithoutIn(parameter: any): parameter is ParameterWithoutIn;
9
+ export declare function isParameterWithIn(parameter: any): parameter is ParameterWithIn;
10
+ //# sourceMappingURL=parse-parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-parameters.d.ts","sourceRoot":"","sources":["../../../src/modules/config-parser/parse-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAClC,GAAG,6BAA6B,CAAC;AAElC,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;AAgC7D,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS,IAAI,kBAAkB,CAQpF;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS,IAAI,eAAe,CAO9E"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isParameterWithoutIn = isParameterWithoutIn;
4
+ exports.isParameterWithIn = isParameterWithIn;
5
+ // The isParameterWithoutIn and isParameterWithIn type guards are used to differentiate between
6
+ // the two sides of onOffs in the parameter schema that is imported from the @redocly/openapi-core.
7
+ // export const parameter = {
8
+ // type: 'object',
9
+ // oneOf: [
10
+ // {
11
+ // type: 'object',
12
+ // properties: {
13
+ // in: { type: 'string', enum: ['header', 'query', 'path', 'cookie'] },
14
+ // name: { type: 'string' },
15
+ // value: {
16
+ // oneOf: [{ type: 'string' }, { type: 'number' }, { type: 'boolean' }],
17
+ // },
18
+ // },
19
+ // required: ['name', 'value'],
20
+ // additionalProperties: false,
21
+ // },
22
+ // {
23
+ // type: 'object',
24
+ // properties: {
25
+ // reference: { type: 'string' },
26
+ // value: {
27
+ // oneOf: [{ type: 'string' }, { type: 'number' }, { type: 'boolean' }],
28
+ // },
29
+ // },
30
+ // required: ['reference'],
31
+ // additionalProperties: false,
32
+ // },
33
+ // ],
34
+ // } as const;
35
+ function isParameterWithoutIn(parameter) {
36
+ return (typeof parameter === 'object' &&
37
+ parameter !== null &&
38
+ 'name' in parameter &&
39
+ 'value' in parameter &&
40
+ !('in' in parameter));
41
+ }
42
+ function isParameterWithIn(parameter) {
43
+ return (typeof parameter === 'object' &&
44
+ parameter !== null &&
45
+ 'in' in parameter &&
46
+ ['header', 'query', 'path', 'cookie'].includes(parameter.in));
47
+ }
48
+ //# sourceMappingURL=parse-parameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-parameters.js","sourceRoot":"","sources":["../../../src/modules/config-parser/parse-parameters.ts"],"names":[],"mappings":";;AAwCA,oDAQC;AAED,8CAOC;AA/CD,+FAA+F;AAC/F,mGAAmG;AACnG,6BAA6B;AAC7B,oBAAoB;AACpB,aAAa;AACb,QAAQ;AACR,wBAAwB;AACxB,sBAAsB;AACtB,+EAA+E;AAC/E,oCAAoC;AACpC,mBAAmB;AACnB,kFAAkF;AAClF,aAAa;AACb,WAAW;AACX,qCAAqC;AACrC,qCAAqC;AACrC,SAAS;AACT,QAAQ;AACR,wBAAwB;AACxB,sBAAsB;AACtB,yCAAyC;AACzC,mBAAmB;AACnB,kFAAkF;AAClF,aAAa;AACb,WAAW;AACX,iCAAiC;AACjC,qCAAqC;AACrC,SAAS;AACT,OAAO;AACP,cAAc;AACd,SAAgB,oBAAoB,CAAC,SAAc;IACjD,OAAO,CACL,OAAO,SAAS,KAAK,QAAQ;QAC7B,SAAS,KAAK,IAAI;QAClB,MAAM,IAAI,SAAS;QACnB,OAAO,IAAI,SAAS;QACpB,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CACrB,CAAC;AACJ,CAAC;AAED,SAAgB,iBAAiB,CAAC,SAAc;IAC9C,OAAO,CACL,OAAO,SAAS,KAAK,QAAQ;QAC7B,SAAS,KAAK,IAAI;QAClB,IAAI,IAAI,SAAS;QACjB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAC7D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type RequestBody } from '../../types';
2
+ export declare function stripFileDecorator(payload: string): string;
3
+ export declare function parseRequestBody(stepRequestBody: RequestBody | undefined): Promise<{
4
+ payload: any | undefined;
5
+ contentType: string | undefined;
6
+ encoding: string | undefined;
7
+ }>;
8
+ //# sourceMappingURL=parse-request-body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-request-body.d.ts","sourceRoot":"","sources":["../../../src/modules/config-parser/parse-request-body.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,UAIjD;AA4ED,wBAAsB,gBAAgB,CAAC,eAAe,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;IACxF,OAAO,EAAE,GAAG,GAAG,SAAS,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,CAAC,CAoDD"}