zudoku 0.1.1-dev.5 → 0.1.1-dev.51

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 (606) hide show
  1. package/dist/app/App.js +21 -42
  2. package/dist/app/App.js.map +1 -1
  3. package/dist/app/main.js +11 -15
  4. package/dist/app/main.js.map +1 -1
  5. package/dist/cli/build/handler.js +3 -1
  6. package/dist/cli/build/handler.js.map +1 -1
  7. package/dist/cli/cmds/dev.js +0 -1
  8. package/dist/cli/cmds/dev.js.map +1 -1
  9. package/dist/cli/common/analytics/lib.js +1 -1
  10. package/dist/cli/common/analytics/lib.js.map +1 -1
  11. package/dist/cli/common/logger.d.ts +1 -2
  12. package/dist/cli/common/logger.js +3 -3
  13. package/dist/cli/common/logger.js.map +1 -1
  14. package/dist/cli/common/outdated.js +4 -4
  15. package/dist/cli/common/outdated.js.map +1 -1
  16. package/dist/cli/common/output.js +4 -4
  17. package/dist/cli/common/output.js.map +1 -1
  18. package/dist/cli/common/utils/box.js +2 -2
  19. package/dist/cli/common/utils/box.js.map +1 -1
  20. package/dist/cli/dev/handler.d.ts +1 -1
  21. package/dist/cli/dev/handler.js +14 -3
  22. package/dist/cli/dev/handler.js.map +1 -1
  23. package/dist/config/config.d.ts +39 -9
  24. package/dist/config/validators/auth.d.ts +2 -0
  25. package/dist/config/validators/auth.js +2 -0
  26. package/dist/config/validators/auth.js.map +1 -0
  27. package/dist/config/validators/validate.d.ts +2 -0
  28. package/dist/config/validators/validate.js +4 -0
  29. package/dist/config/validators/validate.js.map +1 -0
  30. package/dist/index.d.ts +2 -6
  31. package/dist/index.js +1 -5
  32. package/dist/index.js.map +1 -1
  33. package/dist/lib/authentication/Callback.d.ts +4 -0
  34. package/dist/lib/authentication/Callback.js +20 -0
  35. package/dist/lib/authentication/Callback.js.map +1 -0
  36. package/dist/lib/authentication/auth0.d.ts +5 -0
  37. package/dist/lib/authentication/auth0.js +9 -0
  38. package/dist/lib/authentication/auth0.js.map +1 -0
  39. package/dist/lib/authentication/authentication.d.ts +10 -0
  40. package/dist/lib/authentication/authentication.js.map +1 -0
  41. package/dist/lib/authentication/clerk.d.ts +4 -0
  42. package/dist/{app → lib}/authentication/clerk.js +19 -9
  43. package/dist/lib/authentication/clerk.js.map +1 -0
  44. package/dist/lib/authentication/openid.d.ts +5 -0
  45. package/dist/lib/authentication/openid.js +136 -0
  46. package/dist/lib/authentication/openid.js.map +1 -0
  47. package/dist/{app → lib}/components/AnchorLink.js.map +1 -1
  48. package/dist/{app → lib}/components/CategoryHeading.js.map +1 -1
  49. package/dist/lib/components/DevPortal.d.ts +25 -0
  50. package/dist/lib/components/DevPortal.js +32 -0
  51. package/dist/lib/components/DevPortal.js.map +1 -0
  52. package/dist/{app → lib}/components/Dialog.d.ts +2 -2
  53. package/dist/{app → lib}/components/Dialog.js +3 -3
  54. package/dist/lib/components/Dialog.js.map +1 -0
  55. package/dist/lib/components/Header.d.ts +1 -0
  56. package/dist/lib/components/Header.js +15 -0
  57. package/dist/{app → lib}/components/Header.js.map +1 -1
  58. package/dist/{app → lib/components}/Heading.js +2 -2
  59. package/dist/lib/components/Heading.js.map +1 -0
  60. package/dist/{app → lib}/components/Input.js.map +1 -1
  61. package/dist/{app → lib}/components/Layout.js +4 -7
  62. package/dist/lib/components/Layout.js.map +1 -0
  63. package/dist/lib/components/Link.d.ts +1 -0
  64. package/dist/lib/components/Link.js +2 -0
  65. package/dist/lib/components/Link.js.map +1 -0
  66. package/dist/{app → lib}/components/Markdown.js.map +1 -1
  67. package/dist/lib/components/Router.d.ts +4 -0
  68. package/dist/lib/components/Router.js +20 -0
  69. package/dist/lib/components/Router.js.map +1 -0
  70. package/dist/lib/components/Select.d.ts +13 -0
  71. package/dist/lib/components/Select.js +27 -0
  72. package/dist/lib/components/Select.js.map +1 -0
  73. package/dist/lib/components/Spinner.d.ts +3 -0
  74. package/dist/lib/components/Spinner.js +4 -0
  75. package/dist/lib/components/Spinner.js.map +1 -0
  76. package/dist/{app → lib}/components/SyntaxHighlight.d.ts +2 -1
  77. package/dist/{app → lib}/components/SyntaxHighlight.js +4 -1
  78. package/dist/lib/components/SyntaxHighlight.js.map +1 -0
  79. package/dist/{app → lib}/components/TopNavigation.js.map +1 -1
  80. package/dist/{app → lib}/components/context/ComponentsContext.d.ts +1 -1
  81. package/dist/{app → lib}/components/context/ComponentsContext.js.map +1 -1
  82. package/dist/{app → lib}/components/context/DevPortalProvider.js +1 -1
  83. package/dist/lib/components/context/DevPortalProvider.js.map +1 -0
  84. package/dist/lib/components/context/PluginSystem.js.map +1 -0
  85. package/dist/{app → lib}/components/context/ThemeContext.js +1 -1
  86. package/dist/{app → lib}/components/context/ThemeContext.js.map +1 -1
  87. package/dist/{app → lib}/components/context/ViewportAnchorContext.js.map +1 -1
  88. package/dist/lib/components/index.d.ts +3 -0
  89. package/dist/lib/components/index.js +4 -0
  90. package/dist/lib/components/index.js.map +1 -0
  91. package/dist/{app → lib}/components/navigation/SideNavigation.js +1 -1
  92. package/dist/{app → lib}/components/navigation/SideNavigation.js.map +1 -1
  93. package/dist/{app → lib}/components/navigation/SideNavigationCategory.js +1 -1
  94. package/dist/{app → lib}/components/navigation/SideNavigationCategory.js.map +1 -1
  95. package/dist/{app → lib}/components/navigation/SideNavigationItem.d.ts +2 -1
  96. package/dist/{app → lib}/components/navigation/SideNavigationItem.js +12 -6
  97. package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -0
  98. package/dist/{app → lib}/components/navigation/SideNavigationWrapper.d.ts +3 -0
  99. package/dist/lib/components/navigation/SideNavigationWrapper.js +7 -0
  100. package/dist/lib/components/navigation/SideNavigationWrapper.js.map +1 -0
  101. package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js.map +1 -1
  102. package/dist/{app → lib}/components/navigation/util.js.map +1 -1
  103. package/dist/{app → lib}/core/DevPortalContext.d.ts +9 -13
  104. package/dist/{app → lib}/core/DevPortalContext.js +8 -8
  105. package/dist/lib/core/DevPortalContext.js.map +1 -0
  106. package/dist/{app → lib}/core/helmet.js.map +1 -1
  107. package/dist/lib/core/icons.js.map +1 -0
  108. package/dist/{app → lib}/core/plugins.d.ts +2 -7
  109. package/dist/{app → lib}/core/plugins.js +1 -1
  110. package/dist/{app → lib}/core/plugins.js.map +1 -1
  111. package/dist/lib/core/router.js.map +1 -0
  112. package/dist/{app → lib}/oas/graphql/index.js +2 -2
  113. package/dist/lib/oas/graphql/index.js.map +1 -0
  114. package/dist/{app → lib}/oas/parser/dereference/index.js.map +1 -1
  115. package/dist/{app → lib}/oas/parser/dereference/resolveRef.js.map +1 -1
  116. package/dist/{app → lib}/oas/parser/index.js.map +1 -1
  117. package/dist/{app → lib}/oas/parser/upgrade/index.js.map +1 -1
  118. package/dist/lib/plugins/api-key/CreateApiKey.d.ts +5 -0
  119. package/dist/lib/plugins/api-key/CreateApiKey.js +37 -0
  120. package/dist/lib/plugins/api-key/CreateApiKey.js.map +1 -0
  121. package/dist/lib/plugins/api-key/SettingsApiKeys.d.ts +5 -0
  122. package/dist/lib/plugins/api-key/SettingsApiKeys.js +38 -0
  123. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +1 -0
  124. package/dist/lib/plugins/api-key/index.d.ts +30 -0
  125. package/dist/lib/plugins/api-key/index.js +79 -0
  126. package/dist/lib/plugins/api-key/index.js.map +1 -0
  127. package/dist/lib/plugins/index.d.ts +4 -0
  128. package/dist/lib/plugins/index.js +5 -0
  129. package/dist/lib/plugins/index.js.map +1 -0
  130. package/dist/lib/plugins/markdown/MdxPage.d.ts +5 -0
  131. package/dist/lib/plugins/markdown/MdxPage.js +60 -0
  132. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -0
  133. package/dist/{app → lib}/plugins/markdown/Toc.js.map +1 -1
  134. package/dist/{app → lib}/plugins/markdown/generateRoutes.js +1 -6
  135. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -0
  136. package/dist/{app → lib}/plugins/markdown/index.js.map +1 -1
  137. package/dist/{app → lib}/plugins/openapi/ColorizedParam.d.ts +1 -2
  138. package/dist/{app → lib}/plugins/openapi/ColorizedParam.js +2 -2
  139. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -0
  140. package/dist/lib/plugins/openapi/MakeRequest.js +38 -0
  141. package/dist/lib/plugins/openapi/MakeRequest.js.map +1 -0
  142. package/dist/{app → lib}/plugins/openapi/MethodBadge.js.map +1 -1
  143. package/dist/{app → lib}/plugins/openapi/OperationList.js +12 -3
  144. package/dist/lib/plugins/openapi/OperationList.js.map +1 -0
  145. package/dist/lib/plugins/openapi/OperationListItem.js +18 -0
  146. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -0
  147. package/dist/{app → lib}/plugins/openapi/ParameterList.js +1 -1
  148. package/dist/{app → lib}/plugins/openapi/ParameterList.js.map +1 -1
  149. package/dist/lib/plugins/openapi/ParameterListItem.js +13 -0
  150. package/dist/{app → lib}/plugins/openapi/ParameterListItem.js.map +1 -1
  151. package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js +1 -1
  152. package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  153. package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js +3 -3
  154. package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  155. package/dist/lib/plugins/openapi/SchemaListView.d.ts +7 -0
  156. package/dist/lib/plugins/openapi/SchemaListView.js +43 -0
  157. package/dist/lib/plugins/openapi/SchemaListView.js.map +1 -0
  158. package/dist/{app → lib}/plugins/openapi/Select.js.map +1 -1
  159. package/dist/{app → lib}/plugins/openapi/Sidecar.js +15 -15
  160. package/dist/{app → lib}/plugins/openapi/Sidecar.js.map +1 -1
  161. package/dist/{app → lib}/plugins/openapi/SidecarBox.js.map +1 -1
  162. package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.d.ts +1 -1
  163. package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  164. package/dist/{app → lib}/plugins/openapi/graphql/gql.d.ts +5 -5
  165. package/dist/{app → lib}/plugins/openapi/graphql/gql.js +2 -3
  166. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -0
  167. package/dist/{app → lib}/plugins/openapi/graphql/graphql.d.ts +9 -0
  168. package/dist/{app → lib}/plugins/openapi/graphql/graphql.js +50 -0
  169. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -0
  170. package/dist/lib/plugins/openapi/graphql/index.js.map +1 -0
  171. package/dist/{app → lib}/plugins/openapi/index.js +3 -1
  172. package/dist/lib/plugins/openapi/index.js.map +1 -0
  173. package/dist/lib/plugins/openapi/playground/Editor.d.ts +1 -0
  174. package/dist/lib/plugins/openapi/playground/Editor.js +5 -0
  175. package/dist/lib/plugins/openapi/playground/Editor.js.map +1 -0
  176. package/dist/lib/plugins/openapi/playground/Headers.d.ts +7 -0
  177. package/dist/lib/plugins/openapi/playground/Headers.js +15 -0
  178. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -0
  179. package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +4 -0
  180. package/dist/lib/plugins/openapi/playground/InlineInput.js +3 -0
  181. package/dist/lib/plugins/openapi/playground/InlineInput.js.map +1 -0
  182. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +6 -0
  183. package/dist/lib/plugins/openapi/playground/PathParams.js +21 -0
  184. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -0
  185. package/dist/lib/plugins/openapi/playground/Playground.d.ts +30 -0
  186. package/dist/lib/plugins/openapi/playground/Playground.js +99 -0
  187. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -0
  188. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +5 -0
  189. package/dist/lib/plugins/openapi/playground/QueryParams.js +34 -0
  190. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -0
  191. package/dist/lib/plugins/openapi/playground/UrlDisplay.d.ts +4 -0
  192. package/dist/lib/plugins/openapi/playground/UrlDisplay.js +22 -0
  193. package/dist/lib/plugins/openapi/playground/UrlDisplay.js.map +1 -0
  194. package/dist/lib/plugins/openapi/playground/createUrl.d.ts +2 -0
  195. package/dist/lib/plugins/openapi/playground/createUrl.js +15 -0
  196. package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -0
  197. package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.d.ts +1 -1
  198. package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js +17 -9
  199. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -0
  200. package/dist/{app → lib}/plugins/openapi/util/urql.js.map +1 -1
  201. package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js +2 -1
  202. package/dist/lib/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -0
  203. package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +1 -0
  204. package/dist/lib/plugins/openapi/worker/shared-worker.js +6 -0
  205. package/dist/lib/plugins/openapi/worker/shared-worker.js.map +1 -0
  206. package/dist/{app → lib}/plugins/openapi/worker/worker.js.map +1 -1
  207. package/dist/lib/plugins/openapi-worker.d.ts +1 -0
  208. package/dist/lib/plugins/openapi-worker.js +2 -0
  209. package/dist/lib/plugins/openapi-worker.js.map +1 -0
  210. package/dist/{app → lib}/plugins/redirect/index.d.ts +1 -2
  211. package/dist/{app → lib}/plugins/redirect/index.js.map +1 -1
  212. package/dist/lib/ui/Button.d.ts +7 -0
  213. package/dist/lib/ui/Button.js +11 -0
  214. package/dist/lib/ui/Button.js.map +1 -0
  215. package/dist/{app → lib}/ui/Callout.js.map +1 -1
  216. package/dist/{app → lib}/ui/Card.js.map +1 -1
  217. package/dist/{app → lib}/ui/Note.js.map +1 -1
  218. package/dist/{app → lib}/ui/Tabs.d.ts +2 -2
  219. package/dist/{app → lib}/ui/Tabs.js +2 -2
  220. package/dist/{app → lib}/ui/Tabs.js.map +1 -1
  221. package/dist/lib/ui/button-variants.d.ts +4 -0
  222. package/dist/{app/ui/Button.js → lib/ui/button-variants.js} +2 -12
  223. package/dist/lib/ui/button-variants.js.map +1 -0
  224. package/dist/{app → lib}/util/MdxComponents.js +9 -9
  225. package/dist/lib/util/MdxComponents.js.map +1 -0
  226. package/dist/{app → lib}/util/cn.js.map +1 -1
  227. package/dist/lib/util/createVariantComponent.d.ts +9 -0
  228. package/dist/lib/util/createVariantComponent.js +17 -0
  229. package/dist/lib/util/createVariantComponent.js.map +1 -0
  230. package/dist/{app → lib}/util/createWaitForNotify.js.map +1 -1
  231. package/dist/{app → lib}/util/groupBy.js.map +1 -1
  232. package/dist/{app → lib}/util/joinPath.js.map +1 -1
  233. package/dist/{app → lib}/util/pastellize.js.map +1 -1
  234. package/dist/lib/util/slugify.js.map +1 -0
  235. package/dist/{app → lib}/util/traverseNavigation.js.map +1 -1
  236. package/dist/{app → lib}/util/useScrollToAnchor.js.map +1 -1
  237. package/dist/{app → lib}/util/useScrollToTop.js.map +1 -1
  238. package/dist/ts.d.ts +6 -0
  239. package/dist/ts.js +61 -0
  240. package/dist/ts.js.map +1 -0
  241. package/dist/vite/build.js +2 -8
  242. package/dist/vite/build.js.map +1 -1
  243. package/dist/vite/common.d.ts +1 -0
  244. package/dist/vite/common.js +5 -0
  245. package/dist/vite/common.js.map +1 -0
  246. package/dist/vite/config.d.ts +10 -3
  247. package/dist/vite/config.js +109 -58
  248. package/dist/vite/config.js.map +1 -1
  249. package/dist/vite/config.test.js +4 -3
  250. package/dist/vite/config.test.js.map +1 -1
  251. package/dist/vite/dev-server.d.ts +2 -0
  252. package/dist/vite/dev-server.js +30 -9
  253. package/dist/vite/dev-server.js.map +1 -1
  254. package/dist/vite/html.d.ts +1 -1
  255. package/dist/vite/html.js +2 -3
  256. package/dist/vite/html.js.map +1 -1
  257. package/dist/vite/plugin-api-keys.d.ts +4 -0
  258. package/dist/vite/plugin-api-keys.js +33 -0
  259. package/dist/vite/plugin-api-keys.js.map +1 -0
  260. package/dist/vite/plugin-api.d.ts +4 -0
  261. package/dist/vite/plugin-api.js +49 -0
  262. package/dist/vite/plugin-api.js.map +1 -0
  263. package/dist/vite/plugin-auth.d.ts +4 -0
  264. package/dist/vite/plugin-auth.js +30 -0
  265. package/dist/vite/plugin-auth.js.map +1 -0
  266. package/dist/vite/plugin-component.d.ts +4 -0
  267. package/dist/vite/plugin-component.js +16 -0
  268. package/dist/vite/plugin-component.js.map +1 -0
  269. package/dist/vite/plugin-config.d.ts +7 -0
  270. package/dist/vite/plugin-config.js +25 -0
  271. package/dist/vite/plugin-config.js.map +1 -0
  272. package/dist/vite/plugin-docs.d.ts +4 -0
  273. package/dist/vite/plugin-docs.js +45 -0
  274. package/dist/vite/plugin-docs.js.map +1 -0
  275. package/dist/vite/plugin-docs.test.js +30 -0
  276. package/dist/vite/plugin-docs.test.js.map +1 -0
  277. package/dist/vite/plugin-html.d.ts +3 -0
  278. package/dist/vite/plugin-html.js +47 -0
  279. package/dist/vite/plugin-html.js.map +1 -0
  280. package/dist/vite/plugin-mdx.d.ts +8 -0
  281. package/dist/vite/plugin-mdx.js +63 -0
  282. package/dist/vite/plugin-mdx.js.map +1 -0
  283. package/dist/vite/plugin-metadata.d.ts +6 -0
  284. package/dist/vite/plugin-metadata.js +24 -0
  285. package/dist/vite/plugin-metadata.js.map +1 -0
  286. package/dist/vite/plugin-openapi-worker.d.ts +4 -0
  287. package/dist/vite/plugin-openapi-worker.js +28 -0
  288. package/dist/vite/plugin-openapi-worker.js.map +1 -0
  289. package/dist/vite/plugin-redirect.d.ts +4 -0
  290. package/dist/vite/plugin-redirect.js +32 -0
  291. package/dist/vite/plugin-redirect.js.map +1 -0
  292. package/dist/vite/plugin.d.ts +2 -6
  293. package/dist/vite/plugin.js +22 -104
  294. package/dist/vite/plugin.js.map +1 -1
  295. package/lib/DevPortalProvider-yBHPOS9_.js +4559 -0
  296. package/lib/Spinner-Daa7xsri.js +7329 -0
  297. package/lib/assets/index-BPdJm2ty.js +4764 -0
  298. package/lib/assets/worker-BCcpCNJ7.js +14473 -0
  299. package/lib/clerk-Wslx_mPo.js +19685 -0
  300. package/lib/loglevel-D-4S8up4.js +152 -0
  301. package/lib/prism-bash.min-DadFsM4Z.js +6 -0
  302. package/lib/prism-java.min-d5iT_mOd.js +6 -0
  303. package/lib/prism-json.min-B1GJqK1k.js +1 -0
  304. package/lib/prism-markup-templating-DZrrEs0A.js +61 -0
  305. package/lib/prism-php.min-o7FpoMP_.js +10 -0
  306. package/lib/prism-ruby.min-C7LwcKyz.js +9 -0
  307. package/lib/urql-DMlBWUKL.js +1591 -0
  308. package/lib/zudoku.auth-auth0.js +829 -0
  309. package/lib/zudoku.auth-clerk.js +41 -0
  310. package/lib/zudoku.components.js +1203 -0
  311. package/lib/zudoku.openapi-worker.js +225 -0
  312. package/lib/zudoku.plugins.js +19877 -0
  313. package/package.json +75 -50
  314. package/src/app/App.tsx +23 -46
  315. package/src/app/main.css +1 -0
  316. package/src/app/main.tsx +13 -17
  317. package/src/lib/authentication/Callback.tsx +31 -0
  318. package/src/lib/authentication/auth0.tsx +18 -0
  319. package/src/lib/authentication/authentication.ts +11 -0
  320. package/src/lib/authentication/clerk.tsx +56 -0
  321. package/src/lib/authentication/openid.tsx +206 -0
  322. package/src/{app → lib/components}/DevPortal.tsx +30 -42
  323. package/src/{app → lib}/components/Dialog.tsx +37 -37
  324. package/src/{app → lib}/components/Header.tsx +4 -4
  325. package/src/{app → lib/components}/Heading.tsx +2 -2
  326. package/src/{app → lib}/components/Layout.tsx +18 -12
  327. package/src/lib/components/Link.tsx +1 -0
  328. package/src/lib/components/Router.tsx +28 -0
  329. package/src/lib/components/Select.tsx +157 -0
  330. package/src/lib/components/Spinner.tsx +5 -0
  331. package/src/{app → lib}/components/SyntaxHighlight.tsx +10 -3
  332. package/src/{app → lib}/components/context/DevPortalProvider.ts +1 -1
  333. package/src/lib/components/index.ts +3 -0
  334. package/src/{app → lib}/components/navigation/SideNavigation.tsx +4 -1
  335. package/src/{app → lib}/components/navigation/SideNavigationCategory.tsx +3 -1
  336. package/src/{app → lib}/components/navigation/SideNavigationItem.tsx +16 -7
  337. package/src/lib/components/navigation/SideNavigationWrapper.tsx +24 -0
  338. package/src/{app → lib}/core/DevPortalContext.ts +20 -22
  339. package/src/{app → lib}/core/plugins.ts +5 -5
  340. package/src/{app → lib}/oas/graphql/index.ts +2 -2
  341. package/src/lib/plugins/api-key/CreateApiKey.tsx +100 -0
  342. package/src/lib/plugins/api-key/SettingsApiKeys.tsx +125 -0
  343. package/src/lib/plugins/api-key/index.tsx +132 -0
  344. package/src/lib/plugins/index.ts +4 -0
  345. package/src/{app → lib}/plugins/markdown/MdxPage.tsx +32 -10
  346. package/src/{app → lib}/plugins/markdown/generateRoutes.tsx +1 -16
  347. package/src/{app → lib}/plugins/openapi/ColorizedParam.tsx +1 -3
  348. package/src/lib/plugins/openapi/MakeRequest.tsx +58 -0
  349. package/src/{app → lib}/plugins/openapi/OperationList.tsx +14 -4
  350. package/src/{app → lib}/plugins/openapi/OperationListItem.tsx +36 -4
  351. package/src/{app → lib}/plugins/openapi/ParameterList.tsx +1 -1
  352. package/src/{app → lib}/plugins/openapi/ParameterListItem.tsx +5 -2
  353. package/src/{app → lib}/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
  354. package/src/{app → lib}/plugins/openapi/ResponsesSidecarBox.tsx +2 -3
  355. package/src/lib/plugins/openapi/SchemaListView.tsx +228 -0
  356. package/src/{app → lib}/plugins/openapi/Sidecar.tsx +23 -23
  357. package/src/{app → lib}/plugins/openapi/graphql/gql.ts +7 -7
  358. package/src/{app → lib}/plugins/openapi/graphql/graphql.ts +59 -0
  359. package/src/{app → lib}/plugins/openapi/index.tsx +8 -2
  360. package/src/lib/plugins/openapi/playground/Editor.tsx +4 -0
  361. package/src/lib/plugins/openapi/playground/Headers.tsx +60 -0
  362. package/src/lib/plugins/openapi/playground/InlineInput.tsx +6 -0
  363. package/src/lib/plugins/openapi/playground/PathParams.tsx +63 -0
  364. package/src/lib/plugins/openapi/playground/Playground.tsx +367 -0
  365. package/src/lib/plugins/openapi/playground/QueryParams.tsx +109 -0
  366. package/src/lib/plugins/openapi/playground/UrlDisplay.tsx +32 -0
  367. package/src/lib/plugins/openapi/playground/createUrl.ts +22 -0
  368. package/src/{app → lib}/plugins/openapi/util/generateSchemaExample.ts +22 -9
  369. package/src/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.ts +2 -1
  370. package/src/lib/plugins/openapi/worker/shared-worker.ts +5 -0
  371. package/src/lib/plugins/openapi-worker.ts +1 -0
  372. package/src/{app → lib}/plugins/redirect/index.tsx +1 -1
  373. package/src/lib/ui/Button.tsx +25 -0
  374. package/src/{app → lib}/ui/Tabs.tsx +2 -2
  375. package/src/{app/ui/Button.tsx → lib/ui/button-variants.ts} +4 -29
  376. package/src/{app → lib}/util/MdxComponents.tsx +33 -8
  377. package/src/{app → lib}/util/createVariantComponent.tsx +12 -7
  378. package/dist/app/DevPortal.d.ts +0 -25
  379. package/dist/app/DevPortal.js +0 -41
  380. package/dist/app/DevPortal.js.map +0 -1
  381. package/dist/app/Heading.js.map +0 -1
  382. package/dist/app/authentication/authentication.d.ts +0 -13
  383. package/dist/app/authentication/authentication.js.map +0 -1
  384. package/dist/app/authentication/clerk.d.ts +0 -5
  385. package/dist/app/authentication/clerk.js.map +0 -1
  386. package/dist/app/authentication/openid.d.ts +0 -11
  387. package/dist/app/authentication/openid.js +0 -118
  388. package/dist/app/authentication/openid.js.map +0 -1
  389. package/dist/app/components/Dialog.js.map +0 -1
  390. package/dist/app/components/DynamicIcon.d.ts +0 -6
  391. package/dist/app/components/DynamicIcon.js +0 -6
  392. package/dist/app/components/DynamicIcon.js.map +0 -1
  393. package/dist/app/components/Header.d.ts +0 -1
  394. package/dist/app/components/Header.js +0 -15
  395. package/dist/app/components/Layout.js.map +0 -1
  396. package/dist/app/components/SyntaxHighlight.js.map +0 -1
  397. package/dist/app/components/context/DevPortalProvider.js.map +0 -1
  398. package/dist/app/components/context/PluginSystem.js.map +0 -1
  399. package/dist/app/components/navigation/SideNavigationItem.js.map +0 -1
  400. package/dist/app/components/navigation/SideNavigationWrapper.js +0 -6
  401. package/dist/app/components/navigation/SideNavigationWrapper.js.map +0 -1
  402. package/dist/app/config.d.ts +0 -3
  403. package/dist/app/config.js +0 -9
  404. package/dist/app/config.js.map +0 -1
  405. package/dist/app/core/DevPortalContext.js.map +0 -1
  406. package/dist/app/core/icons.js.map +0 -1
  407. package/dist/app/core/router.js.map +0 -1
  408. package/dist/app/core/types/combine.d.ts +0 -4
  409. package/dist/app/core/types/combine.js +0 -2
  410. package/dist/app/core/types/combine.js.map +0 -1
  411. package/dist/app/markdowns.d.ts +0 -3
  412. package/dist/app/markdowns.js +0 -5
  413. package/dist/app/markdowns.js.map +0 -1
  414. package/dist/app/oas/graphql/index.js.map +0 -1
  415. package/dist/app/oas/graphql/server.js +0 -8
  416. package/dist/app/oas/graphql/server.js.map +0 -1
  417. package/dist/app/plugins/api-key/SettingsApiKeys.d.ts +0 -4
  418. package/dist/app/plugins/api-key/SettingsApiKeys.js +0 -7
  419. package/dist/app/plugins/api-key/SettingsApiKeys.js.map +0 -1
  420. package/dist/app/plugins/api-key/index.d.ts +0 -32
  421. package/dist/app/plugins/api-key/index.js +0 -55
  422. package/dist/app/plugins/api-key/index.js.map +0 -1
  423. package/dist/app/plugins/markdown/MdxPage.d.ts +0 -3
  424. package/dist/app/plugins/markdown/MdxPage.js +0 -55
  425. package/dist/app/plugins/markdown/MdxPage.js.map +0 -1
  426. package/dist/app/plugins/markdown/generateRoutes.js.map +0 -1
  427. package/dist/app/plugins/openapi/ColorizedParam.js.map +0 -1
  428. package/dist/app/plugins/openapi/MakeRequest.js +0 -23
  429. package/dist/app/plugins/openapi/MakeRequest.js.map +0 -1
  430. package/dist/app/plugins/openapi/OperationList.js.map +0 -1
  431. package/dist/app/plugins/openapi/OperationListItem.js +0 -15
  432. package/dist/app/plugins/openapi/OperationListItem.js.map +0 -1
  433. package/dist/app/plugins/openapi/ParameterListItem.js +0 -13
  434. package/dist/app/plugins/openapi/graphql/gql.js.map +0 -1
  435. package/dist/app/plugins/openapi/graphql/graphql.js.map +0 -1
  436. package/dist/app/plugins/openapi/graphql/index.js.map +0 -1
  437. package/dist/app/plugins/openapi/index.js.map +0 -1
  438. package/dist/app/plugins/openapi/playground/Playground.d.ts +0 -8
  439. package/dist/app/plugins/openapi/playground/Playground.js +0 -98
  440. package/dist/app/plugins/openapi/playground/Playground.js.map +0 -1
  441. package/dist/app/plugins/openapi/util/generateSchemaExample.js.map +0 -1
  442. package/dist/app/plugins/openapi/worker/createSharedWorkerClient.js.map +0 -1
  443. package/dist/app/ui/Button.d.ts +0 -11
  444. package/dist/app/ui/Button.js.map +0 -1
  445. package/dist/app/util/MdxComponents.js.map +0 -1
  446. package/dist/app/util/createVariantComponent.d.ts +0 -15
  447. package/dist/app/util/createVariantComponent.js +0 -12
  448. package/dist/app/util/createVariantComponent.js.map +0 -1
  449. package/dist/app/util/slugify.js.map +0 -1
  450. package/dist/auth.d.ts +0 -2
  451. package/dist/auth.js +0 -3
  452. package/dist/auth.js.map +0 -1
  453. package/dist/plugins.d.ts +0 -4
  454. package/dist/plugins.js +0 -6
  455. package/dist/plugins.js.map +0 -1
  456. package/src/app/authentication/authentication.ts +0 -18
  457. package/src/app/authentication/clerk.ts +0 -47
  458. package/src/app/authentication/openid.ts +0 -192
  459. package/src/app/components/DynamicIcon.tsx +0 -60
  460. package/src/app/components/navigation/SideNavigationWrapper.tsx +0 -15
  461. package/src/app/config.ts +0 -20
  462. package/src/app/core/types/combine.ts +0 -16
  463. package/src/app/markdowns.ts +0 -7
  464. package/src/app/oas/graphql/server.ts +0 -10
  465. package/src/app/plugins/api-key/SettingsApiKeys.tsx +0 -22
  466. package/src/app/plugins/api-key/index.tsx +0 -123
  467. package/src/app/plugins/openapi/MakeRequest.tsx +0 -49
  468. package/src/app/plugins/openapi/playground/Playground.tsx +0 -309
  469. package/src/app/plugins/openapi/queries.graphql +0 -6
  470. package/dist/{app → lib}/authentication/authentication.js +0 -0
  471. package/dist/{app → lib}/components/AnchorLink.d.ts +0 -0
  472. package/dist/{app → lib}/components/AnchorLink.js +0 -0
  473. package/dist/{app → lib}/components/CategoryHeading.d.ts +0 -0
  474. package/dist/{app → lib}/components/CategoryHeading.js +0 -0
  475. package/dist/{app → lib/components}/Heading.d.ts +0 -0
  476. package/dist/{app → lib}/components/Input.d.ts +0 -0
  477. package/dist/{app → lib}/components/Input.js +0 -0
  478. package/dist/{app → lib}/components/Layout.d.ts +0 -0
  479. package/dist/{app → lib}/components/Markdown.d.ts +0 -0
  480. package/dist/{app → lib}/components/Markdown.js +0 -0
  481. package/dist/{app → lib}/components/TopNavigation.d.ts +0 -0
  482. package/dist/{app → lib}/components/TopNavigation.js +0 -0
  483. package/dist/{app → lib}/components/context/ComponentsContext.js +0 -0
  484. package/dist/{app → lib}/components/context/DevPortalProvider.d.ts +0 -0
  485. package/dist/{app → lib}/components/context/PluginSystem.d.ts +0 -0
  486. package/dist/{app → lib}/components/context/PluginSystem.js +0 -0
  487. package/dist/{app → lib}/components/context/ThemeContext.d.ts +0 -0
  488. package/dist/{app → lib}/components/context/ViewportAnchorContext.d.ts +0 -0
  489. package/dist/{app → lib}/components/context/ViewportAnchorContext.js +0 -0
  490. package/dist/{app → lib}/components/navigation/SideNavigation.d.ts +0 -0
  491. package/dist/{app → lib}/components/navigation/SideNavigationCategory.d.ts +0 -0
  492. package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.d.ts +0 -0
  493. package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js +0 -0
  494. package/dist/{app → lib}/components/navigation/util.d.ts +0 -0
  495. package/dist/{app → lib}/components/navigation/util.js +0 -0
  496. package/dist/{app → lib}/core/helmet.d.ts +0 -0
  497. package/dist/{app → lib}/core/helmet.js +0 -0
  498. package/dist/{app → lib}/core/icons.d.ts +0 -0
  499. package/dist/{app → lib}/core/icons.js +0 -0
  500. package/dist/{app → lib}/core/router.d.ts +0 -0
  501. package/dist/{app → lib}/core/router.js +0 -0
  502. package/dist/{app → lib}/oas/graphql/index.d.ts +0 -0
  503. package/dist/{app → lib}/oas/parser/dereference/index.d.ts +0 -0
  504. package/dist/{app → lib}/oas/parser/dereference/index.js +0 -0
  505. package/dist/{app → lib}/oas/parser/dereference/resolveRef.d.ts +0 -0
  506. package/dist/{app → lib}/oas/parser/dereference/resolveRef.js +0 -0
  507. package/dist/{app → lib}/oas/parser/index.d.ts +0 -0
  508. package/dist/{app → lib}/oas/parser/index.js +0 -0
  509. package/dist/{app → lib}/oas/parser/upgrade/index.d.ts +0 -0
  510. package/dist/{app → lib}/oas/parser/upgrade/index.js +0 -0
  511. package/dist/{app → lib}/plugins/markdown/Toc.d.ts +0 -0
  512. package/dist/{app → lib}/plugins/markdown/Toc.js +0 -0
  513. package/dist/{app → lib}/plugins/markdown/generateRoutes.d.ts +0 -0
  514. package/dist/{app → lib}/plugins/markdown/index.d.ts +0 -0
  515. package/dist/{app → lib}/plugins/markdown/index.js +0 -0
  516. package/dist/{app → lib}/plugins/openapi/MakeRequest.d.ts +0 -0
  517. package/dist/{app → lib}/plugins/openapi/MethodBadge.d.ts +0 -0
  518. package/dist/{app → lib}/plugins/openapi/MethodBadge.js +0 -0
  519. package/dist/{app → lib}/plugins/openapi/OperationList.d.ts +0 -0
  520. package/dist/{app → lib}/plugins/openapi/OperationListItem.d.ts +0 -0
  521. package/dist/{app → lib}/plugins/openapi/ParameterList.d.ts +0 -0
  522. package/dist/{app → lib}/plugins/openapi/ParameterListItem.d.ts +0 -0
  523. package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.d.ts +0 -0
  524. package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.d.ts +0 -0
  525. package/dist/{app → lib}/plugins/openapi/Select.d.ts +0 -0
  526. package/dist/{app → lib}/plugins/openapi/Select.js +0 -0
  527. package/dist/{app → lib}/plugins/openapi/Sidecar.d.ts +0 -0
  528. package/dist/{app → lib}/plugins/openapi/SidecarBox.d.ts +0 -0
  529. package/dist/{app → lib}/plugins/openapi/SidecarBox.js +0 -0
  530. package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js +0 -0
  531. package/dist/{app → lib}/plugins/openapi/graphql/index.d.ts +0 -0
  532. package/dist/{app → lib}/plugins/openapi/graphql/index.js +0 -0
  533. package/dist/{app → lib}/plugins/openapi/index.d.ts +0 -0
  534. package/dist/{app → lib}/plugins/openapi/util/urql.d.ts +0 -0
  535. package/dist/{app → lib}/plugins/openapi/util/urql.js +0 -0
  536. package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -0
  537. package/dist/{app → lib}/plugins/openapi/worker/worker.d.ts +0 -0
  538. package/dist/{app → lib}/plugins/openapi/worker/worker.js +0 -0
  539. package/dist/{app → lib}/plugins/redirect/index.js +0 -0
  540. package/dist/{app → lib}/ui/Callout.d.ts +0 -0
  541. package/dist/{app → lib}/ui/Callout.js +0 -0
  542. package/dist/{app → lib}/ui/Card.d.ts +0 -0
  543. package/dist/{app → lib}/ui/Card.js +0 -0
  544. package/dist/{app → lib}/ui/Note.d.ts +0 -0
  545. package/dist/{app → lib}/ui/Note.js +0 -0
  546. package/dist/{app → lib}/util/MdxComponents.d.ts +0 -0
  547. package/dist/{app → lib}/util/cn.d.ts +0 -0
  548. package/dist/{app → lib}/util/cn.js +0 -0
  549. package/dist/{app → lib}/util/createWaitForNotify.d.ts +0 -0
  550. package/dist/{app → lib}/util/createWaitForNotify.js +0 -0
  551. package/dist/{app → lib}/util/groupBy.d.ts +0 -0
  552. package/dist/{app → lib}/util/groupBy.js +0 -0
  553. package/dist/{app → lib}/util/joinPath.d.ts +0 -0
  554. package/dist/{app → lib}/util/joinPath.js +0 -0
  555. package/dist/{app → lib}/util/pastellize.d.ts +0 -0
  556. package/dist/{app → lib}/util/pastellize.js +0 -0
  557. package/dist/{app → lib}/util/slugify.d.ts +0 -0
  558. package/dist/{app → lib}/util/slugify.js +0 -0
  559. package/dist/{app → lib}/util/traverseNavigation.d.ts +0 -0
  560. package/dist/{app → lib}/util/traverseNavigation.js +0 -0
  561. package/dist/{app → lib}/util/useScrollToAnchor.d.ts +0 -0
  562. package/dist/{app → lib}/util/useScrollToAnchor.js +0 -0
  563. package/dist/{app → lib}/util/useScrollToTop.d.ts +0 -0
  564. package/dist/{app → lib}/util/useScrollToTop.js +0 -0
  565. package/dist/{app/oas/graphql/server.d.ts → vite/plugin-docs.test.d.ts} +0 -0
  566. package/src/{app → lib}/components/AnchorLink.tsx +0 -0
  567. package/src/{app → lib}/components/CategoryHeading.tsx +1 -1
  568. package/src/{app → lib}/components/Input.tsx +0 -0
  569. package/src/{app → lib}/components/Markdown.tsx +0 -0
  570. package/src/{app → lib}/components/TopNavigation.tsx +0 -0
  571. package/src/{app → lib}/components/context/ComponentsContext.tsx +0 -0
  572. package/src/{app → lib}/components/context/PluginSystem.ts +0 -0
  573. package/src/{app → lib}/components/context/ThemeContext.tsx +1 -1
  574. package/src/{app → lib}/components/context/ViewportAnchorContext.tsx +0 -0
  575. package/src/{app → lib}/components/navigation/useNavigationCollapsibleState.ts +0 -0
  576. package/src/{app → lib}/components/navigation/util.ts +0 -0
  577. package/src/{app → lib}/core/helmet.ts +0 -0
  578. package/src/{app → lib}/core/icons.tsx +0 -0
  579. package/src/{app → lib}/core/router.tsx +0 -0
  580. package/src/{app → lib}/oas/parser/dereference/index.ts +0 -0
  581. package/src/{app → lib}/oas/parser/dereference/resolveRef.ts +0 -0
  582. package/src/{app → lib}/oas/parser/index.ts +0 -0
  583. package/src/{app → lib}/oas/parser/schemas/v3.0.json +0 -0
  584. package/src/{app → lib}/oas/parser/schemas/v3.1.json +0 -0
  585. package/src/{app → lib}/oas/parser/upgrade/index.ts +0 -0
  586. package/src/{app → lib}/plugins/markdown/Toc.tsx +0 -0
  587. package/src/{app → lib}/plugins/markdown/index.tsx +0 -0
  588. package/src/{app → lib}/plugins/openapi/MethodBadge.tsx +0 -0
  589. package/src/{app → lib}/plugins/openapi/Select.tsx +0 -0
  590. package/src/{app → lib}/plugins/openapi/SidecarBox.tsx +0 -0
  591. package/src/{app → lib}/plugins/openapi/graphql/fragment-masking.ts +1 -1
  592. /package/src/{app → lib}/plugins/openapi/graphql/index.ts +0 -0
  593. /package/src/{app → lib}/plugins/openapi/util/urql.ts +0 -0
  594. /package/src/{app → lib}/plugins/openapi/worker/worker.ts +0 -0
  595. /package/src/{app → lib}/ui/Callout.tsx +0 -0
  596. /package/src/{app → lib}/ui/Card.tsx +0 -0
  597. /package/src/{app → lib}/ui/Note.tsx +0 -0
  598. /package/src/{app → lib}/util/cn.ts +0 -0
  599. /package/src/{app → lib}/util/createWaitForNotify.ts +0 -0
  600. /package/src/{app → lib}/util/groupBy.ts +0 -0
  601. /package/src/{app → lib}/util/joinPath.tsx +0 -0
  602. /package/src/{app → lib}/util/pastellize.ts +0 -0
  603. /package/src/{app → lib}/util/slugify.ts +0 -0
  604. /package/src/{app → lib}/util/traverseNavigation.ts +0 -0
  605. /package/src/{app → lib}/util/useScrollToAnchor.ts +0 -0
  606. /package/src/{app → lib}/util/useScrollToTop.ts +0 -0
