zudoku 0.16.3 → 0.18.0

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 (342) hide show
  1. package/dist/app/demo.js +0 -2
  2. package/dist/app/demo.js.map +1 -1
  3. package/dist/app/entry.client.js +14 -0
  4. package/dist/app/entry.client.js.map +1 -1
  5. package/dist/app/entry.server.js +5 -4
  6. package/dist/app/entry.server.js.map +1 -1
  7. package/dist/app/main.d.ts +1 -1
  8. package/dist/app/main.js +2 -2
  9. package/dist/app/main.js.map +1 -1
  10. package/dist/app/standalone.js +0 -2
  11. package/dist/app/standalone.js.map +1 -1
  12. package/dist/codegen.d.ts +3 -0
  13. package/dist/codegen.js +45 -0
  14. package/dist/codegen.js.map +1 -0
  15. package/dist/config/validators/InputSidebarSchema.d.ts +10 -10
  16. package/dist/config/validators/validate.d.ts +114 -114
  17. package/dist/config/validators/validate.js.map +1 -1
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +1 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/lib/authentication/authentication.d.ts +2 -2
  22. package/dist/lib/authentication/hook.d.ts +5 -4
  23. package/dist/lib/authentication/hook.js +1 -3
  24. package/dist/lib/authentication/hook.js.map +1 -1
  25. package/dist/lib/authentication/providers/auth0.js +11 -11
  26. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  27. package/dist/lib/authentication/providers/openid.d.ts +0 -1
  28. package/dist/lib/authentication/providers/openid.js +11 -26
  29. package/dist/lib/authentication/providers/openid.js.map +1 -1
  30. package/dist/lib/authentication/state.d.ts +25 -4
  31. package/dist/lib/authentication/state.js +28 -3
  32. package/dist/lib/authentication/state.js.map +1 -1
  33. package/dist/lib/authentication/use-broadcast/shared.d.ts +48 -0
  34. package/dist/lib/authentication/use-broadcast/shared.js +243 -0
  35. package/dist/lib/authentication/use-broadcast/shared.js.map +1 -0
  36. package/dist/lib/authentication/use-broadcast/useBroadcast.d.ts +24 -0
  37. package/dist/lib/authentication/use-broadcast/useBroadcast.js +106 -0
  38. package/dist/lib/authentication/use-broadcast/useBroadcast.js.map +1 -0
  39. package/dist/lib/components/Bootstrap.d.ts +3 -1
  40. package/dist/lib/components/Bootstrap.js +11 -3
  41. package/dist/lib/components/Bootstrap.js.map +1 -1
  42. package/dist/lib/components/ClientOnly.d.ts +4 -2
  43. package/dist/lib/components/ClientOnly.js +1 -1
  44. package/dist/lib/components/ClientOnly.js.map +1 -1
  45. package/dist/lib/components/DeveloperHint.js +2 -1
  46. package/dist/lib/components/DeveloperHint.js.map +1 -1
  47. package/dist/lib/components/Header.js +5 -7
  48. package/dist/lib/components/Header.js.map +1 -1
  49. package/dist/lib/components/Heading.d.ts +1 -1
  50. package/dist/lib/components/Layout.js +11 -3
  51. package/dist/lib/components/Layout.js.map +1 -1
  52. package/dist/lib/components/MobileTopNavigation.js +6 -7
  53. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  54. package/dist/lib/components/SyntaxHighlight.js +16 -12
  55. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  56. package/dist/lib/components/ThemeSwitch.d.ts +1 -0
  57. package/dist/lib/components/ThemeSwitch.js +13 -0
  58. package/dist/lib/components/ThemeSwitch.js.map +1 -0
  59. package/dist/lib/components/TopNavigation.d.ts +2 -0
  60. package/dist/lib/components/TopNavigation.js +13 -7
  61. package/dist/lib/components/TopNavigation.js.map +1 -1
  62. package/dist/lib/components/{DevPortal.d.ts → Zudoku.d.ts} +3 -3
  63. package/dist/lib/components/{DevPortal.js → Zudoku.js} +13 -14
  64. package/dist/lib/components/Zudoku.js.map +1 -0
  65. package/dist/lib/components/context/ZudokuContext.d.ts +7 -7
  66. package/dist/lib/components/context/ZudokuContext.js +8 -13
  67. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  68. package/dist/lib/components/context/ZudokuProvider.d.ts +2 -2
  69. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  70. package/dist/lib/components/index.d.ts +18 -10
  71. package/dist/lib/components/index.js +2 -3
  72. package/dist/lib/components/index.js.map +1 -1
  73. package/dist/lib/components/navigation/Sidebar.js +1 -1
  74. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  75. package/dist/lib/components/navigation/utils.js +2 -2
  76. package/dist/lib/components/navigation/utils.js.map +1 -1
  77. package/dist/lib/core/{DevPortalContext.d.ts → ZudokuContext.d.ts} +3 -7
  78. package/dist/lib/core/{DevPortalContext.js → ZudokuContext.js} +2 -7
  79. package/dist/lib/core/ZudokuContext.js.map +1 -0
  80. package/dist/lib/core/plugins.d.ts +12 -12
  81. package/dist/lib/core/plugins.js.map +1 -1
  82. package/dist/lib/errors/ErrorAlert.js +1 -1
  83. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  84. package/dist/lib/plugins/api-keys/index.d.ts +9 -9
  85. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  86. package/dist/lib/plugins/custom-pages/index.d.ts +2 -2
  87. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  88. package/dist/lib/plugins/markdown/index.d.ts +2 -2
  89. package/dist/lib/plugins/markdown/index.js.map +1 -1
  90. package/dist/lib/plugins/openapi/ColorizedParam.js +13 -9
  91. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  92. package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
  93. package/dist/lib/plugins/openapi/Endpoint.js +5 -9
  94. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  95. package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
  96. package/dist/lib/plugins/openapi/OperationList.js +7 -22
  97. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  98. package/dist/lib/plugins/openapi/Route.d.ts +4 -4
  99. package/dist/lib/plugins/openapi/Route.js +2 -4
  100. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  101. package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -1
  102. package/dist/lib/plugins/openapi/Sidecar.js +34 -33
  103. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  104. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +8 -0
  105. package/dist/lib/plugins/openapi/client/GraphQLClient.js +102 -0
  106. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -0
  107. package/dist/lib/plugins/openapi/client/GraphQLContext.d.ts +7 -0
  108. package/dist/lib/plugins/openapi/client/GraphQLContext.js +5 -0
  109. package/dist/lib/plugins/openapi/client/GraphQLContext.js.map +1 -0
  110. package/dist/lib/plugins/openapi/client/createServer.d.ts +1 -0
  111. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +5 -0
  112. package/dist/lib/plugins/openapi/client/useCreateQuery.js +13 -0
  113. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -0
  114. package/dist/lib/plugins/openapi/client/worker.d.ts +4 -1
  115. package/dist/lib/plugins/openapi/client/worker.js +23 -14
  116. package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
  117. package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +3 -3
  118. package/dist/lib/plugins/openapi/graphql/fragment-masking.js +3 -4
  119. package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  120. package/dist/lib/plugins/openapi/graphql/gql.d.ts +5 -52
  121. package/dist/lib/plugins/openapi/graphql/gql.js +2 -1
  122. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  123. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +134 -9
  124. package/dist/lib/plugins/openapi/graphql/graphql.js +194 -778
  125. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  126. package/dist/lib/plugins/openapi/index.d.ts +2 -2
  127. package/dist/lib/plugins/openapi/index.js +40 -53
  128. package/dist/lib/plugins/openapi/index.js.map +1 -1
  129. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  130. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  131. package/dist/lib/plugins/openapi-worker.js +7 -1
  132. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  133. package/dist/lib/plugins/redirect/index.d.ts +2 -2
  134. package/dist/lib/plugins/redirect/index.js.map +1 -1
  135. package/dist/lib/plugins/search-inkeep/index.d.ts +2 -2
  136. package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
  137. package/dist/lib/ui/ActionButton.d.ts +3 -1
  138. package/dist/lib/util/MdxComponents.d.ts +1 -1
  139. package/dist/lib/util/useOnScreen.d.ts +4 -0
  140. package/dist/lib/util/useOnScreen.js +19 -0
  141. package/dist/lib/util/useOnScreen.js.map +1 -0
  142. package/dist/vite/config.js +0 -1
  143. package/dist/vite/config.js.map +1 -1
  144. package/dist/vite/html.js +0 -2
  145. package/dist/vite/html.js.map +1 -1
  146. package/dist/vite/plugin-component.js +1 -1
  147. package/dist/vite/plugin-component.js.map +1 -1
  148. package/dist/vite/plugin-mdx.d.ts +0 -6
  149. package/dist/vite/plugin-mdx.js +3 -2
  150. package/dist/vite/plugin-mdx.js.map +1 -1
  151. package/dist/vite/plugin.js +0 -2
  152. package/dist/vite/plugin.js.map +1 -1
  153. package/dist/vite/remarkStaticGeneration.d.ts +3 -0
  154. package/dist/vite/remarkStaticGeneration.js +125 -0
  155. package/dist/vite/remarkStaticGeneration.js.map +1 -0
  156. package/lib/{AnchorLink-BbB2q-jx.js → AnchorLink-CDlhr8gL.js} +11 -10
  157. package/lib/{AnchorLink-BbB2q-jx.js.map → AnchorLink-CDlhr8gL.js.map} +1 -1
  158. package/lib/{AuthenticationPlugin-C9BHGXlE.js → AuthenticationPlugin-DeGDVa1r.js} +6 -5
  159. package/lib/{AuthenticationPlugin-C9BHGXlE.js.map → AuthenticationPlugin-DeGDVa1r.js.map} +1 -1
  160. package/lib/{Spinner-ChOGyPls.js → Button-jK0EsymC.js} +12 -15
  161. package/lib/Button-jK0EsymC.js.map +1 -0
  162. package/lib/{ClientOnly-CVN6leDu.js → ClientOnly-E7hGysn1.js} +4 -4
  163. package/lib/ClientOnly-E7hGysn1.js.map +1 -0
  164. package/lib/Markdown-ievDDhFT.js +15192 -0
  165. package/lib/Markdown-ievDDhFT.js.map +1 -0
  166. package/lib/{MdxPage-DKMH_t0f.js → MdxPage-Bwn-VSsH.js} +5 -5
  167. package/lib/{MdxPage-DKMH_t0f.js.map → MdxPage-Bwn-VSsH.js.map} +1 -1
  168. package/lib/OperationList-BwBl1xrD.js +4691 -0
  169. package/lib/OperationList-BwBl1xrD.js.map +1 -0
  170. package/lib/Route-DlG_HTMu.js +11 -0
  171. package/lib/Route-DlG_HTMu.js.map +1 -0
  172. package/lib/{Select-Bagt3Bme.js → Select-O9ZM3ZgX.js} +7 -7
  173. package/lib/Select-O9ZM3ZgX.js.map +1 -0
  174. package/lib/SidebarBadge-DxFJcJ6V.js +51 -0
  175. package/lib/SidebarBadge-DxFJcJ6V.js.map +1 -0
  176. package/lib/SlotletProvider-DyomlzGx.js +252 -0
  177. package/lib/SlotletProvider-DyomlzGx.js.map +1 -0
  178. package/lib/Spinner-3cQDBVGr.js +7 -0
  179. package/lib/Spinner-3cQDBVGr.js.map +1 -0
  180. package/lib/SyntaxHighlight-DkLOsjHS.js +2983 -0
  181. package/lib/SyntaxHighlight-DkLOsjHS.js.map +1 -0
  182. package/lib/assets/{worker-YA-aCP3P.js → worker-CPsGZsve.js} +24 -22
  183. package/lib/assets/{worker-YA-aCP3P.js.map → worker-CPsGZsve.js.map} +1 -1
  184. package/lib/context-D1nXWxm7.js +22 -0
  185. package/lib/context-D1nXWxm7.js.map +1 -0
  186. package/lib/createServer-DK-g7kbB.js +16089 -0
  187. package/lib/createServer-DK-g7kbB.js.map +1 -0
  188. package/lib/{hook-sn0zMTkE.js → hook-hEqe7fPB.js} +12 -14
  189. package/lib/hook-hEqe7fPB.js.map +1 -0
  190. package/lib/index-Czzd9rjU.js +899 -0
  191. package/lib/index-Czzd9rjU.js.map +1 -0
  192. package/lib/index-DNxQ_rCt.js +1273 -0
  193. package/lib/index-DNxQ_rCt.js.map +1 -0
  194. package/lib/index-Yn8c3UWE.js +921 -0
  195. package/lib/index-Yn8c3UWE.js.map +1 -0
  196. package/lib/{router-BsfSoK2j.js → router-lfyopgBI.js} +23 -23
  197. package/lib/{router-BsfSoK2j.js.map → router-lfyopgBI.js.map} +1 -1
  198. package/lib/state-tsXBLONe.js +203 -0
  199. package/lib/{state-CsuHT8ZO.js.map → state-tsXBLONe.js.map} +1 -1
  200. package/lib/ui/ActionButton.js +11 -10
  201. package/lib/ui/ActionButton.js.map +1 -1
  202. package/lib/useExposedProps-CTPtylCV.js +10 -0
  203. package/lib/{useExposedProps-ChOIUaS4.js.map → useExposedProps-CTPtylCV.js.map} +1 -1
  204. package/lib/{ZudokuContext-BKXGJTmu.js → utils-DcpDOncX.js} +242 -246
  205. package/lib/utils-DcpDOncX.js.map +1 -0
  206. package/lib/zudoku.auth-auth0.js +24 -18
  207. package/lib/zudoku.auth-auth0.js.map +1 -1
  208. package/lib/zudoku.auth-clerk.js +2 -2
  209. package/lib/zudoku.auth-openid.js +124 -138
  210. package/lib/zudoku.auth-openid.js.map +1 -1
  211. package/lib/zudoku.components.js +1284 -1121
  212. package/lib/zudoku.components.js.map +1 -1
  213. package/lib/zudoku.openapi-worker.js +10 -16346
  214. package/lib/zudoku.openapi-worker.js.map +1 -1
  215. package/lib/zudoku.plugin-api-keys.js +18 -18
  216. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  217. package/lib/zudoku.plugin-custom-pages.js +2 -2
  218. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  219. package/lib/zudoku.plugin-markdown.js +1 -1
  220. package/lib/zudoku.plugin-markdown.js.map +1 -1
  221. package/lib/zudoku.plugin-openapi.js +5 -9
  222. package/lib/zudoku.plugin-openapi.js.map +1 -1
  223. package/lib/zudoku.plugin-redirect.js +1 -1
  224. package/lib/zudoku.plugin-redirect.js.map +1 -1
  225. package/lib/zudoku.plugin-search-inkeep.js +1 -1
  226. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  227. package/package.json +14 -4
  228. package/src/app/demo.tsx +0 -3
  229. package/src/app/entry.client.tsx +14 -0
  230. package/src/app/entry.server.tsx +59 -57
  231. package/src/app/main.tsx +4 -4
  232. package/src/app/standalone.tsx +0 -3
  233. package/src/lib/authentication/authentication.ts +2 -2
  234. package/src/lib/authentication/hook.ts +1 -3
  235. package/src/lib/authentication/providers/auth0.tsx +16 -11
  236. package/src/lib/authentication/providers/openid.tsx +12 -30
  237. package/src/lib/authentication/state.ts +50 -9
  238. package/{LICENSE.md → src/lib/authentication/use-broadcast/LICENSE.md} +2 -2
  239. package/src/lib/authentication/use-broadcast/shared.ts +372 -0
  240. package/src/lib/authentication/use-broadcast/useBroadcast.ts +146 -0
  241. package/src/lib/components/Bootstrap.tsx +36 -9
  242. package/src/lib/components/ClientOnly.tsx +6 -3
  243. package/src/lib/components/DeveloperHint.tsx +6 -1
  244. package/src/lib/components/Header.tsx +32 -37
  245. package/src/lib/components/Layout.tsx +48 -36
  246. package/src/lib/components/MobileTopNavigation.tsx +15 -18
  247. package/src/lib/components/SyntaxHighlight.tsx +81 -46
  248. package/src/lib/components/ThemeSwitch.tsx +26 -0
  249. package/src/lib/components/TopNavigation.tsx +27 -19
  250. package/src/lib/components/Zudoku.tsx +108 -0
  251. package/src/lib/components/context/ZudokuContext.ts +11 -16
  252. package/src/lib/components/context/ZudokuProvider.tsx +2 -2
  253. package/src/lib/components/index.ts +2 -3
  254. package/src/lib/components/navigation/Sidebar.tsx +3 -3
  255. package/src/lib/components/navigation/utils.ts +2 -2
  256. package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +3 -11
  257. package/src/lib/core/plugins.ts +12 -16
  258. package/src/lib/errors/ErrorAlert.tsx +2 -1
  259. package/src/lib/plugins/api-keys/index.tsx +9 -9
  260. package/src/lib/plugins/custom-pages/index.tsx +2 -2
  261. package/src/lib/plugins/markdown/index.tsx +2 -2
  262. package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -14
  263. package/src/lib/plugins/openapi/Endpoint.tsx +5 -10
  264. package/src/lib/plugins/openapi/OperationList.tsx +6 -40
  265. package/src/lib/plugins/openapi/Route.tsx +11 -12
  266. package/src/lib/plugins/openapi/Sidecar.tsx +72 -61
  267. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +140 -0
  268. package/src/lib/plugins/openapi/client/GraphQLContext.tsx +16 -0
  269. package/src/lib/plugins/openapi/client/createServer.ts +2 -0
  270. package/src/lib/plugins/openapi/client/useCreateQuery.ts +18 -0
  271. package/src/lib/plugins/openapi/client/worker.ts +38 -24
  272. package/src/lib/plugins/openapi/graphql/fragment-masking.ts +11 -18
  273. package/src/lib/plugins/openapi/graphql/gql.ts +7 -25
  274. package/src/lib/plugins/openapi/graphql/graphql.ts +351 -782
  275. package/src/lib/plugins/openapi/index.tsx +42 -67
  276. package/src/lib/plugins/openapi/schema/SchemaView.tsx +1 -1
  277. package/src/lib/plugins/openapi-worker.ts +11 -1
  278. package/src/lib/plugins/redirect/index.tsx +2 -2
  279. package/src/lib/plugins/search-inkeep/index.tsx +2 -2
  280. package/src/lib/ui/ActionButton.tsx +1 -1
  281. package/src/lib/util/useOnScreen.ts +32 -0
  282. package/dist/lib/components/DevPortal.js.map +0 -1
  283. package/dist/lib/components/context/ThemeContext.d.ts +0 -2
  284. package/dist/lib/components/context/ThemeContext.js +0 -7
  285. package/dist/lib/components/context/ThemeContext.js.map +0 -1
  286. package/dist/lib/components/context/ThemeProvider.d.ts +0 -4
  287. package/dist/lib/components/context/ThemeProvider.js +0 -23
  288. package/dist/lib/components/context/ThemeProvider.js.map +0 -1
  289. package/dist/lib/core/DevPortalContext.js.map +0 -1
  290. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +0 -9
  291. package/dist/lib/plugins/openapi/client/createMemoryClient.js +0 -54
  292. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +0 -1
  293. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +0 -10
  294. package/dist/lib/plugins/openapi/client/createWorkerClient.js +0 -62
  295. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +0 -1
  296. package/dist/lib/plugins/openapi/client/interfaces.d.ts +0 -4
  297. package/dist/lib/plugins/openapi/client/interfaces.js +0 -2
  298. package/dist/lib/plugins/openapi/client/interfaces.js.map +0 -1
  299. package/dist/lib/themeToggle.d.ts +0 -1
  300. package/dist/lib/themeToggle.js +0 -7
  301. package/dist/lib/themeToggle.js.map +0 -1
  302. package/dist/lib/util/createWaitForNotify.d.ts +0 -1
  303. package/dist/lib/util/createWaitForNotify.js +0 -15
  304. package/dist/lib/util/createWaitForNotify.js.map +0 -1
  305. package/dist/vite/plugin-html-transform.d.ts +0 -2
  306. package/dist/vite/plugin-html-transform.js +0 -15
  307. package/dist/vite/plugin-html-transform.js.map +0 -1
  308. package/lib/ClientOnly-CVN6leDu.js.map +0 -1
  309. package/lib/DeveloperHint-DHdLXGHA.js +0 -16
  310. package/lib/DeveloperHint-DHdLXGHA.js.map +0 -1
  311. package/lib/Markdown-BDcCAWwm.js +0 -18059
  312. package/lib/Markdown-BDcCAWwm.js.map +0 -1
  313. package/lib/OperationList-BjppA5yM.js +0 -621
  314. package/lib/OperationList-BjppA5yM.js.map +0 -1
  315. package/lib/Route-D_djzMv3.js +0 -13
  316. package/lib/Route-D_djzMv3.js.map +0 -1
  317. package/lib/Select-Bagt3Bme.js.map +0 -1
  318. package/lib/SidebarBadge-Bbt92M5K.js +0 -38
  319. package/lib/SidebarBadge-Bbt92M5K.js.map +0 -1
  320. package/lib/SlotletProvider-Da7eFgd2.js +0 -241
  321. package/lib/SlotletProvider-Da7eFgd2.js.map +0 -1
  322. package/lib/Spinner-ChOGyPls.js.map +0 -1
  323. package/lib/StaggeredRender-DDHSzQKE.js +0 -17
  324. package/lib/StaggeredRender-DDHSzQKE.js.map +0 -1
  325. package/lib/ZudokuContext-BKXGJTmu.js.map +0 -1
  326. package/lib/hook-sn0zMTkE.js.map +0 -1
  327. package/lib/index-CRo94sKK.js +0 -1783
  328. package/lib/index-CRo94sKK.js.map +0 -1
  329. package/lib/index-_gtpPhlu.js +0 -5877
  330. package/lib/index-_gtpPhlu.js.map +0 -1
  331. package/lib/state-CsuHT8ZO.js +0 -183
  332. package/lib/urql-core-35Qt_U4i.js +0 -1511
  333. package/lib/urql-core-35Qt_U4i.js.map +0 -1
  334. package/lib/useExposedProps-ChOIUaS4.js +0 -9
  335. package/src/lib/components/DevPortal.tsx +0 -111
  336. package/src/lib/components/context/ThemeContext.tsx +0 -8
  337. package/src/lib/components/context/ThemeProvider.tsx +0 -27
  338. package/src/lib/plugins/openapi/client/createMemoryClient.ts +0 -65
  339. package/src/lib/plugins/openapi/client/createWorkerClient.ts +0 -79
  340. package/src/lib/plugins/openapi/client/interfaces.ts +0 -5
  341. package/src/lib/themeToggle.ts +0 -7
  342. package/src/lib/util/createWaitForNotify.ts +0 -18
