@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,19 @@
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("./create-har-log"), exports);
18
+ __exportStar(require("./with-har"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/har-logs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,6CAA2B"}
@@ -0,0 +1,6 @@
1
+ export interface WithHar {
2
+ (baseFetch: any, defaults?: any): any;
3
+ harEntryMap?: Map<string, any>;
4
+ }
5
+ export declare const withHar: WithHar;
6
+ //# sourceMappingURL=with-har.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-har.d.ts","sourceRoot":"","sources":["../../../src/utils/har-logs/with-har.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,OAAO;IACtB,CAAC,SAAS,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IACtC,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,eAAO,MAAM,OAAO,EAAE,OAgNrB,CAAC"}
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ /* istanbul ignore file */
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.withHar = void 0;
28
+ // Forked from:
29
+ // https://github.com/exogen/node-fetch-har
30
+ // Changes made:
31
+ // - Allow to pass body as FormData
32
+ // - removed nanoid and replaced with crypto.randomUUID
33
+ // - migrated to be used with undici
34
+ const url_1 = require("url");
35
+ const undici_1 = require("undici");
36
+ const crypto = __importStar(require("node:crypto"));
37
+ const add_headers_1 = require("./helpers/add-headers");
38
+ const get_duration_1 = require("./helpers/get-duration");
39
+ const build_request_cookies_1 = require("./helpers/build-request-cookies");
40
+ const build_headers_1 = require("./helpers/build-headers");
41
+ const build_response_cookies_1 = require("./helpers/build-response-cookies");
42
+ const HAR_HEADER_NAME = 'x-har-request-id';
43
+ const harEntryMap = new Map();
44
+ const withHar = function (baseFetch, defaults = {}) {
45
+ exports.withHar.harEntryMap = harEntryMap;
46
+ return async function fetch(input, options = {}) {
47
+ const { har = defaults.har, harPageRef = defaults.harPageRef, onHarEntry = defaults.onHarEntry, } = options;
48
+ if (har === false) {
49
+ return baseFetch(input, options);
50
+ }
51
+ const requestId = crypto.randomUUID();
52
+ const startTime = process.hrtime();
53
+ const url = new url_1.URL(typeof input === 'string' ? input : input.url);
54
+ const entry = {
55
+ _compressed: false,
56
+ _resourceType: 'fetch',
57
+ _timestamps: {
58
+ start: startTime,
59
+ socket: startTime,
60
+ lookup: startTime,
61
+ connect: startTime,
62
+ secureConnect: startTime,
63
+ sent: startTime,
64
+ firstByte: startTime,
65
+ received: startTime,
66
+ },
67
+ timings: {
68
+ blocked: -1,
69
+ dns: -1,
70
+ connect: -1,
71
+ send: 0,
72
+ wait: 0,
73
+ receive: 0,
74
+ ssl: -1,
75
+ },
76
+ time: 0,
77
+ startedDateTime: new Date().toISOString(),
78
+ cache: {
79
+ beforeRequest: null,
80
+ afterRequest: null,
81
+ },
82
+ request: {
83
+ method: options.method || 'GET',
84
+ url: url.href,
85
+ cookies: (0, build_request_cookies_1.buildRequestCookies)(options.headers || {}),
86
+ headers: (0, build_headers_1.buildHeaders)(options.headers || {}),
87
+ queryString: [...url.searchParams].map(([name, value]) => ({
88
+ name,
89
+ value,
90
+ })),
91
+ headersSize: -1,
92
+ bodySize: -1,
93
+ postData: {},
94
+ httpVersion: 'HTTP/1.1',
95
+ },
96
+ response: {},
97
+ pageref: '',
98
+ };
99
+ // Replace the Dispatcher initialization with Client
100
+ const client = options.dispatcher || new undici_1.Client(url.origin);
101
+ // Listen to Undici dispatcher events
102
+ client.on('connect', () => (entry._timestamps.connect = process.hrtime()));
103
+ // Pass the dispatcher in options
104
+ options = Object.assign({}, options, {
105
+ headers: (0, add_headers_1.addHeaders)(options.headers, { [HAR_HEADER_NAME]: requestId }),
106
+ dispatcher: client, // Use client as dispatcher
107
+ });
108
+ harEntryMap.set(requestId, entry);
109
+ // Update sent time just before the request
110
+ entry._timestamps.sent = process.hrtime();
111
+ // Make the request
112
+ const response = await baseFetch(input, options);
113
+ // Need to clone response to get both text and arrayBuffer
114
+ const responseClone = response.clone();
115
+ // Update firstByte time when we get the response
116
+ entry._timestamps.firstByte = process.hrtime();
117
+ // Get the response body and update received time
118
+ const text = await response.text();
119
+ entry._timestamps.received = process.hrtime();
120
+ const harEntry = harEntryMap.get(requestId);
121
+ harEntryMap.delete(requestId);
122
+ if (!harEntry) {
123
+ return response;
124
+ }
125
+ // Add response info
126
+ if (!harEntry.response) {
127
+ harEntry.response = {};
128
+ }
129
+ // Calculate total bytes of headers including the double CRLF before body
130
+ const headerLines = [...response.headers.entries()].map(([name, value]) => `${name}: ${value}`);
131
+ const statusLine = `HTTP/1.1 ${response.status} ${response.statusText}`;
132
+ const headerBytes = Buffer.byteLength(statusLine + '\r\n' + headerLines.join('\r\n') + '\r\n\r\n');
133
+ harEntry._compressed = /^(gzip|compress|deflate|br)$/.test(response.headers.get('content-encoding') || '');
134
+ if (!harEntry.response.content) {
135
+ harEntry.response.content = {
136
+ size: -1,
137
+ };
138
+ }
139
+ if (harEntry._compressed) {
140
+ const rawBody = await responseClone.arrayBuffer();
141
+ harEntry.response.content.size = rawBody.byteLength;
142
+ }
143
+ else {
144
+ harEntry.response.content.size = text ? Buffer.byteLength(text) : -1;
145
+ }
146
+ const bodySize = text ? Buffer.byteLength(text) : -1;
147
+ harEntry.response = {
148
+ headers: (0, build_headers_1.buildHeaders)(response.headers),
149
+ cookies: (0, build_response_cookies_1.buildResponseCookies)(response.headers),
150
+ status: response.status,
151
+ statusText: response.statusText || '',
152
+ httpVersion: response.httpVersion ? `HTTP/${response.httpVersion}` : 'HTTP/1.1',
153
+ redirectURL: response.headers.location || '',
154
+ content: {
155
+ size: harEntry._compressed && harEntry.response.content.size !== -1
156
+ ? harEntry.response.content.size
157
+ : Buffer.byteLength(text),
158
+ mimeType: response.headers.get('content-type') || '',
159
+ text,
160
+ compression: harEntry._compressed && harEntry.response.content.size !== -1
161
+ ? harEntry.response.content.size - bodySize
162
+ : 0,
163
+ },
164
+ bodySize,
165
+ headersSize: headerBytes,
166
+ };
167
+ // Calculate timings
168
+ const { _timestamps: time } = harEntry;
169
+ harEntry.timings = {
170
+ blocked: Math.max((0, get_duration_1.getDuration)(time.start, time.socket), 0.01),
171
+ dns: -1,
172
+ connect: Math.max((0, get_duration_1.getDuration)(time.lookup, time.connect), -1),
173
+ ssl: time.secureConnect ? Math.max((0, get_duration_1.getDuration)(time.connect, time.secureConnect), -1) : -1,
174
+ send: (0, get_duration_1.getDuration)(time.secureConnect || time.connect, time.sent),
175
+ wait: Math.max((0, get_duration_1.getDuration)(time.sent, time.firstByte), 0),
176
+ receive: (0, get_duration_1.getDuration)(time.firstByte, time.received),
177
+ };
178
+ // Calculate total time
179
+ harEntry.time = (0, get_duration_1.getDuration)(time.start, time.received);
180
+ const parents = [];
181
+ let child = harEntry;
182
+ do {
183
+ const parent = child._parent;
184
+ delete child._parent;
185
+ if (parent) {
186
+ parents.unshift(parent);
187
+ }
188
+ child = parent;
189
+ } while (child);
190
+ // Allow grouping by pages.
191
+ entry.pageref = harPageRef || 'page_1';
192
+ parents.forEach((parent) => {
193
+ parent.pageref = entry.pageref;
194
+ });
195
+ const Response = defaults.Response || baseFetch.Response || global.Response || response.constructor;
196
+ const responseCopy = new Response(text, {
197
+ status: response.statusCode,
198
+ statusText: response.statusText || '',
199
+ headers: response.headers,
200
+ url: response.url,
201
+ });
202
+ responseCopy.harEntry = entry;
203
+ if (har && typeof har === 'object') {
204
+ har.log.entries.push(...parents, entry);
205
+ }
206
+ if (onHarEntry) {
207
+ parents.forEach((parent) => {
208
+ onHarEntry(parent);
209
+ });
210
+ onHarEntry(entry);
211
+ }
212
+ return responseCopy;
213
+ };
214
+ };
215
+ exports.withHar = withHar;
216
+ //# sourceMappingURL=with-har.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-har.js","sourceRoot":"","sources":["../../../src/utils/har-logs/with-har.ts"],"names":[],"mappings":";AAAA,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;AAE1B,eAAe;AACf,2CAA2C;AAC3C,gBAAgB;AAChB,mCAAmC;AACnC,uDAAuD;AACvD,oCAAoC;AAEpC,6BAA0B;AAC1B,mCAAgC;AAChC,oDAAsC;AACtC,uDAAmD;AACnD,yDAAqD;AACrD,2EAAsE;AACtE,2DAAuD;AACvD,6EAAwE;AAExE,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAC3C,MAAM,WAAW,GAAG,IAAI,GAAG,EAAe,CAAC;AAMpC,MAAM,OAAO,GAAY,UAAU,SAAc,EAAE,WAAgB,EAAE;IAC1E,eAAO,CAAC,WAAW,GAAG,WAAW,CAAC;IAClC,OAAO,KAAK,UAAU,KAAK,CAAC,KAAU,EAAE,UAAe,EAAE;QACvD,MAAM,EACJ,GAAG,GAAG,QAAQ,CAAC,GAAG,EAClB,UAAU,GAAG,QAAQ,CAAC,UAAU,EAChC,UAAU,GAAG,QAAQ,CAAC,UAAU,GACjC,GAAG,OAAO,CAAC;QAEZ,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;YAClB,OAAO,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACtC,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;QAEnC,MAAM,GAAG,GAAG,IAAI,SAAG,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEnE,MAAM,KAAK,GAAG;YACZ,WAAW,EAAE,KAAK;YAClB,aAAa,EAAE,OAAO;YACtB,WAAW,EAAE;gBACX,KAA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names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,WAcjC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEmpty = isEmpty;
4
+ function isEmpty(value) {
5
+ if (value === null || value === undefined) {
6
+ return true;
7
+ }
8
+ if (typeof value === 'object') {
9
+ return Object.keys(value).length === 0;
10
+ }
11
+ if (typeof value === 'string' || Array.isArray(value)) {
12
+ return value.length === 0;
13
+ }
14
+ return false;
15
+ }
16
+ //# sourceMappingURL=is-empty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-empty.js","sourceRoot":"","sources":["../../src/utils/is-empty.ts"],"names":[],"mappings":";;AAAA,0BAcC;AAdD,SAAgB,OAAO,CAAC,KAAU;IAChC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACtD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function isJSON(str: string): boolean;
2
+ //# sourceMappingURL=is-json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-json.d.ts","sourceRoot":"","sources":["../../src/utils/is-json.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAO3C"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isJSON = isJSON;
4
+ function isJSON(str) {
5
+ try {
6
+ JSON.parse(str);
7
+ return true;
8
+ }
9
+ catch {
10
+ return false;
11
+ }
12
+ }
13
+ //# sourceMappingURL=is-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-json.js","sourceRoot":"","sources":["../../src/utils/is-json.ts"],"names":[],"mappings":";;AAAA,wBAOC;AAPD,SAAgB,MAAM,CAAC,GAAW;IAChC,IAAI,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function isURL(url: string): boolean;
2
+ //# sourceMappingURL=is-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-url.d.ts","sourceRoot":"","sources":["../../src/utils/is-url.ts"],"names":[],"mappings":"AAUA,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,WAEhC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isURL = isURL;
4
+ const throws = (fn) => {
5
+ try {
6
+ fn();
7
+ }
8
+ catch {
9
+ return true;
10
+ }
11
+ return false;
12
+ };
13
+ function isURL(url) {
14
+ return !throws(() => new URL(url));
15
+ }
16
+ //# sourceMappingURL=is-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-url.js","sourceRoot":"","sources":["../../src/utils/is-url.ts"],"names":[],"mappings":";;AAUA,sBAEC;AAZD,MAAM,MAAM,GAAG,CAAC,EAAiB,EAAE,EAAE;IACnC,IAAI,CAAC;QACH,EAAE,EAAE,CAAC;IACP,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,SAAgB,KAAK,CAAC,GAAW;IAC/B,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface Logger {
2
+ log(message: string): void;
3
+ error(message: string): void;
4
+ printNewLine(): void;
5
+ printSeparator(separator: string): void;
6
+ }
7
+ export declare class DefaultLogger implements Logger {
8
+ private static instance;
9
+ private constructor();
10
+ static getInstance(): DefaultLogger;
11
+ error(message: string): void;
12
+ log(message: string): void;
13
+ printNewLine(): void;
14
+ printSeparator(separator: string): void;
15
+ }
16
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/utils/logger/logger.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,MAAM;IACrB,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,IAAI,IAAI,CAAC;IACrB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC;AAED,qBAAa,aAAc,YAAW,MAAM;IAC1C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAgB;IAEvC,OAAO;WAEO,WAAW,IAAI,aAAa;IAO1C,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5B,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAI1B,YAAY,IAAI,IAAI;IAIpB,cAAc,CAAC,SAAS,EAAE,MAAM;CAQjC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DefaultLogger = void 0;
4
+ const colorette_1 = require("colorette");
5
+ const RESET_ESCAPE_CODE_IN_TERMINAL = '\x1B[0m';
6
+ class DefaultLogger {
7
+ static instance;
8
+ constructor() { }
9
+ static getInstance() {
10
+ if (!DefaultLogger.instance) {
11
+ DefaultLogger.instance = new DefaultLogger();
12
+ }
13
+ return DefaultLogger.instance;
14
+ }
15
+ error(message) {
16
+ process.stderr.write(`${message}\n`);
17
+ }
18
+ log(message) {
19
+ process.stdout.write(`${message}`);
20
+ }
21
+ printNewLine() {
22
+ process.stdout.write(`${RESET_ESCAPE_CODE_IN_TERMINAL}\n`);
23
+ }
24
+ printSeparator(separator) {
25
+ const windowWidth = process.stdout.columns || 80;
26
+ const separatorLine = separator
27
+ .repeat(Math.ceil(windowWidth / separator.length))
28
+ .slice(0, windowWidth);
29
+ process.stdout.write((0, colorette_1.gray)(`${separatorLine}`));
30
+ }
31
+ }
32
+ exports.DefaultLogger = DefaultLogger;
33
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/utils/logger/logger.ts"],"names":[],"mappings":";;;AAAA,yCAAiC;AAEjC,MAAM,6BAA6B,GAAG,SAAS,CAAC;AAShD,MAAa,aAAa;IAChB,MAAM,CAAC,QAAQ,CAAgB;IAEvC,gBAAuB,CAAC;IAEjB,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;YAC5B,aAAa,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAC/C,CAAC;QACD,OAAO,aAAa,CAAC,QAAQ,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,GAAG,CAAC,OAAe;QACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,YAAY;QACV,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,6BAA6B,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED,cAAc,CAAC,SAAiB;QAC9B,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;QACjD,MAAM,aAAa,GAAG,SAAS;aAC5B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;aACjD,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;QAEzB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAA,gBAAI,EAAC,GAAG,aAAa,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC;CACF;AAhCD,sCAgCC"}
@@ -0,0 +1,4 @@
1
+ import { Client } from 'undici';
2
+ import type { TestContext } from '../../types';
3
+ export declare function createMtlsClient(parsedPathToFetch: string, mtlsCerts?: TestContext['mtlsCerts']): Client | undefined;
4
+ //# sourceMappingURL=create-mtls-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-mtls-client.d.ts","sourceRoot":"","sources":["../../../src/utils/mtls/create-mtls-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,wBAAgB,gBAAgB,CAC9B,iBAAiB,EAAE,MAAM,EACzB,SAAS,GAAE,WAAW,CAAC,WAAW,CAAM,sBAkBzC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createMtlsClient = createMtlsClient;
4
+ const undici_1 = require("undici");
5
+ function createMtlsClient(parsedPathToFetch, mtlsCerts = {}) {
6
+ const { clientCert, clientKey, caCert } = mtlsCerts;
7
+ const baseUrl = new URL(parsedPathToFetch).origin;
8
+ if (clientCert && clientKey) {
9
+ return new undici_1.Client(baseUrl, {
10
+ connect: {
11
+ key: Buffer.from(clientKey),
12
+ cert: Buffer.from(clientCert),
13
+ ...(caCert && { ca: Buffer.from(caCert) }),
14
+ // Keeping this `false` to have the ability to call different servers in one Arazzo file
15
+ // some of them might not require mTLS.
16
+ rejectUnauthorized: false,
17
+ },
18
+ });
19
+ }
20
+ return undefined;
21
+ }
22
+ //# sourceMappingURL=create-mtls-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-mtls-client.js","sourceRoot":"","sources":["../../../src/utils/mtls/create-mtls-client.ts"],"names":[],"mappings":";;AAIA,4CAoBC;AAxBD,mCAAgC;AAIhC,SAAgB,gBAAgB,CAC9B,iBAAyB,EACzB,YAAsC,EAAE;IAExC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACpD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC;IAElD,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;QAC5B,OAAO,IAAI,eAAM,CAAC,OAAO,EAAE;YACzB,OAAO,EAAE;gBACP,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;gBAC3B,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;gBAC7B,GAAG,CAAC,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1C,wFAAwF;gBACxF,uCAAuC;gBACvC,kBAAkB,EAAE,KAAK;aAC1B;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type TestContext } from '../../types';
2
+ export declare function resolveMtlsCertificates(mtlsCertificates?: Partial<TestContext['mtlsCerts']>): {
3
+ clientCert: string | undefined;
4
+ clientKey: string | undefined;
5
+ caCert: string | undefined;
6
+ };
7
+ //# sourceMappingURL=resolve-mtls-certificates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-mtls-certificates.d.ts","sourceRoot":"","sources":["../../../src/utils/mtls/resolve-mtls-certificates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,wBAAgB,uBAAuB,CAAC,gBAAgB,GAAE,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAM;;;;EAQ/F"}
@@ -0,0 +1,69 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.resolveMtlsCertificates = resolveMtlsCertificates;
27
+ const fs = __importStar(require("node:fs"));
28
+ function resolveMtlsCertificates(mtlsCertificates = {}) {
29
+ const { clientCert, clientKey, caCert } = mtlsCertificates;
30
+ return {
31
+ clientCert: resolveCertificate(clientCert),
32
+ clientKey: resolveCertificate(clientKey),
33
+ caCert: resolveCertificate(caCert),
34
+ };
35
+ }
36
+ function resolveCertificate(cert) {
37
+ if (!cert)
38
+ return undefined;
39
+ try {
40
+ // Check if the string looks like a certificate content
41
+ const isCertContent = cert.includes('-----BEGIN') && cert.includes('-----END');
42
+ if (!isCertContent) {
43
+ // If not a certificate content, treat as file path
44
+ fs.accessSync(cert, fs.constants.R_OK);
45
+ return fs.readFileSync(cert, 'utf-8');
46
+ }
47
+ // Return the certificate content as-is
48
+ return formatCertificate(cert);
49
+ }
50
+ catch (error) {
51
+ throw new Error(`Failed to read certificate: ${error.message}`);
52
+ }
53
+ }
54
+ function formatCertificate(cert) {
55
+ // Split the content into header, body, and footer
56
+ const matches = cert.match(/^(-----BEGIN[^-]+-----)\s*([A-Za-z0-9+/=\s]+)\s*(-----END[^-]+-----)/);
57
+ if (!matches) {
58
+ throw new Error('Invalid certificate format');
59
+ }
60
+ const [, header, body, footer] = matches;
61
+ // Format the body with proper line breaks (64 characters per line)
62
+ const formattedBody = body
63
+ .replace(/\s+/g, '') // Remove all whitespace
64
+ .match(/.{1,64}/g) // Split into 64-character chunks
65
+ ?.join('\n') || ''; // Join with newlines
66
+ // Reconstruct the properly formatted certificate
67
+ return `${header}\n${formattedBody}\n${footer}`;
68
+ }
69
+ //# sourceMappingURL=resolve-mtls-certificates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-mtls-certificates.js","sourceRoot":"","sources":["../../../src/utils/mtls/resolve-mtls-certificates.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA,0DAQC;AAXD,4CAA8B;AAG9B,SAAgB,uBAAuB,CAAC,mBAAsD,EAAE;IAC9F,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC;IAE3D,OAAO;QACL,UAAU,EAAE,kBAAkB,CAAC,UAAU,CAAC;QAC1C,SAAS,EAAE,kBAAkB,CAAC,SAAS,CAAC;QACxC,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC;KACnC,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAwB;IAClD,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAE5B,IAAI,CAAC;QACH,uDAAuD;QACvD,MAAM,a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":"","sources":["../../src/utils/sort.ts"],"names":[],"mappings":"AAyBA,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAE/C"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sortMethods = sortMethods;
4
+ const methodCompareMap = {
5
+ post: 0,
6
+ put: 1,
7
+ get: 2,
8
+ patch: 3,
9
+ delete: 4,
10
+ head: 5,
11
+ options: 6,
12
+ trace: 7,
13
+ connect: 8,
14
+ query: 9,
15
+ };
16
+ function getKeyWeigh(keyMap, key) {
17
+ const uniqueKeyMap = new Map(Object.entries(keyMap));
18
+ const ketToReturn = uniqueKeyMap.get(key.toLowerCase());
19
+ return ketToReturn ? ketToReturn : -1;
20
+ }
21
+ function sortKeys(a, b, compareMap) {
22
+ const aKeyWeight = getKeyWeigh(compareMap, a);
23
+ const bKeyWeight = getKeyWeigh(compareMap, b);
24
+ return aKeyWeight - bKeyWeight;
25
+ }
26
+ function sortMethods(a, b) {
27
+ return sortKeys(a, b, methodCompareMap);
28
+ }
29
+ //# sourceMappingURL=sort.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sort.js","sourceRoot":"","sources":["../../src/utils/sort.ts"],"names":[],"mappings":";;AAyBA,kCAEC;AA3BD,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,CAAC;IACP,GAAG,EAAE,CAAC;IACN,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,SAAS,WAAW,CAAC,MAA8B,EAAE,GAAW;IAC9D,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACxD,OAAO,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS,EAAE,CAAS,EAAE,UAAkC;IACxE,MAAM,UAAU,GAAG,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC9C,MAAM,UAAU,GAAG,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC9C,OAAO,UAAU,GAAG,UAAU,CAAC;AACjC,CAAC;AAED,SAAgB,WAAW,CAAC,CAAS,EAAE,CAAS;IAC9C,OAAO,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function getExecutionTime(startedAt: number): string;
2
+ //# sourceMappingURL=time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AACA,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,UAIjD"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getExecutionTime = getExecutionTime;
4
+ // Function from @redocly/cli
5
+ function getExecutionTime(startedAt) {
6
+ return process.env.NODE_ENV === 'test'
7
+ ? '<test>ms'
8
+ : `${Math.ceil(performance.now() - startedAt)}ms`;
9
+ }
10
+ //# sourceMappingURL=time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.js","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":";;AACA,4CAIC;AALD,6BAA6B;AAC7B,SAAgB,gBAAgB,CAAC,SAAiB;IAChD,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM;QACpC,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC;AACtD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function combineUrl(host: string, path: string): string;
2
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI7D"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.combineUrl = combineUrl;
4
+ function combineUrl(host, path) {
5
+ const normalizedHost = host.endsWith('/') ? host.slice(0, -1) : host;
6
+ const normalizedPath = path.startsWith('/') ? path.slice(1) : path;
7
+ return `${normalizedHost}/${normalizedPath}`;
8
+ }
9
+ //# sourceMappingURL=url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/utils/url.ts"],"names":[],"mappings":";;AAAA,gCAIC;AAJD,SAAgB,UAAU,CAAC,IAAY,EAAE,IAAY;IACnD,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACrE,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnE,OAAO,GAAG,cAAc,IAAI,cAAc,EAAE,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { LoadOptions, DumpOptions } from 'js-yaml';
2
+ export declare function parseYaml(str: string, opts?: LoadOptions): unknown;
3
+ export declare function stringifyYaml(obj: any, opts?: DumpOptions): string;
4
+ export declare function readYaml(path: string): unknown;
5
+ //# sourceMappingURL=yaml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../../src/utils/yaml.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAOxD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,CAElE;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,CAElE;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9C"}