zudoku 0.1.1-dev.4 → 0.1.1-dev.41

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 (553) hide show
  1. package/dist/app/App.js +17 -38
  2. package/dist/app/App.js.map +1 -1
  3. package/dist/app/main.js +3 -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/logger.d.ts +1 -2
  10. package/dist/cli/common/logger.js +3 -3
  11. package/dist/cli/common/logger.js.map +1 -1
  12. package/dist/cli/common/outdated.js +4 -4
  13. package/dist/cli/common/outdated.js.map +1 -1
  14. package/dist/cli/common/output.js +4 -4
  15. package/dist/cli/common/output.js.map +1 -1
  16. package/dist/cli/common/utils/box.js +2 -2
  17. package/dist/cli/common/utils/box.js.map +1 -1
  18. package/dist/cli/dev/handler.d.ts +1 -1
  19. package/dist/cli/dev/handler.js +14 -3
  20. package/dist/cli/dev/handler.js.map +1 -1
  21. package/dist/config/config.d.ts +20 -7
  22. package/dist/index.d.ts +2 -6
  23. package/dist/index.js +1 -5
  24. package/dist/index.js.map +1 -1
  25. package/dist/lib/authentication/authentication.js.map +1 -0
  26. package/dist/{app → lib}/authentication/clerk.d.ts +2 -2
  27. package/dist/{app → lib}/authentication/clerk.js +9 -5
  28. package/dist/lib/authentication/clerk.js.map +1 -0
  29. package/dist/{app → lib}/authentication/openid.js.map +1 -1
  30. package/dist/{app → lib}/components/AnchorLink.js.map +1 -1
  31. package/dist/{app → lib}/components/CategoryHeading.js.map +1 -1
  32. package/dist/{app → lib/components}/DevPortal.d.ts +8 -7
  33. package/dist/lib/components/DevPortal.js +28 -0
  34. package/dist/lib/components/DevPortal.js.map +1 -0
  35. package/dist/{app → lib}/components/Dialog.js +1 -1
  36. package/dist/lib/components/Dialog.js.map +1 -0
  37. package/dist/{app → lib}/components/DynamicIcon.js.map +1 -1
  38. package/dist/{app → lib}/components/Header.js +1 -1
  39. package/dist/{app → lib}/components/Header.js.map +1 -1
  40. package/dist/{app → lib/components}/Heading.js +2 -2
  41. package/dist/lib/components/Heading.js.map +1 -0
  42. package/dist/{app → lib}/components/Input.js.map +1 -1
  43. package/dist/{app → lib}/components/Layout.js +1 -2
  44. package/dist/lib/components/Layout.js.map +1 -0
  45. package/dist/lib/components/Link.d.ts +1 -0
  46. package/dist/lib/components/Link.js +2 -0
  47. package/dist/lib/components/Link.js.map +1 -0
  48. package/dist/{app → lib}/components/Markdown.js.map +1 -1
  49. package/dist/lib/components/Router.d.ts +4 -0
  50. package/dist/lib/components/Router.js +20 -0
  51. package/dist/lib/components/Router.js.map +1 -0
  52. package/dist/{app → lib}/components/SyntaxHighlight.d.ts +2 -1
  53. package/dist/{app → lib}/components/SyntaxHighlight.js +4 -1
  54. package/dist/lib/components/SyntaxHighlight.js.map +1 -0
  55. package/dist/{app → lib}/components/TopNavigation.js.map +1 -1
  56. package/dist/{app → lib}/components/context/ComponentsContext.js.map +1 -1
  57. package/dist/{app → lib}/components/context/DevPortalProvider.js +1 -1
  58. package/dist/lib/components/context/DevPortalProvider.js.map +1 -0
  59. package/dist/lib/components/context/PluginSystem.js.map +1 -0
  60. package/dist/{app → lib}/components/context/ThemeContext.js.map +1 -1
  61. package/dist/{app → lib}/components/context/ViewportAnchorContext.js.map +1 -1
  62. package/dist/lib/components/index.d.ts +3 -0
  63. package/dist/lib/components/index.js +4 -0
  64. package/dist/lib/components/index.js.map +1 -0
  65. package/dist/{app → lib}/components/navigation/SideNavigation.js +1 -1
  66. package/dist/lib/components/navigation/SideNavigation.js.map +1 -0
  67. package/dist/{app → lib}/components/navigation/SideNavigationCategory.js +1 -1
  68. package/dist/{app → lib}/components/navigation/SideNavigationCategory.js.map +1 -1
  69. package/dist/{app → lib}/components/navigation/SideNavigationItem.d.ts +2 -1
  70. package/dist/{app → lib}/components/navigation/SideNavigationItem.js +11 -4
  71. package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -0
  72. package/dist/{app → lib}/components/navigation/SideNavigationWrapper.d.ts +3 -0
  73. package/dist/lib/components/navigation/SideNavigationWrapper.js +5 -0
  74. package/dist/lib/components/navigation/SideNavigationWrapper.js.map +1 -0
  75. package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js.map +1 -1
  76. package/dist/{app → lib}/components/navigation/util.js.map +1 -1
  77. package/dist/{app → lib}/core/DevPortalContext.d.ts +2 -1
  78. package/dist/{app → lib}/core/DevPortalContext.js +2 -2
  79. package/dist/lib/core/DevPortalContext.js.map +1 -0
  80. package/dist/{app → lib}/core/helmet.js.map +1 -1
  81. package/dist/lib/core/icons.js.map +1 -0
  82. package/dist/{app → lib}/core/plugins.d.ts +1 -1
  83. package/dist/{app → lib}/core/plugins.js +1 -1
  84. package/dist/{app → lib}/core/plugins.js.map +1 -1
  85. package/dist/lib/core/router.js.map +1 -0
  86. package/dist/lib/core/types/combine.js.map +1 -0
  87. package/dist/{app → lib}/oas/graphql/index.js.map +1 -1
  88. package/dist/{app → lib}/oas/graphql/server.js.map +1 -1
  89. package/dist/{app → lib}/oas/parser/dereference/index.js.map +1 -1
  90. package/dist/{app → lib}/oas/parser/dereference/resolveRef.js.map +1 -1
  91. package/dist/{app → lib}/oas/parser/index.js.map +1 -1
  92. package/dist/{app → lib}/oas/parser/upgrade/index.js.map +1 -1
  93. package/dist/lib/plugins/api-key/CreateApiKeys.d.ts +5 -0
  94. package/dist/lib/plugins/api-key/CreateApiKeys.js +37 -0
  95. package/dist/lib/plugins/api-key/CreateApiKeys.js.map +1 -0
  96. package/dist/lib/plugins/api-key/SettingsApiKeys.d.ts +5 -0
  97. package/dist/lib/plugins/api-key/SettingsApiKeys.js +38 -0
  98. package/dist/lib/plugins/api-key/SettingsApiKeys.js.map +1 -0
  99. package/dist/lib/plugins/api-key/index.d.ts +30 -0
  100. package/dist/lib/plugins/api-key/index.js +76 -0
  101. package/dist/lib/plugins/api-key/index.js.map +1 -0
  102. package/dist/lib/plugins/index.d.ts +4 -0
  103. package/dist/lib/plugins/index.js +5 -0
  104. package/dist/lib/plugins/index.js.map +1 -0
  105. package/dist/lib/plugins/markdown/MdxPage.d.ts +5 -0
  106. package/dist/{app → lib}/plugins/markdown/MdxPage.js +8 -3
  107. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -0
  108. package/dist/{app → lib}/plugins/markdown/Toc.js.map +1 -1
  109. package/dist/{app → lib}/plugins/markdown/generateRoutes.js +1 -6
  110. package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -0
  111. package/dist/{app → lib}/plugins/markdown/index.js.map +1 -1
  112. package/dist/{app → lib}/plugins/openapi/ColorizedParam.d.ts +1 -2
  113. package/dist/{app → lib}/plugins/openapi/ColorizedParam.js +1 -1
  114. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -0
  115. package/dist/lib/plugins/openapi/MakeRequest.js +38 -0
  116. package/dist/lib/plugins/openapi/MakeRequest.js.map +1 -0
  117. package/dist/{app → lib}/plugins/openapi/MethodBadge.js.map +1 -1
  118. package/dist/{app → lib}/plugins/openapi/OperationList.js +2 -2
  119. package/dist/{app → lib}/plugins/openapi/OperationList.js.map +1 -1
  120. package/dist/lib/plugins/openapi/OperationListItem.js +38 -0
  121. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -0
  122. package/dist/{app → lib}/plugins/openapi/ParameterList.js +1 -1
  123. package/dist/{app → lib}/plugins/openapi/ParameterList.js.map +1 -1
  124. package/dist/{app → lib}/plugins/openapi/ParameterListItem.js +1 -1
  125. package/dist/{app → lib}/plugins/openapi/ParameterListItem.js.map +1 -1
  126. package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js +1 -1
  127. package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  128. package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js +2 -2
  129. package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  130. package/dist/{app → lib}/plugins/openapi/Select.js.map +1 -1
  131. package/dist/{app → lib}/plugins/openapi/Sidecar.js +13 -13
  132. package/dist/{app → lib}/plugins/openapi/Sidecar.js.map +1 -1
  133. package/dist/{app → lib}/plugins/openapi/SidecarBox.js.map +1 -1
  134. package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  135. package/dist/{app → lib}/plugins/openapi/graphql/gql.d.ts +2 -2
  136. package/dist/{app → lib}/plugins/openapi/graphql/gql.js +1 -1
  137. package/dist/{app → lib}/plugins/openapi/graphql/gql.js.map +1 -1
  138. package/dist/{app → lib}/plugins/openapi/graphql/graphql.d.ts +1 -0
  139. package/dist/{app → lib}/plugins/openapi/graphql/graphql.js +4 -0
  140. package/dist/{app → lib}/plugins/openapi/graphql/graphql.js.map +1 -1
  141. package/dist/lib/plugins/openapi/graphql/index.js.map +1 -0
  142. package/dist/{app → lib}/plugins/openapi/index.js +3 -1
  143. package/dist/lib/plugins/openapi/index.js.map +1 -0
  144. package/dist/lib/plugins/openapi/playground/Editor.d.ts +1 -0
  145. package/dist/lib/plugins/openapi/playground/Editor.js +5 -0
  146. package/dist/lib/plugins/openapi/playground/Editor.js.map +1 -0
  147. package/dist/lib/plugins/openapi/playground/Headers.d.ts +7 -0
  148. package/dist/lib/plugins/openapi/playground/Headers.js +15 -0
  149. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -0
  150. package/dist/lib/plugins/openapi/playground/InlineInput.d.ts +4 -0
  151. package/dist/lib/plugins/openapi/playground/InlineInput.js +3 -0
  152. package/dist/lib/plugins/openapi/playground/InlineInput.js.map +1 -0
  153. package/dist/lib/plugins/openapi/playground/PathParams.d.ts +6 -0
  154. package/dist/lib/plugins/openapi/playground/PathParams.js +21 -0
  155. package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -0
  156. package/dist/lib/plugins/openapi/playground/Playground.d.ts +29 -0
  157. package/dist/lib/plugins/openapi/playground/Playground.js +90 -0
  158. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -0
  159. package/dist/lib/plugins/openapi/playground/QueryParams.d.ts +5 -0
  160. package/dist/lib/plugins/openapi/playground/QueryParams.js +35 -0
  161. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -0
  162. package/dist/lib/plugins/openapi/playground/UrlDisplay.d.ts +4 -0
  163. package/dist/lib/plugins/openapi/playground/UrlDisplay.js +22 -0
  164. package/dist/lib/plugins/openapi/playground/UrlDisplay.js.map +1 -0
  165. package/dist/lib/plugins/openapi/playground/createUrl.d.ts +2 -0
  166. package/dist/lib/plugins/openapi/playground/createUrl.js +15 -0
  167. package/dist/lib/plugins/openapi/playground/createUrl.js.map +1 -0
  168. package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.d.ts +1 -1
  169. package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js +19 -9
  170. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -0
  171. package/dist/{app → lib}/plugins/openapi/util/urql.js.map +1 -1
  172. package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js +1 -1
  173. package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -1
  174. package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +1 -0
  175. package/dist/lib/plugins/openapi/worker/shared-worker.js +6 -0
  176. package/dist/lib/plugins/openapi/worker/shared-worker.js.map +1 -0
  177. package/dist/{app → lib}/plugins/openapi/worker/worker.js.map +1 -1
  178. package/dist/lib/plugins/openapi-worker.d.ts +1 -0
  179. package/dist/lib/plugins/openapi-worker.js +2 -0
  180. package/dist/lib/plugins/openapi-worker.js.map +1 -0
  181. package/dist/{app → lib}/plugins/redirect/index.d.ts +1 -2
  182. package/dist/{app → lib}/plugins/redirect/index.js.map +1 -1
  183. package/dist/{app → lib}/ui/Button.d.ts +1 -1
  184. package/dist/{app → lib}/ui/Button.js.map +1 -1
  185. package/dist/{app → lib}/ui/Callout.js.map +1 -1
  186. package/dist/{app → lib}/ui/Card.js.map +1 -1
  187. package/dist/{app → lib}/ui/Note.js.map +1 -1
  188. package/dist/{app → lib}/ui/Tabs.js.map +1 -1
  189. package/dist/{app → lib}/util/MdxComponents.js +2 -2
  190. package/dist/lib/util/MdxComponents.js.map +1 -0
  191. package/dist/{app → lib}/util/cn.js.map +1 -1
  192. package/dist/lib/util/createVariantComponent.d.ts +9 -0
  193. package/dist/lib/util/createVariantComponent.js +17 -0
  194. package/dist/lib/util/createVariantComponent.js.map +1 -0
  195. package/dist/{app → lib}/util/createWaitForNotify.js.map +1 -1
  196. package/dist/{app → lib}/util/groupBy.js.map +1 -1
  197. package/dist/{app → lib}/util/joinPath.js.map +1 -1
  198. package/dist/{app → lib}/util/pastellize.js.map +1 -1
  199. package/dist/lib/util/slugify.js.map +1 -0
  200. package/dist/{app → lib}/util/traverseNavigation.js.map +1 -1
  201. package/dist/{app → lib}/util/useScrollToAnchor.js.map +1 -1
  202. package/dist/{app → lib}/util/useScrollToTop.js.map +1 -1
  203. package/dist/ts.d.ts +6 -0
  204. package/dist/ts.js +62 -0
  205. package/dist/ts.js.map +1 -0
  206. package/dist/vite/build.js +2 -8
  207. package/dist/vite/build.js.map +1 -1
  208. package/dist/vite/common.d.ts +1 -0
  209. package/dist/vite/common.js +2 -0
  210. package/dist/vite/common.js.map +1 -0
  211. package/dist/vite/config.d.ts +10 -3
  212. package/dist/vite/config.js +108 -58
  213. package/dist/vite/config.js.map +1 -1
  214. package/dist/vite/config.test.js +4 -3
  215. package/dist/vite/config.test.js.map +1 -1
  216. package/dist/vite/dev-server.d.ts +2 -0
  217. package/dist/vite/dev-server.js +28 -8
  218. package/dist/vite/dev-server.js.map +1 -1
  219. package/dist/vite/html.d.ts +1 -1
  220. package/dist/vite/html.js +2 -3
  221. package/dist/vite/html.js.map +1 -1
  222. package/dist/vite/plugin-api-keys.d.ts +4 -0
  223. package/dist/vite/plugin-api-keys.js +33 -0
  224. package/dist/vite/plugin-api-keys.js.map +1 -0
  225. package/dist/vite/plugin-api.d.ts +4 -0
  226. package/dist/vite/plugin-api.js +49 -0
  227. package/dist/vite/plugin-api.js.map +1 -0
  228. package/dist/vite/plugin-auth.d.ts +4 -0
  229. package/dist/vite/plugin-auth.js +30 -0
  230. package/dist/vite/plugin-auth.js.map +1 -0
  231. package/dist/vite/plugin-component.d.ts +4 -0
  232. package/dist/vite/plugin-component.js +16 -0
  233. package/dist/vite/plugin-component.js.map +1 -0
  234. package/dist/vite/plugin-config.d.ts +7 -0
  235. package/dist/vite/plugin-config.js +25 -0
  236. package/dist/vite/plugin-config.js.map +1 -0
  237. package/dist/vite/plugin-docs.d.ts +4 -0
  238. package/dist/vite/plugin-docs.js +45 -0
  239. package/dist/vite/plugin-docs.js.map +1 -0
  240. package/dist/vite/plugin-docs.test.d.ts +1 -0
  241. package/dist/vite/plugin-docs.test.js +30 -0
  242. package/dist/vite/plugin-docs.test.js.map +1 -0
  243. package/dist/vite/plugin-html.d.ts +3 -0
  244. package/dist/vite/plugin-html.js +47 -0
  245. package/dist/vite/plugin-html.js.map +1 -0
  246. package/dist/vite/plugin-mdx.d.ts +8 -0
  247. package/dist/vite/plugin-mdx.js +61 -0
  248. package/dist/vite/plugin-mdx.js.map +1 -0
  249. package/dist/vite/plugin-metadata.d.ts +6 -0
  250. package/dist/vite/plugin-metadata.js +24 -0
  251. package/dist/vite/plugin-metadata.js.map +1 -0
  252. package/dist/vite/plugin-openapi-worker.d.ts +4 -0
  253. package/dist/vite/plugin-openapi-worker.js +28 -0
  254. package/dist/vite/plugin-openapi-worker.js.map +1 -0
  255. package/dist/vite/plugin-redirect.d.ts +4 -0
  256. package/dist/vite/plugin-redirect.js +32 -0
  257. package/dist/vite/plugin-redirect.js.map +1 -0
  258. package/dist/vite/plugin.d.ts +2 -6
  259. package/dist/vite/plugin.js +22 -104
  260. package/dist/vite/plugin.js.map +1 -1
  261. package/lib/assets/index-BPdJm2ty.js +4764 -0
  262. package/lib/assets/worker-W78u54MC.js +14473 -0
  263. package/lib/prism-bash.min-DadFsM4Z.js +6 -0
  264. package/lib/prism-java.min-d5iT_mOd.js +6 -0
  265. package/lib/prism-json.min-B1GJqK1k.js +1 -0
  266. package/lib/prism-markup-templating-DZrrEs0A.js +61 -0
  267. package/lib/prism-php.min-o7FpoMP_.js +10 -0
  268. package/lib/prism-ruby.min-C7LwcKyz.js +9 -0
  269. package/lib/urql-DMlBWUKL.js +1591 -0
  270. package/lib/util-c0rdJnKP.js +11742 -0
  271. package/lib/zudoku.auth-clerk.js +32 -0
  272. package/lib/zudoku.components.js +1294 -0
  273. package/lib/zudoku.openapi-worker.js +225 -0
  274. package/lib/zudoku.plugins.js +17280 -0
  275. package/package.json +69 -51
  276. package/src/app/App.tsx +19 -42
  277. package/src/app/main.tsx +5 -18
  278. package/src/{app → lib}/authentication/clerk.ts +11 -9
  279. package/src/{app → lib/components}/DevPortal.tsx +23 -42
  280. package/src/{app → lib}/components/Dialog.tsx +32 -32
  281. package/src/{app → lib}/components/Header.tsx +3 -3
  282. package/src/{app → lib/components}/Heading.tsx +2 -2
  283. package/src/{app → lib}/components/Layout.tsx +10 -6
  284. package/src/lib/components/Link.tsx +1 -0
  285. package/src/lib/components/Router.tsx +28 -0
  286. package/src/{app → lib}/components/SyntaxHighlight.tsx +10 -3
  287. package/src/{app → lib}/components/context/DevPortalProvider.ts +1 -1
  288. package/src/lib/components/index.ts +3 -0
  289. package/src/{app → lib}/components/navigation/SideNavigation.tsx +4 -1
  290. package/src/{app → lib}/components/navigation/SideNavigationCategory.tsx +3 -1
  291. package/src/{app → lib}/components/navigation/SideNavigationItem.tsx +15 -5
  292. package/src/lib/components/navigation/SideNavigationWrapper.tsx +18 -0
  293. package/src/{app → lib}/core/DevPortalContext.ts +7 -3
  294. package/src/{app → lib}/core/plugins.ts +1 -1
  295. package/src/lib/plugins/api-key/CreateApiKeys.tsx +84 -0
  296. package/src/lib/plugins/api-key/SettingsApiKeys.tsx +122 -0
  297. package/src/lib/plugins/api-key/index.tsx +126 -0
  298. package/src/lib/plugins/index.ts +4 -0
  299. package/src/{app → lib}/plugins/markdown/MdxPage.tsx +23 -6
  300. package/src/{app → lib}/plugins/markdown/generateRoutes.tsx +1 -16
  301. package/src/{app → lib}/plugins/openapi/ColorizedParam.tsx +0 -2
  302. package/src/lib/plugins/openapi/MakeRequest.tsx +58 -0
  303. package/src/{app → lib}/plugins/openapi/OperationList.tsx +3 -3
  304. package/src/lib/plugins/openapi/OperationListItem.tsx +191 -0
  305. package/src/{app → lib}/plugins/openapi/ParameterList.tsx +1 -1
  306. package/src/{app → lib}/plugins/openapi/ParameterListItem.tsx +4 -1
  307. package/src/{app → lib}/plugins/openapi/RequestBodySidecarBox.tsx +1 -1
  308. package/src/{app → lib}/plugins/openapi/ResponsesSidecarBox.tsx +1 -2
  309. package/src/{app → lib}/plugins/openapi/Sidecar.tsx +20 -20
  310. package/src/{app → lib}/plugins/openapi/graphql/gql.ts +3 -3
  311. package/src/{app → lib}/plugins/openapi/graphql/graphql.ts +5 -0
  312. package/src/{app → lib}/plugins/openapi/index.tsx +8 -2
  313. package/src/lib/plugins/openapi/playground/Editor.tsx +6 -0
  314. package/src/lib/plugins/openapi/playground/Headers.tsx +60 -0
  315. package/src/lib/plugins/openapi/playground/InlineInput.tsx +6 -0
  316. package/src/lib/plugins/openapi/playground/PathParams.tsx +63 -0
  317. package/src/lib/plugins/openapi/playground/Playground.tsx +324 -0
  318. package/src/lib/plugins/openapi/playground/QueryParams.tsx +111 -0
  319. package/src/lib/plugins/openapi/playground/UrlDisplay.tsx +32 -0
  320. package/src/lib/plugins/openapi/playground/createUrl.ts +22 -0
  321. package/src/{app → lib}/plugins/openapi/util/generateSchemaExample.ts +24 -9
  322. package/src/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.ts +1 -1
  323. package/src/lib/plugins/openapi/worker/shared-worker.ts +5 -0
  324. package/src/lib/plugins/openapi-worker.ts +1 -0
  325. package/src/{app → lib}/plugins/redirect/index.tsx +1 -1
  326. package/src/{app → lib}/util/MdxComponents.tsx +2 -1
  327. package/src/{app → lib}/util/createVariantComponent.tsx +13 -8
  328. package/dist/app/DevPortal.js +0 -41
  329. package/dist/app/DevPortal.js.map +0 -1
  330. package/dist/app/Heading.js.map +0 -1
  331. package/dist/app/authentication/authentication.js.map +0 -1
  332. package/dist/app/authentication/clerk.js.map +0 -1
  333. package/dist/app/components/Dialog.js.map +0 -1
  334. package/dist/app/components/Layout.js.map +0 -1
  335. package/dist/app/components/SyntaxHighlight.js.map +0 -1
  336. package/dist/app/components/context/DevPortalProvider.js.map +0 -1
  337. package/dist/app/components/context/PluginSystem.js.map +0 -1
  338. package/dist/app/components/navigation/SideNavigation.js.map +0 -1
  339. package/dist/app/components/navigation/SideNavigationItem.js.map +0 -1
  340. package/dist/app/components/navigation/SideNavigationWrapper.js +0 -6
  341. package/dist/app/components/navigation/SideNavigationWrapper.js.map +0 -1
  342. package/dist/app/config.d.ts +0 -3
  343. package/dist/app/config.js +0 -9
  344. package/dist/app/config.js.map +0 -1
  345. package/dist/app/core/DevPortalContext.js.map +0 -1
  346. package/dist/app/core/icons.js.map +0 -1
  347. package/dist/app/core/router.js.map +0 -1
  348. package/dist/app/core/types/combine.js.map +0 -1
  349. package/dist/app/markdowns.d.ts +0 -3
  350. package/dist/app/markdowns.js +0 -5
  351. package/dist/app/markdowns.js.map +0 -1
  352. package/dist/app/plugins/api-key/SettingsApiKeys.d.ts +0 -4
  353. package/dist/app/plugins/api-key/SettingsApiKeys.js +0 -7
  354. package/dist/app/plugins/api-key/SettingsApiKeys.js.map +0 -1
  355. package/dist/app/plugins/api-key/index.d.ts +0 -32
  356. package/dist/app/plugins/api-key/index.js +0 -55
  357. package/dist/app/plugins/api-key/index.js.map +0 -1
  358. package/dist/app/plugins/markdown/MdxPage.d.ts +0 -3
  359. package/dist/app/plugins/markdown/MdxPage.js.map +0 -1
  360. package/dist/app/plugins/markdown/generateRoutes.js.map +0 -1
  361. package/dist/app/plugins/openapi/ColorizedParam.js.map +0 -1
  362. package/dist/app/plugins/openapi/MakeRequest.js +0 -23
  363. package/dist/app/plugins/openapi/MakeRequest.js.map +0 -1
  364. package/dist/app/plugins/openapi/OperationListItem.js +0 -15
  365. package/dist/app/plugins/openapi/OperationListItem.js.map +0 -1
  366. package/dist/app/plugins/openapi/graphql/index.js.map +0 -1
  367. package/dist/app/plugins/openapi/index.js.map +0 -1
  368. package/dist/app/plugins/openapi/playground/Playground.d.ts +0 -8
  369. package/dist/app/plugins/openapi/playground/Playground.js +0 -98
  370. package/dist/app/plugins/openapi/playground/Playground.js.map +0 -1
  371. package/dist/app/plugins/openapi/util/generateSchemaExample.js.map +0 -1
  372. package/dist/app/util/MdxComponents.js.map +0 -1
  373. package/dist/app/util/createVariantComponent.d.ts +0 -15
  374. package/dist/app/util/createVariantComponent.js +0 -12
  375. package/dist/app/util/createVariantComponent.js.map +0 -1
  376. package/dist/app/util/slugify.js.map +0 -1
  377. package/dist/auth.d.ts +0 -2
  378. package/dist/auth.js +0 -3
  379. package/dist/auth.js.map +0 -1
  380. package/dist/plugins.d.ts +0 -4
  381. package/dist/plugins.js +0 -6
  382. package/dist/plugins.js.map +0 -1
  383. package/src/app/components/navigation/SideNavigationWrapper.tsx +0 -15
  384. package/src/app/config.ts +0 -20
  385. package/src/app/markdowns.ts +0 -7
  386. package/src/app/plugins/api-key/SettingsApiKeys.tsx +0 -22
  387. package/src/app/plugins/api-key/index.tsx +0 -123
  388. package/src/app/plugins/openapi/MakeRequest.tsx +0 -49
  389. package/src/app/plugins/openapi/OperationListItem.tsx +0 -55
  390. package/src/app/plugins/openapi/playground/Playground.tsx +0 -309
  391. package/src/app/plugins/openapi/queries.graphql +0 -6
  392. /package/dist/{app → lib}/authentication/authentication.d.ts +0 -0
  393. /package/dist/{app → lib}/authentication/authentication.js +0 -0
  394. /package/dist/{app → lib}/authentication/openid.d.ts +0 -0
  395. /package/dist/{app → lib}/authentication/openid.js +0 -0
  396. /package/dist/{app → lib}/components/AnchorLink.d.ts +0 -0
  397. /package/dist/{app → lib}/components/AnchorLink.js +0 -0
  398. /package/dist/{app → lib}/components/CategoryHeading.d.ts +0 -0
  399. /package/dist/{app → lib}/components/CategoryHeading.js +0 -0
  400. /package/dist/{app → lib}/components/Dialog.d.ts +0 -0
  401. /package/dist/{app → lib}/components/DynamicIcon.d.ts +0 -0
  402. /package/dist/{app → lib}/components/DynamicIcon.js +0 -0
  403. /package/dist/{app → lib}/components/Header.d.ts +0 -0
  404. /package/dist/{app → lib/components}/Heading.d.ts +0 -0
  405. /package/dist/{app → lib}/components/Input.d.ts +0 -0
  406. /package/dist/{app → lib}/components/Input.js +0 -0
  407. /package/dist/{app → lib}/components/Layout.d.ts +0 -0
  408. /package/dist/{app → lib}/components/Markdown.d.ts +0 -0
  409. /package/dist/{app → lib}/components/Markdown.js +0 -0
  410. /package/dist/{app → lib}/components/TopNavigation.d.ts +0 -0
  411. /package/dist/{app → lib}/components/TopNavigation.js +0 -0
  412. /package/dist/{app → lib}/components/context/ComponentsContext.d.ts +0 -0
  413. /package/dist/{app → lib}/components/context/ComponentsContext.js +0 -0
  414. /package/dist/{app → lib}/components/context/DevPortalProvider.d.ts +0 -0
  415. /package/dist/{app → lib}/components/context/PluginSystem.d.ts +0 -0
  416. /package/dist/{app → lib}/components/context/PluginSystem.js +0 -0
  417. /package/dist/{app → lib}/components/context/ThemeContext.d.ts +0 -0
  418. /package/dist/{app → lib}/components/context/ThemeContext.js +0 -0
  419. /package/dist/{app → lib}/components/context/ViewportAnchorContext.d.ts +0 -0
  420. /package/dist/{app → lib}/components/context/ViewportAnchorContext.js +0 -0
  421. /package/dist/{app → lib}/components/navigation/SideNavigation.d.ts +0 -0
  422. /package/dist/{app → lib}/components/navigation/SideNavigationCategory.d.ts +0 -0
  423. /package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.d.ts +0 -0
  424. /package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js +0 -0
  425. /package/dist/{app → lib}/components/navigation/util.d.ts +0 -0
  426. /package/dist/{app → lib}/components/navigation/util.js +0 -0
  427. /package/dist/{app → lib}/core/helmet.d.ts +0 -0
  428. /package/dist/{app → lib}/core/helmet.js +0 -0
  429. /package/dist/{app → lib}/core/icons.d.ts +0 -0
  430. /package/dist/{app → lib}/core/icons.js +0 -0
  431. /package/dist/{app → lib}/core/router.d.ts +0 -0
  432. /package/dist/{app → lib}/core/router.js +0 -0
  433. /package/dist/{app → lib}/core/types/combine.d.ts +0 -0
  434. /package/dist/{app → lib}/core/types/combine.js +0 -0
  435. /package/dist/{app → lib}/oas/graphql/index.d.ts +0 -0
  436. /package/dist/{app → lib}/oas/graphql/index.js +0 -0
  437. /package/dist/{app → lib}/oas/graphql/server.d.ts +0 -0
  438. /package/dist/{app → lib}/oas/graphql/server.js +0 -0
  439. /package/dist/{app → lib}/oas/parser/dereference/index.d.ts +0 -0
  440. /package/dist/{app → lib}/oas/parser/dereference/index.js +0 -0
  441. /package/dist/{app → lib}/oas/parser/dereference/resolveRef.d.ts +0 -0
  442. /package/dist/{app → lib}/oas/parser/dereference/resolveRef.js +0 -0
  443. /package/dist/{app → lib}/oas/parser/index.d.ts +0 -0
  444. /package/dist/{app → lib}/oas/parser/index.js +0 -0
  445. /package/dist/{app → lib}/oas/parser/upgrade/index.d.ts +0 -0
  446. /package/dist/{app → lib}/oas/parser/upgrade/index.js +0 -0
  447. /package/dist/{app → lib}/plugins/markdown/Toc.d.ts +0 -0
  448. /package/dist/{app → lib}/plugins/markdown/Toc.js +0 -0
  449. /package/dist/{app → lib}/plugins/markdown/generateRoutes.d.ts +0 -0
  450. /package/dist/{app → lib}/plugins/markdown/index.d.ts +0 -0
  451. /package/dist/{app → lib}/plugins/markdown/index.js +0 -0
  452. /package/dist/{app → lib}/plugins/openapi/MakeRequest.d.ts +0 -0
  453. /package/dist/{app → lib}/plugins/openapi/MethodBadge.d.ts +0 -0
  454. /package/dist/{app → lib}/plugins/openapi/MethodBadge.js +0 -0
  455. /package/dist/{app → lib}/plugins/openapi/OperationList.d.ts +0 -0
  456. /package/dist/{app → lib}/plugins/openapi/OperationListItem.d.ts +0 -0
  457. /package/dist/{app → lib}/plugins/openapi/ParameterList.d.ts +0 -0
  458. /package/dist/{app → lib}/plugins/openapi/ParameterListItem.d.ts +0 -0
  459. /package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.d.ts +0 -0
  460. /package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.d.ts +0 -0
  461. /package/dist/{app → lib}/plugins/openapi/Select.d.ts +0 -0
  462. /package/dist/{app → lib}/plugins/openapi/Select.js +0 -0
  463. /package/dist/{app → lib}/plugins/openapi/Sidecar.d.ts +0 -0
  464. /package/dist/{app → lib}/plugins/openapi/SidecarBox.d.ts +0 -0
  465. /package/dist/{app → lib}/plugins/openapi/SidecarBox.js +0 -0
  466. /package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.d.ts +0 -0
  467. /package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js +0 -0
  468. /package/dist/{app → lib}/plugins/openapi/graphql/index.d.ts +0 -0
  469. /package/dist/{app → lib}/plugins/openapi/graphql/index.js +0 -0
  470. /package/dist/{app → lib}/plugins/openapi/index.d.ts +0 -0
  471. /package/dist/{app → lib}/plugins/openapi/util/urql.d.ts +0 -0
  472. /package/dist/{app → lib}/plugins/openapi/util/urql.js +0 -0
  473. /package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -0
  474. /package/dist/{app → lib}/plugins/openapi/worker/worker.d.ts +0 -0
  475. /package/dist/{app → lib}/plugins/openapi/worker/worker.js +0 -0
  476. /package/dist/{app → lib}/plugins/redirect/index.js +0 -0
  477. /package/dist/{app → lib}/ui/Button.js +0 -0
  478. /package/dist/{app → lib}/ui/Callout.d.ts +0 -0
  479. /package/dist/{app → lib}/ui/Callout.js +0 -0
  480. /package/dist/{app → lib}/ui/Card.d.ts +0 -0
  481. /package/dist/{app → lib}/ui/Card.js +0 -0
  482. /package/dist/{app → lib}/ui/Note.d.ts +0 -0
  483. /package/dist/{app → lib}/ui/Note.js +0 -0
  484. /package/dist/{app → lib}/ui/Tabs.d.ts +0 -0
  485. /package/dist/{app → lib}/ui/Tabs.js +0 -0
  486. /package/dist/{app → lib}/util/MdxComponents.d.ts +0 -0
  487. /package/dist/{app → lib}/util/cn.d.ts +0 -0
  488. /package/dist/{app → lib}/util/cn.js +0 -0
  489. /package/dist/{app → lib}/util/createWaitForNotify.d.ts +0 -0
  490. /package/dist/{app → lib}/util/createWaitForNotify.js +0 -0
  491. /package/dist/{app → lib}/util/groupBy.d.ts +0 -0
  492. /package/dist/{app → lib}/util/groupBy.js +0 -0
  493. /package/dist/{app → lib}/util/joinPath.d.ts +0 -0
  494. /package/dist/{app → lib}/util/joinPath.js +0 -0
  495. /package/dist/{app → lib}/util/pastellize.d.ts +0 -0
  496. /package/dist/{app → lib}/util/pastellize.js +0 -0
  497. /package/dist/{app → lib}/util/slugify.d.ts +0 -0
  498. /package/dist/{app → lib}/util/slugify.js +0 -0
  499. /package/dist/{app → lib}/util/traverseNavigation.d.ts +0 -0
  500. /package/dist/{app → lib}/util/traverseNavigation.js +0 -0
  501. /package/dist/{app → lib}/util/useScrollToAnchor.d.ts +0 -0
  502. /package/dist/{app → lib}/util/useScrollToAnchor.js +0 -0
  503. /package/dist/{app → lib}/util/useScrollToTop.d.ts +0 -0
  504. /package/dist/{app → lib}/util/useScrollToTop.js +0 -0
  505. /package/src/{app → lib}/authentication/authentication.ts +0 -0
  506. /package/src/{app → lib}/authentication/openid.ts +0 -0
  507. /package/src/{app → lib}/components/AnchorLink.tsx +0 -0
  508. /package/src/{app → lib}/components/CategoryHeading.tsx +0 -0
  509. /package/src/{app → lib}/components/DynamicIcon.tsx +0 -0
  510. /package/src/{app → lib}/components/Input.tsx +0 -0
  511. /package/src/{app → lib}/components/Markdown.tsx +0 -0
  512. /package/src/{app → lib}/components/TopNavigation.tsx +0 -0
  513. /package/src/{app → lib}/components/context/ComponentsContext.tsx +0 -0
  514. /package/src/{app → lib}/components/context/PluginSystem.ts +0 -0
  515. /package/src/{app → lib}/components/context/ThemeContext.tsx +0 -0
  516. /package/src/{app → lib}/components/context/ViewportAnchorContext.tsx +0 -0
  517. /package/src/{app → lib}/components/navigation/useNavigationCollapsibleState.ts +0 -0
  518. /package/src/{app → lib}/components/navigation/util.ts +0 -0
  519. /package/src/{app → lib}/core/helmet.ts +0 -0
  520. /package/src/{app → lib}/core/icons.tsx +0 -0
  521. /package/src/{app → lib}/core/router.tsx +0 -0
  522. /package/src/{app → lib}/core/types/combine.ts +0 -0
  523. /package/src/{app → lib}/oas/graphql/index.ts +0 -0
  524. /package/src/{app → lib}/oas/graphql/server.ts +0 -0
  525. /package/src/{app → lib}/oas/parser/dereference/index.ts +0 -0
  526. /package/src/{app → lib}/oas/parser/dereference/resolveRef.ts +0 -0
  527. /package/src/{app → lib}/oas/parser/index.ts +0 -0
  528. /package/src/{app → lib}/oas/parser/schemas/v3.0.json +0 -0
  529. /package/src/{app → lib}/oas/parser/schemas/v3.1.json +0 -0
  530. /package/src/{app → lib}/oas/parser/upgrade/index.ts +0 -0
  531. /package/src/{app → lib}/plugins/markdown/Toc.tsx +0 -0
  532. /package/src/{app → lib}/plugins/markdown/index.tsx +0 -0
  533. /package/src/{app → lib}/plugins/openapi/MethodBadge.tsx +0 -0
  534. /package/src/{app → lib}/plugins/openapi/Select.tsx +0 -0
  535. /package/src/{app → lib}/plugins/openapi/SidecarBox.tsx +0 -0
  536. /package/src/{app → lib}/plugins/openapi/graphql/fragment-masking.ts +0 -0
  537. /package/src/{app → lib}/plugins/openapi/graphql/index.ts +0 -0
  538. /package/src/{app → lib}/plugins/openapi/util/urql.ts +0 -0
  539. /package/src/{app → lib}/plugins/openapi/worker/worker.ts +0 -0
  540. /package/src/{app → lib}/ui/Button.tsx +0 -0
  541. /package/src/{app → lib}/ui/Callout.tsx +0 -0
  542. /package/src/{app → lib}/ui/Card.tsx +0 -0
  543. /package/src/{app → lib}/ui/Note.tsx +0 -0
  544. /package/src/{app → lib}/ui/Tabs.tsx +0 -0
  545. /package/src/{app → lib}/util/cn.ts +0 -0
  546. /package/src/{app → lib}/util/createWaitForNotify.ts +0 -0
  547. /package/src/{app → lib}/util/groupBy.ts +0 -0
  548. /package/src/{app → lib}/util/joinPath.tsx +0 -0
  549. /package/src/{app → lib}/util/pastellize.ts +0 -0
  550. /package/src/{app → lib}/util/slugify.ts +0 -0
  551. /package/src/{app → lib}/util/traverseNavigation.ts +0 -0
  552. /package/src/{app → lib}/util/useScrollToAnchor.ts +0 -0
  553. /package/src/{app → lib}/util/useScrollToTop.ts +0 -0
