@noodleseed/one 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (427) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +2 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/author-loop.d.ts +1 -0
  5. package/dist/commands/author-loop.d.ts.map +1 -1
  6. package/dist/commands/author-loop.js +6 -2
  7. package/dist/commands/author-loop.js.map +1 -1
  8. package/dist/commands/catalog-data-core.d.ts.map +1 -1
  9. package/dist/commands/catalog-data-core.js +17 -3
  10. package/dist/commands/catalog-data-core.js.map +1 -1
  11. package/dist/commands/catalog-data-resources.js +2 -2
  12. package/dist/commands/catalog-data-resources.js.map +1 -1
  13. package/dist/commands/catalog-dispatch.d.ts.map +1 -1
  14. package/dist/commands/catalog-dispatch.js +21 -2
  15. package/dist/commands/catalog-dispatch.js.map +1 -1
  16. package/dist/commands/catalog-render.d.ts.map +1 -1
  17. package/dist/commands/catalog-render.js +6 -0
  18. package/dist/commands/catalog-render.js.map +1 -1
  19. package/dist/commands/deploy-ops.d.ts.map +1 -1
  20. package/dist/commands/deploy-ops.js +30 -13
  21. package/dist/commands/deploy-ops.js.map +1 -1
  22. package/dist/commands/deploy-status-ops.d.ts +1 -1
  23. package/dist/commands/deploy-status-ops.d.ts.map +1 -1
  24. package/dist/commands/deploy-status-ops.js +8 -4
  25. package/dist/commands/deploy-status-ops.js.map +1 -1
  26. package/dist/commands/devtools.d.ts +11 -0
  27. package/dist/commands/devtools.d.ts.map +1 -0
  28. package/dist/commands/devtools.js +123 -0
  29. package/dist/commands/devtools.js.map +1 -0
  30. package/dist/commands/mcp-apps.d.ts +0 -1
  31. package/dist/commands/mcp-apps.d.ts.map +1 -1
  32. package/dist/commands/mcp-apps.js +71 -122
  33. package/dist/commands/mcp-apps.js.map +1 -1
  34. package/dist/commands/shared.d.ts +6 -0
  35. package/dist/commands/shared.d.ts.map +1 -1
  36. package/dist/commands/shared.js +19 -0
  37. package/dist/commands/shared.js.map +1 -1
  38. package/dist/deploy.d.ts +1 -1
  39. package/dist/deploy.d.ts.map +1 -1
  40. package/dist/deploy.js +5 -1
  41. package/dist/deploy.js.map +1 -1
  42. package/dist/dev.d.ts.map +1 -1
  43. package/dist/dev.js +13 -1
  44. package/dist/dev.js.map +1 -1
  45. package/dist/fire.js +1 -1
  46. package/dist/fire.js.map +1 -1
  47. package/dist/first-run.d.ts +11 -0
  48. package/dist/first-run.d.ts.map +1 -1
  49. package/dist/first-run.js +19 -4
  50. package/dist/first-run.js.map +1 -1
  51. package/dist/flavor.d.ts +1 -1
  52. package/dist/flavor.d.ts.map +1 -1
  53. package/dist/flavor.js +12 -2
  54. package/dist/flavor.js.map +1 -1
  55. package/dist/project-scaffold-templates.d.ts +11 -0
  56. package/dist/project-scaffold-templates.d.ts.map +1 -0
  57. package/dist/project-scaffold-templates.js +359 -0
  58. package/dist/project-scaffold-templates.js.map +1 -0
  59. package/dist/project.d.ts.map +1 -1
  60. package/dist/project.js +1 -323
  61. package/dist/project.js.map +1 -1
  62. package/dist/react.d.ts +2 -2
  63. package/dist/react.d.ts.map +1 -1
  64. package/dist/react.js +1 -1
  65. package/dist/react.js.map +1 -1
  66. package/dist/validate.d.ts +12 -0
  67. package/dist/validate.d.ts.map +1 -1
  68. package/dist/validate.js +11 -0
  69. package/dist/validate.js.map +1 -1
  70. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +4 -4
  71. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js.map +1 -1
  72. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts.map +1 -1
  73. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +72 -13
  74. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js.map +1 -1
  75. package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.d.ts.map +1 -1
  76. package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js +8 -3
  77. package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js.map +1 -1
  78. package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
  79. package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts +18 -1
  80. package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts.map +1 -1
  81. package/node_modules/@noodle-borg/authoring/dist/connectors.js +17 -4
  82. package/node_modules/@noodle-borg/authoring/dist/connectors.js.map +1 -1
  83. package/node_modules/@noodle-borg/authoring/dist/index.d.ts +3 -3
  84. package/node_modules/@noodle-borg/authoring/dist/index.d.ts.map +1 -1
  85. package/node_modules/@noodle-borg/authoring/dist/index.js +1 -1
  86. package/node_modules/@noodle-borg/authoring/dist/index.js.map +1 -1
  87. package/node_modules/@noodle-borg/authoring/dist/react/components.d.ts +302 -7
  88. package/node_modules/@noodle-borg/authoring/dist/react/components.d.ts.map +1 -1
  89. package/node_modules/@noodle-borg/authoring/dist/react/components.js +39 -7
  90. package/node_modules/@noodle-borg/authoring/dist/react/components.js.map +1 -1
  91. package/node_modules/@noodle-borg/authoring/dist/react/index.d.ts +4 -2
  92. package/node_modules/@noodle-borg/authoring/dist/react/index.d.ts.map +1 -1
  93. package/node_modules/@noodle-borg/authoring/dist/react/index.js +2 -1
  94. package/node_modules/@noodle-borg/authoring/dist/react/index.js.map +1 -1
  95. package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.d.ts +2618 -0
  96. package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.d.ts.map +1 -0
  97. package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.js +110 -0
  98. package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.js.map +1 -0
  99. package/node_modules/@noodle-borg/authoring/dist/react.d.ts +2 -2
  100. package/node_modules/@noodle-borg/authoring/dist/react.d.ts.map +1 -1
  101. package/node_modules/@noodle-borg/authoring/dist/react.js +1 -1
  102. package/node_modules/@noodle-borg/authoring/dist/react.js.map +1 -1
  103. package/node_modules/@noodle-borg/authoring/dist/recording.d.ts +1 -1
  104. package/node_modules/@noodle-borg/authoring/dist/recording.d.ts.map +1 -1
  105. package/node_modules/@noodle-borg/authoring/dist/recording.js +38 -6
  106. package/node_modules/@noodle-borg/authoring/dist/recording.js.map +1 -1
  107. package/node_modules/@noodle-borg/authoring/dist/server.d.ts +25 -2
  108. package/node_modules/@noodle-borg/authoring/dist/server.d.ts.map +1 -1
  109. package/node_modules/@noodle-borg/authoring/dist/server.js +64 -6
  110. package/node_modules/@noodle-borg/authoring/dist/server.js.map +1 -1
  111. package/node_modules/@noodle-borg/compiler/dist/compile.d.ts.map +1 -1
  112. package/node_modules/@noodle-borg/compiler/dist/compile.js +20 -8
  113. package/node_modules/@noodle-borg/compiler/dist/compile.js.map +1 -1
  114. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +2 -0
  115. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts.map +1 -1
  116. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +6 -0
  117. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js.map +1 -1
  118. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.js +1 -1
  119. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.js.map +1 -1
  120. package/node_modules/@noodle-borg/connector-defs/dist/call-graph.d.ts +14 -0
  121. package/node_modules/@noodle-borg/connector-defs/dist/call-graph.d.ts.map +1 -0
  122. package/node_modules/@noodle-borg/connector-defs/dist/call-graph.js +66 -0
  123. package/node_modules/@noodle-borg/connector-defs/dist/call-graph.js.map +1 -0
  124. package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.d.ts +21 -0
  125. package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.d.ts.map +1 -0
  126. package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.js +102 -0
  127. package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.js.map +1 -0
  128. package/node_modules/@noodle-borg/connector-defs/dist/compile.d.ts +19 -4
  129. package/node_modules/@noodle-borg/connector-defs/dist/compile.d.ts.map +1 -1
  130. package/node_modules/@noodle-borg/connector-defs/dist/compile.js +67 -99
  131. package/node_modules/@noodle-borg/connector-defs/dist/compile.js.map +1 -1
  132. package/node_modules/@noodle-borg/connector-defs/dist/index.d.ts +1 -1
  133. package/node_modules/@noodle-borg/connector-defs/dist/index.d.ts.map +1 -1
  134. package/node_modules/@noodle-borg/connector-defs/dist/index.js.map +1 -1
  135. package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts +168 -10
  136. package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts.map +1 -1
  137. package/node_modules/@noodle-borg/connector-defs/dist/schema.js +72 -5
  138. package/node_modules/@noodle-borg/connector-defs/dist/schema.js.map +1 -1
  139. package/node_modules/@noodle-borg/connector-http/dist/http-connector.d.ts +6 -0
  140. package/node_modules/@noodle-borg/connector-http/dist/http-connector.d.ts.map +1 -1
  141. package/node_modules/@noodle-borg/connector-http/dist/http-connector.js +2 -0
  142. package/node_modules/@noodle-borg/connector-http/dist/http-connector.js.map +1 -1
  143. package/node_modules/@noodle-borg/connector-http/package.json +1 -1
  144. package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts.map +1 -1
  145. package/node_modules/@noodle-borg/protocol/dist/mapping.js +8 -0
  146. package/node_modules/@noodle-borg/protocol/dist/mapping.js.map +1 -1
  147. package/node_modules/@noodle-borg/runtime/dist/execute.d.ts.map +1 -1
  148. package/node_modules/@noodle-borg/runtime/dist/execute.js +87 -62
  149. package/node_modules/@noodle-borg/runtime/dist/execute.js.map +1 -1
  150. package/node_modules/@noodle-borg/runtime/dist/result.d.ts +1 -1
  151. package/node_modules/@noodle-borg/runtime/dist/result.d.ts.map +1 -1
  152. package/node_modules/@noodle-borg/service/dist/credential-broker.d.ts.map +1 -1
  153. package/node_modules/@noodle-borg/service/dist/credential-broker.js +113 -11
  154. package/node_modules/@noodle-borg/service/dist/credential-broker.js.map +1 -1
  155. package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts +28 -5
  156. package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts.map +1 -1
  157. package/node_modules/@noodle-borg/service/dist/github/app-client.js +116 -7
  158. package/node_modules/@noodle-borg/service/dist/github/app-client.js.map +1 -1
  159. package/node_modules/@noodle-borg/service/dist/github/builder-auth.d.ts +12 -0
  160. package/node_modules/@noodle-borg/service/dist/github/builder-auth.d.ts.map +1 -0
  161. package/node_modules/@noodle-borg/service/dist/github/builder-auth.js +15 -0
  162. package/node_modules/@noodle-borg/service/dist/github/builder-auth.js.map +1 -0
  163. package/node_modules/@noodle-borg/service/dist/github/builder-main.d.ts +3 -0
  164. package/node_modules/@noodle-borg/service/dist/github/builder-main.d.ts.map +1 -0
  165. package/node_modules/@noodle-borg/service/dist/github/builder-main.js +9 -0
  166. package/node_modules/@noodle-borg/service/dist/github/builder-main.js.map +1 -0
  167. package/node_modules/@noodle-borg/service/dist/github/builder-runner.d.ts +21 -0
  168. package/node_modules/@noodle-borg/service/dist/github/builder-runner.d.ts.map +1 -0
  169. package/node_modules/@noodle-borg/service/dist/github/builder-runner.js +192 -0
  170. package/node_modules/@noodle-borg/service/dist/github/builder-runner.js.map +1 -0
  171. package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.d.ts +45 -0
  172. package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.d.ts.map +1 -0
  173. package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.js +60 -0
  174. package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.js.map +1 -0
  175. package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.d.ts +64 -0
  176. package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.d.ts.map +1 -0
  177. package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.js +121 -0
  178. package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.js.map +1 -0
  179. package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.d.ts +33 -0
  180. package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.d.ts.map +1 -0
  181. package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.js +14 -0
  182. package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.js.map +1 -0
  183. package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.d.ts +36 -0
  184. package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.d.ts.map +1 -0
  185. package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.js +107 -0
  186. package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.js.map +1 -0
  187. package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.d.ts +38 -0
  188. package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.d.ts.map +1 -0
  189. package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.js +60 -0
  190. package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.js.map +1 -0
  191. package/node_modules/@noodle-borg/service/dist/github/local-compile.d.ts +24 -0
  192. package/node_modules/@noodle-borg/service/dist/github/local-compile.d.ts.map +1 -0
  193. package/node_modules/@noodle-borg/service/dist/github/local-compile.js +98 -0
  194. package/node_modules/@noodle-borg/service/dist/github/local-compile.js.map +1 -0
  195. package/node_modules/@noodle-borg/service/dist/github/local-process-executor.d.ts +39 -0
  196. package/node_modules/@noodle-borg/service/dist/github/local-process-executor.d.ts.map +1 -0
  197. package/node_modules/@noodle-borg/service/dist/github/local-process-executor.js +67 -0
  198. package/node_modules/@noodle-borg/service/dist/github/local-process-executor.js.map +1 -0
  199. package/node_modules/@noodle-borg/service/dist/github/run-access-mode.d.ts +18 -0
  200. package/node_modules/@noodle-borg/service/dist/github/run-access-mode.d.ts.map +1 -0
  201. package/node_modules/@noodle-borg/service/dist/github/run-access-mode.js +32 -0
  202. package/node_modules/@noodle-borg/service/dist/github/run-access-mode.js.map +1 -0
  203. package/node_modules/@noodle-borg/service/dist/github/run-token.d.ts +41 -0
  204. package/node_modules/@noodle-borg/service/dist/github/run-token.d.ts.map +1 -0
  205. package/node_modules/@noodle-borg/service/dist/github/run-token.js +59 -0
  206. package/node_modules/@noodle-borg/service/dist/github/run-token.js.map +1 -0
  207. package/node_modules/@noodle-borg/service/dist/http-util.d.ts +7 -1
  208. package/node_modules/@noodle-borg/service/dist/http-util.d.ts.map +1 -1
  209. package/node_modules/@noodle-borg/service/dist/http-util.js +14 -0
  210. package/node_modules/@noodle-borg/service/dist/http-util.js.map +1 -1
  211. package/node_modules/@noodle-borg/service/dist/index.d.ts +13 -2
  212. package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
  213. package/node_modules/@noodle-borg/service/dist/index.js +12 -1
  214. package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
  215. package/node_modules/@noodle-borg/service/dist/main.js +72 -0
  216. package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
  217. package/node_modules/@noodle-borg/service/dist/options.d.ts +26 -3
  218. package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
  219. package/node_modules/@noodle-borg/service/dist/registry-helpers.d.ts +12 -0
  220. package/node_modules/@noodle-borg/service/dist/registry-helpers.d.ts.map +1 -1
  221. package/node_modules/@noodle-borg/service/dist/registry-helpers.js +3 -0
  222. package/node_modules/@noodle-borg/service/dist/registry-helpers.js.map +1 -1
  223. package/node_modules/@noodle-borg/service/dist/registry-types.d.ts +7 -0
  224. package/node_modules/@noodle-borg/service/dist/registry-types.d.ts.map +1 -1
  225. package/node_modules/@noodle-borg/service/dist/registry.d.ts +7 -29
  226. package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
  227. package/node_modules/@noodle-borg/service/dist/registry.js +62 -57
  228. package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
  229. package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.d.ts +3 -2
  230. package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.d.ts.map +1 -1
  231. package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.js +36 -8
  232. package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.js.map +1 -1
  233. package/node_modules/@noodle-borg/service/dist/routes/control-plane.d.ts +3 -2
  234. package/node_modules/@noodle-borg/service/dist/routes/control-plane.d.ts.map +1 -1
  235. package/node_modules/@noodle-borg/service/dist/routes/control-plane.js +100 -12
  236. package/node_modules/@noodle-borg/service/dist/routes/control-plane.js.map +1 -1
  237. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts +7 -0
  238. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts.map +1 -1
  239. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js +36 -1
  240. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js.map +1 -1
  241. package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.d.ts +13 -0
  242. package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.d.ts.map +1 -0
  243. package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.js +84 -0
  244. package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.js.map +1 -0
  245. package/node_modules/@noodle-borg/service/dist/routes/github-run-status.d.ts +5 -0
  246. package/node_modules/@noodle-borg/service/dist/routes/github-run-status.d.ts.map +1 -0
  247. package/node_modules/@noodle-borg/service/dist/routes/github-run-status.js +73 -0
  248. package/node_modules/@noodle-borg/service/dist/routes/github-run-status.js.map +1 -0
  249. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts +23 -1
  250. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts.map +1 -1
  251. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js +41 -0
  252. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js.map +1 -1
  253. package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts +4 -0
  254. package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts.map +1 -1
  255. package/node_modules/@noodle-borg/service/dist/routes/paths.js +10 -0
  256. package/node_modules/@noodle-borg/service/dist/routes/paths.js.map +1 -1
  257. package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.d.ts +85 -0
  258. package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.d.ts.map +1 -0
  259. package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.js +90 -0
  260. package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.js.map +1 -0
  261. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  262. package/node_modules/@noodle-borg/service/dist/serve.js +31 -0
  263. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  264. package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
  265. package/node_modules/@noodle-borg/service/dist/service.js +8 -13
  266. package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
  267. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts +1 -0
  268. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts.map +1 -1
  269. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js +5 -0
  270. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js.map +1 -1
  271. package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts +1 -0
  272. package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts.map +1 -1
  273. package/node_modules/@noodle-borg/service/dist/store/github-connections.js +5 -0
  274. package/node_modules/@noodle-borg/service/dist/store/github-connections.js.map +1 -1
  275. package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.d.ts +120 -0
  276. package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.d.ts.map +1 -0
  277. package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.js +6 -0
  278. package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.js.map +1 -0
  279. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts +6 -1
  280. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts.map +1 -1
  281. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js +18 -1
  282. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js.map +1 -1
  283. package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts +22 -1
  284. package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts.map +1 -1
  285. package/node_modules/@noodle-borg/service/dist/store/github-runs.js +39 -2
  286. package/node_modules/@noodle-borg/service/dist/store/github-runs.js.map +1 -1
  287. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts +13 -1
  288. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts.map +1 -1
  289. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js +115 -1
  290. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js.map +1 -1
  291. package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts +1 -0
  292. package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts.map +1 -1
  293. package/node_modules/@noodle-borg/service/dist/store/postgres-github.js +6 -0
  294. package/node_modules/@noodle-borg/service/dist/store/postgres-github.js.map +1 -1
  295. package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts +15 -1
  296. package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts.map +1 -1
  297. package/node_modules/@noodle-borg/service/dist/store/postgres.js +22 -2
  298. package/node_modules/@noodle-borg/service/dist/store/postgres.js.map +1 -1
  299. package/node_modules/@noodle-borg/service/dist/store.d.ts +22 -99
  300. package/node_modules/@noodle-borg/service/dist/store.d.ts.map +1 -1
  301. package/node_modules/@noodle-borg/service/dist/store.js.map +1 -1
  302. package/node_modules/hono/dist/adapter/aws-lambda/handler.js +15 -21
  303. package/node_modules/hono/dist/adapter/bun/websocket.js +3 -1
  304. package/node_modules/hono/dist/adapter/lambda-edge/handler.js +8 -2
  305. package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +15 -21
  306. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +3 -1
  307. package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +8 -2
  308. package/node_modules/hono/dist/cjs/helper/css/common.js +3 -1
  309. package/node_modules/hono/dist/cjs/helper/css/index.js +9 -1
  310. package/node_modules/hono/dist/cjs/jsx/base.js +8 -14
  311. package/node_modules/hono/dist/cjs/jsx/components.js +41 -21
  312. package/node_modules/hono/dist/cjs/jsx/context.js +131 -5
  313. package/node_modules/hono/dist/cjs/jsx/streaming.js +9 -7
  314. package/node_modules/hono/dist/cjs/middleware/cors/index.js +2 -5
  315. package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +2 -2
  316. package/node_modules/hono/dist/cjs/utils/body.js +12 -4
  317. package/node_modules/hono/dist/cjs/utils/buffer.js +2 -1
  318. package/node_modules/hono/dist/cjs/validator/validator.js +3 -3
  319. package/node_modules/hono/dist/helper/css/common.js +3 -1
  320. package/node_modules/hono/dist/helper/css/index.js +9 -1
  321. package/node_modules/hono/dist/jsx/base.js +15 -15
  322. package/node_modules/hono/dist/jsx/components.js +42 -22
  323. package/node_modules/hono/dist/jsx/context.js +129 -5
  324. package/node_modules/hono/dist/jsx/streaming.js +10 -8
  325. package/node_modules/hono/dist/middleware/cors/index.js +2 -5
  326. package/node_modules/hono/dist/middleware/serve-static/index.js +2 -2
  327. package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +1 -1
  328. package/node_modules/hono/dist/types/jsx/base.d.ts +1 -3
  329. package/node_modules/hono/dist/types/jsx/context.d.ts +39 -0
  330. package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +2 -2
  331. package/node_modules/hono/dist/types/utils/body.d.ts +1 -1
  332. package/node_modules/hono/dist/utils/body.js +12 -4
  333. package/node_modules/hono/dist/utils/buffer.js +2 -1
  334. package/node_modules/hono/dist/validator/validator.js +3 -3
  335. package/node_modules/hono/package.json +9 -10
  336. package/node_modules/tailwindcss/dist/chunk-HMCCH6MG.mjs +1 -0
  337. package/node_modules/tailwindcss/dist/default-theme.mjs +1 -1
  338. package/node_modules/tailwindcss/dist/lib.js +13 -13
  339. package/node_modules/tailwindcss/dist/lib.mjs +18 -18
  340. package/node_modules/tailwindcss/package.json +2 -2
  341. package/node_modules/undici/README.md +3 -2
  342. package/node_modules/undici/docs/docs/api/Agent.md +248 -44
  343. package/node_modules/undici/docs/docs/api/BalancedPool.md +246 -48
  344. package/node_modules/undici/docs/docs/api/CacheStorage.md +171 -13
  345. package/node_modules/undici/docs/docs/api/CacheStore.md +294 -98
  346. package/node_modules/undici/docs/docs/api/Client.md +365 -178
  347. package/node_modules/undici/docs/docs/api/ClientStats.md +80 -14
  348. package/node_modules/undici/docs/docs/api/Connector.md +118 -36
  349. package/node_modules/undici/docs/docs/api/ContentType.md +65 -25
  350. package/node_modules/undici/docs/docs/api/Cookies.md +125 -47
  351. package/node_modules/undici/docs/docs/api/Debug.md +34 -18
  352. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +364 -164
  353. package/node_modules/undici/docs/docs/api/Dispatcher.md +479 -1093
  354. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +101 -87
  355. package/node_modules/undici/docs/docs/api/Errors.md +503 -40
  356. package/node_modules/undici/docs/docs/api/EventSource.md +294 -32
  357. package/node_modules/undici/docs/docs/api/Fetch.md +680 -31
  358. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +78 -98
  359. package/node_modules/undici/docs/docs/api/H2CClient.md +298 -176
  360. package/node_modules/undici/docs/docs/api/Interceptors.md +355 -0
  361. package/node_modules/undici/docs/docs/api/MockAgent.md +314 -322
  362. package/node_modules/undici/docs/docs/api/MockCallHistory.md +272 -98
  363. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +189 -26
  364. package/node_modules/undici/docs/docs/api/MockClient.md +151 -33
  365. package/node_modules/undici/docs/docs/api/MockErrors.md +56 -5
  366. package/node_modules/undici/docs/docs/api/MockPool.md +299 -263
  367. package/node_modules/undici/docs/docs/api/Pool.md +235 -43
  368. package/node_modules/undici/docs/docs/api/PoolStats.md +119 -13
  369. package/node_modules/undici/docs/docs/api/ProxyAgent.md +179 -160
  370. package/node_modules/undici/docs/docs/api/RedirectHandler.md +238 -63
  371. package/node_modules/undici/docs/docs/api/RetryAgent.md +113 -26
  372. package/node_modules/undici/docs/docs/api/RetryHandler.md +161 -77
  373. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +166 -72
  374. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +264 -542
  375. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +162 -186
  376. package/node_modules/undici/docs/docs/api/Util.md +68 -11
  377. package/node_modules/undici/docs/docs/api/WebSocket.md +475 -80
  378. package/node_modules/undici/docs/docs/api/api-lifecycle.md +100 -32
  379. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +2 -0
  380. package/node_modules/undici/docs/docs/best-practices/crawling.md +3 -1
  381. package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +6 -4
  382. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +9 -7
  383. package/node_modules/undici/docs/docs/best-practices/proxy.md +3 -1
  384. package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +10 -8
  385. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +2 -0
  386. package/node_modules/undici/docs/docs/{GettingStarted.md → getting-started.md} +22 -19
  387. package/node_modules/undici/docs/docs/index.md +779 -0
  388. package/node_modules/undici/docs/docs/site.json +125 -0
  389. package/node_modules/undici/docs/docs/type-map.json +79 -0
  390. package/node_modules/undici/lib/api/api-request.js +7 -1
  391. package/node_modules/undici/lib/api/readable.js +47 -2
  392. package/node_modules/undici/lib/core/errors.js +20 -0
  393. package/node_modules/undici/lib/core/request.js +1 -1
  394. package/node_modules/undici/lib/core/util.js +24 -1
  395. package/node_modules/undici/lib/dispatcher/client-h1.js +92 -1
  396. package/node_modules/undici/lib/dispatcher/client-h2.js +322 -118
  397. package/node_modules/undici/lib/dispatcher/client.js +6 -2
  398. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +1 -0
  399. package/node_modules/undici/lib/dispatcher/proxy-agent.js +42 -7
  400. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +4 -2
  401. package/node_modules/undici/lib/handler/redirect-handler.js +1 -0
  402. package/node_modules/undici/lib/handler/retry-handler.js +57 -19
  403. package/node_modules/undici/lib/util/cache.js +8 -2
  404. package/node_modules/undici/lib/web/cookies/parse.js +20 -27
  405. package/node_modules/undici/lib/web/cookies/util.js +1 -1
  406. package/node_modules/undici/lib/web/eventsource/eventsource.js +7 -18
  407. package/node_modules/undici/lib/web/eventsource/util.js +32 -1
  408. package/node_modules/undici/lib/web/fetch/body.js +43 -0
  409. package/node_modules/undici/lib/web/fetch/constants.js +1 -1
  410. package/node_modules/undici/lib/web/fetch/index.js +11 -2
  411. package/node_modules/undici/lib/web/fetch/request.js +1 -0
  412. package/node_modules/undici/lib/web/fetch/util.js +4 -1
  413. package/node_modules/undici/lib/web/websocket/receiver.js +20 -3
  414. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -1
  415. package/node_modules/undici/lib/web/websocket/websocket.js +3 -1
  416. package/node_modules/undici/package.json +1 -1
  417. package/node_modules/undici/types/client.d.ts +6 -1
  418. package/node_modules/undici/types/cookies.d.ts +1 -1
  419. package/node_modules/undici/types/errors.d.ts +10 -0
  420. package/node_modules/undici/types/fetch.d.ts +1 -0
  421. package/node_modules/undici/types/handlers.d.ts +2 -0
  422. package/node_modules/undici/types/proxy-agent.d.ts +7 -0
  423. package/package.json +4 -4
  424. package/react/styles.css +510 -5
  425. package/react/styles.source.css +850 -0
  426. package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +0 -1
  427. package/node_modules/tailwindcss/dist/chunk-XVOTX5KS.mjs +0 -1
