zudoku 0.0.0-fix-firebase-export.f8270825 → 0.0.0-fix-warnings.z053d4e27

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 (424) hide show
  1. package/dist/app/main.d.ts +6 -6
  2. package/dist/cli/common/version-check.js +12 -3
  3. package/dist/cli/common/version-check.js.map +1 -1
  4. package/dist/config/loader.js +3 -1
  5. package/dist/config/loader.js.map +1 -1
  6. package/dist/config/validators/InputNavigationSchema.d.ts +121 -119
  7. package/dist/config/validators/InputNavigationSchema.js +1 -0
  8. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  9. package/dist/config/validators/NavigationSchema.js +6 -1
  10. package/dist/config/validators/NavigationSchema.js.map +1 -1
  11. package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
  12. package/dist/config/validators/validate.d.ts +60 -13
  13. package/dist/config/validators/validate.js +7 -4
  14. package/dist/config/validators/validate.js.map +1 -1
  15. package/dist/flat-config.d.ts +28 -26
  16. package/dist/index.d.ts +2 -1
  17. package/dist/index.js +2 -1
  18. package/dist/index.js.map +1 -1
  19. package/dist/lib/auth/issuer.js +1 -1
  20. package/dist/lib/auth/issuer.js.map +1 -1
  21. package/dist/lib/authentication/authentication.d.ts +3 -2
  22. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  23. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  24. package/dist/lib/authentication/components/SignIn.js +4 -2
  25. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  26. package/dist/lib/authentication/components/SignUp.js +4 -2
  27. package/dist/lib/authentication/components/SignUp.js.map +1 -1
  28. package/dist/lib/authentication/hook.d.ts +2 -0
  29. package/dist/lib/authentication/hook.js +10 -0
  30. package/dist/lib/authentication/hook.js.map +1 -1
  31. package/dist/lib/authentication/providers/auth0.js +11 -7
  32. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  33. package/dist/lib/authentication/providers/clerk.js +0 -22
  34. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  35. package/dist/lib/authentication/providers/firebase.js +67 -9
  36. package/dist/lib/authentication/providers/firebase.js.map +1 -1
  37. package/dist/lib/authentication/providers/supabase.js +6 -15
  38. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  39. package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
  40. package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
  41. package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
  42. package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +7 -2
  43. package/dist/lib/authentication/ui/ZudokuAuthUi.js +43 -11
  44. package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -1
  45. package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
  46. package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
  47. package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
  48. package/dist/lib/components/Heading.d.ts +1 -1
  49. package/dist/lib/components/Pagination.js +2 -2
  50. package/dist/lib/components/Pagination.js.map +1 -1
  51. package/dist/lib/components/index.d.ts +18 -69
  52. package/dist/lib/components/index.js +19 -32
  53. package/dist/lib/components/index.js.map +1 -1
  54. package/dist/lib/components/navigation/NavigationItem.js +2 -2
  55. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  56. package/dist/lib/core/RouteGuard.js +12 -7
  57. package/dist/lib/core/RouteGuard.js.map +1 -1
  58. package/dist/lib/core/plugins.d.ts +11 -1
  59. package/dist/lib/core/plugins.js +1 -0
  60. package/dist/lib/core/plugins.js.map +1 -1
  61. package/dist/lib/core/react-query.d.ts +1 -0
  62. package/dist/lib/core/react-query.js +2 -0
  63. package/dist/lib/core/react-query.js.map +1 -0
  64. package/dist/lib/core/transform-config.d.ts +2 -0
  65. package/dist/lib/core/transform-config.js +22 -0
  66. package/dist/lib/core/transform-config.js.map +1 -0
  67. package/dist/lib/errors/ErrorMessage.d.ts +3 -0
  68. package/dist/lib/errors/ErrorMessage.js +16 -0
  69. package/dist/lib/errors/ErrorMessage.js.map +1 -0
  70. package/dist/lib/hooks/index.d.ts +7 -28
  71. package/dist/lib/hooks/index.js +7 -15
  72. package/dist/lib/hooks/index.js.map +1 -1
  73. package/dist/lib/oas/graphql/circular.d.ts +2 -0
  74. package/dist/lib/oas/graphql/circular.js +32 -10
  75. package/dist/lib/oas/graphql/circular.js.map +1 -1
  76. package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
  77. package/dist/lib/oas/graphql/circular.test.js +152 -0
  78. package/dist/lib/oas/graphql/circular.test.js.map +1 -0
  79. package/dist/lib/oas/graphql/index.js +7 -3
  80. package/dist/lib/oas/graphql/index.js.map +1 -1
  81. package/dist/lib/oas/parser/index.js +14 -5
  82. package/dist/lib/oas/parser/index.js.map +1 -1
  83. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
  84. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  85. package/dist/lib/plugins/api-keys/index.d.ts +11 -4
  86. package/dist/lib/plugins/api-keys/index.js +36 -22
  87. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  88. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
  89. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
  90. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
  91. package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
  92. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +33 -0
  93. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
  94. package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
  95. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
  96. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
  97. package/dist/lib/plugins/openapi/OasProvider.js +6 -2
  98. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
  99. package/dist/lib/plugins/openapi/OperationList.js +4 -4
  100. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  101. package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
  102. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
  103. package/dist/lib/plugins/openapi/Sidecar.js +3 -2
  104. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  105. package/dist/lib/plugins/openapi/interfaces.d.ts +3 -0
  106. package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
  107. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  108. package/dist/lib/plugins/openapi/schema/utils.js +11 -3
  109. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  110. package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
  111. package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
  112. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +3 -0
  113. package/dist/lib/plugins/openapi/util/getRoutes.js +2 -1
  114. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  115. package/dist/lib/ui/Button.js +1 -1
  116. package/dist/lib/ui/Button.js.map +1 -1
  117. package/dist/lib/ui/Command.d.ts +3 -3
  118. package/dist/lib/util/flattenAllOf.d.ts +0 -2
  119. package/dist/lib/util/flattenAllOf.js +0 -46
  120. package/dist/lib/util/flattenAllOf.js.map +1 -1
  121. package/dist/lib/util/flattenAllOf.test.js +2 -1
  122. package/dist/lib/util/flattenAllOf.test.js.map +1 -1
  123. package/dist/lib/util/flattenAllOfProcessor.d.ts +2 -0
  124. package/dist/lib/util/flattenAllOfProcessor.js +48 -0
  125. package/dist/lib/util/flattenAllOfProcessor.js.map +1 -0
  126. package/dist/lib/util/invariant.d.ts +1 -1
  127. package/dist/lib/util/invariant.js +2 -2
  128. package/dist/lib/util/invariant.js.map +1 -1
  129. package/dist/lib/util/readFrontmatter.js +2 -1
  130. package/dist/lib/util/readFrontmatter.js.map +1 -1
  131. package/dist/vite/api/SchemaManager.d.ts +12 -1
  132. package/dist/vite/api/SchemaManager.js +32 -15
  133. package/dist/vite/api/SchemaManager.js.map +1 -1
  134. package/dist/vite/api/SchemaManager.test.js +45 -1
  135. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  136. package/dist/vite/build.js +91 -73
  137. package/dist/vite/build.js.map +1 -1
  138. package/dist/vite/config.js +10 -4
  139. package/dist/vite/config.js.map +1 -1
  140. package/dist/vite/error-handler.js +1 -5
  141. package/dist/vite/error-handler.js.map +1 -1
  142. package/dist/vite/mdx/remark-inject-filepath.js +5 -1
  143. package/dist/vite/mdx/remark-inject-filepath.js.map +1 -1
  144. package/dist/vite/mdx/remark-link-rewrite.js +4 -3
  145. package/dist/vite/mdx/remark-link-rewrite.js.map +1 -1
  146. package/dist/vite/plugin-api-keys.js +5 -1
  147. package/dist/vite/plugin-api-keys.js.map +1 -1
  148. package/dist/vite/plugin-api.js +5 -3
  149. package/dist/vite/plugin-api.js.map +1 -1
  150. package/dist/vite/plugin-docs.js +9 -7
  151. package/dist/vite/plugin-docs.js.map +1 -1
  152. package/dist/vite/plugin-markdown-export.js +5 -3
  153. package/dist/vite/plugin-markdown-export.js.map +1 -1
  154. package/dist/vite/prerender/utils.js +9 -3
  155. package/dist/vite/prerender/utils.js.map +1 -1
  156. package/dist/vite/prerender/worker.js +3 -0
  157. package/dist/vite/prerender/worker.js.map +1 -1
  158. package/dist/vite/zuplo.d.ts +13 -0
  159. package/dist/vite/zuplo.js +15 -0
  160. package/dist/vite/zuplo.js.map +1 -0
  161. package/lib/{ActionButton-DUgvSylL.js → ActionButton-B0CXL1Lq.js} +3 -3
  162. package/lib/{ActionButton-DUgvSylL.js.map → ActionButton-B0CXL1Lq.js.map} +1 -1
  163. package/lib/{Button-CynVW1JV.js → Button-GUVe7pmt.js} +8 -7
  164. package/lib/{Button-CynVW1JV.js.map → Button-GUVe7pmt.js.map} +1 -1
  165. package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
  166. package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
  167. package/lib/{ClaudeLogo-B4Xxt-x_.js → ClaudeLogo-C6q-Xn_l.js} +21 -17
  168. package/lib/ClaudeLogo-C6q-Xn_l.js.map +1 -0
  169. package/lib/{Command-BpT1iBE6.js → Command-N6VujV30.js} +3 -3
  170. package/lib/{Command-BpT1iBE6.js.map → Command-N6VujV30.js.map} +1 -1
  171. package/lib/{Dialog-BQciPiHN.js → Dialog-hlvmmQ_c.js} +2 -2
  172. package/lib/{Dialog-BQciPiHN.js.map → Dialog-hlvmmQ_c.js.map} +1 -1
  173. package/lib/{Drawer-Ci7XwhqT.js → Drawer-Ch7927PF.js} +7 -7
  174. package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-Ch7927PF.js.map} +1 -1
  175. package/lib/{DropdownMenu-C8SX_-S_.js → DropdownMenu-DN0jNrjj.js} +2 -2
  176. package/lib/{DropdownMenu-C8SX_-S_.js.map → DropdownMenu-DN0jNrjj.js.map} +1 -1
  177. package/lib/Frame-DKlOmSkU.js +205 -0
  178. package/lib/Frame-DKlOmSkU.js.map +1 -0
  179. package/lib/HydrationBoundary-CNF2ZV3E.js +601 -0
  180. package/lib/HydrationBoundary-CNF2ZV3E.js.map +1 -0
  181. package/lib/{IndexingDialog-B5zCiUKr.js → IndexingDialog-D0YdGfbn.js} +3 -3
  182. package/lib/{IndexingDialog-B5zCiUKr.js.map → IndexingDialog-D0YdGfbn.js.map} +1 -1
  183. package/lib/Input-Cx-GeKoF.js +22 -0
  184. package/lib/Input-Cx-GeKoF.js.map +1 -0
  185. package/lib/{MdxPage-BagO2c-n.js → MdxPage-B1G4W1TK.js} +11 -11
  186. package/lib/{MdxPage-BagO2c-n.js.map → MdxPage-B1G4W1TK.js.map} +1 -1
  187. package/lib/{Mermaid-D_VSX7_Q.js → Mermaid-B1xNo-pf.js} +5 -4
  188. package/lib/{Mermaid-D_VSX7_Q.js.map → Mermaid-B1xNo-pf.js.map} +1 -1
  189. package/lib/{OAuthErrorPage-Fq54RLgt.js → OAuthErrorPage-01Ke086W.js} +25 -23
  190. package/lib/OAuthErrorPage-01Ke086W.js.map +1 -0
  191. package/lib/OasProvider-BG-FWDIq.js +48 -0
  192. package/lib/OasProvider-BG-FWDIq.js.map +1 -0
  193. package/lib/{OperationList-C0jiEaG5.js → OperationList-GGkJ1vac.js} +1983 -1965
  194. package/lib/OperationList-GGkJ1vac.js.map +1 -0
  195. package/lib/RouteGuard-B1lCR0C_.js +77 -0
  196. package/lib/RouteGuard-B1lCR0C_.js.map +1 -0
  197. package/lib/{SchemaList-BU0zCHn9.js → SchemaList-CNVdC9f-.js} +9 -9
  198. package/lib/{SchemaList-BU0zCHn9.js.map → SchemaList-CNVdC9f-.js.map} +1 -1
  199. package/lib/SchemaView-CrV0yIwR.js +438 -0
  200. package/lib/SchemaView-CrV0yIwR.js.map +1 -0
  201. package/lib/{Select-CkxXP5I7.js → Secret-BDBqq4p3.js} +122 -122
  202. package/lib/Secret-BDBqq4p3.js.map +1 -0
  203. package/lib/{Separator-CTPSeW1S.js → Separator-BXt1LYnm.js} +2 -2
  204. package/lib/{Separator-CTPSeW1S.js.map → Separator-BXt1LYnm.js.map} +1 -1
  205. package/lib/SignUp-8kDBaLbO.js +55 -0
  206. package/lib/SignUp-8kDBaLbO.js.map +1 -0
  207. package/lib/{SyntaxHighlight-Kdyskw3C.js → SyntaxHighlight-hZOFnYl0.js} +1749 -1723
  208. package/lib/SyntaxHighlight-hZOFnYl0.js.map +1 -0
  209. package/lib/{Toc-DJxFPfcS.js → Toc-qEIii_-W.js} +3 -3
  210. package/lib/{Toc-DJxFPfcS.js.map → Toc-qEIii_-W.js.map} +1 -1
  211. package/lib/{ErrorAlert-DrOR8w3f.js → Zudoku-DUsdmPME.js} +5449 -4427
  212. package/lib/Zudoku-DUsdmPME.js.map +1 -0
  213. package/lib/ZudokuContext-BBI06sOx.js +387 -0
  214. package/lib/ZudokuContext-BBI06sOx.js.map +1 -0
  215. package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
  216. package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
  217. package/lib/{circular-CzWF1hj5.js → circular-bbWO95zs.js} +771 -749
  218. package/lib/{circular-CzWF1hj5.js.map → circular-bbWO95zs.js.map} +1 -1
  219. package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
  220. package/lib/cn-5-Gd1Dss.js.map +1 -0
  221. package/lib/createServer-B7POuwZp.js +13036 -0
  222. package/lib/createServer-B7POuwZp.js.map +1 -0
  223. package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
  224. package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
  225. package/lib/{errors-Bs4duWDy.js → errors-7hgPDs1h.js} +3 -3
  226. package/lib/{errors-Bs4duWDy.js.map → errors-7hgPDs1h.js.map} +1 -1
  227. package/lib/{firebase-qUdSEL1p.js → firebase-Dwn-2ju-.js} +1590 -1342
  228. package/lib/firebase-Dwn-2ju-.js.map +1 -0
  229. package/lib/hook-ZEd1Es7D.js +52 -0
  230. package/lib/hook-ZEd1Es7D.js.map +1 -0
  231. package/lib/{index-0oT9beQN.js → index-CTCT4jlW.js} +499 -493
  232. package/lib/{index-0oT9beQN.js.map → index-CTCT4jlW.js.map} +1 -1
  233. package/lib/index-CrcNWbel.js.map +1 -1
  234. package/lib/index-DAWHN3cH.js +86 -0
  235. package/lib/index-DAWHN3cH.js.map +1 -0
  236. package/lib/{index-Bh-MffiL.js → index-Dxdhrp-I.js} +2 -2
  237. package/lib/{index-Bh-MffiL.js.map → index-Dxdhrp-I.js.map} +1 -1
  238. package/lib/index.esm-BYObtETB.js.map +1 -1
  239. package/lib/{index.esm-DtzT_KoE.js → index.esm-Ca5zvoff.js} +20 -20
  240. package/lib/{index.esm-DtzT_KoE.js.map → index.esm-Ca5zvoff.js.map} +1 -1
  241. package/lib/{index.esm-kW-Utcsi.js → index.esm-DG4KaDKR.js} +16 -14
  242. package/lib/index.esm-DG4KaDKR.js.map +1 -0
  243. package/lib/{invariant-CGOLuIIz.js → invariant-B_t_F2s_.js} +6 -6
  244. package/lib/invariant-B_t_F2s_.js.map +1 -0
  245. package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
  246. package/lib/{mutation-BoVlx8yA.js → mutation-BISOc7OM.js} +70 -44
  247. package/lib/mutation-BISOc7OM.js.map +1 -0
  248. package/lib/ui/Accordion.js +1 -1
  249. package/lib/ui/ActionButton.js +2 -2
  250. package/lib/ui/Alert.js +1 -1
  251. package/lib/ui/AlertDialog.js +1 -1
  252. package/lib/ui/Badge.js +1 -1
  253. package/lib/ui/Breadcrumb.js +1 -1
  254. package/lib/ui/Button.js +7 -6
  255. package/lib/ui/Button.js.map +1 -1
  256. package/lib/ui/ButtonGroup.js +1 -1
  257. package/lib/ui/Callout.js +1 -1
  258. package/lib/ui/Card.js +1 -1
  259. package/lib/ui/Carousel.js +1 -1
  260. package/lib/ui/Carousel.js.map +1 -1
  261. package/lib/ui/Checkbox.js +1 -1
  262. package/lib/ui/CodeBlock.js +1 -1
  263. package/lib/ui/Command.js +2 -2
  264. package/lib/ui/Dialog.js +1 -1
  265. package/lib/ui/Drawer.js +3 -3
  266. package/lib/ui/DropdownMenu.js +1 -1
  267. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  268. package/lib/ui/Form.js +1 -1
  269. package/lib/ui/Frame.js +1 -1
  270. package/lib/ui/HoverCard.js +1 -1
  271. package/lib/ui/Input.js +1 -1
  272. package/lib/ui/Item.js +1 -1
  273. package/lib/ui/Label.js +1 -1
  274. package/lib/ui/NativeSelect.js +1 -1
  275. package/lib/ui/Pagination.js +1 -1
  276. package/lib/ui/Popover.js +1 -1
  277. package/lib/ui/Progress.js +1 -1
  278. package/lib/ui/RadioGroup.js +1 -1
  279. package/lib/ui/ScrollArea.js +1 -1
  280. package/lib/ui/Secret.js +1 -1
  281. package/lib/ui/Separator.js +1 -1
  282. package/lib/ui/Skeleton.js +1 -1
  283. package/lib/ui/Slider.js +1 -1
  284. package/lib/ui/Switch.js +1 -1
  285. package/lib/ui/SyntaxHighlight.js +3 -3
  286. package/lib/ui/Tabs.js +1 -1
  287. package/lib/ui/Textarea.js +1 -1
  288. package/lib/ui/Toggle.js +1 -1
  289. package/lib/ui/ToggleGroup.js +1 -1
  290. package/lib/ui/Value.js +1 -1
  291. package/lib/ui/util.js +1 -1
  292. package/lib/useExposedProps-CzTDfXfq.js +30 -0
  293. package/lib/useExposedProps-CzTDfXfq.js.map +1 -0
  294. package/lib/{useMutation-C6RqWmTS.js → useMutation-CFMGlAMW.js} +39 -17
  295. package/lib/useMutation-CFMGlAMW.js.map +1 -0
  296. package/lib/useSuspenseQuery-CSB_rVek.js +1226 -0
  297. package/lib/useSuspenseQuery-CSB_rVek.js.map +1 -0
  298. package/lib/zudoku.__internal.js +827 -1325
  299. package/lib/zudoku.__internal.js.map +1 -1
  300. package/lib/zudoku.auth-auth0.js +16 -16
  301. package/lib/zudoku.auth-auth0.js.map +1 -1
  302. package/lib/zudoku.auth-azureb2c.js +4 -4
  303. package/lib/zudoku.auth-clerk.js +52 -75
  304. package/lib/zudoku.auth-clerk.js.map +1 -1
  305. package/lib/zudoku.auth-firebase.js +6 -5
  306. package/lib/zudoku.auth-firebase.js.map +1 -1
  307. package/lib/zudoku.auth-openid.js +5 -5
  308. package/lib/zudoku.auth-supabase.js +31 -40
  309. package/lib/zudoku.auth-supabase.js.map +1 -1
  310. package/lib/zudoku.components.js +29 -25
  311. package/lib/zudoku.components.js.map +1 -1
  312. package/lib/zudoku.hooks.js +24 -11
  313. package/lib/zudoku.hooks.js.map +1 -1
  314. package/lib/zudoku.mermaid.js +5 -4
  315. package/lib/zudoku.mermaid.js.map +1 -1
  316. package/lib/zudoku.plugin-api-catalog.js +35 -31
  317. package/lib/zudoku.plugin-api-catalog.js.map +1 -1
  318. package/lib/zudoku.plugin-api-keys.js +607 -551
  319. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  320. package/lib/zudoku.plugin-custom-pages.js +1 -1
  321. package/lib/zudoku.plugin-markdown.js +1 -1
  322. package/lib/zudoku.plugin-openapi.js +3 -3
  323. package/lib/zudoku.plugin-redirect.js +1 -1
  324. package/lib/zudoku.plugin-search-pagefind.js +30 -29
  325. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  326. package/lib/zudoku.plugins.js +9 -8
  327. package/lib/zudoku.plugins.js.map +1 -1
  328. package/lib/zudoku.react-query.js +440 -0
  329. package/lib/zudoku.react-query.js.map +1 -0
  330. package/lib/zudoku.router.js +1130 -1404
  331. package/lib/zudoku.router.js.map +1 -1
  332. package/package.json +30 -22
  333. package/src/lib/auth/issuer.ts +1 -1
  334. package/src/lib/authentication/authentication.ts +8 -2
  335. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  336. package/src/lib/authentication/components/SignIn.tsx +5 -2
  337. package/src/lib/authentication/components/SignUp.tsx +5 -2
  338. package/src/lib/authentication/hook.ts +16 -0
  339. package/src/lib/authentication/providers/auth0.tsx +15 -9
  340. package/src/lib/authentication/providers/clerk.tsx +0 -26
  341. package/src/lib/authentication/providers/firebase.tsx +98 -6
  342. package/src/lib/authentication/providers/supabase.tsx +6 -15
  343. package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
  344. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +170 -38
  345. package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
  346. package/src/lib/components/Pagination.tsx +4 -5
  347. package/src/lib/components/index.ts +19 -35
  348. package/src/lib/components/navigation/NavigationItem.tsx +9 -3
  349. package/src/lib/core/RouteGuard.tsx +30 -24
  350. package/src/lib/core/plugins.ts +21 -1
  351. package/src/lib/core/react-query.ts +1 -0
  352. package/src/lib/core/transform-config.ts +29 -0
  353. package/src/lib/errors/ErrorMessage.tsx +38 -0
  354. package/src/lib/hooks/index.ts +7 -16
  355. package/src/lib/oas/graphql/circular.test.ts +186 -0
  356. package/src/lib/oas/graphql/circular.ts +49 -10
  357. package/src/lib/oas/graphql/index.ts +7 -3
  358. package/src/lib/oas/parser/index.ts +17 -6
  359. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +36 -476
  360. package/src/lib/plugins/api-keys/index.tsx +76 -32
  361. package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -0
  362. package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +67 -0
  363. package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +124 -0
  364. package/src/lib/plugins/openapi/OasProvider.tsx +10 -2
  365. package/src/lib/plugins/openapi/OperationList.tsx +4 -4
  366. package/src/lib/plugins/openapi/ParamInfos.tsx +1 -0
  367. package/src/lib/plugins/openapi/Sidecar.tsx +3 -2
  368. package/src/lib/plugins/openapi/interfaces.ts +6 -1
  369. package/src/lib/plugins/openapi/schema/SchemaView.tsx +6 -4
  370. package/src/lib/plugins/openapi/schema/utils.ts +15 -4
  371. package/src/lib/plugins/openapi/util/createHttpSnippet.ts +29 -1
  372. package/src/lib/plugins/openapi/util/getRoutes.tsx +4 -1
  373. package/src/lib/ui/Button.tsx +1 -0
  374. package/src/lib/util/flattenAllOf.test.ts +2 -1
  375. package/src/lib/util/flattenAllOf.ts +0 -57
  376. package/src/lib/util/flattenAllOfProcessor.ts +58 -0
  377. package/src/lib/util/invariant.ts +2 -1
  378. package/src/lib/util/readFrontmatter.ts +2 -1
  379. package/src/shiki/langs/c3.js +1 -0
  380. package/src/shiki/langs/gn.js +1 -0
  381. package/src/shiki/langs/moonbit.js +1 -0
  382. package/src/zuplo/enrich-with-zuplo-mcp.ts +168 -0
  383. package/src/zuplo/enrich-with-zuplo.ts +254 -0
  384. package/src/zuplo/policy-types.ts +46 -0
  385. package/src/zuplo/with-zuplo-processors.ts +35 -0
  386. package/src/zuplo/with-zuplo.ts +14 -0
  387. package/lib/ClaudeLogo-B4Xxt-x_.js.map +0 -1
  388. package/lib/ErrorAlert-DrOR8w3f.js.map +0 -1
  389. package/lib/OAuthErrorPage-Fq54RLgt.js.map +0 -1
  390. package/lib/OasProvider-DPH8mwDa.js +0 -40
  391. package/lib/OasProvider-DPH8mwDa.js.map +0 -1
  392. package/lib/OperationList-C0jiEaG5.js.map +0 -1
  393. package/lib/RouteGuard-9wjejsKm.js +0 -77
  394. package/lib/RouteGuard-9wjejsKm.js.map +0 -1
  395. package/lib/RouterError-DSLXagd5.js +0 -42
  396. package/lib/RouterError-DSLXagd5.js.map +0 -1
  397. package/lib/SchemaView-DVae4RO2.js +0 -597
  398. package/lib/SchemaView-DVae4RO2.js.map +0 -1
  399. package/lib/Select-CkxXP5I7.js.map +0 -1
  400. package/lib/SignUp-BjS4ozA7.js +0 -50
  401. package/lib/SignUp-BjS4ozA7.js.map +0 -1
  402. package/lib/SyntaxHighlight-Kdyskw3C.js.map +0 -1
  403. package/lib/ZudokuContext-BXldanA8.js +0 -1508
  404. package/lib/ZudokuContext-BXldanA8.js.map +0 -1
  405. package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js +0 -9
  406. package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js.map +0 -1
  407. package/lib/chunk-PVWAREVJ-dLIqswPy.js +0 -7965
  408. package/lib/chunk-PVWAREVJ-dLIqswPy.js.map +0 -1
  409. package/lib/cn-dYga0KKN.js.map +0 -1
  410. package/lib/createServer-BIr2_tGn.js +0 -16693
  411. package/lib/createServer-BIr2_tGn.js.map +0 -1
  412. package/lib/createVariantComponent-B9_dVBvu.js +0 -35
  413. package/lib/createVariantComponent-B9_dVBvu.js.map +0 -1
  414. package/lib/firebase-qUdSEL1p.js.map +0 -1
  415. package/lib/hook-BNxidGQq.js +0 -40
  416. package/lib/hook-BNxidGQq.js.map +0 -1
  417. package/lib/index-CCmMJp02.js +0 -1059
  418. package/lib/index-CCmMJp02.js.map +0 -1
  419. package/lib/index-Css56y3F.js +0 -133
  420. package/lib/index-Css56y3F.js.map +0 -1
  421. package/lib/index.esm-kW-Utcsi.js.map +0 -1
  422. package/lib/invariant-CGOLuIIz.js.map +0 -1
  423. package/lib/mutation-BoVlx8yA.js.map +0 -1
  424. package/lib/useMutation-C6RqWmTS.js.map +0 -1
