zudoku 0.0.0-fix-firebase-export.2e421fda → 0.0.0-monetization-standalone.z07361713

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 (410) 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/create-plugin.d.ts +2 -0
  5. package/dist/config/create-plugin.js +30 -0
  6. package/dist/config/create-plugin.js.map +1 -0
  7. package/dist/config/loader.js +3 -1
  8. package/dist/config/loader.js.map +1 -1
  9. package/dist/config/validators/InputNavigationSchema.d.ts +77 -75
  10. package/dist/config/validators/InputNavigationSchema.js +1 -0
  11. package/dist/config/validators/InputNavigationSchema.js.map +1 -1
  12. package/dist/config/validators/NavigationSchema.js +6 -1
  13. package/dist/config/validators/NavigationSchema.js.map +1 -1
  14. package/dist/config/validators/ProtectedRoutesSchema.d.ts +1 -1
  15. package/dist/config/validators/validate.d.ts +61 -15
  16. package/dist/config/validators/validate.js +9 -5
  17. package/dist/config/validators/validate.js.map +1 -1
  18. package/dist/flat-config.d.ts +30 -27
  19. package/dist/index.d.ts +3 -1
  20. package/dist/index.js +3 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/lib/auth/issuer.js +1 -1
  23. package/dist/lib/auth/issuer.js.map +1 -1
  24. package/dist/lib/authentication/authentication.d.ts +3 -2
  25. package/dist/lib/authentication/components/CallbackHandler.js +1 -1
  26. package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
  27. package/dist/lib/authentication/components/SignIn.js +4 -2
  28. package/dist/lib/authentication/components/SignIn.js.map +1 -1
  29. package/dist/lib/authentication/components/SignUp.js +4 -2
  30. package/dist/lib/authentication/components/SignUp.js.map +1 -1
  31. package/dist/lib/authentication/hook.d.ts +2 -0
  32. package/dist/lib/authentication/hook.js +10 -0
  33. package/dist/lib/authentication/hook.js.map +1 -1
  34. package/dist/lib/authentication/providers/auth0.js +11 -7
  35. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  36. package/dist/lib/authentication/providers/clerk.js +0 -22
  37. package/dist/lib/authentication/providers/clerk.js.map +1 -1
  38. package/dist/lib/authentication/providers/firebase.js +67 -9
  39. package/dist/lib/authentication/providers/firebase.js.map +1 -1
  40. package/dist/lib/authentication/providers/supabase.js +6 -15
  41. package/dist/lib/authentication/providers/supabase.js.map +1 -1
  42. package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
  43. package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
  44. package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
  45. package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +7 -2
  46. package/dist/lib/authentication/ui/ZudokuAuthUi.js +48 -12
  47. package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -1
  48. package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
  49. package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
  50. package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
  51. package/dist/lib/components/Bootstrap.js +1 -2
  52. package/dist/lib/components/Bootstrap.js.map +1 -1
  53. package/dist/lib/components/Pagination.js +2 -2
  54. package/dist/lib/components/Pagination.js.map +1 -1
  55. package/dist/lib/components/Zudoku.js +2 -5
  56. package/dist/lib/components/Zudoku.js.map +1 -1
  57. package/dist/lib/components/context/ZudokuContext.d.ts +2 -4
  58. package/dist/lib/components/context/ZudokuContext.js +2 -2
  59. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  60. package/dist/lib/components/context/ZudokuProvider.js +1 -1
  61. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  62. package/dist/lib/components/context/ZudokuReactContext.d.ts +11 -0
  63. package/dist/lib/components/context/ZudokuReactContext.js +4 -0
  64. package/dist/lib/components/context/ZudokuReactContext.js.map +1 -0
  65. package/dist/lib/components/index.d.ts +5 -0
  66. package/dist/lib/components/index.js +4 -0
  67. package/dist/lib/components/index.js.map +1 -1
  68. package/dist/lib/components/navigation/NavigationItem.js +2 -2
  69. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  70. package/dist/lib/core/RouteGuard.js +12 -7
  71. package/dist/lib/core/RouteGuard.js.map +1 -1
  72. package/dist/lib/core/plugins.d.ts +11 -1
  73. package/dist/lib/core/plugins.js +1 -0
  74. package/dist/lib/core/plugins.js.map +1 -1
  75. package/dist/lib/core/react-query.d.ts +1 -0
  76. package/dist/lib/core/react-query.js +2 -0
  77. package/dist/lib/core/react-query.js.map +1 -0
  78. package/dist/lib/core/transform-config.d.ts +2 -0
  79. package/dist/lib/core/transform-config.js +22 -0
  80. package/dist/lib/core/transform-config.js.map +1 -0
  81. package/dist/lib/errors/ErrorAlert.js +1 -2
  82. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  83. package/dist/lib/errors/ErrorMessage.d.ts +3 -0
  84. package/dist/lib/errors/ErrorMessage.js +16 -0
  85. package/dist/lib/errors/ErrorMessage.js.map +1 -0
  86. package/dist/lib/hooks/index.d.ts +2 -0
  87. package/dist/lib/oas/graphql/circular.d.ts +2 -0
  88. package/dist/lib/oas/graphql/circular.js +32 -10
  89. package/dist/lib/oas/graphql/circular.js.map +1 -1
  90. package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
  91. package/dist/lib/oas/graphql/circular.test.js +152 -0
  92. package/dist/lib/oas/graphql/circular.test.js.map +1 -0
  93. package/dist/lib/oas/graphql/index.js +7 -3
  94. package/dist/lib/oas/graphql/index.js.map +1 -1
  95. package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
  96. package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
  97. package/dist/lib/plugins/api-keys/index.d.ts +11 -4
  98. package/dist/lib/plugins/api-keys/index.js +36 -22
  99. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  100. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
  101. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
  102. package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
  103. package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
  104. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +33 -0
  105. package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
  106. package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
  107. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
  108. package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
  109. package/dist/lib/plugins/openapi/OasProvider.js +6 -2
  110. package/dist/lib/plugins/openapi/OasProvider.js.map +1 -1
  111. package/dist/lib/plugins/openapi/OperationList.js +4 -4
  112. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  113. package/dist/lib/plugins/openapi/ParamInfos.js +1 -0
  114. package/dist/lib/plugins/openapi/ParamInfos.js.map +1 -1
  115. package/dist/lib/plugins/openapi/Sidecar.js +3 -2
  116. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  117. package/dist/lib/plugins/openapi/interfaces.d.ts +3 -0
  118. package/dist/lib/plugins/openapi/schema/SchemaView.js +1 -1
  119. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  120. package/dist/lib/plugins/openapi/schema/utils.js +11 -3
  121. package/dist/lib/plugins/openapi/schema/utils.js.map +1 -1
  122. package/dist/lib/plugins/openapi/util/createHttpSnippet.js +24 -1
  123. package/dist/lib/plugins/openapi/util/createHttpSnippet.js.map +1 -1
  124. package/dist/lib/plugins/openapi/util/getRoutes.d.ts +3 -0
  125. package/dist/lib/plugins/openapi/util/getRoutes.js +2 -1
  126. package/dist/lib/plugins/openapi/util/getRoutes.js.map +1 -1
  127. package/dist/lib/ui/Button.js +1 -1
  128. package/dist/lib/ui/Button.js.map +1 -1
  129. package/dist/lib/ui/Command.d.ts +3 -3
  130. package/dist/lib/ui/Secret.js +2 -2
  131. package/dist/lib/ui/Secret.js.map +1 -1
  132. package/dist/lib/util/invariant.d.ts +1 -1
  133. package/dist/lib/util/invariant.js +2 -2
  134. package/dist/lib/util/invariant.js.map +1 -1
  135. package/dist/vite/api/SchemaManager.d.ts +12 -1
  136. package/dist/vite/api/SchemaManager.js +31 -14
  137. package/dist/vite/api/SchemaManager.js.map +1 -1
  138. package/dist/vite/api/SchemaManager.test.js +44 -0
  139. package/dist/vite/api/SchemaManager.test.js.map +1 -1
  140. package/dist/vite/config.js +10 -4
  141. package/dist/vite/config.js.map +1 -1
  142. package/dist/vite/error-handler.js +1 -5
  143. package/dist/vite/error-handler.js.map +1 -1
  144. package/dist/vite/mdx/remark-link-rewrite.js +1 -1
  145. package/dist/vite/plugin-api-keys.js +5 -1
  146. package/dist/vite/plugin-api-keys.js.map +1 -1
  147. package/dist/vite/plugin-api.js +5 -3
  148. package/dist/vite/plugin-api.js.map +1 -1
  149. package/dist/vite/plugin-markdown-export.js +1 -1
  150. package/dist/vite/plugin-markdown-export.js.map +1 -1
  151. package/dist/vite/plugin-theme.js +2 -1
  152. package/dist/vite/plugin-theme.js.map +1 -1
  153. package/dist/vite/prerender/utils.js +9 -3
  154. package/dist/vite/prerender/utils.js.map +1 -1
  155. package/dist/vite/prerender/worker.js +3 -0
  156. package/dist/vite/prerender/worker.js.map +1 -1
  157. package/dist/vite/zuplo.d.ts +13 -0
  158. package/dist/vite/zuplo.js +15 -0
  159. package/dist/vite/zuplo.js.map +1 -0
  160. package/lib/{ActionButton-DUgvSylL.js → ActionButton-B0CXL1Lq.js} +3 -3
  161. package/lib/{ActionButton-DUgvSylL.js.map → ActionButton-B0CXL1Lq.js.map} +1 -1
  162. package/lib/{Button-CynVW1JV.js → Button-GUVe7pmt.js} +8 -7
  163. package/lib/{Button-CynVW1JV.js.map → Button-GUVe7pmt.js.map} +1 -1
  164. package/lib/{Card-KFniaZn5.js → Card-DCdq37aA.js} +2 -2
  165. package/lib/{Card-KFniaZn5.js.map → Card-DCdq37aA.js.map} +1 -1
  166. package/lib/{ClaudeLogo-B4Xxt-x_.js → ClaudeLogo-CUaQXKLK.js} +22 -22
  167. package/lib/ClaudeLogo-CUaQXKLK.js.map +1 -0
  168. package/lib/{Command-BpT1iBE6.js → Command-N6VujV30.js} +3 -3
  169. package/lib/{Command-BpT1iBE6.js.map → Command-N6VujV30.js.map} +1 -1
  170. package/lib/{Dialog-BQciPiHN.js → Dialog-hlvmmQ_c.js} +2 -2
  171. package/lib/{Dialog-BQciPiHN.js.map → Dialog-hlvmmQ_c.js.map} +1 -1
  172. package/lib/{Drawer-Ci7XwhqT.js → Drawer-Ch7927PF.js} +7 -7
  173. package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-Ch7927PF.js.map} +1 -1
  174. package/lib/{DropdownMenu-C8SX_-S_.js → DropdownMenu-DN0jNrjj.js} +2 -2
  175. package/lib/{DropdownMenu-C8SX_-S_.js.map → DropdownMenu-DN0jNrjj.js.map} +1 -1
  176. package/lib/Frame-DKlOmSkU.js +205 -0
  177. package/lib/Frame-DKlOmSkU.js.map +1 -0
  178. package/lib/HydrationBoundary-CNF2ZV3E.js +601 -0
  179. package/lib/HydrationBoundary-CNF2ZV3E.js.map +1 -0
  180. package/lib/{IndexingDialog-B5zCiUKr.js → IndexingDialog-D0YdGfbn.js} +3 -3
  181. package/lib/{IndexingDialog-B5zCiUKr.js.map → IndexingDialog-D0YdGfbn.js.map} +1 -1
  182. package/lib/Input-Cx-GeKoF.js +22 -0
  183. package/lib/Input-Cx-GeKoF.js.map +1 -0
  184. package/lib/{MdxPage-BagO2c-n.js → MdxPage-BiAVpP8K.js} +11 -11
  185. package/lib/{MdxPage-BagO2c-n.js.map → MdxPage-BiAVpP8K.js.map} +1 -1
  186. package/lib/{Mermaid-D_VSX7_Q.js → Mermaid-DEztDKFw.js} +4 -4
  187. package/lib/{Mermaid-D_VSX7_Q.js.map → Mermaid-DEztDKFw.js.map} +1 -1
  188. package/lib/{OAuthErrorPage-Fq54RLgt.js → OAuthErrorPage-DhJo-O2B.js} +15 -15
  189. package/lib/OAuthErrorPage-DhJo-O2B.js.map +1 -0
  190. package/lib/OasProvider-DFMZwyNn.js +48 -0
  191. package/lib/OasProvider-DFMZwyNn.js.map +1 -0
  192. package/lib/{OperationList-C0jiEaG5.js → OperationList-CnmLfOuu.js} +1560 -1545
  193. package/lib/{OperationList-C0jiEaG5.js.map → OperationList-CnmLfOuu.js.map} +1 -1
  194. package/lib/RouteGuard-CZuPjknT.js +77 -0
  195. package/lib/RouteGuard-CZuPjknT.js.map +1 -0
  196. package/lib/{SchemaList-BU0zCHn9.js → SchemaList-B5ikunUd.js} +9 -9
  197. package/lib/{SchemaList-BU0zCHn9.js.map → SchemaList-B5ikunUd.js.map} +1 -1
  198. package/lib/SchemaView-rjji7zMf.js +438 -0
  199. package/lib/SchemaView-rjji7zMf.js.map +1 -0
  200. package/lib/{Select-CkxXP5I7.js → Secret-BE7V0Vb5.js} +159 -139
  201. package/lib/Secret-BE7V0Vb5.js.map +1 -0
  202. package/lib/{Separator-CTPSeW1S.js → Separator-BXt1LYnm.js} +2 -2
  203. package/lib/{Separator-CTPSeW1S.js.map → Separator-BXt1LYnm.js.map} +1 -1
  204. package/lib/SignUp-DHWDXat-.js +50 -0
  205. package/lib/SignUp-DHWDXat-.js.map +1 -0
  206. package/lib/{SyntaxHighlight-Kdyskw3C.js → SyntaxHighlight-paLQ8NP8.js} +1751 -1725
  207. package/lib/SyntaxHighlight-paLQ8NP8.js.map +1 -0
  208. package/lib/{Toc-DJxFPfcS.js → Toc-vMbSQCkj.js} +3 -3
  209. package/lib/{Toc-DJxFPfcS.js.map → Toc-vMbSQCkj.js.map} +1 -1
  210. package/lib/ZudokuContext-CnEI8jPU.js +389 -0
  211. package/lib/ZudokuContext-CnEI8jPU.js.map +1 -0
  212. package/lib/{___vite-browser-external_commonjs-proxy-Cga3HsWk.js → ___vite-browser-external_commonjs-proxy-BttVsNON.js} +2 -2
  213. package/lib/___vite-browser-external_commonjs-proxy-BttVsNON.js.map +1 -0
  214. package/lib/chunk-EPOLDU6W-C6C8jAwd.js +8558 -0
  215. package/lib/chunk-EPOLDU6W-C6C8jAwd.js.map +1 -0
  216. package/lib/{circular-CzWF1hj5.js → circular-CLhJAE3S.js} +771 -749
  217. package/lib/{circular-CzWF1hj5.js.map → circular-CLhJAE3S.js.map} +1 -1
  218. package/lib/{cn-dYga0KKN.js → cn-5-Gd1Dss.js} +531 -498
  219. package/lib/cn-5-Gd1Dss.js.map +1 -0
  220. package/lib/{createServer-BIr2_tGn.js → createServer-BYtu5Pcr.js} +12 -12
  221. package/lib/{createServer-BIr2_tGn.js.map → createServer-BYtu5Pcr.js.map} +1 -1
  222. package/lib/createVariantComponent-Dc0vtOvr.js +18 -0
  223. package/lib/createVariantComponent-Dc0vtOvr.js.map +1 -0
  224. package/lib/{errors-Bs4duWDy.js → errors-DkJIl45d.js} +3 -3
  225. package/lib/{errors-Bs4duWDy.js.map → errors-DkJIl45d.js.map} +1 -1
  226. package/lib/{firebase-Cax7HPzn.js → firebase-CmsW0j7-.js} +1579 -1325
  227. package/lib/firebase-CmsW0j7-.js.map +1 -0
  228. package/lib/hook-Da8QTnPd.js +52 -0
  229. package/lib/hook-Da8QTnPd.js.map +1 -0
  230. package/lib/{index-Css56y3F.js → index-Ba6RP577.js} +4 -4
  231. package/lib/{index-Css56y3F.js.map → index-Ba6RP577.js.map} +1 -1
  232. package/lib/index-CrcNWbel.js.map +1 -1
  233. package/lib/{index-Bh-MffiL.js → index-D35F-SCL.js} +2 -2
  234. package/lib/{index-Bh-MffiL.js.map → index-D35F-SCL.js.map} +1 -1
  235. package/lib/{index-0oT9beQN.js → index-k0PVZBYl.js} +155 -151
  236. package/lib/{index-0oT9beQN.js.map → index-k0PVZBYl.js.map} +1 -1
  237. package/lib/{ErrorAlert-DrOR8w3f.js → index-ofqkdEjL.js} +5457 -4444
  238. package/lib/index-ofqkdEjL.js.map +1 -0
  239. package/lib/index.esm-BYObtETB.js.map +1 -1
  240. package/lib/{index.esm-DtzT_KoE.js → index.esm-B_0dvNjB.js} +2 -2
  241. package/lib/{index.esm-DtzT_KoE.js.map → index.esm-B_0dvNjB.js.map} +1 -1
  242. package/lib/{index.esm-DDENMN4y.js → index.esm-DFzsB75P.js} +16 -14
  243. package/lib/index.esm-DFzsB75P.js.map +1 -0
  244. package/lib/{invariant-CGOLuIIz.js → invariant-BJAl77rw.js} +4 -4
  245. package/lib/invariant-BJAl77rw.js.map +1 -0
  246. package/lib/jsx-runtime-BzflLqGi.js.map +1 -1
  247. package/lib/{mutation-BoVlx8yA.js → mutation-BISOc7OM.js} +70 -44
  248. package/lib/mutation-BISOc7OM.js.map +1 -0
  249. package/lib/ui/Accordion.js +1 -1
  250. package/lib/ui/ActionButton.js +2 -2
  251. package/lib/ui/Alert.js +1 -1
  252. package/lib/ui/AlertDialog.js +1 -1
  253. package/lib/ui/Badge.js +1 -1
  254. package/lib/ui/Breadcrumb.js +1 -1
  255. package/lib/ui/Button.js +7 -6
  256. package/lib/ui/Button.js.map +1 -1
  257. package/lib/ui/ButtonGroup.js +1 -1
  258. package/lib/ui/Callout.js +1 -1
  259. package/lib/ui/Card.js +1 -1
  260. package/lib/ui/Carousel.js +1 -1
  261. package/lib/ui/Carousel.js.map +1 -1
  262. package/lib/ui/Checkbox.js +1 -1
  263. package/lib/ui/CodeBlock.js +1 -1
  264. package/lib/ui/Command.js +2 -2
  265. package/lib/ui/Dialog.js +1 -1
  266. package/lib/ui/Drawer.js +3 -3
  267. package/lib/ui/DropdownMenu.js +1 -1
  268. package/lib/ui/EmbeddedCodeBlock.js +1 -1
  269. package/lib/ui/Form.js +1 -1
  270. package/lib/ui/Frame.js +1 -1
  271. package/lib/ui/HoverCard.js +1 -1
  272. package/lib/ui/Input.js +1 -1
  273. package/lib/ui/Item.js +1 -1
  274. package/lib/ui/Label.js +1 -1
  275. package/lib/ui/NativeSelect.js +1 -1
  276. package/lib/ui/Pagination.js +1 -1
  277. package/lib/ui/Popover.js +1 -1
  278. package/lib/ui/Progress.js +1 -1
  279. package/lib/ui/RadioGroup.js +1 -1
  280. package/lib/ui/ScrollArea.js +1 -1
  281. package/lib/ui/Secret.js +3 -3
  282. package/lib/ui/Secret.js.map +1 -1
  283. package/lib/ui/Separator.js +1 -1
  284. package/lib/ui/Skeleton.js +1 -1
  285. package/lib/ui/Slider.js +1 -1
  286. package/lib/ui/Switch.js +1 -1
  287. package/lib/ui/SyntaxHighlight.js +3 -3
  288. package/lib/ui/Tabs.js +1 -1
  289. package/lib/ui/Textarea.js +1 -1
  290. package/lib/ui/Toggle.js +1 -1
  291. package/lib/ui/ToggleGroup.js +1 -1
  292. package/lib/ui/Value.js +1 -1
  293. package/lib/ui/util.js +1 -1
  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 +826 -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 +23 -21
  311. package/lib/zudoku.hooks.js +3 -3
  312. package/lib/zudoku.mermaid.js +3 -3
  313. package/lib/zudoku.plugin-api-catalog.js +8 -8
  314. package/lib/zudoku.plugin-api-keys.js +607 -552
  315. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  316. package/lib/zudoku.plugin-custom-pages.js +1 -1
  317. package/lib/zudoku.plugin-markdown.js +1 -1
  318. package/lib/zudoku.plugin-openapi.js +3 -3
  319. package/lib/zudoku.plugin-redirect.js +1 -1
  320. package/lib/zudoku.plugin-search-pagefind.js +30 -29
  321. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  322. package/lib/zudoku.plugins.js +9 -8
  323. package/lib/zudoku.plugins.js.map +1 -1
  324. package/lib/zudoku.react-query.js +440 -0
  325. package/lib/zudoku.react-query.js.map +1 -0
  326. package/lib/zudoku.router.js +1130 -1404
  327. package/lib/zudoku.router.js.map +1 -1
  328. package/package.json +36 -22
  329. package/src/lib/auth/issuer.ts +1 -1
  330. package/src/lib/authentication/authentication.ts +8 -2
  331. package/src/lib/authentication/components/CallbackHandler.tsx +1 -1
  332. package/src/lib/authentication/components/SignIn.tsx +5 -2
  333. package/src/lib/authentication/components/SignUp.tsx +5 -2
  334. package/src/lib/authentication/hook.ts +16 -0
  335. package/src/lib/authentication/providers/auth0.tsx +15 -9
  336. package/src/lib/authentication/providers/clerk.tsx +0 -26
  337. package/src/lib/authentication/providers/firebase.tsx +98 -6
  338. package/src/lib/authentication/providers/supabase.tsx +6 -15
  339. package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
  340. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +181 -39
  341. package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
  342. package/src/lib/components/Bootstrap.tsx +1 -4
  343. package/src/lib/components/Pagination.tsx +4 -5
  344. package/src/lib/components/Zudoku.tsx +5 -11
  345. package/src/lib/components/context/ZudokuContext.ts +2 -6
  346. package/src/lib/components/context/ZudokuProvider.tsx +1 -1
  347. package/src/lib/components/context/ZudokuReactContext.tsx +17 -0
  348. package/src/lib/components/index.ts +4 -0
  349. package/src/lib/components/navigation/NavigationItem.tsx +9 -3
  350. package/src/lib/core/RouteGuard.tsx +30 -24
  351. package/src/lib/core/plugins.ts +21 -1
  352. package/src/lib/core/react-query.ts +1 -0
  353. package/src/lib/core/transform-config.ts +29 -0
  354. package/src/lib/errors/ErrorAlert.tsx +1 -6
  355. package/src/lib/errors/ErrorMessage.tsx +38 -0
  356. package/src/lib/oas/graphql/circular.test.ts +186 -0
  357. package/src/lib/oas/graphql/circular.ts +49 -10
  358. package/src/lib/oas/graphql/index.ts +7 -3
  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/ui/Secret.tsx +2 -2
  375. package/src/lib/util/invariant.ts +2 -1
  376. package/src/shiki/langs/c3.js +1 -0
  377. package/src/shiki/langs/gn.js +1 -0
  378. package/src/shiki/langs/moonbit.js +1 -0
  379. package/lib/ClaudeLogo-B4Xxt-x_.js.map +0 -1
  380. package/lib/ErrorAlert-DrOR8w3f.js.map +0 -1
  381. package/lib/OAuthErrorPage-Fq54RLgt.js.map +0 -1
  382. package/lib/OasProvider-DPH8mwDa.js +0 -40
  383. package/lib/OasProvider-DPH8mwDa.js.map +0 -1
  384. package/lib/RouteGuard-9wjejsKm.js +0 -77
  385. package/lib/RouteGuard-9wjejsKm.js.map +0 -1
  386. package/lib/RouterError-DSLXagd5.js +0 -42
  387. package/lib/RouterError-DSLXagd5.js.map +0 -1
  388. package/lib/SchemaView-DVae4RO2.js +0 -597
  389. package/lib/SchemaView-DVae4RO2.js.map +0 -1
  390. package/lib/Select-CkxXP5I7.js.map +0 -1
  391. package/lib/SignUp-BjS4ozA7.js +0 -50
  392. package/lib/SignUp-BjS4ozA7.js.map +0 -1
  393. package/lib/SyntaxHighlight-Kdyskw3C.js.map +0 -1
  394. package/lib/ZudokuContext-BXldanA8.js +0 -1508
  395. package/lib/ZudokuContext-BXldanA8.js.map +0 -1
  396. package/lib/___vite-browser-external_commonjs-proxy-Cga3HsWk.js.map +0 -1
  397. package/lib/chunk-PVWAREVJ-dLIqswPy.js +0 -7965
  398. package/lib/chunk-PVWAREVJ-dLIqswPy.js.map +0 -1
  399. package/lib/cn-dYga0KKN.js.map +0 -1
  400. package/lib/createVariantComponent-B9_dVBvu.js +0 -35
  401. package/lib/createVariantComponent-B9_dVBvu.js.map +0 -1
  402. package/lib/firebase-Cax7HPzn.js.map +0 -1
  403. package/lib/hook-BNxidGQq.js +0 -40
  404. package/lib/hook-BNxidGQq.js.map +0 -1
  405. package/lib/index-CCmMJp02.js +0 -1059
  406. package/lib/index-CCmMJp02.js.map +0 -1
  407. package/lib/index.esm-DDENMN4y.js.map +0 -1
  408. package/lib/invariant-CGOLuIIz.js.map +0 -1
  409. package/lib/mutation-BoVlx8yA.js.map +0 -1
  410. package/lib/useMutation-C6RqWmTS.js.map +0 -1
