zudoku 0.1.1-dev.15 → 0.1.1-dev.16

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 (387) hide show
  1. package/dist/app/App.js +3 -1
  2. package/dist/app/App.js.map +1 -1
  3. package/dist/config/config.d.ts +3 -3
  4. package/dist/index.d.ts +2 -6
  5. package/dist/index.js +1 -5
  6. package/dist/index.js.map +1 -1
  7. package/dist/{app → lib}/DevPortal.d.ts +2 -2
  8. package/dist/{app → lib}/DevPortal.js +4 -4
  9. package/dist/{app → lib}/DevPortal.js.map +1 -1
  10. package/dist/{app → lib}/Heading.js.map +1 -1
  11. package/dist/{app → lib}/Router.js.map +1 -1
  12. package/dist/lib/auth.d.ts +1 -0
  13. package/dist/lib/auth.js +2 -0
  14. package/dist/lib/auth.js.map +1 -0
  15. package/dist/lib/authentication/authentication.js.map +1 -0
  16. package/dist/{app → lib}/authentication/clerk.d.ts +1 -2
  17. package/dist/{app → lib}/authentication/clerk.js +1 -2
  18. package/dist/lib/authentication/clerk.js.map +1 -0
  19. package/dist/{app → lib}/authentication/openid.js.map +1 -1
  20. package/dist/{app → lib}/components/AnchorLink.js.map +1 -1
  21. package/dist/{app → lib}/components/CategoryHeading.js.map +1 -1
  22. package/dist/{app → lib}/components/Dialog.js.map +1 -1
  23. package/dist/{app → lib}/components/DynamicIcon.js.map +1 -1
  24. package/dist/{app → lib}/components/Header.js.map +1 -1
  25. package/dist/{app → lib}/components/Input.js.map +1 -1
  26. package/dist/{app → lib}/components/Layout.js.map +1 -1
  27. package/dist/{app → lib}/components/Markdown.js.map +1 -1
  28. package/dist/{app → lib}/components/SyntaxHighlight.js.map +1 -1
  29. package/dist/{app → lib}/components/TopNavigation.js.map +1 -1
  30. package/dist/{app → lib}/components/context/ComponentsContext.js.map +1 -1
  31. package/dist/{app → lib}/components/context/DevPortalProvider.js.map +1 -1
  32. package/dist/lib/components/context/PluginSystem.js.map +1 -0
  33. package/dist/{app → lib}/components/context/ThemeContext.js.map +1 -1
  34. package/dist/{app → lib}/components/context/ViewportAnchorContext.js.map +1 -1
  35. package/dist/{app → lib}/components/navigation/SideNavigation.js.map +1 -1
  36. package/dist/{app → lib}/components/navigation/SideNavigationCategory.js.map +1 -1
  37. package/dist/{app → lib}/components/navigation/SideNavigationItem.js.map +1 -1
  38. package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js.map +1 -1
  39. package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js.map +1 -1
  40. package/dist/{app → lib}/components/navigation/util.js.map +1 -1
  41. package/dist/lib/components.d.ts +3 -0
  42. package/dist/lib/components.js +4 -0
  43. package/dist/lib/components.js.map +1 -0
  44. package/dist/{app → lib}/core/DevPortalContext.js.map +1 -1
  45. package/dist/{app → lib}/core/helmet.js.map +1 -1
  46. package/dist/lib/core/icons.js.map +1 -0
  47. package/dist/{app → lib}/core/plugins.js.map +1 -1
  48. package/dist/lib/core/router.js.map +1 -0
  49. package/dist/lib/core/types/combine.js.map +1 -0
  50. package/dist/{app → lib}/oas/graphql/index.js.map +1 -1
  51. package/dist/{app → lib}/oas/graphql/server.js.map +1 -1
  52. package/dist/{app → lib}/oas/parser/dereference/index.js.map +1 -1
  53. package/dist/{app → lib}/oas/parser/dereference/resolveRef.js.map +1 -1
  54. package/dist/{app → lib}/oas/parser/index.js.map +1 -1
  55. package/dist/{app → lib}/oas/parser/upgrade/index.js.map +1 -1
  56. package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.js.map +1 -1
  57. package/dist/{app → lib}/plugins/api-key/index.js.map +1 -1
  58. package/dist/{app → lib}/plugins/markdown/MdxPage.js.map +1 -1
  59. package/dist/{app → lib}/plugins/markdown/Toc.js.map +1 -1
  60. package/dist/{app → lib}/plugins/markdown/generateRoutes.js.map +1 -1
  61. package/dist/{app → lib}/plugins/markdown/index.js.map +1 -1
  62. package/dist/{app → lib}/plugins/openapi/ColorizedParam.js.map +1 -1
  63. package/dist/{app → lib}/plugins/openapi/MakeRequest.js.map +1 -1
  64. package/dist/{app → lib}/plugins/openapi/MethodBadge.js.map +1 -1
  65. package/dist/{app → lib}/plugins/openapi/OperationList.js.map +1 -1
  66. package/dist/{app → lib}/plugins/openapi/OperationListItem.js.map +1 -1
  67. package/dist/{app → lib}/plugins/openapi/ParameterList.js.map +1 -1
  68. package/dist/{app → lib}/plugins/openapi/ParameterListItem.js.map +1 -1
  69. package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  70. package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  71. package/dist/{app → lib}/plugins/openapi/Select.js.map +1 -1
  72. package/dist/{app → lib}/plugins/openapi/Sidecar.js.map +1 -1
  73. package/dist/{app → lib}/plugins/openapi/SidecarBox.js.map +1 -1
  74. package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  75. package/dist/{app → lib}/plugins/openapi/graphql/gql.js.map +1 -1
  76. package/dist/{app → lib}/plugins/openapi/graphql/graphql.js.map +1 -1
  77. package/dist/lib/plugins/openapi/graphql/index.js.map +1 -0
  78. package/dist/{app → lib}/plugins/openapi/index.js.map +1 -1
  79. package/dist/{app → lib}/plugins/openapi/playground/Playground.js.map +1 -1
  80. package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  81. package/dist/{app → lib}/plugins/openapi/util/urql.js.map +1 -1
  82. package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -1
  83. package/dist/{app → lib}/plugins/openapi/worker/worker.js.map +1 -1
  84. package/dist/{app → lib}/plugins/redirect/index.js.map +1 -1
  85. package/dist/lib/plugins.d.ts +4 -0
  86. package/dist/lib/plugins.js +6 -0
  87. package/dist/lib/plugins.js.map +1 -0
  88. package/dist/{app → lib}/ui/Button.d.ts +1 -1
  89. package/dist/{app → lib}/ui/Button.js.map +1 -1
  90. package/dist/{app → lib}/ui/Callout.js.map +1 -1
  91. package/dist/{app → lib}/ui/Card.js.map +1 -1
  92. package/dist/{app → lib}/ui/Note.js.map +1 -1
  93. package/dist/{app → lib}/ui/Tabs.js.map +1 -1
  94. package/dist/{app → lib}/util/MdxComponents.js.map +1 -1
  95. package/dist/{app → lib}/util/cn.js.map +1 -1
  96. package/dist/{app → lib}/util/createVariantComponent.js.map +1 -1
  97. package/dist/{app → lib}/util/createWaitForNotify.js.map +1 -1
  98. package/dist/{app → lib}/util/groupBy.js.map +1 -1
  99. package/dist/{app → lib}/util/joinPath.js.map +1 -1
  100. package/dist/{app → lib}/util/pastellize.js.map +1 -1
  101. package/dist/lib/util/slugify.js.map +1 -0
  102. package/dist/{app → lib}/util/traverseNavigation.js.map +1 -1
  103. package/dist/{app → lib}/util/useScrollToAnchor.js.map +1 -1
  104. package/dist/{app → lib}/util/useScrollToTop.js.map +1 -1
  105. package/dist/vite/config.d.ts +0 -1
  106. package/dist/vite/config.js +18 -14
  107. package/dist/vite/config.js.map +1 -1
  108. package/dist/vite/dev-server.js +1 -1
  109. package/dist/vite/plugin-api.js +1 -1
  110. package/dist/vite/plugin-api.js.map +1 -1
  111. package/dist/vite/plugin-auth.js +2 -2
  112. package/dist/vite/plugin-auth.js.map +1 -1
  113. package/dist/vite/plugin-component.d.ts +3 -0
  114. package/dist/vite/plugin-component.js +22 -0
  115. package/dist/vite/plugin-component.js.map +1 -0
  116. package/dist/vite/plugin-docs.js +1 -1
  117. package/dist/vite/plugin-docs.js.map +1 -1
  118. package/dist/vite/plugin-html.js +0 -3
  119. package/dist/vite/plugin-html.js.map +1 -1
  120. package/dist/vite/plugin-mdx.js +1 -1
  121. package/dist/vite/plugin-mdx.js.map +1 -1
  122. package/package.json +15 -16
  123. package/src/app/App.tsx +4 -1
  124. package/dist/app/authentication/authentication.js.map +0 -1
  125. package/dist/app/authentication/clerk.js.map +0 -1
  126. package/dist/app/components/context/PluginSystem.js.map +0 -1
  127. package/dist/app/core/icons.js.map +0 -1
  128. package/dist/app/core/router.js.map +0 -1
  129. package/dist/app/core/types/combine.js.map +0 -1
  130. package/dist/app/plugins/openapi/graphql/index.js.map +0 -1
  131. package/dist/app/util/slugify.js.map +0 -1
  132. package/dist/auth.d.ts +0 -2
  133. package/dist/auth.js +0 -3
  134. package/dist/auth.js.map +0 -1
  135. package/dist/plugins.d.ts +0 -4
  136. package/dist/plugins.js +0 -6
  137. package/dist/plugins.js.map +0 -1
  138. package/src/app/DevPortal.tsx +0 -93
  139. package/src/app/Heading.tsx +0 -60
  140. package/src/app/Router.tsx +0 -28
  141. package/src/app/authentication/authentication.ts +0 -18
  142. package/src/app/authentication/clerk.ts +0 -47
  143. package/src/app/authentication/openid.ts +0 -192
  144. package/src/app/components/AnchorLink.tsx +0 -19
  145. package/src/app/components/CategoryHeading.tsx +0 -16
  146. package/src/app/components/Dialog.tsx +0 -119
  147. package/src/app/components/DynamicIcon.tsx +0 -60
  148. package/src/app/components/Header.tsx +0 -69
  149. package/src/app/components/Input.tsx +0 -24
  150. package/src/app/components/Layout.tsx +0 -56
  151. package/src/app/components/Markdown.tsx +0 -37
  152. package/src/app/components/SyntaxHighlight.tsx +0 -94
  153. package/src/app/components/TopNavigation.tsx +0 -32
  154. package/src/app/components/context/ComponentsContext.tsx +0 -24
  155. package/src/app/components/context/DevPortalProvider.ts +0 -54
  156. package/src/app/components/context/PluginSystem.ts +0 -0
  157. package/src/app/components/context/ThemeContext.tsx +0 -46
  158. package/src/app/components/context/ViewportAnchorContext.tsx +0 -139
  159. package/src/app/components/navigation/SideNavigation.tsx +0 -18
  160. package/src/app/components/navigation/SideNavigationCategory.tsx +0 -74
  161. package/src/app/components/navigation/SideNavigationItem.tsx +0 -143
  162. package/src/app/components/navigation/SideNavigationWrapper.tsx +0 -15
  163. package/src/app/components/navigation/useNavigationCollapsibleState.ts +0 -27
  164. package/src/app/components/navigation/util.ts +0 -38
  165. package/src/app/core/DevPortalContext.ts +0 -164
  166. package/src/app/core/helmet.ts +0 -5
  167. package/src/app/core/icons.tsx +0 -1
  168. package/src/app/core/plugins.ts +0 -43
  169. package/src/app/core/router.tsx +0 -1
  170. package/src/app/core/types/combine.ts +0 -16
  171. package/src/app/oas/graphql/index.ts +0 -422
  172. package/src/app/oas/graphql/server.ts +0 -10
  173. package/src/app/oas/parser/dereference/index.ts +0 -59
  174. package/src/app/oas/parser/dereference/resolveRef.ts +0 -32
  175. package/src/app/oas/parser/index.ts +0 -94
  176. package/src/app/oas/parser/schemas/v3.0.json +0 -1489
  177. package/src/app/oas/parser/schemas/v3.1.json +0 -1298
  178. package/src/app/oas/parser/upgrade/index.ts +0 -108
  179. package/src/app/plugins/api-key/SettingsApiKeys.tsx +0 -22
  180. package/src/app/plugins/api-key/index.tsx +0 -123
  181. package/src/app/plugins/markdown/MdxPage.tsx +0 -128
  182. package/src/app/plugins/markdown/Toc.tsx +0 -122
  183. package/src/app/plugins/markdown/generateRoutes.tsx +0 -72
  184. package/src/app/plugins/markdown/index.tsx +0 -31
  185. package/src/app/plugins/openapi/ColorizedParam.tsx +0 -82
  186. package/src/app/plugins/openapi/MakeRequest.tsx +0 -49
  187. package/src/app/plugins/openapi/MethodBadge.tsx +0 -36
  188. package/src/app/plugins/openapi/OperationList.tsx +0 -117
  189. package/src/app/plugins/openapi/OperationListItem.tsx +0 -55
  190. package/src/app/plugins/openapi/ParameterList.tsx +0 -32
  191. package/src/app/plugins/openapi/ParameterListItem.tsx +0 -60
  192. package/src/app/plugins/openapi/RequestBodySidecarBox.tsx +0 -51
  193. package/src/app/plugins/openapi/ResponsesSidecarBox.tsx +0 -60
  194. package/src/app/plugins/openapi/Select.tsx +0 -35
  195. package/src/app/plugins/openapi/Sidecar.tsx +0 -160
  196. package/src/app/plugins/openapi/SidecarBox.tsx +0 -36
  197. package/src/app/plugins/openapi/graphql/fragment-masking.ts +0 -111
  198. package/src/app/plugins/openapi/graphql/gql.ts +0 -70
  199. package/src/app/plugins/openapi/graphql/graphql.ts +0 -795
  200. package/src/app/plugins/openapi/graphql/index.ts +0 -2
  201. package/src/app/plugins/openapi/index.tsx +0 -142
  202. package/src/app/plugins/openapi/playground/Playground.tsx +0 -309
  203. package/src/app/plugins/openapi/queries.graphql +0 -6
  204. package/src/app/plugins/openapi/util/generateSchemaExample.ts +0 -59
  205. package/src/app/plugins/openapi/util/urql.ts +0 -8
  206. package/src/app/plugins/openapi/worker/createSharedWorkerClient.ts +0 -60
  207. package/src/app/plugins/openapi/worker/worker.ts +0 -30
  208. package/src/app/plugins/redirect/index.tsx +0 -20
  209. package/src/app/ui/Button.tsx +0 -56
  210. package/src/app/ui/Callout.tsx +0 -87
  211. package/src/app/ui/Card.tsx +0 -82
  212. package/src/app/ui/Note.tsx +0 -58
  213. package/src/app/ui/Tabs.tsx +0 -52
  214. package/src/app/util/MdxComponents.tsx +0 -70
  215. package/src/app/util/cn.ts +0 -6
  216. package/src/app/util/createVariantComponent.tsx +0 -30
  217. package/src/app/util/createWaitForNotify.ts +0 -18
  218. package/src/app/util/groupBy.ts +0 -24
  219. package/src/app/util/joinPath.tsx +0 -10
  220. package/src/app/util/pastellize.ts +0 -25
  221. package/src/app/util/slugify.ts +0 -3
  222. package/src/app/util/traverseNavigation.ts +0 -55
  223. package/src/app/util/useScrollToAnchor.ts +0 -38
  224. package/src/app/util/useScrollToTop.ts +0 -13
  225. /package/dist/{app → lib}/Heading.d.ts +0 -0
  226. /package/dist/{app → lib}/Heading.js +0 -0
  227. /package/dist/{app → lib}/Router.d.ts +0 -0
  228. /package/dist/{app → lib}/Router.js +0 -0
  229. /package/dist/{app → lib}/authentication/authentication.d.ts +0 -0
  230. /package/dist/{app → lib}/authentication/authentication.js +0 -0
  231. /package/dist/{app → lib}/authentication/openid.d.ts +0 -0
  232. /package/dist/{app → lib}/authentication/openid.js +0 -0
  233. /package/dist/{app → lib}/components/AnchorLink.d.ts +0 -0
  234. /package/dist/{app → lib}/components/AnchorLink.js +0 -0
  235. /package/dist/{app → lib}/components/CategoryHeading.d.ts +0 -0
  236. /package/dist/{app → lib}/components/CategoryHeading.js +0 -0
  237. /package/dist/{app → lib}/components/Dialog.d.ts +0 -0
  238. /package/dist/{app → lib}/components/Dialog.js +0 -0
  239. /package/dist/{app → lib}/components/DynamicIcon.d.ts +0 -0
  240. /package/dist/{app → lib}/components/DynamicIcon.js +0 -0
  241. /package/dist/{app → lib}/components/Header.d.ts +0 -0
  242. /package/dist/{app → lib}/components/Header.js +0 -0
  243. /package/dist/{app → lib}/components/Input.d.ts +0 -0
  244. /package/dist/{app → lib}/components/Input.js +0 -0
  245. /package/dist/{app → lib}/components/Layout.d.ts +0 -0
  246. /package/dist/{app → lib}/components/Layout.js +0 -0
  247. /package/dist/{app → lib}/components/Markdown.d.ts +0 -0
  248. /package/dist/{app → lib}/components/Markdown.js +0 -0
  249. /package/dist/{app → lib}/components/SyntaxHighlight.d.ts +0 -0
  250. /package/dist/{app → lib}/components/SyntaxHighlight.js +0 -0
  251. /package/dist/{app → lib}/components/TopNavigation.d.ts +0 -0
  252. /package/dist/{app → lib}/components/TopNavigation.js +0 -0
  253. /package/dist/{app → lib}/components/context/ComponentsContext.d.ts +0 -0
  254. /package/dist/{app → lib}/components/context/ComponentsContext.js +0 -0
  255. /package/dist/{app → lib}/components/context/DevPortalProvider.d.ts +0 -0
  256. /package/dist/{app → lib}/components/context/DevPortalProvider.js +0 -0
  257. /package/dist/{app → lib}/components/context/PluginSystem.d.ts +0 -0
  258. /package/dist/{app → lib}/components/context/PluginSystem.js +0 -0
  259. /package/dist/{app → lib}/components/context/ThemeContext.d.ts +0 -0
  260. /package/dist/{app → lib}/components/context/ThemeContext.js +0 -0
  261. /package/dist/{app → lib}/components/context/ViewportAnchorContext.d.ts +0 -0
  262. /package/dist/{app → lib}/components/context/ViewportAnchorContext.js +0 -0
  263. /package/dist/{app → lib}/components/navigation/SideNavigation.d.ts +0 -0
  264. /package/dist/{app → lib}/components/navigation/SideNavigation.js +0 -0
  265. /package/dist/{app → lib}/components/navigation/SideNavigationCategory.d.ts +0 -0
  266. /package/dist/{app → lib}/components/navigation/SideNavigationCategory.js +0 -0
  267. /package/dist/{app → lib}/components/navigation/SideNavigationItem.d.ts +0 -0
  268. /package/dist/{app → lib}/components/navigation/SideNavigationItem.js +0 -0
  269. /package/dist/{app → lib}/components/navigation/SideNavigationWrapper.d.ts +0 -0
  270. /package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js +0 -0
  271. /package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.d.ts +0 -0
  272. /package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js +0 -0
  273. /package/dist/{app → lib}/components/navigation/util.d.ts +0 -0
  274. /package/dist/{app → lib}/components/navigation/util.js +0 -0
  275. /package/dist/{app → lib}/core/DevPortalContext.d.ts +0 -0
  276. /package/dist/{app → lib}/core/DevPortalContext.js +0 -0
  277. /package/dist/{app → lib}/core/helmet.d.ts +0 -0
  278. /package/dist/{app → lib}/core/helmet.js +0 -0
  279. /package/dist/{app → lib}/core/icons.d.ts +0 -0
  280. /package/dist/{app → lib}/core/icons.js +0 -0
  281. /package/dist/{app → lib}/core/plugins.d.ts +0 -0
  282. /package/dist/{app → lib}/core/plugins.js +0 -0
  283. /package/dist/{app → lib}/core/router.d.ts +0 -0
  284. /package/dist/{app → lib}/core/router.js +0 -0
  285. /package/dist/{app → lib}/core/types/combine.d.ts +0 -0
  286. /package/dist/{app → lib}/core/types/combine.js +0 -0
  287. /package/dist/{app → lib}/oas/graphql/index.d.ts +0 -0
  288. /package/dist/{app → lib}/oas/graphql/index.js +0 -0
  289. /package/dist/{app → lib}/oas/graphql/server.d.ts +0 -0
  290. /package/dist/{app → lib}/oas/graphql/server.js +0 -0
  291. /package/dist/{app → lib}/oas/parser/dereference/index.d.ts +0 -0
  292. /package/dist/{app → lib}/oas/parser/dereference/index.js +0 -0
  293. /package/dist/{app → lib}/oas/parser/dereference/resolveRef.d.ts +0 -0
  294. /package/dist/{app → lib}/oas/parser/dereference/resolveRef.js +0 -0
  295. /package/dist/{app → lib}/oas/parser/index.d.ts +0 -0
  296. /package/dist/{app → lib}/oas/parser/index.js +0 -0
  297. /package/dist/{app → lib}/oas/parser/upgrade/index.d.ts +0 -0
  298. /package/dist/{app → lib}/oas/parser/upgrade/index.js +0 -0
  299. /package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.d.ts +0 -0
  300. /package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.js +0 -0
  301. /package/dist/{app → lib}/plugins/api-key/index.d.ts +0 -0
  302. /package/dist/{app → lib}/plugins/api-key/index.js +0 -0
  303. /package/dist/{app → lib}/plugins/markdown/MdxPage.d.ts +0 -0
  304. /package/dist/{app → lib}/plugins/markdown/MdxPage.js +0 -0
  305. /package/dist/{app → lib}/plugins/markdown/Toc.d.ts +0 -0
  306. /package/dist/{app → lib}/plugins/markdown/Toc.js +0 -0
  307. /package/dist/{app → lib}/plugins/markdown/generateRoutes.d.ts +0 -0
  308. /package/dist/{app → lib}/plugins/markdown/generateRoutes.js +0 -0
  309. /package/dist/{app → lib}/plugins/markdown/index.d.ts +0 -0
  310. /package/dist/{app → lib}/plugins/markdown/index.js +0 -0
  311. /package/dist/{app → lib}/plugins/openapi/ColorizedParam.d.ts +0 -0
  312. /package/dist/{app → lib}/plugins/openapi/ColorizedParam.js +0 -0
  313. /package/dist/{app → lib}/plugins/openapi/MakeRequest.d.ts +0 -0
  314. /package/dist/{app → lib}/plugins/openapi/MakeRequest.js +0 -0
  315. /package/dist/{app → lib}/plugins/openapi/MethodBadge.d.ts +0 -0
  316. /package/dist/{app → lib}/plugins/openapi/MethodBadge.js +0 -0
  317. /package/dist/{app → lib}/plugins/openapi/OperationList.d.ts +0 -0
  318. /package/dist/{app → lib}/plugins/openapi/OperationList.js +0 -0
  319. /package/dist/{app → lib}/plugins/openapi/OperationListItem.d.ts +0 -0
  320. /package/dist/{app → lib}/plugins/openapi/OperationListItem.js +0 -0
  321. /package/dist/{app → lib}/plugins/openapi/ParameterList.d.ts +0 -0
  322. /package/dist/{app → lib}/plugins/openapi/ParameterList.js +0 -0
  323. /package/dist/{app → lib}/plugins/openapi/ParameterListItem.d.ts +0 -0
  324. /package/dist/{app → lib}/plugins/openapi/ParameterListItem.js +0 -0
  325. /package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.d.ts +0 -0
  326. /package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js +0 -0
  327. /package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.d.ts +0 -0
  328. /package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js +0 -0
  329. /package/dist/{app → lib}/plugins/openapi/Select.d.ts +0 -0
  330. /package/dist/{app → lib}/plugins/openapi/Select.js +0 -0
  331. /package/dist/{app → lib}/plugins/openapi/Sidecar.d.ts +0 -0
  332. /package/dist/{app → lib}/plugins/openapi/Sidecar.js +0 -0
  333. /package/dist/{app → lib}/plugins/openapi/SidecarBox.d.ts +0 -0
  334. /package/dist/{app → lib}/plugins/openapi/SidecarBox.js +0 -0
  335. /package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.d.ts +0 -0
  336. /package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js +0 -0
  337. /package/dist/{app → lib}/plugins/openapi/graphql/gql.d.ts +0 -0
  338. /package/dist/{app → lib}/plugins/openapi/graphql/gql.js +0 -0
  339. /package/dist/{app → lib}/plugins/openapi/graphql/graphql.d.ts +0 -0
  340. /package/dist/{app → lib}/plugins/openapi/graphql/graphql.js +0 -0
  341. /package/dist/{app → lib}/plugins/openapi/graphql/index.d.ts +0 -0
  342. /package/dist/{app → lib}/plugins/openapi/graphql/index.js +0 -0
  343. /package/dist/{app → lib}/plugins/openapi/index.d.ts +0 -0
  344. /package/dist/{app → lib}/plugins/openapi/index.js +0 -0
  345. /package/dist/{app → lib}/plugins/openapi/playground/Playground.d.ts +0 -0
  346. /package/dist/{app → lib}/plugins/openapi/playground/Playground.js +0 -0
  347. /package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.d.ts +0 -0
  348. /package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js +0 -0
  349. /package/dist/{app → lib}/plugins/openapi/util/urql.d.ts +0 -0
  350. /package/dist/{app → lib}/plugins/openapi/util/urql.js +0 -0
  351. /package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -0
  352. /package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js +0 -0
  353. /package/dist/{app → lib}/plugins/openapi/worker/worker.d.ts +0 -0
  354. /package/dist/{app → lib}/plugins/openapi/worker/worker.js +0 -0
  355. /package/dist/{app → lib}/plugins/redirect/index.d.ts +0 -0
  356. /package/dist/{app → lib}/plugins/redirect/index.js +0 -0
  357. /package/dist/{app → lib}/ui/Button.js +0 -0
  358. /package/dist/{app → lib}/ui/Callout.d.ts +0 -0
  359. /package/dist/{app → lib}/ui/Callout.js +0 -0
  360. /package/dist/{app → lib}/ui/Card.d.ts +0 -0
  361. /package/dist/{app → lib}/ui/Card.js +0 -0
  362. /package/dist/{app → lib}/ui/Note.d.ts +0 -0
  363. /package/dist/{app → lib}/ui/Note.js +0 -0
  364. /package/dist/{app → lib}/ui/Tabs.d.ts +0 -0
  365. /package/dist/{app → lib}/ui/Tabs.js +0 -0
  366. /package/dist/{app → lib}/util/MdxComponents.d.ts +0 -0
  367. /package/dist/{app → lib}/util/MdxComponents.js +0 -0
  368. /package/dist/{app → lib}/util/cn.d.ts +0 -0
  369. /package/dist/{app → lib}/util/cn.js +0 -0
  370. /package/dist/{app → lib}/util/createVariantComponent.d.ts +0 -0
  371. /package/dist/{app → lib}/util/createVariantComponent.js +0 -0
  372. /package/dist/{app → lib}/util/createWaitForNotify.d.ts +0 -0
  373. /package/dist/{app → lib}/util/createWaitForNotify.js +0 -0
  374. /package/dist/{app → lib}/util/groupBy.d.ts +0 -0
  375. /package/dist/{app → lib}/util/groupBy.js +0 -0
  376. /package/dist/{app → lib}/util/joinPath.d.ts +0 -0
  377. /package/dist/{app → lib}/util/joinPath.js +0 -0
  378. /package/dist/{app → lib}/util/pastellize.d.ts +0 -0
  379. /package/dist/{app → lib}/util/pastellize.js +0 -0
  380. /package/dist/{app → lib}/util/slugify.d.ts +0 -0
  381. /package/dist/{app → lib}/util/slugify.js +0 -0
  382. /package/dist/{app → lib}/util/traverseNavigation.d.ts +0 -0
  383. /package/dist/{app → lib}/util/traverseNavigation.js +0 -0
  384. /package/dist/{app → lib}/util/useScrollToAnchor.d.ts +0 -0
  385. /package/dist/{app → lib}/util/useScrollToAnchor.js +0 -0
  386. /package/dist/{app → lib}/util/useScrollToTop.d.ts +0 -0
  387. /package/dist/{app → lib}/util/useScrollToTop.js +0 -0
