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
@@ -32,6 +32,7 @@ type SyntaxHighlightProps = {
32
32
  noBackground?: boolean;
33
33
  wrapLines?: boolean;
34
34
  copyable?: boolean;
35
+ showLanguageIndicator?: boolean;
35
36
  } & Omit<HighlightProps, "children">;
36
37
 
37
38
  export const SyntaxHighlight = ({
@@ -41,6 +42,10 @@ export const SyntaxHighlight = ({
41
42
  const [isDark] = useTheme();
42
43
  const [isCopied, setIsCopied] = useState(false);
43
44
 
45
+ if (!props.code) {
46
+ return null;
47
+ }
48
+
44
49
  return (
45
50
  <Highlight theme={isDark ? themes.vsDark : themes.github} {...props}>
46
51
  {({ className, style, tokens, getLineProps, getTokenProps }) => (
@@ -77,9 +82,11 @@ export const SyntaxHighlight = ({
77
82
  )}
78
83
  </button>
79
84
  )}
80
- <span className="absolute top-1.5 right-3 text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0">
81
- {props.language}
82
- </span>
85
+ {props.showLanguageIndicator && (
86
+ <span className="absolute top-1.5 right-3 text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0">
87
+ {props.language}
88
+ </span>
89
+ )}
83
90
  {tokens.map((line, i) => (
84
91
  <div key={i} {...getLineProps({ line })}>
85
92
  {line.map((token, key) => (
@@ -23,7 +23,7 @@ export const useApiIdentities = () => {
23
23
  const { getApiIdentities } = useDevPortal();
24
24
  return useSuspenseQuery({
25
25
  queryFn: getApiIdentities,
26
- queryKey: ["api-keys"],
26
+ queryKey: ["api-identities"],
27
27
  });
28
28
  };
29
29
 
@@ -0,0 +1,3 @@
1
+ export { DevPortal } from "./DevPortal.js";
2
+ export { DynamicIcon } from "./DynamicIcon.js";
3
+ export { Link } from "./Link.js";
@@ -9,7 +9,10 @@ export const SideNavigation = () => {
9
9
  const navigation = useNavigation();
10
10
 
11
11
  return (
12
- <SideNavigationWrapper ref={navRef}>
12
+ <SideNavigationWrapper
13
+ ref={navRef}
14
+ data={navigation.data.items.length > 0 ? "true" : "false"}
15
+ >
13
16
  {navigation.data.items.map((category) => (
14
17
  <SideNavigationCategory key={category.label} category={category} />
15
18
  ))}
@@ -36,7 +36,7 @@ export const SideNavigationCategory = ({
36
36
  open={isOpen}
37
37
  onOpenChange={() => setIsOpen((prev) => !prev)}
38
38
  >
39
- {category.label.length > 0 && (
39
+ {category.label.length > 0 ? (
40
40
  <Collapsible.Trigger asChild={isCollapsible} disabled={!isCollapsible}>
41
41
  <h5
42
42
  className={cn(
@@ -53,6 +53,8 @@ export const SideNavigationCategory = ({
53
53
  )}
54
54
  </h5>
55
55
  </Collapsible.Trigger>
56
+ ) : (
57
+ "Endpoints"
56
58
  )}
57
59
  <Collapsible.Content className="CollapsibleContent -mx-[--padding-nav-item]">
58
60
  {/* margin on Collapsible.Content will lead jumpiness when animating because it's not added to the calculated height */}
@@ -15,7 +15,7 @@ import { DynamicIcon, isValidIcon } from "../DynamicIcon.js";
15
15
  import { useNavigationCollapsibleState } from "./useNavigationCollapsibleState.js";
16
16
  import { checkHasActiveItem, isLinkItem, isPathItem } from "./util.js";
17
17
 
18
- export const linkItem = cva(
18
+ export const navigationListItem = cva(
19
19
  "flex px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent transition-colors duration-300",
20
20
  {
21
21
  variants: {
@@ -23,6 +23,10 @@ export const linkItem = cva(
23
23
  true: "text-primary font-medium",
24
24
  false: "text-foreground/80",
25
25
  },
26
+ isMuted: {
27
+ true: "text-foreground/30",
28
+ false: "",
29
+ },
26
30
  },
27
31
  },
28
32
  );
@@ -54,7 +58,9 @@ export const SideNavigationItem = ({
54
58
  if (isLinkItem(item)) {
55
59
  const classes = cn(
56
60
  "flex items-center gap-2",
57
- linkItem({ isActive: item.href === location.pathname }),
61
+ navigationListItem({
62
+ isActive: item.href === location.pathname,
63
+ }),
58
64
  );
59
65
  return item.href.startsWith("http") ? (
60
66
  <a
@@ -101,7 +107,10 @@ export const SideNavigationItem = ({
101
107
  className="flex flex-col"
102
108
  >
103
109
  <Collapsible.Trigger
104
- className={cn("group text-start", linkItem({ isActive: false }))}
110
+ className={cn(
111
+ "group text-start",
112
+ navigationListItem({ isActive: false }),
113
+ )}
105
114
  >
106
115
  {linkContent}
107
116
  </Collapsible.Trigger>
@@ -124,15 +133,16 @@ export const SideNavigationItem = ({
124
133
  <AnchorLink
125
134
  to={item.path}
126
135
  {...{ [DATA_ANCHOR_ATTR]: item.path }}
127
- className={linkItem({
136
+ className={navigationListItem({
128
137
  isActive: item.path.slice(1) === activeAnchor,
138
+ isMuted: item.muted,
129
139
  })}
130
140
  >
131
141
  {linkContent}
132
142
  </AnchorLink>
133
143
  ) : (
134
144
  <NavLink
135
- className={({ isActive }) => linkItem({ isActive })}
145
+ className={({ isActive }) => navigationListItem({ isActive })}
136
146
  to={currentPath}
137
147
  >
138
148
  {linkContent}
@@ -0,0 +1,18 @@
1
+ import { forwardRef, type PropsWithChildren } from "react";
2
+ import { cn } from "../../util/cn.js";
3
+
4
+ export const SideNavigationWrapper = forwardRef<
5
+ HTMLDivElement,
6
+ PropsWithChildren<{ data?: string; className?: string }>
7
+ >(({ children, className, data }, ref) => (
8
+ <nav
9
+ data-navigation={data}
10
+ className={cn(
11
+ "peer hidden lg:flex flex-col fixed text-sm overflow-y-auto shrink-0 p-[--padding-nav-item] -mx-[--padding-nav-item] pb-20 pt-[--padding-content-top] w-[--side-nav-width] h-[calc(100%-var(--header-height))] scroll-pt-2 gap-2",
12
+ className,
13
+ )}
14
+ ref={ref}
15
+ >
16
+ {children}
17
+ </nav>
18
+ ));
@@ -1,10 +1,13 @@
1
1
  import { QueryClient } from "@tanstack/react-query";
2
2
  import { type ReactNode } from "react";
3
3
  import { create } from "zustand";
4
- import { type DevPortalPath, type DevPortalProps } from "../DevPortal.js";
5
4
  import { type AuthProvider } from "../authentication/authentication.js";
6
5
  import {
7
- isApiKeyPlugin,
6
+ type DevPortalPath,
7
+ type DevPortalProps,
8
+ } from "../components/DevPortal.js";
9
+ import {
10
+ isApiIdentityPlugin,
8
11
  isNavigationPlugin,
9
12
  needsInitialization,
10
13
  type DevPortalPlugin,
@@ -23,6 +26,7 @@ export interface ApiIdentity {
23
26
  type BaseNavigationCategoryItem = {
24
27
  label: ReactNode;
25
28
  title?: string;
29
+ muted?: boolean;
26
30
  icon?: ReactNode | IconName;
27
31
  };
28
32
 
@@ -114,7 +118,7 @@ export class DevPortalContext {
114
118
  getApiIdentities = async () => {
115
119
  const keys = await Promise.all(
116
120
  this.plugins
117
- .filter(isApiKeyPlugin)
121
+ .filter(isApiIdentityPlugin)
118
122
  .map((plugin) => plugin.getIdentities(this)),
119
123
  );
120
124
 
@@ -37,7 +37,7 @@ export const needsInitialization = (
37
37
  ): obj is InitializationPlugin =>
38
38
  "initialize" in obj && typeof obj.initialize === "function";
39
39
 
40
- export const isApiKeyPlugin = (
40
+ export const isApiIdentityPlugin = (
41
41
  obj: DevPortalPlugin,
42
42
  ): obj is ApiIdentityPlugin =>
43
43
  "getIdentities" in obj && typeof obj.getIdentities === "function";
@@ -0,0 +1,84 @@
1
+ import { useDevPortal } from "../../components/context/DevPortalProvider.js";
2
+ import { type ApiKeyPluginOptions, ApiKeyService } from "./index.js";
3
+ import { useMutation } from "@tanstack/react-query";
4
+ import { Button } from "../../ui/Button.js";
5
+ import { Input } from "../../components/Input.js";
6
+ import { cn } from "../../util/cn.js";
7
+ import { Link, useNavigate } from "react-router-dom";
8
+ import { useForm } from "react-hook-form";
9
+
10
+ type CreateApiKeys = { description: string; expiresAt?: string };
11
+
12
+ export const CreateApiKey = ({
13
+ options,
14
+ service,
15
+ }: {
16
+ options: ApiKeyPluginOptions;
17
+ service: ApiKeyService;
18
+ }) => {
19
+ const context = useDevPortal();
20
+ const navigate = useNavigate();
21
+ const form = useForm<CreateApiKeys>();
22
+ const createKeyMutation = useMutation({
23
+ mutationFn: ({ description, expiresAt }: CreateApiKeys) => {
24
+ if (!service.createKey) {
25
+ throw new Error("deleteKey not implemented");
26
+ }
27
+
28
+ return service.createKey({ description }, context);
29
+ },
30
+ onSuccess: () => navigate("/settings/api-keys/"),
31
+ });
32
+
33
+ if (!service.createKey) {
34
+ return null;
35
+ }
36
+
37
+ return (
38
+ <div className="max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]">
39
+ <div className="flex justify-between mb-4 border-b pb-1">
40
+ <h1 className="font-medium text-2xl">New API Keys</h1>
41
+ </div>
42
+ <form
43
+ onSubmit={form.handleSubmit((data) => {
44
+ if (data.expiresAt === "never") {
45
+ delete data.expiresAt;
46
+ }
47
+ createKeyMutation.mutate(data);
48
+ })}
49
+ >
50
+ <div className="flex gap-2 flex-col">
51
+ Note
52
+ <Input {...form.register("description")} />
53
+ Expiration
54
+ <select
55
+ className={cn(
56
+ "row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
57
+ "rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75",
58
+ )}
59
+ {...form.register("expiresAt")}
60
+ >
61
+ <option value="never">Never</option>
62
+ {[7, 30, 60, 90].map((option) => (
63
+ <option value={addDaysToDate(option)} key={option}>
64
+ {option} Days
65
+ </option>
66
+ ))}
67
+ </select>
68
+ <div className="flex gap-2">
69
+ <Button>Generate Key</Button>
70
+ <Button variant="outline" asChild>
71
+ <Link to="/settings/api-keys/">Cancel</Link>
72
+ </Button>
73
+ </div>
74
+ </div>
75
+ </form>
76
+ </div>
77
+ );
78
+ };
79
+
80
+ const addDaysToDate = (days: number): string => {
81
+ const date = new Date();
82
+ date.setDate(date.getDate() + days);
83
+ return date.toISOString().split("T")[0];
84
+ };
@@ -0,0 +1,122 @@
1
+ import { useDevPortal } from "../../components/context/DevPortalProvider.js";
2
+ import { type ApiKeyPluginOptions, ApiKeyService } from "./index.js";
3
+ import {
4
+ useMutation,
5
+ useQueryClient,
6
+ useSuspenseQuery,
7
+ } from "@tanstack/react-query";
8
+ import { Button } from "../../ui/Button.js";
9
+ import { Card } from "../../ui/Card.js";
10
+ import { EyeIcon, EyeOffIcon, RotateCwIcon, TrashIcon } from "lucide-react";
11
+ import { Link } from "react-router-dom";
12
+ import { useState } from "react";
13
+
14
+ export const SettingsApiKeys = ({
15
+ options,
16
+ service,
17
+ }: {
18
+ options: ApiKeyPluginOptions;
19
+ service: ApiKeyService;
20
+ }) => {
21
+ const context = useDevPortal();
22
+ const queryClient = useQueryClient();
23
+ const { data } = useSuspenseQuery({
24
+ queryFn: () => service.getKeys(context),
25
+ queryKey: ["api-keys"],
26
+ });
27
+
28
+ const deleteKeyMutation = useMutation({
29
+ mutationFn: (id: string) => {
30
+ if (!service.deleteKey) {
31
+ throw new Error("deleteKey not implemented");
32
+ }
33
+
34
+ return service.deleteKey(id, context);
35
+ },
36
+ onSuccess: () => {
37
+ void queryClient.invalidateQueries({ queryKey: ["api-keys"] });
38
+ },
39
+ });
40
+
41
+ return (
42
+ <div className="max-w-screen-lg pt-[--padding-content-top] pb-[--padding-content-bottom]">
43
+ <div className="flex justify-between mb-4 border-b border-border pb-1">
44
+ <h1 className="font-medium text-2xl">API Keys</h1>
45
+ {service.createKey && (
46
+ <Button asChild>
47
+ <Link to="/settings/api-keys/new">Create API Key</Link>
48
+ </Button>
49
+ )}
50
+ </div>
51
+
52
+ <Card>
53
+ <ul className="grid grid-cols-[min-content_1fr_min-content] ">
54
+ {data?.map((key) => (
55
+ <li
56
+ className="border-b border-border p-5 grid grid-cols-subgrid col-span-full gap-2 items-center"
57
+ key={key.id}
58
+ >
59
+ <div className="flex flex-col gap-1 text-sm">
60
+ {key.description ?? key.id}
61
+ {key.expiresOn ? (
62
+ <div>Expires on {key.expiresOn}</div>
63
+ ) : (
64
+ key.createdOn && (
65
+ <div className="text-gray-500 whitespace-pre">
66
+ Created on {new Date(key.createdOn).toLocaleDateString()}
67
+ </div>
68
+ )
69
+ )}
70
+ </div>
71
+ <div className="items-center flex justify-center">
72
+ <RevealApiKey apiKey={key.key} />
73
+ </div>
74
+ <div className="flex gap-2">
75
+ {service.rollKey && (
76
+ <Button size="icon">
77
+ <RotateCwIcon size={16} />
78
+ </Button>
79
+ )}
80
+ {service.deleteKey && (
81
+ <Button
82
+ variant="ghost"
83
+ size="icon"
84
+ onClick={() => {
85
+ if (!confirm("Do you want to delete this key?")) {
86
+ return;
87
+ }
88
+
89
+ deleteKeyMutation.mutate(key.id);
90
+ }}
91
+ disabled={deleteKeyMutation.isPending}
92
+ >
93
+ <TrashIcon size={16} />
94
+ </Button>
95
+ )}
96
+ </div>
97
+ </li>
98
+ ))}
99
+ </ul>
100
+ </Card>
101
+ </div>
102
+ );
103
+ };
104
+
105
+ const RevealApiKey = ({ apiKey }: { apiKey: string }) => {
106
+ const [revealed, setRevealed] = useState(false);
107
+
108
+ return (
109
+ <div className="flex gap-2 items-center text-sm">
110
+ <code className="border border-border rounded bg-gray-100 dark:bg-gray-950 p-1 font-mono">
111
+ {revealed ? apiKey : "•".repeat(apiKey.length)}
112
+ </code>
113
+ <Button
114
+ variant="outline"
115
+ onClick={() => setRevealed((prev) => !prev)}
116
+ size="icon"
117
+ >
118
+ {revealed ? <EyeOffIcon size={16} /> : <EyeIcon size={16} />}
119
+ </Button>
120
+ </div>
121
+ );
122
+ };
@@ -0,0 +1,126 @@
1
+ import { DevPortalContext } from "../../core/DevPortalContext.js";
2
+ import {
3
+ type ApiIdentityPlugin,
4
+ type DevPortalPlugin,
5
+ } from "../../core/plugins.js";
6
+ import { SettingsApiKeys } from "./SettingsApiKeys.js";
7
+ import { CreateApiKey } from "./CreateApiKeys.js";
8
+
9
+ export type ApiKeyResults = Promise<ApiKey[]>;
10
+ const DEFAULT_API_KEY_ENDPOINT =
11
+ "https://zudoku-rewiringamerica-main-ef9c9c0.d2.zuplo.dev";
12
+
13
+ export type ApiKeyService = {
14
+ getKeys: (context: DevPortalContext) => ApiKeyResults;
15
+ rollKey?: (id: string, context: DevPortalContext) => Promise<void>;
16
+ deleteKey?: (id: string, context: DevPortalContext) => Promise<void>;
17
+ updateKeyDescription?: (
18
+ apiKey: { jd: string; description: string },
19
+ context: DevPortalContext,
20
+ ) => Promise<void>;
21
+ getUsage?: (apiKeys: string[], context: DevPortalContext) => Promise<void>;
22
+ createKey?: (
23
+ apiKey: { description: string; expiresAt?: string },
24
+ context: DevPortalContext,
25
+ ) => Promise<void>;
26
+ };
27
+
28
+ export type GetApiKeysOptions = ApiKeyService | { endpoint: string } | {};
29
+
30
+ export type ApiKeyPluginOptions = {} & GetApiKeysOptions;
31
+
32
+ export interface ApiKey {
33
+ id: string;
34
+ description?: string;
35
+ createdOn?: string;
36
+ updatedOn?: string;
37
+ expiresOn?: string;
38
+ key: string;
39
+ }
40
+
41
+ const createDefaultHandler = (endpoint: string): ApiKeyService => {
42
+ return {
43
+ deleteKey: async (id, context) => {
44
+ const accessToken = await context.authentication?.getToken?.(context);
45
+
46
+ if (!accessToken) {
47
+ throw new Error("Not authenticated");
48
+ }
49
+
50
+ await fetch(endpoint + `/v1/developer/api-keys/${id}`, {
51
+ method: "DELETE",
52
+ headers: {
53
+ Authorization: `Bearer ${accessToken}`,
54
+ },
55
+ });
56
+ },
57
+ createKey: async (apiKey, context) => {
58
+ const accessToken = await context.authentication?.getToken?.(context);
59
+
60
+ if (!accessToken) {
61
+ throw new Error("Not authenticated");
62
+ }
63
+
64
+ await fetch(endpoint + `/v1/developer/api-keys`, {
65
+ method: "POST",
66
+ headers: {
67
+ Authorization: `Bearer ${accessToken}`,
68
+ "Content-Type": "application/json",
69
+ },
70
+ body: JSON.stringify(apiKey),
71
+ });
72
+ },
73
+ getKeys: async (context) => {
74
+ const accessToken = await context.authentication?.getToken?.(context);
75
+
76
+ if (!accessToken) {
77
+ return [];
78
+ }
79
+
80
+ const keys = await fetch(endpoint + `/v1/developer/api-keys`, {
81
+ headers: {
82
+ Authorization: `Bearer ${accessToken}`,
83
+ },
84
+ });
85
+
86
+ return await keys.json();
87
+ },
88
+ };
89
+ };
90
+
91
+ export const apiKeyPlugin = (
92
+ options: ApiKeyPluginOptions,
93
+ ): DevPortalPlugin & ApiIdentityPlugin => {
94
+ const endpoint =
95
+ "endpoint" in options ? options.endpoint : DEFAULT_API_KEY_ENDPOINT;
96
+
97
+ const service =
98
+ "getKeys" in options ? options : createDefaultHandler(endpoint);
99
+
100
+ return {
101
+ getIdentities: async (context) => {
102
+ const keys = await service.getKeys(context);
103
+
104
+ return keys.map((key) => ({
105
+ authorizeRequest: (request) => {
106
+ request.headers.set("Authorization", `Bearer ${key.key}`);
107
+ return request;
108
+ },
109
+ id: key.id,
110
+ name: key.id,
111
+ }));
112
+ },
113
+ getRoutes: () => {
114
+ return [
115
+ {
116
+ path: "/settings/api-keys",
117
+ element: <SettingsApiKeys options={options} service={service} />,
118
+ },
119
+ {
120
+ path: "/settings/api-keys/new",
121
+ element: <CreateApiKey options={options} service={service} />,
122
+ },
123
+ ];
124
+ },
125
+ };
126
+ };
@@ -0,0 +1,4 @@
1
+ export { apiKeyPlugin } from "./api-key/index.js";
2
+ export { markdownPlugin } from "./markdown/index.js";
3
+ export { openApiPlugin } from "./openapi/index.js";
4
+ export { redirectPlugin } from "./redirect/index.js";
@@ -1,6 +1,6 @@
1
1
  import { useMemo, type PropsWithChildren, type ReactNode } from "react";
2
- import { Heading } from "../../Heading.js";
3
2
  import { CategoryHeading } from "../../components/CategoryHeading.js";
3
+ import { Heading } from "../../components/Heading.js";
4
4
  import { ProseClasses } from "../../components/Markdown.js";
5
5
  import { useTopNavigationItem } from "../../components/context/DevPortalProvider.js";
6
6
  import { isPathItem } from "../../components/navigation/util.js";
@@ -11,12 +11,27 @@ import slugify from "../../util/slugify.js";
11
11
  import { traverseNavigation } from "../../util/traverseNavigation.js";
12
12
  import { Toc } from "./Toc.js";
13
13
  import type { MDXImport } from "./index.js";
14
+ import { useMDXComponents } from "@mdx-js/react";
15
+ import type { MdxComponentsType } from "../../util/MdxComponents.js";
16
+
17
+ const MarkdownHeadings = {
18
+ h2: ({ children, id }) => (
19
+ <Heading level={2} id={id} children={children} registerSidebarAnchor />
20
+ ),
21
+ h3: ({ children, id }) => (
22
+ <Heading level={3} id={id} children={children} registerSidebarAnchor />
23
+ ),
24
+ } satisfies MdxComponentsType;
14
25
 
15
26
  export const MdxPage = ({
16
- children,
27
+ mdxComponent: MdxComponent,
17
28
  frontmatter,
18
29
  tableOfContents,
19
- }: PropsWithChildren<Omit<MDXImport, "default">>) => {
30
+ }: PropsWithChildren<
31
+ Omit<MDXImport, "default"> & {
32
+ mdxComponent: MDXImport["default"];
33
+ }
34
+ >) => {
20
35
  const navItem = useTopNavigationItem();
21
36
  const location = useLocation();
22
37
 
@@ -75,10 +90,10 @@ export const MdxPage = ({
75
90
  <div
76
91
  className={cn(
77
92
  ProseClasses,
78
- "mx-auto max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]",
93
+ "max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]",
79
94
  )}
80
95
  >
81
- <header className="-translate-y-1">
96
+ <header>
82
97
  {category && <CategoryHeading>{category}</CategoryHeading>}
83
98
  {title && (
84
99
  <Heading level={1} id={slugify(title, { lower: true })}>
@@ -89,7 +104,9 @@ export const MdxPage = ({
89
104
  <p className="prose-lg">{frontmatter.description}</p>
90
105
  )}
91
106
  </header>
92
- {children}
107
+ <MdxComponent
108
+ components={{ ...useMDXComponents(), ...MarkdownHeadings }}
109
+ />
93
110
  <hr />
94
111
  <div className="not-prose flex items-center justify-between gap-8">
95
112
  {prev.path ? (
@@ -1,21 +1,10 @@
1
- import { Heading } from "../../Heading.js";
2
1
  import { useTopNavigationItem } from "../../components/context/DevPortalProvider.js";
3
2
  import { isPathItem } from "../../components/navigation/util.js";
4
3
  import { Navigate, type RouteObject } from "../../core/router.js";
5
- import type { MdxComponentsType } from "../../util/MdxComponents.js";
6
4
  import { traverseNavigation } from "../../util/traverseNavigation.js";
7
5
  import { MdxPage } from "./MdxPage.js";
8
6
  import type { MarkdownPluginOptions } from "./index.js";
9
7
 
10
- const MarkdownHeadings = {
11
- h2: ({ children, id }) => (
12
- <Heading level={2} id={id} children={children} registerSidebarAnchor />
13
- ),
14
- h3: ({ children, id }) => (
15
- <Heading level={3} id={id} children={children} registerSidebarAnchor />
16
- ),
17
- } satisfies MdxComponentsType;
18
-
19
8
  export const generateRoutes = (
20
9
  markdownFiles: MarkdownPluginOptions["markdownFiles"],
21
10
  ): RouteObject[] => {
@@ -39,11 +28,7 @@ export const generateRoutes = (
39
28
  const { default: Component, ...props } = await importPromise();
40
29
 
41
30
  return {
42
- element: (
43
- <MdxPage {...props}>
44
- <Component components={MarkdownHeadings} />
45
- </MdxPage>
46
- ),
31
+ element: <MdxPage mdxComponent={Component} {...props} />,
47
32
  };
48
33
  },
49
34
  } satisfies RouteObject;
@@ -15,7 +15,6 @@ export const usePastellizedColor = (name: string) => {
15
15
 
16
16
  export const ColorizedParam = ({
17
17
  name,
18
- value,
19
18
  className,
20
19
  backgroundOpacity = "100%",
21
20
  slug,
@@ -23,7 +22,6 @@ export const ColorizedParam = ({
23
22
  onClick,
24
23
  }: {
25
24
  name: string;
26
- value?: string;
27
25
  className?: string;
28
26
  backgroundOpacity?: string;
29
27
  slug?: string;