@@ -1,597 +0,0 @@
1
- import { j as t } from "./jsx-runtime-BzflLqGi.js";
2
- import { ChevronUpIcon as T, ChevronDownIcon as _, ChevronsLeftRightIcon as J, MinusIcon as U, PlusIcon as G, RefreshCcwDotIcon as K, InfoIcon as W } from "lucide-react";
3
- import { useState as j, isValidElement as Q, Fragment as C } from "react";
4
- import { c as a } from "./cn-dYga0KKN.js";
5
- import { Slot as X } from "@radix-ui/react-slot";
6
- import { c as Y } from "./index-DI5SPFK9.js";
7
- import { Separator as Z } from "./ui/Separator.js";
8
- import { S as m, I as q, M as E } from "./ErrorAlert-DrOR8w3f.js";
9
- import { B as H } from "./Button-CynVW1JV.js";
10
- import * as P from "@radix-ui/react-collapsible";
11
- import { Button as ee } from "./ui/Button.js";
12
- import { Badge as te } from "./ui/Badge.js";
13
- import { Frame as re, FramePanel as ne } from "./ui/Frame.js";
14
- import { C as se } from "./circular-CzWF1hj5.js";
15
- const Ee = ({
16
- name: e,
17
- children: r
18
- }) => /* @__PURE__ */ t.jsx("span", { "data-pagefind-meta": e, className: "sr-only", children: r }), ie = (e, r) => e.reduce(
19
- (n, i) => {
20
- const o = r(i);
21
- return n[o] || (n[o] = []), n[o].push(i), n;
22
- },
23
- {}
24
- );
25
- function N({ className: e, ...r }) {
26
- return /* @__PURE__ */ t.jsx(
27
- "div",
28
- {
29
- "data-slot": "frame",
30
- className: a(
31
- "relative flex flex-col rounded-2xl bg-muted p-1",
32
- e
33
- ),
34
- ...r
35
- }
36
- );
37
- }
38
- function b({ className: e, ...r }) {
39
- return /* @__PURE__ */ t.jsx(
40
- "div",
41
- {
42
- "data-slot": "frame-panel",
43
- className: a(
44
- "relative bg-clip-padding rounded-xl border bg-card p-5 shadow-xs",
45
- "before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]",
46
- e
47
- ),
48
- ...r
49
- }
50
- );
51
- }
52
- function oe({ className: e, ...r }) {
53
- return /* @__PURE__ */ t.jsx(
54
- "header",
55
- {
56
- "data-slot": "frame-panel-header",
57
- className: a("flex flex-col p-4", e),
58
- ...r
59
- }
60
- );
61
- }
62
- function le({
63
- className: e,
64
- ...r
65
- }) {
66
- return /* @__PURE__ */ t.jsx(
67
- "div",
68
- {
69
- "data-slot": "frame-panel-description",
70
- className: a("text-sm text-muted-foreground", e),
71
- ...r
72
- }
73
- );
74
- }
75
- function ae({ className: e, ...r }) {
76
- return /* @__PURE__ */ t.jsx(
77
- "footer",
78
- {
79
- "data-slot": "frame-panel-footer",
80
- className: a("flex flex-col gap-1 px-5 py-4", e),
81
- ...r
82
- }
83
- );
84
- }
85
- function de({ className: e, ...r }) {
86
- return /* @__PURE__ */ t.jsx(
87
- "div",
88
- {
89
- role: "list",
90
- "data-slot": "item-group",
91
- className: a("group/item-group flex flex-col", e),
92
- ...r
93
- }
94
- );
95
- }
96
- function S({
97
- className: e,
98
- ...r
99
- }) {
100
- return /* @__PURE__ */ t.jsx(
101
- Z,
102
- {
103
- "data-slot": "item-separator",
104
- orientation: "horizontal",
105
- className: a("my-0", e),
106
- ...r
107
- }
108
- );
109
- }
110
- const ce = Y(
111
- "group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
112
- {
113
- variants: {
114
- variant: {
115
- default: "bg-transparent",
116
- outline: "border-border",
117
- muted: "bg-muted/50"
118
- },
119
- size: {
120
- default: "p-4 gap-4 ",
121
- sm: "py-3 px-4 gap-2.5"
122
- }
123
- },
124
- defaultVariants: {
125
- variant: "default",
126
- size: "default"
127
- }
128
- }
129
- );
130
- function $({
131
- className: e,
132
- variant: r = "default",
133
- size: n = "default",
134
- asChild: i = !1,
135
- ...o
136
- }) {
137
- const s = i ? X : "div";
138
- return /* @__PURE__ */ t.jsx(
139
- s,
140
- {
141
- "data-slot": "item",
142
- "data-variant": r,
143
- "data-size": n,
144
- className: a(ce({ variant: r, size: n, className: e })),
145
- ...o
146
- }
147
- );
148
- }
149
- function g({ className: e, ...r }) {
150
- return /* @__PURE__ */ t.jsx(
151
- "div",
152
- {
153
- "data-slot": "item-content",
154
- className: a(
155
- "flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
156
- e
157
- ),
158
- ...r
159
- }
160
- );
161
- }
162
- function w({ className: e, ...r }) {
163
- return /* @__PURE__ */ t.jsx(
164
- "div",
165
- {
166
- "data-slot": "item-title",
167
- className: a(
168
- "flex w-fit items-center gap-2 text-sm leading-snug font-medium",
169
- e
170
- ),
171
- ...r
172
- }
173
- );
174
- }
175
- function pe({ className: e, ...r }) {
176
- return /* @__PURE__ */ t.jsx(
177
- "div",
178
- {
179
- "data-slot": "item-actions",
180
- className: a("flex items-center gap-2", e),
181
- ...r
182
- }
183
- );
184
- }
185
- const z = ({
186
- schema: e,
187
- hideDescription: r = !1
188
- }) => /* @__PURE__ */ t.jsx("div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ t.jsxs("div", { children: [
189
- /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Const value: " }),
190
- /* @__PURE__ */ t.jsx(m, { className: "border rounded px-1 font-mono", children: e.const }),
191
- !r && e.description && /* @__PURE__ */ t.jsx("div", { className: "text-muted-foreground", children: e.description })
192
- ] }) }), v = ({
193
- values: e,
194
- className: r,
195
- maxVisibleValues: n = 8
196
- }) => {
197
- const [i, o] = j(!1);
198
- if (!e.length) return null;
199
- const s = e.length > n, l = s && !i ? e.slice(0, n) : e;
200
- return /* @__PURE__ */ t.jsxs("div", { className: a("flex flex-wrap gap-1.5", r), children: [
201
- /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Enum values:" }),
202
- l.map((c) => /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(m, { className: "border rounded-sm px-1 font-mono", children: c }) }, c)),
203
- s && /* @__PURE__ */ t.jsx(
204
- H,
205
- {
206
- variant: "ghost",
207
- size: "sm",
208
- className: "h-fit px-0",
209
- onClick: () => o(!i),
210
- children: i ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
211
- /* @__PURE__ */ t.jsx(T, { size: 12 }),
212
- /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "show less" })
213
- ] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-1", children: [
214
- /* @__PURE__ */ t.jsx(_, { size: 12 }),
215
- /* @__PURE__ */ t.jsxs("span", { className: "text-muted-foreground", children: [
216
- "show ",
217
- e.length - n,
218
- " more"
219
- ] })
220
- ] })
221
- }
222
- )
223
- ] });
224
- }, xe = ({ pattern: e }) => {
225
- const [r, n] = j(!1), i = e.length > 20, o = i ? `${e.slice(0, 20)}…` : e;
226
- return /* @__PURE__ */ t.jsxs(
227
- q,
228
- {
229
- className: a("text-xs", i && "cursor-pointer"),
230
- onClick: () => n(!r),
231
- selectOnClick: !1,
232
- children: [
233
- r ? e : o,
234
- i && /* @__PURE__ */ t.jsx("button", { type: "button", className: "p-1 translate-y-[2px]", children: !r && /* @__PURE__ */ t.jsx(J, { size: 12 }) })
235
- ]
236
- }
237
- );
238
- }, ue = (e) => e ? [
239
- e.type === "array" && e.items.type ? Array.isArray(e.items.type) ? `(${e.items.type.join(" | ")})[]` : `${e.items.type}[]` : Array.isArray(e.type) ? e.type.join(" | ") : e.type,
240
- e.enum && "enum",
241
- e.const && "const",
242
- e.format,
243
- e.minimum !== void 0 && `min: ${e.minimum}`,
244
- e.maximum !== void 0 && `max: ${e.maximum}`,
245
- e.minLength !== void 0 && `minLength: ${e.minLength}`,
246
- e.maxLength !== void 0 && `maxLength: ${e.maxLength}`,
247
- e.minItems !== void 0 && `minItems: ${e.minItems}`,
248
- e.maxItems !== void 0 && `maxItems: ${e.maxItems}`,
249
- e.minProperties !== void 0 && `minProps: ${e.minProperties}`,
250
- e.maxProperties !== void 0 && `maxProps: ${e.maxProperties}`,
251
- e.uniqueItems && "unique",
252
- e.readOnly && "readOnly",
253
- e.writeOnly && "writeOnly",
254
- e.deprecated && "deprecated",
255
- e.pattern && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
256
- "pattern: ",
257
- /* @__PURE__ */ t.jsx(xe, { pattern: e.pattern })
258
- ] })
259
- ] : [], h = ({
260
- schema: e,
261
- extraItems: r = [],
262
- className: n
263
- }) => {
264
- const i = [...ue(e), ...r].flatMap(
265
- (o) => typeof o == "string" || Q(o) ? o : []
266
- );
267
- return /* @__PURE__ */ t.jsx("span", { className: n, children: i.map((o, s) => (
268
- // biome-ignore lint/suspicious/noArrayIndexKey: index should be stable
269
- /* @__PURE__ */ t.jsxs("span", { className: "text-muted-foreground", children: [
270
- o,
271
- s < i.length - 1 && /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground/50", children: " · " })
272
- ] }, s)
273
- )) });
274
- }, I = ({
275
- schema: e
276
- }) => {
277
- const r = e.examples?.at(0), n = e.default;
278
- return r === void 0 && n === void 0 ? null : /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-1", children: [
279
- r !== void 0 && /* @__PURE__ */ t.jsxs("div", { children: [
280
- /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Example: " }),
281
- /* @__PURE__ */ t.jsx(m, { className: "border rounded-sm px-1 font-mono", children: typeof r == "object" || typeof r == "boolean" ? JSON.stringify(r) : r })
282
- ] }),
283
- n !== void 0 && /* @__PURE__ */ t.jsxs("div", { children: [
284
- /* @__PURE__ */ t.jsx("span", { className: "text-muted-foreground", children: "Default: " }),
285
- /* @__PURE__ */ t.jsx(m, { className: "border rounded-sm px-1 font-mono", children: typeof n == "object" || typeof n == "boolean" ? JSON.stringify(n) : n })
286
- ] })
287
- ] });
288
- }, R = (e) => typeof e == "string" && ["string", "number", "boolean", "integer", "null"].includes(e) || Array.isArray(e) && e.every(R), f = (e) => e.type === "array" || // schema.type might be an array of types, so we need to check if "array" is one of them
289
- Array.isArray(e.type) && e.type.includes("array"), k = (e) => e && (e.type === "object" && Object.keys(e.properties ?? {}).length > 0 || e.type === "array" && typeof e.items == "object" && (!e.items.type || e.items.type === "object")), B = (e) => typeof e == "string" && e.startsWith(se), F = (e) => f(e) && "items" in e && B(e.items), me = (e) => typeof e == "string" ? e.split(":")[1] : void 0, V = ({ circularProp: e }) => /* @__PURE__ */ t.jsxs(
290
- q,
291
- {
292
- className: "inline-flex items-center gap-1.5 text-xs translate-y-0.5",
293
- selectOnClick: !1,
294
- children: [
295
- /* @__PURE__ */ t.jsx(K, { size: 13 }),
296
- /* @__PURE__ */ t.jsx("span", { children: e ? `${e} (circular)` : "circular" })
297
- ]
298
- }
299
- ), fe = ({
300
- name: e,
301
- schema: r,
302
- group: n,
303
- defaultOpen: i = !1,
304
- showCollapseButton: o = !0
305
- }) => {
306
- const [s, l] = j(i);
307
- if (B(r))
308
- return /* @__PURE__ */ t.jsx($, { children: /* @__PURE__ */ t.jsxs(g, { className: "gap-y-2", children: [
309
- /* @__PURE__ */ t.jsxs("div", { children: [
310
- /* @__PURE__ */ t.jsx(w, { className: "inline me-2", children: /* @__PURE__ */ t.jsx("code", { children: e }) }),
311
- /* @__PURE__ */ t.jsx(
312
- h,
313
- {
314
- className: "inline",
315
- schema: r,
316
- extraItems: [
317
- n !== "optional" && /* @__PURE__ */ t.jsx("span", { className: "text-primary", children: "required" }),
318
- /* @__PURE__ */ t.jsx(V, {}, "circular-ref")
319
- ]
320
- }
321
- )
322
- ] }),
323
- /* @__PURE__ */ t.jsx(I, { schema: r })
324
- ] }) });
325
- const c = !!((r.allOf || r.anyOf || r.oneOf || k(r) || f(r) && "items" in r && k(r.items) || r.additionalProperties) && !F(r)), x = !!(r.description || "items" in r && r.items?.enum || r.const || r.enum || r.example !== void 0 || r.default !== void 0);
326
- return /* @__PURE__ */ t.jsxs($, { children: [
327
- /* @__PURE__ */ t.jsxs(g, { className: "gap-y-2", children: [
328
- /* @__PURE__ */ t.jsxs("div", { children: [
329
- /* @__PURE__ */ t.jsx(w, { className: "inline me-2", children: c ? /* @__PURE__ */ t.jsx(
330
- "button",
331
- {
332
- onClick: () => l(!s),
333
- type: "button",
334
- className: "hover:underline",
335
- children: /* @__PURE__ */ t.jsx("code", { children: e })
336
- }
337
- ) : /* @__PURE__ */ t.jsx("code", { children: e }) }),
338
- /* @__PURE__ */ t.jsx(
339
- h,
340
- {
341
- className: "inline",
342
- schema: r,
343
- extraItems: [
344
- n !== "optional" && /* @__PURE__ */ t.jsx("span", { className: "text-primary", children: "required" }),
345
- F(r) && /* @__PURE__ */ t.jsx(
346
- V,
347
- {
348
- circularProp: me(r.items)
349
- }
350
- )
351
- ]
352
- }
353
- )
354
- ] }),
355
- x && /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-1.5", children: [
356
- r.description && /* @__PURE__ */ t.jsx(E, { className: "prose-sm", content: r.description }),
357
- "items" in r && r.items?.enum && /* @__PURE__ */ t.jsx(v, { values: r.items.enum }),
358
- r.const && /* @__PURE__ */ t.jsx(z, { schema: r, hideDescription: !0 }),
359
- r.enum && /* @__PURE__ */ t.jsx(v, { values: r.enum }),
360
- /* @__PURE__ */ t.jsx(I, { schema: r })
361
- ] })
362
- ] }),
363
- c && o && /* @__PURE__ */ t.jsx(pe, { className: "self-start", children: /* @__PURE__ */ t.jsx(
364
- ee,
365
- {
366
- variant: "ghost",
367
- size: "icon",
368
- className: "rounded-full",
369
- onClick: () => l(!s),
370
- "aria-label": "Toggle properties",
371
- children: s ? /* @__PURE__ */ t.jsx(U, { size: 16 }) : /* @__PURE__ */ t.jsx(G, { size: 16 })
372
- }
373
- ) }),
374
- c && /* @__PURE__ */ t.jsx(
375
- P.Root,
376
- {
377
- defaultOpen: i,
378
- open: s,
379
- onOpenChange: l,
380
- className: a("w-full", !s && "contents"),
381
- children: /* @__PURE__ */ t.jsx(P.Content, { asChild: !0, children: /* @__PURE__ */ t.jsx(g, { children: r.anyOf || r.oneOf || r.type === "object" ? /* @__PURE__ */ t.jsx(u, { schema: r }) : f(r) && "items" in r ? /* @__PURE__ */ t.jsx(u, { schema: r.items }) : null }) })
382
- }
383
- )
384
- ] });
385
- }, M = (e) => {
386
- const r = e.oneOf ?? e.anyOf ?? [];
387
- return e.properties && Object.keys(e.properties).length > 0 ? r.map((n) => !n.properties && !n.type && !n.oneOf && !n.anyOf ? {
388
- ...n,
389
- type: "object",
390
- properties: e.properties,
391
- required: n.required ?? e.required
392
- } : n) : r;
393
- }, je = (e) => {
394
- if (Array.isArray(e.oneOf)) return "exactly-one";
395
- const r = e.discriminator?.propertyName;
396
- if (!r) return "at-least-one";
397
- const n = M(e), i = /* @__PURE__ */ new Set();
398
- for (const o of n) {
399
- const s = o.properties?.[r], l = s?.const ?? (Array.isArray(s?.enum) && s.enum.length === 1 ? String(s.enum[0]) : void 0);
400
- if (l == null || i.has(String(l))) return "at-least-one";
401
- i.add(String(l));
402
- }
403
- return "exactly-one";
404
- }, O = (e, r) => r.title?.trim() || `Variant ${e + 1}`, ye = (e, r) => {
405
- const n = [];
406
- e.type && n.push(
407
- `type = ${Array.isArray(e.type) ? e.type.join("|") : e.type}`
408
- );
409
- const i = r?.discriminator?.propertyName;
410
- if (i) {
411
- const s = e.properties?.[i], l = s?.const ?? (Array.isArray(s?.enum) && s.enum.length === 1 ? s.enum[0] : void 0);
412
- l !== void 0 && n.push(`${i}=${JSON.stringify(l)}`);
413
- }
414
- const o = (e.required ?? []).filter((s) => s !== i);
415
- if (o.length) {
416
- const s = o.slice(0, 3).join(", "), l = o.length > 3 ? ` +${o.length - 3} more` : "";
417
- n.push(`requires: ${s}${l}`);
418
- }
419
- return n;
420
- }, ge = ({
421
- variants: e,
422
- schema: r,
423
- selectedVariant: n,
424
- onSelectVariant: i
425
- }) => {
426
- const o = e.map((s, l) => ({
427
- label: O(l, s),
428
- guards: ye(s, r)
429
- }));
430
- return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2 text-sm", children: [
431
- /* @__PURE__ */ t.jsx("h4", { className: "font-medium", children: "Decision Table" }),
432
- /* @__PURE__ */ t.jsx("div", { className: "border rounded-md overflow-hidden", children: /* @__PURE__ */ t.jsxs("table", { className: "w-full", children: [
433
- /* @__PURE__ */ t.jsx("thead", { children: /* @__PURE__ */ t.jsxs("tr", { className: "border-b bg-muted/50", children: [
434
- /* @__PURE__ */ t.jsx("th", { className: "text-left p-2 font-medium", children: "Variant" }),
435
- /* @__PURE__ */ t.jsx("th", { className: "text-left p-2 font-medium", children: "Matching Criteria" })
436
- ] }) }),
437
- /* @__PURE__ */ t.jsx("tbody", { className: "divide-y", children: o.map((s) => /* @__PURE__ */ t.jsxs("tr", { className: "hover:bg-muted/30", children: [
438
- /* @__PURE__ */ t.jsx("td", { className: "p-2 font-medium", children: /* @__PURE__ */ t.jsx(
439
- "button",
440
- {
441
- type: "button",
442
- className: a(
443
- "hover:underline",
444
- n === s.label && "text-primary"
445
- ),
446
- onClick: () => i(s.label),
447
- children: s.label
448
- }
449
- ) }),
450
- /* @__PURE__ */ t.jsx("td", { className: "p-2 text-muted-foreground text-xs", children: s.guards.length > 0 ? s.guards.join(" · ") : "No specific criteria" })
451
- ] }, s.label)) })
452
- ] }) })
453
- ] });
454
- }, Ne = ({
455
- schema: e,
456
- cardHeader: r
457
- }) => {
458
- const n = Array.isArray(e.oneOf) ? "oneOf" : Array.isArray(e.anyOf) ? "anyOf" : void 0, i = n ? M(e) : [], [o, s] = j(
459
- () => i[0] ? O(0, i[0]) : ""
460
- );
461
- if (!n) return null;
462
- const c = je(e) === "exactly-one" ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
463
- "Exactly one variant ",
464
- /* @__PURE__ */ t.jsx("b", { children: "must match" }),
465
- "."
466
- ] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
467
- "At least one variant ",
468
- /* @__PURE__ */ t.jsx("b", { children: "must match" }),
469
- ". Multiple variants",
470
- " ",
471
- /* @__PURE__ */ t.jsx("i", { children: "may match" }),
472
- " simultaneously."
473
- ] }), x = i.findIndex(
474
- (p, y) => O(y, p) === o
475
- ), d = x >= 0 ? i[x] : null;
476
- return /* @__PURE__ */ t.jsxs(re, { children: [
477
- r,
478
- /* @__PURE__ */ t.jsxs(ne, { className: "text-sm flex flex-col gap-4", children: [
479
- /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-2", children: [
480
- /* @__PURE__ */ t.jsx(te, { variant: "outline", children: n }),
481
- /* @__PURE__ */ t.jsx("div", { className: "flex-1 p-2", children: /* @__PURE__ */ t.jsx("span", { className: "text-sm", children: c }) })
482
- ] }),
483
- /* @__PURE__ */ t.jsx(
484
- ge,
485
- {
486
- variants: i,
487
- schema: e,
488
- selectedVariant: o,
489
- onSelectVariant: s
490
- }
491
- ),
492
- /* @__PURE__ */ t.jsxs("strong", { children: [
493
- "Properties for ",
494
- o,
495
- ":"
496
- ] }),
497
- d && /* @__PURE__ */ t.jsx(u, { schema: d })
498
- ] })
499
- ] });
500
- }, be = (e) => e && /* @__PURE__ */ t.jsx(
501
- E,
502
- {
503
- className: "text-sm leading-normal line-clamp-4",
504
- content: e
505
- }
506
- ), ve = (e, r, n) => {
507
- const i = /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
508
- /* @__PURE__ */ t.jsx("span", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ t.jsx(h, { schema: e }) }),
509
- e.enum && /* @__PURE__ */ t.jsx(v, { values: e.enum }),
510
- be(e.description),
511
- /* @__PURE__ */ t.jsx(I, { schema: e })
512
- ] });
513
- return n ? /* @__PURE__ */ t.jsx("div", { className: "space-y-2 p-4", children: i }) : /* @__PURE__ */ t.jsxs(N, { children: [
514
- r,
515
- /* @__PURE__ */ t.jsx(b, { className: "space-y-2", children: i })
516
- ] });
517
- }, u = ({
518
- schema: e,
519
- defaultOpen: r = !1,
520
- cardHeader: n,
521
- embedded: i
522
- }) => {
523
- if (!e || Object.keys(e).length === 0)
524
- return /* @__PURE__ */ t.jsxs(N, { children: [
525
- n,
526
- /* @__PURE__ */ t.jsx(b, { children: /* @__PURE__ */ t.jsx("div", { className: "text-sm text-muted-foreground italic", children: "No data returned" }) })
527
- ] });
528
- if (e.const)
529
- return /* @__PURE__ */ t.jsx(z, { schema: e });
530
- if (Array.isArray(e.oneOf) || Array.isArray(e.anyOf))
531
- return /* @__PURE__ */ t.jsx(Ne, { schema: e, cardHeader: n });
532
- if (R(e.type))
533
- return ve(e, n, i);
534
- if (f(e) && typeof e.items == "object") {
535
- const s = {
536
- type: "object",
537
- properties: { "": e }
538
- };
539
- return /* @__PURE__ */ t.jsx(u, { schema: s, cardHeader: n, defaultOpen: !0 });
540
- }
541
- const o = typeof e.additionalProperties == "object" && /* @__PURE__ */ t.jsx(u, { schema: e.additionalProperties, embedded: !0 });
542
- if (e.type === "object") {
543
- const s = ie(
544
- Object.entries(e.properties ?? {}),
545
- ([d, p]) => p.deprecated ? "deprecated" : e.required?.includes(d) ? "required" : "optional"
546
- ), x = ["required", "optional", "deprecated"].flatMap((d) => {
547
- const p = s[d];
548
- return p ? { group: d, properties: p } : [];
549
- }).map(({ group: d, properties: p }, y) => /* @__PURE__ */ t.jsxs(C, { children: [
550
- y > 0 && /* @__PURE__ */ t.jsx(S, {}),
551
- /* @__PURE__ */ t.jsx(de, { className: "overflow-clip", children: p.map(([A, D], L) => /* @__PURE__ */ t.jsxs(C, { children: [
552
- L > 0 && /* @__PURE__ */ t.jsx(S, {}),
553
- /* @__PURE__ */ t.jsx(
554
- fe,
555
- {
556
- name: A,
557
- schema: D,
558
- group: d,
559
- defaultOpen: r
560
- }
561
- )
562
- ] }, A)) })
563
- ] }, d));
564
- return i ? x : /* @__PURE__ */ t.jsxs(N, { children: [
565
- n,
566
- e.description && /* @__PURE__ */ t.jsx(oe, { children: /* @__PURE__ */ t.jsx(le, { children: e.description }) }),
567
- /* @__PURE__ */ t.jsxs(b, { className: "p-0!", children: [
568
- x,
569
- o
570
- ] }),
571
- e.additionalProperties === !0 && /* @__PURE__ */ t.jsx(ae, { children: /* @__PURE__ */ t.jsxs(
572
- "a",
573
- {
574
- className: "text-sm flex items-center gap-1 hover:underline",
575
- href: "https://swagger.io/docs/specification/v3_0/data-models/dictionaries/",
576
- rel: "noopener noreferrer",
577
- target: "_blank",
578
- children: [
579
- "Additional properties are allowed",
580
- /* @__PURE__ */ t.jsx(W, { size: 14 })
581
- ]
582
- }
583
- ) })
584
- ] });
585
- }
586
- };
587
- export {
588
- v as E,
589
- Ee as P,
590
- u as S,
591
- h as a,
592
- I as b,
593
- B as c,
594
- ie as g,
595
- f as i
596
- };
597
- //# sourceMappingURL=SchemaView-DVae4RO2.js.map