@@ -1,20 +1,19 @@
1
1
  import { Outlet } from "react-router-dom";
2
- import { Provider, Client as UrqlClient } from "urql";
2
+ import type { GraphQLClient } from "./client/GraphQLClient.js";
3
+ import { GraphQLProvider } from "./client/GraphQLContext.js";
3
4
  import { OasConfigProvider } from "./context.js";
4
5
  import { OasPluginConfig } from "./interfaces.js";
5
6
 
6
- export function OpenApiRoute({
7
+ export const OpenApiRoute = ({
7
8
  config,
8
9
  client,
9
10
  }: {
10
11
  config: OasPluginConfig;
11
- client: typeof UrqlClient;
12
- }) {
13
- return (
14
- <Provider value={client}>
15
- <OasConfigProvider value={{ config }}>
16
- <Outlet />
17
- </OasConfigProvider>
18
- </Provider>
19
- );
20
- }
12
+ client: GraphQLClient;
13
+ }) => (
14
+ <OasConfigProvider value={{ config }}>
15
+ <GraphQLProvider client={client}>
16
+ <Outlet />
17
+ </GraphQLProvider>
18
+ </OasConfigProvider>
19
+ );
@@ -1,12 +1,14 @@
1
+ import { useSuspenseQuery } from "@tanstack/react-query";
1
2
  import { HTTPSnippet } from "@zudoku/httpsnippet";