@@ -1,40 +1,77 @@
1
- # Class: MockAgent
1
+ # MockAgent
2
2
 
3
- Extends: `undici.Dispatcher`
3
+ <!--introduced_in=v4.0.0-->
4
+ <!--type=module-->
5
+ <!-- source_link=lib/mock/mock-agent.js -->
4
6
 
5
- A mocked Agent class that implements the Agent API. It allows one to intercept HTTP requests made through undici and return mocked responses instead.
7
+ > Stability: 2 - Stable
6
8
 
7
- ## `new MockAgent([options])`
9
+ A `MockAgent` is a {Dispatcher} that intercepts HTTP requests made through
10
+ undici and replies with programmed mock responses instead of contacting the
11
+ network. It is useful for testing code that performs HTTP requests without
12
+ relying on a live server.
8
13
 
9
- Arguments:
14
+ A `MockAgent` does not intercept requests on its own. Mock responses are
15
+ registered on the {MockClient} or {MockPool} instances returned by
16
+ [`mockAgent.get(origin)`][], and requests are routed through them once the
17
+ `MockAgent` is set as the dispatcher (for example through
18
+ [`setGlobalDispatcher()`][] or a per-request `dispatcher` option).
10
19
 
11
- * **options** `MockAgentOptions` (optional) - It extends the `Agent` options.
20
+ ```mjs
21
+ import { MockAgent } from 'undici'
22
+
23
+ const mockAgent = new MockAgent()
24
+ ```
12
25
 