@@ -0,0 +1,367 @@
1
+ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
2
+ import { useMutation } from "@tanstack/react-query";
3
+ import { CirclePlayIcon } from "lucide-react";
4
+ import { Fragment } from "react";
5
+ import { FormProvider, useForm } from "react-hook-form";
6
+ import { useApiIdentities } from "../../../components/context/DevPortalProvider.js";
7
+ import {
8
+ Dialog,
9
+ DialogContent,
10
+ DialogTitle,
11
+ DialogTrigger,
12
+ } from "../../../components/Dialog.js";
13
+ import {
14
+ Select,
15
+ SelectContent,
16
+ SelectItem,
17
+ SelectTrigger,
18
+ SelectValue,
19
+ } from "../../../components/Select.js";
20
+ import { Spinner } from "../../../components/Spinner.js";
21
+ import { SyntaxHighlight } from "../../../components/SyntaxHighlight.js";
22
+ import { Button } from "../../../ui/Button.js";
23
+ import { Card } from "../../../ui/Card.js";
24
+ import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../../ui/Tabs.js";
25
+ import { ColorizedParam } from "../ColorizedParam.js";
26
+ import { createUrl } from "./createUrl.js";
27
+ import { Headers } from "./Headers.js";
28
+ import { PathParams } from "./PathParams.js";
29
+ import { QueryParams } from "./QueryParams.js";
30
+
31
+ function mimeTypeToLanguage(mimeType: string) {
32
+ const mimeTypeMapping = {
33
+ "application/json": "json",
34
+ "text/json": "json",
35
+ "text/html": "html",
36
+ "text/css": "css",
37
+ "text/javascript": "javascript",
38
+ "application/xml": "xml",
39
+ "application/xhtml+xml": "xhtml",
40
+ "text/plain": "plain",
41
+ } as const;
42
+
43
+ return Object.entries(mimeTypeMapping).find(([mime]) =>
44
+ mimeType.includes(mime),
45
+ )?.[0][1];
46
+ }
47
+
48
+ const statusCodeMap: Record<number, string> = {
49
+ 200: "OK",
50
+ 201: "Created",
51
+ 202: "Accepted",
52
+ 204: "No Content",
53
+ 400: "Bad Request",
54
+ 401: "Unauthorized",
55
+ 403: "Forbidden",
56
+ 404: "Not Found",
57
+ 405: "Method Not Allowed",
58
+ 500: "Internal Server Error",
59
+ };
60
+
61
+ export type Header = {
62
+ name: string;
63
+ value: string;
64
+ };
65
+ export type QueryParam = {
66
+ name: string;
67
+ value: string;
68
+ active?: boolean;
69
+ };
70
+ export type PathParam = {
71
+ name: string;
72
+ value: string;
73
+ };
74
+
75
+ export type PlaygroundForm = {
76
+ body: string;
77
+ queryParams: QueryParam[];
78
+ pathParams: PathParam[];
79
+ headers: Header[];
80
+ identity?: string;
81
+ };
82
+
83
+ const NO_IDENTITY = "__none";
84
+
85
+ const Playground = ({
86
+ url,
87
+ host,
88
+ method,
89
+ headers = [{ name: "", value: "" }],
90
+ queryParams = [],
91
+ pathParams = [],
92
+ hasParams,
93
+ }: {
94
+ host: string;
95
+ url: string;
96
+ method: string;
97
+ headers?: Header[];
98
+ queryParams?: QueryParam[];
99
+ pathParams?: PathParam[];
100
+ hasParams: boolean;
101
+ }) => {
102
+ const { register, control, handleSubmit, watch, ...form } =
103
+ useForm<PlaygroundForm>({
104
+ defaultValues: {
105
+ body: "",
106
+ queryParams,
107
+ headers,
108
+ pathParams,
109
+ identity: NO_IDENTITY,
110
+ },
111
+ });
112
+ const formState = watch();
113
+ const identities = useApiIdentities();
114
+
115
+ const queryMutation = useMutation({
116
+ mutationFn: async (data: PlaygroundForm) => {
117
+ const requestUrl = createUrl(host, url, data);
118
+ const start = performance.now();
119
+
120
+ const request = new Request(requestUrl, {
121
+ method: method.toUpperCase(),
122
+ headers: Object.fromEntries(
123
+ data.pathParams
124
+ .filter((h) => h.name)
125
+ .map((header) => [header.name, header.value]),
126
+ ),
127
+ });
128
+
129
+ if (data.identity !== NO_IDENTITY) {
130
+ identities.data
131
+ .find((i) => i.id === data.identity)
132
+ ?.authorizeRequest(request);
133
+ }
134
+
135
+ const response = await fetch(request);
136
+
137
+ const body = await response.text();
138
+
139
+ return {
140
+ status: response.status,
141
+ headers: response.headers,
142
+ size: body.length,
143
+ body,
144
+ time: performance.now() - start,
145
+ };
146
+ },
147
+ });
148
+
149
+ const path = url.split("/").map((part, i, arr) => (
150
+ <Fragment key={part}>
151
+ {part.startsWith("{") && part.endsWith("}") ? (
152
+ <ColorizedParam
153
+ name={part}
154
+ backgroundOpacity="0"
155
+ slug={part.slice(1, -1)}
156
+ >
157
+ {
158
+ formState.pathParams.find((p) => p.name === part.slice(1, -1))
159
+ ?.value
160
+ }
161
+ </ColorizedParam>
162
+ ) : (
163
+ part
164
+ )}
165
+ {i < arr.length - 1 && "/"}
166
+ <wbr />
167
+ </Fragment>
168
+ ));
169
+
170
+ const lang = mimeTypeToLanguage(
171
+ queryMutation.data?.headers.get("Content-Type") ?? "",
172
+ );
173
+
174
+ const headerEntries = Array.from(queryMutation.data?.headers.entries() ?? []);
175
+
176
+ const urlQueryParams = formState.queryParams
177
+ .filter((p) => p.active)
178
+ .map((p) => (
179
+ <Fragment key={p.name}>
180
+ {p.name}={p.value}
181
+ <wbr />
182
+ </Fragment>
183
+ ));
184
+
185
+ return (
186
+ <Dialog>
187
+ <DialogTrigger asChild>
188
+ <CirclePlayIcon
189
+ className="cursor-pointer text-primary hover:text-primary/80"
190
+ size={16}
191
+ />
192
+ </DialogTrigger>
193
+
194
+ <DialogContent
195
+ className="max-w-screen-xl w-full h-5/6 overflow-auto p-0"
196
+ aria-describedby={undefined}
197
+ >
198
+ <VisuallyHidden>
199
+ <DialogTitle>Playground</DialogTitle>
200
+ </VisuallyHidden>
201
+ <FormProvider {...{ register, control, handleSubmit, watch, ...form }}>
202
+ <form
203
+ onSubmit={handleSubmit((data) => {
204
+ queryMutation.mutateAsync(data);
205
+ })}
206
+ >
207
+ <div className="grid grid-cols-2 text-sm h-full">
208
+ <div className="flex flex-col gap-4 p-8 bg-muted/50 after:bg-muted-foreground/20 relative after:absolute after:w-px after:inset-0 after:left-auto">
209
+ <div className="flex gap-2 items-stretch">
210
+ <div className="flex flex-1 items-center w-full border rounded-md border-border">
211
+ <div className="border-r border-border p-2 bg-muted rounded-l-md self-stretch font-semibold font-mono">
212
+ {method.toUpperCase()}
213
+ </div>
214
+ <div className="p-2 font-mono text-xs">
215
+ {path}
216
+ {urlQueryParams.length > 0 ? "?" : ""}
217
+ {urlQueryParams}
218
+ </div>
219
+ </div>
220
+ <Button type="submit" className="h-auto flex gap-1">
221
+ Send
222
+ </Button>
223
+ </div>
224
+ <Tabs defaultValue={hasParams ? "parameters" : "headers"}>
225
+ <div className="flex justify-between">
226
+ <TabsList>
227
+ {hasParams && (
228
+ <TabsTrigger value="parameters">Parameters</TabsTrigger>
229
+ )}
230
+ <TabsTrigger value="headers">
231
+ Headers{" "}
232
+ {formState.headers.length > 0 &&
233
+ `(${formState.headers.length})`}
234
+ </TabsTrigger>
235
+ <TabsTrigger
236
+ value="body"
237
+ disabled={["POST", "PUT", "PATCH", "DELETE"].includes(
238
+ method.toUpperCase(),
239
+ )}
240
+ >
241
+ Body
242
+ </TabsTrigger>
243
+ </TabsList>
244
+ <div className="flex gap-2 items-center">
245
+ Auth:
246
+ <Select
247
+ onValueChange={(value) =>
248
+ form.setValue("identity", value)
249
+ }
250
+ defaultValue={formState.identity}
251
+ >
252
+ <SelectTrigger className="w-[180px]">
253
+ <SelectValue />
254
+ </SelectTrigger>
255
+ <SelectContent align="center">
256
+ <SelectItem value={NO_IDENTITY}>None</SelectItem>
257
+ {identities.data.map((identity) => (
258
+ <SelectItem key={identity.id} value={identity.id}>
259
+ {identity.label}
260
+ </SelectItem>
261
+ ))}
262
+ </SelectContent>
263
+ </Select>
264
+ </div>
265
+ </div>
266
+ <TabsContent value="headers">
267
+ <Headers
268
+ control={control}
269
+ register={register}
270
+ headers={formState.headers}
271
+ />
272
+ </TabsContent>
273
+ <TabsContent value="parameters">
274
+ <div className="grid grid-cols-[min-content_1fr_1fr_auto]">
275
+ {pathParams.length > 0 && (
276
+ <div className="font-semibold my-3 col-span-3">
277
+ Path Parameters
278
+ </div>
279
+ )}
280
+ <PathParams control={control} register={register} />
281
+ {queryParams.length > 0 && (
282
+ <span className="font-semibold my-3 col-span-3">
283
+ Query Parameters
284
+ </span>
285
+ )}
286
+ <QueryParams control={control} />
287
+ </div>
288
+ </TabsContent>
289
+ <TabsContent value="body">
290
+ <textarea
291
+ {...register("body")}
292
+ className="border border-border w-full rounded p-2 bg-muted h-40"
293
+ />
294
+ </TabsContent>
295
+ </Tabs>
296
+ </div>
297
+ <div className="flex flex-col gap-4 p-8 bg-muted/70">
298
+ {queryMutation.error ? (
299
+ <div>{queryMutation.error.message}</div>
300
+ ) : queryMutation.data ? (
301
+ <div className="flex flex-col gap-2">
302
+ <div className="flex gap-2">
303
+ <div className="flex text-xs gap-6">
304
+ <div>
305
+ Status: {queryMutation.data.status}{" "}
306
+ {statusCodeMap[queryMutation.data.status] ?? ""}
307
+ </div>
308
+ <div>Time: {queryMutation.data.time.toFixed(0)}ms</div>
309
+ <div>Size: {queryMutation.data.size} B</div>
310
+ </div>
311
+ </div>
312
+ {/*<UrlDisplay host={host} path={url} />*/}
313
+ <Tabs defaultValue="response">
314
+ <TabsList>
315
+ <TabsTrigger value="response">Response</TabsTrigger>
316
+ <TabsTrigger value="headers">
317
+ {headerEntries.length
318
+ ? `Headers (${headerEntries.length})`
319
+ : "No headers"}
320
+ </TabsTrigger>
321
+ </TabsList>
322
+
323
+ <TabsContent value="response">
324
+ <Card className="shadow-none p-4">
325
+ <SyntaxHighlight
326
+ language={lang ?? "json"}
327
+ noBackground
328
+ className="overflow-x-auto "
329
+ code={queryMutation.data.body ?? JSON.stringify("")}
330
+ />
331
+ </Card>
332
+ </TabsContent>
333
+ <TabsContent value="headers">
334
+ <Card className="grid grid-cols-2 w-full gap-2.5 font-mono text-xs shadow-none p-4">
335
+ <div className="font-semibold">Key</div>
336
+ <div className="font-semibold">Value</div>
337
+ {headerEntries.map(([key, value]) => (
338
+ <Fragment key={key}>
339
+ <div>{key}</div>
340
+ <div>{value}</div>
341
+ </Fragment>
342
+ ))}
343
+ </Card>
344
+ </TabsContent>
345
+ </Tabs>
346
+ </div>
347
+ ) : (
348
+ <div className="grid place-items-center h-full">
349
+ <span className="text-[16px] font-semibold text-muted-foreground">
350
+ {queryMutation.isPending ? (
351
+ <Spinner />
352
+ ) : (
353
+ "Send a request first to see the response here"
354
+ )}
355
+ </span>
356
+ </div>
357
+ )}
358
+ </div>
359
+ </div>
360
+ </form>
361
+ </FormProvider>
362
+ </DialogContent>
363
+ </Dialog>
364
+ );
365
+ };
366
+
367
+ export { Playground };
@@ -0,0 +1,109 @@
1
+ import logger from "loglevel";
2
+ import { XIcon } from "lucide-react";
3
+ import { useEffect } from "react";
4
+ import {
5
+ Control,
6
+ Controller,
7
+ useFieldArray,
8
+ useFormContext,
9
+ useWatch,
10
+ } from "react-hook-form";
11
+ import { InlineInput } from "./InlineInput.js";
12
+ import { PlaygroundForm } from "./Playground.js";
13
+
14
+ const QueryParamActive = ({
15
+ i,
16
+ control,
17
+ }: {
18
+ i: number;
19
+ control: Control<PlaygroundForm>;
20
+ }) => {
21
+ const value = useWatch({ control, name: `queryParams.${i}.value` });
22
+ const active = useWatch({ control, name: `queryParams.${i}.active` });
23
+ const form = useFormContext<PlaygroundForm>();
24
+
25
+ useEffect(() => {
26
+ if (value) {
27
+ logger.log(`queryParams.${i}.active`, active);
28
+ form.setValue(`queryParams.${i}.active`, true);
29
+ }
30
+ }, [value]);
31
+
32
+ return (
33
+ <Controller
34
+ name={`queryParams.${i}.active`}
35
+ render={({ field }) => {
36
+ return (
37
+ <input
38
+ type="checkbox"
39
+ id={`queryParams.${i}.active`}
40
+ {...field}
41
+ checked={field.value}
42
+ />
43
+ );
44
+ }}
45
+ />
46
+ );
47
+ };
48
+
49
+ export const QueryParams = ({
50
+ control,
51
+ }: {
52
+ control: Control<PlaygroundForm>;
53
+ }) => {
54
+ const { fields } = useFieldArray<PlaygroundForm>({
55
+ control,
56
+ name: "queryParams",
57
+ });
58
+
59
+ return fields.map((field, i) => (
60
+ <div
61
+ key={field.id}
62
+ className="px-2 grid-cols-subgrid col-span-full grid items-center gap-x-2 has-[:focus]:bg-muted hover:bg-accent rounded overflow-hidden group"
63
+ >
64
+ <QueryParamActive i={i} control={control} />
65
+
66
+ <Controller
67
+ control={control}
68
+ render={({ field }) => {
69
+ return (
70
+ <InlineInput asChild>
71
+ <label
72
+ className="flex items-center"
73
+ htmlFor={`queryParams.${i}.active`}
74
+ >
75
+ {field.value}
76
+ </label>
77
+ </InlineInput>
78
+ );
79
+ }}
80
+ name={`queryParams.${i}.name`}
81
+ />
82
+ <Controller
83
+ control={control}
84
+ render={({ field }) => {
85
+ return (
86
+ <InlineInput {...field} placeholder="Value" className="peer" />
87
+ );
88
+ }}
89
+ name={`queryParams.${i}.value`}
90
+ />
91
+ <Controller
92
+ control={control}
93
+ render={({ field }) => {
94
+ return (
95
+ <button
96
+ className="hover:bg-black/5 p-1 rounded mr-2 text-muted-foreground invisible group-hover:visible peer-focus:visible"
97
+ onClick={() => field.onChange("")}
98
+ >
99
+ <XIcon size={16} />
100
+ </button>
101
+ );
102
+ }}
103
+ name={`queryParams.${i}.value`}
104
+ />
105
+
106
+ <div className="-mx-2 col-span-full border-b border-border"></div>
107
+ </div>
108
+ ));
109
+ };
@@ -0,0 +1,32 @@
1
+ import { useFormContext } from "react-hook-form";
2
+ import type { PlaygroundForm } from "./Playground.js";
3
+
4
+ export const UrlDisplay = ({ host, path }: { host: string; path: string }) => {
5
+ const { watch } = useFormContext<PlaygroundForm>();
6
+ const data = watch();
7
+ const url = new URL(
8
+ host +
9
+ path
10
+ .split("/")
11
+ .map((v) =>
12
+ v.startsWith("{") && v.endsWith("}")
13
+ ? data.pathParams.find((part) => part.name === v.slice(1, -1))
14
+ ?.value ?? v
15
+ : v,
16
+ )
17
+ .join("/"),
18
+ );
19
+
20
+ data.queryParams.forEach((param) => {
21
+ if (!param.value) {
22
+ return;
23
+ }
24
+ url.searchParams.set(param.name, param.value);
25
+ });
26
+
27
+ return (
28
+ <div className="overflow-auto font-mono whitespace-nowrap">
29
+ {url.toString()}
30
+ </div>
31
+ );
32
+ };
@@ -0,0 +1,22 @@
1
+ import { PlaygroundForm } from "./Playground.js";
2
+
3
+ export const createUrl = (host: string, path: string, data: PlaygroundForm) => {
4
+ const url = new URL(
5
+ host +
6
+ path
7
+ .split("/")
8
+ .map((v) =>
9
+ v.startsWith("{") && v.endsWith("}")
10
+ ? data.pathParams.find((part) => part.name === v.slice(1, -1))
11
+ ?.value ?? v
12
+ : v,
13
+ )
14
+ .join("/"),
15
+ );
16
+
17
+ data.queryParams.forEach((param) => {
18
+ url.searchParams.set(param.name, param.value);
19
+ });
20
+
21
+ return url;
22
+ };
@@ -4,7 +4,10 @@ import { type SchemaObject } from "../../../oas/graphql/index.js";
4
4
  export const isObject = (value: unknown): boolean =>