@@ -0,0 +1,124 @@
1
+ import { TrashIcon } from "lucide-react";
2
+ import { useState } from "react";
3
+ import { Button } from "zudoku/ui/Button.js";
4
+ import {
5
+ Dialog,
6
+ DialogClose,
7
+ DialogContent,
8
+ DialogDescription,
9
+ DialogFooter,
10
+ DialogHeader,
11
+ DialogTitle,
12
+ DialogTrigger,
13
+ } from "zudoku/ui/Dialog.js";
14
+ import { Secret } from "zudoku/ui/Secret.js";
15
+ import { cn } from "../../../util/cn.js";
16
+ import type { ApiKey } from "../index.js";
17
+
18
+ export const RevealApiKey = ({
19
+ apiKey,
20
+ onDeleteKey,
21
+ className,
22
+ }: {
23
+ apiKey: ApiKey;
24
+ onDeleteKey: () => void;
25
+ className?: string;
26
+ }) => {
27
+ const [revealed, setRevealed] = useState(false);
28
+
29
+ const { key, createdOn, expiresOn } = apiKey;
30
+ const isExpired = expiresOn && new Date(expiresOn) < new Date();
31
+ const daysUntilExpiry = expiresOn
32
+ ? Math.ceil(
33
+ (new Date(expiresOn).getTime() - Date.now()) / (1000 * 60 * 60 * 24),
34
+ )
35
+ : Infinity;
36
+ const expiresSoon = daysUntilExpiry <= 7 && !isExpired;
37
+
38
+ return (
39
+ <div className={cn("grid col-span-full grid-cols-subgrid p-6", className)}>
40
+ <div className="flex flex-col gap-1">
41
+ <Secret
42
+ className="max-w-fit w-full"
43
+ secret={key}
44
+ status={isExpired ? "expired" : expiresSoon ? "expiring" : "active"}
45
+ revealed={revealed}
46
+ onReveal={setRevealed}
47
+ />
48
+ <div className="flex gap-1 mt-0.5 text-nowrap">
49
+ {createdOn && (
50
+ <span className="text-xs text-muted-foreground">
51
+ Created {getTimeAgo(createdOn)}.
52
+ </span>
53
+ )}{" "}
54
+ {expiresOn && expiresSoon && (
55
+ <span className="text-xs text-primary">
56
+ Expires in {daysUntilExpiry}{" "}
57
+ {daysUntilExpiry === 1 ? "day" : "days"}.
58
+ </span>
59
+ )}
60
+ {expiresOn && isExpired && (
61
+ <span className="text-xs text-primary">
62
+ Expired{" "}
63
+ {daysUntilExpiry === 0
64
+ ? "today."
65
+ : `${daysUntilExpiry * -1} days ago.`}
66
+ </span>
67
+ )}
68
+ </div>
69
+ </div>
70
+ <div className="flex justify-end">
71
+ {expiresOn && onDeleteKey && (
72
+ <Dialog>
73
+ <DialogTrigger asChild>
74
+ <Button variant="ghost" size="icon">
75
+ <TrashIcon size={16} />
76
+ </Button>
77
+ </DialogTrigger>
78
+ <DialogContent>
79
+ <DialogHeader>
80
+ <DialogTitle>Delete API Key</DialogTitle>
81
+ <DialogDescription>
82
+ Are you sure you want to delete this API key?
83
+ </DialogDescription>
84
+ </DialogHeader>
85
+ <DialogFooter>
86
+ <DialogClose asChild>
87
+ <Button variant="outline">Cancel</Button>
88
+ </DialogClose>
89
+ <DialogClose asChild>
90
+ <Button
91
+ onClick={() => {
92
+ onDeleteKey();
93
+ }}
94
+ >
95
+ Delete
96
+ </Button>
97
+ </DialogClose>
98
+ </DialogFooter>
99
+ </DialogContent>
100
+ </Dialog>
101
+ )}
102
+ </div>
103
+ </div>
104
+ );
105
+ };
106
+
107
+ const getTimeAgo = (date: string) => {
108
+ const now = new Date();
109
+ const created = new Date(date);
110
+ const diffInSeconds = Math.floor((now.getTime() - created.getTime()) / 1000);
111
+
112
+ const rtf = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
113
+
114
+ if (diffInSeconds < 60) return rtf.format(-diffInSeconds, "second");
115
+ if (diffInSeconds < 3600)
116
+ return rtf.format(-Math.floor(diffInSeconds / 60), "minute");
117
+ if (diffInSeconds < 86400)
118
+ return rtf.format(-Math.floor(diffInSeconds / 3600), "hour");
119
+ if (diffInSeconds < 2592000)
120
+ return rtf.format(-Math.floor(diffInSeconds / 86400), "day");
121
+ if (diffInSeconds < 31536000)
122
+ return rtf.format(-Math.floor(diffInSeconds / 2592000), "month");
123
+ return rtf.format(-Math.floor(diffInSeconds / 31536000), "year");
124
+ };
@@ -19,13 +19,21 @@ export const OasProvider = ({
19
19
  client: GraphQLClient;
20
20
  }) => {
21
21
  const value = useMemo(() => {
22
- const { versions: availableVersions, labels } = getVersionMetadata(config);
22
+ const {
23
+ versions: availableVersions,
24
+ labels,
25
+ downloadUrls,
26
+ } = getVersionMetadata(config);
23
27
  const currentVersion = version ?? availableVersions.at(0);
24
28
 
25
29
  const versionLinks = Object.fromEntries(
26
30
  availableVersions.map((id) => [
27
31
  id,
28
- { path: joinUrl(basePath, id), label: labels[id] ?? id },
32
+ {
33
+ path: joinUrl(basePath, id),
34
+ label: labels[id] ?? id,
35
+ downloadUrl: downloadUrls[id],
36
+ },
29
37
  ]),
30
38
  );
31
39
 
@@ -20,7 +20,6 @@ import { Heading } from "../../components/Heading.js";
20
20
  import { Markdown } from "../../components/Markdown.js";
21
21
  import { PagefindSearchMeta } from "../../components/PagefindSearchMeta.js";
22
22
  import { Pagination } from "../../components/Pagination.js";
23
- import { joinUrl } from "../../util/joinUrl.js";
24
23
  import { useCreateQuery } from "./client/useCreateQuery.js";
25
24
  import { useOasConfig } from "./context.js";
26
25
  import { DownloadSchemaButton } from "./DownloadSchemaButton.js";
@@ -158,7 +157,7 @@ export const OperationList = ({
158
157
  tag?: string;
159
158
  untagged?: boolean;
160
159
  }) => {
161
- const { path, input, type, versions, version, options } = useOasConfig();
160
+ const { input, type, versions, version, options } = useOasConfig();
162
161
  const { tag: tagFromParams } = useParams<"tag">();
163
162
  const query = useCreateQuery(OperationsForTagQuery, {
164
163
  input,
@@ -247,11 +246,12 @@ export const OperationList = ({
247
246
  const tagTitle = schema.tag.extensions?.["x-displayName"] ?? schema.tag.name;
248
247
  const helmetTitle = [tagTitle, title].filter(Boolean).join(" - ");
249
248
 
249
+ const currentVersion = version != null ? versions[version] : undefined;
250
250
  const downloadUrl =
251
251
  typeof input === "string"
252
252
  ? type === "url"
253
253
  ? input
254
- : joinUrl(path, version, input.split("/").pop())
254
+ : currentVersion?.downloadUrl
255
255
  : undefined;
256
256
 
257
257
  return (
@@ -286,7 +286,7 @@ export const OperationList = ({
286
286
  {showVersions && (
287
287
  <span className="text-xl text-muted-foreground ms-1.5">
288
288
  {" "}
289
- ({version})
289
+ ({schema.version})
290
290
  </span>
291
291
  )}
292
292
  </Heading>
@@ -40,6 +40,7 @@ const getSchemaInfos = (schema?: SchemaObject) => {
40
40
  schema.enum && "enum",
41
41
  schema.const && "const",
42
42
  schema.format,
43
+ schema.type === "array" && schema.items?.contentMediaType,
43
44
  schema.minimum !== undefined && `min: ${schema.minimum}`,
44
45
  schema.maximum !== undefined && `max: ${schema.maximum}`,
45
46
  schema.minLength !== undefined && `minLength: ${schema.minLength}`,
@@ -149,10 +149,10 @@ export const Sidecar = ({
149
149
  selectedServer,
150
150
  exampleBody: currentExampleCode
151
151
  ? {
152
- mimeType: "application/json",
152
+ mimeType: selectedContent?.mediaType ?? "application/json",
153
153
  text: JSON.stringify(currentExampleCode, null, 2),
154
154
  }
155
- : { mimeType: "application/json" },
155
+ : { mimeType: selectedContent?.mediaType ?? "application/json" },
156
156
  });
157
157
 
158
158
  return getConverted(snippet, selectedLang);
@@ -161,6 +161,7 @@ export const Sidecar = ({
161
161
  operation,
162
162
  selectedServer,
163
163
  selectedLang,
164
+ selectedContent,
164
165
  options,
165
166
  auth,
166
167
  context,
@@ -7,6 +7,8 @@ type DynamicInput = () => Promise<unknown>;
7
7
 
8
8
  export type VersionedInput<T> = Array<{
9
9
  path: string;
10
+ version?: string;
11
+ downloadUrl?: string;
10
12
  label?: string;
11
13
  input: T;
12
14
  }>;
@@ -85,5 +87,8 @@ export type OasPluginConfig = BaseOasConfig & OasSource;
85
87
  export type OasPluginContext = BaseOasConfig &
86
88
  ContextOasSource & {
87
89
  version?: string;
88
- versions: Record<string, { path: string; label: string }>;
90
+ versions: Record<
91
+ string,
92
+ { path: string; label: string; downloadUrl?: string }
93
+ >;
89
94
  };
@@ -154,10 +154,12 @@ export const SchemaView = ({
154
154
  <FrameDescription>{schema.description}</FrameDescription>
155
155
  </FrameHeader>
156
156
  )}
157
- <FramePanel className="p-0!">
158
- {itemsList}
159
- {additionalObjectProperties}
160
- </FramePanel>
157
+ {(itemsList.length > 0 || additionalObjectProperties) && (
158
+ <FramePanel className="p-0!">
159
+ {itemsList}
160
+ {additionalObjectProperties}
161
+ </FramePanel>
162
+ )}
161
163
  {schema.additionalProperties === true && (
162
164
  <FrameFooter>
163
165
  <a
@@ -1,4 +1,7 @@
1
- import { CIRCULAR_REF } from "../../../oas/graphql/circular.js";
1
+ import {
2
+ CIRCULAR_REF,
3
+ SCHEMA_REF_PREFIX,
4
+ } from "../../../oas/graphql/circular.js";
2
5
  import type {
3
6
  ArraySchemaObject,
4
7
  SchemaObject,
@@ -25,7 +28,8 @@ export const isComplexType = (value?: SchemaObject) =>
25
28
  (!value.items.type || value.items.type === "object")));
26
29
 
27
30
  export const isCircularRef = (schema: unknown): schema is string =>
28
- typeof schema === "string" && schema.startsWith(CIRCULAR_REF);
31
+ typeof schema === "string" &&
32
+ (schema.startsWith(CIRCULAR_REF) || schema.startsWith(SCHEMA_REF_PREFIX));
29
33
 
30
34
  export const isArrayCircularRef = (
31
35
  schema: SchemaObject,
@@ -34,5 +38,12 @@ export const isArrayCircularRef = (
34
38
 
35
39
  export const extractCircularRefInfo = (
36
40
  ref?: string | SchemaObject,
37
- ): string | undefined =>
38
- typeof ref === "string" ? ref.split(":")[1] : undefined;
41
+ ): string | undefined => {
42
+ if (typeof ref !== "string") return undefined;
43
+
44
+ if (ref.startsWith(SCHEMA_REF_PREFIX)) {
45
+ return ref.slice(SCHEMA_REF_PREFIX.length).split("/").pop();
46
+ }
47
+
48
+ return ref.split(":")[1];
49
+ };
@@ -1,6 +1,23 @@
1
1
  import { HTTPSnippet } from "@zudoku/httpsnippet";
2
2
  import type { OperationsFragmentFragment } from "../graphql/graphql.js";
3
3
 
4
+ const toFormDataParams = (text?: string) => {
5
+ const stringify = (v: unknown) =>
6
+ typeof v === "string" ? v : JSON.stringify(v);
7
+
8
+ try {
9
+ const obj = text && JSON.parse(text);
10
+ if (typeof obj !== "object" || !obj) return [];
11
+
12
+ return Object.entries(obj).flatMap(([name, value]) => {
13
+ const values = Array.isArray(value) ? value : [value];
14
+ return values.map((v) => ({ name, value: stringify(v) }));
15
+ });
16
+ } catch {
17
+ return [];
18
+ }
19
+ };
20
+
4
21
  export const createHttpSnippet = ({
5
22
  operation,
6
23
  selectedServer,
@@ -13,11 +30,22 @@ export const createHttpSnippet = ({
13
30
  text?: string;
14
31
  };
15
32
  }) => {
33
+ const isMultipart =
34
+ exampleBody.mimeType === "multipart/form-data" ||
35
+ exampleBody.mimeType === "application/x-www-form-urlencoded";
36
+
37
+ const postData = isMultipart
38
+ ? {
39
+ mimeType: exampleBody.mimeType,
40
+ params: toFormDataParams(exampleBody.text),
41
+ }
42
+ : exampleBody;
43
+
16
44
  return new HTTPSnippet({
17
45
  method: operation.method.toUpperCase(),
18
46
  url:
19
47
  selectedServer + operation.path.replaceAll("{", ":").replaceAll("}", ""),
20
- postData: exampleBody,
48
+ postData,
21
49
  headers: [
22
50
  ...(exampleBody.text
23
51
  ? [{ name: "Content-Type", value: exampleBody.mimeType }]
@@ -150,7 +150,7 @@ const createVersionRoutes = (
150
150
 
151
151
  export const getVersionMetadata = (config: OasPluginConfig) => {
152
152
  if (config.type === "raw" || !Array.isArray(config.input)) {
153
- return { versions: [], labels: {} };
153
+ return { versions: [], labels: {}, downloadUrls: {} };
154
154
  }
155
155
 
156
156
  return {
@@ -158,6 +158,9 @@ export const getVersionMetadata = (config: OasPluginConfig) => {
158
158
  labels: Object.fromEntries(
159
159
  config.input.map((v) => [v.path, v.label ?? v.path]),
160
160
  ),
161
+ downloadUrls: Object.fromEntries(
162
+ config.input.map((v) => [v.path, v.downloadUrl]),
163
+ ),
161
164
  };
162
165
  };
163
166
 
@@ -51,6 +51,7 @@ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
51
51
  const Comp = asChild ? Slot : "button";
52
52
  return (
53
53
  <Comp
54
+ type={asChild ? undefined : "button"}
54
55
  className={cn(buttonVariants({ variant, size, className }))}
55
56
  ref={ref}
56
57
  {...props}
@@ -1,7 +1,8 @@
1
1
  import type { JSONSchema7 } from "json-schema";
2
2
  import { describe, expect, it, vi } from "vitest";
3
3
  import type { OpenAPIDocument } from "../oas/parser/index.js";
4
- import { flattenAllOf, flattenAllOfProcessor } from "./flattenAllOf.js";
4
+ import { flattenAllOf } from "./flattenAllOf.js";
5
+ import { flattenAllOfProcessor } from "./flattenAllOfProcessor.js";
5
6
  import invariant from "./invariant.js";
6
7
 
7
8
  describe("flattenAllOf", () => {
@@ -1,4 +1,3 @@
1
- import { $RefParser } from "@apidevtools/json-schema-ref-parser";
2
1
  import {
3
2
  createComparator,
4
3
  createMerger,
@@ -9,62 +8,6 @@ import {
9
8
  createIntersector,
10
9
  } from "@x0k/json-schema-merge/lib/array";
11
10
  import type { JSONSchema7Definition } from "json-schema";
12
- import type { Processor } from "../../config/validators/BuildSchema.js";
13
- import type { OpenAPIDocument } from "../oas/parser/index.js";
14
- import { type RecordAny, traverse } from "./traverse.js";
15
-
16
- export const flattenAllOfProcessor: Processor = async ({ schema, file }) => {
17
- try {
18
- // Resolve refs once - creates a lookup table without modifying the schema
19
- const parser = new $RefParser();
20
- await parser.resolve(schema);
21
- const $refs = parser.$refs;
22
-
23
- const flattened = traverse(schema, (spec) => {
24
- if (!spec || typeof spec !== "object" || Array.isArray(spec)) {
25
- return spec;
26
- }
27
-
28
- const isSchemaObject =
29
- "type" in spec ||
30
- "properties" in spec ||
31
- "allOf" in spec ||
32
- "anyOf" in spec ||
33
- "oneOf" in spec;
34
-
35
- if (!isSchemaObject) return spec;
36
-
37
- if ("allOf" in spec && Array.isArray(spec.allOf)) {
38
- const resolvedAllOf = spec.allOf.map((item) => {
39
- if (
40
- item &&
41
- typeof item === "object" &&
42
- "$ref" in item &&
43
- typeof item.$ref === "string"
44
- ) {
45
- try {
46
- return $refs.get(item.$ref) ?? item;
47
- } catch {
48
- return item;
49
- }
50
- }
51
- return item;
52
- });
53
- return flattenAllOf({ ...spec, allOf: resolvedAllOf }) as RecordAny;
54
- }
55
-
56
- return flattenAllOf(spec) as RecordAny;
57
- }) as OpenAPIDocument;
58
-
59
- return flattened;
60
- } catch (error) {
61
- // biome-ignore lint/suspicious/noConsole: Logging allowed here
62
- console.warn(
63
- `Failed to flatten \`allOf\` in ${file}: ${error instanceof Error ? error.message : error}`,
64
- );
65
- return schema;
66
- }
67
- };
68
11
 
69
12
  const { compareSchemaDefinitions, compareSchemaValues } = createComparator();
70
13
  const { mergeArrayOfSchemaDefinitions } = createMerger({
@@ -0,0 +1,58 @@
1
+ import { $RefParser } from "@apidevtools/json-schema-ref-parser";
2
+ import type { Processor } from "../../config/validators/BuildSchema.js";
3
+ import type { OpenAPIDocument } from "../oas/parser/index.js";
4
+ import { flattenAllOf } from "./flattenAllOf.js";
5
+ import { type RecordAny, traverse } from "./traverse.js";
6
+
7
+ export const flattenAllOfProcessor: Processor = async ({ schema, file }) => {
8
+ try {
9
+ // Resolve refs once - creates a lookup table without modifying the schema
10
+ const parser = new $RefParser();
11
+ await parser.resolve(schema);
12
+ const $refs = parser.$refs;
13
+
14
+ const flattened = traverse(schema, (spec) => {
15
+ if (!spec || typeof spec !== "object" || Array.isArray(spec)) {
16
+ return spec;
17
+ }
18
+
19
+ const isSchemaObject =
20
+ "type" in spec ||
21
+ "properties" in spec ||
22
+ "allOf" in spec ||
23
+ "anyOf" in spec ||
24
+ "oneOf" in spec;
25
+
26
+ if (!isSchemaObject) return spec;
27
+
28
+ if ("allOf" in spec && Array.isArray(spec.allOf)) {
29
+ const resolvedAllOf = spec.allOf.map((item) => {
30
+ if (
31
+ item &&
32
+ typeof item === "object" &&
33
+ "$ref" in item &&
34
+ typeof item.$ref === "string"
35
+ ) {
36
+ try {
37
+ return $refs.get(item.$ref) ?? item;
38
+ } catch {
39
+ return item;
40
+ }
41
+ }
42
+ return item;
43
+ });
44
+ return flattenAllOf({ ...spec, allOf: resolvedAllOf }) as RecordAny;
45
+ }
46
+
47
+ return flattenAllOf(spec) as RecordAny;
48
+ }) as OpenAPIDocument;
49
+
50
+ return flattened;
51
+ } catch (error) {
52
+ // biome-ignore lint/suspicious/noConsole: Logging allowed here
53
+ console.warn(
54
+ `Failed to flatten \`allOf\` in ${file}: ${error instanceof Error ? error.message : error}`,
55
+ );
56
+ return schema;
57
+ }
58
+ };
@@ -7,6 +7,7 @@ export default function invariant(
7
7
  * the message takes a fair amount of effort to compute
8
8
  */
9
9
  message?: string | (() => string),
10
+ options?: ZudokuErrorOptions,
10
11
  ): asserts condition {
11
12
  if (condition) {
12
13
  return;
@@ -16,7 +17,7 @@ export default function invariant(
16
17
  const provided: string | undefined =
17
18
  typeof message === "function" ? message() : message;
18
19
 
19
- throw new ZudokuError(provided ?? "Invariant failed");
20
+ throw new ZudokuError(provided ?? "Invariant failed", options);
20
21
  }
21
22
 
22
23
  export type ZudokuErrorOptions = {
@@ -9,5 +9,6 @@ export const yaml = {
9
9
 
10
10
  export const readFrontmatter = async (filePath: string) => {
11
11
  const content = await readFile(filePath, "utf-8");
12
- return matter(content, { engines: { yaml } });
12
+ const normalizedContent = content.replace(/\r\n/g, "\n");
13
+ return matter(normalizedContent, { engines: { yaml } });
13
14
  };
@@ -0,0 +1 @@
1
+ export { default } from "@shikijs/langs/c3";
@@ -0,0 +1 @@
1
+ export { default } from "@shikijs/langs/gn";
@@ -0,0 +1 @@
1
+ export { default } from "@shikijs/langs/moonbit";