@@ -1,49 +0,0 @@
1
- import { useApiIdentities } from "../../components/context/DevPortalProvider.js";
2
- import type { OperationListItemResult } from "./OperationList.js";
3
- import { Playground } from "./playground/Playground.js";
4
- import { useOasConfig } from "./index.js";
5
- import { gql, useQuery } from "urql";
6
-
7
- const getServerQuery = gql`
8
- query getServerQuery($input: JSON!, $type: SchemaType!) {
9
- schema(input: $input, type: $type) {
10
- url
11
- }
12
- }
13
- `;
14
-
15
- export const MakeRequest = ({
16
- operation,
17
- }: {
18
- operation: OperationListItemResult;
19
- }) => {
20
- const identities = useApiIdentities();
21
- const variables = useOasConfig();
22
- const [server] = useQuery({ query: getServerQuery, variables });
23
-
24
- return (
25
- <div>
26
- <Playground
27
- host={server.data?.schema.url}
28
- method={operation.method}
29
- url={operation.path}
30
- defaultHeaders={[]}
31
- />
32
- {identities.data.map((identity) => (
33
- <button
34
- key={identity.id}
35
- onClick={() => {
36
- const test = new Request(
37
- "https://zudoku-customer-main-b36fa2f.d2.zuplo.dev" +
38
- operation.path,
39
- );
40
- void fetch(identity.authorizeRequest(test));
41
- }}
42
- className="p-2 border border-border rounded hover:bg-accent"
43
- >
44
- Test Request {operation.path} ({identity.name})
45
- </button>
46
- ))}
47
- </div>
48
- );
49
- };
@@ -1,36 +0,0 @@
1
- import { cn } from "../../util/cn.js";
2
-
3
- export const MethodTextColorMap = {
4
- get: "text-green-600",
5
- post: "text-sky-600",
6
- put: "text-yellow-600",
7
- delete: "text-red-600",
8
- patch: "text-purple-600",
9
- options: "text-indigo-600",
10
- head: "text-gray-600",
11
- trace: "text-gray-600",
12
- };
13
-
14
- const MethodColorMap = {
15
- get: "bg-green-400 dark:bg-green-800",
16
- post: "bg-sky-400 dark:bg-sky-800",
17
- put: "bg-yellow-400 dark:bg-yellow-800",
18
- delete: "bg-red-400 dark:bg-red-800",
19
- patch: "bg-purple-400 dark:bg-purple-600",
20
- options: "bg-indigo-400 dark:bg-indigo-600",
21
- head: "bg-gray-400 dark:bg-gray-600",
22
- trace: "bg-gray-400 dark:bg-gray-600",
23
- };
24
-
25
- export const MethodBadge = ({ method }: { method: string }) => {
26
- return (
27
- <span
28
- className={cn(
29
- "mt-0.5 flex items-center duration-200 transition-opacity text-center uppercase font-mono text-[0.65rem] font-bold rounded text-background dark:text-zinc-50 h-4 px-1",
30
- MethodColorMap[method as keyof typeof MethodColorMap],
31
- )}
32
- >
33
- {method}
34
- </span>
35
- );
36
- };
@@ -1,117 +0,0 @@
1
- import { Heading } from "../../Heading.js";
2
- import { CategoryHeading } from "../../components/CategoryHeading.js";
3
- import { Markdown, ProseClasses } from "../../components/Markdown.js";
4
- import { cn } from "../../util/cn.js";
5
- import { OperationListItem } from "./OperationListItem.js";
6
- import { useOasConfig } from "./index.js";
7
- import { graphql } from "./graphql/index.js";
8
- import { useQuery } from "./util/urql.js";
9
- import { ResultOf } from "@graphql-typed-document-node/core";
10
-
11
- export const OperationsFragment = graphql(/* GraphQL */ `
12
- fragment OperationsFragment on OperationItem {
13
- slug
14
- summary
15
- method
16
- description
17
- operationId
18
- contentTypes
19
- path
20
- parameters {
21
- name
22
- in
23
- description
24
- required
25
- schema
26
- style
27
- }
28
- requestBody {
29
- content {
30
- mediaType
31
- encoding {
32
- name
33
- }
34
- schema
35
- }
36
- description
37
- required
38
- }
39
- responses {
40
- statusCode
41
- links
42
- description
43
- content {
44
- mediaType
45
- encoding {
46
- name
47
- }
48
- schema
49
- }
50
- }
51
- }
52
- `);
53
-
54
- export type OperationListItemResult = ResultOf<typeof OperationsFragment>;
55
-
56
- const AllOperationsQuery = graphql(/* GraphQL */ `
57
- query AllOperations($input: JSON!, $type: SchemaType!) {
58
- schema(input: $input, type: $type) {
59
- description
60
- title
61
- url
62
- version
63
- tags {
64
- name
65
- description
66
- operations {
67
- slug
68
- ...OperationsFragment
69
- }
70
- }
71
- }
72
- }
73
- `);
74
-
75
- export const OperationList = () => {
76
- const { type, input } = useOasConfig();
77
-
78
- const [result] = useQuery({
79
- query: AllOperationsQuery,
80
- variables: { type, input },
81
- });
82
-
83
- if (!result.data) return null;
84
-
85
- return (
86
- <div className="pt-[--padding-content-top]">
87
- <div className={cn(ProseClasses, "mb-16")}>
88
- <CategoryHeading>Overview</CategoryHeading>
89
- <Heading level={1} id="description" registerSidebarAnchor>
90
- {result.data.schema.title}
91
- </Heading>
92
- <Markdown content={result.data.schema.description ?? ""} />
93
- </div>
94
- {result.data?.schema.tags
95
- .filter((tag) => tag.operations.length > 0)
96
- .map((tag) => (
97
- <div key={tag.name}>
98
- {tag.name && <CategoryHeading>{tag.name}</CategoryHeading>}
99
- {tag.description && (
100
- <Markdown
101
- className={`${ProseClasses} mt-2 mb-12`}
102
- content={tag.description}
103
- />
104
- )}
105
- <div className="operation mb-12">
106
- {tag.operations.map((fragment) => (
107
- <OperationListItem
108
- key={fragment.slug}
109
- operationFragment={fragment}
110
- />
111
- ))}
112
- </div>
113
- </div>
114
- ))}
115
- </div>
116
- );
117
- };
@@ -1,55 +0,0 @@
1
- import { Heading } from "../../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
-
9
- export const PARAM_GROUPS = ["path", "query", "header", "cookie"] as const;
10
- export type ParameterGroup = (typeof PARAM_GROUPS)[number];
11
-
12
- export const OperationListItem = ({
13
- operationFragment,
14
- }: {
15
- operationFragment: FragmentType<typeof OperationsFragment>;
16
- }) => {
17
- const operation = useFragment(OperationsFragment, operationFragment);
18
- const groupedParameters = groupBy(operation?.parameters ?? [], "in");
19
-
20
- return (
21
- <div
22
- key={operation.operationId}
23
- className="grid grid-cols-2 gap-8 items-start border-b-2 mb-16 pb-16 border-border"
24
- >
25
- <div className={ProseClasses}>
26
- <Heading
27
- level={2}
28
- className="mt-0"
29
- id={operation.slug}
30
- registerSidebarAnchor
31
- >
32
- {operation.summary}
33
- </Heading>
34
- {operation.description && <Markdown content={operation.description} />}
35
- {operation.parameters && operation.parameters.length > 0 && (
36
- <div className="mt-4">
37
- {PARAM_GROUPS.flatMap((group) =>
38
- groupedParameters?.[group]?.length ? (
39
- <ParameterList
40
- key={group}
41
- id={operation.slug}
42
- groupedParameters={groupedParameters}
43
- group={group}
44
- />
45
- ) : (
46
- []
47
- ),
48
- )}
49
- </div>
50
- )}
51
- </div>
52
- <Sidecar operation={operation} />
53
- </div>
54
- );
55
- };
@@ -1,32 +0,0 @@
1
- import { Heading } from "../../Heading.js";
2
- import type { ParameterGroup } from "./OperationListItem.js";
3
- import {
4
- ParameterListItem,
5
- type ParameterListItemResult,
6
- } from "./ParameterListItem.js";
7
-
8
- export const ParameterList = ({
9
- groupedParameters,
10
- group,
11
- id,
12
- }: {
13
- groupedParameters: Record<ParameterGroup, ParameterListItemResult[]>;
14
- group: ParameterGroup;
15
- id: string;
16
- }) => (
17
- <>
18
- <Heading level={3} id={`${id}/${group}-parameters`} className="capitalize">
19
- {group === "header" ? "Headers" : `${group} Parameters`}
20
- </Heading>
21
- <ul className="list-none m-0 px-0 overflow-hidden">
22
- {groupedParameters[group].map((parameter) => (
23
- <ParameterListItem
24
- key={`${parameter.name}-${parameter.in}`}
25
- parameter={parameter}
26
- id={id}
27
- group={group}
28
- />
29
- ))}
30
- </ul>
31
- </>
32
- );
@@ -1,60 +0,0 @@
1
- import { Markdown } from "../../components/Markdown.js";
2
- import { type SchemaObject } from "../../oas/graphql/index.js";
3
- import { ColorizedParam } from "./ColorizedParam.js";
4
- import type { OperationListItemResult } from "./OperationList.js";
5
- import type { ParameterGroup } from "./OperationListItem.js";
6
-
7
- const getParameterSchema = (
8
- parameter: ParameterListItemResult,
9
- ): SchemaObject => {
10
- if (parameter.schema != null && typeof parameter.schema === "object") {
11
- return parameter.schema;
12
- }
13
- return {
14
- type: "string",
15
- };
16
- };
17
-
18
- export type ParameterListItemResult = NonNullable<
19
- OperationListItemResult["parameters"]
20
- >[number];
21
-
22
- export const ParameterListItem = ({
23
- parameter,
24
- group,
25
- id,
26
- }: {
27
- parameter: ParameterListItemResult;
28
- group: ParameterGroup;
29
- id: string;
30
- }) => (
31
- <li className="not-prose px-2 py-4 border-t border-border bg-border/20">
32
- <div className="flex items-center gap-2">
33
- <code>
34
- {group === "path" ? (
35
- <ColorizedParam
36
- name={parameter.name}
37
- backgroundOpacity="15%"
38
- className="px-1"
39
- slug={id + "-" + parameter.name.toLocaleLowerCase()}
40
- />
41
- ) : (
42
- parameter.name
43
- )}
44
- </code>
45
- {parameter.required && (
46
- <span className="py-px px-1.5 font-medium text-xs bg-primary/75 text-muted rounded-lg">
47
- required
48
- </span>
49
- )}
50
- {getParameterSchema(parameter).type && (
51
- <span className="text-xs text-muted-foreground">
52
- {getParameterSchema(parameter).type}
53
- </span>
54
- )}
55
- </div>
56
- {parameter.description && (
57
- <Markdown content={parameter.description} className="prose-p:my-1" />
58
- )}
59
- </li>
60
- );
@@ -1,51 +0,0 @@
1
- import { useState } from "react";
2
- import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
3
- import { type SchemaObject } from "../../oas/graphql/index.js";
4
- import type { OperationListItemResult } from "./OperationList.js";
5
- import { Select } from "./Select.js";
6
- import * as SidecarBox from "./SidecarBox.js";
7
- import { generateSchemaExample } from "./util/generateSchemaExample.js";
8
-
9
- type Content = NonNullable<
10
- NonNullable<OperationListItemResult["requestBody"]>["content"]
11
- >;
12
-
13
- // @todo should we handle multiple content types?
14
- export const RequestBodySidecarBox = ({ content }: { content: Content }) => {
15
- const [selected, setSelected] = useState("example");
16
-
17
- if (!content.length) return null;
18
-
19
- return (
20
- <>
21
- <div>lol</div>
22
- <SidecarBox.Root>
23
- <SidecarBox.Head className="text-xs flex justify-between items-center">
24
- <span className="font-mono">Request Body</span>
25
- <Select
26
- onChange={(e) => setSelected(e.target.value)}
27
- options={[
28
- { value: "example", label: "Example" },
29
- { value: "schema", label: "Schema" },
30
- ]}
31
- />
32
- </SidecarBox.Head>
33
- <SidecarBox.Body>
34
- <SyntaxHighlight
35
- language="json"
36
- noBackground
37
- copyable={false}
38
- className="text-xs"
39
- code={JSON.stringify(
40
- selected === "example"
41
- ? generateSchemaExample(content[0].schema as SchemaObject)
42
- : content[0].schema,
43
- null,
44
- 2,
45
- )}
46
- />
47
- </SidecarBox.Body>
48
- </SidecarBox.Root>
49
- </>
50
- );
51
- };
@@ -1,60 +0,0 @@
1
- import { useState } from "react";
2
- import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
3
- import { type SchemaObject } from "../../oas/graphql/index.js";
4
- import { cn } from "../../util/cn.js";
5
- import type { OperationListItemResult } from "./OperationList.js";
6
- import * as SidecarBox from "./SidecarBox.js";
7
- import { generateSchemaExample } from "./util/generateSchemaExample.js";
8
-
9
- type Responses = OperationListItemResult["responses"];
10
- export const ResponsesSidecarBox = ({
11
- responses,
12
- }: {
13
- responses: Responses;
14
- }) => {
15
- const [tabIndex, setTabIndex] = useState(0);
16
-
17
- const activeTab = responses[tabIndex];
18
- const schema = activeTab?.content?.[0]?.schema as SchemaObject | undefined;
19
-
20
- return (
21
- <SidecarBox.Root>
22
- <SidecarBox.Head className="text-xs grid grid-rows-2 pb-0">
23
- <span className="font-mono">Responses</span>
24
- <div className="flex gap-2">
25
- {responses.map((response, index) => (
26
- <div
27
- key={response.statusCode}
28
- onClick={() => setTabIndex(index)}
29
- className={cn(
30
- "text-xs font-mono px-1.5 py-1 pb-px translate-y-px border-b-2 border-transparent rounded-t cursor-pointer",
31
- tabIndex === index
32
- ? "text-primary dark:text-inherit border-primary"
33
- : "hover:border-accent-foreground/25",
34
- )}
35
- >
36
- {response.statusCode}
37
- </div>
38
- ))}
39
- </div>
40
- </SidecarBox.Head>
41
- <SidecarBox.Body>
42
- {schema ? (
43
- <SyntaxHighlight
44
- language="json"
45
- noBackground
46
- copyable={false}
47
- className="text-xs"
48
- code={JSON.stringify(generateSchemaExample(schema), null, 2)}
49
- />
50
- ) : (
51
- <span className="text-muted-foreground font-mono italic text-xs">
52
- Empty Response
53
- </span>
54
- )}
55
- <hr className="border-border my-1" />
56
- <div className="text-xs">{responses[tabIndex].description}</div>
57
- </SidecarBox.Body>
58
- </SidecarBox.Root>
59
- );
60
- };
@@ -1,35 +0,0 @@
1
- import type { ChangeEventHandler } from "react";
2
- import { ChevronsUpDownIcon } from "../../core/icons.js";
3
- import { cn } from "../../util/cn.js";
4
-
5
- export const Select = ({
6
- onChange,
7
- className,
8
- options,
9
- }: {
10
- onChange?: ChangeEventHandler<HTMLSelectElement>;
11
- className?: string;
12
- options: {
13
- value: string;
14
- label: string;
15
- }[];
16
- }) => (
17
- <div className={cn("grid", className)}>
18
- <select
19
- className={cn(
20
- "row-start-1 col-start-1 border border-input text-foreground px-2 py-1 pe-6",
21
- "rounded-md appearance-none bg-zinc-50 hover:bg-white dark:bg-zinc-800 hover:dark:bg-zinc-800/75",
22
- )}
23
- onChange={onChange}
24
- >
25
- {options.map((option) => (
26
- <option value={option.value} key={option.value}>
27
- {option.label}
28
- </option>
29
- ))}
30
- </select>
31
- <div className="row-start-1 col-start-1 self-center justify-self-end relative end-2 pointer-events-none">
32
- <ChevronsUpDownIcon size={14} />
33
- </div>
34
- </div>
35
- );
@@ -1,160 +0,0 @@
1
- import { Fragment, useMemo, useState } from "react";
2
- import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
3
- import { cn } from "../../util/cn.js";
4
- import { ColorizedParam } from "./ColorizedParam.js";
5
- import { MakeRequest } from "./MakeRequest.js";
6
- import { MethodTextColorMap } from "./MethodBadge.js";
7
- import type { OperationListItemResult } from "./OperationList.js";
8
- import { RequestBodySidecarBox } from "./RequestBodySidecarBox.js";
9
- import { ResponsesSidecarBox } from "./ResponsesSidecarBox.js";
10
- import { Select } from "./Select.js";
11
- import * as SidecarBox from "./SidecarBox.js";
12
- import { HTTPSnippet } from "@zudoku/httpsnippet";
13
- import { generateSchemaExample } from "./util/generateSchemaExample.js";
14
- import type { SchemaObject } from "../../oas/parser/index.js";
15
-
16
- const getConverted = (snippet: HTTPSnippet, option: string) => {
17
- let converted;
18
- switch (option) {
19
- case "shell":
20
- converted = snippet.convert("shell", "curl");
21
- break;
22
- case "js":
23
- converted = snippet.convert("javascript", "fetch");
24
- break;
25
- case "python":
26
- converted = snippet.convert("python", "requests");
27
- break;
28
- case "java":
29
- converted = snippet.convert("java", "okhttp");
30
- break;
31
- case "go":
32
- converted = snippet.convert("go", "native");
33
- break;
34
- case "csharp":
35
- converted = snippet.convert("csharp", "httpclient");
36
- break;
37
- case "kotlin":
38
- converted = snippet.convert("kotlin", "okhttp");
39
- break;
40
- case "objc":
41
- converted = snippet.convert("objc", "nsurlsession");
42
- break;
43
- case "php":
44
- converted = snippet.convert("php", "http2");
45
- break;
46
- case "ruby":
47
- converted = snippet.convert("ruby");
48
- break;
49
- case "swift":
50
- converted = snippet.convert("swift");
51
- break;
52
- default:
53
- converted = snippet.convert("shell");
54
- break;
55
- }
56
-
57
- return converted ? converted[0] : "";
58
- };
59
-
60
- export const Sidecar = ({
61
- operation,
62
- }: {
63
- operation: OperationListItemResult;
64
- }) => {
65
- const methodTextColor =
66
- MethodTextColorMap[operation.method as keyof typeof MethodTextColorMap];
67
- const [option, setOption] = useState("curl");
68
- const requestBodyContent = operation.requestBody?.content;
69
-
70
- const path = operation.path.split("/").map((part) => (
71
- <Fragment key={part}>
72
- {part.startsWith("{") && part.endsWith("}") ? (
73
- <ColorizedParam
74
- name={part.slice(1, -1)}
75
- backgroundOpacity="0"
76
- // same as in `ParameterListItem`
77
- slug={operation.slug + "-" + part.slice(1, -1).toLocaleLowerCase()}
78
- >
79
- {part}
80
- </ColorizedParam>
81
- ) : (
82
- part
83
- )}
84
- /
85
- <wbr />
86
- </Fragment>
87
- ));
88
-
89
- const code = useMemo(() => {
90
- const example = requestBodyContent?.[0]?.schema
91
- ? generateSchemaExample(requestBodyContent[0].schema as SchemaObject)
92
- : undefined;
93
-
94
- const snippet = new HTTPSnippet(
95
- {
96
- method: operation.method.toLocaleUpperCase(),
97
- url: operation.path.replaceAll("{", ":").replaceAll("}", ""),
98
- headers: [{ name: "Authorization", value: "Bearer <token>" }],
99
- postData: example
100
- ? {
101
- text: JSON.stringify(example, null, 2),
102
- mimeType: "application/json",
103
- }
104
- : {},
105
- } as never, // 👈 never touch this
106
- );
107
-
108
- return getConverted(snippet, option) ?? "";
109
- }, [option, operation.method, operation.path, requestBodyContent]);
110
-
111
- return (
112
- <aside className="flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4">
113
- <SidecarBox.Root>
114
- <MakeRequest operation={operation} />
115
- <SidecarBox.Head className="flex justify-between items-center flex-nowrap p-2 gap-2 text-xs">
116
- <span className="font-mono break-words">
117
- <span className={cn("font-semibold", methodTextColor)}>
118
- {operation.method.toLocaleUpperCase()}
119
- </span>
120
- &nbsp;
121
- {path}
122
- </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
- />
140
- </SidecarBox.Head>
141
- <SidecarBox.Body>
142
- <SyntaxHighlight
143
- language={option}
144
- copyable={false}
145
- noBackground
146
- className="text-xs"
147
- code={code}
148
- />
149
- </SidecarBox.Body>
150
- </SidecarBox.Root>
151
- {/*<MakeRequest />*/}
152
- {requestBodyContent && (
153
- <RequestBodySidecarBox content={requestBodyContent} />
154
- )}
155
- {operation.responses.length > 0 && (
156
- <ResponsesSidecarBox responses={operation.responses} />
157
- )}
158
- </aside>
159
- );
160
- };