5
5
  typeof value === "object" && value !== null && !Array.isArray(value);
6
6
 
7
- export const generateSchemaExample = (schema: SchemaObject): any => {
7
+ export const generateSchemaExample = (
8
+ schema: SchemaObject,
9
+ name?: string,
10
+ ): any => {
8
11
  // Directly return the example or default if they exist
9
12
  if (schema.example !== undefined) {
10
13
  return schema.example;
@@ -18,21 +21,31 @@ export const generateSchemaExample = (schema: SchemaObject): any => {
18
21
  }
19
22
 
20
23
  // Recursively process objects and arrays
21
- return processComplexTypes(schema);
24
+ return processComplexTypes(schema, name);
22
25
  };
23
26
 
24
- function processComplexTypes(schema: SchemaObject): any {
25
- if (schema.type === "object" && schema.properties) {
27
+ function processComplexTypes(schema: SchemaObject, name?: string): any {
28
+ const properties = Object.entries(schema.properties ?? {}).concat(
29
+ Object.entries(schema.additionalProperties ?? {}),
30
+ );
31
+ if (schema.type === "object" && properties.length > 0) {
26
32
  const obj: { [key: string]: any } = {};
27
- Object.keys(schema.properties!).forEach((key) => {
28
- obj[key] = generateSchemaExample(schema.properties![key]);
33
+ properties.forEach(([key, propSchema]) => {
34
+ const value = generateSchemaExample(propSchema, key);
35
+ if (value !== undefined) {
36
+ obj[key] = value;
37
+ }
29
38
  });
30
39
  return obj;
31
40
  } else if (schema.type === "array" && schema.items) {
32
- return [generateSchemaExample(schema.items)];
41
+ const value = generateSchemaExample(schema.items, name);
42
+ if (value !== undefined) {
43
+ return [value];
44
+ }
45
+ return [];
33
46
  }
34
47
  // Fallback for missing or undefined types
35
- return getDefaultForType(schema.type);
48
+ return undefined; //getDefaultForType(schema.type);
36
49
  }
37
50
 
38
51
  function getDefaultForType(type?: string | string[]): any {
@@ -54,6 +67,6 @@ function getDefaultForSingleType(type?: string): any {
54
67
  case "null":
55
68
  return null;
56
69
  default:
57
- return undefined;
70
+ return "undefined";
58
71
  }
59
72
  }
@@ -1,4 +1,5 @@
1
- import { monotonicFactory } from "ulid";
1
+ /* eslint-disable no-console */
2
+ import { monotonicFactory } from "ulidx";
2
3
  import { createWaitForNotify } from "../../../util/createWaitForNotify.js";
3
4
  import {
4
5
  cacheExchange,
@@ -0,0 +1,5 @@
1
+ export function createSharedWorker() {
2
+ return new SharedWorker(new URL("./worker.ts", import.meta.url), {
3
+ type: "module",
4
+ });
5
+ }
@@ -0,0 +1 @@
1
+ export { createSharedWorkerClient } from "./openapi/worker/createSharedWorkerClient.js";
@@ -1,7 +1,7 @@
1
1
  import { Navigate } from "react-router-dom";
2
2
  import type { DevPortalPlugin } from "../../core/plugins.js";
3
3
 
4
- type Redirect = {
4
+ export type Redirect = {
5
5
  from: string;
6
6
  to: string;
7
7
  replace?: boolean;
@@ -0,0 +1,25 @@
1
+ import { Slot } from "@radix-ui/react-slot";
2
+ import { VariantProps } from "class-variance-authority";
3
+ import * as React from "react";
4
+ import { cn } from "../util/cn.js";
5
+ import { buttonVariants } from "./button-variants.js";
6
+
7
+ export interface ButtonProps
8
+ extends React.ButtonHTMLAttributes<HTMLButtonElement>,
9
+ VariantProps<typeof buttonVariants> {
10
+ asChild?: boolean;
11
+ }
12
+
13
+ export const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
14
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
15
+ const Comp = asChild ? Slot : "button";
16
+ return (
17
+ <Comp
18
+ className={cn(buttonVariants({ variant, size, className }))}
19
+ ref={ref}
20
+ {...props}
21
+ />
22
+ );
23
+ },
24
+ );
25
+ Button.displayName = "Button";
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
1
  import * as TabsPrimitive from "@radix-ui/react-tabs";
2
+ import * as React from "react";
3
3
  import { cn } from "../util/cn.js";
4
4
 
5
5
  const Tabs = TabsPrimitive.Root;
@@ -49,4 +49,4 @@ const TabsContent = React.forwardRef<
49
49
  ));
50
50
  TabsContent.displayName = TabsPrimitive.Content.displayName;
51
51
 
52
- export { Tabs, TabsList, TabsTrigger, TabsContent };
52
+ export { Tabs, TabsContent, TabsList, TabsTrigger };