@@ -0,0 +1,58 @@
1
+ import type { OperationListItemResult } from "./OperationList.js";
2
+ import { Playground } from "./playground/Playground.js";
3
+ import { useOasConfig } from "./index.js";
4
+ import { graphql } from "./graphql/index.js";
5
+
6
+ import { useQuery } from "urql";
7
+
8
+ const GetServerQuery = graphql(/* GraphQL */ `
9
+ query getServerQuery($input: JSON!, $type: SchemaType!) {
10
+ schema(input: $input, type: $type) {
11
+ url
12
+ }
13
+ }
14
+ `);
15
+
16
+ export const MakeRequest = ({
17
+ operation,
18
+ }: {
19
+ operation: OperationListItemResult;
20
+ }) => {
21
+ const variables = useOasConfig();
22
+ const [server] = useQuery({ query: GetServerQuery, variables });
23
+
24
+ const headers = operation.parameters
25
+ ?.filter((p) => p.in === "header")
26
+ ?.map((p) => ({
27
+ name: p.name,
28
+ value: "",
29
+ }));
30
+ const queryParams = operation.parameters
31
+ ?.filter((p) => p.in === "query")
32
+ ?.map((p) => ({
33
+ name: p.name,
34
+ value: "",
35
+ }));
36
+ const pathParams = operation.parameters
37
+ ?.filter((p) => p.in === "path")
38
+ ?.map((p) => ({
39
+ name: p.name,
40
+ value: "",
41
+ }));
42
+
43
+ const hasParams =
44
+ operation.parameters?.some((p) => p.in === "query" || p.in === "path") ??
45
+ false;
46
+
47
+ return (
48
+ <Playground
49
+ host={server.data?.schema.url ?? ""}
50
+ method={operation.method}
51
+ url={operation.path}
52
+ headers={headers}
53
+ queryParams={queryParams}
54
+ pathParams={pathParams}
55
+ hasParams={hasParams}
56
+ />
57
+ );
58
+ };
@@ -1,12 +1,12 @@
1
- import { Heading } from "../../Heading.js";
1
+ import { ResultOf } from "@graphql-typed-document-node/core";
2
2
  import { CategoryHeading } from "../../components/CategoryHeading.js";