2
3
  import { Fragment, useMemo, useTransition } from "react";
3
4
  import { useSearchParams } from "react-router-dom";
4
- import { useQuery } from "urql";
5
5
  import { useSelectedServerStore } from "../../authentication/state.js";
6
6
  import { TextColorMap } from "../../components/navigation/SidebarBadge.js";
7
7
  import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
8
8
  import type { SchemaObject } from "../../oas/parser/index.js";
9
9
  import { cn } from "../../util/cn.js";
10
+ import { useOnScreen } from "../../util/useOnScreen.js";
11
+ import { useCreateQuery } from "./client/useCreateQuery.js";
10
12
  import { CollapsibleCode } from "./CollapsibleCode.js";
11
13
  import { ColorizedParam } from "./ColorizedParam.js";
12
14
  import { useOasConfig } from "./context.js";
@@ -74,8 +76,6 @@ export const GetServerQuery = graphql(/* GraphQL */ `
74
76
  }
75
77
  `);
76
78
 
77
- const context = { suspense: true };
78
-
79
79
  const methodToColor = {
80
80
  get: TextColorMap.green,
81
81
  post: TextColorMap.blue,
@@ -87,6 +87,20 @@ const methodToColor = {
87
87
  trace: TextColorMap.gray,
88
88
  };
89
89
 
90
+ const EXAMPLE_LANGUAGES = [
91
+ { value: "shell", label: "cURL" },
92
+ { value: "js", label: "JavaScript" },
93
+ { value: "python", label: "Python" },
94
+ { value: "java", label: "Java" },
95
+ { value: "go", label: "Go" },
96
+ { value: "csharp", label: "C#" },
97
+ { value: "kotlin", label: "Kotlin" },
98
+ { value: "objc", label: "Objective-C" },
99
+ { value: "php", label: "PHP" },
100
+ { value: "ruby", label: "Ruby" },
101
+ { value: "swift", label: "Swift" },
102
+ ];
103
+
90
104
  export const Sidecar = ({
91
105
  operation,
92
106
  selectedResponse,
@@ -96,12 +110,10 @@ export const Sidecar = ({
96
110
  selectedResponse?: string;
97
111
  onSelectResponse: (response: string) => void;
98
112
  }) => {
99
- const oasConfig = useOasConfig();
100
- const [result] = useQuery({
101
- query: GetServerQuery,
102
- variables: oasConfig,
103
- context,
104
- });
113
+ const { input, type } = useOasConfig();
114
+ const query = useCreateQuery(GetServerQuery, { input, type });
115
+ const result = useSuspenseQuery(query);
116
+
105
117
  const methodTextColor =
106
118
  methodToColor[
107
119
  operation.method.toLocaleLowerCase() as keyof typeof methodToColor
@@ -150,7 +162,7 @@ export const Sidecar = ({
150
162
  const snippet = new HTTPSnippet({
151
163
  method: operation.method.toLocaleUpperCase(),
152
164
  url:
153
- (selectedServer ?? result.data?.schema.url ?? "") +
165
+ (selectedServer ?? result.data.schema.url ?? "") +
154
166
  operation.path.replaceAll("{", ":").replaceAll("}", ""),
155
167
  postData: example
156
168
  ? {
@@ -168,15 +180,20 @@ export const Sidecar = ({
168
180
 
169
181
  return getConverted(snippet, selectedLang);
170
182
  }, [
171
- selectedServer,
172
- selectedLang,
183
+ requestBodyContent,
173
184
  operation.method,
174
185
  operation.path,
175
- requestBodyContent,
186
+ selectedServer,
187
+ result.data.schema.url,
188
+ selectedLang,
176
189
  ]);
190
+ const [ref, isOnScreen] = useOnScreen({ rootMargin: "200px 0px 200px 0px" });
177
191
 
178
192
  return (
179
- <aside className="flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4">
193
+ <aside
194
+ ref={ref}
195
+ className="flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4"
196
+ >
180
197
  <SidecarBox.Root>
181
198
  <SidecarBox.Head className="flex justify-between items-center flex-nowrap py-3 gap-2 text-xs">
182
199
  <span className="font-mono break-words">
@@ -186,57 +203,51 @@ export const Sidecar = ({
186
203
  &nbsp;
187
204
  {path}
188
205
  </span>
189
- <PlaygroundDialogWrapper
190
- server={result.data?.schema.url ?? ""}
191
- servers={
192
- result.data?.schema.servers.map((server) => server.url) ?? []
193
- }
194
- operation={operation}
195
- />
196
- </SidecarBox.Head>
197
- <SidecarBox.Body className="p-0">
198
- <CollapsibleCode>
199
- <SyntaxHighlight
200
- language={selectedLang}
201
- noBackground
202
- className="[--scrollbar-color:gray] text-xs max-h-[500px] p-2"
203
- code={code!}
206
+ {isOnScreen && (
207
+ <PlaygroundDialogWrapper
208
+ server={result.data.schema.url ?? ""}
209
+ servers={
210
+ result.data.schema.servers.map((server) => server.url) ?? []
211
+ }
212
+ operation={operation}
204
213
  />
205
- </CollapsibleCode>
206
- </SidecarBox.Body>
207
- <SidecarBox.Footer className="flex items-center text-xs gap-2 justify-end py-1">
208
- <span>Show example in</span>
209
- <SimpleSelect
210
- className="self-start max-w-[150px]"
211
- value={selectedLang}
212
- onChange={(e) => {
213
- startTransition(() => {
214
- setSearchParams((prev) => {
215
- prev.set("lang", e.target.value);
216
- return prev;
217
- });
218
- });
219
- }}
220
- options={[
221
- { value: "shell", label: "cURL" },
222
- { value: "js", label: "JavaScript" },
223
- { value: "python", label: "Python" },
224
- { value: "java", label: "Java" },
225
- { value: "go", label: "Go" },
226
- { value: "csharp", label: "C#" },
227
- { value: "kotlin", label: "Kotlin" },
228
- { value: "objc", label: "Objective-C" },
229
- { value: "php", label: "PHP" },
230
- { value: "ruby", label: "Ruby" },
231
- { value: "swift", label: "Swift" },
232
- ]}
233
- />
234
- </SidecarBox.Footer>
214
+ )}
215
+ </SidecarBox.Head>
216
+ {isOnScreen && (
217
+ <>
218
+ <SidecarBox.Body className="p-0">
219
+ <CollapsibleCode>
220
+ <SyntaxHighlight
221
+ language={selectedLang}
222
+ noBackground
223
+ className="[--scrollbar-color:gray] text-xs max-h-[500px] p-2"
224
+ code={code!}
225
+ />
226
+ </CollapsibleCode>
227
+ </SidecarBox.Body>
228
+ <SidecarBox.Footer className="flex items-center text-xs gap-2 justify-end py-1">
229
+ <span>Show example in</span>
230
+ <SimpleSelect
231
+ className="self-start max-w-[150px]"
232
+ value={selectedLang}
233
+ onChange={(e) => {
234
+ startTransition(() => {
235
+ setSearchParams((prev) => {
236
+ prev.set("lang", e.target.value);
237
+ return prev;
238
+ });
239
+ });
240
+ }}
241
+ options={EXAMPLE_LANGUAGES}
242
+ />
243
+ </SidecarBox.Footer>
244
+ </>
245
+ )}
235
246
  </SidecarBox.Root>
236
- {requestBodyContent && (
247
+ {isOnScreen && requestBodyContent && (
237
248
  <RequestBodySidecarBox content={requestBodyContent} />
238
249
  )}
239
- {operation.responses.length > 0 && (
250
+ {isOnScreen && operation.responses.length > 0 && (
240
251
  <ResponsesSidecarBox
241
252
  selectedResponse={selectedResponse}
242
253
  onSelectResponse={onSelectResponse}
@@ -0,0 +1,140 @@
1
+ import type { GraphQLError } from "graphql/error/index.js";
2
+ import { ulid } from "ulidx";
3
+ import { initializeWorker } from "zudoku/openapi-worker";
4
+ import { ZudokuError } from "../../../util/invariant.js";
5
+ import type { TypedDocumentString } from "../graphql/graphql.js";
6
+ import type { OpenApiPluginOptions } from "../index.js";
7
+ import type { LocalServer } from "./createServer.js";
8
+ import type { WorkerGraphQLMessage } from "./worker.js";
9
+
10
+ let localServerPromise: Promise<LocalServer> | undefined;
11
+ let worker: SharedWorker | undefined;
12
+
13
+ type GraphQLResponse<TResult> = {
14
+ errors?: GraphQLError[];
15
+ data: TResult;
16
+ };
17
+
18
+ const throwIfError = (response: GraphQLResponse<unknown>) => {
19
+ if (!response.errors?.[0]) return;
20
+
21
+ throw new ZudokuError(response.errors[0].message, {
22
+ developerHint:
23
+ "Check your configuration value `apis.type` and `apis.input` in the Zudoku config.",
24
+ });
25
+ };
26
+
27
+ export class GraphQLClient {
28
+ readonly #mode: "remote" | "in-memory" | "worker";
29
+ #pendingRequests = new Map<string, (value: any) => void>();
30
+ #port: MessagePort | undefined;
31
+
32
+ constructor(private config: OpenApiPluginOptions) {
33
+ if (config.server) {
34
+ this.#mode = "remote";
35
+ } else if (config.inMemory || typeof SharedWorker === "undefined") {
36
+ this.#mode = "in-memory";
37
+ } else {
38
+ this.#mode = "worker";
39
+ }
40
+ }
41
+
42
+ #initializeLocalServer = () =>
43
+ import("./createServer.js").then((m) => m.createServer());
44
+
45
+ fetch = async <TResult, TVariables>(
46
+ query: TypedDocumentString<TResult, TVariables>,
47
+ ...[variables]: TVariables extends Record<string, never> ? [] : [TVariables]
48
+ ) => {
49
+ const operationName = query.match(/query (\w+)/)?.[1];
50
+ const body = JSON.stringify({ query, variables, operationName });
51
+
52
+ switch (this.#mode) {
53
+ case "remote": {
54
+ const response = await fetch(this.config.server!, {
55
+ method: "POST",
56
+ body,
57
+ headers: { "Content-Type": "application/json" },
58
+ });
59
+
60
+ if (!response.ok) {
61
+ throw new Error("Network response was not ok");
62
+ }
63
+
64
+ const result = (await response.json()) as GraphQLResponse<TResult>;
65
+ throwIfError(result);
66
+
67
+ return result.data;
68
+ }
69
+
70
+ case "in-memory": {
71
+ if (!localServerPromise) {
72
+ localServerPromise = this.#initializeLocalServer();
73
+ }
74
+
75
+ const localServer = await localServerPromise;
76
+ if (!localServer) throw new Error("Local server not initialized");
77
+
78
+ const response = await localServer.fetch(
79
+ new Request("http://localhost/graphql", {
80
+ method: "POST",
81
+ body,
82
+ headers: { "Content-Type": "application/json" },
83
+ }),
84
+ );
85
+
86
+ if (!response.ok) {
87
+ throw new Error("Network response was not ok");
88
+ }
89
+
90
+ const result = (await response.json()) as GraphQLResponse<TResult>;
91
+ throwIfError(result);
92
+
93
+ return result.data;
94
+ }
95
+
96
+ case "worker": {
97
+ if (!worker) {
98
+ worker = initializeWorker();
99
+ }
100
+
101
+ if (!this.#port) {
102
+ const channel = new MessageChannel();
103
+
104
+ worker.port.postMessage({ port: channel.port2 }, [channel.port2]);
105
+
106
+ this.#port = channel.port1;
107
+
108
+ this.#port.onmessage = (e: MessageEvent<WorkerGraphQLMessage>) => {
109
+ const { id, body } = e.data;
110
+ const resolve = this.#pendingRequests.get(id);
111
+ if (resolve) {
112
+ const result = JSON.parse(body);
113
+ resolve(result);
114
+ this.#pendingRequests.delete(id);
115
+ } else {
116
+ // eslint-disable-next-line no-console
117
+ console.error(`No pending request found for id: ${id}`);
118
+ }
119
+ };
120
+
121
+ this.#port.start();
122
+ }
123
+
124
+ const id = ulid();
125
+
126
+ const resultPromise = new Promise<GraphQLResponse<TResult>>(
127
+ (resolve) => {
128
+ this.#pendingRequests.set(id, resolve);
129
+ this.#port!.postMessage({ id, body } as WorkerGraphQLMessage);
130
+ },
131
+ );
132
+
133
+ const result = await resultPromise;
134
+ throwIfError(result);
135
+
136
+ return result.data;
137
+ }
138
+ }
139
+ };
140
+ }
@@ -0,0 +1,16 @@
1
+ import { createContext, type ReactNode } from "react";
2
+ import { GraphQLClient } from "./GraphQLClient.js";
3
+
4
+ export const GraphQLContext = createContext<GraphQLClient | undefined>(
5
+ undefined,
6
+ );
7
+
8
+ export const GraphQLProvider = ({
9
+ children,
10
+ client,
11
+ }: {
12
+ children: ReactNode;
13
+ client: GraphQLClient;
14
+ }) => (
15
+ <GraphQLContext.Provider value={client}>{children}</GraphQLContext.Provider>
16
+ );
@@ -31,3 +31,5 @@ export const createServer = () =>
31
31
  }),
32
32
  ],
33
33
  });
34
+
35
+ export type LocalServer = ReturnType<typeof createServer>;
@@ -0,0 +1,18 @@
1
+ import { useContext } from "react";
2
+ import type { TypedDocumentString } from "../graphql/graphql.js";
3
+ import { GraphQLContext } from "./GraphQLContext.js";
4
+
5
+ export const useCreateQuery = <TResult, TVariables>(
6
+ query: TypedDocumentString<TResult, TVariables>,
7
+ ...variables: TVariables extends Record<string, never> ? [] : [TVariables]
8
+ ) => {
9
+ const graphQLClient = useContext(GraphQLContext);
10
+ if (graphQLClient === undefined) {
11
+ throw new Error("useGraphQL must be used within a GraphQLProvider");
12
+ }
13
+
14
+ return {
15
+ queryFn: () => graphQLClient.fetch(query, ...variables),
16
+ queryKey: [query, variables[0]],
17
+ } as const;
18
+ };
@@ -1,30 +1,44 @@
1
1
  import { createServer } from "./createServer.js";
2
- import { type WorkerGraphQLMessage } from "./createWorkerClient.js";
2
+
3
+ export type WorkerGraphQLMessage = { id: string; body: string };
3
4
 
4
5
  const localServer = createServer();
5
6
 
6
7
  const worker = self as unknown as SharedWorkerGlobalScope;
7
8
 
8
- worker.addEventListener(
9
- "connect",
10
- function (event: MessageEvent<{ id: string; body: string }>) {
11
- const port = event.ports[0];
12
-
13
- port!.onmessage = async function (e) {
14
- const response = await localServer.fetch(
15
- new Request("/__z/graphql", {
16
- method: "POST",
17
- body: e.data.body,
18
- headers: {
19
- "Content-Type": "application/json",
20
- },
21
- }),
22
- );
23
-
24
- port!.postMessage({
25
- id: e.data.id,
26
- body: await response.text(),
27
- } satisfies WorkerGraphQLMessage);
28
- };
29
- },
30
- );
9
+ worker.addEventListener("connect", (event) => {
10
+ const mainPort = event.ports[0];
11
+
12
+ mainPort!.onmessage = (e) => {
13
+ if (e.data.port) {
14
+ const clientPort = e.data.port as MessagePort;
15
+
16
+ clientPort.onmessage = async (
17
+ event: MessageEvent<{ id: string; body: string }>,
18
+ ) => {
19
+ const { id, body } = event.data;
20
+
21
+ const response = await localServer.fetch(
22
+ new Request("/__z/graphql", {
23
+ method: "POST",
24
+ body,
25
+ headers: {
26
+ "Content-Type": "application/json",
27
+ },
28
+ }),
29
+ );
30
+
31
+ const responseBody = await response.text();
32
+
33
+ clientPort.postMessage({
34
+ id,
35
+ body: responseBody,
36
+ } as WorkerGraphQLMessage);
37
+ };
38
+
39
+ clientPort.start();
40
+ }
41
+ };
42
+
43
+ mainPort!.start();
44
+ });
@@ -2,10 +2,8 @@
2
2
  import type {
3
3
  DocumentTypeDecoration,
4
4
  ResultOf,
5
- TypedDocumentNode,
6
5
  } from "@graphql-typed-document-node/core";
7
- import type { FragmentDefinitionNode } from "graphql";
8
- import type { Incremental } from "./graphql.js";
6
+ import type { Incremental, TypedDocumentString } from "./graphql.js";
9
7
 
10
8
  export type FragmentType<
11
9
  TDocumentType extends DocumentTypeDecoration<any, any>,
@@ -86,26 +84,21 @@ export function makeFragmentData<
86
84
  return data as FragmentType<F>;
87
85
  }
88
86
  export function isFragmentReady<TQuery, TFrag>(
89
- queryNode: DocumentTypeDecoration<TQuery, any>,
90
- fragmentNode: TypedDocumentNode<TFrag>,
87
+ queryNode: TypedDocumentString<TQuery, any>,
88
+ fragmentNode: TypedDocumentString<TFrag, any>,
91
89
  data:
92
- | FragmentType<TypedDocumentNode<Incremental<TFrag>, any>>
90
+ | FragmentType<TypedDocumentString<Incremental<TFrag>, any>>
93
91
  | null
94
92
  | undefined,
95
93
  ): data is FragmentType<typeof fragmentNode> {
96
- const deferredFields = (
97
- queryNode as {
98
- __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> };
99
- }
100
- ).__meta__?.deferredFields;
94
+ const deferredFields = queryNode.__meta__?.deferredFields as Record<
95
+ string,
96
+ (keyof TFrag)[]
97
+ >;
98
+ const fragName = fragmentNode.__meta__?.fragmentName as string | undefined;
101
99
 
102
- if (!deferredFields) return true;
100
+ if (!deferredFields || !fragName) return true;
103
101
 
104
- const fragDef = fragmentNode.definitions[0] as
105
- | FragmentDefinitionNode
106
- | undefined;
107
- const fragName = fragDef?.name?.value;
108
-
109
- const fields = (fragName && deferredFields[fragName]) || [];
102
+ const fields = deferredFields[fragName] ?? [];
110
103
  return fields.length > 0 && fields.every((field) => data && field in data);
111
104
  }
@@ -1,5 +1,4 @@
1
1
  /* eslint-disable */
2
- import type { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core";
3
2
  import * as types from "./graphql.js";
4
3
 
5
4
  /**
@@ -22,58 +21,41 @@ const documents = {
22
21
  types.AllOperationsDocument,
23
22
  "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n":
24
23
  types.GetServerQueryDocument,
25
- "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n":
24
+ "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n":
26
25
  types.GetCategoriesDocument,
27
26
  };
28
27
 
29
- /**
30
- * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
31
- *
32
- *
33
- * @example
34
- * ```ts
35
- * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);
36
- * ```
37
- *
38
- * The query argument is unknown!
39
- * Please regenerate the types.
40
- */
41
- export function graphql(source: string): unknown;
42
-
43
28
  /**
44
29
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
45
30
  */
46
31
  export function graphql(
47
32
  source: "\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n",
48
- ): (typeof documents)["\n query ServersQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n"];
33
+ ): typeof import("./graphql.js").ServersQueryDocument;
49
34
  /**
50
35
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
51
36
  */
52
37
  export function graphql(
53
38
  source: "\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n examples {\n name\n description\n externalValue\n value\n summary\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n examples {\n name\n description\n externalValue\n value\n summary\n }\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n",
54
- ): (typeof documents)["\n fragment OperationsFragment on OperationItem {\n slug\n summary\n method\n description\n operationId\n contentTypes\n path\n parameters {\n name\n in\n description\n required\n schema\n style\n examples {\n name\n description\n externalValue\n value\n summary\n }\n }\n requestBody {\n content {\n mediaType\n encoding {\n name\n }\n examples {\n name\n description\n externalValue\n value\n summary\n }\n schema\n }\n description\n required\n }\n responses {\n statusCode\n links\n description\n content {\n examples {\n name\n description\n externalValue\n value\n summary\n }\n mediaType\n encoding {\n name\n }\n schema\n }\n }\n }\n"];
39
+ ): typeof import("./graphql.js").OperationsFragmentFragmentDoc;
55
40
  /**
56
41
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
57
42
  */
58
43
  export function graphql(
59
44
  source: "\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n",
60
- ): (typeof documents)["\n query AllOperations($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n description\n title\n url\n version\n tags {\n name\n description\n operations {\n slug\n ...OperationsFragment\n }\n }\n }\n }\n"];
45
+ ): typeof import("./graphql.js").AllOperationsDocument;
61
46
  /**
62
47
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
63
48
  */
64
49
  export function graphql(
65
50
  source: "\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n",
66
- ): (typeof documents)["\n query getServerQuery($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n servers {\n url\n }\n }\n }\n"];
51
+ ): typeof import("./graphql.js").GetServerQueryDocument;
67
52
  /**
68
53
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
69
54
  */
70
55
  export function graphql(
71
- source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n",
72
- ): (typeof documents)["\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n"];
56
+ source: "\n query GetCategories($input: JSON!, $type: SchemaType!) {\n schema(input: $input, type: $type) {\n url\n tags {\n __typename\n name\n operations {\n __typename\n slug\n deprecated\n method\n summary\n operationId\n path\n }\n }\n }\n }\n",
57
+ ): typeof import("./graphql.js").GetCategoriesDocument;
73
58
 
74
59
  export function graphql(source: string) {
75
60
  return (documents as any)[source] ?? {};
76
61
  }
77
-
78
- export type DocumentType<TDocumentNode extends DocumentNode<any, any>> =
79
- TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;