13
- Returns: `MockAgent`
26
+ ## Class: `MockAgent`
14
27
 
15
- ### Parameter: `MockAgentOptions`
28
+ <!-- YAML
29
+ added: v4.0.0
30
+ -->
16
31
 
17
- Extends: [`AgentOptions`](/docs/docs/api/Agent.md#parameter-agentoptions)
32
+ * Extends: {Dispatcher}
18
33
 
19
- * **agent** `Agent` (optional) - Default: `new Agent([options])` - a custom agent encapsulated by the MockAgent.
34
+ Intercepts HTTP requests made through undici and returns mocked responses.
20
35
 
21
- * **ignoreTrailingSlash** `boolean` (optional) - Default: `false` - set the default value for `ignoreTrailingSlash` for interceptors.
36
+ ### `new MockAgent([options])`
22
37
 
23
- * **acceptNonStandardSearchParameters** `boolean` (optional) - Default: `false` - set to `true` if the matcher should also accept non standard search parameters such as multi-value items specified with `[]` (e.g. `param[]=1&param[]=2&param[]=3`) and multi-value items which values are comma separated (e.g. `param=1,2,3`).
38
+ <!-- YAML
39
+ added: v4.0.0
40
+ changes:
41
+ - version: v7.16.0
42
+ pr-url: https://github.com/nodejs/undici/pull/4479
43
+ description: Mock options are always normalized to an object internally.
44
+ -->
24
45
 
25
- ### Example - Basic MockAgent instantiation
46
+ * `options` {MockAgentOptions} (optional)
47
+ * Returns: {MockAgent}
26
48
 
27
- This will instantiate the MockAgent. It will not do anything until registered as the agent to use with requests and mock interceptions are added.
49
+ When instantiated, a `MockAgent` is automatically activated. It does not
50
+ intercept any request until mock interceptors are registered on the dispatchers
51
+ returned by [`mockAgent.get(origin)`][].
28
52
 
29
- ```js
53
+ #### Parameter: `MockAgentOptions`
54
+
55
+ * Extends: {AgentOptions}
56
+ * `agent` {Dispatcher} (optional) A custom agent to be encapsulated by the
57
+ `MockAgent`. It must implement the `Agent` API (that is, expose a `dispatch`
58
+ function). **Default:** a new {Agent} constructed from `options`.
59
+ * `ignoreTrailingSlash` {boolean} (optional) Whether trailing slashes in the
60
+ request path are ignored when matching interceptors. **Default:** `false`.
61
+ * `acceptNonStandardSearchParameters` {boolean} (optional) Whether the matcher
62
+ also accepts URLs using non-standard search-parameter syntaxes, such as
63
+ multi-value items written with `[]` (for example `param[]=1&param[]=2`) or
64
+ comma-separated values (for example `param=1,2,3`). **Default:** `false`.
65
+ * `enableCallHistory` {boolean} (optional) Whether call history recording is
66
+ enabled. See [`mockAgent.getCallHistory()`][]. **Default:** `false`.
67
+
68
+ ```mjs displayName="Basic instantiation"
30
69
  import { MockAgent } from 'undici'
31
70
 
32
71
  const mockAgent = new MockAgent()
33
72
  ```
34
73
 
35
- ### Example - Basic MockAgent instantiation with custom agent
36
-
37
- ```js
74
+ ```mjs displayName="Instantiation with a custom agent"
38
75
  import { Agent, MockAgent } from 'undici'
39
76
 
40
77
  const agent = new Agent()
@@ -42,34 +79,30 @@ const agent = new Agent()
42
79
  const mockAgent = new MockAgent({ agent })
43
80
  ```
44
81
 
45
- ## Instance Methods
82
+ ### `mockAgent.get(origin)`
46
83
 
47
- ### `MockAgent.get(origin)`
84
+ <!-- YAML
85
+ added: v4.0.0
86
+ -->
48
87
 
49
- This method creates and retrieves MockPool or MockClient instances which can then be used to intercept HTTP requests. If the number of connections on the mock agent is set to 1, a MockClient instance is returned. Otherwise a MockPool instance is returned.
88
+ * `origin` {string|RegExp|Function} A matcher for the origin to retrieve. The
89
+ function form has the signature `(origin) => boolean`.
90
+ * Returns: {MockClient|MockPool}
50
91
 
51
- For subsequent `MockAgent.get` calls on the same origin, the same mock instance will be returned.
92
+ Creates and retrieves the mock dispatcher used to intercept requests for the
93
+ given origin. When the `connections` option of the `MockAgent` is `1`, a
94
+ {MockClient} is returned; otherwise a {MockPool} is returned. Subsequent calls
95
+ with the same origin return the same instance.
52
96
 
53
- Arguments:
97
+ The way `origin` is matched against incoming requests depends on its type:
54
98
 
55
- * **origin** `string | RegExp | (value) => boolean` - a matcher for the pool origin to be retrieved from the MockAgent.
99
+ | Matcher type | Condition to pass |
100
+ | :----------: | ---------------------------- |
101
+ | `string` | Exact match against the value |
102
+ | `RegExp` | The regular expression matches |
103
+ | `Function` | The function returns `true` |
56
104
 
57
- | Matcher type | Condition to pass |
58
- |:------------:| -------------------------- |
59
- | `string` | Exact match against string |
60
- | `RegExp` | Regex must pass |
61
- | `Function` | Function must return true |
62
-
63
- Returns: `MockClient | MockPool`.
64
-
65
- | `MockAgentOptions` | Mock instance returned |
66
- | -------------------- | ---------------------- |
67
- | `connections === 1` | `MockClient` |
68
- | `connections` > `1` | `MockPool` |
69
-
70
- #### Example - Basic Mocked Request
71
-
72
- ```js
105
+ ```mjs displayName="Basic mocked request"
73
106
  import { MockAgent, setGlobalDispatcher, request } from 'undici'
74
107
 
75
108
  const mockAgent = new MockAgent()
@@ -87,9 +120,7 @@ for await (const data of body) {
87
120
  }
88
121
  ```
89
122
 
90
- #### Example - Basic Mocked Request with local mock agent dispatcher
91
-
92
- ```js
123
+ ```mjs displayName="Mocked request using a local dispatcher"
93
124
  import { MockAgent, request } from 'undici'
94
125
 
95
126
  const mockAgent = new MockAgent()
@@ -97,32 +128,9 @@ const mockAgent = new MockAgent()
97
128
  const mockPool = mockAgent.get('http://localhost:3000')
98
129
  mockPool.intercept({ path: '/foo' }).reply(200, 'foo')
99
130
 
100
- const {
101
- statusCode,
102
- body
103
- } = await request('http://localhost:3000/foo', { dispatcher: mockAgent })
104
-
105
- console.log('response received', statusCode) // response received 200
106
-
107
- for await (const data of body) {
108
- console.log('data', data.toString('utf8')) // data foo
109
- }
110
- ```
111
-
112
- #### Example - Basic Mocked Request with local mock pool dispatcher
113
-
114
- ```js
115
- import { MockAgent, request } from 'undici'
116
-
117
- const mockAgent = new MockAgent()
118
-
119
- const mockPool = mockAgent.get('http://localhost:3000')
120
- mockPool.intercept({ path: '/foo' }).reply(200, 'foo')
121
-
122
- const {
123
- statusCode,
124
- body
125
- } = await request('http://localhost:3000/foo', { dispatcher: mockPool })
131
+ const { statusCode, body } = await request('http://localhost:3000/foo', {
132
+ dispatcher: mockAgent
133
+ })
126
134
 
127
135
  console.log('response received', statusCode) // response received 200
128
136
 
@@ -131,9 +139,7 @@ for await (const data of body) {
131
139
  }
132
140
  ```
133
141
 
134
- #### Example - Basic Mocked Request with local mock client dispatcher
135
-
136
- ```js
142
+ ```mjs displayName="Returning a MockClient"
137
143
  import { MockAgent, request } from 'undici'
138
144
 
139
145
  const mockAgent = new MockAgent({ connections: 1 })
@@ -141,10 +147,9 @@ const mockAgent = new MockAgent({ connections: 1 })
141
147
  const mockClient = mockAgent.get('http://localhost:3000')
142
148
  mockClient.intercept({ path: '/foo' }).reply(200, 'foo')
143
149
 
144
- const {
145
- statusCode,
146
- body
147
- } = await request('http://localhost:3000/foo', { dispatcher: mockClient })
150
+ const { statusCode, body } = await request('http://localhost:3000/foo', {
151
+ dispatcher: mockClient
152
+ })
148
153
 
149
154
  console.log('response received', statusCode) // response received 200
150
155
 
@@ -153,131 +158,64 @@ for await (const data of body) {
153
158
  }
154
159
  ```
155
160
 
156
- #### Example - Basic Mocked requests with multiple intercepts
157
-
158
- ```js
161
+ ```mjs displayName="Matching the origin with a regular expression"
159
162
  import { MockAgent, setGlobalDispatcher, request } from 'undici'
160
163
 
161
164
  const mockAgent = new MockAgent()
162
165
  setGlobalDispatcher(mockAgent)
163
166
 
164
- const mockPool = mockAgent.get('http://localhost:3000')
167
+ const mockPool = mockAgent.get(new RegExp('http://localhost:3000'))
165
168
  mockPool.intercept({ path: '/foo' }).reply(200, 'foo')
166
- mockPool.intercept({ path: '/hello'}).reply(200, 'hello')
167
-
168
- const result1 = await request('http://localhost:3000/foo')
169
-
170
- console.log('response received', result1.statusCode) // response received 200
171
-
172
- for await (const data of result1.body) {
173
- console.log('data', data.toString('utf8')) // data foo
174
- }
175
169
 
176
- const result2 = await request('http://localhost:3000/hello')
170
+ const { statusCode } = await request('http://localhost:3000/foo')
177
171
 
178
- console.log('response received', result2.statusCode) // response received 200
179
-
180
- for await (const data of result2.body) {
181
- console.log('data', data.toString('utf8')) // data hello
182
- }
183
- ```
184
-
185
- #### Example - Mock different requests within the same file
186
-
187
- ```js
188
- const { MockAgent, setGlobalDispatcher } = require('undici');
189
- const agent = new MockAgent();
190
- agent.disableNetConnect();
191
- setGlobalDispatcher(agent);
192
- describe('Test', () => {
193
- it('200', async () => {
194
- const mockAgent = agent.get('http://test.com');
195
- // your test
196
- });
197
- it('200', async () => {
198
- const mockAgent = agent.get('http://testing.com');
199
- // your test
200
- });
201
- });
172
+ console.log('response received', statusCode) // response received 200
202
173
  ```
203
174
 
204
- #### Example - Mocked request with query body, headers and trailers
205
-
206
- ```js
175
+ ```mjs displayName="Matching the origin with a function"
207
176
  import { MockAgent, setGlobalDispatcher, request } from 'undici'
208
177
 
209
178
  const mockAgent = new MockAgent()
210
179
  setGlobalDispatcher(mockAgent)
211
180
 
212
- const mockPool = mockAgent.get('http://localhost:3000')
213
-
214
- mockPool.intercept({
215
- path: '/foo?hello=there&see=ya',
216
- method: 'POST',
217
- body: 'form1=data1&form2=data2'
218
- }).reply(200, { foo: 'bar' }, {
219
- headers: { 'content-type': 'application/json' },
220
- trailers: { 'Content-MD5': 'test' }
221
- })
181
+ const mockPool = mockAgent.get((origin) => origin === 'http://localhost:3000')
182
+ mockPool.intercept({ path: '/foo' }).reply(200, 'foo')
222
183
 
223
- const {
224
- statusCode,
225
- headers,
226
- trailers,
227
- body
228
- } = await request('http://localhost:3000/foo?hello=there&see=ya', {
229
- method: 'POST',
230
- body: 'form1=data1&form2=data2'
231
- })
184
+ const { statusCode } = await request('http://localhost:3000/foo')
232
185
 
233
186
  console.log('response received', statusCode) // response received 200
234
- console.log('headers', headers) // { 'content-type': 'application/json' }
235
-
236
- for await (const data of body) {
237
- console.log('data', data.toString('utf8')) // '{"foo":"bar"}'
238
- }
239
-
240
- console.log('trailers', trailers) // { 'content-md5': 'test' }
241
187
  ```
242
188
 
243
- #### Example - Mocked request with origin regex
244
-
245
- ```js
246
- import { MockAgent, setGlobalDispatcher, request } from 'undici'
247
-
248
- const mockAgent = new MockAgent()
249
- setGlobalDispatcher(mockAgent)
250
-
251
- const mockPool = mockAgent.get(new RegExp('http://localhost:3000'))
252
- mockPool.intercept({ path: '/foo' }).reply(200, 'foo')
253
-
254
- const {
255
- statusCode,
256
- body
257
- } = await request('http://localhost:3000/foo')
189
+ ### `mockAgent.dispatch(options, handler)`
258
190
 
259
- console.log('response received', statusCode) // response received 200
191
+ <!-- YAML
192
+ added: v4.0.0
193
+ -->
260
194
 
261
- for await (const data of body) {
262
- console.log('data', data.toString('utf8')) // data foo
263
- }
264
- ```
195
+ * `options` {AgentDispatchOptions}
196
+ * `handler` {DispatchHandler}
197
+ * Returns: {boolean}
265
198
 
266
- #### Example - Mocked request with origin function
199
+ Dispatches a mocked request. This implements
200
+ [`Dispatcher.dispatch()`][] for the encapsulated agent: it ensures the mock
201
+ dispatcher for `options.origin` exists, records the call in the call history
202
+ when enabled, and forwards the request to the underlying agent. It is normally
203
+ invoked indirectly through higher-level methods such as
204
+ [`mockAgent.request()`][].
267
205
 
268
- ```js
269
- import { MockAgent, setGlobalDispatcher, request } from 'undici'
206
+ ```mjs displayName="Using mockAgent.request()"
207
+ import { MockAgent } from 'undici'
270
208
 
271
209
  const mockAgent = new MockAgent()
272
- setGlobalDispatcher(mockAgent)
273
210
 
274
- const mockPool = mockAgent.get((origin) => origin === 'http://localhost:3000')
211
+ const mockPool = mockAgent.get('http://localhost:3000')
275
212
  mockPool.intercept({ path: '/foo' }).reply(200, 'foo')
276
213
 
277
- const {
278
- statusCode,
279
- body
280
- } = await request('http://localhost:3000/foo')
214
+ const { statusCode, body } = await mockAgent.request({
215
+ origin: 'http://localhost:3000',
216
+ path: '/foo',
217
+ method: 'GET'
218
+ })
281
219
 
282
220
  console.log('response received', statusCode) // response received 200
283
221
 
@@ -286,15 +224,19 @@ for await (const data of body) {
286
224
  }
287
225
  ```
288
226
 
289
- ### `MockAgent.close()`
227
+ ### `mockAgent.close()`
290
228
 
291
- Closes the mock agent and waits for registered mock pools and clients to also close before resolving.
229
+ <!-- YAML
230
+ added: v4.0.0
231
+ -->
292
232
 
293
- Returns: `Promise<void>`
233
+ * Returns: {Promise<void>} Resolves once the agent and its registered mock pools
234
+ and clients have closed.
294
235
 
295
- #### Example - clean up after tests are complete
236
+ Clears the call history, closes the encapsulated agent, and waits for all
237
+ registered mock pools and clients to close.
296
238
 
297
- ```js
239
+ ```mjs displayName="Clean up after tests"
298
240
  import { MockAgent, setGlobalDispatcher } from 'undici'
299
241
 
300
242
  const mockAgent = new MockAgent()
@@ -303,49 +245,18 @@ setGlobalDispatcher(mockAgent)
303
245
  await mockAgent.close()
304
246
  ```
305
247
 
306
- ### `MockAgent.dispatch(options, handlers)`
307
-
308
- Implements [`Agent.dispatch(options, handlers)`](/docs/docs/api/Agent.md#parameter-agentdispatchoptions).
309
-
310
- ### `MockAgent.request(options[, callback])`
311
-
312
- See [`Dispatcher.request(options [, callback])`](/docs/docs/api/Dispatcher.md#dispatcherrequestoptions-callback).
313
-
314
- #### Example - MockAgent request
315
-
316
- ```js
317
- import { MockAgent } from 'undici'
318
-
319
- const mockAgent = new MockAgent()
320
-
321
- const mockPool = mockAgent.get('http://localhost:3000')
322
- mockPool.intercept({ path: '/foo' }).reply(200, 'foo')
323
-
324
- const {
325
- statusCode,
326
- body
327
- } = await mockAgent.request({
328
- origin: 'http://localhost:3000',
329
- path: '/foo',
330
- method: 'GET'
331
- })
332
-
333
- console.log('response received', statusCode) // response received 200
334
-
335
- for await (const data of body) {
336
- console.log('data', data.toString('utf8')) // data foo
337
- }
338
- ```
339
-
340
- ### `MockAgent.deactivate()`
248
+ ### `mockAgent.deactivate()`
341
249
 
342
- This method disables mocking in MockAgent.
250
+ <!-- YAML
251
+ added: v4.0.0
252
+ -->
343
253
 
344
- Returns: `void`
254
+ * Returns: {undefined}
345
255
 
346
- #### Example - Deactivate Mocking
256
+ Disables mocking on the `MockAgent`. While deactivated, requests are no longer
257
+ intercepted.
347
258
 
348
- ```js
259
+ ```mjs displayName="Deactivate mocking"
349
260
  import { MockAgent, setGlobalDispatcher } from 'undici'
350
261
 
351
262
  const mockAgent = new MockAgent()
@@ -354,15 +265,19 @@ setGlobalDispatcher(mockAgent)
354
265
  mockAgent.deactivate()
355
266
  ```
356
267
 
357
- ### `MockAgent.activate()`
268
+ ### `mockAgent.activate()`
358
269
 
359
- This method enables mocking in a MockAgent instance. When instantiated, a MockAgent is automatically activated. Therefore, this method is only effective after `MockAgent.deactivate` has been called.
270
+ <!-- YAML
271
+ added: v4.0.0
272
+ -->
360
273
 
361
- Returns: `void`
274
+ * Returns: {undefined}
362
275
 
363
- #### Example - Activate Mocking
276
+ Enables mocking on the `MockAgent`. A `MockAgent` is activated automatically
277
+ when instantiated, so this method is only required after
278
+ [`mockAgent.deactivate()`][] has been called.
364
279
 
365
- ```js
280
+ ```mjs displayName="Re-activate mocking"
366
281
  import { MockAgent, setGlobalDispatcher } from 'undici'
367
282
 
368
283
  const mockAgent = new MockAgent()
@@ -375,21 +290,23 @@ mockAgent.deactivate()
375
290
  mockAgent.activate()
376
291
  ```
377
292
 
378
- ### `MockAgent.enableNetConnect([host])`
293
+ ### `mockAgent.enableNetConnect([matcher])`
379
294
 
380
- When requests are not matched in a MockAgent intercept, a real HTTP request is attempted. We can control this further through the use of `enableNetConnect`. This is achieved by defining host matchers so only matching requests will be attempted.
295
+ <!-- YAML
296
+ added: v4.0.0
297
+ -->
381
298
 
382
- When using a string, it should only include the **hostname and optionally, the port**. In addition, calling this method multiple times with a string will allow all HTTP requests that match these values.
299
+ * `matcher` {string|RegExp|Function} (optional) A host matcher. When a string is
300
+ used it should only contain the hostname and, optionally, the port. The
301
+ function form has the signature `(host) => boolean`. When omitted, all
302
+ non-matching requests are allowed to perform a real request.
303
+ * Returns: {undefined}
383
304
 
384
- Arguments:
305
+ Defines host matchers so that requests that are not intercepted by a mock
306
+ dispatcher are allowed to perform a real HTTP request. Calling this method
307
+ multiple times with a string appends each value to the list of allowed hosts.
385
308
 
386
- * **host** `string | RegExp | (value) => boolean` - (optional)
387
-
388
- Returns: `void`
389
-
390
- #### Example - Allow all non-matching urls to be dispatched in a real HTTP request
391
-
392
- ```js
309
+ ```mjs displayName="Allow all non-matching requests"
393
310
  import { MockAgent, setGlobalDispatcher, request } from 'undici'
394
311
 
395
312
  const mockAgent = new MockAgent()
@@ -401,9 +318,7 @@ await request('http://example.com')
401
318
  // A real request is made
402
319
  ```
403
320
 
404
- #### Example - Allow requests matching a host string to make real requests
405
-
406
- ```js
321
+ ```mjs displayName="Allow requests matching specific hosts"
407
322
  import { MockAgent, setGlobalDispatcher, request } from 'undici'
408
323
 
409
324
  const mockAgent = new MockAgent()
@@ -422,75 +337,167 @@ await request('http://example-3.com')
422
337
  // Will throw
423
338
  ```
424
339
 
425
- #### Example - Allow requests matching a host regex to make real requests
426
-
427
- ```js
340
+ ```mjs displayName="Allow requests matching a regular expression or function"
428
341
  import { MockAgent, setGlobalDispatcher, request } from 'undici'
429
342
 
430
343
  const mockAgent = new MockAgent()
431
344
  setGlobalDispatcher(mockAgent)
432
345
 
433
346
  mockAgent.enableNetConnect(new RegExp('example.com'))
347
+ mockAgent.enableNetConnect((host) => host === 'example.org')
434
348
 
435
349
  await request('http://example.com')
436
350
  // A real request is made
437
351
  ```
438
352
 
439
- #### Example - Allow requests matching a host function to make real requests
353
+ ### `mockAgent.disableNetConnect()`
440
354
 
441
- ```js
442
- import { MockAgent, setGlobalDispatcher, request } from 'undici'
355
+ <!-- YAML
356
+ added: v4.0.0
357
+ -->
358
+
359
+ * Returns: {undefined}
360
+
361
+ Causes every request that is not matched by a mock interceptor to throw,
362
+ disallowing real HTTP requests.
363
+
364
+ ```mjs displayName="Throw on every non-matching request"
365
+ import { MockAgent, request } from 'undici'
443
366
 
444
367
  const mockAgent = new MockAgent()
445
- setGlobalDispatcher(mockAgent)
446
368
 
447
- mockAgent.enableNetConnect((value) => value === 'example.com')
369
+ mockAgent.disableNetConnect()
448
370
 
449
371
  await request('http://example.com')
450
- // A real request is made
372
+ // Will throw
451
373
  ```
452
374
 
453
- ### `MockAgent.disableNetConnect()`
375
+ ### `mockAgent.enableCallHistory()`
454
376
 
455
- This method causes all requests to throw when requests are not matched in a MockAgent intercept.
377
+ <!-- YAML
378
+ added: v7.5.0
379
+ -->
456
380
 
457
- Returns: `void`
381
+ * Returns: {MockAgent} The same `MockAgent` instance, for chaining.
458
382
 
459
- #### Example - Disable all non-matching requests by throwing an error for each
383
+ Enables call history recording. Once enabled, subsequent calls are registered
384
+ and can be retrieved through [`mockAgent.getCallHistory()`][]. Call history can
385
+ also be enabled at construction time with the `enableCallHistory` option.
460
386
 
461
- ```js
462
- import { MockAgent, request } from 'undici'
387
+ ```mjs
388
+ import { MockAgent } from 'undici'
463
389
 
464
390
  const mockAgent = new MockAgent()
465
391
 
466
- mockAgent.disableNetConnect()
392
+ mockAgent.enableCallHistory()
393
+ ```
467
394
 
468
- await request('http://example.com')
469
- // Will throw
395
+ ### `mockAgent.disableCallHistory()`
396
+
397
+ <!-- YAML
398
+ added: v7.5.0
399
+ -->
400
+
401
+ * Returns: {MockAgent} The same `MockAgent` instance, for chaining.
402
+
403
+ Disables call history recording. Subsequent calls are no longer registered.
404
+
405
+ ```mjs
406
+ import { MockAgent } from 'undici'
407
+
408
+ const mockAgent = new MockAgent({ enableCallHistory: true })
409
+
410
+ mockAgent.disableCallHistory()
470
411
  ```
471
412
 
472
- ### `MockAgent.pendingInterceptors()`
413
+ ### `mockAgent.getCallHistory()`
414
+
415
+ <!-- YAML
416
+ added: v7.5.0
417
+ -->
418
+
419
+ * Returns: {MockCallHistory|undefined} The {MockCallHistory} instance, or
420
+ `undefined` when call history is not enabled.
473
421
 
474
- This method returns any pending interceptors registered on a mock agent. A pending interceptor meets one of the following criteria:
422
+ Returns the call history instance, which records every request made through the
423
+ `MockAgent` (whether intercepted or not). Call history is not enabled by
424
+ default; enable it with the `enableCallHistory` option or
425
+ [`mockAgent.enableCallHistory()`][].
475
426
 
476
- - Is registered with neither `.times(<number>)` nor `.persist()`, and has not been invoked;
477
- - Is persistent (i.e., registered with `.persist()`) and has not been invoked;
478
- - Is registered with `.times(<number>)` and has not been invoked `<number>` of times.
427
+ ```mjs displayName="Inspect recorded calls"
428
+ import { MockAgent, setGlobalDispatcher, request } from 'undici'
429
+
430
+ const mockAgent = new MockAgent({ enableCallHistory: true })
431
+ setGlobalDispatcher(mockAgent)
432
+
433
+ await request('http://example.com', { query: { item: 1 } })
434
+
435
+ mockAgent.getCallHistory()?.firstCall()
436
+ // Returns
437
+ // MockCallHistoryLog {
438
+ // body: undefined,
439
+ // headers: undefined,
440
+ // method: 'GET',
441
+ // origin: 'http://example.com',
442
+ // fullUrl: 'http://example.com/?item=1',
443
+ // path: '/',
444
+ // searchParams: { item: '1' },
445
+ // protocol: 'http:',
446
+ // host: 'example.com',
447
+ // port: ''
448
+ // }
449
+ ```
479
450
 
480
- Returns: `PendingInterceptor[]` (where `PendingInterceptor` is a `MockDispatch` with an additional `origin: string`)
451
+ ### `mockAgent.clearCallHistory()`
481
452
 
482
- #### Example - List all pending interceptors
453
+ <!-- YAML
454
+ added: v7.5.0
455
+ -->
483
456
 
484
- ```js
485
- const agent = new MockAgent()
486
- agent.disableNetConnect()
457
+ * Returns: {undefined}
487
458
 
488
- agent
459
+ Clears the call history, deleting every recorded {MockCallHistoryLog} on the
460
+ {MockCallHistory} instance. It is a no-op when call history has never been
461
+ enabled.
462
+
463
+ ```mjs
464
+ import { MockAgent } from 'undici'
465
+
466
+ const mockAgent = new MockAgent({ enableCallHistory: true })
467
+
468
+ mockAgent.clearCallHistory()
469
+ ```
470
+
471
+ ### `mockAgent.pendingInterceptors()`
472
+
473
+ <!-- YAML
474
+ added: v5.1.0
475
+ -->
476
+
477
+ * Returns: {PendingInterceptor[]} A `PendingInterceptor` is a `MockDispatch`
478
+ with an additional `origin` {string} property.
479
+
480
+ Returns the interceptors registered on the `MockAgent` that are still pending.
481
+ An interceptor is pending when it meets one of the following criteria:
482
+
483
+ * It is registered with neither `.times(<number>)` nor `.persist()` and has not
484
+ been invoked.
485
+ * It is persistent (registered with `.persist()`) and has not been invoked.
486
+ * It is registered with `.times(<number>)` and has not been invoked `<number>`
487
+ times.
488
+
489
+ ```mjs displayName="List pending interceptors"
490
+ import { MockAgent } from 'undici'
491
+
492
+ const mockAgent = new MockAgent()
493
+ mockAgent.disableNetConnect()
494
+
495
+ mockAgent
489
496
  .get('https://example.com')
490
497
  .intercept({ method: 'GET', path: '/' })
491
498
  .reply(200)
492
499
 
493
- const pendingInterceptors = agent.pendingInterceptors()
500
+ const pendingInterceptors = mockAgent.pendingInterceptors()
494
501
  // Returns [
495
502
  // {
496
503
  // timesInvoked: 0,
@@ -514,26 +521,35 @@ const pendingInterceptors = agent.pendingInterceptors()
514
521
  // ]
515
522
  ```
516
523
 
517
- ### `MockAgent.assertNoPendingInterceptors([options])`
524
+ ### `mockAgent.assertNoPendingInterceptors([options])`
525
+
526
+ <!-- YAML
527
+ added: v5.1.0
528
+ -->
518
529
 
519
- This method throws if the mock agent has any pending interceptors. A pending interceptor meets one of the following criteria:
530
+ * `options` {Object} (optional)
531
+ * `pendingInterceptorsFormatter` {Object} An object exposing a
532
+ `format(pendingInterceptors)` method used to render the pending interceptors
533
+ in the thrown error message. **Default:** a built-in formatter that prints a
534
+ table.
535
+ * Returns: {undefined}
520
536
 
521
- - Is registered with neither `.times(<number>)` nor `.persist()`, and has not been invoked;
522
- - Is persistent (i.e., registered with `.persist()`) and has not been invoked;
523
- - Is registered with `.times(<number>)` and has not been invoked `<number>` of times.
537
+ Throws an {UndiciError} when the `MockAgent` has any pending interceptors. The
538
+ criteria for an interceptor being pending are the same as for
539
+ [`mockAgent.pendingInterceptors()`][].
524
540
 
525
- #### Example - Check that there are no pending interceptors
541
+ ```mjs displayName="Assert there are no pending interceptors"
542
+ import { MockAgent } from 'undici'
526
543
 
527
- ```js
528
- const agent = new MockAgent()
529
- agent.disableNetConnect()
544
+ const mockAgent = new MockAgent()
545
+ mockAgent.disableNetConnect()
530
546
 
531
- agent
547
+ mockAgent
532
548
  .get('https://example.com')
533
549
  .intercept({ method: 'GET', path: '/' })
534
550
  .reply(200)
535
551
 
536
- agent.assertNoPendingInterceptors()
552
+ mockAgent.assertNoPendingInterceptors()
537
553
  // Throws an UndiciError with the following message:
538
554
  //
539
555
  // 1 interceptor is pending:
@@ -545,59 +561,35 @@ agent.assertNoPendingInterceptors()
545
561
  // └─────────┴────────┴───────────────────────┴──────┴─────────────┴────────────┴─────────────┴───────────┘
546
562
  ```
547
563
 
548
- #### Example - access call history on MockAgent
549
-
550
- You can register every call made within a MockAgent to be able to retrieve the body, headers and so on.
551
-
552
- This is not enabled by default.
553
-
554
- ```js
555
- import { MockAgent, setGlobalDispatcher, request } from 'undici'
564
+ ### `mockAgent.isMockActive`
556
565
 
557
- const mockAgent = new MockAgent({ enableCallHistory: true })
558
- setGlobalDispatcher(mockAgent)
566
+ <!-- YAML
567
+ added: v5.3.0
568
+ -->
559
569
 
560
- await request('http://example.com', { query: { item: 1 }})
570
+ * Type: {boolean} `true` while mocking is active, `false` after
571
+ [`mockAgent.deactivate()`][] has been called.
561
572
 
562
- mockAgent.getCallHistory()?.firstCall()
563
- // Returns
564
- // MockCallHistoryLog {
565
- // body: undefined,
566
- // headers: undefined,
567
- // method: 'GET',
568
- // origin: 'http://example.com',
569
- // fullUrl: 'http://example.com/?item=1',
570
- // path: '/',
571
- // searchParams: { item: '1' },
572
- // protocol: 'http:',
573
- // host: 'example.com',
574
- // port: ''
575
- // }
576
- ```
573
+ A read-only property indicating whether mocking is currently active on the
574
+ `MockAgent`.
577
575
 
578
- #### Example - clear call history
576
+ ```mjs
577
+ import { MockAgent } from 'undici'
579
578
 
580
- ```js
581
579
  const mockAgent = new MockAgent()
582
580
 
583
- mockAgent.clearCallHistory()
584
- ```
585
-
586
- #### Example - call history instance class method
581
+ console.log(mockAgent.isMockActive) // true
587
582
 
588
- ```js
589
- const mockAgent = new MockAgent()
583
+ mockAgent.deactivate()
590
584
 
591
- const mockAgentHistory = mockAgent.getCallHistory()
592
-
593
- mockAgentHistory?.calls() // returns an array of MockCallHistoryLogs
594
- mockAgentHistory?.firstCall() // returns the first MockCallHistoryLogs or undefined
595
- mockAgentHistory?.lastCall() // returns the last MockCallHistoryLogs or undefined
596
- mockAgentHistory?.nthCall(3) // returns the third MockCallHistoryLogs or undefined
597
- mockAgentHistory?.filterCalls({ path: '/endpoint', hash: '#hash-value' }) // returns an Array of MockCallHistoryLogs WHERE path === /endpoint OR hash === #hash-value
598
- mockAgentHistory?.filterCalls({ path: '/endpoint', hash: '#hash-value' }, { operator: 'AND' }) // returns an Array of MockCallHistoryLogs WHERE path === /endpoint AND hash === #hash-value
599
- mockAgentHistory?.filterCalls(/"data": "{}"/) // returns an Array of MockCallHistoryLogs where any value match regexp
600
- mockAgentHistory?.filterCalls('application/json') // returns an Array of MockCallHistoryLogs where any value === 'application/json'
601
- mockAgentHistory?.filterCalls((log) => log.path === '/endpoint') // returns an Array of MockCallHistoryLogs when given function returns true
602
- mockAgentHistory?.clear() // clear the history
585
+ console.log(mockAgent.isMockActive) // false
603
586
  ```
587
+
588
+ [`Dispatcher.dispatch()`]: Dispatcher.md#dispatcherdispatchoptions-handler
589
+ [`mockAgent.deactivate()`]: #mockagentdeactivate
590
+ [`mockAgent.enableCallHistory()`]: #mockagentenablecallhistory
591
+ [`mockAgent.get(origin)`]: #mockagentgetorigin
592
+ [`mockAgent.getCallHistory()`]: #mockagentgetcallhistory
593
+ [`mockAgent.pendingInterceptors()`]: #mockagentpendinginterceptors
594
+ [`mockAgent.request()`]: Dispatcher.md#dispatcherrequestoptions-callback
595
+ [`setGlobalDispatcher()`]: Dispatcher.md#setglobaldispatcherdispatcher