3
+ import { Heading } from "../../components/Heading.js";
3
4
  import { Markdown, ProseClasses } from "../../components/Markdown.js";
4
5
  import { cn } from "../../util/cn.js";
5
6
  import { OperationListItem } from "./OperationListItem.js";
6
- import { useOasConfig } from "./index.js";
7
7
  import { graphql } from "./graphql/index.js";
8
+ import { useOasConfig } from "./index.js";
8
9
  import { useQuery } from "./util/urql.js";
9
- import { ResultOf } from "@graphql-typed-document-node/core";
10
10
 
11
11
  export const OperationsFragment = graphql(/* GraphQL */ `
12
12
  fragment OperationsFragment on OperationItem {
@@ -0,0 +1,191 @@
1
+ import { Heading } from "../../components/Heading.js";
2
+ import { Markdown, ProseClasses } from "../../components/Markdown.js";
3
+ import { groupBy } from "../../util/groupBy.js";
4
+ import { OperationsFragment } from "./OperationList.js";
5
+ import { ParameterList } from "./ParameterList.js";
6
+ import { Sidecar } from "./Sidecar.js";
7
+ import { FragmentType, useFragment } from "./graphql/index.js";
8
+ import { SchemaObject } from "../../oas/parser/index.js";
9
+ import { useState } from "react";
10
+ import { cn } from "../../util/cn.js";
11
+ import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../ui/Tabs.js";
12
+
13
+ export const PARAM_GROUPS = ["path", "query", "header", "cookie"] as const;
14
+ export type ParameterGroup = (typeof PARAM_GROUPS)[number];
15
+
16
+ export const OperationListItem = ({
17
+ operationFragment,
18
+ }: {
19
+ operationFragment: FragmentType<typeof OperationsFragment>;
20
+ }) => {
21
+ const operation = useFragment(OperationsFragment, operationFragment);
22
+ const groupedParameters = groupBy(operation?.parameters ?? [], "in");
23
+ const first = operation.responses.find((re) => re.statusCode === "200");
24
+ return (
25
+ <div
26
+ key={operation.operationId}
27
+ className="grid grid-cols-2 gap-8 items-start border-b-2 mb-16 pb-16 border-border"
28
+ >
29
+ <div className={ProseClasses}>
30
+ <Heading
31
+ level={2}
32
+ className="mt-0"
33
+ id={operation.slug}
34
+ registerSidebarAnchor
35
+ >
36
+ {operation.summary}
37
+ </Heading>
38
+ {operation.description && <Markdown content={operation.description} />}
39
+ {operation.parameters && operation.parameters.length > 0 && (
40
+ <div className="mt-4">
41
+ {PARAM_GROUPS.flatMap((group) =>
42
+ groupedParameters?.[group]?.length ? (
43
+ <ParameterList
44
+ key={group}
45
+ id={operation.slug}
46
+ groupedParameters={groupedParameters}
47
+ group={group}
48
+ />
49
+ ) : (
50
+ []
51
+ ),
52
+ )}
53
+ </div>
54
+ )}
55
+ <Heading level={3} className="capitalize">
56
+ Repsonses
57
+ </Heading>
58
+ <Tabs defaultValue={`${first?.statusCode}${first?.description}`}>
59
+ <TabsList>
60
+ {operation.responses.map((response) => (
61
+ <TabsTrigger value={response.statusCode + response.description}>
62
+ {response.description} ({response.statusCode})
63
+ </TabsTrigger>
64
+ ))}
65
+ </TabsList>
66
+ <ul className="list-none m-0 px-0 overflow-hidden">
67
+ {operation.responses.map((response) => (
68
+ <TabsContent value={response.statusCode + response.description}>
69
+ <ViewSchema schema={response.content?.at(0)?.schema} name="" />
70
+ </TabsContent>
71
+ ))}
72
+ </ul>
73
+ </Tabs>
74
+ </div>
75
+
76
+ <Sidecar operation={operation} />
77
+ </div>
78
+ );
79
+ };
80
+
81
+ const ViewSchema = ({
82
+ name,
83
+ schema,
84
+ level = 0,
85
+ collapsible = false,
86
+ }: {
87
+ level?: number;
88
+ collapsible?: boolean;
89
+ name?: string;
90
+ schema: SchemaObject;
91
+ }) => {
92
+ const [open, setOpen] = useState(!collapsible);
93
+
94
+ const properties = Object.entries(schema.properties ?? {});
95
+ const additionalProperties =
96
+ typeof schema.additionalProperties === "object"
97
+ ? Object.entries(schema.additionalProperties)
98
+ : [];
99
+
100
+ return (
101
+ <div
102
+ className={cn(
103
+ "not-prose",
104
+ level > 0 && "border border-border rounded text-sm",
105
+ )}
106
+ onClick={
107
+ collapsible
108
+ ? () => {
109
+ setOpen((open) => !open);
110
+ }
111
+ : undefined
112
+ }
113
+ >
114
+ {(schema.title ?? name) && (
115
+ <div className="ml-2 my-1 font-bold">{schema.title ?? name}</div>
116
+ )}
117
+ {level === 0 && <p>schema.description</p>}
118
+ <ul>
119
+ {open &&
120
+ properties
121
+ .concat(additionalProperties)
122
+ .map(([propertyName, property]) => (
123
+ <div
124
+ className={cn(
125
+ level > 0 ? "py-2" : "py-4",
126
+ "px-2 border-t border-border bg-border/20 hover:bg-border/30 flex gap-1 flex-col",
127
+ property.deprecated && "opacity-50",
128
+ )}
129
+ >
130
+ <div className="flex items-center gap-2 relative">
131
+ <code>
132
+ {propertyName} {property.title}
133
+ </code>
134
+
135
+ {property.type && (
136
+ <span className="text-sm text-muted-foreground">
137
+ {property.type}
138
+ </span>
139
+ )}
140
+ {property.deprecated && (
141
+ <span className="text-sm text-muted-foreground">
142
+ Deprecated
143
+ </span>
144
+ )}
145
+
146
+ {!schema.required?.includes(propertyName) &&
147
+ !property.required && (
148
+ <span className="py-px px-1.5 font-medium text-xs border border-border rounded-lg">
149
+ optional
150
+ </span>
151
+ )}
152
+ {/*{property.type === "object" && (*/}
153
+ {/* <div className="absolute right-3">+</div>*/}
154
+ {/*)}*/}
155
+ </div>
156
+ {property.description && (
157
+ <Markdown
158
+ content={property.description}
159
+ className="prose text-sm prose-p:my-1 leading-normal line-clamp-4"
160
+ />
161
+ )}
162
+
163
+ {property.enum && (
164
+ <span className="text-sm text-muted-foreground flex gap-1 flex-wrap items-center">
165
+ <span>Possible values</span>
166
+ {property.enum
167
+ .filter((value) => value)
168
+ .map((value) => (
169
+ <span className="font-mono text-xs border-border border bg-muted rounded px-1">
170
+ {value}
171
+ </span>
172
+ ))}
173
+ </span>
174
+ )}
175
+ {property.type === "object" && (
176
+ <div className="mt-2.5">
177
+ <ViewSchema schema={property} level={level + 1} />
178
+ </div>
179
+ )}
180
+ {property.type === "array" &&
181
+ property.items.type === "object" && (
182
+ <div className="mt-2.5">
183
+ <ViewSchema schema={property.items} level={level + 1} />
184
+ </div>
185
+ )}
186
+ </div>
187
+ ))}
188
+ </ul>
189
+ </div>
190
+ );
191
+ };
@@ -1,4 +1,4 @@
1
- import { Heading } from "../../Heading.js";
1
+ import { Heading } from "../../components/Heading.js";
2
2
  import type { ParameterGroup } from "./OperationListItem.js";
3
3
  import {
4
4
  ParameterListItem,
@@ -54,7 +54,10 @@ export const ParameterListItem = ({
54
54
  )}
55
55
  </div>
56
56
  {parameter.description && (
57
- <Markdown content={parameter.description} className="prose-p:my-1" />
57
+ <Markdown
58
+ content={parameter.description}
59
+ className="text-sm prose-p:my-1"
60
+ />
58
61
  )}
59
62
  </li>
60
63
  );
@@ -34,7 +34,7 @@ export const RequestBodySidecarBox = ({ content }: { content: Content }) => {
34
34
  <SyntaxHighlight
35
35
  language="json"
36
36
  noBackground
37
- copyable={false}
37
+ copyable
38
38
  className="text-xs"
39
39
  code={JSON.stringify(
40
40
  selected === "example"
@@ -20,7 +20,7 @@ export const ResponsesSidecarBox = ({
20
20
  return (
21
21
  <SidecarBox.Root>
22
22
  <SidecarBox.Head className="text-xs grid grid-rows-2 pb-0">
23
- <span className="font-mono">Responses</span>
23
+ <span className="font-mono">Example Responses</span>
24
24
  <div className="flex gap-2">
25
25
  {responses.map((response, index) => (
26
26
  <div
@@ -43,7 +43,6 @@ export const ResponsesSidecarBox = ({
43
43
  <SyntaxHighlight
44
44
  language="json"
45
45
  noBackground
46
- copyable={false}
47
46
  className="text-xs"
48
47
  code={JSON.stringify(generateSchemaExample(schema), null, 2)}
49
48
  />
@@ -111,7 +111,6 @@ export const Sidecar = ({
111
111
  return (
112
112
  <aside className="flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4">
113
113
  <SidecarBox.Root>
114
- <MakeRequest operation={operation} />
115
114
  <SidecarBox.Head className="flex justify-between items-center flex-nowrap p-2 gap-2 text-xs">
116
115
  <span className="font-mono break-words">
117
116
  <span className={cn("font-semibold", methodTextColor)}>
@@ -120,35 +119,36 @@ export const Sidecar = ({
120
119
  &nbsp;
121
120
  {path}
122
121
  </span>
123
- <Select
124
- className="self-start"
125
- onChange={(e) => setOption(e.target.value)}
126
- options={[
127
- { value: "shell", label: "cURL" },
128
- { value: "js", label: "Javascript" },
129
- { value: "python", label: "Python" },
130
- { value: "java", label: "Java" },
131
- { value: "go", label: "Go" },
132
- { value: "csharp", label: "C#" },
133
- { value: "kotlin", label: "Kotlin" },
134
- { value: "objc", label: "Objective C" },
135
- { value: "php", label: "PHP" },
136
- { value: "ruby", label: "Ruby" },
137
- { value: "swift", label: "Swift" },
138
- ]}
139
- />
122
+ <div className="flex gap-2 items-center">
123
+ <Select
124
+ className="self-start"
125
+ onChange={(e) => setOption(e.target.value)}
126
+ options={[
127
+ { value: "shell", label: "cURL" },
128
+ { value: "js", label: "Javascript" },
129
+ { value: "python", label: "Python" },
130
+ { value: "java", label: "Java" },
131
+ { value: "go", label: "Go" },
132
+ { value: "csharp", label: "C#" },
133
+ { value: "kotlin", label: "Kotlin" },
134
+ { value: "objc", label: "Objective C" },
135
+ { value: "php", label: "PHP" },
136
+ { value: "ruby", label: "Ruby" },
137
+ { value: "swift", label: "Swift" },
138
+ ]}
139
+ />
140
+ <MakeRequest operation={operation} />
141
+ </div>
140
142
  </SidecarBox.Head>
141
143
  <SidecarBox.Body>
142
144
  <SyntaxHighlight
143
145
  language={option}
144
- copyable={false}
145
146
  noBackground
146
147
  className="text-xs"
147
148
  code={code}
148
149
  />
149
150
  </SidecarBox.Body>
150
151
  </SidecarBox.Root>
151
- {/*<MakeRequest />*/}
152
152
  {requestBodyContent && (
153
153
  <RequestBodySidecarBox content={requestBodyContent} />
154
154
  )}
@@ -19,7 +19,7 @@ const documents = {
19
19
  types.OperationsFragmentFragmentDoc,
20
20
  "\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n":
21
21
  types.AllOperationsDocument,
22
- "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n method\n summary\n operationId\n path\n }\n }\n }\n }\n":
22
+ "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n":
23
23
  types.GetCategoriesDocument,
24
24
  };
25
25
 
@@ -59,8 +59,8 @@ export function graphql(
59
59
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
60
60
  */
61
61
  export function graphql(
62
- source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n method\n summary\n operationId\n path\n }\n }\n }\n }\n",
63
- ): (typeof documents)["\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n method\n summary\n operationId\n path\n }\n }\n }\n }\n"];
62
+ source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n",
63
+ ): (typeof documents)["\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n"];
64
64
 
65
65
  export function graphql(source: string) {
66
66
  return (documents as any)[source] ?? {};
@@ -259,6 +259,7 @@ export type GetCategoriesQuery = {
259
259
  operations: Array<{
260
260
  __typename: "OperationItem";
261
261
  slug: string;
262
+ deprecated?: boolean | null;
262
263
  method: string;
263
264
  summary?: string | null;
264
265
  operationId?: string | null;
@@ -763,6 +764,10 @@ export const GetCategoriesDocument = {
763
764
  kind: "Field",
764
765
  name: { kind: "Name", value: "slug" },
765
766
  },
767
+ {
768
+ kind: "Field",
769
+ name: { kind: "Name", value: "deprecated" },
770
+ },
766
771
  {
767
772
  kind: "Field",
768
773
  name: { kind: "Name", value: "method" },
@@ -13,7 +13,9 @@ import {
13
13
  cacheExchange,
14
14
  fetchExchange,
15
15
  } from "./util/urql.js";
16
- import { createSharedWorkerClient } from "./worker/createSharedWorkerClient.js";
16
+
17
+ import { createSharedWorkerClient } from "virtual:zudoku-openapi-worker";
18
+ import type { createSharedWorkerClient as createSharedWorkerClientType } from "./worker/createSharedWorkerClient.js";
17
19
 
18
20
  const OasContext = createContext<{ config: OasPluginConfig } | undefined>(
19
21
  undefined,
@@ -64,6 +66,7 @@ const GetCategoriesQuery = graphql(`
64
66
  operations {
65
67
  __typename
66
68
  slug
69
+ deprecated
67
70
  method
68
71
  summary
69
72
  operationId
@@ -82,7 +85,9 @@ export const openApiPlugin = (config: OasPluginConfig): DevPortalPlugin => {
82
85
  url: config.server,
83
86
  exchanges: [cacheExchange, fetchExchange],
84
87
  })
85
- : createSharedWorkerClient();
88
+ : (createSharedWorkerClient() as ReturnType<
89
+ typeof createSharedWorkerClientType
90
+ >);
86
91
 
87
92
  return {
88
93
  getNavigation: async (path: string) => {
@@ -105,6 +110,7 @@ export const openApiPlugin = (config: OasPluginConfig): DevPortalPlugin => {
105
110
  collapsible: false,
106
111
  children: tag.operations.map((operation) => ({
107
112
  path: `#${operation.slug}`,
113
+ muted: !!operation.deprecated,
108
114
  title: operation.summary ?? operation.path,
109
115
  label: (
110
116
  <div className="flex flex-1 min-w-0 justify-between gap-2">
@@ -0,0 +1,6 @@
1
+ import { lazy } from "react";
2
+
3
+ export const Editor = () => {
4
+ // const XoXo = lazy(() => import("@monaco-editor/react"));
5
+ // return <XoXo />;
6
+ };
@@ -0,0 +1,60 @@
1
+ import { Control, useFieldArray, UseFormRegister } from "react-hook-form";
2
+ import { XIcon } from "lucide-react";
3
+ import { InlineInput } from "./InlineInput.js";
4
+ import type { PlaygroundForm, Header } from "./Playground.js";
5
+ import { Button } from "../../../ui/Button.js";
6
+
7
+ export const Headers = ({
8
+ control,
9
+ register,
10
+ headers,
11
+ }: {
12
+ register: UseFormRegister<PlaygroundForm>;
13
+ control: Control<PlaygroundForm>;
14
+ headers: Header[];
15
+ }) => {
16
+ const { fields, append, remove } = useFieldArray<PlaygroundForm>({
17
+ control,
18
+ name: "headers",
19
+ });
20
+ return (
21
+ <div className="grid grid-cols-[1fr_1fr_auto]">
22
+ {fields.map((header, i) => (
23
+ <div
24
+ key={header.id}
25
+ className="grid-cols-subgrid col-span-full grid items-center gap-x-2 has-[:focus]:bg-muted hover:bg-muted rounded overflow-hidden group"
26
+ >
27
+ <InlineInput
28
+ {...register(`headers.${i}.name`)}
29
+ placeholder="Name"
30
+ className="peer"
31
+ autoComplete="off"
32
+ />
33
+ <InlineInput
34
+ placeholder={"Value"}
35
+ className="peer"
36
+ {...register(`headers.${i}.value`)}
37
+ autoComplete="off"
38
+ />
39
+ <button
40
+ className="hover:bg-black/5 p-1 rounded mr-2 text-muted-foreground invisible group-hover:visible peer-focus:visible"
41
+ onClick={() => {
42
+ remove(i);
43
+ }}
44
+ type="button"
45
+ >
46
+ <XIcon size={16} />
47
+ </button>
48
+ <div className="col-span-full border-b border-border"></div>
49
+ </div>
50
+ ))}
51
+ <Button
52
+ className="col-span-full mt-4"
53
+ onClick={() => append({ name: "", value: "" })}
54
+ type="button"
55
+ >
56
+ Add header
57
+ </Button>
58
+ </div>
59
+ );
60
+ };
@@ -0,0 +1,6 @@
1
+ import createVariantComponent from "../../../util/createVariantComponent.js";
2
+
3
+ export const InlineInput = createVariantComponent(
4
+ "input",
5
+ "px-2 bg-transparent h-6 font-mono text-xs m-2",
6
+ );
@@ -0,0 +1,63 @@
1
+ import { Control, useFieldArray, UseFormRegister } from "react-hook-form";
2
+ import { InlineInput } from "./InlineInput.js";
3
+ import { PlaygroundForm } from "./Playground.js";
4
+ import { DATA_ATTR, usePastellizedColor } from "../ColorizedParam.js";
5
+ import { forwardRef, InputHTMLAttributes } from "react";
6
+ import { cn } from "../../../util/cn.js";
7
+
8
+ type ParameterValueProps = {
9
+ part: string;
10
+ } & InputHTMLAttributes<HTMLInputElement>;
11
+
12
+ const ParameterValue = forwardRef<HTMLInputElement, ParameterValueProps>(
13
+ ({ part, className, ...props }, ref) => {
14
+ const color = usePastellizedColor(part);
15
+ return (
16
+ <InlineInput
17
+ {...props}
18
+ ref={ref}
19
+ className={cn(className, "opacity-80 data-[active=true]:opacity-100")}
20
+ style={{
21
+ // color: `hsl(${color})`,
22
+ outlineColor: `hsl(${color})`,
23
+ }}
24
+ />
25
+ );
26
+ },
27
+ );
28
+
29
+ export const PathParams = ({
30
+ control,
31
+ register,
32
+ }: {
33
+ register: UseFormRegister<PlaygroundForm>;
34
+ control: Control<PlaygroundForm>;
35
+ }) => {
36
+ const { fields } = useFieldArray<PlaygroundForm>({
37
+ control,
38
+ name: "pathParams",
39
+ });
40
+
41
+ return fields.map((part, i) => (
42
+ <div
43
+ key={part.id}
44
+ className="grid-cols-subgrid col-span-full grid items-center gap-x-2 has-[:focus]:bg-muted hover:bg-muted rounded overflow-hidden group"
45
+ >
46
+ <InlineInput
47
+ {...register(`pathParams.${i}.name`)}
48
+ disabled
49
+ placeholder="Name"
50
+ className="peer"
51
+ />
52
+ <ParameterValue
53
+ {...register(`pathParams.${i}.value`)}
54
+ part={part.name}
55
+ {...{ [DATA_ATTR]: part.name }}
56
+ placeholder="Value"
57
+ className="peer"
58
+ />
59
+
60
+ <div className="col-span-full border-b border-border"></div>
61
+ </div>
62
+ ));
63
+ };